diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 533c2f9151..4317128869 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) @@ -670,7 +695,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](heap/heap.d.ts) [heap](https://github.com/qiao/heap.js) by [Ryan McNamara](https://github.com/ryan10132) * [:link:](heatmap.js/heatmap.d.ts) [heatmap.js](https://github.com/pa7/heatmap.js) by [Yang Guan](https://github.com/lookuptable) * [:link:](hellojs/hellojs.d.ts) [hello.js](http://adodson.com/hello.js) by [Pavel Zika](https://github.com/PavelPZ) -* [:link:](helmet/helmet.d.ts) [helmet](https://github.com/helmetjs/helmet) by [Cyril Schumacher](https://github.com/cyrilschumacher) +* [:link:](helmet/helmet.d.ts) [helmet](https://github.com/helmetjs/helmet) by [Cyril Schumacher](https://github.com/cyrilschumacher), [Evan Hahn](https://github.com/EvanHahn) * [:link:](highcharts/highcharts.d.ts) [Highcharts](http://www.highcharts.com) by [Damiano Gambarotto](http://github.com/damianog), [Dan Lewi Harkestad](http://github.com/baltie) * [:link:](highcharts-ng/highcharts-ng.d.ts) [highcharts-ng](https://github.com/pablojim/highcharts-ng) by [Scott Hatcher](https://github.com/scatcher) * [:link:](highland/highland.d.ts) [Highland](http://highlandjs.org) by [Bart van der Schoor](https://github.com/Bartvds) @@ -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/CybozuLabs-md5/CybozuLabs-md5-tests.ts b/CybozuLabs-md5/CybozuLabs-md5-tests.ts new file mode 100644 index 0000000000..16dd05b059 --- /dev/null +++ b/CybozuLabs-md5/CybozuLabs-md5-tests.ts @@ -0,0 +1,9 @@ +/// + +var hash: string; +hash = CybozuLabs.MD5.calc("abc"); +hash = CybozuLabs.MD5.calc("abc", CybozuLabs.MD5.BY_ASCII); +hash = CybozuLabs.MD5.calc("abc", CybozuLabs.MD5.BY_UTF16); + +var version: string; +version = CybozuLabs.MD5.VERSION; \ No newline at end of file diff --git a/CybozuLabs-md5/CybozuLabs-md5.d.ts b/CybozuLabs-md5/CybozuLabs-md5.d.ts new file mode 100644 index 0000000000..6e1f31739d --- /dev/null +++ b/CybozuLabs-md5/CybozuLabs-md5.d.ts @@ -0,0 +1,11 @@ +// Type definitions for CybozuLabs.MD5 +// Project: http://labs.cybozu.co.jp/blog/mitsunari/2007/07/md5js_1.html +// Definitions by: MIZUNE Pine +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare namespace CybozuLabs.MD5 { + var VERSION: string; + var BY_ASCII: number; + var BY_UTF16: number; + function calc(str: string, option?: number): string; +} diff --git a/amcharts/AmCharts.d.ts b/amcharts/AmCharts.d.ts index 02d2c540a0..543467feac 100644 --- a/amcharts/AmCharts.d.ts +++ b/amcharts/AmCharts.d.ts @@ -36,7 +36,7 @@ declare namespace AmCharts { chart.dataProvider = chartData; chart.write("chartdiv"); */ - class AmPieChart { + class AmPieChart extends AmChart { /** Name of the field in chart's dataProvider which holds slice's alpha. */ alphaField: string; /** Pie lean angle (for 3D effect). Valid range is 0 - 90. */ @@ -187,19 +187,6 @@ declare namespace AmCharts { rollOverSlice(index: number); /** Shows slice. index - the number of a slice or Slice object. */ showSlice(index: number); - - /** Adds event listener of the type "clickSlice" or "pullInSlice" or "pullOutSlice" to the object. - @param type Always "clickSlice" or "pullInSlice" or "pullOutSlice". - @param handler - If the type is "clickSlice", dispatched when user clicks on a slice. - If the type is "pullInSlice", dispatched when user clicks on a slice and the slice is pulled-in. - If the type is "pullOutSlice", dispatched when user clicks on a slice and the slice is pulled-out. - If the type is "rollOutSlice", dispatched when user rolls-out of the slice. - If the type is "rollOverSlice", dispatched when user rolls-over the slice. - */ - addListener(type: string, handler: (e: {/** Always "rollOverSlice". */ - type: string; dataItem: Slice; - }) => void ); } /** AmRadarChart is the class you have to use for radar and polar chart types. @@ -803,6 +790,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 +1230,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 +1244,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 +1490,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-deferred-bootstrap/angular-deferred-bootstrap-tests.ts b/angular-deferred-bootstrap/angular-deferred-bootstrap-tests.ts new file mode 100644 index 0000000000..d8a07444d1 --- /dev/null +++ b/angular-deferred-bootstrap/angular-deferred-bootstrap-tests.ts @@ -0,0 +1,11 @@ +/// +/// + +deferredBootstrapper.bootstrap( + { + element: window.document, + module: "myApp", + resolve: { + configuration: ["$http", ($http: ng.IHttpService) => $http.get("config.json")] + } + }); diff --git a/angular-deferred-bootstrap/angular-deferred-bootstrap.d.ts b/angular-deferred-bootstrap/angular-deferred-bootstrap.d.ts new file mode 100644 index 0000000000..a76226761c --- /dev/null +++ b/angular-deferred-bootstrap/angular-deferred-bootstrap.d.ts @@ -0,0 +1,20 @@ +// Type definitions for angular-deferred-bootstrap v0.1.9 +// Project: https://github.com/philippd/angular-deferred-bootstrap +// Definitions by: Markus Wagner +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare var deferredBootstrapper: angular.IDeferredBootstrapperStatic; + +declare module angular { + interface IDeferredBootstrapperStatic { + bootstrap(configParam: IConfigParam): ng.IPromise + } + + interface IConfigParam { + element?: Node, + module?: string, + resolve: any + } +} \ No newline at end of file diff --git a/angular-jwt/angular-jwt-tests.ts b/angular-jwt/angular-jwt-tests.ts index 7f66f26114..3a6b7d6bf1 100644 --- a/angular-jwt/angular-jwt-tests.ts +++ b/angular-jwt/angular-jwt-tests.ts @@ -3,14 +3,14 @@ var app = angular.module("angular-jwt-tests", ["angular-jwt"]); -var $jwtHelper: angular.jwt.IJwtHelper; +var $jwtHelper: ng.jwt.IJwtHelper; var expToken = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3NhbXBsZXMuYXV0aDAuY29tLyIsInN1YiI6ImZhY2Vib29rfDEwMTU0Mjg3MDI3NTEwMzAyIiwiYXVkIjoiQlVJSlNXOXg2MHNJSEJ3OEtkOUVtQ2JqOGVESUZ4REMiLCJleHAiOjE0MTIyMzQ3MzAsImlhdCI6MTQxMjE5ODczMH0.7M5sAV50fF1-_h9qVbdSgqAnXVF7mz3I6RjS6JiH0H8'; var tokenPayload = $jwtHelper.decodeToken(expToken); var date = $jwtHelper.getTokenExpirationDate(expToken); var bool = $jwtHelper.isTokenExpired(expToken); -var $jwtInterceptor: angular.jwt.IJwtInterceptor; +var $jwtInterceptor: ng.jwt.IJwtInterceptor; $jwtInterceptor.tokenGetter = () => { return expToken; diff --git a/angular-jwt/angular-jwt.d.ts b/angular-jwt/angular-jwt.d.ts index d8c719e2ef..eb02cf24df 100644 --- a/angular-jwt/angular-jwt.d.ts +++ b/angular-jwt/angular-jwt.d.ts @@ -8,14 +8,14 @@ declare namespace angular.jwt { interface JwtToken { - iss: string; - sub: string; - aud: string; - exp: number; - nbf: number; - iat: number; - jti: string; - unique_name: string; + iss?: string; + sub?: string; + aud?: string; + exp?: number; + nbf?: number; + iat?: number; + jti?: string; + unique_name?: string; } interface IJwtHelper { diff --git a/angular-material/angular-material-tests.ts b/angular-material/angular-material-tests.ts index 3c70dd27e8..cecaf07e67 100644 --- a/angular-material/angular-material-tests.ts +++ b/angular-material/angular-material-tests.ts @@ -55,6 +55,18 @@ myApp.controller('DialogController', ($scope: ng.IScope, $mdDialog: ng.material. $scope['confirmDialog'] = () => { $mdDialog.show($mdDialog.confirm().htmlContent('Confirm!')); }; + $scope['promptDialog'] = () => { + $mdDialog.show($mdDialog.prompt().textContent('Prompt!')); + }; + $scope['promptDialog'] = () => { + $mdDialog.show($mdDialog.prompt().htmlContent('Prompt!')); + }; + $scope['promptDialog'] = () => { + $mdDialog.show($mdDialog.prompt().cancel('Prompt "Cancel" button text')); + }; + $scope['promptDialog'] = () => { + $mdDialog.show($mdDialog.prompt().placeholder('Prompt input placeholder text')); + }; $scope['hideDialog'] = $mdDialog.hide.bind($mdDialog, 'hide'); $scope['cancelDialog'] = $mdDialog.cancel.bind($mdDialog, 'cancel'); }); diff --git a/angular-material/angular-material.d.ts b/angular-material/angular-material.d.ts index 6ba65473ed..bb144d15d4 100644 --- a/angular-material/angular-material.d.ts +++ b/angular-material/angular-material.d.ts @@ -59,6 +59,11 @@ declare namespace angular.material { interface IConfirmDialog extends IPresetDialog { cancel(cancel: string): IConfirmDialog; } + + interface IPromptDialog extends IPresetDialog { + cancel(cancel: string): IPromptDialog; + placeholder(placeholder: string): IPromptDialog; + } interface IDialogOptions { templateUrl?: string; @@ -90,6 +95,7 @@ declare namespace angular.material { show(dialog: IDialogOptions|IAlertDialog|IConfirmDialog): angular.IPromise; confirm(): IConfirmDialog; alert(): IAlertDialog; + prompt(): IPromptDialog; hide(response?: any): angular.IPromise; cancel(response?: any): void; } @@ -250,4 +256,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-2.3.1-tests.ts b/angular-permission/angular-permission-2.3.1-tests.ts new file mode 100644 index 0000000000..3753ba9d51 --- /dev/null +++ b/angular-permission/angular-permission-2.3.1-tests.ts @@ -0,0 +1,92 @@ +/// + +import permission = angular.permission; + +angular + .module('fooModule', ['permission', 'user']) + .run(function (PermissionStore: permission.PermissionStore, User: any) { + // Define anonymous permission + PermissionStore + .definePermission('anonymous', function (stateParams) { + // If the returned value is *truthy* then the user has the permission, otherwise they don't + if (!User) { + return true; // Is anonymous + } + return false; + }); + }); + + interface BackendUserService { + checkSession(): angular.IPromise; + getAccessLevel(): angular.IPromise<{accessLevel: string}>; + hasPermissionDefinition(permission: string) : angular.IPromise; + } + + angular.module('barModule', ['permission', 'user']) + .run(function (PermissionStore: permission.PermissionStore, User: BackendUserService, $q: angular.IQService) { + PermissionStore + // Define user permission calling back-end + .definePermission('user', function (stateParams) { + // This time we will return a promise + // If the promise *resolves* then the user has the permission, if it *rejects* (you guessed it) + + // Let's assume this returns a promise that resolves or rejects if session is active + return User.checkSession(); + }); + + PermissionStore + // A different example for admin + .definePermission('admin', function (stateParams) { + var deferred = $q.defer(); + + User.getAccessLevel() + .then(function (data) { + if (data.accessLevel === 'admin') { + deferred.resolve(); + } else { + deferred.reject(); + } + }) + .catch(function () { + // Error with request + deferred.reject(); + }); + + return deferred.promise; + }); + + let arrayOfPermissionNames = ['p1', 'p2']; + PermissionStore.defineManyPermissions(arrayOfPermissionNames, function (stateParams: angular.ui.IStateParamsService, permissionName: string) { + return User.hasPermissionDefinition(permissionName); + }); + + PermissionStore.clearStore(); + + PermissionStore.removePermissionDefinition('user'); + + let permissions: Array = PermissionStore.getStore(); + + + }); + +angular + .module('fooModule', ['permission', 'user']) + .run(function (RoleStore: permission.RoleStore, User: any) { + RoleStore + // Permission array validated role + // Library will internally validate if 'user' and 'editor' permissions are valid when checking if role is valid + .defineRole('admin', ['user', 'editor']); + + RoleStore + // Server side validated role + .defineRole('accountant', [], function (stateParams) { + // Let's assume that we are making a request to server here and return response as promise + return User.hasRole('accountant'); + }); + + RoleStore.clearStore(); + + RoleStore.removeRoleDefinition('user'); + + let roles: Array = RoleStore.getStore(); + }); diff --git a/angular-permission/angular-permission-2.3.1.d.ts b/angular-permission/angular-permission-2.3.1.d.ts new file mode 100644 index 0000000000..afe32ce875 --- /dev/null +++ b/angular-permission/angular-permission-2.3.1.d.ts @@ -0,0 +1,165 @@ +// Type definitions for angular-permission 2.3.1 +// Project: https://github.com/Narzerus/angular-permission +// Definitions by: Voislav Mishevski +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// +/// + +declare namespace angular.permission { + + export interface PermissionStore { + /** + * Allows to define permission on application configuration + * @method + * + * @param permissionName {String} Name of defined permission + * @param validationFunction {Function} Function used to validate if permission is valid + */ + definePermission( + name: string, + validationFunction: (stateParams?: angular.ui.IStateParamsService, permission?: string) => boolean | angular.IPromise + ): void; + + /** + * Allows to define set of permissionNames with shared validation function on application configuration + * @method + * @throws {TypeError} + * + * @param permissionNames {Array} Set of permission names + * @param validationFunction {Function} Function used to validate if permission is valid + */ + defineManyPermissions( + permissions: string[], + validationFunction: (stateParams?: angular.ui.IStateParamsService, permission?: string) => boolean | angular.IPromise + ): void; + + clearStore(): void; + + /** + * Deletes permission + * @method + * + * @param permissionName {String} Name of defined permission + */ + removePermissionDefinition(permission: string): void; + + /** + * Checks if permission exists + * @method + * + * @param permissionName {String} Name of defined permission + * @returns {Boolean} + */ + hasPermissionDefinition(permissionName: string): boolean; + + /** + * Returns all permissions + * @method + * + * @returns {Object} Permissions collection + */ + getStore(): Permission[]; + } + + export interface RoleStore { + /** + * Allows to define role + * @method + * + * @param roleName {String} Name of defined role + * @param permissions {Array} Set of permission names + * @param [validationFunction] {Function} Function used to validate if permissions in role are valid + */ + defineRole( + role: string, + permissions: Array, + validationFunction: RoleValidationFunction + ): void; + + /** + * Allows to define role + * @method + * + * @param roleName {String} Name of defined role + * @param permissions {Array} Set of permission names + */ + defineRole(role: string, permissions: Array): void; + + /** + * Checks if role is defined in store + * @method + * + * @param roleName {String} Name of role + * @returns {Boolean} + */ + hasRoleDefinition(role: string): boolean; + + /** + * Returns role definition object by it's name + * @method + * + * @returns {permission.Role} Role definition object + */ + getRoleDefinition(roleName: string): Role; + + /** + * Removes all role definitions + * @method + */ + clearStore(): void; + + /** + * Deletes role from store + * @method + * + * @param roleName {String} Name of defined permission + */ + removeRoleDefinition(roleName: string): void; + + /** + * Returns all role definitions + * @method + * + * @returns {Object} Defined roles collection + */ + getStore(): Role[]; + } + + export interface Role { + roleName: string; + permissionNames: string[]; + validationFunction?: RoleValidationFunction; + } + + export interface Permission { + permissionName: string; + validationFunction?: PermissionValidationFunction; + } + + interface RoleValidationFunction { + (stateParams?: angular.ui.IStateParamsService, permission?: string): boolean | angular.IPromise; + } + + interface PermissionValidationFunction { + (stateParams?: angular.ui.IStateParamsService, permission?: string): boolean | angular.IPromise; + } + + export interface IPermissionState extends angular.ui.IState { + data?: any | DataWithPermissions; + } + + export interface DataWithPermissions { + permissions?: { + only?: (() => void) | Array | angular.IPromise; + except?: (() => void) | Array | angular.IPromise; + redirectTo: string | (() => string) | (() => PermissionRedirectConfigation) | {[index: string]: PermissionRedirectConfigation} + }; + } + + export interface PermissionRedirectConfigation { + state: string; + params?: {}; + options?: angular.ui.IStateOptions; + } +} diff --git a/angular-permission/angular-permission-tests.ts b/angular-permission/angular-permission-tests.ts index d14f7ac7e3..cc9cd7c367 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']) @@ -36,7 +36,7 @@ angular PermissionStore // A different example for admin - .definePermission('admin', function (stateParams) { + .definePermission('admin', function (permission: string, stateParams: angular.permission.TransitionProperties) { var deferred = $q.defer(); User.getAccessLevel() @@ -56,7 +56,7 @@ angular }); let arrayOfPermissionNames = ['p1', 'p2']; - PermissionStore.defineManyPermissions(arrayOfPermissionNames, function (stateParams: angular.ui.IStateParamsService, permissionName: string) { + PermissionStore.defineManyPermissions(arrayOfPermissionNames, function (permissionName: string, stateParams: angular.permission.TransitionProperties) { return User.hasPermissionDefinition(permissionName); }); @@ -79,7 +79,7 @@ angular RoleStore // Server side validated role - .defineRole('accountant', [], function (stateParams) { + .defineRole('accountant', [], function (permission, stateParams) { // Let's assume that we are making a request to server here and return response as promise return User.hasRole('accountant'); }); diff --git a/angular-permission/angular-permission.d.ts b/angular-permission/angular-permission.d.ts index 0a1a28188f..fecbafb29b 100644 --- a/angular-permission/angular-permission.d.ts +++ b/angular-permission/angular-permission.d.ts @@ -1,4 +1,4 @@ -// Type definitions for angular-permission 2.3.1 +// Type definitions for angular-permission 2.3.6 // Project: https://github.com/Narzerus/angular-permission // Definitions by: Voislav Mishevski // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -6,7 +6,18 @@ /// /// -declare module 'angular-permission' { +declare namespace angular.permission { + /** + * Used as optional parameter provided on definitions of permissions and roles + */ + export interface TransitionProperties { + fromState?: angular.ui.IState; + fromParams?: angular.ui.IStateParamsService; + toState?: angular.ui.IState; + toParams?: angular.ui.IStateParamsService; + options?: angular.ui.IStateOptions; + } + export interface PermissionStore { /** * Allows to define permission on application configuration @@ -17,7 +28,7 @@ declare module 'angular-permission' { */ definePermission( name: string, - validationFunction: (stateParams?: angular.ui.IStateParamsService, permission?: string) => boolean | angular.IPromise + validationFunction: (permission?: string, transitionProperties?: TransitionProperties) => boolean | angular.IPromise ): void; /** @@ -30,7 +41,7 @@ declare module 'angular-permission' { */ defineManyPermissions( permissions: string[], - validationFunction: (stateParams?: angular.ui.IStateParamsService, permission?: string) => boolean | angular.IPromise + validationFunction: (permission?: string, transitionProperties?: TransitionProperties) => boolean | angular.IPromise ): void; clearStore(): void; @@ -137,11 +148,11 @@ declare module 'angular-permission' { } interface RoleValidationFunction { - (stateParams?: angular.ui.IStateParamsService, permission?: string): boolean | angular.IPromise; + (permission?: string, transitionProperties?: TransitionProperties): boolean | angular.IPromise; } interface PermissionValidationFunction { - (stateParams?: angular.ui.IStateParamsService, permission?: string): boolean | angular.IPromise; + (permission?: string, transitionProperties?: TransitionProperties): boolean | angular.IPromise; } export interface IPermissionState extends angular.ui.IState { diff --git a/angular-protractor/angular-protractor.d.ts b/angular-protractor/angular-protractor.d.ts index fa2928c136..d33eeddace 100644 --- a/angular-protractor/angular-protractor.d.ts +++ b/angular-protractor/angular-protractor.d.ts @@ -1683,7 +1683,7 @@ declare namespace protractor { * @return {!webdriver.promise.Promise} A promise that will resolve to the * scripts return value. */ - waitForAngular(): webdriver.promise.Promise; + waitForAngular(): webdriver.promise.Promise; /** * Add a module to load before Angular whenever Protractor.get is called. diff --git a/angular-translate/angular-translate-tests.ts b/angular-translate/angular-translate-tests.ts index 8ef1ab2e39..4aac8b4b34 100644 --- a/angular-translate/angular-translate-tests.ts +++ b/angular-translate/angular-translate-tests.ts @@ -35,7 +35,11 @@ interface Scope extends ng.IScope { app.controller('Ctrl', ($scope: Scope, $translate: angular.translate.ITranslateService) => { $scope['changeLanguage'] = function (key: any) { - $translate.use(key); + $translate.onReady().then(() => { + if($translate.isReady()) { + $translate.use(key); + } + }); }; }).run(($filter: ng.IFilterService) => { var x: string; diff --git a/angular-translate/angular-translate.d.ts b/angular-translate/angular-translate.d.ts index 9d9eeb98a1..045f2f5994 100644 --- a/angular-translate/angular-translate.d.ts +++ b/angular-translate/angular-translate.d.ts @@ -66,6 +66,9 @@ declare namespace angular.translate { useFallbackLanguage(langKey?: string): void; versionInfo(): string; loaderCache(): any; + isReady(): boolean; + onReady(): angular.IPromise; + resolveClientLocale():string; } interface ITranslateProvider extends angular.IServiceProvider { @@ -109,6 +112,7 @@ declare namespace angular.translate { registerAvailableLanguageKeys(): string[]; registerAvailableLanguageKeys(languageKeys: string[], aliases?: ILanguageKeyAlias): ITranslateProvider; useLoaderCache(cache?: any): ITranslateProvider; + resolveClientLocale():string; } } diff --git a/angular-ui-bootstrap/angular-ui-bootstrap-tests.ts b/angular-ui-bootstrap/angular-ui-bootstrap-tests.ts index 7851d2da37..d92c90bc60 100644 --- a/angular-ui-bootstrap/angular-ui-bootstrap-tests.ts +++ b/angular-ui-bootstrap/angular-ui-bootstrap-tests.ts @@ -181,6 +181,10 @@ testApp.controller('TestCtrl', ( $log.log('modal rendered'); }); + modalInstance.closed.then(()=> { + $log.log('modal closed'); + }); + modalInstance.result.then((closeResult:any)=> { $log.log('modal closed', closeResult); }, (dismissResult:any)=> { diff --git a/angular-ui-bootstrap/angular-ui-bootstrap.d.ts b/angular-ui-bootstrap/angular-ui-bootstrap.d.ts index 29ad03485b..0a7b54775e 100644 --- a/angular-ui-bootstrap/angular-ui-bootstrap.d.ts +++ b/angular-ui-bootstrap/angular-ui-bootstrap.d.ts @@ -270,6 +270,11 @@ declare namespace angular.ui.bootstrap { * A promise that is resolved when a modal is rendered. */ rendered: angular.IPromise; + + /** + * A promise that is resolved when a modal is closed and the animation completes. + */ + closed: angular.IPromise; } interface IModalScope extends angular.IScope { 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..88f00c9b5d 100644 --- a/angular-ui-router/angular-ui-router.d.ts +++ b/angular-ui-router/angular-ui-router.d.ts @@ -35,7 +35,7 @@ declare namespace angular.ui { /** * String HTML content, or function that returns an HTML string */ - template?: string | {(): string}; + template?: string | {(params: IStateParamsService): string}; /** * String URL path to template file OR Function, returns URL path string */ @@ -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; @@ -223,9 +229,9 @@ declare namespace angular.ui { */ notify?: boolean; /** - * {boolean=false}, If true will force transition even if the state or params have not changed, aka a reload of the same state. It differs from reloadOnSearch because you'd use this when you want to force a reload when everything is the same, including search params. + * {boolean=false|string|IState}, If true will force transition even if the state or params have not changed, aka a reload of the same state. It differs from reloadOnSearch because you'd use this when you want to force a reload when everything is the same, including search params. */ - reload?: boolean; + reload?: boolean | string | IState; } interface IHrefOptions { diff --git a/angularjs/angular-mocks-tests.ts b/angularjs/angular-mocks-tests.ts index 86bbe6c945..8790e68cf3 100644 --- a/angularjs/angular-mocks-tests.ts +++ b/angularjs/angular-mocks-tests.ts @@ -36,6 +36,7 @@ mock.module( function () { return 2; } ); mock.module({ module1: function () { return 1; } }); +mock.module.sharedInjector(); date = mock.TzDate(-7, '2013-1-1T15:00:00Z'); date = mock.TzDate(-8, 12345678); @@ -87,6 +88,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..9031cc56d1 100644 --- a/angularjs/angular-mocks.d.ts +++ b/angularjs/angular-mocks.d.ts @@ -47,7 +47,10 @@ declare namespace angular { inject: IInjectStatic // see https://docs.angularjs.org/api/ngMock/function/angular.mock.module - module(...modules: any[]): any; + module: { + (...modules: any[]): any; + sharedInjector(): void; + } // see https://docs.angularjs.org/api/ngMock/type/angular.mock.TzDate TzDate(offset: number, timestamp: number): Date; @@ -97,6 +100,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/angular.d.ts b/angularjs/angular.d.ts index e86fd37052..204c645b0c 100644 --- a/angularjs/angular.d.ts +++ b/angularjs/angular.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; /** @@ -389,9 +389,9 @@ declare namespace angular { $submitted: boolean; $error: any; $pending: any; - $addControl(control: INgModelController): void; - $removeControl(control: INgModelController): void; - $setValidity(validationErrorKey: string, isValid: boolean, control: INgModelController): void; + $addControl(control: INgModelController | IFormController): void; + $removeControl(control: INgModelController | IFormController): void; + $setValidity(validationErrorKey: string, isValid: boolean, control: INgModelController | IFormController): void; $setDirty(): void; $setPristine(): void; $commitViewValue(): void; @@ -1845,7 +1845,7 @@ declare namespace angular { controller(name: string): any; injector(): any; scope(): IScope; - + /** * Overload for custom scope interfaces */ @@ -1870,6 +1870,33 @@ declare namespace angular { annotate(fn: Function, strictDi?: boolean): string[]; annotate(inlineAnnotatedFunction: any[]): string[]; get(name: string, caller?: string): T; + get(name: '$anchorScroll'): IAnchorScrollService + get(name: '$cacheFactory'): ICacheFactoryService + get(name: '$compile'): ICompileService + get(name: '$controller'): IControllerService + get(name: '$document'): IDocumentService + get(name: '$exceptionHandler'): IExceptionHandlerService + get(name: '$filter'): IFilterService + get(name: '$http'): IHttpService + get(name: '$httpBackend'): IHttpBackendService + get(name: '$httpParamSerializer'): IHttpParamSerializer + get(name: '$httpParamSerializerJQLike'): IHttpParamSerializer + get(name: '$interpolate'): IInterpolateService + get(name: '$interval'): IIntervalService + get(name: '$locale'): ILocaleService + get(name: '$location'): ILocationService + get(name: '$log'): ILogService + get(name: '$parse'): IParseService + get(name: '$q'): IQService + get(name: '$rootElement'): IRootElementService + get(name: '$rootScope'): IRootScopeService + get(name: '$sce'): ISCEService + get(name: '$sceDelegate'): ISCEDelegateService + get(name: '$templateCache'): ITemplateCacheService + get(name: '$templateRequest'): ITemplateRequestService + get(name: '$timeout'): ITimeoutService + get(name: '$window'): IWindowService + get(name: '$xhrFactory'): IXhrFactory has(name: string): boolean; instantiate(typeConstructor: Function, locals?: any): T; invoke(inlineAnnotatedFunction: any[]): any; diff --git a/argv/argv-tests.ts b/argv/argv-tests.ts new file mode 100644 index 0000000000..6d73c53ec7 --- /dev/null +++ b/argv/argv-tests.ts @@ -0,0 +1,15 @@ +/// +import argv = require('argv'); +argv.version( 'v1.0' ); +argv.info( 'Special script info' ); +argv.clear() +.option({ + name: 'option', + short: 'o', + type: 'string', + description: 'Defines an option for your script', + example: "'script --opiton=value' or 'script -o value'" +}) +.run([ '--option=123', '-o', '123' ]); +argv.run(); +argv.help(); diff --git a/argv/argv.d.ts b/argv/argv.d.ts new file mode 100644 index 0000000000..182ffde861 --- /dev/null +++ b/argv/argv.d.ts @@ -0,0 +1,59 @@ +// Type definitions for argv +// Project: https://www.npmjs.com/package/argv +// Definitions by: Hookclaw +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +declare module "argv" { + // argv module + type args = { + targets:string[], + options:{[key:string]:any} + }; + + type helpOption = { + name: string, + type: string, + short?: string, + description?: string, + example?: string + }; + + type module = { + mod: string, + description: string, + options: {[key:string]:helpOption} + }; + + type typeFunction = (value:any, ...arglist:any[]) => any; + + type argv = { + + // Runs the arguments parser + run: ( argv?:string[] ) => args, + + // Adding options to definitions list + option: ( mod:helpOption|helpOption[] ) => argv, + + // Creating module + mod: ( object:module|module[] ) => argv, + + // Creates custom type function + type: ( name:string|{[key:string]:typeFunction}, callback?:typeFunction ) => any, + + // Setting version number, and auto setting version option + version: ( v:string ) => argv, + + // Description setup + info: ( mod:string, description?:module ) => argv, + + // Cleans out current options + clear: () => argv, + + // Prints out the help doc + help: ( mod?:string ) => argv + + }; + + var argv:argv; + + export = argv; +} diff --git a/array-find-index/array-find-index-tests.ts b/array-find-index/array-find-index-tests.ts new file mode 100644 index 0000000000..8c69a531e2 --- /dev/null +++ b/array-find-index/array-find-index-tests.ts @@ -0,0 +1,10 @@ +/// + +import * as arrayFindIndex from 'array-find-index'; + +arrayFindIndex(['rainbow', 'unicorn', 'pony'], x => x === 'unicorn'); + +const ctx = {foo: 'rainbow'}; +arrayFindIndex(['rainbow', 'unicorn', 'pony'], function (x) { + return x === this.foo; +}, ctx); diff --git a/array-find-index/array-find-index.d.ts b/array-find-index/array-find-index.d.ts new file mode 100644 index 0000000000..650cac2a16 --- /dev/null +++ b/array-find-index/array-find-index.d.ts @@ -0,0 +1,13 @@ +// Type definitions for array-find-index +// Project: https://github.com/sindresorhus/array-find-index +// Definitions by: Sam Verschueren +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare module "array-find-index" { + type Predicate = (element: any, index: number, array: any[]) => boolean; + + function arrayFindIndex(arr: any[], predicate: Predicate): number; + function arrayFindIndex(arr: any[], predicate: Predicate, ctx: any): number; + namespace arrayFindIndex {} + export = arrayFindIndex; +} diff --git a/async/async.d.ts b/async/async.d.ts index 066685e3c7..c3d218fabc 100644 --- a/async/async.d.ts +++ b/async/async.d.ts @@ -15,7 +15,7 @@ interface AsyncIterator { (item: T, callback: ErrorCallback): void; } interface AsyncForEachOfIterator { (item: T, key: number, callback: ErrorCallback): void; } interface AsyncResultIterator { (item: T, callback: AsyncResultCallback): void; } interface AsyncMemoIterator { (memo: R, item: T, callback: AsyncResultCallback): void; } -interface AsyncBooleanIterator { (item: T, callback: (truthValue: boolean) => void): void; } +interface AsyncBooleanIterator { (item: T, callback: (err: string, truthValue: boolean) => void): void; } interface AsyncWorker { (task: T, callback: ErrorCallback): void; } interface AsyncVoidFunction { (callback: ErrorCallback): void; } @@ -85,23 +85,23 @@ interface Async { map(arr: T[], iterator: AsyncResultIterator, callback?: AsyncResultArrayCallback): any; mapSeries(arr: T[], iterator: AsyncResultIterator, callback?: AsyncResultArrayCallback): any; mapLimit(arr: T[], limit: number, iterator: AsyncResultIterator, callback?: AsyncResultArrayCallback): any; - filter(arr: T[], iterator: AsyncBooleanIterator, callback?: (results: T[]) => any): any; - select(arr: T[], iterator: AsyncBooleanIterator, callback?: (results: T[]) => any): any; - filterSeries(arr: T[], iterator: AsyncBooleanIterator, callback?: (results: T[]) => any): any; - selectSeries(arr: T[], iterator: AsyncBooleanIterator, callback?: (results: T[]) => any): any; - filterLimit(arr: T[], limit: number, iterator: AsyncBooleanIterator, callback?: (results: T[]) => any): any; - selectLimit(arr: T[], limit: number, iterator: AsyncBooleanIterator, callback?: (results: T[]) => any): any; - reject(arr: T[], iterator: AsyncBooleanIterator, callback?: (results: T[]) => any): any; - rejectSeries(arr: T[], iterator: AsyncBooleanIterator, callback?: (results: T[]) => any): any; - rejectLimit(arr: T[], limit: number, iterator: AsyncBooleanIterator, callback?: (results: T[]) => any): any; + filter(arr: T[], iterator: AsyncBooleanIterator, callback?: AsyncResultArrayCallback): any; + select(arr: T[], iterator: AsyncBooleanIterator, callback?: AsyncResultArrayCallback): any; + filterSeries(arr: T[], iterator: AsyncBooleanIterator, callback?: AsyncResultArrayCallback): any; + selectSeries(arr: T[], iterator: AsyncBooleanIterator, callback?: AsyncResultArrayCallback): any; + filterLimit(arr: T[], limit: number, iterator: AsyncBooleanIterator, callback?: AsyncResultArrayCallback): any; + selectLimit(arr: T[], limit: number, iterator: AsyncBooleanIterator, callback?: AsyncResultArrayCallback): any; + reject(arr: T[], iterator: AsyncBooleanIterator, callback?: AsyncResultArrayCallback): any; + rejectSeries(arr: T[], iterator: AsyncBooleanIterator, callback?: AsyncResultArrayCallback): any; + rejectLimit(arr: T[], limit: number, iterator: AsyncBooleanIterator, callback?: AsyncResultArrayCallback): any; reduce(arr: T[], memo: R, iterator: AsyncMemoIterator, callback?: AsyncResultCallback): any; inject(arr: T[], memo: R, iterator: AsyncMemoIterator, callback?: AsyncResultCallback): any; foldl(arr: T[], memo: R, iterator: AsyncMemoIterator, callback?: AsyncResultCallback): any; reduceRight(arr: T[], memo: R, iterator: AsyncMemoIterator, callback: AsyncResultCallback): any; foldr(arr: T[], memo: R, iterator: AsyncMemoIterator, callback: AsyncResultCallback): any; - detect(arr: T[], iterator: AsyncBooleanIterator, callback?: (result: T) => void): any; - detectSeries(arr: T[], iterator: AsyncBooleanIterator, callback?: (result: T) => void): any; - detectLimit(arr: T[], limit: number, iterator: AsyncBooleanIterator, callback?: (result: T) => void): any; + detect(arr: T[], iterator: AsyncBooleanIterator, callback?: AsyncResultCallback): any; + detectSeries(arr: T[], iterator: AsyncBooleanIterator, callback?: AsyncResultCallback): any; + detectLimit(arr: T[], limit: number, iterator: AsyncBooleanIterator, callback?: AsyncResultCallback): any; sortBy(arr: T[], iterator: AsyncResultIterator, callback?: AsyncResultArrayCallback): any; some(arr: T[], iterator: AsyncBooleanIterator, callback?: (result: boolean) => void): any; someLimit(arr: T[], limit: number, iterator: AsyncBooleanIterator, callback?: (result: boolean) => void): any; diff --git a/atmosphere/atmosphere.d.ts b/atmosphere/atmosphere.d.ts index bf26ba0db4..239986b3a1 100644 --- a/atmosphere/atmosphere.d.ts +++ b/atmosphere/atmosphere.d.ts @@ -102,5 +102,6 @@ declare namespace Atmosphere { } declare var atmosphere:Atmosphere.Atmosphere; - - +declare module 'atmosphere' { + export = atmosphere; +} diff --git a/atom/atom.d.ts b/atom/atom.d.ts index 31fa76eb4a..389d6ef16e 100644 --- a/atom/atom.d.ts +++ b/atom/atom.d.ts @@ -456,82 +456,111 @@ declare namespace AtomCore { // TBD } - interface ISelection /* extends Theorist.Model */ { - cursor:ICursor; - marker:IDisplayBufferMarker; - editor:IEditor; - initialScreenRange:any; - wordwise:boolean; - needsAutoscroll:boolean; - retainSelection:boolean; - subscriptionCounts:any; + interface ISelection { + // https://atom.io/docs/api/v1.7.3/Selection - destroy():any; - finalize():any; - clearAutoscroll():any; - isEmpty():boolean; - isReversed():boolean; - isSingleScreenLine():boolean; - getScreenRange():TextBuffer.IRange; - setScreenRange(screenRange:any, options:any):any; - getBufferRange():TextBuffer.IRange; - setBufferRange(bufferRange:any, options:any):any; - getBufferRowRange():number[]; - autoscroll():void; - getText():string; - clear():boolean; - selectWord():TextBuffer.IRange; - expandOverWord():any; - selectLine(row?:any):TextBuffer.IRange; - expandOverLine():boolean; - selectToScreenPosition(position:any):any; - selectToBufferPosition(position:any):any; - selectRight():boolean; - selectLeft():boolean; - selectUp(rowCount?:any):boolean; - selectDown(rowCount?:any):boolean; - selectToTop():any; - selectToBottom():any; - selectAll():any; - selectToBeginningOfLine():any; - selectToFirstCharacterOfLine():any; - selectToEndOfLine():any; - selectToBeginningOfWord():any; - selectToEndOfWord():any; - selectToBeginningOfNextWord():any; - selectToPreviousWordBoundary():any; - selectToNextWordBoundary():any; - addSelectionBelow():any; - getGoalBufferRange():any; - addSelectionAbove():any[]; - insertText(text:string, options?:any):any; - normalizeIndents(text:string, indentBasis:number):any; - indent(_arg?:any):any; - indentSelectedRows():TextBuffer.IRange[]; - setIndentationForLine(line:string, indentLevel:number):any; - backspace():any; - backspaceToBeginningOfWord():any; - backspaceToBeginningOfLine():any; - delete():any; - deleteToEndOfWord():any; - deleteSelectedText():any; - deleteLine():any; - joinLines():any; - outdentSelectedRows():any[]; - autoIndentSelectedRows():any; - toggleLineComments():any; - cutToEndOfLine(maintainClipboard:any):any; - cut(maintainClipboard:any):any; - copy(maintainClipboard:any):any; - fold():any; - modifySelection(fn:()=>any):any; - plantTail():any; - intersectsBufferRange(bufferRange:any):any; - intersectsWith(otherSelection:any):any; - merge(otherSelection:any, options:any):any; - compare(otherSelection:any):any; - getRegionRects():any[]; - screenRangeChanged():any; + // Event Subscription + onDidChangeRange(callback: (event: { + oldBufferRange: TextBuffer.IRange; + oldScreenRange: TextBuffer.IRange; + newBufferRange: TextBuffer.IRange; + newScreenRange: TextBuffer.IRange; + selection: ISelection; + }) => {}): Disposable; + onDidDestroy(callback: () => {}): Disposable; + + // Managing the selection range + getScreenRange(): TextBuffer.IRange; + setScreenRange(screenRange: TextBuffer.IRange, options?: { + preserveFolds?: boolean; + autoscroll?: boolean; + }): void; + getBufferRange(): TextBuffer.IRange; + setBufferRange(bufferRange: TextBuffer.IRange, options?: { + preserveFolds?: boolean; + autoscroll?: boolean; + }): void; + getBufferRowRange(): [number]; + + // Info about the selection + isEmpty(): boolean; + isReversed(): boolean; + isSingleScreenLine(): boolean; + getText(): string; + intersectsBufferRange(bufferRange: TextBuffer.IRange): boolean; + intersectsWith(otherSelection: ISelection): boolean; + + // Modifying the selected range + clear(options?: {autoscroll?: boolean}): void; + selectToScreenPosition(position: any): void; + selectToBufferPosition(position: any): void; + selectRight(columnCount?: number): void; + selectLeft(columnCount?: number): void; + selectUp(rowCount: number): void; + selectDown(rowCount: number): void; + selectToTop(): void; + selectToBottom(): void; + selectAll(): void; + selectToBeginningOfLine(): void; + selectToFirstCharacterOfLine(): void; + selectToEndOfLine(): void; + selectToEndOfBufferLine(): void; + selectToBeginningOfWord(): void; + selectToEndOfWord(): void; + selectToBeginningOfNextWord(): void; + selectToPreviousWordBoundary(): void; + selectToNextWordBoundary(): void; + selectToPreviousSubwordBoundary(): void; + selectToNextSubwordBoundary(): void; + selectToBeginningOfNextParagraph(): void; + selectToBeginningOfPreviousParagraph(): void; + selectWord(): TextBuffer.IRange; + expandOverWord(): void; + selectLine(row?: number): void; + expandOverLine(): void; + + // Modifying the selected text + insertText(text: string, options?: { + select: boolean; + autoIndent: boolean; + autoIndentNewline: boolean; + autoDecreaseIndent: boolean; + normalizeLineEndings?: boolean; + undo?: 'skip'; + }): void; + backspace(): void; + deleteToPreviousWordBoundary(): void; + deleteToNextWordBoundary(): void; + deleteToBeginningOfWord(): void; + deleteToBeginningOfLine(): void; + delete(): void; + deleteToEndOfLine(): void; + deleteToEndOfWord(): void; + deleteToBeginningOfSubword(): void; + deleteToEndOfSubword(): void; + deleteSelectedText(): void; + deleteLine(): void; + joinLines(): void; + outdentSelectedRows(): void; + autoIndentSelectedRows(): void; + toggleLineComments(): void; + cutToEndOfLine(): void; + cutToEndOfBufferLine(): void; + cut(maintainClipboard?: boolean, fullLine?: boolean): void; + copy(maintainClipboard?: boolean, fullLine?: boolean): void; + fold(): void; + indentSelectedRows(): void; + + // Managing multiple selections + addSelectionBelow(): void; + addSelectionAbove(): void; + merge(otherSelection: ISelection, options?: { + preserveFolds?: boolean; + autoscroll?: boolean; + }): void; + + // Comparing to other selections + compare(otherSelection: ISelection): any; } interface IDecorationParams { diff --git a/avoscloud-sdk/avoscloud-sdk-tests.ts b/avoscloud-sdk/avoscloud-sdk-tests.ts new file mode 100644 index 0000000000..41926ba2d7 --- /dev/null +++ b/avoscloud-sdk/avoscloud-sdk-tests.ts @@ -0,0 +1,222 @@ +/// +import * as AV from 'avoscloud-sdk' +// 创建一个新的 TestObject 对象 +AV.initialize('uay57kigwe0b6f5n0e1d4z4xhydsml3dor24bzwvzr57wdap','kfgz7jjfsk55r5a8a3y4ttd3je1ko11bkibcikonk32oozww'); +var TestObject = AV.Object.extend('TestObject'); + +function avobject_Test() { + + + var testObject = new TestObject(); + + testObject.set("testBoolean", false); + testObject.set("testInteger", 178); + testObject.set("testString", "leancloud"); + testObject.set("testDate", new Date()); + testObject.set("testArray", ["leancloud","is","great"]); + testObject.set("testDictionary", {key:"value"}); + + + testObject.increment("testInteger"); + testObject.addUnique("testArray", "service"); + + testObject.save(); +} + +function test_query() { + + var TestObject = AV.Object.extend('TestObject') + var todoObject = new TestObject(); + + var query = new AV.Query(TestObject); + + query.equalTo("testString", "leancloud"); + query.notEqualTo("testString", "aws"); + query.greaterThan("testInteger", 150); + query.limit(10); + query.skip(10); + + // Sorts the results in ascending order by the score field + query.ascending("testString"); + + // Sorts the results in descending order by the score field + query.descending("testString"); + + // Restricts to wins < 50 + query.lessThan("testInteger", 50); + + // Restricts to wins <= 50 + query.lessThanOrEqualTo("testInteger", 50); + + // Restricts to wins > 50 + query.greaterThan("testInteger", 50); + + // Restricts to wins >= 50 + query.greaterThanOrEqualTo("testInteger", 50); + + // Finds scores from any of Jonathan, Dario, or Shawn + query.containedIn("testString", + ["leancloud", "aws", "azure"]); + + // Finds scores from anyone who is neither Jonathan, Dario, nor Shawn + query.notContainedIn("testString", + ["leancloud", "aws", "azure"]); + + // Finds objects that have the score set + query.exists("testInteger"); + + // Finds objects that don't have the score set + query.doesNotExist("testInteger"); + + query.select("testInteger", "leancloud"); + + // Find objects where the array in arrayKey contains 2. + query.equalTo("arrayKey", 2); + + // Find objects where the array in arrayKey contains all of the elements 2, 3, and 4. + query.containsAll("arrayKey", [2, 3, 4]); + + query.startsWith("testString", "l"); +} + +function test_file() { + + var base64 = "V29ya2luZyBhdCBQYXJzZSBpcyBncmVhdCE="; + var file = new AV.File("myfile.txt", { base64: base64 }); + + var bytes = [ 0xBE, 0xEF, 0xCA, 0xFE ]; + var file = new AV.File("myfile.txt", bytes); + + var file = new AV.File("myfile.zzz", {}, "image/png"); + + var src = file.url(); + + file.save().then( + () => { + // The file has been saved to Parse. + }, + (error) => { + // The file either could n ot be read, or could not be saved to Parse. + }); + + // TODO: Check +} + +function test_analytics() { + + var dimensions = { + // Define ranges to bucket data points into meaningful segments + priceRange: '1000-1500', + // Did the user filter the query? + source: 'craigslist', + // Do searches happen more often on weekdays or weekends? + dayType: 'weekday' + }; + // Send the dimensions to Parse along with the 'search' event + AV.Analytics.track('search', dimensions); + + var codeString = '404'; + AV.Analytics.track('error', { code: codeString }) +} + +function test_user_acl_roles() { + + var user = new AV.User(); + user.set("username", "my name"); + user.set("password", "my pass"); + user.set("email", "email@example.com"); + +// other fields can be set just like with Parse.Object + user.set("phone", "415-392-0202"); + + var currentUser = AV.User.current(); + if (currentUser) { + // do stuff with the user + } else { + // show the signup or login page + } + + AV.User.become("session-token-here").then(function (user) { + // The current user is now set to user. + }, function (error) { + // The token could not be validated. + }); + + var groupACL = new AV.ACL(); + + var userList: AV.User[] = [AV.User.current()]; + // userList is an array with the users we are sending this message to. + for (var i = 0; i < userList.length; i++) { + groupACL.setReadAccess(userList[i], true); + groupACL.setWriteAccess(userList[i], true); + } + + groupACL.setPublicReadAccess(true); + + AV.User.requestPasswordReset("email@example.com").then(function (data) { + // The current user is now set to user. + }, function (error) { + // The token could not be validated. + }); + + // By specifying no write privileges for the ACL, we can ensure the role cannot be altered. + var role = new AV.Role("Administrator", groupACL); + role.getUsers().add(role); + role.getRoles().add(role); + role.save(); + + AV.User.logOut().then(function (data) { + // logged out + }); +} + + +function test_push() { + + AV.Push.send({ + channels: [ "Gia nts", "Mets" ], + data: { + alert: "The Giants won against the Mets 2-3." + } + }, { + success: () => { + // Push was successful + }, + error: (error: any) => { + // Handle error + } + }); + + var query = new AV.Query(AV.Installation); + query.equalTo('injuryReports', true); + + AV.Push.send({ + where: query, // Set our Installation query + data: { + alert: "Willie Hayes injured by own pop fly." + } + }, { + success: function() { + // Push was successful + }, + error: function(error: any) { + // Handle error + } + }); +} + + +function test_promise() { + let resolved = AV.Promise.as(true); + let rejected = AV.Promise.error("an error object"); + AV.Promise.when([resolved, rejected]).then(function() { + // success + }, function() { + // failed + }); + + // can check whether an object is a Parse.Promise object or not + AV.Promise.is(resolved); +} + + diff --git a/avoscloud-sdk/avoscloud-sdk.d.ts b/avoscloud-sdk/avoscloud-sdk.d.ts new file mode 100644 index 0000000000..c3bd03e570 --- /dev/null +++ b/avoscloud-sdk/avoscloud-sdk.d.ts @@ -0,0 +1,799 @@ +// Type definitions for avoscloud-sdk 0.6.10 +// Project: https://leancloud.cn/ +// Definitions by: Wu Jun +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare module "avoscloud-sdk" { + namespace AV{ + + var applicationId: string; + var applicationKey: string; + var masterKey: string; + + interface SuccessOption { + success?: Function; + } + + interface ErrorOption { + error?: Function; + } + + interface SuccessFailureOptions extends SuccessOption, ErrorOption { + } + + interface WaitOption { + /** + * Set to true to wait for the server to confirm success + * before triggering an event. + */ + wait?: boolean; + } + + interface UseMasterKeyOption { + /** + * In Cloud Code and Node only, causes the Master Key to be used for this request. + */ + useMasterKey?: boolean; + } + + interface SilentOption { + /** + * Set to true to avoid firing the event. + */ + silent?: boolean; + } + + /** + * A Promise is returned by async methods as a hook to provide callbacks to be + * called when the async task is fulfilled. + * + *

Typical usage would be like:

+     *    query.find().then(function(results) {
+     *      results[0].set("foo", "bar");
+     *      return results[0].saveAsync();
+     *    }).then(function(result) {
+     *      console.log("Updated " + result.id);
+     *    });
+     * 

+ * + * @see AV.Promise.prototype.then + * @class + */ + + interface IPromise { + + then(resolvedCallback: (value: T) => IPromise, rejectedCallback?: (reason: any) => IPromise): IPromise; + then(resolvedCallback: (value: T) => U, rejectedCallback?: (reason: any) => IPromise): IPromise; + then(resolvedCallback: (value: T) => U, rejectedCallback?: (reason: any) => U): IPromise; + } + + class Promise { + + static as(resolvedValue: U): Promise; + static error(error: U): Promise; + static is(possiblePromise: any): Boolean; + static when(promises: Promise[]): Promise; + + always(callback: Function): Promise; + done(callback: Function): Promise; + fail(callback: Function): Promise; + reject(error: any): void; + resolve(result: any): void; + then(resolvedCallback: (value: T) => Promise, + rejectedCallback?: (reason: any) => Promise): IPromise; + then(resolvedCallback: (value: T) => U, + rejectedCallback?: (reason: any) => IPromise): IPromise; + then(resolvedCallback: (value: T) => U, + rejectedCallback?: (reason: any) => U): IPromise; + } + + interface IBaseObject { + toJSON(): any; + } + + class BaseObject implements IBaseObject { + toJSON(): any; + } + + /** + * Creates a new ACL. + * If no argument is given, the ACL has no permissions for anyone. + * If the argument is a AV.User, the ACL will have read and write + * permission for only that user. + * If the argument is any other JSON object, that object will be interpretted + * as a serialized ACL created with toJSON(). + * @see AV.Object#setACL + * @class + * + *

An ACL, or Access Control List can be added to any + * AV.Object to restrict access to only a subset of users + * of your application.

+ */ + class ACL extends BaseObject { + + permissionsById: any; + + constructor(arg1?: any); + + setPublicReadAccess(allowed: boolean): void; + getPublicReadAccess(): boolean; + + setPublicWriteAccess(allowed: boolean): void; + getPublicWriteAccess(): boolean; + + setReadAccess(userId: User, allowed: boolean): void; + getReadAccess(userId: User): boolean; + + setReadAccess(userId: string, allowed: boolean): void; + getReadAccess(userId: string): boolean; + + setRoleReadAccess(role: Role, allowed: boolean): void; + setRoleReadAccess(role: string, allowed: boolean): void; + getRoleReadAccess(role: Role): boolean; + getRoleReadAccess(role: string): boolean; + + setRoleWriteAccess(role: Role, allowed: boolean): void; + setRoleWriteAccess(role: string, allowed: boolean): void; + getRoleWriteAccess(role: Role): boolean; + getRoleWriteAccess(role: string): boolean; + + setWriteAccess(userId: User, allowed: boolean): void; + setWriteAccess(userId: string, allowed: boolean): void; + getWriteAccess(userId: User): boolean; + getWriteAccess(userId: string): boolean; + } + + + /** + * A AV.File is a local representation of a file that is saved to the AV + * cloud. + * @class + * @param name {String} The file's name. This will be prefixed by a unique + * value once the file has finished saving. The file name must begin with + * an alphanumeric character, and consist of alphanumeric characters, + * periods, spaces, underscores, or dashes. + * @param data {Array} The data for the file, as either: + * 1. an Array of byte value Numbers, or + * 2. an Object like { base64: "..." } with a base64-encoded String. + * 3. a File object selected with a file upload control. (3) only works + * in Firefox 3.6+, Safari 6.0.2+, Chrome 7+, and IE 10+. + * For example:
+     * var fileUploadControl = $("#profilePhotoFileUpload")[0];
+     * if (fileUploadControl.files.length > 0) {
+     *   var file = fileUploadControl.files[0];
+     *   var name = "photo.jpg";
+     *   var AVFile = new AV.File(name, file);
+     *   AVFile.save().then(function() {
+     *     // The file has been saved to AV.
+     *   }, function(error) {
+     *     // The file either could not be read, or could not be saved to AV.
+     *   });
+     * }
+ * @param type {String} Optional Content-Type header to use for the file. If + * this is omitted, the content type will be inferred from the name's + * extension. + */ + class File { + + constructor(name: string, data: any, type?: string); + name(): string; + url(): string; + save(options?: SuccessFailureOptions): Promise; + + } + + /** + * Creates a new GeoPoint with any of the following forms:
+ *
+     *   new GeoPoint(otherGeoPoint)
+     *   new GeoPoint(30, 30)
+     *   new GeoPoint([30, 30])
+     *   new GeoPoint({latitude: 30, longitude: 30})
+     *   new GeoPoint()  // defaults to (0, 0)
+     *   
+ * @class + * + *

Represents a latitude / longitude point that may be associated + * with a key in a AVObject or used as a reference point for geo queries. + * This allows proximity-based queries on the key.

+ * + *

Only one key in a class may contain a GeoPoint.

+ * + *

Example:

+     *   var point = new AV.GeoPoint(30.0, -20.0);
+     *   var object = new AV.Object("PlaceObject");
+     *   object.set("location", point);
+     *   object.save();

+ */ + class GeoPoint extends BaseObject { + + latitude: number; + longitude: number; + + constructor(arg1?: any, arg2?: any); + + current(options?: SuccessFailureOptions): GeoPoint; + radiansTo(point: GeoPoint): number; + kilometersTo(point: GeoPoint): number; + milesTo(point: GeoPoint): number; + } + + /** + * A class that is used to access all of the children of a many-to-many relationship. + * Each instance of AV.Relation is associated with a particular parent object and key. + */ + class Relation extends BaseObject { + + parent: Object; + key: string; + targetClassName: string; + + constructor(parent?: Object, key?: string); + + //Adds a AV.Object or an array of AV.Objects to the relation. + add(object: Object): void; + + // Returns a AV.Query that is limited to objects in this relation. + query(): Query; + + // Removes a AV.Object or an array of AV.Objects from this relation. + remove(object: Object): void; + } + + /** + * Creates a new model with defined attributes. A client id (cid) is + * automatically generated and assigned for you. + * + *

You won't normally call this method directly. It is recommended that + * you use a subclass of AV.Object instead, created by calling + * extend.

+ * + *

However, if you don't want to use a subclass, or aren't sure which + * subclass is appropriate, you can use this form:

+     *     var object = new AV.Object("ClassName");
+     * 
+ * That is basically equivalent to:
+     *     var MyClass = AV.Object.extend("ClassName");
+     *     var object = new MyClass();
+     * 

+ * + * @param {Object} attributes The initial set of data to store in the object. + * @param {Object} options A set of Backbone-like options for creating the + * object. The only option currently supported is "collection". + * @see AV.Object.extend + * + * @class + * + *

The fundamental unit of AV data, which implements the Backbone Model + * interface.

+ */ + class Object extends BaseObject { + + id: any; + createdAt:any; + updatedAt:any; + attributes: any; + cid: string; + changed: boolean; + className: string; + + constructor(className?: string, options?: any); + constructor(attributes?: string[], options?: any); + + static extend(className: string, protoProps?: any, classProps?: any): any; + static fetchAll(list: Object[], options: SuccessFailureOptions): Promise; + static fetchAllIfNeeded(list: Object[], options: SuccessFailureOptions): Promise; + static destroyAll(list: Object[], options?: Object.DestroyAllOptions): Promise; + static saveAll(list: Object[], options?: Object.SaveAllOptions): Promise; + + initialize(): void; + add(attr: string, item: any): Object; + addUnique(attr: string, item: any): any; + change(options: any): Object; + changedAttributes(diff: any): boolean; + clear(options: any): any; + clone(): Object; + destroy(options?: Object.DestroyOptions): Promise; + dirty(attr: String): boolean; + dirtyKeys(): string[]; + escape(attr: string): string; + existed(): boolean; + fetch(options?: Object.FetchOptions): Promise; + get(attr: string): any; + getACL(): ACL; + has(attr: string): boolean; + hasChanged(attr: string): boolean; + increment(attr: string, amount?: number): any; + isValid(): boolean; + op(attr: string): any; + previous(attr: string): any; + previousAttributes(): any; + relation(attr: string): Relation; + remove(attr: string, item: any): any; + save(options?: Object.SaveOptions, arg2?: any, arg3?: any): Promise; + set(key: string, value: any, options?: Object.SetOptions): boolean; + setACL(acl: ACL, options?: SuccessFailureOptions): boolean; + unset(attr: string, options?: any): any; + validate(attrs: any, options?: SuccessFailureOptions): boolean; + } + + namespace Object { + interface DestroyOptions extends SuccessFailureOptions, WaitOption, UseMasterKeyOption { } + + interface DestroyAllOptions extends SuccessFailureOptions, UseMasterKeyOption { } + + interface FetchOptions extends SuccessFailureOptions, UseMasterKeyOption { } + + interface SaveOptions extends SuccessFailureOptions, SilentOption, UseMasterKeyOption, WaitOption { } + + interface SaveAllOptions extends SuccessFailureOptions, UseMasterKeyOption { } + + interface SetOptions extends ErrorOption, SilentOption { + promise?: any; + } + } + + /** + * Every AV application installed on a device registered for + * push notifications has an associated Installation object. + */ + class Installation extends Object { + + badge: any; + channels: string[]; + timeZone: any; + deviceType: string; + pushType: string; + installationId: string; + deviceToken: string; + channelUris: string; + appName: string; + appVersion: string; + AVVersion: string; + appIdentifier: string; + + } + + /** + * Creates a new instance with the given models and options. Typically, you + * will not call this method directly, but will instead make a subclass using + * AV.Collection.extend. + * + * @param {Array} models An array of instances of AV.Object. + * + * @param {Object} options An optional object with Backbone-style options. + * Valid options are:
    + *
  • model: The AV.Object subclass that this collection contains. + *
  • query: An instance of AV.Query to use when fetching items. + *
  • comparator: A string property name or function to sort by. + *
+ * + * @see AV.Collection.extend + * + * @class + * + *

Provides a standard collection class for our sets of models, ordered + * or unordered. For more information, see the + * Backbone + * documentation.

+ */ + class Collection extends Events implements IBaseObject { + + model: Object; + models: Object[]; + query: Query; + comparator: (object: Object) => any; + + constructor(models?: Object[], options?: Collection.Options); + static extend(instanceProps: any, classProps: any): any; + + initialize(): void; + add(models: any[], options?: Collection.AddOptions): Collection; + at(index: number): Object; + fetch(options?: Collection.FetchOptions): Promise; + create(model: Object, options?: Collection.CreateOptions): Object; + get(id: string): Object; + getByCid(cid: any): any; + pluck(attr: string): any[]; + remove(model: any, options?: Collection.RemoveOptions): Collection; + remove(models: any[], options?: Collection.RemoveOptions): Collection; + reset(models: any[], options?: Collection.ResetOptions): Collection; + sort(options?: Collection.SortOptions): Collection; + toJSON(): any; + } + + namespace Collection { + interface Options { + model?: Object; + query?: Query; + comparator?: string; + } + + interface AddOptions extends SilentOption { + /** + * The index at which to add the models. + */ + at?: number; + } + + interface CreateOptions extends SuccessFailureOptions, WaitOption, SilentOption, UseMasterKeyOption { + } + + interface FetchOptions extends SuccessFailureOptions, SilentOption, UseMasterKeyOption { } + + interface RemoveOptions extends SilentOption { } + + interface ResetOptions extends SilentOption { } + + interface SortOptions extends SilentOption { } + } + + /** + * @class + * + *

AV.Events is a fork of Backbone's Events module, provided for your + * convenience.

+ * + *

A module that can be mixed in to any object in order to provide + * it with custom events. You may bind callback functions to an event + * with `on`, or remove these functions with `off`. + * Triggering an event fires all callbacks in the order that `on` was + * called. + * + *

+     *     var object = {};
+     *     _.extend(object, AV.Events);
+     *     object.on('expand', function(){ alert('expanded'); });
+     *     object.trigger('expand');

+ * + *

For more information, see the + * Backbone + * documentation.

+ */ + class Events { + + static off(events: string[], callback?: Function, context?: any): Events; + static on(events: string[], callback?: Function, context?: any): Events; + static trigger(events: string[]): Events; + static bind(): Events; + static unbind(): Events; + + on(eventName: string, callback?: Function, context?: any): Events; + off(eventName?: string, callback?: Function, context?: any): Events; + trigger(eventName: string, ...args: any[]): Events; + bind(eventName: string, callback: Function, context?: any): Events; + unbind(eventName?: string, callback?: Function, context?: any): Events; + + } + + /** + * Creates a new AV AV.Query for the given AV.Object subclass. + * @param objectClass - + * An instance of a subclass of AV.Object, or a AV className string. + * @class + * + *

AV.Query defines a query that is used to fetch AV.Objects. The + * most common use case is finding all objects that match a query through the + * find method. For example, this sample code fetches all objects + * of class MyClass. It calls a different function depending on + * whether the fetch succeeded or not. + * + *

+     * var query = new AV.Query(MyClass);
+     * query.find({
+     *   success: function(results) {
+     *     // results is an array of AV.Object.
+     *   },
+     *
+     *   error: function(error) {
+     *     // error is an instance of AV.Error.
+     *   }
+     * });

+ * + *

A AV.Query can also be used to retrieve a single object whose id is + * known, through the get method. For example, this sample code fetches an + * object of class MyClass and id myId. It calls a + * different function depending on whether the fetch succeeded or not. + * + *

+     * var query = new AV.Query(MyClass);
+     * query.get(myId, {
+     *   success: function(object) {
+     *     // object is an instance of AV.Object.
+     *   },
+     *
+     *   error: function(object, error) {
+     *     // error is an instance of AV.Error.
+     *   }
+     * });

+ * + *

A AV.Query can also be used to count the number of objects that match + * the query without retrieving all of those objects. For example, this + * sample code counts the number of objects of the class MyClass + *

+     * var query = new AV.Query(MyClass);
+     * query.count({
+     *   success: function(number) {
+     *     // There are number instances of MyClass.
+     *   },
+     *
+     *   error: function(error) {
+     *     // error is an instance of AV.Error.
+     *   }
+     * });

+ */ + class Query extends BaseObject { + + objectClass: any; + className: string; + + constructor(objectClass: any); + + static or(...var_args: Query[]): Query; + + addAscending(key: string): Query; + addAscending(key: string[]): Query; + addDescending(key: string): Query; + addDescending(key: string[]): Query; + ascending(key: string): Query; + ascending(key: string[]): Query; + collection(items?: Object[], options?: Collection.Options): Collection; + containedIn(key: string, values: any[]): Query; + contains(key: string, substring: string): Query; + containsAll(key: string, values: any[]): Query; + count(options?: Query.CountOptions): Promise; + descending(key: string): Query; + descending(key: string[]): Query; + doesNotExist(key: string): Query; + doesNotMatchKeyInQuery(key: string, queryKey: string, query: Query): Query; + doesNotMatchQuery(key: string, query: Query): Query; + each(callback: Function, options?: SuccessFailureOptions): Promise; + endsWith(key: string, suffix: string): Query; + equalTo(key: string, value: any): Query; + exists(key: string): Query; + find(options?: Query.FindOptions): Promise; + first(options?: Query.FirstOptions): Promise; + get(objectId: string, options?: Query.GetOptions): Promise; + greaterThan(key: string, value: any): Query; + greaterThanOrEqualTo(key: string, value: any): Query; + include(key: string): Query; + include(keys: string[]): Query; + lessThan(key: string, value: any): Query; + lessThanOrEqualTo(key: string, value: any): Query; + limit(n: number): Query; + matches(key: string, regex: RegExp, modifiers: any): Query; + matchesKeyInQuery(key: string, queryKey: string, query: Query): Query; + matchesQuery(key: string, query: Query): Query; + near(key: string, point: GeoPoint): Query; + notContainedIn(key: string, values: any[]): Query; + notEqualTo(key: string, value: any): Query; + select(...keys: string[]): Query; + skip(n: number): Query; + startsWith(key: string, prefix: string): Query; + withinGeoBox(key: string, southwest: GeoPoint, northeast: GeoPoint): Query; + withinKilometers(key: string, point: GeoPoint, maxDistance: number): Query; + withinMiles(key: string, point: GeoPoint, maxDistance: number): Query; + withinRadians(key: string, point: GeoPoint, maxDistance: number): Query; + } + + namespace Query { + interface CountOptions extends SuccessFailureOptions, UseMasterKeyOption { } + interface FindOptions extends SuccessFailureOptions, UseMasterKeyOption { } + interface FirstOptions extends SuccessFailureOptions, UseMasterKeyOption { } + interface GetOptions extends SuccessFailureOptions, UseMasterKeyOption { } + } + + /** + * Represents a Role on the AV server. Roles represent groupings of + * Users for the purposes of granting permissions (e.g. specifying an ACL + * for an Object). Roles are specified by their sets of child users and + * child roles, all of which are granted any permissions that the parent + * role has. + * + *

Roles must have a name (which cannot be changed after creation of the + * role), and must specify an ACL.

+ * @class + * A AV.Role is a local representation of a role persisted to the AV + * cloud. + */ + class Role extends Object { + + constructor(name: string, acl: ACL); + + getRoles(): Relation; + getUsers(): Relation; + getName(): string; + setName(name: string, options?: SuccessFailureOptions): any; + } + + /** + * @class + * + *

A AV.User object is a local representation of a user persisted to the + * AV cloud. This class is a subclass of a AV.Object, and retains the + * same functionality of a AV.Object, but also extends it with various + * user specific methods, like authentication, signing up, and validation of + * uniqueness.

+ */ + class User extends Object { + + static current(): User; + static signUp(username: string, password: string, attrs: any, options?: SuccessFailureOptions): Promise; + static logIn(username: string, password: string, options?: SuccessFailureOptions): Promise; + static logOut(): Promise; + static allowCustomUserClass(isAllowed: boolean): void; + static become(sessionToken: string, options?: SuccessFailureOptions): Promise; + static requestPasswordReset(email: string, options?: SuccessFailureOptions): Promise; + + signUp(attrs: any, options?: SuccessFailureOptions): Promise; + logIn(options?: SuccessFailureOptions): Promise; + fetch(options?: SuccessFailureOptions): Promise; + save(arg1: any, arg2: any, arg3: any): Promise; + authenticated(): boolean; + isCurrent(): boolean; + + getEmail(): string; + setEmail(email: string, options: SuccessFailureOptions): boolean; + + getUsername(): string; + setUsername(username: string, options?: SuccessFailureOptions): boolean; + + setPassword(password: string, options?: SuccessFailureOptions): boolean; + getSessionToken(): string; + } + + namespace Analytics { + + function track(name: string, dimensions: any):Promise; + } + + + class Error { + + code: ErrorCode; + message: string; + + constructor(code: ErrorCode, message: string); + + } + + enum ErrorCode { + + OTHER_CAUSE = -1, + INTERNAL_SERVER_ERROR = 1, + CONNECTION_FAILED = 100, + OBJECT_NOT_FOUND = 101, + INVALID_QUERY = 102, + INVALID_CLASS_NAME = 103, + MISSING_OBJECT_ID = 104, + INVALID_KEY_NAME = 105, + INVALID_POINTER = 106, + INVALID_JSON = 107, + COMMAND_UNAVAILABLE = 108, + NOT_INITIALIZED = 109, + INCORRECT_TYPE = 111, + INVALID_CHANNEL_NAME = 112, + PUSH_MISCONFIGURED = 115, + OBJECT_TOO_LARGE = 116, + OPERATION_FORBIDDEN = 119, + CACHE_MISS = 120, + INVALID_NESTED_KEY = 121, + INVALID_FILE_NAME = 122, + INVALID_ACL = 123, + TIMEOUT = 124, + INVALID_EMAIL_ADDRESS = 125, + MISSING_CONTENT_TYPE = 126, + MISSING_CONTENT_LENGTH = 127, + INVALID_CONTENT_LENGTH = 128, + FILE_TOO_LARGE = 129, + FILE_SAVE_ERROR = 130, + DUPLICATE_VALUE = 137, + INVALID_ROLE_NAME = 139, + EXCEEDED_QUOTA = 140, + SCRIPT_FAILED = 141, + VALIDATION_ERROR = 142, + INVALID_IMAGE_DATA = 150, + UNSAVED_FILE_ERROR = 151, + INVALID_PUSH_TIME_ERROR = 152, + FILE_DELETE_ERROR = 153, + REQUEST_LIMIT_EXCEEDED = 155, + INVALID_EVENT_NAME = 160, + USERNAME_MISSING = 200, + PASSWORD_MISSING = 201, + USERNAME_TAKEN = 202, + EMAIL_TAKEN = 203, + EMAIL_MISSING = 204, + EMAIL_NOT_FOUND = 205, + SESSION_MISSING = 206, + MUST_CREATE_USER_THROUGH_SIGNUP = 207, + ACCOUNT_ALREADY_LINKED = 208, + INVALID_SESSION_TOKEN = 209, + LINKED_ID_MISSING = 250, + INVALID_LINKED_SESSION = 251, + UNSUPPORTED_SERVICE = 252, + AGGREGATE_ERROR = 600, + FILE_READ_ERROR = 601, + X_DOMAIN_REQUEST = 602 + } + + /** + * @class + * A AV.Op is an atomic operation that can be applied to a field in a + * AV.Object. For example, calling object.set("foo", "bar") + * is an example of a AV.Op.Set. Calling object.unset("foo") + * is a AV.Op.Unset. These operations are stored in a AV.Object and + * sent to the server as part of object.save() operations. + * Instances of AV.Op should be immutable. + * + * You should not create subclasses of AV.Op or instantiate AV.Op + * directly. + */ + namespace Op { + + interface BaseOperation extends IBaseObject { + objects(): any[]; + } + + interface Add extends BaseOperation { + } + + interface AddUnique extends BaseOperation { + } + + interface Increment extends IBaseObject { + amount: number; + } + + interface Relation extends IBaseObject { + added(): Object[]; + removed: Object[]; + } + + interface Set extends IBaseObject { + value(): any; + } + + interface Unset extends IBaseObject { + } + + } + + /** + * Contains functions to deal with Push in AV + * @name AV.Push + * @namespace + */ + namespace Push { + function send(data: PushData, options?: SendOptions): Promise; + + interface PushData { + channels?: string[]; + push_time?: Date; + expiration_time?: Date; + expiration_interval?: number; + where?: Query; + data?: any; + alert?: string; + badge?: string; + sound?: string; + title?: string; + } + + interface SendOptions { + success?: () => void; + error?: (error: Error) => void; + } + } + + /** + * Call this method first to set up your authentication tokens for AV. + * @param {String} applicationId Your Application ID. + * @param {String} applicationKey Your Application Key. + * @param {String} masterKey (optional) Your Application Master Key. (Node.js only!) + */ + function initialize(applicationId: string, applicationKey: string, masterKey?: string): void; + + } + + export = AV; +} diff --git a/aws-sdk/aws-sdk.d.ts b/aws-sdk/aws-sdk.d.ts index eb54a5991d..64805da137 100644 --- a/aws-sdk/aws-sdk.d.ts +++ b/aws-sdk/aws-sdk.d.ts @@ -1023,18 +1023,26 @@ declare module "aws-sdk" { export interface Client { config: ClientConfig; - publicTopic(params: PublishRequest, callback: (err: any, data: PublishResult) => void): void; + publish(params: PublishRequest, callback: (err: any, data: PublishResult) => void): void; createTopic(params: CreateTopicRequest, callback: (err: any, data: CreateTopicResult) => void): void; deleteTopic(params: DeleteTopicRequest, callback: (err: any, data: any) => void): void; } export interface PublishRequest { TopicArn?: string; + TargetArn?: string; + MessageAttributes?: { [name: string]: MessageAttribute; }; Message?: string; MessageStructure?: string; Subject?: string; } + export interface MessageAttribute { + DataType: string; + StringValue?: string; + BinaryValue: any; // (Buffer, Typed Array, Blob, String) + } + export interface PublishResult { MessageId?: string; } @@ -1072,7 +1080,7 @@ declare module "aws-sdk" { GrantReadACP?: string; GrantWriteACP?: string; Key: string; - Metadata?: string[]; + Metadata?: { [key: string]:string; }; ServerSideEncryption?: string; StorageClass?: string; WebsiteRedirectLocation?: string; diff --git a/azure-mobile-services-client/AzureMobileServicesClient.d.ts b/azure-mobile-services-client/AzureMobileServicesClient.d.ts index f93ca868c7..b9749002c9 100644 --- a/azure-mobile-services-client/AzureMobileServicesClient.d.ts +++ b/azure-mobile-services-client/AzureMobileServicesClient.d.ts @@ -100,7 +100,7 @@ declare namespace Microsoft.WindowsAzure { } } -declare module "WindowsAzure" { +declare module "azure-mobile-apps-client" { export = WindowsAzure; } diff --git a/babel-core/babel-core-tests.ts b/babel-core/babel-core-tests.ts new file mode 100644 index 0000000000..e564b9d81e --- /dev/null +++ b/babel-core/babel-core-tests.ts @@ -0,0 +1,32 @@ +/// +import * as babel from "babel-core"; + + +// Example from https://github.com/babel/babel/tree/master/packages/babel-core +const code = `class Example {}`; +const result = babel.transform(code, { /* options */ }); +result.code; // Generated code +result.map; // Sourcemap +result.ast; // AST + + +// Examples from http://babeljs.io/docs/usage/api/ +let options: babel.TransformOptions = { + plugins: [ + "es2015-arrow-functions", + "es2015-block-scoped-functions", + "es2015-block-scoping", + "es2015-classes", + ], + only: /.*\.js/, + ast: false, + sourceMaps: true +}; + +babel.transformFile("filename.js", options, function (err, result) { + result.code; + result.map; + result.ast; +}); + +babel.transformFileSync("filename.js", options).code; diff --git a/babel-core/babel-core.d.ts b/babel-core/babel-core.d.ts new file mode 100644 index 0000000000..19146e65e0 --- /dev/null +++ b/babel-core/babel-core.d.ts @@ -0,0 +1,144 @@ +// Type definitions for babel-core v6.7 +// Project: https://github.com/babel/babel/tree/master/packages/babel-core +// Definitions by: Troy Gerwien +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// +/// +/// + +declare module "babel-core" { + import * as t from 'babel-types'; + export {t as types}; + type Node = t.Node; + export import template = require('babel-template'); + export var version: string; + import traverse, {Visitor} from "babel-traverse"; + export {traverse, Visitor}; + + + /** Transforms the passed in `code`. Returning an object with the generated code, source map, and AST. */ + export function transform(code: string, opts?: TransformOptions): BabelFileResult; + + /** Asynchronously transforms the entire contents of a file. */ + export function transformFile(filename: string, opts: TransformOptions, callback: (err: any, result: BabelFileResult) => void): void; + + /** Synchronous version of `babel.transformFile`. Returns the transformed contents of the `filename`. */ + export function transformFileSync(filename: string, opts?: TransformOptions): BabelFileResult; + + export function transformFromAst(ast: Node, code?: string, opts?: TransformOptions): BabelFileResult; + + export interface TransformOptions { + + /** Filename to use when reading from stdin - this will be used in source-maps, errors etc. Default: "unknown". */ + filename?: string; + + /** Filename relative to `sourceRoot`. */ + filenameRelative?: string; + + /** A source map object that the output source map will be based on. */ + inputSourceMap?: Object; + + /** + * This is an object of keys that represent different environments. For example, you may have: + * `{ env: { production: { / * specific options * / } } }` + * which will use those options when the enviroment variable `BABEL_ENV` is set to `"production"`. + * If `BABEL_ENV` isn't set then `NODE_ENV` will be used, if it's not set then it defaults to `"development"`. + */ + env?: Object; + + /** Retain line numbers - will result in really ugly code. Default: `false` */ + retainLines?: boolean; + + /** Enable/disable ANSI syntax highlighting of code frames. Default: `true`. */ + highlightCode?: boolean; + + /** List of presets (a set of plugins) to load and use. */ + presets?: any[]; + + /** List of plugins to load and use. */ + plugins?: any[]; + + /** list of glob paths to **not** compile. Opposite to the `only` option. */ + ignore?: string[]; + + /** + * A glob, regex, or mixed array of both, matching paths to only compile. Can also be an array of arrays containing + * paths to explicitly match. When attempting to compile a non-matching file it's returned verbatim. + */ + only?: string | RegExp | Array; + + /** Enable code generation. Default: `true`. */ + code?: boolean; + + /** Include the AST in the returned object. Default: `true`. */ + ast?: boolean; + + /** A path to an .babelrc file to extend. */ + extends?: string; + + /** write comments to generated output. Default: `true`. */ + comments?: boolean; + + /** + * An optional callback that controls whether a comment should be output or not. Called as + * `shouldPrintComment(commentContents)`. **NOTE**: This overrides the `comments` option when used. + */ + shouldPrintComment?: (comment: string) => boolean; + + /** + * Do not include superfluous whitespace characters and line terminators. When set to `"auto"`, `compact` is set to + * `true` on input sizes of >100KB. + */ + compact?: boolean | "auto"; + + /** + * If truthy, adds a `map` property to returned output. If set to `"inline"`, a comment with a `sourceMappingURL` + * directive is added to the bottom of the returned code. If set to `"both"` then a map property is returned as well + * as a source map comment appended. + */ + sourceMaps?: boolean | "inline" | "both"; + + /** Set `file` on returned source map. */ + sourceMapTarget?: string; + + /** Set `sources[0]` on returned source map. */ + sourceFileName?: string; + + /** The root from which all sources are relative. */ + sourceRoot?: string; + + /** Specify whether or not to use `.babelrc` and `.babelignore` files. Default: `true`. */ + babelrc?: boolean; + + /** Attach a comment before all non-user injected code. */ + auxiliaryCommentBefore?: string; + + /** Attach a comment after all non-user injected code. */ + auxiliaryCommentAfter?: string; + + /** + * Specify a custom callback to generate a module id with. Called as `getModuleId(moduleName)`. + * If falsy value is returned then the generated module id is used. + */ + getModuleId?: (moduleName: string) => string; + + /** Optional prefix for the AMD module formatter that will be prepend to the filename on module definitions. */ + moduleRoot?: string; + + /** + * If truthy, insert an explicit id for modules. By default, all modules are anonymous. + * (Not available for `common` modules). + */ + moduleIds?: boolean; + + /** Specify a custom name for module ids. */ + moduleId?: string; + } + + export interface BabelFileResult { + ast?: Node; + code?: string; + map?: Object; + } +} diff --git a/babel-generator/babel-generator-tests.ts b/babel-generator/babel-generator-tests.ts new file mode 100644 index 0000000000..33d10b5cd9 --- /dev/null +++ b/babel-generator/babel-generator-tests.ts @@ -0,0 +1,27 @@ +/// +/// + + +// Example from https://github.com/babel/babel/tree/master/packages/babel-generator +import {parse} from 'babylon'; +import generate from 'babel-generator'; + +const code = 'class Example {}'; +const ast = parse(code); + +ast.type; +ast.loc.start; + +const output = generate(ast, { /* options */ }, code); + + +// Example from https://github.com/thejameskyle/babel-handbook/blob/master/translations/en/plugin-handbook.md#babel-generator +let result = generate(ast, { + retainLines: false, + compact: "auto", + concise: false, + quotes: "double", + // ... +}, code); +result.code; +result.map; diff --git a/babel-generator/babel-generator.d.ts b/babel-generator/babel-generator.d.ts new file mode 100644 index 0000000000..aa8232e8b0 --- /dev/null +++ b/babel-generator/babel-generator.d.ts @@ -0,0 +1,102 @@ +// Type definitions for babel-generator v6.7 +// Project: https://github.com/babel/babel/tree/master/packages/babel-generator +// Definitions by: Troy Gerwien +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare module "babel-generator" { + import * as t from 'babel-types'; + type Node = t.Node; + + /** + * Turns an AST into code, maintaining sourcemaps, user preferences, and valid output. + * @param ast - the abstract syntax tree from which to generate output code. + * @param opts - used for specifying options for code generation. + * @param code - the original source code, used for source maps. + * @returns - an object containing the output code and source map. + */ + export default function generate(ast: Node, opts?: GeneratorOptions, code?: string | {[filename: string]: string}): GeneratorResult; + + export interface GeneratorOptions { + + /** + * Optional string to add as a block comment at the start of the output file. + */ + auxiliaryCommentBefore?: string; + + /** + * Optional string to add as a block comment at the end of the output file. + */ + auxiliaryCommentAfter?: string; + + /** + * Function that takes a comment (as a string) and returns true if the comment should be included in the output. + * By default, comments are included if `opts.comments` is `true` or if `opts.minifed` is `false` and the comment + * contains `@preserve` or `@license`. + */ + shouldPrintComment?: (comment: string) => boolean; + + /** + * Attempt to use the same line numbers in the output code as in the source code (helps preserve stack traces). + * Defaults to `false`. + */ + retainLines?: boolean; + + /** + * Should comments be included in output? Defaults to `true`. + */ + comments?: boolean; + + /** + * Set to true to avoid adding whitespace for formatting. Defaults to the value of `opts.minified`. + */ + compact?: boolean | 'auto'; + + /** + * Should the output be minified. Defaults to `false`. + */ + minified?: boolean; + + /** + * Set to true to reduce whitespace (but not as much as opts.compact). Defaults to `false`. + */ + concise?: boolean; + + /** + * The type of quote to use in the output. If omitted, autodetects based on `ast.tokens`. + */ + quotes?: 'single' | 'double'; + + /** + * Used in warning messages + */ + filename?: string; + + /** + * Enable generating source maps. Defaults to `false`. + */ + sourceMaps?: boolean; + + /** + * The filename of the generated code that the source map will be associated with. + */ + sourceMapTarget?: string; + + /** + * A root for all relative URLs in the source map. + */ + sourceRoot?: string; + + /** + * The filename for the source code (i.e. the code in the `code` argument). + * This will only be used if `code` is a string. + */ + sourceFileName?: string; + } + + export interface GeneratorResult { + map: Object; + code: string; + } +} diff --git a/babel-template/babel-template-tests.ts b/babel-template/babel-template-tests.ts new file mode 100644 index 0000000000..e0ae7497ff --- /dev/null +++ b/babel-template/babel-template-tests.ts @@ -0,0 +1,21 @@ +/// +/// +/// + + +// Example from https://github.com/babel/babel/tree/master/packages/babel-template +import template = require('babel-template'); +import generate from 'babel-generator'; +import * as t from 'babel-types'; + +const buildRequire = template(` + var IMPORT_NAME = require(SOURCE); +`); + +const ast = buildRequire({ + IMPORT_NAME: t.identifier('myModule'), + SOURCE: t.stringLiteral('my-module') +}); + +console.log(generate(ast).code); +// var myModule = require('my-module'); diff --git a/babel-template/babel-template.d.ts b/babel-template/babel-template.d.ts new file mode 100644 index 0000000000..7b3cafe7f4 --- /dev/null +++ b/babel-template/babel-template.d.ts @@ -0,0 +1,21 @@ +// Type definitions for babel-template v6.7 +// Project: https://github.com/babel/babel/tree/master/packages/babel-template +// Definitions by: Troy Gerwien +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// +/// + +declare module "babel-template" { + import {BabylonOptions} from 'babylon'; + import * as t from 'babel-types'; + type Node = t.Node; + + // NB: This export doesn't match the handbook example, where `template` is the default export. + // But it does match the runtime behaviour (at least at the time of this writing). For some reason, + // babel-template/lib/index.js has this line at the bottom: module.exports = exports["default"]; + export = template; + function template(code: string, opts?: BabylonOptions): UseTemplate; + + type UseTemplate = (nodes?: {[placeholder: string]: Node}) => Node; +} diff --git a/babel-traverse/babel-traverse-tests.ts b/babel-traverse/babel-traverse-tests.ts new file mode 100644 index 0000000000..fba04dfd5d --- /dev/null +++ b/babel-traverse/babel-traverse-tests.ts @@ -0,0 +1,111 @@ +/// +/// +/// + + +import * as babylon from "babylon"; +import traverse, {Visitor} from 'babel-traverse'; +import * as t from 'babel-types'; + + +// Examples from: https://github.com/thejameskyle/babel-handbook/blob/master/translations/en/plugin-handbook.md +const MyVisitor: Visitor = { + Identifier: { + enter() { + console.log("Entered!"); + }, + exit() { + console.log("Exited!"); + } + } +}; + +const MyVisitor2: Visitor = { + Identifier(path) { + console.log("Visiting: " + path.node.name); + } +}; + + +// Example from https://github.com/thejameskyle/babel-handbook/blob/master/translations/en/plugin-handbook.md#babel-traverse +const code = `function square(n) { + return n * n; +}`; + +const ast = babylon.parse(code); + +traverse(ast, { + enter(path) { + let node = path.node; + if (t.isIdentifier(node) && node.name === "n") { + node.name = "x"; + } + } +}); + + +// Examples from https://github.com/thejameskyle/babel-handbook/blob/master/translations/en/plugin-handbook.md#writing-your-first-babel-plugin + +const v1: Visitor = { + + BinaryExpression(path) { + if (t.isIdentifier(path.node.left)) { + // ... + } + path.replaceWith( + t.binaryExpression("**", path.node.left, t.numericLiteral(2)) + ); + path.parentPath.replaceWith( + t.expressionStatement(t.stringLiteral("Anyway the wind blows, doesn't really matter to me, to me.")) + ); + path.parentPath.remove(); + }, + + Identifier(path) { + if (path.isReferencedIdentifier()) { + // ... + } + if (t.isReferenced(path.node, path.parent)) { + // ... + } + }, + + ReturnStatement(path) { + path.replaceWithMultiple([ + t.expressionStatement(t.stringLiteral("Is this the real life?")), + t.expressionStatement(t.stringLiteral("Is this just fantasy?")), + t.expressionStatement(t.stringLiteral("(Enjoy singing the rest of the song in your head)")), + ]); + }, + + FunctionDeclaration(path, state) { + path.replaceWithSourceString(`function add(a, b) { + return a + b; + }`); + + path.insertBefore(t.expressionStatement(t.stringLiteral("Because I'm easy come, easy go."))); + path.insertAfter(t.expressionStatement(t.stringLiteral("A little high, little low."))); + path.remove(); + + if (path.scope.hasBinding("n")) { + // ... + } + if (path.scope.hasOwnBinding("n")) { + // ... + } + + let id1 = path.scope.generateUidIdentifier("uid"); + id1.type; + id1.name; + let id2 = path.scope.generateUidIdentifier("uid"); + id2.type; + id2.name; + + const id = path.scope.generateUidIdentifierBasedOnNode(path.node.id); + path.remove(); + path.scope.parent.push({ id, init: path.node }); + + path.scope.rename("n", "x"); + path.scope.rename("n"); + } +}; diff --git a/babel-traverse/babel-traverse.d.ts b/babel-traverse/babel-traverse.d.ts new file mode 100644 index 0000000000..17cbda2f23 --- /dev/null +++ b/babel-traverse/babel-traverse.d.ts @@ -0,0 +1,966 @@ +// Type definitions for babel-traverse v6.7 +// Project: https://github.com/babel/babel/tree/master/packages/babel-traverse +// Definitions by: Troy Gerwien +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare module "babel-traverse" { + import * as t from 'babel-types'; + type Node = t.Node; + + export default function traverse(parent: Node | Node[], opts?: TraverseOptions, scope?: Scope, state?: any, parentPath?: NodePath): void; + + export interface TraverseOptions extends Visitor { + scope?: Scope; + noScope?: boolean; + } + + export class Scope { + constructor(path: NodePath, parentScope?: Scope); + path: NodePath; + block: Node; + parentBlock: Node; + parent: Scope; + hub: Hub; + bindings: { [name: string]: Binding; }; + + /** Traverse node with current scope and path. */ + traverse(node: Node | Node[], opts?: TraverseOptions, state?: any): void; + + /** Generate a unique identifier and add it to the current scope. */ + generateDeclaredUidIdentifier(name?: string): t.Identifier; + + /** Generate a unique identifier. */ + generateUidIdentifier(name?: string): t.Identifier; + + /** Generate a unique `_id1` binding. */ + generateUid(name?: string): string; + + /** Generate a unique identifier based on a node. */ + generateUidIdentifierBasedOnNode(parent: Node, defaultName?: string): t.Identifier; + + /** + * Determine whether evaluating the specific input `node` is a consequenceless reference. ie. + * evaluating it wont result in potentially arbitrary code from being ran. The following are + * whitelisted and determined not to cause side effects: + * + * - `this` expressions + * - `super` expressions + * - Bound identifiers + */ + isStatic(node: Node): boolean; + + /** Possibly generate a memoised identifier if it is not static and has consequences. */ + maybeGenerateMemoised(node: Node, dontPush?: boolean): t.Identifier; + + checkBlockScopedCollisions(local: Node, kind: string, name: string, id: Object): void; + + rename(oldName: string, newName?: string, block?: Node): void; + + dump(): void; + + toArray(node: Node, i?: number): Node; + + registerDeclaration(path: NodePath): void; + + buildUndefinedNode(): Node; + + registerConstantViolation(path: NodePath): void; + + registerBinding(kind: string, path: NodePath, bindingPath?: NodePath): void; + + addGlobal(node: Node): void; + + hasUid(name: string): boolean; + + hasGlobal(name: string): boolean; + + hasReference(name: string): boolean; + + isPure(node: Node, constantsOnly?: boolean): boolean; + + setData(key: string, val: any): any; + + getData(key: string): any; + + removeData(key: string): void; + + push(opts: any): void; + + getProgramParent(): Scope; + + getFunctionParent(): Scope; + + getBlockParent(): Scope; + + /** Walks the scope tree and gathers **all** bindings. */ + getAllBindings(...kinds: string[]): Object; + + bindingIdentifierEquals(name: string, node: Node): boolean; + + getBinding(name: string): Binding; + + getOwnBinding(name: string): Binding; + + getBindingIdentifier(name: string): t.Identifier; + + getOwnBindingIdentifier(name: string): t.Identifier; + + hasOwnBinding(name: string): boolean; + + hasBinding(name: string, noGlobals?: boolean): boolean; + + parentHasBinding(name: string, noGlobals?: boolean): boolean; + + /** Move a binding of `name` to another `scope`. */ + moveBindingTo(name: string, scope: Scope): void; + + removeOwnBinding(name: string): void; + + removeBinding(name: string): void; + } + + export class Binding { + constructor(opts: { existing: Binding; identifier: t.Identifier; scope: Scope; path: NodePath; kind: 'var' | 'let' | 'const'; }); + identifier: t.Identifier; + scope: Scope; + path: NodePath; + kind: 'var' | 'let' | 'const'; + referenced: boolean; + references: number; + referencePaths: NodePath[]; + constant: boolean; + constantViolations: NodePath[]; + } + + export interface Visitor extends VisitNodeObject { + ArrayExpression?: VisitNode; + AssignmentExpression?: VisitNode; + LVal?: VisitNode; + Expression?: VisitNode; + BinaryExpression?: VisitNode; + Directive?: VisitNode; + DirectiveLiteral?: VisitNode; + BlockStatement?: VisitNode; + BreakStatement?: VisitNode; + Identifier?: VisitNode; + CallExpression?: VisitNode; + CatchClause?: VisitNode; + ConditionalExpression?: VisitNode; + ContinueStatement?: VisitNode; + DebuggerStatement?: VisitNode; + DoWhileStatement?: VisitNode; + Statement?: VisitNode; + EmptyStatement?: VisitNode; + ExpressionStatement?: VisitNode; + File?: VisitNode; + Program?: VisitNode; + ForInStatement?: VisitNode; + VariableDeclaration?: VisitNode; + ForStatement?: VisitNode; + FunctionDeclaration?: VisitNode; + FunctionExpression?: VisitNode; + IfStatement?: VisitNode; + LabeledStatement?: VisitNode; + StringLiteral?: VisitNode; + NumericLiteral?: VisitNode; + NullLiteral?: VisitNode; + BooleanLiteral?: VisitNode; + RegExpLiteral?: VisitNode; + LogicalExpression?: VisitNode; + MemberExpression?: VisitNode; + NewExpression?: VisitNode; + ObjectExpression?: VisitNode; + ObjectMethod?: VisitNode; + ObjectProperty?: VisitNode; + RestElement?: VisitNode; + ReturnStatement?: VisitNode; + SequenceExpression?: VisitNode; + SwitchCase?: VisitNode; + SwitchStatement?: VisitNode; + ThisExpression?: VisitNode; + ThrowStatement?: VisitNode; + TryStatement?: VisitNode; + UnaryExpression?: VisitNode; + UpdateExpression?: VisitNode; + VariableDeclarator?: VisitNode; + WhileStatement?: VisitNode; + WithStatement?: VisitNode; + AssignmentPattern?: VisitNode; + ArrayPattern?: VisitNode; + ArrowFunctionExpression?: VisitNode; + ClassBody?: VisitNode; + ClassDeclaration?: VisitNode; + ClassExpression?: VisitNode; + ExportAllDeclaration?: VisitNode; + ExportDefaultDeclaration?: VisitNode; + ExportNamedDeclaration?: VisitNode; + Declaration?: VisitNode; + ExportSpecifier?: VisitNode; + ForOfStatement?: VisitNode; + ImportDeclaration?: VisitNode; + ImportDefaultSpecifier?: VisitNode; + ImportNamespaceSpecifier?: VisitNode; + ImportSpecifier?: VisitNode; + MetaProperty?: VisitNode; + ClassMethod?: VisitNode; + ObjectPattern?: VisitNode; + SpreadElement?: VisitNode; + Super?: VisitNode; + TaggedTemplateExpression?: VisitNode; + TemplateLiteral?: VisitNode; + TemplateElement?: VisitNode; + YieldExpression?: VisitNode; + AnyTypeAnnotation?: VisitNode; + ArrayTypeAnnotation?: VisitNode; + BooleanTypeAnnotation?: VisitNode; + BooleanLiteralTypeAnnotation?: VisitNode; + NullLiteralTypeAnnotation?: VisitNode; + ClassImplements?: VisitNode; + ClassProperty?: VisitNode; + DeclareClass?: VisitNode; + DeclareFunction?: VisitNode; + DeclareInterface?: VisitNode; + DeclareModule?: VisitNode; + DeclareTypeAlias?: VisitNode; + DeclareVariable?: VisitNode; + ExistentialTypeParam?: VisitNode; + FunctionTypeAnnotation?: VisitNode; + FunctionTypeParam?: VisitNode; + GenericTypeAnnotation?: VisitNode; + InterfaceExtends?: VisitNode; + InterfaceDeclaration?: VisitNode; + IntersectionTypeAnnotation?: VisitNode; + MixedTypeAnnotation?: VisitNode; + NullableTypeAnnotation?: VisitNode; + NumericLiteralTypeAnnotation?: VisitNode; + NumberTypeAnnotation?: VisitNode; + StringLiteralTypeAnnotation?: VisitNode; + StringTypeAnnotation?: VisitNode; + ThisTypeAnnotation?: VisitNode; + TupleTypeAnnotation?: VisitNode; + TypeofTypeAnnotation?: VisitNode; + TypeAlias?: VisitNode; + TypeAnnotation?: VisitNode; + TypeCastExpression?: VisitNode; + TypeParameterDeclaration?: VisitNode; + TypeParameterInstantiation?: VisitNode; + ObjectTypeAnnotation?: VisitNode; + ObjectTypeCallProperty?: VisitNode; + ObjectTypeIndexer?: VisitNode; + ObjectTypeProperty?: VisitNode; + QualifiedTypeIdentifier?: VisitNode; + UnionTypeAnnotation?: VisitNode; + VoidTypeAnnotation?: VisitNode; + JSXAttribute?: VisitNode; + JSXIdentifier?: VisitNode; + JSXNamespacedName?: VisitNode; + JSXElement?: VisitNode; + JSXExpressionContainer?: VisitNode; + JSXClosingElement?: VisitNode; + JSXMemberExpression?: VisitNode; + JSXOpeningElement?: VisitNode; + JSXEmptyExpression?: VisitNode; + JSXSpreadAttribute?: VisitNode; + JSXText?: VisitNode; + Noop?: VisitNode; + ParenthesizedExpression?: VisitNode; + AwaitExpression?: VisitNode; + BindExpression?: VisitNode; + Decorator?: VisitNode; + DoExpression?: VisitNode; + ExportDefaultSpecifier?: VisitNode; + ExportNamespaceSpecifier?: VisitNode; + RestProperty?: VisitNode; + SpreadProperty?: VisitNode; + Binary?: VisitNode; + Scopable?: VisitNode; + BlockParent?: VisitNode; + Block?: VisitNode; + Terminatorless?: VisitNode; + CompletionStatement?: VisitNode; + Conditional?: VisitNode; + Loop?: VisitNode; + While?: VisitNode; + ExpressionWrapper?: VisitNode; + For?: VisitNode; + ForXStatement?: VisitNode; + Function?: VisitNode; + FunctionParent?: VisitNode; + Pureish?: VisitNode; + Literal?: VisitNode; + Immutable?: VisitNode; + UserWhitespacable?: VisitNode; + Method?: VisitNode; + ObjectMember?: VisitNode; + Property?: VisitNode; + UnaryLike?: VisitNode; + Pattern?: VisitNode; + Class?: VisitNode; + ModuleDeclaration?: VisitNode; + ExportDeclaration?: VisitNode; + ModuleSpecifier?: VisitNode; + Flow?: VisitNode; + FlowBaseAnnotation?: VisitNode; + FlowDeclaration?: VisitNode; + JSX?: VisitNode; + } + + export type VisitNode = VisitNodeFunction | VisitNodeObject; + + export type VisitNodeFunction = (path: NodePath, state: any) => void; + + export interface VisitNodeObject { + enter?(path: NodePath, state: any): void; + exit?(path: NodePath, state: any): void; + } + + export class NodePath { + constructor(hub: Hub, parent: Node); + parent: Node; + hub: Hub; + contexts: TraversalContext[]; + data: Object; + shouldSkip: boolean; + shouldStop: boolean; + removed: boolean; + state: any; + opts: Object; + skipKeys: Object; + parentPath: NodePath; + context: TraversalContext; + container: Object | Object[]; + listKey: string; + inList: boolean; + parentKey: string; + key: string; + node: T; + scope: Scope; + type: string; + typeAnnotation: Object; + + getScope(scope: Scope): Scope; + + setData(key: string, val: any): any; + + getData(key: string, def?: any): any; + + buildCodeFrameError(msg: string, Error: Error): Error; + + traverse(visitor: Visitor, state?: any): void; + + set(key: string, node: Node): void; + + getPathLocation(): string; + + debug(buildMessage: Function): void; + + // ------------------------- ancestry ------------------------- + /** + * Call the provided `callback` with the `NodePath`s of all the parents. + * When the `callback` returns a truthy value, we return that node path. + */ + findParent(callback: (path: NodePath) => boolean): NodePath; + + find(callback: (path: NodePath) => boolean): NodePath; + + /** Get the parent function of the current path. */ + getFunctionParent(): NodePath; + + /** Walk up the tree until we hit a parent node path in a list. */ + getStatementParent(): NodePath; + + /** + * Get the deepest common ancestor and then from it, get the earliest relationship path + * to that ancestor. + * + * Earliest is defined as being "before" all the other nodes in terms of list container + * position and visiting key. + */ + getEarliestCommonAncestorFrom(paths: NodePath[]): NodePath; + + /** Get the earliest path in the tree where the provided `paths` intersect. */ + getDeepestCommonAncestorFrom(paths: NodePath[], filter?: Function): NodePath; + + /** + * Build an array of node paths containing the entire ancestry of the current node path. + * + * NOTE: The current node path is included in this. + */ + getAncestry(): NodePath[]; + + inType(...candidateTypes: string[]): boolean; + + // ------------------------- inference ------------------------- + /** Infer the type of the current `NodePath`. */ + getTypeAnnotation(): t.FlowTypeAnnotation; + + isBaseType(baseName: string, soft?: boolean): boolean; + + couldBeBaseType(name: string): boolean; + + baseTypeStrictlyMatches(right: NodePath): boolean; + + isGenericType(genericName: string): boolean; + + // ------------------------- replacement ------------------------- + /** + * Replace a node with an array of multiple. This method performs the following steps: + * + * - Inherit the comments of first provided node with that of the current node. + * - Insert the provided nodes after the current node. + * - Remove the current node. + */ + replaceWithMultiple(nodes: Node[]): void; + + /** + * Parse a string as an expression and replace the current node with the result. + * + * NOTE: This is typically not a good idea to use. Building source strings when + * transforming ASTs is an antipattern and SHOULD NOT be encouraged. Even if it's + * easier to use, your transforms will be extremely brittle. + */ + replaceWithSourceString(replacement: any): void; + + /** Replace the current node with another. */ + replaceWith(replacement: Node | NodePath): void; + + /** + * This method takes an array of statements nodes and then explodes it + * into expressions. This method retains completion records which is + * extremely important to retain original semantics. + */ + replaceExpressionWithStatements(nodes: Node[]): Node; + + replaceInline(nodes: Node | Node[]): void; + + // ------------------------- evaluation ------------------------- + /** + * Walk the input `node` and statically evaluate if it's truthy. + * + * Returning `true` when we're sure that the expression will evaluate to a + * truthy value, `false` if we're sure that it will evaluate to a falsy + * value and `undefined` if we aren't sure. Because of this please do not + * rely on coercion when using this method and check with === if it's false. + */ + evaluateTruthy(): boolean; + + /** + * Walk the input `node` and statically evaluate it. + * + * Returns an object in the form `{ confident, value }`. `confident` indicates + * whether or not we had to drop out of evaluating the expression because of + * hitting an unknown node that we couldn't confidently find the value of. + * + * Example: + * + * t.evaluate(parse("5 + 5")) // { confident: true, value: 10 } + * t.evaluate(parse("!true")) // { confident: true, value: false } + * t.evaluate(parse("foo + foo")) // { confident: false, value: undefined } + */ + evaluate(): { confident: boolean; value: any }; + + // ------------------------- introspection ------------------------- + /** + * Match the current node if it matches the provided `pattern`. + * + * For example, given the match `React.createClass` it would match the + * parsed nodes of `React.createClass` and `React["createClass"]`. + */ + matchesPattern(pattern: string, allowPartial?: boolean): boolean; + + /** + * Check whether we have the input `key`. If the `key` references an array then we check + * if the array has any items, otherwise we just check if it's falsy. + */ + has(key: string): boolean; + + isStatic(): boolean; + + /** Alias of `has`. */ + is(key: string): boolean; + + /** Opposite of `has`. */ + isnt(key: string): boolean; + + /** Check whether the path node `key` strict equals `value`. */ + equals(key: string, value: any): boolean; + + /** + * Check the type against our stored internal type of the node. This is handy when a node has + * been removed yet we still internally know the type and need it to calculate node replacement. + */ + isNodeType(type: string): boolean; + + /** + * This checks whether or not we're in one of the following positions: + * + * for (KEY in right); + * for (KEY;;); + * + * This is because these spots allow VariableDeclarations AND normal expressions so we need + * to tell the path replacement that it's ok to replace this with an expression. + */ + canHaveVariableDeclarationOrExpression(): boolean; + + /** + * This checks whether we are swapping an arrow function's body between an + * expression and a block statement (or vice versa). + * + * This is because arrow functions may implicitly return an expression, which + * is the same as containing a block statement. + */ + canSwapBetweenExpressionAndStatement(replacement: Node): boolean; + + /** Check whether the current path references a completion record */ + isCompletionRecord(allowInsideFunction?: boolean): boolean; + + /** + * Check whether or not the current `key` allows either a single statement or block statement + * so we can explode it if necessary. + */ + isStatementOrBlock(): boolean; + + /** Check if the currently assigned path references the `importName` of `moduleSource`. */ + referencesImport(moduleSource: string, importName: string): boolean; + + /** Get the source code associated with this node. */ + getSource(): string; + + // ------------------------- context ------------------------- + call(key: string): boolean; + + isBlacklisted(): boolean; + + visit(): boolean; + + skip(): void; + + skipKey(key: string): void; + + stop(): void; + + setScope(): void; + + setContext(context: TraversalContext): NodePath; + + popContext(): void; + + pushContext(context: TraversalContext): void; + + // ------------------------- removal ------------------------- + remove(): void; + + // ------------------------- modification ------------------------- + /** Insert the provided nodes before the current one. */ + insertBefore(nodes: Node | Node[]): any; + + /** + * Insert the provided nodes after the current one. When inserting nodes after an + * expression, ensure that the completion record is correct by pushing the current node. + */ + insertAfter(nodes: Node | Node[]): any; + + /** Update all sibling node paths after `fromIndex` by `incrementBy`. */ + updateSiblingKeys(fromIndex: number, incrementBy: number): void; + + /** Hoist the current node to the highest scope possible and return a UID referencing it. */ + hoist(scope: Scope): void; + + // ------------------------- family ------------------------- + getStatementParent(): NodePath; + + getOpposite(): NodePath; + + getCompletionRecords(): NodePath[]; + + getSibling(key: string): NodePath; + + get(key: string, context?: boolean | TraversalContext): NodePath; + + getBindingIdentifiers(duplicates?: boolean): Node[]; + + getOuterBindingIdentifiers(duplicates?: boolean): Node[]; + + // ------------------------- comments ------------------------- + /** Share comments amongst siblings. */ + shareCommentsWithSiblings(): void; + + addComment(type: string, content: string, line?: boolean): void; + + /** Give node `comments` of the specified `type`. */ + addComments(type: string, comments: any[]): void; + + // ------------------------- isXXX ------------------------- + isArrayExpression(opts?: Object): boolean; + isAssignmentExpression(opts?: Object): boolean; + isBinaryExpression(opts?: Object): boolean; + isDirective(opts?: Object): boolean; + isDirectiveLiteral(opts?: Object): boolean; + isBlockStatement(opts?: Object): boolean; + isBreakStatement(opts?: Object): boolean; + isCallExpression(opts?: Object): boolean; + isCatchClause(opts?: Object): boolean; + isConditionalExpression(opts?: Object): boolean; + isContinueStatement(opts?: Object): boolean; + isDebuggerStatement(opts?: Object): boolean; + isDoWhileStatement(opts?: Object): boolean; + isEmptyStatement(opts?: Object): boolean; + isExpressionStatement(opts?: Object): boolean; + isFile(opts?: Object): boolean; + isForInStatement(opts?: Object): boolean; + isForStatement(opts?: Object): boolean; + isFunctionDeclaration(opts?: Object): boolean; + isFunctionExpression(opts?: Object): boolean; + isIdentifier(opts?: Object): boolean; + isIfStatement(opts?: Object): boolean; + isLabeledStatement(opts?: Object): boolean; + isStringLiteral(opts?: Object): boolean; + isNumericLiteral(opts?: Object): boolean; + isNullLiteral(opts?: Object): boolean; + isBooleanLiteral(opts?: Object): boolean; + isRegExpLiteral(opts?: Object): boolean; + isLogicalExpression(opts?: Object): boolean; + isMemberExpression(opts?: Object): boolean; + isNewExpression(opts?: Object): boolean; + isProgram(opts?: Object): boolean; + isObjectExpression(opts?: Object): boolean; + isObjectMethod(opts?: Object): boolean; + isObjectProperty(opts?: Object): boolean; + isRestElement(opts?: Object): boolean; + isReturnStatement(opts?: Object): boolean; + isSequenceExpression(opts?: Object): boolean; + isSwitchCase(opts?: Object): boolean; + isSwitchStatement(opts?: Object): boolean; + isThisExpression(opts?: Object): boolean; + isThrowStatement(opts?: Object): boolean; + isTryStatement(opts?: Object): boolean; + isUnaryExpression(opts?: Object): boolean; + isUpdateExpression(opts?: Object): boolean; + isVariableDeclaration(opts?: Object): boolean; + isVariableDeclarator(opts?: Object): boolean; + isWhileStatement(opts?: Object): boolean; + isWithStatement(opts?: Object): boolean; + isAssignmentPattern(opts?: Object): boolean; + isArrayPattern(opts?: Object): boolean; + isArrowFunctionExpression(opts?: Object): boolean; + isClassBody(opts?: Object): boolean; + isClassDeclaration(opts?: Object): boolean; + isClassExpression(opts?: Object): boolean; + isExportAllDeclaration(opts?: Object): boolean; + isExportDefaultDeclaration(opts?: Object): boolean; + isExportNamedDeclaration(opts?: Object): boolean; + isExportSpecifier(opts?: Object): boolean; + isForOfStatement(opts?: Object): boolean; + isImportDeclaration(opts?: Object): boolean; + isImportDefaultSpecifier(opts?: Object): boolean; + isImportNamespaceSpecifier(opts?: Object): boolean; + isImportSpecifier(opts?: Object): boolean; + isMetaProperty(opts?: Object): boolean; + isClassMethod(opts?: Object): boolean; + isObjectPattern(opts?: Object): boolean; + isSpreadElement(opts?: Object): boolean; + isSuper(opts?: Object): boolean; + isTaggedTemplateExpression(opts?: Object): boolean; + isTemplateElement(opts?: Object): boolean; + isTemplateLiteral(opts?: Object): boolean; + isYieldExpression(opts?: Object): boolean; + isAnyTypeAnnotation(opts?: Object): boolean; + isArrayTypeAnnotation(opts?: Object): boolean; + isBooleanTypeAnnotation(opts?: Object): boolean; + isBooleanLiteralTypeAnnotation(opts?: Object): boolean; + isNullLiteralTypeAnnotation(opts?: Object): boolean; + isClassImplements(opts?: Object): boolean; + isClassProperty(opts?: Object): boolean; + isDeclareClass(opts?: Object): boolean; + isDeclareFunction(opts?: Object): boolean; + isDeclareInterface(opts?: Object): boolean; + isDeclareModule(opts?: Object): boolean; + isDeclareTypeAlias(opts?: Object): boolean; + isDeclareVariable(opts?: Object): boolean; + isExistentialTypeParam(opts?: Object): boolean; + isFunctionTypeAnnotation(opts?: Object): boolean; + isFunctionTypeParam(opts?: Object): boolean; + isGenericTypeAnnotation(opts?: Object): boolean; + isInterfaceExtends(opts?: Object): boolean; + isInterfaceDeclaration(opts?: Object): boolean; + isIntersectionTypeAnnotation(opts?: Object): boolean; + isMixedTypeAnnotation(opts?: Object): boolean; + isNullableTypeAnnotation(opts?: Object): boolean; + isNumericLiteralTypeAnnotation(opts?: Object): boolean; + isNumberTypeAnnotation(opts?: Object): boolean; + isStringLiteralTypeAnnotation(opts?: Object): boolean; + isStringTypeAnnotation(opts?: Object): boolean; + isThisTypeAnnotation(opts?: Object): boolean; + isTupleTypeAnnotation(opts?: Object): boolean; + isTypeofTypeAnnotation(opts?: Object): boolean; + isTypeAlias(opts?: Object): boolean; + isTypeAnnotation(opts?: Object): boolean; + isTypeCastExpression(opts?: Object): boolean; + isTypeParameterDeclaration(opts?: Object): boolean; + isTypeParameterInstantiation(opts?: Object): boolean; + isObjectTypeAnnotation(opts?: Object): boolean; + isObjectTypeCallProperty(opts?: Object): boolean; + isObjectTypeIndexer(opts?: Object): boolean; + isObjectTypeProperty(opts?: Object): boolean; + isQualifiedTypeIdentifier(opts?: Object): boolean; + isUnionTypeAnnotation(opts?: Object): boolean; + isVoidTypeAnnotation(opts?: Object): boolean; + isJSXAttribute(opts?: Object): boolean; + isJSXClosingElement(opts?: Object): boolean; + isJSXElement(opts?: Object): boolean; + isJSXEmptyExpression(opts?: Object): boolean; + isJSXExpressionContainer(opts?: Object): boolean; + isJSXIdentifier(opts?: Object): boolean; + isJSXMemberExpression(opts?: Object): boolean; + isJSXNamespacedName(opts?: Object): boolean; + isJSXOpeningElement(opts?: Object): boolean; + isJSXSpreadAttribute(opts?: Object): boolean; + isJSXText(opts?: Object): boolean; + isNoop(opts?: Object): boolean; + isParenthesizedExpression(opts?: Object): boolean; + isAwaitExpression(opts?: Object): boolean; + isBindExpression(opts?: Object): boolean; + isDecorator(opts?: Object): boolean; + isDoExpression(opts?: Object): boolean; + isExportDefaultSpecifier(opts?: Object): boolean; + isExportNamespaceSpecifier(opts?: Object): boolean; + isRestProperty(opts?: Object): boolean; + isSpreadProperty(opts?: Object): boolean; + isExpression(opts?: Object): boolean; + isBinary(opts?: Object): boolean; + isScopable(opts?: Object): boolean; + isBlockParent(opts?: Object): boolean; + isBlock(opts?: Object): boolean; + isStatement(opts?: Object): boolean; + isTerminatorless(opts?: Object): boolean; + isCompletionStatement(opts?: Object): boolean; + isConditional(opts?: Object): boolean; + isLoop(opts?: Object): boolean; + isWhile(opts?: Object): boolean; + isExpressionWrapper(opts?: Object): boolean; + isFor(opts?: Object): boolean; + isForXStatement(opts?: Object): boolean; + isFunction(opts?: Object): boolean; + isFunctionParent(opts?: Object): boolean; + isPureish(opts?: Object): boolean; + isDeclaration(opts?: Object): boolean; + isLVal(opts?: Object): boolean; + isLiteral(opts?: Object): boolean; + isImmutable(opts?: Object): boolean; + isUserWhitespacable(opts?: Object): boolean; + isMethod(opts?: Object): boolean; + isObjectMember(opts?: Object): boolean; + isProperty(opts?: Object): boolean; + isUnaryLike(opts?: Object): boolean; + isPattern(opts?: Object): boolean; + isClass(opts?: Object): boolean; + isModuleDeclaration(opts?: Object): boolean; + isExportDeclaration(opts?: Object): boolean; + isModuleSpecifier(opts?: Object): boolean; + isFlow(opts?: Object): boolean; + isFlowBaseAnnotation(opts?: Object): boolean; + isFlowDeclaration(opts?: Object): boolean; + isJSX(opts?: Object): boolean; + isNumberLiteral(opts?: Object): boolean; + isRegexLiteral(opts?: Object): boolean; + isReferencedIdentifier(opts?: Object): boolean; + isReferencedMemberExpression(opts?: Object): boolean; + isBindingIdentifier(opts?: Object): boolean; + isScope(opts?: Object): boolean; + isReferenced(opts?: Object): boolean; + isBlockScoped(opts?: Object): boolean; + isVar(opts?: Object): boolean; + isUser(opts?: Object): boolean; + isGenerated(opts?: Object): boolean; + isPure(opts?: Object): boolean; + + // ------------------------- assertXXX ------------------------- + assertArrayExpression(opts?: Object): void; + assertAssignmentExpression(opts?: Object): void; + assertBinaryExpression(opts?: Object): void; + assertDirective(opts?: Object): void; + assertDirectiveLiteral(opts?: Object): void; + assertBlockStatement(opts?: Object): void; + assertBreakStatement(opts?: Object): void; + assertCallExpression(opts?: Object): void; + assertCatchClause(opts?: Object): void; + assertConditionalExpression(opts?: Object): void; + assertContinueStatement(opts?: Object): void; + assertDebuggerStatement(opts?: Object): void; + assertDoWhileStatement(opts?: Object): void; + assertEmptyStatement(opts?: Object): void; + assertExpressionStatement(opts?: Object): void; + assertFile(opts?: Object): void; + assertForInStatement(opts?: Object): void; + assertForStatement(opts?: Object): void; + assertFunctionDeclaration(opts?: Object): void; + assertFunctionExpression(opts?: Object): void; + assertIdentifier(opts?: Object): void; + assertIfStatement(opts?: Object): void; + assertLabeledStatement(opts?: Object): void; + assertStringLiteral(opts?: Object): void; + assertNumericLiteral(opts?: Object): void; + assertNullLiteral(opts?: Object): void; + assertBooleanLiteral(opts?: Object): void; + assertRegExpLiteral(opts?: Object): void; + assertLogicalExpression(opts?: Object): void; + assertMemberExpression(opts?: Object): void; + assertNewExpression(opts?: Object): void; + assertProgram(opts?: Object): void; + assertObjectExpression(opts?: Object): void; + assertObjectMethod(opts?: Object): void; + assertObjectProperty(opts?: Object): void; + assertRestElement(opts?: Object): void; + assertReturnStatement(opts?: Object): void; + assertSequenceExpression(opts?: Object): void; + assertSwitchCase(opts?: Object): void; + assertSwitchStatement(opts?: Object): void; + assertThisExpression(opts?: Object): void; + assertThrowStatement(opts?: Object): void; + assertTryStatement(opts?: Object): void; + assertUnaryExpression(opts?: Object): void; + assertUpdateExpression(opts?: Object): void; + assertVariableDeclaration(opts?: Object): void; + assertVariableDeclarator(opts?: Object): void; + assertWhileStatement(opts?: Object): void; + assertWithStatement(opts?: Object): void; + assertAssignmentPattern(opts?: Object): void; + assertArrayPattern(opts?: Object): void; + assertArrowFunctionExpression(opts?: Object): void; + assertClassBody(opts?: Object): void; + assertClassDeclaration(opts?: Object): void; + assertClassExpression(opts?: Object): void; + assertExportAllDeclaration(opts?: Object): void; + assertExportDefaultDeclaration(opts?: Object): void; + assertExportNamedDeclaration(opts?: Object): void; + assertExportSpecifier(opts?: Object): void; + assertForOfStatement(opts?: Object): void; + assertImportDeclaration(opts?: Object): void; + assertImportDefaultSpecifier(opts?: Object): void; + assertImportNamespaceSpecifier(opts?: Object): void; + assertImportSpecifier(opts?: Object): void; + assertMetaProperty(opts?: Object): void; + assertClassMethod(opts?: Object): void; + assertObjectPattern(opts?: Object): void; + assertSpreadElement(opts?: Object): void; + assertSuper(opts?: Object): void; + assertTaggedTemplateExpression(opts?: Object): void; + assertTemplateElement(opts?: Object): void; + assertTemplateLiteral(opts?: Object): void; + assertYieldExpression(opts?: Object): void; + assertAnyTypeAnnotation(opts?: Object): void; + assertArrayTypeAnnotation(opts?: Object): void; + assertBooleanTypeAnnotation(opts?: Object): void; + assertBooleanLiteralTypeAnnotation(opts?: Object): void; + assertNullLiteralTypeAnnotation(opts?: Object): void; + assertClassImplements(opts?: Object): void; + assertClassProperty(opts?: Object): void; + assertDeclareClass(opts?: Object): void; + assertDeclareFunction(opts?: Object): void; + assertDeclareInterface(opts?: Object): void; + assertDeclareModule(opts?: Object): void; + assertDeclareTypeAlias(opts?: Object): void; + assertDeclareVariable(opts?: Object): void; + assertExistentialTypeParam(opts?: Object): void; + assertFunctionTypeAnnotation(opts?: Object): void; + assertFunctionTypeParam(opts?: Object): void; + assertGenericTypeAnnotation(opts?: Object): void; + assertInterfaceExtends(opts?: Object): void; + assertInterfaceDeclaration(opts?: Object): void; + assertIntersectionTypeAnnotation(opts?: Object): void; + assertMixedTypeAnnotation(opts?: Object): void; + assertNullableTypeAnnotation(opts?: Object): void; + assertNumericLiteralTypeAnnotation(opts?: Object): void; + assertNumberTypeAnnotation(opts?: Object): void; + assertStringLiteralTypeAnnotation(opts?: Object): void; + assertStringTypeAnnotation(opts?: Object): void; + assertThisTypeAnnotation(opts?: Object): void; + assertTupleTypeAnnotation(opts?: Object): void; + assertTypeofTypeAnnotation(opts?: Object): void; + assertTypeAlias(opts?: Object): void; + assertTypeAnnotation(opts?: Object): void; + assertTypeCastExpression(opts?: Object): void; + assertTypeParameterDeclaration(opts?: Object): void; + assertTypeParameterInstantiation(opts?: Object): void; + assertObjectTypeAnnotation(opts?: Object): void; + assertObjectTypeCallProperty(opts?: Object): void; + assertObjectTypeIndexer(opts?: Object): void; + assertObjectTypeProperty(opts?: Object): void; + assertQualifiedTypeIdentifier(opts?: Object): void; + assertUnionTypeAnnotation(opts?: Object): void; + assertVoidTypeAnnotation(opts?: Object): void; + assertJSXAttribute(opts?: Object): void; + assertJSXClosingElement(opts?: Object): void; + assertJSXElement(opts?: Object): void; + assertJSXEmptyExpression(opts?: Object): void; + assertJSXExpressionContainer(opts?: Object): void; + assertJSXIdentifier(opts?: Object): void; + assertJSXMemberExpression(opts?: Object): void; + assertJSXNamespacedName(opts?: Object): void; + assertJSXOpeningElement(opts?: Object): void; + assertJSXSpreadAttribute(opts?: Object): void; + assertJSXText(opts?: Object): void; + assertNoop(opts?: Object): void; + assertParenthesizedExpression(opts?: Object): void; + assertAwaitExpression(opts?: Object): void; + assertBindExpression(opts?: Object): void; + assertDecorator(opts?: Object): void; + assertDoExpression(opts?: Object): void; + assertExportDefaultSpecifier(opts?: Object): void; + assertExportNamespaceSpecifier(opts?: Object): void; + assertRestProperty(opts?: Object): void; + assertSpreadProperty(opts?: Object): void; + assertExpression(opts?: Object): void; + assertBinary(opts?: Object): void; + assertScopable(opts?: Object): void; + assertBlockParent(opts?: Object): void; + assertBlock(opts?: Object): void; + assertStatement(opts?: Object): void; + assertTerminatorless(opts?: Object): void; + assertCompletionStatement(opts?: Object): void; + assertConditional(opts?: Object): void; + assertLoop(opts?: Object): void; + assertWhile(opts?: Object): void; + assertExpressionWrapper(opts?: Object): void; + assertFor(opts?: Object): void; + assertForXStatement(opts?: Object): void; + assertFunction(opts?: Object): void; + assertFunctionParent(opts?: Object): void; + assertPureish(opts?: Object): void; + assertDeclaration(opts?: Object): void; + assertLVal(opts?: Object): void; + assertLiteral(opts?: Object): void; + assertImmutable(opts?: Object): void; + assertUserWhitespacable(opts?: Object): void; + assertMethod(opts?: Object): void; + assertObjectMember(opts?: Object): void; + assertProperty(opts?: Object): void; + assertUnaryLike(opts?: Object): void; + assertPattern(opts?: Object): void; + assertClass(opts?: Object): void; + assertModuleDeclaration(opts?: Object): void; + assertExportDeclaration(opts?: Object): void; + assertModuleSpecifier(opts?: Object): void; + assertFlow(opts?: Object): void; + assertFlowBaseAnnotation(opts?: Object): void; + assertFlowDeclaration(opts?: Object): void; + assertJSX(opts?: Object): void; + assertNumberLiteral(opts?: Object): void; + assertRegexLiteral(opts?: Object): void; + } + + export class Hub { + constructor(file: any, options: any); + file: any; + options: any; + } + + interface TraversalContext { + parentPath: NodePath; + scope: Scope; + state: any; + opts: any; + } +} diff --git a/babel-types/babel-types-tests.ts b/babel-types/babel-types-tests.ts new file mode 100644 index 0000000000..2a8a25a961 --- /dev/null +++ b/babel-types/babel-types-tests.ts @@ -0,0 +1,26 @@ +/// +/// + + +// Examples from https://github.com/thejameskyle/babel-handbook/blob/master/translations/en/plugin-handbook.md#babel-types +import traverse from "babel-traverse"; +import * as t from "babel-types"; + +let ast: t.Node; + +traverse(ast, { + enter(path) { + let node = path.node; + if (t.isIdentifier(node, { name: "n" })) { + node.name = "x"; + } + } +}); + +if (t.isBinaryExpression(ast)) { + ast.left; + ast.right; + ast.operator; +} +t.assertBinaryExpression(ast); +t.assertBinaryExpression(ast, { operator: "*" }); diff --git a/babel-types/babel-types.d.ts b/babel-types/babel-types.d.ts new file mode 100644 index 0000000000..d10302370a --- /dev/null +++ b/babel-types/babel-types.d.ts @@ -0,0 +1,1403 @@ +// Type definitions for babel-types v6.7 +// Project: https://github.com/babel/babel/tree/master/packages/babel-types +// Definitions by: Troy Gerwien +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare module "babel-types" { + + export interface Comment { + value: string; + start: number; + end: number; + loc: SourceLocation; + } + + export interface CommentBlock extends Comment { + type: "CommentBlock"; + } + + export interface CommentLine extends Comment { + type: "CommentLine"; + } + + export interface SourceLocation { + start: { + line: number; + column: number; + }; + + end: { + line: number; + column: number; + }; + } + + export interface Node { + type: string; + leadingComments?: Array; + innerComments?: Array; + trailingComments?: Array; + start: number; + end: number; + loc: SourceLocation; + } + + export interface ArrayExpression extends Node { + type: "ArrayExpression"; + elements: Array; + } + + export interface AssignmentExpression extends Node { + type: "AssignmentExpression"; + operator: "=" | "+=" | "-=" | "*=" | "/=" | "%=" | "<<=" | ">>=" | ">>>=" | "|=" | "^=" | "&="; + left: LVal; + right: Expression; + } + + export interface BinaryExpression extends Node { + type: "BinaryExpression"; + operator: "+" | "-" | "/" | "%" | "*" | "**" | "&" | "|" | ">>" | ">>>" | "<<" | "^" | "==" | "===" | "!=" | "!==" | "in" | "instanceof" | ">" | "<" | ">=" | "<="; + left: Expression; + right: Expression; + } + + export interface Directive extends Node { + type: "Directive"; + value: DirectiveLiteral; + } + + export interface DirectiveLiteral extends Node { + type: "DirectiveLiteral"; + value: string; + } + + export interface BlockStatement extends Node { + type: "BlockStatement"; + directives?: Directive[]; + body: Statement[]; + } + + export interface BreakStatement extends Node { + type: "BreakStatement"; + label: Identifier; + } + + export interface CallExpression extends Node { + type: "CallExpression"; + callee: Expression | Super; + arguments: Array; + } + + export interface CatchClause extends Node { + type: "CatchClause"; + param: Pattern; + body: BlockStatement; + } + + export interface ConditionalExpression extends Node { + type: "ConditionalExpression"; + test: Expression; + consequent: Expression; + alternate: Expression; + } + + export interface ContinueStatement extends Node { + type: "ContinueStatement"; + label: Identifier; + } + + export interface DebuggerStatement extends Node { + type: "DebuggerStatement"; + } + + export interface DoWhileStatement extends Node { + type: "DoWhileStatement"; + test: Expression; + body: Statement; + } + + export interface EmptyStatement extends Node { + type: "EmptyStatement"; + } + + export interface ExpressionStatement extends Node { + type: "ExpressionStatement"; + expression: Expression; + } + + export interface File extends Node { + type: "File"; + program: Program; + comments: Comment[]; + tokens: any[]; + } + + export interface ForInStatement extends Node { + type: "ForInStatement"; + left: VariableDeclaration | LVal; + right: Expression; + body: Statement; + } + + export interface ForStatement extends Node { + type: "ForStatement"; + init: VariableDeclaration | Expression; + test: Expression; + update: Expression; + body: Statement; + } + + export interface FunctionDeclaration extends Node { + type: "FunctionDeclaration"; + id: Identifier; + params: Pattern[]; + body: BlockStatement; + generator: boolean; + async: boolean; + returnType?: TypeAnnotation; + typeParameters?: TypeParameterDeclaration; + } + + export interface FunctionExpression extends Node { + type: "FunctionExpression"; + id: Identifier; + params: Pattern[]; + body: BlockStatement; + generator: boolean; + async: boolean; + returnType?: TypeAnnotation; + typeParameters?: TypeParameterDeclaration; + } + + export interface Identifier extends Node { + type: "Identifier"; + name: string; + typeAnnotation?: TypeAnnotation; + } + + export interface IfStatement extends Node { + type: "IfStatement"; + test: Expression; + consequent: Statement; + alternate: Statement; + } + + export interface LabeledStatement extends Node { + type: "LabeledStatement"; + label: Identifier; + body: Statement; + } + + export interface StringLiteral extends Node { + type: "StringLiteral"; + value: string; + } + + export interface NumericLiteral extends Node { + type: "NumericLiteral"; + value: number; + } + + export interface NullLiteral extends Node { + type: "NullLiteral"; + } + + export interface BooleanLiteral extends Node { + type: "BooleanLiteral"; + value: boolean; + } + + export interface RegExpLiteral extends Node { + type: "RegExpLiteral"; + pattern: string; + flags?: string; + } + + export interface LogicalExpression extends Node { + type: "LogicalExpression"; + operator: "||" | "&&"; + left: Expression; + right: Expression; + } + + export interface MemberExpression extends Node { + type: "MemberExpression"; + object: Expression | Super; + property: Expression; + computed: boolean; + } + + export interface NewExpression extends Node { + type: "NewExpression"; + callee: Expression | Super; + arguments: Array; + } + + export interface Program extends Node { + type: "Program"; + sourceType: "script" | "module"; + directives?: Directive[]; + body: Array; + } + + export interface ObjectExpression extends Node { + type: "ObjectExpression"; + properties: Array; + } + + export interface ObjectMethod extends Node { + type: "ObjectMethod"; + key: Expression; + kind: "get" | "set" | "method"; + shorthand: boolean; + computed: boolean; + value: Expression; + decorators?: Decorator[]; + id: Identifier; + params: Pattern[]; + body: BlockStatement; + generator: boolean; + async: boolean; + returnType?: TypeAnnotation; + typeParameters?: TypeParameterDeclaration; + } + + export interface ObjectProperty extends Node { + type: "ObjectProperty"; + key: Expression; + computed: boolean; + value: Expression; + decorators?: Decorator[]; + shorthand: boolean; + } + + export interface RestElement extends Node { + type: "RestElement"; + argument: LVal; + typeAnnotation?: TypeAnnotation; + } + + export interface ReturnStatement extends Node { + type: "ReturnStatement"; + argument: Expression; + } + + export interface SequenceExpression extends Node { + type: "SequenceExpression"; + expressions: Expression[]; + } + + export interface SwitchCase extends Node { + type: "SwitchCase"; + test: Expression; + consequent: Statement[]; + } + + export interface SwitchStatement extends Node { + type: "SwitchStatement"; + discriminant: Expression; + cases: SwitchCase[]; + } + + export interface ThisExpression extends Node { + type: "ThisExpression"; + } + + export interface ThrowStatement extends Node { + type: "ThrowStatement"; + argument: Expression; + } + + export interface TryStatement extends Node { + type: "TryStatement"; + block: BlockStatement; + handler: CatchClause; + finalizer: BlockStatement; + } + + export interface UnaryExpression extends Node { + type: "UnaryExpression"; + operator: "-" | "+" | "!" | "~" | "typeof" | "void" | "delete"; + prefix: boolean; + argument: Expression; + } + + export interface UpdateExpression extends Node { + type: "UpdateExpression"; + operator: "++" | "--"; + prefix: boolean; + argument: Expression; + } + + export interface VariableDeclaration extends Node { + type: "VariableDeclaration"; + declarations: VariableDeclarator[]; + kind: "var" | "let" | "const"; + } + + export interface VariableDeclarator extends Node { + type: "VariableDeclarator"; + id: LVal; + init: Expression; + } + + export interface WhileStatement extends Node { + type: "WhileStatement"; + test: Expression; + body: Statement; + } + + export interface WithStatement extends Node { + type: "WithStatement"; + object: Expression; + body: BlockStatement | Statement; + } + + export interface AssignmentPattern extends Node { + type: "AssignmentPattern"; + left: Pattern; + right: Expression; + } + + export interface ArrayPattern extends Node { + type: "ArrayPattern"; + elements: Array; + typeAnnotation?: TypeAnnotation; + } + + export interface ArrowFunctionExpression extends Node { + type: "ArrowFunctionExpression"; + id: Identifier; + params: Pattern[]; + body: BlockStatement | Expression; + generator: boolean; + async: boolean; + expression: boolean; + returnType?: TypeAnnotation; + typeParameters?: TypeParameterDeclaration; + } + + export interface ClassBody extends Node { + type: "ClassBody"; + body: Array; + } + + export interface ClassDeclaration extends Node { + type: "ClassDeclaration"; + id: Identifier; + superClass: Expression; + body: ClassBody; + decorators?: Decorator[]; + implements?: ClassImplements[]; + mixins?: any[]; + typeParameters?: TypeParameterDeclaration; + superTypeParameters?: TypeParameterInstantiation; + } + + export interface ClassExpression extends Node { + type: "ClassExpression"; + id: Identifier; + superClass: Expression; + body: ClassBody; + decorators?: Decorator[]; + implements?: ClassImplements[]; + mixins?: any[]; + typeParameters?: TypeParameterDeclaration; + superTypeParameters?: TypeParameterInstantiation; + } + + export interface ExportAllDeclaration extends Node { + type: "ExportAllDeclaration"; + source: StringLiteral; + } + + export interface ExportDefaultDeclaration extends Node { + type: "ExportDefaultDeclaration"; + declaration: Declaration | Expression; + } + + export interface ExportNamedDeclaration extends Node { + type: "ExportNamedDeclaration"; + declaration: Declaration; + specifiers: ExportSpecifier[]; + source: StringLiteral; + } + + export interface ExportSpecifier extends Node { + type: "ExportSpecifier"; + local: Identifier; + imported: Identifier; + exported: Identifier; + } + + export interface ForOfStatement extends Node { + type: "ForOfStatement"; + left: VariableDeclaration | LVal; + right: Expression; + body: Statement; + } + + export interface ImportDeclaration extends Node { + type: "ImportDeclaration"; + specifiers: Array; + source: StringLiteral; + } + + export interface ImportDefaultSpecifier extends Node { + type: "ImportDefaultSpecifier"; + local: Identifier; + } + + export interface ImportNamespaceSpecifier extends Node { + type: "ImportNamespaceSpecifier"; + local: Identifier; + } + + export interface ImportSpecifier extends Node { + type: "ImportSpecifier"; + local: Identifier; + imported: Identifier; + } + + export interface MetaProperty extends Node { + type: "MetaProperty"; + meta: Identifier; + property: Identifier; + } + + export interface ClassMethod extends Node { + type: "ClassMethod"; + key: Expression; + value?: FunctionExpression; + kind: "constructor" | "method" | "get" | "set"; + computed: boolean; + static: boolean; + decorators?: Decorator[]; + id: Identifier; + params: Pattern[]; + body: BlockStatement; + generator: boolean; + async: boolean; + expression: boolean; + returnType?: TypeAnnotation; + typeParameters?: TypeParameterDeclaration; + } + + // See: https://github.com/babel/babel/blob/master/doc/ast/spec.md#objectpattern + export interface AssignmentProperty extends Node { + type: "ObjectProperty"; + key: Expression; + computed: boolean; + value: Pattern; + decorators?: Decorator[]; + shorthand: boolean; + } + + export interface ObjectPattern extends Node { + type: "ObjectPattern"; + properties: Array; + typeAnnotation?: TypeAnnotation; + } + + export interface SpreadElement extends Node { + type: "SpreadElement"; + argument: Expression; + } + + export interface Super extends Node { + type: "Super"; + } + + export interface TaggedTemplateExpression extends Node { + type: "TaggedTemplateExpression"; + tag: Expression; + quasi: TemplateLiteral; + } + + export interface TemplateElement extends Node { + type: "TemplateElement"; + tail: boolean; + value: { + cooked: string; + raw: string; + }; + } + + export interface TemplateLiteral extends Node { + type: "TemplateLiteral"; + quasis: TemplateElement[]; + expressions: Expression[]; + } + + export interface YieldExpression extends Node { + type: "YieldExpression"; + argument: Expression; + delegate: boolean; + } + + export interface AnyTypeAnnotation extends Node { + type: "AnyTypeAnnotation"; + } + + export interface ArrayTypeAnnotation extends Node { + type: "ArrayTypeAnnotation"; + elementType: FlowTypeAnnotation; + } + + export interface BooleanTypeAnnotation extends Node { + type: "BooleanTypeAnnotation"; + } + + export interface BooleanLiteralTypeAnnotation extends Node { + type: "BooleanLiteralTypeAnnotation"; + } + + export interface NullLiteralTypeAnnotation extends Node { + type: "NullLiteralTypeAnnotation"; + } + + export interface ClassImplements extends Node { + type: "ClassImplements"; + id: Identifier; + typeParameters: TypeParameterInstantiation; + } + + export interface ClassProperty extends Node { + type: "ClassProperty"; + key: Identifier; + value: Expression; + decorators?: Decorator[]; + typeAnnotation?: TypeAnnotation; + } + + export interface DeclareClass extends Node { + type: "DeclareClass"; + id: Identifier; + typeParameters: TypeParameterDeclaration; + extends: InterfaceExtends[]; + body: ObjectTypeAnnotation; + } + + export interface DeclareFunction extends Node { + type: "DeclareFunction"; + id: Identifier; + } + + export interface DeclareInterface extends Node { + type: "DeclareInterface"; + id: Identifier; + typeParameters: TypeParameterDeclaration; + extends: InterfaceExtends[]; + body: ObjectTypeAnnotation; + } + + export interface DeclareModule extends Node { + type: "DeclareModule"; + id: StringLiteral | Identifier; + body: BlockStatement; + } + + export interface DeclareTypeAlias extends Node { + type: "DeclareTypeAlias"; + id: Identifier; + typeParameters: TypeParameterDeclaration; + right: FlowTypeAnnotation; + } + + export interface DeclareVariable extends Node { + type: "DeclareVariable"; + id: Identifier; + } + + export interface ExistentialTypeParam extends Node { + type: "ExistentialTypeParam"; + } + + export interface FunctionTypeAnnotation extends Node { + type: "FunctionTypeAnnotation"; + typeParameters: TypeParameterDeclaration; + params: FunctionTypeParam[]; + rest: FunctionTypeParam; + returnType: FlowTypeAnnotation; + } + + export interface FunctionTypeParam extends Node { + type: "FunctionTypeParam"; + name: Identifier; + typeAnnotation: FlowTypeAnnotation; + } + + export interface GenericTypeAnnotation extends Node { + type: "GenericTypeAnnotation"; + id: Identifier; + typeParameters: TypeParameterInstantiation; + } + + export interface InterfaceExtends extends Node { + type: "InterfaceExtends"; + id: Identifier; + typeParameters: TypeParameterInstantiation; + } + + export interface InterfaceDeclaration extends Node { + type: "InterfaceDeclaration"; + id: Identifier; + typeParameters: TypeParameterDeclaration; + extends: InterfaceExtends[]; + mixins?: any[]; + body: ObjectTypeAnnotation; + } + + export interface IntersectionTypeAnnotation extends Node { + type: "IntersectionTypeAnnotation"; + types: FlowTypeAnnotation[]; + } + + export interface MixedTypeAnnotation extends Node { + type: "MixedTypeAnnotation"; + } + + export interface NullableTypeAnnotation extends Node { + type: "NullableTypeAnnotation"; + typeAnnotation: FlowTypeAnnotation; + } + + export interface NumericLiteralTypeAnnotation extends Node { + type: "NumericLiteralTypeAnnotation"; + } + + export interface NumberTypeAnnotation extends Node { + type: "NumberTypeAnnotation"; + } + + export interface StringLiteralTypeAnnotation extends Node { + type: "StringLiteralTypeAnnotation"; + } + + export interface StringTypeAnnotation extends Node { + type: "StringTypeAnnotation"; + } + + export interface ThisTypeAnnotation extends Node { + type: "ThisTypeAnnotation"; + } + + export interface TupleTypeAnnotation extends Node { + type: "TupleTypeAnnotation"; + types: FlowTypeAnnotation[]; + } + + export interface TypeofTypeAnnotation extends Node { + type: "TypeofTypeAnnotation"; + argument: FlowTypeAnnotation; + } + + export interface TypeAlias extends Node { + type: "TypeAlias"; + id: Identifier; + typeParameters: TypeParameterDeclaration; + right: FlowTypeAnnotation; + } + + export interface TypeAnnotation extends Node { + type: "TypeAnnotation"; + typeAnnotation: FlowTypeAnnotation; + } + + export interface TypeCastExpression extends Node { + type: "TypeCastExpression"; + expression: Expression; + typeAnnotation: FlowTypeAnnotation; + } + + export interface TypeParameterDeclaration extends Node { + type: "TypeParameterDeclaration"; + params: Identifier[]; + } + + export interface TypeParameterInstantiation extends Node { + type: "TypeParameterInstantiation"; + params: FlowTypeAnnotation[]; + } + + export interface ObjectTypeAnnotation extends Node { + type: "ObjectTypeAnnotation"; + properties: ObjectTypeProperty[]; + indexers: ObjectTypeIndexer[]; + callProperties: ObjectTypeCallProperty[]; + } + + export interface ObjectTypeCallProperty extends Node { + type: "ObjectTypeCallProperty"; + value: FlowTypeAnnotation; + } + + export interface ObjectTypeIndexer extends Node { + type: "ObjectTypeIndexer"; + id: Expression; + key: FlowTypeAnnotation; + value: FlowTypeAnnotation; + } + + export interface ObjectTypeProperty extends Node { + type: "ObjectTypeProperty"; + key: Expression; + value: FlowTypeAnnotation; + } + + export interface QualifiedTypeIdentifier extends Node { + type: "QualifiedTypeIdentifier"; + id: Identifier; + qualification: Identifier | QualifiedTypeIdentifier; + } + + export interface UnionTypeAnnotation extends Node { + type: "UnionTypeAnnotation"; + types: FlowTypeAnnotation[]; + } + + export interface VoidTypeAnnotation extends Node { + type: "VoidTypeAnnotation"; + } + + export interface JSXAttribute extends Node { + type: "JSXAttribute"; + name: JSXIdentifier | JSXNamespacedName; + value: JSXElement | StringLiteral | JSXExpressionContainer; + } + + export interface JSXClosingElement extends Node { + type: "JSXClosingElement"; + name: JSXIdentifier | JSXMemberExpression; + } + + export interface JSXElement extends Node { + type: "JSXElement"; + openingElement: JSXOpeningElement; + closingElement: JSXClosingElement; + children: Array; + selfClosing?: boolean; + } + + export interface JSXEmptyExpression extends Node { + type: "JSXEmptyExpression"; + } + + export interface JSXExpressionContainer extends Node { + type: "JSXExpressionContainer"; + expression: Expression; + } + + export interface JSXIdentifier extends Node { + type: "JSXIdentifier"; + name: string; + } + + export interface JSXMemberExpression extends Node { + type: "JSXMemberExpression"; + object: JSXMemberExpression | JSXIdentifier; + property: JSXIdentifier; + } + + export interface JSXNamespacedName extends Node { + type: "JSXNamespacedName"; + namespace: JSXIdentifier; + name: JSXIdentifier; + } + + export interface JSXOpeningElement extends Node { + type: "JSXOpeningElement"; + name: JSXIdentifier | JSXMemberExpression; + selfClosing: boolean; + attributes: JSXAttribute[]; + } + + export interface JSXSpreadAttribute extends Node { + type: "JSXSpreadAttribute"; + argument: Expression; + } + + export interface JSXText extends Node { + type: "JSXText"; + value: string; + } + + export interface Noop extends Node { + type: "Noop"; + } + + export interface ParenthesizedExpression extends Node { + type: "ParenthesizedExpression"; + expression: Expression; + } + + export interface AwaitExpression extends Node { + type: "AwaitExpression"; + argument: Expression; + } + + export interface BindExpression extends Node { + type: "BindExpression"; + object: Expression; + callee: Expression; + } + + export interface Decorator extends Node { + type: "Decorator"; + expression: Expression; + } + + export interface DoExpression extends Node { + type: "DoExpression"; + body: BlockStatement; + } + + export interface ExportDefaultSpecifier extends Node { + type: "ExportDefaultSpecifier"; + exported: Identifier; + } + + export interface ExportNamespaceSpecifier extends Node { + type: "ExportNamespaceSpecifier"; + exported: Identifier; + } + + export interface RestProperty extends Node { + type: "RestProperty"; + argument: LVal; + } + + export interface SpreadProperty extends Node { + type: "SpreadProperty"; + argument: Expression; + } + + export type Expression = ArrayExpression | AssignmentExpression | BinaryExpression | CallExpression | ConditionalExpression | FunctionExpression | Identifier | StringLiteral | NumericLiteral | BooleanLiteral | RegExpLiteral | LogicalExpression | MemberExpression | NewExpression | ObjectExpression | SequenceExpression | ThisExpression | UnaryExpression | UpdateExpression | ArrowFunctionExpression | ClassExpression | MetaProperty | Super | TaggedTemplateExpression | TemplateLiteral | YieldExpression | TypeCastExpression | JSXElement | JSXEmptyExpression | JSXIdentifier | JSXMemberExpression | ParenthesizedExpression | AwaitExpression | BindExpression | DoExpression; + export type Binary = BinaryExpression | LogicalExpression; + export type Scopable = BlockStatement | CatchClause | DoWhileStatement | ForInStatement | ForStatement | FunctionDeclaration | FunctionExpression | Program | ObjectMethod | SwitchStatement | WhileStatement | ArrowFunctionExpression | ClassDeclaration | ClassExpression | ForOfStatement | ClassMethod; + export type BlockParent = BlockStatement | DoWhileStatement | ForInStatement | ForStatement | FunctionDeclaration | FunctionExpression | Program | ObjectMethod | SwitchStatement | WhileStatement | ArrowFunctionExpression | ForOfStatement | ClassMethod; + export type Block = BlockStatement | Program; + export type Statement = BlockStatement | BreakStatement | ContinueStatement | DebuggerStatement | DoWhileStatement | EmptyStatement | ExpressionStatement | ForInStatement | ForStatement | FunctionDeclaration | IfStatement | LabeledStatement | ReturnStatement | SwitchStatement | ThrowStatement | TryStatement | VariableDeclaration | WhileStatement | WithStatement | ClassDeclaration | ExportAllDeclaration | ExportDefaultDeclaration | ExportNamedDeclaration | ForOfStatement | ImportDeclaration | DeclareClass | DeclareFunction | DeclareInterface | DeclareModule | DeclareTypeAlias | DeclareVariable | InterfaceDeclaration | TypeAlias; + export type Terminatorless = BreakStatement | ContinueStatement | ReturnStatement | ThrowStatement | YieldExpression | AwaitExpression; + export type CompletionStatement = BreakStatement | ContinueStatement | ReturnStatement | ThrowStatement; + export type Conditional = ConditionalExpression | IfStatement; + export type Loop = DoWhileStatement | ForInStatement | ForStatement | WhileStatement | ForOfStatement; + export type While = DoWhileStatement | WhileStatement; + export type ExpressionWrapper = ExpressionStatement | TypeCastExpression | ParenthesizedExpression; + export type For = ForInStatement | ForStatement | ForOfStatement; + export type ForXStatement = ForInStatement | ForOfStatement; + export type Function = FunctionDeclaration | FunctionExpression | ObjectMethod | ArrowFunctionExpression | ClassMethod; + export type FunctionParent = FunctionDeclaration | FunctionExpression | Program | ObjectMethod | ArrowFunctionExpression | ClassMethod; + export type Pureish = FunctionDeclaration | FunctionExpression | StringLiteral | NumericLiteral | BooleanLiteral | ArrowFunctionExpression | ClassDeclaration | ClassExpression; + export type Declaration = FunctionDeclaration | VariableDeclaration | ClassDeclaration | ExportAllDeclaration | ExportDefaultDeclaration | ExportNamedDeclaration | ImportDeclaration | DeclareClass | DeclareFunction | DeclareInterface | DeclareModule | DeclareTypeAlias | DeclareVariable | InterfaceDeclaration | TypeAlias; + export type LVal = Identifier | MemberExpression | RestElement | AssignmentPattern | ArrayPattern | ObjectPattern; + export type Literal = StringLiteral | NumericLiteral | BooleanLiteral | RegExpLiteral | TemplateLiteral; + export type Immutable = StringLiteral | NumericLiteral | BooleanLiteral | JSXAttribute | JSXClosingElement | JSXElement | JSXExpressionContainer | JSXOpeningElement; + export type UserWhitespacable = ObjectMethod | ObjectProperty | ObjectTypeCallProperty | ObjectTypeIndexer | ObjectTypeProperty; + export type Method = ObjectMethod | ClassMethod; + export type ObjectMember = ObjectMethod | ObjectProperty; + export type Property = ObjectProperty | ClassProperty; + export type UnaryLike = UnaryExpression | SpreadElement | RestProperty | SpreadProperty; + export type Pattern = AssignmentPattern | ArrayPattern | ObjectPattern; + export type Class = ClassDeclaration | ClassExpression; + export type ModuleDeclaration = ExportAllDeclaration | ExportDefaultDeclaration | ExportNamedDeclaration | ImportDeclaration; + export type ExportDeclaration = ExportAllDeclaration | ExportDefaultDeclaration | ExportNamedDeclaration; + export type ModuleSpecifier = ExportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier | ImportSpecifier | ExportDefaultSpecifier | ExportNamespaceSpecifier; + export type Flow = AnyTypeAnnotation | ArrayTypeAnnotation | BooleanTypeAnnotation | BooleanLiteralTypeAnnotation | ClassImplements | ClassProperty | DeclareClass | DeclareFunction | DeclareInterface | DeclareModule | DeclareTypeAlias | DeclareVariable | ExistentialTypeParam | FunctionTypeAnnotation | FunctionTypeParam | GenericTypeAnnotation | InterfaceExtends | InterfaceDeclaration | IntersectionTypeAnnotation | MixedTypeAnnotation | NullableTypeAnnotation | NumericLiteralTypeAnnotation | NumberTypeAnnotation | StringLiteralTypeAnnotation | StringTypeAnnotation | ThisTypeAnnotation | TupleTypeAnnotation | TypeofTypeAnnotation | TypeAlias | TypeAnnotation | TypeCastExpression | TypeParameterDeclaration | TypeParameterInstantiation | ObjectTypeAnnotation | ObjectTypeCallProperty | ObjectTypeIndexer | ObjectTypeProperty | QualifiedTypeIdentifier | UnionTypeAnnotation | VoidTypeAnnotation; + export type FlowTypeAnnotation = AnyTypeAnnotation | ArrayTypeAnnotation | BooleanTypeAnnotation | BooleanLiteralTypeAnnotation | FunctionTypeAnnotation | GenericTypeAnnotation | IntersectionTypeAnnotation | MixedTypeAnnotation | NullableTypeAnnotation | NumericLiteralTypeAnnotation | NumberTypeAnnotation | StringLiteralTypeAnnotation | StringTypeAnnotation | ThisTypeAnnotation | TupleTypeAnnotation | TypeofTypeAnnotation | TypeAnnotation | ObjectTypeAnnotation | UnionTypeAnnotation | VoidTypeAnnotation; + export type FlowBaseAnnotation = AnyTypeAnnotation | BooleanTypeAnnotation | MixedTypeAnnotation | NumberTypeAnnotation | StringTypeAnnotation | ThisTypeAnnotation | VoidTypeAnnotation; + export type FlowDeclaration = DeclareClass | DeclareFunction | DeclareInterface | DeclareModule | DeclareTypeAlias | DeclareVariable | InterfaceDeclaration | TypeAlias; + export type JSX = JSXAttribute | JSXClosingElement | JSXElement | JSXEmptyExpression | JSXExpressionContainer | JSXIdentifier | JSXMemberExpression | JSXNamespacedName | JSXOpeningElement | JSXSpreadAttribute | JSXText; + + export function arrayExpression(elements?: Array): ArrayExpression; + export function assignmentExpression(operator?: string, left?: LVal, right?: Expression): AssignmentExpression; + export function binaryExpression(operator?: "+" | "-" | "/" | "%" | "*" | "**" | "&" | "|" | ">>" | ">>>" | "<<" | "^" | "==" | "===" | "!=" | "!==" | "in" | "instanceof" | ">" | "<" | ">=" | "<=", left?: Expression, right?: Expression): BinaryExpression; + export function directive(value?: DirectiveLiteral): Directive; + export function directiveLiteral(value?: string): DirectiveLiteral; + export function blockStatement(body?: Statement[], directives?: Directive[]): BlockStatement; + export function breakStatement(label?: Identifier): BreakStatement; + export function callExpression(callee?: Expression, _arguments?: Array): CallExpression; + export function catchClause(param?: Identifier, body?: BlockStatement): CatchClause; + export function conditionalExpression(test?: Expression, consequent?: Expression, alternate?: Expression): ConditionalExpression; + export function continueStatement(label?: Identifier): ContinueStatement; + export function debuggerStatement(): DebuggerStatement; + export function doWhileStatement(test?: Expression, body?: Statement): DoWhileStatement; + export function emptyStatement(): EmptyStatement; + export function expressionStatement(expression?: Expression): ExpressionStatement; + export function file(program?: Program, comments?: Comment[], tokens?: any[]): File; + export function forInStatement(left?: VariableDeclaration | LVal, right?: Expression, body?: Statement): ForInStatement; + export function forStatement(init?: VariableDeclaration | Expression, test?: Expression, update?: Expression, body?: Statement): ForStatement; + export function functionDeclaration(id?: Identifier, params?: Pattern[], body?: BlockStatement, generator?: boolean, async?: boolean): FunctionDeclaration; + export function functionExpression(id?: Identifier, params?: Pattern[], body?: BlockStatement, generator?: boolean, async?: boolean): FunctionExpression; + export function identifier(name?: string): Identifier; + export function ifStatement(test?: Expression, consequent?: Statement, alternate?: Statement): IfStatement; + export function labeledStatement(label?: Identifier, body?: Statement): LabeledStatement; + export function stringLiteral(value?: string): StringLiteral; + export function numericLiteral(value?: number): NumericLiteral; + export function nullLiteral(): NullLiteral; + export function booleanLiteral(value?: boolean): BooleanLiteral; + export function regExpLiteral(pattern?: string, flags?: string): RegExpLiteral; + export function logicalExpression(operator?: "||" | "&&", left?: Expression, right?: Expression): LogicalExpression; + export function memberExpression(object?: Expression | Super, property?: Expression, computed?: boolean): MemberExpression; + export function newExpression(callee?: Expression | Super, _arguments?: Array): NewExpression; + export function program(body?: Array, directives?: Directive[]): Program; + export function objectExpression(properties?: Array): ObjectExpression; + export function objectMethod(kind?: "get" | "set" | "method", key?: Expression, params?: Pattern[], body?: BlockStatement, computed?: boolean): ObjectMethod; + export function objectProperty(key?: Expression, value?: Expression, computed?: boolean, shorthand?: boolean, decorators?: Decorator[]): ObjectProperty; + export function restElement(argument?: LVal, typeAnnotation?: TypeAnnotation): RestElement; + export function returnStatement(argument?: Expression): ReturnStatement; + export function sequenceExpression(expressions?: Expression[]): SequenceExpression; + export function switchCase(test?: Expression, consequent?: Statement[]): SwitchCase; + export function switchStatement(discriminant?: Expression, cases?: SwitchCase[]): SwitchStatement; + export function thisExpression(): ThisExpression; + export function throwStatement(argument?: Expression): ThrowStatement; + export function tryStatement(block?: BlockStatement, handler?: CatchClause, finalizer?: BlockStatement): TryStatement; + export function unaryExpression(operator?: "void" | "delete" | "!" | "+" | "-" | "++" | "--" | "~" | "typeof", argument?: Expression, prefix?: boolean): UnaryExpression; + export function updateExpression(operator?: "++" | "--", argument?: Expression, prefix?: boolean): UpdateExpression; + export function variableDeclaration(kind?: "var" | "let" | "const", declarations?: VariableDeclarator[]): VariableDeclaration; + export function variableDeclarator(id?: LVal, init?: Expression): VariableDeclarator; + export function whileStatement(test?: Expression, body?: BlockStatement | Statement): WhileStatement; + export function withStatement(object?: Expression, body?: BlockStatement | Statement): WithStatement; + export function assignmentPattern(left?: Identifier, right?: Expression): AssignmentPattern; + export function arrayPattern(elements?: Array, typeAnnotation?: TypeAnnotation): ArrayPattern; + export function arrowFunctionExpression(params?: Pattern[], body?: BlockStatement | Expression, async?: boolean): ArrowFunctionExpression; + export function classBody(body?: Array): ClassBody; + export function classDeclaration(id?: Identifier, superClass?: Expression, body?: ClassBody, decorators?: Decorator[]): ClassDeclaration; + export function classExpression(id?: Identifier, superClass?: Expression, body?: ClassBody, decorators?: Decorator[]): ClassExpression; + export function exportAllDeclaration(source?: StringLiteral): ExportAllDeclaration; + export function exportDefaultDeclaration(declaration?: FunctionDeclaration | ClassDeclaration | Expression): ExportDefaultDeclaration; + export function exportNamedDeclaration(declaration?: Declaration, specifiers?: ExportSpecifier[], source?: StringLiteral): ExportNamedDeclaration; + export function exportSpecifier(local?: Identifier, exported?: Identifier): ExportSpecifier; + export function forOfStatement(left?: VariableDeclaration | LVal, right?: Expression, body?: Statement): ForOfStatement; + export function importDeclaration(specifiers?: Array, source?: StringLiteral): ImportDeclaration; + export function importDefaultSpecifier(local?: Identifier): ImportDefaultSpecifier; + export function importNamespaceSpecifier(local?: Identifier): ImportNamespaceSpecifier; + export function importSpecifier(local?: Identifier, imported?: Identifier): ImportSpecifier; + export function metaProperty(meta?: string, property?: string): MetaProperty; + export function classMethod(kind?: "constructor" | "method" | "get" | "set", key?: Expression, params?: Pattern[], body?: BlockStatement, computed?: boolean, _static?: boolean): ClassMethod; + export function objectPattern(properties?: Array, typeAnnotation?: TypeAnnotation): ObjectPattern; + export function spreadElement(argument?: Expression): SpreadElement; + export function taggedTemplateExpression(tag?: Expression, quasi?: TemplateLiteral): TaggedTemplateExpression; + export function templateElement(value?: {cooked?: string; raw?: string;}, tail?: boolean): TemplateElement; + export function templateLiteral(quasis?: TemplateElement[], expressions?: Expression[]): TemplateLiteral; + export function yieldExpression(argument?: Expression, delegate?: boolean): YieldExpression; + export function anyTypeAnnotation(): AnyTypeAnnotation; + export function arrayTypeAnnotation(elementType?: FlowTypeAnnotation): ArrayTypeAnnotation; + export function booleanTypeAnnotation(): BooleanTypeAnnotation; + export function booleanLiteralTypeAnnotation(): BooleanLiteralTypeAnnotation; + export function nullLiteralTypeAnnotation(): NullLiteralTypeAnnotation; + export function classImplements(id?: Identifier, typeParameters?: TypeParameterInstantiation): ClassImplements; + export function classProperty(key?: Identifier, value?: Expression, typeAnnotation?: TypeAnnotation, decorators?: Decorator[]): ClassProperty; + export function declareClass(id?: Identifier, typeParameters?: TypeParameterDeclaration, _extends?: InterfaceExtends[], body?: ObjectTypeAnnotation): DeclareClass; + export function declareFunction(id?: Identifier): DeclareFunction; + export function declareInterface(id?: Identifier, typeParameters?: TypeParameterDeclaration, _extends?: InterfaceExtends[], body?: ObjectTypeAnnotation): DeclareInterface; + export function declareModule(id?: StringLiteral | Identifier, body?: BlockStatement): DeclareModule; + export function declareTypeAlias(id?: Identifier, typeParameters?: TypeParameterDeclaration, right?: FlowTypeAnnotation): DeclareTypeAlias; + export function declareVariable(id?: Identifier): DeclareVariable; + export function existentialTypeParam(): ExistentialTypeParam; + export function functionTypeAnnotation(typeParameters?: TypeParameterDeclaration, params?: FunctionTypeParam[], rest?: FunctionTypeParam, returnType?: FlowTypeAnnotation): FunctionTypeAnnotation; + export function functionTypeParam(name?: Identifier, typeAnnotation?: FlowTypeAnnotation): FunctionTypeParam; + export function genericTypeAnnotation(id?: Identifier, typeParameters?: TypeParameterInstantiation): GenericTypeAnnotation; + export function interfaceExtends(id?: Identifier, typeParameters?: TypeParameterInstantiation): InterfaceExtends; + export function interfaceDeclaration(id?: Identifier, typeParameters?: TypeParameterDeclaration, _extends?: InterfaceExtends[], body?: ObjectTypeAnnotation): InterfaceDeclaration; + export function intersectionTypeAnnotation(types?: FlowTypeAnnotation[]): IntersectionTypeAnnotation; + export function mixedTypeAnnotation(): MixedTypeAnnotation; + export function nullableTypeAnnotation(typeAnnotation?: FlowTypeAnnotation): NullableTypeAnnotation; + export function numericLiteralTypeAnnotation(): NumericLiteralTypeAnnotation; + export function numberTypeAnnotation(): NumberTypeAnnotation; + export function stringLiteralTypeAnnotation(): StringLiteralTypeAnnotation; + export function stringTypeAnnotation(): StringTypeAnnotation; + export function thisTypeAnnotation(): ThisTypeAnnotation; + export function tupleTypeAnnotation(types?: FlowTypeAnnotation[]): TupleTypeAnnotation; + export function typeofTypeAnnotation(argument?: FlowTypeAnnotation): TypeofTypeAnnotation; + export function typeAlias(id?: Identifier, typeParameters?: TypeParameterDeclaration, right?: FlowTypeAnnotation): TypeAlias; + export function typeAnnotation(typeAnnotation?: FlowTypeAnnotation): TypeAnnotation; + export function typeCastExpression(expression?: Expression, typeAnnotation?: FlowTypeAnnotation): TypeCastExpression; + export function typeParameterDeclaration(params?: Identifier[]): TypeParameterDeclaration; + export function typeParameterInstantiation(params?: FlowTypeAnnotation[]): TypeParameterInstantiation; + export function objectTypeAnnotation(properties?: ObjectTypeProperty[], indexers?: ObjectTypeIndexer[], callProperties?: ObjectTypeCallProperty[]): ObjectTypeAnnotation; + export function objectTypeCallProperty(value?: FlowTypeAnnotation): ObjectTypeCallProperty; + export function objectTypeIndexer(id?: Expression, key?: FlowTypeAnnotation, value?: FlowTypeAnnotation): ObjectTypeIndexer; + export function objectTypeProperty(key?: Expression, value?: FlowTypeAnnotation): ObjectTypeProperty; + export function qualifiedTypeIdentifier(id?: Identifier, qualification?: Identifier | QualifiedTypeIdentifier): QualifiedTypeIdentifier; + export function unionTypeAnnotation(types?: FlowTypeAnnotation[]): UnionTypeAnnotation; + export function voidTypeAnnotation(): VoidTypeAnnotation; + export function jSXAttribute(name?: JSXIdentifier | JSXNamespacedName, value?: JSXElement | StringLiteral | JSXExpressionContainer): JSXAttribute; + export function jSXClosingElement(name?: JSXIdentifier | JSXMemberExpression): JSXClosingElement; + export function jSXElement(openingElement?: JSXOpeningElement, closingElement?: JSXClosingElement, children?: Array, selfClosing?: boolean): JSXElement; + export function jSXEmptyExpression(): JSXEmptyExpression; + export function jSXExpressionContainer(expression?: Expression): JSXExpressionContainer; + export function jSXIdentifier(name?: string): JSXIdentifier; + export function jSXMemberExpression(object?: JSXMemberExpression | JSXIdentifier, property?: JSXIdentifier): JSXMemberExpression; + export function jSXNamespacedName(namespace?: JSXIdentifier, name?: JSXIdentifier): JSXNamespacedName; + export function jSXOpeningElement(name?: JSXIdentifier | JSXMemberExpression, attributes?: JSXAttribute[], selfClosing?: boolean): JSXOpeningElement; + export function jSXSpreadAttribute(argument?: Expression): JSXSpreadAttribute; + export function jSXText(value?: string): JSXText; + export function noop(): Noop; + export function parenthesizedExpression(expression?: Expression): ParenthesizedExpression; + export function awaitExpression(argument?: Expression): AwaitExpression; + export function bindExpression(object?: Expression, callee?: Expression): BindExpression; + export function decorator(expression?: Expression): Decorator; + export function doExpression(body?: BlockStatement): DoExpression; + export function exportDefaultSpecifier(exported?: Identifier): ExportDefaultSpecifier; + export function exportNamespaceSpecifier(exported?: Identifier): ExportNamespaceSpecifier; + export function restProperty(argument?: LVal): RestProperty; + export function spreadProperty(argument?: Expression): SpreadProperty; + + export function isArrayExpression(node: Object, opts?: Object): node is ArrayExpression; + export function isAssignmentExpression(node: Object, opts?: Object): node is AssignmentExpression; + export function isBinaryExpression(node: Object, opts?: Object): node is BinaryExpression; + export function isDirective(node: Object, opts?: Object): node is Directive; + export function isDirectiveLiteral(node: Object, opts?: Object): node is DirectiveLiteral; + export function isBlockStatement(node: Object, opts?: Object): node is BlockStatement; + export function isBreakStatement(node: Object, opts?: Object): node is BreakStatement; + export function isCallExpression(node: Object, opts?: Object): node is CallExpression; + export function isCatchClause(node: Object, opts?: Object): node is CatchClause; + export function isConditionalExpression(node: Object, opts?: Object): node is ConditionalExpression; + export function isContinueStatement(node: Object, opts?: Object): node is ContinueStatement; + export function isDebuggerStatement(node: Object, opts?: Object): node is DebuggerStatement; + export function isDoWhileStatement(node: Object, opts?: Object): node is DoWhileStatement; + export function isEmptyStatement(node: Object, opts?: Object): node is EmptyStatement; + export function isExpressionStatement(node: Object, opts?: Object): node is ExpressionStatement; + export function isFile(node: Object, opts?: Object): node is File; + export function isForInStatement(node: Object, opts?: Object): node is ForInStatement; + export function isForStatement(node: Object, opts?: Object): node is ForStatement; + export function isFunctionDeclaration(node: Object, opts?: Object): node is FunctionDeclaration; + export function isFunctionExpression(node: Object, opts?: Object): node is FunctionExpression; + export function isIdentifier(node: Object, opts?: Object): node is Identifier; + export function isIfStatement(node: Object, opts?: Object): node is IfStatement; + export function isLabeledStatement(node: Object, opts?: Object): node is LabeledStatement; + export function isStringLiteral(node: Object, opts?: Object): node is StringLiteral; + export function isNumericLiteral(node: Object, opts?: Object): node is NumericLiteral; + export function isNullLiteral(node: Object, opts?: Object): node is NullLiteral; + export function isBooleanLiteral(node: Object, opts?: Object): node is BooleanLiteral; + export function isRegExpLiteral(node: Object, opts?: Object): node is RegExpLiteral; + export function isLogicalExpression(node: Object, opts?: Object): node is LogicalExpression; + export function isMemberExpression(node: Object, opts?: Object): node is MemberExpression; + export function isNewExpression(node: Object, opts?: Object): node is NewExpression; + export function isProgram(node: Object, opts?: Object): node is Program; + export function isObjectExpression(node: Object, opts?: Object): node is ObjectExpression; + export function isObjectMethod(node: Object, opts?: Object): node is ObjectMethod; + export function isObjectProperty(node: Object, opts?: Object): node is ObjectProperty; + export function isRestElement(node: Object, opts?: Object): node is RestElement; + export function isReturnStatement(node: Object, opts?: Object): node is ReturnStatement; + export function isSequenceExpression(node: Object, opts?: Object): node is SequenceExpression; + export function isSwitchCase(node: Object, opts?: Object): node is SwitchCase; + export function isSwitchStatement(node: Object, opts?: Object): node is SwitchStatement; + export function isThisExpression(node: Object, opts?: Object): node is ThisExpression; + export function isThrowStatement(node: Object, opts?: Object): node is ThrowStatement; + export function isTryStatement(node: Object, opts?: Object): node is TryStatement; + export function isUnaryExpression(node: Object, opts?: Object): node is UnaryExpression; + export function isUpdateExpression(node: Object, opts?: Object): node is UpdateExpression; + export function isVariableDeclaration(node: Object, opts?: Object): node is VariableDeclaration; + export function isVariableDeclarator(node: Object, opts?: Object): node is VariableDeclarator; + export function isWhileStatement(node: Object, opts?: Object): node is WhileStatement; + export function isWithStatement(node: Object, opts?: Object): node is WithStatement; + export function isAssignmentPattern(node: Object, opts?: Object): node is AssignmentPattern; + export function isArrayPattern(node: Object, opts?: Object): node is ArrayPattern; + export function isArrowFunctionExpression(node: Object, opts?: Object): node is ArrowFunctionExpression; + export function isClassBody(node: Object, opts?: Object): node is ClassBody; + export function isClassDeclaration(node: Object, opts?: Object): node is ClassDeclaration; + export function isClassExpression(node: Object, opts?: Object): node is ClassExpression; + export function isExportAllDeclaration(node: Object, opts?: Object): node is ExportAllDeclaration; + export function isExportDefaultDeclaration(node: Object, opts?: Object): node is ExportDefaultDeclaration; + export function isExportNamedDeclaration(node: Object, opts?: Object): node is ExportNamedDeclaration; + export function isExportSpecifier(node: Object, opts?: Object): node is ExportSpecifier; + export function isForOfStatement(node: Object, opts?: Object): node is ForOfStatement; + export function isImportDeclaration(node: Object, opts?: Object): node is ImportDeclaration; + export function isImportDefaultSpecifier(node: Object, opts?: Object): node is ImportDefaultSpecifier; + export function isImportNamespaceSpecifier(node: Object, opts?: Object): node is ImportNamespaceSpecifier; + export function isImportSpecifier(node: Object, opts?: Object): node is ImportSpecifier; + export function isMetaProperty(node: Object, opts?: Object): node is MetaProperty; + export function isClassMethod(node: Object, opts?: Object): node is ClassMethod; + export function isObjectPattern(node: Object, opts?: Object): node is ObjectPattern; + export function isSpreadElement(node: Object, opts?: Object): node is SpreadElement; + export function isSuper(node: Object, opts?: Object): node is Super; + export function isTaggedTemplateExpression(node: Object, opts?: Object): node is TaggedTemplateExpression; + export function isTemplateElement(node: Object, opts?: Object): node is TemplateElement; + export function isTemplateLiteral(node: Object, opts?: Object): node is TemplateLiteral; + export function isYieldExpression(node: Object, opts?: Object): node is YieldExpression; + export function isAnyTypeAnnotation(node: Object, opts?: Object): node is AnyTypeAnnotation; + export function isArrayTypeAnnotation(node: Object, opts?: Object): node is ArrayTypeAnnotation; + export function isBooleanTypeAnnotation(node: Object, opts?: Object): node is BooleanTypeAnnotation; + export function isBooleanLiteralTypeAnnotation(node: Object, opts?: Object): node is BooleanLiteralTypeAnnotation; + export function isNullLiteralTypeAnnotation(node: Object, opts?: Object): node is NullLiteralTypeAnnotation; + export function isClassImplements(node: Object, opts?: Object): node is ClassImplements; + export function isClassProperty(node: Object, opts?: Object): node is ClassProperty; + export function isDeclareClass(node: Object, opts?: Object): node is DeclareClass; + export function isDeclareFunction(node: Object, opts?: Object): node is DeclareFunction; + export function isDeclareInterface(node: Object, opts?: Object): node is DeclareInterface; + export function isDeclareModule(node: Object, opts?: Object): node is DeclareModule; + export function isDeclareTypeAlias(node: Object, opts?: Object): node is DeclareTypeAlias; + export function isDeclareVariable(node: Object, opts?: Object): node is DeclareVariable; + export function isExistentialTypeParam(node: Object, opts?: Object): node is ExistentialTypeParam; + export function isFunctionTypeAnnotation(node: Object, opts?: Object): node is FunctionTypeAnnotation; + export function isFunctionTypeParam(node: Object, opts?: Object): node is FunctionTypeParam; + export function isGenericTypeAnnotation(node: Object, opts?: Object): node is GenericTypeAnnotation; + export function isInterfaceExtends(node: Object, opts?: Object): node is InterfaceExtends; + export function isInterfaceDeclaration(node: Object, opts?: Object): node is InterfaceDeclaration; + export function isIntersectionTypeAnnotation(node: Object, opts?: Object): node is IntersectionTypeAnnotation; + export function isMixedTypeAnnotation(node: Object, opts?: Object): node is MixedTypeAnnotation; + export function isNullableTypeAnnotation(node: Object, opts?: Object): node is NullableTypeAnnotation; + export function isNumericLiteralTypeAnnotation(node: Object, opts?: Object): node is NumericLiteralTypeAnnotation; + export function isNumberTypeAnnotation(node: Object, opts?: Object): node is NumberTypeAnnotation; + export function isStringLiteralTypeAnnotation(node: Object, opts?: Object): node is StringLiteralTypeAnnotation; + export function isStringTypeAnnotation(node: Object, opts?: Object): node is StringTypeAnnotation; + export function isThisTypeAnnotation(node: Object, opts?: Object): node is ThisTypeAnnotation; + export function isTupleTypeAnnotation(node: Object, opts?: Object): node is TupleTypeAnnotation; + export function isTypeofTypeAnnotation(node: Object, opts?: Object): node is TypeofTypeAnnotation; + export function isTypeAlias(node: Object, opts?: Object): node is TypeAlias; + export function isTypeAnnotation(node: Object, opts?: Object): node is TypeAnnotation; + export function isTypeCastExpression(node: Object, opts?: Object): node is TypeCastExpression; + export function isTypeParameterDeclaration(node: Object, opts?: Object): node is TypeParameterDeclaration; + export function isTypeParameterInstantiation(node: Object, opts?: Object): node is TypeParameterInstantiation; + export function isObjectTypeAnnotation(node: Object, opts?: Object): node is ObjectTypeAnnotation; + export function isObjectTypeCallProperty(node: Object, opts?: Object): node is ObjectTypeCallProperty; + export function isObjectTypeIndexer(node: Object, opts?: Object): node is ObjectTypeIndexer; + export function isObjectTypeProperty(node: Object, opts?: Object): node is ObjectTypeProperty; + export function isQualifiedTypeIdentifier(node: Object, opts?: Object): node is QualifiedTypeIdentifier; + export function isUnionTypeAnnotation(node: Object, opts?: Object): node is UnionTypeAnnotation; + export function isVoidTypeAnnotation(node: Object, opts?: Object): node is VoidTypeAnnotation; + export function isJSXAttribute(node: Object, opts?: Object): node is JSXAttribute; + export function isJSXClosingElement(node: Object, opts?: Object): node is JSXClosingElement; + export function isJSXElement(node: Object, opts?: Object): node is JSXElement; + export function isJSXEmptyExpression(node: Object, opts?: Object): node is JSXEmptyExpression; + export function isJSXExpressionContainer(node: Object, opts?: Object): node is JSXExpressionContainer; + export function isJSXIdentifier(node: Object, opts?: Object): node is JSXIdentifier; + export function isJSXMemberExpression(node: Object, opts?: Object): node is JSXMemberExpression; + export function isJSXNamespacedName(node: Object, opts?: Object): node is JSXNamespacedName; + export function isJSXOpeningElement(node: Object, opts?: Object): node is JSXOpeningElement; + export function isJSXSpreadAttribute(node: Object, opts?: Object): node is JSXSpreadAttribute; + export function isJSXText(node: Object, opts?: Object): node is JSXText; + export function isNoop(node: Object, opts?: Object): node is Noop; + export function isParenthesizedExpression(node: Object, opts?: Object): node is ParenthesizedExpression; + export function isAwaitExpression(node: Object, opts?: Object): node is AwaitExpression; + export function isBindExpression(node: Object, opts?: Object): node is BindExpression; + export function isDecorator(node: Object, opts?: Object): node is Decorator; + export function isDoExpression(node: Object, opts?: Object): node is DoExpression; + export function isExportDefaultSpecifier(node: Object, opts?: Object): node is ExportDefaultSpecifier; + export function isExportNamespaceSpecifier(node: Object, opts?: Object): node is ExportNamespaceSpecifier; + export function isRestProperty(node: Object, opts?: Object): node is RestProperty; + export function isSpreadProperty(node: Object, opts?: Object): node is SpreadProperty; + export function isExpression(node: Object, opts?: Object): node is Expression; + export function isBinary(node: Object, opts?: Object): node is Binary; + export function isScopable(node: Object, opts?: Object): node is Scopable; + export function isBlockParent(node: Object, opts?: Object): node is BlockParent; + export function isBlock(node: Object, opts?: Object): node is Block; + export function isStatement(node: Object, opts?: Object): node is Statement; + export function isTerminatorless(node: Object, opts?: Object): node is Terminatorless; + export function isCompletionStatement(node: Object, opts?: Object): node is CompletionStatement; + export function isConditional(node: Object, opts?: Object): node is Conditional; + export function isLoop(node: Object, opts?: Object): node is Loop; + export function isWhile(node: Object, opts?: Object): node is While; + export function isExpressionWrapper(node: Object, opts?: Object): node is ExpressionWrapper; + export function isFor(node: Object, opts?: Object): node is For; + export function isForXStatement(node: Object, opts?: Object): node is ForXStatement; + export function isFunction(node: Object, opts?: Object): node is Function; + export function isFunctionParent(node: Object, opts?: Object): node is FunctionParent; + export function isPureish(node: Object, opts?: Object): node is Pureish; + export function isDeclaration(node: Object, opts?: Object): node is Declaration; + export function isLVal(node: Object, opts?: Object): node is LVal; + export function isLiteral(node: Object, opts?: Object): node is Literal; + export function isImmutable(node: Object, opts?: Object): node is Immutable; + export function isUserWhitespacable(node: Object, opts?: Object): node is UserWhitespacable; + export function isMethod(node: Object, opts?: Object): node is Method; + export function isObjectMember(node: Object, opts?: Object): node is ObjectMember; + export function isProperty(node: Object, opts?: Object): node is Property; + export function isUnaryLike(node: Object, opts?: Object): node is UnaryLike; + export function isPattern(node: Object, opts?: Object): node is Pattern; + export function isClass(node: Object, opts?: Object): node is Class; + export function isModuleDeclaration(node: Object, opts?: Object): node is ModuleDeclaration; + export function isExportDeclaration(node: Object, opts?: Object): node is ExportDeclaration; + export function isModuleSpecifier(node: Object, opts?: Object): node is ModuleSpecifier; + export function isFlow(node: Object, opts?: Object): node is Flow; + export function isFlowBaseAnnotation(node: Object, opts?: Object): node is FlowBaseAnnotation; + export function isFlowDeclaration(node: Object, opts?: Object): node is FlowDeclaration; + export function isJSX(node: Object, opts?: Object): node is JSX; + export function isNumberLiteral(node: Object, opts?: Object): node is NumericLiteral; + export function isRegexLiteral(node: Object, opts?: Object): node is RegExpLiteral; + + export function isReferencedIdentifier(node: Object, opts?: Object): boolean; + export function isReferencedMemberExpression(node: Object, opts?: Object): boolean; + export function isBindingIdentifier(node: Object, opts?: Object): boolean; + export function isScope(node: Object, opts?: Object): boolean; + export function isReferenced(node: Object, opts?: Object): boolean; + export function isBlockScoped(node: Object, opts?: Object): boolean; + export function isVar(node: Object, opts?: Object): boolean; + export function isUser(node: Object, opts?: Object): boolean; + export function isGenerated(node: Object, opts?: Object): boolean; + export function isPure(node: Object, opts?: Object): boolean; + + export function assertArrayExpression(node: Object, opts?: Object): void; + export function assertAssignmentExpression(node: Object, opts?: Object): void; + export function assertBinaryExpression(node: Object, opts?: Object): void; + export function assertDirective(node: Object, opts?: Object): void; + export function assertDirectiveLiteral(node: Object, opts?: Object): void; + export function assertBlockStatement(node: Object, opts?: Object): void; + export function assertBreakStatement(node: Object, opts?: Object): void; + export function assertCallExpression(node: Object, opts?: Object): void; + export function assertCatchClause(node: Object, opts?: Object): void; + export function assertConditionalExpression(node: Object, opts?: Object): void; + export function assertContinueStatement(node: Object, opts?: Object): void; + export function assertDebuggerStatement(node: Object, opts?: Object): void; + export function assertDoWhileStatement(node: Object, opts?: Object): void; + export function assertEmptyStatement(node: Object, opts?: Object): void; + export function assertExpressionStatement(node: Object, opts?: Object): void; + export function assertFile(node: Object, opts?: Object): void; + export function assertForInStatement(node: Object, opts?: Object): void; + export function assertForStatement(node: Object, opts?: Object): void; + export function assertFunctionDeclaration(node: Object, opts?: Object): void; + export function assertFunctionExpression(node: Object, opts?: Object): void; + export function assertIdentifier(node: Object, opts?: Object): void; + export function assertIfStatement(node: Object, opts?: Object): void; + export function assertLabeledStatement(node: Object, opts?: Object): void; + export function assertStringLiteral(node: Object, opts?: Object): void; + export function assertNumericLiteral(node: Object, opts?: Object): void; + export function assertNullLiteral(node: Object, opts?: Object): void; + export function assertBooleanLiteral(node: Object, opts?: Object): void; + export function assertRegExpLiteral(node: Object, opts?: Object): void; + export function assertLogicalExpression(node: Object, opts?: Object): void; + export function assertMemberExpression(node: Object, opts?: Object): void; + export function assertNewExpression(node: Object, opts?: Object): void; + export function assertProgram(node: Object, opts?: Object): void; + export function assertObjectExpression(node: Object, opts?: Object): void; + export function assertObjectMethod(node: Object, opts?: Object): void; + export function assertObjectProperty(node: Object, opts?: Object): void; + export function assertRestElement(node: Object, opts?: Object): void; + export function assertReturnStatement(node: Object, opts?: Object): void; + export function assertSequenceExpression(node: Object, opts?: Object): void; + export function assertSwitchCase(node: Object, opts?: Object): void; + export function assertSwitchStatement(node: Object, opts?: Object): void; + export function assertThisExpression(node: Object, opts?: Object): void; + export function assertThrowStatement(node: Object, opts?: Object): void; + export function assertTryStatement(node: Object, opts?: Object): void; + export function assertUnaryExpression(node: Object, opts?: Object): void; + export function assertUpdateExpression(node: Object, opts?: Object): void; + export function assertVariableDeclaration(node: Object, opts?: Object): void; + export function assertVariableDeclarator(node: Object, opts?: Object): void; + export function assertWhileStatement(node: Object, opts?: Object): void; + export function assertWithStatement(node: Object, opts?: Object): void; + export function assertAssignmentPattern(node: Object, opts?: Object): void; + export function assertArrayPattern(node: Object, opts?: Object): void; + export function assertArrowFunctionExpression(node: Object, opts?: Object): void; + export function assertClassBody(node: Object, opts?: Object): void; + export function assertClassDeclaration(node: Object, opts?: Object): void; + export function assertClassExpression(node: Object, opts?: Object): void; + export function assertExportAllDeclaration(node: Object, opts?: Object): void; + export function assertExportDefaultDeclaration(node: Object, opts?: Object): void; + export function assertExportNamedDeclaration(node: Object, opts?: Object): void; + export function assertExportSpecifier(node: Object, opts?: Object): void; + export function assertForOfStatement(node: Object, opts?: Object): void; + export function assertImportDeclaration(node: Object, opts?: Object): void; + export function assertImportDefaultSpecifier(node: Object, opts?: Object): void; + export function assertImportNamespaceSpecifier(node: Object, opts?: Object): void; + export function assertImportSpecifier(node: Object, opts?: Object): void; + export function assertMetaProperty(node: Object, opts?: Object): void; + export function assertClassMethod(node: Object, opts?: Object): void; + export function assertObjectPattern(node: Object, opts?: Object): void; + export function assertSpreadElement(node: Object, opts?: Object): void; + export function assertSuper(node: Object, opts?: Object): void; + export function assertTaggedTemplateExpression(node: Object, opts?: Object): void; + export function assertTemplateElement(node: Object, opts?: Object): void; + export function assertTemplateLiteral(node: Object, opts?: Object): void; + export function assertYieldExpression(node: Object, opts?: Object): void; + export function assertAnyTypeAnnotation(node: Object, opts?: Object): void; + export function assertArrayTypeAnnotation(node: Object, opts?: Object): void; + export function assertBooleanTypeAnnotation(node: Object, opts?: Object): void; + export function assertBooleanLiteralTypeAnnotation(node: Object, opts?: Object): void; + export function assertNullLiteralTypeAnnotation(node: Object, opts?: Object): void; + export function assertClassImplements(node: Object, opts?: Object): void; + export function assertClassProperty(node: Object, opts?: Object): void; + export function assertDeclareClass(node: Object, opts?: Object): void; + export function assertDeclareFunction(node: Object, opts?: Object): void; + export function assertDeclareInterface(node: Object, opts?: Object): void; + export function assertDeclareModule(node: Object, opts?: Object): void; + export function assertDeclareTypeAlias(node: Object, opts?: Object): void; + export function assertDeclareVariable(node: Object, opts?: Object): void; + export function assertExistentialTypeParam(node: Object, opts?: Object): void; + export function assertFunctionTypeAnnotation(node: Object, opts?: Object): void; + export function assertFunctionTypeParam(node: Object, opts?: Object): void; + export function assertGenericTypeAnnotation(node: Object, opts?: Object): void; + export function assertInterfaceExtends(node: Object, opts?: Object): void; + export function assertInterfaceDeclaration(node: Object, opts?: Object): void; + export function assertIntersectionTypeAnnotation(node: Object, opts?: Object): void; + export function assertMixedTypeAnnotation(node: Object, opts?: Object): void; + export function assertNullableTypeAnnotation(node: Object, opts?: Object): void; + export function assertNumericLiteralTypeAnnotation(node: Object, opts?: Object): void; + export function assertNumberTypeAnnotation(node: Object, opts?: Object): void; + export function assertStringLiteralTypeAnnotation(node: Object, opts?: Object): void; + export function assertStringTypeAnnotation(node: Object, opts?: Object): void; + export function assertThisTypeAnnotation(node: Object, opts?: Object): void; + export function assertTupleTypeAnnotation(node: Object, opts?: Object): void; + export function assertTypeofTypeAnnotation(node: Object, opts?: Object): void; + export function assertTypeAlias(node: Object, opts?: Object): void; + export function assertTypeAnnotation(node: Object, opts?: Object): void; + export function assertTypeCastExpression(node: Object, opts?: Object): void; + export function assertTypeParameterDeclaration(node: Object, opts?: Object): void; + export function assertTypeParameterInstantiation(node: Object, opts?: Object): void; + export function assertObjectTypeAnnotation(node: Object, opts?: Object): void; + export function assertObjectTypeCallProperty(node: Object, opts?: Object): void; + export function assertObjectTypeIndexer(node: Object, opts?: Object): void; + export function assertObjectTypeProperty(node: Object, opts?: Object): void; + export function assertQualifiedTypeIdentifier(node: Object, opts?: Object): void; + export function assertUnionTypeAnnotation(node: Object, opts?: Object): void; + export function assertVoidTypeAnnotation(node: Object, opts?: Object): void; + export function assertJSXAttribute(node: Object, opts?: Object): void; + export function assertJSXClosingElement(node: Object, opts?: Object): void; + export function assertJSXElement(node: Object, opts?: Object): void; + export function assertJSXEmptyExpression(node: Object, opts?: Object): void; + export function assertJSXExpressionContainer(node: Object, opts?: Object): void; + export function assertJSXIdentifier(node: Object, opts?: Object): void; + export function assertJSXMemberExpression(node: Object, opts?: Object): void; + export function assertJSXNamespacedName(node: Object, opts?: Object): void; + export function assertJSXOpeningElement(node: Object, opts?: Object): void; + export function assertJSXSpreadAttribute(node: Object, opts?: Object): void; + export function assertJSXText(node: Object, opts?: Object): void; + export function assertNoop(node: Object, opts?: Object): void; + export function assertParenthesizedExpression(node: Object, opts?: Object): void; + export function assertAwaitExpression(node: Object, opts?: Object): void; + export function assertBindExpression(node: Object, opts?: Object): void; + export function assertDecorator(node: Object, opts?: Object): void; + export function assertDoExpression(node: Object, opts?: Object): void; + export function assertExportDefaultSpecifier(node: Object, opts?: Object): void; + export function assertExportNamespaceSpecifier(node: Object, opts?: Object): void; + export function assertRestProperty(node: Object, opts?: Object): void; + export function assertSpreadProperty(node: Object, opts?: Object): void; + export function assertExpression(node: Object, opts?: Object): void; + export function assertBinary(node: Object, opts?: Object): void; + export function assertScopable(node: Object, opts?: Object): void; + export function assertBlockParent(node: Object, opts?: Object): void; + export function assertBlock(node: Object, opts?: Object): void; + export function assertStatement(node: Object, opts?: Object): void; + export function assertTerminatorless(node: Object, opts?: Object): void; + export function assertCompletionStatement(node: Object, opts?: Object): void; + export function assertConditional(node: Object, opts?: Object): void; + export function assertLoop(node: Object, opts?: Object): void; + export function assertWhile(node: Object, opts?: Object): void; + export function assertExpressionWrapper(node: Object, opts?: Object): void; + export function assertFor(node: Object, opts?: Object): void; + export function assertForXStatement(node: Object, opts?: Object): void; + export function assertFunction(node: Object, opts?: Object): void; + export function assertFunctionParent(node: Object, opts?: Object): void; + export function assertPureish(node: Object, opts?: Object): void; + export function assertDeclaration(node: Object, opts?: Object): void; + export function assertLVal(node: Object, opts?: Object): void; + export function assertLiteral(node: Object, opts?: Object): void; + export function assertImmutable(node: Object, opts?: Object): void; + export function assertUserWhitespacable(node: Object, opts?: Object): void; + export function assertMethod(node: Object, opts?: Object): void; + export function assertObjectMember(node: Object, opts?: Object): void; + export function assertProperty(node: Object, opts?: Object): void; + export function assertUnaryLike(node: Object, opts?: Object): void; + export function assertPattern(node: Object, opts?: Object): void; + export function assertClass(node: Object, opts?: Object): void; + export function assertModuleDeclaration(node: Object, opts?: Object): void; + export function assertExportDeclaration(node: Object, opts?: Object): void; + export function assertModuleSpecifier(node: Object, opts?: Object): void; + export function assertFlow(node: Object, opts?: Object): void; + export function assertFlowBaseAnnotation(node: Object, opts?: Object): void; + export function assertFlowDeclaration(node: Object, opts?: Object): void; + export function assertJSX(node: Object, opts?: Object): void; + export function assertNumberLiteral(node: Object, opts?: Object): void; + export function assertRegexLiteral(node: Object, opts?: Object): void; +} diff --git a/babylon/babylon-tests.ts b/babylon/babylon-tests.ts new file mode 100644 index 0000000000..16a6998037 --- /dev/null +++ b/babylon/babylon-tests.ts @@ -0,0 +1,24 @@ +/// +/// +/// + + +// Example from https://github.com/thejameskyle/babel-handbook/blob/master/translations/en/plugin-handbook.md#babylon +import * as babylon from "babylon"; +declare function assert(expr: boolean): void; + +const code = `function square(n) { + return n * n; +}`; + +let node = babylon.parse(code); +assert(node.type === "File"); +assert(node.start === 0); +assert(node.end === 38); +assert(node.loc.start > node.loc.end); + + +babylon.parse(code, { + sourceType: "module", // default: "script" + plugins: ["jsx"] // default: [] +}); diff --git a/babylon/babylon.d.ts b/babylon/babylon.d.ts new file mode 100644 index 0000000000..88be6dab84 --- /dev/null +++ b/babylon/babylon.d.ts @@ -0,0 +1,48 @@ +// Type definitions for babylon v6.7 +// Project: https://github.com/babel/babylon +// Definitions by: Troy Gerwien +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare module "babylon" { + import * as t from 'babel-types'; + type Node = t.Node; + + export function parse(code: string, opts?: BabylonOptions): Node; + + export interface BabylonOptions { + /** + * By default, import and export declarations can only appear at a program's top level. + * Setting this option to true allows them anywhere where a statement is allowed. + */ + allowImportExportEverywhere?: boolean; + + /** + * By default, a return statement at the top level raises an error. Set this to true to accept such code. + */ + allowReturnOutsideFunction?: boolean; + + allowSuperOutsideMethod?: boolean; + + /** + * Indicate the mode the code should be parsed in. Can be either "script" or "module". + */ + sourceType?: 'script' | 'module'; + + /** + * Correlate output AST nodes with their source filename. Useful when + * generating code and source maps from the ASTs of multiple input files. + */ + sourceFilename?: string; + + /** + * Array containing the plugins that you want to enable. + */ + plugins?: PluginName[]; + } + + export type PluginName = 'jsx' | 'flow' | 'asyncFunctions' | 'classConstructorCall' | 'doExpressions' + | 'trailingFunctionCommas' | 'objectRestSpread' | 'decorators' | 'classProperties' | 'exportExtensions' + | 'exponentiationOperator' | 'asyncGenerators' | 'functionBind' | 'functionSent'; +} diff --git a/backbone-fetch-cache/backbone-fetch-cache-tests.ts b/backbone-fetch-cache/backbone-fetch-cache-tests.ts new file mode 100644 index 0000000000..e2eb532690 --- /dev/null +++ b/backbone-fetch-cache/backbone-fetch-cache-tests.ts @@ -0,0 +1,81 @@ +/// + +import * as Backbone from "backbone-fetch-cache"; + +// static methods / properties + +const fc: BackboneFetchCache.Static = Backbone.fetchCache; + +fc.enabled = true; +fc.localStorage = true; + +const opts: BackboneFetchCache.GetCacheOptions = {url: "string url", data: {}}; +const strKey: string = "string key"; +const getCacheKeyOpts = {getCacheKey: () => "string key"}; + +let cache: BackboneFetchCache.Cache +cache = fc.getCache(strKey); +cache = fc.getCache(() => strKey); +cache = fc.getCache(getCacheKeyOpts); +cache = fc.getCache({url: strKey}); +cache = fc.getCache({url: () => strKey}); +cache = fc.getCache(strKey, opts); + +const cacheExpires: number = cache.expires; +const cacheLastSync: number = cache.lastSync; +const cachePrefillExpires: number = cache.prefillExpires; +const cacheValue: any = cache.value; + +let key: string; +key = fc.getCacheKey(strKey); +key = fc.getCacheKey(strKey, opts); +key = fc.getCacheKey(getCacheKeyOpts); + +let lastSync: number; +lastSync = fc.getLastSync(strKey, opts); +lastSync = fc.getLastSync(getCacheKeyOpts, opts); + +fc.getLocalStorage(); +const localStorageKey: string = fc.getLocalStorageKey(); + +fc.priorityFn = (a: BackboneFetchCache.Cache, b: BackboneFetchCache.Cache) => 12345; + +fc.reset(); + +const setOpts: BackboneFetchCache.SetCacheOptions = { + data: {}, + url: strKey, + cache: true, + expires: 12345, + prefill: true, + prefillExpires: 12345, +}; +fc.setCache(strKey, setOpts, {}); + +fc.setLocalStorage(); + +// instance methods + +const modelOpts: Backbone.ModelFetchWithCacheOptions = { + cache: true, + expires: new Date().getTime(), + prefill: true, + prefillExpires: new Date().getTime(), + prefillSuccess: (self: any, attributes: any, opts: Backbone.ModelFetchWithCacheOptions) => { }, + context: {}, +}; + +const hoge = new Backbone.Model; +hoge.fetch(modelOpts); + +const collectionOpts: Backbone.CollectionFetchWithCacheOptions = { + cache: true, + context: {}, + expires: new Date().getTime(), + prefill: true, + prefillExpires: new Date().getTime(), + prefillSuccess: (self: any) => { }, +}; + +const fuga = new Backbone.Collection; +fuga.fetch(collectionOpts); diff --git a/backbone-fetch-cache/backbone-fetch-cache.d.ts b/backbone-fetch-cache/backbone-fetch-cache.d.ts new file mode 100644 index 0000000000..449db1c667 --- /dev/null +++ b/backbone-fetch-cache/backbone-fetch-cache.d.ts @@ -0,0 +1,189 @@ +// Type definitions for backbone-fetch-cache 1.4.0 +// Project: https://github.com/madglory/backbone-fetch-cache +// Definitions by: delphinus +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare namespace BackboneFetchCache { + + interface SuperMethods { + + modelFetch(options?: Backbone.ModelFetchOptions): JQueryXHR; + modelSync(...arg: any[]): JQueryXHR; + collectionFetch(options?: Backbone.CollectionFetchOptions): JQueryXHR; + } + + interface GetCacheOptions { + + data?: any; + url?: string; + } + + interface SetCacheOptions extends GetCacheOptions { + + cache: boolean; + expires: boolean | number; + prefill: boolean; + prefillExpires: boolean | number; + } + + interface Cache { + + expires: number; + lastSync: number; + prefillExpires: number; + value: any; + } + + interface GetCacheKeyObject { + + getCacheKey?: (opts?: GetCacheOptions) => string; + url?: () => string; + } + + type GetCacheKeyOptions = string | {url: string} | GetCacheKeyObject; + + interface Static { + + /** + * Global flag to enable/disable caching + */ + enabled: boolean; + + /** + * By default the cache is persisted in localStorage (if available). + * Set Backbone.fetchCache.localStorage = false to disable this. + */ + localStorage: boolean; + + /** + * Sometimes you just need to clear a cached item manually. + * Backbone.fetchCache.clearItem() can be called safely from anywhere + * in your application. It will take your backbone Model or Collection, + * a function that returns the key String, or the key String itself. If + * you pass in a Model or Collection, the .getCacheKey() method will be + * checked before the url property. + */ + clearItem(...args: any[]): any; + + /** + * You can explicitly fetch a cached item, without having to call the + * models/collection fetch. This might be useful for debugging and + * testing. + */ + getCache(key: () => string, opts?: GetCacheOptions): Cache; + getCache(key: GetCacheKeyOptions, opts?: GetCacheOptions): Cache; + + getCacheKey(key: () => string, opts?: GetCacheOptions): string; + getCacheKey(key: GetCacheKeyOptions, opts?: GetCacheOptions): string; + + /** + * If you want to know when was the last (server) sync of a given key, you can use. + */ + getLastSync(key: () => string, opts?: GetCacheOptions): number; + getLastSync(key: GetCacheKeyOptions, opts?: GetCacheOptions): number; + + getLocalStorage(): void; + getLocalStorageKey(): string; + + /** + * When setting items in localStorage, the browser may throw a + * QUOTA_EXCEEDED_ERR, meaning the store is full. Backbone.fetchCache + * tries to work around this problem by deleting what it considers the + * most stale item to make space for the new data. The staleness of + * data is determined by the sorting function priorityFn, which by + * default returns the oldest item. + */ + priorityFn(a: Cache, b: Cache): number; + + reset(): void; + + setCache(instance: () => string, opts?: SetCacheOptions, attrs?: any): void; + setCache(instance: GetCacheKeyOptions, opts?: SetCacheOptions, attrs?: any): void; + + setLocalStorage(...args: any[]): any; + + _superMethods: SuperMethods; + } +} + +declare module Backbone { + + var fetchCache: BackboneFetchCache.Static; + + /** + * The most used API hook for Backbone Fetch Cache is the Model and + * Collection #.fetch() method. Here are the options you can pass into that + * method to get behaviour particular to Backbone Fetch Cache. + */ + interface ModelFetchWithCacheOptions extends ModelFetchOptions { + + /** + * Calls to modelInstance.fetch or collectionInstance.fetch will be + * fulfilled from the cache (if possible) when cache: true is set in + * the options hash. + */ + cache?: boolean; + + context?: any; + + /** + * Cache values expire after 5 minutes by default. You can adjust this + * by passing expires: to the fetch call. Set to false to + * never expire. + */ + expires?: number; + + /** + * This option allows the model/collection to be populated from the + * cache immediately and then be updated once the call to fetch has + * completed. The initial cache hit calls the prefillSuccess callback + * and then the AJAX success/error callbacks are called as normal when + * the request is complete. This allows the page to render something + * immediately and then update it after the request completes. (Note: + * the prefillSuccess callback will not fire if the data is not found + * in the cache.) + * + * prefill and prefillExpires options can be used with the promises + * interface like so (note: the progress event will not fire if the + * data is not found in the cache.). + * + * prefillExpires affects prefill in the following ways: + * + * 1. If the cache doesn't hold the requested data, just fetch it + * (usual behaviour) + * 2. If the cache holds an expired version of the requested data, just + * fetch it (usual behaviour) + * 3. If the cache holds requested data that is neither expired nor + * prefill expired, just return it and don't do a fetch / prefill + * callback (usual cache behavior, unusual prefill behaviour) + * 4. If the cache holds requested data that isn't expired but is + * prefill expired, use the prefill callback and do a fetch (usual + * prefill behaviour) + */ + prefill?: boolean; + prefillExpires?: number; + prefillSuccess?: (self: any, attributes: any, opts: ModelFetchWithCacheOptions) => void; + } + + interface CollectionFetchWithCacheOptions extends ModelFetchWithCacheOptions { + + prefillSuccess?: (self: any) => void; + } + + interface ModelWithCache extends Model { + + fetch(options?: ModelFetchWithCacheOptions): JQueryXHR; + } + + interface CollectionWithCache extends Collection { + + fetch(options?: CollectionFetchWithCacheOptions): JQueryXHR; + } +} + +declare module "backbone-fetch-cache" { + + export = Backbone; +} diff --git a/backbone.radio/backbone.radio-tests.ts b/backbone.radio/backbone.radio-tests.ts index 295c552af2..764fb65943 100644 --- a/backbone.radio/backbone.radio-tests.ts +++ b/backbone.radio/backbone.radio-tests.ts @@ -101,4 +101,10 @@ function TestGlobalApiAndChannels() { Backbone.Radio.reply('auth', 'authenticate', onStart); Backbone.Radio.request('auth', 'authenticate', 'pelle', 42); -} \ No newline at end of file +} + +import Radio = require('backbone.radio'); +function TestImport() { + var channel: Backbone.Radio.Channel = Radio.channel('channel-name'); + channel.command('show:view'); +} diff --git a/backbone.radio/backbone.radio.d.ts b/backbone.radio/backbone.radio.d.ts index 50895b0275..dd049ec1fe 100644 --- a/backbone.radio/backbone.radio.d.ts +++ b/backbone.radio/backbone.radio.d.ts @@ -90,3 +90,9 @@ declare namespace Backbone { } } } + +declare module 'backbone.radio' { + import Backbone = require('backbone'); + + export = Backbone.Radio; +} diff --git a/backbone/backbone-global.d.ts b/backbone/backbone-global.d.ts index be849cee04..ef0a10f006 100644 --- a/backbone/backbone-global.d.ts +++ b/backbone/backbone-global.d.ts @@ -9,6 +9,7 @@ declare namespace Backbone { interface AddOptions extends Silenceable { at?: number; + merge?: boolean; } interface HistoryOptions extends Silenceable { @@ -311,11 +312,11 @@ 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; - loadUrl(fragmentOverride: string): boolean; + loadUrl(fragmentOverride?: string): boolean; navigate(fragment: string, options?: any): boolean; static started: boolean; options: any; @@ -328,6 +329,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/backbone/backbone-tests.ts b/backbone/backbone-tests.ts index 3669a6c4e1..50632712a6 100644 --- a/backbone/backbone-tests.ts +++ b/backbone/backbone-tests.ts @@ -166,6 +166,9 @@ function test_collection() { ////////// Backbone.history.start(); +Backbone.History.started; +Backbone.history.loadUrl(); +Backbone.history.loadUrl('12345'); namespace v1Changes { namespace events { diff --git a/bezier-js/bezier-js-tests.ts b/bezier-js/bezier-js-tests.ts new file mode 100644 index 0000000000..1814d67dc0 --- /dev/null +++ b/bezier-js/bezier-js-tests.ts @@ -0,0 +1,95 @@ +/// + +function test() { + + var bezierjs: typeof BezierJs; + + var bezier = new bezierjs.Bezier([1,2,3,4]); + var cap = new bezierjs.BezierCap([]); + var point: BezierJs.Point = { x: 0, y: 0 }; + var utils = bezier.getUtils(); + var line: BezierJs.Line = { p1: { x:0, y: 0}, p2: {x:1, y: 1}}; + var abc: BezierJs.ABC = { A: null, B: null, C: null }; + var arc: BezierJs.Arc = { e: 0, s: 0, x: 0, y: 0, r: 1 }; + var bbox: BezierJs.BBox = bezier.bbox(); + var closest: BezierJs.Closest = { mdist: 1, mpos: 0 }; + var inflection: BezierJs.Inflection = { values: null, x: [0], y: [0], z:[0] }; + var minmax: BezierJs.MinMax = { min: 0, max: 0 }; + var offset: BezierJs.Offset = { x: 0, y: 0, c: point, n: point }; + var pair: BezierJs.Pair = { left: bezier, right: bezier }; + var poly: BezierJs.PolyBezier = bezier.outline(1); + var projection: BezierJs.Projection = { x: 0, y: 0, t: 9, d: 4 }; + var shape: BezierJs.Shape = { startcap: cap, endcap: cap, forward: bezier, back: bezier, bbox: bbox }; + var split: BezierJs.Split = { left: bezier, right: bezier, span: [point] }; + + bezier.arcs(); + bezier.clockwise; + bezier.compute(.5); + bezier.computedirection(); + bezier.curveintersects([bezier], [bezier]); + bezier.derivative(0); + bezier.get(1); + bezier.getLUT()[0].x; + bezier.hull(0); + bezier.inflections().values; + bezier.intersects(bezier); + bezier.length(); + bezier.lineIntersects(line); + bezier.normal(0); + bezier.offset(1,2); + bezier.on(point, 0); + bezier.order = 5; + bezier.outlineshapes(1,3); + bezier.overlaps(bezier); + bezier.point(9); + bezier.project(point); + bezier.raise(); + bezier.reduce(); + bezier.scale(4); + bezier.selfintersects(); + bezier.simple(); + bezier.split(0, 1); + bezier.toSVG(); + bezier.update(); + + cap.virtual = true; + + poly.addCurve(bezier); + poly.bbox(); + poly.curve(7); + poly.curves[0]._3d; + poly.length(); + poly.offset(9).points[0].y; + poly.points[0]; + + utils.abcratio(0, 1); + utils.align([point], line); + utils.angle(point, point, point); + utils.approximately(5, 7, .001); + utils.arcfn(1, function(){}); + utils.bboxoverlap(bbox, bbox); + utils.between(0, 0, 1); + utils.closest([point], point); + utils.copy({}); + utils.dist(point, point); + utils.droots([9]); + utils.expandbox(bbox, bbox); + utils.findbbox([bezier]); + utils.getccenter(point, point, point); + utils.getminmax(bezier, 'x', [0]); + utils.length(function(){}); + utils.lerp(1, point, point); + utils.lli(offset, offset); + utils.lli4(point, point, point, point); + utils.lli8(0, 0, 0, 0, 0, 0, 0, 0); + utils.makeline(point, point); + utils.makeshape(bezier, bezier); + utils.map(0, 0, 0, 0, 0); + utils.pairiteration(bezier, bezier); + utils.pointsToString([point]); + utils.projectionratio(0, 0); + utils.roots([point], line); + utils.round(.999, .001); + utils.shapeintersections(shape, bbox, shape, bbox); + +} \ No newline at end of file diff --git a/bezier-js/bezier-js.d.ts b/bezier-js/bezier-js.d.ts new file mode 100644 index 0000000000..7d54a19d95 --- /dev/null +++ b/bezier-js/bezier-js.d.ts @@ -0,0 +1,197 @@ +// Type definitions for Bezier.js +// Project: https://github.com/Pomax/bezierjs +// Definitions by: Dan Marshall +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +declare module BezierJs { + interface Point { + x: number; + y: number; + z?: number; + } + interface Projection extends Point { + t?: number; + d?: number; + } + interface Inflection { + x: number[]; + y: number[]; + z?: number[]; + values: number[]; + } + interface Offset extends Point { + c: Point; + n: Point; + } + interface Pair { + left: Bezier; + right: Bezier; + } + interface Split extends Pair { + span: Point[]; + _t1?: number; + _t2?: number; + } + interface MinMax { + min: number; + mid?: number; + max: number; + size?: number; + } + interface BBox { + x: MinMax; + y: MinMax; + z?: MinMax; + } + interface Line { + p1: Point; + p2: Point; + } + interface Arc extends Point { + e: number; + r: number; + s: number; + } + interface Shape { + startcap: BezierCap; + forward: Bezier; + back: Bezier; + endcap: BezierCap; + bbox: BBox; + } + interface ABC { + A: Point; + B: Point; + C: Point; + } + interface Closest { + mdist: number; + mpos: number; + } + /** + * Bezier curve constructor. The constructor argument can be one of three things: + * + * 1. array/4 of {x:..., y:..., z:...}, z optional + * 2. numerical array/8 ordered x1,y1,x2,y2,x3,y3,x4,y4 + * 3. numerical array/12 ordered x1,y1,z1,x2,y2,z2,x3,y3,z3,x4,y4,z4 + * + */ + class Bezier { + clockwise: boolean; + private _linear; + _3d: boolean; + _t1: number; + _t2: number; + _lut: Point[]; + dpoints: Point[][]; + order: number; + points: Point[]; + dims: string[]; + dimlen: number; + constructor(points: Point[]); + constructor(coords: number[]); + constructor(n1: number, n2: number, n3: number, n4: number, n5: number, n6: number, n7: number, n8: number); + constructor(p1: Point, p2: Point, p3: Point, p4?: Point); + static fromSVG(svgString: string): Bezier; + static getABC(n: number, S: Point, B: Point, E: Point, t: number): ABC; + static quadraticFromPoints(p1: Point, p2: Point, p3: Point, t: number): Bezier; + static cubicFromPoints(S: Point, B: Point, E: Point, t: number, d1: number): Bezier; + static getUtils(): typeof utils; + getUtils(): typeof utils; + valueOf(): string; + toString(): string; + toSVG(): string; + update(): void; + computedirection(): void; + length(): number; + getLUT(steps?: number): Point[]; + on(point: Point, error: number): number; + project(point: Point): Projection; + get(t: number): Point; + point(idx: number): Point; + compute(t: number): Point; + raise(): Bezier; + derivative(t: number): Point; + inflections(): number[]; + normal(t: number): Point; + private __normal2(t); + private __normal3(t); + private __normal(t); + hull(t: number): Point[]; + split(t1: number, t2?: number): Bezier | Split; + extrema(): Inflection; + bbox(): BBox; + overlaps(curve: Bezier): boolean; + offset(t: number, d?: number): Offset | Bezier[]; + simple(): boolean; + reduce(): any[]; + scale(d: Function): Bezier; + scale(d: number): Bezier; + outline(d1: number, d2?: number, d3?: number, d4?: number): PolyBezier; + outlineshapes(d1: number, d2: number): Shape[]; + intersects(curve: Bezier): string[] | number[]; + intersects(curve: Line): string[] | number[]; + lineIntersects(line: Line): number[]; + selfintersects(): string[]; + curveintersects(c1: Bezier[], c2: Bezier[]): string[]; + arcs(errorThreshold?: number): Arc[]; + private _error(pc, np1, s, e); + private _iterate(errorThreshold, circles); + } + class BezierCap extends Bezier { + virtual: boolean; + } +} +declare module BezierJs.utils { + var Tvalues: number[]; + var Cvalues: number[]; + function arcfn(t: number, derivativeFn: Function): number; + function between(v: number, m: number, M: number): boolean; + function approximately(a: number, b: number, precision?: number): boolean; + function length(derivativeFn: Function): number; + function map(v: number, ds: number, de: number, ts: number, te: number): number; + function lerp(r: number, v1: Point, v2: Point): Point; + function pointToString(p: Point): string; + function pointsToString(points: Point[]): string; + function copy(obj: Object): any; + function angle(o: Point, v1: Point, v2: Point): number; + function round(v: number, d: number): number; + function dist(p1: Point, p2: Point): number; + function closest(LUT: Point[], point: Point): Closest; + function abcratio(t: number, n: number): number; + function projectionratio(t: number, n: number): number; + function lli8(x1: number, y1: number, x2: number, y2: number, x3: number, y3: number, x4: number, y4: number): Point; + function lli4(p1: Point, p2: Point, p3: Point, p4: Point): Point; + function lli(v1: Offset, v2: Offset): Point; + function makeline(p1: Point, p2: Point): Bezier; + function findbbox(sections: Bezier[]): BBox; + function shapeintersections(s1: Shape, bbox1: BBox, s2: Shape, bbox2: BBox): string[][] | number[][]; + function makeshape(forward: Bezier, back: Bezier): Shape; + function getminmax(curve: Bezier, d: string, list: number[]): MinMax; + function align(points: Point[], line: Line): Point[]; + function roots(points: Point[], line: Line): number[]; + function droots(p: number[]): number[]; + function inflections(points: Point[]): number[]; + function bboxoverlap(b1: BBox, b2: BBox): boolean; + function expandbox(bbox: BBox, _bbox: BBox): void; + function pairiteration(c1: Bezier, c2: Bezier): string[]; + function getccenter(p1: Point, p2: Point, p3: Point): Arc; +} +declare module BezierJs { + /** + * Poly Bezier + * @param {[type]} curves [description] + */ + class PolyBezier { + curves: Bezier[]; + private _3d; + points: Point[]; + constructor(curves: Bezier[]); + valueOf(): string; + toString(): string; + addCurve(curve: Bezier): void; + length(): number; + curve(idx: number): Bezier; + bbox(): BBox; + offset(d: number): PolyBezier; + } +} diff --git a/bookshelf/bookshelf-tests.ts b/bookshelf/bookshelf-tests.ts index 42faf0909e..5d6080b99a 100644 --- a/bookshelf/bookshelf-tests.ts +++ b/bookshelf/bookshelf-tests.ts @@ -1,30 +1,68 @@ /// /// +/// +/// import * as Knex from 'knex'; import * as Bookshelf from 'bookshelf'; +import * as assert from 'assert'; +import * as express from 'express'; + + +/** + * The examples/tests below follow Bookshelf documentation chapter after chapter: http://bookshelfjs.org/ + */ + + +/* Installation, see http://bookshelfjs.org/#installation */ var knex = Knex({ - client: 'sqlite3', + client: 'mysql', connection: { - filename: ':memory:', - }, + host : '127.0.0.1', + user : 'your_database_user', + password : 'your_database_password', + database : 'myapp_test', + charset : 'utf8' + } }); -// Examples - var bookshelf = Bookshelf(knex); -class User extends bookshelf.Model { - get tableName() { return 'users'; } - messages() : Bookshelf.Collection { - return this.hasMany(Posts); +{ + class User extends bookshelf.Model { + get tableName() { return 'users'; } + } + + // In a file named something like bookshelf.js + const dbConfig: Knex.Config = {}; + var knex = Knex(dbConfig); + + // elsewhere, to use the bookshelf client: + var bookshelf = Bookshelf(knex); + + class Post extends bookshelf.Model { + // ... } } -class Posts extends bookshelf.Model { +/* Examples, see http://bookshelfjs.org/#examples */ + +var bookshelf = Bookshelf(knex); + +bookshelf.plugin('registry'); +bookshelf.plugin(['virtuals']); + +class User extends bookshelf.Model { + get tableName() { return 'users'; } + messages(): Bookshelf.Collection { + return this.hasMany(Post); + } +} + +class Post extends bookshelf.Model { get tableName() { return 'messages'; } - tags() : Bookshelf.Collection { + tags(): Bookshelf.Collection { return this.belongsToMany(Tag); } } @@ -33,67 +71,1256 @@ class Tag extends bookshelf.Model { get tableName() { return 'tags'; } } -new User({}).where('id', 1).fetch({withRelated: ['posts.tags']}) +new User().where('id', 1).fetch({withRelated: ['posts.tags']}) .then(user => { - console.log(user.related('posts').toJSON()); + const posts = user.related('posts'); + console.log(posts.toJSON()); }).catch(err => { console.error(err); }); +/* Plugins, see http://bookshelfjs.org/#plugins */ -// Associations +/* Support, see http://bookshelfjs.org/#support */ + +/* F.A.Q., see http://bookshelfjs.org/#faq*/ + +/* Associations, see http://bookshelfjs.org/#associations */ + +/* One-to-one, see http://bookshelfjs.org/#one-to-one */ class Book extends bookshelf.Model { get tableName() { return 'books'; } - summary() { + summary(): Summary { return this.hasOne(Summary); } - pages() { - return this.hasMany(Pages); + pages(): Bookshelf.Collection { + return this.hasMany(Page); } - authors() { + authors(): Bookshelf.Collection { return this.belongsToMany(Author); } } class Summary extends bookshelf.Model { get tableName() { return 'summaries'; } - book() : Book { + book(): Book { return this.belongsTo(Book); } } -class Pages extends bookshelf.Model { +exports.up = (knex: Knex) => { + return knex.schema.createTable('books', table => { + table.increments('id').primary(); + table.string('name'); + }).createTable('summaries', table => { + table.increments('id').primary(); + table.string('details'); + table.integer('book_id').unique().references('books.id'); + }); +}; + +exports.down = (knex: Knex) => { + return knex.schema.dropTable('books') + .dropTable('summaries'); +}; + +/* One-to-many, see http://bookshelfjs.org/#one-to-many */ + +class Page extends bookshelf.Model { get tableName() { return 'pages'; } - book() { + book(): Book { return this.belongsTo(Book); } } +exports.up = (knex: Knex) => { + return knex.schema.createTable('books', table => { + table.increments('id').primary(); + table.string('name'); + }).createTable('pages', table => { + table.increments('id').primary(); + table.string('content'); + table.integer('book_id').references('books.id') + }); +}; + +exports.down = (knex: Knex) => { + return knex.schema.dropTable('books') + .dropTable('pages'); +}; + +/* Many-to-many, see http://bookshelfjs.org/#many-to-many */ + class Author extends bookshelf.Model { - get tableName() { return 'author'; } + get tableName() { return 'authors'; } books() { return this.belongsToMany(Book); } } -class Site extends bookshelf.Model { - get tableName() { return 'sites'; } - photo() { - return this.morphOne(Photo, 'imageable'); +exports.up = (knex: Knex) => { + return knex.schema.createTable('books', table => { + table.increments('id').primary(); + table.string('name'); + }).createTable('authors', table => { + table.increments('id').primary(); + table.string('name'); + }).createTable('authors_books', table => { + table.integer('author_id').references('authors.id'); + table.integer('book_id').references('books.id'); + }); +}; + +exports.down = (knex: Knex) => { + return knex.schema.dropTable('books') + .dropTable('authors') + .dropTable('authors_books'); +}; + +/* Polymorphic, see http://bookshelfjs.org/#polymorphic */ + +{ + class Site extends bookshelf.Model { + get tableName() { return 'sites'; } + photo(): Photo { + return this.morphOne(Photo, 'imageable'); + } + } + + class Post extends bookshelf.Model { + get tableName() { return 'posts'; } + photos(): Bookshelf.Collection { + return this.morphMany(Photo, 'imageable'); + } + } + + class Photo extends bookshelf.Model { + get tableName() { return 'photos'; } + imageable(): Photo { + return this.morphTo('imageable', Site, Post); + } } } -class Post extends bookshelf.Model { - get tableName() { return 'posts'; } - photos() { - return this.morphMany(Photo, 'imageable'); +/* Bookshelf, see http://bookshelfjs.org/#section-Bookshelf */ + +/* Construction, see http://bookshelfjs.org/#Bookshelf-subsection-construction */ + +/* new Bookshelf(), see http://bookshelfjs.org/#Bookshelf */ + +/* Members, see http://bookshelfjs.org/#Bookshelf-subsection-members */ + +/* bookshelf.knex, see http://bookshelfjs.org/#Bookshelf-instance-knex */ + +/* Methods, see http://bookshelfjs.org/#Bookshelf-subsection-methods */ + +/* bookshelf.transaction(), see http://bookshelfjs.org/#Bookshelf-instance-transaction */ + +class Library extends bookshelf.Model { + get tableName() { return 'libraries'; } + + relatedBooks(): Bookshelf.Collection { + return > this.related('books'); } } -class Photo extends bookshelf.Model { - get tableName() { return 'photos'; } - imageable() { - return this.morphTo('imageable', Site, Post); +bookshelf.transaction(t => { + return new Library({name: 'Old Books'}) + .save(null, {transacting: t}) + .tap(model => { + return Promise.map([ + {title: 'Canterbury Tales'}, + {title: 'Moby Dick'}, + {title: 'Hamlet'} + ], info => { + // Some validation could take place here. + return new Book(info).save({'shelf_id': model.id}, {transacting: t}); + }); + }); +}).then(library => { + console.log(library.relatedBooks().pluck('title')); +}).catch(err => { + console.error(err); +}); + +/* Type definitions */ + +/* transactionCallback(), see http://bookshelfjs.org/#Bookshelf~transactionCallback */ + +/* Model, see http://bookshelfjs.org/#section-Model */ + +/* Construction, see http://bookshelfjs.org/#Model-subsection-construction */ + +/* new Model(), see http://bookshelfjs.org/#Model */ + +{ + new Book({ + title: "One Thousand and One Nights", + author: "Scheherazade" + }); + + class Book extends bookshelf.Model { + get tableName() { return 'documents'; } + + constructor(json: Object) { + super(json); + + this.on('saving', (model, attrs, options) => { + options.query.where('type', '=', 'book'); + }); + } } } + +/* model.initialize(), see http://bookshelfjs.org/#Model-instance-initialize */ + +/* Static, see http://bookshelfjs.org/#Model-subsection-static */ + +/* Model.collection(), see http://bookshelfjs.org/#Model-static-collection */ + +class Customer extends bookshelf.Model { + get tableName() { return 'customers'; } +} +Customer.collection().fetch().then(collection => { + // ... +}); + +/* Model.count(), see http://bookshelfjs.org/#Model-static-count */ + +/* Model.extend(), see http://bookshelfjs.org/#Model-static-extend */ + +class Account extends bookshelf.Model { + get tableName() { return 'accounts'; } +} +{ + var checkit = require('checkit'); + var bcrypt = Promise.promisifyAll(require('bcrypt')); + + class Customer extends bookshelf.Model { + get tableName() { return 'customers'; } + + initialize() { + this.on('saving', this.validateSave); + } + + validateSave() { + let rules: any; + return checkit(rules).run(this.attributes); + } + + account() { + return this.belongsTo(Account); + } + + static login(email: string, password: string): Promise { + if (!email || !password) throw new Error('Email and password are both required'); + return new this({email: email.toLowerCase().trim()}).fetch({require: true}).tap(customer => { + return bcrypt.compareAsync(password, customer.get('password')) + .then((res: boolean) => { + if (!res) throw new Error('Invalid password'); + }); + }); + } + } + + const email = 'email'; + const password = 'password'; + Customer.login(email, password) + .then(customer => { + console.log(customer.omit('password')); + }).catch(Customer.NotFoundError, () => { + console.log({error: email + ' not found'}); + }).catch(err => { + console.error(err); + }); +} + +/* Model.fetchAll(), see http://bookshelfjs.org/#Model-static-fetchAll */ + +/* Model.forge(), see http://bookshelfjs.org/#Model-static-forge */ + +/* Members, see http://bookshelfjs.org/#Model-subsection-members */ + +/* model.hasTimestamps, see http://bookshelfjs.org/#Model-instance-hasTimestamps */ + +/* model.idAttribute, see http://bookshelfjs.org/#Model-instance-idAttribute */ + +/* model.tableName, see http://bookshelfjs.org/#Model-instance-tableName */ + +class Television extends bookshelf.Model { + get tableName() { return 'televisions'; } +} + +/* Methods, see http://bookshelfjs.org/#Model-subsection-methods */ + +/* model.belongsTo(), see http://bookshelfjs.org/#Model-instance-belongsTo */ + +{ + class Book extends bookshelf.Model { + get tableName() { return 'books'; } + author(): Author { + return this.belongsTo(Author); + } + } + + // select * from `books` where id = 1 + // select * from `authors` where id = book.author_id + new Book().where({id: 1}).fetch({withRelated: ['author']}).then(book => { + console.log(JSON.stringify(book.related('author'))); + }); +} + +/* model.belongsToMany(), see http://bookshelfjs.org/#Model-instance-belongsToMany */ + +{ + class Account extends bookshelf.Model { + get tableName() { return 'accounts'; } + } + + class User extends bookshelf.Model { + get tableName() { return 'users'; } + allAccounts() { + return this.belongsToMany(Account); + } + adminAccounts() { + return this.belongsToMany(Account).query({where: {access: 'admin'}}); + } + viewAccounts() { + return this.belongsToMany(Account).query({where: {access: 'readonly'}}); + } + } + + class Doctor extends bookshelf.Model { + patients(): Bookshelf.Collection { + return this.belongsToMany(Patient).through(Appointment); + } + } + + class Appointment extends bookshelf.Model { + patient(): Patient { + return this.belongsTo(Patient); + } + doctor(): Doctor { + return this.belongsTo(Doctor); + } + } + + class Patient extends bookshelf.Model { + doctors(): Bookshelf.Collection { + return this.belongsToMany(Doctor).through(Appointment); + } + } +} + +/* model.clear(), see http://bookshelfjs.org/#Model-instance-clear */ + +/* model.clone(), see http://bookshelfjs.org/#Model-instance-clone */ + +/* model.count(), see http://bookshelfjs.org/#Model-instance-count */ + +class Duck extends bookshelf.Model { +} +new Duck().where('color', 'blue').count('name') + .then(count => { + //... + }); + +/* model.destroy(), see http://bookshelfjs.org/#Model-instance-destroy */ +new User({id: 1}) + .destroy() + .then(model => { + // ... + }); + +/* model.escape(), see http://bookshelfjs.org/#Model-instance-escape */ + +/* model.fetch(), see http://bookshelfjs.org/#Model-instance-fetch */ + +// select * from `books` where `ISBN-13` = '9780440180296' +new Book({'ISBN-13': '9780440180296'}) + .fetch() + .then(model => { + // outputs 'Slaughterhouse Five' + console.log(model.get('title')); + }); +{ + class Edition extends bookshelf.Model {} + class Chapter extends bookshelf.Model {} + class Genre extends bookshelf.Model {} + + class Book extends bookshelf.Model { + get tableName() { return 'books'; } + editions() { + return this.hasMany(Edition); + } + chapters() { + return this.hasMany(Chapter); + } + genre() { + return this.belongsTo(Genre); + } + } + + new Book({'ISBN-13': '9780440180296'}).fetch({ + withRelated: [ + 'genre', 'editions', + { chapters: query => query.orderBy('chapter_number') } + ] + }).then(book => { + console.log(book.related('genre').toJSON()); + console.log(book.related('editions').toJSON()); + console.log(book.toJSON()); + }); +} + +/* model.fetchAll(), see http://bookshelfjs.org/#Model-instance-fetchAll */ + +/* model.format(), see http://bookshelfjs.org/#Model-instance-format */ + +/* model.get(), see http://bookshelfjs.org/#Model-instance-get */ +const note = new bookshelf.Model(); +note.get("title"); + +/* model.has(), see http://bookshelfjs.org/#Model-instance-has */ + +/* model.hasChanged(), see http://bookshelfjs.org/#Model-instance-hasChanged */ + +/* model.hasMany(), see http://bookshelfjs.org/#Model-instance-hasMany */ + +{ + class Author extends bookshelf.Model { + get tableName() { return 'authors'; } + + books() { + return this.hasMany(Book); + } + } + + // select * from `authors` where id = 1 + // select * from `books` where author_id = 1 + new Author().where({id: 1}).fetch({withRelated: ['books']}).then(author => { + console.log(JSON.stringify(author.related('books'))); + }); +} + +/* model.hasOne(), see http://bookshelfjs.org/#Model-instance-hasOne */ + +{ + class Record extends bookshelf.Model { + get tableName() { return 'health_records'; } + } + + class Patient extends bookshelf.Model { + get tableName() { return 'patients'; } + record(): Record { + return this.hasOne(Record); + } + } + + // select * from `health_records` where `patient_id` = 1; + const record = new Patient({id: 1}).related('record'); + record.fetch().then(model => { + // ... + }); + + // alternatively, if you don't need the relation loaded on the patient's relations hash: + new Patient({id: 1}).record().fetch().then(model => { + // ... + }); +} + +/* model.isNew(), see http://bookshelfjs.org/#Model-instance-isNew */ + +var modelA = new bookshelf.Model(); +modelA.isNew(); // true + +var modelB = new bookshelf.Model({id: 1}); +modelB.isNew(); // false + +/* model.load(), see http://bookshelfjs.org/#Model-instance-load */ +class Posts extends bookshelf.Collection {} +new Posts().fetch().then(collection => { + collection.at(0) + .load(['author', 'content', 'comments.tags']) + .then(model => { + JSON.stringify(model); + }); +}); +/* +{ + title: 'post title', + author: {...}, + content: {...}, + comments: [ + {tags: [...]}, {tags: [...]} + ] +} +*/ + +/* model.morphMany(), see http://bookshelfjs.org/#Model-instance-morphMany */ + +class Photo extends bookshelf.Model {} +{ + class Post extends bookshelf.Model { + get tableName() { return 'posts'; } + photos() { + return this.morphMany(Photo, 'imageable'); + } + } +} +{ + class Post extends bookshelf.Model { + get tableName() { return 'posts'; } + photos() { + return this.morphMany(Photo, 'imageable', ["ImageableType", "ImageableId"]); + } + } +} + +/* model.morphOne(), see http://bookshelfjs.org/#Model-instance-morphOne */ + +{ + class Site extends bookshelf.Model { + get tableName() { return 'sites'; } + photo() { + return this.morphOne(Photo, 'imageable'); + } + } +} +{ + class Site extends bookshelf.Model { + get tableName() { return 'sites'; } + photo() { + return this.morphOne(Photo, 'imageable', ["ImageableType", "ImageableId"]); + } + } +} + +/* model.morphTo(), see http://bookshelfjs.org/#Model-instance-morphTo */ + +class Site extends bookshelf.Model {} +{ + class Photo extends bookshelf.Model { + get tableName() { return 'photos'; } + imageable() { + return this.morphTo('imageable', Site, Post); + } + } +} +{ + class Photo extends bookshelf.Model { + get tableName() { return 'photos'; } + imageable() { + return this.morphTo('imageable', ["ImageableType", "ImageableId"], Site, Post); + } + } +} + +/* model.off(), see http://bookshelfjs.org/#Model-instance-off */ + +const customer = new Customer(); +const ship = new bookshelf.Model(); +customer.off('fetched fetching'); +ship.off(); // This will remove all event listeners + +/* model.on(), see http://bookshelfjs.org/#Model-instance-on */ + +customer.on('fetching', (model, columns) => { + // Do something before the data is fetched from the database +}); + +/* model.once(), see http://bookshelfjs.org/#Model-instance-once */ + +/* model.parse(), see http://bookshelfjs.org/#Model-instance-parse */ + +// Example of a "parse" to convert snake_case to camelCase, using `underscore.string` +customer.parse = attrs => { + return _.reduce(<_.Dictionary> attrs, (memo, val, key) => { + (<_.Dictionary> memo)[_.camelCase(key)] = val; + return memo; + }, {}); +}; + +/* model.previous(), see http://bookshelfjs.org/#Model-instance-previous */ + +/* model.previousAttributes(), see http://bookshelfjs.org/#Model-instance-previousAttributes */ + +/* model.query(), see http://bookshelfjs.org/#Model-instance-query */ + +const model = new bookshelf.Model(); +model + .query('where', 'other_id', '=', '5') + .fetch() + .then(model => { + // ... + }); + +model + .query({where: {other_id: '5'}, orWhere: {key: 'value'}}) + .fetch() + .then(model => { + // ... + }); + +model.query(qb => { + qb.where('other_person', 'LIKE', '%Demo').orWhere('other_id', '>', 10); +}).fetch() + .then(model => { + // ... + }); + +let qb = model.query(); +qb.where({id: 1}).select().then(resp => { + // ... +}); + +/* model.refresh(), see http://bookshelfjs.org/#Model-instance-refresh */ + +/* model.related(), see http://bookshelfjs.org/#Model-instance-related */ +class Trip extends bookshelf.Model {} +class Trips extends bookshelf.Collection {} +new Photo({id: 1}).fetch({ + withRelated: ['account'] +}).then(photo => { + if (photo) { + var account = photo.related('account'); + if (account.id) { + return ( account.related('trips')).fetch(); + } + } +}); + +/* model.resetQuery(), see http://bookshelfjs.org/#Model-instance-resetQuery */ + +/* model.save(), see http://bookshelfjs.org/#Model-instance-save */ + +new Post({name: 'New Article'}).save().then(model => { + // ... +}); +// update authors set "bio" = 'Short user bio' where "id" = 1 +new Author({id: 1, first_name: 'User'}) + .save({bio: 'Short user bio'}, {patch: true}) + .then(model => { + // ... + }); + +// Save with no arguments +bookshelf.Model.forge({id: 5, firstName: "John", lastName: "Smith"}).save().then(() => { + //... +}); + +// Or add attributes during save +bookshelf.Model.forge({id: 5}).save({firstName: "John", lastName: "Smith"}).then(() => { + //... +}); + +// Or, if you prefer, for a single attribute +bookshelf.Model.forge({id: 5}).save('name', 'John Smith').then(() => { + //... +}); + +/* model.serialize(), see http://bookshelfjs.org/#Model-instance-serialize */ + +var artist = new bookshelf.Model({ + firstName: "Wassily", + lastName: "Kandinsky" +}); + +artist.set({birthday: "December 16, 1866"}); + +console.log(JSON.stringify(artist)); +// {firstName: "Wassily", lastName: "Kandinsky", birthday: "December 16, 1866"} + +/* model.set(), see http://bookshelfjs.org/#Model-instance-set */ + +customer.set({first_name: "Joe", last_name: "Customer"}); +customer.set("telephone", "555-555-1212"); + +/* model.through(), see http://bookshelfjs.org/#Model-instance-through */ + +{ + class Book extends bookshelf.Model { + get tableName() { return 'books'; } + + // Find all paragraphs associated with this book, by + // passing through the "Chapter" model. + paragraphs(): Paragraphs { + return this.hasMany(Paragraph).through(Chapter); + } + + chapters(): Chapters { + return this.hasMany(Chapter); + } + } + + class Chapter extends bookshelf.Model { + get tableName() { return 'chapters'; } + + paragraphs(): Bookshelf.Collection { + return this.hasMany(Paragraph); + } + } + + class Chapters extends bookshelf.Collection { + } + + class Paragraph extends bookshelf.Model { + get tableName() { return 'paragraphs'; } + + chapter(): Chapter { + return this.belongsTo(Chapter); + } + + // A reverse relation, where we can get the book from the chapter. + book(): Book { + return this.belongsTo(Book).through(Chapter); + } + } + + class Paragraphs extends bookshelf.Collection { + } +} + +/* model.timestamp(), see http://bookshelfjs.org/#Model-instance-timestamp */ + +/* model.toJSON(), see http://bookshelfjs.org/#Model-instance-toJSON */ + +// TODO No example provided on Bookshelf website + +{ + interface UserJson { + name: string; + } + + class User extends bookshelf.Model { + get tableName() { return 'users'; } + + toJSON(): UserJson { + return super.toJSON(); + } + + fetchAll(): Promise { + return super.fetchAll(); + } + } + + class Users extends bookshelf.Collection { + toJSON(): UserJson[] { + return super.toJSON(); + } + } + + new User({id: 1}).fetch().then(user => { + const userJson = user.toJSON(); + console.log('User name:', userJson.name); + }); + + new User({name: 'John'}).fetchAll().then(users => { + const usersJson = users.toJSON(); + console.log('First user name:', usersJson[0].name); + }); +} + +/* model.trigger(), see http://bookshelfjs.org/#Model-instance-trigger */ + +ship.trigger('fetched'); + +/* model.triggerThen(), see http://bookshelfjs.org/#Model-instance-triggerThen */ + +/* model.unset(), see http://bookshelfjs.org/#Model-instance-unset */ + +/* model.where(), see http://bookshelfjs.org/#Model-instance-where */ + +model.where('favorite_color', '<>', 'green').fetch().then(() => { + //... +}); +// or +model.where('favorite_color', 'red').fetch().then(() => { + //... +}); +// or +model.where({favorite_color: 'red', shoe_size: 12}).fetch().then(() => { + //... +}); + +/* Lodash methods, see http://bookshelfjs.org/#Model-subsection-lodash-methods */ + +/* invert(), see http://lodash.com/docs/#invert */ + +/* keys(), see http://lodash.com/docs/#keys */ + +/* omit(), see http://lodash.com/docs/#omit */ + +/* pairs(), see http://lodash.com/docs/#pairs */ + +/* pick(), see http://lodash.com/docs/#pick */ + +/* values(), see http://lodash.com/docs/#values */ + +/* Events, see http://bookshelfjs.org/#Model-subsection-events */ + +/* model.on("created"), see http://bookshelfjs.org/#Model-event-created */ + +/* model.on("creating"), see http://bookshelfjs.org/#Model-event-creating */ + +/* model.on("destroyed"), see http://bookshelfjs.org/#Model-event-destroyed */ + +/* model.on("destroying"), see http://bookshelfjs.org/#Model-event-destroying */ + +/* model.on("fetched"), see http://bookshelfjs.org/#Model-event-fetched */ + +/* model.on("fetching"), see http://bookshelfjs.org/#Model-event-fetching */ + +/* model.on("saved"), see http://bookshelfjs.org/#Model-event-saved */ + +/* model.on("saving"), see http://bookshelfjs.org/#Model-event-saving */ + +/* model.on("updated"), see http://bookshelfjs.org/#Model-event-updated */ + +/* model.on("updating"), see http://bookshelfjs.org/#Model-event-updating */ + +/* new Model.NoRowsDeletedError(), see http://bookshelfjs.org/#Model-static-NoRowsDeletedError */ + +// TODO No example provided on Bookshelf website + +new User({id: 1}).destroy({require: true}) +.then(user => { + console.log(user.toJSON()); +}) +.catch(User.NoRowsDeletedError, () => { + console.log('User not found'); +}) +.catch(error => { + console.log('Internal error:', error); +}); + +/* new Model.NoRowsUpdatedError(), see http://bookshelfjs.org/#Model-static-NoRowsUpdatedError */ + +// TODO No example provided on Bookshelf website + +new User({id: 1}).save({}, {patch: true, require: true}) +.then(user => { + console.log(user.toJSON()); +}) +.catch(User.NoRowsUpdatedError, () => { + console.log('User not updated'); +}) +.catch(error => { + console.log('Internal error:', error); +}); + +/* new Model.NotFoundError(), see http://bookshelfjs.org/#Model-static-NotFoundError */ + +// TODO No example provided on Bookshelf website + +new User({id: 1}).fetch({require: true}) +.then(user => { + console.log(user.toJSON()); +}) +.catch(User.NotFoundError, () => { + console.log('User not found'); +}) +.catch(error => { + console.log('Internal error:', error); +}); + +/* Collection, see http://bookshelfjs.org/#section-Collection */ + +/* Construction, see http://bookshelfjs.org/#Collection-subsection-construction */ + +/* new Collection(), see http://bookshelfjs.org/#Collection */ + +class Tab extends bookshelf.Model { +} +const tab1 = new Tab(); +const tab2 = new Tab(); +const tab3 = new Tab(); +class TabSet extends bookshelf.Collection { +} +let tabs = new TabSet([tab1, tab2, tab3]); + +/* collection.initialize(), see http://bookshelfjs.org/#Collection-instance-initialize */ + +/* Static, see http://bookshelfjs.org/#Collection-subsection-static */ + +/* Collection.extend(), see http://bookshelfjs.org/#Collection-static-extend */ + +/* Collection.forge(), see http://bookshelfjs.org/#Collection-static-forge */ + +class Accounts extends bookshelf.Collection { + model: Account +} + +var accounts = Accounts.forge([ + {name: 'Person1'}, + {name: 'Person2'} +]); + +Promise.all(accounts.invoke('save')).then(() => { + // collection models should now be saved... +}); + +/* Methods, see http://bookshelfjs.org/#Collection-subsection-methods */ + +/* collection.add(), see http://bookshelfjs.org/#Collection-instance-add */ + +const ships = new bookshelf.Collection; + +ships.add([ + {name: "Flying Dutchman"}, + {name: "Black Pearl"} +]); + +/* collection.at(), see http://bookshelfjs.org/#Collection-instance-at */ + +/* collection.attach(), see http://bookshelfjs.org/#Collection-instance-attach */ + +{ + class Admin extends bookshelf.Model { + } + class Site extends bookshelf.Model { + admins() { + return this.hasMany(Admin); + } + } + var admin1 = new Admin({username: 'user1', password: 'test'}); + var admin2 = new Admin({username: 'user2', password: 'test'}); + + Promise.all([admin1.save(), admin2.save()]) + .then(() => { + return Promise.all([ + new Site({id: 1}).admins().attach([admin1, admin2]), + new Site({id: 2}).admins().attach(admin2) + ]); + }); +} + +/* collection.clone(), see http://bookshelfjs.org/#Collection-instance-clone */ + +/* collection.count(), see http://bookshelfjs.org/#Collection-instance-count */ + +class Shareholder extends bookshelf.Model {} +class Company extends bookshelf.Model { + shareholders() { + return this.hasMany(Shareholder); + } +} + +// select count(*) from shareholders where company_id = 1 and share > 0.1; +Company.forge({id:1}) + .shareholders() + .query('where', 'share', '>', '0.1') + .count() + .then(count => { + assert(count === 3); + }); + +/* collection.create(), see http://bookshelfjs.org/#Collection-instance-create */ + +class Student extends bookshelf.Model {} + +function get(req: express.Request, res: express.Response) { + // FIXME Support proposed ES Rest/Spread properties https://github.com/Microsoft/TypeScript/issues/2103 + //const { courses, ...attributes } = req.body; + const { courses, attributes } = req.body; + + Student.forge(attributes).save().tap(student => + Promise.map(courses, course => (> student.related('courses')).create(course)) + ).then(student => + res.status(200).send(student) + ).catch(error => + res.status(500).send(error.message) + ); +} + +/* collection.detach(), see http://bookshelfjs.org/#Collection-instance-detach */ + +/* collection.fetch(), see http://bookshelfjs.org/#Collection-instance-fetch */ + +/* collection.fetchOne(), see http://bookshelfjs.org/#Collection-instance-fetchOne */ + +{ + class Site extends bookshelf.Model { + authors() { + return this.hasMany(Author); + } + } + + // select * from authors where site_id = 1 and id = 2 limit 1; + new Site({id: 1}) + .authors() + .query({where: {id: 2}}) + .fetchOne() + .then(model => { + // ... + }); +} + +/* collection.findWhere(), see http://bookshelfjs.org/#Collection-instance-findWhere */ + +/* collection.get(), see http://bookshelfjs.org/#Collection-instance-get */ + +const library = new bookshelf.Collection(); +const book = library.get(110); + +/* collection.invokeThen(), see http://bookshelfjs.org/#Collection-instance-invokeThen */ + +const options = {}; +const collection = new bookshelf.Collection(); +collection.invokeThen('save', null, options).then(() => { + // ... all models in the collection have been saved +}); + +collection.invokeThen('destroy', options).then(() => { + // ... all models in the collection have been destroyed +}); + +/* collection.load(), see http://bookshelfjs.org/#Collection-instance-load */ + +/* collection.off(), see http://bookshelfjs.org/#Collection-instance-off */ + +ships.off('fetched') // Remove the 'fetched' event listener + +/* collection.on(), see http://bookshelfjs.org/#Collection-instance-on */ + +ships.on('fetched', (collection, response) => { + // Do something after the data has been fetched from the database +}) + +/* collection.once(), see http://bookshelfjs.org/#Collection-instance-once */ + +/* collection.parse(), see http://bookshelfjs.org/#Collection-instance-parse */ + +/* collection.pluck(), see http://bookshelfjs.org/#Collection-instance-pluck */ + +/* collection.pop(), see http://bookshelfjs.org/#Collection-instance-pop */ + +/* collection.push(), see http://bookshelfjs.org/#Collection-instance-push */ + +/* collection.query(), see http://bookshelfjs.org/#Collection-instance-query */ + +{ + let qb = collection.query(); + qb.where({id: 1}).select().then(resp => { + // ... + }); + + collection.query(qb => { + qb.where('id', '>', 5).andWhere('first_name', '=', 'Test'); + }).fetch() + .then(collection => { + // ... + }); + + collection + .query('where', 'other_id', '=', '5') + .fetch() + .then(collection => { + // ... + }); +} + +/* collection.reduceThen(), see http://bookshelfjs.org/#Collection-instance-reduceThen */ + +/* collection.remove(), see http://bookshelfjs.org/#Collection-instance-remove */ + +/* collection.reset(), see http://bookshelfjs.org/#Collection-instance-reset */ + +/* collection.resetQuery(), see http://bookshelfjs.org/#Collection-instance-resetQuery */ + +/* collection.serialize(), see http://bookshelfjs.org/#Collection-instance-serialize */ + +/* collection.set(), see http://bookshelfjs.org/#Collection-instance-set */ + +class BandMember extends bookshelf.Model {} +const eddie = new BandMember(); +const alex = new BandMember(); +const stone = new BandMember(); +const roth = new BandMember(); +const hagar = new BandMember(); +var vanHalen = new bookshelf.Collection([eddie, alex, stone, roth]); +vanHalen.set([eddie, alex, stone, hagar]); + +/* collection.shift(), see http://bookshelfjs.org/#Collection-instance-shift */ + +/* collection.slice(), see http://bookshelfjs.org/#Collection-instance-slice */ + +/* collection.through(), see http://bookshelfjs.org/#Collection-instance-through */ + +/* collection.toJSON(), see http://bookshelfjs.org/#Collection-instance-toJSON */ + +/* collection.trigger(), see http://bookshelfjs.org/#Collection-instance-trigger */ + +ships.trigger('fetched'); + +/* collection.triggerThen(), see http://bookshelfjs.org/#Collection-instance-triggerThen */ + +/* collection.unshift(), see http://bookshelfjs.org/#Collection-instance-unshift */ + +/* collection.updatePivot(), see http://bookshelfjs.org/#Collection-instance-updatePivot */ + +/* collection.where(), see http://bookshelfjs.org/#Collection-instance-where */ + +/* collection.withPivot(), see http://bookshelfjs.org/#Collection-instance-withPivot */ + +{ + class Comment extends bookshelf.Model {} + class Tag extends bookshelf.Model { + comments() { + return this.belongsToMany(Comment).withPivot(['created_at', 'order']); + } + } +} + +/* Lodash methods, see http://bookshelfjs.org/#Collection-subsection-lodash-methods */ + +/* all(), see http://lodash.com/docs/#all */ + +/* any(), see http://lodash.com/docs/#any */ + +/* chain(), see http://lodash.com/docs/#chain */ + +/* collect(), see http://lodash.com/docs/#collect */ + +/* contains(), see http://lodash.com/docs/#contains */ + +/* countBy(), see http://lodash.com/docs/#countBy */ + +/* detect(), see http://lodash.com/docs/#detect */ + +/* difference(), see http://lodash.com/docs/#difference */ + +/* drop(), see http://lodash.com/docs/#drop */ + +/* each(), see http://lodash.com/docs/#each */ + +/* every(), see http://lodash.com/docs/#every */ + +/* filter(), see http://lodash.com/docs/#filter */ + +/* find(), see http://lodash.com/docs/#find */ + +/* first(), see http://lodash.com/docs/#first */ + +/* foldl(), see http://lodash.com/docs/#foldl */ + +/* foldr(), see http://lodash.com/docs/#foldr */ + +/* forEach(), see http://lodash.com/docs/#forEach */ + +/* groupBy(), see http://lodash.com/docs/#groupBy */ + +/* head(), see http://lodash.com/docs/#head */ + +/* include(), see http://lodash.com/docs/#include */ + +/* indexOf(), see http://lodash.com/docs/#indexOf */ + +/* initial(), see http://lodash.com/docs/#initial */ + +/* inject(), see http://lodash.com/docs/#inject */ + +/* invoke(), see http://lodash.com/docs/#invoke */ + +/* isEmpty(), see http://lodash.com/docs/#isEmpty */ + +/* last(), see http://lodash.com/docs/#last */ + +/* lastIndexOf(), see http://lodash.com/docs/#lastIndexOf */ + +/* map(), see http://lodash.com/docs/#map */ + +// TODO No example provided on Bookshelf website + +{ + class Author extends bookshelf.Model { + get tableName() { return 'author'; } + books() { + return this.belongsToMany(Book); + } + relatedBooks() { + return > this.related('books'); + } + } + new Author({id: 1}).fetch({require: true, withRelated: ['books']}) + .then(author => { + const books = author.relatedBooks(); + const booksJson = books.map(book => book.toJSON()); + }); + + class AuthorOutput { + constructor(bookJson: Object) {} + } + + new Author({id: 1}).fetch({require: true, withRelated: ['books']}) + .then(author => { + const books = author.relatedBooks(); + const booksOutput = books.map(book => new AuthorOutput(book.toJSON())); + }); +} + +/* max(), see http://lodash.com/docs/#max */ + +/* min(), see http://lodash.com/docs/#min */ + +/* reduce(), see http://lodash.com/docs/#reduce */ + +/* reduceRight(), see http://lodash.com/docs/#reduceRight */ + +/* reject(), see http://lodash.com/docs/#reject */ + +/* rest(), see http://lodash.com/docs/#rest */ + +/* select(), see http://lodash.com/docs/#select */ + +/* shuffle(), see http://lodash.com/docs/#shuffle */ + +/* size(), see http://lodash.com/docs/#size */ + +/* some(), see http://lodash.com/docs/#some */ + +/* sortBy(), see http://lodash.com/docs/#sortBy */ + +/* tail(), see http://lodash.com/docs/#tail */ + +/* take(), see http://lodash.com/docs/#take */ + +/* toArray(), see http://lodash.com/docs/#toArray */ + +/* without(), see http://lodash.com/docs/#without */ + +/* Events, see http://bookshelfjs.org/#Collection-subsection-events */ + +/* collection.on("fetched"), see http://bookshelfjs.org/#Collection-event-fetched */ + +/* new Collection.EmptyError(), see http://bookshelfjs.org/#Collection-static-EmptyError */ + +// TODO No example provided on Bookshelf website + +class Users extends bookshelf.Collection { +} +new User({name: 'John'}).fetchAll({require: true}) +.then(users => { + console.log(users.toJSON()); +}) +.catch(Users.EmptyError, () => { + console.log('No user found'); +}) +.catch(error => { + console.log('Internal error:', error); +}); + +/* Events, see http://bookshelfjs.org/#section-Events */ + +/* new Events(), see http://bookshelfjs.org/#Events */ + +/* events.off(), see http://bookshelfjs.org/#Events-instance-off */ + +/* events.on(), see http://bookshelfjs.org/#Events-instance-on */ + +/* events.once(), see http://bookshelfjs.org/#Events-instance-once */ + +/* events.trigger(), see http://bookshelfjs.org/#Events-instance-trigger */ + +/* events.triggerThen(), see http://bookshelfjs.org/#Events-instance-triggerThen */ diff --git a/bookshelf/bookshelf.d.ts b/bookshelf/bookshelf.d.ts index 74f5e83d4a..0ca3a1ebcd 100644 --- a/bookshelf/bookshelf.d.ts +++ b/bookshelf/bookshelf.d.ts @@ -6,23 +6,25 @@ /// /// /// +/// declare module 'bookshelf' { - import knex = require('knex'); - import Promise = require('bluebird'); - import Lodash = require('lodash'); + import * as Knex from 'knex'; + import * as Promise from 'bluebird'; + import * as Lodash from 'lodash'; + import * as createError from 'create-error'; interface Bookshelf extends Bookshelf.Events { VERSION : string; - knex : knex; + knex : Knex; Model : typeof Bookshelf.Model; Collection : typeof Bookshelf.Collection; - plugin(name: string) : Bookshelf; - transaction(callback : (transaction : knex.Transaction) => T) : Promise; + plugin(name: string | string[] | Function, options?: any) : Bookshelf; + transaction(callback : (transaction : Knex.Transaction) => T) : T; } - function Bookshelf(knex : knex) : Bookshelf; + function Bookshelf(knex : Knex) : Bookshelf; namespace Bookshelf { abstract class Events { @@ -44,6 +46,13 @@ declare module 'bookshelf' { /** If overriding, must use a getter instead of a plain property. */ idAttribute : string; + // See https://github.com/tgriesser/bookshelf/blob/0.9.4/src/base/model.js#L178 + // See https://github.com/tgriesser/bookshelf/blob/0.9.4/src/base/model.js#L213 + id : any; + + // See https://github.com/tgriesser/bookshelf/blob/0.9.4/src/base/model.js#L28 + attributes : any; + constructor(attributes? : any, options? : ModelOptions); clear() : T; @@ -54,7 +63,7 @@ declare module 'bookshelf' { has(attribute : string) : boolean; hasChanged(attribute? : string) : boolean; isNew() : boolean; - parse(response : any) : any; + parse(response : Object) : Object; previousAttributes() : any; previous(attribute : string) : any; related>(relation : string) : R | Collection; @@ -88,7 +97,7 @@ declare module 'bookshelf' { belongsTo>(target : {new(...args : any[]) : R}, foreignKey? : string) : R; belongsToMany>(target : {new(...args : any[]) : R}, table? : string, foreignKey? : string, otherKey? : string) : Collection; count(column? : string, options? : SyncOptions) : Promise; - destroy(options? : SyncOptions) : Promise; + destroy(options? : DestroyOptions) : Promise; fetch(options? : FetchOptions) : Promise; fetchAll(options? : FetchAllOptions) : Promise>; hasMany>(target : {new(...args : any[]) : R}, foreignKey? : string) : Collection; @@ -98,20 +107,35 @@ declare module 'bookshelf' { morphOne>(target : {new(...args : any[]) : R}, name? : string, columnNames? : string[], morphValue? : string) : R; morphTo(name : string, columnNames? : string[], ...target : typeof Model[]) : T; morphTo(name : string, ...target : typeof Model[]) : T; + + // Declaration order matters otherwise TypeScript gets confused between query() and query(...query: string[]) + query() : Knex.QueryBuilder; + query(callback : (qb : Knex.QueryBuilder) => void) : T; query(...query : string[]) : T; query(query : {[key : string] : any}) : T; - query(callback : (qb : knex.QueryBuilder) => void) : T; - query() : knex.QueryBuilder; + refresh(options? : FetchOptions) : Promise; resetQuery() : T; - save(key? : string, val? : string, options? : SaveOptions) : Promise; + save(key? : string, val? : any, options? : SaveOptions) : Promise; save(attrs? : {[key : string] : any}, options? : SaveOptions) : Promise; - through>(interim : typeof Model, throughForeignKey? : string, otherKey? : string) : R | Collection; + through>(interim : typeof Model, throughForeignKey? : string, otherKey? : string) : R; where(properties : {[key : string] : any}) : T; where(key : string, operatorOrValue : string|number|boolean, valueIfOperator? : string|number|boolean) : T; + + // See https://github.com/tgriesser/bookshelf/blob/0.9.4/src/errors.js + // See https://github.com/tgriesser/bookshelf/blob/0.9.4/src/model.js#L1280 + static NotFoundError: createError.Error; + static NoRowsUpdatedError: createError.Error; + static NoRowsDeletedError: createError.Error; } abstract class CollectionBase> extends Events { + // See https://github.com/tgriesser/bookshelf/blob/0.9.4/src/base/collection.js#L573 + length : number; + + // See https://github.com/tgriesser/bookshelf/blob/0.9.4/src/base/collection.js#L21 + constructor(models? : T[], options? : CollectionOptions); + add(models : T[]|{[key : string] : any}[], options? : CollectionAddOptions) : Collection; at(index : number) : T; clone() : Collection; @@ -127,11 +151,11 @@ declare module 'bookshelf' { remove(model : T, options? : EventOptions) : T; remove(model : T[], options? : EventOptions) : T[]; reset(model : any[], options? : CollectionAddOptions) : T[]; - serialize(options? : SerializeOptions) : any; + serialize(options? : SerializeOptions) : any[]; set(models : T[]|{[key : string] : any}[], options? : CollectionSetOptions) : Collection; shift(options? : EventOptions) : void; slice(begin? : number, end? : number) : void; - toJSON(options? : SerializeOptions) : any; + toJSON(options? : SerializeOptions) : any[]; unshift(model : any, options? : CollectionAddOptions) : void; where(match : {[key : string] : any}, firstOnly : boolean) : T|Collection; @@ -177,8 +201,13 @@ declare module 'bookshelf' { keys() : string[]; last() : T; lastIndexOf(value : any, fromIndex? : number) : number; - map(predicate? : Lodash.ListIterator|Lodash.DictionaryIterator|string, thisArg? : any) : T[]; - map(predicate? : R) : T[]; + + // See https://github.com/DefinitelyTyped/DefinitelyTyped/blob/1ec3d51/lodash/lodash-3.10.d.ts#L7119 + // See https://github.com/Microsoft/TypeScript/blob/v1.8.10/lib/lib.core.es7.d.ts#L1122 + map(predicate? : Lodash.ListIterator|string, thisArg? : any) : U[]; + map(predicate? : Lodash.DictionaryIterator|string, thisArg? : any) : U[]; + map(predicate? : string) : U[]; + max(predicate? : Lodash.ListIterator|string, thisArg? : any) : T; max(predicate? : R) : T; min(predicate? : Lodash.ListIterator|string, thisArg? : any) : T; @@ -208,20 +237,27 @@ declare module 'bookshelf' { /** @deprecated should use `new` objects instead. */ static forge(attributes? : any, options? : ModelOptions) : T; - attach(ids : any[], options? : SyncOptions) : Promise>; + attach(ids : any|any[], options? : SyncOptions) : Promise>; count(column? : string, options? : SyncOptions) : Promise; create(model : {[key : string] : any}, options? : CollectionCreateOptions) : Promise; detach(ids : any[], options? : SyncOptions) : Promise; + detach(options? : SyncOptions) : Promise; fetchOne(options? : CollectionFetchOneOptions) : Promise; load(relations : string|string[], options? : SyncOptions) : Promise>; + + // Declaration order matters otherwise TypeScript gets confused between query() and query(...query: string[]) + query() : Knex.QueryBuilder; + query(callback : (qb : Knex.QueryBuilder) => void) : Collection; query(...query : string[]) : Collection; query(query : {[key : string] : any}) : Collection; - query(callback : (qb : knex.QueryBuilder) => void) : Collection; - query() : knex.QueryBuilder; + resetQuery() : Collection; - through>(interim : typeof Model, throughForeignKey? : string, otherKey? : string) : R | Collection; + through>(interim : typeof Model, throughForeignKey? : string, otherKey? : string) : Collection; updatePivot(attributes : any, options? : PivotOptions) : Promise; withPivot(columns : string[]) : Collection; + + // See https://github.com/tgriesser/bookshelf/blob/0.9.4/src/collection.js#L389 + static EmptyError: createError.Error; } interface ModelOptions { @@ -231,13 +267,17 @@ declare module 'bookshelf' { } interface LoadOptions extends SyncOptions { - withRelated: string|any|any[]; + withRelated : (string|WithRelatedQuery)[]; } interface FetchOptions extends SyncOptions { require? : boolean; columns? : string|string[]; - withRelated? : string|any|any[]; + withRelated? : (string|WithRelatedQuery)[]; + } + + interface WithRelatedQuery { + [index : string] : (query : Knex.QueryBuilder) => Knex.QueryBuilder; } interface FetchAllOptions extends SyncOptions { @@ -251,6 +291,10 @@ declare module 'bookshelf' { require? : boolean; } + interface DestroyOptions extends SyncOptions { + require? : boolean; + } + interface SerializeOptions { shallow? : boolean; omitPivot? : boolean; @@ -265,7 +309,7 @@ declare module 'bookshelf' { } interface SyncOptions { - transacting? : knex.Transaction; + transacting? : Knex.Transaction; debug? : boolean; } diff --git a/bootstrap.datepicker/bootstrap.datepicker.d.ts b/bootstrap.datepicker/bootstrap.datepicker.d.ts index 0633db5358..686cc6b423 100644 --- a/bootstrap.datepicker/bootstrap.datepicker.d.ts +++ b/bootstrap.datepicker/bootstrap.datepicker.d.ts @@ -35,6 +35,7 @@ interface DatepickerOptions { multidate?: any; multidateSeparator?: string; orientation?: string; + assumeNearbyYear?: any; } interface DatepickerEventObject extends JQueryEventObject { diff --git a/browser-sync/browser-sync-tests.ts b/browser-sync/browser-sync-tests.ts index 822c941d9f..72bcb6465e 100644 --- a/browser-sync/browser-sync-tests.ts +++ b/browser-sync/browser-sync-tests.ts @@ -1,5 +1,5 @@ /// -import browserSync = require("browser-sync"); +import * as browserSync from "browser-sync"; (() => { //make sure that the interfaces are correctly exposed diff --git a/browser-sync/browser-sync.d.ts b/browser-sync/browser-sync.d.ts index 3bc083d1f1..00d234f958 100644 --- a/browser-sync/browser-sync.d.ts +++ b/browser-sync/browser-sync.d.ts @@ -8,10 +8,10 @@ /// declare module "browser-sync" { - import chokidar = require("chokidar"); - import fs = require("fs"); - import http = require("http"); - import mm = require("micromatch"); + import * as chokidar from "chokidar"; + import * as fs from "fs"; + import * as http from "http"; + import * as mm from "micromatch"; namespace browserSync { interface Options { @@ -23,14 +23,14 @@ declare module "browser-sync" { * weinre.port - Default: 8080 * Note: requires at least version 2.0.0 */ - ui?: UIOptions; + ui?: UIOptions | boolean; /** * Browsersync can watch your files as you work. Changes you make will either be injected into the page (CSS * & images) or will cause all browsers to do a full-page refresh. See anymatch for more information on glob * patterns. * Default: false */ - files?: string | string[]; + files?: string | (string | FileCallback)[]; /** * File watching options that get passed along to Chokidar. Check their docs for available options * Default: undefined @@ -245,7 +245,7 @@ declare module "browser-sync" { * Note: requires at least version 1.6.2 */ socket?: SocketOptions; - middleware?: MiddlewareHandler | MiddlewareHandler[]; + middleware?: MiddlewareHandler | PerRouteMiddleware | (MiddlewareHandler | PerRouteMiddleware)[]; } interface Hash { @@ -261,6 +261,12 @@ declare module "browser-sync" { }; } + interface FileCallback { + match?: string | string[]; + fn: (event: string, file: string) => any; + options?: chokidar.WatchOptions; + } + interface ServerOptions { /** set base directory */ baseDir?: string | string[]; @@ -274,7 +280,7 @@ declare module "browser-sync" { */ routes?: Hash; /** configure custom middleware */ - middleware?: MiddlewareHandler[]; + middleware?: (MiddlewareHandler | PerRouteMiddleware)[]; } interface ProxyOptions { @@ -289,6 +295,11 @@ declare module "browser-sync" { (req: http.ServerRequest, res: http.ServerResponse, next: Function): any; } + interface PerRouteMiddleware { + route: string; + handle: MiddlewareHandler; + } + interface GhostOptions { clicks?: boolean; scroll?: boolean; 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/cachefactory/cachefactory-tests.ts b/cachefactory/cachefactory-tests.ts new file mode 100644 index 0000000000..0c859e749d --- /dev/null +++ b/cachefactory/cachefactory-tests.ts @@ -0,0 +1,34 @@ +/// + +CacheFactory.get('test'); + +CacheFactory.createCache('test', { + deleteOnExpire: 'aggressive', + recycleFreq: 60000 +}); + +let testCache = CacheFactory.get('test'); + +testCache.put('testOne', {title: 'testOne', id: 1}); + +let item = testCache.get('testOne'); + + +let profileCache = CacheFactory('profileCache', { + maxAge: 60 * 60 * 1000, + deleteOnExpire: 'aggressive' +}); + +let localStoragePolyfill = { + getItem: (key: string) => { return ""; }, + setItem: (key: string, value: string) => { }, + removeItem: (key: string) => { } +}; + +let myAwesomeCache = CacheFactory('myAwesomeCache', { + maxAge: 15 * 60 * 1000, + cacheFlushInterval: 60 * 60 * 1000, + deleteOnExpire: 'aggressive', + storageMode: 'localStorage', + storageImpl: localStoragePolyfill +}); \ No newline at end of file diff --git a/cachefactory/cachefactory.d.ts b/cachefactory/cachefactory.d.ts new file mode 100644 index 0000000000..ac416e6837 --- /dev/null +++ b/cachefactory/cachefactory.d.ts @@ -0,0 +1,443 @@ +// Type definitions for CacheFactory 1.4.0 +// Project: https://github.com/jmdobry/CacheFactory +// Definitions by: Vaggelis Mparmpas , Daniel Massa +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare module CacheFactory { + export interface IStoreImplementation { + getItem(key: string): string; + + setItem(key: string, value: string): void; + + removeItem(key: string): void; + } + + export interface CacheGetOptions { + /* + * A callback function to be executed whenever an expired item is removed from a cache when the cache is in passive + * or aggressive mode. Will be passed the key and value of the expired item. + * + * Will be passed a third done argument if the cache is in passive mode. This allows you to synchronously access the + * key and value of the expired item when you make the cache#get(key[, options]) call that is the reason the expired + * item is being removed in the first place. Default: null. + */ + onExpire?(key: string, value: any): any; + } + + export interface CachePutOptions { + /* + * The number of milliseconds until a newly inserted item expires. Default: Number.MAX_VALUE. + */ + maxAge?: number; + + /* + * If inserting a promise into a cache, also insert the rejection value if the promise rejects. Default: false. + */ + storeOnReject?: boolean; + + /* + * If inserting a promise into a cache, also insert the resolved value if the promise resolves. Default: false. + */ + storeOnResolve?: boolean; + + created?: Date; + access?: Date; + expires?: Date; + } + + export interface CacheTouchOptions extends CachePutOptions { } + + export interface CacheOptions { + /* + * If set, remove all items from a cache on an interval after the given number of milliseconds. Default: null. + */ + cacheFlushInterval?: number; + + /* + * Maximum number of items a cache can hold. Adding more items than the capacity will cause the cache to operate + * like an LRU cache, removing the least recently used items to stay under capacity. Default: Number.MAX_VALUE. + */ + + capacity?: number; + + /* + * Determines the behavior of a cache when an item expires. Default: none. + * + * Possible values: + * + * none - cache will do nothing when an item expires. + * passive - cache will do nothing when an item expires. Expired items will remain in the cache until requested, + * at which point they are removed, and undefined is returned. + * aggressive - cache will remove expired items as soon as they are discovered. + */ + deleteOnExpire?: string; + + /* + * Determines whether a cache is disabled. Default: false. + */ + disabled?: boolean; + + /* + * The number of milliseconds until a newly inserted item expires. Default: Number.MAX_VALUE. + */ + maxAge?: number; + + /* + * Determines how often a cache will scan for expired items when in aggressive mode. Default: 1000 (milliseconds). + */ + recycleFreq?: number; + + /* + * If inserting a promise into a cache, also insert the rejection value if the promise rejects. Default: false. + */ + storeOnReject?: boolean; + + /* + * If inserting a promise into a cache, also insert the resolved value if the promise resolves. Default: false. + */ + storeOnResolve?: boolean; + + /* + * Provide a custom storage medium, e.g. a polyfill for localStorage. Default: null. + * + * Must implement: + * + * setItem - Same API as localStorage.setItem(key, value) + * getItem - Same API as localStorage.getItem(key) + * removeItem - Same API as localStorage.removeItem(key) + */ + storageImpl?: IStoreImplementation; + + /* + * Determines the storage medium used by a cache. Default: memory. + * + * Possible values: + * + * memory - cache will hold data in memory. Data is cleared when the page is refreshed. + * localStorage - cache will hold data in localStorage if available. Data is not cleared when the page is refreshed. + * sessionStorage - cache will hold data in sessionStorage if available. Data is not cleared when the page is refreshed. + */ + storageMode?: string; + + /* + * Determines the namespace of a cache when storageMode is set to localStorage or sessionStorage. Make it a shorter + * string to save space. Default: angular-cache.caches. + */ + storagePrefix?: string; + + /* + * A callback function to be executed whenever an expired item is removed from a cache when the cache is in passive + * or aggressive mode. Will be passed the key and value of the expired item. + * + * Will be passed a third done argument if the cache is in passive mode. This allows you to synchronously access the + * key and value of the expired item when you make the cache#get(key[, options]) call that is the reason the expired + * item is being removed in the first place. Default: null. + */ + onExpire?(key: string, value: any): any; + } + + export interface ICache { + + $$id: string; + + /** + * Return the item with the given key.options, if provided, must be an object. + * + * If the cache is in passive mode, then options.onExpire can be a function that will be called with the key + * and value of the requested item if the requested item is expired, with the get call itself returning undefined. + * @param key + * @returns {} + */ + get(key: string, options?: CacheGetOptions): T; + + /** + * Insert the item with the given key and value into the cache.options, if provided, must be an object. + * + * If inserting a promise, options.storeOnReject determines whether to insert the rejection value if the promise + * rejects (overriding the default storeOnReject setting for the cache). If inserting a promise, options.storeOnResolve + * determines whether to insert the resolved value if the promise resolves (overriding the default storeOnResolve setting for the cache). + * + * @param key + * @param value + * @param options + */ + put(key: string, value: T, options?: CachePutOptions): void; + + /** + * Remove and return the item with the given key, if it is in the cache. + * @param key + * @returns {} + */ + remove(key: string): T; + + /** + * Remove all items in the cache. + */ + removeAll(): void; + + /** + * Remove and return all expired items in the cache. + * @returns {} + */ + removeExpired(): { [key: string]: any }; + + /** + * Completely destroy this cache and its data. + * @returns {} + */ + destroy(): void; + + /** + * Returns an object containing information about the cache. + * + * @param key + */ + info(): CacheInfo; + + /** + * Returns an object containing information about the item with the given key, if the item is in the cache. + * + * @param key + */ + info(key: string): CacheItemInfo; + + /** + * Return the keys of all items in the cache as an object. + * @returns {} + */ + keySet(): any; + + /** + * Return the keys of all items in the cache as an array. + * @returns [] + */ + keys(): Array; + + /** + * Enable the cache. + */ + enable(): void; + + /** + * Disable the cache. + */ + disable(): void; + + /** + * cache#touch() will "touch" all items in the cache. + * cache#touch(key) will "touch" the item with the given key. + * + * @param key + */ + touch(key?: string, options?: CacheTouchOptions): void; + + /** + * Set the cacheFlushInterval for the cache. + * @param cacheFlushInterval + */ + setCacheFlushInterval(cacheFlushInterval: number): void; + + /** + * Set the capacity for the cache.Setting this lower than the current item count will result in those items being removed. + * @param capacity + */ + setCapacity(capacity: number): void; + + /** + * Set the deleteOnExpire for the cache. + * @param deleteOnExpire + */ + setDeleteOnExpire(deleteOnExpire: string): void; + + /** + * Set the maxAge for the cache. + */ + setMaxAge(maxAge: number): void; + + /** + * Set the onExpire for the cache. + * @param onExpire + */ + setOnExpire(onExpire: Function): void; + + /** + * Set the recycleFreq for the cache. + * @param recycleFreq + */ + setRecycleFreq(recycleFreq: number): void; + + /** + * Set the storageMode for the cache.This will move data from the current storage medium to the new one. + * @param storageMode + */ + setStorageMode(storageMode: string): void; + + /** + * Set multiple options for the cache at a time.Setting strict to true will reset options for the cache + * that are not specifically set in the options hash to CacheFactoryProvider.defaults. + * @param options + */ + setOptions(options: CacheOptions, strict?: boolean): void; + + /** + * Return the values of all items in the cache as an array. + * @returns Array + */ + values(): Array + } + + export interface ICacheFactory { + + BinaryHeap: IBinaryHeap; + utils: IUtils; + defaults: CacheOptions; + + /** + * Create a cache. cache must not already exist. cacheId must be a string. options is an optional argument and must be an object. + * Any options you pass here will override any default options. + * @param cacheId + * @param options + * @returns ICache + */ + (cacheId: string, options?: CacheOptions): ICache; + + /** + * Create a cache. cache must not already exist. cacheId must be a string. options is an optional argument and must be an object. + * Any options you pass here will override any default options. + * @param cacheId + * @param options + * @returns ICache + */ + createCache(cacheId: string, options?: CacheOptions): ICache; + + /** + * Return the cache with the given cacheId. + * @param cacheId The id of the cache storage. + * @returns ICache + */ + get(cacheId: string, options?: CacheOptions): ICache; + + /** + * Return an object of key- value pairs, the keys being cache ids and the values being the result of .info() being called on each cache. + * @returns CacheInfo + */ + info(): CacheInfo; + + /** + * Return the ids of all registered caches as an object. + * @returns {[key: string]: ICache} + */ + keySet(): { [key: string]: ICache }; + + /** + * Return the ids of all registered caches as an array. + * @returns Array + */ + keys(): Array; + + /** + * Destroy the cache with the given cacheId. + * @param cacheId + */ + destroy(cacheId: string): void; + + /** + * Destroy all registered caches. + */ + destroyAll(): void; + + /** + * Remove all data from all registered caches. + */ + clearAll(): void; + + /** + * Enable all registered caches. + */ + enableAll(): void; + + /** + * Disable all registered caches. + */ + disableAll(): void; + + /** + * Call.touch() on all registered caches. + */ + touchAll(): void; + + /** + * Call.removeExpired() on all registered caches.Returns a hash of any expired items, keyed by cache id. + * @returns {} + */ + removeExpiredFromAll(): Array<{ [key: string]: Array<{ [key: string]: any }> }>; + } + + export interface IUtils { + isNumber(value: any): boolean; + isString(value: any): boolean; + isObject(value: any): boolean; + isFunction(value: any): boolean; + equals(a: any, b: any): boolean; + fromJson(value: any): {} + Promise: any; + } + + export interface HeapItem { + key: string; + accessed: Date; + } + + export interface IBinaryHeap { + (w?: IWeightFunc, c?: ICompareFunc): void; + + heap: Array; + weightFunc: IWeightFunc; + compareFunc: ICompareFunc; + + push(node: HeapItem): void; + pop(): HeapItem; + peek(): HeapItem; + remove(node: HeapItem): HeapItem; + removeAll(): void; + size(): Number; + } + + export interface IWeightFunc { + (x: T): T; + } + + export interface ICompareFunc { + (x: T, y: T): boolean; + } + + export interface CacheInfo { + size: Number; + caches: { [key: string]: any }; + capacity: Number; + maxAge: Number; + deleteOnExpire: string; + onExpire: Function; + cacheFlushInterval: Number; + recycleFreq: Number; + storageMode: string; + storageImpl: IStoreImplementation; + disabled: boolean; + storagePrefix: string; + storeOnResolve: boolean; + storeOnReject: boolean; + } + + export interface CacheItemInfo { + created: Date; + accessed: Date; + expires: Date; + isExpired: boolean; + } +} + +declare var CacheFactory: CacheFactory.ICacheFactory; + +declare module "cachefactory" { + export = CacheFactory; +} \ No newline at end of file diff --git a/chai-as-promised/chai-as-promised.d.ts b/chai-as-promised/chai-as-promised.d.ts index 91a46f9033..6b2882b338 100644 --- a/chai-as-promised/chai-as-promised.d.ts +++ b/chai-as-promised/chai-as-promised.d.ts @@ -36,6 +36,7 @@ declare namespace Chai { // From chai not: PromisedAssertion; deep: PromisedDeep; + all: PromisedKeyFilter; a: PromisedTypeComparison; an: PromisedTypeComparison; include: PromisedInclude; @@ -129,6 +130,10 @@ declare namespace Chai { property: PromisedProperty; } + interface PromisedKeyFilter { + keys: PromisedKeys; + } + interface PromisedEqual { (value: any, message?: string): PromisedAssertion; } @@ -151,6 +156,7 @@ declare namespace Chai { (value: number, message?: string): PromisedAssertion; keys: PromisedKeys; members: PromisedMembers; + all: PromisedKeyFilter; } interface PromisedKeys { 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/chrome/chrome-app.d.ts b/chrome/chrome-app.d.ts index 1891b960e0..3b63357986 100644 --- a/chrome/chrome-app.d.ts +++ b/chrome/chrome-app.d.ts @@ -685,7 +685,7 @@ declare namespace chrome.usb { interface DeviceEvent extends chrome.events.Event<(device: Device) => void> {} export var onDeviceAdded: DeviceEvent; - export var onDeviceAdded: DeviceEvent; + export var onDeviceRemoved: DeviceEvent; export function getDevices(options: { vendorId?: number, productId?: number, filters?: DeviceFilter[] }, callback: (devices: Device[]) => void): void; export function getUserSelectedDevices(options: { multiple?: boolean, filters?: DeviceFilter[] }, callback: (devices: Device[]) => void): void; diff --git a/chrome/chrome.d.ts b/chrome/chrome.d.ts index 9cdf8c3a5d..bdd0271fca 100644 --- a/chrome/chrome.d.ts +++ b/chrome/chrome.d.ts @@ -6210,7 +6210,12 @@ declare namespace chrome.tabs { * The tab's new favicon URL. * @since Chrome 27. */ - faviconUrl?: string; + favIconUrl?: string; + /** + * The tab's new title. + * @since Chrome 48. + */ + title?: string; } interface TabMoveInfo { diff --git a/codemirror/codemirror.d.ts b/codemirror/codemirror.d.ts index 6196d015c6..4d95220c67 100644 --- a/codemirror/codemirror.d.ts +++ b/codemirror/codemirror.d.ts @@ -1063,6 +1063,12 @@ declare namespace CodeMirror { */ function defineMode(id: string, modefactory: ModeFactory): void; + /** + * id will be the id for the defined mode. Typically, you should use this second argument to defineMode as your module scope function + * (modes should not leak anything into the global scope!), i.e. write your whole mode inside this function. + */ + function defineMode(id: string, modefactory: ModeFactory): void; + /** * The first argument is a configuration object as passed to the mode constructor function, and the second argument * is a mode specification as in the EditorConfiguration mode option. @@ -1119,6 +1125,115 @@ declare namespace CodeMirror { severity?: string; to?: Position; } + + /** + * A function that calculates either a two-way or three-way merge between different sets of content. + */ + function MergeView(element: HTMLElement, options?: MergeView.MergeViewEditorConfiguration): MergeView.MergeViewEditor; + + namespace MergeView { + /** + * Options available to MergeView. + */ + interface MergeViewEditorConfiguration extends EditorConfiguration { + /** + * Determines whether the original editor allows editing. Defaults to false. + */ + allowEditingOriginals?: boolean; + + /** + * When true stretches of unchanged text will be collapsed. When a number is given, this indicates the amount + * of lines to leave visible around such stretches (which defaults to 2). Defaults to false. + */ + collapseIdentical?: boolean | number; + + /** + * Sets the style used to connect changed chunks of code. By default, connectors are drawn. When this is set to "align", + * the smaller chunk is padded to align with the bigger chunk instead. + */ + connect?: string; + + /** + * Callback for when stretches of unchanged text are collapsed. + */ + onCollapse?(mergeView: MergeViewEditor, line: number, size: number, mark: TextMarker): void; + + /** + * Provides original version of the document to be shown on the right of the editor. + */ + orig: any; + + /** + * Provides original version of the document to be shown on the left of the editor. + * To create a 2-way (as opposed to 3-way) merge view, provide only one of origLeft and origRight. + */ + origLeft?: any; + + /** + * Provides original version of document to be shown on the right of the editor. + * To create a 2-way (as opposed to 3-way) merge view, provide only one of origLeft and origRight. + */ + origRight?: any; + + /** + * Determines whether buttons that allow the user to revert changes are shown. Defaults to true. + */ + revertButtons?: boolean; + + /** + * When true, changed pieces of text are highlighted. Defaults to true. + */ + showDifferences?: boolean; + } + + interface MergeViewEditor extends Editor { + /** + * Returns the editor instance. + */ + editor(): Editor; + + /** + * Left side of the merge view. + */ + left: DiffView; + leftChunks(): MergeViewDiffChunk; + leftOriginal(): Editor; + + /** + * Right side of the merge view. + */ + right: DiffView; + rightChunks(): MergeViewDiffChunk; + rightOriginal(): Editor; + + /** + * Sets whether or not the merge view should show the differences between the editor views. + */ + setShowDifferences(showDifferences: boolean): void; + } + + /** + * Tracks changes in chunks from oroginal to new. + */ + interface MergeViewDiffChunk { + editFrom: number; + editTo: number; + origFrom: number; + origTo: number; + } + + interface DiffView { + /** + * Forces the view to reload. + */ + forceUpdate(): (mode: string) => void; + + /** + * Sets whether or not the merge view should show the differences between the editor views. + */ + setShowDifferences(showDifferences: boolean): void; + } + } } declare module "codemirror" { diff --git a/colors/colors.d.ts b/colors/colors.d.ts index cc6b307c03..7a78240287 100644 --- a/colors/colors.d.ts +++ b/colors/colors.d.ts @@ -41,6 +41,7 @@ declare module "colors" { america: Color; trap: Color; random: Color; + zalgo: Color; } namespace e { @@ -80,6 +81,7 @@ declare module "colors" { export var america: Color; export var trap: Color; export var random: Color; + export var zalgo: Color; } export = e; @@ -120,4 +122,5 @@ interface String { america: string; trap: string; random: string; + zalgo: string; } diff --git a/compression/compression.d.ts b/compression/compression.d.ts index 6a444e3f49..84fa211bd0 100644 --- a/compression/compression.d.ts +++ b/compression/compression.d.ts @@ -10,8 +10,50 @@ declare module "compression" { namespace e { interface CompressionOptions { - threshold?: number; + /** + * See https://github.com/expressjs/compression#chunksize regarding the usage. + */ + chunkSize?: number; + + /** + * See https://github.com/expressjs/compression#level regarding the usage. + */ + level?: number; + + /** + * See https://github.com/expressjs/compression#memlevel regarding the usage. + */ + memLevel?: number; + + /** + * See https://github.com/expressjs/compression#strategy regarding the usage. + */ + strategy?: number; + + /** + * See https://github.com/expressjs/compression#threshold regarding the usage. + */ + threshold?: number|string; + + /** + * See https://github.com/expressjs/compression#windowbits regarding the usage. + */ + windowBits?: number; + + /** + * See https://github.com/expressjs/compression#filter regarding the usage. + */ filter?: Function; + + /** + * See https://nodejs.org/api/zlib.html#zlib_class_options regarding the usage. + */ + flush?: number; + + /** + * See https://nodejs.org/api/zlib.html#zlib_class_options regarding the usage. + */ + finishFlush?: number; } } 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/cordova/cordova.d.ts b/cordova/cordova.d.ts index 299e2da4d9..24adab6928 100644 --- a/cordova/cordova.d.ts +++ b/cordova/cordova.d.ts @@ -35,7 +35,7 @@ interface Cordova { * @param action The action name to call on the native side (generally corresponds to the native class method). * @param args An array of arguments to pass into the native environment. */ - exec(success: () => any, fail: () => any, service: string, action: string, args?: string[]): void; + exec(success: () => any, fail: () => any, service: string, action: string, args?: any[]): void; /** Gets the operating system name. */ platformId: string; /** Gets Cordova framework version */ diff --git a/cordova/plugins/NetworkInformation.d.ts b/cordova/plugins/NetworkInformation.d.ts index 4f80fdbb7e..0d49597e3a 100644 --- a/cordova/plugins/NetworkInformation.d.ts +++ b/cordova/plugins/NetworkInformation.d.ts @@ -47,6 +47,7 @@ interface Connection { */ type: string; addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } declare var Connection: { diff --git a/core-js/core-js-tests.ts b/core-js/core-js-tests.ts index bc690d434c..965acc6855 100644 --- a/core-js/core-js-tests.ts +++ b/core-js/core-js-tests.ts @@ -500,3 +500,5 @@ s = s.unescapeHTML(); // ############################################################################################# promiseOfVoid = delay(i); + +console.log('core-js version number:', core.version); diff --git a/core-js/core-js.d.ts b/core-js/core-js.d.ts index 16441df233..2c1fa4bd99 100644 --- a/core-js/core-js.d.ts +++ b/core-js/core-js.d.ts @@ -1266,6 +1266,8 @@ interface String { declare function delay(msec: number): Promise; declare namespace core { + var version: string; + namespace Reflect { function apply(target: Function, thisArgument: any, argumentsList: ArrayLike): any; function construct(target: Function, argumentsList: ArrayLike): any; diff --git a/crypto-js/crypto-js-tests.ts b/crypto-js/crypto-js-tests.ts index 199c32ef2f..3a06346ed4 100644 --- a/crypto-js/crypto-js-tests.ts +++ b/crypto-js/crypto-js-tests.ts @@ -2,8 +2,8 @@ import CryptoJS = require('crypto-js'); +// Hashers var str: string; - str = CryptoJS.MD5('some message'); str = CryptoJS.MD5('some message', 'some key'); @@ -13,11 +13,123 @@ str = CryptoJS.SHA1('some message', 'some key', { any: true }); str = CryptoJS.format.OpenSSL('some message'); str = CryptoJS.format.OpenSSL('some message', 'some key'); -str = CryptoJS.enc.Utf8('some message'); -str = CryptoJS.enc.Utf8('some message', 'some key'); -str = CryptoJS.mode.OFB('some message'); -str = CryptoJS.mode.OFB('some message', 'some key'); +// Ciphers +var encrypted: CryptoJS.WordArray; +var decrypted: CryptoJS.DecryptedMessage; -str = CryptoJS.pad.Ansix923('some message'); -str = CryptoJS.pad.Ansix923('some message', 'some key'); +encrypted = CryptoJS.AES.encrypt("Message", "Secret Passphrase"); +decrypted = CryptoJS.AES.decrypt(encrypted, "Secret Passphrase"); + +encrypted = CryptoJS.DES.encrypt("Message", "Secret Passphrase"); +decrypted = CryptoJS.DES.decrypt(encrypted, "Secret Passphrase"); + +encrypted = CryptoJS.TripleDES.encrypt("Message", "Secret Passphrase"); +decrypted = CryptoJS.TripleDES.decrypt(encrypted, "Secret Passphrase"); + + +encrypted = CryptoJS.Rabbit.encrypt("Message", "Secret Passphrase"); +decrypted = CryptoJS.Rabbit.decrypt(encrypted, "Secret Passphrase"); + +encrypted = CryptoJS.RC4.encrypt("Message", "Secret Passphrase"); +decrypted = CryptoJS.RC4.decrypt(encrypted, "Secret Passphrase"); + +encrypted = CryptoJS.RC4Drop.encrypt("Message", "Secret Passphrase"); +encrypted = CryptoJS.RC4Drop.encrypt("Message", "Secret Passphrase", { drop: 3072 / 4 }); +decrypted = CryptoJS.RC4Drop.decrypt(encrypted, "Secret Passphrase", { drop: 3072 / 4 }); + +var key = CryptoJS.enc.Hex.parse('000102030405060708090a0b0c0d0e0f'); +var iv = CryptoJS.enc.Hex.parse('101112131415161718191a1b1c1d1e1f'); +encrypted = CryptoJS.AES.encrypt("Message", key, { iv: iv }); + +encrypted = CryptoJS.AES.encrypt("Message", "Secret Passphrase", { + mode: CryptoJS.mode.CFB, + padding: CryptoJS.pad.AnsiX923 +}); + + +// The Cipher Output +encrypted = CryptoJS.AES.encrypt("Message", "Secret Passphrase"); +alert(encrypted.key); +// 74eb593087a982e2a6f5dded54ecd96d1fd0f3d44a58728cdcd40c55227522223 +alert(encrypted.iv); +// 7781157e2629b094f0e3dd48c4d786115 +alert(encrypted.salt); +// 7a25f9132ec6a8b34 +alert(encrypted.ciphertext); +// 73e54154a15d1beeb509d9e12f1e462a0 +alert(encrypted); +// U2FsdGVkX1+iX5Ey7GqLND5UFUoV0b7rUJ2eEvHkYqA= + +var JsonFormatter = { + stringify: function(cipherParams: any) { + // create json object with ciphertext + var jsonObj: any = { + ct: cipherParams.ciphertext.toString(CryptoJS.enc.Base64) + }; + // optionally add iv and salt + if (cipherParams.iv) { + jsonObj.iv = cipherParams.iv.toString(); + } + if (cipherParams.salt) { + jsonObj.s = cipherParams.salt.toString(); + } + // stringify json object + return JSON.stringify(jsonObj); + }, + parse: function (jsonStr: any) { + // parse json string + var jsonObj = JSON.parse(jsonStr); + // extract ciphertext from json object, and create cipher params object + var cipherParams = (CryptoJS).lib.CipherParams.create({ + ciphertext: CryptoJS.enc.Base64.parse(jsonObj.ct) + }); + // optionally extract iv and salt + if (jsonObj.iv) { + cipherParams.iv = CryptoJS.enc.Hex.parse(jsonObj.iv); + } + if (jsonObj.s) { + cipherParams.salt = CryptoJS.enc.Hex.parse(jsonObj.s); + } return cipherParams; + } +}; +encrypted = CryptoJS.AES.encrypt("Message", "Secret Passphrase", { + format: JsonFormatter +}); +alert(encrypted); +// {"ct":"tZ4MsEnfbcDOwqau68aOrQ==","iv":"8a8c8fd8fe33743d3638737ea4a00698","s":"ba06373c8f57179c"} +decrypted = CryptoJS.AES.decrypt(encrypted, "Secret Passphrase", { + format: JsonFormatter +}); +alert(decrypted.toString(CryptoJS.enc.Utf8)); // Message + + +// Progressive Ciphering +var key = CryptoJS.enc.Hex.parse('000102030405060708090a0b0c0d0e0f'); +var iv = CryptoJS.enc.Hex.parse('101112131415161718191a1b1c1d1e1f'); +var aesEncryptor = CryptoJS.algo.AES.createEncryptor(key, { iv: iv }); +var ciphertextPart1 = aesEncryptor.process("Message Part 1"); +var ciphertextPart2 = aesEncryptor.process("Message Part 2"); +var ciphertextPart3 = aesEncryptor.process("Message Part 3"); +var ciphertextPart4 = aesEncryptor.finalize(); +var aesDecryptor = CryptoJS.algo.AES.createDecryptor(key, { iv: iv }); +var plaintextPart1 = aesDecryptor.process(ciphertextPart1); +var plaintextPart2 = aesDecryptor.process(ciphertextPart2); +var plaintextPart3 = aesDecryptor.process(ciphertextPart3); +var plaintextPart4 = aesDecryptor.process(ciphertextPart4); +var plaintextPart5 = aesDecryptor.finalize(); + + +// Encoders +var words = CryptoJS.enc.Base64.parse('SGVsbG8sIFdvcmxkIQ=='); +var base64 = CryptoJS.enc.Base64.stringify(words); +var words = CryptoJS.enc.Latin1.parse('Hello, World!'); +var latin1 = CryptoJS.enc.Latin1.stringify(words); +var words = CryptoJS.enc.Hex.parse('48656c6c6f2c20576f726c6421'); +var hex = CryptoJS.enc.Hex.stringify(words); +var words = CryptoJS.enc.Utf8.parse('𤭢'); +var utf8 = CryptoJS.enc.Utf8.stringify(words); +var words = CryptoJS.enc.Utf16.parse('Hello, World!'); +var utf16 = CryptoJS.enc.Utf16.stringify(words); +var words = CryptoJS.enc.Utf16LE.parse('Hello, World!'); +var utf16 = CryptoJS.enc.Utf16LE.stringify(words); diff --git a/crypto-js/crypto-js.d.ts b/crypto-js/crypto-js.d.ts index 19ea3cd196..0ab6681dce 100644 --- a/crypto-js/crypto-js.d.ts +++ b/crypto-js/crypto-js.d.ts @@ -1,10 +1,48 @@ -// Type definitions for crypto-js v3.1.3 +// Type definitions for crypto-js v3.1.4 // Project: https://github.com/evanvosberg/crypto-js // Definitions by: Michael Zabka // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare namespace CryptoJS { type Hash = (message: string, key?: string, ...options: any[]) => string; + interface Cipher { + encrypt(message: string, secretPassphrase: string, option?: CipherOption): WordArray; + decrypt(encryptedMessage: string | WordArray, secretPassphrase: string, option?: CipherOption): DecryptedMessage; + } + interface CipherAlgorythm { + createEncryptor(secretPassphrase: string, option?: CipherOption): Encriptor; + createDecryptor(secretPassphrase: string, option?: CipherOption): Decryptor; + } + interface Encriptor { + process(messagePart: string): string; + finalize(): string; + } + interface Decryptor { + process(messagePart: string): string; + finalize(): string; + } + export interface WordArray { + iv: string; + salt: string; + ciphertext: string; + key?: string; + } + export type DecryptedMessage = { + toString(encoder?: Encoder): string; + }; + interface CipherOption { + iv?: string; + mode?: Mode; + padding?: Padding; + [option: string]: any; + } + interface Encoder { + parse(encodedMessage: string): any; + stringify(words: any): string; + } + + interface Mode {} + interface Padding {} export interface Hashes { MD5: Hash; @@ -24,37 +62,50 @@ declare namespace CryptoJS { HmacSHA3: Hash; HmacRIPEMD160: Hash; PBKDF2: Hash; - AES: Hash; - TripleDES: Hash; - RC4: Hash; - Rabbit: Hash; - RabbitLegacy: Hash; - EvpKDF: Hash; + AES: Cipher; + DES: Cipher; + TripleDES: Cipher; + RC4: Cipher; + RC4Drop: Cipher; + Rabbit: Cipher; + RabbitLegacy: Cipher; + EvpKDF: Cipher; + algo: { + AES: CipherAlgorythm; + DES: CipherAlgorythm; + TrippleDES: CipherAlgorythm; + RC4: CipherAlgorythm; + RC4Drop: CipherAlgorythm; + Rabbit: CipherAlgorythm; + RabbitLegacy: CipherAlgorythm; + EvpKDF: CipherAlgorythm; + }; format: { - OpenSSL: Hash; - Hex: Hash; + OpenSSL: any; + Hex: any; }; enc: { - Latin1: Hash; - Utf8: Hash; - Hex: Hash; - Utf16: Hash; - Base64: Hash; + Latin1: Encoder; + Utf8: Encoder; + Hex: Encoder; + Utf16: Encoder; + Utf16LE: Encoder; + Base64: Encoder; }; mode: { - CFB: Hash; - CTR: Hash; - CTRGladman: Hash; - OFB: Hash; - ECB: Hash; + CFB: Mode; + CTR: Mode; + CTRGladman: Mode; + OFB: Mode; + ECB: Mode; }; pad: { - Pkcs7: Hash; - Ansix923: Hash; - Iso10126: Hash; - Iso97971: Hash; - ZeroPadding: Hash; - NoPadding: Hash; + Pkcs7: Padding; + AnsiX923: Padding; + Iso10126: Padding; + Iso97971: Padding; + ZeroPadding: Padding; + NoPadding: Padding; }; } diff --git a/d3/d3-tests.ts b/d3/d3-tests.ts index c9027b0889..7991dcaa03 100644 --- a/d3/d3-tests.ts +++ b/d3/d3-tests.ts @@ -2706,3 +2706,17 @@ function testMultiUtcFormat() { ["%Y", function() { return true; }] ]); } + +function testEnterSizeEmpty() { + + var selectionSize: number, + emptyStatus: boolean; + + var newNodes = d3.selectAll('.test') + .data(['1', '2', '3']) + .enter(); + + emptyStatus = newNodes.empty(); + selectionSize = newNodes.size(); + +} \ No newline at end of file diff --git a/d3/d3.d.ts b/d3/d3.d.ts index c80a922f1f..85a1b70f82 100644 --- a/d3/d3.d.ts +++ b/d3/d3.d.ts @@ -415,6 +415,9 @@ declare namespace d3 { select(name: (datum: Datum, index: number, outerIndex: number) => EventTarget): Selection; call(func: (selection: Enter, ...args: any[]) => any, ...args: any[]): Enter; + + empty(): boolean; + size(): number; } } diff --git a/dagre-d3/dagre-d3-tests.ts b/dagre-d3/dagre-d3-tests.ts index f73389015f..ef5fddffac 100644 --- a/dagre-d3/dagre-d3-tests.ts +++ b/dagre-d3/dagre-d3-tests.ts @@ -1,19 +1,19 @@ /// namespace DagreD3Tests { - var gDagre = new dagreD3.graphlib.Graph(); - var graph = gDagre.graph(); + const gDagre = new dagreD3.graphlib.Graph(); + const graph = gDagre.graph(); // has graph methods from dagre.d.ts graph.setNode("a", {}); - var num: number = 251 + graph.height + graph.width; - var predecessors: { [vertex:string]: string[] } = {}; - var successors: { [vertex:string]: string[] } = {}; + const num: number = 251 + graph.height + graph.width; + const predecessors: { [vertex: string]: string[] } = {}; + const successors: { [vertex: string]: string[] } = {}; predecessors["a"] = graph.predecessors("a"); successors["a"] = graph.successors("a"); - var render = new dagreD3.render(); - var svg = d3.select("svg"); + const render = new dagreD3.render(); + const svg = d3.select("svg"); + render.arrows()["arrowType"] = (parent: JQuery, id: string, edge: Dagre.Edge, type: string) => {}; render(svg, graph); } - diff --git a/dagre-d3/dagre-d3.d.ts b/dagre-d3/dagre-d3.d.ts index c8484995e3..68e24c2fa5 100644 --- a/dagre-d3/dagre-d3.d.ts +++ b/dagre-d3/dagre-d3.d.ts @@ -5,6 +5,7 @@ /// /// +/// declare namespace Dagre { @@ -23,9 +24,15 @@ declare namespace Dagre { } interface Render { + // see http://cpettitt.github.io/project/dagre-d3/latest/demo/user-defined.html for example usage + arrows (): { [arrowStyleName: string]: (parent: JQuery, id: string, edge: Dagre.Edge, type: string) => void }; new (): Render; (selection: d3.Selection, g: Dagre.Graph): void; } } declare var dagreD3: Dagre.DagreD3Factory; + +declare module "dagre-d3" { + export = dagreD3; +} diff --git a/dagre/dagre-tests.ts b/dagre/dagre-tests.ts index a4eaad32f3..0a33a7750d 100644 --- a/dagre/dagre-tests.ts +++ b/dagre/dagre-tests.ts @@ -1,10 +1,11 @@ /// namespace DagreTests { - var gDagre = new dagre.graphlib.Graph(); + const gDagre = new dagre.graphlib.Graph(); gDagre.setGraph({}) .setDefaultEdgeLabel(function(){ return ; }) .setNode("a", {}) - .setEdge("b", "c"); + .setEdge("b", "c") + .setEdge("c", "d", {class: "class"}); dagre.layout(gDagre); } diff --git a/dagre/dagre.d.ts b/dagre/dagre.d.ts index 2b99bf4d5a..7caa1b5590 100644 --- a/dagre/dagre.d.ts +++ b/dagre/dagre.d.ts @@ -3,7 +3,7 @@ // Definitions by: Qinfeng Chen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -declare namespace Dagre{ +declare namespace Dagre { interface DagreFactory { graphlib: GraphLib; layout(graph: Graph): void; @@ -16,7 +16,7 @@ declare namespace Dagre{ nodes(): string[]; node(id: any): any; setDefaultEdgeLabel(callback: () => void): Graph; - setEdge(sourceId: string, targetId: string): Graph; + setEdge(sourceId: string, targetId: string, options?: { [key: string]: any }): Graph; setGraph(options: { [key: string]: any }): Graph; setNode(id: string, node: { [key: string]: any }): Graph; } diff --git a/daterangepicker/daterangepicker-tests.ts b/daterangepicker/daterangepicker-tests.ts new file mode 100644 index 0000000000..ca1f99961c --- /dev/null +++ b/daterangepicker/daterangepicker-tests.ts @@ -0,0 +1,59 @@ +/// + +function tests_simple() { + $('#daterange').daterangepicker(); + $('input[name="daterange"]').daterangepicker({ + timePicker: true, + timePickerIncrement: 30, + locale: { + format: 'MM/DD/YYYY h:mm A' + } + }); + + $('#reportrange').daterangepicker({ + ranges: { + 'Today': [moment(), moment()], + 'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')], + 'Last 7 Days': [moment().subtract(6, 'days'), moment()], + 'Last 30 Days': [moment().subtract(29, 'days'), moment()], + 'This Month': [moment().startOf('month'), moment().endOf('month')], + 'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')] + } + }); + + $('input[name="datefilter"]').on('apply.daterangepicker', function (ev, picker) { + $(this).val(picker.startDate.format('MM/DD/YYYY') + ' - ' + picker.endDate.format('MM/DD/YYYY')); + }); + + + $('input[name="datefilter"]').on('cancel.daterangepicker', function (ev, picker) { + $(this).val(''); + }); + + $('#demo').daterangepicker({ + "startDate": "05/06/2016", + "endDate": "05/12/2016" + }, function (start: string, end: string, label: string) { + console.log("New date range selected: ' + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD') + ' (predefined range: ' + label + ')"); + }); + + $(function() { + + function cb(start: moment.Moment, end: moment.Moment) { + $('#reportrange span').html(start.format('MMMM D, YYYY') + ' - ' + end.format('MMMM D, YYYY')); + } + cb(moment().subtract(29, 'days'), moment()); + + $('#reportrange').daterangepicker({ + ranges: { + 'Today': [moment(), moment()], + 'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')], + 'Last 7 Days': [moment().subtract(6, 'days'), moment()], + 'Last 30 Days': [moment().subtract(29, 'days'), moment()], + 'This Month': [moment().startOf('month'), moment().endOf('month')], + 'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')] + } + }, cb); + +}); +} diff --git a/daterangepicker/daterangepicker.d.ts b/daterangepicker/daterangepicker.d.ts new file mode 100644 index 0000000000..11190aa85d --- /dev/null +++ b/daterangepicker/daterangepicker.d.ts @@ -0,0 +1,142 @@ +// Type definitions for Date Range Picker v2.1.19 +// Project: http://www.daterangepicker.com/ +// Definitions by: SirMartin +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// +/// + +interface JQuery { + daterangepicker(settings?: daterangepicker.Settings): JQuery; + daterangepicker(settings?: daterangepicker.Settings, callback?: (start?: string | Date | moment.Moment, end?: string | Date | moment.Moment, label?: string) => any): JQuery; +} + +declare module daterangepicker { + + interface DatepickerEventObject extends JQueryEventObject { + date: Date; + format(format?: string): string; + } + + interface Settings { + /** + * The start of the initially selected date range + */ + startDate?: string | moment.Moment | Date; + /** + * The end of the initially selected date range + */ + endDate?: string | moment.Moment | Date; + /** + * The earliest date a user may select + */ + minDate?: string | moment.Moment | Date; + /** + * The latest date a user may select + */ + maxDate?: string | moment.Moment | Date; + /** + * The maximum span between the selected start and end dates. Can have any property you can add to a moment object (i.e. days, months) + */ + dateLimit?: any; + /** + * Show year and month select boxes above calendars to jump to a specific month and year + */ + showDropdowns?: boolean; + /** + * Show localized week numbers at the start of each week on the calendars + */ + showWeekNumbers?: boolean; + /** + * Show ISO week numbers at the start of each week on the calendars + */ + showISOWeekNumbers?: boolean; + /** + * Allow selection of dates with times, not just dates + */ + timePicker?: boolean; + /** + * Increment of the minutes selection list for times (i.e. 30 to allow only selection of times ending in 0 or 30) + */ + timePickerIncrement?: number; + /** + * Use 24- hour instead of 12- hour times, removing the AM/ PM selection. + */ + timePicker24Hour?: boolean; + /** + * Show seconds in the timePicker. + */ + timePickerSeconds?: boolean; + /** + * Set predefined date ranges the user can select from.Each key is the label for the range, and its value an array with two dates representing the bounds of the range. + */ + ranges?: any; + /** + * (string: 'left'/'right'/'center') Whether the picker appears aligned to the left, to the right, or centered under the HTML element it's attached to + */ + opens?: string; + /** + * (string: 'down' or 'up') Whether the picker appears below (default) or above the HTML element it's attached to + */ + drops?: string; + /** + * CSS class names that will be added to all buttons in the picker + */ + buttonClasses?: string[]; + /** + * CSS class string that will be added to the apply button + */ + applyClass?: string; + /** + * CSS class string that will be added to the cancel button + */ + cancelClass?: string; + /** + * Allows you to provide localized strings for buttons and labels, customize the date display format, and change the first day of week for the calendars. + */ + locale?: Locale; + /** + * Show only a single calendar to choose one date, instead of a range picker with two calendars; the start and end dates provided to your callback will be the same single date chosen. + */ + singleDatePicker?: boolean; + /** + * Hide the apply and cancel buttons, and automatically apply a new date range as soon as two dates or a predefined range is selected. + */ + autoApply?: boolean; + /** + * When enabled, the two calendars displayed will always be for two sequential months (i.e.January and February), and both will be advanced when clicking the left or right arrows above the calendars.When disabled, the two calendars can be individually advanced and display any month/ year. + */ + linkedCalendars?: boolean; + /** + * jQuery selector of the parent element that the date range picker will be added to, if not provided this will be 'body' + */ + parentEl?: string; + /** + * A function that is passed each date in the two calendars before they are displayed, and may return true or false to indicate whether that date should be available for selection or not. + */ + isInvalidDate?(startDate: string | moment.Moment | Date, endDate?: string | moment.Moment | Date): boolean; + /** + * Indicates whether the date range picker should automatically update the value of an < input > element it's attached to at initialization and when the selected dates change. + */ + autoUpdateInput?: boolean; + /** + * Normally, if you use the ranges option to specify pre- defined date ranges, calendars for choosing a custom date range are not shown until the user clicks "Custom Range".When this option is set to true, the calendars for choosing a custom date range are always shown instead. + */ + alwaysShowCalendars?: boolean; + } + + interface Locale { + /** + * Text for cancel label. + */ + cancelLabel?: string; + /** + * Text for apply label. + */ + applyLabel?: string; + /** + * Format of the date string. example: 'YYYY-MM-DD' + */ + format?: string; + } +} diff --git a/db.js/db.js-tests.ts b/db.js/db.js-tests.ts new file mode 100644 index 0000000000..e2aacb27f0 --- /dev/null +++ b/db.js/db.js-tests.ts @@ -0,0 +1,259 @@ +// Test file for db.js Definition file +/// + +/* Type for use in tests */ + +interface Person { + firstName: string; + lastName: string; + answer: number; + group?: string; +} + +/* Opening/creating a database and connection */ + +var server: DbJs.Server; + +db.open({ + server: 'my-app', + version: 1, + schema: { + people: { + key: { keyPath: 'id', autoIncrement: true }, + indexes: { + firstName: {}, + answer: { unique: true } + } + } + } +}).then(function (s: DbJs.Server) { + server = s; +}); + +var typedStore: DbJs.TypedObjectStoreServer = server['people']; + +/* Basic server operations */ + +var idb = server.getIndexedDB(); +server.close(); + +/* General server/store methods */ + +// Adding items +server.add('people', { + firstName: 'Aaron', + lastName: 'Powell', + answer: 42 +}).then(function (item) { }); + +typedStore.add({ + firstName: 'Aaron', + lastName: 'Powell', + answer: 42 +}).then(function (item) { }); + +// Updating +server.update('people', { + firstName: 'Aaron', + lastName: 'Powell', + answer: 42 +}).then(function (item) { }); + +typedStore.update({ + firstName: 'Aaron', + lastName: 'Powell', + answer: 42 +}).then(function (item) { }); + +// Removing +server.remove('people', 1).then(function (key) { }); +typedStore.remove(1).then(function (key) { }); + +// Clearing +server.clear('people').then(function() { }); +typedStore.clear().then(function() { }); + +// Fetching + +// Getting a single object by key +server.get('people', 5).then(function (results) { }); +typedStore.get(5).then(function (results) { }); + +// Getting a single object by key range + +// With a MongoDB-style range: + +server.get('people', {gte: 1, lt: 3}) + .then(function (results) { }); +typedStore.get({gte: 1, lt: 3}) + .then(function (results) { }); + +// With an IDBKeyRange : + +server.get('people', IDBKeyRange.bound(1, 3, false, true)) + .then(function (results) { }); +typedStore.get(IDBKeyRange.bound(1, 3, false, true)) + .then(function (results) { }); + +// Querying + +// Querying all objects +server.query('people') + .all() + .execute() + .then(function (results) { }); + +typedStore.query() + .all() + .execute() + .then(function (results) { }); + +// Querying using indexes +server.query('people', 'specialProperty') + .all() + .execute() + .then(function (results) { }); + + typedStore.query('specialProperty') + .all() + .execute() + .then(function (results) { }); + +// Filter with property and value +server.query('people') + .filter('firstName', 'Aaron') + .execute() + .then(function (results) { }); + +// Filter with function +server.query('people') + .filter(function(person: any) { return person.group === 'hipster'; }) + .execute() + .then(function (results) { }); + +typedStore.query('people') + .filter(function(person) { return person.group === 'hipster'; }) + .execute() + .then(function (results) { }); + +// Querying with ranges +server.query('people', 'firstName') + .only('Aaron') + .then(function (results) { }); + +server.query('people', 'answer') + .bound(30, 50) + .then(function (results) { }); + +server.query('people', 'firstName') + .range({ eq: 'Aaron' }) + .then(function (results) { }); + +server.query('people', 'answer') + .range({ gte: 30, lte: 50 }) + .then(function (results) { }); + +// Querying for distinct values + server.query('people', 'firstName') + .only('Aaron') + .distinct() + .execute() + .then(function (data) { }); + +// Limiting cursor range +server.query('people', 'firstName') + .all() + .limit(1, 3) + .execute() + .then(function (data) { }); + +// Cursor direction (desc) +server.query('people') + .all() + .desc() + .execute() + .then(function (results) { }); + +// Keys +server.query('people', 'firstName') + .only('Aaron') + .keys() + .execute() + .then(function (results) { }); + +// Mapping +server.query('people', 'age') + .lowerBound(30) + .map(function (value) { + return { + fullName: value.firstName + ' ' + value.lastName, + raw: value + }; + }) + .execute() + .then(function (data) { }); + +// Counting +server.query('people', 'firstName') + .only('Aaron') + .count() + .execute() + .then(function (results) { }); + +// With no arguments (count all items) +server.count().then(function (ct) { }); + +// With a key +server.count('myKey').then(function (ct) { }); + +// With a MongoDB-style range +server.count({gte: 1, lt: 3}).then(function (ct) { }); + +// With an IDBKeyRange range +server.count(IDBKeyRange.bound(1, 3, false, true)).then(function (ct) { }); + +// Atomic updates +server.query('users', 'last_mod') + .lowerBound(new Date().getTime() - 10000) + .modify({ last_mod: new Date().getTime() }) + .execute() + .then(function(results) { }); + +server.query('users', 'changed') + .only(true) + .modify({ changed: false }) + .execute() + .then(function () { }); + +server.query('users', 'name') + .lowerBound('marcy') + .modify({ views: function(profile: any) { return profile.views + 1; } }) + .execute() + .then(function () { }); + +/* Other server methods */ + +// Closing connection +server.close(); + +// Retrieving the indexedDB.open result object in use +var storeNames = server.getIndexedDB().objectStoreNames; + +// Server event handlers + +server.addEventListener('abort', function (e: Event) { }); +server.addEventListener('error', function (err: Event) { }); +server.addEventListener('versionchange', function (e: Event) { }); + +server + .abort(function (e) { }) + .error(function (err) { }) + .versionchange(function (e) { }); + +// Deleting a database +db.delete('dbName').then(function () { }, function (err: Error) { }); +db.delete('dbName').catch(function (err) { }).then(function (ev) { }); + +// Comparing two keys + +db.cmp('key1', 'key2'); diff --git a/db.js/db.js.d.ts b/db.js/db.js.d.ts new file mode 100644 index 0000000000..83e21fa529 --- /dev/null +++ b/db.js/db.js.d.ts @@ -0,0 +1,154 @@ +// Type definitions for db.js v0.14.0 +// Project: https://github.com/aaronpowell/db.js/ +// Definitions by: Chris Wrench +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module DbJs { + interface ErrorListener { + (err: Error): void; + } + + interface OpenOptions { + server: string; + version: number; + schema?: any; + } + + interface DbJsStatic { + open(options: OpenOptions): Promise; + delete(dbName: string): Promise; + cmp(key1: any, key2: any): number; + } + + // Query API + + interface ExecutableQuery { + execute(): Promise; + } + + interface CountableQuery { + count(): ExecutableQuery; + } + + interface KeysQuery extends DescableQuery, ExecutableQuery, FilterableQuery, DistinctableQuery, MappableQuery { + } + + interface KeyableQuery { + keys(): KeysQuery; + } + + interface FilterQuery extends KeyableQuery, ExecutableQuery, FilterableQuery, DescableQuery, DistinctableQuery, ModifiableQuery, LimitableQuery, MappableQuery { + } + + interface FilterableQuery { + filter(index: string, value: TValue): FilterQuery; + filter(filter: (value: T) => boolean): FilterQuery; + } + + interface DescQuery extends KeyableQuery, CountableQuery, ExecutableQuery, FilterableQuery, DescableQuery, ModifiableQuery, MappableQuery { + } + + interface DescableQuery { + desc(): DescQuery; + } + + interface DistinctQuery extends KeyableQuery, ExecutableQuery, FilterableQuery, DescableQuery, ModifiableQuery, MappableQuery, CountableQuery { + } + + interface DistinctableQuery { + distinct(filter?: (value: T) => boolean): DistinctQuery; + } + + interface ModifiableQuery { + modify(filter: (value: T) => boolean): ExecutableQuery; + modify(modifyObj: any): ExecutableQuery; + } + + interface LimitableQuery { + limit(n: any, m: any): ExecutableQuery; + } + + interface MappableQuery { + map(fn: (value: T) => TMap): Query; + } + + interface Query extends Promise, KeyableQuery, ExecutableQuery, FilterableQuery, DescableQuery, DistinctableQuery, ModifiableQuery, LimitableQuery, MappableQuery, CountableQuery { + } + + interface IndexQuery extends Query { + only(...args: any[]): Query; + bound(lowerBound: any, upperBound: any): Query; + upperBound(upperBound: any): Query; + lowerBound(lowerBound: any): Query; + range(opts: any): Query; + all(): Query; + } + + interface KeyValuePair { + key: TKey; + item: TValue; + } + + interface BaseServer { + getIndexedDB(): IDBDatabase; + close(): void; + } + + interface IndexAccessibleServer { + [store: string]: TypedObjectStoreServer; + } + + interface ObjectStoreServer { + add(table: string, entity: T): Promise; + add(table: string, ...entities: T[]): Promise; + add(table: string, entity: KeyValuePair): Promise>; + add(table: string, ...entities: KeyValuePair[]): Promise[]>; + update(table: string, entity: T): Promise; + update(table: string, ...entities: T[]): Promise; + update(table: string, entity: KeyValuePair): Promise>; + update(table: string, ...entities: KeyValuePair[]): Promise[]>; + remove(table: string, key: TKey): Promise; + remove(table: string, ...keys: TKey[]): Promise; + clear(table: string): Promise; + get(table: string, key: any): Promise; + query(table: string): IndexQuery; + query(table: string, index: string): IndexQuery; + count(): Promise; + count(keyOrRange: any): Promise; + count(table: string, key: any): Promise; + addEventListener(type: 'abort', listener: (ev: Event) => any): void; + addEventListener(type: 'versionchange', listener: (ev: Event) => any): void; + addEventListener(type: 'error', listener: (err: Error) => any): void; + addEventListener(type: string, listener: EventListener | ErrorListener): void; + abort(listener: (ev: Event) => any): ObjectStoreServer; + versionchange(listener: (ev: Event) => any): ObjectStoreServer; + error(listener: (ev: Error) => any): ObjectStoreServer; + } + + interface TypedObjectStoreServer { + add(entity: T): Promise; + add(...entities: T[]): Promise; + add(entity: KeyValuePair): Promise>; + add(...entities: KeyValuePair[]): Promise[]>; + update(entity: T): Promise; + update(...entities: T[]): Promise; + update(entity: KeyValuePair): Promise>; + update(...entities: KeyValuePair[]): Promise[]>; + remove(key: TKey): Promise; + remove(...keys: TKey[]): Promise; + clear(): Promise; + get(key: any): Promise; + query(): IndexQuery; + query(index: string): IndexQuery; + count(key: any): Promise; + } + + type Server = DbJs.IndexAccessibleServer & DbJs.ObjectStoreServer & DbJs.BaseServer; +} + +declare module "db" { + var db: DbJs.DbJsStatic; + export = db; +} + +declare var db: DbJs.DbJsStatic; diff --git a/df-visible/df-visible-tests.ts b/df-visible/df-visible-tests.ts new file mode 100644 index 0000000000..c5a8f1bf2b --- /dev/null +++ b/df-visible/df-visible-tests.ts @@ -0,0 +1,35 @@ +/// + +// https://github.com/customd/jquery-visible/blob/master/examples/demo-basic.html +$(function(){ + + // Add the spans to the container element. + $('#container dt').each(function(){ $(this).append(''); }); + + // Trigger the + $('#detect').on('click',function(){ + + // Select the detection type. + var detectPartial = $('#detect_type').val() == 'partial'; + + // Loop over each container, and check if it's visible. + $('#container dt').each(function(){ + + // Is this element visible onscreen? + var visible = $(this).visible( detectPartial ); + + // Set the visible status into the span. + $(this).find('span').text( visible ? 'Onscreen' : 'Offscreen' ).toggleClass('visible',visible); + }); + }); +}); + +// https://www.customd.com/articles/13/checking-if-an-element-is-visible-on-screen-using-jquery +// Check both vertical, and horizontal at once +$('#element').visible(true, false, 'both'); + +// Check only horizontal +$('#element').visible(true, false, 'horizontal'); + +// Check only vertical +$('#element').visible(true, false, 'vertical'); diff --git a/df-visible/df-visible.d.ts b/df-visible/df-visible.d.ts new file mode 100644 index 0000000000..b8d05fe360 --- /dev/null +++ b/df-visible/df-visible.d.ts @@ -0,0 +1,18 @@ +// Type definitions for jquery-visible +// Project: https://github.com/customd/jquery-visible +// Definitions by: Andrey Lipatkin +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +type Direction = "horizontal" | "vertical" | "both"; + +interface JQuery { + /** + * Gets the value of a setting. + * @param details Which setting to consider. + * @param callback The callback parameter should be a function that looks like this: + * function(object details) {...}; + */ + visible(partial?: boolean, hidden?: boolean, direction?: Direction): boolean; +} diff --git a/dojo/dojo.d.ts b/dojo/dojo.d.ts index 455ffc8fe3..bf3258a14a 100644 --- a/dojo/dojo.d.ts +++ b/dojo/dojo.d.ts @@ -649,7 +649,7 @@ declare namespace dojo { * @param url URL to request * @param options OptionalOptions for the request. */ - interface xhr { (url: String, options?: dojo.request.xhr.__Options): void } + interface xhr { (url: String, options?: dojo.request.xhr.__Options): dojo.request.__Promise } interface xhr { /** * Send an HTTP DELETE request using XMLHttpRequest with the given URL and options. 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/dotdotdot/dotdotdot-tests.ts b/dotdotdot/dotdotdot-tests.ts index 95fe346745..6920d3c2c0 100644 --- a/dotdotdot/dotdotdot-tests.ts +++ b/dotdotdot/dotdotdot-tests.ts @@ -4,6 +4,7 @@ $("span").dotdotdot({ ellipsis: ":::" }); $("span").dotdotdot({ wrap: "letter" }); $("span").dotdotdot({ fallbackToLetter: false }); +$("span").dotdotdot({ after: "a.after" }); $("span").dotdotdot({ after: $("#after") }); $("span").dotdotdot({ watch: true }); $("span").dotdotdot({ height: 42 }); diff --git a/dotdotdot/dotdotdot.d.ts b/dotdotdot/dotdotdot.d.ts index 6219340ba6..bedd6cecac 100644 --- a/dotdotdot/dotdotdot.d.ts +++ b/dotdotdot/dotdotdot.d.ts @@ -31,7 +31,7 @@ declare namespace JQueryDotDotDot { /** jQuery-selector for the element to keep and put after the ellipsis. * Default: null */ - after?: JQuery; + after?: string | JQuery; /** Whether to update the ellipsis: true/'window' * Default: false 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/ej.widgets.all/ej.mobile.all-tests.ts b/ej.widgets.all/ej.mobile.all-tests.ts new file mode 100644 index 0000000000..86381d522a --- /dev/null +++ b/ej.widgets.all/ej.mobile.all-tests.ts @@ -0,0 +1,336 @@ +/// +/// + +$(document).ready(function () { + + $("#CoreLinearGauge").ejLinearGauge({ + labelColor: "#8c8c8c", width: 500, + scales: [{ + width: 4, border: { color: "transparent",width:0 }, showBarPointers: false, showRanges: true, length: 310, + position: { x: 52, y: 50 }, markerPointers: [{ + value: 50, length: 10, width: 10, backgroundColor: "#4D4D4D", border: { color: "#4D4D4D" } + }], + labels: [{ font: { size: "11px", fontFamily: "Segoe UI", fontStyle: "bold" }, distanceFromScale:{x: -13} }], + ticks: [{ type: "majorinterval", width: 1, color: "#8c8c8c" }], + ranges: [{ + endValue: 60, + startValue: 0, + backgroundColor: "#F6B53F", + border: { color: "#F6B53F" }, startWidth: 4, endWidth: 4 + }, { + endValue: 100, + startValue: 60, + backgroundColor: "#E94649", + border: { color: "#E94649" }, startWidth: 4, endWidth: 4 + }] + }], + init:onLinearGaugeinit, + mouseClick:onLinearGaugemouseClick + }); +}); + +function onLinearGaugeinit() +{ + console.log("init"); +} +function onLinearGaugemouseClick() +{ + console.log("mouseClick"); +} + +$(document).ready(function () { + + $("#CoreCircularGauge").ejCircularGauge({ + backgroundColor: "transparent", width: 500, + scales: [{ + showRanges: true, + startAngle: 122, sweepAngle: 296, radius: 130, showScaleBar: true, size: 1, maximum: 120, majorIntervalValue: 20, minorIntervalValue: 10, + border: { + width: 0.5, + }, + pointers: [{ + value: 60, + showBackNeedle: true, + backNeedleLength: 20, + length: 95, + width: 7, + pointerCap: { radius: 12 } + }], + ticks: [{ + type: "major", + distanceFromScale: 2, + height: 16, + width: 1, color: "#8c8c8c" + }, { type: "minor", height: 8, width: 1, distanceFromScale: 2, color: "#8c8c8c" }], + labels: [{ + color: "#8c8c8c" + }], + ranges: [{ + distanceFromScale: -30, + startValue: 0, + endValue: 70 + }, { + distanceFromScale: -30, + startValue: 70, + endValue: 110, + backgroundColor: "#fc0606", + border: { color: "#fc0606" } + }, + { + distanceFromScale: -30, + startValue: 110, + endValue: 120, + backgroundColor: "#f5b43f", + border: { color: "#f5b43f" } + }] + }], + mouseClick:onCircularMouseClick + }); + +}); + +function onCircularMouseClick() +{ + console.log("Mouse click.."); +} + +$(document).ready(function () { + + $("#DigitalCore").ejDigitalGauge({ + width: 525, + height: 305, + items: [{ + segmentSettings: { + width: 1, + spacing: 0, + color: "#8c8c8c" + }, + characterSettings: { + opacity: 0.8, + }, + value: "123456789", + position: { x: 52, y: 52 } + }], + init:onDigitalGaugeinit, + itemRendering:onDigitalGaugeItemRendering + }); +}); + +function onDigitalGaugeinit() +{ + console.log("init"); +} +function onDigitalGaugeItemRendering() +{ + console.log("itemRendering"); +} + +$(document).ready(function () { + + $("#container").ejChart( + { + + + + //Initializing Common Properties for all the series + commonSeriesOptions: + { + type: 'line', enableAnimation: true, + tooltip:{ visible :true, template:'Tooltip'}, + marker: + { + shape: 'circle', + size: + { + height: 10, width: 10 + }, + visible: true + }, + border : {width: 2} + }, + + + + title :{text: 'Efficiency of oil-fired power production'}, + size: { height: "600" }, + legend: { visible: true}, + create:onChartCreate + }); + +}); + +function onChartCreate() +{ + console.log("create"); +} + +$(document).ready(function () { + + $("#scrollcontent").ejRangeNavigator({ + + enableDeferredUpdate: true, + padding: "15", + allowSnapping:true, + selectedRangeSettings: { + start:"2015/5/25", end:"2016/5/25" + }, + + }) +}); + +$(document).ready(function () { + $("#BulletGraph1").ejBulletGraph({ + qualitativeRangeSize: 32, + quantitativeScaleLength: 475, tooltipSettings: {template: "Tooltip", visible: true}, orientation: ej.datavisualization.BulletGraph.Orientation.Horizontal, + flowDirection: ej.datavisualization.BulletGraph.FlowDirection.Forward, + quantitativeScaleSettings: { + location: { x: 110, y: 10 }, + minimum: 0, + maximum: 10, + interval: 1, + minorTicksPerInterval: 4, + majorTickSettings:{ size: 13, width: 1, stroke: 'gray'}, + minorTickSettings:{ size: 5, width: 1, stroke: 'gray'}, + + labelSettings: { + position: ej.datavisualization.BulletGraph.LabelPosition.Below, offset: 14, size: 10 + }, + featuredMeasureSettings: { width: 6 }, + comparativeMeasureSettings:{ + width: 5 + }, + featureMeasures: [{ value: 8, comparativeMeasureValue: 6.7, category: ""}] + }, + qualitativeRanges: [{ + rangeEnd: 4.3 + }, { + rangeEnd: 7.3 + }, { + rangeEnd: 10 + }], + captionSettings: { textAngle: 0, + location: { x: 17, y: 20 }, text: "Revenue YTD", font: { color: null, fontFamily: 'Segoe UI', fontStyle: ej.datavisualization.BulletGraph.FontStyle.Normal, size: '12px', fontWeight: ej.datavisualization.BulletGraph.FontWeight.Normal, opacity: 1 }, //'#707070' + subTitle: { textAngle: 0, + text: "$ in Thousands", location: { x: 10, y: 35 }, font: { color: null, fontFamily: 'Segoe UI', fontStyle: ej.datavisualization.BulletGraph.FontStyle.Normal, size: '12px', fontWeight: ej.datavisualization.BulletGraph.FontWeight.Normal, opacity: 1} //'#707070' + } + } + + + + }); + + $("#BulletGraph2").ejBulletGraph({ qualitativeRangeSize: 32, height:140, + quantitativeScaleLength: 475, orientation: ej.datavisualization.BulletGraph.Orientation.Horizontal, + flowDirection: ej.datavisualization.BulletGraph.FlowDirection.Forward, + quantitativeScaleSettings: { + location: { x: 110, y: 10 }, + minimum: -10, + maximum: 10, + interval: 2, + minorTicksPerInterval: 4, + majorTickSettings:{ size: 13, width: 1}, + minorTickSettings:{ size: 5, width: 1}, + + labelSettings: { + position: ej.datavisualization.BulletGraph.LabelPosition.Below, offset: 14, size: 10, labelSuffix: ' %' + }, + featuredMeasureSettings: { width: 6 }, + comparativeMeasureSettings:{ width: 5 }, + featureMeasures: [{ value: 8, comparativeMeasureValue: 6.7}] + }, + qualitativeRanges: [{ + rangeEnd: -4, rangeStroke: "#61a301" + }, { + rangeEnd: 3, rangeStroke: "#fcda21" + }, { + rangeEnd: 10, rangeStroke: "#d61e3f" + }], + captionSettings: { textAngle: 0, + location: { x: 60, y: 25 }, text: "Profit", font: { color: null, fontFamily: 'Segoe UI', fontStyle: ej.datavisualization.BulletGraph.FontStyle.Normal, size: '13px', fontWeight: ej.datavisualization.BulletGraph.FontWeight.Normal, opacity: 1 }, //'#707070' + //subTitle: { textAngle: 0, + // text: "profit in %", location: { x: 35, y: 35 }, font: { color: null, fontFamily: 'Segoe UI', fontStyle: ej.datavisualization.BulletGraph.FontStyle.Normal, size: '12px', fontWeight: ej.datavisualization.BulletGraph.FontWeight.Normal, opacity: 1} //'#707070' + //} + }, + drawLabels:onBulletDrawLabel + }); + +}); + + function onBulletDrawLabel() + { + console.log("drawLabel"); + } + + +$(document).ready(function () { + + $("#barcode").ejBarcode({ text: "HTTP://WWW.SYNCFUSION.COM", symbologyType: "qrbarcode", xDimension: 8, displayText: true, load:onBarcodeLoad }); + +}); + +function onBarcodeLoad() + { + console.log("load"); + } + + jQuery(function ($) { + $("#container").ejMap({ + mouseover:MapMouseOver, + onRenderComplete:MapOnRenderComplete, + navigationControl:{enableNavigation:true,orientation:'vertical',absolutePosition:{x:5,y:15},dockPosition: 'none'}, + background:'white', + enableAnimation: true, + layers: [ + { + layerType: "geometry", + enableSelection: false, + enableMouseHover:false, + + showMapItems: false, + markerTemplate: 'template', + shapeSettings: { + fill: "#626171", + strokeThickness: "1", + stroke: "#6F6F79", + highlightStroke:"#6F6F79", + valuePath: "name", + highlightColor: "gray" + + }, + + } + ] + + }); + }); + function MapMouseOver() { + console.log("mouseover"); + } + function MapOnRenderComplete() { + console.log("onRenderComplete"); + } + + + jQuery(function ($) { + $("#treemapContainer").ejTreeMap({ + treeMapItemSelected:onTreeMapItemSelected, + + levels: [ + { groupPath: "Continent", groupGap: 5} + ], + colorValuePath: "Growth", + rangeColorMapping: [ + { color: "#DC562D", from: "0", to: "1" }, + { color: "#FED124", from: "1", to: "1.5" }, + { color: "#487FC1", from: "1.5", to: "2" }, + { color: "#0E9F49", from: "2", to: "3" } + ], + showTooltip:true, + leafItemSettings: { labelPath: "Region" } + }); + }); + function onTreeMapItemSelected() { + console.log("TreeMapItemSelected"); + } + + \ No newline at end of file diff --git a/ej.widgets.all/ej.mobile.all.d.ts b/ej.widgets.all/ej.mobile.all.d.ts new file mode 100644 index 0000000000..cdf403f36c --- /dev/null +++ b/ej.widgets.all/ej.mobile.all.d.ts @@ -0,0 +1,19908 @@ +// Type definitions for ej.mobile.all v14.1.0.41 +// Project: http://help.syncfusion.com/js/typescript +// Definitions by: Syncfusion +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + + +/*! +* filename: ej.mobile.all.d.ts +* version : 14.1.0.41 +* Copyright Syncfusion Inc. 2001 - 2016. All rights reserved. +* Use of this code is subject to the terms of our license. +* A copy of the current license can be obtained at any time by e-mailing +* licensing@syncfusion.com. Any infringement will be prosecuted under +* applicable laws. +*/ +declare module ej { + + var dataUtil: dataUtil; + function isMobile(): boolean; + function isIOS(): boolean; + function isAndroid(): boolean; + function isFlat(): boolean; + function isWindows(): boolean; + function isCssCalc(): boolean; + function getCurrentPage(): JQuery; + function isLowerResolution(): boolean; + function browserInfo(): browserInfoOptions; + function isTouchDevice(): boolean; + function addPrefix(style: string): string; + function animationEndEvent(): string; + function blockDefaultActions(e: Object): void; + function buildTag(tag: string, innerHtml: string, styles: Object, attrs: Object): JQuery; + function cancelEvent(): string; + function copyObject(): string; + function createObject(nameSpace: string, value: Object, initIn: string): JQuery; + function defineClass(className: string, constructor:any, proto: Object, replace: boolean): Object; + function destroyWidgets(element: Object): void; + function endEvent(): string; + function event(type: string, data: any, eventProp: Object): Object; + function getAndroidVersion(): Object; + function getAttrVal(ele: Object, val: string, option: Object): Object; + function getBooleanVal(ele: Object, val: string, option: Object): Object; + function getClearString(): string; + function getDimension(element: Object, method: string): Object; + function getFontString(fontObj: Object): string; + function getFontStyle(style: string): string; + function getMaxZindex(): number; + function getNameSpace(className: string): string; + function getObject(nameSpace: string): Object; + function getOffset(ele: string): Object; + function getRenderMode(): string; + function getScrollableParents(element: Object): void; + function getTheme(): string; + function getZindexPartial(element: Object, popupEle: string): number; + function hasRenderMode(element: string): void; + function hasStyle(prop: string): boolean; + function hasTheme(element: string): string; + function hexFromRGB(color: string): string; + function ieClearRemover(element: string): void; + function isAndroidWebView(): string; + function isDevice(): boolean; + function isIOS7(): boolean; + function isIOSWebView(): boolean; + function isLowerAndroid(): boolean; + function isNullOrUndefined(value: Object): boolean; + function isPlainObject(): JQuery; + function isPortrait(): any; + function isTablet(): boolean; + function isWindowsWebView(): string; + function listenEvents(selectors:any, eventTypes: any, handlers: any, remove?: any, pluginObj?: any, disableMouse?: boolean): void; + function listenTouchEvent(selectors:any, eventTypes: any, handlers: any, remove?: any, pluginObj?: any, disableMouse?: boolean): void; + function logBase(val: string, base: string): number; + function measureText(text: string, maxwidth: number, font: string): string; + function moveEvent(): string; + function print(element: string): void; + function proxy(fn: Object, context: string, arg: string): boolean; + function round(value: string, div: string, up: string): any; + function sendAjaxRequest(ajaxOptions: Object): void; + function setCaretToPos(nput: string, pos1: string, pos2: string): void; + function setRenderMode(element: string): void; + function setTheme(): Object; + function startEvent(): string; + function tapEvent(): string; + function tapHoldEvent(): string; + function throwError(): Object; + function transitionEndEvent(): Object; + function userAgent(): boolean; + function widget(pluginName: string, className: string, proto: Object): Object; + function avg(json: Object, filedName: string): any; + function getGuid(prefix: string): number; + function group(jsonArray: any, field: string, agg: string, level: number, groupDs: string): Object; + function isJson(jsonData: string): string; + function max(jsonArray: any, fieldName: string, comparer: string): any; + function min(jsonArray: any, fieldName: string, comparer: string): any; + function merge(first: string, second: string): any; + function mergeshort(jsonArray: any, fieldName: string, comparer: string): any; + function parseJson(jsonText: string): string; + function parseTable(table: number, headerOption: string, headerRowIndex: string): Object; + function select(jsonArray: any, fields: string): any; + function setTransition(): boolean; + function sum(json: string, fieldName: string): string; + function swap(array: any, x: string, y: string): any; + var cssUA: string; + var serverTimezoneOffset: number; + var transform: string; + var transformOrigin: string; + var transformStyle: string; + var transition: string; + var transitionDelay: string; + var transitionDuration: string; + var transitionProperty: string; + var transitionTimingFunction: string; + export module device { + function isAndroid(): boolean; + function isIOS(): boolean; + function isFlat(): boolean; + function isIOS7(): boolean; + function isWindows(): boolean; + } + export module widget { + var autoInit: boolean; + var registeredInstances: Array; + var registeredWidgets: Array; + function register(pluginName: string, className: string, prototype: any): void; + function destroyAll(elements: Element): void; + function init(element: Element): void; + function registerInstance(element: Element, pluginName: string, className: string, prototype: any):void; + } + + interface browserInfoOptions { + name: string; + version: string; + culture: Object; + isMSPointerEnabled: boolean; + } + class WidgetBase { + destroy(): void; + element: JQuery; + setModel(options: Object, forceSet?: boolean):any; + option(prop?: Object, value?: Object, forceSet?: boolean): any; + persistState(): void; + restoreState(silent: boolean): void; + } + + class Widget extends WidgetBase { + constructor(pluginName: string, className: string, proto: any); + static fn: Widget; + static extend(widget: Widget): any; + register(pluginName: string, className: string, prototype: any): void; + destroyAll(elements: Element): void; + model: any; + } + + + interface BaseEvent { + cancel: boolean; + type: string; + } + class DataManager { + constructor(dataSource?: any, query?: ej.Query, adaptor?: any); + setDefaultQuery(query: ej.Query): void; + executeQuery(query?: ej.Query, done?: any, fail?: any, always?: any): JQueryPromise; + executeLocal(query?: ej.Query): ej.DataManager; + saveChanges(changes?: Changes, key?: string, tableName?: string): JQueryDeferred; + insert(data: Object, tableName: string): JQueryPromise; + remove(keyField: string, value: any, tableName: string): Object; + update(keyField: string, value: any, tableName: string): Object; + } + + class Query { + constructor(); + static fn: Query; + static extend(prototype: Object): Query; + key(field: string): ej.Query; + using(dataManager: ej.DataManager): ej.Query; + execute(dataManager: ej.DataManager, done: any, fail?: string, always?: string): any; + executeLocal(dataManager: ej.DataManager): ej.DataManager; + clone(): ej.Query; + from(tableName: any): ej.Query; + addParams(key: string, value: string): ej.Query; + expand(tables: any): ej.Query; + where(fieldName: string, operator: ej.FilterOperators, value: string, ignoreCase?: boolean): ej.Query; + where(predicate:ej.Predicate):ej.Query; + search(searchKey: any, fieldNames?: any, operator?: string, ignoreCase?: boolean): ej.Query; + sortBy(fieldName: string, comparer?: ej.SortOrder, isFromGroup?: boolean): ej.Query; + sortByDesc(fieldName: string): ej.Query; + group(fieldName: string): ej.Query; + page(pageIndex: number, pageSize: number): ej.Query; + take(nos: number): ej.Query; + skip(nos: number): ej.Query; + select(fieldNames: any): ej.Query; + hierarchy(query: ej.Query, selectorFn: any): ej.Query; + foreignKey(key: string): ej.Query; + requiresCount(): ej.Query; + range(start:number, end:number): ej.Query; + } + + class Adaptor { + constructor(ds: any); + pvt: Object; + type: ej.Adaptor; + options: AdaptorOptions; + extend(overrides: any): ej.Adaptor; + processQuery(dm: ej.DataManager, query: ej.Query):any; + processResponse(data: Object, ds: any, query: ej.Query, xhr: JQueryXHR, request?: Object, changes?: Changes): Object; + convertToQueryString(req: any, query: ej.Query, dm: ej.DataManager): JQueryParam; + } + + interface AdaptorOptions { + from?: string; + requestType?: string; + sortBy?: string; + select?: string; + skip?: string; + group?: string; + take?: string; + search?: string; + count?: string; + where?: string; + aggregates?: string; + } + + class UrlAdaptor extends ej.Adaptor { + constructor(); + processQuery(dm: ej.DataManager, query: ej.Query, hierarchyFilters?: Object): { + type: string; url: string; ejPvtData: Object; contentType?: string; data?: Object; + } + convertToQueryString(req: Object, query: ej.Query, dm: ej.DataManager): JQueryParam; + processResponse(data: Object, ds: any, query: ej.Query, xhr: JQueryXHR, request?: Object, changes?: Changes): Object; + onGroup(e: any): void; + batchRequest(dm: ej.DataManager, changes: Changes, e: any): void; + beforeSend(dm: ej.DataManager, request: any, settings?:any): void; + insert(dm: ej.DataManager, data: Object, tableName: string): { url: string; data: any }; + remove(dm: ej.DataManager, keyField: string, value: any, tableName: string): { type: string; url: string; data?: any }; + update(dm: ej.DataManager, keyField: string, value: any, tableName: string): { type: string; url: string; data: any }; + getFiltersFrom(data: Object, query: ej.Query): ej.Predicate; + } + + class ODataAdaptor extends ej.UrlAdaptor { + constructor(); + options: UrlAdaptorOptions; + onEachWhere(filter: any, requiresCast: boolean): any; + onPredicate(pred: ej.Predicate, query: ej.Query, requiresCast: boolean): string; + onComplexPredicate(pred: ej.Predicate, requiresCast: boolean): string; + onWhere(filters: Array): string; + onEachSearch(e: Object): void; + onSearch(e: Object): string; + onEachSort(e: Object): string; + onSortBy(e: Object): string; + onGroup(e: Object): string; + onSelect(e: Object): string; + onCount(e: Object): string; + beforeSend(dm: ej.DataManager, request: any, settings?: any): void; + processResponse(data: Object, ds: Object, query: ej.Query, xhr:any, request: any, changes: Changes): { + result: Object; count: number + }; + convertToQueryString(req: Object, query: ej.Query, dm: ej.DataManager): JQueryParam; + insert(dm: ej.DataManager, data: Object, tableName: string): { url: string; data: Object; } + remove(dm: ej.DataManager, keyField: string, value: any, tableName: string): { url: string; type: string; } + update(dm: ej.DataManager, keyField: string, value: any, tableName: string): { url: string; type: string; data: Object; accept: string; } + batchRequest(dm: ej.DataManager, changes: Changes, e: any): { url: string; type: string; data: Object; contentType: string; } + generateDeleteRequest(arr: Array, e: any): string; + generateInsertRequest(arr: Array, e: any): string; + generateUpdateRequest(arr: Array, e: any): string; + } + interface UrlAdaptorOptions { + requestType?: string; + accept?: string; + multipartAccept?: string; + sortBy?: string; + select?: string; + skip?: string; + take?: string; + count?: string; + where?: string; + expand?: string; + batch?: string; + changeSet?: string; + batchPre?: string; + contentId?: string; + batchContent?: string; + changeSetContent?: string; + batchChangeSetContentType?: string; + } + + class ODataV4Adaptor extends ej.ODataAdaptor { + constructor(); + options: ODataAdaptorOptions; + onCount(e: Object): string; + onEachSearch(e: Object): void; + onSearch(e: Object): string; + beforeSend(dm: ej.DataManager, request: any, settings?: any): void; + processResponse(data: Object, ds: Object, query: ej.Query, xhr:any, request: any, changes: Changes): { + result: Object; count: number + }; + + } + interface ODataAdaptorOptions { + requestType?: string; + accept?: string; + multipartAccept?: string; + sortBy?: string; + select?: string; + skip?: string; + take?: string; + count?: string; + search?: string; + where?: string; + expand?: string; + batch?: string; + changeSet?: string; + batchPre?: string; + contentId?: string; + batchContent?: string; + changeSetContent?: string; + batchChangeSetContentType?: string; + } + + class JsonAdaptor extends ej.Adaptor { + constructor(); + processQuery(ds: Object, query: ej.Query): string; + batchRequest(dm: ej.DataManager, changes: Changes, e:any): Changes; + onWhere(ds: Object, e: any): any; + onSearch(ds: Object, e: any): any + onSortBy(ds: Object, e: any, query: ej.Query): Object; + onGroup(ds: Object, e: any, query: ej.Query): Object; + onPage(ds: Object, e: any, query: ej.Query): Object; + onRange(ds: Object, e: any): Object; + onTake(ds: Object, e: any): Object; + onSkip(ds: Object, e: any): Object; + onSelect(ds: Object, e: any): Object; + insert(dm: ej.DataManager, data: any): Object; + remove(dm: ej.DataManager, keyField: string, value:any, tableName: string): Object; + update(dm: ej.DataManager, keyField: string, value:any, tableName: string): Object; + } + class TableModel { + constructor(name: string, jsonArray: Array, dataManager: ej.DataManager, modelComputed: any); + on(eventName: string, handler: any): void; + off(eventName: string, handler: any): void; + setDataManager(dataManager: DataManager): void; + saveChanges(): void; + rejectChanges(): void; + insert(json: any): void; + update(value: any): void; + remove(key: string): void; + isDirty(): boolean; + getChanges(): Changes; + toArray(): Array; + setDirty(dirty:any, model:any): void; + get(index: number): void; + length(): number; + bindTo(element: any): void; + } + class Model { + constructor(json: any, table: string, name: string); + formElements: Array; + computes(value: any): void; + on(eventName: string, handler: any): void; + off(eventName: string, handler: any): void; + set(field: string, value: any): void; + get(field: string): any; + revert(suspendEvent: any): void; + save(dm: ej.DataManager, key: string): void; + markCommit(): void; + markDelete(): void; + changeState(state: boolean, args: any): void; + properties(): any; + bindTo(element: any): void; + unbind(element: any): void; + } + interface Changes { + changed?: Array; + added?: Array; + deleted?: Array; + } + class Predicate { + constructor(field: string, operator: ej.FilterOperators, value: any, ignoreCase: boolean); + and(field: string, operator: any, value:any, ignoreCase:boolean): void; + or(field: string, operator: any, value: any, ignoreCase: boolean): void; + validate(record: Object): boolean; + toJSON(): { + isComplex: boolean; + field: string; + operator: string; + value: any; + ignoreCase: boolean; + condition: string; + predicates: any; + }; + } + interface dataUtil { + swap(array: Array, x: number, y: number): void; + mergeSort(jsonArray: Array, fieldName: string, comparer:any): Array; + max(jsonArray: Array, fieldName: string, comparer: string): Array; + min(jsonArray: Array, fieldName: string, comparer: string): Array; + distinct(jsonArray: Array, fieldName: string, requiresCompleteRecord:any): Array; + sum(json:any, fieldName: string): number; + avg(json:any, fieldName: string): number; + select(jsonArray: Array, fieldName: string, fields:string): Array; + group(jsonArray: Array, field: string, /* internal */ level: number): Array; + parseTable(table: string, headerOption: ej.headerOption, headerRowIndex: number): Object; + } + interface AjaxSettings { + type?: string; + cache: boolean; + data?: any; + dataType?: string; + contentType?: any; + async?: boolean; + } + enum FilterOperators { + contains, + endsWith, + equal, + greaterThan, + greaterThanOrEqual, + lessThan, + lessThanOrEqual, + notEqual, + startsWith + } + + enum MatrixDefaults { + m11, + m12, + m21, + m22, + offsetX, + offsetY, + type + } + enum MatrixTypes { + Identity, + Scaling, + Translation, + Unknown + } + + enum Orientation { + Horizontal, + Vertical + } + + enum SliderType { + Default, + MinRange, + Range + } + + enum eventType { + click, + mouseDown, + mouseLeave, + mouseMove, + mouseUp + } + enum headerOption { + row, + tHead + } + + enum filterType{ + StartsWith, + Contains, + EndsWith, + LessThan, + GreaterThan, + LessThanOrEqual , + GreaterThanOrEqual, + Equal, + NotEqual + } + enum Animation{ + Fade, + None, + Slide + } + enum Type{ + Overlay, + Slide + } + enum SortOrder + { + Ascending, + Descending + } + + var globalize:globalize; + var cultures:culture; + function addCulture(name: string, culture ?: any): void; + function preferredCulture(culture ?: string): culture; + function format(value: any, format: string, culture ?: string): string; + function parseInt(value: string, radix?: any, culture ?: string): number; + function parseFloat(value: string, radix?: any, culture ?: string): number; + function parseDate(value: string, format: string, culture ?: string): Date; + function getLocalizedConstants(controlName: string, culture ?: string): any; + +interface globalize { + addCulture(name: string, culture?: any): void; + preferredCulture(culture?: string): culture; + format(value: any, format: string, culture?: string): string; + parseInt(value: string, radix?: any, culture?: string): number; + parseFloat(value: string, radix?: any, culture?: string): number; + parseDate(value: string, format: string, culture?: string): Date; + getLocalizedConstants(controlName: string, culture?: string): any; + } + interface culture { + name?: string; + englishName?: string; + namtiveName?: string; + language?: string; + isRTL: boolean; + numberFormat?: formatSettings; + calendars?: calendarsSettings; + } + interface formatSettings { + pattern: Array; + decimals: number; + groupSizes: Array; + percent: percentSettings; + currency: currencySettings; + } + interface percentSettings { + pattern: Array; + decimals: number; + groupSizes: Array; + symbol: string; + } + interface currencySettings { + pattern: Array; + decimals: number; + groupSizes: Array; + symbol: string; + } + interface calendarsSettings { + standard: standardSettings; + } + interface standardSettings { + firstDay: number; + days: daySettings; + months: monthSettings; + AM: Array; + PM: Array; + twoDigitYearMax: number; + patterns: patternSettings; + } + interface daySettings { + names: Array; + namesAbbr: Array; + namesShort: Array; + } + interface monthSettings { + names: Array; + namesAbbr: Array; + } + interface patternSettings { + d: string; + D: string; + t: string; + T: string; + f: string; + F: string; + M: string; + Y: string; + S: string; + } +} +declare module App { + +var addMetaTags: boolean; + var allowPopState: boolean; + var allowPushState: boolean; + var activePage: JQuery; + var waitingPopUp: JQuery; + var hashMonitoring: boolean; + var pageTransition: string; + var renderEJMControlByDef: boolean; + function createPage(element: JQuery): void; + function getLoaction(): string; + function initPage(): void; + function loadView(url: string): void; + function transferPage(fromPage: Object, toPage: Object, options?: any, isFromAjax?: boolean): void; + function userAgent(): void; + + var pageHistory: { + activeHistory(): string; + add(url: string, options?: PageOption): void; + clearForward(): void; + find(url: string): number; + lastHistory(): string; + nextHistory(): string; + prevHistory(): string; + makeUrlAbsolute(hashString: string): void; + } + //Pageoption type for appview page + interface PageOption { + title?: string; + href?: string; + hash?: string; + } + var route: { + convertToRelativeUrl(): void; + hasProtocol(url: string): boolean; + setPageRenderMode(element: JQuery): void; + splitUrl(url: string): any; + } +} +declare module ej.mobile { + + //Global Interface + interface windowsOption { + renderDefault?: boolean; + } + enum RenderMode{ + Auto, + IOS7, + Android, + Windows, + Flat + } + enum Theme{ + Auto, + Dark, + Light + } +class Accordion extends ej.Widget { + static fn: Accordion; + constructor(element: JQuery, options?: AccordionOptions); + model: AccordionOptions; + validTags: Array; + defaults: AccordionOptions; + collapseAll(): void; + disableItems(itemIndexes: Array): void; + enableItems(itemIndexes: Array): void; + selectItems(activeList: Array): void; + deselectItems(activeList: Array): void; + expandAll(): void; + hide(): void; + show(): void; + destroy(): void; + getItemsCount(): number; +} +//ejmAccordion Option +interface AccordionOptions { + theme?: ej.mobile.Theme; + renderMode?: ej.mobile.RenderMode; + cssClass?: string; + enableCache?: boolean; + allowMultipleOpen?: boolean; + collapsible?: boolean; + enabled?: boolean; + enableMultipleOpen?: boolean; + heightAdjustMode?: ej.mobile.Accordion.HeightAdjustMode; + windows?: windowsOption; + enablePersistence?: boolean; + selectedItems?: Array; + disabledItems?: Array; + showHeaderIcon?: boolean; + spinnerText?: string; + items?: Array; + active? (e: AccordionActiveEventArgs): void; + ajaxBeforeLoad? (e: AccordionAjaxBeforeLoadEventArgs): void; + ajaxError? (e: AccordionAjaxErrorEventArgs): void; + ajaxLoad? (e: AccordionAjaxLoadEventArgs): void; + ajaxSuccess? (e: AccordionAjaxSuccessEventArgs): void; + beforeActive? (e: AccordionBeforeActiveEventArgs): void; + destroy? (e: AccordionEventArgs): void; + create? (e: AccordionEventArgs): void; +} + +interface itemCollection { + ajaxUrl?: string; + logoClass?: string; +} +//ejmejmAccordionEvent Arugument +interface AccordionEventArgs { + cancel: boolean; + type: string; + model: AccordionOptions; +} +interface AccordionActiveEventArgs extends AccordionEventArgs { + items: string; + lastSelectedItemIndices: number; + selectedItemIndices: number; +} +interface AccordionAjaxBeforeLoadEventArgs extends AccordionEventArgs { + url: string; +} +interface AccordionAjaxErrorEventArgs extends AccordionEventArgs { + title: string; + data: Object; + url: string; +} +interface AccordionAjaxLoadEventArgs extends AccordionEventArgs { +} +interface AccordionAjaxSuccessEventArgs extends AccordionEventArgs { + content: Object; + data: Object; + url: string; +} +interface AccordionBeforeActiveEventArgs extends AccordionEventArgs { + activeItemIndex?: number; +} +export module Accordion { + enum HeightAdjustMode { + Content, + Auto, + Fill + } +} +class Autocomplete extends ej.Widget { + static fn: Autocomplete; + element: JQuery; + constructor(element: JQuery, options?: AutocompleteOptions); + model: AutocompleteOptions; + defaults: AutocompleteOptions; + disable(): void; + enable(): void; + destroy(): void; + clearText(): void; + getSelectedItems(): Array; + getValue(): string; + +} +interface AutocompleteOptions { + allowScrolling?: boolean; + filterType?: ej.mobile.Autocomplete.FilterType; + caseSensitiveSearch?: boolean; + cssClass?: string; + enableAutoFill?: boolean; + delimiterChar?: string; + enableMultiSelect?: boolean; + enableCheckbox?: boolean; + dataSource?: any; + filterMode?: string; + itemsCount?: string|number; + templateId?: string; + fields?: fieldOptions; + imageField?: string; + renderMode?: ej.mobile.RenderMode; + theme?: ej.mobile.Theme; + mapper?: string; + watermarkText?: string; + imageClass?: string; + allowSorting?: boolean; + value?: string; + sortOrder?: ej.mobile.Autocomplete.SortOrder; + emptyResultText?: string; + showEmptyResultText?: boolean; + minCharacter?: number; + enableDistinct?: boolean; + enablePersistence?: boolean; + enabled?: boolean; + mode?: ej.mobile.Autocomplete.Mode; + selectedKeys?: string; + windows?: windowsOption; + touchEnd? (e: AutocompleteTouchEndEventArgs): void; + keyPress? (e: AutocompleteKeyPressEventArgs): void; + select? (e: AutocompleteSelectEventArgs): void; + change? (e: AutocompleteChangeEventArgs): void; + focusIn? (e: AutocompleteFocusInEventArgs): void; + focusOut? (e: AutocompleteFocusOutEventArgs): void; + destroy? (e: AutocompleteEventArgs): void; + create? (e: AutocompleteEventArgs): void; +} +interface fieldOptions { + text?: string; + key?: string; +} +interface AutocompleteEventArgs { + cancel: boolean; + model: AutocompleteOptions; + type: string; +} +interface AutocompleteTouchEndEventArgs extends AutocompleteEventArgs { + text: string; + isChecked: boolean; + checkedItemsText: Object; + value: string; +} +interface AutocompleteKeyPressEventArgs extends AutocompleteEventArgs { + value: string; +} +interface AutocompleteSelectEventArgs extends AutocompleteEventArgs { + text: string; + isChecked: boolean; + checkedItemsText: Object; + value: string; +} +interface AutocompleteChangeEventArgs extends AutocompleteEventArgs { + text: string; + isChecked: boolean; + checkedItemsText: Object; + value: string; +} +interface AutocompleteFocusInEventArgs extends AutocompleteEventArgs { + value: string; +} +interface AutocompleteFocusOutEventArgs extends AutocompleteEventArgs { + value: string; +} +export module Autocomplete { + enum FilterType { + StartsWith, + Contains + } + enum Mode { + Search, + Default + } + enum SortOrder { + Ascending, + Descending + } +} +class Button extends ej.Widget { + static fn: Button; + element: JQuery; + constructor(element: JQuery, options?: ButtonOptions); + model: ButtonOptions; + validTags: Array; + defaults: ButtonOptions; + disable(): void; + enable(): void; +} +class Actionlink extends ej.Widget { + static fn: Actionlink; + element: JQuery; + constructor(element: Element, options?: ButtonOptions); + model: Object; + validTags: Array; + defaults: ButtonOptions; + disable(): void; + enable(): void; +} +interface ButtonOptions { + touchStart?(e: ButtonEventArgs): void; + touchEnd?(e: ButtonEventArgs): void; + cssClass?: string; + enabled?: (boolean | string); + inline?: (boolean | string); + renderMode?: (ej.mobile.RenderMode | string); + text?: string; + theme?: (ej.mobile.Theme | string); + imageClass?: string; + imagePosition?: (ej.mobile.Button.ImagePosition | string); + contentType?: (ej.mobile.Button.ContentType | string); + ios7?: ios7ButtonOptions; + android?: androidButtonOption; + windows?: windowsButtonOptions; + flat?: flatButtonOption; +} +interface ButtonEventArgs { + element: Object; + text: string; +} +interface ios7ButtonOptions { + style?: (ej.mobile.Button.IOS7.Style | string); + color?: (ej.mobile.Button.IOS7.Color | string); +} +interface androidButtonOption { + style?: (ej.mobile.Button.Android.Style | string); +} +interface windowsButtonOptions extends windowsOption { + style?: (ej.mobile.Button.Windows.Style | string); +} +interface flatButtonOption { + style?: (ej.mobile.Button.Flat.Style | string); +} +export module Button{ +export module IOS7{ + enum Style{ + Normal, + Back, + Header, + Dialog + } + enum Color{ + Gray, + Black, + Blue, + Green, + Red + } + } +export module Android{ + enum Style{ + Normal, + Small, + Dialog + } + +} +export module Windows{ + enum Style{ + Normal, + Back + } +} +export module Flat{ + enum Style{ + Normal, + Back, + Header + } +} + enum ImagePosition{ + Left, + Right + } + enum ContentType{ + Text, + Image, + Both + } +} +class DatePicker extends ej.Widget { + static fn: DatePicker; + static Locale:any; + element: JQuery; + constructor(element: JQuery, options?: DatePickerOptions); + model: DatePickerOptions; + defaults: DatePickerOptions; + disable(): void; + enable(): void; + hide(): void; + show(): void; + setCurrentDate(date:string): void; + getValue(): string; + destroy(): void; +} + +//ejmDatePicker Options +interface DatePickerOptions { + cssClass?: string; + renderMode?: ej.mobile.RenderMode; + theme?: ej.mobile.Theme; + culture?: string; + dateFormat?: string; + value?: string; + enabled?: boolean; + enablePersistence?: boolean; + ios7?: ios7Option; + windows?: windowsOption; + maxDate?: string; + minDate?: string; + load? (e: DatePickerEventArgs): void; + select? (e: DatePickerEventArgs): void; + focusIn? (e: DatePickerEventArgs): void; + focusOut? (e: DatePickerEventArgs): void; + open? (e: DatePickerEventArgs): void; + close? (e: DatePickerEventArgs): void; + change? (e: DatePickerEventArgs): void; + destroy? (e: DatePickerArgs): void; + create? (e: DatePickerArgs): void; +} + +interface DatePickerArgs { + type: string; + model: DatePickerOptions; + value: string; +} +//ejmDatePickerEvent Arugument +interface DatePickerEventArgs extends DatePickerArgs { + cancel: boolean; + +} + +interface ios7Option { + renderDefault: boolean; +} + + +//Class ejmDropDownList +class DropDownList extends ej.Widget { + static fn: DropDownList; + constructor(element: JQuery, options?: DropDownListOptions); + model: DropDownListOptions; + defaults: DropDownListOptions; + show(): void; + hide(): void; + getValue():string; + selectItemByIndex(index:(number|string)): void; + unselectItemByIndex(index:(number|string)): void; + selectItemByIndices(indices:Array): void; + unselectItemByIndices(indices: Array): void; + destroy(): void; + getSelectedItemsValue(): Array; + getSelectedItemValue(): string; +} + +//ejmDropDownList WindowsOption +interface windowsDropDownListOption extends windowsOption { + type?: ej.mobile.DropDownList.WindowsType; +} + +interface androidDropDownListOption { + popUpHeight?: number|string; +} + +interface fieldsDropDownListOption { + text?: string; + groupBy?: string; + imageClass?: string; + imageUrl?: string; + checkBy?: string; + enableTemplate?: string; + templateID?: string; + value?: string; +} + +//ejmDropDownList Option +interface DropDownListOptions { + theme?: ej.mobile.Theme; + renderMode?: ej.mobile.RenderMode; + cssClass?: string; + readOnly?: boolean; + targetID?: string; + selectedItemIndex?: number|string; + dataSource?: any; + fields?: fieldsDropDownListOption; + query?: string; + allowVirtualScrolling?: boolean; + virtualScrollMode?: ej.mobile.DropDownList.VirtualScrollingMode; + itemRequestCount?: number|string; + enabled?: boolean; + enableMultiSelect?: boolean; + delimiterChar?: string; + enableGrouping?: boolean; + mode?: ej.mobile.DropDownList.Mode; + enableTemplate?: boolean; + enablePersistence?: boolean; + windows?: windowsDropDownListOption; + android?: androidDropDownListOption; + items?: Array; + focusIn? (e: DropDownArgs): void; + focusOut? (e: DropDownArgs): void; + select? (e: DropDownSelectArgs): void; + change? (e: DropDownSelectArgs): void; + checkChange? (e: DropDownListEventArgs): void; +} + +interface DropDownArgs { + cancel: boolean; + type: string; + model: DropDownListOptions; +} +//ejmDropDownListEvent Arugument +interface DropDownListEventArgs extends DropDownArgs { + checked: boolean; +} + +interface DropDownSelectArgs extends DropDownArgs { + selectedText: string; + value: string; + selectedItem: Object; +} + +export module DropDownList{ + enum VirtualScrollingMode{ + Continuous, + Normal + } + enum WindowsType{ + ComboBox, + List + } + enum Mode { + Normal, + Native + } +} + +class Numeric extends ej.Widget { + static fn: Numeric; + element: JQuery; + constructor(element: JQuery, options?: EditorOptions); + model: EditorOptions; + ValidTags: Array; + defaults: EditorOptions; + disable(): void; + enable(): void; + getValue(): any; + setValue(value:number): void; + +} + +interface EditorOptions { + cssClass?: string; + enableStrictMode?: boolean; + enabled?: boolean; + showBorder?: boolean; + showSpinButton?: boolean; + incrementStep?: number; + maxValue?: number; + minValue?: number; + name?: string; + enablePersistence?: boolean; + readOnly?: boolean; + renderMode?: ej.mobile.RenderMode; + decimalPlaces?: number; + theme?: ej.mobile.Theme; + value?: number; + watermarkText?: string; + windows?: windowsOption; + change? (e: EditorEventArgs): void; + focusIn? (e: EditorEventArgs): void; + focusOut? (e: EditorEventArgs): void; + destroy?(e:EditorBaseArgs):void; + create?(e:EditorBaseArgs):void; +} + +interface EditorBaseArgs{ + cancel: boolean; + type: string; + model: EditorOptions; +} + +interface EditorEventArgs extends EditorBaseArgs { + value: number; + element: Object; +} + + +class Grid extends ej.Widget { + static fn: Grid; + element: JQuery; + constructor(element: JQuery, options?: GridOptions); + model: GridOptions; + validTags: Array; + defaults: GridOptions; + disable(): void; + enable(): void; + destroy(): void; + getColumnByField(field:string): void; + getColumnByHeaderText(headerText:string): void; + getColumnByIndex(index:number): void; + getColumnFieldNames(): void; + getColumnIndexByField(field:string): void; + getColumnMemberByIndex(colIdx:number): void; + hideColumns(col:string): void; + refreshContent(requestType:string): void; + showColumns(col:string): void; +} +interface GridOptions { + cssClass?: string; + allowPaging?: boolean; + allowSorting?: boolean; + allowFiltering?: boolean; + allowScrolling?: boolean; + allowSelection?: boolean; + dataSource: any; + caption?: string; + enablePersistence?: boolean; + selectedRowIndex?: number; + showCaption?: boolean; + allowColumnSelector?: boolean; + transition?: string; + columns?: Array; + theme?: ej.mobile.Theme; + renderMode?: ej.mobile.RenderMode; + rowSelecting? (e: GridEventArgs): void; + rowSelected? (e: GridEventArgs): void; + actionBegin? (e: GridEventArgs): void; + actionComplete? (e: GridEventArgs): void; + actionSuccess? (e: GridEventArgs): void; + actionFailure? (e: GridEventArgs): void; + queryCellInfo? (e: GridEventArgs): void; + rowDataBound? (e: GridEventArgs): void; + modelChange? (e: GridEventArgs): void; + load? (e: GridEventArgs): void; + pageSettings?: PageSettings; + scrollSettings?: ScrollSettings; + sortSettings?: SortSettings; + filterSettings?: FilterSettings; +} + +interface PageSettings { + pageSize?: number; + currentPage?: number; + display?: ej.mobile.Grid.PagerDisplay; + type?: ej.mobile.Grid.PagerType; + totalRecordsCount?: number; +} +interface ScrollSettings { + enableColumnScrolling?: boolean; + height?: any; + width?: any; + enableRowScrolling?: boolean; + enableNativeScrolling?: boolean; +} +interface SortSettings { + allowMultiSorting?: boolean; + sortedColumns?: Array; +} +interface FilterSettings { + isCaseSensitive?: boolean; + filterBarMode?: ej.mobile.Grid.FilterBarMode; + interval?: number; + filteredColumns?: Array; +} + +//ejmGridEvent Arugument +interface GridEventArgs { + cancel: boolean; + type: string; + model: GridOptions; +} + +export module Grid +{ +enum PagerDisplay +{ +Normal, +Fixed +} + +enum PagerType +{ +Normal, +Scrollable +} + +enum FilterBarMode +{ +Immediate, +OnEnter +} +enum Actions +{ +Paging, +Sorting, +Filtering, +Refresh +} +} +class Header extends ej.Widget { + static fn: Header; + element: JQuery; + constructor(element: JQuery, options?: HeaderOptions); + model: HeaderOptions; + defaults: HeaderOptions; + getTitle(): string; + destroy(): void; +} + +interface HeaderOptions { + hideForUnSupportedDevice?: boolean; + leftButtonNavigationUrl?: string; + leftButtonImageClass: string; + leftButtonImageUrl: string; + rightButtonNavigationUrl?: string; + rightButtonImageClass?:string; + rightButtonImageUrl?:string; + cssClass?: string; + title?: string; + showTitle?: boolean; + position?: ej.mobile.Header.Position; + leftButtonCaption?: string; + rightButtonCaption?: string; + leftButtonStyle?:ej.mobile.Header.HeaderLeftButtonStyle; + rightButtonStyle?:ej.mobile.Header.HeaderRightButtonStyle; + renderMode?: ej.mobile.RenderMode; + theme?: ej.mobile.Theme; + showLeftButton?: boolean; + showRightButton?: boolean; + enablePersistence?:boolean; + templateId?: string; + ios7?: Headerios7Options; + flat?: HeaderFlatOptions; + windows?: HeaderWindowsOptions; + android?: HeaderAndroidOptions; + leftButtonTap? (e: HeaderLeftButtonTapEventArgs): void; + rightButtonTap? (e: HeaderRightButtonTapEventArgs): void; + destroy?(e:HeaderBaseArgs):void; + create?(e:HeaderBaseArgs):void; +} +interface HeaderWindowsOptions extends windowsOption { + enableCustomText?: boolean; + renderDefault?: boolean; + rightButtonStyle?: ej.mobile.Header.Windows.HeaderRightButtonStyle; + leftButtonStyle?: ej.mobile.Header.Windows.HeaderLeftButtonStyle; + showLeftButton?: boolean; + showRightButton?: boolean; +} +interface HeaderAndroidOptions { + backButtonImageClass?: string; + rightButtonStyle?: ej.mobile.Header.Android.HeaderRightButtonStyle; + leftButtonStyle?: ej.mobile.Header.Android.HeaderLeftButtonStyle; + showLeftButton?: boolean; + showRightButton?: boolean; +} +interface Headerios7Options { + rightButtonStyle?: ej.mobile.Header.IOS7.HeaderRightButtonStyle; + leftButtonStyle?: ej.mobile.Header.IOS7.HeaderLeftButtonStyle; + showLeftButton?: boolean; + showRightButton?: boolean; +} +interface HeaderFlatOptions { + rightButtonStyle?: ej.mobile.Header.Flat.HeaderRightButtonStyle; + leftButtonStyle?: ej.mobile.Header.Flat.HeaderLeftButtonStyle; + showLeftButton?: boolean; + showRightButton?: boolean; +} + +interface HeaderBaseArgs{ + cancel: boolean; + type: string; + model: FooterOptions; +} +interface HeaderLeftButtonTapEventArgs { + text: string; + cancel: boolean; + model: Object; + type: string; + status: boolean; +} +interface HeaderRightButtonTapEventArgs { + text: string; + cancel: boolean; + model: Object; + type: string; + status: boolean; +} + +export module Header +{ +enum Position +{ + Normal, + Fixed +} +enum HeaderLeftButtonStyle +{ + Back, + Header, + Normal + +} +enum HeaderRightButtonStyle +{ + Header, + Normal +} + +export module IOS7 +{ +enum HeaderLeftButtonStyle +{ + Auto, + Back, + Header, + Normal +} +enum HeaderRightButtonStyle +{ + Auto, + Header, + Normal +} +} + +export module Flat +{ +enum HeaderLeftButtonStyle +{ + Auto, + Back, + Normal, + Header +} +enum HeaderRightButtonStyle +{ + Auto, + Header, + Normal +} +} + +export module Android +{ +enum HeaderLeftButtonStyle +{ + Auto, + Back, + Normal, + Header +} +enum HeaderRightButtonStyle +{ + Auto, + Normal, + Header +} +} + +export module Windows +{ +enum HeaderLeftButtonStyle +{ + Auto, + Back, + Normal, + Header +} +enum HeaderRightButtonStyle +{ + Auto, + Normal, + Header +} +} +} + + + +/* ListView - Start*/ +interface ajaxSettingsOptions { + type?: string; + cache?: boolean; + async?: boolean; + dataType?: string; + contentType?: string; + url?: string; + data?: Array; +} +//Class ejmListView +class ListView extends ej.Widget { + static fn: ListView; + constructor(element: JQuery, options?: ListViewOptions); + model: ListViewOptions; + defaults: ListViewOptions; + addItem(list?:Object, index?:number,groupid?:any): void; + checkAllItem(): void; + checkItem(index:number,childId?:any): void; + deActive(index:number,childId?:any): void; + disableItem(index:number,childId?:any): void; + enableItem(index:number,childId?:any): void; + getActiveItem(): void; + getActiveItemText(): void; + getCheckedItems(): void; + getCheckedItemsText(): void; + getItemsCount(): void; + getItemText(index:number,childId?:any): void; + hasChild(index:number,childId?:any): boolean; + hide(): void; + hideItem(index:number,childId?:any): void; + isChecked(index:number,childId?:any): boolean; + loadAjaxContent(): void; + removeCheckMark(index:number,childId?:any): void; + removeItem(index:number,childId?:any): void; + selectItem(index:number,childId?:any): void; + setActive(index:number,childId?:any): void; + show(): void; + showItem(index:number,childId?:any): void; + unCheckAllItem(): void; + unCheckItem(index: number, childId?: any): void; + clear(): void; + append(data: Object): void; + getActiveItemData(): void; + getSelectedItemValue(): void; + getSelectedItemsValue(): void; + destroy(): void; +} +//ejmListView IOS7Option +interface Ios7Option { + inline?: boolean; +} +//ejmListView IOS7Option +interface windowsListViewOption extends windowsOption { + preventSkew?: boolean; + enableHeaderCustomText?: boolean; +} + +//ejmListView Option +interface ListViewOptions { + theme?: ej.mobile.Theme; + renderMode?: ej.mobile.RenderMode; + enablePullToRefresh?: boolean; + refreshThreshold?: number; + pullToRefreshSettings?: pullToRefreshSettings; + mode?: ej.mobile.ListView.Mode + cssClass?: string; + ios7?: Ios7Option; + windows?: windowsListViewOption; + adjustFixedPosition?: boolean; + ajaxSettings?: ajaxSettingsOptions; + enableCache?: boolean; + allowScrolling?: boolean; + checkDOMChanges?: boolean; + dataBinding?: boolean; + dataSource?: any; + enableAjax?: boolean; + enableCheckMark?: boolean; + enableFiltering?: boolean; + showHeader?: boolean; + showHeaderBackButton?: boolean; + enableNativeScrolling?: boolean; + showScrollbars?: boolean; + fieldSettings?: fieldSettings; + enableGroupList?: boolean; + headerBackButtonText?: string; + hideHeaderForUnSupportedDevice?: boolean; + headerTitle?: string; + height?: number; + persistSelection?: boolean; + preventSelection?: boolean; + query?: string; + renderTemplate?: boolean; + selectedItemIndex?: number; + autoAdjustHeight?: boolean; + autoAdjustScrollHeight?: boolean; + templateId?: string; + transition?: string; + width?: number; + items?: Array; + enablePersistence?: boolean; + create? (e: ListViewBaseEventArgs): void; + destroy? (e: ListViewBaseEventArgs): void; + ajaxComplete? (e: ListViewEventArgs): void; + ajaxError? (e: ListViewEventArgs): void; + ajaxSuccess? (e: ListViewEventArgs): void; + headerBackButtonTap? (e: ListViewEventArgs): void; + load? (e: ListViewBaseEventArgs): void; + loadComplete? (e: ListViewBaseEventArgs): void; + touchEnd? (e: ListViewEventArgs): void; + touchStart? (e: ListViewEventArgs): void; + refreshBegin? (e: ListViewBaseEventArgs): void; + refreshSuccess? (e: ListViewEventArgs): void; + refreshError? (e: ListViewBaseEventArgs): void; + refreshComplete? (e: ListViewBaseEventArgs): void; + ajaxBeforeLoad? (e: ListViewEventArgs): void; +} +interface pullToRefreshSettings{ + pullText?:string; + releaseText?:string; + refreshText?:string; + errorText?:string; + appendData?:boolean; + appendPosition?:ej.mobile.ListView.AppendPosition; +} +interface fieldSettings{ + navigateUrl?:string; + href?:string; + enableAjax?:string; + preventSelection?:string; + persistSelection?:string; + text?:string; + enableCheckMark?:string; + checked?:string; + primaryKey?:string; + parentPrimaryKey?:string; + imageClass?:string; + imageUrl?:string; + childHeaderTitle?:string; + childId?:string; + childHeaderBackButtonText?:string; + renderTemplate?:string; + templateId?:string; + touchStart?:string; + touchEnd?:string; + attributes?:string; + groupID?:string; + id?:string; + value?: string; +} +//ejmListViewEvent Arugument +interface ListViewBaseEventArgs { + cancel: boolean; + type: string; + model: ListViewOptions; +} +interface ListViewEventArgs extends ListViewBaseEventArgs { + ajaxData?: Object; + data?: Object; + errorData?: Object; + successData?: Object; + text?: string; + element?: Object; + id?: string; + hasChild?: boolean; + currentItem?: string; + currentText?: string; + currentItemIndex?: number; + isChecked?: boolean; + checkedItems?: number; + checkedItemsText?: string; +} +export module ListView{ + enum AppendPosition{ + Bottom, + Top + } + enum Mode { + Page, + Container + } +} + +class Menu extends ej.Widget { + static fn: Menu; + element: JQuery; + constructor(element: JQuery, options?: MenuOptions); + model: MenuOptions; + defaults: MenuOptions; + addItem(menu: any, index: number): void; + disable(): void; + disableItem(index: number): void; + disableOverFlow(): void; + disableOverFlowItem(index: number): void; + enable(): void; + enableItem(index: number): void; + enableOverFlow(): void; + enableOverFlowItem(index: number): void; + hide(): void; + removeItem(index: number): void; + show(e: any, existing?: boolean): void; + destroy(): void; +} +//ejmMenu Option +interface MenuOptions { + theme?: ej.mobile.Theme; + renderMode?: ej.mobile.RenderMode; + cssClass?: string; + allowScrolling?: boolean; + showScrollbars?: boolean; + height?: (number|string); + renderTemplate?: boolean; + showOn?: ej.mobile.Menu.ShowOn; + targetId?: string; + target?: any; + enablePersistence?: boolean; + templateId?: string; + width?: (number|string); + items?: Array; + android?: AndroidOptions; + ios7?: Ios7Options; + windows?: WindowsOptions; + hide? (e: MenuEvent): void; + load? (e: MenuEvent): void; + loadComplete? (e: MenuEvent): void; + show? (e: MenuEvent): void; + touchStart? (e: MenuTouchEventArgs): void; + touchEnd? (e: MenuTouchEventArgs): void; + create? (e: MenuEvent): void; + destroy? (e: MenuEvent): void; +} +//ejmMenu IOS7 Option +interface Ios7Options { + cancelButtonColor?: ej.mobile.Menu.IOS7.CancelButtonColor; + cancelButtonText?: string; + cancelButtonTouchEnd? (e: MenuCancelButtonTouchEndEventArgs): void; + type?: ej.mobile.Menu.IOS7.Type; + title?: string; + showTitle?: boolean; + showCancelButton?: boolean; +} + +//ejmMenu Android Option +interface AndroidOptions { + type?: ej.mobile.Menu.Android.Type; +} +interface WindowsOptions { + type?: ej.mobile.Menu.Windows.Type; + renderDefault?: boolean; +} +//ejmMenu Event Arugument +interface MenuEvent { + cancel: boolean; + type: string; + model: MenuOptions; +} +interface MenuTouchEventArgs { + item: Object; + text: string; +} +interface MenuCancelButtonTouchEndEventArgs extends MenuEvent { + item: Object; + text: string; +} + +export module Menu { + export module IOS7 { + enum Type { + Auto, + Animate, + Normal + } + enum CancelButtonColor { + Blue, + Gray, + Black, + Green, + Red + } + } + + export module Android { + enum Type { + Contextual, + Popup, + OptionsList, + OptionsMenu + } + } + export module Windows { + enum Type { + Contextual, + Popup + } + } + enum ShowOn { + Tap, + TapHold + } +} + + + +//Class ejmProgress +class Progress extends ej.Widget { + static fn: Progress; + element: JQuery; + constructor(element: JQuery, options?: ProgressOptions); + model: ProgressOptions; + defaults: ProgressOptions; + getValue(): number; + getPercentage(): number; + setCustomText(text: string): void; + destroy(): void; +} + +//ejmProgressbar Option +interface ProgressOptions { + theme?: ej.mobile.Theme; + renderMode?: ej.mobile.RenderMode; + enableCustomText?: boolean; + enabled?: boolean; + height?: number; + incrementStep?: number; + maxValue?: number; + minValue?: number; + orientation?: ej.mobile.Progress.Orientation; + percentage?: number; + enablePersistence?: boolean; + text?: string; + value?: number; + width?: number; + create? (e: ProgressEvent): void; + destroy? (e: ProgressEvent): void; + start? (e: ProgressStartEventArgs): void; + change? (e: ProgressChangeEvent): void; + complete? (e: ProgressCompleteEvent): void; +} +//ejmProgressbarEvent Arugument +interface ProgressEvent { + cancel: boolean; + type: string; + model: ProgressOptions; +} +interface ProgressStartEventArgs extends ProgressEvent { + value: number; + percentage: number; +} +interface ProgressChangeEvent extends ProgressEvent { + value: number; + element: Object; + text: string; + percentage: number; +} +interface ProgressCompleteEvent extends ProgressEvent { + value: number; + text: string; + percentage: number; +} +export module Progress { + enum Orientation { + Horizontal, + Vertical + } +} + +//Class ejmRadioButton +class RadioButton extends ej.Widget { + static fn: RadioButton; + element: JQuery; + constructor(element: JQuery, options?: RadioButtonOptions); + model: RadioButtonOptions; + defaults: RadioButtonOptions; + destroy(): void; + enable(): void; + disable(): void; +} + +//ejmRadioButton Options +interface RadioButtonOptions { + renderMode?: ej.mobile.RenderMode; + theme?: ej.mobile.Theme; + cssClass?: string; + checked?: boolean; + text?: string; + enabled?: boolean; + enablePersistence?: boolean; + create? (e: RadioButtonBaseEventArgs): void; + destroy? (e: RadioButtonBaseEventArgs): void; + touchStart? (e: RadioButtonEventArgs): void; + touchEnd? (e: RadioButtonEventArgs): void; + change? (e: RadioButtonEventArgs): void; +} +//ejmRadioButtonEvent Arugument +interface RadioButtonBaseEventArgs { + model: RadioButtonOptions; + cancel: boolean; + type: string; +} +interface RadioButtonEventArgs extends RadioButtonBaseEventArgs { + value: string; + isChecked: boolean; +} + class Rating extends ej.Widget { + static fn: Rating; + element: JQuery; + constructor(element?: JQuery, options?: RatingOptions); + model: RatingOptions; + defaults: RatingOptions; + show(): void; + hide(): void; + getValue(): void + reset(): void; + enable(): void; + disable(): void; + setValue(value: number): void; + destroy(): void; + } + + interface RatingOptions { + maxValue?: number; + minValue?: number; + value?: number; + incrementStep?: number; + precision?: ej.mobile.Rating.Precision; + enabled?: boolean; + theme?: ej.mobile.Theme; + renderMode?: ej.mobile.RenderMode; + shape?: ej.mobile.Rating.Shape; + shapeWidth?: number; + shapeHeight?: number; + spaceBetweenShapes?: number; + orientation?: ej.mobile.Rating.Orientation; + readOnly?: boolean; + backgroundColor?: any; + selectionColor?: any; + borderColor?: any; + hoverColor?: any; + enablePersistence?: boolean; + create? (e: RatingBaseEventArgs): void; + destroy? (e: RatingBaseEventArgs): void; + tap? (e: RatingEventArgs): void; + change? (e: RatingEventArgs): void; + touchMove? (e: RatingEventArgs): void; + } + interface RatingBaseEventArgs { + cancel: boolean; + type: string; + model: RatingOptions; + } + interface RatingEventArgs extends RatingBaseEventArgs { + value: number; + } +export module Rating{ + enum Precision{ + Full, + Exact, + Half + } + enum Shape{ + Star, + Circle, + Diamond, + Heart, + Pentagon, + Square, + Triangle + } + enum Orientation{ + Horizontal, + Vertical + } + +} + class Rotator extends ej.Widget { + static fn: Rotator; + element: JQuery; + constructor(element: JQuery, options?: RotatorOptions); + model: RotatorOptions; + validTags: Array; + defaults: RotatorOptions; + renderDatasource(data: any): void; + destroy(): void; + } + interface RotatorOptions { + create? (e: RotatorBaseEventArgs): void; + destroy? (e: RotatorBaseEventArgs): void; + swipeLeft? (e: RotatorEventArgs): void; + swipeRight? (e: RotatorEventArgs): void; + swipeUp? (e: RotatorEventArgs): void; + swipeDown? (e: RotatorEventArgs): void; + change? (e: RotatorEventArgs): void; + pagerSelect? (e: RotatorEventArgs): void; + adjustFixedPosition?: boolean; + targetId?: string; + cssClass?:string; + windows?:windowsOption; + items?:Array; + renderMode?: ej.mobile.RenderMode; + targetHeight?: (number|string); + targetWidth?: (number|string); + enablePersistence?:boolean; + theme?: ej.mobile.Theme; + currentItemIndex?: number; + showPager?: boolean; + showHeader?: boolean; + headerTitle?: string; + dataBinding?: boolean; + dataSource?: any; + orientation?: ej.mobile.Rotator.Orientation; + pagerPosition?: PagerPosition; + } + interface PagerPosition { + horizontal?: ej.mobile.Rotator.PagerPositionHorizontal; + vertical?: ej.mobile.Rotator.PagerPositionVertical; + } + interface RotatorBaseEventArgs { + cancel: boolean; + model: RotatorOptions; + type: string; + } + interface RotatorEventArgs extends RotatorBaseEventArgs { + targetElement: Object; + element: number; + } +export module Rotator{ + enum Orientation{ + Horizontal, + Vertical + } + enum PagerPositionHorizontal{ + Bottom, + Top, + } + enum PagerPositionVertical{ + Right, + Left + } + +} + class Slider extends ej.Widget { + static fn: Slider; + element: JQuery; + constructor(element: JQuery, options?: SliderOptions); + model: SliderOptions; + defaults: SliderOptions; + getValue(): void; + dispose(): void; + destroy(): void; + } + //ejmSlider Option + interface SliderOptions { + theme?: ej.mobile.Theme; + renderMode?: ej.mobile.RenderMode; + minValue?: number; + maxValue?: number; + value?: number; + values?: Array; + orientation?: ej.mobile.Slider.Orientation; + enableRange?: boolean; + readOnly?: boolean; + incrementStep?: number; + enablePersistence?: boolean; + enabled?: boolean; + enableAnimation?: boolean; + animationSpeed?: number; + ios7?: Ios7Option; + windows?: windowsOption; + create? (e: SliderBaseEventArgs): void; + destroy? (e: SliderBaseEventArgs): void; + touchStart? (e: SliderEventArgs): void; + touchEnd? (e: SliderEventArgs): void; + load? (e: SliderEventArgs): void; + change? (e: SliderEventArgs): void; + slide? (e: SliderEventArgs): void; + } + + //ejmSlider IOS7 Option + interface Ios7Option { + thumbStyle?: ej.mobile.Slider.ThumbStyle; + } + //ejmSlider Slide Event Arugument + interface SliderBaseEventArgs { + cancel: boolean; + model: SliderOptions; + type: string; + } + interface SliderEventArgs extends SliderBaseEventArgs { + value?: number; + values?: Array; + } +export module Slider{ + enum Orientation{ + Horizontal, + Vertical + } + enum ThumbStyle{ + Normal, + Small + + } + +} +class Tab extends ej.Widget { + static fn: Tab; + constructor(element: JQuery, options?: TabOptions); + model:TabOptions; + defaults: TabOptions; + showBadge(index: (number|string)): void; + hideBadge(index: (number|string)): void; + updateBadgeValue(index: (number|string), value: (number|string)): void; + selectItem(index?: (number|string)): void; + enableItem(index?: (number|string)): void; + disableItem(index?: (number|string)): void; + enableContent(index?: (number|string)): void; + disableContent(index?: (number|string)): void; + addItem(tab: Object, index: (number|string)): void; + addOverflowItem(tab: Object, index: (number|string)): void; + removeItem(index: (number|string)): void; + removeOverflowItem(index: (number|string)): void; + getItemsCount(): number; + getOverflowItemCount(): number; + getActiveItemText(): string; + getActiveItem(): Object; + destroy(): void; +} + +interface TabOptions { + renderMode?: ej.mobile.RenderMode; + theme?: ej.mobile.Theme; + cssClass?: string; + allowScrolling?: boolean; + enableNativeScrolling?: boolean; + showScrollbars?: boolean; + enableAjax?: boolean; + showAjaxPopup?: boolean; + badge?: badgeTabOptions; + ios7?: ios7TabOptions; + enableCache?: boolean; + selectedItemIndex?: (number|string); + enabled?: boolean; + enablePersistence?: boolean; + prefetchAjaxContent?: boolean; + items?: Array; + overflowBadge?: overflowBadgeTabOptions; + android?: androidTabOptions; + windows?: windowsTabOptions; + flat?: flatTabOptions; + ajaxSettings?: ajaxSettingsTabOptions; + prefetchContentLoaded? (e: TabPrefetchEventArgs): void; + load? (e: TabEventArgs): void; + loadComplete? (e: TabLoadCompleteEventArgs): void; + touchStart? (e: TabEventArgs): void; + touchEnd? (e: TabEventArgs): void; + ajaxSuccess? (e: TabAjaxLoadSuccessEventArgs): void; + ajaxError? (e: TabAjaxLoadErrorEventArgs): void; + ajaxComplete? (e: TabEventArgs): void; + create? (e: TabEventArgs): void; + destroy? (e: TabEventArgs): void; + ajaxBeforeLoad? (e: TabAjaxBeforeLoadEventArgs): void; +} + +interface TabItemOptions { + text?: string; + href?: string; + enableAjax?: boolean; + badge?: badgeTabOptions; + touchStart? (e: TabEventArgs): void; + touchEnd? (e: TabEventArgs): void; + ios7?: ios7TabOptions; + android?: ios7TabOptions; +} + +interface TabEventArgs { + cancel: boolean; + type: string; + model: TabOptions; +} +interface TabAjaxBeforeLoadEventArgs extends TabEventArgs { + content?: any; + item?: any; + index?: number; + text?: string; + url?: string; +} +interface TabLoadCompleteEventArgs extends TabEventArgs { + element: Object; + id: string; +} +interface TabPrefetchEventArgs extends TabEventArgs { + item: Object; + content: string; + text: string; + url: string; + index: number; +} +interface TabAjaxLoadSuccessEventArgs extends TabEventArgs { + element: Object; + currentContent: string; +} + +interface TabAjaxLoadErrorEventArgs extends TabEventArgs { + status: boolean; + error: string; +} +interface badgeTabOptions { + enabled?: boolean; + value?: (number|string); + maxValue?: (number|string); + minValue?: (number|string); +} +interface ios7TabOptions { + imageClass?: string; +} +interface overflowBadgeTabOptions { + enabled?: boolean; + value?: (number|string); + maxValue?: (number|string); + minValue?: (number|string); +} +interface androidTabOptions { + contentType?: ej.mobile.Tab.Android.ContentType; + imageClass?: string; + position?: ej.mobile.Tab.Position; +} +interface windowsTabOptions extends windowsOption { + enableCustomText?: boolean; + position?: ej.mobile.Tab.Position; + enableTouchMove?: boolean; + preventContentSwipe?: boolean; +} +interface flatTabOptions { + position?: ej.mobile.Tab.Position; +} +interface ajaxSettingsTabOptions { + type?: string; + cache?: boolean; + async?: boolean; + dataType?: string; + contentType?: string; + url?: string; + data?: {}; +} + +export module Tab{ +export module Android{ +enum ContentType{ +Text, +Image, +Both +} +} +enum Position{ +Fixed, +Normal +} +} + +class Tile extends ej.Widget { + static fn: Tile; + constructor(element: JQuery, options?: TileOptions); + model: TileOptions; + defaults: TileOptions; + updateTemplate(id: string, index: (number|string)): void; + destroy(): void; +} + +interface TileOptions { + android?: androidTileOptions; + badge?: tileBadgeOptions; + cssClass?: string; + captionTemplateId?: string; + enablePersistence?: boolean; + imageClass?: string; + imagePath?: string; + imagePosition?: ej.mobile.Tile.ImagePosition; + imageTemplateId?: string; + imageUrl?: string; + backgroundColor?: string; + ios7?: ios7TileOptions; + liveTile?: liveTileOptions; + renderMode?: ej.mobile.RenderMode; + theme?: ej.mobile.Theme; + showText?: boolean; + text?: string; + textAlignment?: ej.mobile.Tile.TextAlignment; + tileSize?: ej.mobile.Tile.TileSize; + width?: (number|string); + height?: (number|string); + touchEnd? (e: tileTouchEventArgs): void; + touchStart? (e: tileTouchEventArgs): void; + create? (e: TileEventArgs): void; + destroy? (e: TileEventArgs): void; +} +interface TileEventArgs { + cancel?: boolean; + model?: TileOptions; + type?: string; +} +interface tileBadgeOptions { + enabled?: boolean; + value?: (number|string); + maxValue?: (number|string); + minValue?: (number|string); + text?: string; +} + +interface liveTileOptions { + enabled?: boolean; + imageClass?: string; + imageTemplateId?: string; + imageUrl?: string[]; + type?: string; + updateInterval?: number; +} + +interface ios7TileOptions { + textPosition?: ej.mobile.Tile.TextPosition; +} + +interface androidTileOptions { + textPosition?: ej.mobile.Tile.TextPosition; +} + +interface tileTouchEventArgs extends TileEventArgs { + text?: string; +} + +export module Tile +{ +enum TextPosition +{ + Inner, + Outer +} +enum TileSize +{ + Medium, + Small, + Large, + Wide +} +enum TextAlignment +{ + + Normal, + Left, + Right, + Center +} +enum ImagePosition +{ + Center, + Top, + Bottom, + Right, + Left, + TopLeft, + TopRight, + BottomRight, + BottomLeft, + Fill +} +} + + +class RadialSlider extends ej.Widget { + static fn: RadialSlider; + constructor(element: JQuery, options?: RadialSliderOptions); + constructor(element: Element, options?: RadialSliderOptions); + model:RadialSliderOptions; + defaults:RadialSliderOptions; + show(): void; + hide(): void; + destroy(): void; +} + +interface RadialSliderOptions { + radius?: number; + endAngle?: number; + startAngle?: number; + ticks?: Array; + enableRoundOff?: boolean; + value?: number|string; + strokeWidth?: number; + autoOpen?: boolean; + enableAnimation?: boolean; + cssClass?: string; + renderMode?: ej.mobile.RenderMode; + theme?: ej.mobile.Theme; + position?: ej.mobile.RadialSlider.Position; + labelSpace?: string|number; + innerCircleImageClass?: string; + innerCircleImageUrl?: string; + showInnerCircle?: boolean; + inline?: boolean; + stop? (e: RadialSliderStopEventArgs): void; + start? (e: RadialSliderStartEventArgs): void; + slide? (e: RadialSliderSlideEventArgs): void; + change? (e: RadialSliderChangeEventArgs): void; + mouseover? (e: RadialSliderMouseOverEventArgs): void; + create? (e: RadialSliderCreateEventArgs): void; + destroy? (e: RadialSliderCreateEventArgs): void; +} +interface RadialSliderCreateEventArgs { + cancel: boolean; + model: RadialSliderOptions; + type: string; +} +interface RadialSliderStopEventArgs extends RadialSliderCreateEventArgs { + value: number; +} + +interface RadialSliderStartEventArgs extends RadialSliderCreateEventArgs { + value: number; +} +interface RadialSliderSlideEventArgs extends RadialSliderCreateEventArgs { + value: number; + selectedValue: number; +} +interface RadialSliderChangeEventArgs extends RadialSliderCreateEventArgs { + value: number; + oldValue: number; +} +interface RadialSliderMouseOverEventArgs extends RadialSliderCreateEventArgs { + value: number; + selectedValue: number; +} +export module RadialSlider { + enum Position { + RightCenter, + RightTop, + RightBottom, + LeftCenter, + LeftTop, + LeftBottom, + TopLeft, + TopRight, + TopCenter, + BottomLeft, + BottomRight, + BottomCenter + } +} +class TimePicker extends ej.Widget { + static fn: TimePicker; + static Locale:any; + constructor(element: JQuery, options?: TimePickerOptions); + model: TimePickerOptions; + defaults: TimePickerOptions; + show(e?:any): void; + hide(e?:any): void; + enable(): void; + disable(): void; + getValue(): string; + setCurrentTime(time: any): void; + destroy(): void; +} +interface TimePickerOptions { + renderMode?: ej.mobile.RenderMode; + theme?: ej.mobile.Theme; + cssClass?: string; + hourFormat?: ej.mobile.TimePicker.HourFormat; + value?: string; + culture?: string; + timeFormat?: string; + enabled?: boolean; + enablePersistence?:boolean; + ios7?: ios7TimepickerOptions; + windows?: windowsOption; + select? (e: TimepickerEventArgs): void; + load? (e: TimepickerEventArgs): void; + focusIn? (e: TimepickerEventArgs): void; + focusOut? (e: TimepickerEventArgs): void; + open? (e: TimepickerEventArgs): void; + close? (e: TimepickerEventArgs): void; + change? (e: TimepickerEventArgs): void; + create? (e: TimePickerCommonEventArgs): void; + destroy? (e: TimePickerCommonEventArgs): void; +} +interface TimePickerCommonEventArgs { + cancel: boolean; + type: string; + model: TimePickerOptions; +} +interface TimepickerEventArgs extends TimePickerCommonEventArgs { + value: string; +} +interface ios7TimepickerOptions { + renderDefault?: boolean; +} + +export module TimePicker{ +enum HourFormat{ + TwentyFour, + Twelve +} +} + +//Class ejmToggleButton +class ToggleButton extends ej.Widget { + static fn: ToggleButton; + constructor(element: JQuery, options?: ToggleButtonOptions); + model: ToggleButtonOptions; + defaults: ToggleButtonOptions; + enable(): void; + disable(): void; + destroy(): void; +} + +//ejmToggleButton Option +interface ToggleButtonOptions { + theme?: ej.mobile.Theme; + renderMode?: ej.mobile.RenderMode; + cssClass?: string; + animate?: boolean; + toggleState?: boolean; + windows?: windowsOption; + enablePersistence?: boolean; + enabled?: boolean; + change? (e: ToggleButtonEventArgs): void; + touchStart? (e: ToggleButtonEventArgs): void; + touchEnd? (e: ToggleButtonEventArgs): void; + create? (e: ToggleButtonCommonEventArgs): void; + destroy? (e: ToggleButtonCommonEventArgs): void; +} + +interface ToggleButtonCommonEventArgs { + cancel: boolean; + type: string; + model: ToggleButtonOptions; +} +//ToggleButtonEvent Arugument +interface ToggleButtonEventArgs extends ToggleButtonCommonEventArgs { + state: boolean; +} +//Class ejmToolbar +class Toolbar extends ej.Widget { + static fn: Toolbar; + constructor(element: JQuery, options?: ToolbarOptions); + model: ToolbarOptions; + validTags: Array; + defaults: ToolbarOptions; + removeItem(index:number): void; + addItem(newitem:string): void; + showEllipsis(): void; + disableItem(disableIcon:string): void; + enableItem(enableIcon:string): void; + hideItem(iconName:string): void; + hideEllipsis(): void; + showItem(iconName:string): void; + hideMenu(): void; + showMenu(): void; + destroy(): void; +} + +//ejmToolbar Android Options +interface ToolbarAndroidOptions { + title?: string; + titleIconUrl?: string; + showBackNavigator?: boolean; + showTitleIcon?: boolean; + enableSplitView?: boolean; + showEllipsis?: boolean; + position?: ej.mobile.Toolbar.Position; + +} +//ejmToolbar IOS7 Options +interface ToolbarIOS7Options { + position?: ej.mobile.Toolbar.Position; +} +//ejmToolbar Flat Options +interface ToolbarFlatOptions { + position?: ej.mobile.Toolbar.Position; +} +//ejmToolbar Windows Options +interface ToolbarWindowsOptions { + position?: ej.mobile.Toolbar.Position; +} +//ejmToolbar Option +interface ToolbarOptions { + theme?: ej.mobile.Theme; + renderMode?: ej.mobile.RenderMode; + cssClass?: string; + items?: Array; + enabled?: boolean; + enablePersistence?:boolean; + hide?: boolean; + position?: ej.mobile.Toolbar.Position; + android?: ToolbarAndroidOptions; + windows?: windowsOption; + ios7?: ToolbarIOS7Options; + Flat?: ToolbarFlatOptions; + templateId?: any; + titleIconUrl?: any; + touchStart? (e: ToolbarEventArgs): void; + touchEnd? (e: ToolbarEventArgs): void; + create? (e: ToolbarEventArgs): void; + destroy? (e: ToolbarEventArgs): void; + +} +interface ToolbarItems{ + iconName?: ej.mobile.Toolbar.IconName; + iconUrl?: string; +} +//ejmToolbarEvent Arugument +interface ToolbarEventArgs { + cancel: boolean; + type: string; + model: ToolbarOptions; +} + +export module Toolbar{ + enum Position{ + Normal, + Fixed + } + enum IconName{ + Add, + Back, + Bookmark, + Close, + Compose, + Copy, + Cut, + Delete, + Done, + Edit, + Mail, + Next, + Refresh, + Overflow, + Paste, + Reply, + Save, + Search, + Settings, + Share + } +} +/*Group button*/ +class GroupButton extends ej.Widget { + static fn: GroupButton; + element: JQuery; + constructor(element?: JQuery, options?: GroupButtonOptions); + model: GroupButtonOptions; + defaults: GroupButtonOptions; + destroy(): void; + //add public functions +} +interface GroupButtonOptions { + selectedItemIndex?: (number|string); + renderMode?: ej.mobile.RenderMode; + theme?: ej.mobile.Theme; + cssClass?: string; + enablePersistence?: boolean; + items?: Array; + windows?: windowsOption; + touchStart? (e: GroupButtonEventArgs): void; + touchEnd? (e: GroupButtonEventArgs): void; + destroy? (e: GroupButtonEventArgs): void; + create? (e: GroupButtonEventArgs): void; +} +interface GroupButtonItemsOptions { + text?: string; + type?: string; + imageClass?: string; + imageUrl?: string; +} +interface GroupButtonEventArgs { + cancel: boolean; + type: string; + model: GroupButtonOptions; +} +/* SplitPane */ +class SplitPane extends ej.Widget { + static fn: SplitPane; + constructor(element: JQuery, options?: SplitPaneOptions); + model:SplitPaneOptions; + defaults: SplitPaneOptions; + loadContent(toPage: string, options?: any): void; + transferPage(toPage: any, options: any, existing: any, newPage: any): void; + refreshRightScroller(): void; + refreshLeftScroller(): void; + destroy(): void; +} +interface SplitPaneOptions { + renderMode?: ej.mobile.RenderMode; + theme?: ej.mobile.Theme; + cssClass?: string; + allowLeftPaneScrolling?: boolean; + allowRightPaneScrolling?: boolean; + android?: SplitPaneAndroidOptions; + windows?: SplitPaneWindowsOptions; + ios7?: SplitPaneIOS7Options; + flat?: SplitPaneFlatOptions; + enablePersistence?: boolean; + enableSwipe?: boolean; + overlayLeftPane?: boolean; + overlayDirection?: ej.mobile.SplitPane.OverlayDirection; + leftPaneScrollSettings?: Object; + rightPaneScrollSettings?: Object; + leftHeaderSettings?: Object; + rightHeaderSettings?: Object; + toolbarSettings?: Object; + create? (e: SplitPaneBaseEventArgs): void; + destroy? (e: SplitPaneBaseEventArgs): void; + beforeTransfer? (e: SplitPaneEventArgs): void; + afterLoadSuccess? (e: SplitPaneEventArgs): void; +} +interface SplitPaneBaseEventArgs { + cancel: boolean; + type: string; + model: SplitPaneOptions; +} +interface SplitPaneEventArgs extends SplitPaneBaseEventArgs { + element: Object; + toPage: Object; + leftPaneheader: Object; + rightPaneheader: Object; + toolbar: Object; +} +interface SplitPaneAndroidOptions { + showToolbar?: boolean; +} +interface SplitPaneWindowsOptions { + showLeftPaneHeader?: boolean; + showRightPaneHeader?: boolean; +} +interface SplitPaneIOS7Options { + showLeftPaneHeader?: boolean; + showRightPaneHeader?: boolean; +} +interface SplitPaneFlatOptions { + showLeftPaneHeader?: boolean; + showRightPaneHeader?: boolean; +} + +export module SplitPane{ +enum OverlayDirection{ +Left, +Right +} +} + +class Dialog extends ej.Widget { + static fn: Dialog; + element: JQuery; + constructor(element: JQuery, options?: DialogOptions); + model: DialogOptions; + defaults: DialogOptions; + open(): void; + close(): void; + isOpened(): boolean; + destroy(): void; +} +interface DialogOptions { + cssClass?: string; + enableAutoOpen?: boolean; + title?: string; + beforeClose? (e: DialogBeforeClose): void; + open? (e: DialogOpen): void; + close? (e: DialogClose): void; + buttonTap? (e: DialogButtonTap): void; + renderMode?: ej.mobile.RenderMode; + theme?: ej.mobile.Theme; + enableModal?: boolean; + showButtons?: boolean; + allowScrolling?: boolean; + enableNativeScrolling?: boolean; + mode?: ej.mobile.Dialog.Mode; + leftButtonCaption?: string; + rightButtonCaption?: string; + checkDOMChanges?: boolean; + templateId?: string; + targetHeight?: string|number; + enablePersistence?: boolean; + enableAnimation?: boolean; + windows?: windowsOption; + destroy? (e: DialogEventArgs): void; + create? (e: DialogEventArgs): void; +} +interface DialogEventArgs { + cancel: boolean; + type: string; + model: DialogOptions; +} +interface DialogBeforeClose extends DialogEventArgs{ + title: string; +} +interface DialogOpen extends DialogEventArgs { + element: Object; + title: string; +} +interface DialogClose extends DialogEventArgs { + title: string; + element: Object; +} +interface DialogButtonTap extends DialogEventArgs { + text: string; +} + +export module Dialog{ +enum Mode{ + Alert, + Confirm, + Normal, + FullView +} +} + +class TextboxCommon extends ej.Widget { + model: TextBoxOptions; + disable(): void; + enable(): void; + getStrippedValue(): string; + getUnstrippedValue(): string; + getValue(): string; + getWatermarkText(): string; + refresh(): void; + destroy(): void; +} +class TextBox extends TextboxCommon { + static fn: TextBox; + constructor(element: JQuery, options?: TextBoxOptions); + defaults: TextBoxOptions; +} +/* Password */ +class Password extends TextboxCommon { + static fn: Password; + constructor(element: JQuery, options?: TextBoxOptions); + defaults: TextBoxOptions; +} +/* MaskEdit */ +class MaskEdit extends TextboxCommon { + static fn: MaskEdit; + constructor(element: JQuery, options?: MaskEditOptions); + defaults: MaskEditOptions; + +} +/* TextArea */ +class TextArea extends TextboxCommon { + static fn: TextArea; + constructor(element: JQuery, options?: TextBoxOptions); + defaults: TextBoxOptions; + +} +interface TextBoxOptions { + renderMode?: ej.mobile.RenderMode; + theme?: ej.mobile.Theme; + cssClass?: string; + showBorder?: boolean; + windows?: WindowsTextBoxOptions; + value?: string; + watermarkText?: string; + change? (e: TextBoxChangeEventArgs): void; + create? (e: TextBoxEventArgs): void; + destroy? (e: TextBoxEventArgs): void; + enabled?: boolean; + enablePersistence?: boolean; + readOnly?: boolean; +} +interface TextBoxEventArgs { + cancel: boolean; + type: string; + model: TextBoxOptions; +} +interface MaskEditOptions extends TextBoxOptions { + mask?: string; +} +interface WindowsTextBoxOptions extends windowsOption { + allowReset?: boolean; +} +interface TextBoxChangeEventArgs extends TextBoxEventArgs { + element: Object; + value: string; + isChecked: boolean; +} +class Footer extends ej.Widget { + static fn: Footer; + element: JQuery; + constructor(element: JQuery, options?: FooterOptions); + model: FooterOptions; + defaults: FooterOptions; + getTitle(): string; + destroy(): void; + +} + +interface FooterOptions { + hideForUnSupportedDevice?: boolean; + leftButtonNavigationUrl?: string; + rightButtonNavigationUrl?: string; + title?: string; + cssClass?: string; + showTitle?: boolean; + position?: ej.mobile.Footer.Position; + leftButtonCaption?: string; + rightButtonCaption?: string; + renderMode?: ej.mobile.RenderMode; + theme?: ej.mobile.Theme; + showLeftButton?: boolean; + showRightButton?: boolean; + enablePersistence?:boolean; + leftButtonStyle?:ej.mobile.Footer.FooterLeftButtonStyle; + rightButtonStyle?:ej.mobile.Footer.FooterRightButtonStyle; + ios7?: Footerios7Options; + flat?: FooterFlatOptions; + android?: FooterAndroidOptions; + templateId?: string; + windows?: FooterWindowsOptions; + leftButtonTap? (e: FooterLeftButtonTapEventArgs): void; + rightButtonTap? (e: FooterRightButtonTapEventArgs): void; + destroy?(e:FooterBaseArgs):void; + create?(e:FooterBaseArgs):void; +} + +interface FooterWindowsOptions extends windowsOption { + renderDefault?: boolean; + rightButtonStyle?: ej.mobile.Footer.Windows.FooterRightButtonStyle; + leftButtonStyle?: ej.mobile.Footer.Windows.FooterLeftButtonStyle; + showLeftButton?: boolean; + showRightButton?: boolean; +} +interface Footerios7Options { + rightButtonStyle?: ej.mobile.Footer.IOS7.FooterRightButtonStyle; + leftButtonStyle?: ej.mobile.Footer.IOS7.FooterLeftButtonStyle; + showLeftButton?: boolean; + showRightButton?: boolean; +} +interface FooterFlatOptions { + rightButtonStyle?: ej.mobile.Footer.Flat.FooterRightButtonStyle; + leftButtonStyle?: ej.mobile.Footer.Flat.FooterLeftButtonStyle; + showLeftButton?: boolean; + showRightButton?: boolean; +} +interface FooterAndroidOptions { + rightButtonStyle?: ej.mobile.Footer.Android.FooterRightButtonStyle; + leftButtonStyle?: ej.mobile.Footer.Android.FooterLeftButtonStyle; + showLeftButton?: boolean; + showRightButton?: boolean; +} + +interface FooterBaseArgs{ + cancel: boolean; + type: string; + model: FooterOptions; +} + +interface FooterLeftButtonTapEventArgs { + text: string; + cancel: boolean; + model: Object; + type: string; + status: boolean; +} +interface FooterRightButtonTapEventArgs { + text: string; + cancel: boolean; + model: Object; + type: string; + status: boolean; +} + +export module Footer{ +export module IOS7 +{ +enum FooterLeftButtonStyle +{ + Auto, + Back, + Header, + Normal +} +enum FooterRightButtonStyle +{ + Auto, + Header, + Normal +} +} + +export module Flat +{ +enum FooterLeftButtonStyle +{ + Auto, + Back, + Normal, + Header +} +enum FooterRightButtonStyle +{ + Auto, + Header, + Normal +} +} + +export module Android +{ +enum FooterLeftButtonStyle +{ + Auto, + Back, + Normal, + Header +} +enum FooterRightButtonStyle +{ + Auto, + Normal, + Header +} +} + +export module Windows +{ +enum FooterLeftButtonStyle +{ + Auto, + Back, + Normal, + Header +} +enum FooterRightButtonStyle +{ + Auto, + Normal, + Header +} +} +enum Position{ + Normal, + Fixed +} +enum FooterLeftButtonStyle{ +Back, +Header, +Normal +} +enum FooterRightButtonStyle{ +Header, +Normal +} +} + +class CheckBox extends ej.Widget { + static fn: CheckBox; + constructor(element: JQuery, options?: CheckBoxOptions); + model: CheckBoxOptions; + defaults: CheckBoxOptions; + isChecked(): boolean; + destroy(): void; + +} +interface CheckBoxOptions { + touchStart? (e: CheckBoxTouchStart): void; + touchEnd? (e: CheckBoxTouchEnd): void; + renderMode?: ej.mobile.RenderMode; + cssClass?: string; + preventDefault?: boolean; + theme?: ej.mobile.Theme; + enabled?: boolean; + checked?: boolean; + enableTriState?: boolean; + checkState?: ej.mobile.CheckBox.CheckState; + windows?: windowsOption; + enablePersistence?: boolean; + text?: string; + destroy? (e: checkBoxEventArgs): void; + create? (e: checkBoxEventArgs): void; +} +interface checkBoxEventArgs { + cancel: boolean; + type: string; + model: CheckBoxOptions; +} +interface CheckBoxTouchStart extends checkBoxEventArgs{ + element: Object; + value: string; + isChecked: boolean; +} +interface CheckBoxTouchEnd extends checkBoxEventArgs{ + element: Object; + value: string; + isChecked: boolean; +} +export module CheckBox{ + enum CheckState{ + Uncheck, + Check, + Indeterminate + } +} +class ScrollPanel extends ej.Widget { + static fn: ScrollPanel; + constructor(element: JQuery, target: any, options?: ScrollPanelOptions); + model: ScrollPanelOptions; + defaults: ScrollPanelOptions; + refresh(): void; + disable(): void; + enable(): void; + getComputedPosition(): void; + stop(): void; + getScrollPosition(): void; + destroy(): void; + } + interface ScrollPanelOptions { + renderMode?: ej.mobile.RenderMode; + theme?: ej.mobile.Theme; + enableResize?: boolean; + targetHeight?: number; + targetWidth?: number; + scrollHeight?: number; + scrollWidth?: number; + target: any; + enableFade?: boolean; + enableShrink?: (boolean|string); + autoAdjustHeight?: boolean; + isRelative?: boolean; + wheelSpeed?: number; + enableInteraction?: boolean; + enabled?: boolean; + eventPassthrough?:any; + translateZ?:string; + mode?:ej.mobile.ScrollPanel.Mode; + checkDOMChanges?: boolean; + enableHrScroll?: boolean; + enableVrScroll?: boolean; + zoomMin?: number; + zoomMax?: number; + adjustFixedPosition?: boolean; + startZoom?: number; + startX?: number; + startY?: number; + bounceEasing?:string; + enableDisplacement?:boolean; + displacementValue?:number; + displacementTime?:number; + preventDefaultException?:{tagName?:any} + deceleration?:any; + disablePointer?: boolean; + disableMouse?: boolean; + disableTouch?: boolean; + directionLockThreshold?: number; + momentum?: boolean; + enableBounce?: boolean; + bounceTime?: number; + preventDefault?: boolean; + enableTransform?: boolean; + enableTransition?: boolean; + showScrollbars?: boolean; + enableMouseWheel?: boolean; + enableKeys?: boolean; + enableZoom?: boolean; + enableNativeScrolling?: boolean; + invertWheel?: boolean; + enablePersistence?: boolean; + create? (e: ScrollPanelBaseEventArgs): void; + destroy? (e: ScrollPanelBaseEventArgs): void; + scrollStart? (e: ScrollPanelEventArgs): void; + scroll? (e: ScrollPanelEventArgs): void; + scrollEnd? (e: ScrollPanelEventArgs): void; + zoomStart? (e: ScrollPanelEventArgs): void; + zoomEnd? (e: ScrollPanelEventArgs): void; + } +interface ScrollPanelBaseEventArgs { + cancel: boolean; + type: string; + model: ScrollPanelOptions; +} +interface ScrollPanelEventArgs extends ScrollPanelBaseEventArgs { + x: number; + y: number; + object: Object; +} +export module ScrollPanel{ + enum Mode{ + Page, + Container + } +} +class NavigationDrawer extends ej.Widget { + static fn: NavigationDrawer; + element: JQuery; + constructor(element: JQuery, options?: NavigationDrawerOptions); + model: NavigationDrawerOptions; + defaults: NavigationDrawerOptions; + open(e: any): void; + close(e: any): void; + toggle(e: any): void; + destroy(): void; +} +//ejmNavigationDrawer Option +interface NavigationDrawerOptions { + theme?: ej.mobile.Theme; + renderMode?: ej.mobile.RenderMode; + cssClass?: string; + contentId?: string; + allowScrolling?: boolean; + scrollSettings?: {}; + considerSubPage?: boolean; + direction?: ej.mobile.NavigationDrawer.Direction; + showScrollbars?: boolean; + targetId?: string; + position?: ej.mobile.NavigationDrawer.Position; + enableListView?: boolean; + listViewSettings?: {}; + type?: ej.mobile.NavigationDrawer.Type; + width?: string; + items?: Array; + swipe? (e: NavigationDrawerSwipeEventArgs): void; + open? (e: NavigationDrawerOpenBeforeCloseEventArgs): void; + beforeClose? (e: NavigationDrawerOpenBeforeCloseEventArgs): void; + create? (e: NavigationDrawerEvent): void; + destroy? (e: NavigationDrawerEvent): void; +} + +interface NavigationDrawerEvent { + type: string; + cancel: boolean; + model: NavigationDrawerOptions; +} + +//ejmNavigationDrawer Swipe Event Arugument +interface NavigationDrawerSwipeEventArgs extends NavigationDrawerEvent { + element: Object; + targetElement: Object; + direction: string; +} +//ejmNavigationDrawer Open and BeforeClose Event Arugument +interface NavigationDrawerOpenBeforeCloseEventArgs extends NavigationDrawerEvent { + element: Object; +} + +export module NavigationDrawer { + enum Direction { + Left, + Right + } + enum Position { + Normal, + Fixed + } + enum Type { + Overlay, + Slide + } +} + + +class RadialMenu extends ej.Widget { + static fn: RadialMenu; + constructor(element: JQuery, options?: RadialMenuOptions); + model: RadialMenuOptions; + defaults: RadialMenuOptions; + show(): void; + hide(): void; + menuHide(): void; + hideMenu(): void; + showMenu(): void; + enableItemByIndex(index: number): void; + enableItemsByIndices(itemIndices: Array): void; + disableItemByIndex(itemIndex: number): void; + disableItemsByIndices(itemIndices: Array): void; + updateBadgeValue(index: number, value: number): void; + showBadge(index: number): void; + hideBadge(index: number): void; +} + +interface RadialMenuOptions { + renderMode?: ej.mobile.RenderMode; + theme?: ej.mobile.Theme; + radius?: number; + cssClass?: string; + imageClass?: string; + backImageClass?: string; + position?: ej.mobile.RadialMenu.Position; + enableAnimation?: boolean; + windows?: windowsOption; + items?: any; + touch? (e: RadialMenuEventArgs): void; + open? (e: RadialMenuEventArgs): void; + close? (e: RadialMenuEventArgs): void; + select? (e: RadialMenuEventArgs): void; +} +interface RadialMenuEventArgs { + cancel: boolean; + model: RadialMenuOptions; + type: string; + index: number; + childIndex: number; +} +export module RadialMenu{ + enum Position{ + RightCenter, + RightTop, + RightBottom, + LeftCenter, + LeftTop, + LeftBottom + } +} + + +} +declare module ej.datavisualization { + +class LinearGauge extends ej.Widget { + static fn: LinearGauge; + constructor(element: JQuery, options?: LinearGauge.Model); + constructor(element: Element, options?: LinearGauge.Model); + model:LinearGauge.Model; + defaults:LinearGauge.Model; + + /** destroy the linear gauge all events bound using this._on will be unbind automatically and bring the control to pre-init state. + * @returns {void} + */ + destroy(): void; + + /** To export Image + * @returns {void} + */ + exportImage(): void; + + /** To get Bar Distance From Scale in number + * @returns {void} + */ + getBarDistanceFromScale(): void; + + /** To get Bar Pointer Value in number + * @returns {void} + */ + getBarPointerValue(): void; + + /** To get Bar Width in number + * @returns {void} + */ + getBarWidth(): void; + + /** To get CustomLabel Angle in number + * @returns {void} + */ + getCustomLabelAngle(): void; + + /** To get CustomLabel Value in string + * @returns {void} + */ + getCustomLabelValue(): void; + + /** To get Label Angle in number + * @returns {void} + */ + getLabelAngle(): void; + + /** To get LabelPlacement in number + * @returns {void} + */ + getLabelPlacement(): void; + + /** To get LabelStyle in number + * @returns {void} + */ + getLabelStyle(): void; + + /** To get Label XDistance From Scale in number + * @returns {void} + */ + getLabelXDistanceFromScale(): void; + + /** To get PointerValue in number + * @returns {void} + */ + getLabelYDistanceFromScale(): void; + + /** To get Major Interval Value in number + * @returns {void} + */ + getMajorIntervalValue(): void; + + /** To get MarkerStyle in number + * @returns {void} + */ + getMarkerStyle(): void; + + /** To get Maximum Value in number + * @returns {void} + */ + getMaximumValue(): void; + + /** To get PointerValue in number + * @returns {void} + */ + getMinimumValue(): void; + + /** To get Minor Interval Value in number + * @returns {void} + */ + getMinorIntervalValue(): void; + + /** To get Pointer Distance From Scale in number + * @returns {void} + */ + getPointerDistanceFromScale(): void; + + /** To get PointerHeight in number + * @returns {void} + */ + getPointerHeight(): void; + + /** To get Pointer Placement in String + * @returns {void} + */ + getPointerPlacement(): void; + + /** To get PointerValue in number + * @returns {void} + */ + getPointerValue(): void; + + /** To get PointerWidth in number + * @returns {void} + */ + getPointerWidth(): void; + + /** To get Range Border Width in number + * @returns {void} + */ + getRangeBorderWidth(): void; + + /** To get Range Distance From Scale in number + * @returns {void} + */ + getRangeDistanceFromScale(): void; + + /** To get Range End Value in number + * @returns {void} + */ + getRangeEndValue(): void; + + /** To get Range End Width in number + * @returns {void} + */ + getRangeEndWidth(): void; + + /** To get Range Position in number + * @returns {void} + */ + getRangePosition(): void; + + /** To get Range Start Value in number + * @returns {void} + */ + getRangeStartValue(): void; + + /** To get Range Start Width in number + * @returns {void} + */ + getRangeStartWidth(): void; + + /** To get ScaleBarLength in number + * @returns {void} + */ + getScaleBarLength(): void; + + /** To get Scale Bar Size in number + * @returns {void} + */ + getScaleBarSize(): void; + + /** To get Scale Border Width in number + * @returns {void} + */ + getScaleBorderWidth(): void; + + /** To get Scale Direction in number + * @returns {void} + */ + getScaleDirection(): void; + + /** To get Scale Location in object + * @returns {void} + */ + getScaleLocation(): void; + + /** To get Scale Style in string + * @returns {void} + */ + getScaleStyle(): void; + + /** To get Tick Angle in number + * @returns {void} + */ + getTickAngle(): void; + + /** To get Tick Height in number + * @returns {void} + */ + getTickHeight(): void; + + /** To get getTickPlacement in number + * @returns {void} + */ + getTickPlacement(): void; + + /** To get Tick Style in string + * @returns {void} + */ + getTickStyle(): void; + + /** To get Tick Width in number + * @returns {void} + */ + getTickWidth(): void; + + /** To get get Tick XDistance From Scale in number + * @returns {void} + */ + getTickXDistanceFromScale(): void; + + /** To get Tick YDistance From Scale in number + * @returns {void} + */ + getTickYDistanceFromScale(): void; + + /** Specifies the scales. + * @returns {void} + */ + scales(): void; + + /** To set setBarDistanceFromScale + * @returns {void} + */ + setBarDistanceFromScale(): void; + + /** To set setBarPointerValue + * @returns {void} + */ + setBarPointerValue(): void; + + /** To set setBarWidth + * @returns {void} + */ + setBarWidth(): void; + + /** To set setCustomLabelAngle + * @returns {void} + */ + setCustomLabelAngle(): void; + + /** To set setCustomLabelValue + * @returns {void} + */ + setCustomLabelValue(): void; + + /** To set setLabelAngle + * @returns {void} + */ + setLabelAngle(): void; + + /** To set setLabelPlacement + * @returns {void} + */ + setLabelPlacement(): void; + + /** To set setLabelStyle + * @returns {void} + */ + setLabelStyle(): void; + + /** To set setLabelXDistanceFromScale + * @returns {void} + */ + setLabelXDistanceFromScale(): void; + + /** To set setLabelYDistanceFromScale + * @returns {void} + */ + setLabelYDistanceFromScale(): void; + + /** To set setMajorIntervalValue + * @returns {void} + */ + setMajorIntervalValue(): void; + + /** To set setMarkerStyle + * @returns {void} + */ + setMarkerStyle(): void; + + /** To set setMaximumValue + * @returns {void} + */ + setMaximumValue(): void; + + /** To set setMinimumValue + * @returns {void} + */ + setMinimumValue(): void; + + /** To set setMinorIntervalValue + * @returns {void} + */ + setMinorIntervalValue(): void; + + /** To set setPointerDistanceFromScale + * @returns {void} + */ + setPointerDistanceFromScale(): void; + + /** To set PointerHeight + * @returns {void} + */ + setPointerHeight(): void; + + /** To set setPointerPlacement + * @returns {void} + */ + setPointerPlacement(): void; + + /** To set PointerValue + * @returns {void} + */ + setPointerValue(): void; + + /** To set PointerWidth + * @returns {void} + */ + setPointerWidth(): void; + + /** To set setRangeBorderWidth + * @returns {void} + */ + setRangeBorderWidth(): void; + + /** To set setRangeDistanceFromScale + * @returns {void} + */ + setRangeDistanceFromScale(): void; + + /** To set setRangeEndValue + * @returns {void} + */ + setRangeEndValue(): void; + + /** To set setRangeEndWidth + * @returns {void} + */ + setRangeEndWidth(): void; + + /** To set setRangePosition + * @returns {void} + */ + setRangePosition(): void; + + /** To set setRangeStartValue + * @returns {void} + */ + setRangeStartValue(): void; + + /** To set setRangeStartWidth + * @returns {void} + */ + setRangeStartWidth(): void; + + /** To set setScaleBarLength + * @returns {void} + */ + setScaleBarLength(): void; + + /** To set setScaleBarSize + * @returns {void} + */ + setScaleBarSize(): void; + + /** To set setScaleBorderWidth + * @returns {void} + */ + setScaleBorderWidth(): void; + + /** To set setScaleDirection + * @returns {void} + */ + setScaleDirection(): void; + + /** To set setScaleLocation + * @returns {void} + */ + setScaleLocation(): void; + + /** To set setScaleStyle + * @returns {void} + */ + setScaleStyle(): void; + + /** To set setTickAngle + * @returns {void} + */ + setTickAngle(): void; + + /** To set setTickHeight + * @returns {void} + */ + setTickHeight(): void; + + /** To set setTickPlacement + * @returns {void} + */ + setTickPlacement(): void; + + /** To set setTickStyle + * @returns {void} + */ + setTickStyle(): void; + + /** To set setTickWidth + * @returns {void} + */ + setTickWidth(): void; + + /** To set setTickXDistanceFromScale + * @returns {void} + */ + setTickXDistanceFromScale(): void; + + /** To set setTickYDistanceFromScale + * @returns {void} + */ + setTickYDistanceFromScale(): void; +} +export module LinearGauge{ + +export interface Model { + + /**Specifies the animationSpeed + * @Default {500} + */ + animationSpeed?: number; + + /**Specifies the backgroundColor for Linear gauge. + * @Default {null} + */ + backgroundColor?: string; + + /**Specifies the borderColor for Linear gauge. + * @Default {null} + */ + borderColor?: string; + + /**Specifies the animate state + * @Default {true} + */ + enableAnimation?: boolean; + + /**Specifies the animate state for marker pointer + * @Default {true} + */ + enableMarkerPointerAnimation?: boolean; + + /**Specifies the can resize state. + * @Default {false} + */ + enableResize?: boolean; + + /**Specify frame of linear gauge + * @Default {null} + */ + frame?: Frame; + + /**Specifies the height of Linear gauge. + * @Default {400} + */ + height?: number; + + /**Specifies the labelColor for Linear gauge. + * @Default {null} + */ + labelColor?: string; + + /**Specifies the maximum value of Linear gauge. + * @Default {100} + */ + maximum?: number; + + /**Specifies the minimum value of Linear gauge. + * @Default {0} + */ + minimum?: number; + + /**Specifies the orientation for Linear gauge. + * @Default {Vertical} + */ + orientation?: string; + + /**Specify labelPosition value of Linear gauge See OuterCustomLabelPosition + * @Default {bottom} + */ + outerCustomLabelPosition?: ej.datavisualization.LinearGauge.OuterCustomLabelPosition|string; + + /**Specifies the pointerGradient1 for Linear gauge. + * @Default {null} + */ + pointerGradient1?: any; + + /**Specifies the pointerGradient2 for Linear gauge. + * @Default {null} + */ + pointerGradient2?: any; + + /**Specifies the read only state. + * @Default {true} + */ + readOnly?: boolean; + + /**Specifies the scales + * @Default {null} + */ + scales?: Scales; + + /**Specifies the theme for Linear gauge. See LinearGauge.Themes + * @Default {flatlight} + */ + theme?: ej.datavisualization.LinearGauge.Themes|string; + + /**Specifies the tick Color for Linear gauge. + * @Default {null} + */ + tickColor?: string; + + /**Specify tooltip options of linear gauge + * @Default {false} + */ + tooltip?: Tooltip; + + /**Specifies the value of the Gauge. + * @Default {0} + */ + value?: number; + + /**Specifies the width of Linear gauge. + * @Default {150} + */ + width?: number; + + /**Triggers while the bar pointer are being drawn on the gauge.*/ + drawBarPointers? (e: DrawBarPointersEventArgs): void; + + /**Triggers while the customLabel are being drawn on the gauge.*/ + drawCustomLabel? (e: DrawCustomLabelEventArgs): void; + + /**Triggers while the Indicator are being drawn on the gauge.*/ + drawIndicators? (e: DrawIndicatorsEventArgs): void; + + /**Triggers while the label are being drawn on the gauge.*/ + drawLabels? (e: DrawLabelsEventArgs): void; + + /**Triggers while the marker are being drawn on the gauge.*/ + drawMarkerPointers? (e: DrawMarkerPointersEventArgs): void; + + /**Triggers while the range are being drawn on the gauge.*/ + drawRange? (e: DrawRangeEventArgs): void; + + /**Triggers while the ticks are being drawn on the gauge.*/ + drawTicks? (e: DrawTicksEventArgs): void; + + /**Triggers when the gauge is initialized.*/ + init? (e: InitEventArgs): void; + + /**Triggers while the gauge start to Load.*/ + load? (e: LoadEventArgs): void; + + /**Triggers when the left mouse button is clicked.*/ + mouseClick? (e: MouseClickEventArgs): void; + + /**Triggers when clicking and dragging the mouse pointer over the gauge pointer.*/ + mouseClickMove? (e: MouseClickMoveEventArgs): void; + + /**Triggers when the mouse click is released.*/ + mouseClickUp? (e: MouseClickUpEventArgs): void; + + /**Triggers while the rendering of the gauge completed.*/ + renderComplete? (e: RenderCompleteEventArgs): void; +} + +export interface DrawBarPointersEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the startX and startY of the pointer + */ + position?: any; + + /**returns the gauge model + */ + Model?: any; + + /**returns the options of the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the pointer belongs. + */ + scaleIndex?: number; + + /**returns the pointer style + */ + style?: string; + + /**returns the current Bar pointer element. + */ + barElement?: any; + + /**returns the index of the bar pointer. + */ + barPointerIndex?: number; + + /**returns the value of the bar pointer. + */ + PointerValue?: number; + + /**returns the name of the event + */ + type?: any; +} + +export interface DrawCustomLabelEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the startX and startY of the customLabel + */ + position?: any; + + /**returns the gauge model + */ + Model?: any; + + /**returns the options of the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the pointer belongs. + */ + scaleIndex?: number; + + /**returns the customLabel style + */ + style?: any; + + /**returns the current customLabel element. + */ + customLabelElement?: any; + + /**returns the index of the customLabel. + */ + customLabelIndex?: number; + + /**returns the name of the event + */ + type?: any; +} + +export interface DrawIndicatorsEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the startX and startY of the Indicator + */ + position?: any; + + /**returns the gauge model + */ + Model?: any; + + /**returns the options of the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the pointer belongs. + */ + scaleIndex?: number; + + /**returns the Indicator style + */ + style?: string; + + /**returns the current Indicator element. + */ + IndicatorElement?: any; + + /**returns the index of the Indicator. + */ + IndicatorIndex?: number; + + /**returns the name of the event + */ + type?: any; +} + +export interface DrawLabelsEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the startX and startY of the label + */ + position?: any; + + /**returns the gauge model + */ + Model?: any; + + /**returns the options of the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the label belongs. + */ + scaleIndex?: number; + + /**returns the label style + */ + style?: string; + + /**returns the angle of the label. + */ + angle?: number; + + /**returns the current label element. + */ + element?: any; + + /**returns the index of the label. + */ + index?: number; + + /**returns the label value of the label. + */ + value?: number; + + /**returns the name of the event + */ + type?: any; +} + +export interface DrawMarkerPointersEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the startX and startY of the pointer + */ + position?: any; + + /**returns the gauge model + */ + Model?: any; + + /**returns the options of the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the pointer belongs. + */ + scaleIndex?: number; + + /**returns the ticks style + */ + style?: string; + + /**returns the current marker pointer element. + */ + markerElement?: any; + + /**returns the index of the marker pointer. + */ + markerPointerIndex?: number; + + /**returns the value of the marker pointer. + */ + pointerValue?: number; + + /**returns the angle of the marker pointer. + */ + pointerAngle?: number; + + /**returns the name of the event + */ + type?: any; +} + +export interface DrawRangeEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the startX and startY of the range + */ + position?: any; + + /**returns the gauge model + */ + Model?: any; + + /**returns the options of the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the pointer belongs. + */ + scaleIndex?: number; + + /**returns the range style + */ + style?: string; + + /**returns the current range element. + */ + rangeElement?: any; + + /**returns the index of the range. + */ + rangeIndex?: number; + + /**returns the name of the event + */ + type?: any; +} + +export interface DrawTicksEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the startX and startY of the ticks + */ + position?: any; + + /**returns the gauge model + */ + Model?: any; + + /**returns the options of the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the tick belongs. + */ + scaleIndex?: number; + + /**returns the ticks style + */ + style?: string; + + /**returns the angle of the tick. + */ + angle?: number; + + /**returns the current tick element. + */ + element?: any; + + /**returns the index of the tick. + */ + index?: number; + + /**returns the tick value of the tick. + */ + value?: number; + + /**returns the name of the event + */ + type?: any; +} + +export interface InitEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the gauge model + */ + Model?: any; + + /**returns the entire scale element. + */ + scaleElement?: any; + + /**returns the context element + */ + context?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface LoadEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the gauge model + */ + Model?: any; + + /**returns the entire scale element. + */ + scaleElement?: any; + + /**returns the context element + */ + context?: any; + + /**returns the name of the event + */ + type?: any; +} + +export interface MouseClickEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the gauge model + */ + model?: any; + + /**returns the name of the event + */ + type?: any; + + /**returns the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the pointer belongs. + */ + scaleIndex?: number; + + /**returns the context element* @param {Object} args.markerpointer returns the context element + */ + context?: any; + + /**returns the pointer Index + */ + markerpointerindex?: number; + + /**returns the pointer element. + */ + markerpointerelement?: any; + + /**returns the value of the pointer. + */ + markerpointervalue?: number; + + /**returns the pointer style + */ + style?: string; + + /**returns the startX and startY of the pointer. + */ + position?: any; +} + +export interface MouseClickMoveEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the gauge model + */ + model?: any; + + /**returns the name of the event + */ + type?: any; + + /**returns the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the pointer belongs. + */ + scaleIndex?: number; + + /**returns the context element + */ + context?: any; + + /**returns the pointer Index + */ + index?: number; + + /**returns the pointer element. + */ + element?: any; + + /**returns the value of the pointer. + */ + value?: number; + + /**returns the pointer style + */ + style?: string; + + /**returns the startX and startY of the pointer. + */ + position?: any; +} + +export interface MouseClickUpEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the gauge model + */ + model?: any; + + /**returns the name of the event + */ + type?: any; + + /**returns the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the pointer belongs. + */ + scaleIndex?: number; + + /**returns the context element* @param {Object} args.markerpointer returns the context element + */ + context?: any; + + /**returns the pointer Index + */ + markerpointerIndex?: number; + + /**returns the pointer element. + */ + markerpointerElement?: any; + + /**returns the value of the pointer. + */ + markerpointerValue?: number; + + /**returns the pointer style + */ + style?: string; + + /**returns the startX and startY of the pointer. + */ + position?: any; +} + +export interface RenderCompleteEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the gauge model + */ + Model?: any; + + /**returns the entire scale element. + */ + scaleElement?: any; + + /**returns the context element + */ + context?: any; + + /**returns the name of the event + */ + type?: any; +} + +export interface Frame { + + /**Specifies the frame background image url of linear gauge + * @Default {null} + */ + backgroundImageUrl?: string; + + /**Specifies the frame InnerWidth + * @Default {8} + */ + innerWidth?: number; + + /**Specifies the frame OuterWidth + * @Default {12} + */ + outerWidth?: number; +} + +export interface ScalesBarPointersBorder { + + /**Specifies the border Color of bar pointer + * @Default {null} + */ + color?: string; + + /**Specifies the border Width of bar pointer + * @Default {1.5} + */ + width?: number; +} + +export interface ScalesBarPointers { + + /**Specifies the backgroundColor of bar pointer + * @Default {null} + */ + backgroundColor?: string; + + /**Specifies the border of bar pointer + * @Default {null} + */ + border?: ScalesBarPointersBorder; + + /**Specifies the distanceFromScale of bar pointer + * @Default {0} + */ + distanceFromScale?: number; + + /**Specifies the scaleBar Gradient of bar pointer + * @Default {null} + */ + gradients?: any; + + /**Specifies the opacity of bar pointer + * @Default {1} + */ + opacity?: number; + + /**Specifies the value of bar pointer + * @Default {null} + */ + value?: number; + + /**Specifies the pointer Width of bar pointer + * @Default {width=30} + */ + width?: number; +} + +export interface ScalesBorder { + + /**Specifies the border color of the Scale. + * @Default {null} + */ + color?: string; + + /**Specifies the border width of the Scale. + * @Default {1.5} + */ + width?: number; +} + +export interface ScalesCustomLabelsFont { + + /**Specifies the fontFamily in customLabels + * @Default {Arial} + */ + fontFamily?: string; + + /**Specifies the fontStyle in customLabels. See FontStyle + * @Default {Bold} + */ + fontStyle?: ej.datavisualization.LinearGauge.FontStyle|string; + + /**Specifies the font size in customLabels + * @Default {11px} + */ + size?: string; +} + +export interface ScalesCustomLabelsPosition { + + /**Specifies the position x in customLabels + * @Default {0} + */ + x?: number; + + /**Specifies the y in customLabels + * @Default {0} + */ + y?: number; +} + +export interface ScalesCustomLabels { + + /**Specifies the label Color in customLabels + * @Default {null} + */ + color?: number; + + /**Specifies the font in customLabels + * @Default {null} + */ + font?: ScalesCustomLabelsFont; + + /**Specifies the opacity in customLabels + * @Default {0} + */ + opacity?: string; + + /**Specifies the position in customLabels + * @Default {null} + */ + position?: ScalesCustomLabelsPosition; + + /**Specifies the positionType in customLabels.See CustomLabelPositionType + * @Default {null} + */ + positionType?: any; + + /**Specifies the textAngle in customLabels + * @Default {0} + */ + textAngle?: number; + + /**Specifies the label Value in customLabels + */ + value?: string; +} + +export interface ScalesIndicatorsBorder { + + /**Specifies the border Color in bar indicators + * @Default {null} + */ + color?: string; + + /**Specifies the border Width in bar indicators + * @Default {1.5} + */ + width?: number; +} + +export interface ScalesIndicatorsFont { + + /**Specifies the fontFamily of font in bar indicators + * @Default {Arial} + */ + fontFamily?: string; + + /**Specifies the fontStyle of font in bar indicators. See FontStyle + * @Default {ej.datavisualization.LinearGauge.FontStyle.Bold} + */ + fontStyle?: ej.datavisualization.LinearGauge.FontStyle|string; + + /**Specifies the size of font in bar indicators + * @Default {11px} + */ + size?: string; +} + +export interface ScalesIndicatorsPosition { + + /**Specifies the x position in bar indicators + * @Default {0} + */ + x?: number; + + /**Specifies the y position in bar indicators + * @Default {0} + */ + y?: number; +} + +export interface ScalesIndicatorsStateRanges { + + /**Specifies the backgroundColor in bar indicators state ranges + * @Default {null} + */ + backgroundColor?: string; + + /**Specifies the borderColor in bar indicators state ranges + * @Default {null} + */ + borderColor?: string; + + /**Specifies the endValue in bar indicators state ranges + * @Default {60} + */ + endValue?: number; + + /**Specifies the startValue in bar indicators state ranges + * @Default {50} + */ + startValue?: number; + + /**Specifies the text in bar indicators state ranges + */ + text?: string; + + /**Specifies the textColor in bar indicators state ranges + * @Default {null} + */ + textColor?: string; +} + +export interface ScalesIndicatorsTextLocation { + + /**Specifies the textLocation position in bar indicators + * @Default {0} + */ + x?: number; + + /**Specifies the Y position in bar indicators + * @Default {0} + */ + y?: number; +} + +export interface ScalesIndicators { + + /**Specifies the backgroundColor in bar indicators + * @Default {null} + */ + backgroundColor?: string; + + /**Specifies the border in bar indicators + * @Default {null} + */ + border?: ScalesIndicatorsBorder; + + /**Specifies the font of bar indicators + * @Default {null} + */ + font?: ScalesIndicatorsFont; + + /**Specifies the indicator Height of bar indicators + * @Default {30} + */ + height?: number; + + /**Specifies the opacity in bar indicators + * @Default {NaN} + */ + opacity?: number; + + /**Specifies the position in bar indicators + * @Default {null} + */ + position?: ScalesIndicatorsPosition; + + /**Specifies the state ranges in bar indicators + * @Default {Array} + */ + stateRanges?: Array; + + /**Specifies the textLocation in bar indicators + * @Default {null} + */ + textLocation?: ScalesIndicatorsTextLocation; + + /**Specifies the indicator Style of font in bar indicators + * @Default {ej.datavisualization.LinearGauge.IndicatorType.Rectangle} + */ + type?: ej.datavisualization.LinearGauge.IndicatorTypes|string; + + /**Specifies the indicator Width in bar indicators + * @Default {30} + */ + width?: number; +} + +export interface ScalesLabelsDistanceFromScale { + + /**Specifies the xDistanceFromScale of labels. + * @Default {-10} + */ + x?: number; + + /**Specifies the yDistanceFromScale of labels. + * @Default {0} + */ + y?: number; +} + +export interface ScalesLabelsFont { + + /**Specifies the fontFamily of font. + * @Default {Arial} + */ + fontFamily?: string; + + /**Specifies the fontStyle of font.See FontStyle + * @Default {ej.datavisualization.LinearGauge.FontStyle.Bold} + */ + fontStyle?: ej.datavisualization.LinearGauge.FontStyle|string; + + /**Specifies the size of font. + * @Default {11px} + */ + size?: string; +} + +export interface ScalesLabels { + + /**Specifies the angle of labels. + * @Default {0} + */ + angle?: number; + + /**Specifies the DistanceFromScale of labels. + * @Default {null} + */ + distanceFromScale?: ScalesLabelsDistanceFromScale; + + /**Specifies the font of labels. + * @Default {null} + */ + font?: ScalesLabelsFont; + + /**need to includeFirstValue. + * @Default {true} + */ + includeFirstValue?: boolean; + + /**Specifies the opacity of label. + * @Default {0} + */ + opacity?: number; + + /**Specifies the label Placement of label. See LabelPlacement + * @Default {Near} + */ + placement?: ej.datavisualization.LinearGauge.PointerPlacement|string; + + /**Specifies the textColor of font. + * @Default {null} + */ + textColor?: string; + + /**Specifies the label Style of label. See LabelType + * @Default {ej.datavisualization.LinearGauge.LabelType.Major} + */ + type?: ej.datavisualization.LinearGauge.ScaleType|string; + + /**Specifies the unitText of label. + */ + unitText?: string; + + /**Specifies the unitText Position of label.See UnitTextPlacement + * @Default {Back} + */ + unitTextPlacement?: ej.datavisualization.LinearGauge.UnitTextPlacement|string; +} + +export interface ScalesMarkerPointersBorder { + + /**Specifies the border color of marker pointer + * @Default {null} + */ + color?: string; + + /**Specifies the border of marker pointer + * @Default {number} + */ + width?: number; +} + +export interface ScalesMarkerPointers { + + /**Specifies the backgroundColor of marker pointer + * @Default {null} + */ + backgroundColor?: string; + + /**Specifies the border of marker pointer + * @Default {null} + */ + border?: ScalesMarkerPointersBorder; + + /**Specifies the distanceFromScale of marker pointer + * @Default {0} + */ + distanceFromScale?: number; + + /**Specifies the pointer Gradient of marker pointer + * @Default {null} + */ + gradients?: any; + + /**Specifies the pointer Length of marker pointer + * @Default {30} + */ + length?: number; + + /**Specifies the opacity of marker pointer + * @Default {1} + */ + opacity?: number; + + /**Specifies the pointer Placement of marker pointer See PointerPlacement + * @Default {Far} + */ + placement?: ej.datavisualization.LinearGauge.PointerPlacement|string; + + /**Specifies the marker Style of marker pointerSee MarkerType + * @Default {Triangle} + */ + type?: ej.datavisualization.LinearGauge.MarkerType|string; + + /**Specifies the value of marker pointer + * @Default {null} + */ + value?: number; + + /**Specifies the pointer Width of marker pointer + * @Default {30} + */ + width?: number; +} + +export interface ScalesPosition { + + /**Specifies the Horizontal position + * @Default {50} + */ + x?: number; + + /**Specifies the vertical position + * @Default {50} + */ + y?: number; +} + +export interface ScalesRangesBorder { + + /**Specifies the border color in the ranges. + * @Default {null} + */ + color?: string; + + /**Specifies the border width in the ranges. + * @Default {1.5} + */ + width?: number; +} + +export interface ScalesRanges { + + /**Specifies the backgroundColor in the ranges. + * @Default {null} + */ + backgroundColor?: string; + + /**Specifies the border in the ranges. + * @Default {null} + */ + border?: ScalesRangesBorder; + + /**Specifies the distanceFromScale in the ranges. + * @Default {0} + */ + distanceFromScale?: number; + + /**Specifies the endValue in the ranges. + * @Default {60} + */ + endValue?: number; + + /**Specifies the endWidth in the ranges. + * @Default {10} + */ + endWidth?: number; + + /**Specifies the range Gradient in the ranges. + * @Default {null} + */ + gradients?: any; + + /**Specifies the opacity in the ranges. + * @Default {null} + */ + opacity?: number; + + /**Specifies the range Position in the ranges. See RangePlacement + * @Default {Center} + */ + placement?: ej.datavisualization.LinearGauge.PointerPlacement|string; + + /**Specifies the startValue in the ranges. + * @Default {20} + */ + startValue?: number; + + /**Specifies the startWidth in the ranges. + * @Default {10} + */ + startWidth?: number; +} + +export interface ScalesTicksDistanceFromScale { + + /**Specifies the xDistanceFromScale in the tick. + * @Default {0} + */ + x?: number; + + /**Specifies the yDistanceFromScale in the tick. + * @Default {0} + */ + y?: number; +} + +export interface ScalesTicks { + + /**Specifies the angle in the tick. + * @Default {0} + */ + angle?: number; + + /**Specifies the tick Color in the tick. + * @Default {null} + */ + color?: string; + + /**Specifies the DistanceFromScale in the tick. + * @Default {null} + */ + distanceFromScale?: ScalesTicksDistanceFromScale; + + /**Specifies the tick Height in the tick. + * @Default {10} + */ + height?: number; + + /**Specifies the opacity in the tick. + * @Default {0} + */ + opacity?: number; + + /**Specifies the tick Placement in the tick. See TickPlacement + * @Default {Near} + */ + placement?: ej.datavisualization.LinearGauge.PointerPlacement|string; + + /**Specifies the tick Style in the tick. See TickType + * @Default {MajorInterval} + */ + type?: ej.datavisualization.LinearGauge.TicksType|string; + + /**Specifies the tick Width in the tick. + * @Default {3} + */ + width?: number; +} + +export interface Scales { + + /**Specifies the backgroundColor of the Scale. + * @Default {null} + */ + backgroundColor?: string; + + /**Specifies the scaleBar Gradient of bar pointer + * @Default {Array} + */ + barPointers?: Array; + + /**Specifies the border of the Scale. + * @Default {null} + */ + border?: ScalesBorder; + + /**Specifies the customLabel + * @Default {Array} + */ + customLabels?: Array; + + /**Specifies the scale Direction of the Scale. See Directions + * @Default {CounterClockwise} + */ + direction?: ej.datavisualization.LinearGauge.Direction|string; + + /**Specifies the indicator + * @Default {Array} + */ + indicators?: Array; + + /**Specifies the labels. + * @Default {Array} + */ + labels?: Array; + + /**Specifies the scaleBar Length. + * @Default {290} + */ + length?: number; + + /**Specifies the majorIntervalValue of the Scale. + * @Default {10} + */ + majorIntervalValue?: number; + + /**Specifies the markerPointers + * @Default {Array} + */ + markerPointers?: Array; + + /**Specifies the maximum of the Scale. + * @Default {null} + */ + maximum?: number; + + /**Specifies the minimum of the Scale. + * @Default {null} + */ + minimum?: number; + + /**Specifies the minorIntervalValue of the Scale. + * @Default {2} + */ + minorIntervalValue?: number; + + /**Specifies the opacity of the Scale. + * @Default {NaN} + */ + opacity?: number; + + /**Specifies the position + * @Default {null} + */ + position?: ScalesPosition; + + /**Specifies the ranges in the tick. + * @Default {Array} + */ + ranges?: Array; + + /**Specifies the shadowOffset. + * @Default {0} + */ + shadowOffset?: number; + + /**Specifies the showBarPointers state. + * @Default {true} + */ + showBarPointers?: boolean; + + /**Specifies the showCustomLabels state. + * @Default {false} + */ + showCustomLabels?: boolean; + + /**Specifies the showIndicators state. + * @Default {false} + */ + showIndicators?: boolean; + + /**Specifies the showLabels state. + * @Default {true} + */ + showLabels?: boolean; + + /**Specifies the showMarkerPointers state. + * @Default {true} + */ + showMarkerPointers?: boolean; + + /**Specifies the showRanges state. + * @Default {false} + */ + showRanges?: boolean; + + /**Specifies the showTicks state. + * @Default {true} + */ + showTicks?: boolean; + + /**Specifies the ticks in the scale. + * @Default {Array} + */ + ticks?: Array; + + /**Specifies the scaleBar type .See ScaleType + * @Default {Rectangle} + */ + type?: ej.datavisualization.LinearGauge.ScaleType|string; + + /**Specifies the scaleBar width. + * @Default {30} + */ + width?: number; +} + +export interface Tooltip { + + /**Specify showCustomLabelTooltip value of linear gauge + * @Default {false} + */ + showCustomLabelTooltip?: boolean; + + /**Specify showLabelTooltip value of linear gauge + * @Default {false} + */ + showLabelTooltip?: boolean; + + /**Specify templateID value of linear gauge + * @Default {false} + */ + templateID?: string; +} +} +module LinearGauge +{ +enum OuterCustomLabelPosition +{ +//string +Left, +//string +Right, +//string +Top, +//string +Bottom, +} +} +module LinearGauge +{ +enum FontStyle +{ +//string +Bold, +//string +Italic, +//string +Regular, +//string +Strikeout, +//string +Underline, +} +} +module LinearGauge +{ +enum Direction +{ +//string +Clockwise, +//string +CounterClockwise, +} +} +module LinearGauge +{ +enum IndicatorTypes +{ +//string +Rectangle, +//string +Circle, +//string +RoundedRectangle, +//string +Text, +} +} +module LinearGauge +{ +enum PointerPlacement +{ +//string +Near, +//string +Far, +//string +Center, +} +} +module LinearGauge +{ +enum ScaleType +{ +//string +Major, +//string +Minor, +} +} +module LinearGauge +{ +enum UnitTextPlacement +{ +//string +Back, +//string +From, +} +} +module LinearGauge +{ +enum MarkerType +{ +//string +Rectangle, +//string +Triangle, +//string +Ellipse, +//string +Diamond, +//string +Pentagon, +//string +Circle, +//string +Star, +//string +Slider, +//string +Pointer, +//string +Wedge, +//string +Trapezoid, +//string +RoundedRectangle, +} +} +module LinearGauge +{ +enum TicksType +{ +//string +Majorinterval, +//string +Minorinterval, +} +} +module LinearGauge +{ +enum Themes +{ +//string +FlatLight, +//string +FlatDark, +} +} + +class CircularGauge extends ej.Widget { + static fn: CircularGauge; + constructor(element: JQuery, options?: CircularGauge.Model); + constructor(element: Element, options?: CircularGauge.Model); + model:CircularGauge.Model; + defaults:CircularGauge.Model; + + /** destroy the circular gauge widget. all events bound using this._on will be unbind automatically and bring the control to pre-init state. + * @returns {void} + */ + destroy(): void; + + /** To export Image + * @returns {void} + */ + exportImage(): void; + + /** To get BackNeedleLength + * @returns {void} + */ + getBackNeedleLength(): void; + + /** To get CustomLabelAngle + * @returns {void} + */ + getCustomLabelAngle(): void; + + /** To get CustomLabelValue + * @returns {void} + */ + getCustomLabelValue(): void; + + /** To get LabelAngle + * @returns {void} + */ + getLabelAngle(): void; + + /** To get LabelDistanceFromScale + * @returns {void} + */ + getLabelDistanceFromScale(): void; + + /** To get LabelPlacement + * @returns {void} + */ + getLabelPlacement(): void; + + /** To get LabelStyle + * @returns {void} + */ + getLabelStyle(): void; + + /** To get MajorIntervalValue + * @returns {void} + */ + getMajorIntervalValue(): void; + + /** To get MarkerDistanceFromScale + * @returns {void} + */ + getMarkerDistanceFromScale(): void; + + /** To get MarkerStyle + * @returns {void} + */ + getMarkerStyle(): void; + + /** To get MaximumValue + * @returns {void} + */ + getMaximumValue(): void; + + /** To get MinimumValue + * @returns {void} + */ + getMinimumValue(): void; + + /** To get MinorIntervalValue + * @returns {void} + */ + getMinorIntervalValue(): void; + + /** To get NeedleStyle + * @returns {void} + */ + getNeedleStyle(): void; + + /** To get PointerCapBorderWidth + * @returns {void} + */ + getPointerCapBorderWidth(): void; + + /** To get PointerCapRadius + * @returns {void} + */ + getPointerCapRadius(): void; + + /** To get PointerLength + * @returns {void} + */ + getPointerLength(): void; + + /** To get PointerNeedleType + * @returns {void} + */ + getPointerNeedleType(): void; + + /** To get PointerPlacement + * @returns {void} + */ + getPointerPlacement(): void; + + /** To get PointerValue + * @returns {void} + */ + getPointerValue(): void; + + /** To get PointerWidth + * @returns {void} + */ + getPointerWidth(): void; + + /** To get RangeBorderWidth + * @returns {void} + */ + getRangeBorderWidth(): void; + + /** To get RangeDistanceFromScale + * @returns {void} + */ + getRangeDistanceFromScale(): void; + + /** To get RangeEndValue + * @returns {void} + */ + getRangeEndValue(): void; + + /** To get RangePosition + * @returns {void} + */ + getRangePosition(): void; + + /** To get RangeSize + * @returns {void} + */ + getRangeSize(): void; + + /** To get RangeStartValue + * @returns {void} + */ + getRangeStartValue(): void; + + /** To get ScaleBarSize + * @returns {void} + */ + getScaleBarSize(): void; + + /** To get ScaleBorderWidth + * @returns {void} + */ + getScaleBorderWidth(): void; + + /** To get ScaleDirection + * @returns {void} + */ + getScaleDirection(): void; + + /** To get ScaleRadius + * @returns {void} + */ + getScaleRadius(): void; + + /** To get StartAngle + * @returns {void} + */ + getStartAngle(): void; + + /** To get SubGaugeLocation + * @returns {void} + */ + getSubGaugeLocation(): void; + + /** To get SweepAngle + * @returns {void} + */ + getSweepAngle(): void; + + /** To get TickAngle + * @returns {void} + */ + getTickAngle(): void; + + /** To get TickDistanceFromScale + * @returns {void} + */ + getTickDistanceFromScale(): void; + + /** To get TickHeight + * @returns {void} + */ + getTickHeight(): void; + + /** To get TickPlacement + * @returns {void} + */ + getTickPlacement(): void; + + /** To get TickStyle + * @returns {void} + */ + getTickStyle(): void; + + /** To get TickWidth + * @returns {void} + */ + getTickWidth(): void; + + /** To set includeFirstValue + * @returns {void} + */ + includeFirstValue(): void; + + /** Switching the redraw option for the gauge + * @returns {void} + */ + redraw(): void; + + /** To set BackNeedleLength + * @returns {void} + */ + setBackNeedleLength(): void; + + /** To set CustomLabelAngle + * @returns {void} + */ + setCustomLabelAngle(): void; + + /** To set CustomLabelValue + * @returns {void} + */ + setCustomLabelValue(): void; + + /** To set LabelAngle + * @returns {void} + */ + setLabelAngle(): void; + + /** To set LabelDistanceFromScale + * @returns {void} + */ + setLabelDistanceFromScale(): void; + + /** To set LabelPlacement + * @returns {void} + */ + setLabelPlacement(): void; + + /** To set LabelStyle + * @returns {void} + */ + setLabelStyle(): void; + + /** To set MajorIntervalValue + * @returns {void} + */ + setMajorIntervalValue(): void; + + /** To set MarkerDistanceFromScale + * @returns {void} + */ + setMarkerDistanceFromScale(): void; + + /** To set MarkerStyle + * @returns {void} + */ + setMarkerStyle(): void; + + /** To set MaximumValue + * @returns {void} + */ + setMaximumValue(): void; + + /** To set MinimumValue + * @returns {void} + */ + setMinimumValue(): void; + + /** To set MinorIntervalValue + * @returns {void} + */ + setMinorIntervalValue(): void; + + /** To set NeedleStyle + * @returns {void} + */ + setNeedleStyle(): void; + + /** To set PointerCapBorderWidth + * @returns {void} + */ + setPointerCapBorderWidth(): void; + + /** To set PointerCapRadius + * @returns {void} + */ + setPointerCapRadius(): void; + + /** To set PointerLength + * @returns {void} + */ + setPointerLength(): void; + + /** To set PointerNeedleType + * @returns {void} + */ + setPointerNeedleType(): void; + + /** To set PointerPlacement + * @returns {void} + */ + setPointerPlacement(): void; + + /** To set PointerValue + * @returns {void} + */ + setPointerValue(): void; + + /** To set PointerWidth + * @returns {void} + */ + setPointerWidth(): void; + + /** To set RangeBorderWidth + * @returns {void} + */ + setRangeBorderWidth(): void; + + /** To set RangeDistanceFromScale + * @returns {void} + */ + setRangeDistanceFromScale(): void; + + /** To set RangeEndValue + * @returns {void} + */ + setRangeEndValue(): void; + + /** To set RangePosition + * @returns {void} + */ + setRangePosition(): void; + + /** To set RangeSize + * @returns {void} + */ + setRangeSize(): void; + + /** To set RangeStartValue + * @returns {void} + */ + setRangeStartValue(): void; + + /** To set ScaleBarSize + * @returns {void} + */ + setScaleBarSize(): void; + + /** To set ScaleBorderWidth + * @returns {void} + */ + setScaleBorderWidth(): void; + + /** To set ScaleDirection + * @returns {void} + */ + setScaleDirection(): void; + + /** To set ScaleRadius + * @returns {void} + */ + setScaleRadius(): void; + + /** To set StartAngle + * @returns {void} + */ + setStartAngle(): void; + + /** To set SubGaugeLocation + * @returns {void} + */ + setSubGaugeLocation(): void; + + /** To set SweepAngle + * @returns {void} + */ + setSweepAngle(): void; + + /** To set TickAngle + * @returns {void} + */ + setTickAngle(): void; + + /** To set TickDistanceFromScale + * @returns {void} + */ + setTickDistanceFromScale(): void; + + /** To set TickHeight + * @returns {void} + */ + setTickHeight(): void; + + /** To set TickPlacement + * @returns {void} + */ + setTickPlacement(): void; + + /** To set TickStyle + * @returns {void} + */ + setTickStyle(): void; + + /** To set TickWidth + * @returns {void} + */ + setTickWidth(): void; +} +export module CircularGauge{ + +export interface Model { + + /**Specifies animationSpeed of circular gauge + * @Default {500} + */ + animationSpeed?: number; + + /**Specifies the background color of circular gauge. + * @Default {null} + */ + backgroundColor?: string; + + /**Specify distanceFromCorner value of circular gauge + * @Default {center} + */ + distanceFromCorner?: number; + + /**Specify animate value of circular gauge + * @Default {true} + */ + enableAnimation?: boolean; + + /**Specify enableResize value of circular gauge + * @Default {false} + */ + enableResize?: boolean; + + /**Specify the frame of circular gauge + * @Default {Object} + */ + frame?: Frame; + + /**Specify gaugePosition value of circular gauge See GaugePosition + * @Default {center} + */ + gaugePosition?: ej.datavisualization.CircularGauge.gaugePosition|string; + + /**Specifies the height of circular gauge. + * @Default {360} + */ + height?: number; + + /**Specifies the interiorGradient of circular gauge. + * @Default {null} + */ + interiorGradient?: any; + + /**Specify isRadialGradient value of circular gauge + * @Default {false} + */ + isRadialGradient?: boolean; + + /**Specifies the maximum value of circular gauge. + * @Default {100} + */ + maximum?: number; + + /**Specifies the minimum value of circular gauge. + * @Default {0} + */ + minimum?: number; + + /**Specify outerCustomLabelPosition value of circular gauge See OuterCustomLabelPosition + * @Default {bottom} + */ + outerCustomLabelPosition?: ej.datavisualization.CircularGauge.CustomLabelPositionType|string; + + /**Specifies the radius of circular gauge. + * @Default {180} + */ + radius?: number; + + /**Specify readonly value of circular gauge + * @Default {true} + */ + readOnly?: boolean; + + /**Specify the pointers, ticks, labels, indicators, ranges of circular gauge + * @Default {null} + */ + scales?: Scales; + + /**Specify the theme of circular gauge. + * @Default {flatlight} + */ + theme?: string; + + /**Specify tooltip option of circular gauge + * @Default {object} + */ + tooltip?: Tooltip; + + /**Specifies the value of circular gauge. + * @Default {0} + */ + value?: number; + + /**Specifies the width of circular gauge. + * @Default {360} + */ + width?: number; + + /**Triggers while the custom labels are being drawn on the gauge.*/ + drawCustomLabel? (e: DrawCustomLabelEventArgs): void; + + /**Triggers while the indicators are being started to drawn on the gauge.*/ + drawIndicators? (e: DrawIndicatorsEventArgs): void; + + /**Triggers while the labels are being drawn on the gauge.*/ + drawLabels? (e: DrawLabelsEventArgs): void; + + /**Triggers while the pointer cap is being drawn on the gauge.*/ + drawPointerCap? (e: DrawPointerCapEventArgs): void; + + /**Triggers while the pointers are being drawn on the gauge.*/ + drawPointers? (e: DrawPointersEventArgs): void; + + /**Triggers when the ranges begin to be getting drawn on the gauge.*/ + drawRange? (e: DrawRangeEventArgs): void; + + /**Triggers while the ticks are being drawn on the gauge.*/ + drawTicks? (e: DrawTicksEventArgs): void; + + /**Triggers while the gauge start to Load.*/ + load? (e: LoadEventArgs): void; + + /**Triggers when the left mouse button is clicked.*/ + mouseClick? (e: MouseClickEventArgs): void; + + /**Triggers when clicking and dragging the mouse pointer over the gauge pointer.*/ + mouseClickMove? (e: MouseClickMoveEventArgs): void; + + /**Triggers when the mouse click is released.*/ + mouseClickUp? (e: MouseClickUpEventArgs): void; + + /**Triggers when the rendering of the gauge is completed.*/ + renderComplete? (e: RenderCompleteEventArgs): void; +} + +export interface DrawCustomLabelEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the startX and startY of the custom label + */ + position?: any; + + /**returns the gauge model + */ + model?: any; + + /**returns the options of the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the custom label belongs. + */ + scaleIndex?: number; + + /**returns the custom label style + */ + style?: string; + + /**returns the current custom label element. + */ + customLabelElement?: any; + + /**returns the index of the custom label. + */ + customLabelIndex?: number; + + /**returns the name of the event + */ + type?: string; +} + +export interface DrawIndicatorsEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the startX and startY of the indicator + */ + position?: any; + + /**returns the gauge model + */ + model?: any; + + /**returns the options of the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the indicator belongs. + */ + scaleIndex?: number; + + /**returns the indicator style + */ + style?: string; + + /**returns the current indicator element. + */ + indicatorElement?: any; + + /**returns the index of the indicator. + */ + indicatorIndex?: number; + + /**returns the name of the event + */ + type?: string; +} + +export interface DrawLabelsEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the startX and startY of the labels + */ + position?: any; + + /**returns the gauge model + */ + model?: any; + + /**returns the options of the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the label belongs. + */ + scaleIndex?: number; + + /**returns the label style + */ + style?: string; + + /**returns the angle of the labels. + */ + angle?: number; + + /**returns the current label element. + */ + element?: any; + + /**returns the index of the label. + */ + index?: number; + + /**returns the value of the label. + */ + pointerValue?: number; + + /**returns the name of the event + */ + type?: string; +} + +export interface DrawPointerCapEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the options of the scale element. + */ + scaleElement?: any; + + /**returns the startX and startY of the pointer cap. + */ + position?: any; + + /**returns the gauge model + */ + model?: any; + + /**returns the pointer cap style + */ + style?: string; + + /**returns the name of the event + */ + type?: string; +} + +export interface DrawPointersEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the startX and startY of the pointer + */ + position?: any; + + /**returns the gauge model + */ + model?: any; + + /**returns the options of the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the pointer belongs. + */ + scaleIndex?: number; + + /**returns the pointer style + */ + style?: string; + + /**returns the angle of the pointer. + */ + angle?: number; + + /**returns the current pointer element. + */ + element?: any; + + /**returns the index of the pointer. + */ + index?: number; + + /**returns the value of the pointer. + */ + value?: number; + + /**returns the name of the event + */ + type?: string; +} + +export interface DrawRangeEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the startX and startY of the range + */ + position?: any; + + /**returns the gauge model + */ + model?: any; + + /**returns the options of the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the range belongs. + */ + scaleIndex?: number; + + /**returns the range style + */ + style?: string; + + /**returns the current range element. + */ + rangeElement?: any; + + /**returns the index of the range. + */ + rangeIndex?: number; + + /**returns the name of the event + */ + type?: string; +} + +export interface DrawTicksEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the startX and startY of the ticks + */ + position?: any; + + /**returns the gauge model + */ + model?: any; + + /**returns the options of the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the tick belongs. + */ + scaleIndex?: number; + + /**returns the ticks style + */ + style?: string; + + /**returns the angle of the tick. + */ + angle?: number; + + /**returns the current tick element. + */ + element?: any; + + /**returns the index of the tick. + */ + index?: number; + + /**returns the label value of the tick. + */ + pointerValue?: number; + + /**returns the name of the event + */ + type?: string; +} + +export interface LoadEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the gauge model + */ + Model?: any; + + /**returns the entire scale element. + */ + scaleElement?: any; + + /**returns the context element + */ + context?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface MouseClickEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the gauge model + */ + model?: any; + + /**returns the name of the event + */ + type?: any; + + /**returns the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the pointer belongs. + */ + scaleIndex?: number; + + /**returns the context element + */ + context?: any; + + /**returns the pointer Index + */ + index?: number; + + /**returns the pointer element. + */ + element?: any; + + /**returns the value of the pointer. + */ + value?: number; + + /**returns the angle of the pointer. + */ + angle?: number; + + /**returns the pointer style + */ + style?: string; + + /**returns the startX and startY of the pointer. + */ + position?: any; +} + +export interface MouseClickMoveEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the gauge model + */ + model?: any; + + /**returns the name of the event + */ + type?: any; + + /**returns the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the pointer belongs. + */ + scaleIndex?: number; + + /**returns the context element + */ + context?: any; + + /**returns the pointer Index + */ + index?: number; + + /**returns the pointer element. + */ + element?: any; + + /**returns the value of the pointer. + */ + value?: number; + + /**returns the angle of the pointer. + */ + angle?: number; + + /**returns the pointer style + */ + style?: string; + + /**returns the startX and startY of the pointer. + */ + position?: any; +} + +export interface MouseClickUpEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the gauge model + */ + model?: any; + + /**returns the name of the event + */ + type?: any; + + /**returns the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the pointer belongs. + */ + scaleIndex?: number; + + /**returns the context element + */ + context?: any; + + /**returns the pointer Index + */ + index?: number; + + /**returns the pointer element. + */ + element?: any; + + /**returns the value of the pointer. + */ + value?: number; + + /**returns the angle of the pointer. + */ + angle?: number; + + /**returns the pointer style + */ + style?: string; + + /**returns the startX and startY of the pointer. + */ + position?: any; +} + +export interface RenderCompleteEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the entire scale element. + */ + scaleElement?: any; + + /**returns the gauge model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface Frame { + + /**Specify the url of the frame background image for circular gauge + * @Default {null} + */ + backgroundImageUrl?: string; + + /**Specifies the frameType of circular gauge. See Frame + * @Default {FullCircle} + */ + frameType?: ej.datavisualization.CircularGauge.FrameType|string; + + /**Specifies the end angle for the half circular frame. + * @Default {360} + */ + halfCircleFrameEndAngle?: number; + + /**Specifies the start angle for the half circular frame. + * @Default {180} + */ + halfCircleFrameStartAngle?: number; +} + +export interface ScalesBorder { + + /**Specify border color for scales of circular gauge + * @Default {null} + */ + color?: string; + + /**Specify border width of circular gauge + * @Default {1.5} + */ + width?: number; +} + +export interface ScalesIndicatorsPosition { + + /**Specify x-axis of position of circular gauge + * @Default {0} + */ + x?: number; + + /**Specify y-axis of position of circular gauge + * @Default {0} + */ + y?: number; +} + +export interface ScalesIndicatorsStateRanges { + + /**Specify backgroundColor for indicator of circular gauge + * @Default {null} + */ + backgroundColor?: string; + + /**Specify borderColor for indicator of circular gauge + * @Default {null} + */ + borderColor?: string; + + /**Specify end value for each specified state of circular gauge + * @Default {0} + */ + endValue?: number; + + /**Specify value of the font as the indicator when the indicator style is set with the value "text" of circular gauge + * @Default {null} + */ + font?: any; + + /**Specify start value for each specified state of circular gauge + * @Default {0} + */ + startValue?: number; + + /**Specify value of the text as the indicator when the indicator style is set with the value "text" of circular gauge + */ + text?: string; + + /**Specify value of the textColor as the indicator when the indicator style is set with the value "text" of circular gauge + * @Default {null} + */ + textColor?: string; +} + +export interface ScalesIndicators { + + /**Specify indicator height of circular gauge + * @Default {15} + */ + height?: number; + + /**Specify imageUrl of circular gauge + * @Default {null} + */ + imageUrl?: string; + + /**Specify position of circular gauge + * @Default {Object} + */ + position?: ScalesIndicatorsPosition; + + /**Specify the various states of circular gauge + * @Default {Array} + */ + stateRanges?: Array; + + /**Specify indicator style of circular gauge. See IndicatorType + * @Default {Circle} + */ + type?: ej.datavisualization.CircularGauge.IndicatorTypes|string; + + /**Specify indicator width of circular gauge + * @Default {15} + */ + width?: number; +} + +export interface ScalesLabelsFont { + + /**Specify font fontFamily for labels of circular gauge + * @Default {Arial} + */ + fontFamily?: string; + + /**Specify font Style for labels of circular gauge + * @Default {Bold} + */ + fontStyle?: string; + + /**Specify font size for labels of circular gauge + * @Default {11px} + */ + size?: string; +} + +export interface ScalesLabels { + + /**Specify the angle for the labels of circular gauge + * @Default {0} + */ + angle?: number; + + /**Specify labels autoAngle value of circular gauge + * @Default {false} + */ + autoAngle?: boolean; + + /**Specify label color of circular gauge + * @Default {null} + */ + color?: string; + + /**Specify distanceFromScale value for labels of circular gauge + * @Default {0} + */ + distanceFromScale?: number; + + /**Specify font for labels of circular gauge + * @Default {Object} + */ + font?: ScalesLabelsFont; + + /**Specify includeFirstValue of circular gauge + * @Default {true} + */ + includeFirstValue?: boolean; + + /**Specify opacity value for labels of circular gauge + * @Default {null} + */ + opacity?: number; + + /**Specify label placement of circular gauge. See LabelPlacement + * @Default {Near} + */ + placement?: ej.datavisualization.CircularGauge.Placement|string; + + /**Specify label Style of circular gauge. See LabelType + * @Default {Major} + */ + type?: ej.datavisualization.CircularGauge.LabelType|string; + + /**Specify unitText of circular gauge + */ + unitText?: string; + + /**Specify unitTextPosition of circular gauge. See UnitTextPosition + * @Default {Back} + */ + unitTextPosition?: ej.datavisualization.CircularGauge.UnitTextPlacement|string; +} + +export interface ScalesPointerCap { + + /**Specify cap backgroundColor of circular gauge + * @Default {null} + */ + backgroundColor?: string; + + /**Specify cap borderColor of circular gauge + * @Default {null} + */ + borderColor?: string; + + /**Specify pointerCap borderWidth value of circular gauge + * @Default {3} + */ + borderWidth?: number; + + /**Specify cap interiorGradient value of circular gauge + * @Default {null} + */ + interiorGradient?: any; + + /**Specify pointerCap Radius value of circular gauge + * @Default {7} + */ + radius?: number; +} + +export interface ScalesPointersBorder { + + /**Specify border color for pointer of circular gauge + * @Default {null} + */ + color?: string; + + /**Specify border width for pointers of circular gauge + * @Default {1.5} + */ + width?: number; +} + +export interface ScalesPointersPointerValueTextFont { + + /**Specify pointer value text font family of circular gauge. + * @Default {Arial} + */ + fontFamily?: string; + + /**Specify pointer value text font style of circular gauge. + * @Default {Bold} + */ + fontStyle?: string; + + /**Specify pointer value text size of circular gauge. + * @Default {11px} + */ + size?: string; +} + +export interface ScalesPointersPointerValueText { + + /**Specify pointer text angle of circular gauge. + * @Default {0} + */ + angle?: number; + + /**Specify pointer text auto angle of circular gauge. + * @Default {false} + */ + autoAngle?: boolean; + + /**Specify pointer value text color of circular gauge. + * @Default {#8c8c8c} + */ + color?: string; + + /**Specify pointer value text distance from pointer of circular gauge. + * @Default {20} + */ + distance?: number; + + /**Specify pointer value text font option of circular gauge. + * @Default {object} + */ + font?: ScalesPointersPointerValueTextFont; + + /**Specify pointer value text opacity of circular gauge. + * @Default {1} + */ + opacity?: number; + + /**enable pointer value text visibility of circular gauge. + * @Default {false} + */ + showValue?: boolean; +} + +export interface ScalesPointers { + + /**Specify backgroundColor for the pointer of circular gauge + * @Default {null} + */ + backgroundColor?: string; + + /**Specify backNeedleLength of circular gauge + * @Default {10} + */ + backNeedleLength?: number; + + /**Specify the border for pointers of circular gauge + * @Default {Object} + */ + border?: ScalesPointersBorder; + + /**Specify distanceFromScale value for pointers of circular gauge + * @Default {0} + */ + distanceFromScale?: number; + + /**Specify pointer gradients of circular gauge + * @Default {null} + */ + gradients?: any; + + /**Specify pointer image of circular gauge.It is applicable for both marker as well as needle type pointers. + * @Default {NULL} + */ + imageUrl?: string; + + /**Specify pointer length of circular gauge + * @Default {150} + */ + length?: number; + + /**Specify marker Style value of circular gauge. See MarkerType + * @Default {Rectangle} + */ + markerType?: ej.datavisualization.CircularGauge.MarkerType|string; + + /**Specify needle Style value of circular gauge. See NeedleType + * @Default {Triangle} + */ + needleType?: ej.datavisualization.CircularGauge.NeedleType|string; + + /**Specify opacity value for pointer of circular gauge + * @Default {1} + */ + opacity?: number; + + /**Specify pointer Placement value of circular gauge. See PointerPlacement + * @Default {Near} + */ + placement?: ej.datavisualization.CircularGauge.Placement|string; + + /**Specify pointer value text of circular gauge. + * @Default {Object} + */ + pointerValueText?: ScalesPointersPointerValueText; + + /**Specify showBackNeedle value of circular gauge + * @Default {false} + */ + showBackNeedle?: boolean; + + /**Specify pointer type value of circular gauge. See PointerType + * @Default {Needle} + */ + type?: ej.datavisualization.CircularGauge.PointerType|string; + + /**Specify value of the pointer of circular gauge + * @Default {null} + */ + value?: number; + + /**Specify pointer width of circular gauge + * @Default {7} + */ + width?: number; +} + +export interface ScalesRangesBorder { + + /**Specify border color for ranges of circular gauge + * @Default {#32b3c6} + */ + color?: string; + + /**Specify border width for ranges of circular gauge + * @Default {1.5} + */ + width?: number; +} + +export interface ScalesRanges { + + /**Specify backgroundColor for the ranges of circular gauge + * @Default {#32b3c6} + */ + backgroundColor?: string; + + /**Specify border for ranges of circular gauge + * @Default {Object} + */ + border?: ScalesRangesBorder; + + /**Specify distanceFromScale value for ranges of circular gauge + * @Default {25} + */ + distanceFromScale?: number; + + /**Specify endValue for ranges of circular gauge + * @Default {null} + */ + endValue?: number; + + /**Specify endWidth for ranges of circular gauge + * @Default {10} + */ + endWidth?: number; + + /**Specify range gradients of circular gauge + * @Default {null} + */ + gradients?: any; + + /**Specify opacity value for ranges of circular gauge + * @Default {null} + */ + opacity?: number; + + /**Specify placement of circular gauge. See RangePlacement + * @Default {Near} + */ + placement?: ej.datavisualization.CircularGauge.Placement|string; + + /**Specify size of the range value of circular gauge + * @Default {5} + */ + size?: number; + + /**Specify startValue for ranges of circular gauge + * @Default {null} + */ + startValue?: number; + + /**Specify startWidth of circular gauge + * @Default {[Array.number] scale.ranges.startWidth = 10} + */ + startWidth?: number; +} + +export interface ScalesSubGaugesPosition { + + /**Specify x-axis position for sub-gauge of circular gauge + * @Default {0} + */ + x?: number; + + /**Specify y-axis position for sub-gauge of circular gauge + * @Default {0} + */ + y?: number; +} + +export interface ScalesSubGauges { + + /**Specify subGauge Height of circular gauge + * @Default {150} + */ + height?: number; + + /**Specify position for sub-gauge of circular gauge + * @Default {Object} + */ + position?: ScalesSubGaugesPosition; + + /**Specify subGauge Width of circular gauge + * @Default {150} + */ + width?: number; +} + +export interface ScalesTicks { + + /**Specify the angle for the ticks of circular gauge + * @Default {0} + */ + angle?: number; + + /**Specify tick color of circular gauge + * @Default {null} + */ + color?: string; + + /**Specify distanceFromScale value for ticks of circular gauge + * @Default {0} + */ + distanceFromScale?: number; + + /**Specify tick height of circular gauge + * @Default {16} + */ + height?: number; + + /**Specify tick placement of circular gauge. See TickPlacement + * @Default {Near} + */ + placement?: ej.datavisualization.CircularGauge.Placement|string; + + /**Specify tick Style of circular gauge. See TickType + * @Default {Major} + */ + type?: ej.datavisualization.CircularGauge.LabelType|string; + + /**Specify tick width of circular gauge + * @Default {3} + */ + width?: number; +} + +export interface Scales { + + /**Specify backgroundColor for the scale of circular gauge + * @Default {null} + */ + backgroundColor?: string; + + /**Specify border for scales of circular gauge + * @Default {Object} + */ + border?: ScalesBorder; + + /**Specify scale direction of circular gauge. See Directions + * @Default {Clockwise} + */ + direction?: ej.datavisualization.CircularGauge.Direction|string; + + /**Specify representing state of circular gauge + * @Default {Array} + */ + indicators?: Array; + + /**Specify the text values displayed in a meaningful manner alongside the ticks of circular gauge + * @Default {Array} + */ + labels?: Array; + + /**Specify majorIntervalValue of circular gauge + * @Default {10} + */ + majorIntervalValue?: number; + + /**Specify maximum scale value of circular gauge + * @Default {null} + */ + maximum?: number; + + /**Specify minimum scale value of circular gauge + * @Default {null} + */ + minimum?: number; + + /**Specify minorIntervalValue of circular gauge + * @Default {2} + */ + minorIntervalValue?: number; + + /**Specify opacity value of circular gauge + * @Default {1} + */ + opacity?: number; + + /**Specify pointer cap of circular gauge + * @Default {Object} + */ + pointerCap?: ScalesPointerCap; + + /**Specify pointers value of circular gauge + * @Default {Array} + */ + pointers?: Array; + + /**Specify scale radius of circular gauge + * @Default {170} + */ + radius?: number; + + /**Specify ranges value of circular gauge + * @Default {Array} + */ + ranges?: Array; + + /**Specify shadowOffset value of circular gauge + * @Default {0} + */ + shadowOffset?: number; + + /**Specify showIndicators of circular gauge + * @Default {false} + */ + showIndicators?: boolean; + + /**Specify showLabels of circular gauge + * @Default {true} + */ + showLabels?: boolean; + + /**Specify showPointers of circular gauge + * @Default {true} + */ + showPointers?: boolean; + + /**Specify showRanges of circular gauge + * @Default {false} + */ + showRanges?: boolean; + + /**Specify showScaleBar of circular gauge + * @Default {false} + */ + showScaleBar?: boolean; + + /**Specify showTicks of circular gauge + * @Default {true} + */ + showTicks?: boolean; + + /**Specify scaleBar size of circular gauge + * @Default {6} + */ + size?: number; + + /**Specify startAngle of circular gauge + * @Default {115} + */ + startAngle?: number; + + /**Specify subGauge of circular gauge + * @Default {Array} + */ + subGauges?: Array; + + /**Specify sweepAngle of circular gauge + * @Default {310} + */ + sweepAngle?: number; + + /**Specify ticks of circular gauge + * @Default {Array} + */ + ticks?: Array; +} + +export interface Tooltip { + + /**enable showCustomLabelTooltip of circular gauge + * @Default {false} + */ + showCustomLabelTooltip?: boolean; + + /**enable showLabelTooltip of circular gauge + * @Default {false} + */ + showLabelTooltip?: boolean; + + /**Specify tooltip templateID of circular gauge + * @Default {false} + */ + templateID?: string; +} +} +module CircularGauge +{ +enum FrameType +{ +//string +FullCircle, +//string +HalfCircle, +} +} +module CircularGauge +{ +enum gaugePosition +{ +//string +TopLeft, +//string +TopRight, +//string +TopCenter, +//string +MiddleLeft, +//string +MiddleRight, +//string +Center, +//string +BottomLeft, +//string +BottomRight, +//string +BottomCenter, +} +} +module CircularGauge +{ +enum CustomLabelPositionType +{ +//string +Top, +//string +Bottom, +//string +Right, +//string +Left, +} +} +module CircularGauge +{ +enum Direction +{ +//string +Clockwise, +//string +CounterClockwise, +} +} +module CircularGauge +{ +enum IndicatorTypes +{ +//string +Rectangle, +//string +Circle, +//string +Text, +//string +RoundedRectangle, +//string +Image, +} +} +module CircularGauge +{ +enum Placement +{ +//string +Near, +//string +Far, +} +} +module CircularGauge +{ +enum LabelType +{ +//string +Major, +//string +Minor, +} +} +module CircularGauge +{ +enum UnitTextPlacement +{ +//string +Back, +//string +Front, +} +} +module CircularGauge +{ +enum MarkerType +{ +//string +Rectangle, +//string +Circle, +//string +Triangle, +//string +Ellipse, +//string +Diamond, +//string +Pentagon, +//string +Slider, +//string +Pointer, +//string +Wedge, +//string +Trapezoid, +//string +RoundedRectangle, +//string +Image, +} +} +module CircularGauge +{ +enum NeedleType +{ +//string +Triangle, +//string +Rectangle, +//string +Arrow, +//string +Image, +//string +Trapezoid, +} +} +module CircularGauge +{ +enum PointerType +{ +//string +Needle, +//string +Marker, +} +} + +class DigitalGauge extends ej.Widget { + static fn: DigitalGauge; + constructor(element: JQuery, options?: DigitalGauge.Model); + constructor(element: Element, options?: DigitalGauge.Model); + model:DigitalGauge.Model; + defaults:DigitalGauge.Model; + + /** To destroy the digital gauge + * @returns {void} + */ + destroy(): void; + + /** To export Digital Gauge as Image + * @param {string} fileName for the Image + * @param {string} fileType for the Image + * @returns {void} + */ + exportImage(fileName: string, fileType: string): void; + + /** Gets the location of an item that is displayed on the gauge. + * @param {number} Position value of an item that is displayed on the gauge. + * @returns {void} + */ + getPosition(itemIndex: number): void; + + /** ClientSideMethod getValue Gets the value of an item that is displayed on the gauge + * @param {number} Index value of an item that displayed on the gauge + * @returns {void} + */ + getValue(itemIndex: number): void; + + /** Refresh the digital gauge widget + * @returns {void} + */ + refresh(): void; + + /** ClientSideMethod Set Position Sets the location of an item to be displayed in the gauge + * @param {number} Index value of the digital gauge item + * @param {any} Location value of the digital gauge + * @returns {void} + */ + setPosition(itemIndex: number, value: any): void; + + /** ClientSideMethod SetValue Sets the value of an item to be displayed in the gauge. + * @param {number} Index value of the digital gauge item + * @param {string} Text value to be displayed in the gaugeS + * @returns {void} + */ + setValue(itemIndex: number, value: string): void; +} +export module DigitalGauge{ + +export interface Model { + + /**Specifies the resize option of the DigitalGauge. + * @Default {false} + */ + enableResize?: boolean; + + /**Specifies the frame of the Digital gauge. + * @Default {{backgroundImageUrl: null, innerWidth: 6, outerWidth: 10}} + */ + frame?: Frame; + + /**Specifies the height of the DigitalGauge. + * @Default {150} + */ + height?: number; + + /**Specifies the items for the DigitalGauge. + * @Default {null} + */ + items?: Items; + + /**Specifies the matrixSegmentData for the DigitalGauge. + */ + matrixSegmentData?: any; + + /**Specifies the segmentData for the DigitalGauge. + */ + segmentData?: any; + + /**Specifies the themes for the Digital gauge. See Themes + * @Default {flatlight} + */ + themes?: string; + + /**Specifies the value to the DigitalGauge. + * @Default {text} + */ + value?: string; + + /**Specifies the width for the Digital gauge. + * @Default {400} + */ + width?: number; + + /**Triggers when the gauge is initialized.*/ + init? (e: InitEventArgs): void; + + /**Triggers when the gauge item rendering.*/ + itemRendering? (e: ItemRenderingEventArgs): void; + + /**Triggers when the gauge is start to load.*/ + load? (e: LoadEventArgs): void; + + /**Triggers when the gauge render is completed.*/ + renderComplete? (e: RenderCompleteEventArgs): void; +} + +export interface InitEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the all the options of the items. + */ + items?: any; + + /**returns the context element + */ + context?: any; + + /**returns the gauge model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface ItemRenderingEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the all the options of the items. + */ + items?: any; + + /**returns the context element + */ + context?: any; + + /**returns the gauge model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface LoadEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the all the options of the items. + */ + items?: any; + + /**returns the context element + */ + context?: any; + + /**returns the gauge model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface RenderCompleteEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the all the options of the items. + */ + items?: any; + + /**returns the context element + */ + context?: any; + + /**returns the gauge model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface Frame { + + /**Specifies the url of an image to be displayed as background of the Digital gauge. + * @Default {null} + */ + backgroundImageUrl?: string; + + /**Specifies the inner width for the frame, when the background image has been set for the Digital gauge.. + * @Default {6} + */ + innerWidth?: number; + + /**Specifies the outer width of the frame, when the background image has been set for the Digital gauge. + * @Default {10} + */ + outerWidth?: number; +} + +export interface ItemsCharacterSettings { + + /**Specifies the CharacterCount value for the DigitalGauge. + * @Default {4} + */ + count?: number; + + /**Specifies the opacity value for the DigitalGauge. + * @Default {1} + */ + opacity?: number; + + /**Specifies the value for spacing between the characters + * @Default {2} + */ + spacing?: number; + + /**Specifies the character type for the text to be displayed. + * @Default {ej.datavisualization.DigitalGauge.CharacterType.EightCrossEightDotMatrix} + */ + type?: ej.datavisualization.DigitalGauge.CharacterType|string; +} + +export interface ItemsFont { + + /**Set the font family value + * @Default {Arial} + */ + fontFamily?: string; + + /**Set the font style for the font + * @Default {italic} + */ + fontStyle?: ej.datavisualization.DigitalGauge.FontStyle|string; + + /**Set the font size value + * @Default {11px} + */ + size?: string; +} + +export interface ItemsPosition { + + /**Set the horizontal location for the text, where it needs to be placed within the gauge. + * @Default {0} + */ + x?: number; + + /**Set the vertical location for the text, where it needs to be placed within the gauge. + * @Default {0} + */ + y?: number; +} + +export interface ItemsSegmentSettings { + + /**Set the color for the text segments. + * @Default {null} + */ + color?: string; + + /**Set the gradient for the text segments. + * @Default {null} + */ + gradient?: any; + + /**Set the length for the text segments. + * @Default {2} + */ + length?: number; + + /**Set the opacity for the text segments. + * @Default {0} + */ + opacity?: number; + + /**Set the spacing for the text segments. + * @Default {1} + */ + spacing?: number; + + /**Set the width for the text segments. + * @Default {1} + */ + width?: number; +} + +export interface Items { + + /**Specifies the Character settings for the DigitalGauge. + * @Default {null} + */ + characterSettings?: ItemsCharacterSettings; + + /**Enable/Disable the custom font to be applied to the text in the gauge. + * @Default {false} + */ + enableCustomFont?: boolean; + + /**Set the specific font for the text, when the enableCustomFont is set to true + * @Default {null} + */ + font?: ItemsFont; + + /**Set the location for the text, where it needs to be placed within the gauge. + * @Default {null} + */ + position?: ItemsPosition; + + /**Set the segment settings for the digital gauge. + * @Default {null} + */ + segmentSettings?: ItemsSegmentSettings; + + /**Set the value for enabling/disabling the blurring effect for the shadows of the text + * @Default {0} + */ + shadowBlur?: number; + + /**Specifies the color of the text shadow. + * @Default {null} + */ + shadowColor?: string; + + /**Set the x offset value for the shadow of the text, indicating the location where it needs to be displayed. + * @Default {1} + */ + shadowOffsetX?: number; + + /**Set the y offset value for the shadow of the text, indicating the location where it needs to be displayed. + * @Default {1} + */ + shadowOffsetY?: number; + + /**Set the alignment of the text that is displayed within the gauge.See TextAlign + * @Default {left} + */ + textAlign?: string; + + /**Specifies the color of the text. + * @Default {null} + */ + textColor?: string; + + /**Specifies the text value. + * @Default {null} + */ + value?: string; +} +} +module DigitalGauge +{ +enum CharacterType +{ +//string +SevenSegment, +//string +FourteenSegment, +//string +SixteenSegment, +//string +EightCrossEightDotMatrix, +//string +EightCrossEightSquareMatrix, +} +} +module DigitalGauge +{ +enum FontStyle +{ +//string +Normal, +//string +Bold, +//string +Italic, +//string +Underline, +//string +Strikeout, +} +} + +class Chart extends ej.Widget { + static fn: Chart; + constructor(element: JQuery, options?: Chart.Model); + constructor(element: Element, options?: Chart.Model); + model:Chart.Model; + defaults:Chart.Model; + + /** Animates the series and/or indicators in Chart. When parameter is not passed to this method, then all the series and indicators present in Chart are animated. + * @param {Array} Series and indicator objects passed in the array collection are animated.Example + * @param {any} Series or indicator object passed to this method are animated.Example, + * @returns {void} + */ + animate(options: Array, option: any): void; + + /** Exports chart as an image or to an excel file. Chart can be exported as an image only when exportCanvasRendering option is set to true. + * @param {string} Type of the export operation to be performed. Following are the two export types that are supported now,1. 'image'2. 'excel'Example + * @param {string} URL of the service, where the chart will be exported to excel.Example, + * @param {boolean} When this parameter is true, all the chart objects initialized to the same document are exported to a single excel file. This is an optional parameter. By default, it is false.Example, + * @returns {void} + */ + export(type: string, url: string, exportMultipleChart: boolean): void; + + /** Redraws the entire chart. You can call this method whenever you update, add or remove points from the data source or whenever you want to refresh the UI. + * @returns {void} + */ + redraw(): void; +} +export module Chart{ + +export interface Model { + + /**Options for adding and customizing annotations in Chart. + */ + annotations?: Array; + + /**Url of the image to be used as chart background. + * @Default {null} + */ + backGroundImageUrl?: string; + + /**Options for customizing the color, opacity and width of the chart border. + */ + border?: Border; + + /**Controls whether Chart has to be responsive or not. + * @Default {false} + */ + canResize?: boolean; + + /**Options for configuring the border and background of the plot area. + */ + chartArea?: ChartArea; + + /**Options to split Chart into multiple plotting areas vertically. Each object in the collection represents a plotting area in Chart. + */ + columnDefinitions?: Array; + + /**Options for configuring the properties of all the series. You can also override the options for specific series by using series collection. + */ + commonSeriesOptions?: CommonSeriesOptions; + + /**Options for displaying and customizing the crosshair. + */ + crosshair?: Crosshair; + + /**Depth of the 3D Chart from front view of series to background wall. This property is applicable only for 3D view. + * @Default {100} + */ + depth?: number; + + /**Controls whether 3D view has to be enabled or not. 3D view is supported only for column, bar. Stacking column, stacking bar, pie and doughnut series types. + * @Default {false} + */ + enable3D?: boolean; + + /**Controls whether Chart has to be rendered as Canvas or SVG. Canvas rendering supports all functionalities in SVG rendering except 3D Charts. + * @Default {false} + */ + enableCanvasRendering?: boolean; + + /**Controls whether 3D view has to be rotated on dragging. This property is applicable only for 3D view. + * @Default {false} + */ + enableRotation?: boolean; + + /**Options to customize the technical indicators. + */ + indicators?: Array; + + /**Options to customize the legend items and legend title. + */ + legend?: Legend; + + /**Name of the culture based on which chart should be localized. Number and date time values are localized with respect to the culture name.String type properties like title text are not localized automatically. Provide localized text as value to string type properties. + * @Default {en-US} + */ + locale?: string; + + /**Palette is used to store the series fill color in array and apply the color to series collection in the order of series index. + * @Default {null} + */ + palette?: Array; + + /**Options to customize the left, right, top and bottom margins of chart area. + */ + Margin?: any; + + /**Perspective angle of the 3D view. Chart appears closer when perspective angle is decreased, and distant when perspective angle is increased.This property is applicable only when 3D view is enabled + * @Default {90} + */ + perspectiveAngle?: number; + + /**This is a horizontal axis that contains options to configure axis and it is the primary x axis for all the series in series array. To override x axis for particular series, create an axis object by providing unique name by using name property and add it to axes array. Then, assign the name to the series’s xAxisName property to link both axis and series. + */ + primaryXAxis?: PrimaryXAxis; + + /**This is a vertical axis that contains options to configure axis. This is the primary y axis for all the series in series array. To override y axis for particular series, create an axis object by providing unique name by using name property and add it to axes array. Then, assign the name to the series’s yAxisName property to link both axis and series. + */ + primaryYAxis?: PrimaryYAxis; + + /**Rotation angle of the 3D view. This property is applicable only when 3D view is enabled. + * @Default {0} + */ + rotation?: number; + + /**Options to split Chart into multiple plotting areas horizontally. Each object in the collection represents a plotting area in Chart. + */ + rowDefinitions?: Array; + + /**Specifies the properties used for customizing the series. + */ + series?: Array; + + /**Controls whether data points has to be displayed side by side or along the depth of the axis. + * @Default {false} + */ + sideBySideSeriesPlacement?: boolean; + + /**Options to customize the Chart size. + */ + size?: Size; + + /**Specifies the theme for Chart. + * @Default {Flatlight. See Theme} + */ + theme?: ej.datavisualization.Chart.Theme|string; + + /**Slope angle of 3D Chart. This property is applicable only when 3D view is enabled. + * @Default {0} + */ + tilt?: number; + + /**Options for customizing the title and subtitle of Chart. + */ + title?: Title; + + /**Width of the wall used in 3D Chart. Wall is present only in Cartesian type 3D series and not in 3D pie or Doughnut series. This property is applicable only when 3D view is enabled. + * @Default {2} + */ + wallSize?: number; + + /**Options for enabling zooming feature of chart. + */ + zooming?: Zooming; + + /**Fires after the series animation is completed. This event will be triggered for each series when animation is enabled.*/ + animationComplete? (e: AnimationCompleteEventArgs): void; + + /**Fires before rendering the labels. This event is fired for each label in axis. You can use this event to add custom text to axis labels.*/ + axesLabelRendering? (e: AxesLabelRenderingEventArgs): void; + + /**Fires during the initialization of axis labels.*/ + axesLabelsInitialize? (e: AxesLabelsInitializeEventArgs): void; + + /**Fires during axes range calculation. This event is fired for each axis present in Chart. You can use this event to customize axis range as required.*/ + axesRangeCalculate? (e: AxesRangeCalculateEventArgs): void; + + /**Fires before rendering the axis title. This event is triggered for each axis with title. You can use this event to add custom text to axis title.*/ + axesTitleRendering? (e: AxesTitleRenderingEventArgs): void; + + /**Fires during the calculation of chart area bounds. You can use this event to customize the bounds of chart area.*/ + chartAreaBoundsCalculate? (e: ChartAreaBoundsCalculateEventArgs): void; + + /**Fires after chart is created.*/ + create? (e: CreateEventArgs): void; + + /**Fires when chart is destroyed completely.*/ + destroy? (e: DestroyEventArgs): void; + + /**Fires before rendering the data labels. This event is triggered for each data label in the series. You can use this event to add custom text in data labels.*/ + displayTextRendering? (e: DisplayTextRenderingEventArgs): void; + + /**Fires during the calculation of legend bounds. You can use this event to customize the bounds of legend.*/ + legendBoundsCalculate? (e: LegendBoundsCalculateEventArgs): void; + + /**Fires on clicking the legend item.*/ + legendItemClick? (e: LegendItemClickEventArgs): void; + + /**Fires when moving mouse over legend item. You can use this event for hit testing on legend items.*/ + legendItemMouseMove? (e: LegendItemMouseMoveEventArgs): void; + + /**Fires before rendering the legend item. This event is fired for each legend item in Chart. You can use this event to customize legend item shape or add custom text to legend item.*/ + legendItemRendering? (e: LegendItemRenderingEventArgs): void; + + /**Fires before loading the chart.*/ + load? (e: LoadEventArgs): void; + + /**Fires on clicking a point in chart. You can use this event to handle clicks made on points.*/ + pointRegionClick? (e: PointRegionClickEventArgs): void; + + /**Fires when mouse is moved over a point.*/ + pointRegionMouseMove? (e: PointRegionMouseMoveEventArgs): void; + + /**Fires before rendering chart.*/ + preRender? (e: PreRenderEventArgs): void; + + /**Fires after selecting a series. This event is triggered after selecting a series only if selection mode is series.*/ + seriesRegionClick? (e: SeriesRegionClickEventArgs): void; + + /**Fires before rendering a series. This event is fired for each series in Chart.*/ + seriesRendering? (e: SeriesRenderingEventArgs): void; + + /**Fires before rendering the marker symbols. This event is triggered for each marker in Chart.*/ + symbolRendering? (e: SymbolRenderingEventArgs): void; + + /**Fires before rendering the Chart title. You can use this event to add custom text in Chart title.*/ + titleRendering? (e: TitleRenderingEventArgs): void; + + /**Fires before rendering the tooltip. This event is fired when tooltip is enabled and mouse is hovered on a Chart point. You can use this event to customize tooltip before rendering.*/ + toolTipInitialize? (e: ToolTipInitializeEventArgs): void; + + /**Fires before rendering crosshair tooltip in axis. This event is fired for each axis with crosshair label enabled. You can use this event to customize crosshair label before rendering*/ + trackAxisToolTip? (e: TrackAxisToolTipEventArgs): void; + + /**Fires before rendering trackball tooltip. This event is fired for each series in Chart because trackball tooltip is displayed for all the series. You can use this event to customize the text displayed in trackball tooltip.*/ + trackToolTip? (e: TrackToolTipEventArgs): void; + + /**Fires, on clicking the axis label.*/ + axisLabelClick? (e: AxisLabelClickEventArgs): void; + + /**Fires on moving mouse over the axis label.*/ + axisLabelMouseMove? (e: AxisLabelMouseMoveEventArgs): void; + + /**Fires, on the clicking the chart.*/ + chartClick? (e: ChartClickEventArgs): void; + + /**Fires on moving mouse over the chart.*/ + chartMouseMove? (e: ChartMouseMoveEventArgs): void; + + /**Fires, on double clicking the chart.*/ + chartDoubleClick? (e: ChartDoubleClickEventArgs): void; + + /**Fires on clicking the annotation.*/ + annotationClick? (e: AnnotationClickEventArgs): void; + + /**Fires, after the chart is resized.*/ + afterResize? (e: AfterResizeEventArgs): void; + + /**Fires, when chart size is changing.*/ + beforeResize? (e: BeforeResizeEventArgs): void; + + /**Fires, when error bar is rendering.*/ + errorBarRendering? (e: ErrorBarRenderingEventArgs): void; +} + +export interface AnimationCompleteEventArgs { + + /**Instance of the series that completed has animation. + */ + series?: any; + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; +} + +export interface AxesLabelRenderingEventArgs { + + /**Instance of the corresponding axis. + */ + Axis?: any; + + /**Formatted text of the respective label. You can also add custom text to the label. + */ + LabelText?: string; + + /**Actual value of the label. + */ + LabelValue?: string; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the chart model object. + */ + model?: any; + + /**Name of the event + */ + type?: string; +} + +export interface AxesLabelsInitializeEventArgs { + + /**Collection of axes in Chart + */ + dataAxes?: any; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the chart model object. + */ + model?: any; + + /**Name of the event + */ + type?: string; +} + +export interface AxesRangeCalculateEventArgs { + + /**Difference between minimum and maximum value of axis range. + */ + delta?: number; + + /**Interval value of axis range. Grid lines, tick lines and axis labels are drawn based on this interval value. + */ + interval?: number; + + /**Maximum value of axis range. + */ + max?: number; + + /**Minimum value of axis range. + */ + min?: number; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the chart model object. + */ + model?: any; + + /**Name of the event + */ + type?: string; +} + +export interface AxesTitleRenderingEventArgs { + + /**Instance of the axis whose title is being rendered + */ + axes?: any; + + /**X-coordinate of title location + */ + locationX?: number; + + /**Y-coordinate of title location + */ + locationY?: number; + + /**Axis title text. You can add custom text to the title. + */ + title?: string; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the chart model object. + */ + model?: any; + + /**Name of the event + */ + type?: string; +} + +export interface ChartAreaBoundsCalculateEventArgs { + + /**Height of the chart area. + */ + areaBoundsHeight?: number; + + /**Width of the chart area. + */ + areaBoundsWidth?: number; + + /**X-coordinate of the chart area. + */ + areaBoundsX?: number; + + /**Y-coordinate of the chart area. + */ + areaBoundsY?: number; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the chart model object. + */ + model?: any; + + /**Name of the event + */ + type?: string; +} + +export interface CreateEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the chart model object. + */ + model?: any; + + /**Name of the event + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the chart model object. + */ + model?: any; + + /**Name of the event + */ + type?: string; +} + +export interface DisplayTextRenderingEventArgs { + + /**Text displayed in data label. You can add custom text to the data label + */ + text?: string; + + /**X-coordinate of data label location + */ + locationX?: number; + + /**Y-coordinate of data label location + */ + locationY?: number; + + /**Index of the series in series Collection whose data label is being rendered + */ + seriesIndex?: number; + + /**Index of the point in series whose data label is being rendered + */ + pointIndex?: number; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the chart model object. + */ + model?: any; + + /**Name of the event + */ + type?: string; +} + +export interface LegendBoundsCalculateEventArgs { + + /**Height of the legend. + */ + legendBoundsHeight?: number; + + /**Width of the legend. + */ + legendBoundsWidth?: number; + + /**Number of rows to display the legend items + */ + legendBoundsRows?: number; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the chart model object. + */ + model?: any; + + /**Name of the event + */ + type?: string; +} + +export interface LegendItemClickEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**X-coordinate of legend item in pixel + */ + startX?: number; + + /**Y-coordinate of legend item in pixel + */ + startY?: number; + + /**Instance of the legend item object that is about to be rendered + */ + LegendItem?: any; + + /**Options to customize the legend item styles such as border, color, size, etc…, + */ + style?: any; + + /**Instance that holds information about legend bounds and legend item bounds. + */ + Bounds?: any; + + /**Name of the legend item shape. Use this option to customize legend item shape before rendering + */ + symbolShape?: string; + + /**Instance of the series object corresponding to the legend item + */ + series?: any; +} + +export interface LegendItemMouseMoveEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**X-coordinate of legend item in pixel + */ + startX?: number; + + /**Y-coordinate of legend item in pixel + */ + startY?: number; + + /**Instance of the legend item object that is about to be rendered + */ + LegendItem?: any; + + /**Options to customize the legend item styles such as border, color, size, etc…, + */ + style?: any; + + /**Options to customize the legend item styles such as border, color, size, etc…, + */ + Bounds?: any; + + /**Name of the legend item shape. Use this option to customize legend item shape before rendering + */ + symbolShape?: string; + + /**Instance of the series object corresponding to the legend item + */ + series?: any; +} + +export interface LegendItemRenderingEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**X-coordinate of legend item in pixel + */ + startX?: number; + + /**Y-coordinate of legend item in pixel + */ + startY?: number; + + /**Instance of the legend item object that is about to be rendered + */ + legendItem?: any; + + /**Options to customize the legend item styles such as border, color, size, etc. + */ + style?: any; + + /**Name of the legend item shape. Use this option to customize legend item shape before rendering + */ + symbolShape?: string; +} + +export interface LoadEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; +} + +export interface PointRegionClickEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**X-coordinate of point in pixel + */ + locationX?: number; + + /**Y-coordinate of point in pixel + */ + locationY?: number; + + /**Index of the point in series + */ + pointIndex?: number; + + /**Index of the series in series collection to which the point belongs + */ + seriesIndex?: number; +} + +export interface PointRegionMouseMoveEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**X-coordinate of point in pixel + */ + locationX?: number; + + /**Y-coordinate of point in pixel + */ + locationY?: number; + + /**Index of the point in series + */ + pointIndex?: number; + + /**Index of the series in series collection to which the point belongs + */ + seriesIndex?: number; +} + +export interface PreRenderEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; +} + +export interface SeriesRegionClickEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**Instance of the selected series + */ + series?: any; + + /**Index of the selected series + */ + seriesIndex?: number; +} + +export interface SeriesRenderingEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**Instance of the series which is about to get rendered + */ + series?: any; +} + +export interface SymbolRenderingEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**Instance that holds the location of marker symbol + */ + location?: any; + + /**Options to customize the marker style such as color, border and size + */ + style?: any; +} + +export interface TitleRenderingEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**Option to customize the title location in pixels + */ + location?: any; + + /**Read-only option to find the size of the title + */ + size?: any; + + /**Use this option to add custom text in title + */ + title?: string; +} + +export interface ToolTipInitializeEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**Text to be displayed in tooltip. Set this option to customize the text displayed in tooltip + */ + currentText?: string; + + /**Index of the point on which mouse is hovered + */ + pointIndex?: number; + + /**Index of the series in series collection whose point is hovered by mouse + */ + seriesIndex?: number; +} + +export interface TrackAxisToolTipEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**Location of the crosshair label in pixels + */ + location?: any; + + /**Index of the axis for which crosshair label is displayed + */ + axisIndex?: number; + + /**Instance of the chart axis object for which cross hair label is displayed + */ + crossAxis?: number; + + /**Text to be displayed in crosshair label. Use this option to add custom text in crosshair label + */ + currentTrackText?: string; +} + +export interface TrackToolTipEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**Location of the trackball tooltip in pixels + */ + location?: any; + + /**Index of the point for which trackball tooltip is displayed + */ + pointIndex?: number; + + /**Index of the series in series collection + */ + seriesIndex?: number; + + /**Text to be displayed in trackball tooltip. Use this option to add custom text in trackball tooltip + */ + currentText?: string; + + /**Instance of the series object for which trackball tooltip is displayed. + */ + series?: any; +} + +export interface AxisLabelClickEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**X and Y co-ordinate of the labels in chart area. + */ + location?: any; + + /**Index of the label. + */ + index?: number; + + /**Instance of the corresponding axis. + */ + axis?: any; + + /**Label that is clicked. + */ + text?: string; +} + +export interface AxisLabelMouseMoveEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**X and Y co-ordinate of the labels in chart area. + */ + location?: any; + + /**Index of the label. + */ + index?: number; + + /**Instance of the corresponding axis. + */ + axis?: any; + + /**Label that is hovered. + */ + text?: string; +} + +export interface ChartClickEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**X and Y co-ordinate of the points with respect to chart area. + */ + location?: any; + + /**ID of the target element. + */ + id?: string; + + /**Width and height of the chart. + */ + size?: any; + + /**x-coordinate of the pointer, relative to the page + */ + pageX?: number; + + /**y-coordinate of the pointer, relative to the page + */ + pageY?: number; +} + +export interface ChartMouseMoveEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**X and Y co-ordinate of the points with respect to chart area. + */ + location?: any; + + /**ID of the target element. + */ + id?: string; + + /**Width and height of the chart. + */ + size?: any; + + /**x-coordinate of the pointer, relative to the page + */ + pageX?: number; + + /**y-coordinate of the pointer, relative to the page + */ + pageY?: number; +} + +export interface ChartDoubleClickEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**X and Y co-ordinate of the points with respect to chart area. + */ + location?: any; + + /**ID of the target element. + */ + id?: string; + + /**Width and height of the chart. + */ + size?: any; + + /**x-coordinate of the pointer, relative to the page + */ + pageX?: number; + + /**y-coordinate of the pointer, relative to the page + */ + pageY?: number; +} + +export interface AnnotationClickEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**X and Y co-ordinate of the annotation in chart area. + */ + location?: any; + + /**Information about the annotation, like Coordinate unit, Region, content + */ + contentData?: any; + + /**x-coordinate of the pointer, relative to the page + */ + pageX?: number; + + /**y-coordinate of the pointer, relative to the page + */ + pageY?: number; +} + +export interface AfterResizeEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**Chart width, after resize + */ + width?: number; + + /**Chart height, after resize + */ + height?: number; + + /**Chart width, before resize + */ + prevWidth?: number; + + /**Chart height, before resize + */ + prevHeight?: number; + + /**Chart width, when the chart was first rendered + */ + originalWidth?: number; + + /**Chart height, when the chart was first rendered + */ + originalHeight?: number; +} + +export interface BeforeResizeEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**Chart width, before resize + */ + currentWidth?: number; + + /**Chart height, before resize + */ + currentHeight?: number; + + /**Chart width, after resize + */ + newWidth?: number; + + /**Chart height, after resize + */ + newHeight?: number; +} + +export interface ErrorBarRenderingEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**Error bar Object + */ + errorbar?: any; +} + +export interface AnnotationsMargin { + + /**Annotation is placed at the specified value above its original position. + * @Default {0} + */ + bottom?: number; + + /**Annotation is placed at the specified value from left side of its original position. + * @Default {0} + */ + left?: number; + + /**Annotation is placed at the specified value from the right side of its original position. + * @Default {0} + */ + right?: number; + + /**Annotation is placed at the specified value under its original position. + * @Default {0} + */ + top?: number; +} + +export interface Annotations { + + /**Angle to rotate the annotation in degrees. + * @Default {'0'} + */ + angle?: number; + + /**Text content or id of a HTML element to be displayed as annotation. + */ + content?: string; + + /**Specifies how annotations have to be placed in Chart. + * @Default {none. See CoordinateUnit} + */ + coordinateUnit?: ej.datavisualization.Chart.CoordinateUnit|string; + + /**Specifies the horizontal alignment of the annotation. + * @Default {middle. See HorizontalAlignment} + */ + horizontalAlignment?: ej.datavisualization.Chart.HorizontalAlignment|string; + + /**Options to customize the margin of annotation. + */ + margin?: AnnotationsMargin; + + /**Controls the opacity of the annotation. + * @Default {1} + */ + opacity?: number; + + /**Specifies whether annotation has to be placed with respect to chart or series. + * @Default {chart. See Region} + */ + region?: ej.datavisualization.Chart.Region|string; + + /**Specifies the vertical alignment of the annotation. + * @Default {middle. See VerticalAlignment} + */ + verticalAlignment?: ej.datavisualization.Chart.VerticalAlignment|string; + + /**Controls the visibility of the annotation. + * @Default {false} + */ + visible?: boolean; + + /**Represents the horizontal offset when coordinateUnit is pixels.when coordinateUnit is points, it represents the x-coordinate of axis bounded with xAxisName property or primary X axis when xAxisName is not provided.This property is not applicable when coordinateUnit is none. + * @Default {0} + */ + x?: number; + + /**Name of the horizontal axis to be used for positioning the annotation. This property is applicable only when coordinateUnit is points. + */ + xAxisName?: string; + + /**Represents the vertical offset when coordinateUnit is pixels.When coordinateUnit is points, it represents the y-coordinate of axis bounded with yAxisName property or primary Y axis when yAxisName is not provided.This property is not applicable when coordinateUnit is none. + * @Default {0} + */ + y?: number; + + /**Name of the vertical axis to be used for positioning the annotation.This property is applicable only when coordinateUnit is points. + */ + yAxisName?: string; +} + +export interface Border { + + /**Border color of the chart. + * @Default {null} + */ + color?: string; + + /**Opacity of the chart border. + * @Default {0.3} + */ + opacity?: number; + + /**Width of the Chart border. + * @Default {0} + */ + width?: number; +} + +export interface ChartAreaBorder { + + /**Border color of the plot area. + * @Default {Gray} + */ + color?: string; + + /**Opacity of the plot area border. + * @Default {0.3} + */ + opacity?: number; + + /**Border width of the plot area. + * @Default {0.5} + */ + width?: number; +} + +export interface ChartArea { + + /**Background color of the plot area. + * @Default {transparent} + */ + background?: string; + + /**Options for customizing the border of the plot area. + */ + border?: ChartAreaBorder; +} + +export interface ColumnDefinitions { + + /**Specifies the unit to measure the width of the column in plotting area. + * @Default {'pixel'. See Unit} + */ + unit?: ej.datavisualization.Chart.Unit|string; + + /**Width of the column in plotting area. Width is measured in either pixel or percentage based on the value of unit property. + * @Default {50} + */ + columnWidth?: number; + + /**Color of the line that indicates the starting point of the column in plotting area. + * @Default {transparent} + */ + lineColor?: string; + + /**Width of the line that indicates the starting point of the column in plot area. + * @Default {1} + */ + lineWidth?: number; +} + +export interface CommonSeriesOptionsBorder { + + /**Border color of all series. + * @Default {transparent} + */ + color?: string; + + /**DashArray for border of the series. + * @Default {null} + */ + dashArray?: string; + + /**Border width of all series. + * @Default {1} + */ + width?: number; +} + +export interface CommonSeriesOptionsFont { + + /**Font color of the text in all series. + * @Default {#707070} + */ + color?: string; + + /**Font Family for all the series. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Specifies the font Style for all the series. + * @Default {normal} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Specifies the font weight for all the series. + * @Default {regular} + */ + fontWeight?: ej.datavisualization.Chart.FontWeight|string; + + /**Opacity for text in all the series. + * @Default {1} + */ + opacity?: number; + + /**Font size for text in all the series. + * @Default {12px} + */ + size?: string; +} + +export interface CommonSeriesOptionsMarkerBorder { + + /**Border color of the marker shape. + * @Default {white} + */ + color?: string; + + /**Border width of the marker shape. + * @Default {3} + */ + width?: number; +} + +export interface CommonSeriesOptionsMarkerDataLabelBorder { + + /**Border color of the data label. + * @Default {null} + */ + color?: string; + + /**Border width of the data label. + * @Default {0.1} + */ + width?: number; +} + +export interface CommonSeriesOptionsMarkerDataLabelConnectorLine { + + /**Specifies when the connector has to be drawn as Bezier curve or straight line. This is applicable only for Pie and Doughnut chart types. + * @Default {line. See ConnectorLineType} + */ + type?: ej.datavisualization.Chart.ConnectorLineType|string; + + /**Width of the connector. + * @Default {0.5} + */ + width?: number; +} + +export interface CommonSeriesOptionsMarkerDataLabelFont { + + /**Font family of the data label. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Font style of the data label. + * @Default {normal. See FontStyle} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Font weight of the data label. + * @Default {regular. See FontWeight} + */ + fontWeight?: ej.datavisualization.Chart.FontWeight|string; + + /**Opacity of the text. + * @Default {1} + */ + opacity?: number; + + /**Font size of the data label. + * @Default {12px} + */ + size?: string; +} + +export interface CommonSeriesOptionsMarkerDataLabelMargin { + + /**Bottom margin of the text. + * @Default {5} + */ + bottom?: number; + + /**Left margin of the text. + * @Default {5} + */ + left?: number; + + /**Right margin of the text. + * @Default {5} + */ + right?: number; + + /**Top margin of the text. + * @Default {5} + */ + top?: number; +} + +export interface CommonSeriesOptionsMarkerDataLabel { + + /**Angle of the data label in degrees. Only the text gets rotated, whereas the background and border does not rotate. + * @Default {null} + */ + angle?: number; + + /**Options for customizing the border of the data label. + */ + border?: CommonSeriesOptionsMarkerDataLabelBorder; + + /**Options for displaying and customizing the line that connects point and data label. + */ + connectorLine?: CommonSeriesOptionsMarkerDataLabelConnectorLine; + + /**Background color of the data label. + * @Default {null} + */ + fill?: string; + + /**Options for customizing the data label font. + */ + font?: CommonSeriesOptionsMarkerDataLabelFont; + + /**Horizontal alignment of the data label. + * @Default {center} + */ + horizontalTextAlignment?: ej.datavisualization.Chart.HorizontalTextAlignment|string; + + /**Margin of the text to its background shape. The size of the background shape increases based on the margin applied to its text. + */ + margin?: CommonSeriesOptionsMarkerDataLabelMargin; + + /**Opacity of the data label. + * @Default {1} + */ + opacity?: number; + + /**Background shape of the data label. + * @Default {none. See Shape} + */ + shape?: ej.datavisualization.Chart.Shape|string; + + /**Name of a field in data source, where datalabel text is displayed. + */ + textMappingName?: string; + + /**Specifies the position of the data label. This property can be used only for the series such as column, bar, stacked column, stacked bar, 100% stacked column, 100% stacked bar, candle and OHLC. + * @Default {top. See TextPosition} + */ + textPosition?: ej.datavisualization.Chart.TextPosition|string; + + /**Vertical alignment of the data label. + * @Default {center} + */ + verticalTextAlignment?: ej.datavisualization.Chart.VerticalTextAlignment|string; + + /**Controls the visibility of the data labels. + * @Default {false} + */ + visible?: boolean; +} + +export interface CommonSeriesOptionsMarkerSize { + + /**Height of the marker. + * @Default {6} + */ + height?: number; + + /**Width of the marker. + * @Default {6} + */ + width?: number; +} + +export interface CommonSeriesOptionsMarker { + + /**Options for customizing the border of the marker shape. + */ + border?: CommonSeriesOptionsMarkerBorder; + + /**Options for displaying and customizing data labels. + */ + dataLabel?: CommonSeriesOptionsMarkerDataLabel; + + /**Color of the marker shape. + * @Default {null} + */ + fill?: string; + + /**The URL for the Image to be displayed as marker. In order to display image as marker, set series.marker.shape as ‘image’. + */ + imageUrl?: string; + + /**Opacity of the marker. + * @Default {1} + */ + opacity?: number; + + /**Specifies the shape of the marker. + * @Default {circle. See Shape} + */ + shape?: ej.datavisualization.Chart.Shape|string; + + /**Options for customizing the size of the marker shape. + */ + size?: CommonSeriesOptionsMarkerSize; + + /**Controls the visibility of the marker shape. + * @Default {false} + */ + visible?: boolean; +} + +export interface CommonSeriesOptionsTooltipBorder { + + /**Border color of the tooltip. + * @Default {null} + */ + color?: string; + + /**Border width of the tooltip. + * @Default {1} + */ + width?: number; +} + +export interface CommonSeriesOptionsTooltip { + + /**Options for customizing the border of the tooltip. + */ + border?: CommonSeriesOptionsTooltipBorder; + + /**Customize the corner radius of the tooltip rectangle. + * @Default {0} + */ + rx?: number; + + /**Customize the corner radius of the tooltip rectangle. + * @Default {0} + */ + ry?: number; + + /**Specifies the duration, the tooltip has to be displayed. + * @Default {500ms} + */ + duration?: string; + + /**Enables/disables the animation of the tooltip when moving from one point to other. + * @Default {true} + */ + enableAnimation?: boolean; + + /**Background color of the tooltip. + * @Default {null} + */ + fill?: string; + + /**Format of the tooltip content. + * @Default {#point.x# : #point.y#} + */ + format?: string; + + /**Opacity of the tooltip. + * @Default {0.5} + */ + opacity?: number; + + /**Custom template to format the tooltip content. Use “point.x” and “point.y” as a placeholder text to display the corresponding data point’s x and y value. + * @Default {null} + */ + template?: string; + + /**Controls the visibility of the tooltip. + * @Default {false} + */ + visible?: boolean; +} + +export interface CommonSeriesOptionsEmptyPointSettingsStyleBorder { + + /**Border color of the empty point. + */ + color?: string; + + /**Border width of the empty point. + * @Default {1} + */ + width?: number; +} + +export interface CommonSeriesOptionsEmptyPointSettingsStyle { + + /**Color of the empty point. + */ + color?: string; + + /**Options for customizing border of the empty point in the series. + */ + border?: CommonSeriesOptionsEmptyPointSettingsStyleBorder; +} + +export interface CommonSeriesOptionsEmptyPointSettings { + + /**Controls the visibility of the empty point. + * @Default {true} + */ + visible?: boolean; + + /**Specifies the mode of empty point. + * @Default {gap} + */ + displayMode?: ej.datavisualization.Chart.EmptyPointMode|string; + + /**Options for customizing the color and border of the empty point in the series. + */ + style?: CommonSeriesOptionsEmptyPointSettingsStyle; +} + +export interface CommonSeriesOptionsConnectorLine { + + /**Width of the connector line. + * @Default {1} + */ + width?: number; + + /**Color of the connector line. + * @Default {#565656} + */ + color?: string; + + /**DashArray of the connector line. + * @Default {null} + */ + dashArray?: string; + + /**DashArray of the connector line. + * @Default {1} + */ + opacity?: number; +} + +export interface CommonSeriesOptionsErrorBarCap { + + /**Show/Hides the error bar cap. + * @Default {true} + */ + visible?: boolean; + + /**Width of the error bar cap. + * @Default {1} + */ + width?: number; + + /**Length of the error bar cap. + * @Default {1} + */ + length?: number; + + /**Color of the error bar cap. + * @Default {“#000000”} + */ + fill?: string; +} + +export interface CommonSeriesOptionsErrorBar { + + /**Show/hides the error bar + * @Default {visible} + */ + visibility?: boolean; + + /**Specifies the type of error bar. + * @Default {FixedValue} + */ + type?: ej.datavisualization.Chart.ErrorBarType|string; + + /**Specifies the mode of error bar. + * @Default {vertical} + */ + mode?: ej.datavisualization.Chart.ErrorBarMode|string; + + /**Specifies the direction of error bar. + * @Default {both} + */ + direction?: ej.datavisualization.Chart.ErrorBarDirection|string; + + /**Value of vertical error bar. + * @Default {3} + */ + verticalErrorValue?: number; + + /**Value of horizontal error bar. + * @Default {1} + */ + horizontalErrorValue?: number; + + /**Value of positive horizontal error bar. + * @Default {1} + */ + horizontalPositiveErrorValue?: number; + + /**Value of negative horizontal error bar. + * @Default {1} + */ + horizontalNegativeErrorValue?: number; + + /**Value of positive vertical error bar. + * @Default {5} + */ + verticalPositiveErrorValue?: number; + + /**Value of negative vertical error bar. + * @Default {5} + */ + verticalNegativeErrorValue?: number; + + /**Fill color of the error bar. + * @Default {#000000} + */ + fill?: string; + + /**Width of the error bar. + * @Default {1} + */ + width?: number; + + /**Options for customizing the error bar cap. + */ + cap?: CommonSeriesOptionsErrorBarCap; +} + +export interface CommonSeriesOptionsTrendlines { + + /**Show/hides the trendline. + */ + visibility?: boolean; + + /**Specifies the type of the trendline for the series. + * @Default {linear. See TrendlinesType} + */ + type?: string; + + /**Name for the trendlines that is to be displayed in the legend text. + * @Default {trendline} + */ + name?: string; + + /**Fill color of the trendlines. + * @Default {#0000FF} + */ + fill?: string; + + /**Width of the trendlines. + * @Default {1} + */ + width?: number; + + /**Opacity of the trendline. + * @Default {1} + */ + opacity?: number; + + /**Pattern of dashes and gaps used to stroke the trendline. + */ + dashArray?: string; + + /**Future trends of the current series. + * @Default {0} + */ + forwardForecast?: number; + + /**Past trends of the current series. + * @Default {0} + */ + backwardForecast?: number; + + /**Specifies the order of the polynomial trendlines. + * @Default {0} + */ + polynomialOrder?: number; + + /**Specifies the moving average starting period value. + * @Default {2} + */ + period?: number; +} + +export interface CommonSeriesOptionsHighlightSettingsBorder { + + /**Border color of the series/point on highlight. + */ + color?: string; + + /**Border width of the series/point on highlight. + * @Default {2} + */ + width?: string; +} + +export interface CommonSeriesOptionsHighlightSettings { + + /**Enables/disables the ability to highlight the series or data point interactively. + * @Default {false} + */ + enable?: boolean; + + /**Specifies whether the series or data point has to be highlighted. + * @Default {series. See Mode} + */ + mode?: ej.datavisualization.Chart.Mode|string; + + /**Color of the series/point on highlight. + */ + color?: string; + + /**Opacity of the series/point on highlight. + * @Default {0.6} + */ + opacity?: number; + + /**Options for customizing the border of series on highlight. + */ + border?: CommonSeriesOptionsHighlightSettingsBorder; + + /**Specifies the pattern for the series/point on highlight. + * @Default {none. See Pattern} + */ + pattern?: string; + + /**Custom pattern for the series on highlight. + */ + customPattern?: string; +} + +export interface CommonSeriesOptionsSelectionSettingsBorder { + + /**Border color of the series/point on selection. + */ + color?: string; + + /**Border width of the series/point on selection. + * @Default {2} + */ + width?: string; +} + +export interface CommonSeriesOptionsSelectionSettings { + + /**Enables/disables the ability to select a series/data point interactively. + * @Default {false} + */ + enable?: boolean; + + /**Specifies the type of selection. + * @Default {single} + */ + type?: ej.datavisualization.Chart.SelectionType|string; + + /**Specifies whether the series or data point has to be selected. + * @Default {series. See Mode} + */ + mode?: ej.datavisualization.Chart.Mode|string; + + /**Color of the series/point on selection. + */ + color?: string; + + /**Opacity of the series/point on selection. + * @Default {0.6} + */ + opacity?: number; + + /**Options for customizing the border of the series on selection. + */ + border?: CommonSeriesOptionsSelectionSettingsBorder; + + /**Specifies the pattern for the series/point on selection. + * @Default {none. See Pattern} + */ + pattern?: string; + + /**Custom pattern for the series on selection. + */ + customPattern?: string; +} + +export interface CommonSeriesOptions { + + /**Options to customize the border of all the series. + */ + border?: CommonSeriesOptionsBorder; + + /**Pattern of dashes and gaps used to stroke all the line type series. + */ + dashArray?: string; + + /**Set the dataSource for all series. It can be an array of JSON objects or an instance of ej.DataManager. + * @Default {null} + */ + dataSource?: any; + + /**Controls the size of the hole in doughnut series. Value ranges from 0 to 1 + * @Default {0.4} + */ + doughnutCoefficient?: number; + + /**Controls the size of the doughnut series. Value ranges from 0 to 1. + * @Default {0.8} + */ + doughnutSize?: number; + + /**Specifies the type of series to be drawn in radar or polar series. + * @Default {line. See DrawType} + */ + drawType?: ej.datavisualization.Chart.DrawType|string; + + /**Enable/disable the animation for all the series. + * @Default {true} + */ + enableAnimation?: boolean; + + /**To avoid overlapping of data labels smartly. + * @Default {true} + */ + enableSmartLabels?: boolean; + + /**Start angle of pie/doughnut series. + * @Default {null} + */ + endAngle?: number; + + /**Explodes the pie/doughnut slices on mouse move. + * @Default {false} + */ + explode?: boolean; + + /**Explodes all the slice of pie/doughnut on render. + * @Default {false} + */ + explodeAll?: boolean; + + /**Index of the point to be exploded from pie/doughnut/pyramid/funnel. + * @Default {null} + */ + explodeIndex?: number; + + /**Specifies the distance of the slice from the center, when it is exploded. + * @Default {0.4} + */ + explodeOffset?: number; + + /**Fill color for all the series. + * @Default {null} + */ + fill?: string; + + /**Options for customizing the font of all the series. + */ + font?: CommonSeriesOptionsFont; + + /**Sets the height of the funnel in funnel series. Values can be either pixel or percentage. + * @Default {32.7%} + */ + funnelHeight?: string; + + /**Sets the width of the funnel in funnel series. Values can be either pixel or percentage. + * @Default {11.6%} + */ + funnelWidth?: string; + + /**Gap between the slices in pyramid and funnel series. + * @Default {0} + */ + gapRatio?: number; + + /**Specifies whether to join start and end point of a line/area series used in polar/radar chart to form a closed path. + * @Default {true} + */ + isClosed?: boolean; + + /**Specifies whether to stack the column series in polar/radar charts. + * @Default {false} + */ + isStacking?: boolean; + + /**Renders the chart vertically. This is applicable only for cartesian type series. + * @Default {false} + */ + isTransposed?: boolean; + + /**Position of the data label in pie/doughnut/pyramid/funnel series. OutsideExtended position is not applicable for pyramid/funnel. + * @Default {inside. See LabelPosition} + */ + labelPosition?: ej.datavisualization.Chart.LabelPosition|string; + + /**Specifies the line cap of the series. + * @Default {butt. See LineCap} + */ + lineCap?: ej.datavisualization.Chart.LineCap|string; + + /**Specifies the type of shape to be used where two lines meet. + * @Default {round. See LineJoin} + */ + lineJoin?: ej.datavisualization.Chart.LineJoin|string; + + /**Options for displaying and customizing marker for individual point in a series. Marker contains shapes and/or data labels. + */ + marker?: CommonSeriesOptionsMarker; + + /**Opacity of the series. + * @Default {1} + */ + opacity?: number; + + /**Name of a field in data source, where the fill color for all the data points is generated. + */ + palette?: string; + + /**Controls the size of pie series. Value ranges from 0 to 1. + * @Default {0.8} + */ + pieCoefficient?: number; + + /**Specifies the mode of the pyramid series. + * @Default {linear. See PyramidMode} + */ + pyramidMode?: ej.datavisualization.Chart.PyramidMode|string; + + /**Start angle from where the pie/doughnut series renders. By default it starts from 0. + * @Default {null} + */ + startAngle?: number; + + /**Options for customizing the tooltip of chart. + */ + tooltip?: CommonSeriesOptionsTooltip; + + /**Specifies the type of the series to render in chart. + * @Default {column. See Type} + */ + type?: ej.datavisualization.Chart.Type|string; + + /**Specifies the name of the x-axis that has to be associated with this series. Add an axis instance with this name to axes collection. + * @Default {null} + */ + xAxisName?: string; + + /**Name of the property in the datasource that contains x value for the series. + * @Default {null} + */ + xName?: string; + + /**Specifies the name of the y-axis that has to be associated with this series. Add an axis instance with this name to axes collection. + * @Default {null} + */ + yAxisName?: string; + + /**Name of the property in the datasource that contains y value for the series. + * @Default {null} + */ + yName?: string; + + /**Name of the property in the datasource that contains high value for the series. + * @Default {null} + */ + high?: string; + + /**Name of the property in the datasource that contains low value for the series. + * @Default {null} + */ + low?: string; + + /**Name of the property in the datasource that contains open value for the series. + * @Default {null} + */ + open?: string; + + /**Name of the property in the datasource that contains close value for the series. + * @Default {null} + */ + close?: string; + + /**Name of the property in the datasource that contains the size value for the bubble series. + * @Default {null} + */ + size?: string; + + /**Options for customizing the empty point in the series. + */ + emptyPointSettings?: CommonSeriesOptionsEmptyPointSettings; + + /**Fill color for the positive column of the waterfall. + * @Default {null} + */ + positiveFill?: string; + + /**Options for customizing the waterfall connector line. + */ + connectorLine?: CommonSeriesOptionsConnectorLine; + + /**Options to customize the error bar in series. + */ + errorBar?: CommonSeriesOptionsErrorBar; + + /**Option to add the trendlines to chart. + */ + trendlines?: Array; + + /**Options for customizing the appearance of the series or data point while highlighting. + */ + highlightSettings?: CommonSeriesOptionsHighlightSettings; + + /**Options for customizing the appearance of the series/data point on selection. + */ + selectionSettings?: CommonSeriesOptionsSelectionSettings; +} + +export interface CrosshairMarkerBorder { + + /**Border width of the marker. + * @Default {3} + */ + width?: number; +} + +export interface CrosshairMarkerSize { + + /**Height of the marker. + * @Default {10} + */ + height?: number; + + /**Width of the marker. + * @Default {10} + */ + width?: number; +} + +export interface CrosshairMarker { + + /**Options for customizing the border. + */ + border?: CrosshairMarkerBorder; + + /**Opacity of the marker. + * @Default {true} + */ + opacity?: boolean; + + /**Options for customizing the size of the marker. + */ + size?: CrosshairMarkerSize; + + /**Show/hides the marker. + * @Default {true} + */ + visible?: boolean; +} + +export interface Crosshair { + + /**Options for customizing the marker in crosshair. + */ + marker?: CrosshairMarker; + + /**Specifies the type of the crosshair. It can be trackball or crosshair + * @Default {crosshair. See CrosshairType} + */ + type?: ej.datavisualization.Chart.CrosshairType|string; + + /**Show/hides the crosshair/trackball visibility. + * @Default {false} + */ + visible?: boolean; +} + +export interface IndicatorsHistogramBorder { + + /**Color of the histogram border in MACD indicator. + * @Default {#9999ff} + */ + color?: string; + + /**Controls the width of histogram border line in MACD indicator. + * @Default {1} + */ + width?: number; +} + +export interface IndicatorsHistogram { + + /**Options to customize the histogram border in MACD indicator. + */ + border?: IndicatorsHistogramBorder; + + /**Color of histogram columns in MACD indicator. + * @Default {#ccccff} + */ + fill?: string; + + /**Opacity of histogram columns in MACD indicator. + * @Default {1} + */ + opacity?: number; +} + +export interface IndicatorsLowerLine { + + /**Color of lower line. + * @Default {#008000} + */ + fill?: string; + + /**Width of the lower line. + * @Default {2} + */ + width?: number; +} + +export interface IndicatorsMacdLine { + + /**Color of MACD line. + * @Default {#ff9933} + */ + fill?: string; + + /**Width of the MACD line. + * @Default {2} + */ + width?: number; +} + +export interface IndicatorsPeriodLine { + + /**Color of period line in indicator. + * @Default {blue} + */ + fill?: string; + + /**Width of the period line in indicators. + * @Default {2} + */ + width?: number; +} + +export interface IndicatorsTooltipBorder { + + /**Border color of indicator tooltip. + * @Default {null} + */ + color?: string; + + /**Border width of indicator tooltip. + * @Default {1} + */ + width?: number; +} + +export interface IndicatorsTooltip { + + /**Option to customize the border of indicator tooltip. + */ + border?: IndicatorsTooltipBorder; + + /**Specifies the animation duration of indicator tooltip. + * @Default {500ms} + */ + duration?: string; + + /**Enables/disables the tooltip animation. + * @Default {true} + */ + enableAnimation?: boolean; + + /**Format of indicator tooltip. Use “point.x” and “point.y” as a placeholder text to display the corresponding data point’s x and y value. + * @Default {#point.x# : #point.y#} + */ + format?: string; + + /**Background color of indicator tooltip. + * @Default {null} + */ + fill?: string; + + /**Opacity of indicator tooltip. + * @Default {0.95} + */ + opacity?: number; + + /**Controls the visibility of indicator tooltip. + * @Default {false} + */ + visible?: boolean; +} + +export interface IndicatorsUpperLine { + + /**Fill color of the upper line in indicators + * @Default {#ff9933} + */ + fill?: string; + + /**Width of the upper line in indicators. + * @Default {2} + */ + width?: number; +} + +export interface Indicators { + + /**The dPeriod value for stochastic indicator. + * @Default {3} + */ + dPeriod?: number; + + /**Enables/disables the animation. + * @Default {false} + */ + enableAnimation?: boolean; + + /**Color of the technical indicator. + * @Default {#00008B} + */ + fill?: string; + + /**Options to customize the histogram in MACD indicator. + */ + histogram?: IndicatorsHistogram; + + /**Specifies the k period in stochastic indicator. + * @Default {3} + */ + kPeriod?: number; + + /**Specifies the long period in MACD indicator. + * @Default {26} + */ + longPeriod?: number; + + /**Options to customize the lower line in indicators. + */ + lowerLine?: IndicatorsLowerLine; + + /**Options to customize the MACD line. + */ + macdLine?: IndicatorsMacdLine; + + /**Specifies the type of the MACD indicator. + * @Default {line. See MACDType} + */ + macdType?: string; + + /**Specifies period value in indicator. + * @Default {14} + */ + period?: number; + + /**Options to customize the period line in indicators. + */ + periodLine?: IndicatorsPeriodLine; + + /**Name of the series for which indicator has to be drawn. + */ + seriesName?: string; + + /**Specifies the short period in MACD indicator. + * @Default {13} + */ + shortPeriod?: number; + + /**Specifies the standard deviation value for Bollinger band indicator. + * @Default {2} + */ + standardDeviations?: number; + + /**Options to customize the tooltip. + */ + tooltip?: IndicatorsTooltip; + + /**Trigger value of MACD indicator. + * @Default {9} + */ + trigger?: number; + + /**Specifies the visibility of indicator. + * @Default {visible} + */ + visibility?: string; + + /**Specifies the type of indicator that has to be rendered. + * @Default {sma. See IndicatorsType} + */ + type?: string; + + /**Options to customize the upper line in indicators + */ + upperLine?: IndicatorsUpperLine; + + /**Width of the indicator line. + * @Default {2} + */ + width?: number; + + /**Name of the horizontal axis used for indicator. Primary X axis is used when x axis name is not specified. + */ + xAxisName?: string; + + /**Name of the vertical axis used for indicator. Primary Y axis is used when y axis name is not specified + */ + yAxisName?: string; +} + +export interface LegendBorder { + + /**Border color of the legend. + * @Default {transparent} + */ + color?: string; + + /**Border width of the legend. + * @Default {1} + */ + width?: number; +} + +export interface LegendFont { + + /**Font family for legend item text. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Font style for legend item text. + * @Default {Normal. See FontStyle} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Font weight for legend item text. + * @Default {Regular. See FontWeight} + */ + fontWeight?: ej.datavisualization.Chart.FontWeight|string; + + /**Font size for legend item text. + * @Default {12px} + */ + size?: string; +} + +export interface LegendItemStyleBorder { + + /**Border color of the legend items. + * @Default {transparent} + */ + color?: string; + + /**Border width of the legend items. + * @Default {1} + */ + width?: number; +} + +export interface LegendItemStyle { + + /**Options for customizing the border of legend items. + */ + border?: LegendItemStyleBorder; + + /**Height of the shape in legend items. + * @Default {10} + */ + height?: number; + + /**Width of the shape in legend items. + * @Default {10} + */ + width?: number; +} + +export interface LegendLocation { + + /**X value or horizontal offset to position the legend in chart. + * @Default {0} + */ + x?: number; + + /**Y value or vertical offset to position the legend. + * @Default {0} + */ + y?: number; +} + +export interface LegendSize { + + /**Height of the legend. Height can be specified in either pixel or percentage. + * @Default {null} + */ + height?: string; + + /**Width of the legend. Width can be specified in either pixel or percentage. + * @Default {null} + */ + width?: string; +} + +export interface LegendTitleFont { + + /**Font family for the text in legend title. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Font style for legend title. + * @Default {normal. See FontStyle} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Font weight for legend title. + * @Default {normal. See FontWeight} + */ + fontWeight?: ej.datavisualization.Chart.FontWeight|string; + + /**Font size for legend title. + * @Default {12px} + */ + size?: string; +} + +export interface LegendTitle { + + /**Options to customize the font used for legend title + */ + font?: LegendTitleFont; + + /**Text to be displayed in legend title. + */ + text?: string; + + /**Alignment of the legend title. + * @Default {center. See Alignment} + */ + textAlignment?: ej.datavisualization.Chart.Alignment|string; +} + +export interface Legend { + + /**Horizontal alignment of the legend. + * @Default {Center. See Alignment} + */ + alignment?: ej.datavisualization.Chart.Alignment|string; + + /**Background for the legend. Use this property to add a background image or background color for the legend. + */ + background?: string; + + /**Options for customizing the legend border. + */ + border?: LegendBorder; + + /**Number of columns to arrange the legend items. + * @Default {null} + */ + columnCount?: number; + + /**Controls whether legend has to use scrollbar or not. When enabled, scroll bar appears depending upon size and position properties of legend. + * @Default {true} + */ + enableScrollbar?: boolean; + + /**Fill color for the legend items. By using this property, it displays all legend item shapes in same color.Legend items representing invisible series is displayed in gray color. + * @Default {null} + */ + fill?: string; + + /**Options to customize the font used for legend item text. + */ + font?: LegendFont; + + /**Gap or padding between the legend items. + * @Default {10} + */ + itemPadding?: number; + + /**Options to customize the style of legend items. + */ + itemStyle?: LegendItemStyle; + + /**Options to customize the location of chart legend. Legend is placed in provided location only when value of position property is custom + */ + location?: LegendLocation; + + /**Opacity of the legend. + * @Default {1} + */ + opacity?: number; + + /**Places the legend at specified position. Legend can be placed at left, right, top or bottom of the chart area.To manually specify the location of legend, set custom as value to this property. + * @Default {Bottom. See Position} + */ + position?: ej.datavisualization.Chart.Position|string; + + /**Number of rows to arrange the legend items. + * @Default {null} + */ + rowCount?: number; + + /**Shape of the legend items. Default shape for pie and doughnut series is circle and all other series uses rectangle. + * @Default {None. See Shape} + */ + shape?: ej.datavisualization.Chart.Shape|string; + + /**Options to customize the size of the legend. + */ + size?: LegendSize; + + /**Options to customize the legend title. + */ + title?: LegendTitle; + + /**Specifies the action taken when the legend width is more than the textWidth. + * @Default {none. See textOverflow} + */ + textOverflow?: ej.datavisualization.Chart.TextOverflow|string; + + /**Text width for legend item. + * @Default {34} + */ + textWidth?: number; + + /**Controls the visibility of the legend. + * @Default {true} + */ + visible?: boolean; +} + +export interface PrimaryXAxisAlternateGridBandEven { + + /**Fill color for the even grid bands. + * @Default {transparent} + */ + fill?: string; + + /**Opacity of the even grid band. + * @Default {1} + */ + opacity?: number; +} + +export interface PrimaryXAxisAlternateGridBandOdd { + + /**Fill color of the odd grid bands + * @Default {transparent} + */ + fill?: string; + + /**Opacity of odd grid band + * @Default {1} + */ + opacity?: number; +} + +export interface PrimaryXAxisAlternateGridBand { + + /**Options for customizing even grid band. + */ + even?: PrimaryXAxisAlternateGridBandEven; + + /**Options for customizing odd grid band. + */ + odd?: PrimaryXAxisAlternateGridBandOdd; +} + +export interface PrimaryXAxisAxisLine { + + /**Pattern of dashes and gaps to be applied to the axis line. + * @Default {null} + */ + dashArray?: string; + + /**Padding for axis line. Normally, it is used along with plotOffset to pad the plot area. + * @Default {null} + */ + offset?: number; + + /**Show/hides the axis line. + * @Default {true} + */ + visible?: boolean; + + /**Width of axis line. + * @Default {1} + */ + width?: number; +} + +export interface PrimaryXAxisCrosshairLabel { + + /**Show/hides the crosshair label associated with this axis. + * @Default {false} + */ + visible?: boolean; +} + +export interface PrimaryXAxisFont { + + /**Font family of labels. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Font style of labels. + * @Default {ej.datavisualization.Chart.FontStyle.Normal. See FontStyle} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Font weight of the label. + * @Default {ej.datavisualization.Chart.FontWeight.Regular. See FontWeight} + */ + fontWeight?: ej.datavisualization.Chart.FontWeight|string; + + /**Opacity of the axis labels. + * @Default {1} + */ + opacity?: number; + + /**Font size of the axis labels. + * @Default {13px} + */ + size?: string; +} + +export interface PrimaryXAxisMajorGridLines { + + /**Pattern of dashes and gaps used to stroke the major grid lines. + * @Default {null} + */ + dashArray?: string; + + /**Opacity of major grid lines. + * @Default {1} + */ + opacity?: number; + + /**Show/hides the major grid lines. + * @Default {true} + */ + visible?: boolean; + + /**Width of the major grid lines. + * @Default {1} + */ + width?: number; +} + +export interface PrimaryXAxisMajorTickLines { + + /**Length of the major tick lines. + * @Default {5} + */ + size?: number; + + /**Show/hides the major tick lines. + * @Default {true} + */ + visible?: boolean; + + /**Width of the major tick lines. + * @Default {1} + */ + width?: number; +} + +export interface PrimaryXAxisMinorGridLines { + + /**Patterns of dashes and gaps used to stroke the minor grid lines. + * @Default {null} + */ + dashArray?: string; + + /**Show/hides the minor grid lines. + * @Default {true} + */ + visible?: boolean; + + /**Width of the minorGridLines. + * @Default {1} + */ + width?: number; +} + +export interface PrimaryXAxisMinorTickLines { + + /**Length of the minor tick lines. + * @Default {5} + */ + size?: number; + + /**Show/hides the minor tick lines. + * @Default {true} + */ + visible?: boolean; + + /**Width of the minor tick line. + * @Default {1} + */ + width?: number; +} + +export interface PrimaryXAxisRange { + + /**Minimum value of the axis range. + * @Default {null} + */ + minimum?: number; + + /**Maximum value of the axis range. + * @Default {null} + */ + maximum?: number; + + /**Interval of the axis range. + * @Default {null} + */ + interval?: number; +} + +export interface PrimaryXAxisStripLineFont { + + /**Font color of the strip line text. + * @Default {black} + */ + color?: string; + + /**Font family of the strip line text. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Font style of the strip line text. + * @Default {Normal} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Font weight of the strip line text. + * @Default {regular} + */ + fontWeight?: string; + + /**Opacity of the strip line text. + * @Default {1} + */ + opacity?: number; + + /**Font size of the strip line text. + * @Default {12px} + */ + size?: string; +} + +export interface PrimaryXAxisStripLine { + + /**Border color of the strip line. + * @Default {gray} + */ + borderColor?: string; + + /**Background color of the strip line. + * @Default {gray} + */ + color?: string; + + /**End value of the strip line. + * @Default {null} + */ + end?: number; + + /**Options for customizing the font of the text. + */ + font?: PrimaryXAxisStripLineFont; + + /**Start value of the strip line. + * @Default {null} + */ + start?: number; + + /**Indicates whether to render the strip line from the minimum/start value of the axis. This property does not work when start property is set. + * @Default {false} + */ + startFromAxis?: boolean; + + /**Specifies text to be displayed inside the strip line. + * @Default {stripLine} + */ + text?: string; + + /**Specifies the alignment of the text inside the strip line. + * @Default {middlecenter. See TextAlignment} + */ + textAlignment?: ej.datavisualization.Chart.TextAlignment|string; + + /**Show/hides the strip line. + * @Default {false} + */ + visible?: boolean; + + /**Width of the strip line. + * @Default {0} + */ + width?: number; + + /**Specifies the order where the strip line and the series have to be rendered. When zOrder is “behind”, strip line is rendered under the series and when it is “over”, it is rendered above the series. + * @Default {over. See ZIndex} + */ + zIndex?: ej.datavisualization.Chart.ZIndex|string; +} + +export interface PrimaryXAxisTitleFont { + + /**Font family of the title text. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Font style of the title text. + * @Default {ej.datavisualization.Chart.FontStyle.Normal} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Font weight of the title text. + * @Default {ej.datavisualization.Chart.FontWeight.Regular. See FontWeight} + */ + fontWeight?: ej.datavisualization.Chart.FontWeight|string; + + /**Opacity of the axis title text. + * @Default {1} + */ + opacity?: number; + + /**Font size of the axis title. + * @Default {16px} + */ + size?: string; +} + +export interface PrimaryXAxisTitle { + + /**Specifies whether to trim the axis title when it exceeds the chart area or the maximum width of the title. + * @Default {false} + */ + enableTrim?: boolean; + + /**Options for customizing the title font. + */ + font?: PrimaryXAxisTitleFont; + + /**Maximum width of the title, when the title exceeds this width, the title gets trimmed, when enableTrim is true. + * @Default {34} + */ + maximumTitleWidth?: number; + + /**Title for the axis. + */ + text?: string; + + /**Controls the visibility of axis title. + * @Default {true} + */ + visible?: boolean; +} + +export interface PrimaryXAxis { + + /**Options for customizing horizontal axis alternate grid band. + */ + alternateGridBand?: PrimaryXAxisAlternateGridBand; + + /**Options for customizing the axis line. + */ + axisLine?: PrimaryXAxisAxisLine; + + /**Specifies the index of the column where the axis is associated, when the chart area is divided into multiple plot areas by using columnDefinitions. + * @Default {null} + */ + columnIndex?: number; + + /**Specifies the number of columns or plot areas an axis has to span horizontally. + * @Default {null} + */ + columnSpan?: number; + + /**Options to customize the crosshair label. + */ + crosshairLabel?: PrimaryXAxisCrosshairLabel; + + /**With this setting, you can request axis to calculate intervals approximately equal to your desired interval. + * @Default {null} + */ + desiredIntervals?: number; + + /**Specifies the position of labels at the edge of the axis. + * @Default {ej.datavisualization.Chart.EdgeLabelPlacement.None. See EdgeLabelPlacement} + */ + edgeLabelPlacement?: ej.datavisualization.Chart.EdgeLabelPlacement|string; + + /**Specifies whether to trim the axis label when the width of the label exceeds the maximumLabelWidth. + * @Default {false} + */ + enableTrim?: boolean; + + /**Options for customizing the font of the axis Labels. + */ + font?: PrimaryXAxisFont; + + /**Specifies the type of interval in date time axis. + * @Default {null. See IntervalType} + */ + intervalType?: ej.datavisualization.Chart.IntervalType|string; + + /**Specifies whether to inverse the axis. + * @Default {false} + */ + isInversed?: boolean; + + /**Custom formatting for axis label and supports all standard formatting type of numerical and date time values. + * @Default {null} + */ + labelFormat?: string; + + /**Specifies the action to take when the axis labels are overlapping with each other. + * @Default {ej.datavisualization.Chart.LabelIntersectAction.None. See LabelIntersectAction} + */ + labelIntersectAction?: ej.datavisualization.Chart.LabelIntersectAction|string; + + /**Specifies the position of the axis labels. + * @Default {outside. See LabelPosition} + */ + labelPosition?: ej.datavisualization.Chart.LabelPosition|string; + + /**Angle in degrees to rotate the axis labels. + * @Default {null} + */ + labelRotation?: number; + + /**Logarithmic base value. This is applicable only for logarithmic axis. + * @Default {10} + */ + logBase?: number; + + /**Options for customizing major gird lines. + */ + majorGridLines?: PrimaryXAxisMajorGridLines; + + /**Options for customizing the major tick lines. + */ + majorTickLines?: PrimaryXAxisMajorTickLines; + + /**Maximum number of labels to be displayed in every 100 pixels. + * @Default {3} + */ + maximumLabels?: number; + + /**Maximum width of the axis label. When the label exceeds the width, the label gets trimmed when the enableTrim is set to true. + * @Default {34} + */ + maximumLabelWidth?: number; + + /**Options for customizing the minor grid lines. + */ + minorGridLines?: PrimaryXAxisMinorGridLines; + + /**Options for customizing the minor tick lines. + */ + minorTickLines?: PrimaryXAxisMinorTickLines; + + /**Specifies the number of minor ticks per interval. + * @Default {null} + */ + minorTicksPerInterval?: number; + + /**Unique name of the axis. To associate an axis with the series, you have to set this name to the xAxisName/yAxisName property of the series. + * @Default {null} + */ + name?: string; + + /**Specifies whether to render the axis at the opposite side of its default position. + * @Default {false} + */ + opposedPosition?: boolean; + + /**Specifies the padding for the plot area. + * @Default {10} + */ + plotOffset?: number; + + /**Options to customize the range of the axis. + */ + range?: PrimaryXAxisRange; + + /**Specifies the padding for the axis range. + * @Default {None. See RangePadding} + */ + rangePadding?: ej.datavisualization.Chart.RangePadding|string; + + /**Rounds the number to the given number of decimals. + * @Default {null} + */ + roundingPlaces?: number; + + /**Options for customizing the strip lines. + * @Default {[ ]} + */ + stripLine?: Array; + + /**Specifies the position of the axis tick lines. + * @Default {outside. See TickLinesPosition} + */ + tickLinesPosition?: ej.datavisualization.Chart.TickLinesPosition|string; + + /**Options for customizing the axis title. + */ + title?: PrimaryXAxisTitle; + + /**Specifies the type of data the axis is handling. + * @Default {null. See ValueType} + */ + valueType?: ej.datavisualization.Chart.ValueType|string; + + /**Show/hides the axis. + * @Default {true} + */ + visible?: boolean; + + /**The axis is scaled by this factor. When zoomFactor is 0.5, the chart is scaled by 200% along this axis. Value ranges from 0 to 1. + * @Default {1} + */ + zoomFactor?: number; + + /**Position of the zoomed axis. Value ranges from 0 to 1. + * @Default {0} + */ + zoomPosition?: number; +} + +export interface PrimaryYAxisAlternateGridBandEven { + + /**Fill color for the even grid bands. + * @Default {transparent} + */ + fill?: string; + + /**Opacity of the even grid band. + * @Default {1} + */ + opacity?: number; +} + +export interface PrimaryYAxisAlternateGridBandOdd { + + /**Fill color of the odd grid bands. + * @Default {transparent} + */ + fill?: string; + + /**Opacity of odd grid band. + * @Default {1} + */ + opacity?: number; +} + +export interface PrimaryYAxisAlternateGridBand { + + /**Options for customizing even grid band. + */ + even?: PrimaryYAxisAlternateGridBandEven; + + /**Options for customizing odd grid band. + */ + odd?: PrimaryYAxisAlternateGridBandOdd; +} + +export interface PrimaryYAxisAxisLine { + + /**Pattern of dashes and gaps to be applied to the axis line. + * @Default {null} + */ + dashArray?: string; + + /**Padding for axis line. Normally, it is used along with plotOffset to pad the plot area. + * @Default {null} + */ + offset?: number; + + /**Show/hides the axis line. + * @Default {true} + */ + visible?: boolean; + + /**Width of axis line. + * @Default {1} + */ + width?: number; +} + +export interface PrimaryYAxisCrosshairLabel { + + /**Show/hides the crosshair label associated with this axis. + * @Default {false} + */ + visible?: boolean; +} + +export interface PrimaryYAxisFont { + + /**Font family of labels. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Font style of labels. + * @Default {ej.datavisualization.Chart.FontStyle.Normal. See FontStyle} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Font weight of the label. + * @Default {ej.datavisualization.Chart.FontWeight.Regular. See FontWeight} + */ + fontWeight?: ej.datavisualization.Chart.FontWeight|string; + + /**Opacity of the axis labels. + * @Default {1} + */ + opacity?: number; + + /**Font size of the axis labels. + * @Default {13px} + */ + size?: string; +} + +export interface PrimaryYAxisMajorGridLines { + + /**Pattern of dashes and gaps used to stroke the major grid lines. + * @Default {null} + */ + dashArray?: string; + + /**Opacity of major grid lines. + * @Default {1} + */ + opacity?: number; + + /**Show/hides the major grid lines. + * @Default {true} + */ + visible?: boolean; + + /**Width of the major grid lines. + * @Default {1} + */ + width?: number; +} + +export interface PrimaryYAxisMajorTickLines { + + /**Length of the major tick lines. + * @Default {5} + */ + size?: number; + + /**Show/hides the major tick lines. + * @Default {true} + */ + visible?: boolean; + + /**Width of the major tick lines. + * @Default {1} + */ + width?: number; +} + +export interface PrimaryYAxisMinorGridLines { + + /**Patterns of dashes and gaps used to stroke the minor grid lines. + * @Default {null} + */ + dashArray?: string; + + /**Show/hides the minor grid lines. + * @Default {true} + */ + visible?: boolean; + + /**Width of the minorGridLines. + * @Default {1} + */ + width?: number; +} + +export interface PrimaryYAxisMinorTickLines { + + /**Length of the minor tick lines. + * @Default {5} + */ + size?: number; + + /**Show/hides the minor tick lines. + * @Default {true} + */ + visible?: boolean; + + /**Width of the minor tick line + * @Default {1} + */ + width?: number; +} + +export interface PrimaryYAxisStripLineFont { + + /**Font color of the strip line text. + * @Default {black} + */ + color?: string; + + /**Font family of the strip line text. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Font style of the strip line text. + * @Default {Normal} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Font weight of the strip line text. + * @Default {regular} + */ + fontWeight?: string; + + /**Opacity of the strip line text. + * @Default {1} + */ + opacity?: number; + + /**Font size of the strip line text. + * @Default {12px} + */ + size?: string; +} + +export interface PrimaryYAxisStripLine { + + /**Border color of the strip line. + * @Default {gray} + */ + borderColor?: string; + + /**Background color of the strip line. + * @Default {gray} + */ + color?: string; + + /**End value of the strip line. + * @Default {null} + */ + end?: number; + + /**Options for customizing the font of the text. + */ + font?: PrimaryYAxisStripLineFont; + + /**Start value of the strip line. + * @Default {null} + */ + start?: number; + + /**Indicates whether to render the strip line from the minimum/start value of the axis. This property won’t work when start property is set. + * @Default {false} + */ + startFromAxis?: boolean; + + /**Specifies text to be displayed inside the strip line. + * @Default {stripLine} + */ + text?: string; + + /**Specifies the alignment of the text inside the strip line. + * @Default {middlecenter. See TextAlignment} + */ + textAlignment?: ej.datavisualization.Chart.TextAlignment|string; + + /**Show/hides the strip line. + * @Default {false} + */ + visible?: boolean; + + /**Width of the strip line. + * @Default {0} + */ + width?: number; + + /**Specifies the order in which strip line and the series have to be rendered. When zOrder is “behind”, strip line is rendered below the series and when it is “over”, it is rendered above the series. + * @Default {over. See ZIndex} + */ + zIndex?: ej.datavisualization.Chart.ZIndex|string; +} + +export interface PrimaryYAxisTitleFont { + + /**Font family of the title text. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Font style of the title text. + * @Default {ej.datavisualization.Chart.FontStyle.Normal} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Font weight of the title text. + * @Default {ej.datavisualization.Chart.FontWeight.Regular. See FontWeight} + */ + fontWeight?: ej.datavisualization.Chart.FontWeight|string; + + /**Opacity of the axis title text. + * @Default {1} + */ + opacity?: number; + + /**Font size of the axis title. + * @Default {16px} + */ + size?: string; +} + +export interface PrimaryYAxisTitle { + + /**Specifies whether to trim the axis title when it exceeds the chart area or the maximum width of the title. + * @Default {ej.datavisualization.Chart.enableTrim} + */ + enableTrim?: boolean; + + /**Options for customizing the title font. + */ + font?: PrimaryYAxisTitleFont; + + /**Maximum width of the title, when the title exceeds this width, the title gets trimmed, when enableTrim is true. + * @Default {ej.datavisualization.Chart.maximumTitleWidth.null} + */ + maximumTitleWidth?: number; + + /**Title for the axis. + */ + text?: string; + + /**Controls the visibility of axis title. + * @Default {true} + */ + visible?: boolean; +} + +export interface PrimaryYAxis { + + /**Options for customizing vertical axis alternate grid band. + */ + alternateGridBand?: PrimaryYAxisAlternateGridBand; + + /**Options for customizing the axis line. + */ + axisLine?: PrimaryYAxisAxisLine; + + /**Options to customize the crosshair label. + */ + crosshairLabel?: PrimaryYAxisCrosshairLabel; + + /**With this setting, you can request axis to calculate intervals approximately equal to your desired interval. + * @Default {null} + */ + desiredIntervals?: number; + + /**Specifies the position of labels at the edge of the axis. + * @Default {ej.datavisualization.Chart.EdgeLabelPlacement.None. See EdgeLabelPlacement} + */ + edgeLabelPlacement?: ej.datavisualization.Chart.EdgeLabelPlacement|string; + + /**Specifies whether to trim the axis label when the width of the label exceeds the maximumLabelWidth. + * @Default {false} + */ + enableTrim?: boolean; + + /**Options for customizing the font of the axis Labels. + */ + font?: PrimaryYAxisFont; + + /**Specifies the type of interval in date time axis. + * @Default {null. See IntervalType} + */ + intervalType?: ej.datavisualization.Chart.IntervalType|string; + + /**Specifies whether to inverse the axis. + * @Default {false} + */ + isInversed?: boolean; + + /**Custom formatting for axis label and supports all standard formatting type of numerical and date time values. + * @Default {null} + */ + labelFormat?: string; + + /**Specifies the action to take when the axis labels are overlapping with each other. + * @Default {ej.datavisualization.Chart.LabelIntersectAction.None} + */ + labelIntersectAction?: ej.datavisualization.Chart.LabelIntersectAction|string; + + /**Default Value + * @Default {outside. See LabelPosition} + */ + labelPosition?: ej.datavisualization.Chart.LabelPosition|string; + + /**Logarithmic base value. This is applicable only for logarithmic axis. + * @Default {10} + */ + logBase?: number; + + /**Options for customizing major gird lines. + */ + majorGridLines?: PrimaryYAxisMajorGridLines; + + /**Options for customizing the major tick lines. + */ + majorTickLines?: PrimaryYAxisMajorTickLines; + + /**Maximum number of labels to be displayed in every 100 pixels. + * @Default {3} + */ + maximumLabels?: number; + + /**Maximum width of the axis label. When the label exceeds the width, the label gets trimmed when the enableTrim is set to true. + * @Default {ej.datavisualization.Chart.maximumLabelWidth type {int}} + */ + maximumLabelWidth?: number; + + /**Options for customizing the minor grid lines. + */ + minorGridLines?: PrimaryYAxisMinorGridLines; + + /**Options for customizing the minor tick lines. + */ + minorTickLines?: PrimaryYAxisMinorTickLines; + + /**Specifies the number of minor ticks per interval. + * @Default {null} + */ + minorTicksPerInterval?: number; + + /**Unique name of the axis. To associate an axis with the series, you have to set this name to the xAxisName/yAxisName property of the series. + * @Default {null} + */ + name?: string; + + /**Specifies whether to render the axis at the opposite side of its default position. + * @Default {false} + */ + opposedPosition?: boolean; + + /**Specifies the padding for the plot area. + * @Default {10} + */ + plotOffset?: number; + + /**Specifies the padding for the axis range. + * @Default {ej.datavisualization.Chart.RangePadding.None. See RangePadding} + */ + rangePadding?: ej.datavisualization.Chart.RangePadding|string; + + /**Rounds the number to the given number of decimals. + * @Default {null} + */ + roundingPlaces?: number; + + /**Specifies the index of the row to which the axis is associated, when the chart area is divided into multiple plot areas by using rowDefinitions. + * @Default {null} + */ + rowIndex?: number; + + /**Specifies the number of row or plot areas an axis has to span vertically. + * @Default {null} + */ + rowSpan?: number; + + /**Options for customizing the strip lines. + * @Default {[ ]} + */ + stripLine?: Array; + + /**Specifies the position of the axis tick lines. + * @Default {outside. See TickLinesPosition} + */ + tickLinesPosition?: ej.datavisualization.Chart.TickLinesPosition|string; + + /**Options for customizing the axis title. + */ + title?: PrimaryYAxisTitle; + + /**Specifies the type of data the axis is handling. + * @Default {null. See ValueType} + */ + valueType?: ej.datavisualization.Chart.ValueType|string; + + /**Show/hides the axis. + * @Default {true} + */ + visible?: boolean; + + /**The axis is scaled by this factor. When zoomFactor is 0.5, the chart is scaled by 200% along this axis. Values ranges from 0 to 1. + * @Default {1} + */ + zoomFactor?: number; + + /**Position of the zoomed axis. Value ranges from 0 to 1 + * @Default {0} + */ + zoomPosition?: number; +} + +export interface RowDefinitions { + + /**Specifies the unit to measure the height of the row in plotting area. + * @Default {'pixel'. See Unit} + */ + unit?: ej.datavisualization.Chart.Unit|string; + + /**Height of the row in plotting area. Height is measured in either pixel or percentage based on the value of unit property. + * @Default {50} + */ + rowHeight?: number; + + /**Color of the line that indicates the starting point of the row in plotting area. + * @Default {transparent} + */ + lineColor?: string; + + /**Width of the line that indicates the starting point of the row in plot area. + * @Default {1} + */ + lineWidth?: number; +} + +export interface SeriesBorder { + + /**Border color of the series. + * @Default {transparent} + */ + color?: string; + + /**Border width of the series. + * @Default {1} + */ + width?: number; + + /**DashArray for border of the series. + * @Default {null} + */ + dashArray?: string; +} + +export interface SeriesFont { + + /**Font color of the series text. + * @Default {#707070} + */ + color?: string; + + /**Font Family of the series. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Font Style of the series. + * @Default {Normal} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Font weight of the series. + * @Default {Regular} + */ + fontWeight?: ej.datavisualization.Chart.FontWeight|string; + + /**Opacity of series text. + * @Default {1} + */ + opacity?: number; + + /**Size of the series text. + * @Default {12px} + */ + size?: string; +} + +export interface SeriesMarkerBorder { + + /**Border color of the marker shape. + * @Default {white} + */ + color?: string; + + /**Border width of the marker shape. + * @Default {3} + */ + width?: number; +} + +export interface SeriesMarkerDataLabelBorder { + + /**Border color of the data label. + * @Default {null} + */ + color?: string; + + /**Border width of the data label. + * @Default {0.1} + */ + width?: number; +} + +export interface SeriesMarkerDataLabelConnectorLine { + + /**Specifies when the connector has to be drawn as Bezier curve or straight line. This is applicable only for Pie and Doughnut chart types. + * @Default {line. See ConnectorLineType} + */ + type?: ej.datavisualization.Chart.Type|string; + + /**Width of the connector. + * @Default {0.5} + */ + width?: number; +} + +export interface SeriesMarkerDataLabelFont { + + /**Font family of the data label. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Font style of the data label. + * @Default {normal. See FontStyle} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Font weight of the data label. + * @Default {regular. See FontWeight} + */ + fontWeight?: ej.datavisualization.Chart.FontWeight|string; + + /**Opacity of the text. + * @Default {1} + */ + opacity?: number; + + /**Font size of the data label. + * @Default {12px} + */ + size?: string; +} + +export interface SeriesMarkerDataLabelMargin { + + /**Bottom margin of the text. + * @Default {5} + */ + bottom?: number; + + /**Left margin of the text. + * @Default {5} + */ + left?: number; + + /**Right margin of the text. + * @Default {5} + */ + right?: number; + + /**Top margin of the text. + * @Default {5} + */ + top?: number; +} + +export interface SeriesMarkerDataLabel { + + /**Angle of the data label in degrees. Only the text gets rotated, whereas the background and border does not rotate. + * @Default {null} + */ + angle?: number; + + /**Options for customizing the border of the data label. + */ + border?: SeriesMarkerDataLabelBorder; + + /**Options for displaying and customizing the line that connects point and data label. + */ + connectorLine?: SeriesMarkerDataLabelConnectorLine; + + /**Background color of the data label. + * @Default {null} + */ + fill?: string; + + /**Options for customizing the data label font. + */ + font?: SeriesMarkerDataLabelFont; + + /**Horizontal alignment of the data label. + * @Default {center} + */ + horizontalTextAlignment?: ej.datavisualization.Chart.HorizontalTextAlignment|string; + + /**Margin of the text to its background shape. The size of the background shape increases based on the margin applied to its text. + */ + margin?: SeriesMarkerDataLabelMargin; + + /**Opacity of the data label. + * @Default {1} + */ + opacity?: number; + + /**Background shape of the data label. + * @Default {No shape is rendered by default, so its value is ‘none’. See Shape} + */ + shape?: ej.datavisualization.Chart.Shape|string; + + /**Name of a field in data source where datalabel text is displayed. + */ + textMappingName?: string; + + /**Specifies the position of the data label. This property can be used only for the series such as column, bar, stacked column, stacked bar, 100% stacked column, 100% stacked bar, candle and OHLC. + * @Default {top. See TextPosition} + */ + textPosition?: ej.datavisualization.Chart.TextPosition|string; + + /**Vertical alignment of the data label. + * @Default {'center'} + */ + verticalTextAlignment?: ej.datavisualization.Chart.VerticalTextAlignment|string; + + /**Controls the visibility of the data labels. + * @Default {false} + */ + visible?: boolean; + + /**Custom template to format the data label content. Use “point.x” and “point.y” as a placeholder text to display the corresponding data point’s x and y value. + */ + template?: string; + + /**Moves the label vertically by some offset. + * @Default {0} + */ + offset?: number; +} + +export interface SeriesMarkerSize { + + /**Height of the marker. + * @Default {6} + */ + height?: number; + + /**Width of the marker. + * @Default {6} + */ + width?: number; +} + +export interface SeriesMarker { + + /**Options for customizing the border of the marker shape. + */ + border?: SeriesMarkerBorder; + + /**Options for displaying and customizing data labels. + */ + dataLabel?: SeriesMarkerDataLabel; + + /**Color of the marker shape. + * @Default {null} + */ + fill?: string; + + /**The URL for the Image that is to be displayed as marker. In order to display image as marker, set series.marker.shape as ‘image’. + */ + imageUrl?: string; + + /**Opacity of the marker. + * @Default {1} + */ + opacity?: number; + + /**Specifies the shape of the marker. + * @Default {circle. See Shape} + */ + shape?: ej.datavisualization.Chart.Shape|string; + + /**Options for customizing the size of the marker shape. + */ + size?: SeriesMarkerSize; + + /**Controls the visibility of the marker shape. + * @Default {false} + */ + visible?: boolean; +} + +export interface SeriesEmptyPointSettingsStyleBorder { + + /**Border color of the empty point. + */ + color?: string; + + /**Border width of the empty point. + * @Default {1} + */ + width?: number; +} + +export interface SeriesEmptyPointSettingsStyle { + + /**Color of the empty point. + */ + color?: string; + + /**Options for customizing border of the empty point in the series. + */ + border?: SeriesEmptyPointSettingsStyleBorder; +} + +export interface SeriesEmptyPointSettings { + + /**Controls the visibility of the empty point. + * @Default {true} + */ + visible?: boolean; + + /**Specifies the mode of empty point. + * @Default {gap} + */ + displayMode?: ej.datavisualization.Chart.EmptyPointMode|string; + + /**Options for customizing the color and border of the empty point in the series. + */ + style?: SeriesEmptyPointSettingsStyle; +} + +export interface SeriesConnectorLine { + + /**Width of the connector line. + * @Default {1} + */ + width?: number; + + /**Color of the connector line. + * @Default {#565656} + */ + color?: string; + + /**DashArray of the connector line. + * @Default {null} + */ + dashArray?: string; + + /**DashArray of the connector line. + * @Default {1} + */ + opacity?: number; +} + +export interface SeriesErrorBarCap { + + /**Show/Hides the error bar cap. + * @Default {true} + */ + visible?: boolean; + + /**Width of the error bar cap. + * @Default {1} + */ + width?: number; + + /**Length of the error bar cap. + * @Default {1} + */ + length?: number; + + /**Color of the error bar cap. + * @Default {#000000} + */ + fill?: string; +} + +export interface SeriesErrorBar { + + /**Show/hides the error bar + * @Default {visible} + */ + visibility?: boolean; + + /**Specifies the type of error bar. + * @Default {FixedValue} + */ + type?: ej.datavisualization.Chart.ErrorBarType|string; + + /**Specifies the mode of error bar. + * @Default {vertical} + */ + mode?: ej.datavisualization.Chart.ErrorBarMode|string; + + /**Specifies the direction of error bar. + * @Default {both} + */ + direction?: ej.datavisualization.Chart.ErrorBarDirection|string; + + /**Value of vertical error bar. + * @Default {3} + */ + verticalErrorValue?: number; + + /**Value of horizontal error bar. + * @Default {1} + */ + horizontalErrorValue?: number; + + /**Value of positive horizontal error bar. + * @Default {1} + */ + horizontalPositiveErrorValue?: number; + + /**Value of negative horizontal error bar. + * @Default {1} + */ + horizontalNegativeErrorValue?: number; + + /**Value of positive vertical error bar. + * @Default {5} + */ + verticalPositiveErrorValue?: number; + + /**Value of negative vertical error bar. + * @Default {5} + */ + verticalNegativeErrorValue?: number; + + /**Fill color of the error bar. + * @Default {#000000} + */ + fill?: string; + + /**Width of the error bar. + * @Default {1} + */ + width?: number; + + /**Options for customizing the error bar cap. + */ + cap?: SeriesErrorBarCap; +} + +export interface SeriesPointsBorder { + + /**Border color of the point. + * @Default {null} + */ + color?: string; + + /**Border width of the point. + * @Default {null} + */ + width?: number; +} + +export interface SeriesPointsMarkerBorder { + + /**Border color of the marker shape. + * @Default {white} + */ + color?: string; + + /**Border width of the marker shape. + * @Default {3} + */ + width?: number; +} + +export interface SeriesPointsMarkerDataLabelBorder { + + /**Border color of the data label. + * @Default {null} + */ + color?: string; + + /**Border width of the data label. + * @Default {0.1} + */ + width?: number; +} + +export interface SeriesPointsMarkerDataLabelConnectorLine { + + /**Specifies when the connector has to be drawn as Bezier curve or straight line. This is applicable only for Pie and Doughnut chart types. + * @Default {line. See ConnectorLineType} + */ + type?: ej.datavisualization.Chart.ConnectorLineType|string; + + /**Width of the connector. + * @Default {0.5} + */ + width?: number; +} + +export interface SeriesPointsMarkerDataLabelFont { + + /**Font family of the data label. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Font style of the data label. + * @Default {normal. See FontStyle} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Font weight of the data label. + * @Default {regular. See FontWeight} + */ + fontWeight?: ej.datavisualization.Chart.FontWeight|string; + + /**Opacity of the text. + * @Default {1} + */ + opacity?: number; + + /**Font size of the data label. + * @Default {12px} + */ + size?: string; +} + +export interface SeriesPointsMarkerDataLabelMargin { + + /**Bottom margin of the text. + * @Default {5} + */ + bottom?: number; + + /**Left margin of the text. + * @Default {5} + */ + left?: number; + + /**Right margin of the text. + * @Default {5} + */ + right?: number; + + /**Top margin of the text. + * @Default {5} + */ + top?: number; +} + +export interface SeriesPointsMarkerDataLabel { + + /**Angle of the data label in degrees. Only the text gets rotated, whereas the background and border does not rotate. + * @Default {null} + */ + angle?: number; + + /**Options for customizing the border of the data label. + */ + border?: SeriesPointsMarkerDataLabelBorder; + + /**Options for displaying and customizing the line that connects point and data label. + */ + connectorLine?: SeriesPointsMarkerDataLabelConnectorLine; + + /**Background color of the data label. + * @Default {null} + */ + fill?: string; + + /**Options for customizing the data label font. + */ + font?: SeriesPointsMarkerDataLabelFont; + + /**Horizontal alignment of the data label. + * @Default {center} + */ + horizontalTextAlignment?: ej.datavisualization.Chart.HorizontalTextAlignment|string; + + /**Margin of the text to its background shape. The size of the background shape increases based on the margin applied to its text. + */ + margin?: SeriesPointsMarkerDataLabelMargin; + + /**Opacity of the data label. + * @Default {1} + */ + opacity?: number; + + /**Background shape of the data label. + * @Default {No shape is rendered by default, so its value is ‘none’. See Shape} + */ + shape?: ej.datavisualization.Chart.Shape|string; + + /**Specifies the position of the data label. This property can be used only for the series such as column, bar, stacked column, stacked bar, 100% stacked column, 100% stacked bar, candle and OHLC. + * @Default {top. See TextPosition} + */ + textPosition?: ej.datavisualization.Chart.TextPosition|string; + + /**Vertical alignment of the data label. + * @Default {'center'} + */ + verticalTextAlignment?: ej.datavisualization.Chart.VerticalTextAlignment|string; + + /**Controls the visibility of the data labels. + * @Default {false} + */ + visible?: boolean; + + /**Custom template to format the data label content. Use “point.x” and “point.y” as a placeholder text to display the corresponding data point’s x and y value. + */ + template?: string; + + /**Moves the label vertically by specified offset. + * @Default {0} + */ + offset?: number; +} + +export interface SeriesPointsMarkerSize { + + /**Height of the marker. + * @Default {6} + */ + height?: number; + + /**Width of the marker. + * @Default {6} + */ + width?: number; +} + +export interface SeriesPointsMarker { + + /**Options for customizing the border of the marker shape. + */ + border?: SeriesPointsMarkerBorder; + + /**Options for displaying and customizing data label. + */ + dataLabel?: SeriesPointsMarkerDataLabel; + + /**Color of the marker shape. + * @Default {null} + */ + fill?: string; + + /**The URL for the Image that is to be displayed as marker. In order to display image as marker, set series.marker.shape as ‘image’. + */ + imageUrl?: string; + + /**Opacity of the marker. + * @Default {1} + */ + opacity?: number; + + /**Specifies the shape of the marker. + * @Default {circle. See Shape} + */ + shape?: ej.datavisualization.Chart.Shape|string; + + /**Options for customizing the size of the marker shape. + */ + size?: SeriesPointsMarkerSize; + + /**Controls the visibility of the marker shape. + * @Default {false} + */ + visible?: boolean; +} + +export interface SeriesPoints { + + /**Options for customizing the border of a point. This is applicable only for column type series and accumulation type series. + */ + border?: SeriesPointsBorder; + + /**To show/hide the intermediate summary from the last intermediate point. + * @Default {false} + */ + showIntermediateSum?: boolean; + + /**To show/hide the total summary of the waterfall series. + * @Default {false} + */ + showTotalSum?: boolean; + + /**Close value of the point. Close value is applicable only for financial type series. + * @Default {null} + */ + close?: number; + + /**Size of a bubble in the bubble series. This is applicable only for the bubble series. + * @Default {null} + */ + size?: number; + + /**Background color of the point. This is applicable only for column type series and accumulation type series. + * @Default {null} + */ + fill?: string; + + /**High value of the point. High value is applicable only for financial type series, range area series and range column series. + * @Default {null} + */ + high?: number; + + /**Low value of the point. Low value is applicable only for financial type series, range area series and range column series. + * @Default {null} + */ + low?: number; + + /**Options for displaying and customizing marker for a data point. Marker contains shapes and/or data labels. + */ + marker?: SeriesPointsMarker; + + /**Open value of the point. This is applicable only for financial type series. + * @Default {null} + */ + open?: number; + + /**Datalabel text for the point. + * @Default {null} + */ + text?: string; + + /**X value of the point. + * @Default {null} + */ + x?: number; + + /**Y value of the point. + * @Default {null} + */ + y?: number; +} + +export interface SeriesTooltipBorder { + + /**Border Color of the tooltip. + * @Default {null} + */ + color?: string; + + /**Border Width of the tooltip. + * @Default {1} + */ + width?: number; +} + +export interface SeriesTooltip { + + /**Options for customizing the border of the tooltip. + */ + border?: SeriesTooltipBorder; + + /**Customize the corner radius of the tooltip rectangle. + * @Default {0} + */ + rx?: number; + + /**Customize the corner radius of the tooltip rectangle. + * @Default {0} + */ + ry?: number; + + /**Specifies the duration, the tooltip has to be displayed. + * @Default {500ms} + */ + duration?: string; + + /**Enables/disables the animation of the tooltip when moving from one point to another. + * @Default {true} + */ + enableAnimation?: boolean; + + /**Background color of the tooltip. + * @Default {null} + */ + fill?: string; + + /**Format of the tooltip content. + * @Default {#point.x# : #point.y#} + */ + format?: string; + + /**Opacity of the tooltip. + * @Default {0.95} + */ + opacity?: number; + + /**Custom template to format the tooltip content. Use “point.x” and “point.y” as a placeholder text to display the corresponding data point’s x and y value. + * @Default {null} + */ + template?: string; + + /**Controls the visibility of the tooltip. + * @Default {false} + */ + visible?: boolean; +} + +export interface SeriesTrendlines { + + /**Show/hides the trendline. + */ + visibility?: boolean; + + /**Specifies the type of trendline for the series. + * @Default {linear. See TrendlinesType} + */ + type?: string; + + /**Name for the trendlines that is to be displayed in legend text. + * @Default {Trendline} + */ + name?: string; + + /**Fill color of the trendlines. + * @Default {#0000FF} + */ + fill?: string; + + /**Width of the trendlines. + * @Default {1} + */ + width?: number; + + /**Opacity of the trendline. + * @Default {1} + */ + opacity?: number; + + /**Pattern of dashes and gaps used to stroke the trendline. + */ + dashArray?: string; + + /**Future trends of the current series. + * @Default {0} + */ + forwardForecast?: number; + + /**Past trends of the current series. + * @Default {0} + */ + backwardForecast?: number; + + /**Specifies the order of polynomial trendlines. + * @Default {0} + */ + polynomialOrder?: number; + + /**Specifies the moving average starting period value. + * @Default {2} + */ + period?: number; +} + +export interface SeriesHighlightSettingsBorder { + + /**Border color of the series/point on highlight. + */ + color?: string; + + /**Border width of the series/point on highlight. + * @Default {2} + */ + width?: string; +} + +export interface SeriesHighlightSettings { + + /**Enables/disables the ability to highlight series or data point interactively. + * @Default {false} + */ + enable?: boolean; + + /**Specifies whether series or data point has to be highlighted. + * @Default {series. See Mode} + */ + mode?: ej.datavisualization.Chart.Mode|string; + + /**Color of the series/point on highlight. + */ + color?: string; + + /**Opacity of the series/point on highlight. + * @Default {0.6} + */ + opacity?: number; + + /**Options for customizing the border of series on highlight. + */ + border?: SeriesHighlightSettingsBorder; + + /**Specifies the pattern for the series/point on highlight. + * @Default {none. See Pattern} + */ + pattern?: string; + + /**Custom pattern for the series on highlight. + */ + customPattern?: string; +} + +export interface SeriesSelectionSettingsBorder { + + /**Border color of the series/point on selection. + */ + color?: string; + + /**Border width of the series/point on selection. + * @Default {2} + */ + width?: string; +} + +export interface SeriesSelectionSettings { + + /**Enables/disables the ability to select a series/data point interactively. + * @Default {false} + */ + enable?: boolean; + + /**Specifies whether series or data point has to be selected. + * @Default {series. See Mode} + */ + mode?: ej.datavisualization.Chart.Mode|string; + + /**Specifies the type of selection. + * @Default {single} + */ + type?: ej.datavisualization.Chart.SelectionType|string; + + /**Color of the series/point on selection. + */ + color?: string; + + /**Opacity of the series/point on selection. + * @Default {0.6} + */ + opacity?: number; + + /**Options for customizing the border of series on selection. + */ + border?: SeriesSelectionSettingsBorder; + + /**Specifies the pattern for the series/point on selection. + * @Default {none. See Pattern} + */ + pattern?: string; + + /**Custom pattern for the series on selection. + */ + customPattern?: string; +} + +export interface Series { + + /**Color of the point, where the close is up in financial chart. + * @Default {null} + */ + bearFillColor?: string; + + /**Options for customizing the border of the series. + */ + border?: SeriesBorder; + + /**Color of the point, where the close is down in financial chart. + * @Default {null} + */ + bullFillColor?: string; + + /**Pattern of dashes and gaps used to stroke the line type series. + */ + dashArray?: string; + + /**Specifies the dataSource for the series. It can be an array of JSON objects or an instance of ej.DataManager. + * @Default {null} + */ + dataSource?: any; + + /**Controls the size of the hole in doughnut series. Value ranges from 0 to 1. + * @Default {0.4} + */ + doughnutCoefficient?: number; + + /**Controls the size of the doughnut series. Value ranges from 0 to 1. + * @Default {0.8} + */ + doughnutSize?: number; + + /**Type of series to be drawn in radar or polar series. + * @Default {line. See DrawType} + */ + drawType?: boolean; + + /**Enable/disable the animation of series. + * @Default {false} + */ + enableAnimation?: boolean; + + /**To avoid overlapping of data labels smartly. + * @Default {null} + */ + enableSmartLabels?: number; + + /**End angle of pie/doughnut series. For a complete circle, it has to be 360, by default. + * @Default {null} + */ + endAngle?: number; + + /**Explodes the pie/doughnut slices on mouse move. + * @Default {false} + */ + explode?: boolean; + + /**Explodes all the slice of pie/doughnut on render. + * @Default {null} + */ + explodeAll?: boolean; + + /**Index of the point to be exploded from pie/doughnut/pyramid/funnel. + * @Default {null} + */ + explodeIndex?: number; + + /**Specifies the distance of the slice from the center, when it is exploded. + * @Default {25} + */ + explodeOffset?: number; + + /**Fill color of the series. + * @Default {null} + */ + fill?: string; + + /**Options for customizing the series font. + */ + font?: SeriesFont; + + /**Specifies the height of the funnel in funnel series. Values can be in both pixel and percentage. + * @Default {32.7%} + */ + funnelHeight?: string; + + /**Specifies the width of the funnel in funnel series. Values can be in both pixel and percentage. + * @Default {11.6%} + */ + funnelWidth?: string; + + /**Gap between the slices of pyramid/funnel series. + * @Default {0} + */ + gapRatio?: number; + + /**Specifies whether to join start and end point of a line/area series used in polar/radar chart to form a closed path. + * @Default {true} + */ + isClosed?: boolean; + + /**Specifies whether to stack the column series in polar/radar charts. + * @Default {true} + */ + isStacking?: boolean; + + /**Renders the chart vertically. This is applicable only for cartesian type series. + * @Default {false} + */ + isTransposed?: boolean; + + /**Position of the data label in pie/doughnut/pyramid/funnel series. OutsideExtended position is not applicable for pyramid/funnel. + * @Default {inside. See LabelPosition} + */ + labelPosition?: ej.datavisualization.Chart.LabelPosition|string; + + /**Specifies the line cap of the series. + * @Default {Butt. See LineCap} + */ + lineCap?: ej.datavisualization.Chart.LineCap|string; + + /**Specifies the type of shape to be used where two lines meet. + * @Default {Round. See LineJoin} + */ + lineJoin?: ej.datavisualization.Chart.LineJoin|string; + + /**Options for displaying and customizing marker for individual point in a series. Marker contains shapes and/or data labels. + */ + marker?: SeriesMarker; + + /**Opacity of the series. + * @Default {1} + */ + opacity?: number; + + /**Name of a field in data source where fill color for all the data points is generated. + */ + palette?: string; + + /**Controls the size of pie series. Value ranges from 0 to 1. + * @Default {0.8} + */ + pieCoefficient?: number; + + /**Options for customizing the empty point in the series. + */ + emptyPointSettings?: SeriesEmptyPointSettings; + + /**Fill color for the positive column of the waterfall. + * @Default {null} + */ + positiveFill?: string; + + /**Options for customizing the waterfall connector line. + */ + connectorLine?: SeriesConnectorLine; + + /**Options to customize the error bar in series. + */ + errorBar?: SeriesErrorBar; + + /**Option to add data points; each point should have x and y property. Also, optionally, you can customize the points color, border, marker by using fill, border and marker options. + */ + points?: Array; + + /**Specifies the mode of the pyramid series. + * @Default {linear} + */ + pyramidMode?: ej.datavisualization.Chart.PyramidMode|string; + + /**Specifies ej.Query to select data from dataSource. This property is applicable only when the dataSource is ej.DataManager. + * @Default {null} + */ + query?: any; + + /**Start angle from where the pie/doughnut series renders. It starts from 0, by default. + * @Default {null} + */ + startAngle?: number; + + /**Options for customizing the tooltip of chart. + */ + tooltip?: SeriesTooltip; + + /**Specifies the type of the series to render in chart. + * @Default {column. see Type} + */ + type?: ej.datavisualization.Chart.Type|string; + + /**Controls the visibility of the series. + * @Default {visible} + */ + visibility?: string; + + /**Specifies the name of the x-axis that has to be associated with this series. Add an axis instance with this name to axes collection. + * @Default {null} + */ + xAxisName?: string; + + /**Name of the property in the datasource that contains x value for the series. + * @Default {null} + */ + xName?: string; + + /**Specifies the name of the y-axis that has to be associated with this series. Add an axis instance with this name to axes collection. + * @Default {null} + */ + yAxisName?: string; + + /**Name of the property in the datasource that contains y value for the series. + * @Default {null} + */ + yName?: string; + + /**Name of the property in the datasource that contains high value for the series. + * @Default {null} + */ + high?: string; + + /**Name of the property in the datasource that contains low value for the series. + * @Default {null} + */ + low?: string; + + /**Name of the property in the datasource that contains open value for the series. + * @Default {null} + */ + open?: string; + + /**Name of the property in the datasource that contains close value for the series. + * @Default {null} + */ + close?: string; + + /**Name of the property in the datasource that contains the size value for the bubble series. + * @Default {null} + */ + size?: string; + + /**Option to add trendlines to chart. + */ + trendlines?: Array; + + /**Options for customizing the appearance of the series or data point while highlighting. + */ + highlightSettings?: SeriesHighlightSettings; + + /**Options for customizing the appearance of the series/data point on selection. + */ + selectionSettings?: SeriesSelectionSettings; +} + +export interface Size { + + /**Height of the Chart. Height can be specified in either pixel or percentage. + * @Default {'450'} + */ + height?: string; + + /**Width of the Chart. Width can be specified in either pixel or percentage. + * @Default {'450'} + */ + width?: string; +} + +export interface TitleBorder { + + /**Width of the title border. + * @Default {1} + */ + width?: number; + + /**color of the title border. + * @Default {transparent} + */ + color?: string; + + /**opacity of the title border. + * @Default {0.8} + */ + opacity?: number; + + /**opacity of the title border. + * @Default {0.8} + */ + cornerRadius?: number; +} + +export interface TitleFont { + + /**Font family for Chart title. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Font style for Chart title. + * @Default {Normal. See FontStyle} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Font weight for Chart title. + * @Default {Regular. See FontWeight} + */ + fontWeight?: ej.datavisualization.Chart.FontWeight|string; + + /**Opacity of the Chart title. + * @Default {0.5} + */ + opacity?: number; + + /**Font size for Chart title. + * @Default {20px} + */ + size?: string; +} + +export interface TitleSubTitleFont { + + /**Font family of sub title. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Font style for sub title. + * @Default {Normal. See FontStyle} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Font weight for sub title. + * @Default {Regular. See FontWeight} + */ + fontWeight?: ej.datavisualization.Chart.FontWeight|string; + + /**Opacity of the sub title. + * @Default {1} + */ + opacity?: number; + + /**Font size for sub title. + * @Default {12px} + */ + size?: string; +} + +export interface TitleSubTitleBorder { + + /**Width of the subtitle border. + * @Default {1} + */ + width?: number; + + /**color of the subtitle border. + * @Default {transparent} + */ + color?: string; + + /**opacity of the subtitle border. + * @Default {0.8} + */ + opacity?: number; + + /**opacity of the subtitle border. + * @Default {0.8} + */ + cornerRadius?: number; +} + +export interface TitleSubTitle { + + /**Options for customizing the font of sub title. + */ + font?: TitleSubTitleFont; + + /**Background color for the chart subtitle. + * @Default {transparent} + */ + background?: string; + + /**Options to customize the border of the title. + */ + border?: TitleSubTitleBorder; + + /**Text to be displayed in sub title. + */ + text?: string; + + /**Alignment of sub title text. + * @Default {far. See TextAlignment} + */ + textAlignment?: ej.datavisualization.Chart.Alignment|string; +} + +export interface Title { + + /**Background color for the chart title. + * @Default {transparent} + */ + background?: string; + + /**Options to customize the border of the title. + */ + border?: TitleBorder; + + /**Options for customizing the font of Chart title. + */ + font?: TitleFont; + + /**Options to customize the sub title of Chart. + */ + subTitle?: TitleSubTitle; + + /**Text to be displayed in Chart title. + */ + text?: string; + + /**Alignment of the title text. + * @Default {Center. See TextAlignment} + */ + textAlignment?: ej.datavisualization.Chart.Alignment|string; +} + +export interface Zooming { + + /**Enables or disables zooming. + * @Default {false} + */ + enable?: boolean; + + /**Enable or disables the differed zooming. When it is enabled, chart is updated only on mouse up action while zooming and panning. + * @Default {false} + */ + enableDeferredZoom?: boolean; + + /**Enables/disables the ability to zoom the chart on moving the mouse wheel. + * @Default {false} + */ + enableMouseWheel?: boolean; + + /**Specifies whether to allow zooming the chart vertically or horizontally or in both ways. + * @Default {'x,y'} + */ + type?: string; + + /**To display user specified buttons in zooming toolbar. + * @Default {[zoomIn, zoomOut, zoom, pan, reset]} + */ + toolbarItems?: Array; +} +} +module Chart +{ +enum CoordinateUnit +{ +//string +None, +//string +Pixels, +//string +Points, +} +} +module Chart +{ +enum HorizontalAlignment +{ +//string +Left, +//string +Right, +//string +Middle, +} +} +module Chart +{ +enum Region +{ +//string +Chart, +//string +Series, +} +} +module Chart +{ +enum VerticalAlignment +{ +//string +Top, +//string +Bottom, +//string +Middle, +} +} +module Chart +{ +enum Unit +{ +//string +Percentage, +//string +Pixel, +} +} +module Chart +{ +enum DrawType +{ +//string +Line, +//string +Area, +//string +Column, +} +} +module Chart +{ +enum FontStyle +{ +//string +Normal, +//string +Italic, +} +} +module Chart +{ +enum FontWeight +{ +//string +Regular, +//string +Bold, +//string +Lighter, +} +} +module Chart +{ +enum LabelPosition +{ +//string +Inside, +//string +Outside, +//string +OutsideExtended, +} +} +module Chart +{ +enum LineCap +{ +//string +Butt, +//string +Round, +//string +Square, +} +} +module Chart +{ +enum LineJoin +{ +//string +Round, +//string +Bevel, +//string +Miter, +} +} +module Chart +{ +enum ConnectorLineType +{ +//string +Line, +//string +Bezier, +} +} +module Chart +{ +enum HorizontalTextAlignment +{ +//string +Center, +//string +Near, +//string +Far, +} +} +module Chart +{ +enum Shape +{ +//string +None, +//string +LeftArrow, +//string +RightArrow, +//string +Circle, +//string +Cross, +//string +HorizLine, +//string +VertLine, +//string +Diamond, +//string +Rectangle, +//string +Triangle, +//string +Hexagon, +//string +Pentagon, +//string +Star, +//string +Ellipse, +//string +Trapezoid, +//string +UpArrow, +//string +DownArrow, +//string +Image, +//string +SeriesType, +} +} +module Chart +{ +enum TextPosition +{ +//string +Top, +//string +Bottom, +//string +Middle, +} +} +module Chart +{ +enum VerticalTextAlignment +{ +//string +Center, +//string +Near, +//string +Far, +} +} +module Chart +{ +enum PyramidMode +{ +//string +Linear, +//string +Surface, +} +} +module Chart +{ +enum Type +{ +//string +Area, +//string +Line, +//string +Spline, +//string +Column, +//string +Scatter, +//string +Bubble, +//string +SplineArea, +//string +StepArea, +//string +StepLine, +//string +Pie, +//string +Hilo, +//string +HiloOpenClose, +//string +Candle, +//string +Bar, +//string +StackingArea, +//string +StackingArea100, +//string +RangeColumn, +//string +StackingColumn, +//string +StackingColumn100, +//string +StackingBar, +//string +StackingBar100, +//string +Pyramid, +//string +Funnel, +//string +Doughnut, +//string +Polar, +//string +Radar, +//string +RangeArea, +} +} +module Chart +{ +enum EmptyPointMode +{ +//string +Gap, +//string +Zero, +//string +Average, +} +} +module Chart +{ +enum ErrorBarType +{ +//string +FixedValue, +//string +Percentage, +//string +StandardDeviation, +//string +StandardError, +} +} +module Chart +{ +enum ErrorBarMode +{ +//string +Both, +//string +Vertical, +//string +Horizontal, +} +} +module Chart +{ +enum ErrorBarDirection +{ +//string +Both, +//string +Plus, +//string +Minus, +} +} +module Chart +{ +enum Mode +{ +//string +Series, +//string +Point, +//string +Cluster, +} +} +module Chart +{ +enum SelectionType +{ +//string +Single, +//string +Multiple, +} +} +module Chart +{ +enum CrosshairType +{ +//string +Crosshair, +//string +Trackball, +} +} +module Chart +{ +enum Alignment +{ +//string +Center, +//string +Near, +//string +Far, +} +} +module Chart +{ +enum Position +{ +//string +Left, +//string +Right, +//string +Top, +//string +Bottom, +} +} +module Chart +{ +enum TextOverflow +{ +//string +None, +//string +Trim, +//string +Wrap, +//string +WrapAndTrim, +} +} +module Chart +{ +enum EdgeLabelPlacement +{ +//string +None, +//string +Shift, +//string +Hide, +} +} +module Chart +{ +enum IntervalType +{ +//string +Days, +//string +Hours, +//string +Seconds, +//string +Milliseconds, +//string +Minutes, +//string +Months, +//string +Years, +} +} +module Chart +{ +enum LabelIntersectAction +{ +//string +None, +//string +Rotate90, +//string +Rotate45, +//string +Wrap, +//string +WrapByword, +//string +Trim, +//string +Hide, +//string +MultipleRows, +} +} +module Chart +{ +enum RangePadding +{ +//string +Additional, +//string +Normal, +//string +None, +//string +Round, +} +} +module Chart +{ +enum TextAlignment +{ +//string +MiddleTop, +//string +MiddleCenter, +//string +MiddleBottom, +} +} +module Chart +{ +enum ZIndex +{ +//string +Inside, +//string +Over, +} +} +module Chart +{ +enum TickLinesPosition +{ +//string +Inside, +//string +Outside, +} +} +module Chart +{ +enum ValueType +{ +//string +Double, +//string +Category, +//string +DateTime, +//string +Logarithmic, +} +} +module Chart +{ +enum Theme +{ +//string +Azure, +//string +FlatLight, +//string +FlatDark, +//string +Azuredark, +//string +Lime, +//string +LimeDark, +//string +Saffron, +//string +SaffronDark, +//string +GradientLight, +//string +GradientDark, +} +} + +class RangeNavigator extends ej.Widget { + static fn: RangeNavigator; + constructor(element: JQuery, options?: RangeNavigator.Model); + constructor(element: Element, options?: RangeNavigator.Model); + model:RangeNavigator.Model; + defaults:RangeNavigator.Model; + + /** destroy the range navigator widget + * @returns {void} + */ + _destroy (): void; +} +export module RangeNavigator{ + +export interface Model { + + /**Toggles the placement of slider exactly on the place it left or on the nearest interval. + * @Default {false} + */ + allowSnapping?: boolean; + + /**Specifies the data source for range navigator. + */ + dataSource?: any; + + /**Sets a value whether to make the range navigator responsive on resize. + * @Default {false} + */ + enableAutoResizing?: boolean; + + /**Toggles the redrawing of chart on moving the sliders. + * @Default {true} + */ + enableDeferredUpdate?: boolean; + + /**Toggles the direction of rendering the range navigator control. + * @Default {false} + */ + enableRTL?: boolean; + + /**Options for customizing the labels colors, font, style, size, horizontalAlignment and opacity. + */ + labelSettings?: LabelSettings; + + /**This property is to specify the localization of range navigator. + * @Default {en-US} + */ + locale?: string; + + /**Options for customizing the range navigator. + */ + navigatorStyleSettings?: NavigatorStyleSettings; + + /**Padding specifies the gap between the container and the range navigator. + * @Default {0} + */ + padding?: string; + + /**If the range is not given explicitly, range will be calculated automatically. + * @Default {none} + */ + rangePadding?: ej.datavisualization.RangeNavigator.RangePadding|string; + + /**Options for customizing the starting and ending ranges. + */ + rangeSettings?: RangeSettings; + + /**selectedData is for getting the data when the "rangeChanged" event trigger from client side. + */ + selectedData?: any; + + /**Options for customizing the start and end range values. + */ + selectedRangeSettings?: SelectedRangeSettings; + + /**Contains property to customize the hight and width of range navigator. + */ + sizeSettings?: SizeSettings; + + /**By specifying this property the user can change the theme of the range navigator. + * @Default {null} + */ + theme?: string; + + /**Options for customizing the tooltip in range navigator. + */ + tooltipSettings?: TooltipSettings; + + /**Options for configuring minor grid lines, major grid lines, axis line of axis. + */ + valueAxisSettings?: ValueAxisSettings; + + /**You can plot data of type date time or numeric. This property determines the type of data that this axis will handle. + * @Default {datetime} + */ + valueType?: ej.datavisualization.RangeNavigator.ValueType|string; + + /**Specifies the xName for dataSource. This is used to take the x values from dataSource + */ + xName?: any; + + /**Specifies the yName for dataSource. This is used to take the y values from dataSource + */ + yName?: any; + + /**Fires on load of range navigator.*/ + load? (e: LoadEventArgs): void; + + /**Fires after range navigator is loaded.*/ + loaded? (e: LoadedEventArgs): void; + + /**Fires on changing the range of range navigator.*/ + rangeChanged? (e: RangeChangedEventArgs): void; +} + +export interface LoadEventArgs { + + /**parameters from range navigator + */ + Data?: any; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the range navigator model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface LoadedEventArgs { + + /**parameters from range navigator + */ + Data?: any; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the range navigator model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface RangeChangedEventArgs { + + /**parameters from range navigator + */ + Data?: any; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the range navigator model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface LabelSettingsHigherLevelBorder { + + /**Specifies the border color of grid lines. + * @Default {transparent} + */ + color?: string; + + /**Specifies the border width of grid lines. + * @Default {0.5} + */ + width?: string; +} + +export interface LabelSettingsHigherLevelGridLineStyle { + + /**Specifies the color of grid lines in higher level. + * @Default {#B5B5B5} + */ + color?: string; + + /**Specifies the dashArray of grid lines in higher level. + * @Default {20 5 0} + */ + dashArray?: string; + + /**Specifies the width of grid lines in higher level. + * @Default {#B5B5B5} + */ + width?: string; +} + +export interface LabelSettingsHigherLevelStyleFont { + + /**Specifies the label font color. Labels render with the specified font color. + * @Default {black} + */ + color?: string; + + /**Specifies the label font family. Labels render with the specified font family. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Specifies the label font style. Labels render with the specified font style. + * @Default {Normal} + */ + fontStyle?: string; + + /**Specifies the label font weight. Labels render with the specified font weight. + * @Default {regular} + */ + fontWeight?: string; + + /**Specifies the label opacity. Labels render with the specified opacity. + * @Default {1} + */ + opacity?: number; + + /**Specifies the label font size. Labels render with the specified font size. + * @Default {12px} + */ + size?: string; +} + +export interface LabelSettingsHigherLevelStyle { + + /**Options for customizing the font properties. + */ + font?: LabelSettingsHigherLevelStyleFont; + + /**Specifies the horizontal text alignment of the text in label. + * @Default {middle} + */ + horizontalAlignment?: string; +} + +export interface LabelSettingsHigherLevel { + + /**Options for customizing the border of grid lines in higher level. + */ + border?: LabelSettingsHigherLevelBorder; + + /**Specifies the fill color of higher level labels. + * @Default {transparent} + */ + fill?: string; + + /**Options for customizing the grid line colors, width, dashArray, border. + */ + gridLineStyle?: LabelSettingsHigherLevelGridLineStyle; + + /**Specifies the intervalType for higher level labels. See IntervalType + * @Default {years} + */ + intervalType?: ej.datavisualization.RangeNavigator.IntervalType|string; + + /**Specifies the position of the labels to render either inside or outside of plot area + * @Default {outside} + */ + labelPlacement?: ej.datavisualization.RangeNavigator.LabelPlacement|string; + + /**Specifies the position of the labels in higher level + * @Default {top} + */ + position?: ej.datavisualization.RangeNavigator.Position|string; + + /**Options for customizing the style of higher level labels. + */ + style?: LabelSettingsHigherLevelStyle; + + /**Toggles the visibility of higher level labels. + * @Default {true} + */ + visible?: boolean; +} + +export interface LabelSettingsLowerLevelBorder { + + /**Specifies the border color of grid lines. + * @Default {transparent} + */ + color?: string; + + /**Specifies the border width of grid lines. + * @Default {0.5} + */ + width?: string; +} + +export interface LabelSettingsLowerLevelGridLineStyle { + + /**Specifies the color of grid lines in lower level. + * @Default {#B5B5B5} + */ + color?: string; + + /**Specifies the dashArray of gridLines in lowerLevel. + * @Default {20 5 0} + */ + dashArray?: string; + + /**Specifies the width of grid lines in lower level. + * @Default {#B5B5B5} + */ + width?: string; +} + +export interface LabelSettingsLowerLevelStyleFont { + + /**Specifies the color of labels. Label text render in this specified color. + * @Default {black} + */ + color?: string; + + /**Specifies the font family of labels. Label text render in this specified font family. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Specifies the font style of labels. Label text render in this specified font style. + * @Default {Normal} + */ + fontStyle?: string; + + /**Specifies the font weight of labels. Label text render in this specified font weight. + * @Default {regular} + */ + fontWeight?: string; + + /**Specifies the opacity of labels. Label text render in this specified opacity. + * @Default {12px} + */ + opacity?: string; + + /**Specifies the size of labels. Label text render in this specified size. + * @Default {12px} + */ + size?: string; +} + +export interface LabelSettingsLowerLevelStyle { + + /**Options for customizing the font of labels. + */ + font?: LabelSettingsLowerLevelStyleFont; + + /**Specifies the horizontal text alignment of the text in label. + * @Default {middle} + */ + horizontalAlignment?: string; +} + +export interface LabelSettingsLowerLevel { + + /**Options for customizing the border of grid lines in lower level. + */ + border?: LabelSettingsLowerLevelBorder; + + /**Specifies the fill color of labels in lower level. + * @Default {transparent} + */ + fill?: string; + + /**Options for customizing the grid lines in lower level. + */ + gridLineStyle?: LabelSettingsLowerLevelGridLineStyle; + + /**Specifies the intervalType of the labels in lower level.See IntervalType + * @Default {years} + */ + intervalType?: ej.datavisualization.RangeNavigator.IntervalType|string; + + /**Specifies the position of the labels to render either inside or outside of plot area. See LabelPlacement + * @Default {outside} + */ + labelPlacement?: ej.datavisualization.RangeNavigator.LabelPlacement|string; + + /**Specifies the position of the labels in lower level.See Position + * @Default {bottom} + */ + position?: ej.datavisualization.RangeNavigator.Position|string; + + /**Options for customizing the style of labels. + */ + style?: LabelSettingsLowerLevelStyle; + + /**Toggles the visibility of labels in lower level. + * @Default {true} + */ + visible?: boolean; +} + +export interface LabelSettingsStyleFont { + + /**Specifies the label color. This color is applied to the labels in range navigator. + * @Default {#FFFFFF} + */ + color?: string; + + /**Specifies the label font family. Labels render with the specified font family. + * @Default {Segoe UI} + */ + family?: string; + + /**Specifies the label font opacity. Labels render with the specified font opacity. + * @Default {1} + */ + opacity?: number; + + /**Specifies the label font size. Labels render with the specified font size. + * @Default {1px} + */ + size?: string; + + /**Specifies the label font style. Labels render with the specified font style.. + * @Default {Normal} + */ + style?: ej.datavisualization.RangeNavigator.FontStyle|string; + + /**Specifies the lable font weight + * @Default {regular} + */ + weight?: ej.datavisualization.RangeNavigator.FontWeight|string; +} + +export interface LabelSettingsStyle { + + /**Options for customizing the font of labels in range navigator. + */ + font?: LabelSettingsStyleFont; + + /**Specifies the horizontalAlignment of the label in RangeNavigator + * @Default {middle} + */ + horizontalAlignment?: ej.datavisualization.RangeNavigator.HorizontalAlignment|string; +} + +export interface LabelSettings { + + /**Options for customizing the higher level labels in range navigator. + */ + higherLevel?: LabelSettingsHigherLevel; + + /**Options for customizing the labels in lower level. + */ + lowerLevel?: LabelSettingsLowerLevel; + + /**Options for customizing the style of labels in range navigator. + */ + style?: LabelSettingsStyle; +} + +export interface NavigatorStyleSettingsBorder { + + /**Specifies the border color of range navigator. + * @Default {transparent} + */ + color?: string; + + /**Specifies the dash array of range navigator. + * @Default {null} + */ + dashArray?: string; + + /**Specifies the border width of range navigator. + * @Default {0.5} + */ + width?: number; +} + +export interface NavigatorStyleSettingsMajorGridLineStyle { + + /**Specifies the color of major grid lines in range navigator. + * @Default {#B5B5B5} + */ + color?: string; + + /**Toggles the visibility of major grid lines. + * @Default {true} + */ + visible?: boolean; +} + +export interface NavigatorStyleSettingsMinorGridLineStyle { + + /**Specifies the color of minor grid lines in range navigator. + * @Default {#B5B5B5} + */ + color?: string; + + /**Toggles the visibility of minor grid lines. + * @Default {true} + */ + visible?: boolean; +} + +export interface NavigatorStyleSettings { + + /**Specifies the background color of range navigator. + * @Default {#dddddd} + */ + background?: string; + + /**Options for customizing the border color and width of range navigator. + */ + border?: NavigatorStyleSettingsBorder; + + /**Specifies the left side thumb template in range navigator we can give either div id or html string + * @Default {null} + */ + leftThumbTemplate?: string; + + /**Options for customizing the major grid lines. + */ + majorGridLineStyle?: NavigatorStyleSettingsMajorGridLineStyle; + + /**Options for customizing the minor grid lines. + */ + minorGridLineStyle?: NavigatorStyleSettingsMinorGridLineStyle; + + /**Specifies the opacity of RangeNavigator. + * @Default {1} + */ + opacity?: number; + + /**Specifies the right side thumb template in range navigator we can give either div id or html string + * @Default {null} + */ + rightThumbTemplate?: string; + + /**Specifies the color of the selected region in range navigator. + * @Default {#EFEFEF} + */ + selectedRegionColor?: string; + + /**Specifies the opacity of Selected Region. + * @Default {0} + */ + selectedRegionOpacity?: number; + + /**Specifies the color of the thumb in range navigator. + * @Default {#2382C3} + */ + thumbColor?: string; + + /**Specifies the radius of the thumb in range navigator. + * @Default {10} + */ + thumbRadius?: number; + + /**Specifies the stroke color of the thumb in range navigator. + * @Default {#303030} + */ + thumbStroke?: string; + + /**Specifies the color of the unselected region in range navigator. + * @Default {#5EABDE} + */ + unselectedRegionColor?: string; + + /**Specifies the opacity of Unselected Region. + * @Default {0.3} + */ + unselectedRegionOpacity?: number; +} + +export interface RangeSettings { + + /**Specifies the ending range of range navigator. + * @Default {null} + */ + end?: string; + + /**Specifies the starting range of range navigator. + * @Default {null} + */ + start?: string; +} + +export interface SelectedRangeSettings { + + /**Specifies the ending range of range navigator. + * @Default {null} + */ + end?: string; + + /**Specifies the starting range of range navigator. + * @Default {null} + */ + start?: string; +} + +export interface SizeSettings { + + /**Specifies height of the range navigator. + * @Default {null} + */ + height?: string; + + /**Specifies width of the range navigator. + * @Default {null} + */ + width?: string; +} + +export interface TooltipSettingsFont { + + /**Specifies the color of text in tooltip. Tooltip text render in the specified color. + * @Default {#FFFFFF} + */ + color?: string; + + /**Specifies the font family of text in tooltip. Tooltip text render in the specified font family. + * @Default {Segoe UI} + */ + family?: string; + + /**Specifies the font style of text in tooltip. Tooltip text render in the specified font style. + * @Default {ej.datavisualization.RangeNavigator.fontStyle.Normal} + */ + fontStyle?: string; + + /**Specifies the opacity of text in tooltip. Tooltip text render in the specified opacity. + * @Default {1} + */ + opacity?: number; + + /**Specifies the size of text in tooltip. Tooltip text render in the specified size. + * @Default {10px} + */ + size?: string; + + /**Specifies the weight of text in tooltip. Tooltip text render in the specified weight. + * @Default {ej.datavisualization.RangeNavigator.weight.Regular} + */ + weight?: string; +} + +export interface TooltipSettings { + + /**Specifies the background color of tooltip. + * @Default {#303030} + */ + backgroundColor?: string; + + /**Options for customizing the font in tooltip. + */ + font?: TooltipSettingsFont; + + /**Specifies the format of text to be displayed in tooltip. + * @Default {MM/dd/yyyy} + */ + labelFormat?: string; + + /**Specifies the mode of displaying the tooltip. Neither to display the tooltip always nor on demand. + * @Default {null} + */ + tooltipDisplayMode?: string; + + /**Toggles the visibility of tooltip. + * @Default {true} + */ + visible?: boolean; +} + +export interface ValueAxisSettingsAxisLine { + + /**Toggles the visibility of axis line. + * @Default {none} + */ + visible?: string; +} + +export interface ValueAxisSettingsFont { + + /**Text in axis render with the specified size. + * @Default {0px} + */ + size?: string; +} + +export interface ValueAxisSettingsMajorGridLines { + + /**Toggles the visibility of major grid lines. + * @Default {false} + */ + visible?: boolean; +} + +export interface ValueAxisSettingsMajorTickLines { + + /**Specifies the size of the majorTickLines in range navigator + * @Default {0} + */ + size?: number; + + /**Toggles the visibility of major tick lines. + * @Default {true} + */ + visible?: boolean; + + /**Specifies width of the major tick lines. + * @Default {0} + */ + width?: number; +} + +export interface ValueAxisSettings { + + /**Options for customizing the axis line. + */ + axisLine?: ValueAxisSettingsAxisLine; + + /**Options for customizing the font of the axis. + */ + font?: ValueAxisSettingsFont; + + /**Options for customizing the major grid lines. + */ + majorGridLines?: ValueAxisSettingsMajorGridLines; + + /**Options for customizing the major tick lines in axis. + */ + majorTickLines?: ValueAxisSettingsMajorTickLines; + + /**If the range is not given explicitly, range will be calculated automatically. You can customize the automatic range calculation using rangePadding. + * @Default {none} + */ + rangePadding?: string; + + /**Toggles the visibility of axis in range navigator. + * @Default {false} + */ + visible?: boolean; +} +} +module RangeNavigator +{ +enum IntervalType +{ +//string +Years, +//string +Quarters, +//string +Months, +//string +Weeks, +//string +Days, +//string +Hours, +} +} +module RangeNavigator +{ +enum LabelPlacement +{ +//string +Inside, +//string +Outside, +} +} +module RangeNavigator +{ +enum Position +{ +//string +Top, +//string +Bottom, +} +} +module RangeNavigator +{ +enum FontStyle +{ +//string +Normal, +//string +Bold, +//string +Italic, +} +} +module RangeNavigator +{ +enum FontWeight +{ +//string +Regular, +//string +Lighter, +} +} +module RangeNavigator +{ +enum HorizontalAlignment +{ +//string +Middle, +//string +Left, +//string +Right, +} +} +module RangeNavigator +{ +enum RangePadding +{ +//string +Additional, +//string +Normal, +//string +None, +//string +Round, +} +} +module RangeNavigator +{ +enum ValueType +{ +//string +Numeric, +//string +DateTime, +} +} + +class BulletGraph extends ej.Widget { + static fn: BulletGraph; + constructor(element: JQuery, options?: BulletGraph.Model); + constructor(element: Element, options?: BulletGraph.Model); + model:BulletGraph.Model; + defaults:BulletGraph.Model; + + /** To destroy the bullet graph + * @returns {void} + */ + destroy (): void; + + /** To redraw the bulet graph + * @returns {void} + */ + redraw(): void; + + /** To set the value for comparative measure in bullet graph. + * @returns {void} + */ + setComparativeMeasureSymbol(): void; + + /** To set the value for feature measure bar. + * @returns {void} + */ + setFeatureMeasureBarValue(): void; +} +export module BulletGraph{ + +export interface Model { + + /**Toggles the visibility of the range stroke color of the labels. + * @Default {false} + */ + applyRangeStrokeToLabels?: boolean; + + /**Toggles the visibility of the range stroke color of the ticks. + * @Default {false} + */ + applyRangeStrokeToTicks?: boolean; + + /**Contains property to customize the caption in bullet graph. + */ + captionSettings?: CaptionSettings; + + /**Comparative measure bar in bullet graph render till the specified value. + * @Default {0} + */ + comparativeMeasureValue?: number; + + /**Toggles the animation of bullet graph. + * @Default {true} + */ + enableAnimation?: boolean; + + /**Sets a value whether to make the bullet graph responsive on resize. + * @Default {true} + */ + enableResizing?: boolean; + + /**Specifies the direction of flow in bullet graph. Neither it may be backward nor forward. + * @Default {forward} + */ + flowDirection?: ej.datavisualization.BulletGraph.FlowDirection|string; + + /**Specifies the height of the bullet graph. + * @Default {90} + */ + height?: number; + + /**Bullet graph will render in the specified orientation. + * @Default {horizontal} + */ + orientation?: ej.datavisualization.BulletGraph.Orientation|string; + + /**Contains property to customize the qualitative ranges. + */ + qualitativeRanges?: Array; + + /**Size of the qualitative range depends up on the specified value. + * @Default {32} + */ + qualitativeRangeSize?: number; + + /**Length of the quantitative range depends up on the specified value. + * @Default {475} + */ + quantitativeScaleLength?: number; + + /**Contains all the properties to customize quantitative scale. + */ + quantitativeScaleSettings?: QuantitativeScaleSettings; + + /**By specifying this property the user can change the theme of the bullet graph. + * @Default {flatlight} + */ + theme?: string; + + /**Contains all the properties to customize tooltip. + */ + tooltipSettings?: TooltipSettings; + + /**Feature measure bar in bullet graph render till the specified value. + * @Default {0} + */ + value?: number; + + /**Specifies the width of the bullet graph. + * @Default {595} + */ + width?: number; + + /**Fires on rendering the caption of bullet graph.*/ + drawCaption? (e: DrawCaptionEventArgs): void; + + /**Fires on rendering the category.*/ + drawCategory? (e: DrawCategoryEventArgs): void; + + /**Fires on rendering the comparative measure symbol.*/ + drawComparativeMeasureSymbol? (e: DrawComparativeMeasureSymbolEventArgs): void; + + /**Fires on rednering the feature measure bar.*/ + drawFeatureMeasureBar? (e: DrawFeatureMeasureBarEventArgs): void; + + /**Fires on rendering the indicator of bullet graph.*/ + drawIndicator? (e: DrawIndicatorEventArgs): void; + + /**Fires on rendering the labels.*/ + drawLabels? (e: DrawLabelsEventArgs): void; + + /**Fires on rendering the qualitative ranges.*/ + drawQualitativeRanges? (e: DrawQualitativeRangesEventArgs): void; + + /**Fires on loading bullet graph.*/ + load? (e: LoadEventArgs): void; +} + +export interface DrawCaptionEventArgs { + + /**returns the object of the bullet graph. + */ + Object?: any; + + /**returns the options of the scale element. + */ + scaleElement?: HTMLElement; + + /**returns the current captionSettings element. + */ + captionElement?: HTMLElement; + + /**returns the type of the captionSettings. + */ + captionType?: string; +} + +export interface DrawCategoryEventArgs { + + /**returns the object of the bullet graph. + */ + Object?: any; + + /**returns the options of the scale element. + */ + scaleElement?: HTMLElement; + + /**returns the options of category element. + */ + categoryElement?: HTMLElement; + + /**returns the text value of the category that is drawn. + */ + Value?: string; +} + +export interface DrawComparativeMeasureSymbolEventArgs { + + /**returns the object of the bullet graph. + */ + Object?: any; + + /**returns the options of the scale element. + */ + scaleElement?: HTMLElement; + + /**returns the options of comparative measure element. + */ + targetElement?: HTMLElement; + + /**returns the value of the comparative measure symbol. + */ + Value?: number; +} + +export interface DrawFeatureMeasureBarEventArgs { + + /**returns the object of the bullet graph. + */ + Object?: any; + + /**returns the options of the scale element. + */ + scaleElement?: HTMLElement; + + /**returns the options of feature measure element. + */ + currentElement?: HTMLElement; + + /**returns the value of the feature measure bar. + */ + Value?: number; +} + +export interface DrawIndicatorEventArgs { + + /**returns an object to customize bullet graph indicator text and symbol before rendering it. + */ + indicatorSettings?: any; + + /**returns the object of bullet graph. + */ + model?: any; + + /**returns the type of event. + */ + type?: string; + + /**for cancelling the event. + */ + cancel?: boolean; +} + +export interface DrawLabelsEventArgs { + + /**returns the object of the bullet graph. + */ + Object?: any; + + /**returns the options of the scale element. + */ + scaleElement?: HTMLElement; + + /**returns the current label element. + */ + tickElement?: HTMLElement; + + /**returns the label type. + */ + labelType?: string; +} + +export interface DrawQualitativeRangesEventArgs { + + /**returns the object of the bullet graph. + */ + Object?: any; + + /**returns the index of current range. + */ + rangeIndex?: number; + + /**returns the settings for current range. + */ + rangeOptions?: any; + + /**returns the end value of current range. + */ + rangeEndValue?: number; +} + +export interface LoadEventArgs { +} + +export interface CaptionSettingsFont { + + /**Specifies the color of the text in caption. + * @Default {null} + */ + color?: string; + + /**Specifies the fontFamily of caption. Caption text render with this fontFamily + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Specifies the fontStyle of caption + * @Default {Normal} + */ + fontStyle?: ej.datavisualization.BulletGraph.FontStyle|string; + + /**Specifies the fontWeight of caption + * @Default {regular} + */ + fontWeight?: ej.datavisualization.BulletGraph.FontWeight|string; + + /**Specifies the opacity of caption. Caption text render with this opacity. + * @Default {1} + */ + opacity?: number; + + /**Specifies the size of caption. Caption text render with this size + * @Default {12px} + */ + size?: string; +} + +export interface CaptionSettingsIndicatorFont { + + /**Specifies the color of the indicator's text. + * @Default {null} + */ + color?: string; + + /**Specifies the fontFamily of indicator. Indicator text render with this fontFamily. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Specifies the fontStyle of indicator. Indicator text render with this fontStyle. See FontStyle + * @Default {Normal} + */ + fontStyle?: ej.datavisualization.BulletGraph.FontStyle|string; + + /**Specifies the fontWeight of indicator. Indicator text render with this fontWeight. See FontWeight + * @Default {regular} + */ + fontWeight?: ej.datavisualization.BulletGraph.FontWeight|string; + + /**Specifies the opacity of indicator text. Indicator text render with this Opacity. + * @Default {1} + */ + opacity?: number; + + /**Specifies the size of indicator. Indicator text render with this size. + * @Default {12px} + */ + size?: string; +} + +export interface CaptionSettingsIndicatorLocation { + + /**Specifies the horizontal position of the indicator. + * @Default {10} + */ + x?: number; + + /**Specifies the vertical position of the indicator. + * @Default {60} + */ + y?: number; +} + +export interface CaptionSettingsIndicatorSymbolBorder { + + /**Specifies the border color of indicator symbol. + * @Default {null} + */ + color?: string; + + /**Specifies the border width of indicator symbol. + * @Default {1} + */ + width?: number; +} + +export interface CaptionSettingsIndicatorSymbolSize { + + /**Specifies the height of indicator symbol. + * @Default {10} + */ + height?: number; + + /**Specifies the width of indicator symbol. + * @Default {10} + */ + width?: number; +} + +export interface CaptionSettingsIndicatorSymbol { + + /**Contains property to customize the border of indicator symbol. + */ + border?: CaptionSettingsIndicatorSymbolBorder; + + /**Specifies the color of indicator symbol. + * @Default {null} + */ + color?: string; + + /**Specifies the url of image that represents indicator symbol. + */ + imageURL?: string; + + /**Specifies the opacity of indicator symbol. + * @Default {1} + */ + opacity?: number; + + /**Specifies the shape of indicator symbol. + */ + shape?: string; + + /**Contains property to customize the size of indicator symbol. + */ + size?: CaptionSettingsIndicatorSymbolSize; +} + +export interface CaptionSettingsIndicator { + + /**Contains property to customize the font of indicator. + */ + font?: CaptionSettingsIndicatorFont; + + /**Contains property to customize the location of indicator. + */ + location?: CaptionSettingsIndicatorLocation; + + /**Specifies the padding to be applied when text position is used. + * @Default {2} + */ + padding?: number; + + /**Contains property to customize the symbol of indicator. + */ + symbol?: CaptionSettingsIndicatorSymbol; + + /**Specifies the text to be displayed as indicator text. By default difference between current value and target will be displayed + */ + text?: string; + + /**Specifies the alignement of indicator with respect to scale based on text position + * @Default {'Near'} + */ + textAlignment?: ej.datavisualization.BulletGraph.TextAlignment|string; + + /**Specifies where indicator text should be anchored when indicator overlaps with other caption group text. Text will be anchored when overlapping caption group text are at same position. Anchoring is not applicable for float position. + * @Default {'start'} + */ + textAnchor?: ej.datavisualization.BulletGraph.TextAnchor|string; + + /**indicator text render in the specified angle. + * @Default {0} + */ + textAngle?: number; + + /**Specifies where indicator should be placed + * @Default {'float'} + */ + textPosition?: ej.datavisualization.BulletGraph.TextPosition|string; + + /**Specifies the space between indicator symbol and text. + * @Default {3} + */ + textSpacing?: number; + + /**Specifies whether indicator will be visible or not. + * @Default {false} + */ + visibile?: boolean; +} + +export interface CaptionSettingsLocation { + + /**Specifies the position in horizontal direction + * @Default {17} + */ + x?: number; + + /**Specifies the position in horizontal direction + * @Default {30} + */ + y?: number; +} + +export interface CaptionSettingsSubTitleFont { + + /**Specifies the color of the subtitle's text. + * @Default {null} + */ + color?: string; + + /**Specifies the fontFamily of subtitle. Subtitle text render with this fontFamily. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Specifies the fontStyle of subtitle. Subtitle text render with this fontStyle. See FontStyle + * @Default {Normal} + */ + fontStyle?: ej.datavisualization.BulletGraph.FontStyle|string; + + /**Specifies the fontWeight of subtitle. Subtitle text render with this fontWeight. See FontWeight + * @Default {regular} + */ + fontWeight?: ej.datavisualization.BulletGraph.FontWeight|string; + + /**Specifies the opacity of subtitle. Subtitle text render with this opacity. + * @Default {1} + */ + opacity?: number; + + /**Specifies the size of subtitle. Subtitle text render with this size. + * @Default {12px} + */ + size?: string; +} + +export interface CaptionSettingsSubTitleLocation { + + /**Specifies the horizontal position of the subtitle. + * @Default {10} + */ + x?: number; + + /**Specifies the vertical position of the subtitle. + * @Default {45} + */ + y?: number; +} + +export interface CaptionSettingsSubTitle { + + /**Contains property to customize the font of subtitle. + */ + font?: CaptionSettingsSubTitleFont; + + /**Contains property to customize the location of subtitle. + */ + location?: CaptionSettingsSubTitleLocation; + + /**Specifies the padding to be applied when text position is used. + * @Default {5} + */ + padding?: number; + + /**Specifies the text to be displayed as subtitle. + */ + text?: string; + + /**Specifies the alignment of sub title text with respect to scale. Alignment will not be applied in float position. + * @Default {'Near'} + */ + textAlignment?: ej.datavisualization.BulletGraph.TextAlignment|string; + + /**Specifies where subtitle text should be anchored when sub title text overlaps with other caption group text. Text will be anchored when overlapping caption group text are at same position. Anchoring is not applicable for float position. + * @Default {'start'} + */ + textAnchor?: ej.datavisualization.BulletGraph.TextAnchor|string; + + /**Subtitle render in the specified angle. + * @Default {0} + */ + textAngle?: number; + + /**Specifies where sub title text should be placed. + * @Default {'float'} + */ + textPosition?: ej.datavisualization.BulletGraph.TextPosition|string; +} + +export interface CaptionSettings { + + /**Specifies whether trim the labels will be true or false. + * @Default {true} + */ + enableTrim?: boolean; + + /**Contains property to customize the font of caption. + */ + font?: CaptionSettingsFont; + + /**Contains property to customize the indicator. + */ + indicator?: CaptionSettingsIndicator; + + /**Contains property to customize the location. + */ + location?: CaptionSettingsLocation; + + /**Specifies the padding to be applied when text position is used. + * @Default {5} + */ + padding?: number; + + /**Contains property to customize the subtitle. + */ + subTitle?: CaptionSettingsSubTitle; + + /**Specifies the text to be displayed on bullet graph. + */ + text?: string; + + /**Specifies the alignment of caption text with respect to scale. This property will not be applied when text position is float. + * @Default {'Near'} + */ + textAlignment?: ej.datavisualization.BulletGraph.TextAlignment|string; + + /**Specifies caption text anchoring when caption text overlaps with other caption group text. Text will be anchored when overlapping caption group text are at same position. Anchoring is not applicable for float position. + * @Default {'start'} + */ + textAnchor?: ej.datavisualization.BulletGraph.TextAnchor|string; + + /**Specifies the angel in which the caption is rendered. + * @Default {0} + */ + textAngle?: number; + + /**Specifies how caption text should be placed. + * @Default {'float'} + */ + textPosition?: ej.datavisualization.BulletGraph.TextPosition|string; +} + +export interface QualitativeRanges { + + /**Specifies the ending range to which the qualitative ranges will render. + * @Default {3} + */ + rangeEnd?: number; + + /**Specifies the opacity for the qualitative ranges. + * @Default {1} + */ + rangeOpacity?: number; + + /**Specifies the stroke for the qualitative ranges. + * @Default {null} + */ + rangeStroke?: string; +} + +export interface QuantitativeScaleSettingsComparativeMeasureSettings { + + /**Specifies the stroke of the comparative measure. + * @Default {null} + */ + stroke?: number; + + /**Specifies the width of the comparative measure. + * @Default {5} + */ + width?: number; +} + +export interface QuantitativeScaleSettingsFeaturedMeasureSettings { + + /**Specifies the Stroke of the featured measure in bullet graph. + * @Default {null} + */ + stroke?: number; + + /**Specifies the width of the featured measure in bullet graph. + * @Default {2} + */ + width?: number; +} + +export interface QuantitativeScaleSettingsFeatureMeasures { + + /**Specifies the category of feature measure. + * @Default {null} + */ + category?: string; + + /**Comparative measure render till the specified value. + * @Default {null} + */ + comparativeMeasureValue?: number; + + /**Feature measure render till the specified value. + * @Default {null} + */ + value?: number; +} + +export interface QuantitativeScaleSettingsFields { + + /**Specifies the category of the bullet graph. + * @Default {null} + */ + category?: string; + + /**Comparative measure render based on the values in the specified field. + * @Default {null} + */ + comparativeMeasure?: string; + + /**Specifies the dataSource for the bullet graph. + * @Default {null} + */ + dataSource?: any; + + /**Feature measure render based on the values in the specified field. + * @Default {null} + */ + featureMeasures?: string; + + /**Specifies the query for fetching the values form data source to render the bullet graph. + * @Default {null} + */ + query?: string; + + /**Specifies the name of the table. + * @Default {null} + */ + tableName?: string; +} + +export interface QuantitativeScaleSettingsLabelSettingsFont { + + /**Specifies the fontFamily of labels in bullet graph. Labels render with this fontFamily. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Specifies the fontStyle of labels in bullet graph. Labels render with this fontStyle. See FontStyle + * @Default {Normal} + */ + fontStyle?: ej.datavisualization.BulletGraph.FontStyle|string; + + /**Specifies the fontWeight of labels in bullet graph. Labels render with this fontWeight. See FontWeight + * @Default {regular} + */ + fontWeight?: ej.datavisualization.BulletGraph.FontWeight|string; + + /**Specifies the opacity of labels in bullet graph. Labels render with this opacity + * @Default {1} + */ + opacity?: number; +} + +export interface QuantitativeScaleSettingsLabelSettings { + + /**Contains property to customize the font of the labels in bullet graph. + */ + font?: QuantitativeScaleSettingsLabelSettingsFont; + + /**Specifies the placement of labels in bullet graph scale. + * @Default {outside} + */ + labelPlacement?: ej.datavisualization.BulletGraph.LabelPlacement|string; + + /**Specifies the prefix to be added with labels in bullet graph. + * @Default {Empty string} + */ + labelPrefix?: string; + + /**Specifies the suffix to be added after labels in bullet graph. + * @Default {Empty string} + */ + labelSuffix?: string; + + /**Specifies the horizontal/vertical padding of labels. + * @Default {15} + */ + offset?: number; + + /**Specifies the position of the labels to render either above or below the graph. See Position + * @Default {below} + */ + position?: ej.datavisualization.BulletGraph.LabelPosition|string; + + /**Specifies the Size of the labels. + * @Default {12} + */ + size?: number; + + /**Specifies the stroke color of the labels in bullet graph. + * @Default {null} + */ + stroke?: string; +} + +export interface QuantitativeScaleSettingsLocation { + + /**This property specifies the x position for rendering quantitative scale. + * @Default {10} + */ + x?: number; + + /**This property specifies the y position for rendering quantitative scale. + * @Default {10} + */ + y?: number; +} + +export interface QuantitativeScaleSettingsMajorTickSettings { + + /**Specifies the size of the major ticks. + * @Default {13} + */ + size?: number; + + /**Specifies the stroke color of the major tick lines. + * @Default {null} + */ + stroke?: string; + + /**Specifies the width of the major tick lines. + * @Default {2} + */ + width?: number; +} + +export interface QuantitativeScaleSettingsMinorTickSettings { + + /**Specifies the size of minor ticks. + * @Default {7} + */ + size?: number; + + /**Specifies the stroke color of minor ticks in bullet graph. + * @Default {null} + */ + stroke?: string; + + /**Specifies the width of the minor ticks in bullet graph. + * @Default {2} + */ + width?: number; +} + +export interface QuantitativeScaleSettings { + + /**Contains property to customize the comparative measure. + */ + comparativeMeasureSettings?: QuantitativeScaleSettingsComparativeMeasureSettings; + + /**Contains property to customize the featured measure. + */ + featuredMeasureSettings?: QuantitativeScaleSettingsFeaturedMeasureSettings; + + /**Contains property to customize the featured measure. + */ + featureMeasures?: Array; + + /**Contains property to customize the fields. + */ + fields?: QuantitativeScaleSettingsFields; + + /**Specifies the interval for the Graph. + * @Default {1} + */ + interval?: number; + + /**Contains property to customize the labels. + */ + labelSettings?: QuantitativeScaleSettingsLabelSettings; + + /**Contains property to customize the position of the quantitative scale + */ + location?: QuantitativeScaleSettingsLocation; + + /**Contains property to customize the major tick lines. + */ + majorTickSettings?: QuantitativeScaleSettingsMajorTickSettings; + + /**Specifies the maximum value of the Graph. + * @Default {10} + */ + maximum?: number; + + /**Specifies the minimum value of the Graph. + * @Default {0} + */ + minimum?: number; + + /**Contains property to customize the minor ticks. + */ + minorTickSettings?: QuantitativeScaleSettingsMinorTickSettings; + + /**The specified number of minor ticks will be rendered per interval. + * @Default {4} + */ + minorTicksPerInterval?: number; + + /**Specifies the placement of ticks to render either inside or outside the scale. + * @Default {ej.datavisualization.BulletGraph.TickPlacement.Outside} + */ + tickPlacement?: ej.datavisualization.BulletGraph.TickPlacement|string; + + /**Specifies the position of the ticks to render either above,below or inside + * @Default {ej.datavisualization.BulletGraph.TickPosition.Far} + */ + tickPosition?: ej.datavisualization.BulletGraph.TickPosition|string; +} + +export interface TooltipSettings { + + /**Specifies template for caption tooltip + * @Default {null} + */ + captionTemplate?: string; + + /**Toggles the visibility of caption tooltip + * @Default {false} + */ + enableCaptionTooltip?: boolean; + + /**Specifies the ID of a div, which is to be displayed as tooltip. + * @Default {null} + */ + template?: string; + + /**Toggles the visibility of tooltip + * @Default {true} + */ + visible?: boolean; +} +} +module BulletGraph +{ +enum FontStyle +{ +//string +Normal, +//string +Italic, +//string +Oblique, +} +} +module BulletGraph +{ +enum FontWeight +{ +//string +Normal, +//string +Bold, +//string +Bolder, +//string +Lighter, +} +} +module BulletGraph +{ +enum TextAlignment +{ +//string +Near, +//string +Far, +//string +Center, +} +} +module BulletGraph +{ +enum TextAnchor +{ +//string +Start, +//string +Middle, +//string +End, +} +} +module BulletGraph +{ +enum TextPosition +{ +//string +Top, +//string +Right, +//string +Left, +//string +Bottom, +//string +Float, +} +} +module BulletGraph +{ +enum FlowDirection +{ +//string +Forward, +//string +Backward, +} +} +module BulletGraph +{ +enum Orientation +{ +//string +Horizontal, +//string +Vertical, +} +} +module BulletGraph +{ +enum LabelPlacement +{ +//string +Inside, +//string +Outside, +} +} +module BulletGraph +{ +enum LabelPosition +{ +//string +Above, +//string +Below, +} +} +module BulletGraph +{ +enum TickPlacement +{ +//string +Inside, +//string +Outside, +} +} +module BulletGraph +{ +enum TickPosition +{ +//string +Below, +//string +Above, +//string +Cross, +} +} + +class Barcode extends ej.Widget { + static fn: Barcode; + constructor(element: JQuery, options?: Barcode.Model); + constructor(element: Element, options?: Barcode.Model); + model:Barcode.Model; + defaults:Barcode.Model; + + /** To disable the barcode + * @returns {void} + */ + disable(): void; + + /** To enable the barcode + * @returns {void} + */ + enable(): void; +} +export module Barcode{ + +export interface Model { + + /**Specifies the distance between the barcode and text below it. + */ + barcodeToTextGapHeight?: number; + + /**Specifies the height of bars in the Barcode. By modifying the barHeight, the entire barcode height can be customized. Please refer to xDimension for two dimensional barcode height customization. + */ + barHeight?: number; + + /**Specifies the dark bar color of the Barcode. One dimensional barcode contains a series of dark and light bars which are usually colored as black and white respectively. + */ + darkBarColor?: any; + + /**Specifies whether the text below the barcode is visible or hidden. + */ + displayText?: boolean; + + /**Specifies whether the control is enabled. + */ + enabled?: boolean; + + /**Specifies the start and stop encode symbol in the Barcode. In one dimensional barcodes, an additional character is added as start and stop delimiters. These symbols are optional and the unique of the symbol allows the reader to determine the direction of the barcode being scanned. + */ + encodeStartStopSymbol?: number; + + /**Specifies the light bar color of the Barcode. One dimensional barcode contains a series of dark and light bars which are usually colored as black and white respectively. + */ + lightBarColor?: any; + + /**Specifies the width of the narrow bars in the barcode. The dark bars in the one dimensional barcode contains random narrow and wide bars based on the provided input which can be specified during initialization. + */ + narrowBarWidth?: number; + + /**Specifies the width of the quiet zone. In barcode, a quiet zone is the blank margin on either side of a barcode which informs the reader where a barcode's symbology starts and stops. The purpose of a quiet zone is to prevent the reader from picking up unrelated information. + */ + quietZone?: QuietZone; + + /**Specifies the type of the Barcode. See SymbologyType + */ + symbologyType?: ej.datavisualization.Barcode.SymbologyType|string; + + /**Specifies the text to be encoded in the barcode. + */ + text?: string; + + /**Specifies the color of the text/data at the bottom of the barcode. + */ + textColor?: any; + + /**Specifies the width of the wide bars in the barcode. One dimensional barcode usually contains random narrow and wide bars based on the provided which can be customized during initialization. + */ + wideBarWidth?: number; + + /**Specifies the width of the narrowest element(bar or space) in a barcode. The greater the x dimension, the more easily a barcode reader will scan. + */ + xDimension?: number; + + /**Fires after Barcode control is loaded.*/ + load? (e: LoadEventArgs): void; +} + +export interface LoadEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the barcode model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; + + /**return the barcode state + */ + status?: boolean; +} + +export interface QuietZone { + + /**Specifies the quiet zone around the Barcode. + */ + all?: number; + + /**Specifies the bottom quiet zone of the Barcode. + */ + bottom?: number; + + /**Specifies the left quiet zone of the Barcode. + */ + left?: number; + + /**Specifies the right quiet zone of the Barcode. + */ + right?: number; + + /**Specifies the top quiet zone of the Barcode. + */ + top?: number; +} +} +module Barcode +{ +enum SymbologyType +{ +//Represents the QR code +QRBarcode, +//Represents the Data Matrix barcode +DataMatrix, +//Represents the Code 39 barcode +Code39, +//Represents the Code 39 Extended barcode +Code39Extended, +//Represents the Code 11 barcode +Code11, +//Represents the Codabar barcode +Codabar, +//Represents the Code 32 barcode +Code32, +//Represents the Code 93 barcode +Code93, +//Represents the Code 93 Extended barcode +Code93Extended, +//Represents the Code 128 A barcode +Code128A, +//Represents the Code 128 B barcode +Code128B, +//Represents the Code 128 C barcode +Code128C, +} +} + +class Map extends ej.Widget { + static fn: Map; + constructor(element: JQuery, options?: Map.Model); + constructor(element: Element, options?: Map.Model); + model:Map.Model; + defaults:Map.Model; + + /** Method for navigating to specific shape based on latitude, longitude and zoomlevel. + * @param {number} Pass the latitude value for map + * @param {number} Pass the longitude value for map + * @param {number} Pass the zoom level for map + * @returns {void} + */ + navigateTo(latitude: number, longitude: number, level: number): void; + + /** Method to perform map panning + * @param {string} Pass the direction in which map should be panned + * @returns {void} + */ + pan(direction: string): void; + + /** Method to reload the map. + * @returns {void} + */ + refresh(): void; + + /** Method to reload the shapeLayers with updated values + * @returns {void} + */ + refreshLayers(): void; + + /** Method to reload the navigation control with updated values. + * @param {any} Pass the navigation control instance + * @returns {void} + */ + refreshNavigationControl(navigation: any): void; + + /** Method to perform map zooming. + * @param {number} Pass the zoom level for map to be zoomed + * @param {boolean} Pass the boolean value to enable or disable animation while zooming + * @returns {void} + */ + zoom(level: number, isAnimate: boolean): void; +} +export module Map{ + +export interface Model { + + /**Specifies the background color for map + * @Default {white} + */ + background?: string; + + /**Specifies the base map-index of the map to determine the shapelayer to be displayed + * @Default {0} + */ + baseMapIndex?: number; + + /**Specify the center position where map should be displayed + * @Default {[0,0]} + */ + centerPosition?: any; + + /**Enables or Disables the map animation + * @Default {false} + */ + enableAnimation?: boolean; + + /**Enables or Disables the animation for layer change in map + * @Default {false} + */ + enableLayerChangeAnimation?: boolean; + + /**Enables or Disables the map panning + * @Default {true} + */ + enablePan?: boolean; + + /**Determines whether map need to resize when container is resized + * @Default {true} + */ + enableResize?: boolean; + + /**Enables or Disables the zooming of map + * @Default {true} + */ + enableZoom?: boolean; + + /**Enables or Disables the zoom on selecting the map shape + * @Default {false} + */ + enableZoomOnSelection?: boolean; + + /**Specifies the zoom factor for map zoom value. + * @Default {1} + */ + factor?: number; + + /**Hold the shapelayers to be displayed in map + * @Default {[]} + */ + layers?: Array; + + /**Specifies the zoom level value for which map to be zoomed + * @Default {1} + */ + level?: number; + + /**Specifies the maximum zoom level of the map + * @Default {100} + */ + maxValue?: number; + + /**Specifies the minimum zoomSettings level of the map + * @Default {1} + */ + minValue?: number; + + /**Enables or Disables the navigation control for map to perform zooming and panning on map shapes. + */ + navigationControl?: any; + + /**Layer for holding the map shapes + */ + shapeLayer?: ShapeLayer; + + /**Enables or Disables the Zooming for map. + */ + zoomSettings?: any; + + /**Triggered on selecting the map markers.*/ + markerSelected? (e: MarkerSelectedEventArgs): void; + + /**Triggers while leaving the hovered map shape*/ + mouseleave? (e: MouseleaveEventArgs): void; + + /**Triggers while hovering the map shape.*/ + mouseover? (e: MouseoverEventArgs): void; + + /**Triggers once map render completed.*/ + onRenderComplete? (e: OnRenderCompleteEventArgs): void; + + /**Triggers when map panning ends.*/ + panned? (e: PannedEventArgs): void; + + /**Triggered on selecting the map shapes.*/ + shapeSelected? (e: ShapeSelectedEventArgs): void; + + /**Triggered when map is zoomed-in.*/ + zoomedIn? (e: ZoomedInEventArgs): void; + + /**Triggers when map is zoomed out.*/ + zoomedOut? (e: ZoomedOutEventArgs): void; +} + +export interface MarkerSelectedEventArgs { + + /**Returns marker object. + */ + originalEvent?: any; +} + +export interface MouseleaveEventArgs { + + /**Returns hovered map shape object. + */ + originalEvent?: any; +} + +export interface MouseoverEventArgs { + + /**Returns hovered map shape object. + */ + originalEvent?: any; +} + +export interface OnRenderCompleteEventArgs { + + /**Event parameters from map + */ + originalEvent?: any; +} + +export interface PannedEventArgs { + + /**Event parameters from map + */ + originalEvent?: any; +} + +export interface ShapeSelectedEventArgs { + + /**Returns selected shape object. + */ + originalEvent?: any; +} + +export interface ZoomedInEventArgs { + + /**Event parameters from map + */ + originalEvent?: any; + + /**Returns zoom level value for which the map is zoomed. + */ + zoomLevel?: any; +} + +export interface ZoomedOutEventArgs { + + /**Event parameters from map + */ + originalEvent?: any; + + /**Returns zoom level value for which the map is zoomed. + */ + zoomLevel?: any; +} + +export interface ShapeLayerBubbleSettings { + + /**Specifies the bubble Opacity value of bubbles for shape layer in map + * @Default {0.9} + */ + bubbleOpacity?: number; + + /**Specifies the mouse hover color of the shape layer in map + * @Default {gray} + */ + color?: string; + + /**Specifies the colorMappings of the shape layer in map + * @Default {null} + */ + colorMappings?: any; + + /**Specifies the bubble color valuePath of the shape layer in map + * @Default {null} + */ + colorValuePath?: string; + + /**Specifies the maximum size value of bubbles for shape layer in map + * @Default {20} + */ + maxValue?: number; + + /**Specifies the minimum size value of bubbles for shape layer in map + * @Default {10} + */ + minValue?: number; + + /**Specifies the showBubble visibility status map + * @Default {true} + */ + showBubble?: boolean; + + /**Specifies the tooltip visibility status of the shape layer in map + * @Default {false} + */ + showTooltip?: boolean; + + /**Specifies the bubble tooltip template of the shape layer in map + * @Default {null} + */ + tooltipTemplate?: string; + + /**Specifies the bubble valuePath of the shape layer in map + * @Default {null} + */ + valuePath?: string; +} + +export interface ShapeLayerLabelSettings { + + /**enable or disable the enableSmartLabel property + * @Default {false} + */ + enableSmartLabel?: boolean; + + /**set the labelLength property + * @Default {'2'} + */ + labelLength?: number; + + /**set the labelPath property + * @Default {null} + */ + labelPath?: string; + + /**enable or disable the showlabel property + * @Default {false} + */ + showLabels?: boolean; + + /**set the smartLabelSize property + * @Default {fixed} + */ + smartLabelSize?: ej.datavisualization.Map.LabelSize|string; +} + +export interface ShapeLayerLegendSettings { + + /**Determines whether the legend should be placed outside or inside the map bounds + * @Default {false} + */ + dockOnMap?: boolean; + + /**Determines the legend placement and it is valid only when dockOnMap is true + * @Default {top} + */ + dockPosition?: ej.datavisualization.Map.DockPosition|string; + + /**height value for legend setting + * @Default {0} + */ + height?: number; + + /**to get icon value for legend setting + * @Default {rectangle} + */ + icon?: ej.datavisualization.Map.LegendIcons|string; + + /**icon height value for legend setting + * @Default {20} + */ + iconHeight?: number; + + /**icon Width value for legend setting + * @Default {20} + */ + iconWidth?: number; + + /**set the orientation of legend labels + * @Default {vertical} + */ + labelOrientation?: ej.datavisualization.Map.LabelOrientation|string; + + /**to get leftLabel value for legend setting + * @Default {null} + */ + leftLabel?: string; + + /**to get mode of legend setting + * @Default {default} + */ + mode?: ej.datavisualization.Map.LegendMode|string; + + /**set the position of legend settings + * @Default {topleft} + */ + position?: ej.datavisualization.Map.Position|string; + + /**x position value for legend setting + * @Default {0} + */ + positionX?: number; + + /**y position value for legend setting + * @Default {0} + */ + positionY?: number; + + /**to get rightLabel value for legend setting + * @Default {null} + */ + rightLabel?: string; + + /**Enables or Disables the showLabels + * @Default {false} + */ + showLabels?: boolean; + + /**Enables or Disables the showLegend + * @Default {false} + */ + showLegend?: boolean; + + /**to get title of legend setting + * @Default {null} + */ + title?: string; + + /**to get type of legend setting + * @Default {layers} + */ + type?: ej.datavisualization.Map.LegendType|string; + + /**width value for legend setting + * @Default {0} + */ + width?: number; +} + +export interface ShapeLayerShapeSettings { + + /**Enables or Disables the auto fill colors for shape layer in map. When this property value set to true, shapes will be filled with palette colors. + * @Default {false} + */ + autoFill?: boolean; + + /**Specifies the colorMappings of the shape layer in map + * @Default {null} + */ + colorMappings?: any; + + /**Specifies the shape color palette value of the shape layer in map. Accepted colorPalette values are palette1, palette2, palette3 and custompalette. + * @Default {palette1} + */ + colorPalette?: string; + + /**Specifies the shape color valuePath of the shape layer in map + * @Default {null} + */ + colorValuePath?: string; + + /**Enables or Disables the gradient colors for map shapes. + * @Default {false} + */ + enableGradient?: boolean; + + /**Specifies the shape fill color of the shape layer in map + * @Default {#E5E5E5} + */ + fill?: string; + + /**Specifies the mouse over width of the shape layer in map + * @Default {1} + */ + highlightBorderWidth?: number; + + /**Specifies the mouse hover color of the shape layer in map + * @Default {gray} + */ + highlightColor?: string; + + /**Specifies the mouse over stroke color of the shape layer in map + * @Default {#C1C1C1} + */ + highlightStroke?: string; + + /**Specifies the shape selection color of the shape layer in map + * @Default {gray} + */ + selectionColor?: string; + + /**Specifies the shape selection stroke color of the shape layer in map + * @Default {#C1C1C1} + */ + selectionStroke?: string; + + /**Specifies the shape selection stroke width of the shape layer in map + * @Default {1} + */ + selectionStrokeWidth?: number; + + /**Specifies the shape stroke color of the shape layer in map + * @Default {#C1C1C1} + */ + stroke?: string; + + /**Specifies the shape stroke thickness value of the shape layer in map + * @Default {0.2} + */ + strokeThickness?: number; + + /**Specifies the shape valuePath of the shape layer in map + * @Default {null} + */ + valuePath?: string; +} + +export interface ShapeLayer { + + /**to get the type of bing map. + * @Default {aerial} + */ + bingMapType?: ej.datavisualization.Map.BingMapType|string; + + /**Specifies the bubble settings for map + */ + bubbleSettings?: ShapeLayerBubbleSettings; + + /**Specifies the datasource for the shape layer + */ + dataSource?: any; + + /**Enables or disables the animation + * @Default {false} + */ + enableAnimation?: boolean; + + /**Enables or disables the shape mouse hover + * @Default {false} + */ + enableMouseHover?: boolean; + + /**Enables or disables the shape selection + * @Default {true} + */ + enableSelection?: boolean; + + /**to get the key of bing map + * @Default {null} + */ + key?: string; + + /**Options for enabling and configuring labelSettings labelPath, smartLabelSize, labelLength etc., + */ + labelSettings?: ShapeLayerLabelSettings; + + /**Specifies the map type. + * @Default {'geometry'} + */ + layerType?: ej.datavisualization.Map.LayerType|string; + + /**Options for enabling and configuring legendSettings position, height, width, mode, type etc., + */ + legendSettings?: ShapeLayerLegendSettings; + + /**Specifies the map items template for shapes. + */ + mapItemsTemplate?: string; + + /**Specify markers for shape layer. + * @Default {[]} + */ + markers?: Array; + + /**Specifies the map marker template for map layer. + * @Default {null} + */ + markerTemplate?: string; + + /**Specify selectedMapShapes for shape layer + * @Default {[]} + */ + selectedMapShapes?: Array; + + /**Specifies the selection mode of the map. Accepted selection mode values are Default and Multiple. + * @Default {default} + */ + selectionMode?: ej.datavisualization.Map.SelectionMode|string; + + /**Specifies the shape data for the shape layer + */ + shapeDataobject?: any; + + /**Specifies the shape settings of map layer + */ + shapeSettings?: ShapeLayerShapeSettings; + + /**Shows or hides the map items. + * @Default {false} + */ + showMapItems?: boolean; + + /**Shows or hides the tooltip for shapes + * @Default {false} + */ + showTooltip?: boolean; + + /**Specifies the sub shape layers + * @Default {[]} + */ + subLayers?: Array; + + /**Specifies the tooltip template for shapes. + */ + tooltipTemplate?: string; + + /**Specifies the url template for the OSM type map. + * @Default {'http://a.tile.openstreetmap.org/level/tileX/tileY.png'} + */ + urlTemplate?: string; +} +} +module Map +{ +enum Position +{ +//specifies the none position +None, +//specifies the topleft position +Topleft, +//specifies the topcenter position +Topcenter, +//specifies the topright position +Topright, +//specifies the centerleft position +Centerleft, +//specifies the center position +Center, +//specifies the centerright position +Centerright, +//specifies the bottomleft position +Bottomleft, +//specifies the bottomcenter position +Bottomcenter, +//specifies the bottomright position +Bottomright, +} +} +module Map +{ +enum Orientation +{ +//specifies the horizontal position +Horizontal, +//specifies the vertical position +Vertical, +} +} +module Map +{ +enum BingMapType +{ +//specifies the aerial type +Aerial, +//specifies the aerialwithlabel type +Aerialwithlabel, +//specifies the road type +Road, +} +} +module Map +{ +enum LabelSize +{ +//specifies the fixed size +Fixed, +//specifies the default size +Default, +} +} +module Map +{ +enum LayerType +{ +//specifies the geometry type +Geometry, +//specifies the osm type +Osm, +//specifies the bing type +Bing, +} +} +module Map +{ +enum DockPosition +{ +//specifies the top position +Top, +//specifies the bottom position +Bottom, +//specifies the bottom position +Right, +//specifies the left position +Left, +} +} +module Map +{ +enum LegendIcons +{ +//specifies the rectangle position +Rectangle, +//specifies the circle position +Circle, +} +} +module Map +{ +enum LabelOrientation +{ +//specifies the horizontal position +Horizontal, +//specifies the vertical position +Vertical, +} +} +module Map +{ +enum LegendMode +{ +//specifies the default mode +Default, +//specifies the interactive mode +Interactive, +} +} +module Map +{ +enum LegendType +{ +//specifies the layers type +Layers, +//specifies the bubbles type +Bubbles, +} +} +module Map +{ +enum SelectionMode +{ +//specifies the default position +Default, +//specifies the multiple position +Multiple, +} +} + +class TreeMap extends ej.Widget { + static fn: TreeMap; + constructor(element: JQuery, options?: TreeMap.Model); + constructor(element: Element, options?: TreeMap.Model); + model:TreeMap.Model; + defaults:TreeMap.Model; + + /** Method to reload treemap with updated values. + * @returns {void} + */ + refresh(): void; +} +export module TreeMap{ + +export interface Model { + + /**Specifies the border brush color of the treemap + * @Default {white} + */ + borderBrush?: string; + + /**Specifies the border thickness of the treemap + * @Default {1} + */ + borderThickness?: number; + + /**Specifies the colors of the paletteColorMapping + * @Default {[]} + */ + colors?: Array; + + /**Specifies the color valuepath of the treemap + * @Default {null} + */ + colorValuePath?: string; + + /**Specifies the datasource of the treemap + * @Default {null} + */ + dataSource?: any; + + /**Specifies the desaturationColorMapping settings of the treemap + */ + desaturationColorMapping?: any; + + /**Specifies the dockPosition for legend + * @Default {top} + */ + dockPosition?: ej.datavisualization.TreeMap.DockPosition|string; + + /**specifies the drillDown header color + * @Default {'null'} + */ + drillDownHeaderColor?: string; + + /**specifies the drillDown selection color + * @Default {'#000000'} + */ + drillDownSelectionColor?: string; + + /**Enable/Disable the drillDown for treemap + * @Default {false} + */ + enableDrillDown?: boolean; + + /**Specifies whether treemap need to resize when container is resized + * @Default {true} + */ + enableResize?: boolean; + + /**Specifies the from value for desaturation color mapping + * @Default {0} + */ + from?: number; + + /**Specifies the group color mapping of the treemap + * @Default {[]} + */ + groupColorMapping?: Array; + + /**Specifies the height for legend + * @Default {30} + */ + height?: number; + + /**Specifies the highlight border brush of treemap + * @Default {gray} + */ + highlightBorderBrush?: string; + + /**Specifies the border thickness when treemap items is highlighted in the treemap + * @Default {5} + */ + highlightBorderThickness?: number; + + /**Specifies the highlight border brush of treemap + * @Default {gray} + */ + highlightGroupBorderBrush?: string; + + /**Specifies the border thickness when treemap items is highlighted in the treemap + * @Default {5} + */ + highlightGroupBorderThickness?: number; + + /**Specifies whether treemap item need to highlighted on selection + * @Default {false} + */ + highlightGroupOnSelection?: boolean; + + /**Specifies whether treemap item need to highlighted on selection + * @Default {false} + */ + highlightOnSelection?: boolean; + + /**Specifies the iconHeight for legend + * @Default {15} + */ + iconHeight?: number; + + /**Specifies the iconWidth for legend + * @Default {15} + */ + iconWidth?: number; + + /**Specifies the items layout mode of the treemap. Accepted itemsLayoutMode values are Squarified, SliceAndDiceHorizontal, SliceAndDiceVertical and SliceAndDiceAuto + * @Default {Squarified} + */ + itemsLayoutMode?: ej.datavisualization.TreeMap.ItemsLayoutMode|string; + + /**Specifies the leaf settings of the treemap + */ + leafItemSettings?: LeafItemSettings; + + /**Specifies the legend settings of the treemap + */ + legendSettings?: any; + + /**Specify levels of treemap for grouped visualization of datas + * @Default {[]} + */ + levels?: Array; + + /**Specifies the paletteColorMapping of the treemap + */ + paletteColorMapping?: any; + + /**Specifies the rangeColorMapping settings of the treemap + */ + rangeColorMapping?: Array; + + /**Specifies the rangeMaximum value for desaturation color mapping + * @Default {0} + */ + rangeMaximum?: number; + + /**Specifies the rangeMinimum value for desaturation color mapping + * @Default {0} + */ + rangeMinimum?: number; + + /**Specifies the legend visibility status of the treemap + * @Default {false} + */ + showLegend?: boolean; + + /**Specifies whether treemap tooltip need to be visible + * @Default {false} + */ + showTooltip?: boolean; + + /**Specifies the template for legendSettings + * @Default {null} + */ + template?: string; + + /**Specifies the to value for desaturation color mapping + * @Default {0} + */ + to?: number; + + /**Specifies the tooltip template of the treemap + * @Default {null} + */ + tooltipTemplate?: string; + + /**Hold the treeMapItems to be displayed in treemap + * @Default {[]} + */ + treeMapItems?: Array; + + /**Hold the Level settings of TreeMap + */ + treeMapLevel?: TreeMapLevel; + + /**Specifies the uniColorMapping settings of the treemap + */ + uniColorMapping?: any; + + /**Specifies the weight valuepath of the treemap + * @Default {null} + */ + weightValuePath?: string; + + /**Specifies the width for legend + * @Default {100} + */ + width?: number; + + /**Triggers on treemap item selected.*/ + treeMapItemSelected? (e: TreeMapItemSelectedEventArgs): void; +} + +export interface TreeMapItemSelectedEventArgs { + + /**Returns selected treeMapItem object. + */ + originalEvent?: any; +} + +export interface LeafItemSettings { + + /**Specifies the border bruch color of the leaf item. + * @Default {white} + */ + borderBrush?: string; + + /**Specifies the border thickness of the leaf item. + * @Default {1} + */ + borderThickness?: number; + + /**Specifies the label template of the leaf item. + * @Default {null} + */ + itemTemplate?: string; + + /**Specifies the label path of the leaf item. + * @Default {null} + */ + labelPath?: string; + + /**Specifies the position of the leaf labels. + * @Default {center} + */ + labelPosition?: ej.datavisualization.TreeMap.Position|string; + + /**Specifies the mode of label visibility + * @Default {visible} + */ + labelVisibilityMode?: ej.datavisualization.TreeMap.VisibilityMode|string; + + /**Shows or hides the label of the leaf item. + * @Default {false} + */ + showLabels?: boolean; +} + +export interface TreeMapLevel { + + /**specifies the group background + * @Default {null} + */ + groupBackground?: string; + + /**Specifies the group border color for tree map level. + * @Default {null} + */ + groupBorderColor?: string; + + /**Specifies the group border thickness for tree map level. + * @Default {1} + */ + groupBorderThickness?: number; + + /**Specifies the group gap for tree map level. + * @Default {1} + */ + groupGap?: number; + + /**Specifies the group padding for tree map level. + * @Default {4} + */ + groupPadding?: number; + + /**Specifies the group path for tree map level. + */ + groupPath?: string; + + /**Specifies the header height for tree map level. + * @Default {0} + */ + headerHeight?: number; + + /**Specifies the header template for tree map level. + * @Default {null} + */ + headerTemplate?: string; + + /**Specifies the mode of header visibility + * @Default {visible} + */ + headerVisibilityMode?: ej.datavisualization.TreeMap.VisibilityMode|string; + + /**Specifies the position of the labels. + * @Default {center} + */ + labelPosition?: ej.datavisualization.TreeMap.Position|string; + + /**Specifies the label template for tree map level. + * @Default {null} + */ + labelTemplate?: string; + + /**Specifies the mode of label visibility + * @Default {visible} + */ + labelVisibilityMode?: ej.datavisualization.TreeMap.VisibilityMode|string; + + /**Shows or hides the header for tree map level. + * @Default {false} + */ + showHeader?: boolean; + + /**Shows or hides the labels for tree map level. + * @Default {false} + */ + showLabels?: boolean; +} +} +module TreeMap +{ +enum DockPosition +{ +//specifies the top position +Top, +//specifies the bottom position +Bottom, +//specifies the bottom position +Right, +//specifies the left position +Left, +} +} +module TreeMap +{ +enum ItemsLayoutMode +{ +//specifies the squarified as layout type position +Squarified, +//specifies the sliceanddicehorizontal as layout type position +Sliceanddicehorizontal, +//specifies the sliceanddicevertical as layout type position +Sliceanddicevertical, +//specifies the sliceanddiceauto as layout type position +Sliceanddiceauto, +} +} +module TreeMap +{ +enum Position +{ +//specifies the none position +None, +//specifies the topleft position +Topleft, +//specifies the topcenter position +Topcenter, +//specifies the topright position +Topright, +//specifies the centerleft position +Centerleft, +//specifies the center position +Center, +//specifies the centerright position +Centerright, +//specifies the bottomleft position +Bottomleft, +//specifies the bottomcenter position +Bottomcenter, +//specifies the bottomright position +Bottomright, +} +} +module TreeMap +{ +enum VisibilityMode +{ +//specifies the visible mode +Top, +//specifies the hideonexceededlength mode +Hideonexceededlength, +} +} +module TreeMap +{ +enum groupSelectionMode +{ +//specifies the default mode +Default, +//specifies the multiple mode +Multiple, +} +} + +class Diagram extends ej.Widget { + static fn: Diagram; + constructor(element: JQuery, options?: Diagram.Model); + constructor(element: Element, options?: Diagram.Model); + model:Diagram.Model; + defaults:Diagram.Model; + + /** Add nodes and connectors to diagram at runtime + * @param {any} a JSON to define a node/connector or an array of nodes and connector + * @returns {void} + */ + add(node: any): void; + + /** Add a label to a node at runtime + * @param {string} name of the node to which label will be added + * @param {any} JSON for the new label to be added + * @returns {void} + */ + addLabel(nodeName: string, newLabel: any): void; + + /** Add a phase to a swimlane at runtime + * @param {string} name of the swimlane to which the phase will be added + * @param {any} JSON object to define the phase to be added + * @returns {void} + */ + addPhase(name: string, options: any): void; + + /** Add a collection of ports to the node specified by name + * @param {string} name of the node to which the ports have to be added + * @param {Array} a collection of ports to be added to the specified node + * @returns {void} + */ + addPorts(name: string, ports: Array): void; + + /** Add the specified node to selection list + * @param {any} the node to be selected + * @param {boolean} to define whether to clear the existing selection or not + * @returns {void} + */ + addSelection(node: any, clearSelection: boolean): void; + + /** Align the selected objects based on the reference object and direction + * @param {string} to specify the direction towards which the selected objects are to be aligned("left","right",top","bottom") + * @returns {void} + */ + align(direction: string): void; + + /** Bring the specified portion of the diagram content to the diagram viewport + * @param {any} the rectangular region that is to be brought into diagram viewport + * @returns {void} + */ + bringIntoView(rect: any): void; + + /** Bring the specified portion of the diagram content to the center of the diagram viewport + * @param {any} the rectangular region that is to be brought to the center of diagram viewport + * @returns {void} + */ + bringToCenter(rect: any): void; + + /** Visually move the selected object over all other intersected objects + * @returns {void} + */ + bringToFront(): void; + + /** Remove all the elements from diagram + * @returns {void} + */ + clear(): void; + + /** Remove the current selection in diagram + * @returns {void} + */ + clearSelection(): void; + + /** Copy the selected object to internal clipboard and get the copied object + * @returns {any} + */ + copy(): any; + + /** Cut the selected object from diagram to diagram internal clipboard + * @returns {void} + */ + cut(): void; + + /** Export the diagram as downloadable files or as data + * @param {Diagram.Options} options to export the desired region of diagram to the desired formats.NameTypeDescriptionfileNamestringname of the file to be downloaded.formatstringformat of the exported file/data. See [File Formats](/js/api/global#fileformats).modestringto set whether to export diagram as a file or as raw data. See [Export Modes](/js/api/global#exportmodes).regionstringto set the region of the diagram to be exported. See [Region](/js/api/global#region).boundsobjectto export any custom region of diagram.marginobjectto set margin to the exported data. + * @returns {string} + */ + exportDiagram(options: Diagram.Options): string; + + /** Read a node/connector object by its name + * @param {string} name of the node/connector that is to be identified + * @returns {any} + */ + findNode(name: string): any; + + /** Fit the diagram content into diagram viewport + * @param {string} to set the mode of fit to command. See [Fit Mode](/js/api/global#fitmode) + * @param {string} to set whether the region to be fit will be based on diagram elements or page settings [Region](/js/api/global#region) + * @param {any} to set the required margin + * @returns {void} + */ + fitToPage(mode: string, region: string, margin: any): void; + + /** Group the selected nodes and connectors + * @returns {void} + */ + group(): void; + + /** Insert a label into a node's label collection at runtime + * @param {string} name of the node to which the label has to be inserted + * @param {any} JSON to define the new label + * @param {number} index to insert the label into the node + * @returns {void} + */ + insertLabel(name: string, label: any, index: number): void; + + /** Refresh the diagram with the specified layout + * @returns {void} + */ + layout(): void; + + /** Load the diagram + * @param {any} JSON data to load the diagram + * @returns {void} + */ + load(data: any): void; + + /** Visually move the selected object over its closest intersected object + * @returns {void} + */ + moveForward(): void; + + /** Move the selected objects by either one pixel or by the pixels specified through argument + * @param {string} specifies the direction to move the selected objects ("left","right",top","bottom") + * @param {number} specifies the number of pixels by which the selected objects have to be moved + * @returns {void} + */ + nudge(direction: string, delta: number): void; + + /** Paste the selected object from internal clipboard to diagram + * @param {any} object to be added to diagram + * @param {boolean} to define whether the specified object is to be renamed or not + * @returns {void} + */ + paste(object: any, rename: boolean): void; + + /** Print the diagram as image + * @returns {void} + */ + print(): void; + + /** Restore the last action that was reverted + * @returns {void} + */ + redo(): void; + + /** Refresh the diagram at runtime + * @returns {void} + */ + refresh(): void; + + /** Remove either the given node/connector or the selected element from diagram + * @param {any} the node/connector to be removed from diagram + * @returns {void} + */ + remove(node: any): void; + + /** Remove a particular object from selection list + * @param {any} the node/connector to be removed from selection list + * @returns {void} + */ + removeSelection(node: any): void; + + /** Scale the selected objects to the height of the first selected object + * @returns {void} + */ + sameHeight(): void; + + /** Scale the selected objects to the size of the first selected object + * @returns {void} + */ + sameSize(): void; + + /** Scale the selected objects to the width of the first selected object + * @returns {void} + */ + sameWidth(): void; + + /** Returns the diagram as serialized JSON + * @returns {any} + */ + save(): any; + + /** Bring the node into view + * @param {any} the node/connector to be brought into view + * @returns {void} + */ + scrollToNode(node: any): void; + + /** Select all nodes and connector in diagram + * @returns {void} + */ + selectAll(): void; + + /** Visually move the selected object behind its closest intersected object + * @returns {void} + */ + sendBackward(): void; + + /** Visually move the selected object behind all other intersected objects + * @returns {void} + */ + sendToBack(): void; + + /** Update the horizontal space between the selected objects as equal and within the selection boundary + * @returns {void} + */ + spaceAcross(): void; + + /** Update the vertical space between the selected objects as equal and within the selection boundary + * @returns {void} + */ + spaceDown(): void; + + /** Move the specified label to edit mode + * @param {any} node/connector that contains the label to be edited + * @param {any} to be edited + * @returns {void} + */ + startLabelEdit(node: any, label: any): void; + + /** Reverse the last action that was performed + * @returns {void} + */ + undo(): void; + + /** Ungroup the selected group + * @returns {void} + */ + ungroup(): void; + + /** Update diagram at runtime + * @param {any} JSON to specify the diagram properties that have to be modified + * @returns {void} + */ + update(options: any): void; + + /** Update Connectors at runtime + * @param {string} name of the connector to be updated + * @param {any} JSON to specify the connector properties that have to be updated + * @returns {void} + */ + updateConnector(name: string, options: any): void; + + /** Update the given label at runtime + * @param {string} the name of node/connector which contains the label to be updated + * @param {any} the label to be modified + * @param {any} JSON to specify the label properties that have to be updated + * @returns {any} + */ + updateLabel(nodeName: string, label: any, options: any): any; + + /** Update nodes at runtime + * @param {string} name of the node that is to be updated + * @param {any} JSON to specify the properties of node that have to be updated + * @returns {void} + */ + updateNode(name: string, options: any): void; + + /** Update a port with its modified properties at runtime + * @param {string} the name of node which contains the port to be updated + * @param {any} the port to be updated + * @param {any} JSON to specify the properties of the port that have to be updated + * @returns {void} + */ + updatePort(nodeName: string, port: any, options: any): void; + + /** Update the specified node as selected object + * @param {string} name of the node to be updated as selected object + * @returns {void} + */ + updateSelectedObject(name: string): void; + + /** Update the selection at runtime + * @param {boolean} to specify whether to show the user handles or not + * @returns {void} + */ + updateSelection(showUserHandles: boolean): void; + + /** Update userhandles with respect to the given node + * @param {any} node/connector with respect to which, the user handles have to be updated + * @returns {void} + */ + updateUserHandles(node: any): void; + + /** Update the diagram viewport at runtime + * @returns {void} + */ + updateViewPort(): void; + + /** Upgrade the diagram from old version + * @param {any} to be upgraded + * @returns {void} + */ + upgrade(data: any): void; + + /** Used to zoomIn/zoomOut diagram + * @param {any} options to zoom the diagram(zoom factor, zoomIn/zoomOut) + * @returns {void} + */ + zoomTo(zoom: any): void; +} +export module Diagram{ + +export interface Options { + + /**name of the file to be downloaded. + */ + fileName?: string; + + /**format of the exported file/data. See [File Formats](/js/api/global#fileformats). + */ + format?: string; + + /**to set whether to export diagram as a file or as raw data. See [Export Modes](/js/api/global#exportmodes). + */ + mode?: string; + + /**to set the region of the diagram to be exported. See [Region](/js/api/global#region). + */ + region?: string; + + /**to export any custom region of diagram. + */ + bounds?: any; + + /**to set margin to the exported data. + */ + margin?: any; +} + +export interface Model { + + /**Defines the background color of diagram elements + * @Default {transparent} + */ + backgroundColor?: string; + + /**Defines the path of the background image of diagram elements + * @Default {null} + */ + backgroundImage?: string; + + /**Sets the direction of line bridges. + * @Default {ej.datavisualization.Diagram.BridgeDirection.Top} + */ + bridgeDirection?: ej.datavisualization.Diagram.BridgeDirection|string; + + /**Defines a set of custom commands and binds them with a set of desired key gestures. + */ + commandManager?: CommandManager; + + /**A collection of JSON objects where each object represents a connector + * @Default {[]} + */ + connectors?: Array; + + /**Binds the custom JSON data with connector properties + * @Default {null} + */ + connectorTemplate?: any; + + /**Enables/Disables the default behaviors of the diagram. + * @Default {ej.datavisualization.Diagram.DiagramConstraints.All} + */ + constraints?: ej.datavisualization.Diagram.DiagramConstraints|string; + + /**An object to customize the context menu of diagram + */ + contextMenu?: ContextMenu; + + /**Configures the data source that is to be bound with diagram + */ + dataSourceSettings?: DataSourceSettings; + + /**Initializes the default values for nodes and connectors + * @Default {{}} + */ + defaultSettings?: DefaultSettings; + + /**Sets the type of Json object to be drawn through drawing tool + * @Default {{}} + */ + drawType?: any; + + /**Enables or disables auto scroll in diagram + * @Default {true} + */ + enableAutoScroll?: boolean; + + /**Enables or disables diagram context menu + * @Default {true} + */ + enableContextMenu?: boolean; + + /**Specifies the height of the diagram + * @Default {null} + */ + height?: string; + + /**Customizes the undo redo functionality + */ + historyManager?: HistoryManager; + + /**Automatically arranges the nodes and connectors in a predefined manner + */ + layout?: Layout; + + /**Defines the current culture of diagram + * @Default {en-US} + */ + locale?: string; + + /**Array of JSON objects where each object represents a node + * @Default {[]} + */ + nodes?: Array; + + /**Binds the custom JSON data with node properties + * @Default {null} + */ + nodeTemplate?: any; + + /**Defines the size and appearance of diagram page + */ + pageSettings?: PageSettings; + + /**Defines the zoom value, zoom factor, scroll status and view port size of the diagram + */ + scrollSettings?: ScrollSettings; + + /**Defines the size and position of selected items and defines the appearance of selector + */ + selectedItems?: SelectedItems; + + /**Enables or disables tooltip of diagram + * @Default {true} + */ + showTooltip?: boolean; + + /**Defines the gridlines and defines how and when the objects have to be snapped + */ + snapSettings?: SnapSettings; + + /**Enables/Disables the interactive behaviors of diagram. + * @Default {ej.datavisualization.Diagram.Tool.All} + */ + tool?: ej.datavisualization.Diagram.Tool|string; + + /**An object that defines the description, appearance and alignments of tooltips + * @Default {null} + */ + tooltip?: Tooltip; + + /**Specifies the width of the diagram + * @Default {null} + */ + width?: string; + + /**Sets the factor by which we can zoom in or zoom out + * @Default {0.2} + */ + zoomFactor?: number; + + /**Triggers When auto scroll is changed*/ + autoScrollChange? (e: AutoScrollChangeEventArgs): void; + + /**Triggers when a node, connector or diagram is clicked*/ + click? (e: ClickEventArgs): void; + + /**Triggers when the connection is changed*/ + connectionChange? (e: ConnectionChangeEventArgs): void; + + /**Triggers when the connector collection is changed*/ + connectorCollectionChange? (e: ConnectorCollectionChangeEventArgs): void; + + /**Triggers when the connectors' source point is changed*/ + connectorSourceChange? (e: ConnectorSourceChangeEventArgs): void; + + /**Triggers when the connectors' target point is changed*/ + connectorTargetChange? (e: ConnectorTargetChangeEventArgs): void; + + /**Triggers before opening the context menu*/ + contextMenuBeforeOpen? (e: ContextMenuBeforeOpenEventArgs): void; + + /**Triggers when a context menu item is clicked*/ + contextMenuClick? (e: ContextMenuClickEventArgs): void; + + /**Triggers when a node, connector or diagram model is clicked twice*/ + doubleClick? (e: DoubleClickEventArgs): void; + + /**Triggers while dragging the elements in diagram*/ + drag? (e: DragEventArgs): void; + + /**Triggers when a symbol is dragged into diagram from symbol palette*/ + dragEnter? (e: DragEnterEventArgs): void; + + /**Triggers when a symbol is dragged outside of the diagram.*/ + dragLeave? (e: DragLeaveEventArgs): void; + + /**Triggers when a symbol is dragged over diagram*/ + dragOver? (e: DragOverEventArgs): void; + + /**Triggers when a symbol is dragged and dropped from symbol palette to drawing area*/ + drop? (e: DropEventArgs): void; + + /**Triggers when a child is added to or removed from a group*/ + groupChange? (e: GroupChangeEventArgs): void; + + /**Triggers when a diagram element is clicked*/ + itemClick? (e: ItemClickEventArgs): void; + + /**Triggers when mouse enters a node/connector*/ + mouseEnter? (e: MouseEnterEventArgs): void; + + /**Triggers when mouse leaves node/connector*/ + mouseLeave? (e: MouseLeaveEventArgs): void; + + /**Triggers when mouse hovers over a node/connector*/ + mouseOver? (e: MouseOverEventArgs): void; + + /**Triggers when node collection is changed*/ + nodeCollectionChange? (e: NodeCollectionChangeEventArgs): void; + + /**Triggers when the node properties(x, y,width and height alone) are changed using nudge commands or updateNode API.*/ + propertyChange? (e: PropertyChangeEventArgs): void; + + /**Triggers when the diagram elements are rotated*/ + rotationChange? (e: RotationChangeEventArgs): void; + + /**Triggers when the diagram is zoomed or panned*/ + scrollChange? (e: ScrollChangeEventArgs): void; + + /**Triggers when a connector segment is edited*/ + segmentChange? (e: SegmentChangeEventArgs): void; + + /**Triggers when the selection is changed in diagram*/ + selectionChange? (e: SelectionChangeEventArgs): void; + + /**Triggers when a node is resized*/ + sizeChange? (e: SizeChangeEventArgs): void; + + /**Triggers when label editing is ended*/ + textChange? (e: TextChangeEventArgs): void; +} + +export interface AutoScrollChangeEventArgs { + + /**Returns the delay between subsequent auto scrolls + */ + delay?: string; +} + +export interface ClickEventArgs { + + /**parameter returns the clicked node, connector or diagram + */ + element?: any; + + /**parameter returns the object that is actually clicked + */ + actualObject?: number; + + /**parameter returns the horizontal coordinate of the mouse pointer, relative to the diagram + */ + offsetX?: number; + + /**parameter returns the vertical coordinate of the mouse pointer, relative to the diagram + */ + offsetY?: number; + + /**parameter returns the count of how many times the mouse button is pressed + */ + count?: number; + + /**parameter returns the actual click event arguments that explains which button is clicked + */ + event?: any; +} + +export interface ConnectionChangeEventArgs { + + /**parameter returns the connection that is changed between nodes, ports or points + */ + element?: any; + + /**parameter returns the new source node or target node of the connector + */ + connection?: string; + + /**parameter returns the new source port or target port of the connector + */ + port?: any; + + /**parameter defines whether to cancel the change or not + */ + cancel?: boolean; +} + +export interface ConnectorCollectionChangeEventArgs { + + /**parameter returns whether the connector is inserted or removed + */ + changeType?: string; + + /**parameter returns the connector that is to be added or deleted + */ + element?: any; + + /**parameter defines whether to cancel the collection change or not + */ + cancel?: boolean; +} + +export interface ConnectorSourceChangeEventArgs { + + /**returns the connector, the source point of which is being dragged + */ + element?: any; + + /**returns the source node of the element + */ + node?: any; + + /**returns the source point of the element + */ + point?: any; + + /**returns the source port of the element + */ + port?: any; + + /**returns the state of connection end point dragging(starting, dragging, completed) + */ + dragState?: string; + + /**parameter defines whether to cancel the change or not + */ + cancel?: boolean; +} + +export interface ConnectorTargetChangeEventArgs { + + /**parameter returns the connector, the target point of which is being dragged + */ + element?: any; + + /**returns the target node of the element + */ + node?: any; + + /**returns the target point of the element + */ + point?: any; + + /**returns the target port of the element + */ + port?: any; + + /**returns the state of connection end point dragging(starting, dragging, completed) + */ + dragState?: string; + + /**parameter defines whether to cancel the change or not + */ + cancel?: boolean; +} + +export interface ContextMenuBeforeOpenEventArgs { + + /**parameter returns the diagram object + */ + diagram?: any; + + /**parameter returns the actual arguments from context menu + */ + contextmenu?: any; + + /**parameter returns the object that was clicked + */ + target?: any; +} + +export interface ContextMenuClickEventArgs { + + /**parameter returns the id of the selected context menu item + */ + id?: string; + + /**parameter returns the text of the selected context menu item + */ + text?: string; + + /**parameter returns the parent id of the selected context menu item + */ + parentId?: string; + + /**parameter returns the parent text of the selected context menu item + */ + parentText?: string; + + /**parameter returns the object that was clicked + */ + target?: any; + + /**parameter defines whether to execute the click event or not + */ + canExecute?: boolean; +} + +export interface DoubleClickEventArgs { + + /**parameter returns the object that is actually clicked + */ + actualObject?: any; + + /**parameter returns the selected object + */ + element?: any; +} + +export interface DragEventArgs { + + /**parameter returns the node or connector that is being dragged + */ + element?: any; + + /**parameter returns the previous position of the node/connector + */ + oldValue?: any; + + /**parameter returns the new position of the node/connector + */ + newValue?: any; + + /**parameter returns the state of drag event (Starting, dragging, completed) + */ + dragState?: string; + + /**parameter returns whether or not to cancel the drag event + */ + cancel?: boolean; +} + +export interface DragEnterEventArgs { + + /**parameter returns the node or connector that is dragged into diagram + */ + element?: any; + + /**parameter returns whether to add or remove the symbol from diagram + */ + cancel?: boolean; +} + +export interface DragLeaveEventArgs { + + /**parameter returns the node or connector that is dragged outside of the diagram + */ + element?: any; +} + +export interface DragOverEventArgs { + + /**parameter returns the node or connector that is dragged over diagram + */ + element?: any; + + /**parameter defines whether the symbol can be dropped at the current mouse position + */ + allowDrop?: boolean; + + /**parameter returns the node/connector over which the symbol is dragged + */ + target?: any; + + /**parameter returns the previous position of the node/connector + */ + oldValue?: any; + + /**parameter returns the new position of the node/connector + */ + newValue?: any; + + /**parameter returns whether or not to cancel the dragOver event + */ + cancel?: boolean; +} + +export interface DropEventArgs { + + /**parameter returns node or connector that is being dropped + */ + element?: any; + + /**parameter returns whether or not to cancel the drop event + */ + cancel?: boolean; + + /**parameter returns the object from where the element is dragged + */ + source?: any; + + /**parameter returns the object over which the object will be dropped + */ + target?: any; + + /**parameter returns the enum which defines the type of the source + */ + sourceType?: string; +} + +export interface GroupChangeEventArgs { + + /**parameter returns the object that is added to/removed from a group + */ + element?: any; + + /**parameter returns the old parent group(if any) of the object + */ + oldParent?: any; + + /**parameter returns the new parent group(if any) of the object + */ + newParent?: any; + + /**parameter returns the cause of group change("group", unGroup") + */ + cause?: string; +} + +export interface ItemClickEventArgs { + + /**parameter returns the object that was actually clicked + */ + actualObject?: any; + + /**parameter returns the object that is selected + */ + selectedObject?: any; + + /**parameter returns whether or not to cancel the drop event + */ + cancel?: boolean; + + /**parameter returns the actual click event arguments that explains which button is clicked + */ + event?: any; +} + +export interface MouseEnterEventArgs { + + /**parameter returns the target node or connector + */ + element?: any; + + /**parameter returns the object from where the selected object is dragged + */ + source?: any; + + /**parameter returns the target object over which the selected object is dragged + */ + target?: any; +} + +export interface MouseLeaveEventArgs { + + /**parameter returns the target node or connector + */ + element?: any; + + /**parameter returns the object from where the selected object is dragged + */ + source?: any; + + /**parameter returns the target object over which the selected object is dragged + */ + target?: any; +} + +export interface MouseOverEventArgs { + + /**parameter returns the target node or connector + */ + element?: any; + + /**parameter returns the object from where the element is dragged + */ + source?: any; + + /**parameter returns the object over which the element is being dragged. + */ + target?: any; +} + +export interface NodeCollectionChangeEventArgs { + + /**parameter returns whether the node is to be added or removed + */ + changeType?: string; + + /**parameter returns the node which needs to be added or deleted + */ + element?: any; + + /**parameter defines whether to cancel the collection change or not + */ + cancel?: boolean; +} + +export interface PropertyChangeEventArgs { + + /**parameter returns the selected element + */ + element?: any; + + /**parameter returns the action is nudge or not + */ + cause?: string; + + /**parameter returns the new value of the node property that is being changed + */ + newValue?: any; + + /**parameter returns the old value of the property that is being changed + */ + oldValue?: any; + + /**parameter returns the name of the property that is changed + */ + propertyName?: string; +} + +export interface RotationChangeEventArgs { + + /**parameter returns the node that is rotated + */ + element?: any; + + /**parameter returns the previous rotation angle + */ + oldValue?: any; + + /**parameter returns the new rotation angle + */ + newValue?: any; + + /**parameter to specify whether or not to cancel the event + */ + cancel?: boolean; +} + +export interface ScrollChangeEventArgs { + + /**Parameter returns the new zoom value, horizontal and vertical scroll offsets. + */ + newValues?: any; + + /**parameter returns the previous zoom value, horizontal and vertical scroll offsets. + */ + oldValues?: any; +} + +export interface SegmentChangeEventArgs { + + /**Parameter returns the connector that is being edited + */ + element?: any; + + /**parameter returns the state of editing (starting, dragging, completed) + */ + dragState?: string; + + /**parameter returns the current mouse position + */ + point?: any; + + /**parameter to specify whether or not to cancel the event + */ + cancel?: boolean; +} + +export interface SelectionChangeEventArgs { + + /**parameter returns whether the item is selected or removed selection + */ + changeType?: string; + + /**parameter returns the item which is selected or to be selected + */ + element?: any; + + /**parameter returns the collection of nodes and connectors that have to be removed from selection list + */ + oldItems?: Array; + + /**parameter returns the collection of nodes and connectors that have to be added to selection list + */ + newItems?: Array; + + /**parameter returns the collection of nodes and connectors that will be selected after selection change + */ + selectedItems?: Array; + + /**parameter to specify whether or not to cancel the selection change event + */ + cancel?: boolean; +} + +export interface SizeChangeEventArgs { + + /**parameter returns node that was resized + */ + element?: any; + + /**parameter to cancel the size change + */ + cancel?: boolean; + + /**parameter returns the new width, height, offsetX and offsetY values of the element that is being resized + */ + newValue?: any; + + /**parameter returns the previous width,height,offsetX and offsetY values of the element that is being resized + */ + oldValue?: any; + + /**parameter returns the state of resizing(starting,resizing,completed) + */ + resizeState?: string; + + /**parameter returns the difference between new and old value + */ + offset?: any; +} + +export interface TextChangeEventArgs { + + /**parameter returns the node that contains the text being edited + */ + element?: any; + + /**parameter returns the new text + */ + value?: string; + + /**parameter returns the keyCode of the key entered + */ + keyCode?: string; +} + +export interface CommandManagerCommandsGesture { + + /**Sets the key value, on recognition of which the command will be executed. + * @Default {ej.datavisualization.Diagram.Keys.None} + */ + key?: ej.datavisualization.Diagram.Keys|string; + + /**Sets a combination of key modifiers, on recognition of which the command will be executed. + * @Default {ej.datavisualization.Diagram.KeyModifiers.None} + */ + keyModifiers?: ej.datavisualization.Diagram.KeyModifiers|string; +} + +export interface CommandManagerCommands { + + /**A method that defines whether the command is executable at the moment or not. + */ + canExecute?: Function; + + /**A method that defines what to be executed when the key combination is recognized. + */ + execute?: Function; + + /**Defines a combination of keys and key modifiers, on recognition of which the command will be executed + */ + gesture?: CommandManagerCommandsGesture; + + /**Defines any additional parameters that are required at runtime + * @Default {null} + */ + parameter?: any; +} + +export interface CommandManager { + + /**An object that maps a set of command names with the corresponding command objects + * @Default {{}} + */ + commands?: CommandManagerCommands; +} + +export interface ConnectorsSegments { + + /**Sets the direction of orthogonal segment + */ + direction?: string; + + /**Describes the length of orthogonal segment + * @Default {undefined} + */ + length?: number; + + /**Describes the end point of bezier/straight segment + * @Default {Diagram.Point()} + */ + point?: ej.datavisualization.Diagram.ConnectorsSourcePoint|string; + + /**Defines the first control point of the bezier segment + * @Default {null} + */ + point1?: ej.datavisualization.Diagram.ConnectorsSourcePoint|string; + + /**Defines the second control point of bezier segment + * @Default {null} + */ + point2?: ej.datavisualization.Diagram.ConnectorsSourcePoint|string; + + /**Sets the type of the segment. + * @Default {ej.datavisualization.Diagram.Segments.Straight} + */ + type?: ej.datavisualization.Diagram.Segments|string; + + /**Describes the length and angle between the first control point and the start point of bezier segment + * @Default {null} + */ + vector1?: any; + + /**Describes the length and angle between the second control point and end point of bezier segment + * @Default {null} + */ + vector2?: any; +} + +export interface ConnectorsSourceDecorator { + + /**Sets the border color of the source decorator + * @Default {black} + */ + borderColor?: string; + + /**Sets the border width of the decorator + * @Default {1} + */ + borderWidth?: number; + + /**Sets the fill color of the source decorator + * @Default {black} + */ + fillColor?: string; + + /**Sets the height of the source decorator + * @Default {8} + */ + height?: number; + + /**Defines the custom shape of the source decorator + */ + pathData?: string; + + /**Defines the shape of the source decorator. + * @Default {ej.datavisualization.Diagram.DecoratorShapes.Arrow} + */ + shape?: ej.datavisualization.Diagram.DecoratorShapes|string; + + /**Defines the width of the source decorator + * @Default {8} + */ + width?: number; +} + +export interface ConnectorsSourcePoint { + + /**Defines the x-coordinate of a position + * @Default {0} + */ + x?: number; + + /**Defines the y-coordinate of a position + * @Default {0} + */ + y?: number; +} + +export interface ConnectorsTargetDecorator { + + /**Sets the border color of the decorator + * @Default {black} + */ + borderColor?: string; + + /**Sets the color with which the decorator will be filled + * @Default {black} + */ + fillColor?: string; + + /**Defines the height of the target decorator + * @Default {8} + */ + height?: number; + + /**Defines the custom shape of the target decorator + */ + pathData?: string; + + /**Defines the shape of the target decorator. + * @Default {ej.datavisualization.Diagram.DecoratorShapes.Arrow} + */ + shape?: ej.datavisualization.Diagram.DecoratorShapes|string; + + /**Defines the width of the target decorator + * @Default {8} + */ + width?: number; +} + +export interface Connectors { + + /**To maintain additional information about connectors + * @Default {null} + */ + addInfo?: any; + + /**Defines the width of the line bridges + * @Default {10} + */ + bridgeSpace?: number; + + /**Enables or disables the behaviors of connectors. + * @Default {ej.datavisualization.Diagram.ConnectorConstraints.Default} + */ + constraints?: ej.datavisualization.Diagram.ConnectorConstraints|string; + + /**Defines the radius of the rounded corner + * @Default {0} + */ + cornerRadius?: number; + + /**Configures the styles of shapes + */ + cssClass?: string; + + /**Sets the horizontal alignment of the connector. Applicable, if the parent of the connector is a container. + * @Default {ej.datavisualization.Diagram.HorizontalAlignment.Left} + */ + horizontalAlign?: ej.datavisualization.Diagram.HorizontalAlignment|string; + + /**A collection of JSON objects where each object represents a label. For label properties, refer Labels + * @Default {[]} + */ + labels?: Array; + + /**Sets the stroke color of the connector + * @Default {black} + */ + lineColor?: string; + + /**Sets the pattern of dashes and gaps used to stroke the path of the connector + */ + lineDashArray?: string; + + /**Defines the padding value to ease the interaction with connectors + * @Default {10} + */ + lineHitPadding?: number; + + /**Sets the width of the line + * @Default {1} + */ + lineWidth?: number; + + /**Defines the minimum space to be left between the bottom of parent bounds and the connector. Applicable, if the parent is a container. + * @Default {0} + */ + marginBottom?: number; + + /**Defines the minimum space to be left between the left of parent bounds and the connector. Applicable, if the parent is a container. + * @Default {0} + */ + marginLeft?: number; + + /**Defines the minimum space to be left between the right of parent bounds and the connector. Applicable, if the parent is a container. + * @Default {0} + */ + marginRight?: number; + + /**Defines the minimum space to be left between the top of parent bounds and the connector. Applicable, if the parent is a container. + * @Default {0} + */ + marginTop?: number; + + /**Sets a unique name for the connector + */ + name?: string; + + /**Defines the transparency of the connector + * @Default {1} + */ + opacity?: number; + + /**Defines the size and preview size of the node to add that to symbol palette. To explore palette item, refer Palette Item + * @Default {null} + */ + paletteItem?: any; + + /**Sets the parent name of the connector. + */ + parent?: string; + + /**An array of JSON objects where each object represents a segment + * @Default {[ { type:straight } ]} + */ + segments?: Array; + + /**Defines the source decorator of the connector + * @Default {{ shape:arrow, width: 8, height:8, borderColor:black, fillColor:black }} + */ + sourceDecorator?: ConnectorsSourceDecorator; + + /**Sets the source node of the connector + */ + sourceNode?: string; + + /**Defines the space to be left between the source node and the source point of a connector + * @Default {0} + */ + sourcePadding?: number; + + /**Describes the start point of the connector + * @Default {ej.datavisualization.Diagram.Point()} + */ + sourcePoint?: ConnectorsSourcePoint; + + /**Sets the source port of the connector + */ + sourcePort?: string; + + /**Defines the target decorator of the connector + * @Default {{ shape:arrow, width: 8, height:8, borderColor:black, fillColor:black }} + */ + targetDecorator?: ConnectorsTargetDecorator; + + /**Sets the target node of the connector + */ + targetNode?: string; + + /**Defines the space to be left between the target node and the target point of the connector + * @Default {0} + */ + targetPadding?: number; + + /**Describes the end point of the connector + * @Default {ej.datavisualization.Diagram.Point()} + */ + targetPoint?: ej.datavisualization.Diagram.ConnectorsSourcePoint|string; + + /**Sets the targetPort of the connector + */ + targetPort?: string; + + /**Defines the tooltip that should be shown when the mouse hovers over connector. For tooltip properties, refer Tooltip + * @Default {null} + */ + tooltip?: any; + + /**To set the vertical alignment of connector (Applicable,if the parent is group). + * @Default {ej.datavisualization.Diagram.VerticalAlignment.Top} + */ + verticalAlign?: ej.datavisualization.Diagram.VerticalAlignment|string; + + /**Enables or disables the visibility of connector + * @Default {true} + */ + visible?: boolean; + + /**Sets the z-index of the connector + * @Default {0} + */ + zOrder?: number; +} + +export interface ContextMenu { + + /**Defines the collection of context menu items + * @Default {[]} + */ + items?: Array; + + /**To set whether to display the default context menu items or not + * @Default {false} + */ + showCustomMenuItemsOnly?: boolean; +} + +export interface DataSourceSettings { + + /**Defines the data source either as a collection of objects or as an instance of ej.DataManager + * @Default {null} + */ + dataSource?: any; + + /**Sets the unique id of the data source items + */ + id?: string; + + /**Defines the parent id of the data source item + * @Default {''} + */ + parent?: string; + + /**Describes query to retrieve a set of data from the specified datasource + * @Default {null} + */ + query?: string; + + /**Sets the unique id of the root data source item + */ + root?: string; + + /**Describes the name of the table on which the specified query has to be executed + * @Default {null} + */ + tableName?: string; +} + +export interface DefaultSettings { + + /**Initializes the default connector properties + * @Default {null} + */ + connector?: any; + + /**Initializes the default properties of groups + * @Default {null} + */ + group?: any; + + /**Initializes the default properties for nodes + * @Default {null} + */ + node?: any; +} + +export interface HistoryManager { + + /**A method that takes a history entry as argument and returns whether the specific entry can be popped or not + */ + canPop?: Function; + + /**A method that ends grouping the changes + */ + closeGroupAction?: Function; + + /**A method that removes the history of a recent change made in diagram + */ + pop?: Function; + + /**A method that allows to track the custom changes made in diagram + */ + push?: Function; + + /**Defines what should be happened while trying to restore a custom change + * @Default {null} + */ + redo?: Function; + + /**A method that starts to group the changes to revert/restore them in a single undo or redo + */ + startGroupAction?: Function; + + /**Defines what should be happened while trying to revert a custom change + */ + undo?: Function; +} + +export interface Layout { + + /**Defines the fixed node with reference to which, the layout will be arranged and fixed node will not be repositioned + */ + fixedNode?: string; + + /**Customizes the orientation of trees/sub trees. For orientations, see Chart Orientations. For chart types, see Chart Types + * @Default {null} + */ + getLayoutInfo?: any; + + /**Sets the space to be horizontally left between nodes + * @Default {30} + */ + horizontalSpacing?: number; + + /**Sets the margin value to be horizontally left between the layout and diagram + * @Default {0} + */ + marginX?: number; + + /**Sets the margin value to be vertically left between layout and diagram + * @Default {0} + */ + marginY?: number; + + /**Sets the orientation/direction to arrange the diagram elements. + * @Default {ej.datavisualization.Diagram.LayoutOrientations.TopToBottom} + */ + orientation?: ej.datavisualization.Diagram.LayoutOrientations|string; + + /**Sets the type of the layout based on which the elements will be arranged. + * @Default {ej.datavisualization.Diagram.LayoutTypes.None} + */ + type?: ej.datavisualization.Diagram.LayoutTypes|string; + + /**Sets the space to be vertically left between nodes + * @Default {30} + */ + verticalSpacing?: number; +} + +export interface NodesContainer { + + /**Defines the orientation of the container. Applicable, if the group is a container. + * @Default {vertical} + */ + orientation?: string; + + /**Sets the type of the container. Applicable if the group is a container. + * @Default {ej.datavisualization.Diagram.ContainerType.Canvas} + */ + type?: ej.datavisualization.Diagram.ContainerType|string; +} + +export interface NodesGradientLinearGradient { + + /**Defines the different colors and the region of color transitions + * @Default {[]} + */ + stops?: Array; + + /**Defines the left most position(relative to node) of the rectangular region that needs to be painted + * @Default {0} + */ + x1?: number; + + /**Defines the right most position(relative to node) of the rectangular region that needs to be painted + * @Default {0} + */ + x2?: number; + + /**Defines the top most position(relative to node) of the rectangular region that needs to be painted + * @Default {0} + */ + y1?: number; + + /**Defines the bottom most position(relative to node) of the rectangular region that needs to be painted + * @Default {0} + */ + y2?: number; +} + +export interface NodesGradientRadialGradient { + + /**Defines the position of the outermost circle + * @Default {0} + */ + cx?: number; + + /**Defines the outer most circle of the radial gradient + * @Default {0} + */ + cy?: number; + + /**Defines the innermost circle of the radial gradient + * @Default {0} + */ + fx?: number; + + /**Defines the innermost circle of the radial gradient + * @Default {0} + */ + fy?: number; + + /**Defines the different colors and the region of color transitions. + * @Default {[]} + */ + stops?: Array; +} + +export interface NodesGradientStop { + + /**Sets the color to be filled over the specified region + */ + color?: string; + + /**Sets the position where the previous color transition ends and a new color transition starts + * @Default {0} + */ + offset?: number; + + /**Describes the transparency level of the region + * @Default {1} + */ + opacity?: number; +} + +export interface NodesGradient { + + /**Paints the node with linear color transitions + */ + LinearGradient?: NodesGradientLinearGradient; + + /**Paints the node with radial color transitions. A focal point defines the beginning of the gradient, and a circle defines the end point of the gradient. + */ + RadialGradient?: NodesGradientRadialGradient; + + /**Defines the color and a position where the previous color transition ends and a new color transition starts + */ + Stop?: NodesGradientStop; +} + +export interface NodesLabels { + + /**Enables/disables the bold style + * @Default {false} + */ + bold?: boolean; + + /**Sets the border color of the label + * @Default {transparent} + */ + borderColor?: string; + + /**Sets the border width of the label + * @Default {0} + */ + borderWidth?: number; + + /**Sets the fill color of the text area + * @Default {transparent} + */ + fillColor?: string; + + /**Sets the font color of the text + * @Default {black} + */ + fontColor?: string; + + /**Sets the font family of the text + * @Default {Arial} + */ + fontFamily?: string; + + /**Defines the font size of the text + * @Default {12} + */ + fontSize?: number; + + /**Sets the horizontal alignment of the label. + * @Default {ej.datavisualization.Diagram.HorizontalAlignment.Center} + */ + horizontalAlignment?: ej.datavisualization.Diagram.HorizontalAlignment|string; + + /**Enables/disables the italic style + * @Default {false} + */ + italic?: boolean; + + /**To set the margin of the label + * @Default {ej.datavisualization.Diagram.Margin()} + */ + margin?: any; + + /**Gets whether the label is currently being edited or not. + * @Default {ej.datavisualization.Diagram.LabelEditMode.Edit} + */ + mode?: ej.datavisualization.Diagram.LabelEditMode|string; + + /**Sets the unique identifier of the label + */ + name?: string; + + /**Sets the fraction/ratio(relative to node) that defines the position of the label + * @Default {ej.datavisualization.Diagram.Point(0.5, 0.5)} + */ + offset?: any; + + /**Defines whether the label is editable or not + * @Default {false} + */ + readOnly?: boolean; + + /**Defines the angle to which the label needs to be rotated + * @Default {0} + */ + rotateAngle?: number; + + /**Defines the label text + */ + text?: string; + + /**Defines how to align the text inside the label. + * @Default {ej.datavisualization.Diagram.TextAlign.Center} + */ + textAlign?: ej.datavisualization.Diagram.TextAlign|string; + + /**Sets how to decorate the label text. + * @Default {ej.datavisualization.Diagram.TextDecorations.None} + */ + textDecoration?: ej.datavisualization.Diagram.TextDecorations|string; + + /**Sets the vertical alignment of the label. + * @Default {ej.datavisualization.Diagram.VerticalAlignment.Center} + */ + verticalAlignment?: ej.datavisualization.Diagram.VerticalAlignment|string; + + /**Enables or disables the visibility of the label + * @Default {true} + */ + visible?: boolean; + + /**Sets the width of the label(the maximum value of label width and the node width will be considered as label width) + * @Default {50} + */ + width?: number; + + /**Defines how the label text needs to be wrapped. + * @Default {ej.datavisualization.Diagram.TextWrapping.WrapWithOverflow} + */ + wrapping?: ej.datavisualization.Diagram.TextWrapping|string; +} + +export interface NodesLanes { + + /**Allows to maintain additional information about lane + * @Default {{}} + */ + addInfo?: any; + + /**An array of objects where each object represents a child node of the lane + * @Default {[]} + */ + children?: Array; + + /**Defines the fill color of the lane + * @Default {white} + */ + fillColor?: string; + + /**Defines the header of the lane + * @Default {{ text: Function, fontSize: 11 }} + */ + header?: any; + + /**Defines the object as a lane + * @Default {false} + */ + isLane?: boolean; + + /**Sets the unique identifier of the lane + */ + name?: string; + + /**Sets the orientation of the lane. + * @Default {vertical} + */ + orientation?: string; +} + +export interface NodesPaletteItem { + + /**Defines whether the symbol should be drawn at its actual size regardless of precedence factors or not + * @Default {true} + */ + enableScale?: boolean; + + /**Defines the height of the symbol + * @Default {0} + */ + height?: number; + + /**Defines the margin of the symbol item + * @Default {{ left: 4, right: 4, top: 4, bottom: 4 }} + */ + margin?: any; + + /**Defines the preview height of the symbol + * @Default {undefined} + */ + previewHeight?: number; + + /**Defines the preview width of the symbol + * @Default {undefined} + */ + previewWidth?: number; + + /**Defines the width of the symbol + * @Default {0} + */ + width?: number; +} + +export interface NodesPhases { + + /**Defines the header of the smaller regions + * @Default {null} + */ + label?: any; + + /**Defines the line color of the splitter that splits adjacent phases. + * @Default {#606060} + */ + lineColor?: string; + + /**Sets the dash array that used to stroke the phase splitter + * @Default {3,3} + */ + lineDashArray?: string; + + /**Sets the lineWidth of the phase + * @Default {1} + */ + lineWidth?: number; + + /**Sets the unique identifier of the phase + */ + name?: string; + + /**Sets the length of the smaller region(phase) of a swimlane + * @Default {100} + */ + offset?: number; + + /**Sets the orientation of the phase + * @Default {horizontal} + */ + orientation?: string; + + /**Sets the type of the object as phase + * @Default {phase} + */ + type?: string; +} + +export interface NodesPorts { + + /**Sets the border color of the port + * @Default {#1a1a1a} + */ + borderColor?: string; + + /**Sets the stroke width of the port + * @Default {1} + */ + borderWidth?: number; + + /**Defines the space to be left between the port bounds and its incoming and outgoing connections. + * @Default {0} + */ + connectorPadding?: number; + + /**Defines whether connections can be created with the port + * @Default {ej.datavisualization.Diagram.PortConstraints.Connect} + */ + constraints?: ej.datavisualization.Diagram.PortConstraints|string; + + /**Sets the fill color of the port + * @Default {white} + */ + fillColor?: string; + + /**Sets the unique identifier of the port + */ + name?: string; + + /**Defines the position of the port as fraction/ ratio relative to node + * @Default {ej.datavisualization.Diagram.Point(0, 0)} + */ + offset?: any; + + /**Defines the path data to draw the port. Applicable, if the port shape is path. + */ + pathData?: string; + + /**Defines the shape of the port. + * @Default {ej.datavisualization.Diagram.PortShapes.Square} + */ + shape?: ej.datavisualization.Diagram.PortShapes|string; + + /**Defines the size of the port + * @Default {8} + */ + size?: number; + + /**Defines when the port should be visible. + * @Default {ej.datavisualization.Diagram.PortVisibility.Default} + */ + visibility?: ej.datavisualization.Diagram.PortVisibility|string; +} + +export interface NodesShadow { + + /**Defines the angle of the shadow relative to node + * @Default {45} + */ + angle?: number; + + /**Sets the distance to move the shadow relative to node + * @Default {5} + */ + distance?: number; + + /**Defines the opaque of the shadow + * @Default {0.7} + */ + opacity?: number; +} + +export interface NodesSubProcess { + + /**Defines whether the bpmn sub process is without any prescribed order or not + * @Default {false} + */ + adhoc?: boolean; + + /**Sets the boundary of the BPMN process + * @Default {ej.datavisualization.Diagram.BPMNBoundary.Default} + */ + boundary?: ej.datavisualization.Diagram.BPMNBoundary|string; + + /**Sets whether the bpmn subprocess is triggered as a compensation of a specific activity + * @Default {false} + */ + compensation?: boolean; + + /**Defines the loop type of a sub process. + * @Default {ej.datavisualization.Diagram.BPMNLoops.None} + */ + loop?: ej.datavisualization.Diagram.BPMNLoops|string; +} + +export interface NodesTask { + + /**To set whether the task is a global task or not + * @Default {false} + */ + call?: boolean; + + /**Sets whether the task is triggered as a compensation of another specific activity + * @Default {false} + */ + compensation?: boolean; + + /**Sets the loop type of a bpmn task. + * @Default {ej.datavisualization.Diagram.BPMNLoops.None} + */ + loop?: ej.datavisualization.Diagram.BPMNLoops|string; + + /**Sets the type of the BPMN task. + * @Default {ej.datavisualization.Diagram.BPMNTasks.None} + */ + type?: ej.datavisualization.Diagram.BPMNTasks|string; +} + +export interface Nodes { + + /**Defines the type of BPMN Activity. Applicable, if the node is a bpmn activity. + * @Default {ej.datavisualization.Diagram.BPMNActivity.Task} + */ + activity?: ej.datavisualization.Diagram.BPMNActivity|string; + + /**To maintain additional information about nodes + * @Default {{}} + */ + addInfo?: any; + + /**Sets the border color of node + * @Default {black} + */ + borderColor?: string; + + /**Sets the pattern of dashes and gaps to stroke the border + */ + borderDashArray?: string; + + /**Sets the border width of the node + * @Default {1} + */ + borderWidth?: number; + + /**Defines whether the group can be ungrouped or not + * @Default {true} + */ + canUngroup?: boolean; + + /**Array of JSON objects where each object represents a child node/connector + * @Default {[]} + */ + children?: Array; + + /**Defines whether the BPMN data object is a collection or not + * @Default {false} + */ + collection?: boolean; + + /**Defines the distance to be left between a node and its connections(In coming and out going connections). + * @Default {0} + */ + connectorPadding?: number; + + /**Enables or disables the default behaviors of the node. + * @Default {ej.datavisualization.Diagram.NodeConstraints.Default} + */ + constraints?: ej.datavisualization.Diagram.NodeConstraints|string; + + /**Defines how the child objects need to be arranged(Either in any predefined manner or automatically). Applicable, if the node is a group. + * @Default {null} + */ + container?: NodesContainer; + + /**Defines the corner radius of rectangular shapes. + * @Default {0} + */ + cornerRadius?: number; + + /**Configures the styles of shapes + */ + cssClass?: string; + + /**Sets the type of the BPMN Events. Applicable, if the node is a bpmn event. + * @Default {ej.datavisualization.Diagram.BPMNEvents.Start} + */ + event?: ej.datavisualization.Diagram.BPMNEvents|string; + + /**Defines whether the node can be automatically arranged using layout or not + * @Default {false} + */ + excludeFromLayout?: boolean; + + /**Defines the fill color of the node + * @Default {white} + */ + fillColor?: string; + + /**Sets the type of the BPMN Gateway. Applicable, if the node is a bpmn gateway. + * @Default {ej.datavisualization.Diagram.BPMNGateways.None} + */ + gateway?: ej.datavisualization.Diagram.BPMNGateways|string; + + /**Paints the node with a smooth transition from one color to another color + */ + gradient?: NodesGradient; + + /**Defines the header of a swimlane/lane + * @Default {{ text: Title, fontSize: 11 }} + */ + header?: any; + + /**Defines the height of the node + * @Default {0} + */ + height?: number; + + /**Sets the horizontal alignment of the node. Applicable, if the parent of the node is a container. + * @Default {ej.datavisualization.Diagram.HorizontalAlignment.Left} + */ + horizontalAlign?: ej.datavisualization.Diagram.HorizontalAlignment|string; + + /**A read only collection of the incoming connectors/edges of the node + * @Default {[]} + */ + inEdges?: Array; + + /**Defines whether the sub tree of the node is expanded or collapsed + * @Default {true} + */ + isExpanded?: boolean; + + /**Sets the node as a swimlane + * @Default {false} + */ + isSwimlane?: boolean; + + /**A collection of objects where each object represents a label + * @Default {[]} + */ + labels?: Array; + + /**An array of objects where each object represents a lane. Applicable, if the node is a swimlane. + * @Default {[]} + */ + lanes?: Array; + + /**Defines the minimum space to be left between the bottom of parent bounds and the node. Applicable, if the parent is a container. + * @Default {0} + */ + marginBottom?: number; + + /**Defines the minimum space to be left between the left of parent bounds and the node. Applicable, if the parent is a container. + * @Default {0} + */ + marginLeft?: number; + + /**Defines the minimum space to be left between the right of the parent bounds and the node. Applicable, if the parent is a container. + * @Default {0} + */ + marginRight?: number; + + /**Defines the minimum space to be left between the top of parent bounds and the node. Applicable, if the parent is a container. + * @Default {0} + */ + marginTop?: number; + + /**Defines the maximum height limit of the node + * @Default {0} + */ + maxHeight?: number; + + /**Defines the maximum width limit of the node + * @Default {0} + */ + maxWidth?: number; + + /**Defines the minimum height limit of the node + * @Default {0} + */ + minHeight?: number; + + /**Defines the minimum width limit of the node + * @Default {0} + */ + minWidth?: number; + + /**Sets the unique identifier of the node + */ + name?: string; + + /**Defines the position of the node on X-Axis + * @Default {0} + */ + offsetX?: number; + + /**Defines the position of the node on Y-Axis + * @Default {0} + */ + offsetY?: number; + + /**Defines the opaque of the node + * @Default {1} + */ + opacity?: number; + + /**Defines the orientation of nodes. Applicable, if the node is a swimlane. + * @Default {vertical} + */ + orientation?: string; + + /**A read only collection of outgoing connectors/edges of the node + * @Default {[]} + */ + outEdges?: Array; + + /**Defines the minimum padding value to be left between the bottom most position of a group and its children. Applicable, if the group is a container. + * @Default {0} + */ + paddingBottom?: number; + + /**Defines the minimum padding value to be left between the left most position of a group and its children. Applicable, if the group is a container. + * @Default {0} + */ + paddingLeft?: number; + + /**Defines the minimum padding value to be left between the right most position of a group and its children. Applicable, if the group is a container. + * @Default {0} + */ + paddingRight?: number; + + /**Defines the minimum padding value to be left between the top most position of a group and its children. Applicable, if the group is a container. + * @Default {0} + */ + paddingTop?: number; + + /**Defines the size and preview size of the node to add that to symbol palette + * @Default {null} + */ + paletteItem?: NodesPaletteItem; + + /**Sets the name of the parent group + */ + parent?: string; + + /**Sets the path geometry that defines the shape of a path node + */ + pathData?: string; + + /**An array of objects, where each object represents a smaller region(phase) of a swimlane. + * @Default {[]} + */ + phases?: Array; + + /**Sets the height of the phase headers + * @Default {0} + */ + phaseSize?: number; + + /**Sets the ratio/ fractional value relative to node, based on which the node will be transformed(positioning, scaling and rotation) + * @Default {ej.datavisualization.Diagram.Points(0.5,0.5)} + */ + pivot?: any; + + /**Defines a collection of points to draw a polygon. Applicable, if the shape is a polygon. + * @Default {[]} + */ + points?: Array; + + /**An array of objects where each object represents a port + * @Default {[]} + */ + ports?: Array; + + /**Sets the angle to which the node should be rotated + * @Default {0} + */ + rotateAngle?: number; + + /**Defines the opacity and the position of shadow + * @Default {ej.datavisualization.Diagram.Shadow()} + */ + shadow?: NodesShadow; + + /**Sets the shape of the node. It depends upon the type of node. + * @Default {ej.datavisualization.Diagram.BasicShapes.Rectangle} + */ + shape?: ej.datavisualization.Diagram.BasicShapes|string; + + /**Sets the source path of the image. Applicable, if the type of the node is image. + */ + source?: string; + + /**Defines the sub process of a BPMN Activity. Applicable, if the type of the bpmn activity is sub process. + * @Default {ej.datavisualization.Diagram.BPMNSubProcess()} + */ + subProcess?: NodesSubProcess; + + /**Defines the task of the bpmn activity. Applicable, if the type of activity is set as task. + * @Default {ej.datavisualization.Diagram.BPMNTask()} + */ + task?: NodesTask; + + /**Sets the id of svg/html templates. Applicable, if the node is html or native. + */ + templateId?: string; + + /**Defines the textBlock of a text node + * @Default {null} + */ + textBlock?: any; + + /**Defines the tooltip that should be shown when the mouse hovers over node. For tooltip properties, refer Tooltip + * @Default {null} + */ + tooltip?: any; + + /**Sets the type of BPMN Event Triggers. + * @Default {ej.datavisualization.Diagram.BPMNTriggers.None} + */ + trigger?: ej.datavisualization.Diagram.BPMNTriggers|string; + + /**Defines the type of the node. + * @Default {ej.datavisualization.Diagram.Shapes.Basic} + */ + type?: ej.datavisualization.Diagram.Shapes|string; + + /**Sets the vertical alignment of a node. Applicable, if the parent of a node is a container. + * @Default {ej.datavisualization.Diagram.VerticalAlignment.Top} + */ + verticalAlign?: ej.datavisualization.Diagram.VerticalAlignment|string; + + /**Defines the visibility of the node + * @Default {true} + */ + visible?: boolean; + + /**Defines the width of the node + * @Default {0} + */ + width?: number; + + /**Defines the z-index of the node + * @Default {0} + */ + zOrder?: number; +} + +export interface PageSettings { + + /**Defines the maximum distance to be left between the object and the scroll bar to trigger auto scrolling + * @Default {{ left: 15, top: 15, right: 15, bottom: 15 }} + */ + autoScrollBorder?: any; + + /**Sets whether multiple pages can be created to fit all nodes and connectors + * @Default {false} + */ + multiplePage?: boolean; + + /**Defines the background color of diagram pages + * @Default {#ffffff} + */ + pageBackgroundColor?: string; + + /**Defines the page border color + * @Default {#565656} + */ + pageBorderColor?: string; + + /**Sets the border width of diagram pages + * @Default {0} + */ + pageBorderWidth?: number; + + /**Defines the height of a page + * @Default {null} + */ + pageHeight?: number; + + /**Defines the page margin + * @Default {24} + */ + pageMargin?: number; + + /**Sets the orientation of the page. + * @Default {ej.datavisualization.Diagram.PageOrientations.Portrait} + */ + pageOrientation?: ej.datavisualization.Diagram.PageOrientations|string; + + /**Defines the height of a diagram page + * @Default {null} + */ + pageWidth?: number; + + /**Defines the scrollable area of diagram. Applicable, if the scroll limit is "limited". + * @Default {null} + */ + scrollableArea?: any; + + /**Defines the scrollable region of diagram. + * @Default {ej.datavisualization.Diagram.ScrollLimit.Infinite} + */ + scrollLimit?: ej.datavisualization.Diagram.ScrollLimit|string; + + /**Enables or disables the page breaks + * @Default {false} + */ + showPageBreak?: boolean; +} + +export interface ScrollSettings { + + /**Allows to read the zoom value of diagram + * @Default {0} + */ + currentZoom?: number; + + /**Sets the horizontal scroll offset + * @Default {0} + */ + horizontalOffset?: number; + + /**Allows to extend the scrollable region that is based on the scroll limit + * @Default {{left: 0, right: 0, top:0, bottom: 0}} + */ + padding?: any; + + /**Sets the vertical scroll offset + * @Default {0} + */ + verticalOffset?: number; + + /**Allows to read the view port height of the diagram + * @Default {0} + */ + viewPortHeight?: number; + + /**Allows to read the view port width of the diagram + * @Default {0} + */ + viewPortWidth?: number; +} + +export interface SelectedItems { + + /**A read only collection of the selected items + * @Default {[]} + */ + children?: Array; + + /**Controls the visibility of selector. + * @Default {ej.datavisualization.Diagram.SelectorConstraints.All} + */ + constraints?: ej.datavisualization.Diagram.SelectorConstraints|string; + + /**Defines a method that dynamically enables/ disables the interaction with multiple selection. + * @Default {null} + */ + getConstraints?: any; + + /**Sets the height of the selected items + * @Default {0} + */ + height?: number; + + /**Sets the x position of the selector + * @Default {0} + */ + offsetX?: number; + + /**Sets the y position of the selector + * @Default {0} + */ + offsetY?: number; + + /**Sets the angle to rotate the selected items + * @Default {0} + */ + rotateAngle?: number; + + /**Sets the angle to rotate the selected items. For tooltip properties, refer Tooltip + * @Default {ej.datavisualization.Diagram.Tooltip()} + */ + tooltip?: any; + + /**A collection of frequently using commands that have to be added around the selector. + * @Default {[]} + */ + userHandles?: Array; + + /**Sets the width of the selected items + * @Default {0} + */ + width?: number; +} + +export interface SnapSettingsHorizontalGridLines { + + /**Defines the line color of horizontal grid lines + * @Default {lightgray} + */ + lineColor?: string; + + /**Specifies the pattern of dashes and gaps used to stroke horizontal grid lines + */ + lineDashArray?: string; + + /**A pattern of lines and gaps that defines a set of horizontal gridlines + * @Default {[1.25, 18.75, 0.25, 19.75, 0.25, 19.75, 0.25, 19.75, 0.25, 19.75]} + */ + linesInterval?: Array; + + /**Specifies a set of intervals to snap the objects + * @Default {[20]} + */ + snapInterval?: Array; +} + +export interface SnapSettingsVerticalGridLines { + + /**Defines the line color of horizontal grid lines + * @Default {lightgray} + */ + lineColor?: string; + + /**Specifies the pattern of dashes and gaps used to stroke horizontal grid lines + */ + lineDashArray?: string; + + /**A pattern of lines and gaps that defines a set of horizontal gridlines + * @Default {[1.25, 18.75, 0.25, 19.75, 0.25, 19.75, 0.25, 19.75, 0.25, 19.75]} + */ + linesInterval?: Array; + + /**Specifies a set of intervals to snap the objects + * @Default {[20]} + */ + snapInterval?: Array; +} + +export interface SnapSettings { + + /**Enables or disables snapping nodes/connectors to objects + * @Default {true} + */ + enableSnapToObject?: boolean; + + /**Defines the appearance of horizontal gridlines + */ + horizontalGridLines?: SnapSettingsHorizontalGridLines; + + /**Defines the angle by which the object needs to be snapped + * @Default {5} + */ + snapAngle?: number; + + /**Defines the minimum distance between the selected object and the nearest object + * @Default {5} + */ + snapObjectDistance?: number; + + /**Defines the appearance of horizontal gridlines + */ + verticalGridLines?: SnapSettingsVerticalGridLines; +} + +export interface TooltipAlignment { + + /**Defines the horizontal alignment of tooltip. + * @Default {ej.datavisualization.Diagram.HorizontalAlignment.Center} + */ + horizontal?: ej.datavisualization.Diagram.HorizontalAlignment|string; + + /**Defines the vertical alignment of tooltip. + * @Default {ej.datavisualization.Diagram.VerticalAlignment.Bottom} + */ + vertical?: ej.datavisualization.Diagram.VerticalAlignment|string; +} + +export interface Tooltip { + + /**Aligns the tooltip around nodes/connectors + */ + alignment?: TooltipAlignment; + + /**Sets the margin of the tooltip + * @Default {{ left: 5, right: 5, top: 5, bottom: 5 }} + */ + margin?: any; + + /**Defines whether the tooltip should be shown at the mouse position or around node. + * @Default {ej.datavisualization.Diagram.RelativeMode.Object} + */ + relativeMode?: ej.datavisualization.Diagram.RelativeMode|string; + + /**Sets the svg/html template to be bound with tooltip + */ + templateId?: string; +} +} +module Diagram +{ +enum BridgeDirection +{ +//Used to set the direction of line bridges as left +Left, +//Used to set the direction of line bridges as right +Right, +//Used to set the direction of line bridges as top +Top, +//Used to set the direction of line bridges as bottom +Bottom, +} +} +module Diagram +{ +enum Keys +{ +//No key pressed. +None, +//The A key. +A, +//The B key. +B, +//The C key. +C, +//The D Key. +D, +//The E key. +E, +//The F key. +F, +//The G key. +G, +//The H Key. +H, +//The I key. +I, +//The J key. +J, +//The K key. +K, +//The L Key. +L, +//The M key. +M, +//The N key. +N, +//The O key. +O, +//The P Key. +P, +//The Q key. +Q, +//The R key. +R, +//The S key. +S, +//The T Key. +T, +//The U key. +U, +//The V key. +V, +//The W key. +W, +//The X key. +X, +//The Y key. +Y, +//The Z key. +Z, +//The 0 key. +Number0, +//The 1 key. +Number1, +//The 2 key. +Number2, +//The 3 key. +Number3, +//The 4 key. +Number4, +//The 5 key. +Number5, +//The 6 key. +Number6, +//The 7 key. +Number7, +//The 8 key. +Number8, +//The 9 key. +Number9, +//The LEFT ARROW key. +Left, +//The UP ARROW key. +Up, +//The RIGHT ARROW key. +Right, +//The DOWN ARROW key. +Down, +//The ESC key. +Escape, +//The DEL key. +Delete, +//The TAB key. +Tab, +//The ENTER key. +Enter, +} +} +module Diagram +{ +enum KeyModifiers +{ +//No modifiers are pressed. +None, +//The ALT key. +Alt, +//The CTRL key. +Control, +//The SHIFT key. +Shift, +} +} +module Diagram +{ +enum ConnectorConstraints +{ +//Disable all connector Constraints +None, +//Enables connector to be selected +Select, +//Enables connector to be Deleted +Delete, +//Enables connector to be Dragged +Drag, +//Enables connectors source end to be selected +DragSourceEnd, +//Enables connectors target end to be selected +DragTargetEnd, +//Enables control point and end point of every segment in a connector for editing +DragSegmentThumb, +//Enables bridging to the connector +Bridging, +//Enables label of node to be Dragged +DragLabel, +//Enables bridging to the connector +InheritBridging, +//Enables all constraints +Default, +} +} +module Diagram +{ +enum HorizontalAlignment +{ +//Used to align text horizontally on left side of node/connector +Left, +//Used to align text horizontally on center of node/connector +Center, +//Used to align text horizontally on right side of node/connector +Right, +} +} +module Diagram +{ +enum Segments +{ +//Used to specify the lines as Straight +Straight, +//Used to specify the lines as Orthogonal +Orthogonal, +//Used to specify the lines as Bezier +Bezier, +} +} +module Diagram +{ +enum DecoratorShapes +{ +//Used to set decorator shape as none +None, +//Used to set decorator shape as Arrow +Arrow, +//Used to set decorator shape as Open Arrow +OpenArrow, +//Used to set decorator shape as Circle +Circle, +//Used to set decorator shape as Diamond +Diamond, +//Used to set decorator shape as path +Path, +} +} +module Diagram +{ +enum VerticalAlignment +{ +//Used to align text Vertically on left side of node/connector +Top, +//Used to align text Vertically on center of node/connector +Center, +//Used to align text Vertically on bottom of node/connector +Bottom, +} +} +module Diagram +{ +enum DiagramConstraints +{ +//Disables all DiagramConstraints +None, +//Enables/Disables PageEditing +PageEditable, +//Enables/Disables Bridging +Bridging, +//Enables/Disables Zooming +Zoomable, +//Enables/Disables panning on horizontal axis +PannableX, +//Enables/Disables panning on vertical axis +PannableY, +//Enables/Disables Panning +Pannable, +//Enables/Disables undo actions +Undoable, +//Enables all Constraints +Default, +} +} +module Diagram +{ +enum LayoutOrientations +{ +//Used to set LayoutOrientation from top to bottom +TopToBottom, +//Used to set LayoutOrientation from bottom to top +BottomToTop, +//Used to set LayoutOrientation from left to right +LeftToRight, +//Used to set LayoutOrientation from right to left +RightToLeft, +} +} +module Diagram +{ +enum LayoutTypes +{ +//Used not to set any specific layout +None, +//Used to set layout type as hierarchical layout +HierarchicalTree, +//Used to set layout type as organnizational chart +OrganizationalChart, +} +} +module Diagram +{ +enum BPMNActivity +{ +//Used to set BPMN Activity as None +None, +//Used to set BPMN Activity as Task +Task, +//Used to set BPMN Activity as SubProcess +SubProcess, +} +} +module Diagram +{ +enum NodeConstraints +{ +//Disable all node Constraints +None, +//Enables node to be selected +Select, +//Enables node to be Deleted +Delete, +//Enables node to be Dragged +Drag, +//Enables node to be Rotated +Rotate, +//Enables node to be connected +Connect, +//Enables node to be resize north east +ResizeNorthEast, +//Enables node to be resize east +ResizeEast, +//Enables node to be resize south east +ResizeSouthEast, +//Enables node to be resize south +ResizeSouth, +//Enables node to be resize south west +ResizeSouthWest, +//Enables node to be resize west +ResizeWest, +//Enables node to be resize north west +ResizeNorthWest, +//Enables node to be resize north +ResizeNorth, +//Enables node to be Resized +Resize, +//Enables shadow +Shadow, +//Enables label of node to be Dragged +DragLabel, +//Enables panning should be done while node dragging +AllowPan, +//Enables Proportional resize for node +AspectRatio, +//Enables all node constraints +Default, +} +} +module Diagram +{ +enum ContainerType +{ +//Sets the container type as Canvas +Canvas, +//Sets the container type as Stack +Stack, +} +} +module Diagram +{ +enum BPMNEvents +{ +//Used to set BPMN Event as Start +Start, +//Used to set BPMN Event as Intermediate +Intermediate, +//Used to set BPMN Event as End +End, +//Used to set BPMN Event as NonInterruptingStart +NonInterruptingStart, +//Used to set BPMN Event as NonInterruptingIntermediate +NonInterruptingIntermediate, +} +} +module Diagram +{ +enum BPMNGateways +{ +//Used to set BPMN Gateway as None +None, +//Used to set BPMN Gateway as Exclusive +Exclusive, +//Used to set BPMN Gateway as Inclusive +Inclusive, +//Used to set BPMN Gateway as Parallel +Parallel, +//Used to set BPMN Gateway as Complex +Complex, +//Used to set BPMN Gateway as EventBased +EventBased, +} +} +module Diagram +{ +enum LabelEditMode +{ +//Used to set label edit mode as edit +Edit, +//Used to set label edit mode as view +View, +} +} +module Diagram +{ +enum TextAlign +{ +//Used to align text on left side of node/connector +Left, +//Used to align text on center of node/connector +Center, +//Used to align text on Right side of node/connector +Right, +} +} +module Diagram +{ +enum TextDecorations +{ +//Used to set text decoration of the label as Underline +Underline, +//Used to set text decoration of the label as Overline +Overline, +//Used to set text decoration of the label as LineThrough +LineThrough, +//Used to set text decoration of the label as None +None, +} +} +module Diagram +{ +enum TextWrapping +{ +//Disables wrapping +NoWrap, +//Enables Line-break at normal word break points +Wrap, +//Enables Line-break at normal word break points with longer word overflows +WrapWithOverflow, +} +} +module Diagram +{ +enum PortConstraints +{ +//Disable all constraints +None, +//Enables connections with connector +Connect, +} +} +module Diagram +{ +enum PortShapes +{ +//Used to set port shape as X +X, +//Used to set port shape as Circle +Circle, +//Used to set port shape as Square +Square, +//Used to set port shape as Path +Path, +} +} +module Diagram +{ +enum PortVisibility +{ +//Set the port visibility as Visible +Visible, +//Set the port visibility as Hidden +Hidden, +//Port get visible when hover connector on node +Hover, +//Port gets visible when connect connector to node +Connect, +//Specifies the port visibility as default +Default, +} +} +module Diagram +{ +enum BasicShapes +{ +//Used to specify node Shape as Rectangle +Rectangle, +//Used to specify node Shape as Ellipse +Ellipse, +//Used to specify node Shape as Path +Path, +//Used to specify node Shape as Polygon +Polygon, +//Used to specify node Shape as Triangle +Triangle, +//Used to specify node Shape as Plus +Plus, +//Used to specify node Shape as Star +Star, +//Used to specify node Shape as Pentagon +Pentagon, +//Used to specify node Shape as Heptagon +Heptagon, +//Used to specify node Shape as Octagon +Octagon, +//Used to specify node Shape as Trapezoid +Trapezoid, +//Used to specify node Shape as Decagon +Decagon, +//Used to specify node Shape as RightTriangle +RightTriangle, +//Used to specify node Shape as Cylinder +Cylinder, +} +} +module Diagram +{ +enum BPMNBoundary +{ +//Used to set BPMN SubProcess's Boundary as Default +Default, +//Used to set BPMN SubProcess's Boundary as Call +Call, +//Used to set BPMN SubProcess's Boundary as Event +Event, +} +} +module Diagram +{ +enum BPMNLoops +{ +//Used to set BPMN Activity's Loop as None +None, +//Used to set BPMN Activity's Loop as Standard +Standard, +//Used to set BPMN Activity's Loop as ParallelMultiInstance +ParallelMultiInstance, +//Used to set BPMN Activity's Loop as SequenceMultiInstance +SequenceMultiInstance, +} +} +module Diagram +{ +enum BPMNTasks +{ +//Used to set BPMN Task Type as None +None, +//Used to set BPMN Task Type as Service +Service, +//Used to set BPMN Task Type as Receive +Receive, +//Used to set BPMN Task Type as Send +Send, +//Used to set BPMN Task Type as InstantiatingReceive +InstantiatingReceive, +//Used to set BPMN Task Type as Manual +Manual, +//Used to set BPMN Task Type as BusinessRule +BusinessRule, +//Used to set BPMN Task Type as User +User, +//Used to set BPMN Task Type as Script +Script, +//Used to set BPMN Task Type as Parallel +Parallel, +} +} +module Diagram +{ +enum BPMNTriggers +{ +//Used to set Event Trigger as None +None, +//Used to set Event Trigger as Message +Message, +//Used to set Event Trigger as Timer +Timer, +//Used to set Event Trigger as Escalation +Escalation, +//Used to set Event Trigger as Link +Link, +//Used to set Event Trigger as Error +Error, +//Used to set Event Trigger as Compensation +Compensation, +//Used to set Event Trigger as Signal +Signal, +//Used to set Event Trigger as Multiple +Multiple, +//Used to set Event Trigger as Parallel +Parallel, +} +} +module Diagram +{ +enum Shapes +{ +//Used to set decorator shape as none +None, +//Used to set decorator shape as Arrow +Arrow, +//Used to set decorator shape as Open Arrow +OpenArrow, +//Used to set decorator shape as Circle +Circle, +//Used to set decorator shape as Diamond +Diamond, +//Used to set decorator shape as path +Path, +} +} +module Diagram +{ +enum PageOrientations +{ +//Used to set orientation as Landscape +Landscape, +//Used to set orientation as portrait +Portrait, +} +} +module Diagram +{ +enum ScrollLimit +{ +//Used to set scrollLimit as Infinite +Infinite, +//Used to set scrollLimit as Diagram +Diagram, +//Used to set scrollLimit as Limited +Limited, +} +} +module Diagram +{ +enum SelectorConstraints +{ +//Hides the selector +None, +//Sets the visibility of rotation handle as visible +Rotator, +//Sets the visibility of resize handles as visible +Resizer, +//Sets the visibility of user handles as visible +UserHandles, +//Sets the visibility of all selection handles as visible +All, +} +} +module Diagram +{ +enum Tool +{ +//Disables all Tools +None, +//Enables/Disables SingleSelect tool +SingleSelect, +//Enables/Disables MultiSelect tool +MultipleSelect, +//Enables/Disables ZoomPan tool +ZoomPan, +//Enables/Disables DrawOnce tool +DrawOnce, +//Enables/Disables ContinuousDraw tool +ContinuesDraw, +} +} +module Diagram +{ +enum RelativeMode +{ +//Shows tooltip around the node +Object, +//Shows tooltip at the mouse position +Mouse, +} +} + +} + +interface JQueryXHR { +} +interface JQueryPromise { +} +interface JQueryDeferred extends JQueryPromise { +} +interface JQueryParam { +} +interface JQuery { + data(key: any): any; +} +interface JQuery { + + /*Accordion*/ + ejmAccordion(): JQuery; + ejmAccordion(options?: ej.mobile.AccordionOptions): JQuery; + data(key: "ejmAccordion"): ej.mobile.Accordion; + /*Accordion*/ + + /*AutoComplete*/ + ejmAutocomplete(): JQuery; + ejmAutocomplete(options?: ej.mobile.AutocompleteOptions): JQuery; + data(key: "ejmAutocomplete"): ej.mobile.Autocomplete; + /*AutoComplete*/ + + /*Button*/ + ejmButton(): JQuery; + ejmButton(options?: ej.mobile.ButtonOptions): JQuery; + data(key: "ejmButton"): ej.mobile.Button; + + ejmActionlink(): JQuery; + ejmActionlink(options?: ej.mobile.ButtonOptions): JQuery; + data(key: "ejmActionlink"): ej.mobile.Button; + /*Button*/ + + /* DatePicker */ + ejmDatePicker(): JQuery; + ejmDatePicker(options?: ej.mobile.DatePickerOptions): JQuery; + data(key: "ejmDatePicker"): ej.mobile.DatePicker; + /* DatePicker */ + + /*Editor*/ + ejmNumeric(): JQuery; + ejmNumeric(options?: ej.mobile.EditorOptions): JQuery; + data(key: "ejmNumeric"): ej.mobile.Numeric; + /*Editor*/ + + /* Grid Start */ + ejmGrid(): JQuery; + ejmGrid(options?: ej.mobile.GridOptions): JQuery; + data(key: "ejmGrid"): ej.mobile.Grid; + /* Grid End */ + + /*Header*/ + ejmHeader(): JQuery; + ejmHeader(options?: ej.mobile.HeaderOptions): JQuery; + data(key: "ejmHeader"): ej.mobile.Header; + /*Header*/ + + /*ListView*/ + ejmListView(): JQuery; + ejmListView(options?: ej.mobile.ListViewOptions): JQuery; + data(key: "ejmListView"): ej.mobile.ListView; + /*ListView*/ + + /*Menu*/ + ejmMenu(): JQuery; + ejmMenu(options?: ej.mobile.MenuOptions): JQuery; + data(key: "ejmMenu"): ej.mobile.Menu; + /*Menu*/ + + /* ProgressBar */ + ejmProgress(): JQuery; + ejmProgress(options?: ej.mobile.ProgressOptions): JQuery; + data(key: "ejmProgress"): ej.mobile.Progress; + /* ProgressBar */ + + /*Radio Button*/ + ejmRadioButton(): JQuery; + ejmRadioButton(options?: ej.mobile.RadioButtonOptions): JQuery; + data(key: "ejmRadioButton"): ej.mobile.RadioButton; + /*Radio Button*/ + + /*Rating*/ + ejmRating(): JQuery; + ejmRating(options?: ej.mobile.RatingOptions): JQuery; + data(key: "ejmRating"): ej.mobile.Rating; + /*Rating*/ + + + /*Rotator*/ + ejmRotator(): JQuery; + ejmRotator(options?: ej.mobile.RotatorOptions): JQuery; + data(key: "ejmRotator"): ej.mobile.Rotator; + /*Rotator*/ + + /*Slider*/ + ejmSlider(): JQuery; + ejmSlider(options?: ej.mobile.SliderOptions): JQuery; + data(key: "ejmSlider"): ej.mobile.Slider; + /*Slider*/ + + /* Tab */ + ejmTab(): JQuery; + ejmTab(options?: ej.mobile.TabOptions): JQuery; + data(key: "ejmTab"): ej.mobile.Tab; + /* Tab */ + + /*Tile*/ + ejmTile(): JQuery; + ejmTile(options?: ej.mobile.TileOptions): JQuery; + data(key: "ejmTile"): ej.mobile.Tile; + /*Tile*/ + + /* TimePicker */ + ejmTimePicker(): JQuery; + ejmTimePicker(options?: ej.mobile.TimePickerOptions): JQuery; + data(key: "ejmTimePicker"): ej.mobile.TimePicker; + /* TimePicker */ + + /*ToggleButton*/ + ejmToggleButton(): JQuery; + ejmToggleButton(options?: ej.mobile.ToggleButtonOptions): JQuery; + data(key: "ejmToggleButton"): ej.mobile.ToggleButton; + /*ToggleButton*/ + + /*Toolbar*/ + ejmToolbar(): JQuery; + ejmToolbar(options?: ej.mobile.ToolbarOptions): JQuery; + data(key: "ejmToolbar"): ej.mobile.Toolbar; + /*Toolbar*/ + + /*GroupButton*/ + ejmGroupButton(): JQuery; + ejmGroupButton(options?: ej.mobile.GroupButtonOptions): JQuery; + data(key: "ejmGroupButton"): ej.mobile.GroupButton; + /*GroupButton*/ + + /* SplitPane */ + ejmSplitPane(): JQuery; + ejmSplitPane(options?: ej.mobile.SplitPaneOptions): JQuery; + data(key: "ejmSplitPane"): ej.mobile.SplitPane; + /* SplitPane */ + + /* Dialog */ + ejmDialog(): JQuery; + ejmDialog(options?: ej.mobile.DialogOptions): JQuery; + data(key: "ejmDialog"): ej.mobile.Dialog; + /* Dialog */ + + /* TextBox */ + ejmTextBox(): JQuery; + ejmTextBox(options?: ej.mobile.TextBoxOptions): JQuery; + data(key: "ejmTextBox"): ej.mobile.TextBox; + /* TextBox */ + + /* Password */ + ejmPassword(): JQuery; + ejmPassword(options?: ej.mobile.TextBoxOptions): JQuery; + data(key: "ejmPassword"): ej.mobile.TextBox; + /* Password */ + + /* MaskEdit */ + ejmMaskEdit(): JQuery; + ejmMaskEdit(options?: ej.mobile.MaskEditOptions): JQuery; + data(key: "ejmMaskEdit"): ej.mobile.MaskEdit; + /* MaskEdit */ + + /* TextArea */ + ejmTextArea(): JQuery; + ejmTextArea(options?: ej.mobile.TextBoxOptions): JQuery; + data(key: "ejmTextArea"): ej.mobile.TextBox; + /* MaskEdit */ + + /* Footer */ + ejmFooter(): JQuery; + ejmFooter(options?: ej.mobile.FooterOptions): JQuery; + data(key: "ejmFooter"): ej.mobile.Footer; + /* Footer */ + + /* CheckBox */ + ejmCheckBox(): JQuery; + ejmCheckBox(options?: ej.mobile.CheckBoxOptions): JQuery; + data(key: "ejmCheckBox"): ej.mobile.CheckBox; + /* CheckBox */ + + /* ScrollPanel */ + ejmScrollPanel(): JQuery; + ejmScrollPanel(options: ej.mobile.ScrollPanelOptions): JQuery; + data(key: "ejmScrollPanel"): ej.mobile.ScrollPanel; + /* ScrollPanel */ + + /* NavigationDrawer */ + ejmNavigationDrawer(): JQuery; + ejmNavigationDrawer(options: ej.mobile.NavigationDrawerOptions): JQuery; + data(key: "ejmNavigationDrawer"): ej.mobile.NavigationDrawer; + /* NavigationDrawer */ + + /* RadialMenu */ + ejmRadialMenu(): JQuery; + ejmRadialMenu(options?: ej.mobile.RadialMenuOptions): JQuery; + data(key: "ejmRadialMenu"): ej.mobile.RadialMenu; + /* RadialMenu */ + + ejLinearGauge(): JQuery; + ejLinearGauge(options?: ej.datavisualization.LinearGauge.Model): JQuery; + data(key: "ejLinearGauge"): ej.datavisualization.LinearGauge; + + ejDigitalGauge(): JQuery; + ejDigitalGauge(options?: ej.datavisualization.DigitalGauge.Model): JQuery; + data(key: "ejDigitalGauge"): ej.datavisualization.DigitalGauge; + + ejCircularGauge(): JQuery; + ejCircularGauge(options?: ej.datavisualization.CircularGauge.Model): JQuery; + data(key: "ejCircularGauge"): ej.datavisualization.CircularGauge; + + ejChart(): JQuery; + ejChart(options?: ej.datavisualization.Chart.Model): JQuery; + data(key: "ejChart"): ej.datavisualization.Chart; + + ejRangeNavigator(): JQuery; + ejRangeNavigator(options?: ej.datavisualization.RangeNavigator.Model): JQuery; + data(key: "ejRangeNavigator"): ej.datavisualization.RangeNavigator; + + ejBulletGraph(): JQuery; + ejBulletGraph(options?: ej.datavisualization.BulletGraph.Model): JQuery; + data(key: "ejBulletGraph"): ej.datavisualization.BulletGraph; + + ejMap(): JQuery; + ejMap(options?: ej.datavisualization.Map.Model): JQuery; + data(key: "ejMap"): ej.datavisualization.Map; + + ejTreeMap(): JQuery; + ejTreeMap(options?: ej.datavisualization.TreeMap.Model): JQuery; + data(key: "ejTreeMap"): ej.datavisualization.TreeMap; + + ejBarcode(): JQuery; + ejBarcode(options?: ej.datavisualization.Barcode.Model): JQuery; + data(key: "ejBarcode"): ej.datavisualization.Barcode; + + ejDiagram(): JQuery; + ejDiagram(options?: ej.datavisualization.Diagram.Model): JQuery; + data(key: "ejDiagram"): ej.datavisualization.Diagram; + +} \ No newline at end of file diff --git a/ej.widgets.all/ej.web.all-tests.ts b/ej.widgets.all/ej.web.all-tests.ts new file mode 100644 index 0000000000..091359c821 --- /dev/null +++ b/ej.widgets.all/ej.web.all-tests.ts @@ -0,0 +1,1260 @@ +/// +/// + +$(document).ready(function () { + + //Properties + $("#draggable1").ejDraggable({ + drag: ondrag1, dragStart: ondragstart1, dragStop: ondragstop1 + }); + $("#droppable1").ejDroppable(); + +}); +//Events + +function ondrag1() { + console.log("The mouse is moved during the dragging."); +} +function ondragstart1() { + console.log("To handle the drag start event as an init option."); +} +function ondragstop1() { + console.log("The mouse is moved during the dragging.."); +} + + + + + +$(document).ready(function () { + + //Properties + $("#draggable1").ejDraggable({ + drag: ondrag2, dragStart: ondragstart2, dragStop: ondragstop2 + }); + $("#droppable1").ejDroppable(); + +}); +//Events + +function ondrag2() { + console.log("The mouse is moved during the dragging."); +} +function ondragstart2() { + console.log("To handle the drag start event as an init option."); +} +function ondragstop2() { + console.log("The mouse is moved during the dragging.."); +} + + + + + +$(document).ready(function () { + + //Properties + $("#resizable1").ejResizable({resizeStart: onresizestart , resizeStop: onresizestop }); + +}); +//Events +function onresizestart() { + console.log("The resizing is start"); +} +function onresizestop() { + console.log("The resizing is stop"); +} + + + + + +$(document).ready(function () { + + //Properties + $("#scroller1").ejScroller({ height: 300, width: 500, create: onScrollCreate }); + $("#scroller2").ejScroller({ height: 300, width: 500,scrollTop:40 }); + +}); +//Events +function onScrollCreate() { + console.log("control created"); +} + +$(document).ready(function () { + + $("#accordion1").ejAccordion({cssClass: "gradient-lime" , create: AccordionCreate }); + $("#accordion2").ejAccordion({ enabled: true , activate: AccordionActivate }); + +}); + +function AccordionCreate() { + console.log("create"); +} +function AccordionActivate(){ + console.log("activate") +} + +$(document).ready(function () { + + $("#Text1").ejButton({ text: "Button", enabled: false , create: onButtoncreate }); + $("#Text2").ejButton({ text: "Button", cssClass: "customclass" , click: onButtonclick }); +}); + +function onButtoncreate() { + console.log("create"); +} +function onButtonclick(){ + console.log("click") +} +$(document).ready(function () { + + //Properties + $("#listbox1").ejListBox({ allowMultiSelection: true, create: onlistBoxcreate }); + $("#listbox2").ejListBox({ showCheckbox: true,checkChange: onlistBoxcheckchange }); + +}); +//Events +function onlistBoxcreate() { + console.log("control created"); +} +function onlistBoxcheckchange() { + console.log("list item is checked or unchecked"); +} + + + + + +$(document).ready(function () { + + $("#checkbox1").ejCheckBox({ enableTriState: true, create: onCheckboxcreate }); + $("#checkbox2").ejCheckBox({ checked: true , change: onCheckboxchange }); + +}); + +function onCheckboxcreate() { + console.log("create"); +} +function onCheckboxchange(){ + console.log("change") +} + + + +$(document).ready(function () { + + $("#colorpicker1").ejColorPicker({ value: "#278787" , open: oncolorPickeropen }); + $("#colorpicker2").ejColorPicker({ enabled: true, create: oncolorPickercreate }); + +}); +function oncolorPickeropen() { + console.log("open"); +} +function oncolorPickercreate(){ + console.log("create") +} + + +$(document).ready(function () { + + $("#fileExplorer").ejFileExplorer({ + isResponsive: true, + fileTypes: "*.png, *.gif, *.jpg, *.jpeg, *.docx", + layout: "largeicons", + path: "http://mvc.syncfusion.com/ODataServices/FileBrowser/", + ajaxAction: "http://mvc.syncfusion.com/OdataServices/fileExplorer/fileoperation/doJSONPAction", + ajaxDataType: "jsonp", + }); +}); + + +$(document).ready(function () { + + $("#datepicker1").ejDatePicker({dateFormat: "dd/MM/yyyy" ,open: ondatePickeropen }); + $("#datepicker3").ejDatePicker({value: "21/2/2010" , select: ondatePickerselect }); + +}); +function ondatePickeropen() { + console.log("open"); +} +function ondatePickerselect(){ + console.log("select") +} + + +$(document).ready(function () { + + $("#datetimepicker1").ejDateTimePicker({width:"100%" , create: ondatetimePickercreate }); + $("#datetimepicker2").ejDateTimePicker({enableRTL: true , open: ondatetimePickeropen }); +}); +function ondatetimePickercreate() { + console.log("create"); +} +function ondatetimePickeropen(){ + console.log("open") +} + + +$(document).ready(function () { + $("#Div1").ejDialog({ enabled: true , open : ondialogOpen }); + $("#Div2").ejDialog({ title: "Low battery" , beforeClose : ondialogbeforeClose }); +}); +function ondialogbeforeClose() { + console.log("beforeClose"); +} +function ondialogOpen() { + console.log("open"); +} +$(document).ready(function () { + + $("#dropdownlist1").ejDropDownList({ targetID: "carsList", create: ondropDowncreate }); + $("#dropdownlist2").ejDropDownList({ watermarkText: "Select a car", change: ondropDownchange }); +}); + +function ondropDowncreate() { + console.log("create"); +} +function ondropDownchange(){ + console.log("change") +} +$(document).ready(function () { + $("#num1").ejNumericTextbox({ value:"35" ,create: onEditorcreate }); + $("#num2").ejNumericTextbox({ width:"100%" , change: onEditorchange }); + + $("#num3").ejPercentageTextbox({ value:"3" ,create: onEditorcreate }); + $("#num4").ejPercentageTextbox({ width:"100%" , change: onEditorchange }); + + $("#num5").ejCurrencyTextbox({ value:"555" ,create: onEditorcreate }); + $("#num6").ejCurrencyTextbox({ width:"100%" , change: onEditorchange }); + +}); + +function onEditorcreate() { + console.log("create"); +} +function onEditorchange(){ + console.log("change") +} + +$(document).ready(function () { + + //Properties + $("#listview1").ejListView({ width: 200,mouseUP: onlistViewmouseup }); + $("#listview2").ejListView({ height: 300, mouseDown: onlistViewmousedown }); + +}); +//Events +function onlistViewmouseup() { + console.log("mouse up happens on the item."); +} +function onlistViewmousedown() { + console.log("mouse down happens on the item."); +} + + + + + + + + + +$(document).ready(function () { + $("#num1").ejMaskEdit({ maskFormat: "99-999-99999" ,create: onmaskEditcreate }); + $("#num2").ejMaskEdit({ watermarkText: "99-999-99999", width:"100%" , change: onmaskEditchange }); +}); + +function onmaskEditcreate() { + console.log("create"); +} +function onmaskEditchange(){ + console.log("change") +} +$(document).ready(function () { + + //Properties + $("#menu1").ejMenu({ enabled: false ,create: onMenucreate }); + $("#menu2").ejMenu({ width: "800px",click: onMenuclick }); + +}); +//Events +function onMenucreate() { + console.log("control created"); +} +function onMenuclick() { + console.log("mouse click on menu items"); +} + + + + + +$(document).ready(function () { + $("#pager1").ejPager({ click : onclickpager }); + $("#pager2").ejPager({ enableRTL: true }); +}); + +function onclickpager(){ + console.log("click") +} +$(document).ready(function () { + + $("#progress1").ejProgressBar({ text: 'loading...' , value: 50 , create: ProgressBarCreate }); + $("#progress2").ejProgressBar({ width: 200, value: 50 , change: ProgressBarChange }); + +}); + +function ProgressBarCreate() { + console.log("create"); +} +function ProgressBarChange(){ + console.log("change"); +} + +$(document).ready(function () { + $("#r1").ejRadioButton({ create: onradioButtoncreate }); + $("#r2").ejRadioButton({ text: "RadioButton",change: onradioButtonchange }); + $("#r3").ejRadioButton({ text: "RadioButton1", enabled: false }); +}); + +function onradioButtonchange() { + console.log("Change triggered"); +} +function onradioButtoncreate() { + console.log("Create triggered"); +} +$(document).ready(function () { + $("#Div1").ejRating({ enabled: true, click: onRatingclick }); + $("#Div2").ejRating({ incrementStep: 1, change: RatingvalueChanged }); +}); + +function RatingvalueChanged() { + console.log("Value changed"); +} +function onRatingclick() { + console.log("Entered"); +} +$(document).ready(function () { + + + $("#test1").ejRibbon({ + allowResizing:true,applicationTab: { + menuSettings: { + openOnClick: false + } + }, + tabs: [{ + id: "home", + text: "HOME", + groups: [{ + text: "New", + type: "custom", + contentID: "btn" + }] + }], + }); + $("#test2").ejRibbon({ + width: "100%", + applicationTab: { + menuSettings: { + openOnClick: false + } + }, + tabs: [{ + id: "home", + text: "HOME", + groups: [{ + text: "New", + type: "custom", + contentID: "btn" + }] + }], tabClick: onRibbonTabClick + }); +}); + +function onRibbonTabClick() { + console.log("Tab Clicked.."); +} + +$(function() { + $("#Kanban").ejKanban( + { + enableRTL: true, + columns: [ + { headerText: "Backlog", key: "Open" }, + { headerText: "In Progress", key: "InProgress" }, + { headerText: "Testing", key: "Testing" }, + { headerText: "Done", key: "Close" } + ], + keyField: "Status", + + + }); + }); + +$(document).ready(function () { + var imageData = [ + { + "imageurl": "../themes/images/rose.jpg", + }, + { + "imageurl": "../themes/images/rose.jpg", + } + + ]; + $("#test1").ejRotator({ + dataSource:imageData, allowKeyboardNavigation : false,create: onRotatorCreate + }); + $("#test2").ejRotator({ + dataSource:imageData, displayItemsCount : "1",pagerClick: onRotatorpagerClick + + }); + + +}); + +function onRotatorCreate() { + console.log("created"); +} +function onRotatorpagerClick() { + console.log("page clicked.."); +} + + +$(document).ready(function () { + $("#rteSample").ejRTE({ allowEditing: false , enableRTL: true }); + $("#rteSample").ejRTE({ change: onRtechange , execute: onRteExecute }); +}); + +function onRtechange() { + console.log("Change triggered"); +} +function onRteExecute() { + console.log("Executed"); +} +$(document).ready(function() { + $("#test1").ejSlider({ showRoundedCorner: true }); + $("#test2").ejSlider({ orientation: ej.Orientation.Vertical }); + $("#test3").ejSlider({ minValue: 20, maxValue: 80 }); + $("#test4").ejSlider({ start: Sliderstart }); + $("#test5").ejSlider({ enabled: false }); + $("#test6").ejSlider({ slide: onSliderslide }); +}); +function Sliderstart() { + console.log("Slider Started"); +} +function onSliderslide() { + console.log("Moving"); +} + +$(document).ready(function () { + $("#sbutton").ejSplitButton({ + width: "120px", + height: "50px", + buttonMode: ej.ButtonMode.Dropdown, + create: splitButtonopen, + targetID: "target", + }); +}); + +function splitButtonopen() +{ +alert("Opened"); +} + + + +$(document).ready(function () { + + $("#splitter1").ejSplitter({ enableRTL: true , create: onSplitterCreate }); + $("#splitter2").ejSplitter({allowKeyboardNavigation: false , expandCollapse: onSplitterExpandCollapse }); + +}); +function onSplitterCreate() { + console.log("Created"); +} +function onSplitterExpandCollapse(){ + console.log("expand and collapsed") +} + +$(document).ready(function () { + + $("#tab1").ejTab({ enableRTL: true , create: onTabCreate }); + $("#tab2").ejTab({ showRoundedCorner: true , ajaxSuccess: onTabAjaxSuccess }); + +}); +function onTabCreate() { + console.log("created"); +} + +function onTabAjaxSuccess() { + console.log("ajaxsuccess"); +} + + +$(function () { + // declaration + var websiteCollection = [ + { text: "Google", url: "http://www.google.com", frequency: 12 }, + { text: "All Things Digital", url: "http://allthingsd.com/", frequency: 3 }, + + ]; + $("#tagtest").ejTagCloud({ + titleText: "Tech Sites", + dataSource: websiteCollection, + enableRTL: true, mouseout: onTagMouseout + }); + $("#tagtest1").ejTagCloud({ + titleText: "Tech Sites", + dataSource: websiteCollection, + maxFontSize: "10px", create: onTagCreate + }); + function onTagCreate() { + console.log("created"); + } + function onTagMouseout() { + console.log("mouseout"); + } +}); + + + + $(function () { + $("#time").ejTimePicker({ enabled : true, height : "35",close: TimeClose,create: TimeCreate}); + }); + + function TimeClose() { + console.log("close"); + } + function TimeCreate() { + console.log("create"); + } + + + $(function () { + $("#tbutton").ejToggleButton({ + size: "large", + height: "28px", + click:ToggleClick, + create:ToggleCreate + }); + }); + + function ToggleClick() { + console.log("click"); + } + function ToggleCreate() { + console.log("create"); + } + +$(function () {// document ready + // Toolbar control creation + $("#ToolbarItem").ejToolbar({ + width: "auto", // width of the Toolbar + height: "33px", // height of the Toolbar + create:ToolBarCreate, + click:ToolBarClick + }); + }); + +function ToolBarCreate() { + console.log("click"); +} +function ToolBarClick() { + console.log("create"); +} + +$(document).ready(function () { + + $("#treeView").ejTreeView({ width: 300 , cssClass: 'customclass' , create: TreeViewCreate }); + + $("#treeView1").ejTreeView({ height: 300 , enabled: true , nodeClick: TreeViewClick }); +}); + + +function TreeViewCreate() { + console.log("create"); +} +function TreeViewClick(){ + console.log("click"); +} + +$(document).ready(function () { + + //Properties + $("#uploadbbox1").ejUploadbox({ height: "60px", create: onuploadBoxcreate }); + $("#uploadbbox2").ejUploadbox({ enableRTL: true, fileSelect: onuploadBoxfileselect }); + +}); +//Events +function onuploadBoxcreate() { + console.log("control created"); +} +function onuploadBoxfileselect() { + console.log("file has been selected"); +} + + + + + + + + + +$(document).ready(function () { + + //Properties + $("#waitingpopup1").ejWaitingPopup({ showOnInit: true, create: onwaitingPopupcreate }); + $("#waitingpopup2").ejWaitingPopup({ showOnInit: true, showImage: false }); + +}); +//Events +function onwaitingPopupcreate() { + console.log("control created"); +} + + + + + +$(function () { + $("#Grid").ejGrid({ + allowPaging: true, + allowSorting: true, + rowSelected: onGridRowSelect, + columnSelected: onGridColumnSelect, + rightClick: onGridRightClick, + columns: [ + { field: "OrderID", headerText: "Order ID", width: 75 , textAlign: ej.TextAlign.Right }, + { field: "CustomerID", headerText: "Customer ID", width: 80 }, + { field: "EmployeeID", headerText: "Employee ID", width: 75, textAlign: ej.TextAlign.Right }, + { field: "Freight", width: 75, format: "{0:C}", textAlign: ej.TextAlign.Right }, + { field: "OrderDate", headerText: "Order Date", width: 80, format: "{0:MM/dd/yyyy}", textAlign: ej.TextAlign.Right }, + { field: "ShipCity", headerText: "Ship City", width: 110 } + ] + }); + }); + +function onGridRowSelect() +{ +console.log("Row Selected"); +} +function onGridRightClick() +{ +console.log("Right Click Button Clicked"); +} +function onGridColumnSelect() +{ +console.log("Column Selected"); +} + + $(function () { + $("#PivotGrid").ejPivotGrid({ + load: PivotGridload, + renderComplete: PivotGridrenderComplete, + url: "/wcf/PivotGridService.svc", + isResponsive: true + + }); + }); + + function PivotGridload() { + console.log("load"); + } + function PivotGridrenderComplete() { + console.log("rendercomplete"); + } + + + $(function () { + $("#PivotSchemaDesigner1").ejPivotSchemaDesigner({ + height: "630px", + url: "/wcf/PivotService.svc" + }); + }); + + + +$(document).ready(function () { + $("#pivotpager1").ejPivotPager({ categoricalCurrentPage: 1 }); + $("#pivotpager2").ejPivotPager({ seriesPageCount: 0 }); +}); + +$(document).ready(function () { + $("#test1").ejSchedule({ + cellHeight:"35px", cellClick: onScheduleCellClick + }); + $("#test2").ejSchedule({ + enableRTL: true, menuItemClick: onScheduleMenuItemClick + }); +}); +function onScheduleCellClick() { + console.log("cell clicked.."); +} +function onScheduleMenuItemClick() { + console.log("Menu Item Clicked.."); +} + + + $(function () { + $("#RecurrenceEditor").ejRecurrenceEditor({ + selectedRecurrenceType: 0, + create: RecurrenceEditorOncreate + }); + + }); + + function RecurrenceEditorOncreate() { + this.element.find("#recurrencetype_wrapper").css("width", "33%"); + } + +$(document).ready(function () { + +$("#GanttContainer").ejGantt({ + allowSelection: true, + allowColumnResize: true, + taskIdMapping: "TaskID", + taskNameMapping: "TaskName", + scheduleStartDate: "02/23/2014", + scheduleEndDate: "03/31/2014", + startDateMapping: "StartDate", + endDateMapping: "EndDate", + progressMapping: "Progress", + childMapping: "Children", + allowGanttChartEditing: false, + treeColumnIndex: 1, + enableResize: true, + expanded: onGanttExpand, + load: onGanttLoad + }); +}); + +function onGanttExpand() +{ +console.log("Expanded"); +} +function onGanttLoad() +{ +console.log("Loading"); +} +$(document).ready(function () { + + + $("#test1").ejReportViewer({ reportServiceUrl: "../api/RDLReport",enablePageCache: false,reportLoaded: onReportReportLoaded }); + $("#test2").ejReportViewer({ + renderMode: ej.ReportViewer.RenderMode.Default,reportServiceUrl: "../api/RDLReport",renderingBegin: onReportRenderingBegin }); +}); +function onReportRenderingBegin() { + console.log("Rendering Begin.."); +} +function onReportReportLoaded() { + console.log("Report Loaded.."); +} + +$(document).ready(function () { + var dataManager = [ + { + taskID: 1, + taskName: "Planning", + startDate: "02/03/2014", + endDate: "02/07/2014", + progress: 100, + duration: 5, + priority: "Normal", + approved: false, + subtasks: [ + { taskID: 2, taskName: "Plan timeline", startDate: "02/03/2014", endDate: "02/07/2014", duration: 5, progress: 100, priority: "Normal", approved: false }, + { taskID: 3, taskName: "Plan budget", startDate: "02/03/2014", endDate: "02/07/2014", duration: 5, progress: 100, approved: true }, + { taskID: 4, taskName: "Allocate resources", startDate: "02/03/2014", endDate: "02/07/2014", duration: 5, progress: 100, priority: "Critical", approved: false }, + { taskID: 5, taskName: "Planning complete", startDate: "02/07/2014", endDate: "02/07/2014", duration: 0, progress: 0, priority: "Low", approved: true } + ] + }]; + +$("#test1").ejTreeGrid({ + dataSource:dataManager,allowColumnResize: true, + columns: [ + { field: "taskID", headerText: "Task Id", editType: "numericedit" }, + { field: "taskName", headerText: "Task Name", editType: "stringedit" }, + { field: "startDate", headerText: "Start Date", editType: "datepicker" }, + { field: "endDate", headerText: "End Date", editType: "datepicker" }, + { field: "duration", headerText: "Duration", editType: "numericedit" }, + { field: "progress", headerText: "Progress", editType: "numericedit" } + ],load: onTreeLoad + }); + $("#test2").ejTreeGrid({ + dataSource:dataManager,rowHeight : 30, + columns: [ + { field: "taskID", headerText: "Task Id", editType: "numericedit" }, + { field: "taskName", headerText: "Task Name", editType: "stringedit" }, + { field: "startDate", headerText: "Start Date", editType: "datepicker" }, + { field: "endDate", headerText: "End Date", editType: "datepicker" }, + { field: "duration", headerText: "Duration", editType: "numericedit" }, + { field: "progress", headerText: "Progress", editType: "numericedit" } + ],rowSelected: onTreeRowSelected + + }); + + +}); +function onTreeLoad() { + console.log("loaded.."); +} +function onTreeRowSelected() { + console.log("row Selected.."); +} + + +$(document).ready(function () { + $("#navpane").ejNavigationDrawer({ type: "overlay", direction: "left", position: "fixed",open: NavigationDrawerOpen }); +}); + +function NavigationDrawerOpen() +{ + console.log("open"); +} + + + $(function () { + $('#radialmenu').ejRadialMenu({ targetElementId: "radialtarget", "autoOpen":true,select: RadialMenuSelect , mouseUp: RadialMenuMouseUp }); + }); + + function RadialMenuMouseUp() { + console.log("mouseUp"); + } + function RadialMenuSelect() { + console.log("select"); + } + + + +$(function () +{ + $("#tile1").ejTile({ text: "Map", tileSize: "medium", imageUrl: 'http://js.syncfusion.com/ug/web/content/tile/map.png', mouseUp: TileMouseUp, mouseDown: TileMouseDown }); +}); + +function TileMouseUp() { + console.log("mouseUp"); +} + +function TileMouseDown() { + console.log("mousedown"); +} + + + + + $(function () { + $("#radialSlider").ejRadialSlider({ innerCircleImageUrl: "chevron-right.png",autoOpen:true, create: RadialSliderCreate , start: RadialSliderStart }); + }); + + function RadialSliderCreate() { + console.log("create"); + } + function RadialSliderStart() { + console.log("start"); + } + +$(document).ready(function () { + $("#test1").ejSpreadsheet({ + allowDelete: true, cellEdit: onSpreadsheetCellEdit + }); + $("#test2").ejSpreadsheet({ + cssClass: "gradient-lime", drag: onSpreadsheetDrag + }); +}); +function onSpreadsheetDrag() { + console.log("item drag.."); +} +function onSpreadsheetCellEdit() { + console.log("cell edited.."); +} + + + $(function() + { + $("#OlapChart").ejOlapChart( + { + url: "OlapChartService.svc", + renderFailure: OlapChartRenderFailure, + renderSuccess: OlapChartRenderSuccess + }); + }); + + function OlapChartRenderFailure() { + console.log("failure"); + } + function OlapChartRenderSuccess() { + console.log("success"); + } + + + $(function() + { + $("#OlapClient").ejOlapClient( + { + url: "/wcf/OlapClientService.svc", + title: "OLAP Browser", + renderFailure: OlapClientRenderFailure, + renderSuccess: OlapClientRenderSuccess + }); + }); + + function OlapClientRenderFailure() { + console.log("failure"); + } + function OlapClientRenderSuccess() { + console.log("success"); + } + +$(document).ready(function() + { + $("#olapgauge1").ejOlapGauge( + { + url: "../wcf/OlapGaugeService.svc", + enableTooltip: true, + renderFailure: olapGaugerenderFailure, + renderSuccess: olapGaugerenderSuccess + }); + }); +function olapGaugerenderFailure() { + console.log("failure"); + } +function olapGaugerenderSuccess() { + console.log("success"); + } + +$(document).ready(function () { + + $("#CoreLinearGauge").ejLinearGauge({ + labelColor: "#8c8c8c", width: 500, + scales: [{ + width: 4, border: { color: "transparent",width:0 }, showBarPointers: false, showRanges: true, length: 310, + position: { x: 52, y: 50 }, markerPointers: [{ + value: 50, length: 10, width: 10, backgroundColor: "#4D4D4D", border: { color: "#4D4D4D" } + }], + labels: [{ font: { size: "11px", fontFamily: "Segoe UI", fontStyle: "bold" }, distanceFromScale:{x: -13} }], + ticks: [{ type: "majorinterval", width: 1, color: "#8c8c8c" }], + ranges: [{ + endValue: 60, + startValue: 0, + backgroundColor: "#F6B53F", + border: { color: "#F6B53F" }, startWidth: 4, endWidth: 4 + }, { + endValue: 100, + startValue: 60, + backgroundColor: "#E94649", + border: { color: "#E94649" }, startWidth: 4, endWidth: 4 + }] + }], + init:onLinearGaugeinit, + mouseClick:onLinearGaugemouseClick + }); +}); + +function onLinearGaugeinit() +{ + console.log("init"); +} +function onLinearGaugemouseClick() +{ + console.log("mouseClick"); +} + +$(document).ready(function () { + + $("#CoreCircularGauge").ejCircularGauge({ + backgroundColor: "transparent", width: 500, + scales: [{ + showRanges: true, + startAngle: 122, sweepAngle: 296, radius: 130, showScaleBar: true, size: 1, maximum: 120, majorIntervalValue: 20, minorIntervalValue: 10, + border: { + width: 0.5, + }, + pointers: [{ + value: 60, + showBackNeedle: true, + backNeedleLength: 20, + length: 95, + width: 7, + pointerCap: { radius: 12 } + }], + ticks: [{ + type: "major", + distanceFromScale: 2, + height: 16, + width: 1, color: "#8c8c8c" + }, { type: "minor", height: 8, width: 1, distanceFromScale: 2, color: "#8c8c8c" }], + labels: [{ + color: "#8c8c8c" + }], + ranges: [{ + distanceFromScale: -30, + startValue: 0, + endValue: 70 + }, { + distanceFromScale: -30, + startValue: 70, + endValue: 110, + backgroundColor: "#fc0606", + border: { color: "#fc0606" } + }, + { + distanceFromScale: -30, + startValue: 110, + endValue: 120, + backgroundColor: "#f5b43f", + border: { color: "#f5b43f" } + }] + }], + mouseClick:onCircularMouseClick + }); + +}); + +function onCircularMouseClick() +{ + console.log("Mouse click.."); +} + +$(document).ready(function () { + + $("#DigitalCore").ejDigitalGauge({ + width: 525, + height: 305, + items: [{ + segmentSettings: { + width: 1, + spacing: 0, + color: "#8c8c8c" + }, + characterSettings: { + opacity: 0.8, + }, + value: "123456789", + position: { x: 52, y: 52 } + }], + init:onDigitalGaugeinit, + itemRendering:onDigitalGaugeItemRendering + }); +}); + +function onDigitalGaugeinit() +{ + console.log("init"); +} +function onDigitalGaugeItemRendering() +{ + console.log("itemRendering"); +} + +$(document).ready(function () { + + $("#container").ejChart( + { + + + + //Initializing Common Properties for all the series + commonSeriesOptions: + { + type: 'line', enableAnimation: true, + tooltip:{ visible :true, template:'Tooltip'}, + marker: + { + shape: 'circle', + size: + { + height: 10, width: 10 + }, + visible: true + }, + border : {width: 2} + }, + + + + title :{text: 'Efficiency of oil-fired power production'}, + size: { height: "600" }, + legend: { visible: true}, + create:onChartCreate + }); + +}); + +function onChartCreate() +{ + console.log("create"); +} + +$(document).ready(function () { + + $("#scrollcontent").ejRangeNavigator({ + + enableDeferredUpdate: true, + padding: "15", + allowSnapping:true, + selectedRangeSettings: { + start:"2015/5/25", end:"2016/5/25" + }, + + }) +}); + +$(document).ready(function () { + $("#BulletGraph1").ejBulletGraph({ + qualitativeRangeSize: 32, + quantitativeScaleLength: 475, tooltipSettings: {template: "Tooltip", visible: true}, orientation: ej.datavisualization.BulletGraph.Orientation.Horizontal, + flowDirection: ej.datavisualization.BulletGraph.FlowDirection.Forward, + quantitativeScaleSettings: { + location: { x: 110, y: 10 }, + minimum: 0, + maximum: 10, + interval: 1, + minorTicksPerInterval: 4, + majorTickSettings:{ size: 13, width: 1, stroke: 'gray'}, + minorTickSettings:{ size: 5, width: 1, stroke: 'gray'}, + + labelSettings: { + position: ej.datavisualization.BulletGraph.LabelPosition.Below, offset: 14, size: 10 + }, + featuredMeasureSettings: { width: 6 }, + comparativeMeasureSettings:{ + width: 5 + }, + featureMeasures: [{ value: 8, comparativeMeasureValue: 6.7, category: ""}] + }, + qualitativeRanges: [{ + rangeEnd: 4.3 + }, { + rangeEnd: 7.3 + }, { + rangeEnd: 10 + }], + captionSettings: { textAngle: 0, + location: { x: 17, y: 20 }, text: "Revenue YTD", font: { color: null, fontFamily: 'Segoe UI', fontStyle: ej.datavisualization.BulletGraph.FontStyle.Normal, size: '12px', fontWeight: ej.datavisualization.BulletGraph.FontWeight.Normal, opacity: 1 }, //'#707070' + subTitle: { textAngle: 0, + text: "$ in Thousands", location: { x: 10, y: 35 }, font: { color: null, fontFamily: 'Segoe UI', fontStyle: ej.datavisualization.BulletGraph.FontStyle.Normal, size: '12px', fontWeight: ej.datavisualization.BulletGraph.FontWeight.Normal, opacity: 1} //'#707070' + } + } + + + + }); + + $("#BulletGraph2").ejBulletGraph({ qualitativeRangeSize: 32, height:140, + quantitativeScaleLength: 475, orientation: ej.datavisualization.BulletGraph.Orientation.Horizontal, + flowDirection: ej.datavisualization.BulletGraph.FlowDirection.Forward, + quantitativeScaleSettings: { + location: { x: 110, y: 10 }, + minimum: -10, + maximum: 10, + interval: 2, + minorTicksPerInterval: 4, + majorTickSettings:{ size: 13, width: 1}, + minorTickSettings:{ size: 5, width: 1}, + + labelSettings: { + position: ej.datavisualization.BulletGraph.LabelPosition.Below, offset: 14, size: 10, labelSuffix: ' %' + }, + featuredMeasureSettings: { width: 6 }, + comparativeMeasureSettings:{ width: 5 }, + featureMeasures: [{ value: 8, comparativeMeasureValue: 6.7}] + }, + qualitativeRanges: [{ + rangeEnd: -4, rangeStroke: "#61a301" + }, { + rangeEnd: 3, rangeStroke: "#fcda21" + }, { + rangeEnd: 10, rangeStroke: "#d61e3f" + }], + captionSettings: { textAngle: 0, + location: { x: 60, y: 25 }, text: "Profit", font: { color: null, fontFamily: 'Segoe UI', fontStyle: ej.datavisualization.BulletGraph.FontStyle.Normal, size: '13px', fontWeight: ej.datavisualization.BulletGraph.FontWeight.Normal, opacity: 1 }, //'#707070' + //subTitle: { textAngle: 0, + // text: "profit in %", location: { x: 35, y: 35 }, font: { color: null, fontFamily: 'Segoe UI', fontStyle: ej.datavisualization.BulletGraph.FontStyle.Normal, size: '12px', fontWeight: ej.datavisualization.BulletGraph.FontWeight.Normal, opacity: 1} //'#707070' + //} + }, + drawLabels:onBulletDrawLabel + }); + +}); + + function onBulletDrawLabel() + { + console.log("drawLabel"); + } + + +$(document).ready(function () { + + $("#barcode").ejBarcode({ text: "HTTP://WWW.SYNCFUSION.COM", symbologyType: "qrbarcode", xDimension: 8, displayText: true, load:onBarcodeLoad }); + +}); + +function onBarcodeLoad() + { + console.log("load"); + } + + jQuery(function ($) { + $("#container").ejMap({ + mouseover:MapMouseOver, + onRenderComplete:MapOnRenderComplete, + navigationControl:{enableNavigation:true,orientation:'vertical',absolutePosition:{x:5,y:15},dockPosition: 'none'}, + background:'white', + enableAnimation: true, + layers: [ + { + layerType: "geometry", + enableSelection: false, + enableMouseHover:false, + + showMapItems: false, + markerTemplate: 'template', + shapeSettings: { + fill: "#626171", + strokeThickness: "1", + stroke: "#6F6F79", + highlightStroke:"#6F6F79", + valuePath: "name", + highlightColor: "gray" + + }, + + } + ] + + }); + }); + function MapMouseOver() { + console.log("mouseover"); + } + function MapOnRenderComplete() { + console.log("onRenderComplete"); + } + + + jQuery(function ($) { + $("#treemapContainer").ejTreeMap({ + treeMapItemSelected:onTreeMapItemSelected, + + levels: [ + { groupPath: "Continent", groupGap: 5} + ], + colorValuePath: "Growth", + rangeColorMapping: [ + { color: "#DC562D", from: "0", to: "1" }, + { color: "#FED124", from: "1", to: "1.5" }, + { color: "#487FC1", from: "1.5", to: "2" }, + { color: "#0E9F49", from: "2", to: "3" } + ], + showTooltip:true, + leafItemSettings: { labelPath: "Region" } + }); + }); + function onTreeMapItemSelected() { + console.log("TreeMapItemSelected"); + } + + \ No newline at end of file diff --git a/ej.widgets.all/ej.web.all.d.ts b/ej.widgets.all/ej.web.all.d.ts new file mode 100644 index 0000000000..de335df408 --- /dev/null +++ b/ej.widgets.all/ej.web.all.d.ts @@ -0,0 +1,47109 @@ +// Type definitions for ej.web.all v14.1.0.41 +// Project: http://help.syncfusion.com/js/typescript +// Definitions by: Syncfusion +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/*! +* filename: ej.web.all.d.ts +* version : 14.1.0.41 +* Copyright Syncfusion Inc. 2001 - 2016. All rights reserved. +* Use of this code is subject to the terms of our license. +* A copy of the current license can be obtained at any time by e-mailing +* licensing@syncfusion.com. Any infringement will be prosecuted under +* applicable laws. +*/ +declare module ej { + + var dataUtil: dataUtil; + function isMobile(): boolean; + function isIOS(): boolean; + function isAndroid(): boolean; + function isFlat(): boolean; + function isWindows(): boolean; + function isCssCalc(): boolean; + function getCurrentPage(): JQuery; + function isLowerResolution(): boolean; + function browserInfo(): browserInfoOptions; + function isTouchDevice(): boolean; + function addPrefix(style: string): string; + function animationEndEvent(): string; + function blockDefaultActions(e: Object): void; + function buildTag(tag: string, innerHtml: string, styles: Object, attrs: Object): JQuery; + function cancelEvent(): string; + function copyObject(): string; + function createObject(nameSpace: string, value: Object, initIn: string): JQuery; + function defineClass(className: string, constructor:any, proto: Object, replace: boolean): Object; + function destroyWidgets(element: Object): void; + function endEvent(): string; + function event(type: string, data: any, eventProp: Object): Object; + function getAndroidVersion(): Object; + function getAttrVal(ele: Object, val: string, option: Object): Object; + function getBooleanVal(ele: Object, val: string, option: Object): Object; + function getClearString(): string; + function getDimension(element: Object, method: string): Object; + function getFontString(fontObj: Object): string; + function getFontStyle(style: string): string; + function getMaxZindex(): number; + function getNameSpace(className: string): string; + function getObject(nameSpace: string): Object; + function getOffset(ele: string): Object; + function getRenderMode(): string; + function getScrollableParents(element: Object): void; + function getTheme(): string; + function getZindexPartial(element: Object, popupEle: string): number; + function hasRenderMode(element: string): void; + function hasStyle(prop: string): boolean; + function hasTheme(element: string): string; + function hexFromRGB(color: string): string; + function ieClearRemover(element: string): void; + function isAndroidWebView(): string; + function isDevice(): boolean; + function isIOS7(): boolean; + function isIOSWebView(): boolean; + function isLowerAndroid(): boolean; + function isNullOrUndefined(value: Object): boolean; + function isPlainObject(): JQuery; + function isPortrait(): any; + function isTablet(): boolean; + function isWindowsWebView(): string; + function listenEvents(selectors:any, eventTypes: any, handlers: any, remove?: any, pluginObj?: any, disableMouse?: boolean): void; + function listenTouchEvent(selectors:any, eventTypes: any, handlers: any, remove?: any, pluginObj?: any, disableMouse?: boolean): void; + function logBase(val: string, base: string): number; + function measureText(text: string, maxwidth: number, font: string): string; + function moveEvent(): string; + function print(element: string): void; + function proxy(fn: Object, context: string, arg: string): boolean; + function round(value: string, div: string, up: string): any; + function sendAjaxRequest(ajaxOptions: Object): void; + function setCaretToPos(nput: string, pos1: string, pos2: string): void; + function setRenderMode(element: string): void; + function setTheme(): Object; + function startEvent(): string; + function tapEvent(): string; + function tapHoldEvent(): string; + function throwError(): Object; + function transitionEndEvent(): Object; + function userAgent(): boolean; + function widget(pluginName: string, className: string, proto: Object): Object; + function avg(json: Object, filedName: string): any; + function getGuid(prefix: string): number; + function group(jsonArray: any, field: string, agg: string, level: number, groupDs: string): Object; + function isJson(jsonData: string): string; + function max(jsonArray: any, fieldName: string, comparer: string): any; + function min(jsonArray: any, fieldName: string, comparer: string): any; + function merge(first: string, second: string): any; + function mergeshort(jsonArray: any, fieldName: string, comparer: string): any; + function parseJson(jsonText: string): string; + function parseTable(table: number, headerOption: string, headerRowIndex: string): Object; + function select(jsonArray: any, fields: string): any; + function setTransition(): boolean; + function sum(json: string, fieldName: string): string; + function swap(array: any, x: string, y: string): any; + var cssUA: string; + var serverTimezoneOffset: number; + var transform: string; + var transformOrigin: string; + var transformStyle: string; + var transition: string; + var transitionDelay: string; + var transitionDuration: string; + var transitionProperty: string; + var transitionTimingFunction: string; + export module device { + function isAndroid(): boolean; + function isIOS(): boolean; + function isFlat(): boolean; + function isIOS7(): boolean; + function isWindows(): boolean; + } + export module widget { + var autoInit: boolean; + var registeredInstances: Array; + var registeredWidgets: Array; + function register(pluginName: string, className: string, prototype: any): void; + function destroyAll(elements: Element): void; + function init(element: Element): void; + function registerInstance(element: Element, pluginName: string, className: string, prototype: any):void; + } + + interface browserInfoOptions { + name: string; + version: string; + culture: Object; + isMSPointerEnabled: boolean; + } + class WidgetBase { + destroy(): void; + element: JQuery; + setModel(options: Object, forceSet?: boolean):any; + option(prop?: Object, value?: Object, forceSet?: boolean): any; + persistState(): void; + restoreState(silent: boolean): void; + } + + class Widget extends WidgetBase { + constructor(pluginName: string, className: string, proto: any); + static fn: Widget; + static extend(widget: Widget): any; + register(pluginName: string, className: string, prototype: any): void; + destroyAll(elements: Element): void; + model: any; + } + + + interface BaseEvent { + cancel: boolean; + type: string; + } + class DataManager { + constructor(dataSource?: any, query?: ej.Query, adaptor?: any); + setDefaultQuery(query: ej.Query): void; + executeQuery(query?: ej.Query, done?: any, fail?: any, always?: any): JQueryPromise; + executeLocal(query?: ej.Query): ej.DataManager; + saveChanges(changes?: Changes, key?: string, tableName?: string): JQueryDeferred; + insert(data: Object, tableName: string): JQueryPromise; + remove(keyField: string, value: any, tableName: string): Object; + update(keyField: string, value: any, tableName: string): Object; + } + + class Query { + constructor(); + static fn: Query; + static extend(prototype: Object): Query; + key(field: string): ej.Query; + using(dataManager: ej.DataManager): ej.Query; + execute(dataManager: ej.DataManager, done: any, fail?: string, always?: string): any; + executeLocal(dataManager: ej.DataManager): ej.DataManager; + clone(): ej.Query; + from(tableName: any): ej.Query; + addParams(key: string, value: string): ej.Query; + expand(tables: any): ej.Query; + where(fieldName: string, operator: ej.FilterOperators, value: string, ignoreCase?: boolean): ej.Query; + where(predicate:ej.Predicate):ej.Query; + search(searchKey: any, fieldNames?: any, operator?: string, ignoreCase?: boolean): ej.Query; + sortBy(fieldName: string, comparer?: ej.SortOrder, isFromGroup?: boolean): ej.Query; + sortByDesc(fieldName: string): ej.Query; + group(fieldName: string): ej.Query; + page(pageIndex: number, pageSize: number): ej.Query; + take(nos: number): ej.Query; + skip(nos: number): ej.Query; + select(fieldNames: any): ej.Query; + hierarchy(query: ej.Query, selectorFn: any): ej.Query; + foreignKey(key: string): ej.Query; + requiresCount(): ej.Query; + range(start:number, end:number): ej.Query; + } + + class Adaptor { + constructor(ds: any); + pvt: Object; + type: ej.Adaptor; + options: AdaptorOptions; + extend(overrides: any): ej.Adaptor; + processQuery(dm: ej.DataManager, query: ej.Query):any; + processResponse(data: Object, ds: any, query: ej.Query, xhr: JQueryXHR, request?: Object, changes?: Changes): Object; + convertToQueryString(req: any, query: ej.Query, dm: ej.DataManager): JQueryParam; + } + + interface AdaptorOptions { + from?: string; + requestType?: string; + sortBy?: string; + select?: string; + skip?: string; + group?: string; + take?: string; + search?: string; + count?: string; + where?: string; + aggregates?: string; + } + + class UrlAdaptor extends ej.Adaptor { + constructor(); + processQuery(dm: ej.DataManager, query: ej.Query, hierarchyFilters?: Object): { + type: string; url: string; ejPvtData: Object; contentType?: string; data?: Object; + } + convertToQueryString(req: Object, query: ej.Query, dm: ej.DataManager): JQueryParam; + processResponse(data: Object, ds: any, query: ej.Query, xhr: JQueryXHR, request?: Object, changes?: Changes): Object; + onGroup(e: any): void; + batchRequest(dm: ej.DataManager, changes: Changes, e: any): void; + beforeSend(dm: ej.DataManager, request: any, settings?:any): void; + insert(dm: ej.DataManager, data: Object, tableName: string): { url: string; data: any }; + remove(dm: ej.DataManager, keyField: string, value: any, tableName: string): { type: string; url: string; data?: any }; + update(dm: ej.DataManager, keyField: string, value: any, tableName: string): { type: string; url: string; data: any }; + getFiltersFrom(data: Object, query: ej.Query): ej.Predicate; + } + + class ODataAdaptor extends ej.UrlAdaptor { + constructor(); + options: UrlAdaptorOptions; + onEachWhere(filter: any, requiresCast: boolean): any; + onPredicate(pred: ej.Predicate, query: ej.Query, requiresCast: boolean): string; + onComplexPredicate(pred: ej.Predicate, requiresCast: boolean): string; + onWhere(filters: Array): string; + onEachSearch(e: Object): void; + onSearch(e: Object): string; + onEachSort(e: Object): string; + onSortBy(e: Object): string; + onGroup(e: Object): string; + onSelect(e: Object): string; + onCount(e: Object): string; + beforeSend(dm: ej.DataManager, request: any, settings?: any): void; + processResponse(data: Object, ds: Object, query: ej.Query, xhr:any, request: any, changes: Changes): { + result: Object; count: number + }; + convertToQueryString(req: Object, query: ej.Query, dm: ej.DataManager): JQueryParam; + insert(dm: ej.DataManager, data: Object, tableName: string): { url: string; data: Object; } + remove(dm: ej.DataManager, keyField: string, value: any, tableName: string): { url: string; type: string; } + update(dm: ej.DataManager, keyField: string, value: any, tableName: string): { url: string; type: string; data: Object; accept: string; } + batchRequest(dm: ej.DataManager, changes: Changes, e: any): { url: string; type: string; data: Object; contentType: string; } + generateDeleteRequest(arr: Array, e: any): string; + generateInsertRequest(arr: Array, e: any): string; + generateUpdateRequest(arr: Array, e: any): string; + } + interface UrlAdaptorOptions { + requestType?: string; + accept?: string; + multipartAccept?: string; + sortBy?: string; + select?: string; + skip?: string; + take?: string; + count?: string; + where?: string; + expand?: string; + batch?: string; + changeSet?: string; + batchPre?: string; + contentId?: string; + batchContent?: string; + changeSetContent?: string; + batchChangeSetContentType?: string; + } + + class ODataV4Adaptor extends ej.ODataAdaptor { + constructor(); + options: ODataAdaptorOptions; + onCount(e: Object): string; + onEachSearch(e: Object): void; + onSearch(e: Object): string; + beforeSend(dm: ej.DataManager, request: any, settings?: any): void; + processResponse(data: Object, ds: Object, query: ej.Query, xhr:any, request: any, changes: Changes): { + result: Object; count: number + }; + + } + interface ODataAdaptorOptions { + requestType?: string; + accept?: string; + multipartAccept?: string; + sortBy?: string; + select?: string; + skip?: string; + take?: string; + count?: string; + search?: string; + where?: string; + expand?: string; + batch?: string; + changeSet?: string; + batchPre?: string; + contentId?: string; + batchContent?: string; + changeSetContent?: string; + batchChangeSetContentType?: string; + } + + class JsonAdaptor extends ej.Adaptor { + constructor(); + processQuery(ds: Object, query: ej.Query): string; + batchRequest(dm: ej.DataManager, changes: Changes, e:any): Changes; + onWhere(ds: Object, e: any): any; + onSearch(ds: Object, e: any): any + onSortBy(ds: Object, e: any, query: ej.Query): Object; + onGroup(ds: Object, e: any, query: ej.Query): Object; + onPage(ds: Object, e: any, query: ej.Query): Object; + onRange(ds: Object, e: any): Object; + onTake(ds: Object, e: any): Object; + onSkip(ds: Object, e: any): Object; + onSelect(ds: Object, e: any): Object; + insert(dm: ej.DataManager, data: any): Object; + remove(dm: ej.DataManager, keyField: string, value:any, tableName: string): Object; + update(dm: ej.DataManager, keyField: string, value:any, tableName: string): Object; + } + class TableModel { + constructor(name: string, jsonArray: Array, dataManager: ej.DataManager, modelComputed: any); + on(eventName: string, handler: any): void; + off(eventName: string, handler: any): void; + setDataManager(dataManager: DataManager): void; + saveChanges(): void; + rejectChanges(): void; + insert(json: any): void; + update(value: any): void; + remove(key: string): void; + isDirty(): boolean; + getChanges(): Changes; + toArray(): Array; + setDirty(dirty:any, model:any): void; + get(index: number): void; + length(): number; + bindTo(element: any): void; + } + class Model { + constructor(json: any, table: string, name: string); + formElements: Array; + computes(value: any): void; + on(eventName: string, handler: any): void; + off(eventName: string, handler: any): void; + set(field: string, value: any): void; + get(field: string): any; + revert(suspendEvent: any): void; + save(dm: ej.DataManager, key: string): void; + markCommit(): void; + markDelete(): void; + changeState(state: boolean, args: any): void; + properties(): any; + bindTo(element: any): void; + unbind(element: any): void; + } + interface Changes { + changed?: Array; + added?: Array; + deleted?: Array; + } + class Predicate { + constructor(field: string, operator: ej.FilterOperators, value: any, ignoreCase: boolean); + and(field: string, operator: any, value:any, ignoreCase:boolean): void; + or(field: string, operator: any, value: any, ignoreCase: boolean): void; + validate(record: Object): boolean; + toJSON(): { + isComplex: boolean; + field: string; + operator: string; + value: any; + ignoreCase: boolean; + condition: string; + predicates: any; + }; + } + interface dataUtil { + swap(array: Array, x: number, y: number): void; + mergeSort(jsonArray: Array, fieldName: string, comparer:any): Array; + max(jsonArray: Array, fieldName: string, comparer: string): Array; + min(jsonArray: Array, fieldName: string, comparer: string): Array; + distinct(jsonArray: Array, fieldName: string, requiresCompleteRecord:any): Array; + sum(json:any, fieldName: string): number; + avg(json:any, fieldName: string): number; + select(jsonArray: Array, fieldName: string, fields:string): Array; + group(jsonArray: Array, field: string, /* internal */ level: number): Array; + parseTable(table: string, headerOption: ej.headerOption, headerRowIndex: number): Object; + } + interface AjaxSettings { + type?: string; + cache: boolean; + data?: any; + dataType?: string; + contentType?: any; + async?: boolean; + } + enum FilterOperators { + contains, + endsWith, + equal, + greaterThan, + greaterThanOrEqual, + lessThan, + lessThanOrEqual, + notEqual, + startsWith + } + + enum MatrixDefaults { + m11, + m12, + m21, + m22, + offsetX, + offsetY, + type + } + enum MatrixTypes { + Identity, + Scaling, + Translation, + Unknown + } + + enum Orientation { + Horizontal, + Vertical + } + + enum SliderType { + Default, + MinRange, + Range + } + + enum eventType { + click, + mouseDown, + mouseLeave, + mouseMove, + mouseUp + } + enum headerOption { + row, + tHead + } + + enum filterType{ + StartsWith, + Contains, + EndsWith, + LessThan, + GreaterThan, + LessThanOrEqual , + GreaterThanOrEqual, + Equal, + NotEqual + } + enum Animation{ + Fade, + None, + Slide + } + enum Type{ + Overlay, + Slide + } +class Draggable extends ej.Widget { + static fn: Draggable; + constructor(element: JQuery, options?: DraggableOptions); + constructor(element: Element, options?: DraggableOptions); + model: DraggableOptions; +} + +interface DraggableOptions { + scope?: string; + handle?: Object; + dragArea?: Object; + clone?: boolean; + distance?: number; + helper?: any; + cursorAt?: DragAtPositon; + destroy? (e: DraggableEvent): void; + drag? (e: DraggableDragEvent): void; + dragStart? (e: DraggableDragStartEvent): void; + dragStop? (e: DraggableDragStopEvent): void; + +} + +interface DragAtPositon { + top?: number; + left?: number; +} + +interface DraggableEvent extends ej.BaseEvent { + model: DraggableOptions; +} +interface DraggableDragStartEvent extends ej.BaseEvent, DraggableEvent { + element: Object; + target: Object; +} +interface DraggableDragStopEvent extends ej.BaseEvent, DraggableEvent { + element: Object; + target: Object; +} +interface DraggableDragEvent extends ej.BaseEvent, DraggableEvent { + element: Object; + target: Object; +} +class Droppable extends ej.Widget { + static fn: Droppable; + constructor(element: JQuery, options?: DroppableOptions); + constructor(element: Element, options?: DroppableOptions); + model: DroppableOptions; +} + +interface DroppableOptions { + scope?: string; + accept?: Object; + drop? (e: DroppableDropEvent): void; + over? (e: DroppableOverEvent): void; + out? (e: DroppableOutEvent): void; +} + +interface DroppableEvent extends ej.BaseEvent { + model: DroppableOptions; +} +interface DroppableDropEvent extends ej.BaseEvent, DraggableEvent { + targetElement: Object; +} +interface DroppableOverEvent extends ej.BaseEvent, DraggableEvent { + targetElement: Object; +} +interface DroppableOutEvent extends ej.BaseEvent, DraggableEvent { + targetElement: Object; +} +class Resizable extends ej.Widget { + static fn: Resizable; + constructor(element: JQuery, options?: ResizableOptions); + constructor(element: Element, options?: ResizableOptions); + model: ResizableOptions; +} + +interface ResizableOptions { + scope?: string; + handle?: Object; + distance?: number; + cursorAt?: resizeAtPositon; + helper?: any; + maxHeight?: (number|string); + maxWidth?: (number|string); + minHeight?: (number|string); + minWidth?: (number|string); + destroy? (e: ResizeEvent): void; + resizeStart? (e: ResizableStartEvent): void; + resize? (e: ResizableEvent): void; + resizeStop? (e: ResizableStopEvent): void; +} + +interface resizeAtPositon { + top?: number; + left?: number; +} + +interface ResizeEvent extends ej.BaseEvent { + model: ResizableOptions; +} +interface ResizableStartEvent extends ej.BaseEvent, ResizeEvent { + targetElement: Object; +} +interface ResizableEvent extends ej.BaseEvent, ResizeEvent { + targetElement: Object; +} +interface ResizableStopEvent extends ej.BaseEvent, ResizeEvent { + targetElement: Object; +} + + var globalize:globalize; + var cultures:culture; + function addCulture(name: string, culture ?: any): void; + function preferredCulture(culture ?: string): culture; + function format(value: any, format: string, culture ?: string): string; + function parseInt(value: string, radix?: any, culture ?: string): number; + function parseFloat(value: string, radix?: any, culture ?: string): number; + function parseDate(value: string, format: string, culture ?: string): Date; + function getLocalizedConstants(controlName: string, culture ?: string): any; + +interface globalize { + addCulture(name: string, culture?: any): void; + preferredCulture(culture?: string): culture; + format(value: any, format: string, culture?: string): string; + parseInt(value: string, radix?: any, culture?: string): number; + parseFloat(value: string, radix?: any, culture?: string): number; + parseDate(value: string, format: string, culture?: string): Date; + getLocalizedConstants(controlName: string, culture?: string): any; + } + interface culture { + name?: string; + englishName?: string; + namtiveName?: string; + language?: string; + isRTL: boolean; + numberFormat?: formatSettings; + calendars?: calendarsSettings; + } + interface formatSettings { + pattern: Array; + decimals: number; + groupSizes: Array; + percent: percentSettings; + currency: currencySettings; + } + interface percentSettings { + pattern: Array; + decimals: number; + groupSizes: Array; + symbol: string; + } + interface currencySettings { + pattern: Array; + decimals: number; + groupSizes: Array; + symbol: string; + } + interface calendarsSettings { + standard: standardSettings; + } + interface standardSettings { + firstDay: number; + days: daySettings; + months: monthSettings; + AM: Array; + PM: Array; + twoDigitYearMax: number; + patterns: patternSettings; + } + interface daySettings { + names: Array; + namesAbbr: Array; + namesShort: Array; + } + interface monthSettings { + names: Array; + namesAbbr: Array; + } + interface patternSettings { + d: string; + D: string; + t: string; + T: string; + f: string; + F: string; + M: string; + Y: string; + S: string; + } +class Scroller extends ej.Widget { + static fn: Scroller; + constructor(element: JQuery, options?: Scroller.Model); + constructor(element: Element, options?: Scroller.Model); + model:Scroller.Model; + defaults:Scroller.Model; + + /** destroy the Scroller control, unbind the all ej control related events automatically and bring the control to pre-init state. + * @returns {void} + */ + destroy(): void; + + /** User disables the Scroller control at any time. + * @returns {void} + */ + disable(): void; + + /** User enables the Scroller control at any time. + * @returns {void} + */ + enable(): void; + + /** Returns true if horizontal scrollbar is shown, else return false. + * @returns {boolean} + */ + isHScroll(): boolean; + + /** Returns true if vertical scrollbar is shown, else return false. + * @returns {boolean} + */ + isVScroll(): boolean; + + /** User refreshes the Scroller control at any time. + * @returns {void} + */ + refresh(): void; + + /** Scroller moves to given pixel in X (left) position. We can also specify the animation speed,in which the scroller has to move while re-positioning it. + * @returns {void} + */ + scrollX(): void; + + /** Scroller moves to given pixel in Y (top) position. We can also specify the animation speed,in which the scroller has to move while re-positioning it. + * @returns {void} + */ + scrollY(): void; +} +export module Scroller{ + +export interface Model { + + /**Set true to hides the scrollbar, when mouseout the content area. + * @Default {false} + */ + autoHide?: boolean; + + /**Specifies the height and width of button in the scrollbar. + * @Default {18} + */ + buttonSize?: number; + + /**Specifies to enable or disable the scroller + * @Default {true} + */ + enabled?: boolean; + + /**Save current model value to browser cookies for state maintenance. While refresh the page Rating control values are retained. + * @Default {false} + */ + enablePersistence?: boolean; + + /**Indicates the Right to Left direction to scroller + * @Default {undefined} + */ + enableRTL?: boolean; + + /**Enables or Disable the touch Scroll + * @Default {true} + */ + enableTouchScroll?: boolean; + + /**Specifies the height of Scroll panel and scrollbars. + * @Default {250} + */ + height?: number; + + /**If the scrollbar has vertical it set as width, else it will set as height of the handler. + * @Default {18} + */ + scrollerSize?: number; + + /**The Scroller content and scrollbars move left with given value. + * @Default {0} + */ + scrollLeft?: number; + + /**While press on the arrow key the scrollbar position added to the given pixel value. + * @Default {57} + */ + scrollOneStepBy?: number; + + /**The Scroller content and scrollbars move to top position with specified value. + * @Default {0} + */ + scrollTop?: number; + + /**Indicates the target area to which scroller have to appear. + * @Default {null} + */ + targetPane?: string; + + /**Specifies the width of Scroll panel and scrollbars. + * @Default {0} + */ + width?: number; + + /**Fires when Scroller control is created.*/ + create? (e: CreateEventArgs): void; + + /**Fires when Scroller control is destroyed.*/ + destroy? (e: DestroyEventArgs): void; +} + +export interface CreateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the scroller model + */ + model?: ej.Scroller.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the scroller model + */ + model?: ej.Scroller.Model; + + /**returns the name of the event. + */ + type?: string; +} +} + +class Accordion extends ej.Widget { + static fn: Accordion; + constructor(element: JQuery, options?: Accordion.Model); + constructor(element: Element, options?: Accordion.Model); + model:Accordion.Model; + defaults:Accordion.Model; + + /** AddItem method is used to add the panel in dynamically. It receives the following parameters + * @param {string} specify the name of the header + * @param {string} content of the new panel + * @param {number} insertion place of the new panel + * @param {boolean} Enable or disable the ajax request to the added panel + * @returns {void} + */ + addItem(header_name: string, content: string, index: number, isAjaxReq: boolean): void; + + /** This method used to collapse the all the expanded items in accordion at a time. + * @returns {void} + */ + collapseAll(): void; + + /** destroy the Accordion widget all events bound using this._on will be unbind automatically and bring the control to pre-init state. + * @returns {void} + */ + destroy(): void; + + /** Disables the accordion widget includes all the headers and content panels. + * @returns {void} + */ + disable(): void; + + /** Disable the accordion widget item based on specified header index. + * @param {Array} index values to disable the panels + * @returns {void} + */ + disableItems(index: Array): void; + + /** Enable the accordion widget includes all the headers and content panels. + * @returns {void} + */ + enable(): void; + + /** Enable the accordion widget item based on specified header index. + * @param {Array} index values to enable the panels + * @returns {void} + */ + enableItems(index: Array): void; + + /** To expand all the accordion widget items. + * @returns {void} + */ + expandAll(): void; + + /** Returns the total number of panels in the control. + * @returns {number} + */ + getItemsCount(): number; + + /** Hides the visible Accordion control. + * @returns {void} + */ + hide(): void; + + /** The refresh method is used to adjust the control size based on the parent element dimension. + * @returns {void} + */ + refresh(): void; + + /** RemoveItem method is used to remove the specified index panel.It receives the parameter as number. + * @param {number} specify the index value for remove the accordion panel. + * @returns {void} + */ + removeItem( index : number): void; + + /** Shows the hidden Accordion control. + * @returns {void} + */ + show(): void; +} +export module Accordion{ + +export interface Model { + + /**Specifies the ajaxSettings option to load the content to the accordion control. + * @Default {null} + */ + ajaxSettings?: AjaxSettings; + + /**Accordion headers can be expanded and collapsed on keyboard action. + * @Default {true} + */ + allowKeyboardNavigation?: boolean; + + /**To set the Accordion headers Collapse Speed. + * @Default {300} + */ + collapseSpeed?: number; + + /**Specifies the collapsible state of accordion control. + * @Default {false} + */ + collapsible?: boolean; + + /**Sets the root CSS class for Accordion theme, which is used customize. + */ + cssClass?: string; + + /**Allows you to set the custom header Icon. It accepts two key values “header”, ”selectedHeader”. + * @Default {{ header: e-collapse, selectedHeader: e-expand }} + */ + customIcon?: CustomIcon; + + /**Disables the specified indexed items in accordion. + * @Default {[]} + */ + disabledItems?: number[]; + + /**Specifies the animation behavior in accordion. + * @Default {true} + */ + enableAnimation?: boolean; + + /**With this enabled property, you can enable or disable the Accordion. + * @Default {true} + */ + enabled?: boolean; + + /**Used to enable the disabled items in accordion. + * @Default {[]} + */ + enabledItems?: number[]; + + /**Multiple content panels to activate at a time. + * @Default {false} + */ + enableMultipleOpen?: boolean; + + /**Save current model value to browser cookies for maintaining states. When refreshing the accordion control page, the model value is applied from browser cookies or HTML 5local storage. + * @Default {false} + */ + enablePersistence?: boolean; + + /**Display headers and panel text from right-to-left. + * @Default {false} + */ + enableRTL?: boolean; + + /**The events API binds the action for activating the accordion header. Users can activate the header by using mouse actions such as mouse-over, mouse-up, mouse-down, and soon. + * @Default {click} + */ + events?: string; + + /**To set the Accordion headers Expand Speed. + * @Default {300} + */ + expandSpeed?: number; + + /**Sets the height for Accordion items header. + */ + headerSize?: number|string; + + /**Specifies height of the accordion. + * @Default {null} + */ + height?: number|string; + + /**Adjusts the content panel height based on the given option (content, auto, or fill). By default, the panel heights are adjusted based on the content. + * @Default {content} + */ + heightAdjustMode?: ej.Accordion.HeightAdjustMode|string; + + /**It allows to define the characteristics of the Accordion control. It will helps to extend the capability of an HTML element. + * @Default {{}} + */ + htmlAttributes?: any; + + /**The given index header will activate (open). If collapsible is set to true, and a negative value is given, then all headers are collapsed. Otherwise, the first panel isactivated. + * @Default {0} + */ + selectedItemIndex?: number|string; + + /**Activate the specified indexed items of the accordion + * @Default {[0]} + */ + selectedItems?: number[]; + + /**Used to determines the close button visibility an each accordion items. This close button helps to remove the accordion item from the control. + * @Default {false} + */ + showCloseButton?: boolean; + + /**Displays rounded corner borders on the Accordion control's panels and headers. + * @Default {false} + */ + showRoundedCorner?: boolean; + + /**Specifies width of the accordion. + * @Default {null} + */ + width?: number|string; + + /**Triggered after a Accordion item is active or inactive. Argument values are activeIndex, activeHeader, inActiveHeader, inActiveIndex and current model value.*/ + activate? (e: ActivateEventArgs): void; + + /**Triggered before the AJAX content is loaded in a content panel. Arguments have location of the content (URL) and current model value.*/ + ajaxBeforeLoad? (e: AjaxBeforeLoadEventArgs): void; + + /**Triggered after AJAX load failed action. Arguments have URL, error message, and current model value.*/ + ajaxError? (e: AjaxErrorEventArgs): void; + + /**Triggered after the AJAX content loads. Arguments have current model values.*/ + ajaxLoad? (e: AjaxLoadEventArgs): void; + + /**Triggered after AJAX success action. Arguments have URL, content, and current model values.*/ + ajaxSuccess? (e: AjaxSuccessEventArgs): void; + + /**Triggered before a tab item is active. Arguments have active index and model values.*/ + beforeActivate? (e: BeforeActivateEventArgs): void; + + /**Triggered after a Accordion item is active or inactive. Argument values are activeIndex, activeHeader, inActiveHeader, inActiveIndex and current model value.*/ + beforeInactivate? (e: BeforeInactivateEventArgs): void; + + /**Triggered after Accordion control creation.*/ + create? (e: CreateEventArgs): void; + + /**Triggered after Accordion control destroy.*/ + destroy? (e: DestroyEventArgs): void; + + /**Triggered after a Accordion item is active or inactive. Argument values are activeIndex, activeHeader, inActiveHeader, inActiveIndex and current model value.*/ + inActivate? (e: InActivateEventArgs): void; +} + +export interface ActivateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the accordion model + */ + model ?: ej.Accordion.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns active index + */ + activeIndex ?: number; + + /**returns current active header + */ + activeHeader ?: any; + + /**returns true when the Accordion index activated by user interaction otherwise returns false + */ + isInteraction ?: boolean; +} + +export interface AjaxBeforeLoadEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the accordion model + */ + model ?: ej.Accordion.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns current ajax content location + */ + url ?: string; +} + +export interface AjaxErrorEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the accordion model + */ + model ?: ej.Accordion.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns current ajax content location + */ + url ?: string; + + /**returns the failed data sent. + */ + data ?: string; +} + +export interface AjaxLoadEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the accordion model + */ + model ?: ej.Accordion.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the name of the url + */ + url ?: string; +} + +export interface AjaxSuccessEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the accordion model + */ + model ?: ej.Accordion.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns current ajax content location + */ + url ?: string; + + /**returns the successful data sent. + */ + data ?: string; + + /**returns the ajax content. + */ + content ?: string; +} + +export interface BeforeActivateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the accordion model + */ + model ?: ej.Accordion.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns active index + */ + activeIndex ?: number; + + /**returns true when the Accordion index activated by user interaction otherwise returns false + */ + isInteraction ?: boolean; +} + +export interface BeforeInactivateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the accordion model + */ + model ?: ej.Accordion.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns active index + */ + inActiveIndex ?: number; + + /**returns true when the Accordion index activated by user interaction otherwise returns false + */ + isInteraction ?: boolean; +} + +export interface CreateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the accordion model + */ + model ?: ej.Accordion.Model; + + /**returns the name of the event + */ + type ?: string; +} + +export interface DestroyEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the accordion model + */ + model ?: ej.Accordion.Model; + + /**returns the name of the event + */ + type ?: string; +} + +export interface InActivateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the accordion model + */ + model ?: ej.Accordion.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns active index + */ + inActiveIndex ?: number; + + /**returns in active element + */ + inActiveHeader ?: any; + + /**returns true when the Accordion index activated by user interaction otherwise returns false + */ + isInteraction ?: boolean; +} + +export interface AjaxSettings { + + /**It specifies, whether to enable or disable asynchronous request. + */ + async?: boolean; + + /**It specifies the page will be cached in the web browser. + */ + cache?: boolean; + + /**It specifies the type of data is send in the query string. + */ + contentType?: string; + + /**It specifies the data as an object, will be passed in the query string. + */ + data?: any; + + /**It specifies the type of data that you're expecting back from the response. + */ + dataType?: string; + + /**It specifies the HTTP request type. + */ + type?: string; +} + +export interface CustomIcon { + + /**This class name set to collapsing header. + */ + header?: string; + + /**This class name set to expanded (active) header. + */ + selectedHeader?: string; +} + +enum HeightAdjustMode{ + + ///Height fit to the content in the panel + Content, + + ///Height set to the largest content in the panel + Auto, + + ///Height filled to the content of the panel + Fill +} + +} + +class Autocomplete extends ej.Widget { + static fn: Autocomplete; + constructor(element: JQuery, options?: Autocomplete.Model); + constructor(element: Element, options?: Autocomplete.Model); + model:Autocomplete.Model; + defaults:Autocomplete.Model; + + /** Clears the text in the Autocomplete textbox. + * @returns {void} + */ + clearText(): void; + + /** Destroys the Autocomplete widget. + * @returns {void} + */ + destroy(): void; + + /** Disables the autocomplete widget. + * @returns {void} + */ + disable(): void; + + /** Enables the autocomplete widget. + * @returns {void} + */ + enable(): void; + + /** Returns objects (data object) of all the selected items in the autocomplete textbox. + * @returns {void} + */ + getSelectedItems(): void; + + /** Returns the current selected value from the Autocomplete textbox. + * @returns {void} + */ + getValue(): void; + + /** Search the entered text and show it in the suggestion list if available. + * @returns {void} + */ + search(): void; + + /** Open up the autocomplete suggestion popup with all list items. + * @returns {void} + */ + open(): void; + + /** Sets the value of the Autocomplete textbox based on the given key value. + * @param {string} The key value of the specific suggestion item. + * @returns {void} + */ + selectValueByKey(Key: string): void; + + /** Sets the value of the Autocomplete textbox based on the given input text value. + * @param {string} The text (label) value of the specific suggestion item. + * @returns {void} + */ + selectValueByText(Text: string): void; +} +export module Autocomplete{ + +export interface Model { + + /**Customize "Add New" text (label) to be added in the autocomplete popup list for the entered text when there are no suggestions for it. + * @Default {Add New} + */ + addNewText?: boolean; + + /**Allows new values to be added to the autocomplete input other than the values in the suggestion list. Normally, when there are no suggestions it will display “No suggestions” label in the popup. + * @Default {false} + */ + allowAddNew?: boolean; + + /**Enables or disables the sorting of suggestion list item. The default sort order is ascending order. You customize sort order. + * @Default {true} + */ + allowSorting?: boolean; + + /**To focus the items in the suggestion list when the popup is shown. By default first item will be focused. + * @Default {false} + */ + autoFocus?: boolean; + + /**Enables or disables the case sensitive search. + * @Default {false} + */ + caseSensitiveSearch?: boolean; + + /**The root class for the Autocomplete textbox widget which helps in customizing its theme. + * @Default {””} + */ + cssClass?: string; + + /**The data source contains the list of data for the suggestions list. It can be a string array or json array. + * @Default {null} + */ + dataSource?: any|Array; + + /**The time delay (in milliseconds) after which the suggestion popup will be shown. + * @Default {200} + */ + delaySuggestionTimeout?: number; + + /**The special character which acts as a separator for the given words for multi-mode search i.e. the text after the delimiter are considered as a separate word or query for search operation. + * @Default {’,’} + */ + delimiterChar?: string; + + /**The text to be displayed in the popup when there are no suggestions available for the entered text. + * @Default {“No suggestions”} + */ + emptyResultText?: string; + + /**Fills the autocomplete textbox with the first matched item from the suggestion list automatically based on the entered text when enabled. + * @Default {false} + */ + enableAutoFill?: boolean; + + /**Enables or disables the Autocomplete textbox widget. + * @Default {true} + */ + enabled?: boolean; + + /**Enables or disables displaying the duplicate names present in the search result. + * @Default {false} + */ + enableDistinct?: boolean; + + /**Allows the current model values to be saved in local storage or browser cookies for state maintenance when it is set to true. While refreshing the page, it retains the model value from browser cookies or local storage. + * @Default {false} + */ + enablePersistence?: boolean; + + /**Displays the Autocomplete widget’s content from right to left when enabled. + * @Default {false} + */ + enableRTL?: boolean; + + /**Mapping fields for the suggestion items of the Autocomplete textbox widget. + * @Default {null} + */ + fields?: any; + + /**Specifies the search filter type. There are several types of search filter available such as ‘startswith’, ‘contains’, ‘endswith’, ‘lessthan’, ‘lessthanorequal’, ‘greaterthan’, ‘greaterthanorequal’, ‘equal’, ‘notequal’. + * @Default {ej.filterType.StartsWith} + */ + filterType?: string; + + /**The height of the Autocomplete textbox. + * @Default {null} + */ + height?: string; + + /**The search text can be highlighted in the AutoComplete suggestion list when enabled. + * @Default {false} + */ + highlightSearch?: boolean; + + /**Number of items to be displayed in the suggestion list. + * @Default {0} + */ + itemsCount?: number; + + /**Minimum number of character to be entered in the Autocomplete textbox to show the suggestion list. + * @Default {1} + */ + minCharacter?: number; + + /**Enables or disables selecting multiple values from the suggestion list. Multiple values can be selected through either of the following options, + * @Default {ej.MultiSelectMode.None} + */ + multiSelectMode?: ej.Autocomplete.MultiSelectMode|string; + + /**The height of the suggestion list. + * @Default {“152px”} + */ + popupHeight?: string; + + /**The width of the suggestion list. + * @Default {“auto”} + */ + popupWidth?: string; + + /**The query to retrieve the data from the data source. + * @Default {null} + */ + query?: ej.Query|string; + + /**Indicates that the autocomplete textbox values can only be readable. + * @Default {false} + */ + readOnly?: boolean; + + /**Enables or disables showing the message when there are no suggestions for the entered text. + * @Default {true} + */ + showEmptyResultText?: boolean; + + /**Enables or disables the loading icon to intimate the searching operation. The loading icon is visible when there is a time delay to perform the search. + * @Default {true} + */ + showLoadingIcon?: boolean; + + /**Enables the showPopup button in autocomplete textbox. When the Showpopup button is clicked, it displays all the available data from the data source. + * @Default {false} + */ + showPopupButton?: boolean; + + /**Enables or disables rounded corner. + * @Default {false} + */ + showRoundedCorner?: boolean; + + /**Sort order specifies whether the suggestion list values has to be displayed in ascending or descending order. + * @Default {ej.SortOrder.Ascending} + */ + sortOrder?: ej.Autocomplete.SortOrder|string; + + /**The template to display the suggestion list items with customized appearance. + * @Default {null} + */ + template?: string; + + /**The jQuery validation error message to be displayed on form validation. + * @Default {null} + */ + validationMessage?: any; + + /**The jQuery validation rules for form validation. + * @Default {null} + */ + validationRules?: any; + + /**The value to be displayed in the autocomplete textbox. + * @Default {null} + */ + value?: string; + + /**Enables or disables the visibility of the autocomplete textbox. + * @Default {true} + */ + visible?: boolean; + + /**The text to be displayed when the value of the autocomplete textbox is empty. + * @Default {null} + */ + watermarkText?: string; + + /**The width of the Autocomplete textbox. + * @Default {null} + */ + width?: string; + + /**Triggers when the data requested from AJAX will get successfully loaded in the Autocomplete widget.*/ + actionSuccess? (e: ActionSuccessEventArgs): void; + + /**Triggers when the AJAX requests complete. The request may get failed or succeed.*/ + actionComplete? (e: ActionCompleteEventArgs): void; + + /**Triggers when the data requested from AJAX get failed.*/ + actionFailure? (e: ActionFailureEventArgs): void; + + /**Triggers when the text box value is changed.*/ + change? (e: ChangeEventArgs): void; + + /**Triggers after the suggestion popup is closed.*/ + close? (e: CloseEventArgs): void; + + /**Triggers when Autocomplete widget is created.*/ + create? (e: CreateEventArgs): void; + + /**Triggers after the Autocomplete widget is destroyed.*/ + destroy? (e: DestroyEventArgs): void; + + /**Triggers after the autocomplete textbox is focused.*/ + focusIn? (e: FocusInEventArgs): void; + + /**Triggers after the Autocomplete textbox gets out of the focus.*/ + focusOut? (e: FocusOutEventArgs): void; + + /**Triggers after the suggestion list is opened.*/ + open? (e: OpenEventArgs): void; + + /**Triggers when an item has been selected from the suggestion list.*/ + select? (e: SelectEventArgs): void; +} + +export interface ActionSuccessEventArgs { +} + +export interface ActionCompleteEventArgs { +} + +export interface ActionFailureEventArgs { +} + +export interface ChangeEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the autocomplete model object. + */ + model?: any; + + /**Name of the event. + */ + type?: string; + + /**Value of the autocomplete textbox. + */ + value?: string; +} + +export interface CloseEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the autocomplete model object. + */ + model?: any; + + /**Name of the event. + */ + type?: string; +} + +export interface CreateEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the autocomplete model object. + */ + model?: ej.Autocomplete.Model; + + /**Name of the event. + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the autocomplete model object. + */ + model?: ej.Autocomplete.Model; + + /**Name of the event. + */ + type?: string; +} + +export interface FocusInEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the autocomplete model object. + */ + model?: ej.Autocomplete.Model; + + /**Name of the event. + */ + type?: string; + + /**Value of the autocomplete textbox. + */ + value?: string; +} + +export interface FocusOutEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the autocomplete model object. + */ + model?: ej.Autocomplete.Model; + + /**Name of the event. + */ + type?: string; + + /**Value of the autocomplete textbox. + */ + value?: string; +} + +export interface OpenEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the autocomplete model object. + */ + model?: ej.Autocomplete.Model; + + /**Name of the event. + */ + type?: string; +} + +export interface SelectEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the autocomplete model object. + */ + model?: ej.Autocomplete.Model; + + /**Name of the event. + */ + type?: string; + + /**Value of the autocomplete textbox. + */ + value?: string; + + /**Text of the selected item. + */ + text?: string; + + /**Key of the selected item. + */ + key?: string; + + /**Data object of the selected item. + */ + Item?: ej.Autocomplete.Model; +} + +enum MultiSelectMode{ + + ///Multiple values are separated using a given special character. + Delimiter, + + ///Each values are displayed in separate box with close button. + VisualMode +} + + +enum SortOrder{ + + ///Items to be displayed in the suggestion list in ascending order. + Ascending, + + ///Items to be displayed in the suggestion list in descending order. + Descending +} + +} + +class Button extends ej.Widget { + static fn: Button; + constructor(element: JQuery, options?: Button.Model); + constructor(element: Element, options?: Button.Model); + model:Button.Model; + defaults:Button.Model; + + /** destroy the button widget all events bound using this._on will be unbind automatically and bring the control to pre-init state. + * @returns {void} + */ + destroy(): void; + + /** To disable the button + * @returns {void} + */ + disable(): void; + + /** To enable the button + * @returns {void} + */ + enable(): void; +} +export module Button{ + +export interface Model { + + /**Specifies the contentType of the Button. See below to know available ContentType + * @Default {ej.ContentType.TextOnly} + */ + contentType?: ej.ContentType|string; + + /**Sets the root CSS class for Button theme, which is used customize. + */ + cssClass?: string; + + /**Specifies the button control state. + * @Default {true} + */ + enabled?: boolean; + + /**Specify the Right to Left direction to button + * @Default {false} + */ + enableRTL?: boolean; + + /**Specifies the height of the Button. + * @Default {28} + */ + height?: number; + + /**It allows to define the characteristics of the Button control. It will helps to extend the capability of an HTML element. + * @Default {{}} + */ + htmlAttributes?: any; + + /**Specifies the image position of the Button. This image position is applicable only with the textandimage contentType property. The images can be positioned in both imageLeft and imageRight options. See below to know about available ImagePosition + * @Default {ej.ImagePosition.ImageLeft} + */ + imagePosition?: ej.ImagePosition|string; + + /**Specifies the primary icon for Button. This icon will be displayed from the left margin of the button. + * @Default {null} + */ + prefixIcon?: string; + + /**Convert the button as repeat button. It raises the 'Click' event repeatedly from the it is pressed until it is released. + * @Default {false} + */ + repeatButton?: boolean; + + /**Displays the Button with rounded corners. + * @Default {false} + */ + showRoundedCorner?: boolean; + + /**Specifies the size of the Button. See below to know available ButtonSize + * @Default {ej.ButtonSize.Normal} + */ + size?: ej.ButtonSize|string; + + /**Specifies the secondary icon for Button. This icon will be displayed from the right margin of the button. + * @Default {null} + */ + suffixIcon?: string; + + /**Specifies the text content for Button. + * @Default {null} + */ + text?: string; + + /**Specified the time interval between two consecutive 'click' event on the button. + * @Default {150} + */ + timeInterval?: string; + + /**Specifies the Type of the Button. See below to know available ButtonType + * @Default {ej.ButtonType.Submit} + */ + type?: ej.ButtonType|string; + + /**Specifies the width of the Button. + * @Default {100} + */ + width?: number; + + /**Fires when Button control is clicked successfully.Consider the scenario to perform any validation,modification of content or any other operations click on button,we can make use of this click event to achieve the scenario.*/ + click? (e: ClickEventArgs): void; + + /**Fires after Button control is created.If the user want to perform any operation after the button control creation then the user can make use of this create event.*/ + create? (e: CreateEventArgs): void; + + /**Fires when the button is destroyed successfully.If the user want to perform any operation after the destroy button control then the user can make use of this destroy event.*/ + destroy? (e: DestroyEventArgs): void; +} + +export interface ClickEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the button model + */ + model?: ej.Button.Model; + + /**returns the name of the event + */ + type?: string; + + /**return the button state + */ + status?: boolean; + + /**return the event model for sever side processing. + */ + e?: any; +} + +export interface CreateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the button model + */ + model?: ej.Button.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the button model + */ + model?: ej.Button.Model; + + /**returns the name of the event + */ + type?: string; +} +} +enum ContentType +{ +//To display the text content only in button +TextOnly, +//To display the image only in button +ImageOnly, +//Supports to display image for both ends of the button +ImageBoth, +//Supports to display image with the text content +TextAndImage, +//Supports to display image with both ends of the text +ImageTextImage, +} +enum ImagePosition +{ +//support for aligning text in left and image in right +ImageRight, +//support for aligning text in right and image in left +ImageLeft, +//support for aligning text in bottom and image in top. +ImageTop, +//support for aligning text in top and image in bottom +ImageBottom, +} +enum ButtonSize +{ +//Creates button with inbuilt default size height, width specified +Normal, +//Creates button with inbuilt mini size height, width specified +Mini, +//Creates button with inbuilt small size height, width specified +Small, +//Creates button with inbuilt medium size height, width specified +Medium, +//Creates button with inbuilt large size height, width specified +Large, +} +enum ButtonType +{ +//Creates button with inbuilt button type specified +Button, +//Creates button with inbuilt reset type specified +Reset, +//Creates button with inbuilt submit type specified +Submit, +} + +class Captcha extends ej.Widget { + static fn: Captcha; + constructor(element: JQuery, options?: Captcha.Model); + constructor(element: Element, options?: Captcha.Model); + model:Captcha.Model; + defaults:Captcha.Model; +} +export module Captcha{ + +export interface Model { + + /**Specifies the character set of the Captcha that will be used to generate captcha text randomly. + */ + characterSet?: string; + + /**Specifies the error message to be displayed when the Captcha mismatch. + */ + customErrorMessage?: string; + + /**Set the Captcha validation automatically. + */ + enableAutoValidation?: boolean; + + /**Specifies the case sensitivity for the characters typed in the Captcha. + */ + enableCaseSensitivity?: boolean; + + /**Specifies the background patterns for the Captcha. + */ + enablePattern?: boolean; + + /**Sets the Captcha direction as right to left alignment. + */ + enableRTL?: boolean; + + /**Specifies the background apperance for the captcha. + */ + hatchStyle?: ej.HatchStyle|string; + + /**Specifies the height of the Captcha. + */ + height?: number; + + /**Specifies the method with values to be mapped in the Captcha. + */ + mapper?: string; + + /**Specifies the maximum number of characters used in the Captcha. + */ + maximumLength?: number; + + /**Specifies the minimum number of characters used in the Captcha. + */ + minimumLength?: number; + + /**Specifies the method to map values to Captcha. + */ + requestMapper?: string; + + /**Sets the Captcha with audio support, that enables to dictate the captcha text. + */ + showAudioButton?: boolean; + + /**Sets the Captcha with a refresh button. + */ + showRefreshButton?: boolean; + + /**Specifies the target button of the Captcha to validate the entered text and captcha text. + */ + targetButton?: string; + + /**Specifies the target input element that will verify the Captcha. + */ + targetInput?: string; + + /**Specifies the width of the Captcha. + */ + width?: number; + + /**Fires when captch refresh begins.*/ + refreshBegin? (e: RefreshBeginEventArgs): void; + + /**Fires after captch refresh completed.*/ + refreshComplete? (e: RefreshCompleteEventArgs): void; + + /**Fires when captch refresh fails to load.*/ + refreshFailure? (e: RefreshFailureEventArgs): void; + + /**Fires after captch refresh succeeded.*/ + refreshSuccess? (e: RefreshSuccessEventArgs): void; +} + +export interface RefreshBeginEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the Captcha model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface RefreshCompleteEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the Captcha model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface RefreshFailureEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the Captcha model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface RefreshSuccessEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the Captcha model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; +} +} +enum HatchStyle +{ +//Set background as None to Captcha +None, +//Set background as BackwardDiagonal to Captcha +BackwardDiagonal, +//Set background as Cross to Captcha +Cross, +//Set background as DarkDownwardDiagonal to Captcha +DarkDownwardDiagonal, +//Set background as DarkHorizontal to Captcha +DarkHorizontal, +//Set background as DarkUpwardDiagonal to Captcha +DarkUpwardDiagonal, +//Set background as DarkVertical to Captcha +DarkVertical, +//Set background as DashedDownwardDiagonal to Captcha +DashedDownwardDiagonal, +//Set background as DashedHorizontal to Captcha +DashedHorizontal, +//Set background as DashedUpwardDiagonal to Captcha +DashedUpwardDiagonal, +//Set background as DashedVertical to Captcha +DashedVertical, +//Set background as DiagonalBrick to Captcha +DiagonalBrick, +//Set background as DiagonalCross to Captcha +DiagonalCross, +//Set background as Divot to Captcha +Divot, +//Set background as DottedDiamond to Captcha +DottedDiamond, +//Set background as DottedGrid to Captcha +DottedGrid, +//Set background as ForwardDiagonal to Captcha +ForwardDiagonal, +//Set background as Horizontal to Captcha +Horizontal, +//Set background as HorizontalBrick to Captcha +HorizontalBrick, +//Set background as LargeCheckerBoard to Captcha +LargeCheckerBoard, +//Set background as LargeConfetti to Captcha +LargeConfetti, +//Set background as LargeGrid to Captcha +LargeGrid, +//Set background as LightDownwardDiagonal to Captcha +LightDownwardDiagonal, +//Set background as LightHorizontal to Captcha +LightHorizontal, +//Set background as LightUpwardDiagonal to Captcha +LightUpwardDiagonal, +//Set background as LightVertical to Captcha +LightVertical, +//Set background as Max to Captcha +Max, +//Set background as Min to Captcha +Min, +//Set background as NarrowHorizontal to Captcha +NarrowHorizontal, +//Set background as NarrowVertical to Captcha +NarrowVertical, +//Set background as OutlinedDiamond to Captcha +OutlinedDiamond, +//Set background as Percent90 to Captcha +Percent90, +//Set background as Wave to Captcha +Wave, +//Set background as Weave to Captcha +Weave, +//Set background as WideDownwardDiagonal to Captcha +WideDownwardDiagonal, +//Set background as WideUpwardDiagonal to Captcha +WideUpwardDiagonal, +//Set background as ZigZag to Captcha +ZigZag, +} + +class ListBox extends ej.Widget { + static fn: ListBox; + constructor(element: JQuery, options?: ListBox.Model); + constructor(element: Element, options?: ListBox.Model); + model:ListBox.Model; + defaults:ListBox.Model; + + /** Adds a given list items in the ListBox widget at a specified index. It accepts two parameters. + * @param {any|string} This can be a list item object (for JSON binding) or a string (for UL and LI rendering). Also we can the specify this as an array of list item object or an array of strings to add multiple items. + * @param {number} The index value to add the given items at the specified index. If index is not specified, the given items will be added at the end of the list. + * @returns {void} + */ + addItem(listItem: any|string, index: number): void; + + /** Checks all the list items in the ListBox widget. It is dependent on showCheckbox property. + * @returns {void} + */ + checkAll(): void; + + /** Checks a list item by using its index. It is dependent on showCheckbox property. + * @param {number} Index of the listbox item to be checked. If index is not specified, the given items will be added at the end of the list. + * @returns {void} + */ + checkItemByIndex(index: number): void; + + /** Checks multiple list items by using its index values. It is dependent on showCheckbox property. + * @param {number[]} Index/Indices of the listbox items to be checked. If index is not specified, the given items will be added at the end of the list. + * @returns {void} + */ + checkItemsByIndices(indices: number[]): void; + + /** Disables the ListBox widget. + * @returns {void} + */ + disable(): void; + + /** Disables a list item by passing the item text as parameter. + * @param {string} Text of the listbox item to be disabled. + * @returns {void} + */ + disableItem(text: string): void; + + /** Disables a list Item using its index value. + * @param {number} Index of the listbox item to be disabled. + * @returns {void} + */ + disableItemByIndex(index: number): void; + + /** Disables set of list Items using its index values. + * @param {number[]|string} Indices of the listbox items to be disabled. + * @returns {void} + */ + disableItemsByIndices(Indices: number[]|string): void; + + /** Enables the ListBox widget when it is disabled. + * @returns {void} + */ + enable(): void; + + /** Enables a list Item using its item text value. + * @param {string} Text of the listbox item to be enabled. + * @returns {void} + */ + enableItem(text: string): void; + + /** Enables a list item using its index value. + * @param {number} Index of the listbox item to be enabled. + * @returns {void} + */ + enableItemByIndex(index: number): void; + + /** Enables a set of list Items using its index values. + * @param {number[]|string} Indices of the listbox items to be enabled. + * @returns {void} + */ + enableItemsByIndices(indices: number[]|string): void; + + /** Returns the list of checked items in the ListBox widget. It is dependent on showCheckbox property. + * @returns {any} + */ + getCheckedItems(): any; + + /** Returns the list of selected items in the ListBox widget. + * @returns {any} + */ + getSelectedItems(): any; + + /** Returns an item’s index based on the given text. + * @param {string} The list item text (label) + * @returns {number} + */ + getIndexByText(text: string): number; + + /** Returns an item’s index based on the value given. + * @param {string} The list item’s value + * @returns {number} + */ + getIndexByValue(indices: string): number; + + /** Returns an item’s text (label) based on the index given. + * @returns {string} + */ + getTextByIndex(): string; + + /** Returns a list item’s object using its index. + * @returns {any} + */ + getItemByIndex(): any; + + /** Returns a list item’s object based on the text given. + * @param {string} The list item text. + * @returns {any} + */ + getItemByText(text: string): any; + + /** Merges the given data with the existing data items in the listbox. + * @param {Array} Data to merge in listbox. + * @returns {void} + */ + mergeData(data: Array): void; + + /** Selects the next item based on the current selection. + * @returns {void} + */ + moveDown(): void; + + /** Selects the previous item based on the current selection. + * @returns {void} + */ + moveUp(): void; + + /** Refreshes the ListBox widget. + * @param {boolean} Refreshes both the datasource and the dimensions of the ListBox widget when the parameter is passed as true, otherwise only the ListBox dimensions will be refreshed. + * @returns {void} + */ + refresh(refreshData: boolean): void; + + /** Removes all the list items from listbox. + * @returns {void} + */ + removeAll(): void; + + /** Removes the selected list items from the listbox. + * @returns {void} + */ + removeSelectedItems(): void; + + /** Removes a list item by using its text. + * @param {string} Text of the listbox item to be removed. + * @returns {void} + */ + removeItemByText(text: string): void; + + /** Removes a list item by using its index value. + * @param {number} Index of the listbox item to be removed. + * @returns {void} + */ + removeItemByIndex(index: number): void; + + /** + * @returns {void} + */ + selectAll(): void; + + /** Selects the list tem using its text value. + * @param {string} Text of the listbox item to be selected. + * @returns {void} + */ + selectItemByText(text: string): void; + + /** Selects list tem using its value property. + * @param {string} Value of the listbox item to be selected. + * @returns {void} + */ + selectItemByValue(value: string): void; + + /** Selects list item using its index value. + * @param {number} Index of the listbox item to be selected. + * @returns {void} + */ + selectItemByIndex(index: number): void; + + /** Selects a set of list items through its index values. + * @param {number|number[]} Index/Indices of the listbox item to be selected. + * @returns {void} + */ + selectItemsByIndices(Indices: number|number[]): void; + + /** Unchecks all the checked list items in the ListBox widget. To use this method showCheckbox property to be set as true. + * @returns {void} + */ + uncheckAll(): void; + + /** Unchecks a checked list item using its index value. To use this method showCheckbox property to be set as true. + * @param {number} Index of the listbox item to be unchecked. + * @returns {void} + */ + uncheckItemByIndex(index: number): void; + + /** Unchecks the set of checked list items using its index values. To use this method showCheckbox property must be set to true. + * @param {number[]|string} Indices of the listbox item to be unchecked. + * @returns {void} + */ + uncheckItemsByIndices(indices: number[]|string): void; + + /** + * @returns {void} + */ + unselectAll(): void; + + /** Unselects a selected list item using its index value + * @param {number} Index of the listbox item to be unselected. + * @returns {void} + */ + unselectItemByIndex(index: number): void; + + /** Unselects a selected list item using its text value. + * @param {string} Text of the listbox item to be unselected. + * @returns {void} + */ + unselectItemByText(text: string): void; + + /** Unselects a selected list item using its value. + * @param {string} Value of the listbox item to be unselected. + * @returns {void} + */ + unselectItemByValue(value: string): void; + + /** Unselects a set of list items using its index values. + * @param {number[]|string} Indices of the listbox item to be unselected. + * @returns {void} + */ + unselectItemsByIndices(indices: number[]|string): void; + + /** Hides all the checked items in the listbox. + * @returns {void} + */ + hideCheckedItems (): void; + + /** Shows a set of hidden list Items using its index values. + * @param {number[]|string} Indices of the listbox items to be shown. + * @returns {void} + */ + showItemByIndices(indices: number[]|string): void; + + /** Hides a set of list Items using its index values. + * @param {number[]|string} Indices of the listbox items to be hidden. + * @returns {void} + */ + hideItemsByIndices(indices: number[]|string): void; + + /** Shows the hidden list items using its values. + * @param {Array} Values of the listbox items to be shown. + * @returns {void} + */ + showItemsByValues(values: Array): void; + + /** Hides the list item using its values. + * @param {Array} Values of the listbox items to be hidden. + * @returns {void} + */ + hideItemsByValues(values: Array): void; + + /** Shows a hidden list item using its value. + * @param {string} Value of the listbox item to be shown. + * @returns {void} + */ + showItemByValue(value: string): void; + + /** Hide a list item using its value. + * @param {string} Value of the listbox item to be hidden. + * @returns {void} + */ + hideItemByValue(value: string): void; + + /** Shows a hidden list item using its index value. + * @param {number} Index of the listbox item to be shown. + * @returns {void} + */ + showItemByIndex(index: number): void; + + /** Hides a list item using its index value. + * @param {number} Index of the listbox item to be hidden. + * @returns {void} + */ + hideItemByIndex (index: number): void; + + /** + * @returns {void} + */ + show(): void; + + /** Hides the listbox. + * @returns {void} + */ + hide(): void; + + /** Hides all the listbox items in the listbox. + * @returns {void} + */ + hideAllItems(): void; + + /** Shows all the listbox items in the listbox. + * @returns {void} + */ + showAllItems(): void; +} +export module ListBox{ + +export interface Model { + + /**Enables/disables the dragging behavior of the items in ListBox widget. + * @Default {false} + */ + allowDrag?: boolean; + + /**Accepts the items which are dropped in to it, when it is set to true. + * @Default {false} + */ + allowDrop?: boolean; + + /**Enables or disables multiple selection. + * @Default {false} + */ + allowMultiSelection?: boolean; + + /**Loads the list data on demand via scrolling behavior to improve the application’s performance. There are two ways to load data which can be defined using “virtualScrollMode” property. + * @Default {false} + */ + allowVirtualScrolling?: boolean; + + /**Enables or disables the case sensitive search for list item by typing the text (search) value. + * @Default {false} + */ + caseSensitiveSearch?: boolean; + + /**Dynamically populate data of a list box while selecting an item in another list box i.e. rendering child list box based on the item selection in parent list box. This property accepts the id of the child ListBox widget to populate the data. + * @Default {null} + */ + cascadeTo?: string; + + /**Set of list items to be checked by default using its index. It works only when the showCheckbox property is set to true. + * @Default {null} + */ + checkedIndices?: string; + + /**The root class for the ListBox widget to customize the existing theme. + * @Default {“”} + */ + cssClass?: string; + + /**Contains the list of data for generating the list items. + * @Default {null} + */ + dataSource?: any; + + /**Enables or disables the ListBox widget. + * @Default {true} + */ + enabled?: boolean; + + /**Enables or disables the search behavior to find the specific list item by typing the text value. + * @Default {false} + */ + enableIncrementalSearch?: boolean; + + /**Allows the current model values to be saved in local storage or browser cookies for state maintenance when it is set to true. + * @Default {false} + */ + enablePersistence?: boolean; + + /**Displays the ListBox widget’s content from right to left when enabled. + * @Default {false} + */ + enableRTL?: boolean; + + /**Mapping fields for the data items of the ListBox widget. + * @Default {null} + */ + fields?: any; + + /**Defines the height of the ListBox widget. + * @Default {null} + */ + height?: string; + + /**The number of list items to be shown in the ListBox widget. The remaining list items will be scrollable. + * @Default {null} + */ + itemsCount?: number; + + /**The total number of list items to be rendered in the ListBox widget. + * @Default {null} + */ + totalItemsCount?: number; + + /**The number of list items to be loaded in the list box while enabling virtual scrolling and when virtualScrollMode is set to continuous. + * @Default {5} + */ + itemRequestCount?: number; + + /**Loads data for the listbox by default (i.e. on initialization) when it is set to true. It creates empty ListBox if it is set to false. + */ + loadDataOnInit?: boolean; + + /**The query to retrieve required data from the data source. + * @Default {ej.Query()} + */ + query?: ej.Query|string; + + /**The list item to be selected by default using its index. + * @Default {null} + */ + selectedIndex?: number; + + /**The list items to be selected by default using its indices. To use this property allowMultiSelection should be enabled. + * @Default {[]} + */ + selectedIndices?: Array; + + /**Enables/Disables the multi selection option with the help of checkbox control. + * @Default {false} + */ + showCheckbox?: boolean; + + /**To display the ListBox container with rounded corners. + * @Default {false} + */ + showRoundedCorner?: boolean; + + /**The template to display the ListBox widget with customized appearance. + * @Default {null} + */ + template?: string; + + /**Holds the selected items values and used to bind value to the list item using angular and knockout. + * @Default {“”} + */ + value?: number; + + /**Specifies the virtual scroll mode to load the list data on demand via scrolling behavior. There are two types of mode. + */ + virtualScrollMode?: ej.VirtualScrollMode|string; + + /**Defines the width of the ListBox widget. + * @Default {null} + */ + width?: string; + + /**Specifies the targetID for the listbox items. + */ + targetID?: string; + + /**Triggers before the AJAX request begins to load data in the ListBox widget.*/ + actionBegin? (e: ActionBeginEventArgs): void; + + /**Triggers after the data requested via AJAX is successfully loaded in the ListBox widget.*/ + actionSuccess? (e: ActionSuccessEventArgs): void; + + /**Triggers when the AJAX requests complete. The request may get failed or succeed.*/ + actionComplete? (e: ActionCompleteEventArgs): void; + + /**Triggers when the data requested from AJAX get failed.*/ + actionFailure? (e: ActionFailureEventArgs): void; + + /**Event will be triggered before the requested data via AJAX once loaded in successfully.*/ + actionBeforeSuccess? (e: ActionBeforeSuccessEventArgs): void; + + /**Triggers when the item selection is changed.*/ + change? (e: ChangeEventArgs): void; + + /**Triggers when the list item is checked or unchecked.*/ + checkChange? (e: CheckChangeEventArgs): void; + + /**Triggers when the ListBox widget is created successfully.*/ + create? (e: CreateEventArgs): void; + + /**Triggers when the ListBox widget is destroyed successfully.*/ + destroy? (e: DestroyEventArgs): void; + + /**Triggers when focus the listbox items.*/ + focusIn? (e: FocusInEventArgs): void; + + /**Triggers when focus out from listbox items.*/ + focusOut? (e: FocusOutEventArgs): void; + + /**Triggers when the list item is being dragged.*/ + itemDrag? (e: ItemDragEventArgs): void; + + /**Triggers when the list item is ready to be dragged.*/ + itemDragStart? (e: ItemDragStartEventArgs): void; + + /**Triggers when the list item stops dragging.*/ + itemDragStop? (e: ItemDragStopEventArgs): void; + + /**Triggers when the list item is dropped.*/ + itemDrop? (e: ItemDropEventArgs): void; + + /**Triggers when a list item gets selected.*/ + select? (e: SelectEventArgs): void; + + /**Triggers when a list item gets unselected.*/ + unselect? (e: UnselectEventArgs): void; +} + +export interface ActionBeginEventArgs { +} + +export interface ActionSuccessEventArgs { +} + +export interface ActionCompleteEventArgs { +} + +export interface ActionFailureEventArgs { +} + +export interface ActionBeforeSuccessEventArgs { + + /**Instance of the listbox model object. + */ + model?: any; + + /**Name of the event. + */ + type?: string; + + /**List of actual object. + */ + actual?: any; + + /**Object of ListBox widget which contains DataManager arguments + */ + request?: any; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**List of array object + */ + result?: Array; + + /**ExcuteQuery object of DataManager + */ + xhr?: any; +} + +export interface ChangeEventArgs { + + /**Instance of the listbox model object. + */ + model?: any; + + /**Name of the event. + */ + type?: string; + + /**List item object. + */ + item?: any; + + /**The Datasource of the listbox. + */ + data?: any; + + /**List item’s index. + */ + index?: number; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Boolean value based on whether the list item is checked or not. + */ + isChecked?: boolean; + + /**Boolean value based on whether the list item is selected or not. + */ + isSelected?: boolean; + + /**Boolean value based on the list item is enabled or not. + */ + isEnabled?: boolean; + + /**List item’s text (label). + */ + text?: string; + + /**List item’s value. + */ + value?: string; +} + +export interface CheckChangeEventArgs { + + /**Instance of the listbox model object. + */ + model?: any; + + /**Name of the event. + */ + type?: string; + + /**List item object. + */ + item?: any; + + /**The Datasource of the listbox. + */ + data?: any; + + /**List item’s index. + */ + index?: number; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Boolean value based on whether the list item is checked or not. + */ + isChecked?: boolean; + + /**Boolean value based on whether the list item is selected or not. + */ + isSelected?: boolean; + + /**Boolean value based on the list item is enabled or not. + */ + isEnabled?: boolean; + + /**List item’s text (label). + */ + text?: string; + + /**List item’s value. + */ + value?: string; +} + +export interface CreateEventArgs { + + /**Instance of the listbox model object. + */ + model?: ej.ListBox.Model; + + /**Name of the event. + */ + type?: string; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; +} + +export interface DestroyEventArgs { + + /**Instance of the listbox model object. + */ + model?: any; + + /**Name of the event. + */ + type?: string; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; +} + +export interface FocusInEventArgs { + + /**Instance of the listbox model object. + */ + model?: any; + + /**Name of the event. + */ + type?: string; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; +} + +export interface FocusOutEventArgs { + + /**Instance of the listbox model object. + */ + model?: any; + + /**Name of the event. + */ + type?: string; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; +} + +export interface ItemDragEventArgs { + + /**Instance of the listbox model object. + */ + model?: any; + + /**Name of the event. + */ + type?: string; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**The Datasource of the listbox. + */ + data?: any; + + /**List item’s index. + */ + index?: number; + + /**Boolean value based on whether the list item is checked or not. + */ + isChecked?: boolean; + + /**Boolean value based on whether the list item is selected or not. + */ + isSelected?: boolean; + + /**Boolean value based on whether the list item is enabled or not. + */ + isEnabled?: boolean; + + /**List item’s text (label). + */ + text?: string; + + /**List item’s value. + */ + value?: string; +} + +export interface ItemDragStartEventArgs { + + /**Instance of the listbox model object. + */ + model?: any; + + /**Name of the event. + */ + type?: string; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**The Datasource of the listbox. + */ + data?: any; + + /**List item’s index. + */ + index?: number; + + /**Boolean value based on whether the list item is checked or not. + */ + isChecked?: boolean; + + /**Boolean value based on whether the list item is selected or not. + */ + isSelected?: boolean; + + /**Boolean value based on whether the list item is enabled or not. + */ + isEnabled?: boolean; + + /**List item’s text (label). + */ + text?: string; + + /**List item’s value. + */ + value?: string; +} + +export interface ItemDragStopEventArgs { + + /**Instance of the listbox model object. + */ + model?: any; + + /**Name of the event. + */ + type?: string; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**The Datasource of the listbox. + */ + data?: any; + + /**List item’s index. + */ + index?: number; + + /**Boolean value based on whether the list item is checked or not. + */ + isChecked?: boolean; + + /**Boolean value based on whether the list item is selected or not. + */ + isSelected?: boolean; + + /**Boolean value based on whether the list item is enabled or not. + */ + isEnabled?: boolean; + + /**List item’s text (label). + */ + text?: string; + + /**List item’s value. + */ + value?: string; +} + +export interface ItemDropEventArgs { + + /**Instance of the listbox model object. + */ + model?: any; + + /**Name of the event. + */ + type?: string; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**The Datasource of the listbox. + */ + data?: any; + + /**List item’s index. + */ + index?: number; + + /**Boolean value based on whether the list item is checked or not. + */ + isChecked?: boolean; + + /**Boolean value based on whether the list item is selected or not. + */ + isSelected?: boolean; + + /**Boolean value based on whether the list item is enabled or not. + */ + isEnabled?: boolean; + + /**List item’s text (label). + */ + text?: string; + + /**List item’s value. + */ + value?: string; +} + +export interface SelectEventArgs { + + /**Instance of the listbox model object. + */ + model?: any; + + /**Name of the event. + */ + type?: string; + + /**List item object. + */ + item?: any; + + /**The Datasource of the listbox. + */ + data?: any; + + /**List item’s index. + */ + index?: number; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Boolean value based on whether the list item is checked or not. + */ + isChecked?: boolean; + + /**Boolean value based on whether the list item is selected or not. + */ + isSelected?: boolean; + + /**Boolean value based on the list item is enabled or not. + */ + isEnabled?: boolean; + + /**List item’s text (label). + */ + text?: string; + + /**List item’s value. + */ + value?: string; +} + +export interface UnselectEventArgs { + + /**Instance of the listbox model object. + */ + model?: any; + + /**Name of the event. + */ + type?: string; + + /**List item object. + */ + item?: any; + + /**The Datasource of the listbox. + */ + data?: any; + + /**List item’s index. + */ + index?: number; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Boolean value based on whether the list item is checked or not. + */ + isChecked?: boolean; + + /**Boolean value based on whether the list item is selected or not. + */ + isSelected?: boolean; + + /**Boolean value based on the list item is enabled or not. + */ + isEnabled?: boolean; + + /**List item’s text (label). + */ + text?: string; + + /**List item’s value. + */ + value?: string; +} +} + +class Calculate extends ej.Widget { + static fn: Calculate; + constructor(element: JQuery, options?: Calculate.Model); + constructor(element: Element, options?: Calculate.Model); + model:Calculate.Model; + defaults:Calculate.Model; + + /** Add the custom formuls with function in CalcEngine library + * @param {string} pass the formula name + * @param {string} pass the custom function name to call + * @returns {void} + */ + addCustomFunction(FormulaName: string, FunctionName: string): void; + + /** Adds a named range to the NamedRanges collection + * @param {string} pass the namedRange's name + * @param {string} pass the cell range of NamedRange + * @returns {void} + */ + addNamedRange(Name: string, cellRange: string): void; + + /** Accepts a possible parsed formula and returns the calculated value without quotes. + * @param {string} pass the cell range to adjust its range + * @returns {string} + */ + adjustRangeArg(Name: string): string; + + /** When a formula cell changes, call this method to clear it from its dependent cells. + * @param {string} pass the changed cell address + * @returns {void} + */ + clearFormulaDependentCells(Cell: string): void; + + /** Call this method to clear whether an exception was raised during the computation of a library function. + * @returns {void} + */ + clearLibraryComputationException(): void; + + /** Get the column index from a cell reference passed in. + * @param {string} pass the cell address + * @returns {void} + */ + colIndex(Cell: string): void; + + /** Evaluates a parsed formula. + * @param {string} pass the parsed formula + * @returns {string} + */ + computedValue(Formula: string): string; + + /** Evaluates a parsed formula. + * @param {string} pass the parsed formula + * @returns {string} + */ + computeFormula(Formula: string): string; +} +export module Calculate{ + +export interface Model { +} +} + +class CheckBox extends ej.Widget { + static fn: CheckBox; + constructor(element: JQuery, options?: CheckBox.Model); + constructor(element: Element, options?: CheckBox.Model); + model:CheckBox.Model; + defaults:CheckBox.Model; + + /** Destroy the CheckBox widget all events bound using this._on will be unbind automatically and bring the control to pre-init state. + * @returns {void} + */ + destroy(): void; + + /** Disable the CheckBox to prevent all user interactions. + * @returns {void} + */ + disable(): void; + + /** To enable the CheckBox + * @returns {void} + */ + enable(): void; + + /** To Check the status of CheckBox + * @returns {boolean} + */ + isChecked(): boolean; +} +export module CheckBox{ + +export interface Model { + + /**Specifies whether CheckBox has to be in checked or not. We can also specify array of string as value for this property. If any of the value in the specified array matches the value of the textbox, then it will be considered as checked. It will be useful in MVVM binding, specify array type to identify the values of the checked CheckBoxes. + * @Default {false} + */ + checked?: boolean|string[]; + + /**Specifies the State of CheckBox.See below to get available CheckState + * @Default {null} + */ + checkState?: ej.CheckState|string; + + /**Sets the root CSS class for CheckBox theme, which is used customize. + */ + cssClass?: string; + + /**Specifies the checkbox control state. + * @Default {true} + */ + enabled?: boolean; + + /**Specifies the persist property for CheckBox while initialization. The persist API save current model value to browser cookies for state maintains. While refreshing the CheckBox control page the model value apply from browser cookies. + * @Default {false} + */ + enablePersistence?: boolean; + + /**Specify the Right to Left direction to Checkbox + * @Default {false} + */ + enableRTL?: boolean; + + /**Specifies the enable or disable Tri-State for checkbox control. + * @Default {false} + */ + enableTriState?: boolean; + + /**It allows to define the characteristics of the CheckBox control. It will helps to extend the capability of an HTML element. + * @Default {{}} + */ + htmlAttributes?: any; + + /**Specified value to be added an id attribute of the CheckBox. + * @Default {null} + */ + id?: string; + + /**Specify the prefix value of id to be added before the current id of the CheckBox. + * @Default {ej} + */ + idPrefix?: string; + + /**Specifies the name attribute of the CheckBox. + * @Default {null} + */ + name?: string; + + /**Displays rounded corner borders to CheckBox + * @Default {false} + */ + showRoundedCorner?: boolean; + + /**Specifies the size of the CheckBox.See below to know available CheckboxSize + * @Default {small} + */ + size?: ej.CheckboxSize|string; + + /**Specifies the text content to be displayed for CheckBox. + */ + text?: string; + + /**Set the jQuery validation error message in CheckBox. + * @Default {null} + */ + validationMessage?: any; + + /**Set the jQuery validation rules in CheckBox. + * @Default {null} + */ + validationRules?: any; + + /**Specifies the value attribute of the CheckBox. + * @Default {null} + */ + value?: string; + + /**Fires before the CheckBox is going to changed its state successfully*/ + beforeChange? (e: BeforeChangeEventArgs): void; + + /**Fires when the CheckBox state is changed successfully*/ + change? (e: ChangeEventArgs): void; + + /**Fires when the CheckBox state is created successfully*/ + create? (e: CreateEventArgs): void; + + /**Fires when the CheckBox state is destroyed successfully*/ + destroy? (e: DestroyEventArgs): void; +} + +export interface BeforeChangeEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the CheckBox model + */ + model?: ej.CheckBox.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the event model values + */ + event?: any; + + /**returns the status whether the element is checked or not. + */ + isChecked?: boolean; +} + +export interface ChangeEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the CheckBox model + */ + model?: ej.CheckBox.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the event arguments + */ + event?: any; + + /**returns the status whether the element is checked or not. + */ + isChecked?: boolean; + + /**returns the state of the checkbox + */ + checkState?: string; +} + +export interface CreateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the CheckBox model + */ + model?: ej.CheckBox.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the CheckBox model + */ + model?: ej.CheckBox.Model; + + /**returns the name of the event + */ + type?: string; +} +} +enum CheckState +{ +//string +Uncheck, +//string +Check, +//string +Indeterminate, +} +enum CheckboxSize +{ +//Displays the CheckBox in medium size +Medium, +//Displays the CheckBox in small size +Small, +} + +class ColorPicker extends ej.Widget { + static fn: ColorPicker; + constructor(element: JQuery, options?: ColorPicker.Model); + constructor(element: Element, options?: ColorPicker.Model); + model:ColorPicker.Model; + defaults:ColorPicker.Model; + + /** Disables the color picker control + * @returns {void} + */ + disable(): void; + + /** Enable the color picker control + * @returns {void} + */ + enable(): void; + + /** Gets the selected color in RGB format + * @returns {any} + */ + getColor(): any; + + /** Gets the selected color value as string + * @returns {string} + */ + getValue(): string; + + /** To Convert color value from hexCode to RGB + * @returns {any} + */ + hexCodeToRGB(): any; + + /** Hides the ColorPicker popup, if in opened state. + * @returns {void} + */ + hide(): void; + + /** Convert color value from HSV to RGB + * @returns {any} + */ + HSVToRGB(): any; + + /** Convert color value from RGB to HEX + * @returns {string} + */ + RGBToHEX(): string; + + /** Convert color value from RGB to HSV + * @returns {any} + */ + RGBToHSV(): any; + + /** Open the ColorPicker popup. + * @returns {void} + */ + show(): void; +} +export module ColorPicker{ + +export interface Model { + + /**The ColorPicker control allows to define the customized text to displayed in button elements. Using the property to achieve the customized culture values. + * @Default {buttonText.apply= Apply, buttonText.cancel= Cancel,buttonText.swatches=Swatches} + */ + buttonText?: any; + + /**Allows to change the mode of the button. Please refer below to know available button mode + * @Default {ej.ButtonMode.Split} + */ + buttonMode?: ej.ButtonMode|string; + + /**Specifies the number of columns to be displayed color palette model. + * @Default {10} + */ + columns?: number; + + /**This property allows you to customize its appearance using user-defined CSS and custom skin options such as colors and backgrounds. + */ + cssClass?: string; + + /**This property allows to define the custom colors in the palette model.Custom palettes are created by passing a comma delimited string of HEX values or an array of colors. + * @Default {empty} + */ + custom?: Array; + + /**This property allows to embed the popup in the order of DOM element flow . When we set the value as true, the color picker popup is always in visible state. + * @Default {false} + */ + displayInline?: boolean; + + /**This property allows to change the control in enabled or disabled state. + * @Default {true} + */ + enabled?: boolean; + + /**This property allows to enable or disable the opacity slider in the color picker control + * @Default {true} + */ + enableOpacity?: boolean; + + /**It allows to define the characteristics of the ColorPicker control. It will helps to extend the capability of an HTML element. + * @Default {{}} + */ + htmlAttributes?: any; + + /**Specifies the model type to be rendered initially in the color picker control. See below to get available ModelType + * @Default {ej.ColorPicker.ModelType.Default} + */ + modelType?: ej.ColorPicker.ModelType|string; + + /**This property allows to change the opacity value .The selected color opacity will be adjusted by using this opacity value. + * @Default {100} + */ + opacityValue?: number; + + /**Specifies the palette type to be displayed at initial time in palette model.There two types of palette model available in ColorPicker control. See below available Palette + * @Default {ej.ColorPicker.Palette.BasicPalette} + */ + palette?: ej.ColorPicker.Palette|string; + + /**This property allows to define the preset model to be rendered initially in palette type.It consists of 12 different types of presets. Each presets have 50 colors. See below available Presets + * @Default {ej.ColorPicker.Presets.Basic} + */ + presetType?: ej.ColorPicker.Presets|string; + + /**Allows to show/hides the apply and cancel buttons in ColorPicker control + * @Default {true} + */ + showApplyCancel?: boolean; + + /**Allows to show/hides the clear button in ColorPicker control + * @Default {true} + */ + showClearButton?: boolean; + + /**This property allows to provides live preview support for current cursor selection color and selected color. + * @Default {true} + */ + showPreview?: boolean; + + /**This property allows to store the color values in custom list.The ColorPicker will keep up to 11 colors in a custom list.By clicking the add button, the selected color from picker or palette will get added in the recent color list. + * @Default {false} + */ + showRecentColors?: boolean; + + /**This property allows to shows tooltip to notify the slider value in color picker control. + * @Default {false} + */ + showTooltip?: boolean; + + /**Specifies the toolIcon to be displayed in dropdown control color area. + * @Default {null} + */ + toolIcon?: string; + + /**This property allows to define the customized text or content to displayed when mouse over the following elements. This property also allows to use the culture values. + * @Default {tooltipText: { switcher: Switcher, addbutton: Add Color, basic: Basic, monochrome: Mono Chrome, flatcolors: Flat Color, seawolf: Sea Wolf, webcolors: Web Colors, sandy: Sandy, pinkshades: Pink Shades, misty: Misty, citrus: Citrus, vintage: Vintage, moonlight: Moon Light, candycrush: Candy Crush, currentcolor: Current Color, selectedcolor: Selected Color }} + */ + tooltipText?: any; + + /**Specifies the color value for color picker control, the value is in hexadecimal form with prefix of "#". + * @Default {null} + */ + value?: string; + + /**Fires after Color value has been changed successfully.If the user want to perform any operation after the color value changed then the user can make use of this change event.*/ + change? (e: ChangeEventArgs): void; + + /**Fires after closing the color picker popup.*/ + close? (e: CloseEventArgs): void; + + /**Fires after Color picker control is created. If the user want to perform any operation after the color picker control creation then the user can make use of this create event.*/ + create? (e: CreateEventArgs): void; + + /**Fires after Color picker control is destroyed. If the user want to perform any operation after the color picker control destroyed then the user can make use of this destroy event.*/ + destroy? (e: DestroyEventArgs): void; + + /**Fires after opening the color picker popup*/ + open? (e: OpenEventArgs): void; + + /**Fires after Color value has been selected successfully. If the user want to perform any operation after the color value selected then the user can make use of this select event.*/ + select? (e: SelectEventArgs): void; +} + +export interface ChangeEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the color picker model + */ + model?: ej.ColorPicker.Model; + + /**returns the name of the event + */ + type?: string; + + /**return the changed color value + */ + value?: string; +} + +export interface CloseEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the color picker model + */ + model?: ej.ColorPicker.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface CreateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the color picker model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the color picker model + */ + model?: ej.ColorPicker.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface OpenEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the color picker model + */ + model?: ej.ColorPicker.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface SelectEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the color picker model + */ + model?: ej.ColorPicker.Model; + + /**returns the name of the event + */ + type?: string; + + /**return the selected color value + */ + value?: string; +} + +enum ModelType{ + + ///support palette type mode in color picker. + Palette, + + ///support palette type mode in color picker. + Picker +} + + +enum Palette{ + + ///used to show the basic palette + BasicPalette, + + ///used to show the custompalette + CustomPalette +} + + +enum Presets{ + + ///used to show the basic presets + Basic, + + ///used to show the CandyCrush colors presets + CandyCrush, + + ///used to show the Citrus colors presets + Citrus, + + ///used to show the FlatColors presets + FlatColors, + + ///used to show the Misty presets + Misty, + + ///used to show the MoonLight presets + MoonLight, + + ///used to show the PinkShades presets + PinkShades, + + ///used to show the Sandy presets + Sandy, + + ///used to show the Seawolf presets + SeaWolf, + + ///used to show the Vintage presets + Vintage, + + ///used to show the WebColors presets + WebColors +} + +} +enum ButtonMode +{ +//Displays the button in split mode +Split, +//Displays the button in Dropdown mode +Dropdown, +} + +class FileExplorer extends ej.Widget { + static fn: FileExplorer; + constructor(element: JQuery, options?: FileExplorer.Model); + constructor(element: Element, options?: FileExplorer.Model); + model:FileExplorer.Model; + defaults:FileExplorer.Model; + + /** Refresh the size of FileExplorer control. + * @returns {void} + */ + adjustSize(): void; + + /** Disable the particular context menu item. + * @param {string|HTMLElement} Id of the menu item/ Menu element to be disabled + * @returns {void} + */ + disableMenuItem(item: string|HTMLElement): void; + + /** Disable the particular toolbar item. + * @param {string|HTMLElement} Id of the toolbar item/ Tool item element to be disabled + * @returns {void} + */ + disableToolbarItem(item: string|HTMLElement): void; + + /** Enable the particular context menu item. + * @param {string|HTMLElement} Id of the menu item/ Menu element to be Enabled + * @returns {void} + */ + enableMenuItem(item: string|HTMLElement): void; + + /** Enable the particular toolbar item + * @param {string|HTMLElement} Id of the tool item/ Tool item element to be Enabled + * @returns {void} + */ + enableToolbarItem(item: string|HTMLElement): void; + + /** Refresh the content of the selected folder in FileExplorer control. + * @returns {void} + */ + refresh(): void; + + /** Remove the particular toolbar item. + * @param {string|HTMLElement} Id of the tool item/ tool item element to be removed + * @returns {void} + */ + removeToolbarItem(item: string|HTMLElement): void; +} +export module FileExplorer{ + +export interface Model { + + /**Sets the URL of server side ajax handling method that handles file operation like Read, Remove, Rename, Create, Upload, Download, Copy and Move in File Explorer. + */ + ajaxAction?: string; + + /**Specifies the data type of server side ajax handling method. + * @Default {json} + */ + ajaxDataType?: string; + + /**By using ajaxSettings property, you can customize the ajax configurations. Normally you can customize the following option in ajax handling data, url, type, async, contentType, dataType and success. For upload, download and getImage API, you can only customize url. + * @Default {{ read: {}, createFolder: {}, remove: {}, rename: {}, paste: {}, getDetails: {}, download: {}, upload: {}, getImage: {}}} + */ + ajaxSettings?: any; + + /**The FileExplorer allows to select multiple files by enabling the allowMultiSelection property. You can perform multi selection by pressing the Ctrl key or Shift key. + * @Default {true} + */ + allowMultiSelection?: boolean; + + /**Sets the root class for FileExplorer theme. This cssClass API allows to use custom skinning option for File Explorer control. By defining the root class by using this API, you have to include this root class in CSS. + */ + cssClass?: string; + + /**Enables or disables the resize support in FileExplorer control. + * @Default {false} + */ + enableResize?: boolean; + + /**Enables or disables the Right to Left alignment support in FileExplorer control. + * @Default {false} + */ + enableRTL?: boolean; + + /**Allows specified type of files only to display in FileExplorer control. + * @Default {.} + */ + fileTypes?: string; + + /**By using filterSettings property, you can customize the search functionality of the search bar in FileExplorer control. + */ + filterSettings?: FilterSettings; + + /**By using the gridSettings property, you can customize the grid behavior in the FileExplorer control. + */ + gridSettings?: GridSettings; + + /**Specifies the height of FileExplorer control. + * @Default {400} + */ + height?: string|number; + + /**Enables or disables the responsive support for FileExplorer control during the window resizing time. + * @Default {false} + */ + isResponsive?: boolean; + + /**Sets the file view type. There are two view types available, such as grid, tile. See layoutType. + * @Default {ej.FileExplorer.layoutType.Grid} + */ + layout?: ej.FileExplorer.layoutType|string; + + /**Sets the culture in FileExplorer. + * @Default {en-US} + */ + locale?: string; + + /**Sets the maximum height of FileExplorer control. + * @Default {null} + */ + maxHeight?: string|number; + + /**Sets the maximum width of FileExplorer control. + * @Default {null} + */ + maxWidth?: string|number; + + /**Sets the minimum height of FileExplorer control. + * @Default {250} + */ + minHeight?: string|number; + + /**Sets the minimum width of FileExplorer control. + * @Default {400} + */ + minWidth?: string|number; + + /**The property path denotes the filesystem path that are to be explored. The path for the filesystem can be physical path or relative path, but it has to be relevant to where the Web API is hosted. + */ + path?: string; + + /**The selectedFolder is used to select the specified folder of FileExplorer control. + */ + selectedFolder?: string; + + /**The selectedItems is used to select the specified items (file, folder) of FileExplorer control. + */ + selectedItems?: string|Array; + + /**Enables or disables the context menu option in FileExplorer control. + * @Default {true} + */ + showContextMenu?: boolean; + + /**Enables or disables the footer in FileExplorer control. The footer element displays the details of the current selected files and folders. And also the footer having the switcher to change the layout view. + * @Default {true} + */ + showFooter?: boolean; + + /**Shows or disables the toolbar in FileExplorer control. + * @Default {true} + */ + showToolbar?: boolean; + + /**Enables or disables the navigation pane in FileExplorer control. The navigation pane contains a tree view element that displays all the folders from the filesystem in a hierarchical manner. This is useful to a quick navigation of any folder in the filesystem. + * @Default {true} + */ + showNavigationPane?: boolean; + + /**The tools property is used to configure and group required toolbar items in FileExplorer control. + * @Default {{ creation:[NewFolder, Open], navigation: [Back, Forward, Upward], addressBar: [Addressbar], editing: [Refresh, Upload, Delete, Rename, Download], copyPaste: [Cut, Copy, Paste], getProperties: [Details], searchBar: [Searchbar] }} + */ + tools?: any; + + /**The toolsList property is used to arrange the toolbar items in the FileExplorer control. + * @Default {[creation, navigation, addressBar, editing, copyPaste, getProperties, searchBar]} + */ + toolsList?: Array; + + /**Gets or sets an object that indicates whether to customize the upload behavior in the FileExplorer. + */ + uploadSettings?: UploadSettings; + + /**Specifies the width of FileExplorer control. + * @Default {850} + */ + width?: string|number; + + /**Fires before the ajax request is performed.*/ + beforeAjaxRequest? (e: BeforeAjaxRequestEventArgs): void; + + /**Fires before downloading the files.*/ + beforeDownload? (e: BeforeDownloadEventArgs): void; + + /**Fires before files or folders open.*/ + beforeOpen? (e: BeforeOpenEventArgs): void; + + /**Fires before uploading the files.*/ + beforeUpload? (e: BeforeUploadEventArgs): void; + + /**Fires when file or folder is copied successfully.*/ + copy? (e: CopyEventArgs): void; + + /**Fires when new folder is created successfully in file system.*/ + createFolder? (e: CreateFolderEventArgs): void; + + /**Fires when file or folder is cut successfully.*/ + cut? (e: CutEventArgs): void; + + /**Fires when the file view type is changed.*/ + layoutChange? (e: LayoutChangeEventArgs): void; + + /**Fires when files are successfully opened.*/ + open? (e: OpenEventArgs): void; + + /**Fires when a file or folder is pasted successfully.*/ + paste? (e: PasteEventArgs): void; + + /**Fires when file or folder is deleted successfully.*/ + remove? (e: RemoveEventArgs): void; + + /**Fires when resizing is performed for FileExplorer.*/ + resize? (e: ResizeEventArgs): void; + + /**Fires when resizing is started for FileExplorer.*/ + resizeStart? (e: ResizeStartEventArgs): void; + + /**Fires this event when the resizing is stopped for FileExplorer.*/ + resizeStop? (e: ResizeStopEventArgs): void; + + /**Fires when the items from grid view or tile view of FileExplorer control is selected.*/ + select? (e: SelectEventArgs): void; +} + +export interface BeforeAjaxRequestEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the ajax response data + */ + data?: any; + + /**returns the FileExplorer model + */ + model?: ej.FileExplorer.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface BeforeDownloadEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the downloaded file names. + */ + files?: string[]; + + /**returns the FileExplorer model. + */ + model?: ej.FileExplorer.Model; + + /**returns the path of currently opened item. + */ + path?: string; + + /**returns the selected item details. + */ + selectedItems?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface BeforeOpenEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the opened item type. + */ + itemType?: string; + + /**returns the FileExplorer model. + */ + model?: ej.FileExplorer.Model; + + /**returns the path of currently opened item. + */ + path?: string; + + /**returns the selected item details. + */ + selectedItems?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface BeforeUploadEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the FileExplorer model. + */ + model?: ej.FileExplorer.Model; + + /**returns the path of currently opened item. + */ + path?: string; + + /**returns the selected item details. + */ + selectedItems?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface CopyEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the FileExplorer model. + */ + model?: ej.FileExplorer.Model; + + /**returns the name of copied file/folder. + */ + name?: string[]; + + /**returns the selected item details. + */ + selectedItems?: any; + + /**returns the source path. + */ + sourcePath?: string; + + /**returns the name of the event. + */ + type?: string; +} + +export interface CreateFolderEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the ajax response data + */ + data?: any; + + /**returns the FileExplorer model + */ + model?: ej.FileExplorer.Model; + + /**returns the selected item details + */ + selectedItems?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface CutEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the FileExplorer model. + */ + model?: ej.FileExplorer.Model; + + /**returns the name of moved file or folder. + */ + name?: string[]; + + /**returns the selected item details. + */ + selectedItems?: any; + + /**returns the source path. + */ + sourcePath?: string; + + /**returns the name of the event. + */ + type?: string; +} + +export interface LayoutChangeEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the current view type. + */ + layoutType?: string; + + /**returns the FileExplorer model. + */ + model?: ej.FileExplorer.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface OpenEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the opened item type. + */ + itemType?: any; + + /**returns the FileExplorer model. + */ + model?: ej.FileExplorer.Model; + + /**returns the path of currently opened item. + */ + path?: string; + + /**returns the selected item details. + */ + selectedItems?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface PasteEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the FileExplorer model. + */ + model?: ej.FileExplorer.Model; + + /**returns the name of moved file or folder. + */ + name?: string[]; + + /**returns the selected item details. + */ + selectedItems?: any; + + /**returns the target folder item details. + */ + targetFolder?: any; + + /**returns the target path. + */ + targetPath?: string; + + /**returns the name of the event. + */ + type?: string; +} + +export interface RemoveEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the ajax response data. + */ + data?: any; + + /**returns the FileExplorer model. + */ + model?: ej.FileExplorer.Model; + + /**returns the names of deleted items. + */ + name?: string; + + /**returns the path of deleted item. + */ + path?: string; + + /**returns the selected item details. + */ + selectedItems?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface ResizeEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the mouse move event args. + */ + event?: any; + + /**returns the FileExplorer model. + */ + model?: ej.FileExplorer.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface ResizeStartEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the mouse down event args. + */ + event?: any; + + /**returns the FileExplorer model. + */ + model?: ej.FileExplorer.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface ResizeStopEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the mouse leave event args. + */ + event?: any; + + /**returns the FileExplorer model. + */ + model?: ej.FileExplorer.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface SelectEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the FileExplorer model. + */ + model?: ej.FileExplorer.Model; + + /**returns the name of clicked item. + */ + name?: string; + + /**returns the path of clicked item. + */ + path?: string; + + /**returns the selected item details + */ + selectedItems?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface FilterSettings { + + /**Enables or disables to perform the filter operation with case sensitive. + * @Default {false} + */ + caseSensitiveSearch?: boolean; + + /**Sets the search filter type. There are several filter types available, such as "startswith", "contains", "endswith". See filterType + * @Default {ej.FileExplorer.filterType.Contains} + */ + filterType?: ej.FilterType|string; +} + +export interface GridSettings { + + /**Gets or sets a value that indicates whether to enable the dynamic sorting behavior on grid data. Sorting can be done through clicking on particular column header. + * @Default {true} + */ + allowSorting?: boolean; + + /**Gets or sets an object that indicates to render the grid with specified columns. You can use this property same as the column property in Grid control. + * @Default {[{ field: name, headerText: Name, width: 25% }, { field: type, headerText: Type, width: 20% }, { field: dateModified, headerText: Date Modified, width: 35% }, { field: size, headerText: Size, width: 15%, textAlign: right, headerTextAlign: left }]} + */ + columns?: Array; +} + +export interface UploadSettings { + + /**Specifies the maximum file size allowed to upload. It accepts the value in bytes. + * @Default {31457280} + */ + maxFileSize?: number; + + /**Enables or disables the multiple files upload. When it is enabled, you can upload multiple files at a time and when disabled, you can upload only one file at a time. + * @Default {true} + */ + allowMultipleFile?: boolean; + + /**Enables or disables the auto upload option while uploading files in FileExplorer control. + * @Default {false} + */ + autoUpload?: boolean; +} + +enum layoutType{ + + ///Supports to display files in tile view + Tile, + + ///Supports to display files in grid view + Grid, + + ///Supports to display files as large icons + LargeIcons +} + +} + +class DatePicker extends ej.Widget { + static fn: DatePicker; + constructor(element: JQuery, options?: DatePicker.Model); + constructor(element: Element, options?: DatePicker.Model); + model:DatePicker.Model; + defaults:DatePicker.Model; + + /** Disables the DatePicker control. + * @returns {void} + */ + disable(): void; + + /** Enable the DatePicker control, if it is in disabled state. + * @returns {void} + */ + enable(): void; + + /** Returns the current date value in the DatePicker control. + * @returns {string} + */ + getValue(): string; + + /** Close the DatePicker popup, if it is in opened state. + * @returns {void} + */ + hide(): void; + + /** Opens the DatePicker popup. + * @returns {void} + */ + show(): void; +} +export module DatePicker{ + +export interface Model { + + /**Used to allow or restrict the editing in DatePicker input field directly. By setting false to this API, You can only pick the date from DatePicker popup. + * @Default {true} + */ + allowEdit?: boolean; + + /**allow or restrict the drill down to multiple levels of view (month/year/decade) in DatePicker calendar + * @Default {true} + */ + allowDrillDown?: boolean; + + /**Sets the specified text value to the today button in the DatePicker calendar. + * @Default {Today} + */ + buttonText?: string; + + /**Sets the root CSS class for Accordion theme, which is used customize. + */ + cssClass?: string; + + /**Formats the value of the DatePicker in to the specified date format. If this API is not specified, dateFormat will be set based on the current culture of DatePicker. + * @Default {MM/dd/yyyy} + */ + dateFormat?: string; + + /**Specifies the header format of days in DatePicker calendar. See below to get available Headers options + * @Default {ej.DatePicker.Header.Min} + */ + dayHeaderFormat?: string | ej.DatePicker.Header; + + /**Specifies the navigation depth level in DatePicker calendar. This option is not applied when start level view option is lower than depth level view. See below to know available levels in DatePicker Calendar + */ + depthLevel?: string | ej.DatePicker.Level; + + /**Allows to embed the DatePicker calendar in the page. Also associates DatePicker with div element instead of input. + * @Default {false} + */ + displayInline?: boolean; + + /**Enables or disables the animation effect with DatePicker calendar. + * @Default {true} + */ + enableAnimation?: boolean; + + /**Enable or disable the DatePicker control. + * @Default {true} + */ + enabled?: boolean; + + /**Sustain the entire widget model of DatePicker even after form post or browser refresh + * @Default {false} + */ + enablePersistence?: boolean; + + /**Displays DatePicker calendar along with DatePicker input field in Right to Left direction. + * @Default {false} + */ + enableRTL?: boolean; + + /**Allows to enter valid or invalid date in input textbox and indicate as error if it is invalid value, when this API value is set to true. For false value, invalid date is not allowed to input field and corrected to valid date automatically, even if invalid date is given. + * @Default {false} + */ + enableStrictMode?: boolean; + + /**Used the required fields for special Dates in DatePicker in order to customize the special dates in a calendar. + * @Default {null} + */ + fields?: Fields; + + /**Specifies the header format to be displayed in the DatePicker calendar. + * @Default {MMMM yyyy} + */ + headerFormat?: string; + + /**Specifies the height of the DatePicker input text. + * @Default {28px} + */ + height?: string; + + /**HighlightSection is used to highlight currently selected date's month/week/workdays. See below to get available HighlightSection options + * @Default {none} + */ + highlightSection?: string | ej.DatePicker.HighlightSection; + + /**Weekend dates will be highlighted when this property is set to true. + * @Default {false} + */ + highlightWeekend?: boolean; + + /**Specifies the HTML Attributes of the DatePicker. + * @Default {{}} + */ + htmlAttributes?: any; + + /**Change the DatePicker calendar and date format based on given culture. + * @Default {en-US} + */ + locale?: string; + + /**Specifies the maximum date in the calendar that the user can select. + * @Default {new Date(2099, 11, 31)} + */ + maxDate?: string|Date; + + /**Specifies the minimum date in the calendar that the user can select. + * @Default {new Date(1900, 00, 01)} + */ + minDate?: string|Date; + + /**Allows to toggles the read only state of the DatePicker. When the widget is readOnly, it doesn't allow your input. + * @Default {false} + */ + readOnly?: boolean; + + /**It allows to display footer in DatePicker calendar. + * @Default {true} + */ + showFooter?: boolean; + + /**It allows to display/hides the other months days from the current month calendar in a DatePicker. + * @Default {true} + */ + showOtherMonths?: boolean; + + /**Shows/hides the date icon button at right side of textbox, which is used to open or close the DatePicker calendar popup. + * @Default {true} + */ + showPopupButton?: boolean; + + /**DatePicker input is displayed with rounded corner when this property is set to true. + * @Default {false} + */ + showRoundedCorner?: boolean; + + /**Used to show the tooltip when hovering on the days in the DatePicker calendar. + * @Default {true} + */ + showTooltip?: boolean; + + /**Specifies the special dates in DatePicker. + * @Default {null} + */ + specialDates?: any; + + /**Specifies the start day of the week in DatePicker calendar. + * @Default {0} + */ + startDay?: number; + + /**Specifies the start level view in DatePicker calendar. See below available Levels + * @Default {ej.DatePicker.Level.Month} + */ + startLevel?: string | ej.DatePicker.Level; + + /**Specifies the number of months to be navigate for one click of next and previous button in a DatePicker Calendar. + * @Default {1} + */ + stepMonths?: number; + + /**Provides option to customize the tooltip format. + * @Default {ddd MMM dd yyyy} + */ + tooltipFormat?: string; + + /**Sets the jQuery validation support to DatePicker Date value. See validation + * @Default {null} + */ + validationMessage?: any; + + /**Sets the jQuery validation custom rules to the DatePicker. see validation + * @Default {null} + */ + validationRules?: any; + + /**sets or returns the current value of DatePicker + * @Default {null} + */ + value?: string|Date; + + /**Specifies the water mark text to be displayed in input text. + * @Default {Select date} + */ + watermarkText?: string; + + /**Specifies the width of the DatePicker input text. + * @Default {160px} + */ + width?: string; + + /**Fires before closing the DatePicker popup.*/ + beforeClose? (e: BeforeCloseEventArgs): void; + + /**Fires when each date is created in the DatePicker popup calendar.*/ + beforeDateCreate? (e: BeforeDateCreateEventArgs): void; + + /**Fires before opening the DatePicker popup.*/ + beforeOpen? (e: BeforeOpenEventArgs): void; + + /**Fires when the DatePicker input value is changed.*/ + change? (e: ChangeEventArgs): void; + + /**Fires when DatePicker popup is closed.*/ + close? (e: CloseEventArgs): void; + + /**Fires when the DatePicker is created successfully.*/ + create? (e: CreateEventArgs): void; + + /**Fires when the DatePicker is destroyed successfully.*/ + destroy? (e: DestroyEventArgs): void; + + /**NameTypeDescriptioncancelbooleanSet to true when the event has to be canceled, else false.modelobjectreturns the DatePicker model.typestringreturns the name of the event.valuestringreturns the currently selected date value.*/ + focusIn? (e: FocusInEventArgs): void; + + /**Fires when DatePicker input loses the focus.*/ + focusOut? (e: FocusOutEventArgs): void; + + /**Fires when DatePicker popup is opened.*/ + open? (e: OpenEventArgs): void; + + /**Fires when a date is selected from the DatePicker popup.*/ + select? (e: SelectEventArgs): void; +} + +export interface BeforeCloseEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the DatePicker model. + */ + model?: ej.DatePicker.Model; + + /**returns the name of the event. + */ + type?: string; + + /**returns the event parameters from DatePicker. + */ + events?: any; + + /**returns the DatePicker popup. + */ + element?: HTMLElement; +} + +export interface BeforeDateCreateEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the DatePicker model. + */ + model?: ej.DatePicker.Model; + + /**returns the name of the event. + */ + type?: string; + + /**returns the currently created date object. + */ + date?: any; + + /**returns the current DOM object of the date from the Calendar. + */ + element?: HTMLElement; +} + +export interface BeforeOpenEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the DatePicker model. + */ + model?: ej.DatePicker.Model; + + /**returns the name of the event. + */ + type?: string; + + /**returns the event parameters from DatePicker. + */ + events?: any; + + /**returns the DatePicker popup. + */ + element?: HTMLElement; +} + +export interface ChangeEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the DatePicker model. + */ + model?: ej.DatePicker.Model; + + /**returns the name of the event. + */ + type?: string; + + /**returns the DatePicker input value. + */ + value?: string; + + /**returns the previously selected value. + */ + prevDate?: string; +} + +export interface CloseEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the DatePicker model. + */ + model?: ej.DatePicker.Model; + + /**returns the name of the event. + */ + type?: string; + + /**returns the current date value. + */ + value?: string; + + /**returns the previously selected value. + */ + prevDate?: string; +} + +export interface CreateEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the DatePicker model. + */ + model?: ej.DatePicker.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the DatePicker model. + */ + model?: ej.DatePicker.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface FocusInEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the DatePicker model. + */ + model?: ej.DatePicker.Model; + + /**returns the name of the event. + */ + type?: string; + + /**returns the currently selected date value. + */ + value?: string; +} + +export interface FocusOutEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the DatePicker model. + */ + model?: ej.DatePicker.Model; + + /**returns the name of the event. + */ + type?: string; + + /**returns the currently selected date value. + */ + value?: string; + + /**returns the previously selected date value. + */ + prevDate?: string; +} + +export interface OpenEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the DatePicker model. + */ + model?: ej.DatePicker.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the current date value. + */ + value?: string; + + /**returns the previously selected value. + */ + prevDate?: string; +} + +export interface SelectEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the DatePicker model. + */ + model?: ej.DatePicker.Model; + + /**returns the name of the event. + */ + type?: string; + + /**returns the current date value. + */ + value?: string; + + /**returns the previously selected value. + */ + prevDate?: string; + + /**returns whether the currently selected date is special date or not. + */ + isSpecialDay?: string; +} + +export interface Fields { + + /**Specifies the specials dates + */ + date?: string; + + /**Specifies the icon class to special dates. + */ + iconClass?: string; + + /**Specifies the tooltip to special dates. + */ + tooltip?: string; +} + +enum Header{ + + ///Removes day header in DatePicker + None, + + ///sets the short format of day name (like Sun) in header in DatePicker + Short, + + ///sets the Min format of day name (like su) in header format DatePicker + Min +} + + +enum Level{ + + ///allow navigation upto year level in DatePicker + Year, + + ///allow navigation upto decade level in DatePicker + Decade, + + ///allow navigation upto Century level in DatePicker + Century +} + + +enum HighlightSection{ + + ///Highlight the week of the currently selected date in DatePicker popup calendar + Week, + + ///Highlight the workdays in a currently selected date's week in DatePicker popup calendar + WorkDays, + + ///Nothing will be highlighted, remove highlights from DatePicker popup calendar if already exists + None +} + +} + +class DateTimePicker extends ej.Widget { + static fn: DateTimePicker; + constructor(element: JQuery, options?: DateTimePicker.Model); + constructor(element: Element, options?: DateTimePicker.Model); + model:DateTimePicker.Model; + defaults:DateTimePicker.Model; + + /** Disables the DateTimePicker control. + * @returns {void} + */ + disable(): void; + + /** Enables the DateTimePicker control. + * @returns {void} + */ + enable(): void; + + /** Returns the current datetime value in the DateTimePicker. + * @returns {string} + */ + getValue(): string; + + /** Hides or closes the DateTimePicker popup. + * @returns {void} + */ + hide(): void; + + /** Updates the current system date value and time value to the DateTimePicker. + * @returns {void} + */ + setCurrentDateTime(): void; + + /** Shows or opens the DateTimePicker popup. + * @returns {void} + */ + show(): void; +} +export module DateTimePicker{ + +export interface Model { + + /**Displays the custom text for the buttons inside the DateTimePicker popup. when the culture value changed, we can change the buttons text based on the culture. + * @Default {{ today: Today, timeNow: Time Now, done: Done, timeTitle: Time }} + */ + buttonText?: ButtonText; + + /**Set the root class for DateTimePicker theme. This cssClass API helps to use custom skinning option for DateTimePicker control. + */ + cssClass?: string; + + /**Defines the datetime format displayed in the DateTimePicker. The value should be a combination of date format and time format. + * @Default {M/d/yyyy h:mm tt} + */ + dateTimeFormat?: string; + + /**Specifies the header format of the datepicker inside the DateTimePicker popup. See DatePicker.Header + * @Default {ej.DatePicker.Header.Min} + */ + dayHeaderFormat?: ej.DatePicker.Header|string; + + /**Specifies the drill down level in datepicker inside the DateTimePicker popup. See ej.DatePicker.Level + */ + depthLevel?: ej.DatePicker.Level|string; + + /**Enable or disable the animation effect in DateTimePicker. + * @Default {true} + */ + enableAnimation?: boolean; + + /**When this property is set to false, it disables the DateTimePicker control. + * @Default {false} + */ + enabled?: boolean; + + /**Enables or disables the state maintenance of DateTimePicker. + * @Default {false} + */ + enablePersistence?: boolean; + + /**Sets the DateTimePicker direction as right to left alignment. + * @Default {false} + */ + enableRTL?: boolean; + + /**When enableStrictMode true it allows the value outside of the range also but it highlights the textbox with error class, otherwise it internally changed to the correct value. + * @Default {false} + */ + enableStrictMode?: boolean; + + /**Specifies the header format to be displayed in the DatePicker calendar inside the DateTimePicker popup. + * @Default {MMMM yyyy} + */ + headerFormat?: string; + + /**Defines the height of the DateTimePicker textbox. + * @Default {30} + */ + height?: string|number; + + /**Specifies the HTML Attributes of the ejDateTimePicker + * @Default {{}} + */ + htmlAttributes?: any; + + /**Sets the time interval between the two adjacent time values in the time popup. + * @Default {30} + */ + interval?: number; + + /**Defines the localization culture for DateTimePicker. + * @Default {en-US} + */ + locale?: string; + + /**Sets the maximum value to the DateTimePicker. Beyond the maximum value an error class is added to the wrapper element when we set true to enableStrictMode. + * @Default {new Date(12/31/2099 11:59:59 PM)} + */ + maxDateTime?: string|Date; + + /**Sets the minimum value to the DateTimePicker. Behind the minimum value an error class is added to the wrapper element. + * @Default {new Date(1/1/1900 12:00:00 AM)} + */ + minDateTime?: string|Date; + + /**Specifies the popup position of DateTimePicker.See below to know available popup positions + * @Default {ej.DateTimePicker.Bottom} + */ + popupPosition?: string | ej.popupPosition; + + /**Indicates that the DateTimePicker value can only be read and can’t change. + * @Default {false} + */ + readOnly?: boolean; + + /**It allows showing days in other months of DatePicker calendar inside the DateTimePicker popup. + * @Default {true} + */ + showOtherMonths?: boolean; + + /**Shows or hides the arrow button from the DateTimePicker textbox. When the button disabled, the DateTimePicker popup opens while focus in the textbox and hides while focus out from the textbox. + * @Default {true} + */ + showPopupButton?: boolean; + + /**Changes the sharped edges into rounded corner for the DateTimePicker textbox and popup. + * @Default {false} + */ + showRoundedCorner?: boolean; + + /**Specifies the start day of the week in datepicker inside the DateTimePicker popup. + * @Default {1} + */ + startDay?: number; + + /**Specifies the start level view in datepicker inside the DateTimePicker popup. See DatePicker.Level + * @Default {ej.DatePicker.Level.Month or month} + */ + startLevel?: ej.DatePicker.Level|string; + + /**Specifies the number of months to navigate at one click of next and previous button in datepicker inside the DateTimePicker popup. + * @Default {1} + */ + stepMonths?: number; + + /**Defines the time format displayed in the time dropdown inside the DateTimePicker popup. + * @Default {h:mm tt} + */ + timeDisplayFormat?: string; + + /**We can drill down up to time interval on selected date with meridian details. + * @Default {{ enabled: false, interval: 5, showMeridian: false, autoClose: true }} + */ + timeDrillDown?: TimeDrillDown; + + /**Defines the width of the time dropdown inside the DateTimePicker popup. + * @Default {100} + */ + timePopupWidth?: string|number; + + /**Set the jquery validation error message in DateTimePicker. + * @Default {null} + */ + validationMessage?: any; + + /**Set the jquery validation rules in DateTimePicker. + * @Default {null} + */ + validationRules?: any; + + /**Sets the DateTime value to the control. + */ + value?: string|Date; + + /**Defines the width of the DateTimePicker textbox. + * @Default {143} + */ + width?: string|number; + + /**Fires when the datetime value changed in the DateTimePicker textbox.*/ + change? (e: ChangeEventArgs): void; + + /**Fires when DateTimePicker popup closes.*/ + close? (e: CloseEventArgs): void; + + /**Fires after DateTimePicker control is created.*/ + create? (e: CreateEventArgs): void; + + /**Fires when the DateTimePicker is destroyed successfully*/ + destroy? (e: DestroyEventArgs): void; + + /**Fires when the focus-in happens in the DateTimePicker textbox.*/ + focusIn? (e: FocusInEventArgs): void; + + /**Fires when the focus-out happens in the DateTimePicker textbox.*/ + focusOut? (e: FocusOutEventArgs): void; + + /**Fires when DateTimePicker popup opens.*/ + open? (e: OpenEventArgs): void; +} + +export interface ChangeEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the TimePicker model + */ + model?: ej.DateTimePicker.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the current value is valid or not + */ + isValidState?: boolean; + + /**returns the modified datetime value + */ + value?: string; + + /**returns the previously selected date time value + */ + prevDateTime?: string; + + /**returns true if change event triggered by interaction, otherwise returns false + */ + isInteraction?: boolean; +} + +export interface CloseEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the TimePicker model + */ + model?: ej.DateTimePicker.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the modified datetime value + */ + value?: string; + + /**returns the previously selected date time value + */ + prevDateTime?: string; +} + +export interface CreateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the DateTimePicker model + */ + model?: ej.DateTimePicker.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the DateTimePicker model + */ + model?: ej.DateTimePicker.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface FocusInEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the TimePicker model + */ + model?: ej.DateTimePicker.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the datetime value, which is in text box + */ + value?: string; +} + +export interface FocusOutEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the TimePicker model + */ + model?: ej.DateTimePicker.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the datetime value, which is in text box + */ + value?: string; +} + +export interface OpenEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the TimePicker model + */ + model?: ej.DateTimePicker.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the modified datetime value + */ + value?: string; + + /**returns the previously selected date time value + */ + prevDateTime?: string; +} + +export interface ButtonText { + + /**Sets the text for the Done button inside the datetime popup. + */ + done?: string; + + /**Sets the text for the Now button inside the datetime popup. + */ + timeNow?: string; + + /**Sets the header text for the Time dropdown. + */ + timeTitle?: string; + + /**Sets the text for the Today button inside the datetime popup. + */ + today?: string; +} + +export interface TimeDrillDown { + + /**This is the field to show/hide the timeDrillDown in DateTimePicker. + */ + enabled?: boolean; + + /**Sets the interval time of minutes on selected date. + */ + interval?: number; + + /**Allows the user to show or hide the meridian with time in DateTimePicker. + */ + showMeridian?: boolean; + + /**After choosing the time, the popup will close automatically if we set it as true, otherwise we focus out the DateTimePicker or choose timeNow button for closing the popup. + */ + autoClose?: boolean; +} +} +enum popupPosition +{ +//Opens the DateTimePicker popup below to the DateTimePicker input box +Bottom, +//Opens the DateTimePicker popup above to the DateTimePicker input box +Top, +} + +class Dialog extends ej.Widget { + static fn: Dialog; + constructor(element: JQuery, options?: Dialog.Model); + constructor(element: Element, options?: Dialog.Model); + model:Dialog.Model; + defaults:Dialog.Model; + + /** Closes the dialog widget dynamically. + * @returns {void} + */ + close(): void; + + /** Collapses the content area when it is expanded. + * @returns {void} + */ + collapse(): void; + + /** Destroys the Dialog widget. + * @returns {void} + */ + destroy(): void; + + /** Expands the content area when it is collapsed. + * @returns {void} + */ + expand(): void; + + /** Checks whether the Dialog widget is opened or not. This methods returns Boolean value. + * @returns {void} + */ + isOpen(): void; + + /** Maximizes the Dialog widget. + * @returns {void} + */ + maximize(): void; + + /** Minimizes the Dialog widget. + * @returns {void} + */ + minimize(): void; + + /** Opens the Dialog widget. + * @returns {void} + */ + open(): void; + + /** Pins the dialog in its current position. + * @returns {void} + */ + pin(): void; + + /** Restores the dialog. + * @returns {void} + */ + restore(): void; + + /** Unpins the Dialog widget. + * @returns {void} + */ + unpin(): void; + + /** Sets the title for the Dialog widget. + * @param {string} The title for the dialog widget. + * @returns {void} + */ + setTitle(Title: string): void; + + /** Sets the content for the Dialog widget dynamically. + * @param {string} The content for the dialog widget. It accepts both string and html string. + * @returns {void} + */ + setContent(content: string): void; + + /** Sets the focus on the Dialog widget. + * @returns {void} + */ + focus(): void; +} +export module Dialog{ + +export interface Model { + + /**Adds action buttons like close, minimize, pin, maximize in the dialog header. + */ + actionButtons?: string[]; + + /**Enables or disables draggable. + */ + allowDraggable?: boolean; + + /**Enables or disables keyboard interaction. + */ + allowKeyboardNavigation?: boolean; + + /**Customizes the Dialog widget animations. The Dialog widget can be animated while opening and closing the dialog. In order to customize animation effects, you need to set “enableAnimation” as true. It contains the following sub properties. + */ + animation?: any; + + /**The tooltip text for the dialog close button. + */ + closeIconTooltip?: string; + + /**Closes the dialog widget on pressing the ESC key when it is set to true. + */ + closeOnEscape?: boolean; + + /**The selector for the container element. If the property is set, then dialog will append to the selected element and it is restricted to move only within the specified container element. + */ + containment?: string; + + /**The content type to load the dialog content at run time. The possible values are null, ajax, iframe and image. When it is null (default value), the content inside dialog element will be displayed as content and when it is not null, the content will be loaded from the URL specified in the contentUrl property. + */ + contentType?: string; + + /**The URL to load the dialog content (such as AJAX, image, and iframe). In order to load content from URL, you need to set contentType as ‘ajax’ or ‘iframe’ or ‘image’. + */ + contentUrl?: string; + + /**The root class for the Dialog widget to customize the existing theme. + */ + cssClass?: string; + + /**Enable or disables animation when the dialog is opened or closed. + */ + enableAnimation?: boolean; + + /**Enables or disables the Dialog widget. + */ + enabled?: boolean; + + /**Enable or disables modal dialog. The modal dialog acts like a child window that is displayed on top of the main window/screen and disables the main window interaction until it is closed. + */ + enableModal?: boolean; + + /**Allows the current model values to be saved in local storage or browser cookies for state maintenance when it is set to true. + */ + enablePersistence?: boolean; + + /**Allows the dialog to be resized. The dialog cannot be resized less than the minimum height, width values and greater than the maximum height and width. + */ + enableResize?: boolean; + + /**Displays dialog content from right to left when set to true. + */ + enableRTL?: boolean; + + /**The CSS class name to display the favicon in the dialog header. In order to display favicon, you need to set showHeader as true since the favicon will be displayed in the dialog header. + */ + faviconCSS?: string; + + /**Sets the height for the dialog widget. It accepts both string and integer values. For example, it can accepts values like “auto”, “100%”, “100px” as string type and “100”, “500” as integer type. The unit of integer type value is “px”. + */ + height?: string|number; + + /**Enable or disables responsive behavior. + */ + isResponsive?: boolean; + + /**Default Value:{:.param}“en-US” + */ + locale?: number; + + /**Sets the maximum height for the dialog widget. + */ + maxHeight?: number; + + /**Sets the maximum width for the dialog widget. + */ + maxWidth?: number; + + /**Sets the minimum height for the dialog widget. + */ + minHeight?: number; + + /**Sets the minimum width for the dialog widget. + */ + minWidth?: number; + + /**Displays the Dialog widget at the given X and Y position. + */ + position?: any; + + /**Shows or hides the dialog header. + */ + showHeader?: boolean; + + /**The Dialog widget can be opened by default i.e. on initialization, when it is set to true. + */ + showOnInit?: boolean; + + /**Enables or disables the rounder corner. + */ + showRoundedCorner?: boolean; + + /**The selector for the container element. If this property is set, the dialog will be displayed (positioned) based on its container. + */ + target?: string; + + /**The title text to be displayed in the dialog header. In order to set title, you need to set showHeader as true since the title will be displayed in the dialog header. + */ + title?: string; + + /**Add or configure the tooltip text for actionButtons in the dialog header. + */ + tooltip?: any; + + /**Sets the height for the dialog widget. It accepts both string and integer values. For example, it can accepts values like “auto”, “100%”, “100px” as string type and “100”, “500” as integer type. The unit of integer type value is “px”. + */ + width?: string|number; + + /**Sets the z-index value for the Dialog widget. + */ + zIndex?: number; + + /**This event is triggered before the dialog widgets gets open.*/ + beforeOpen? (e: BeforeOpenEventArgs): void; + + /**This event is triggered whenever the Ajax request fails to retrieve the dialog content.*/ + ajaxError? (e: AjaxErrorEventArgs): void; + + /**This event is triggered whenever the Ajax request to retrieve the dialog content, gets succeed.*/ + ajaxSuccess? (e: AjaxSuccessEventArgs): void; + + /**This event is triggered before the dialog widgets get closed.*/ + beforeClose? (e: BeforeCloseEventArgs): void; + + /**This event is triggered after the dialog widget is closed.*/ + close? (e: CloseEventArgs): void; + + /**Triggered after the dialog content is loaded in DOM.*/ + contentLoad? (e: ContentLoadEventArgs): void; + + /**Triggered after the dialog is created successfully*/ + create? (e: CreateEventArgs): void; + + /**Triggered after the dialog widget is destroyed successfully*/ + destroy? (e: DestroyEventArgs): void; + + /**Triggered while the dialog is dragged.*/ + drag? (e: DragEventArgs): void; + + /**Triggered when the user starts dragging the dialog.*/ + dragStart? (e: DragStartEventArgs): void; + + /**Triggered when the user stops dragging the dialog.*/ + dragStop? (e: DragStopEventArgs): void; + + /**Triggered after the dialog is opened.*/ + open? (e: OpenEventArgs): void; + + /**Triggered while the dialog is resized.*/ + resize? (e: ResizeEventArgs): void; + + /**Triggered when the user starts resizing the dialog.*/ + resizeStart? (e: ResizeStartEventArgs): void; + + /**Triggered when the user stops resizing the dialog.*/ + resizeStop? (e: ResizeStopEventArgs): void; + + /**Triggered when the dialog content is expanded.*/ + expand? (e: ExpandEventArgs): void; + + /**Triggered when the dialog content is collapsed.*/ + collapse? (e: CollapseEventArgs): void; +} + +export interface BeforeOpenEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the dialog model object. + */ + model?: ej.Dialog.Model; + + /**Name of the event + */ + type?: string; +} + +export interface AjaxErrorEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the dialog model object. + */ + model?: ej.Dialog.Model; + + /**Name of the event. + */ + type?: string; + + /**URL of the content. + */ + url?: string; + + /**Error page content. + */ + responseText?: string; + + /**Error code. + */ + status?: number; + + /**The corresponding error description. + */ + statusText?: string; +} + +export interface AjaxSuccessEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the dialog model object. + */ + model?: ej.Dialog.Model; + + /**Name of the event. + */ + type?: string; + + /**URL of the content. + */ + url?: string; + + /**Response content. + */ + data?: string; +} + +export interface BeforeCloseEventArgs { + + /**Current event object. + */ + event?: any; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the dialog model object. + */ + model?: ej.Dialog.Model; + + /**Name of the event. + */ + type?: string; +} + +export interface CloseEventArgs { + + /**Current event object. + */ + event?: any; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the dialog model object. + */ + model?: ej.Dialog.Model; + + /**Name of the event + */ + type?: string; +} + +export interface ContentLoadEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the dialog model object. + */ + model?: ej.Dialog.Model; + + /**Name of the event. + */ + type?: string; + + /**URL of the content. + */ + url?: string; + + /**Content type + */ + contentType?: any; +} + +export interface CreateEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the dialog model object. + */ + model?: ej.Dialog.Model; + + /**Name of the event. + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the dialog model object. + */ + model?: ej.Dialog.Model; + + /**Name of the event. + */ + type?: string; +} + +export interface DragEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the dialog model object. + */ + model?: ej.Dialog.Model; + + /**Name of the event. + */ + type?: string; + + /**Current event object. + */ + event?: any; +} + +export interface DragStartEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the dialog model object. + */ + model?: ej.Dialog.Model; + + /**Name of the event. + */ + type?: string; + + /**Current event object. + */ + event?: any; +} + +export interface DragStopEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the dialog model object. + */ + model?: ej.Dialog.Model; + + /**Name of the event. + */ + type?: string; + + /**Current event object. + */ + event?: any; +} + +export interface OpenEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the dialog model object. + */ + model?: ej.Dialog.Model; + + /**Name of the event. + */ + type?: string; +} + +export interface ResizeEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the dialog model object. + */ + model?: ej.Dialog.Model; + + /**Name of the event. + */ + type?: string; + + /**Current event object. + */ + event?: any; +} + +export interface ResizeStartEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the dialog model object. + */ + model?: ej.Dialog.Model; + + /**Name of the event + */ + type?: string; + + /**Current event object. + */ + event?: any; +} + +export interface ResizeStopEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the dialog model object. + */ + model?: ej.Dialog.Model; + + /**Name of the event + */ + type?: string; + + /**Current event object. + */ + event?: any; +} + +export interface ExpandEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the dialog model object. + */ + model?: ej.Dialog.Model; + + /**Name of the event. + */ + type?: string; +} + +export interface CollapseEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the dialog model object. + */ + model?: ej.Dialog.Model; + + /**Name of the event. + */ + type?: string; +} +} + +class DropDownList extends ej.Widget { + static fn: DropDownList; + constructor(element: JQuery, options?: DropDownList.Model); + constructor(element: Element, options?: DropDownList.Model); + model:DropDownList.Model; + defaults:DropDownList.Model; + + /** Adding a single item or an array of items into the DropDownList allows you to specify all the field attributes such as value, template, image URL, and html attributes for those items. + * @param {any|Array} this parameter should have field attributes with respect to mapped field attributes and it's corresponding values to fields + * @returns {void} + */ + addItem(data: any|Array): void; + + /** This method is used to select all the items in the DropDownList. + * @returns {void} + */ + checkAll(): void; + + /** Clears the text in the DropDownList textbox. + * @returns {void} + */ + clearText(): void; + + /** Destroys the DropDownList widget. + * @returns {void} + */ + destroy(): void; + + /** This property is used to disable the DropDownList widget. + * @returns {void} + */ + disable(): void; + + /** This property disables the set of items in the DropDownList. + * @param {string|number|Array} disable the given index list items + * @returns {void} + */ + disableItemsByIndices(index: string|number|Array): void; + + /** This property enables the DropDownList control. + * @returns {void} + */ + enable(): void; + + /** Enables an Item or set of Items that are disabled in the DropDownList + * @param {string|number|Array} enable the given index list items if it's disabled + * @returns {void} + */ + enableItemsByIndices(index: string|number|Array): void; + + /** This method retrieves the items using given value. + * @param {string|number|any} Return the whole object of data based on given value + * @returns {any} + */ + getItemDataByValue(value: string|number|any): any; + + /** This method is used to retrieve the items that are bound with the DropDownList. + * @returns {any} + */ + getListData(): any; + + /** This method is used to get the selected items in the DropDownList. + * @returns {HTMLElement} + */ + getSelectedItem(): HTMLElement; + + /** This method is used to retrieve the items value that are selected in the DropDownList. + * @returns {string} + */ + getSelectedValue(): string; + + /** This method hides the suggestion popup in the DropDownList. + * @returns {void} + */ + hidePopup(): void; + + /** This method is used to select the list of items in the DropDownList through the Index of the items. + * @param {string|number|Array} select the given index list items + * @returns {void} + */ + selectItemsByIndices(index: string|number|Array): void; + + /** This method is used to select an item in the DropDownList by using the given text value. + * @param {string|number|Array} select the list items relates to given text + * @returns {void} + */ + selectItemByText(index: string|number|Array): void; + + /** This method is used to select an item in the DropDownList by using the given value. + * @param {string|number|Array} select the list items relates to given values + * @returns {void} + */ + selectItemByValue(index: string|number|Array): void; + + /** This method shows the DropDownList control with the suggestion popup. + * @returns {void} + */ + showPopup(): void; + + /** This method is used to unselect all the items in the DropDownList. + * @returns {void} + */ + unCheckAll(): void; + + /** This method is used to unselect the list of items in the DropDownList through Index of the items. + * @param {string|number|Array} unselect the given index list items + * @returns {void} + */ + unselectItemsByIndices(index: string|number|Array): void; + + /** This method is used to unselect an item in the DropDownList by using the given text value. + * @param {string|number|Array} unselect the list items realtes to given text + * @returns {void} + */ + unselectItemByText(index: string|number|Array): void; + + /** This method is used to unselect an item in the DropDownList by using the given value. + * @param {string|number|Array} unselect the list items realtes to given values + * @returns {void} + */ + unselectItemByValue(index: string|number|Array): void; +} +export module DropDownList{ + +export interface Model { + + /**The cascading DropDownLists is a series of two or more DropDownLists in which each DropDownList is filtered according to the previous DropDownList’s value. + * @Default {null} + */ + cascadeTo?: string; + + /**Sets the case sensitivity of the search operation. It supports both enableFilterSearch and enableIncrementalSearch property. + * @Default {false} + */ + caseSensitiveSearch?: boolean; + + /**Dropdown widget's style and appearance can be controlled based on 13 different default built-in themes.You can customize the appearance of the dropdown by using the cssClass property. You need to specify a class name in the cssClass property and the same class name is used before the class definitions wherever the custom styles are applied. + */ + cssClass?: string; + + /**This property is used to serve data from the data services based on the query provided. To bind the data to the dropdown widget, the dataSource property is assigned with the instance of the ej.DataManager. + * @Default {null} + */ + dataSource?: any; + + /**Sets the separator when the multiSelectMode with delimiter option or checkbox is enabled with the dropdown. When you enter the delimiter value, the texts after the delimiter are considered as a separate word or query. The delimiter string is a single character and must be a symbol. Mostly, the delimiter symbol is used as comma (,) or semi-colon (;) or any other special character. + * @Default {','} + */ + delimiterChar?: string; + + /**The enabled Animation property uses the easeOutQuad animation to SlideDown and SlideUp the Popup list in 200 and 100 milliseconds, respectively. + * @Default {false} + */ + enableAnimation?: boolean; + + /**This property is used to indicate whether the DropDownList control responds to the user interaction or not. By default, the control is in the enabled mode and you can disable it by setting it to false. + * @Default {true} + */ + enabled?: boolean; + + /**Specifies to perform incremental search for the selection of items from the DropDownList with the help of this property. This helps in selecting the item by using the typed character. + * @Default {true} + */ + enableIncrementalSearch?: boolean; + + /**This property selects the item in the DropDownList when the item is entered in the Search textbox. + * @Default {false} + */ + enableFilterSearch?: boolean; + + /**Saves the current model value to the browser cookies for state maintenance. While refreshing the DropDownList control page, it retains the model value and it is applied from the browser cookies. + * @Default {false} + */ + enablePersistence?: boolean; + + /**This enables the resize handler to resize the popup to any size. + * @Default {false} + */ + enablePopupResize?: boolean; + + /**Sets the DropDownList textbox direction from right to left align. + * @Default {false} + */ + enableRTL?: boolean; + + /**This property is used to sort the Items in the DropDownList. By default, it sorts the items in an ascending order. + * @Default {false} + */ + enableSorting?: boolean; + + /**Specifies the mapping fields for the data items of the DropDownList. + * @Default {null} + */ + fields?: Fields; + + /**When the enableFilterSearch property value is set to true, the values in the DropDownList shows the items starting with or containing the key word/letter typed in the Search textbox. + * @Default {ej.FilterType.Contains} + */ + filterType?: ej.FilterType|string; + + /**Used to create visualized header for dropdown items + * @Default {null} + */ + headerTemplate?: string; + + /**Defines the height of the DropDownList textbox. + * @Default {null} + */ + height?: string|number; + + /**It sets the given HTML attributes for the DropDownList control such as ID, name, disabled, etc. + * @Default {null} + */ + htmlAttributes?: any; + + /**Data can be fetched in the DropDownList control by using the DataSource, specifying the number of items. + * @Default {5} + */ + itemsCount?: number; + + /**Defines the maximum height of the suggestion box. This property restricts the maximum height of the popup when resize is enabled. + * @Default {null} + */ + maxPopupHeight?: string|number; + + /**Defines the minimum height of the suggestion box. This property restricts the minimum height of the popup when resize is enabled. + * @Default {null} + */ + minPopupHeight?: string|number; + + /**Defines the maximum width of the suggestion box. This property restricts the maximum width of the popup when resize is enabled. + * @Default {null} + */ + maxPopupWidth?: string|number; + + /**Defines the minimum height of the suggestion box. This property restricts the minimum height of the popup when resize is enabled. + * @Default {0} + */ + minPopupWidth?: string|number; + + /**With the help of this property, you can make a single or multi selection with the DropDownList and display the text in two modes, delimiter and visual mode. In delimiter mode, you can separate the items by using the delimiter character such as comma (,) or semi-colon (;) or any other special character. In the visual mode, the items are showcased like boxes with close icon in the textbox. + * @Default {ej.MultiSelectMode.None} + */ + multiSelectMode?: ej.MultiSelectMode|string; + + /**Defines the height of the suggestion popup box in the DropDownList control. + * @Default {152px} + */ + popupHeight?: string|number; + + /**Defines the width of the suggestion popup box in the DropDownList control. + * @Default {auto} + */ + popupWidth?: string|number; + + /**Specifies the query to retrieve the data from the DataSource. + * @Default {null} + */ + query?: any; + + /**Specifies that the DropDownList textbox values should be read-only. + * @Default {false} + */ + readOnly?: boolean; + + /**Specifies an item to be selected in the DropDownList. + * @Default {null} + */ + selectedIndex?: number; + + /**Specifies the selectedItems for the DropDownList. + * @Default {[]} + */ + selectedIndices?: Array; + + /**Selects multiple items in the DropDownList with the help of the checkbox control. To achieve this, enable the showCheckbox option to true. + * @Default {false} + */ + showCheckbox?: boolean; + + /**DropDownList control is displayed with the popup seen. + * @Default {false} + */ + showPopupOnLoad?: boolean; + + /**DropDownList textbox displayed with the rounded corner style. + * @Default {false} + */ + showRoundedCorner?: boolean; + + /**When the enableSorting property value is set to true, this property helps to sort the items either in ascending or descending order + * @Default {ej.sortOrder.Ascending} + */ + sortOrder?: ej.SortOrder|string; + + /**Specifies the targetID for the DropDownList’s items. + * @Default {null} + */ + targetID?: string; + + /**By default, you can add any text or image to the DropDownList item. To customize the item layout or to create your own visualized elements, you can use this template support. + * @Default {null} + */ + template?: string; + + /**Defines the text value that is displayed in the DropDownList textbox. + * @Default {null} + */ + text?: string; + + /**Sets the jQuery validation error message in the DropDownList + * @Default {null} + */ + validationMessage?: any; + + /**Sets the jquery validation rules in the Dropdownlist. + * @Default {null} + */ + validationRules?: any; + + /**Specifies the value (text content) for the DropDownList control. + * @Default {null} + */ + value?: string; + + /**Specifies a short hint that describes the expected value of the DropDownList control. + * @Default {null} + */ + watermarkText?: string; + + /**Defines the width of the DropDownList textbox. + * @Default {null} + */ + width?: string|number; + + /**The Virtual Scrolling feature is used to display a large amount of records in the DropDownList, that is, when scrolling, an Ajax request is sent to fetch some amount of data from the server dynamically. To achieve this scenario with DropDownList, set the allowVirtualScrolling to true. You can set the itemsCount property that represents the number of items to be fetched from the server on every Ajax request. + * @Default {normal} + */ + virtualScrollMode?: ej.VirtualScrollMode|string; + + /**Fires the action before the XHR request.*/ + actionBegin? (e: ActionBeginEventArgs): void; + + /**Fires the action when the list of items is bound to the DropDownList by xhr post calling*/ + actionComplete? (e: ActionCompleteEventArgs): void; + + /**Fires the action when the xhr post calling failed on remote data binding with the DropDownList control.*/ + actionFailure? (e: ActionFailureEventArgs): void; + + /**Fires the action when the xhr post calling succeed on remote data binding with the DropDownList control*/ + actionSuccess? (e: ActionSuccessEventArgs): void; + + /**Fires the action before the popup is ready to hide.*/ + beforePopupHide? (e: BeforePopupHideEventArgs): void; + + /**Fires the action before the popup is ready to be displayed.*/ + beforePopupShown? (e: BeforePopupShownEventArgs): void; + + /**Fires when the cascading happens between two DropDownList exactly after the value changes in the first dropdown and before filtering in the second Dropdown.*/ + cascade? (e: CascadeEventArgs): void; + + /**Fires the action when the DropDownList control’s value is changed.*/ + change? (e: ChangeEventArgs): void; + + /**Fires the action when the list item checkbox value is changed.*/ + checkChange? (e: CheckChangeEventArgs): void; + + /**Fires the action once the DropDownList is created.*/ + create? (e: CreateEventArgs): void; + + /**Fires the action when the list items is bound to the DropDownList.*/ + dataBound? (e: DataBoundEventArgs): void; + + /**Fires the action when the DropDownList is destroyed.*/ + destroy? (e: DestroyEventArgs): void; + + /**Fires the action, once the popup is closed*/ + popupHide? (e: PopupHideEventArgs): void; + + /**Fires the action, when the popup is resized.*/ + popupResize? (e: PopupResizeEventArgs): void; + + /**Fires the action, once the popup is opened.*/ + popupShown? (e: PopupShownEventArgs): void; + + /**Fires the action, when resizing a popup starts.*/ + popupResizeStart? (e: PopupResizeStartEventArgs): void; + + /**Fires the action, when the popup resizing is stopped.*/ + popupResizeStop? (e: PopupResizeStopEventArgs): void; + + /**Fires the action before filtering the list items that starts in the DropDownList when the enableFilterSearch is enabled.*/ + search? (e: SearchEventArgs): void; + + /**Fires the action, when the list of item is selected.*/ + select? (e: SelectEventArgs): void; +} + +export interface ActionBeginEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the DropDownList model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface ActionCompleteEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**Returns number of times trying to fetch the data + */ + count?: number; + + /**returns the DropDownList model + */ + model?: any; + + /**Returns the query for data retrieval + */ + query?: any; + + /**Returns the query for data retrieval from the Database + */ + request?: any; + + /**returns the name of the event + */ + type?: string; + + /**Returns the number of items fetched from remote data + */ + result?: Array; + + /**Returns the requested data + */ + xhr?: any; +} + +export interface ActionFailureEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**Returns the error message + */ + error?: any; + + /**returns the DropDownList model + */ + model?: any; + + /**Returns the query for data retrieval + */ + query?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface ActionSuccessEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**Returns number of times trying to fetch the data + */ + count?: number; + + /**returns the DropDownList model + */ + model?: any; + + /**Returns the query for data retrieval + */ + query?: any; + + /**Returns the query for data retrieval from the Database + */ + request?: any; + + /**returns the name of the event + */ + type?: string; + + /**Returns the number of items fetched from remote data + */ + result?: Array; + + /**Returns the requested data + */ + xhr?: any; +} + +export interface BeforePopupHideEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the DropDownList model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; + + /**returns the selected text + */ + text?: string; + + /**returns the selected value + */ + value?: string; +} + +export interface BeforePopupShownEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the DropDownList model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; + + /**returns the selected text + */ + text?: string; + + /**returns the selected value + */ + value?: string; +} + +export interface CascadeEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**Returns the cascading dropdown model. + */ + cascadeModel?: any; + + /**returns the current selected value in first dropdown. + */ + cascadeValue?: string; + + /**returns the DropDownList model + */ + model?: any; + + /**returns the default filter action for second dropdown data should happen or not. + */ + requiresDefaultFilter?: boolean; + + /**returns the name of the event + */ + type?: string; +} + +export interface ChangeEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**Returns the selected item with checkbox checked or not. + */ + isChecked?: boolean; + + /**Returns the selected item ID. + */ + itemId?: string; + + /**returns the DropDownList model + */ + model?: any; + + /**Returns the selected item text. + */ + selectedText?: string; + + /**returns the name of the event + */ + type?: string; + + /**Returns the selected text. + */ + text?: string; + + /**Returns the selected value. + */ + value?: string; +} + +export interface CheckChangeEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**Returns the selected item with checkbox checked or not. + */ + isChecked?: boolean; + + /**Returns the selected item ID. + */ + itemId?: string; + + /**returns the DropDownList model + */ + model?: any; + + /**Returns the selected item text. + */ + selectedText?: string; + + /**returns the name of the event + */ + type?: string; + + /**Returns the selected text. + */ + text?: string; + + /**Returns the selected value. + */ + value?: string; +} + +export interface CreateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the DropDownList model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface DataBoundEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the DropDownList model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; + + /**returns the data that is bound to DropDownList + */ + data?: any; +} + +export interface DestroyEventArgs { + + /**its value is set as true,if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the DropDownList model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface PopupHideEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the DropDownList model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; + + /**returns the selected text + */ + text?: string; + + /**returns the selected value + */ + value?: string; +} + +export interface PopupResizeEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the DropDownList model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; + + /**Returns the data from the resizable plugin. + */ + event?: any; +} + +export interface PopupShownEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the DropDownList model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; + + /**returns the selected text + */ + text?: string; + + /**returns the selected value + */ + value?: string; +} + +export interface PopupResizeStartEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the DropDownList model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; + + /**Returns the data from the resizable plugin. + */ + event?: any; +} + +export interface PopupResizeStopEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the DropDownList model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; + + /**Returns the data from the resizable plugin. + */ + event?: any; +} + +export interface SearchEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**Returns the data bound to the DropDownList. + */ + items?: any; + + /**returns the DropDownList model + */ + model?: any; + + /**Returns the selected item text. + */ + selectedText?: string; + + /**returns the name of the event + */ + type?: string; + + /**Returns the search string typed in search box. + */ + searchString?: string; +} + +export interface SelectEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**Returns the selected item with checkbox checked or not. + */ + isChecked?: boolean; + + /**Returns the selected item ID. + */ + itemId?: string; + + /**returns the DropDownList model + */ + model?: any; + + /**Returns the selected item text. + */ + selectedText?: string; + + /**returns the name of the event + */ + type?: string; + + /**Returns the selected text. + */ + text?: string; + + /**Returns the selected value. + */ + value?: string; +} + +export interface Fields { + + /**Used to group the items. + */ + groupBy?: string; + + /**Defines the HTML attributes such as ID, class, and styles for the item. + */ + htmlAttributes?: any; + + /**Defines the ID for the tag. + */ + id?: string; + + /**Defines the image attributes such as height, width, styles, and so on. + */ + imageAttributes?: string; + + /**Defines the imageURL for the image location. + */ + imageUrl?: string; + + /**Defines the tag value to be selected initially. + */ + selected?: boolean; + + /**Defines the sprite css for the image tag. + */ + spriteCssClass?: string; + + /**Defines the table name for tag value or display text while rendering remote data. + */ + tableName?: string; + + /**Defines the text content for the tag. + */ + text?: string; + + /**Defines the tag value. + */ + value?: string; +} +} +enum FilterType +{ +//filter the data wherever contains search key +Contains, +//filter the data based on search key present at start position +StartsWith, +} +enum MultiSelectMode +{ +// can select only single item in DropDownList +None, +//can select multiple items and it's seperated by delimiterChar +Delimiter, +// can select multiple items and it's show's like visual box in textbox +VisualMode, +} +enum SortOrder +{ +// Sort the data in ascending order +Ascending, +//Sort the data in descending order +Descending, +} +enum VirtualScrollMode +{ +// The data is loaded only to the corresponding page (display items). When scrolling some other position, it enables the load on demand with the DropDownList. +Normal, +//The data items are loaded from the remote when scroll handle reaches the end of the scrollbar like infinity scrolling. +Continuous, +} + +class Editor extends ej.Widget { + static fn: Editor; + constructor(element: JQuery, options?: Editor.Model); + constructor(element: Element, options?: Editor.Model); + model:Editor.Model; + defaults:Editor.Model; + + /** destroy the editor widgets all events are unbind automatically and bring the control to pre-init state. + * @returns {void} + */ + destroy(): void; + + /** To disable the corresponding Editors + * @returns {void} + */ + disable(): void; + + /** To enable the corresponding Editors + * @returns {void} + */ + enable(): void; + + /** To get value from corresponding Editors + * @returns {number} + */ + getValue(): number; +} + + class NumericTextbox extends Editor{ +} + + class CurrencyTextbox extends Editor{ +} + + class PercentageTextbox extends Editor{ +} +export module Editor{ + +export interface Model { + + /**Sets the root CSS class for Accordion theme, which is used customize. + */ + cssClass?: string; + + /**DecimalPlaces declares the number of digits to be displayed right side of the value. + * @Default {0} + */ + decimalPlaces?: number; + + /**Specify the editor control state. + * @Default {true} + */ + enabled?: boolean; + + /**Specify the enablePersistence to editor to save current model value to browser cookies for state maintains + * @Default {false} + */ + enablePersistence?: boolean; + + /**Specify the Right to Left Direction to editor. + * @Default {false} + */ + enableRTL?: boolean; + + /**Strict mode option to restrict entering values defined outside the range in the editor. + * @Default {false} + */ + enableStrictMode?: boolean; + + /**It provides the options to get the customized character to separate the digits. If not set, the separator defined by the current culture. + * @Default {null} + */ + groupSeparator?: string; + + /**Specifies the height of the editor. + * @Default {30} + */ + height?: number|string; + + /**It allows to define the characteristics of the Editors control. It will helps to extend the capability of an HTML element. + * @Default {{}} + */ + htmlAttributes?: any; + + /**The Editor value increment or decrement based an increment step value. + * @Default {1} + */ + incrementStep?: number; + + /**Specifies the Localization info used by the editor. + * @Default {en-US} + */ + locale?: string; + + /**Specifies the maximum value of the editor. + * @Default {Number.MAX_VALUE} + */ + maxValue?: number; + + /**Specifies the minimum value of the editor. + * @Default {-(Number.MAX_VALUE) and 0 for Currency Textbox.} + */ + minValue?: number; + + /**Specifies the name of the editor. + * @Default {Sets id as name if it is null.} + */ + name?: string; + + /**Toggles the readonly state of the editor. When the Editor is readonly it doesn't allow user interactions. + * @Default {false} + */ + readOnly?: boolean; + + /**Specify the rounded corner to editor + * @Default {false} + */ + showRoundedCorner?: boolean; + + /**Specifies whether the up and down spin buttons should be displayed in editor. + * @Default {true} + */ + showSpinButton?: boolean; + + /**Enables decimal separator position validation on type . + * @Default {false} + */ + validateOnType?: boolean; + + /**Set the jQuery validation error message in editor. + * @Default {null} + */ + validationMessage?: any; + + /**Set the jQuery validation rules to the editor. + * @Default {null} + */ + validationRules?: any; + + /**Specifies the value of the editor. + * @Default {null} + */ + value?: number|string; + + /**Specify the watermark text to editor. + */ + watermarkText?: string; + + /**Specifies the width of the editor. + * @Default {143} + */ + width?: number|string; + + /**Fires after Editor control value is changed.*/ + change? (e: ChangeEventArgs): void; + + /**Fires after Editor control is created.*/ + create? (e: CreateEventArgs): void; + + /**Fires when the Editor is destroyed successfully.*/ + destroy? (e: DestroyEventArgs): void; + + /**Fires after Editor control is focused.*/ + focusIn? (e: FocusInEventArgs): void; + + /**Fires after Editor control is loss the focus.*/ + focusOut? (e: FocusOutEventArgs): void; +} + +export interface ChangeEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the corresponding editor model. + */ + model ?: ej.Editor.Model; + + /**returns the name of the event. + */ + type?: string; + + /**returns the corresponding editor control value. + */ + value ?: number; + + /**returns true when the value changed by user interaction otherwise returns false + */ + isInteraction ?: boolean; +} + +export interface CreateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the editor model + */ + model ?: ej.Editor.Model; + + /**returns the name of the event + */ + type ?: string; +} + +export interface DestroyEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the editor model + */ + model ?: ej.Editor.Model; + + /**returns the name of the event + */ + type ?: string; +} + +export interface FocusInEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the corresponding editor model. + */ + model?: ej.Editor.Model; + + /**returns the name of the event. + */ + type?: string; + + /**returns the corresponding editor control value. + */ + value?: number; +} + +export interface FocusOutEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the corresponding editor model. + */ + model?: ej.Editor.Model; + + /**returns the name of the event. + */ + type?: string; + + /**returns the corresponding editor control value. + */ + value?: number; +} +} + +class ListView extends ej.Widget { + static fn: ListView; + constructor(element: JQuery, options?: ListView.Model); + constructor(element: Element, options?: ListView.Model); + model:ListView.Model; + defaults:ListView.Model; + + /** To add item in the given index. + * @param {string} Specifies the item to be added in ListView + * @param {number} Specifies the index where item to be added + * @returns {void} + */ + addItem(item: string, index: number): void; + + /** To check all the items. + * @returns {void} + */ + checkAllItem(): void; + + /** To check item in the given index. + * @param {number} Specifies the index of the item to be checked + * @returns {void} + */ + checkItem(index: number): void; + + /** To clear all the list item in the control before updating with new datasource. + * @returns {void} + */ + clear(): void; + + /** To make the item in the given index to be default state. + * @param {number} Specifies the index to make the item to be in default state. + * @returns {void} + */ + deActive(index: number): void; + + /** To disable item in the given index. + * @param {number} Specifies the index value to be disabled. + * @returns {void} + */ + disableItem(index: number): void; + + /** To enable item in the given index. + * @param {number} Specifies the index value to be enabled. + * @returns {void} + */ + enableItem(index: number): void; + + /** To get the active item. + * @returns {HTMLElement} + */ + getActiveItem(): HTMLElement; + + /** To get the text of the active item. + * @returns {string} + */ + getActiveItemText(): string; + + /** To get all the checked items. + * @returns {Array} + */ + getCheckedItems(): Array; + + /** To get the text of all the checked items. + * @returns {Array} + */ + getCheckedItemsText(): Array; + + /** To get the total item count. + * @returns {number} + */ + getItemsCount(): number; + + /** To get the text of the item in the given index. + * @param {string|number} Specifies the index value to get the textvalue. + * @returns {string} + */ + getItemText(index: string|number): string; + + /** To check whether the item in the given index has child item. + * @param {number} Specifies the index value to check the item has child or not. + * @returns {boolean} + */ + hasChild(index: number): boolean; + + /** To hide the list. + * @returns {void} + */ + hide(): void; + + /** To hide item in the given index. + * @param {number} Specifies the index value to hide the item. + * @returns {void} + */ + hideItem(index: number): void; + + /** To check whether item in the given index is checked. + * @returns {boolean} + */ + isChecked(): boolean; + + /** To load the ajax content while selecting the item. + * @param {string} Specifies the item to load the ajax content. + * @returns {void} + */ + loadAjaxContent(item: string): void; + + /** To remove the check mark either for specific item in the given index or for all items. + * @param {number} Specifies the index value to remove the checkbox. + * @returns {void} + */ + removeCheckMark(index: number): void; + + /** To remove item in the given index. + * @param {number} Specifies the index value to remove the item. + * @returns {void} + */ + removeItem(index: number): void; + + /** To select item in the given index. + * @param {number} Specifies the index value to select the item. + * @returns {void} + */ + selectItem(index: number): void; + + /** To make the item in the given index to be active state. + * @param {number} Specifies the index value to make the item in active state. + * @returns {void} + */ + setActive(index: number): void; + + /** To show the list. + * @returns {void} + */ + show(): void; + + /** To show item in the given index. + * @param {number} Specifies the index value to show the hided item. + * @returns {void} + */ + showItem(index: number): void; + + /** To uncheck all the items. + * @returns {void} + */ + unCheckAllItem(): void; + + /** To uncheck item in the given index. + * @param {number} Specifies the index value to uncheck the item. + * @returns {void} + */ + unCheckItem(index: number): void; +} +export module ListView{ + +export interface Model { + + /**Sets the root class for ListView theme. This cssClass API helps to use custom skinning option for ListView control. By defining the root class using this API, we need to include this root class in CSS. + */ + cssClass?: string; + + /**Contains the list of data for generating the ListView items. + * @Default {[]} + */ + dataSource?: Array; + + /**Specifies whether to load ajax content while selecting item. + * @Default {false} + */ + enableAjax?: boolean; + + /**Specifies whether to enable caching the content. + * @Default {false} + */ + enableCache?: boolean; + + /**Specifies whether to enable check mark for the item. + * @Default {false} + */ + enableCheckMark?: boolean; + + /**Specifies whether to enable the filtering feature to filter the item. + * @Default {false} + */ + enableFiltering?: boolean; + + /**Specifies whether to group the list item. + * @Default {false} + */ + enableGroupList?: boolean; + + /**Specifies to maintain the current model value to browser cookies for state maintenance. While refresh the page, the model value will get apply to the control from browser cookies. + * @Default {false} + */ + enablePersistence?: boolean; + + /**Specifies the field settings to map the datasource. + */ + fieldSettings?: any; + + /**Specifies the text of the back button in the header. + * @Default {null} + */ + headerBackButtonText?: string; + + /**Specifies the title of the header. + * @Default {Title} + */ + headerTitle?: string; + + /**Specifies the height. + * @Default {null} + */ + height?: number; + + /**Specifies whether to retain the selection of the item. + * @Default {false} + */ + persistSelection?: boolean; + + /**Specifies whether to prevent the selection of the item. + * @Default {false} + */ + preventSelection?: boolean; + + /**Specifies the query to execute with the datasource. + * @Default {null} + */ + query?: any; + + /**Specifies whether need to render the control with the template contents. + * @Default {false} + */ + renderTemplate?: boolean; + + /**Specifies the index of item which need to be in selected state initially while loading. + * @Default {0} + */ + selectedItemIndex?: number; + + /**Specifies whether to show the header. + * @Default {true} + */ + showHeader?: boolean; + + /**Specifies ID of the element contains template contents. + * @Default {false} + */ + templateId?: boolean; + + /**Specifies the width. + * @Default {null} + */ + width?: number; + + /**Event triggers before the ajax request happens.*/ + ajaxBeforeLoad? (e: AjaxBeforeLoadEventArgs): void; + + /**Event triggers after the ajax content loaded completely.*/ + ajaxComplete? (e: AjaxCompleteEventArgs): void; + + /**Event triggers when the ajax request failed.*/ + ajaxError? (e: AjaxErrorEventArgs): void; + + /**Event triggers after the ajax content loaded successfully.*/ + ajaxSuccess? (e: AjaxSuccessEventArgs): void; + + /**Event triggers before the items loaded.*/ + load? (e: LoadEventArgs): void; + + /**Event triggers after the items loaded.*/ + loadComplete? (e: LoadCompleteEventArgs): void; + + /**Event triggers when mouse down happens on the item.*/ + mouseDown? (e: MouseDownEventArgs): void; + + /**Event triggers when mouse up happens on the item.*/ + mouseUP? (e: MouseUPEventArgs): void; +} + +export interface AjaxBeforeLoadEventArgs { + + /**returns true if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the name of the event. + */ + type?: string; + + /**returns the model value of the control. + */ + model?: any; + + /**returns the ajax settings. + */ + ajaxData?: any; +} + +export interface AjaxCompleteEventArgs { + + /**returns true if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the name of the event. + */ + type?: string; + + /**returns the model value of the control. + */ + model?: any; +} + +export interface AjaxErrorEventArgs { + + /**returns true if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the name of the event. + */ + type?: string; + + /**returns the model value of the control. + */ + model?: any; + + /**returns the error thrown in the ajax post. + */ + errorThrown?: any; + + /**returns the status. + */ + textStatus?: any; + + /**returns the current list item. + */ + item?: any; + + /**returns the current item text. + */ + text?: string; + + /**returns the current item index. + */ + index?: number; +} + +export interface AjaxSuccessEventArgs { + + /**returns true if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the name of the event. + */ + type?: string; + + /**returns the model value of the control. + */ + model?: any; + + /**returns the ajax current content. + */ + content?: string; + + /**returns the current list item. + */ + item?: any; + + /**returns the current item text. + */ + text?: string; + + /**returns the current item index. + */ + index?: number; + + /**returns the current url of the ajax post. + */ + url?: string; +} + +export interface LoadEventArgs { + + /**returns true if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the name of the event. + */ + type?: string; + + /**returns the model value of the control. + */ + model?: any; +} + +export interface LoadCompleteEventArgs { + + /**returns true if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the name of the event. + */ + type?: string; + + /**returns the model value of the control. + */ + model?: any; +} + +export interface MouseDownEventArgs { + + /**returns true if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the name of the event. + */ + type?: string; + + /**returns the model value of the control. + */ + model?: any; + + /**If the child element exist return true; otherwise, false. + */ + hasChild?: boolean; + + /**returns the current list item. + */ + item?: string; + + /**returns the current text of item. + */ + text?: string; + + /**returns the current Index of the item. + */ + index?: number; + + /**If checked return true; otherwise, false. + */ + isChecked?: boolean; + + /**returns the list of checked items. + */ + checkedItems?: number; + + /**returns the current checked item text. + */ + checkedItemsText?: string; +} + +export interface MouseUPEventArgs { + + /**returns true if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the name of the event. + */ + type?: string; + + /**returns the model value of the control. + */ + model?: any; + + /**If the child element exist return true; otherwise, false. + */ + hasChild?: boolean; + + /**returns the current list item. + */ + item?: string; + + /**returns the current text of item. + */ + text?: string; + + /**returns the current Index of the item. + */ + index?: number; + + /**If checked return true; otherwise, false. + */ + isChecked?: boolean; + + /**returns the list of checked items. + */ + checkedItems?: number; + + /**returns the current checked item text. + */ + checkedItemsText?: string; +} +} + +class MaskEdit extends ej.Widget { + static fn: MaskEdit; + constructor(element: JQuery, options?: MaskEdit.Model); + constructor(element: Element, options?: MaskEdit.Model); + model:MaskEdit.Model; + defaults:MaskEdit.Model; + + /** To clear the text in mask edit textbox control. + * @returns {void} + */ + clear(): void; + + /** To disable the mask edit textbox control. + * @returns {void} + */ + disable(): void; + + /** To enable the mask edit textbox control. + * @returns {void} + */ + enable(): void; + + /** To obtained the pure value of the text value, removes all the symbols in mask edit textbox control. + * @returns {string} + */ + get_StrippedValue(): string; + + /** To obtained the textbox value as such that, Just replace all '_' to ' '(space) in mask edit textbox control. + * @returns {string} + */ + get_UnstrippedValue(): string; +} +export module MaskEdit{ + +export interface Model { + + /**Specify the cssClass to achieve custom theme. + * @Default {null} + */ + cssClass?: string; + + /**Specify the custom character allowed to entered in mask edit textbox control. + * @Default {null} + */ + customCharacter?: string; + + /**Specify the state of the mask edit textbox control. + * @Default {true} + */ + enabled?: boolean; + + /**Specify the enablePersistence to mask edit textbox to save current model value to browser cookies for state maintains. + */ + enablePersistence?: boolean; + + /**Specifies the height for the mask edit textbox control. + * @Default {28 px} + */ + height?: string; + + /**Specifies whether hide the prompt characters with spaces on blur. Prompt chars will be shown again on focus the textbox. + * @Default {false} + */ + hidePromptOnLeave?: boolean; + + /**Specifies the list of html attributes to be added to mask edit textbox. + * @Default {{}} + */ + htmlAttributes?: any; + + /**Specify the inputMode for mask edit textbox control. See InputMode + * @Default {ej.InputMode.Text} + */ + inputMode?: ej.InputMode|string; + + /**Specifies the input mask. + * @Default {null} + */ + maskFormat?: string; + + /**Specifies the name attribute value for the mask edit textbox. + * @Default {null} + */ + name?: string; + + /**Toggles the readonly state of the mask edit textbox. When the mask edit textbox is readonly, it doesn't allow your input. + * @Default {false} + */ + readOnly?: boolean; + + /**Specifies whether the error will show until correct value entered in the mask edit textbox control. + * @Default {false} + */ + showError?: boolean; + + /**MaskEdit input is displayed in rounded corner style when this property is set to true. + * @Default {false} + */ + showRoundedCorner?: boolean; + + /**Specify the text alignment for mask edit textbox control.See TextAlign + * @Default {left} + */ + textAlign?: ej.TextAlign|string; + + /**Sets the jQuery validation error message in mask edit. This property works when the widget is present inside the form. Include jquery.validate.min.js plugin additionally. + * @Default {null} + */ + validationMessage?: any; + + /**Sets the jQuery validation rules to the MaskEdit. This property works when the widget is present inside the form. Include jquery.validate.min.js plugin additionally. + * @Default {null} + */ + validationRules?: any; + + /**Specifies the value for the mask edit textbox control. + * @Default {null} + */ + value?: string; + + /**Specifies the water mark text to be displayed in input text. + * @Default {null} + */ + watermarkText?: string; + + /**Specifies the width for the mask edit textbox control. + * @Default {143pixel} + */ + width?: string; + + /**Fires when value changed in mask edit textbox control.*/ + change? (e: ChangeEventArgs): void; + + /**Fires after MaskEdit control is created.*/ + create? (e: CreateEventArgs): void; + + /**Fires when the MaskEdit is destroyed successfully.*/ + destroy? (e: DestroyEventArgs): void; + + /**Fires when focused in mask edit textbox control.*/ + focusIn? (e: FocusInEventArgs): void; + + /**Fires when focused out in mask edit textbox control.*/ + focusOut? (e: FocusOutEventArgs): void; + + /**Fires when keydown in mask edit textbox control.*/ + keydown? (e: KeydownEventArgs): void; + + /**Fires when key press in mask edit textbox control.*/ + keyPress? (e: KeyPressEventArgs): void; + + /**Fires when keyup in mask edit textbox control.*/ + keyup? (e: KeyupEventArgs): void; + + /**Fires when mouse out in mask edit textbox control.*/ + mouseout? (e: MouseoutEventArgs): void; + + /**Fires when mouse over in mask edit textbox control.*/ + mouseover? (e: MouseoverEventArgs): void; +} + +export interface ChangeEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the mask edit model + */ + model?: ej.MaskEdit.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the mask edit value + */ + value?: number; + + /**returns unstripped value in mask edit textbox control. + */ + unmaskedValue?: string; +} + +export interface CreateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the MaskEdit model + */ + model?: ej.MaskEdit.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the MaskEdit model + */ + model?: ej.MaskEdit.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface FocusInEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the mask edit model + */ + model?: ej.MaskEdit.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the mask edit value + */ + value?: number; + + /**returns unstripped value in mask edit textbox control. + */ + unmaskedValue?: string; +} + +export interface FocusOutEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the mask edit model + */ + model?: ej.MaskEdit.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the mask edit value + */ + value?: number; + + /**returns unstripped value in mask edit textbox control. + */ + unmaskedValue?: string; +} + +export interface KeydownEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the mask edit model + */ + model?: ej.MaskEdit.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the mask edit value + */ + value?: number; + + /**returns unstripped value in mask edit textbox control. + */ + unmaskedValue?: string; +} + +export interface KeyPressEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the mask edit model + */ + model?: ej.MaskEdit.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the mask edit value + */ + value?: number; + + /**returns unstripped value in mask edit textbox control. + */ + unmaskedValue?: string; +} + +export interface KeyupEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the mask edit model + */ + model?: ej.MaskEdit.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the mask edit value + */ + value?: number; + + /**returns unstripped value in mask edit textbox control. + */ + unmaskedValue?: string; +} + +export interface MouseoutEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the mask edit model + */ + model?: ej.MaskEdit.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the mask edit value + */ + value?: number; + + /**returns unstripped value in mask edit textbox control. + */ + unmaskedValue?: string; +} + +export interface MouseoverEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the mask edit model + */ + model?: ej.MaskEdit.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the mask edit value + */ + value?: number; + + /**returns unstripped value in mask edit textbox control. + */ + unmaskedValue?: string; +} +} +enum InputMode +{ +//string +Password, +//string +Text, +} +enum TextAlign +{ +//string +Center, +//string +Justify, +//string +Left, +//string +Right, +} + +class Menu extends ej.Widget { + static fn: Menu; + constructor(element: JQuery, options?: Menu.Model); + constructor(element: Element, options?: Menu.Model); + model:Menu.Model; + defaults:Menu.Model; + + /** Disables the Menu control. + * @returns {void} + */ + disable(): void; + + /** Specifies the Menu Item to be disabled by using the Menu Item Text. + * @param {string} Specifies the Menu Item Text to be disabled. + * @returns {void} + */ + disableItem(itemtext: string): void; + + /** Specifies the Menu Item to be disabled by using the Menu Item Id. + * @param {string|number} Specifies the Menu Item id to be disabled + * @returns {void} + */ + disableItembyID(itemid: string|number): void; + + /** Enables the Menu control. + * @returns {void} + */ + enable(): void; + + /** Specifies the Menu Item to be enabled by using the Menu Item Text. + * @param {string} Specifies the Menu Item Text to be enabled. + * @returns {void} + */ + enableItem(itemtext: string): void; + + /** Specifies the Menu Item to be enabled by using the Menu Item Id. + * @param {string|number} Specifies the Menu Item id to be enabled. + * @returns {void} + */ + enableItembyID(itemid: string|number): void; + + /** Hides the Context Menu control. + * @returns {void} + */ + hide(): void; + + /** Insert the menu item as child of target node. + * @param {any} Information about Menu item. + * @param {string|any} Selector of target node or Object of target node. + * @returns {void} + */ + insert(item: any, target: string|any): void; + + /** Insert the menu item after the target node. + * @param {any} Information about Menu item. + * @param {string|any} Selector of target node or Object of target node. + * @returns {void} + */ + insertAfter(item: any, target: string|any): void; + + /** Insert the menu item before the target node. + * @param {any} Information about Menu item. + * @param {string|any} Selector of target node or Object of target node. + * @returns {void} + */ + insertBefore(item: any, target: string|any): void; + + /** Remove Menu item. + * @param {any|Array} Selector of target node or Object of target node. + * @returns {void} + */ + remove(target: any|Array): void; + + /** To show the Menu control. + * @param {number} x co-ordinate position of context menu. + * @param {number} y co-ordinate position of context menu. + * @param {any} target element + * @param {any} name of the event + * @returns {void} + */ + show(locationX: number, locationY: number, targetElement: any, event: any): void; +} +export module Menu{ + +export interface Model { + + /**To enable or disable the Animation while hover or click an menu items.See AnimationType + * @Default {ej.AnimationType.Default} + */ + animationType?: ej.AnimationType|string; + + /**Specifies the target id of context menu. On right clicking the specified contextTarget element, context menu gets shown. + * @Default {null} + */ + contextMenuTarget?: string; + + /**Specify the CSS class to achieve custom theme. + */ + cssClass?: string; + + /**To enable or disable the Animation effect while hover or click an menu items. + * @Default {true} + */ + enableAnimation?: boolean; + + /**Specifies the root menu items to be aligned center in horizontal menu. + * @Default {false} + */ + enableCenterAlign?: boolean; + + /**Enable / Disable the Menu control. + * @Default {true} + */ + enabled?: boolean; + + /**Specifies the menu items to be displayed in right to left direction. + * @Default {false} + */ + enableRTL?: boolean; + + /**When this property sets to false, the menu items is displayed without any separators. + * @Default {true} + */ + enableSeparator?: boolean; + + /**Specifies the target which needs to be excluded. i.e., The context menu will not be displayed in those specified targets. + * @Default {null} + */ + excludeTarget?: string; + + /**Fields used to bind the data source and it includes following field members to make databind easier. + * @Default {null} + */ + fields?: Fields; + + /**Specifies the height of the root menu. + * @Default {auto} + */ + height?: string|number; + + /**Specifies the list of html attributes to be added to menu control. + * @Default {{}} + */ + htmlAttributes?: any; + + /**Specifies the type of the menu. Essential JavaScript Menu consists of two type of menu, they are Normal Menu and Context Menu mode.See MenuType + * @Default {ej.MenuType.NormalMenu} + */ + menuType?: string|ej.MenuType; + + /**Specifies the sub menu items to be show or open only on click. + * @Default {false} + */ + openOnClick?: boolean; + + /**Specifies the orientation of normal menu. Normal menu can rendered in horizontal or vertical direction by using this API. See Orientation + * @Default {ej.Orientation.Horizontal} + */ + orientation?: string|ej.Orientation; + + /**Specifies the main menu items arrows only to be shown if it contains child items. + * @Default {true} + */ + showRooltLevelArrows?: boolean; + + /**Specifies the sub menu items arrows only to be shown if it contains child items. + * @Default {true} + */ + showSubLevelArrows?: boolean; + + /**Specifies position of pulldown submenus that will appear on mouse over.See Direction + * @Default {ej.Direction.Right} + */ + subMenuDirection?: string|ej.Direction; + + /**Specifies the title to responsive menu. + * @Default {Menu} + */ + titleText?: string; + + /**Specifies the width of the main menu. + * @Default {auto} + */ + width?: string|number; + + /**Fires before context menu gets open.*/ + beforeOpen? (e: BeforeOpenEventArgs): void; + + /**Fires when mouse click on menu items.*/ + click? (e: ClickEventArgs): void; + + /**Fire when context menu on close.*/ + close? (e: CloseEventArgs): void; + + /**Fires when context menu on open.*/ + open? (e: OpenEventArgs): void; + + /**Fires to create menu items.*/ + create? (e: CreateEventArgs): void; + + /**Fires to destroy menu items.*/ + destroy? (e: DestroyEventArgs): void; + + /**Fires when key down on menu items.*/ + keydown? (e: KeydownEventArgs): void; + + /**Fires when mouse out from menu items.*/ + mouseout? (e: MouseoutEventArgs): void; + + /**Fires when mouse over the Menu items.*/ + mouseover? (e: MouseoverEventArgs): void; +} + +export interface BeforeOpenEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the menu model + */ + model?: ej.Menu.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the target element + */ + target?: any; +} + +export interface ClickEventArgs { + + /**returns the menu model + */ + model?: ej.Menu.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns clicked menu item text + */ + text?: string; + + /**returns clicked menu item element + */ + element?: any; + + /**returns the event + */ + event?: any; + + /**returns the selected item + */ + selectedItem?: number; +} + +export interface CloseEventArgs { + + /**returns the menu model + */ + model?: ej.Menu.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the target element + */ + target?: any; +} + +export interface OpenEventArgs { + + /**returns the menu model + */ + model?: ej.Menu.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the target element + */ + target?: any; +} + +export interface CreateEventArgs { + + /**returns the menu model + */ + model?: ej.Menu.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**returns the menu model + */ + model?: ej.Menu.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface KeydownEventArgs { + + /**returns the menu model + */ + model?: ej.Menu.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns clicked menu item text + */ + menuText?: string; + + /**returns clicked menu item element + */ + element?: any; + + /**returns the event + */ + event?: any; +} + +export interface MouseoutEventArgs { + + /**returns the menu model + */ + model?: ej.Menu.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns clicked menu item text + */ + text?: string; + + /**returns clicked menu item element + */ + element?: any; + + /**returns the event + */ + event?: any; +} + +export interface MouseoverEventArgs { + + /**returns the menu model + */ + model?: ej.Menu.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns clicked menu item text + */ + text?: string; + + /**returns clicked menu item element + */ + element?: any; + + /**returns the event + */ + event?: any; +} + +export interface Fields { + + /**It receives the child data for the inner level. + */ + child?: any; + + /**It receives datasource as Essential DataManager object and JSON object. + */ + dataSource?: any; + + /**Specifies the html attributes to “li” item list. + */ + htmlAttribute?: string; + + /**Specifies the id to menu items list + */ + id?: string; + + /**Specifies the image attribute to “img” tag inside items list. + */ + imageAttribute?: string; + + /**Specifies the image URL to “img” tag inside item list. + */ + imageUrl?: string; + + /**Adds custom attributes like "target" to the anchor tag of the menu items. + */ + linkAttribute?: string; + + /**Specifies the parent id of the table. + */ + parentId?: string; + + /**It receives query to retrieve data from the table (query is same as SQL). + */ + query?: any; + + /**Specifies the sprite CSS class to “li” item list. + */ + spriteCssClass?: string; + + /**It receives table name to execute query on the corresponding table. + */ + tableName?: string; + + /**Specifies the text of menu items list. + */ + text?: string; + + /**Specifies the url to the anchor tag in menu item list. + */ + url?: string; +} +} +enum AnimationType +{ +//string +Default, +//string +None, +} +enum MenuType +{ +//string +ContextMenu, +//string +NormalMenu, +} +enum Direction +{ +//string +Left, +//string +None, +//string +Right, +} + +class Pager extends ej.Widget { + static fn: Pager; + constructor(element: JQuery, options?: Pager.Model); + constructor(element: Element, options?: Pager.Model); + model:Pager.Model; + defaults:Pager.Model; + + /** Send a paging request to specified page through the pagerControl. + * @returns {void} + */ + gotoPage(): void; +} +export module Pager{ + +export interface Model { + + /**Gets or sets a value that indicates whether to define the number of records displayed per page. + * @Default {12} + */ + pageSize?: number; + + /**Gets or sets a value that indicates whether to define the number of pages displayed in the pager for navigation. + * @Default {10} + */ + pageCount?: number; + + /**Gets or sets a value that indicates whether to define which page to display currently in pager. + * @Default {1} + */ + currentPage?: number; + + /**Get or sets a value of total number of pages in the pager. The totalPages value is calculated based on pagesize and totalrecords. + * @Default {null} + */ + totalPages?: number; + + /**Get the value of total number of records which is bound to a data item. + * @Default {null} + */ + totalRecordsCount?: number; + + /**Gets or sets a value that indicates whether to pass the current page information as a query string along with the url while navigating to other page. + * @Default {false} + */ + enableQueryString?: boolean; + + /**Gets or sets a value that indicates whether to customizing the user interface (UI) as locale-specific in order to display regional data i.e. in a language and culture specific to a particular country or region. + * @Default {en-US} + */ + locale?: string; + + /**Align content in the pager control from right to left by setting the property as true. + * @Default {false} + */ + enableRTL?: boolean; + + /**Triggered when pager numeric item is clicked in pager control.*/ + click? (e: ClickEventArgs): void; +} + +export interface ClickEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the current page index. + */ + currentPage?: number; + + /**Returns the pager model. + */ + model?: any; + + /**Returns the name of event + */ + type?: string; + + /**Returns current action event type and its target. + */ + event?: any; +} +} + +class ProgressBar extends ej.Widget { + static fn: ProgressBar; + constructor(element: JQuery, options?: ProgressBar.Model); + constructor(element: Element, options?: ProgressBar.Model); + model:ProgressBar.Model; + defaults:ProgressBar.Model; + + /** Destroy the progressbar widget + * @returns {void} + */ + destroy(): void; + + /** Disables the progressbar control + * @returns {void} + */ + disable(): void; + + /** Enables the progressbar control + * @returns {void} + */ + enable(): void; + + /** Returns the current progress value in percent. + * @returns {number} + */ + getPercentage(): number; + + /** Returns the current progress value + * @returns {number} + */ + getValue(): number; +} +export module ProgressBar{ + +export interface Model { + + /**Sets the root CSS class for ProgressBar theme, which is used customize. + * @Default {null} + */ + cssClass?: string; + + /**When this property sets to false, it disables the ProgressBar control + * @Default {true} + */ + enabled?: boolean; + + /**Save current model value to browser cookies for state maintains. While refresh the progressBar control page retains the model value apply from browser cookies + * @Default {false} + */ + enablePersistence?: boolean; + + /**Sets the ProgressBar direction as right to left alignment. + * @Default {false} + */ + enableRTL?: boolean; + + /**Defines the height of the ProgressBar. + * @Default {null} + */ + height?: number|string; + + /**It allows to define the characteristics of the progressBar control. It will helps to extend the capability of an HTML element. + * @Default {{}} + */ + htmlAttributes?: any; + + /**Sets the maximum value of the ProgressBar. + * @Default {100} + */ + maxValue?: number; + + /**Sets the minimum value of the ProgressBar. + * @Default {0} + */ + minValue?: number; + + /**Sets the ProgressBar value in percentage. The value should be in between 0 to 100. + * @Default {0} + */ + percentage?: number; + + /**Displays rounded corner borders on the progressBar control. + * @Default {false} + */ + showRoundedCorner?: boolean; + + /**Sets the custom text for the ProgressBar. The text placed in the middle of the ProgressBar and it can be customizable using the class 'e-progress-text'. + * @Default {null} + */ + text?: string; + + /**Sets the ProgressBar value. The value should be in between min and max values. + * @Default {0} + */ + value?: number; + + /**Defines the width of the ProgressBar. + * @Default {null} + */ + width?: number|string; + + /**Event triggers when the progress value changed*/ + change? (e: ChangeEventArgs): void; + + /**Event triggers when the process completes (at 100%)*/ + complete? (e: CompleteEventArgs): void; + + /**Event triggers when the progressbar are created*/ + create? (e: CreateEventArgs): void; + + /**Event triggers when the progressbar are destroyed*/ + destroy? (e: DestroyEventArgs): void; + + /**Event triggers when the process starts (from 0%)*/ + start? (e: StartEventArgs): void; +} + +export interface ChangeEventArgs { + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the ProgressBar model + */ + model?: ej.ProgressBar.Model; + + /**returns the current progress percentage + */ + percentage?: any; + + /**returns the name of the event + */ + type?: string; + + /**returns the current progress value + */ + value?: string; +} + +export interface CompleteEventArgs { + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the ProgressBar model + */ + model?: ej.ProgressBar.Model; + + /**returns the current progress percentage + */ + percentage?: any; + + /**returns the name of the event + */ + type?: string; + + /**returns the current progress value + */ + value?: string; +} + +export interface CreateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the progressbar model + */ + model?: ej.ProgressBar.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the progressbar model + */ + model?: ej.ProgressBar.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface StartEventArgs { + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the ProgressBar model + */ + model?: ej.ProgressBar.Model; + + /**returns the current progress percentage + */ + percentage?: any; + + /**returns the name of the event + */ + type?: string; + + /**returns the current progress value + */ + value?: string; +} +} + +class RadioButton extends ej.Widget { + static fn: RadioButton; + constructor(element: JQuery, options?: RadioButton.Model); + constructor(element: Element, options?: RadioButton.Model); + model:RadioButton.Model; + defaults:RadioButton.Model; + + /** To disable the RadioButton + * @returns {void} + */ + disable(): void; + + /** To enable the RadioButton + * @returns {void} + */ + enable(): void; +} +export module RadioButton{ + +export interface Model { + + /**Specifies the check attribute of the Radio Button. + * @Default {false} + */ + checked?: boolean; + + /**Specify the CSS class to RadioButton to achieve custom theme. + */ + cssClass?: string; + + /**Specifies the RadioButton control state. + * @Default {true} + */ + enabled?: boolean; + + /**Specifies the enablePersistence property for RadioButton while initialization. The enablePersistence API save current model value to browser cookies for state maintains. While refreshing the radio button control page the model value apply from browser cookies. + * @Default {false} + */ + enablePersistence?: boolean; + + /**Specify the Right to Left direction to RadioButton + * @Default {false} + */ + enableRTL?: boolean; + + /**Specifies the HTML Attributes of the Checkbox + * @Default {{}} + */ + htmlAttributes?: any; + + /**Specifies the id attribute for the Radio Button while initialization. + * @Default {null} + */ + id?: string; + + /**Specify the idPrefix value to be added before the current id of the RadioButton. + * @Default {ej} + */ + idPrefix?: string; + + /**Specifies the name attribute for the Radio Button while initialization. + * @Default {Sets id as name if it is null} + */ + name?: string; + + /**Specifies the size of the RadioButton. + * @Default {small} + */ + size?: ej.RadioButtonSize|string; + + /**Specifies the text content for RadioButton. + */ + text?: string; + + /**Set the jquery validation error message in radio button. + * @Default {null} + */ + validationMessage?: any; + + /**Set the jquery validation rules in radio button. + * @Default {null} + */ + validationRules?: any; + + /**Specifies the value attribute of the Radio Button. + * @Default {null} + */ + value?: string; + + /**Fires before the RadioButton is going to changed its state successfully*/ + beforeChange? (e: BeforeChangeEventArgs): void; + + /**Fires when the RadioButton state is changed successfully*/ + change? (e: ChangeEventArgs): void; + + /**Fires when the RadioButton created successfully*/ + create? (e: CreateEventArgs): void; + + /**Fires when the RadioButton destroyed successfully*/ + destroy? (e: DestroyEventArgs): void; +} + +export interface BeforeChangeEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the RadioButton model + */ + model?: ej.RadioButton.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns true if element is checked, otherwise returns false + */ + isChecked?: boolean; + + /**returns true if change event triggered by interaction, otherwise returns false + */ + isInteraction?: boolean; +} + +export interface ChangeEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the RadioButton model + */ + model?: ej.RadioButton.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns true if element is checked, otherwise returns false + */ + isChecked?: boolean; + + /**returns true if change event triggered by interaction, otherwise returns false + */ + isInteraction?: boolean; +} + +export interface CreateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the RadioButton model + */ + model?: ej.RadioButton.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the RadioButton model + */ + model?: ej.RadioButton.Model; + + /**returns the name of the event + */ + type?: string; +} +} +enum RadioButtonSize +{ +//Shows small size radio button +Small, +//Shows medium size radio button +Medium, +} + +class Rating extends ej.Widget { + static fn: Rating; + constructor(element: JQuery, options?: Rating.Model); + constructor(element: Element, options?: Rating.Model); + model:Rating.Model; + defaults:Rating.Model; + + /** Destroy the Rating widget all events bound will be unbind automatically and bring the control to pre-init state. + * @returns {void} + */ + destroy(): void; + + /** To get the current value of rating control. + * @returns {number} + */ + getValue(): number; + + /** To hide the rating control. + * @returns {void} + */ + hide(): void; + + /** User can refresh the rating control to identify changes. + * @returns {void} + */ + refresh(): void; + + /** To reset the rating value. + * @returns {void} + */ + reset(): void; + + /** To set the rating value. + * @param {string|number} Specifies the rating value. + * @returns {void} + */ + setValue(value: string|number): void; + + /** To show the rating control + * @returns {void} + */ + show(): void; +} +export module Rating{ + +export interface Model { + + /**Enables the rating control with reset button.It can be used to reset the rating control value. + * @Default {true} + */ + allowReset?: boolean; + + /**Specify the CSS class to achieve custom theme. + */ + cssClass?: string; + + /**When this property is set to false, it disables the rating control. + * @Default {true} + */ + enabled?: boolean; + + /**Save current model value to browser cookies for state maintenance. While refresh the page Rating control values are retained. + * @Default {false} + */ + enablePersistence?: boolean; + + /**Specifies the height of the Rating control wrapper. + * @Default {null} + */ + height?: string; + + /**Specifies the value to be increased while navigating between shapes(stars) in Rating control. + * @Default {1} + */ + incrementStep?: number; + + /**Allow to render the maximum number of Rating shape(star). + * @Default {5} + */ + maxValue?: number; + + /**Allow to render the minimum number of Rating shape(star). + * @Default {0} + */ + minValue?: number; + + /**Specifies the orientation of Rating control. See Orientation + * @Default {ej.Rating.Orientation.Horizontal} + */ + orientation?: ej.Orientation|string; + + /**Helps to provide more precise ratings.Rating control supports three precision modes - full, half, and exact. See Precision + * @Default {full} + */ + precision?: ej.Rating.Precision|string; + + /**Interaction with Rating control can be prevented by enabling this API. + * @Default {false} + */ + readOnly?: boolean; + + /**To specify the height of each shape in Rating control. + * @Default {23} + */ + shapeHeight?: number; + + /**To specify the width of each shape in Rating control. + * @Default {23} + */ + shapeWidth?: number; + + /**Enables the tooltip option.Currently selected value will be displayed in tooltip. + * @Default {true} + */ + showTooltip?: boolean; + + /**To specify the number of stars to be selected while rendering. + * @Default {1} + */ + value?: number; + + /**Specifies the width of the Rating control wrapper. + * @Default {null} + */ + width?: string; + + /**Fires when Rating value changes.*/ + change? (e: ChangeEventArgs): void; + + /**Fires when Rating control is clicked successfully.*/ + click? (e: ClickEventArgs): void; + + /**Fires when Rating control is created.*/ + create? (e: CreateEventArgs): void; + + /**Fires when Rating control is destroyed successfully.*/ + destroy? (e: DestroyEventArgs): void; + + /**Fires when mouse hover is removed from Rating control.*/ + mouseout? (e: MouseoutEventArgs): void; + + /**Fires when mouse hovered over the Rating control.*/ + mouseover? (e: MouseoverEventArgs): void; +} + +export interface ChangeEventArgs { + + /**returns the current value. + */ + value?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the rating model + */ + model?: ej.Rating.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the mouse click event args values. + */ + event?: any; +} + +export interface ClickEventArgs { + + /**returns the current value. + */ + value?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the rating model + */ + model?: ej.Rating.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the mouse click event args values. + */ + event?: any; +} + +export interface CreateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the rating model + */ + model?: ej.Rating.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the rating model + */ + model?: ej.Rating.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface MouseoutEventArgs { + + /**returns the current value. + */ + value?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the rating model + */ + model?: ej.Rating.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the mouse click event args values. + */ + event?: any; +} + +export interface MouseoverEventArgs { + + /**returns the current value. + */ + value?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the rating model + */ + model?: ej.Rating.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the mouse click event args values. + */ + event?: any; + + /**returns the current index value. + */ + index?: any; +} + +enum Precision{ + + ///string + Exact, + + ///string + Full, + + ///string + Half +} + +} + +class Ribbon extends ej.Widget { + static fn: Ribbon; + constructor(element: JQuery, options?: Ribbon.Model); + constructor(element: Element, options?: Ribbon.Model); + model:Ribbon.Model; + defaults:Ribbon.Model; + + /** Adds contextual tab or contextual tab set dynamically in the ribbon control with contextual tabs object and index position. When index is null, ribbon contextual tab or contextual tab set is added at the last index. + * @param {any} contextual tab or contextual tab set object. + * @param {number} index of the contextual tab or contextual tab set, this is optional. + * @returns {void} + */ + addContextualTabs(contextualTabSet: any, index: number): void; + + /** Adds tab dynamically in the ribbon control with given name, tab group array and index position. When index is null, ribbon tab is added at the last index. + * @param {string} ribbon tab display text. + * @param {Array} groups to be displayed in ribbon tab . + * @param {number} index of the ribbon tab,this is optional. + * @returns {void} + */ + addTab(tabText: string, ribbonGroups: Array, index: number): void; + + /** Adds tab group dynamically in the ribbon control with given tab index, tab group object and group index position. When group index is null, ribbon group is added at the last index. + * @param {number} ribbon tab index. + * @param {any} group to be displayed in ribbon tab . + * @param {number} index of the ribbon group,this is optional. + * @returns {void} + */ + addTabGroup(tabIndex: number, tabGroup: any, groupIndex: number): void; + + /** Adds group content dynamically in the ribbon control with given tab index, group index, sub group index, content and content index position. When content index is null, content is added at the last index. + * @param {number} ribbon tab index. + * @param {number} ribbon group index. + * @param {number} sub group index in the ribbon group, + * @param {any} content to be displayed in the ribbon group. + * @param {number} ribbon content index .this is optional. + * @returns {void} + */ + addTabGroupContent(tabIndex: number, groupIndex: number, subGroupIndex: number, content: any, contentIndex: number): void; + + /** Hides the ribbon backstage page. + * @returns {void} + */ + hideBackstage(): void; + + /** Collapses the ribbon tab content. + * @returns {void} + */ + collapse(): void; + + /** Destroys the ribbon widget. All the events bound using this._on are unbound automatically and the ribbon control is moved to pre-init state. + * @returns {void} + */ + destroy(): void; + + /** Expands the ribbon tab content. + * @returns {void} + */ + expand(): void; + + /** Gets text of the given index tab in the ribbon control. + * @param {number} index of the tab item. + * @returns {string} + */ + getTabText(index: number): string; + + /** Hides the given text tab in the ribbon control. + * @param {string} text of the tab item. + * @returns {void} + */ + hideTab(string: string): void; + + /** Checks whether the given text tab in the ribbon control is enabled or not. + * @param {string} text of the tab item. + * @returns {boolean} + */ + isEnable(string: string): boolean; + + /** Checks whether the given text tab in the ribbon control is visible or not. + * @param {string} text of the tab item. + * @returns {boolean} + */ + isVisible(string: string): boolean; + + /** Removes the given index tab item from the ribbon control. + * @param {number} index of tab item. + * @returns {void} + */ + removeTab(index: number): void; + + /** Sets new text to the given text tab in the ribbon control. + * @param {string} current text of the tab item. + * @param {string} new text of the tab item. + * @returns {void} + */ + setTabText(tabText: string, newText: string): void; + + /** Displays the ribbon backstage page. + * @returns {void} + */ + showBackstage(): void; + + /** Displays the given text tab in the ribbon control. + * @param {string} text of the tab item. + * @returns {void} + */ + showTab(string: string): void; +} +export module Ribbon{ + +export interface Model { + + /**Enables the ribbon resize feature. + * @Default {false} + */ + allowResizing?: boolean; + + /**Specifies the height, width, enableRTL, showRoundedCorner,enabled,cssClass property to the controls in the ribbon commonly andit will work only when those properties are not defined in buttonSettings and content defaults. + * @Default {object} + */ + buttonDefaults?: any; + + /**Property to enable the ribbon quick access toolbar. + * @Default {false} + */ + showQAT?: boolean; + + /**Sets custom setting to the collapsible pin in the ribbon. + * @Default {Object} + */ + collapsePinSettings?: CollapsePinSettings; + + /**Sets custom setting to the expandable pin in the ribbon. + * @Default {Object} + */ + expandPinSettings?: ExpandPinSettings; + + /**Specifies the application tab to contain application menu or backstage page in the ribbon control. + * @Default {Object} + */ + applicationTab?: ApplicationTab; + + /**Specifies the contextual tabs and tab set to the ribbon control with the background color and border color. Refer to the tabs section for adding tabs into the contextual tab and contextual tab set. + * @Default {array} + */ + contextualTabs?: Array; + + /**Specifies the index or indexes to disable the given index tab or indexes tabs in the ribbon control. + * @Default {0} + */ + disabledItemIndex?: Array; + + /**Specifies the index or indexes to enable the given index tab or indexes tabs in the ribbon control. + * @Default {null} + */ + enabledItemIndex?: Array; + + /**Specifies the index of the ribbon tab to select the given index tab item in the ribbon control. + * @Default {1} + */ + selectedItemIndex?: number; + + /**Specifies the tabs and its groups. Also specifies the control details that has to be placed in the tab area in the ribbon control. + * @Default {array} + */ + tabs?: Array; + + /**Gets or sets a value that indicates whether to customizing the user interface (UI) as locale-specific in order to display regional data i.e. in a language and culture specific to a particular country or region and it will need to use the user's preference. + * @Default {en-US} + */ + locale?: string; + + /**Specifies the width to the ribbon control. You can set width in string or number format. + * @Default {null} + */ + width?: string|number; + + /**Triggered before the ribbon tab item is removed.*/ + beforeTabRemove? (e: BeforeTabRemoveEventArgs): void; + + /**Triggered before the ribbon control is created.*/ + create? (e: CreateEventArgs): void; + + /**Triggered before the ribbon control is destroyed.*/ + destroy? (e: DestroyEventArgs): void; + + /**Triggered when the control in the group is clicked successfully.*/ + groupClick? (e: GroupClickEventArgs): void; + + /**Triggered when the groupexpander in the group is clicked successfully.*/ + groupExpand? (e: GroupExpandEventArgs): void; + + /**Triggered when an item in the Gallery control is clicked successfully.*/ + galleryItemClick? (e: GalleryItemClickEventArgs): void; + + /**Triggered when a tab or button in the backstage page is clicked successfully.*/ + backstageItemClick? (e: BackstageItemClickEventArgs): void; + + /**Triggered when the ribbon control is collapsed.*/ + collapse? (e: CollapseEventArgs): void; + + /**Triggered when the ribbon control is expanded.*/ + expand? (e: ExpandEventArgs): void; + + /**Triggered after adding the new ribbon tab item.*/ + tabAdd? (e: TabAddEventArgs): void; + + /**Triggered when tab is clicked successfully in the ribbon control.*/ + tabClick? (e: TabClickEventArgs): void; + + /**Triggered before the ribbon tab is created.*/ + tabCreate? (e: TabCreateEventArgs): void; + + /**Triggered after the tab item is removed from the ribbon control.*/ + tabRemove? (e: TabRemoveEventArgs): void; + + /**Triggered after the ribbon tab item is selected in the ribbon control.*/ + tabSelect? (e: TabSelectEventArgs): void; + + /**Triggered when the expand/collapse button is clicked successfully .*/ + toggleButtonClick? (e: ToggleButtonClickEventArgs): void; + + /**Triggered when the QAT menu item is clicked successfully .*/ + qatMenuItemClick? (e: QatMenuItemClickEventArgs): void; +} + +export interface BeforeTabRemoveEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the ribbon model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; + + /**returns current tab item index in the ribbon control. + */ + index?: number; +} + +export interface CreateEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the ribbon model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**Set to true when the event has to be cancelled, else false. + */ + cancel?: boolean; + + /**returns the ribbon model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; + + /**returns current ribbon tab item index + */ + deleteIndex?: number; +} + +export interface GroupClickEventArgs { + + /**Set to true when the event has to be cancelled, else false. + */ + cancel?: boolean; + + /**returns the ribbon model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; + + /**returns the control clicked in the group. + */ + target?: number; +} + +export interface GroupExpandEventArgs { + + /**Set to true when the event has to be cancelled, else false. + */ + cancel?: boolean; + + /**returns the ribbon model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; + + /**returns the clicked groupexpander. + */ + target?: number; +} + +export interface GalleryItemClickEventArgs { + + /**Set to true when the event has to be cancelled, else false. + */ + cancel?: boolean; + + /**returns the ribbon model. + */ + model?: any; + + /**returns the gallery model. + */ + galleryModel?: any; + + /**returns the name of the event. + */ + type?: string; + + /**returns the item clicked in the gallery. + */ + target?: number; +} + +export interface BackstageItemClickEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the ribbon model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; + + /**returns the item clicked in the gallery. + */ + target?: number; + + /**returns the id of the target item. + */ + id?: string; + + /**returns the text of the target item. + */ + text?: string; +} + +export interface CollapseEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the ribbon model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface ExpandEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the ribbon model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface TabAddEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the ribbon model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; + + /**returns new added tab header. + */ + tabHeader?: any; + + /**returns new added tab content panel. + */ + tabContent?: any; +} + +export interface TabClickEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the ribbon model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; + + /**returns previous active tab header. + */ + prevActiveHeader?: any; + + /**returns previous active index. + */ + prevActiveIndex?: number; + + /**returns current active tab header . + */ + activeHeader?: any; + + /**returns current active index. + */ + activeIndex?: number; +} + +export interface TabCreateEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the ribbon model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; + + /**returns current ribbon tab item index + */ + deleteIndex?: number; +} + +export interface TabRemoveEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the ribbon model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; + + /**returns the removed index. + */ + removedIndex?: number; +} + +export interface TabSelectEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the ribbon model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; + + /**returns previous active tab header. + */ + prevActiveHeader?: any; + + /**returns previous active index. + */ + prevActiveIndex?: number; + + /**returns current active tab header . + */ + activeHeader?: any; + + /**returns current active index. + */ + activeIndex?: number; +} + +export interface ToggleButtonClickEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the ribbon model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; + + /**returns the expand/collapse button. + */ + target?: number; +} + +export interface QatMenuItemClickEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the ribbon model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; + + /**returns the clicked menu item text. + */ + text?: string; +} + +export interface CollapsePinSettings { + + /**Sets tooltip for the collapse pin . + * @Default {null} + */ + toolTip?: string; + + /**Specifies the custom tooltip for collapse pin.Refer to ejRibbon#tabs->groups->content->groups->customToolTip for its inner properties. + * @Default {Object} + */ + customToolTip?: any; +} + +export interface ExpandPinSettings { + + /**Sets tooltip for the expand pin. + * @Default {null} + */ + toolTip?: string; + + /**Specifies the custom tooltip for expand pin.Refer to ejRibbon#tabs->groups->content->groups->customToolTip for its inner properties. + * @Default {Object} + */ + customToolTip?: any; +} + +export interface ApplicationTabBackstageSettingsPages { + + /**Specifies the id for ribbon backstage page's tab and button elements. + * @Default {null} + */ + id?: string; + + /**Specifies the text for ribbon backstage page's tab header and button elements. + * @Default {null} + */ + text?: string; + + /**Specifies the type for ribbon backstage page's contents. Set "ej.Ribbon.backStageItemType.tab" to render the tab or "ej.Ribbon.backStageItemType.button" to render the button. + * @Default {ej.Ribbon.itemType.tab} + */ + itemType?: ej.Ribbon.itemType|string; + + /**Specifies the id of html elements like div, ul, etc., as ribbon backstage page's tab content. + * @Default {null} + */ + contentID?: string; + + /**Specifies the separator between backstage page's tab and button elements. + * @Default {false} + */ + enableSeparator?: boolean; +} + +export interface ApplicationTabBackstageSettings { + + /**Specifies the display text of application tab. + * @Default {null} + */ + text?: string; + + /**Specifies the height of ribbon backstage page. + * @Default {null} + */ + height?: string|number; + + /**Specifies the width of ribbon backstage page. + * @Default {null} + */ + width?: string|number; + + /**Specifies the ribbon backstage page with its tab and button elements. + * @Default {array} + */ + pages?: Array; + + /**Specifies the width of backstage page header that contains tabs and buttons. + * @Default {null} + */ + headerWidth?: string|number; +} + +export interface ApplicationTab { + + /**Specifies the ribbon backstage page items. + * @Default {object} + */ + backstageSettings?: ApplicationTabBackstageSettings; + + /**Specifies the ID of 'ul' list to create application menu in the ribbon control. + * @Default {null} + */ + menuItemID?: string; + + /**Specifies the menu members, events by using the menu settings for the menu in the application tab. + * @Default {object} + */ + menuSettings?: any; + + /**Specifies the application menu or backstage page. Specify the type of application tab as "ej.Ribbon.applicationTabType.menu" to render the application menu or "ej.Ribbon.applicationTabType.backstage" to render backstage page in the ribbon control. + * @Default {ej.Ribbon.applicationTabType.menu} + */ + type?: ej.Ribbon.applicationTabType|string; +} + +export interface ContextualTabs { + + /**Specifies the backgroundColor of the contextual tabs and tab set in the ribbon control. + * @Default {null} + */ + backgroundColor?: string; + + /**Specifies the borderColor of the contextual tabs and tab set in the ribbon control. + * @Default {null} + */ + borderColor?: string; + + /**Specifies the tabs to present in the contextual tabs and tab set. Refer to the tabs section for adding tabs into the contextual tabs and tab set. + * @Default {array} + */ + tabs?: Array; +} + +export interface TabsGroupsContentGroupsCustomGalleryItems { + + /**Specifies the syncfusion button members, events by using buttonSettings. + * @Default {object} + */ + buttonSettings?: any; + + /**Specifies the type as ej.Ribbon.customItemType.menu or ej.Ribbon.customItemType.button to render Syncfusion button and menu. + * @Default {ej.Ribbon.customItemType.button} + */ + customItemType?: ej.Ribbon.customItemType|string; + + /**Specifies the custom tooltip for gallery extra item's button. Refer to ejRibbon#tabs->groups->content->groups->customToolTip for its inner properties. + * @Default {object} + */ + customToolTip?: any; + + /**Specifies the UL list id to render menu as gallery extra item. + * @Default {null} + */ + menuId?: string; + + /**Specifies the Syncfusion menu members, events by using menuSettings. + * @Default {object} + */ + menuSettings?: any; + + /**Specifies the text for gallery extra item's button. + * @Default {null} + */ + text?: string; + + /**Specifies the tooltip for gallery extra item's button. + * @Default {null} + */ + toolTip?: string; +} + +export interface TabsGroupsContentGroupsCustomToolTip { + + /**Sets content to the custom tooltip. Text and html support are provided for content. + * @Default {null} + */ + content?: string; + + /**Sets icon to the custom tooltip content. + * @Default {null} + */ + prefixIcon?: string; + + /**Sets title to the custom tooltip. Text and html support are provided for title and the title is in bold for text format. + * @Default {null} + */ + title?: string; +} + +export interface TabsGroupsContentGroupsGalleryItems { + + /**Specifies the Syncfusion button members, events by using buttonSettings. + * @Default {object} + */ + buttonSettings?: any; + + /**Specifies the custom tooltip for gallery content. Refer to ejRibbon#tabs->groups->content->groups->customToolTip for its inner properties. + * @Default {object} + */ + customToolTip?: any; + + /**Sets text for the gallery content. + * @Default {null} + */ + text?: string; + + /**Sets tooltip for the gallery content. + * @Default {null} + */ + toolTip?: string; +} + +export interface TabsGroupsContentGroups { + + /**Specifies the Syncfusion button members, events by using this buttonSettings. + * @Default {object} + */ + buttonSettings?: any; + + /**It is used to set the count of gallery contents in a row. + * @Default {null} + */ + columns?: number; + + /**Specifies the custom items such as div, table, controls as custom controls with the type "ej.Ribbon.type.custom" in the groups. + * @Default {null} + */ + contentID?: string; + + /**Specifies the css class property to apply styles to the button, split, dropdown controls in the groups. + * @Default {null} + */ + cssClass?: string; + + /**Specifies the Syncfusion button and menu as gallery extra items. + * @Default {array} + */ + customGalleryItems?: Array; + + /**Provides custom tooltip for button, split button, dropdown list, toggle button, custom controls in the sub groups. Text and html support are also provided for title and content. + * @Default {Object} + */ + customToolTip?: TabsGroupsContentGroupsCustomToolTip; + + /**Specifies the Syncfusion dropdown list members, events by using this dropdownSettings. + * @Default {object} + */ + dropdownSettings?: any; + + /**Specifies the separator to the control that is in row type group. The separator separates the control from the next control in the group. Set "true" to enable the separator. + * @Default {false} + */ + enableSeparator?: boolean; + + /**Sets the count of gallery contents in a row, when the gallery is in expanded state. + * @Default {null} + */ + expandedColumns?: number; + + /**Defines each gallery content. + * @Default {array} + */ + galleryItems?: Array; + + /**Specifies the Id for button, split button, dropdown list, toggle button, gallery, custom controls in the sub groups. + * @Default {null} + */ + id?: string; + + /**Specifies the size for button, split button controls. Set "true" for big size and "false" for small size. + * @Default {null} + */ + isBig?: boolean; + + /**Sets the height of each gallery content. + * @Default {null} + */ + itemHeight?: string|number; + + /**Sets the width of each gallery content. + * @Default {null} + */ + itemWidth?: string|number; + + /**Specifies the Syncfusion split button members, events by using this splitButtonSettings. + * @Default {object} + */ + splitButtonSettings?: any; + + /**Specifies the text for button, split button, toggle button controls in the sub groups. + * @Default {null} + */ + text?: string; + + /**Specifies the Syncfusion toggle button members, events by using toggleButtonSettings. + * @Default {object} + */ + toggleButtonSettings?: any; + + /**Specifies the tooltip for button, split button, dropdown list, toggle button, custom controls in the sub groups. + * @Default {null} + */ + toolTip?: string; + + /**To add,show and hide controls in Quick Access toolbar. + * @Default {ej.Ribbon.quickAccessMode.none} + */ + quickAccessMode?: ej.Ribbon.quickAccessMode|string; + + /**Specifies the type as "ej.Ribbon.type.button" or "ej.Ribbon.type.splitButton" or "ej.Ribbon.type.dropDownList" or "ej.Ribbon.type.toggleButton" or "ej.Ribbon.type.custom" or "ej.Ribbon.type.gallery" to render button, split, dropdown, toggle button, gallery, custom controls. + * @Default {ej.Ribbon.type.button} + */ + type?: ej.Ribbon.type|string; +} + +export interface TabsGroupsContent { + + /**Specifies the height, width, type, isBig property to the controls in the group commonly. + * @Default {object} + */ + defaults?: any; + + /**Specifies the controls such as Syncfusion button, split button, dropdown list, toggle button, gallery, custom controls in the subgroup of the ribbon tab . + * @Default {array} + */ + groups?: Array; +} + +export interface TabsGroupsGroupExpanderSettings { + + /**Sets tooltip for the group expander of the group. + * @Default {null} + */ + toolTip?: string; + + /**Specifies the custom tooltip for group expander.Refer to ejRibbon#tabs->groups->content->groups->customToolTip for its inner properties. + * @Default {Object} + */ + customToolTip?: any; +} + +export interface TabsGroups { + + /**Specifies the alignment of controls in the groups in 'row' type or 'column' type. Value for row type is "ej.Ribbon.alignType.rows" and for column type is "ej.Ribbon.alignType.columns". + * @Default {ej.Ribbon.alignType.rows} + */ + alignType?: ej.Ribbon.alignType|string; + + /**Specifies the Syncfusion button, split button, dropdown list, toggle button, gallery, custom controls to the groups in the ribbon control. + * @Default {array} + */ + content?: Array; + + /**Specifies the ID of custom items to be placed in the groups. + * @Default {null} + */ + contentID?: string; + + /**Specifies the HTML contents to place into the groups. + * @Default {null} + */ + customContent?: string; + + /**Specifies the group expander for groups in the ribbon control. Set "true" to enable the group expander. + * @Default {false} + */ + enableGroupExpander?: boolean; + + /**Sets custom setting to the groups in the ribbon control. + * @Default {Object} + */ + groupExpanderSettings?: TabsGroupsGroupExpanderSettings; + + /**Specifies the text to the groups in the ribbon control. + * @Default {null} + */ + text?: string; + + /**Specifies the custom items such as div, table, controls by using the "custom" type. + * @Default {null} + */ + type?: string; +} + +export interface Tabs { + + /**Specifies single group or multiple groups and its contents to each tab in the ribbon control. + * @Default {array} + */ + groups?: Array; + + /**Specifies the ID for each tab's content panel. + * @Default {null} + */ + id?: string; + + /**Specifies the text of the tab in the ribbon control. + * @Default {null} + */ + text?: string; +} + +enum itemType{ + + ///To render the button for ribbon backstage page’s contents + Button, + + ///To render the tab for ribbon backstage page’s contents + Tab +} + + +enum applicationTabType{ + + ///applicationTab display as menu + Menu, + + ///applicationTab display as backstage + Backstage +} + + +enum alignType{ + + ///To align the group content's in row + Rows, + + ///To align group content's in columns + Columns +} + + +enum customItemType{ + + ///Specifies the button type in customGalleryItems + Button, + + ///Specifies the menu type in customGalleryItems + Menu +} + + +enum quickAccessMode{ + + ///Controls are hidden in Quick Access toolbar + None, + + ///Add controls in toolBar + ToolBar, + + ///Add controls in menu + Menu +} + + +enum type{ + + ///Specifies the button control + Button, + + ///Specifies the split button + SplitButton, + + ///Specifies the dropDown + DropDownList, + + ///To append external element's + Custom, + + ///Specifies the toggle button + ToggleButton, + + ///Specifies the ribbon gallery + Gallery +} + +} + +class Kanban extends ej.Widget { + static fn: Kanban; + constructor(element: JQuery, options?: Kanban.Model); + constructor(element: Element, options?: Kanban.Model); + model:Kanban.Model; + defaults:Kanban.Model; + + /** Add a new card in kanban control.If parameters are not given default dialog will be open + * @param {string} Pass the primary key field Name of the column + * @param {Array} Pass the edited json data of card need to be add. + * @returns {void} + */ + addCard(primaryKey: string, card: Array): void; + + /** Method used for send a clear search request to kanban. + * @returns {void} + */ + clearSearch(): void; + + /** It is used to clear all the card selection. + * @returns {void} + */ + clearSelection(): void; + + /** Collapse all the swimlane rows in kanban. + * @returns {void} + */ + collapseAll(): void; + + /** Add or remove columns in kanban columns collections + * @param {Array|string} Pass array of columns or string of headerText to add/remove the column in kanban + * @param {Array|string} Pass array of columns or string of keyvalue to add/remove the column in kanban + * @param {string} optional Pass add/remove action to be performed. By default "add" action will perform + * @returns {void} + */ + columns(columndetails: Array|string, keyvalue: Array|string, action: string): void; + + /** Send a cancel request of add/edit card in kanban + * @returns {void} + */ + cancelEdit(): void; + + /** Destroy the kanban widget all events bound using this._on will be unbind automatically and bring the control to pre-init state. + * @returns {void} + */ + destroy(): void; + + /** Delete a card in kanban control. + * @param {string|number} Pass the key of card to be delete + * @returns {void} + */ + deleteCard(Key: string|number): void; + + /** Refresh the kanban with new data source. + * @param {Array} Pass new data source to the kanban + * @returns {void} + */ + dataSource(datasource: Array): void; + + /** Send a save request in kanban when any card is in edit/new add card state. + * @returns {void} + */ + endEdit(): void; + + /** toggleColumn based on the headerText in kanban. + * @param {any} Pass the header text of the column to get the corresponding column object + * @returns {void} + */ + toggleColumn( headerText : any): void; + + /** Expand or collapse the card based on the state of target "div" + * @param {string|number} Pass the key of card to be toggle + * @returns {void} + */ + toggleCard( key : string|number): void; + + /** Expand or collapse the swimlane row based on the state of target "div" + * @param {any} Pass the div object to toggleSwimlane row based on its row state + * @returns {void} + */ + toggleSwimlane( $div : any): void; + + /** Expand all the swimlane rows in kanban. + * @returns {void} + */ + expandAll(): void; + + /** used for get the names of all the visible column name collections in kanban. + * @returns {void} + */ + getVisibleColumnNames(): void; + + /** Get the scroller object of kanban. + * @returns {void} + */ + getScrollObject(): void; + + /** Get the column details based on the given header text in kanban. + * @param {string} Pass the header text of the column to get the corresponding column object + * @returns {string} + */ + getColumnByHeaderText( headerText : string): string; + + /** Hide columns from the kanban based on the header text + * @param {Array|string} you can pass either array of header text of various columns or a header text of a column to hide + * @returns {void} + */ + hideColumns( headerText : Array|string): void; + + /** Refresh the template of the kanban + * @returns {void} + */ + refreshTemplate(): void; + + /** Refresh the kanban contents.The template refreshment is based on the argument passed along with this method + * @param {boolean} optional When templateRefresh is set true, template and kanban contents both are refreshed in kanban else only kanban content is refreshed + * @returns {void} + */ + refresh( templateRefresh : boolean): void; + + /** send a search request to kanban with specified string passed in it. + * @param {string} Pass the string to search in Kanban card + * @returns {void} + */ + searchCards( searchString: string): void; + + /** Method used for set validation to a field during editing. + * @param {string} Specify the name of the column to set validation rules + * @param {any} Specify the validation rules for the field + * @returns {void} + */ + setValidationToField(name: string, rules: any): void; + + /** Send an edit card request in kanban.Parameter will be Html element or primary key + * @param {any} Pass the div selected row element to be edited in kanban + * @returns {void} + */ + startEdit( $div : any): void; + + /** Show columns in the kanban based on the header text. + * @param {Array|string} You can pass either array of header text of various columns or a header text of a column to show + * @returns {void} + */ + showColumns( headerText : Array|string): void; + + /** Update a card in kanban control based on key and json data given. + * @param {string} Pass the key field Name of the column + * @param {Array} Pass the edited json data of card need to be update. + * @returns {void} + */ + updateCard( key : string, data : Array): void; +} +export module Kanban{ + +export interface Model { + + /**Gets or sets a value that indicates whether to enable allowDragAndDrop behavior on kanban. + * @Default {true} + */ + allowDragAndDrop?: boolean; + + /**To enable or disable the title of the card. + * @Default {false} + */ + allowTitle?: boolean; + + /**Customize the settings for swimlane. + * @Default {Object} + */ + swimlaneSettings?: SwimlaneSettings; + + /**To enable or disable the column expand /collapse. + * @Default {false} + */ + allowToggleColumn?: boolean; + + /**To enable Searching operation in kanban. + * @Default {false} + */ + allowSearching?: boolean; + + /**Gets or sets a value that indicates whether to enable allowSelection behavior on kanban.User can select card and the selected card will be highlighted on kanban. + * @Default {true} + */ + allowSelection?: boolean; + + /**Gets or sets a value that indicates whether to allow card hover actions. + * @Default {true} + */ + allowHover?: boolean; + + /**To allow keyboard navigation actions. + * @Default {true} + */ + allowKeyboardNavigation?: boolean; + + /**Gets or sets a value that indicates whether to enable the scrollbar in the kanban and view the card by scroll through the kanban manually. + * @Default {false} + */ + allowScrolling?: boolean; + + /**Gets or sets an object that indicates whether to customize the context menu behavior of the kanban. + * @Default {Object} + */ + contextMenuSettings?: ContextMenuSettings; + + /**Gets or sets an object that indicates to render the kanban with specified columns. + * @Default {array} + */ + columns?: Array; + + /**Gets or sets an object that indicates whether to Customize the card based on the Mapping Fields. + * @Default {Object} + */ + cardSettings?: CardSettings; + + /**Gets or sets a value that indicates to render the kanban with custom theme. + * @Default {null} + */ + cssClass?: string; + + /**Gets or sets the data to render the kanban with card. + * @Default {Object} + */ + dataSource?: any; + + /**Align content in the kanban control from right to left by setting the property as true. + * @Default {false} + */ + enableRTL?: boolean; + + /**To show Total count of cards in each column + * @Default {true} + */ + enableTotalCount?: boolean; + + /**Gets or sets a value that indicates whether to enablehover support for performing card hover actions. + * @Default {true} + */ + enableHover?: boolean; + + /**Get or sets an object that indicates whether to customize the editing behavior of the kanban. + * @Default {Object} + */ + editSettings?: EditSettings; + + /**To customize field mappings for card , editing title and control key parameters + * @Default {Object} + */ + fields?: Fields; + + /**To map datasource field for column values mapping + * @Default {null} + */ + keyField?: string; + + /**Gets or sets a value that indicates whether the kanban design has be to made responsive. + * @Default {false} + */ + isResponsive?: boolean; + + /**Gets or sets a value that indicates whether to set the minimum width of the responsive kanban while isResponsive property is true and enableResponsiveRow property is set as false. + * @Default {null} + */ + minWidth?: number; + + /**To customize the filtering behavior based on queries given. + * @Default {array} + */ + filterSettings?: Array; + + /**The primarykey field is get as property of kanban. And this will used for Drag and drop and editing mainly + * @Default {null} + */ + primaryKeyField?: string; + + /**ej Query to query database of kanban. + * @Default {Object} + */ + query?: any; + + /**To change the key in keyboard interaction to kanban control. + * @Default {Object} + */ + keySettings?: KeySettings; + + /**Gets or sets an object that indicates whether to customize the scrolling behavior of the kanban. + * @Default {Object} + */ + scrollSettings?: any; + + /**To customize the searching behavior of the kanban. + * @Default {Object} + */ + searchSettings?: SearchSettings; + + /**To allow customize selection type. Accepting types are "single" and "multiple". + * @Default {ej.Kanban.SelectionType.Single} + */ + selectionType?: ej.Kanban.SelectionType|string; + + /**Gets or sets an object that indicates to managing the collection of stacked header rows for the kanban. + * @Default {Array} + */ + stackedHeaderRows?: Array; + + /**The tooltip allows to display card details in a tooltip while hovering on it. + */ + tooltipSettings?: TooltipSettings; + + /**Gets or sets a value that indicates whether to customizing the user interface (UI) as locale-specific in order to display regional data i.e. in a language and culture specific to a particular country or region. + * @Default {en-US} + */ + locale?: string; + + /**Triggered for every kanban action before its starts.*/ + actionBegin? (e: ActionBeginEventArgs): void; + + /**tiggered for every kanban action success event.*/ + actionComplete? (e: ActionCompleteEventArgs): void; + + /**Triggered for every kanban action server failure event.*/ + actionFailure? (e: ActionFailureEventArgs): void; + + /**Triggered before the task is going to be edited.*/ + beginEdit? (e: BeginEditEventArgs): void; + + /**Triggered before the task is going to be added*/ + beginAdd? (e: BeginAddEventArgs): void; + + /**triggered before the card is going to be selecting.*/ + beforeCardSelect? (e: BeforeCardSelectEventArgs): void; + + /**Trigger after the card is clicked.*/ + cardClick? (e: CardClickEventArgs): void; + + /**Triggered when the card is being dragged.*/ + cardDrag? (e: CardDragEventArgs): void; + + /**Triggered when card dragging start.*/ + cardDragStart? (e: CardDragStartEventArgs): void; + + /**triggered when card dragging stops.*/ + cardDragStop? (e: CardDragStopEventArgs): void; + + /**Triggered when the card is Drop.*/ + cardDrop? (e: CardDropEventArgs): void; + + /**Triggered after the card is select.*/ + cardSelect? (e: CardSelectEventArgs): void; + + /**Triggered when card is double clicked.*/ + cardDoubleClick? (e: CardDoubleClickEventArgs): void; +} + +export interface ActionBeginEventArgs { + + /**Returns the kanban model. + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the current action event type. + */ + originalEventType?: string; + + /**Returns primary key value. + */ + primaryKeyValue?: string; + + /**Returns request type. + */ + requestType?: string; + + /**Returns the edited row index. + */ + rowIndex?: number; + + /**Returns the card object (JSON). + */ + data?: any; + + /**Returns current filtering object field name. + */ + currentFilteringobject?: any; + + /**Returns filter details. + */ + filterCollection?: any; +} + +export interface ActionCompleteEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the kanban model. + */ + model?: any; + + /**Returns request type. + */ + requestType?: string; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns current action event type. + */ + originalEventType?: string; + + /**Returns primary key. + */ + primaryKey?: string; + + /**Returns primary key value. + */ + primaryKeyValue?: string; + + /**Returns kanban element. + */ + target?: any; + + /**Returns the card object (JSON). + */ + data?: any; + + /**Returns the selectedRow index. + */ + selectedRow?: number; + + /**Returns current filtering column field name. + */ + currentFilteringColumn?: string; + + /**Returns filter details. + */ + filterCollection?: any; +} + +export interface ActionFailureEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the kanban model. + */ + model?: any; + + /**Returns request type. + */ + requestType?: string; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the error return by server. + */ + error?: any; + + /**Returns current action event type. + */ + originalEventType?: string; + + /**Returns primary key value. + */ + primaryKeyValue?: string; + + /**Returns kanban element. + */ + target?: any; + + /**Returns the card object (JSON). + */ + data?: any; + + /**Returns current filtering column field name. + */ + currentFilteringColumn?: string; + + /**Returns filter details. + */ + filterCollection?: any; +} + +export interface BeginEditEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the kanban model. + */ + model?: any; + + /**Returns primary key value. + */ + primaryKeyValue?: string; + + /**Returns beginedit data. + */ + data?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface BeginAddEventArgs { + + /**Returns the kanban model. + */ + model?: any; + + /**Returns primary key value. + */ + primaryKeyValue?: string; + + /**Returns beginAdd data. + */ + data?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface BeforeCardSelectEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the select cell index value. + */ + cellIndex?: number; + + /**Returns the select card index value. + */ + cardIndex?: number; + + /**Returns the select cell element + */ + currentCell?: any; + + /**Returns the previously select the card element + */ + previousCard?: any; + + /**Returns the previously select card indexes + */ + previousRowcellindex?: Array; + + /**Returns the Target item. + */ + Target?: any; + + /**Returns the kanban model. + */ + model?: any; + + /**Returns select card data. + */ + data?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface CardClickEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns current record object (JSON). + */ + data?: any; + + /**Returns the current card to the kanban. + */ + currentCard?: string; + + /**Returns kanban element. + */ + target?: any; + + /**Returns the kanban model. + */ + model?: any; + + /**Returns the Header text of the column corresponding to the selected card. + */ + columnName?: string; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface CardDragEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns drag data. + */ + data?: any; + + /**Returns drag start element. + */ + dragtarget?: any; + + /**Returns dragged element. + */ + draggedElement?: any; + + /**Returns the kanban model. + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface CardDragStartEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns carddragstart data. + */ + data?: any; + + /**Returns dragged element. + */ + draggedElement?: any; + + /**Returns the kanban model. + */ + model?: any; + + /**Returns drag start element. + */ + dragtarget?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface CardDragStopEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns dragged element. + */ + draggedElement?: any; + + /**Returns the kanban model. + */ + model?: any; + + /**Returns drag stop element. + */ + droptarget?: any; + + /**Returns dragg stop data. + */ + data?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface CardDropEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns dragged element. + */ + draggedElement?: any; + + /**Returns dragged data. + */ + data?: any; + + /**Returns the kanban model. + */ + model?: any; + + /**Returns drop element. + */ + target?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface CardSelectEventArgs { + + /**Returns the select cell index value. + */ + cellIndex?: number; + + /**Returns the select card index value. + */ + cardIndex?: number; + + /**Returns the select cell element + */ + currentCell?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the previously select the card element + */ + previousCard?: any; + + /**Returns the previously select card indexes + */ + previousRowcellindex?: Array; + + /**Returns the current item. + */ + currentTarget?: any; + + /**Returns the kanban model. + */ + model?: any; + + /**Returns select card data. + */ + data?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface CardDoubleClickEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns current card object (JSON). + */ + data?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface SwimlaneSettings { + + /**To enable or disable items count in swimlane + * @Default {true} + */ + showCount?: boolean; +} + +export interface ContextMenuSettingsCustomMenuItems { + + /**Sets context menu to target element. + * @Default {ej.Kanban.Target.All} + */ + target?: ej.Kanban.Target|string; + + /**Gets the name to custom menu. + * @Default {null} + */ + text?: string; + + /**Gets the template to render custom menu. + * @Default {null} + */ + template?: string; +} + +export interface ContextMenuSettings { + + /**To enable Context menu , All default context menu will show. + * @Default {false} + */ + enable?: boolean; + + /**Gets or sets a value that indicates the list of items needs to be diable from default context menu + * @Default {array} + */ + disableDefaultItems?: Array; + + /**Gets or sets a value that indicates whether to add custom contextMenu items + * @Default {array} + */ + customMenuItems?: Array; +} + +export interface ColumnsConstraints { + + /**It is used to specify the type whether the constraints based on column or swimlane. + * @Default {null} + */ + type?: string; + + /**It is used to specify the minimum amount of card in particular column cell or swimlane cell can hold. + * @Default {null} + */ + min?: number; + + /**It is used to specify the maximum amount of card in particular column cell or swimlane cell can hold. + * @Default {null} + */ + max?: number; +} + +export interface Columns { + + /**Gets or sets an object that indicates to render the kanban with specified columns headertext. + * @Default {null} + */ + headerText?: string; + + /**Gets or sets an object that indicates to render the kanban with specified columns key. + * @Default {null} + */ + key?: string|number; + + /**To set column collape or expand state + * @Default {false} + */ + isCollapsed?: boolean; + + /**To customize the column constraints whether the constraints contains minimum limit or maximum limit or both. + * @Default {object} + */ + constraints?: ColumnsConstraints; + + /**Gets or sets a value that indicates to add the template within the header element. + * @Default {null} + */ + headerTemplate?: string; + + /**Gets or sets an object that indicates to render the kanban with specified columns width. + * @Default {null} + */ + width?: string|number; + + /**Gets or sets an object that indicates to render the kanban with specified columns visible. + * @Default {true} + */ + visible?: boolean; +} + +export interface CardSettings { + + /**Gets or sets a value that indicates to add the template of card . + * @Default {null} + */ + template?: string; + + /**To customize the card bordercolor based on assinged task. Colors and corresponding values defined here will be mapped with colorField mapped data source column. + * @Default {Object} + */ + colorMapping?: any; +} + +export interface EditSettingsEditItems { + + /**It is used to map editing field in the card. + * @Default {null} + */ + field?: string; + + /**It is used to set the particular editType in the card for editing. + * @Default {ej.Kanban.EditingType.String} + */ + editType?: ej.Kanban.EditingType|string; + + /**Gets or sets a value that indicates to define constraints for saving data to the database. + * @Default {Object} + */ + validationRules?: any; + + /**It is used to set the particular editparams in the card for editing. + * @Default {Object} + */ + editParams?: any; + + /**It is used to specify defaultValue in the card. + * @Default {null} + */ + defaultValue?: string|number; +} + +export interface EditSettings { + + /**Gets or sets a value that indicates whether to enable the editing action in cards of kanban. + * @Default {false} + */ + allowEditing?: boolean; + + /**Gets or sets a value that indicates whether to enable the adding action in cards behavior on kanban. + * @Default {false} + */ + allowAdding?: boolean; + + /**This specifies the id of the template.which is require to be edited using the Dialog Box + * @Default {null} + */ + dialogTemplate?: string; + + /**Get or sets an object that indicates whether to customize the editMode of the kanban. + * @Default {ej.Kanban.EditMode.Dialog} + */ + editMode?: ej.Kanban.EditMode|string; + + /**Get or sets an object that indicates whether to customize the editing fields of kanban card. + * @Default {Array} + */ + editItems?: Array; +} + +export interface Fields { + + /**The primarykey field is get as property of kanban. And this will used for Drag and drop and editing mainly. + * @Default {null} + */ + primaryKey?: string; + + /**To enable swimlane grouping based on the given key field. + * @Default {null} + */ + swimlaneKey?: string; + + /**Priority field has been mapped data source field to maintain card priority + * @Default {null} + */ + priority?: string; + + /**ContentField has been Mapped into card text. + * @Default {null} + */ + content?: string; + + /**TagField has been Mapped into card tag. + * @Default {null} + */ + tag?: string; + + /**TitleField has been Mapped to field in datasource for title content. If titlefield specified , card expand/collapse will be enabled with header and content section + * @Default {null} + */ + title?: string; + + /**To customize the card has been Mapped into card colorfield. + * @Default {null} + */ + color?: string; + + /**ImageUrlField has been Mapped into card image. + * @Default {null} + */ + imageUrl?: string; +} + +export interface FilterSettings { + + /**Gets or sets an object of display name to filter queries. + * @Default {null} + */ + text?: string; + + /**Gets or sets an object that Queries to perform filtering + * @Default {Object} + */ + query?: any; + + /**Gets or sets an object of tooltip to filter buttons. + * @Default {null} + */ + description?: string; +} + +export interface KeySettings { + + /**To specify the focus in kanban control. + * @Default {Object} + */ + focus?: any; + + /**To specify the key value to insert the card. + * @Default {null} + */ + insertCard?: string; + + /**To specify the key value to delete the card. + * @Default {null} + */ + deleteCard?: string; + + /**TTo specify the key value to edit the card. + * @Default {null} + */ + editCard?: string; + + /**TTo specify the key value to save request. + * @Default {null} + */ + saveRequest?: string; + + /**To specify the key value to cancel request. + * @Default {null} + */ + cancelRequest?: string; + + /**To specify the key value to first card selection. + * @Default {null} + */ + firstCardSelection?: string; + + /**To specify the key value to last card selection. + * @Default {null} + */ + lastCardSelection?: string; + + /**To specify the key value to upArrow. + * @Default {null} + */ + upArrow?: string; + + /**To specify the key value to downArrow. + * @Default {null} + */ + downArrow?: string; + + /**To specify the key value to rightArrow. + * @Default {null} + */ + rightArrow?: string; + + /**To specify the key value to leftArrow. + * @Default {null} + */ + leftArrow?: string; + + /**To specify the key value to swimlane expand all. + * @Default {null} + */ + swimlaneExpandAll?: string; + + /**To specify the key value to swimlane collapse all. + * @Default {null} + */ + swimlaneCollapseAll?: string; + + /**To specify the key value to selected group expand. + * @Default {null} + */ + selectedGroupExpand?: string; + + /**To specify the key value to selected group collapse. + * @Default {null} + */ + selectedGroupCollapse?: string; + + /**To specify the key value to selected column collapse. + * @Default {null} + */ + selectedColumnCollapse?: string; + + /**To specify the key value to selected column expand. + * @Default {null} + */ + selectedColumnExpand?: string; + + /**To specify the key value to multi selection by up arrow. + * @Default {null} + */ + multiSelectionByUpArrow?: string; + + /**To specify the key value to multi selection by left arrow. + * @Default {null} + */ + multiSelectionByLeftArrow?: string; + + /**To specify the key value to multi selection by right arrow. + * @Default {null} + */ + multiSelectionByRightArrow?: string; +} + +export interface SearchSettings { + + /**To customize the fields the searching operation can be perform. + * @Default {Array} + */ + fields?: Array; + + /**To customize the searching string. + * @Default {null} + */ + key?: string; + + /**To customize the operator based on searching. + * @Default {null} + */ + operator?: string; + + /**To customize the ignorecase based on searching. + * @Default {true} + */ + ignoreCase?: boolean; +} + +export interface StackedHeaderRowsStackedHeaderColumns { + + /**Gets or sets a value that indicates the headerText for the particular stacked header column. + * @Default {null} + */ + headerText?: string; + + /**Gets or sets a value that indicates the column for the particular stacked header column. + * @Default {null} + */ + column?: string; +} + +export interface StackedHeaderRows { + + /**Gets or sets a value that indicates whether to add stacked header columns into the stacked header rows. + * @Default {Array} + */ + stackedHeaderColumns?: Array; +} + +export interface TooltipSettings { + + /**To enable or disable the tooltip display. + * @Default {false} + */ + enable?: boolean; + + /**To customize the tooltip display based on your requirements. + * @Default {null} + */ + template?: string; +} + +enum Target{ + + ///Sets context menu to kanban header + Header, + + ///Sets context menu to kanban content + Content, + + ///Sets context menu to kanban + All +} + + +enum EditMode{ + + ///Creates kanban with editMode as Dialog + Dialog, + + ///Creates kanban with editMode as DialogTemplate + DialogTemplate +} + + +enum EditingType{ + + ///Allows to set edit type as string edit type + String, + + ///Allows to set edit type as numeric edit type + Numeric, + + ///Allows to set edit type as drop down edit type + Dropdown, + + ///Allows to set edit type as date picker edit type + DatePicker, + + ///Allows to set edit type as date time picker edit type + DateTimePicker, + + ///Allows to set edit type as text area edit type + TextArea, + + ///Allows to set edit type as RTE edit type + RTE +} + + +enum SelectionType{ + + ///Support for Single selection in Kanban + Single, + + ///Support for multiple selections in Kanban + Multiple +} + +} + +class Rotator extends ej.Widget { + static fn: Rotator; + constructor(element: JQuery, options?: Rotator.Model); + constructor(element: Element, options?: Rotator.Model); + model:Rotator.Model; + defaults:Rotator.Model; + + /** Disables the Rotator control. + * @returns {void} + */ + disable(): void; + + /** Enables the Rotator control. + * @returns {void} + */ + enable(): void; + + /** This method is used to get the current slide index. + * @returns {number} + */ + getIndex(): number; + + /** This method is used to move a slide to the specified index. + * @param {number} index of an slide + * @returns {void} + */ + gotoIndex(index: number): void; + + /** This method is used to pause autoplay. + * @returns {void} + */ + pause(): void; + + /** This method is used to move slides continuously (or start autoplay) in the specified autoplay direction. + * @returns {void} + */ + play(): void; + + /** This method is used to move to the next slide from the current slide. If the current slide is the last slide, then the first slide will be treated as the next slide. + * @returns {void} + */ + slideNext(): void; + + /** This method is used to move to the previous slide from the current slide. If the current slide is the first slide, then the last slide will be treated as the previous slide. + * @returns {void} + */ + slidePrevious(): void; +} +export module Rotator{ + +export interface Model { + + /**Turns on keyboard interaction with the Rotator items. You must set this property to true to access the following keyboard shortcuts: + * @Default {true} + */ + allowKeyboardNavigation?: boolean; + + /**Sets the animationSpeed of slide transition. + * @Default {600} + */ + animationSpeed?: string|number; + + /**Specifies the animationType type for the Rotator Item. animationType options include slide, fastSlide, slowSlide, and other custom easing animationTypes. + * @Default {slide} + */ + animationType?: string; + + /**Enables the circular mode item rotation. + * @Default {true} + */ + circularMode?: boolean; + + /**Specify the CSS class to Rotator to achieve custom theme. + */ + cssClass?: string; + + /**Specify the list of data which contains a set of data fields. Each data value is used to render an item for the Rotator. + * @Default {null} + */ + dataSource?: any; + + /**Sets the delay between the Rotator Items move after the slide transition. + * @Default {500} + */ + delay?: number; + + /**Specifies the number of Rotator Items to be displayed. + * @Default {1} + */ + displayItemsCount?: string|number; + + /**Rotates the Rotator Items continuously without user interference. + * @Default {false} + */ + enableAutoPlay?: boolean; + + /**Enables or disables the Rotator control. + * @Default {true} + */ + enabled?: boolean; + + /**Specifies right to left transition of slides. + * @Default {false} + */ + enableRTL?: boolean; + + /**Defines mapping fields for the data items of the Rotator. + * @Default {null} + */ + fields?: Fields; + + /**Sets the space between the Rotator Items. + */ + frameSpace?: string|number; + + /**Resizes the Rotator when the browser is resized. + * @Default {false} + */ + isResponsive?: boolean; + + /**Specifies the number of Rotator Items to navigate on a single click (next/previous/play buttons). The navigateSteps property value must be less than or equal to the displayItemsCount property value. + * @Default {1} + */ + navigateSteps?: string|number; + + /**Specifies the orientation for the Rotator control, that is, whether it must be rendered horizontally or vertically. See Orientation + * @Default {ej.Orientation.Horizontal} + */ + orientation?: ej.Orientation|string; + + /**Specifies the position of the showPager in the Rotator Item. See PagerPosition + * @Default {outside} + */ + pagerPosition?: string|ej.Rotator.PagerPosition; + + /**Retrieves data from remote data. This property is applicable only when a remote data source is used. + * @Default {null} + */ + query?: string; + + /**If the Rotator Item is an image, you can specify a caption for the Rotator Item. The caption text for each Rotator Item must be set by using the title attribute of the respective tag. The caption cannot be displayed if multiple Rotator Items are present. + * @Default {false} + */ + showCaption?: boolean; + + /**Turns on or off the slide buttons (next and previous) in the Rotator Items. Slide buttons are used to navigate the Rotator Items. + * @Default {true} + */ + showNavigateButton?: boolean; + + /**Turns on or off the pager support in the Rotator control. The Pager is used to navigate the Rotator Items. + * @Default {true} + */ + showPager?: boolean; + + /**Enable play / pause button on rotator. + * @Default {false} + */ + showPlayButton?: boolean; + + /**Turns on or off thumbnail support in the Rotator control. Thumbnail is used to navigate between slides. Thumbnail supports only single slide transition You must specify the source for thumbnail elements through the thumbnailSourceID property. + * @Default {false} + */ + showThumbnail?: boolean; + + /**Sets the height of a Rotator Item. + */ + slideHeight?: string|number; + + /**Sets the width of a Rotator Item. + */ + slideWidth?: string|number; + + /**Sets the index of the slide that must be displayed first. + * @Default {0} + */ + startIndex?: string|number; + + /**Pause the auto play while hover on the rotator content. + * @Default {false} + */ + stopOnHover?: boolean; + + /**Specifies the source for thumbnail elements. + * @Default {null} + */ + thumbnailSourceID?: any; + + /**This event is fired when the Rotator slides are changed.*/ + change? (e: ChangeEventArgs): void; + + /**This event is fired when the Rotator control is initialized.*/ + create? (e: CreateEventArgs): void; + + /**This event is fired when the Rotator control is destroyed.*/ + destroy? (e: DestroyEventArgs): void; + + /**This event is fired when a pager is clicked.*/ + pagerClick? (e: PagerClickEventArgs): void; + + /**This event is fired when enableAutoPlay is started.*/ + start? (e: StartEventArgs): void; + + /**This event is fired when autoplay is stopped or paused.*/ + stop? (e: StopEventArgs): void; + + /**This event is fired when a thumbnail pager is clicked.*/ + thumbItemClick? (e: ThumbItemClickEventArgs): void; +} + +export interface ChangeEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the rotator model + */ + model?: ej.Rotator.Model; + + /**returns the name of the event + */ + type?: string; + + /**the current rotator id. + */ + itemId?: string; + + /**returns the current slide index. + */ + activeItemIndex?: number; +} + +export interface CreateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the rotator model + */ + model?: ej.Rotator.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the rotator model + */ + model?: ej.Rotator.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface PagerClickEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the rotator model + */ + model?: ej.Rotator.Model; + + /**returns the name of the event + */ + type?: string; + + /**the current rotator id. + */ + itemId?: string; + + /**returns the current slide index. + */ + activeItemIndex?: number; +} + +export interface StartEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the rotator model + */ + model?: ej.Rotator.Model; + + /**returns the name of the event + */ + type?: string; + + /**the current rotator id. + */ + itemId?: string; + + /**returns the current slide index. + */ + activeItemIndex?: number; +} + +export interface StopEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the rotator model + */ + model?: ej.Rotator.Model; + + /**returns the name of the event + */ + type?: string; + + /**the current rotator id. + */ + itemId?: string; + + /**returns the current slide index. + */ + activeItemIndex?: number; +} + +export interface ThumbItemClickEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the rotator model + */ + model?: ej.Rotator.Model; + + /**returns the name of the event + */ + type?: string; + + /**the current rotator id. + */ + itemId?: string; + + /**returns the current slide index. + */ + activeItemIndex?: number; +} + +export interface Fields { + + /**Specifies a link for the image. + */ + linkAttribute?: string; + + /**Specifies where to open a given link. + */ + targetAttribute?: string; + + /**Specifies a caption for the image. + */ + text?: string; + + /**Specifies a caption for the thumbnail image. + */ + thumbnailText?: string; + + /**Specifies the URL for an thumbnail image. + */ + thumbnailUrl?: string; + + /**Specifies the URL for an image. + */ + url?: string; +} + +enum PagerPosition{ + + ///string + BottomLeft, + + ///string + BottomRight, + + ///string + Outside, + + ///string + TopCenter, + + ///string + TopLeft, + + ///string + TopRight +} + +} + +class RTE extends ej.Widget { + static fn: RTE; + constructor(element: JQuery, options?: RTE.Model); + constructor(element: Element, options?: RTE.Model); + model:RTE.Model; + defaults:RTE.Model; + + /** Returns the range object. + * @returns {void} + */ + createRange(): void; + + /** Disables the RTE control. + * @returns {void} + */ + disable(): void; + + /** Disables the corresponding tool in the RTE ToolBar. + * @returns {void} + */ + disableToolbarItem(): void; + + /** Enables the RTE control. + * @returns {void} + */ + enable(): void; + + /** Enables the corresponding tool in the toolbar when the tool is disabled. + * @returns {void} + */ + enableToolbarItem(): void; + + /** Performs the action value based on the given command. + * @returns {void} + */ + executeCommand(): void; + + /** Focuses the RTE control. + * @returns {void} + */ + focus(): void; + + /** Gets the command status of the selected text based on the given comment in the RTE control. + * @returns {void} + */ + getCommandStatus(): void; + + /** Gets the HTML string from the RTE control. + * @returns {void} + */ + getDocument(): void; + + /** Gets the HTML string from the RTE control. + * @returns {void} + */ + getHtml(): void; + + /** Gets the selected html string from the RTE control. + * @returns {void} + */ + getSelectedHtml(): void; + + /** Gets the content as string from the RTE control. + * @returns {void} + */ + getText(): void; + + /** Hides the RTE control. + * @returns {void} + */ + hide(): void; + + /** Inserts new item to the target contextmenu node. + * @returns {void} + */ + insertMenuOption(): void; + + /** This method helps to insert/paste the content at the current cursor (caret) position or the selected content to be replaced with our text by passing the value as parameter to the pasteContent method in the Editor. + * @returns {void} + */ + pasteContent(): void; + + /** Refreshes the RTE control. + * @returns {void} + */ + refresh(): void; + + /** Removes the target menu item from the RTE contextmenu. + * @returns {void} + */ + removeMenuOption (): void; + + /** Removes the given tool from the RTE Toolbar. + * @returns {void} + */ + removeToolbarItem(): void; + + /** Selects all the contents within the RTE. + * @returns {void} + */ + selectAll(): void; + + /** Selects the contents in the given range. + * @returns {void} + */ + selectRange(): void; + + /** Sets the color picker model type rendered initially in the RTE control. + * @returns {void} + */ + setColorPickerType(): void; + + /** Sets the HTML string from the RTE control. + * @returns {void} + */ + setHtml(): void; + + /** Displays the RTE control. + * @returns {void} + */ + show(): void; +} +export module RTE{ + +export interface Model { + + /**Enables/disables the editing of the content. + * @Default {True} + */ + allowEditing?: boolean; + + /**RTE control can be accessed through the keyboard shortcut keys. + * @Default {True} + */ + allowKeyboardNavigation?: boolean; + + /**When the property is set to true, it focuses the RTE at the time of rendering. + * @Default {false} + */ + autoFocus?: boolean; + + /**Based on the content size, its height is adjusted instead of adding the scrollbar. + * @Default {false} + */ + autoHeight?: boolean; + + /**Sets the colorCode to display the color of the fontColor and backgroundColor in the font tools of the RTE. + * @Default {[000000, FFFFFF, C4C4C4, ADADAD, 595959, 262626, 4f81bd, dbe5f1, b8cce4, 95b3d7, 366092, 244061, c0504d, f2dcdb, e5b9b7, d99694, 953734,632423, 9bbb59, ebf1dd, d7e3bc, c3d69b, 76923c, 4f6128, 8064a2, e5e0ec, ccc1d9, b2a2c7, 5f497a, 3f3151, f79646, fdeada, fbd5b5, fac08f,e36c09, 974806]} + */ + colorCode?: any; + + /**The number of columns given are rendered in the color palate popup. + * @Default {6} + */ + colorPaletteColumns?: number; + + /**The number of rows given are rendered in the color palate popup. + * @Default {6} + */ + colorPaletteRows?: number; + + /**Sets the root class for the RTE theme. This cssClass API helps the usage of custom skinning option for the RTE control by including this root class in CSS. + */ + cssClass?: string; + + /**Enables/disables the RTE control’s accessibility or interaction. + * @Default {True} + */ + enabled?: boolean; + + /**When the property is set to true, it returns the encrypted text. + * @Default {false} + */ + enableHtmlEncode?: boolean; + + /**Maintain the values of the RTE after page reload. + * @Default {false} + */ + enablePersistence?: boolean; + + /**Shows the resize icon and enables the resize option in the RTE. + * @Default {True} + */ + enableResize?: boolean; + + /**Shows the RTE in the RTL direction. + * @Default {false} + */ + enableRTL?: boolean; + + /**Formats the contents based on the XHTML rules. + * @Default {false} + */ + enableXHTML?: boolean; + + /**Enables the tab key action with the RichTextEditor content. + * @Default {True} + */ + enableTabKeyNavigation?: boolean; + + /**Load the external CSS file inside Iframe. + * @Default {null} + */ + externalCSS?: string; + + /**This API allows to enable the file browser support in the RTE control to browse, create, delete and upload the files in the specified current directory. + * @Default {null} + */ + fileBrowser?: FileBrowser; + + /**Sets the fontName in the RTE. + * @Default {{text: Segoe UI, value: Segoe UI },{text: Arial, value: Arial,Helvetica,sans-serif },{text: Courier New, value: Courier New,Courier,Monospace },{text: Georgia, value: Georgia,serif },{text: Impact, value: Impact,Charcoal,sans-serif },{text: Lucida Console, value: Lucida Console,Monaco,Monospace },{text: Tahoma, value: Tahoma,Geneva,sans-serif },{text: Times New Roman, value: Times New Roman },{text: Trebuchet MS, value: Trebuchet MS,Helvetica,sans-serif },{text: Verdana, value: Verdana,Geneva,sans-serif}} + */ + fontName?: any; + + /**Sets the fontSize in the RTE. + * @Default {{ text: 1, value: 1 },{ text: 2 (10pt), value: 2 },{ text: 3 (12pt), value: 3 },{ text: 4 (14pt), value: 4 },{ text: 5 (18pt), value: 5 },{ text: 6 (24pt), value: 6 },{ text: 7 (36pt), value: 7 }} + */ + fontSize?: any; + + /**Sets the format in the RTE. + * @Default {{ text: Paragraph, value: <p>, spriteCssClass: e-paragraph },{ text: Quotation, value: <blockquote>, spriteCssClass: e-quotation },{ text: Heading 1, value: <h1>, spriteCssClass: e-h1 },{ text: Heading 2, value: <h2>, spriteCssClass: e-h2 },{ text: Heading 3, value: <h3>, spriteCssClass: e-h3 },{ text: Heading 4, value: <h4>, spriteCssClass: e-h4 },{ text: Heading 5, value: <h5>, spriteCssClass: e-h5 },{ text: Heading 6, value: <h6>, spriteCssClass: e-h6}} + */ + format?: string; + + /**Defines the height of the RTE textbox. + * @Default {370} + */ + height?: string|number; + + /**Specifies the HTML Attributes of the ejRTE. + * @Default {{}} + */ + htmlAttributes?: any; + + /**Sets the given attributes to the iframe body element. + * @Default {{}} + */ + iframeAttributes?: any; + + /**This API allows the image browser to support in the RTE control to browse, create, delete, and upload the image files to the specified current directory. + * @Default {null} + */ + imageBrowser?: ImageBrowser; + + /**Enables/disables responsive support for the RTE control toolbar items during the window resizing time. + * @Default {false} + */ + isResponsive?: boolean; + + /**Sets the culture in the RTE when you set the localization values are needs to be assigned to the corresponding text as follows. + * @Default {en-US} + */ + locale?: string; + + /**Sets the maximum height for the RTE outer wrapper element. + * @Default {null} + */ + maxHeight?: string|number; + + /**Sets the maximum length for the RTE outer wrapper element. + * @Default {7000} + */ + maxLength?: number; + + /**Sets the maximum width for the RTE outer wrapper element. + * @Default {null} + */ + maxWidth?: string|number; + + /**Sets the minimum height for the RTE outer wrapper element. + * @Default {280} + */ + minHeight?: string|number; + + /**Sets the minimum width for the RTE outer wrapper element. + * @Default {400} + */ + minWidth?: string|number; + + /**Sets the name in the RTE. When the name value is not initialized, the ID value is assigned to the name. + */ + name?: string; + + /**Shows ClearAll icon in the RTE footer. + * @Default {false} + */ + showClearAll?: boolean; + + /**Shows the clear format in the RTE footer. + * @Default {true} + */ + showClearFormat?: boolean; + + /**Shows the Custom Table in the RTE. + * @Default {True} + */ + showCustomTable?: boolean; + + /**Shows custom contextmenu with the RTE. + * @Default {True} + */ + showContextMenu?: boolean; + + /**This API is used to set the default dimensions for the image and video. When this property is set to true, the image and video dialog displays the dimension option. + * @Default {false} + */ + showDimensions?: boolean; + + /**Shows the FontOption in the RTE. + * @Default {True} + */ + showFontOption?: boolean; + + /**Shows footer in the RTE. When the footer is enabled, it displays the html tag, word Count, character count, clear format, resize icon and clear all the content icons, by default. + * @Default {false} + */ + showFooter?: boolean; + + /**Shows the HtmlSource in the RTE footer. + * @Default {false} + */ + showHtmlSource?: boolean; + + /**When the cursor is placed or when the text is selected in the RTE, it displays the tag info in the footer. + * @Default {True} + */ + showHtmlTagInfo?: boolean; + + /**Shows the toolbar in the RTE. + * @Default {True} + */ + showToolbar?: boolean; + + /**Counts the total characters and displays it in the RTE footer. + * @Default {True} + */ + showCharCount?: boolean; + + /**Counts the total words and displays it in the RTE footer. + * @Default {True} + */ + showWordCount?: boolean; + + /**The given number of columns render the insert table pop. + * @Default {10} + */ + tableColumns?: number; + + /**The given number of rows render the insert table pop. + * @Default {8} + */ + tableRows?: number; + + /**Sets the tools in the RTE and gets the inner display order of the corresponding group element. Tools are dependent on the toolsList property. + * @Default {formatStyle: [format],style: [bold, italic, underline, strikethrough],alignment: [justifyLeft, justifyCenter, justifyRight, justifyFull],lists: [unorderedList, orderedList],indenting: [outdent, indent],doAction: [undo, redo],links: [createLink,removeLink],images: [image],media: [video],tables: [createTable, addRowAbove, addRowBelow, addColumnLeft, addColumnRight, deleteRow, deleteColumn, deleteTable]],view:[“fullScreen”,zoomIn,zoomOut],print:[print]} + */ + tools?: Tools; + + /**Specifies the list of groups and order of those groups displayed in the RTE toolbar. The toolsList property is used to get the root group order and tools property is used to get the inner order of the corresponding groups displayed. When the value is not specified, it gets its default display order and tools. + * @Default {[formatStyle, font, style, effects, alignment, lists, indenting, clipboard, doAction, clear, links, images, media, tables, casing,view, customTools,print,edit]} + */ + toolsList?: Array; + + /**Gets the undo stack limit. + * @Default {50} + */ + undoStackLimit?: number; + + /**The given string value is displayed in the editable area. + * @Default {null} + */ + value?: string; + + /**Sets the jquery validation rules to the Rich Text Editor. + * @Default {null} + */ + validationRules?: any; + + /**Sets the jquery validation error message to the Rich Text Editor. + * @Default {null} + */ + validationMessage?: any; + + /**Defines the width of the RTE textbox. + * @Default {786} + */ + width?: string|number; + + /**Increases and decreases the contents zoom range in percentage + * @Default {0.05} + */ + zoomStep?: string|number; + + /**Fires when changed successfully.*/ + change? (e: ChangeEventArgs): void; + + /**Fires when the RTE is created successfully*/ + create? (e: CreateEventArgs): void; + + /**Fires when mouse click on menu items.*/ + contextMenuClick? (e: ContextMenuClickEventArgs): void; + + /**Fires before the RTE is destroyed.*/ + destroy? (e: DestroyEventArgs): void; + + /**Fires when the commands are executed successfully.*/ + execute? (e: ExecuteEventArgs): void; + + /**Fires when the keydown action is successful.*/ + keydown? (e: KeydownEventArgs): void; + + /**Fires when the keyup action is successful.*/ + keyup? (e: KeyupEventArgs): void; + + /**Fires before the RTE Edit area is rendered and after the toolbar is rendered.*/ + preRender? (e: PreRenderEventArgs): void; +} + +export interface ChangeEventArgs { + + /**When the event is canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the RTE model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface CreateEventArgs { + + /**When the event is canceled; otherwise, false. + */ + cancel?: boolean; + + /**Returns the RTE model + */ + model?: any; + + /**Returns the name of the event + */ + type?: string; +} + +export interface ContextMenuClickEventArgs { + + /**returns clicked menu item text. + */ + text?: string; + + /**returns clicked menu item element. + */ + element?: any; + + /**returns the selected item. + */ + selectedItem?: number; +} + +export interface DestroyEventArgs { + + /**When the event is canceled; otherwise, false. + */ + cancel?: boolean; + + /**Returns the RTE model + */ + model?: any; + + /**Returns the name of the event + */ + type?: string; +} + +export interface ExecuteEventArgs { + + /**When the event is canceled; otherwise, false. + */ + cancel?: boolean; + + /**Returns the RTE model + */ + model?: any; + + /**Returns the name of the event + */ + type?: string; +} + +export interface KeydownEventArgs { + + /**When the event is canceled; otherwise, false. + */ + cancel?: boolean; + + /**Returns the RTE model + */ + model?: any; + + /**Returns the name of the event + */ + type?: string; +} + +export interface KeyupEventArgs { + + /**When the event is canceled; otherwise, false. + */ + cancel?: boolean; + + /**Returns the RTE model + */ + model?: any; + + /**Returns the name of the event + */ + type?: string; +} + +export interface PreRenderEventArgs { + + /**When the event is canceled; otherwise, false. + */ + cancel?: boolean; + + /**Returns the RTE model + */ + model?: any; + + /**Returns the name of the event + */ + type?: string; +} + +export interface FileBrowser { + + /**This API is used to receive the server-side handler for file related operations. + */ + ajaxAction?: string; + + /**Specifies the file type extension shown in the file browser window. + */ + extensionAllow?: string; + + /**Specifies the directory to perform operations like create, delete and rename folder and files, and upload the selected files to the current directory. + */ + filePath?: string; +} + +export interface ImageBrowser { + + /**This API is used to receive the server-side handler for the file related operations. + */ + ajaxAction?: string; + + /**Specifies the file type extension shown in the image browser window. + */ + extensionAllow?: string; + + /**Specifies the directory to perform operations like create, delete and rename folder and files, and upload the selected images to the current directory. + */ + filePath?: string; +} + +export interface ToolsCustomOrderedList { + + /**Specifies the name for customOrderedList item. + */ + name?: string; + + /**Specifies the title for customOrderedList item. + */ + tooltip?: string; + + /**Specifies the styles for customOrderedList item. + */ + css?: string; + + /**Specifies the text for customOrderedList item. + */ + text?: string; + + /**Specifies the list style for customOrderedList item. + */ + listStyle?: string; + + /**Specifies the image for customOrderedList item. + */ + listImage?: string; +} + +export interface ToolsCustomUnorderedList { + + /**Specifies the name for customUnorderedList item. + */ + name?: string; + + /**Specifies the title for customUnorderedList item. + */ + tooltip?: string; + + /**Specifies the styles for customUnorderedList item. + */ + css?: string; + + /**Specifies the text for customUnorderedList item. + */ + text?: string; + + /**Specifies the list style for customUnorderedList item. + */ + listStyle?: string; + + /**Specifies the image for customUnorderedList item. + */ + listImage?: string; +} + +export interface Tools { + + /**Specifies the alignment tools and the display order of this tool in the RTE toolbar. + */ + alignment?: any; + + /**Specifies the casing tools and the display order of this tool in the RTE toolbar. + */ + casing?: Array; + + /**Specifies the clear tools and the display order of this tool in the RTE toolbar. + */ + clear?: Array; + + /**Specifies the clipboard tools and the display order of this tool in the RTE toolbar. + */ + clipboard?: Array; + + /**Specifies the edit tools and the displays tool in the RTE toolbar. + */ + edit?: Array; + + /**Specifies the doAction tools and the display order of this tool in the RTE toolbar. + */ + doAction?: Array; + + /**Specifies the effect of tools and the display order of this tool in RTE toolbar. + */ + effects?: Array; + + /**Specifies the font tools and the display order of this tool in the RTE toolbar. + */ + font?: Array; + + /**Specifies the formatStyle tools and the display order of this tool in the RTE toolbar. + */ + formatStyle?: Array; + + /**Specifies the image tools and the display order of this tool in the RTE toolbar. + */ + images?: Array; + + /**Specifies the indent tools and the display order of this tool in the RTE toolbar. + */ + indenting?: Array; + + /**Specifies the link tools and the display order of this tool in the RTE toolbar. + */ + links?: Array; + + /**Specifies the list tools and the display order of this tool in the RTE toolbar. + */ + lists?: Array; + + /**Specifies the media tools and the display order of this tool in the RTE toolbar. + */ + media?: Array; + + /**Specifies the style tools and the display order of this tool in the RTE toolbar. + */ + style?: Array; + + /**Specifies the table tools and the display order of this tool in the RTE toolbar. + */ + tables?: Array; + + /**Specifies the view tools and the display order of this tool in the RTE toolbar. + */ + view?: Array; + + /**Specifies the print tools and the display order of this tool in the RTE toolbar. + */ + print?: Array; + + /**Specifies the customOrderedList tools and the display order of this tool in the RTE toolbar. + */ + customOrderedList?: Array; + + /**Specifies the customUnOrderedList tools and the display order of this tool in the RTE toolbar. + */ + customUnorderedList?: Array; +} +} + +class Slider extends ej.Widget { + static fn: Slider; + constructor(element: JQuery, options?: Slider.Model); + constructor(element: Element, options?: Slider.Model); + model:Slider.Model; + defaults:Slider.Model; + + /** To disable the slider + * @returns {void} + */ + disable(): void; + + /** To enable the slider + * @returns {void} + */ + enable(): void; + + /** To get value from slider handle + * @returns {number} + */ + getValue(): number; + + /** To set value to slider handle + * @returns {void} + */ + setValue(): void; +} +export module Slider{ + +export interface Model { + + /**Specifies the animationSpeed of the slider. + * @Default {500} + */ + animationSpeed?: number; + + /**Specify the CSS class to slider to achieve custom theme. + */ + cssClass?: string; + + /**Specifies the animation behavior of the slider. + * @Default {true} + */ + enableAnimation?: boolean; + + /**Specifies the state of the slider. + * @Default {true} + */ + enabled?: boolean; + + /**Specify the enablePersistence to slider to save current model value to browser cookies for state maintains + * @Default {false} + */ + enablePersistence?: boolean; + + /**Specifies the Right to Left Direction of the slider. + * @Default {false} + */ + enableRTL?: boolean; + + /**Specifies the height of the slider. + * @Default {14} + */ + height?: string; + + /**Specifies the HTML Attributes of the ejSlider. + * @Default {{}} + */ + htmlAttributes?: any; + + /**Specifies the incremental step value of the slider. + * @Default {1} + */ + incrementStep?: number; + + /**Specifies the distance between two major (large) ticks from the scale of the slider. + * @Default {10} + */ + largeStep?: number; + + /**Specifies the ending value of the slider. + * @Default {100} + */ + maxValue?: number; + + /**Specifies the starting value of the slider. + * @Default {0} + */ + minValue?: number; + + /**Specifies the orientation of the slider. + * @Default {ej.orientation.Horizontal} + */ + orientation?: ej.Orientation|string; + + /**Specifies the readOnly of the slider. + * @Default {false} + */ + readOnly?: boolean; + + /**Specifies the rounded corner behavior for slider. + * @Default {false} + */ + showRoundedCorner?: boolean; + + /**Shows/Hide the major (large) and minor (small) ticks in the scale of the slider. + * @Default {false} + */ + showScale?: boolean; + + /**Specifies the small ticks from the scale of the slider. + * @Default {true} + */ + showSmallTicks?: boolean; + + /**Specifies the showTooltip to shows the current Slider value, while moving the Slider handle or clicking on the slider handle of the slider. + * @Default {true} + */ + showTooltip?: boolean; + + /**Specifies the sliderType of the slider. + * @Default {ej.SliderType.Default} + */ + sliderType?: ej.slider.sliderType|string; + + /**Specifies the distance between two minor (small) ticks from the scale of the slider. + * @Default {1} + */ + smallStep?: number; + + /**Specifies the value of the slider. But it's not applicable for range slider. To range slider we can use values property. + * @Default {0} + */ + value?: number; + + /**Specifies the values of the range slider. But it's not applicable for default and minRange sliders. we can use value property for default and minRange sliders. + * @Default {[minValue,maxValue]} + */ + values?: Array; + + /**Specifies the width of the slider. + * @Default {100%} + */ + width?: string; + + /**Fires once Slider control value is changed successfully.*/ + change? (e: ChangeEventArgs): void; + + /**Fires once Slider control has been created successfully.*/ + create? (e: CreateEventArgs): void; + + /**Fires when Slider control has been destroyed successfully.*/ + destroy? (e: DestroyEventArgs): void; + + /**Fires once Slider control is sliding successfully.*/ + slide? (e: SlideEventArgs): void; + + /**Fires once Slider control is started successfully.*/ + start? (e: StartEventArgs): void; + + /**Fires when Slider control is stopped successfully.*/ + stop? (e: StopEventArgs): void; +} + +export interface ChangeEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns current handle number or index + */ + sliderIndex?: number; + + /**returns slider id. + */ + id?: string; + + /**returns the slider model. + */ + model?: ej.Slider.Model; + + /**returns the name of the event. + */ + type?: string; + + /**returns the slider value. + */ + value?: number; + + /**returns true if event triggered by interaction else returns false. + */ + isInteraction?: boolean; +} + +export interface CreateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the slider model + */ + model?: ej.Slider.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the slider model + */ + model?: ej.Slider.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface SlideEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns current handle number or index + */ + sliderIndex?: number; + + /**returns slider id + */ + id?: string; + + /**returns the slider model + */ + model?: ej.Slider.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the slider value + */ + value?: number; +} + +export interface StartEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns current handle number or index + */ + sliderIndex?: number; + + /**returns slider id + */ + id?: string; + + /**returns the slider model + */ + model?: ej.Slider.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the slider value + */ + value?: number; +} + +export interface StopEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns current handle number or index + */ + sliderIndex?: number; + + /**returns slider id + */ + id?: string; + + /**returns the slider model + */ + model?: ej.Slider.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the slider value + */ + value?: number; +} +} +module slider +{ +enum sliderType +{ +//Shows default slider +Default, +//Shows minRange slider +MinRange, +//Shows Range slider +Range, +} +} + +class SplitButton extends ej.Widget { + static fn: SplitButton; + constructor(element: JQuery, options?: SplitButton.Model); + constructor(element: Element, options?: SplitButton.Model); + model:SplitButton.Model; + defaults:SplitButton.Model; + + /** destroy the split button widget all events bound using this._on will be unbind automatically and bring the control to pre-init state. + * @returns {void} + */ + destroy(): void; + + /** To disable the split button + * @returns {void} + */ + disable(): void; + + /** To Enable the split button + * @returns {void} + */ + enable(): void; + + /** To Hide the list content of the split button. + * @returns {void} + */ + hide(): void; + + /** To show the list content of the split button. + * @returns {void} + */ + show(): void; +} +export module SplitButton{ + +export interface Model { + + /**Specifies the arrowPosition of the Split or Dropdown Button.See arrowPosition + * @Default {ej.ArrowPosition.Right} + */ + arrowPosition?: string|ej.ArrowPosition; + + /**Specifies the buttonMode like Split or Dropdown Button.See ButtonMode + * @Default {ej.ButtonMode.Split} + */ + buttonMode?: string|ej.ButtonMode; + + /**Specifies the contentType of the Split Button.See ContentType + * @Default {ej.ContentType.TextOnly} + */ + contentType?: string|ej.ContentType; + + /**Set the root class for Split Button control theme + */ + cssClass?: string; + + /**Specifies the disabling of Split Button if enabled is set to false. + * @Default {true} + */ + enabled?: boolean; + + /**Specifies the enableRTL property for Split Button while initialization. + * @Default {false} + */ + enableRTL?: boolean; + + /**Specifies the height of the Split Button. + * @Default {“”} + */ + height?: string|number; + + /**Specifies the HTML Attributes of the Split Button. + * @Default {{}} + */ + htmlAttributes?: any; + + /**Specifies the imagePosition of the Split Button.See imagePositions + * @Default {ej.ImagePosition.ImageRight} + */ + imagePosition?: string|ej.ImagePosition; + + /**Specifies the image content for Split Button while initialization. + */ + prefixIcon?: string; + + /**Specifies the showRoundedCorner property for Split Button while initialization. + * @Default {false} + */ + showRoundedCorner?: string; + + /**Specifies the size of the Button. See ButtonSize + * @Default {ej.ButtonSize.Normal} + */ + size?: string|ej.ButtonSize; + + /**Specifies the image content for Split Button while initialization. + */ + suffixIcon?: string; + + /**Specifies the list content for Split Button while initialization + */ + targetID?: string; + + /**Specifies the text content for Split Button while initialization. + */ + text?: string; + + /**Specifies the width of the Split Button. + * @Default {“”} + */ + width?: string|number; + + /**Fires before menu of the split button control is opened.*/ + beforeOpen? (e: BeforeOpenEventArgs): void; + + /**Fires when Button control is clicked successfully*/ + click? (e: ClickEventArgs): void; + + /**Fires before the list content of Button control is closed*/ + close? (e: CloseEventArgs): void; + + /**Fires after Split Button control is created.*/ + create? (e: CreateEventArgs): void; + + /**Fires when the Split Button is destroyed successfully*/ + destroy? (e: DestroyEventArgs): void; + + /**Fires when a menu item is Hovered out successfully*/ + itemMouseOut? (e: ItemMouseOutEventArgs): void; + + /**Fires when a menu item is Hovered in successfully*/ + itemMouseOver? (e: ItemMouseOverEventArgs): void; + + /**Fires when a menu item is clicked successfully*/ + itemSelected? (e: ItemSelectedEventArgs): void; + + /**Fires before the list content of Button control is opened*/ + open? (e: OpenEventArgs): void; +} + +export interface BeforeOpenEventArgs { + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the split button model + */ + model?: ej.SplitButton.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface ClickEventArgs { + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the split button model + */ + model?: ej.SplitButton.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the target of the current object. + */ + target?: any; + + /**return the button state + */ + status?: boolean; +} + +export interface CloseEventArgs { + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the split button model + */ + model?: ej.SplitButton.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface CreateEventArgs { + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the split button model + */ + model?: ej.SplitButton.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the split button model + */ + model?: ej.SplitButton.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface ItemMouseOutEventArgs { + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the split button model + */ + model?: ej.SplitButton.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the clicked menu item element + */ + element?: any; + + /**returns the event + */ + event?: any; +} + +export interface ItemMouseOutEvent { + + /**return the menu item id + */ + ID?: string; + + /**return the clicked menu item text + */ + Text?: string; +} + +export interface ItemMouseOverEventArgs { + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the split button model + */ + model?: ej.SplitButton.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the clicked menu item element + */ + element?: any; + + /**returns the event + */ + event?: any; +} + +export interface ItemMouseOverEvent { + + /**return the menu item id + */ + ID?: string; + + /**return the clicked menu item text + */ + Text?: string; +} + +export interface ItemSelectedEventArgs { + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the split button model + */ + model?: ej.SplitButton.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the clicked menu item element + */ + element?: any; + + /**returns the selected item + */ + selectedItem?: any; + + /**return the menu id + */ + menuId?: string; + + /**return the clicked menu item text + */ + menuText?: string; +} + +export interface OpenEventArgs { + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the split button model + */ + model?: ej.SplitButton.Model; + + /**returns the name of the event + */ + type?: string; +} +} +enum ArrowPosition +{ +//To set Left arrowPosition of the split button +Left, +//To set Right arrowPosition of the split button +Right, +//To set Top arrowPosition of the split button +Top, +//To set Bottom arrowPosition of the split button +Bottom, +} + +class Splitter extends ej.Widget { + static fn: Splitter; + constructor(element: JQuery, options?: Splitter.Model); + constructor(element: Element, options?: Splitter.Model); + model:Splitter.Model; + defaults:Splitter.Model; + + /** To add a new pane to splitter control. + * @param {string} content of pane. + * @param {any} pane properties. + * @param {number} index of pane. + * @returns {HTMLElement} + */ + addItem(content: string, property: any, index: number): HTMLElement; + + /** To collapse the splitter control pane. + * @param {number} index number of pane. + * @returns {void} + */ + collapse(paneIndex: number): void; + + /** To expand the splitter control pane. + * @param {number} index number of pane. + * @returns {void} + */ + expand(paneIndex: number): void; + + /** To refresh the splitter control pane resizing. + * @returns {void} + */ + refresh(): void; + + /** To remove a specified pane from the splitter control. + * @param {number} index of pane. + * @returns {void} + */ + removeItem(index: number): void; +} +export module Splitter{ + +export interface Model { + + /**Turns on keyboard interaction with the Splitter panes. You must set this property to true to access the keyboard shortcuts of ejSplitter. + * @Default {true} + */ + allowKeyboardNavigation?: boolean; + + /**Specify animation speed for the Splitter pane movement, while collapsing and expanding. + * @Default {300} + */ + animationSpeed?: number; + + /**Specify the CSS class to splitter control to achieve custom theme. + * @Default {“”} + */ + cssClass?: string; + + /**Specifies the animation behavior of the splitter. + * @Default {true} + */ + enableAnimation?: boolean; + + /**Specifies the splitter control to be displayed in right to left direction. + * @Default {false} + */ + enableRTL?: boolean; + + /**Specify height for splitter control. + * @Default {null} + */ + height?: string; + + /**Specifies the HTML Attributes of the Splitter. + * @Default {{}} + */ + htmlAttributes?: any; + + /**Specify window resizing behavior for splitter control. + * @Default {false} + */ + isResponsive?: boolean; + + /**Specify the orientation for spliter control. See orientation + * @Default {ej.orientation.Horizontal or “horizontal”} + */ + orientation?: ej.Orientation|string; + + /**Specify properties for each pane like paneSize, minSize, maxSize, collapsible, resizable. + * @Default {[]} + */ + properties?: Array; + + /**Specify width for splitter control. + * @Default {null} + */ + width?: string; + + /**Fires before expanding / collapsing the split pane of splitter control.*/ + beforeExpandCollapse? (e: BeforeExpandCollapseEventArgs): void; + + /**Fires when splitter control pane has been created.*/ + create? (e: CreateEventArgs): void; + + /**Fires when splitter control pane has been destroyed.*/ + destroy? (e: DestroyEventArgs): void; + + /**Fires when expand / collapse operation in splitter control pane has been performed successfully.*/ + expandCollapse? (e: ExpandCollapseEventArgs): void; + + /**Fires when resize in splitter control pane.*/ + resize? (e: ResizeEventArgs): void; +} + +export interface BeforeExpandCollapseEventArgs { + + /**if the event should be cancelled; otherwise, false. + */ + cancel?: boolean; + + /**returns collapsed pane details. + */ + collapsed?: any; + + /**returns expanded pane details. + */ + expanded?: any; + + /**returns the splitter model. + */ + model?: ej.Splitter.Model; + + /**returns the current split bar index. + */ + splitbarIndex?: number; + + /**returns the name of the event. + */ + type?: string; +} + +export interface CreateEventArgs { + + /**if the event should be cancelled; otherwise, false. + */ + cancel?: boolean; + + /**returns the splitter model. + */ + model?: ej.Splitter.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**if the event should be cancelled; otherwise, false. + */ + cancel?: boolean; + + /**returns the splitter model. + */ + model?: ej.Splitter.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface ExpandCollapseEventArgs { + + /**if the event should be cancelled; otherwise, false. + */ + cancel?: boolean; + + /**returns collapsed pane details. + */ + collapsed?: any; + + /**returns expanded pane details. + */ + expanded?: any; + + /**returns the splitter model. + */ + model?: ej.Splitter.Model; + + /**returns the current split bar index. + */ + splitbarIndex?: number; + + /**returns the name of the event. + */ + type?: string; +} + +export interface ResizeEventArgs { + + /**if the event should be cancelled; otherwise, false. + */ + cancel?: boolean; + + /**returns previous pane details. + */ + prevPane?: any; + + /**returns next pane details. + */ + nextPane?: any; + + /**returns the splitter model. + */ + model?: ej.Splitter.Model; + + /**returns the current split bar index. + */ + splitbarIndex?: number; + + /**returns the name of the event. + */ + type?: string; +} +} + +class Tab extends ej.Widget { + static fn: Tab; + constructor(element: JQuery, options?: Tab.Model); + constructor(element: Element, options?: Tab.Model); + model:Tab.Model; + defaults:Tab.Model; + + /** Add new tab items with given name, url and given index position, if index null it’s add last item. + * @param {string} URL name / tab id. + * @param {string} Tab Display name. + * @param {number} Index position to placed , this is optional. + * @param {string} specifies cssClass, this is optional. + * @param {string} specifies id of tab, this is optional. + * @returns {void} + */ + addItem(url: string, displayLabel: string, index: number, cssClass: string, id: string): void; + + /** To disable the tab control. + * @returns {void} + */ + disable(): void; + + /** To enable the tab control. + * @returns {void} + */ + enable(): void; + + /** This function get the number of tab rendered + * @returns {number} + */ + getItemsCount(): number; + + /** This function hides the tab control. + * @returns {void} + */ + hide(): void; + + /** This function hides the specified item tab in tab control. + * @param {number} index of tab item. + * @returns {void} + */ + hideItem(index: number): void; + + /** Remove the given index tab item. + * @param {number} index of tab item. + * @returns {void} + */ + removeItem(index: number): void; + + /** This function is to show the tab control. + * @returns {void} + */ + show(): void; + + /** This function helps to show the specified hidden tab item in tab control. + * @param {number} index of tab item. + * @returns {void} + */ + showItem(index: number): void; +} +export module Tab{ + +export interface Model { + + /**Specifies the ajaxSettings option to load the content to the Tab control. + */ + ajaxSettings?: AjaxSettings; + + /**Tab items interaction with keyboard keys, like headers active navigation. + * @Default {true} + */ + allowKeyboardNavigation?: boolean; + + /**Allow to collapsing the active item, while click on the active header. + * @Default {false} + */ + collapsible?: boolean; + + /**Set the root class for Tab theme. This cssClass API helps to use custom skinning option for Tab control. + */ + cssClass?: string; + + /**Disables the given tab headers and content panels. + * @Default {[]} + */ + disabledItemIndex?: number[]; + + /**Specifies the animation behavior of the tab. + * @Default {true} + */ + enableAnimation?: boolean; + + /**When this property is set to false, it disables the tab control. + * @Default {true} + */ + enabled?: boolean; + + /**Enables the given tab headers and content panels. + * @Default {[]} + */ + enabledItemIndex?: number[]; + + /**Save current model value to browser cookies for state maintains. While refresh the Tab control page the model value apply from browser cookies. + * @Default {false} + */ + enablePersistence?: boolean; + + /**Display Right to Left direction for headers and panels text of tab. + * @Default {false} + */ + enableRTL?: boolean; + + /**Specify to enable scrolling for Tab header. + * @Default {false} + */ + enableTabScroll?: boolean; + + /**The event API to bind the action for active the tab items. + * @Default {click} + */ + events?: string; + + /**Specifies the position of Tab header as top, bottom, left or right. See below to get availanle Position + * @Default {top} + */ + headerPosition?: string | ej.Tab.Position; + + /**Set the height of the tab header element. Default this property value is null, so height take content height. + * @Default {null} + */ + headerSize?: string|number; + + /**Height set the outer panel element. Default this property value is null, so height take content height. + * @Default {null} + */ + height?: string|number; + + /**Adjust the content panel height for given option (content, auto and fill), by default panels height adjust based on the content.See below to get available HeightAdjustMode + * @Default {content} + */ + heightAdjustMode?: string | ej.Tab.HeightAdjustMode; + + /**Specifies to hide a pane of Tab control. + * @Default {[]} + */ + hiddenItemIndex?: Array; + + /**Specifies the HTML Attributes of the Tab. + * @Default {{}} + */ + htmlAttributes?: any; + + /**The idPrefix property appends the given string on the added tab item id’s in runtime. + * @Default {ej-tab-} + */ + idPrefix?: string; + + /**Specifies the Tab header in active for given index value. + * @Default {0} + */ + selectedItemIndex?: number; + + /**Display the close button for each tab items. While clicking on the close icon, particular tab item will be removed. + * @Default {false} + */ + showCloseButton?: boolean; + + /**Display the Reload button for each tab items. + * @Default {false} + */ + showReloadIcon?: boolean; + + /**Tab panels and headers to be displayed in rounded corner style. + * @Default {false} + */ + showRoundedCorner?: boolean; + + /**Set the width for outer panel element, if not it’s take parent width. + * @Default {null} + */ + width?: string|number; + + /**Triggered after a tab item activated.*/ + itemActive? (e: ItemActiveEventArgs): void; + + /**Triggered before ajax content has been loaded.*/ + ajaxBeforeLoad? (e: AjaxBeforeLoadEventArgs): void; + + /**Triggered if error occurs in Ajax request.*/ + ajaxError? (e: AjaxErrorEventArgs): void; + + /**Triggered after ajax content load action.*/ + ajaxLoad? (e: AjaxLoadEventArgs): void; + + /**Triggered after a tab item activated.*/ + ajaxSuccess? (e: AjaxSuccessEventArgs): void; + + /**Triggered before a tab item activated.*/ + beforeActive? (e: BeforeActiveEventArgs): void; + + /**Triggered before a tab item remove.*/ + beforeItemRemove? (e: BeforeItemRemoveEventArgs): void; + + /**Triggered before a tab item Create.*/ + create? (e: CreateEventArgs): void; + + /**Triggered before a tab item destroy.*/ + destroy? (e: DestroyEventArgs): void; + + /**Triggered after new tab item add*/ + itemAdd? (e: ItemAddEventArgs): void; + + /**Triggered after tab item removed.*/ + itemRemove? (e: ItemRemoveEventArgs): void; +} + +export interface ItemActiveEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the tab model. + */ + model?: ej.Tab.Model; + + /**returns the name of the event. + */ + type?: string; + + /**returns previous active tab header. + */ + prevActiveHeader?: HTMLElement; + + /**returns previous active index. + */ + prevActiveIndex?: number; + + /**returns current active tab header . + */ + activeHeader?: HTMLElement; + + /**returns current active index. + */ + activeIndex?: number; + + /**returns, is it triggered by interaction or not. + */ + isInteraction?: boolean; +} + +export interface AjaxBeforeLoadEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the tab model. + */ + model?: ej.Tab.Model; + + /**returns the name of the event. + */ + type?: string; + + /**returns previous active tab header. + */ + prevActiveHeader?: HTMLElement; + + /**returns previous active index. + */ + prevActiveIndex?: number; + + /**returns current active tab header . + */ + activeHeader?: HTMLElement; + + /**returns current active index. + */ + activeIndex?: number; + + /**returns the url of ajax request + */ + url?: string; + + /**returns, is it triggered by interaction or not. + */ + isInteraction?: boolean; +} + +export interface AjaxErrorEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the tab model. + */ + model?: ej.Tab.Model; + + /**returns the name of the event. + */ + type?: string; + + /**returns ajax data details. + */ + data?: any; + + /**returns the url of ajax request. + */ + url?: string; +} + +export interface AjaxLoadEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the tab model. + */ + model?: ej.Tab.Model; + + /**returns the name of the event. + */ + type?: string; + + /**returns previous active tab header. + */ + prevActiveHeader?: HTMLElement; + + /**returns previous active index. + */ + prevActiveIndex?: number; + + /**returns current active tab header . + */ + activeHeader?: HTMLElement; + + /**returns current active index. + */ + activeIndex?: number; + + /**returns the url of ajax request + */ + url?: string; + + /**returns, is it triggered by interaction or not. + */ + isInteraction?: boolean; +} + +export interface AjaxSuccessEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the tab model. + */ + model?: ej.Tab.Model; + + /**returns the name of the event. + */ + type?: string; + + /**return ajax data. + */ + data?: any; + + /**returns ajax url + */ + url?: string; + + /**returns content of ajax request. + */ + content?: any; +} + +export interface BeforeActiveEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the tab model. + */ + model?: ej.Tab.Model; + + /**returns the name of the event. + */ + type?: string; + + /**returns previous active tab header. + */ + prevActiveHeader?: HTMLElement; + + /**returns previous active index. + */ + prevActiveIndex?: number; + + /**returns current active tab header . + */ + activeHeader?: HTMLElement; + + /**returns current active index. + */ + activeIndex?: number; + + /**returns, is it triggered by interaction or not. + */ + isInteraction?: boolean; +} + +export interface BeforeItemRemoveEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the tab model. + */ + model?: ej.Tab.Model; + + /**returns the name of the event. + */ + type?: string; + + /**returns current tab item index + */ + index?: number; +} + +export interface CreateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the tab model. + */ + model?: ej.Tab.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the tab model. + */ + model?: ej.Tab.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface ItemAddEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the tab model. + */ + model?: ej.Tab.Model; + + /**returns the name of the event. + */ + type?: string; + + /**returns new added tab header. + */ + tabHeader?: HTMLElement; + + /**returns new added tab content panel. + */ + tabContent?: any; +} + +export interface ItemRemoveEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the tab model. + */ + model?: ej.Tab.Model; + + /**returns the name of the event. + */ + type?: string; + + /**returns removed tab header. + */ + removedTab?: HTMLElement; +} + +export interface AjaxSettings { + + /**It specifies, whether to enable or disable asynchronous request. + * @Default {true} + */ + async?: boolean; + + /**It specifies the page will be cached in the web browser. + * @Default {false} + */ + cache?: boolean; + + /**It specifies the type of data is send in the query string. + * @Default {html} + */ + contentType?: string; + + /**It specifies the data as an object, will be passed in the query string. + * @Default {{}} + */ + data?: any; + + /**It specifies the type of data that you're expecting back from the response. + * @Default {html} + */ + dataType?: string; + + /**It specifies the HTTP request type. + * @Default {get} + */ + type?: string; +} + +enum Position{ + + ///Tab headers display to top position + Top, + + ///Tab headers display to bottom position + Bottom, + + ///Tab headers display to left position. + Left, + + ///Tab headers display to right position. + Right +} + + +enum HeightAdjustMode{ + + ///string + None, + + ///string + Content, + + ///string + Auto, + + ///string + Fill +} + +} + +class TagCloud extends ej.Widget { + static fn: TagCloud; + constructor(element: JQuery, options?: TagCloud.Model); + constructor(element: Element, options?: TagCloud.Model); + model:TagCloud.Model; + defaults:TagCloud.Model; + + /** Inserts a new item into the TagCloud + * @param {string} Insert new item into the TagCloud + * @returns {void} + */ + insert(name: string): void; + + /** Inserts a new item into the TagCloud at a particular position. + * @param {string} Inserts a new item into the TagCloud + * @param {number} Inserts a new item into the TagCloud with the specified position + * @returns {void} + */ + insertAt(name: string, position: number): void; + + /** Removes the item from the TagCloud based on the name. It removes all the tags which have the corresponding name + * @param {string} name of the tag. + * @returns {void} + */ + remove(name: string): void; + + /** Removes the item from the TagCloud based on the position. It removes the tags from the the corresponding position only. + * @param {number} position of tag item. + * @returns {void} + */ + removeAt(position: number): void; +} +export module TagCloud{ + +export interface Model { + + /**Specify the CSS class to button to achieve custom theme. + */ + cssClass?: string; + + /**The dataSource contains the list of data to display in a cloud format. Each data contains a link url, frequency to categorize the font size and a display text. + * @Default {null} + */ + dataSource?: any; + + /**Sets the TagCloud and tag items direction as right to left alignment. + * @Default {false} + */ + enableRTL?: boolean; + + /**Defines the mapping fields for the data items of the TagCloud. + * @Default {null} + */ + fields?: Fields; + + /**Defines the format for the TagCloud to display the tag items.See Format + * @Default {ej.Format.Cloud} + */ + format?: string|ej.Format; + + /**Sets the maximum font size value for the tag items. The font size for the tag items will be generated in between the minimum and maximum font size values. + * @Default {40px} + */ + maxFontSize?: string|number; + + /**Sets the minimum font size value for the tag items. The font size for the tag items will be generated in between the minimum and maximum font size values. + * @Default {10px} + */ + minFontSize?: string|number; + + /**Define the query to retrieve the data from online server. The query is used only when the online dataSource is used. + * @Default {null} + */ + query?: any; + + /**Shows or hides the TagCloud title. When this set to false, it hides the TagCloud header. + * @Default {true} + */ + showTitle?: boolean; + + /**Sets the title image for the TagCloud. To show the title image, the showTitle property should be enabled. + * @Default {null} + */ + titleImage?: string; + + /**Sets the title text for the TagCloud. To show the title text, the showTitle property should be enabled. + * @Default {Title} + */ + titleText?: string; + + /**Event triggers when the TagCloud items are clicked*/ + click? (e: ClickEventArgs): void; + + /**Event triggers when the TagCloud are created*/ + create? (e: CreateEventArgs): void; + + /**Event triggers when the TagCloud are destroyed*/ + destroy? (e: DestroyEventArgs): void; + + /**Event triggers when the cursor leaves out from a tag item*/ + mouseout? (e: MouseoutEventArgs): void; + + /**Event triggers when the cursor hovers on a tag item*/ + mouseover? (e: MouseoverEventArgs): void; +} + +export interface ClickEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the TagCloud model + */ + model?: ej.TagCloud.Model; + + /**returns the name of the event + */ + type?: string; + + /**return current tag name + */ + text?: string; + + /**return current url link + */ + url?: string; +} + +export interface CreateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the TagCloud model + */ + model?: ej.TagCloud.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the TagCloud model + */ + model?: ej.TagCloud.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface MouseoutEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the TagCloud model + */ + model?: ej.TagCloud.Model; + + /**returns the name of the event + */ + type?: string; + + /**return current tag name + */ + text?: string; + + /**return current url link + */ + url?: string; +} + +export interface MouseoverEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the TagCloud model + */ + model?: ej.TagCloud.Model; + + /**returns the name of the event + */ + type?: string; + + /**return current tag name + */ + text?: string; + + /**return current url link + */ + url?: string; +} + +export interface Fields { + + /**Defines the frequency number to categorize the font size. + */ + frequency?: number; + + /**Defines the html attributes for the anchor elements inside the each tag items. + */ + htmlAttributes?: any; + + /**Defines the tag value or display text. + */ + text?: string; + + /**Defines the url link to navigate while click the tag. + */ + url?: string; +} +} +enum Format +{ +//To render the TagCloud items in cloud format +Cloud, +//To render the TagCloud items in list format +List, +} + +class TimePicker extends ej.Widget { + static fn: TimePicker; + constructor(element: JQuery, options?: TimePicker.Model); + constructor(element: Element, options?: TimePicker.Model); + model:TimePicker.Model; + defaults:TimePicker.Model; + + /** Allows you to disable the TimePicker. + * @returns {void} + */ + disable(): void; + + /** Allows you to enable the TimePicker. + * @returns {void} + */ + enable(): void; + + /** It returns the current time value. + * @returns {string} + */ + getValue(): string; + + /** This method will hide the TimePicker control popup. + * @returns {void} + */ + hide(): void; + + /** Updates the current system time in TimePicker. + * @returns {void} + */ + setCurrentTime(): void; + + /** This method will show the TimePicker control popup. + * @returns {void} + */ + show(): void; +} +export module TimePicker{ + +export interface Model { + + /**Sets the root CSS class for the TimePicker theme, which is used to customize. + */ + cssClass?: string; + + /**Specifies the animation behavior in TimePicker. + * @Default {true} + */ + enableAnimation?: boolean; + + /**When this property is set to false, it disables the TimePicker control. + * @Default {true} + */ + enabled?: boolean; + + /**Save current model value to browser cookies for maintaining states. When refreshing the TimePicker control page, the model value is applied from browser cookies or HTML 5local storage. + * @Default {false} + */ + enablePersistence?: boolean; + + /**Displays the TimePicker as right to left alignment. + * @Default {false} + */ + enableRTL?: boolean; + + /**When the enableStrictMode is set as true it allows the value outside of the range and also indicate with red color border, otherwise it internally changed to the min or max range value based an input value. + * @Default {false} + */ + enableStrictMode?: boolean; + + /**Defines the height of the TimePicker textbox. + */ + height?: string|number; + + /**Sets the step value for increment an hour value through arrow keys or mouse scroll. + * @Default {1} + */ + hourInterval?: number; + + /**It allows to define the characteristics of the TimePicker control. It will helps to extend the capability of an HTML element. + * @Default {{}} + */ + htmlAttributes?: any; + + /**Sets the time interval between the two adjacent time values in the popup. + * @Default {30} + */ + interval?: number; + + /**Defines the localization info used by the TimePicker. + * @Default {en-US} + */ + locale?: string; + + /**Sets the maximum time value to the TimePicker. + * @Default {11:59:59 PM} + */ + maxTime?: string; + + /**Sets the minimum time value to the TimePicker. + * @Default {12:00:00 AM} + */ + minTime?: string; + + /**Sets the step value for increment the minute value through arrow keys or mouse scroll. + * @Default {1} + */ + minutesInterval?: number; + + /**Defines the height of the TimePicker popup. + * @Default {191px} + */ + popupHeight?: string|number; + + /**Defines the width of the TimePicker popup. + * @Default {auto} + */ + popupWidth?: string|number; + + /**Toggles the readonly state of the TimePicker + * @Default {false} + */ + readOnly?: boolean; + + /**Sets the step value for increment the seconds value through arrow keys or mouse scroll. + * @Default {1} + */ + secondsInterval?: number; + + /**shows or hides the drop down button in TimePicker. + * @Default {true} + */ + showPopupButton?: boolean; + + /**TimePicker is displayed with rounded corner when this property is set to true. + * @Default {false} + */ + showRoundedCorner?: boolean; + + /**Defines the time format displayed in the TimePicker. + * @Default {h:mm tt} + */ + timeFormat?: string; + + /**Sets a specified time value on the TimePicker. + * @Default {null} + */ + value?: string|Date; + + /**Defines the width of the TimePicker textbox. + */ + width?: string|number; + + /**Fires when the time value changed in the TimePicker.*/ + beforeChange? (e: BeforeChangeEventArgs): void; + + /**Fires when the TimePicker popup before opened.*/ + beforeOpen? (e: BeforeOpenEventArgs): void; + + /**Fires when the time value changed in the TimePicker.*/ + change? (e: ChangeEventArgs): void; + + /**Fires when the TimePicker popup closed.*/ + close? (e: CloseEventArgs): void; + + /**Fires when create TimePicker successfully.*/ + create? (e: CreateEventArgs): void; + + /**Fires when the TimePicker is destroyed successfully.*/ + destroy? (e: DestroyEventArgs): void; + + /**Fires when the TimePicker control gets focus.*/ + focusIn? (e: FocusInEventArgs): void; + + /**Fires when the TimePicker control get lost focus.*/ + focusOut? (e: FocusOutEventArgs): void; + + /**Fires when the TimePicker popup opened.*/ + open? (e: OpenEventArgs): void; + + /**Fires when the value is selected from the TimePicker dropdown list.*/ + select? (e: SelectEventArgs): void; +} + +export interface BeforeChangeEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the TimePicker model + */ + model?: ej.TimePicker.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the previously selected time value + */ + prevTime?: string; + + /**returns the modified time value + */ + value?: string; +} + +export interface BeforeOpenEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the TimePicker model + */ + model?: ej.TimePicker.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the previously selected time value + */ + prevTime?: string; + + /**returns the time value + */ + value?: string; +} + +export interface ChangeEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the TimePicker model + */ + model?: ej.TimePicker.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns true when the value changed by user interaction otherwise returns false + */ + isInteraction?: boolean; + + /**returns the previously selected time value + */ + prevTime?: string; + + /**returns the modified time value + */ + value?: string; +} + +export interface CloseEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the TimePicker model + */ + model?: ej.TimePicker.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the previously selected time value + */ + prevTime?: string; + + /**returns the time value + */ + value?: string; +} + +export interface CreateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the TimePicker model + */ + model?: ej.TimePicker.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the TimePicker model + */ + model?: ej.TimePicker.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface FocusInEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the TimePicker model + */ + model?: ej.TimePicker.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the previously selected time value + */ + prevTime?: string; + + /**returns the current time value + */ + value?: string; +} + +export interface FocusOutEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the TimePicker model + */ + model?: ej.TimePicker.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the previously selected time value + */ + prevTime?: string; + + /**returns the current time value + */ + value?: string; +} + +export interface OpenEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the TimePicker model + */ + model?: ej.TimePicker.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the time value + */ + value?: string; +} + +export interface SelectEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the TimePicker model + */ + model?: ej.TimePicker.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the previously selected time value + */ + prevTime?: string; + + /**returns the selected time value + */ + value?: string; +} +} + +class ToggleButton extends ej.Widget { + static fn: ToggleButton; + constructor(element: JQuery, options?: ToggleButton.Model); + constructor(element: Element, options?: ToggleButton.Model); + model:ToggleButton.Model; + defaults:ToggleButton.Model; + + /** Allows you to destroy the ToggleButton widget. + * @returns {void} + */ + destroy(): void; + + /** To disable the ToggleButton to prevent all user interactions. + * @returns {void} + */ + disable(): void; + + /** To enable the ToggleButton. + * @returns {void} + */ + enable(): void; +} +export module ToggleButton{ + +export interface Model { + + /**Specify the icon in active state to the toggle button and it will be aligned from left margin of the button. + */ + activePrefixIcon?: string; + + /**Specify the icon in active state to the toggle button and it will be aligned from right margin of the button. + */ + activeSuffixIcon?: string; + + /**Sets the text when ToggleButton is in active state i.e.,checked state. + * @Default {null} + */ + activeText?: string; + + /**Specifies the contentType of the ToggleButton. See ContentType as below + * @Default {ej.ContentType.TextOnly} + */ + contentType?: ej.ContentType|string; + + /**Specify the CSS class to the ToggleButton to achieve custom theme. + */ + cssClass?: string; + + /**Specify the icon in default state to the toggle button and it will be aligned from left margin of the button. + */ + defaultPrefixIcon?: string; + + /**Specify the icon in default state to the toggle button and it will be aligned from right margin of the button. + */ + defaultSuffixIcon?: string; + + /**Specifies the text of the ToggleButton, when the control is a default state. i.e., unChecked state. + * @Default {null} + */ + defaultText?: string; + + /**Specifies the state of the ToggleButton. + * @Default {true} + */ + enabled?: boolean; + + /**Save current model value to browser cookies for maintaining states. When refreshing the ToggleButton control page, the model value is applied from browser cookies or HTML 5local storage. + * @Default {false} + */ + enablePersistence?: boolean; + + /**Specify the Right to Left direction of the ToggleButton. + * @Default {false} + */ + enableRTL?: boolean; + + /**Specifies the height of the ToggleButton. + * @Default {28pixel} + */ + height?: number|string; + + /**It allows to define the characteristics of the ToggleButton control. It will helps to extend the capability of an HTML element. + * @Default {{}} + */ + htmlAttributes?: any; + + /**Specifies the image position of the ToggleButton. + * @Default {ej.ImagePosition.ImageLeft} + */ + imagePosition?: ej.ImagePosition|string; + + /**Allows to prevents the control switched to checked (active) state. + * @Default {false} + */ + preventToggle?: boolean; + + /**Displays the ToggleButton with rounded corners. + * @Default {false} + */ + showRoundedCorner?: boolean; + + /**Specifies the size of the ToggleButton. See ButtonSize as below + * @Default {ej.ButtonSize.Normal} + */ + size?: ej.ButtonSize|string; + + /**It allows to define the ToggleButton state to checked(Active) or unchecked(Default) at initial time. + * @Default {false} + */ + toggleState?: boolean; + + /**Specifies the type of the ToggleButton. See ButtonType as below + * @Default {ej.ButtonType.Button} + */ + type?: ej.ButtonType|string; + + /**Specifies the width of the ToggleButton. + * @Default {100pixel} + */ + width?: number|string; + + /**Fires when ToggleButton control state is changed successfully.*/ + change? (e: ChangeEventArgs): void; + + /**Fires when ToggleButton control is clicked successfully.*/ + click? (e: ClickEventArgs): void; + + /**Fires when ToggleButton control is created successfully.*/ + create? (e: CreateEventArgs): void; + + /**Fires when ToggleButton control is destroyed successfully.*/ + destroy? (e: DestroyEventArgs): void; +} + +export interface ChangeEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**return the toggle button checked state + */ + isChecked?: boolean; + + /**returns the toggle button model + */ + model?: ej.ToggleButton.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface ClickEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**return the toggle button checked state + */ + isChecked?: boolean; + + /**returns the toggle button model + */ + model?: ej.ToggleButton.Model; + + /**return the toggle button state + */ + status?: boolean; + + /**returns the name of the event + */ + type?: string; +} + +export interface CreateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the toggle button model + */ + model?: ej.ToggleButton.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the toggle button model + */ + model?: ej.ToggleButton.Model; + + /**returns the name of the event + */ + type?: string; +} +} + +class Toolbar extends ej.Widget { + static fn: Toolbar; + constructor(element: JQuery, options?: Toolbar.Model); + constructor(element: Element, options?: Toolbar.Model); + model:Toolbar.Model; + defaults:Toolbar.Model; + + /** Deselect the specified Toolbar item. + * @param {any} The element need to be deselected + * @returns {void} + */ + deselectItem(element: any): void; + + /** Deselect the Toolbar item based on specified id. + * @param {string} The ID of the element need to be deselected + * @returns {void} + */ + deselectItemByID(ID: string): void; + + /** Allows you to destroy the Toolbar widget. + * @returns {void} + */ + destroy(): void; + + /** To disable all items in the Toolbar control. + * @returns {void} + */ + disable(): void; + + /** Disable the specified Toolbar item. + * @param {any} The element need to be disabled + * @returns {void} + */ + disableItem(element: any): void; + + /** Disable the Toolbar item based on specified item id in the Toolbar. + * @param {string} The ID of the element need to be disabled + * @returns {void} + */ + disableItemByID(ID: string): void; + + /** Enable the Toolbar if it is in disabled state. + * @returns {void} + */ + enable(): void; + + /** Enable the Toolbar item based on specified item. + * @param {any} The element need to be enabled + * @returns {void} + */ + enableItem(element: any): void; + + /** Enable the Toolbar item based on specified item id in the Toolbar. + * @param {string} The ID of the element need to be enabled + * @returns {void} + */ + enableItemByID(ID: string): void; + + /** To hide the Toolbar + * @returns {void} + */ + hide(): void; + + /** Remove the item from toolbar, based on specified item. + * @param {any} The element need to be removed + * @returns {void} + */ + removeItem(element: any): void; + + /** Remove the item from toolbar, based on specified item id in the Toolbar. + * @param {string} The ID of the element need to be removed + * @returns {void} + */ + removeItemByID(ID: string): void; + + /** Selects the item from toolbar, based on specified item. + * @param {any} The element need to be selected + * @returns {void} + */ + selectItem(element: any): void; + + /** Selects the item from toolbar, based on specified item id in the Toolbar. + * @param {string} The ID of the element need to be selected + * @returns {void} + */ + selectItemByID(ID: string): void; + + /** To show the Toolbar. + * @returns {void} + */ + show(): void; +} +export module Toolbar{ + +export interface Model { + + /**Sets the root CSS class for Toolbar control to achieve the custom theme. + */ + cssClass?: string; + + /**Specifies dataSource value for the Toolbar control during initialization. + * @Default {null} + */ + dataSource?: any; + + /**Specifies the Toolbar control state. + * @Default {true} + */ + enabled?: boolean; + + /**Specifies enableRTL property to align the Toolbar control from right to left direction. + * @Default {false} + */ + enableRTL?: boolean; + + /**Allows to separate the each UL items in the Toolbar control. + * @Default {false} + */ + enableSeparator?: boolean; + + /**Specifies the mapping fields for the data items of the Toolbar + * @Default {null} + */ + fields?: string; + + /**Specifies the height of the Toolbar. + * @Default {28} + */ + height?: number|string; + + /**Specifies whether the Toolbar control is need to be show or hide. + * @Default {false} + */ + hide?: boolean; + + /**Enables/Disables the responsive support for Toolbar items during the window resizing time. + * @Default {false} + */ + isResponsive?: boolean; + + /**Specifies the Toolbar orientation. See orientation + * @Default {Horizontal} + */ + orientation?: ej.Orientation|string; + + /**Specifies the query to retrieve the data from the online server. The query is used only when the online dataSource is used. + * @Default {null} + */ + query?: any; + + /**Displays the Toolbar with rounded corners. + * @Default {false} + */ + showRoundedCorner?: boolean; + + /**Specifies the width of the Toolbar. + */ + width?: number|string; + + /**Fires after Toolbar control is clicked.*/ + click? (e: ClickEventArgs): void; + + /**Fires after Toolbar control is created.*/ + create? (e: CreateEventArgs): void; + + /**Fires when the Toolbar is destroyed successfully.*/ + destroy? (e: DestroyEventArgs): void; + + /**Fires after Toolbar control item is hovered.*/ + itemHover? (e: ItemHoverEventArgs): void; + + /**Fires after mouse leave from Toolbar control item.*/ + itemLeave? (e: ItemLeaveEventArgs): void; +} + +export interface ClickEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the Toolbar model + */ + model?: ej.Toolbar.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the target of the current object. + */ + target?: any; + + /**returns the target of the current object. + */ + currentTarget?: any; + + /**return the Toolbar state + */ + status?: boolean; +} + +export interface CreateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the Toolbar model + */ + model?: ej.Toolbar.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the Toolbar model + */ + model?: ej.Toolbar.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface ItemHoverEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the Toolbar model + */ + model?: ej.Toolbar.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the target of the current object. + */ + target?: any; + + /**returns the target of the current object. + */ + currentTarget?: any; + + /**return the Toolbar state + */ + status?: boolean; +} + +export interface ItemLeaveEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the Toolbar model + */ + model?: ej.Toolbar.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the target of the current object. + */ + target?: any; + + /**returns the target of the current object. + */ + currentTarget?: any; + + /**return the Toolbar state + */ + status?: boolean; +} + +export interface Fields { + + /**Defines the group name for the item. + */ + group?: string; + + /**Defines the html attributes such as id, class, styles for the item to extend the capability. + */ + htmlAttributes?: any; + + /**Defines id for the tag. + */ + id?: string; + + /**Defines the image attributes such as height, width, styles and so on. + */ + imageAttributes?: string; + + /**Defines the imageURL for the image location. + */ + imageUrl?: string; + + /**Defines the sprite CSS for the image tag. + */ + spriteCssClass?: string; + + /**Defines the text content for the tag. + */ + text?: string; + + /**Defines the tooltip text for the tag. + */ + tooltipText?: string; +} +} + +class TreeView extends ej.Widget { + static fn: TreeView; + constructor(element: JQuery, options?: TreeView.Model); + constructor(element: Element, options?: TreeView.Model); + model:TreeView.Model; + defaults:TreeView.Model; + + /** To add a Node or collection of nodes in TreeView. If target tree node is specified, then the given nodes are added as child of target tree node, otherwise nodes are added in TreeView. + * @param {string|any} New node text or JSON object + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {void} + */ + addNode(newNodeText: string|any, target: string|any): void; + + /** To add a collection of nodes in TreeView. If target tree node is specified, then the given nodes are added as child of target tree node, otherwise nodes are added in TreeView. + * @param {any|Array} New node details in JSON object + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {void} + */ + addNodes(collection: any|Array, target : string|any): void; + + /** To check all the nodes in TreeView. + * @returns {void} + */ + checkAll(): void; + + /** To check a node in TreeView. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {void} + */ + checkNode( element : string|any): void; + + /** To collapse all the TreeView nodes. + * @returns {void} + */ + collapseAll(): void; + + /** To collapse a particular node in TreeView. + * @param {string|any} ID of TreeView node|object of TreeView node + * @returns {void} + */ + collapseNode( element : string|any): void; + + /** To disable the node in the TreeView. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {void} + */ + disableNode( element : string|any): void; + + /** To enable the node in the TreeView. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {void} + */ + enableNode( element : string|any): void; + + /** To ensure that the TreeView node is visible in the TreeView. This method is useful if we need select a TreeView node dynamically. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {boolean} + */ + ensureVisible( element : string|any): boolean; + + /** To expand all the TreeView nodes. + * @returns {void} + */ + expandAll(): void; + + /** To expandNode particular node in TreeView. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {void} + */ + expandNode( element : string|any): void; + + /** To get currently checked nodes in TreeView. + * @returns {any} + */ + getCheckedNodes(): any; + + /** To get currently checked nodes indexes in TreeView. + * @returns {Array} + */ + getCheckedNodesIndex(): Array; + + /** To get number of nodes in TreeView. + * @returns {number} + */ + getNodeCount(): number; + + /** To get currently expanded nodes in TreeView. + * @returns {any} + */ + getExpandedNodes(): any; + + /** To get currently expanded nodes indexes in TreeView. + * @returns {Array} + */ + getExpandedNodesIndex(): Array; + + /** To get TreeView node by using index position in TreeView. + * @param {number} Index position of TreeView node + * @returns {any} + */ + getNodeByIndex( index : number): any; + + /** To get TreeView node data such as id, text, parentId, selected, checked, expanded, level, childs and index. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {any} + */ + getNode(element: string|any): any; + + /** To get current index position of TreeView node. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {number} + */ + getNodeIndex(element : string|any): number; + + /** To get immediate parent TreeView node of particular TreeView node. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {any} + */ + getParent(element : string|any): any; + + /** To get the currently selected node in TreeView. + * @returns {any} + */ + getSelectedNode(): any; + + /** To get the index position of currently selected node in TreeView. + * @returns {number} + */ + getSelectedNodeIndex(): number; + + /** To get the text of a node in TreeView. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {string} + */ + getText( element : string|any): string; + + /** To get the updated datasource of TreeView after performing some operation like drag and drop, node editing, adding and removing node. + * @returns {Array} + */ + getTreeData(): Array; + + /** To get currently visible nodes in TreeView. + * @returns {any} + */ + getVisibleNodes(): any; + + /** To check a node having child or not. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {boolean} + */ + hasChildNode( element : string|any): boolean; + + /** To show nodes in TreeView. + * @returns {void} + */ + hide(): void; + + /** To hide particular node in TreeView. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {void} + */ + hideNode( element : string|any): void; + + /** To add a Node or collection of nodes after the particular TreeView node. + * @param {string|any} New node text or JSON object + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {void} + */ + insertAfter( newNodeText : string|any, target : string|any): void; + + /** To add a Node or collection of nodes before the particular TreeView node. + * @param {string|any} New node text or JSON object + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {void} + */ + insertBefore( newNodeText : string|any, target : string|any): void; + + /** To check the given TreeView node is checked or unchecked. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {boolean} + */ + isNodeChecked( element : string|any): boolean; + + /** To check whether the child nodes are loaded of the given TreeView node. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {boolean} + */ + isChildLoaded( element : string|any): boolean; + + /** To check the given TreeView node is disabled or enabled. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {boolean} + */ + isDisabled( element : string|any): boolean; + + /** To check the given node is exist in TreeView. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {boolean} + */ + isExist( element : string|any): boolean; + + /** To get the expand status of the given TreeView node. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {boolean} + */ + isExpanded( element : string|any): boolean; + + /** To get the select status of the given TreeView node. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {boolean} + */ + isSelected( element : string|any): boolean; + + /** To get the visibility status of the given TreeView node. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {boolean} + */ + isVisible( element : string|any): boolean; + + /** To load the TreeView nodes from the particular URL. If target tree node is specified, then the given nodes are added as child of target tree node, otherwise nodes are added in TreeView. + * @param {string} URL location, the data returned from the URL will be loaded in TreeView + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {void} + */ + loadData( URL : string, target : string|any): void; + + /** To move the TreeView node with in same TreeView. The new poistion of given TreeView node will be based on destionation node and index position. + * @param {string|any} ID of TreeView node/object of TreeView node + * @param {string|any} ID of TreeView node/object of TreeView node + * @param {number} New index position of given source node + * @returns {void} + */ + moveNode( sourceNode : string|any, destinationNode : string|any, index : number): void; + + /** To refresh the TreeView + * @returns {void} + */ + refresh(): void; + + /** To remove all the nodes in TreeView. + * @returns {void} + */ + removeAll(): void; + + /** To remove a node in TreeView. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {void} + */ + removeNode( element : string|any): void; + + /** To select a node in TreeView. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {void} + */ + selectNode( element : string|any): void; + + /** To show nodes in TreeView. + * @returns {void} + */ + show(): void; + + /** To show a node in TreeView. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {void} + */ + showNode( element : string|any): void; + + /** To uncheck all the nodes in TreeView. + * @returns {void} + */ + unCheckAll(): void; + + /** To uncheck a node in TreeView. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {void} + */ + uncheckNode( element : string|any): void; + + /** To unselect the node in the TreeView. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {void} + */ + unselectNode( element : string|any): void; + + /** To edit or update the text of the TreeView node. + * @param {string|any} ID of TreeView node/object of TreeView node + * @param {string} New text + * @returns {void} + */ + updateText( target : string|any, newText : string): void; +} +export module TreeView{ + +export interface Model { + + /**Gets or sets a value that indicates whether to enable drag and drop a node within the same tree. + * @Default {false} + */ + allowDragAndDrop?: boolean; + + /**Gets or sets a value that indicates whether to enable drag and drop a node in inter ej.TreeView. + * @Default {true} + */ + allowDragAndDropAcrossControl?: boolean; + + /**Gets or sets a value that indicates whether to drop a node to a sibling of particular node. + * @Default {true} + */ + allowDropSibling?: boolean; + + /**Gets or sets a value that indicates whether to drop a node to a child of particular node. + * @Default {true} + */ + allowDropChild?: boolean; + + /**Gets or sets a value that indicates whether to enable node editing support for TreeView. + * @Default {false} + */ + allowEditing?: boolean; + + /**Gets or sets a value that indicates whether to enable keyboard support for TreeView actions like nodeSelection, nodeEditing, nodeExpand, nodeCollapse, nodeCut and Paste. + * @Default {true} + */ + allowKeyboardNavigation?: boolean; + + /**Allow us to specify the parent and child nodes to get auto check while we check or uncheck a node. + * @Default {true} + */ + autoCheck?: boolean; + + /**Allow us to specify the parent node to be retain in checked or unchecked state instead of going for indeterminate state. + * @Default {false} + */ + autoCheckParentNode?: boolean; + + /**Gets or sets a value that indicates the checkedNodes index collection as an array. The given array index position denotes the nodes, that are checked while rendering TreeView. + * @Default {[]} + */ + checkedNodes?: Array; + + /**Sets the root CSS class for TreeView which allow us to customize the appearance. + */ + cssClass?: string; + + /**Gets or sets a value that indicates whether to enable or disable the animation effect while expanding or collapsing a node. + * @Default {true} + */ + enableAnimation?: boolean; + + /**Gets or sets a value that indicates whether a TreeView can be enabled or disabled. No actions can be performed while this property is set as false + * @Default {true} + */ + enabled?: boolean; + + /**Allow us to prevent multiple nodes to be in expanded state. If it set to false, previously expanded node will be collapsed automatically, while we expand a node. + * @Default {true} + */ + enableMultipleExpand?: boolean; + + /**Sets a value that indicates whether to persist the TreeView model state in page using applicable medium i.e., HTML5 localStorage or cookies + * @Default {false} + */ + enablePersistence?: boolean; + + /**Gets or sets a value that indicates to align content in the TreeView control from right to left by setting the property as true. + * @Default {false} + */ + enableRTL?: boolean; + + /**Gets or sets a array of value that indicates the expandedNodes index collection as an array. The given array index position denotes the nodes, that are expanded while rendering TreeView. + * @Default {[]} + */ + expandedNodes?: Array; + + /**Gets or sets a value that indicates the TreeView node can be expand or collapse by using the specified action. + * @Default {dblclick} + */ + expandOn?: string; + + /**Gets or sets a fields object that allow us to map the data members with field properties in order to make the data binding easier. + * @Default {null} + */ + fields?: Fields; + + /**Defines the height of the TreeView. + * @Default {Null} + */ + height?: string|number; + + /**Specifies the HTML Attributes for the TreeView. Using this API we can add custom attributes in TreeView control. + * @Default {{}} + */ + htmlAttributes?: any; + + /**Specifies the child nodes to be loaded on demand + * @Default {false} + */ + loadOnDemand?: boolean; + + /**Gets or Sets a value that indicates the index position of a tree node. The particular index tree node will be selected while rendering the TreeView. + * @Default {-1} + */ + selectedNode?: number; + + /**Gets or sets a value that indicates whether to display or hide checkbox for all TreeView nodes. + * @Default {false} + */ + showCheckbox?: boolean; + + /**By using sortSettings property, you can customize the sorting option in TreeView control. + */ + sortSettings?: SortSettings; + + /**Allow us to use custom template in order to create TreeView. + * @Default {null} + */ + template?: string; + + /**Defines the width of the TreeView. + * @Default {Null} + */ + width?: string|number; + + /**Fires before adding node to TreeView.*/ + beforeAdd? (e: BeforeAddEventArgs): void; + + /**Fires before collapse a node.*/ + beforeCollapse? (e: BeforeCollapseEventArgs): void; + + /**Fires before cut node in TreeView.*/ + beforeCut? (e: BeforeCutEventArgs): void; + + /**Fires before deleting node in TreeView.*/ + beforeDelete? (e: BeforeDeleteEventArgs): void; + + /**Fires before editing the node in TreeView.*/ + beforeEdit? (e: BeforeEditEventArgs): void; + + /**Fires before expanding the node.*/ + beforeExpand? (e: BeforeExpandEventArgs): void; + + /**Fires before loading nodes to TreeView.*/ + beforeLoad? (e: BeforeLoadEventArgs): void; + + /**Fires before paste node in TreeView.*/ + beforePaste? (e: BeforePasteEventArgs): void; + + /**Fires before selecting node in TreeView.*/ + beforeSelect? (e: BeforeSelectEventArgs): void; + + /**Fires when TreeView created successfully.*/ + create? (e: CreateEventArgs): void; + + /**Fires when TreeView destroyed successfully.*/ + destroy? (e: DestroyEventArgs): void; + + /**Fires before nodeEdit Successful.*/ + inlineEditValidation? (e: InlineEditValidationEventArgs): void; + + /**Fires when key pressed successfully.*/ + keyPress? (e: KeyPressEventArgs): void; + + /**Fires when data load fails.*/ + loadError? (e: LoadErrorEventArgs): void; + + /**Fires when data loaded successfully.*/ + loadSuccess? (e: LoadSuccessEventArgs): void; + + /**Fires once node added successfully.*/ + nodeAdd? (e: NodeAddEventArgs): void; + + /**Fires once node checked successfully.*/ + nodeCheck? (e: NodeCheckEventArgs): void; + + /**Fires when node clicked successfully.*/ + nodeClick? (e: NodeClickEventArgs): void; + + /**Fires when node collapsed successfully.*/ + nodeCollapse? (e: NodeCollapseEventArgs): void; + + /**Fires when node cut successfully.*/ + nodeCut? (e: NodeCutEventArgs): void; + + /**Fires when node deleted successfully.*/ + nodeDelete? (e: NodeDeleteEventArgs): void; + + /**Fires when node dragging.*/ + nodeDrag? (e: NodeDragEventArgs): void; + + /**Fires once node drag start successfully.*/ + nodeDragStart? (e: NodeDragStartEventArgs): void; + + /**Fires before the dragged node to be dropped.*/ + nodeDragStop? (e: NodeDragStopEventArgs): void; + + /**Fires once node dropped successfully.*/ + nodeDropped? (e: NodeDroppedEventArgs): void; + + /**Fires once node edited successfully.*/ + nodeEdit? (e: NodeEditEventArgs): void; + + /**Fires once node expanded successfully.*/ + nodeExpand? (e: NodeExpandEventArgs): void; + + /**Fires once node pasted successfully.*/ + nodePaste? (e: NodePasteEventArgs): void; + + /**Fires when node selected successfully.*/ + nodeSelect? (e: NodeSelectEventArgs): void; + + /**Fires once node unchecked successfully.*/ + nodeUncheck? (e: NodeUncheckEventArgs): void; +} + +export interface BeforeAddEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the given new node data + */ + data ?: string|any; + + /**returns the parent element, the given new nodes to be appended to the given parent element + */ + targetParent ?: any; + + /**returns the given parent node details + */ + parentDetails ?: any; +} + +export interface BeforeCollapseEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the value of the node + */ + value ?: string; + + /**returns the current element of the node clicked + */ + currentElement ?: any; + + /**returns the child nodes are loaded or not + */ + isChildLoaded ?: boolean; + + /**returns the id of currently clicked node + */ + id ?: string; + + /**returns the parent id of currently clicked node + */ + parentId ?: string; + + /**returns the format asynchronous or synchronous + */ + async ?: boolean; +} + +export interface BeforeCutEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the event object + */ + event ?: any; + + /**returns the target element, the given node to be cut + */ + target ?: any; + + /**returns the given target node values + */ + nodeDetails ?: any; + + /**returns the keypressed keycode value + */ + keyCode ?: number; +} + +export interface BeforeDeleteEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the event object + */ + event ?: any; + + /**returns the target element, the given node to be deleted + */ + target ?: any; + + /**returns the given target node values + */ + nodeDetails ?: any; + + /**returns the current parent element of the target node + */ + parentElement ?: any; + + /**returns the parent node values + */ + parentDetails ?: any; +} + +export interface BeforeEditEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the current element of the node clicked + */ + currentElement ?: any; +} + +export interface BeforeExpandEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the value of the node + */ + value ?: string; + + /**if the child node is ready to expanded state; otherwise, false. + */ + isChildLoaded ?: boolean; + + /**returns the current element of the node clicked + */ + currentElement ?: any; + + /**returns the id of currently clicked node + */ + id ?: string; + + /**returns the parent id of currently clicked node + */ + parentId ?: string; + + /**returns the format asynchronous or synchronous + */ + async ?: boolean; +} + +export interface BeforeLoadEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the AJAX settings object + */ + ajaxOptions ?: any; +} + +export interface BeforePasteEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the event object + */ + event ?: any; + + /**returns the target element, the given node to be pasted + */ + target ?: any; + + /**returns the given target node values + */ + nodeDetails ?: any; + + /**returns the keypressed keycode value + */ + keyCode ?: number; +} + +export interface BeforeSelectEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the target element, the given node to be selected + */ + target ?: any; + + /**returns the given target node values + */ + nodeDetails ?: any; +} + +export interface CreateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; +} + +export interface DestroyEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; +} + +export interface InlineEditValidationEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the new entered text for the node + */ + newText ?: string; + + /**returns the current node element id + */ + id ?: any; + + /**returns the old node text + */ + oldText ?: string; +} + +export interface KeyPressEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the event object + */ + event ?: any; + + /**returns the current element of the node clicked + */ + currentElement ?: any; + + /**returns the value of the node + */ + value ?: string; + + /**returns node path from root element + */ + path ?: string; + + /**returns the keypressed keycode value + */ + keyCode ?: number; + + /**it returns when the current node is in expanded state; otherwise, false. + */ + isExpanded ?: boolean; +} + +export interface LoadErrorEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the AJAX error object + */ + error ?: any; +} + +export interface LoadSuccessEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the success data from the URL + */ + data ?: any; + + /**returns the target parent element, the data returned from the URL to be appended to the given parent element, else in TreeView + */ + targetParent ?: any; + + /**returns the given parent node details + */ + parentDetails ?: any; +} + +export interface NodeAddEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the added data, that are given initially + */ + data ?: any; + + /**returns the newly added elements + */ + nodes ?: any; + + /**returns the target parent element of the added element + */ + parentElement ?: any; + + /**returns the given parent node details + */ + parentDetails ?: any; +} + +export interface NodeCheckEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the event object + */ + event ?: any; + + /**returns the value of the node + */ + value ?: string; + + /**returns the id of the current element of the node clicked + */ + id ?: string; + + /**returns the id of the parent element of current element of the node clicked + */ + parentId ?: string; + + /**returns the current element of the node clicked + */ + currentElement ?: any; + + /**it returns true when the node checkbox is checked; otherwise, false. + */ + isChecked ?: boolean; + + /**it returns the currently checked node name + */ + currentNode ?: Array; + + /**it returns the currently checked and its child node details + */ + currentCheckedNodes ?: Array; +} + +export interface NodeClickEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the event object + */ + event ?: any; + + /**returns the current element of the node clicked + */ + currentElement ?: any; + + /**returns the id of current element + */ + id ?: string; + + /**returns the parentId of current element + */ + parentId ?: string; +} + +export interface NodeCollapseEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the id of the current element of the node clicked + */ + id ?: string; + + /**returns the name of the event + */ + type ?: string; + + /**returns the id of the parent element of current element of the node clicked + */ + parentId ?: string; + + /**returns the value of the node + */ + value ?: string; + + /**returns the current element of the node clicked + */ + currentElement ?: any; + + /**returns the child nodes are loaded or not + */ + isChildLoaded ?: boolean; + + /**returns the format asynchronous or synchronous + */ + async ?: boolean; +} + +export interface NodeCutEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the event object + */ + event ?: any; + + /**returns the current parent element of the cut node + */ + parentElement ?: any; + + /**returns the given parent node details + */ + parentDetails ?: any; + + /**returns the keypressed keycode value + */ + keyCode ?: number; +} + +export interface NodeDeleteEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the event object + */ + event ?: any; + + /**returns the current parent element of the deleted node + */ + parentElement ?: any; + + /**returns the given parent node details + */ + parentDetails ?: any; +} + +export interface NodeDragEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the original drag target + */ + dragTarget ?: any; + + /**returns the current target TreeView node + */ + target ?: any; + + /**returns the current target details + */ + targetElementData ?: any; + + /**returns the current parent element of the target node + */ + draggedElement ?: any; + + /**returns the given parent node details + */ + draggedElementData ?: any; + + /**returns the event object + */ + event ?: any; +} + +export interface NodeDragStartEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the original drag target + */ + dragTarget ?: any; + + /**returns the current dragging parent TreeView node + */ + parentElement ?: any; + + /**returns the current dragging parent TreeView node details + */ + parentElementData ?: any; + + /**returns the current parent element of the dragging node + */ + target ?: any; + + /**returns the given parent node details + */ + targetElementData ?: any; + + /**returns the event object + */ + event ?: any; +} + +export interface NodeDragStopEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the original drop target + */ + dropTarget ?: any; + + /**returns the current dragged TreeView node + */ + draggedElement ?: any; + + /**returns the current dragged TreeView node details + */ + draggedElementData ?: any; + + /**returns the current parent element of the dragged node + */ + target ?: any; + + /**returns the given parent node details + */ + targetElementData ?: any; + + /**returns the drop position such as before, after or over + */ + position ?: string; + + /**returns the event object + */ + event ?: any; +} + +export interface NodeDroppedEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the original drop target + */ + dropTarget ?: any; + + /**returns the current dropped TreeView node + */ + droppedElement ?: any; + + /**returns the current dropped TreeView node details + */ + droppedElementData ?: any; + + /**returns the current parent element of the dropped node + */ + target ?: any; + + /**returns the given parent node details + */ + targetElementData ?: any; + + /**returns the drop position such as before, after or over + */ + position ?: string; + + /**returns the event object + */ + event ?: any; +} + +export interface NodeEditEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the id of the element + */ + id ?: string; + + /**returns the oldText of the element + */ + oldText ?: string; + + /**returns the newText of the element + */ + newText ?: string; + + /**returns the event object + */ + event ?: any; + + /**returns the target element, the given node to be cut + */ + target ?: any; + + /**returns the given target node values + */ + nodeDetails ?: any; +} + +export interface NodeExpandEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the value of the node + */ + value ?: string; + + /**if the child node is ready to expanded state; otherwise, false. + */ + isChildLoaded ?: boolean; + + /**returns the current element of the node clicked + */ + currentElement ?: any; + + /**returns the id of currently clicked node + */ + id ?: string; + + /**returns the parent id of currently clicked node + */ + parentId ?: string; + + /**returns the format asynchronous or synchronous + */ + async ?: boolean; +} + +export interface NodePasteEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the event object + */ + event ?: any; + + /**returns the pasted element + */ + target ?: any; + + /**returns the given target node values + */ + nodeDetails ?: any; + + /**returns the keypressed keycode value + */ + keyCode ?: number; +} + +export interface NodeSelectEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the id of the current element of the node clicked + */ + id ?: any; + + /**returns the id of the parent element of current element of the node clicked + */ + parentId ?: any; + + /**returns the value of the node + */ + value ?: string; + + /**returns the current element of the node clicked + */ + currentElement ?: any; +} + +export interface NodeUncheckEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the event object + */ + event ?: any; + + /**returns the id of the current element of the node clicked + */ + id ?: any; + + /**returns the id of the parent element of current element of the node clicked + */ + parentId ?: any; + + /**returns the value of the node + */ + value ?: string; + + /**returns the current element of the node clicked + */ + currentElement ?: any; + + /**it returns true when the node checkbox is checked; otherwise, false. + */ + isChecked ?: boolean; + + /**it returns currently unchecked node name + */ + currentNode ?: string; + + /**it returns currently unchecked node and its child node details. + */ + currentUncheckedNodes ?: Array; +} + +export interface Fields { + + /**It receives the child level or inner level data source such as Essential DataManager object and JSON object. + */ + child?: any; + + /**It receives Essential DataManager object and JSON object. + */ + dataSource?: any; + + /**Specifies the node to be in expanded state. + */ + expanded?: boolean; + + /**Its allow us to indicate whether the node has child or not in load on demand + */ + hasChild?: boolean; + + /**Specifies the html attributes to “li” item list. + */ + htmlAttribute?: any; + + /**Specifies the id to TreeView node items list. + */ + id?: string; + + /**Specifies the image attribute to “img” tag inside items list + */ + imageAttribute?: any; + + /**Specifies the html attributes to “li” item list. + */ + imageUrl?: string; + + /**If its true Checkbox node will be checked when rendered with checkbox. + */ + isChecked?: boolean; + + /**Specifies the link attribute to “a” tag in item list. + */ + linkAttribute?: any; + + /**Specifies the parent id of the node. The nodes are listed as child nodes of the specified parent node by using its parent id. + */ + parentId?: string; + + /**It receives query to retrieve data from the table (query is same as SQL). + */ + query?: any; + + /**Allow us to specify the node to be in selected state + */ + selected?: boolean; + + /**Specifies the sprite CSS class to “li” item list. + */ + spriteCssClass?: string; + + /**It receives the table name to execute query on the corresponding table. + */ + tableName?: string; + + /**Specifies the text of TreeView node items list. + */ + text?: string; +} + +export interface SortSettings { + + /**Enables or disables the sorting option in TreeView control + * @Default {false} + */ + allowSorting?: boolean; + + /**Sets the sorting order type. There are two sorting types available, such as "ascending", "descending". + * @Default {ej.sortOrder.Ascending} + */ + sortOrder?: ej.sortOrder|string; +} +} +enum sortOrder +{ +//Enum for Ascending sort order +Ascending, +//Enum for Descending sort order +Descending, +} + +class Uploadbox extends ej.Widget { + static fn: Uploadbox; + constructor(element: JQuery, options?: Uploadbox.Model); + constructor(element: Element, options?: Uploadbox.Model); + model:Uploadbox.Model; + defaults:Uploadbox.Model; + + /** The destroy method destroys the control and brings the control to a pre-init state. All the events of the Upload control is bound by using this._on unbinds automatically. + * @returns {void} + */ + destroy(): void; + + /** Disables the Uploadbox control + * @returns {void} + */ + disable(): void; + + /** Enables the Uploadbox control + * @returns {void} + */ + enable(): void; +} +export module Uploadbox{ + +export interface Model { + + /**Enables the file drag and drop support to the Uploadbox control. + * @Default {false} + */ + allowDragAndDrop?: boolean; + + /**Uploadbox supports both synchronous and asynchronous upload. This can be achieved by using the asyncUpload property. + * @Default {true} + */ + asyncUpload?: boolean; + + /**Uploadbox supports auto uploading of files after the file selection is done. + * @Default {false} + */ + autoUpload?: boolean; + + /**Sets the text for each action button. + * @Default {{browse: Browse, upload: Upload, cancel: Cancel, close: Close}} + */ + buttonText?: ButtonText; + + /**Sets the root class for the Uploadbox control theme. This cssClass API helps to use custom skinning option for the Uploadbox button and dialog content. + */ + cssClass?: string; + + /**Specifies the custom file details in the dialog popup on initialization. + * @Default {{ title:true, name:true, size:true, status:true, action:true}} + */ + customFileDetails?: CustomFileDetails; + + /**Specifies the actions for dialog popup while initialization. + * @Default {{ modal:false, closeOnComplete:false, content:null, drag:true}} + */ + dialogAction?: DialogAction; + + /**Displays the Uploadbox dialog at the given X and Y positions. X: Dialog sets the left position value. Y: Dialog sets the top position value. + * @Default {null} + */ + dialogPosition?: any; + + /**Property for applying the text to the Dialog title and content headers. + * @Default {{ title: Upload Box, name: Name, size: Size, status: Status}} + */ + dialogText?: DialogText; + + /**The dropAreaText is displayed when the draganddrop support is enabled in the Uploadbox control. + * @Default {Drop files or click to upload} + */ + dropAreaText?: string; + + /**Specifies the dropAreaHeight when the draganddrop support is enabled in the Uploadbox control. + * @Default {100%} + */ + dropAreaHeight?: number|string; + + /**Specifies the dropAreaWidth when the draganddrop support is enabled in the Uploadbox control. + * @Default {100%} + */ + dropAreaWidth?: number|string; + + /**Based on the property value, Uploadbox is enabled or disabled. + * @Default {true} + */ + enabled?: boolean; + + /**Sets the right-to-left direction property for the Uploadbox control. + * @Default {false} + */ + enableRTL?: boolean; + + /**Only the files with the specified extension is allowed to upload. This is mentioned in the string format. + */ + extensionsAllow?: string; + + /**Only the files with the specified extension is denied for upload. This is mentioned in the string format. + */ + extensionsDeny?: string; + + /**Sets the maximum size limit for uploading the file. This is mentioned in the number format. + * @Default {31457280} + */ + fileSize?: number; + + /**Sets the height of the browse button. + * @Default {35px} + */ + height?: string; + + /**Configures the culture data and sets the culture to the Uploadbox. + * @Default {en-US} + */ + locale?: string; + + /**Enables multiple file selection for upload. + * @Default {true} + */ + multipleFilesSelection?: boolean; + + /**You can push the file to the Uploadbox in the client-side of the XHR supported browsers alone. + * @Default {null} + */ + pushFile?: any; + + /**Specifies the remove action to be performed after the file uploading is completed. Here, mention the server address for removal. + */ + removeUrl?: string; + + /**Specifies the save action to be performed after the file is pushed for uploading. Here, mention the server address to be saved. + */ + saveUrl?: string; + + /**Enables the browse button support to the Uploadbox control. + * @Default {true} + */ + showBrowseButton?: boolean; + + /**Specifies the file details to be displayed when selected for uploading. This can be done when the showFileDetails is set to true. + * @Default {true} + */ + showFileDetails?: boolean; + + /**Sets the name for the Uploadbox control. This API helps to Map the action in code behind to retrieve the files. + */ + uploadName?: string; + + /**Sets the width of the browse button. + * @Default {100px} + */ + width?: string; + + /**Fires when the upload progress begins.*/ + begin? (e: BeginEventArgs): void; + + /**Fires when the upload progress is cancelled.*/ + cancel? (e: CancelEventArgs): void; + + /**Fires when the file upload progress is completed.*/ + complete? (e: CompleteEventArgs): void; + + /**Fires when the file upload progress is completed.*/ + success? (e: SuccessEventArgs): void; + + /**Fires when the Uploadbox control is created.*/ + create? (e: CreateEventArgs): void; + + /**Fires when the Uploadbox control is destroyed.*/ + destroy? (e: DestroyEventArgs): void; + + /**Fires when the Upload process ends in Error.*/ + error? (e: ErrorEventArgs): void; + + /**Fires when the file is selected for upload successfully.*/ + fileSelect? (e: FileSelectEventArgs): void; + + /**Fires when the uploaded file is removed successfully.*/ + remove? (e: RemoveEventArgs): void; +} + +export interface BeginEventArgs { + + /**To pass additional information to the server. + */ + data?: any; + + /**Selected FileList Object. + */ + files?: any; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the Uploadbox model + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface CancelEventArgs { + + /**Canceled FileList Object. + */ + fileStatus?: any; + + /**returns the Uploadbox model + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface CompleteEventArgs { + + /**AJAX event argument for reference. + */ + e?: any; + + /**Uploaded file list. + */ + files?: any; + + /**response from the server. + */ + responseText?: string; + + /**XHR-AJAX Object for reference. + */ + xhr?: any; + + /**returns the Uploadbox model + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface SuccessEventArgs { + + /**response from the server. + */ + responseText?: string; + + /**AJAX event argument for reference. + */ + e?: any; + + /**successfully uploaded files list. + */ + success?: any; + + /**Uploaded file list. + */ + files?: any; + + /**XHR-AJAX Object for reference. + */ + xhr?: any; + + /**returns the Uploadbox model + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface CreateEventArgs { + + /**returns the Uploadbox model + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**returns the Uploadbox model + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface ErrorEventArgs { + + /**details about the error information. + */ + error?: string; + + /**returns the name of the event. + */ + type?: string; + + /**error event action details. + */ + action?: string; + + /**returns the file details of the file uploaded + */ + files?: any; +} + +export interface FileSelectEventArgs { + + /**returns Selected FileList objects + */ + files?: any; + + /**returns the Uploadbox model + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface RemoveEventArgs { + + /**returns the Uploadbox model + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; + + /**returns the file details of the file object + */ + fileStatus?: any; +} + +export interface ButtonText { + + /**Sets the text for the browse button. + */ + browse?: string; + + /**Sets the text for the cancel button. + */ + cancel?: string; + + /**Sets the text for the close button. + */ + Close?: string; + + /**Sets the text for the Upload button inside the dialog popup. + */ + upload?: string; +} + +export interface CustomFileDetails { + + /**Enables the file upload interactions like remove/cancel in File details of the dialog popup. + */ + action?: boolean; + + /**Enables the name in the File details of the dialog popup. + */ + name?: boolean; + + /**Enables or disables the File size details of the dialog popup. + */ + size?: boolean; + + /**Enables or disables the file uploading status visibility in the dialog file details content. + */ + status?: boolean; + + /**Enables the title in File details for the dialog popup. + */ + title?: boolean; +} + +export interface DialogAction { + + /**Once uploaded successfully, the dialog popup closes immediately. + */ + closeOnComplete?: boolean; + + /**Sets the content container option to the Uploadbox dialog popup. + */ + content?: string; + + /**Enables the drag option to the dialog popup. + */ + drag?: boolean; + + /**Enables or disables the Uploadbox dialog’s modal property to the dialog popup. + */ + modal?: boolean; +} + +export interface DialogText { + + /**Sets the uploaded file’s Name (header text) to the Dialog popup. + */ + name?: string; + + /**Sets the upload file Size (header text) to the dialog popup. + */ + size?: string; + + /**Sets the upload file Status (header text) to the dialog popup. + */ + status?: string; + + /**Sets the title text of the dialog popup. + */ + title?: string; +} +} + +class WaitingPopup extends ej.Widget { + static fn: WaitingPopup; + constructor(element: JQuery, options?: WaitingPopup.Model); + constructor(element: Element, options?: WaitingPopup.Model); + model:WaitingPopup.Model; + defaults:WaitingPopup.Model; + + /** To hide the waiting popup + * @returns {void} + */ + hide(): void; + + /** Refreshes the WaitingPopup control by resetting the pop-up panel position and content position + * @returns {void} + */ + refresh(): void; + + /** To show the waiting popup + * @returns {void} + */ + show(): void; +} +export module WaitingPopup{ + +export interface Model { + + /**Sets the root class for the WaitingPopup control theme + * @Default {null} + */ + cssClass?: string; + + /**Enables or disables the default loading icon. + * @Default {true} + */ + showImage?: boolean; + + /**Enables the visibility of the WaitingPopup control + * @Default {false} + */ + showOnInit?: boolean; + + /**Loads HTML content inside the popup panel instead of the default icon + * @Default {null} + */ + template?: any; + + /**Sets the custom text in the pop-up panel to notify the waiting process + * @Default {null} + */ + text?: string; + + /**Fires after Create WaitingPopup successfully*/ + create? (e: CreateEventArgs): void; + + /**Fires after Destroy WaitingPopup successfully*/ + destroy? (e: DestroyEventArgs): void; +} + +export interface CreateEventArgs { + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the WaitingPopup model + */ + model?: ej.WaitingPopup.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the WaitingPopup model + */ + model?: ej.WaitingPopup.Model; + + /**returns the name of the event + */ + type?: string; +} +} + +class Grid extends ej.Widget { + static fn: Grid; + constructor(element: JQuery, options?: Grid.Model); + constructor(element: Element, options?: Grid.Model); + model:Grid.Model; + defaults:Grid.Model; + + /** Adds a grid model property which is to be ignored upon exporting. + * @returns {void} + */ + addIgnoreOnExport(): void; + + /** Add a new record in grid control when allowAdding is set as true. + * @returns {void} + */ + addRecord(): void; + + /** Cancel the modified changes in grid control when edit mode is "batch". + * @returns {void} + */ + batchCancel(): void; + + /** Save the modified changes to data source in grid control when edit mode is "batch". + * @returns {void} + */ + batchSave(): void; + + /** Send a cancel request in grid. + * @returns {void} + */ + cancelEdit(): void; + + /** Send a cancel request to the edited cell in grid. + * @returns {void} + */ + cancelEditCell(): void; + + /** It is used to clear all the cell selection. + * @returns {boolean} + */ + clearCellSelection(): boolean; + + /** It is used to clear all the row selection or at specific row selection based on the index provided. + * @param {number} optional If index of the column is specified then it will remove the selection from the particular column else it will clears all of the column selection + * @returns {boolean} + */ + clearColumnSelection(index: number): boolean; + + /** It is used to clear all the filtering done. + * @param {string} If field of the column is specified then it will clear the particular filtering column + * @returns {void} + */ + clearFiltering(field: string): void; + + /** Clear the searching from the grid + * @returns {void} + */ + clearSearching(): void; + + /** Clear all the row selection or at specific row selection based on the index provided + * @param {number} optional If index of the row is specified then it will remove the selection from the particular row else it will clears all of the row selection + * @returns {boolean} + */ + clearSelection(index: number): boolean; + + /** Clear the sorting from columns in the grid + * @returns {void} + */ + clearSorting(): void; + + /** Collapse all the group caption rows in grid + * @returns {void} + */ + collapseAll(): void; + + /** Collapse the group drop area in grid + * @returns {void} + */ + collapseGroupDropArea(): void; + + /** Add or remove columns in grid column collections + * @param {Array|string} Pass array of columns or string of field name to add/remove the column in grid + * @param {string} optional Pass add/remove action to be performed. By default "add" action will perform + * @returns {void} + */ + columns(columnDetails: Array|string, action: string): void; + + /** Refresh the grid with new data source + * @param {Array} Pass new data source to the grid + * @returns {void} + */ + dataSource(datasource: Array): void; + + /** Delete a record in grid control when allowDeleting is set as true + * @param {string} Pass the primary key field Name of the column + * @param {Array} Pass the json data of record need to be delete. + * @returns {void} + */ + deleteRecord(fieldName: string, data: Array): void; + + /** Destroy the grid widget all events bound using this._on will be unbind automatically and bring the control to pre-init state. + * @returns {void} + */ + destroy(): void; + + /** Edit a particular cell based on the row index and field name provided in "batch" edit mode. + * @param {number} Pass row index to edit particular cell + * @param {string} Pass the field name of the column to perform batch edit + * @returns {void} + */ + editCell(index: number, fieldName: string): void; + + /** Send a save request in grid. + * @returns {void} + */ + endEdit(): void; + + /** Expand all the group caption rows in grid. + * @returns {void} + */ + expandAll(): void; + + /** Expand or collapse the row based on the row state in grid + * @param {JQuery} Pass the target object to expand/collapse the row based on its row state + * @returns {HTMLElement} + */ + expandCollapse($target: JQuery): HTMLElement; + + /** Expand the group drop area in grid. + * @returns {void} + */ + expandGroupDropArea(): void; + + /** Export the grid content to excel, word or pdf document. + * @param {string} Pass the controller action name corresponding to exporting + * @param {string} optionalASP server event name corresponding to exporting + * @param {boolean} optionalPass the multiple exporting value as true/false + * @param {Array} optionalPass the array of the gridIds to be filtered + * @returns {void} + */ + export(action: string, serverEvent: string, multipleExport: boolean, gridIds: Array): void; + + /** Send a filtering request to filter one column in grid. + * @param {string} Pass the field name of the column + * @param {string} string/integer/dateTime operator + * @param {string|number} Pass the value to be filtered in a column + * @param {string} Pass the predicate as and/or + * @param {boolean} optional Pass the match case value as true/false + * @returns {void} + */ + filterColumn(fieldName: string, filterOperator: string, filterValue: string|number, predicate: string, matchcase: boolean): void; + + /** Send a filtering request to filter single or multiple column in grid. + * @param {Array} Pass array of filterColumn query for performing filter operation + * @returns {void} + */ + filterColumn(filterQueries: Array): void; + + /** Get the batch changes of edit, delete and add operations of grid. + * @returns {any} + */ + getBatchChanges(): any; + + /** Get the browser details + * @returns {any} + */ + getBrowserDetails(): any; + + /** Get the column details based on the given field in grid + * @param {string} Pass the field name of the column to get the corresponding column object + * @returns {any} + */ + getColumnByField(fieldName: string): any; + + /** Get the column details based on the given header text in grid. + * @param {string} Pass the header text of the column to get the corresponding column object + * @returns {any} + */ + getColumnByHeaderText(headerText: string): any; + + /** Get the column details based on the given column index in grid + * @param {number} Pass the index of the column to get the corresponding column object + * @returns {any} + */ + getColumnByIndex(columnIndex: number): any; + + /** Get the list of field names from column collection in grid. + * @returns {Array} + */ + getColumnFieldNames(): Array; + + /** Get the column index of the given field in grid. + * @param {string} Pass the field name of the column to get the corresponding column index + * @returns {number} + */ + getColumnIndexByField(fieldName: string): number; + + /** Get the content div element of grid. + * @returns {HTMLElement} + */ + getContent(): HTMLElement; + + /** Get the content table element of grid + * @returns {HTMLElement} + */ + getContentTable(): HTMLElement; + + /** Get the data of currently edited cell value in "batch" edit mode + * @returns {any} + */ + getCurrentEditCellData(): any; + + /** Get the current page index in grid pager. + * @returns {number} + */ + getCurrentIndex(): number; + + /** Get the current page data source of grid. + * @returns {Array} + */ + getCurrentViewData(): Array; + + /** Get the column field name from the given header text in grid. + * @param {string} Pass header text of the column to get its corresponding field name + * @returns {string} + */ + getFieldNameByHeaderText(headerText: string): string; + + /** Get the filter bar of grid + * @returns {HTMLElement} + */ + getFilterBar(): HTMLElement; + + /** Get the records filtered or searched in Grid + * @returns {Array} + */ + getFilteredRecords(): Array; + + /** Get the footer content of grid. + * @returns {HTMLElement} + */ + getFooterContent(): HTMLElement; + + /** Get the footer table element of grid. + * @returns {HTMLElement} + */ + getFooterTable(): HTMLElement; + + /** Get the header content div element of grid. + * @returns {HTMLElement} + */ + getHeaderContent(): HTMLElement; + + /** Get the header table element of grid + * @returns {HTMLElement} + */ + getHeaderTable(): HTMLElement; + + /** Get the column header text from the given field name in grid. + * @param {string} Pass field name of the column to get its corresponding header text + * @returns {string} + */ + getHeaderTextByFieldName(field: string): string; + + /** Get the names of all the hidden column collections in grid. + * @returns {Array} + */ + getHiddenColumnNames(): Array; + + /** Get the row index based on the given tr element in grid. + * @param {JQuery} Pass the tr element in grid content to get its row index + * @returns {number} + */ + getIndexByRow($tr: JQuery): number; + + /** Get the pager of grid. + * @returns {HTMLElement} + */ + getPager(): HTMLElement; + + /** Get the names of primary key columns in Grid + * @returns {Array} + */ + getPrimaryKeyFieldNames(): Array; + + /** Get the rows(tr element) from the given from and to row index in grid + * @param {number} Pass the from index from which the rows to be returned + * @param {number} Pass the to index to which the rows to be returned + * @returns {HTMLElement} + */ + getRowByIndex(from: number, to: number): HTMLElement; + + /** Get the row height of grid. + * @returns {number} + */ + getRowHeight(): number; + + /** Get the rows(tr element)of grid which is displayed in the current page. + * @returns {HTMLElement} + */ + getRows(): HTMLElement; + + /** Get the scroller object of grid. + * @returns {any} + */ + getScrollObject(): any; + + /** Get the selected records details in grid. + * @returns {void} + */ + getSelectedRecords(): void; + + /** Get the names of all the visible column collections in grid + * @returns {Array} + */ + getVisibleColumnNames(): Array; + + /** Send a paging request to specified page in grid + * @param {number} Pass the page index to perform paging at specified page index + * @returns {void} + */ + gotoPage(pageIndex: number): void; + + /** Send a column grouping request in grid. + * @param {string} Pass the field Name of the column to be grouped in grid control + * @returns {void} + */ + groupColumn(fieldName: string): void; + + /** Hide columns from the grid based on the header text + * @param {Array|string} you can pass either array of header text of various columns or a header text of a column to hide + * @returns {void} + */ + hideColumns(headerText: Array|string): void; + + /** Print the grid control + * @returns {void} + */ + print(): void; + + /** It is used to refresh and reset the changes made in "batch" edit mode + * @returns {void} + */ + refreshBatchEditChanges(): void; + + /** Refresh the grid contents. The template refreshment is based on the argument passed along with this method + * @param {boolean} optional When templateRefresh is set true, template and grid contents both are refreshed in grid else only grid content is refreshed + * @returns {void} + */ + refreshContent(templateRefresh: boolean): void; + + /** Refresh the template of the grid + * @returns {void} + */ + refreshTemplate(): void; + + /** Refresh the toolbar items in grid. + * @returns {void} + */ + refreshToolbar(): void; + + /** Remove a column or collection of columns from a sorted column collections in grid. + * @param {Array|string} Pass array of field names of the columns to remove a collection of sorted columns or pass a string of field name to remove a column from sorted column collections + * @returns {void} + */ + removeSortedColumns(fieldName: Array|string): void; + + /** Creates a grid control + * @returns {void} + */ + render(): void; + + /** Re-order the column in grid + * @param {string} Pass the from field name of the column needs to be changed + * @param {string} Pass the to field name of the column needs to be changed + * @returns {void} + */ + reorderColumns(fromFieldName: string, toFieldName: string): void; + + /** Reset the model collections like pageSettings, groupSettings, filterSettings, sortSettings and summaryRows. + * @returns {void} + */ + resetModelCollections(): void; + + /** Resize the columns by giving column name and width for the corresponding one. + * @param {string} Pass the column name that needs to be changed + * @param {string} Pass the width to resize the particular columns + * @returns {void} + */ + resizeColumns(column: string, width: string): void; + + /** Resolves row height issue when unbound column is used with FrozenColumn + * @returns {void} + */ + rowHeightRefresh(): void; + + /** Save the particular edited cell in grid. + * @returns {boolean} + */ + saveCell(): boolean; + + /** Set dimension for grid with corresponding to grid parent. + * @returns {void} + */ + setDimension(): void; + + /** Send a request to grid to refresh the width set to columns + * @returns {void} + */ + setWidthToColumns(): void; + + /** Send a search request to grid with specified string passed in it + * @param {string} Pass the string to search in Grid records + * @returns {void} + */ + search(searchString: string): void; + + /** Select cells in grid. + * @param {any} It is used to set the starting index of row and indexes of cells for that corresponding row for selecting cells. + * @returns {void} + */ + selectCells(rowCellIndexes: any): void; + + /** Select columns in grid. + * @param {number} It is used to set the starting index of column for selecting columns. + * @returns {void} + */ + selectColumns(fromIndex: number): void; + + /** Select rows in grid. + * @param {number} It is used to set the starting index of row for selecting rows. + * @param {number} It is used to set the ending index of row for selecting rows. + * @returns {void} + */ + selectRows(fromIndex: number, toIndex: number): void; + + /** Select rows in grid. + * @param {Array} Pass array of rowIndexes for selecting rows + * @returns {void} + */ + selectRows(rowIndexes: Array): void; + + /** Used to update a particular cell value.Note: It will work only for Local Data. + * @returns {void} + */ + setCellText(): void; + + /** Used to update a particular cell value based on specified row Index and the fieldName. + * @param {number} It is used to set the index for selecting the row. + * @param {string} It is used to set the field name for selecting column. + * @param {any} It is used to set the value for the selected cell. + * @returns {void} + */ + setCellValue(Index: number, fieldName: string, value: any): void; + + /** Set validation to a field during editing. + * @param {string} Specify the field name of the column to set validation rules + * @param {any} Specify the validation rules for the field + * @returns {void} + */ + setValidationToField(fieldName: string, rules: any): void; + + /** Show columns in the grid based on the header text + * @param {Array|string} you can pass either array of header text of various columns or a header text of a column to show + * @returns {void} + */ + showColumns(headerText: Array|string): void; + + /** Send a sorting request in grid. + * @param {string} Pass the field name of the column as columnName for which sorting have to be performed + * @param {string} optional Pass the sort direction ascending/descending by which the column have to be sort. By default it is sorting in an ascending order + * @returns {void} + */ + sortColumn(columnName: string, sortingDirection: string): void; + + /** Send an edit record request in grid + * @param {JQuery} Pass the tr- selected row element to be edited in grid + * @returns {HTMLElement} + */ + startEdit($tr: JQuery): HTMLElement; + + /** Un-group a column from grouped columns collection in grid + * @param {string} Pass the field Name of the column to be ungrouped from grouped column collection + * @returns {void} + */ + ungroupColumn(fieldName: string): void; + + /** Update a edited record in grid control when allowEditing is set as true. + * @param {string} Pass the primary key field Name of the column + * @param {Array} Pass the edited json data of record need to be update. + * @returns {void} + */ + updateRecord(fieldName: string, data: Array): void; + + /** It adapts grid to its parent element or to the browsers window. + * @returns {void} + */ + windowonresize(): void; +} +export module Grid{ + +export interface Model { + + /**Gets or sets a value that indicates whether to customizing cell based on our needs. + * @Default {false} + */ + allowCellMerging?: boolean; + + /**Gets or sets a value that indicates whether to enable dynamic grouping behavior. Grouping can be done by drag on drop desired columns to grid’s GroupDropArea. This can be further customized through “groupSettings” property. + * @Default {false} + */ + allowGrouping?: boolean; + + /**Gets or sets a value that indicates whether to enable keyboard support for performing grid actions. selectionType – Gets or sets a value that indicates whether to enable single row or multiple rows selection behavior in grid. Multiple selection can be done through by holding CTRL and clicking the grid rows + * @Default {true} + */ + allowKeyboardNavigation?: boolean; + + /**Gets or sets a value that indicates whether to enable dynamic filtering behavior on grid. Filtering can be used to limit the records displayed using required criteria and this can be further customized through “filterSettings” property + * @Default {false} + */ + allowFiltering?: boolean; + + /**Gets or sets a value that indicates whether to enable the dynamic sorting behavior on grid data. Sorting can be done through clicking on particular column header. + * @Default {false} + */ + allowSorting?: boolean; + + /**Gets or sets a value that indicates whether to enable multi columns sorting behavior in grid. Sort multiple columns by holding CTRL and click on the corresponding column header. + * @Default {false} + */ + allowMultiSorting?: boolean; + + /**This specifies the grid to show the paginated data. Also enables pager control at the bottom of grid for dynamic navigation through data source. Paging can be further customized through “pageSettings” property. + * @Default {false} + */ + allowPaging?: boolean; + + /**Gets or sets a value that indicates whether to enable the columns reordering behavior in the grid. Reordering can be done through by drag and drop the particular column from one index to another index within the grid. + * @Default {false} + */ + allowReordering?: boolean; + + /**Gets or sets a value that indicates whether the column is non resizable. Column width is set automatically based on the content or header text which is large. + * @Default {false} + */ + allowResizeToFit?: boolean; + + /**Gets or sets a value that indicates whether to enable dynamic resizable of columns. Resize the width of the columns by simply click and move the particular column header line + * @Default {false} + */ + allowResizing?: boolean; + + /**Gets or sets a value that indicates whether to enable the scrollbar in the grid and view the records by scroll through the grid manually + * @Default {false} + */ + allowScrolling?: boolean; + + /**Gets or sets a value that indicates whether to enable dynamic searching behavior in grid. Currently search box can be enabled through “toolbarSettings” + * @Default {false} + */ + allowSearching?: boolean; + + /**Gets or sets a value that indicates whether user can select rows on grid. On enabling feature, selected row will be highlighted. + * @Default {true} + */ + allowSelection?: boolean; + + /**Gets or sets a value that indicates whether the Content will wrap to the next line if the content exceeds the boundary of the Column Cells. + * @Default {false} + */ + allowTextWrap?: boolean; + + /**Gets or sets a value that indicates whether to enable the multiple exporting behavior on grid data. + * @Default {false} + */ + allowMultipleExporting?: boolean; + + /**Gets or sets a value that indicates to define common width for all the columns in the grid. + */ + commonWidth?: number; + + /**Gets or sets a value that indicates to enable the visibility of the grid lines. + * @Default {ej.Grid.GridLines.Both} + */ + gridLines?: ej.Grid.GridLines|string; + + /**This specifies the grid to add the grid control inside the grid row of the parent with expand/collapse options + * @Default {null} + */ + childGrid?: any; + + /**Used to enable or disable static width settings for column. If the columnLayout is set as fixed, then column width will be static. + * @Default {ej.Grid.ColumnLayout.Auto} + */ + columnLayout?: ej.Grid.ColumnLayout|string; + + /**Gets or sets an object that indicates to render the grid with specified columns + * @Default {[]} + */ + columns?: Array; + + /**Gets or sets an object that indicates whether to customize the context menu behavior of the grid. + */ + contextMenuSettings?: ContextMenuSettings; + + /**Gets or sets a value that indicates to render the grid with custom theme. allowScrolling – Gets or sets a value that indicates whether to enable the scrollbar in the grid and view the records by scroll through the grid manually + */ + cssClass?: string; + + /**Gets or sets the data to render the grid with records + * @Default {null} + */ + dataSource?: any; + + /**Default Value: + * @Default {null} + */ + detailsTemplate?: string; + + /**Gets or sets an object that indicates whether to customize the editing behavior of the grid. + */ + editSettings?: EditSettings; + + /**Gets or sets a value that indicates whether to enable the alternative rows differentiation in the grid records based on corresponding theme. + * @Default {true} + */ + enableAltRow?: boolean; + + /**Gets or sets a value that indicates whether to enable the save action in the grid through row selection + * @Default {true} + */ + enableAutoSaveOnSelectionChange?: boolean; + + /**Gets or sets a value that indicates whether to enable mouse over effect on the corresponding column header cell of the grid + * @Default {false} + */ + enableHeaderHover?: boolean; + + /**Gets or sets a value that indicates whether to persist the grid model state in page using applicable medium i.e., HTML5 localStorage or cookies + * @Default {false} + */ + enablePersistence?: boolean; + + /**Gets or sets a value that indicates whether the grid rows has to be rendered as detail view in mobile mode + * @Default {false} + */ + enableResponsiveRow?: boolean; + + /**Gets or sets a value that indicates whether to enable mouse over effect on corresponding grid row. + * @Default {true} + */ + enableRowHover?: boolean; + + /**Align content in the grid control from right to left by setting the property as true. + * @Default {false} + */ + enableRTL?: boolean; + + /**To Disable the mouse swipe property as false. + * @Default {true} + */ + enableTouch?: boolean; + + /**Gets or sets an object that indicates whether to customize the filtering behavior of the grid + */ + filterSettings?: FilterSettings; + + /**Gets or sets an object that indicates whether to customize the grouping behavior of the grid. + */ + groupSettings?: GroupSettings; + + /**Gets or sets an object that indicates whether to auto wrap the grid header or content or both + */ + textWrapSettings?: TextWrapSettings; + + /**Gets or sets a value that indicates whether the grid design has be to made responsive. + * @Default {false} + */ + isResponsive?: boolean; + + /**This specifies to change the key in keyboard interaction to grid control + * @Default {null} + */ + keySettings?: any; + + /**Gets or sets a value that indicates whether to customizing the user interface (UI) as locale-specific in order to display regional data i.e. in a language and culture specific to a particular country or region. + * @Default {en-US} + */ + locale?: string; + + /**Gets or sets a value that indicates whether to set the minimum width of the responsive grid while isResponsive property is true and enableResponsiveRow property is set as false. + * @Default {0} + */ + minWidth?: number; + + /**Gets or sets an object that indicates whether to modify the pager default configuration. + */ + pageSettings?: PageSettings; + + /**Query the dataSource from the table for Grid. + * @Default {null} + */ + query?: any; + + /**Gets or sets a value that indicates to render the grid with template rows. The template row must be a table row. That table row must have the JavaScript render binding format ({{:columnName}}) then the grid data source binds the data to the corresponding table row of the template. + * @Default {null} + */ + rowTemplate?: string; + + /**Gets or sets an object that indicates whether to customize the scrolling behavior of the grid. + */ + scrollSettings?: ScrollSettings; + + /**Gets or sets an object that indicates whether to customize the searching behavior of the grid + */ + searchSettings?: SearchSettings; + + /**Gets a value that indicates whether the grid model to hold multiple selected records . selectedRecords can be used to displayed hold the single or multiple selected records using “selectedRecords” property + * @Default {null} + */ + selectedRecords?: Array; + + /**Gets or sets a value that indicates to select the row while initializing the grid + * @Default {-1} + */ + selectedRowIndex?: number; + + /**This property is used to configure the selection behavior of the grid. + */ + selectionSettings?: SelectionSettings; + + /**The row selection behavior of grid. Accepting types are "single" and "multiple". + * @Default {ej.Grid.SelectionType.Single} + */ + selectionType?: ej.Grid.SelectionType|string; + + /**This specifies to add new editable row dynamically at the either top or bottom of the grid. + * @Default {false} + */ + showAddNewRow?: boolean; + + /**Default Value: + * @Default {false} + */ + showColumnChooser?: boolean; + + /**Default Value: + * @Default {true} + */ + showInColumnChooser?: boolean; + + /**Gets or sets a value that indicates stacked header should be shown on grid layout when the property “stackedHeaderRows” is set. + * @Default {false} + */ + showStackedHeader?: boolean; + + /**Gets or sets a value that indicates summary rows should be shown on grid layout when the property “summaryRows” is set + * @Default {false} + */ + showSummary?: boolean; + + /**Gets or sets a value that indicates whether to customize the sorting behavior of the grid. + */ + sortSettings?: SortSettings; + + /**Gets or sets an object that indicates to managing the collection of stacked header rows for the grid. + * @Default {[]} + */ + stackedHeaderRows?: Array; + + /**Gets or sets an object that indicates to managing the collection of summary rows for the grid. + * @Default {[]} + */ + summaryRows?: Array; + + /**Gets or sets an object that indicates whether to enable the toolbar in the grid and add toolbar items + */ + toolbarSettings?: ToolbarSettings; + + /**Triggered for every grid action before its starts.*/ + actionBegin? (e: ActionBeginEventArgs): void; + + /**Triggered for every grid action success event.*/ + actionComplete? (e: ActionCompleteEventArgs): void; + + /**Triggered for every grid action server failure event.*/ + actionFailure? (e: ActionFailureEventArgs): void; + + /**Triggered when record batch add.*/ + batchAdd? (e: BatchAddEventArgs): void; + + /**Triggered when record batch delete.*/ + batchDelete? (e: BatchDeleteEventArgs): void; + + /**Triggered before the batch add.*/ + beforeBatchAdd? (e: BeforeBatchAddEventArgs): void; + + /**Triggered before the batch delete.*/ + beforeBatchDelete? (e: BeforeBatchDeleteEventArgs): void; + + /**Triggered before the batch save.*/ + beforeBatchSave? (e: BeforeBatchSaveEventArgs): void; + + /**Triggered before the record is going to be edited.*/ + beginEdit? (e: BeginEditEventArgs): void; + + /**Triggered when record cell edit.*/ + cellEdit? (e: CellEditEventArgs): void; + + /**Triggered when record cell save.*/ + cellSave? (e: CellSaveEventArgs): void; + + /**Triggered after the cell is selected.*/ + cellSelected? (e: CellSelectedEventArgs): void; + + /**Triggered before the cell is going to be selected.*/ + cellSelecting? (e: CellSelectingEventArgs): void; + + /**Triggered when the column is being dragged.*/ + columnDrag? (e: ColumnDragEventArgs): void; + + /**Triggered when column dragging begins.*/ + columnDragStart? (e: ColumnDragStartEventArgs): void; + + /**Triggered when the column is dropped.*/ + columnDrop? (e: ColumnDropEventArgs): void; + + /**Triggered after the column is selected.*/ + columnSelected? (e: ColumnSelectedEventArgs): void; + + /**Triggered before the column is going to be selected.*/ + columnSelecting? (e: ColumnSelectingEventArgs): void; + + /**Triggered when context menu item is clicked*/ + contextClick? (e: ContextClickEventArgs): void; + + /**Triggered before the context menu is opened.*/ + contextOpen? (e: ContextOpenEventArgs): void; + + /**Triggered when the grid is rendered completely.*/ + create? (e: CreateEventArgs): void; + + /**Triggered when the grid is bound with data during initial rendering.*/ + dataBound? (e: DataBoundEventArgs): void; + + /**Triggered when grid going to destroy.*/ + destroy? (e: DestroyEventArgs): void; + + /**Triggered when detail template row is clicked to collapse.*/ + detailsCollapse? (e: DetailsCollapseEventArgs): void; + + /**Triggered detail template row is initialized.*/ + detailsDataBound? (e: DetailsDataBoundEventArgs): void; + + /**Triggered when detail template row is clicked to expand.*/ + detailsExpand? (e: DetailsExpandEventArgs): void; + + /**Triggered after the record is added.*/ + endAdd? (e: EndAddEventArgs): void; + + /**Triggered after the record is deleted.*/ + endDelete? (e: EndDeleteEventArgs): void; + + /**Triggered after the record is edited.*/ + endEdit? (e: EndEditEventArgs): void; + + /**Triggered initial load.*/ + load? (e: LoadEventArgs): void; + + /**Triggered every time a request is made to access particular cell information, element and data.*/ + mergeCellInfo? (e: MergeCellInfoEventArgs): void; + + /**Triggered every time a request is made to access particular cell information, element and data.*/ + queryCellInfo? (e: QueryCellInfoEventArgs): void; + + /**Triggered when record is clicked.*/ + recordClick? (e: RecordClickEventArgs): void; + + /**Triggered when record is double clicked.*/ + recordDoubleClick? (e: RecordDoubleClickEventArgs): void; + + /**Triggered after column resized.*/ + resized? (e: ResizedEventArgs): void; + + /**Triggered when column resize end.*/ + resizeEnd? (e: ResizeEndEventArgs): void; + + /**Triggered when column resize start.*/ + resizeStart? (e: ResizeStartEventArgs): void; + + /**Triggered when right clicked on grid element.*/ + rightClick? (e: RightClickEventArgs): void; + + /**Triggered every time a request is made to access row information, element and data.*/ + rowDataBound? (e: RowDataBoundEventArgs): void; + + /**Triggered after the row is selected.*/ + rowSelected? (e: RowSelectedEventArgs): void; + + /**Triggered before the row is going to be selected.*/ + rowSelecting? (e: RowSelectingEventArgs): void; + + /**Triggered when refresh the template column elements in the Grid.*/ + templateRefresh? (e: TemplateRefreshEventArgs): void; + + /**Triggered when toolbar item is clicked in grid.*/ + toolBarClick? (e: ToolBarClickEventArgs): void; +} + +export interface ActionBeginEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the current selected page number. + */ + currentPage?: number; + + /**Returns the previous selected page number. + */ + previousPage?: number; + + /**Returns the end row index of that current page. + */ + endIndex?: number; + + /**Returns request type. + */ + requestType?: string; + + /**Returns the start row index of that current page. + */ + startIndex?: number; + + /**Returns the current grouped column field name. + */ + columnName?: string; + + /**Returns the column sort direction. + */ + columnSortDirection?: string; + + /**Returns current edited row. + */ + row?: any; + + /**Returns the current action event type. + */ + originalEventType?: string; + + /**Returns primary key. + */ + primaryKey?: string; + + /**Returns primary key value. + */ + primaryKeyValue?: string; + + /**Returns the edited row index. + */ + rowIndex?: number; + + /**Returns the record object (JSON). + */ + data?: any; + + /**Returns the foreign key record object (JSON). + */ + foreignKeyData?: any; + + /**Returns the selected row index. + */ + selectedRow?: number; + + /**Returns selected row for delete. + */ + tr?: any; + + /**Returns current filtering column field name. + */ + currentFilteringColumn?: any; + + /**Returns filter details. + */ + filterCollection?: any; + + /**Returns type of the column like number, string and so on. + */ + columnType?: string; + + /**Returns the excel filter model. + */ + filtermodel?: any; + + /**Returns the dataSource. + */ + dataSource?: any; + + /**Returns the query manager. + */ + query?: any; + + /**Returns the customfilter option value. + */ + isCustomFilter?: boolean; +} + +export interface ActionCompleteEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the grid model. + */ + model?: any; + + /**Returns request type. + */ + requestType?: string; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the current selected page number. + */ + currentPage?: number; + + /**Returns the previous selected page number. + */ + previousPage?: number; + + /**Returns the end row index of that current page. + */ + endIndex?: number; + + /**Returns current action event type. + */ + originalEventType?: string; + + /**Returns the start row index of the current page. + */ + startIndex?: number; + + /**Returns grid element. + */ + target?: any; + + /**Returns the current sorted column field name. + */ + columnName?: string; + + /**Returns the column sort direction. + */ + columnSortDirection?: string; + + /**Returns current edited row. + */ + row?: any; + + /**Returns primary key. + */ + primaryKey?: string; + + /**Returns primary key value. + */ + primaryKeyValue?: string; + + /**Returns the edited row index. + */ + rowIndex?: number; + + /**Returns the record object (JSON). + */ + data?: any; + + /**Returns the selectedRow index. + */ + selectedRow?: number; + + /**Returns the foreign key record object (JSON). + */ + foreignKeyData?: any; + + /**Returns selected row for delete. + */ + tr?: any; + + /**Returns current filtering column field name. + */ + currentFilteringColumn?: string; + + /**Returns filter details. + */ + filterCollection?: any; + + /**Returns the dataSource. + */ + dataSource?: any; + + /**Returns the excel filter model. + */ + filtermodel?: any; + + /**Returns type of the column like number, string and so on. + */ + columnType?: string; + + /**Returns the customfilter option value. + */ + isCustomFilter?: boolean; +} + +export interface ActionFailureEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the grid model. + */ + model?: any; + + /**Returns request type. + */ + requestType?: string; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the error return by server. + */ + error?: any; + + /**Returns the current selected page number. + */ + currentPage?: number; + + /**Returns the previous selected page number. + */ + previousPage?: number; + + /**Returns the end row index of that current page. + */ + endIndex?: number; + + /**Returns current action event type. + */ + originalEventType?: string; + + /**Returns the start row index of the current page. + */ + startIndex?: number; + + /**Returns grid element. + */ + target?: any; + + /**Returns the current sorted column field name. + */ + columnName?: string; + + /**Returns the column sort direction. + */ + columnSortDirection?: string; + + /**Returns current edited row. + */ + row?: any; + + /**Returns primary key. + */ + primaryKey?: string; + + /**Returns primary key value. + */ + primaryKeyValue?: string; + + /**Returns the edited row index. + */ + rowIndex?: number; + + /**Returns the record object (JSON). + */ + data?: any; + + /**Returns the selectedRow index. + */ + selectedRow?: number; + + /**Returns the foreign key record object (JSON). + */ + foreignKeyData?: any; + + /**Returns selected row for delete. + */ + tr?: any; + + /**Returns current filtering column field name. + */ + currentFilteringColumn?: string; + + /**Returns filter details. + */ + filterCollection?: any; +} + +export interface BatchAddEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the grid model. + */ + model?: any; + + /**Returns deleted data. + */ + data?: any; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the column object. + */ + columnObject?: any; + + /**Returns the column index. + */ + columnIndex?: number; + + /**Returns the row element. + */ + row?: any; + + /**Returns the primaryKey. + */ + primaryKey?: any; + + /**Returns the cell object. + */ + cell?: any; +} + +export interface BatchDeleteEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the grid model. + */ + model?: any; + + /**Returns deleted data. + */ + data?: any; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the primary key. + */ + primaryKey?: any; + + /**Returns the row Index. + */ + rowIndex?: number; +} + +export interface BeforeBatchAddEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the grid model. + */ + model?: any; + + /**Returns deleted data. + */ + data?: any; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the default data object. + */ + defaultData?: any; + + /**Returns the primaryKey. + */ + primaryKey?: any; +} + +export interface BeforeBatchDeleteEventArgs { + + /**Returns the grid model. + */ + model?: any; + + /**Returns deleted data. + */ + data?: any; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the primaryKey. + */ + primaryKey?: any; + + /**Returns the row index. + */ + rowIndex?: number; + + /**Returns the row data. + */ + rowData?: any; + + /**Returns the row element. + */ + row?: any; +} + +export interface BeforeBatchSaveEventArgs { + + /**Returns the grid model. + */ + model?: any; + + /**Returns deleted data. + */ + data?: any; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the changed record object. + */ + batchChanges?: any; +} + +export interface BeginEditEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the current edited row. + */ + row?: any; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the primary key. + */ + primaryKey?: any; + + /**Returns the primary key value. + */ + primaryKeyValue?: any; + + /**Returns the edited row index. + */ + rowIndex?: number; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface CellEditEventArgs { + + /**Returns the grid model. + */ + model?: any; + + /**Returns deleted data. + */ + data?: any; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the validation rules. + */ + validationRules?: any; + + /**Returns the column name. + */ + columnName?: string; + + /**Returns the cell value. + */ + value?: string; + + /**Returns the row data object. + */ + rowData?: any; + + /**Returns the previous value of the cell. + */ + previousValue?: string; + + /**Returns the column object. + */ + columnObject?: any; + + /**Returns the cell object. + */ + cell?: any; + + /**Returns isForeignKey option value. + */ + isForeignKey?: boolean; +} + +export interface CellSaveEventArgs { + + /**Returns the grid model. + */ + model?: any; + + /**Returns deleted data. + */ + data?: any; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the column name. + */ + columnName?: string; + + /**Returns the cell value. + */ + value?: string; + + /**Returns the row data object. + */ + rowData?: any; + + /**Returns the previous value of the cell. + */ + previousValue?: string; + + /**Returns the column object. + */ + columnObject?: any; + + /**Returns the cell object. + */ + cell?: any; + + /**Returns isForeignKey option value. + */ + isForeignKey?: boolean; +} + +export interface CellSelectedEventArgs { + + /**Returns the selected cell index value. + */ + cellIndex?: number; + + /**Returns the previous selected cell index value. + */ + previousRowCellIndex?: number; + + /**Returns the selected cell element. + */ + currentCell?: any; + + /**Returns the previous selected cell element. + */ + previousRowCell?: any; + + /**Returns current record object (JSON). + */ + data?: any; + + /**Returns the selected row cell index values. + */ + selectedRowCellIndex?: Array; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface CellSelectingEventArgs { + + /**Returns the selected cell index value. + */ + cellIndex?: number; + + /**Returns the previous selected cell index value. + */ + previousRowCellIndex?: number; + + /**Returns the selected cell element. + */ + currentCell?: any; + + /**Returns the previous selected cell element. + */ + previousRowCell?: any; + + /**Returns current record object (JSON). + */ + data?: any; + + /**Returns whether the ctrl key is pressed while selecting cell + */ + isCtrlKeyPressed?: boolean; + + /**Returns whether the shift key is pressed while selecting cell + */ + isShiftKeyPressed?: boolean; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface ColumnDragEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns draggable element type. + */ + draggableType?: any; + + /**Returns the draggable column object. + */ + column?: any; + + /**Returns the grid model. + */ + model?: any; + + /**Returns target elements based on mouse move position. + */ + target?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface ColumnDragStartEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns draggable element type. + */ + draggableType?: any; + + /**Returns the draggable column object. + */ + column?: any; + + /**Returns the grid model. + */ + model?: any; + + /**Returns drag start element. + */ + target?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface ColumnDropEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns draggable element type. + */ + draggableType?: string; + + /**Returns the draggable column object. + */ + column?: any; + + /**Returns the grid model. + */ + model?: any; + + /**Returns dropped dragged element. + */ + target?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface ColumnSelectedEventArgs { + + /**Returns the selected cell index value. + */ + columnIndex?: number; + + /**Returns the previous selected column index value. + */ + previousColumnIndex?: number; + + /**Returns the selected header cell element. + */ + headerCell?: any; + + /**Returns the previous selected header cell element. + */ + prevColumnHeaderCell?: any; + + /**Returns corresponding column object (JSON). + */ + column?: any; + + /**Returns the selected columns values. + */ + selectedColumnsIndex?: Array; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface ColumnSelectingEventArgs { + + /**Returns the selected column index value. + */ + columnIndex?: number; + + /**Returns the previous selected column index value. + */ + previousColumnIndex?: number; + + /**Returns the selected header cell element. + */ + headerCell?: any; + + /**Returns the previous selected header cell element. + */ + prevColumnHeaderCell?: any; + + /**Returns corresponding column object (JSON). + */ + column?: any; + + /**Returns whether the ctrl key is pressed while selecting cell + */ + isCtrlKeyPressed?: boolean; + + /**Returns whether the shift key is pressed while selecting cell + */ + isShiftKeyPressed?: boolean; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface ContextClickEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the current item. + */ + currentTarget?: any; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the status of contextmenu item which denotes its enabled state + */ + status?: boolean; + + /**Returns the target item. + */ + target?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface ContextOpenEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the current item. + */ + currentTarget?: any; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the status of contextmenu item which denotes its enabled state + */ + status?: boolean; + + /**Returns the target item. + */ + target?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface CreateEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface DataBoundEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**Returns the grid model. + */ + model?: any; + + /**Returns deleted data. + */ + data?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface DetailsCollapseEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns detail row element. + */ + detailsRow?: any; + + /**Returns master row of detail row record object (JSON). + */ + masterData?: any; + + /**Returns the foreign key record object (JSON). + */ + foreignKeyData?: any; + + /**Returns master row element. + */ + masterRow?: any; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface DetailsDataBoundEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns details row element. + */ + detailsElement?: any; + + /**Returns the details row data. + */ + data?: any; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface DetailsExpandEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns detail row element. + */ + detailsRow?: any; + + /**Returns master row of detail row record object (JSON). + */ + masterData?: any; + + /**Returns the foreign key record object (JSON). + */ + foreignKeyData?: any; + + /**Returns master row element. + */ + masterRow?: any; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface EndAddEventArgs { + + /**Returns the grid model. + */ + model?: any; + + /**Returns added data. + */ + data?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface EndDeleteEventArgs { + + /**Returns the grid model. + */ + model?: any; + + /**Returns deleted data. + */ + data?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface EndEditEventArgs { + + /**Returns the grid model. + */ + model?: any; + + /**Returns modified data. + */ + data?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface LoadEventArgs { + + /**Returns the grid model. + */ + model?: any; + + /**Returns deleted data. + */ + data?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface MergeCellInfoEventArgs { + + /**Returns grid cell. + */ + cell?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns current row record object (JSON). + */ + data?: any; + + /**Returns the text value in the cell. + */ + text?: string; + + /**Returns the column object. + */ + column?: any; + + /**Method to merge Grid rows. + */ + rowMerge?: void; + + /**Method to merge Grid columns. + */ + colMerge?: void; + + /**Method to merge Grid rows and columns. + */ + merge?: void; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface QueryCellInfoEventArgs { + + /**Returns grid cell. + */ + cell?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns current row record object (JSON). + */ + data?: any; + + /**Returns the text value in the cell. + */ + text?: string; + + /**Returns the column object. + */ + column?: any; + + /**Returns the foreign key record object (JSON). + */ + foreignKeyData?: any; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface RecordClickEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns current record object (JSON). + */ + data?: any; + + /**Returns the row index of the selected row. + */ + rowIndex?: number; + + /**Returns the jquery object of the current selected row. + */ + row?: any; + + /**Returns the current selected cell. + */ + cell?: any; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the cell index value. + */ + cellIndex?: number; + + /**Returns the corresponding cell value. + */ + cellValue?: string; + + /**Returns the Header text of the column corresponding to the selected cell. + */ + columnName?: string; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface RecordDoubleClickEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns current record object (JSON). + */ + data?: any; + + /**Returns the row index of the selected row. + */ + rowIndex?: number; + + /**Returns the jquery object of the current selected row. + */ + row?: any; + + /**Returns the current selected cell. + */ + cell?: any; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the selected cell index value. + */ + cellIndex?: number; + + /**Returns the corresponding cell value. + */ + cellValue?: string; + + /**Returns the Header text of the column corresponding to the selected cell. + */ + columnName?: string; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface ResizedEventArgs { + + /**Returns the grid model. + */ + model?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns deleted data. + */ + data?: any; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the column index. + */ + columnIndex?: number; + + /**Returns the column object. + */ + column?: any; + + /**Returns the grid object. + */ + target?: any; + + /**Returns the old width value. + */ + oldWidth?: number; + + /**Returns the new width value. + */ + newWidth?: number; +} + +export interface ResizeEndEventArgs { + + /**Returns the grid model. + */ + model?: any; + + /**Returns deleted data. + */ + data?: any; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the column index. + */ + columnIndex?: number; + + /**Returns the column object. + */ + column?: any; + + /**Returns the grid object. + */ + target?: any; + + /**Returns the old width value. + */ + oldWidth?: number; + + /**Returns the new width value. + */ + newWidth?: number; + + /**Returns the extra width value. + */ + extra?: number; +} + +export interface ResizeStartEventArgs { + + /**Returns the grid model. + */ + model?: any; + + /**Returns deleted data. + */ + data?: any; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the column index. + */ + columnIndex?: number; + + /**Returns the column object. + */ + column?: any; + + /**Returns the grid object. + */ + target?: any; + + /**Returns the old width value. + */ + oldWidth?: number; +} + +export interface RightClickEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns current record object (JSON). + */ + currentData?: any; + + /**Returns the row index of the selected row. + */ + rowIndex?: number; + + /**Returns the current selected row. + */ + row?: any; + + /**Returns the selected row data object. + */ + data?: any; + + /**Returns the cell index of the selected cell. + */ + cellIndex?: number; + + /**Returns the cell value. + */ + cellValue?: string; + + /**Returns the cell object. + */ + cell?: any; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface RowDataBoundEventArgs { + + /**Returns grid row. + */ + row?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns current row record object (JSON). + */ + data?: any; + + /**Returns the foreign key record object (JSON). + */ + foreignKeyData?: any; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface RowSelectedEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns current record object (JSON). + */ + data?: any; + + /**Returns the foreign key record object (JSON). + */ + foreignKeyData?: any; + + /**Returns the row index of the selected row. + */ + rowIndex?: number; + + /**Returns the current selected row. + */ + row?: any; + + /**Returns the previous selected row element. + */ + prevRow?: any; + + /**Returns the previous selected row index. + */ + prevRowIndex?: number; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface RowSelectingEventArgs { + + /**Returns the selected row index value. + */ + rowIndex?: number; + + /**Returns the selected row element. + */ + row?: any; + + /**Returns the previous selected row element. + */ + prevRow?: any; + + /**Returns the previous selected row index. + */ + prevRowIndex?: number; + + /**Returns current record object (JSON). + */ + data?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface TemplateRefreshEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the cell object. + */ + cell?: any; + + /**Returns the column object. + */ + column?: any; + + /**Returns the current row data. + */ + data?: any; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the current row index. + */ + rowIndex?: number; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface ToolBarClickEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the current item. + */ + currentTarget?: any; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the status of toolbar item which denotes its enabled state + */ + status?: boolean; + + /**Returns the target item. + */ + target?: any; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the grid model. + */ + gridModel?: any; + + /**Returns the toolbar object of the selected toolbar element. + */ + toolbarData?: any; +} + +export interface ColumnsCommands { + + /**Gets or sets an object that indicates to define all the button options which are available in ejButton. + */ + buttonOptions?: any; + + /**Gets or sets a value that indicates to add the command column button. See unboundType + */ + type?: ej.Grid.UnboundType|string; +} + +export interface Columns { + + /**Gets or sets a value that indicates whether to enable editing behavior for particular column. + * @Default {true} + */ + allowEditing?: boolean; + + /**Gets or sets a value that indicates whether to enable dynamic filtering behavior for particular column. + * @Default {true} + */ + allowFiltering?: boolean; + + /**Gets or sets a value that indicates whether to enable dynamic grouping behavior for particular column. + * @Default {true} + */ + allowGrouping?: boolean; + + /**Gets or sets a value that indicates whether to enable dynamic sorting behavior for particular column. + * @Default {true} + */ + allowSorting?: boolean; + + /**Gets or sets a value that indicates whether to enable dynamic resizable for particular column. + * @Default {true} + */ + allowResizing?: boolean; + + /**Used to hide the particular column in column chooser by giving value as false. + * @Default {true} + */ + showInColumnChooser?: boolean; + + /**Gets or sets an object that indicates to define a command column in the grid. + * @Default {[]} + */ + commands?: Array; + + /**Gets or sets a value that indicates to provide custom css for an individual column. + */ + cssClass?: string; + + /**Gets or sets a value that indicates the attribute values to the td element of a particular column + */ + customAttributes?: any; + + /**Gets or sets a value that indicates to bind the external datasource to the particular column when columnEditType as "dropdownedit" and also it is used to bind the datasource to the foreign key column while editing the grid. //Where data is array of JSON objects of text and value for the drop-down and array of JSON objects for foreign key column. + * @Default {null} + */ + dataSource?: Array; + + /**Gets or sets a value that indicates to display the specified default value while adding a new record to the grid + */ + defaultValue?: string|number|boolean|Date; + + /**Gets or sets a value that indicates to render the grid content and header with an html elements + * @Default {false} + */ + disableHtmlEncode?: boolean; + + /**Gets or sets a value that indicates to display a column value as checkbox or string + * @Default {true} + */ + displayAsCheckBox?: boolean; + + /**Gets or sets a value that indicates to customize ejNumericTextbox of an editable column. See editingType + */ + editParams?: any; + + /**Gets or sets a template that displays a custom editor used to edit column values. See editTemplate + * @Default {null} + */ + editTemplate?: any; + + /**Gets or sets a value that indicates to render the element(based on edit type) for editing the grid record. See editingType + * @Default {ej.Grid.EditingType.String} + */ + editType?: ej.Grid.EditingType|string; + + /**Gets or sets a value that indicates to display the columns in the grid mapping with column name of the dataSource. + */ + field?: string; + + /**Gets or sets a value that indicates to define foreign key field name of the grid datasource. + * @Default {null} + */ + foreignKeyField?: string; + + /**Gets or sets a value that indicates to bind the field which is in foreign column datasource based on the foreignKeyField + * @Default {null} + */ + foreignKeyValue?: string; + + /**Gets or sets a value that indicates the format for the text applied on the column + */ + format?: string; + + /**Gets or sets a value that indicates to add the template within the header element of the particular column. + * @Default {null} + */ + headerTemplateID?: string; + + /**Gets or sets a value that indicates to display the title of that particular column. + */ + headerText?: string; + + /**This defines the text alignment of a particular column header cell value. See headerTextAlign + * @Default {ej.TextAlign.Left} + */ + headerTextAlign?: ej.TextAlign|string; + + /**You can use this property to freeze selected columns in grid at the time of scrolling. + * @Default {false} + */ + isFrozen?: boolean; + + /**Gets or sets a value that indicates the column has an identity in the database. + * @Default {false} + */ + isIdentity?: boolean; + + /**Gets or sets a value that indicates the column is act as a primary key(read-only) of the grid. The editing is performed based on the primary key column + * @Default {false} + */ + isPrimaryKey?: boolean; + + /**Gets or sets a value that indicates whether to bind the column which are not in the datasource + * @Default {false} + */ + isUnbound?: boolean; + + /**Gets or sets a value that indicates whether to enables column template for a particular column. + * @Default {false} + */ + template?: boolean|string; + + /**Gets or sets a value that indicates to add the template as a particular column data . + * @Default {null} + */ + templateID?: string; + + /**Gets or sets a value that indicates to align the text within the column. See textAlign + * @Default {ej.TextAlign.Left} + */ + textAlign?: ej.TextAlign|string; + + /**Sets the template for Tooltip in Grid Columns(both header and content) + */ + tooltip?: string; + + /**Sets the clip mode for Grid cell as ellipsis or clipped content(both header and content) + * @Default {ej.Grid.ClipMode.Clip} + */ + clipMode?: ej.Grid.ClipMode|string; + + /**Gets or sets a value that indicates to specify the data type of the specified columns. + */ + type?: string; + + /**Gets or sets a value that indicates to define constraints for saving data to the database. + */ + validationRules?: any; + + /**Gets or sets a value that indicates whether this column is visible in the grid. + * @Default {true} + */ + visible?: boolean; + + /**Gets or sets a value that indicates to define the width for a particular column in the grid. + */ + width?: number; +} + +export interface ContextMenuSettingsSubContextMenu { + + /**Used to get or set the corresponding custom context menu item to which the submenu to be appended. + * @Default {null} + */ + contextMenuItem?: string; + + /**Used to get or set the sub menu items to the custom context menu item. + * @Default {[]} + */ + subMenu?: Array; +} + +export interface ContextMenuSettings { + + /**Gets or sets a value that indicates whether to add the default context menu actions as a context menu items If enableContextMenu is true it will show all the items related to the target, if you want selected items from contextmenu you have to mention in the contextMenuItems + * @Default {[]} + */ + contextMenuItems?: Array; + + /**Gets or sets a value that indicates whether to add custom contextMenu items within the toolbar to perform any action in the grid + * @Default {[]} + */ + customContextMenuItems?: Array; + + /**Gets or sets a value that indicates whether to enable the context menu action in the grid. + * @Default {false} + */ + enableContextMenu?: boolean; + + /**Used to get or set the subMenu to the corresponding custom context menu item. + */ + subContextMenu?: Array; + + /**Gets or sets a value that indicates whether to disable the default context menu items in the grid. + * @Default {false} + */ + disabledefaultitems?: boolean; +} + +export interface EditSettings { + + /**Gets or sets a value that indicates whether to enable insert action in the editing mode. + * @Default {false} + */ + allowAdding?: boolean; + + /**Gets or sets a value that indicates whether to enable the delete action in the editing mode. + * @Default {false} + */ + allowDeleting?: boolean; + + /**Gets or sets a value that indicates whether to enable the edit action in the editing mode. + * @Default {false} + */ + allowEditing?: boolean; + + /**Gets or sets a value that indicates whether to enable the editing action while double click on the record + * @Default {true} + */ + allowEditOnDblClick?: boolean; + + /**This specifies the id of the template. This template can be used to display the data that you require to be edited using the Dialog Box + * @Default {null} + */ + dialogEditorTemplateID?: string; + + /**Gets or sets a value that indicates whether to define the mode of editing See editMode + * @Default {ej.Grid.EditMode.Normal} + */ + editMode?: ej.Grid.EditMode|string; + + /**This specifies the id of the template. This template can be used to display the data that you require to be edited using the External edit form + * @Default {null} + */ + externalFormTemplateID?: string; + + /**This specifies to set the position of an External edit form either in the top-right or bottom-left of the grid + * @Default {ej.Grid.FormPosition.BottomLeft} + */ + formPosition?: ej.Grid.FormPosition|string; + + /**This specifies the id of the template. This template can be used to display the data that you require to be edited using the Inline edit form + * @Default {null} + */ + inlineFormTemplateID?: string; + + /**This specifies to set the position of an adding new row either in the top or bottom of the grid + * @Default {ej.Grid.RowPosition.top} + */ + rowPosition?: ej.Grid.RowPosition|string; + + /**Gets or sets a value that indicates whether the confirm dialog has to be shown while saving or discarding the batch changes + * @Default {true} + */ + showConfirmDialog?: boolean; + + /**Gets or sets a value that indicates whether the confirm dialog has to be shown while deleting record + * @Default {false} + */ + showDeleteConfirmDialog?: boolean; + + /**Gets or sets a value that indicates whether the title for edit form is different from the primarykey column. + * @Default {null} + */ + titleColumn?: string; + + /**Gets or sets a value that indicates whether to display the add new form by default in the grid. + * @Default {false} + */ + showAddNewRow?: boolean; +} + +export interface FilterSettingsFilteredColumns { + + /**Gets or sets a value that indicates whether to define the field name of the column to be filter. + */ + field?: string; + + /**Gets or sets a value that indicates whether to define the filter condition to filtered column. + */ + operator?: ej.FilterOperators|string; + + /**Gets or sets a value that indicates whether to define the predicate as and/or. + */ + predicate?: string; + + /**Gets or sets a value that indicates whether to define the value to be filtered in a column. + */ + value?: string|number; +} + +export interface FilterSettings { + + /**Gets or sets a value that indicates to perform the filter operation with case sensitive in excel styled filter menu mode + * @Default {false} + */ + enableCaseSensitivity?: boolean; + + /**This specifies the grid to starts the filter action while typing in the filterBar or after pressing the enter key. based on the filterBarMode. See filterBarMode + * @Default {ej.Grid.FilterBarMode.Immediate} + */ + filterBarMode?: ej.Grid.FilterBarMode|string; + + /**Gets or sets a value that indicates whether to define the filtered columns details programmatically at initial load + * @Default {[]} + */ + filteredColumns?: Array; + + /**This specifies the grid to show the filterBar or filterMenu to the grid records. See filterType + * @Default {ej.Grid.FilterType.FilterBar} + */ + filterType?: ej.Grid.FilterType|string; + + /**Gets or sets a value that indicates the maximum number of filter choices that can be showed in the excel styled filter menu. + * @Default {1000} + */ + maxFilterChoices?: number; + + /**This specifies the grid to show the filter text within the grid pager itself. + * @Default {true} + */ + showFilterBarMessage?: boolean; + + /**Gets or sets a value that indicates whether to enable the predicate options in the filtering menu + * @Default {false} + */ + showPredicate?: boolean; +} + +export interface GroupSettings { + + /**Gets or sets a value that customize the group caption format. + * @Default {null} + */ + captionFormat?: string; + + /**Gets or sets a value that indicates whether to enable the animation effects to the group drop area + * @Default {true} + */ + enableDropAreaAnimation?: boolean; + + /**Gets or sets a value that indicates whether to enable animation button option in the group drop area of the grid. + * @Default {false} + */ + enableDropAreaAutoSizing?: boolean; + + /**Gets or sets a value that indicates whether to add grouped columns programmatically at initial load + * @Default {[]} + */ + groupedColumns?: Array; + + /**Gets or sets a value that indicates whether to show the group drop area just above the column header. It can be used to avoid ungrouping the already grouped column using groupsettings. + * @Default {true} + */ + showDropArea?: boolean; + + /**Gets or sets a value that indicates whether to hide the grouped columns from the grid + * @Default {false} + */ + showGroupedColumn?: boolean; + + /**Gets or sets a value that indicates whether to show the group button image(toggle button)in the column header and also in the grouped column in the group drop area . It can be used to group/ungroup the columns by click on the toggle button. + * @Default {false} + */ + showToggleButton?: boolean; + + /**Gets or sets a value that indicates whether to enable the close button in the grouped column which is in the group drop area to ungroup the grouped column + * @Default {false} + */ + showUngroupButton?: boolean; +} + +export interface TextWrapSettings { + + /**This specifies the grid to apply the auto wrap for grid content or header or both. + * @Default {ej.Grid.WrapMode.Both} + */ + wrapMode?: ej.Grid.WrapMode|string; +} + +export interface PageSettings { + + /**Gets or sets a value that indicates whether to define which page to display currently in the grid + * @Default {1} + */ + currentPage?: number; + + /**Gets or sets a value that indicates whether to pass the current page information as a query string along with the url while navigating to other page. + * @Default {false} + */ + enableQueryString?: boolean; + + /**Gets or sets a value that indicates whether to enables pager template for the grid. + * @Default {false} + */ + enableTemplates?: boolean; + + /**Gets or sets a value that indicates whether to define the number of pages displayed in the pager for navigation + * @Default {8} + */ + pageCount?: number; + + /**Gets or sets a value that indicates whether to define the number of records displayed per page + * @Default {12} + */ + pageSize?: number; + + /**Gets or sets a value that indicates whether to enables default pager for the grid. + * @Default {false} + */ + showDefaults?: boolean; + + /**Gets or sets a value that indicates to add the template as a pager template for grid. + * @Default {null} + */ + template?: string; + + /**Get the value of total number of pages in the grid. The totalPages value is calculated based on page size and total records of grid + * @Default {null} + */ + totalPages?: number; + + /**Get the value of total number of records which is bound to the grid. The totalRecordsCount value is calculated based on dataSource bound to the grid. + * @Default {null} + */ + totalRecordsCount?: number; + + /**Gets or sets a value that indicates whether to define the number of pages to print + * @Default {ej.Grid.PrintMode.AllPages} + */ + printMode?: ej.Grid.PrintMode|string; +} + +export interface ScrollSettings { + + /**This specify the grid to to view data that you require without buffering the entire load of a huge database + * @Default {false} + */ + allowVirtualScrolling?: boolean; + + /**This specify the grid to enable/disable touch control for scrolling. + * @Default {true} + */ + enableTouchScroll?: boolean; + + /**This specify the grid to freeze particular columns at the time of scrolling. + * @Default {0} + */ + frozenColumns?: number; + + /**This specify the grid to freeze particular rows at the time of scrolling. + * @Default {0} + */ + frozenRows?: number; + + /**This specify the grid to show the vertical scroll bar, to scroll and view the grid contents. + * @Default {0} + */ + height?: number; + + /**This is used to define the mode of virtual scrolling in grid. See virtualScrollMode + * @Default {ej.Grid.VirtualScrollMode.Normal} + */ + virtualScrollMode?: ej.Grid.VirtualScrollMode|string; + + /**This specify the grid to show the horizontal scroll bar, to scroll and view the grid contents + * @Default {250} + */ + width?: number; + + /**This specify the scroll down pixel of mouse wheel, to scroll mouse wheel and view the grid contents. + * @Default {57} + */ + scrollOneStepBy?: number; +} + +export interface SearchSettings { + + /**This specify the grid to search for the value in particular columns that is mentioned in the field. + * @Default {[]} + */ + field?: any; + + /**This specifies the grid to search the particular data that is mentioned in the key. + */ + key?: string; + + /**It specifies the grid to search the records based on operator. + * @Default {contains} + */ + operator?: string; + + /**It enables or disables case-sensitivity while searching the search key in grid. + * @Default {true} + */ + ignoreCase?: boolean; +} + +export interface SelectionSettings { + + /**Gets or sets a value that indicates whether to enable the toggle selction behavior for row, cell and column. + * @Default {false} + */ + enableToggle?: boolean; + + /**Gets or sets a value that indicates whether to add the default selection actions as a seleciton mode.See selectionMode + * @Default {[row]} + */ + selectionMode?: ej.Grid.SelectionMode|string; +} + +export interface SortSettingsSortedColumns { + + /**Gets or sets a value that indicates whether to define the direction to sort the column. + */ + direction?: string; + + /**Gets or sets a value that indicates whether to define the field name of the column to be sort + */ + field?: string; +} + +export interface SortSettings { + + /**Gets or sets a value that indicates whether to define the direction and field to sort the column. + */ + sortedColumns?: Array; +} + +export interface StackedHeaderRowsStackedHeaderColumns { + + /**Gets or sets a value that indicates the header text for the particular stacked header column. + * @Default {null} + */ + column?: string; + + /**Gets or sets a value that indicates class to the corresponding stackedHeaderColumn. + * @Default {null} + */ + cssClass?: string; + + /**Gets or sets a value that indicates the header text for the particular stacked header column. + * @Default {null} + */ + headerText?: string; + + /**Gets or sets a value that indicates the text alignment of the corresponding headerText. + * @Default {ej.TextAlign.Left} + */ + textAlign?: string; +} + +export interface StackedHeaderRows { + + /**Gets or sets a value that indicates whether to add stacked header columns into the stacked header rows + * @Default {[]} + */ + stackedHeaderColumns?: Array; +} + +export interface SummaryRowsSummaryColumns { + + /**Gets or sets a value that indicates the text displayed in the summary column as a value + * @Default {null} + */ + customSummaryValue?: string; + + /**This specifies summary column used to perform the summary calculation + * @Default {null} + */ + dataMember?: string; + + /**Gets or sets a value that indicates to define the target column at which to display the summary. + * @Default {null} + */ + displayColumn?: string; + + /**Gets or sets a value that indicates the format for the text applied on the column + * @Default {null} + */ + format?: string; + + /**Gets or sets a value that indicates the text displayed before the summary column value + * @Default {null} + */ + prefix?: string; + + /**Gets or sets a value that indicates the text displayed after the summary column value + * @Default {null} + */ + suffix?: string; + + /**Gets or sets a value that indicates the type of calculations to be performed for the corresponding summary column + * @Default {[]} + */ + summaryType?: ej.Grid.SummaryType|string; + + /**Gets or sets a value that indicates to add the template for the summary value of dataMember given. + * @Default {null} + */ + template?: string; +} + +export interface SummaryRows { + + /**Gets or sets a value that indicates whether to show the summary value within the group caption area for the corresponding summary column while grouping the column + * @Default {false} + */ + showCaptionSummary?: boolean; + + /**Gets or sets a value that indicates whether to show the group summary value for the corresponding summary column while grouping a column + * @Default {false} + */ + showGroupSummary?: boolean; + + /**Gets or sets a value that indicates whether to show the total summary value the for the corresponding summary column. The summary row is added after the grid content. + * @Default {true} + */ + showTotalSummary?: boolean; + + /**Gets or sets a value that indicates whether to add summary columns into the summary rows. + * @Default {[]} + */ + summaryColumns?: Array; + + /**This specifies the grid to show the title for the summary rows. + */ + title?: string; + + /**This specifies the grid to show the title of summary row in the specified column. + * @Default {null} + */ + titleColumn?: string; +} + +export interface ToolbarSettings { + + /**Gets or sets a value that indicates whether to add custom toolbar items within the toolbar to perform any action in the grid + * @Default {[]} + */ + customToolbarItems?: Array; + + /**Gets or sets a value that indicates whether to enable toolbar in the grid. + * @Default {false} + */ + showToolbar?: boolean; + + /**Gets or sets a value that indicates whether to add the default editing actions as a toolbar items + * @Default {[]} + */ + toolbarItems?: ej.Grid.ToolBarItems|string; +} + +enum GridLines{ + + ///Displays both the horizontal and vertical grid lines. + Both, + + ///Displays the horizontal grid lines only. + Horizontal, + + ///Displays the vertical grid lines only. + Vertical, + + ///No grid lines are displayed. + None +} + + +enum ColumnLayout{ + + ///Column layout is auto(based on width). + Auto, + + ///Column layout is fixed(based on width). + Fixed +} + + +enum UnboundType{ + + ///Unbound type is edit. + Edit, + + ///Unbound type is save. + Save, + + ///Unbound type is delete. + Delete, + + ///Unbound type is cancel. + Cancel +} + + +enum EditingType{ + + ///Specifies editing type as string edit. + String, + + ///Specifies editing type as boolean edit. + Boolean, + + ///Specifies editing type as numeric edit. + Numeric, + + ///Specifies editing type as dropdown edit. + Dropdown, + + ///Specifies editing type as datepicker. + DatePicker, + + ///Specifies editing type as datetime picker. + DateTimePicker +} + + +enum ClipMode{ + + ///Shows ellipsis for the overflown cell. + Ellipsis, + + ///Truncate the text in the cell + Clip, + + ///Shows ellipsis and tooltip for the overflown cell. + EllipsisWithTooltip +} + + +enum EditMode{ + + ///Edit mode is normal. + Normal, + + ///Truncate the text in the cell + Clip, + + ///Edit mode is dialog. + Dialog, + + ///Edit mode is dialog template. + DialogTemplate, + + ///Edit mode is batch. + Batch, + + ///Edit mode is inline form. + InlineForm, + + ///Edit mode is inline template form. + InlineTemplateForm, + + ///Edit mode is external form. + ExternalForm, + + ///Edit mode is external form template. + ExternalFormTemplate +} + + +enum FormPosition{ + + ///Form position is bottomleft. + BottomLeft, + + ///Form position is topright. + TopRight +} + + +enum RowPosition{ + + ///Specifies position of add new row as top. + Top, + + ///Specifies position of add new row as bottom. + Bottom +} + + +enum FilterBarMode{ + + ///Initiate filter operation on typing the filter query. + Immediate, + + ///Initiate filter operation after Enter key is pressed. + OnEnter +} + + +enum FilterType{ + + ///Specifies the filter type as menu. + Menu, + + ///Specifies the filter type as excel. + Excel, + + ///Specifies the filter type as filterbar. + FilterBar +} + + +enum WrapMode{ + + ///Auto wrap is applied for both content and header. + Both, + + ///Auto wrap is applied only for content. + Content, + + ///Auto wrap is applied only for header. + Header +} + + +enum PrintMode{ + + ///Prints all pages. + AllPages, + + ///Prints curren tpage. + CurrentPage +} + + +enum VirtualScrollMode{ + + ///virtual scroll mode is normal. + Normal, + + ///virtual scroll mode is continuous. + Continuous +} + + +enum SelectionMode{ + + ///Selection is row basis. + Row, + + ///Selection is cell basis. + Cell, + + ///Selection is column basis. + Column +} + + +enum SelectionType{ + + ///Specifies the selection type as single. + Single, + + ///Specifies the selection type as multiple. + Multiple +} + + +enum SummaryType{ + + ///Summary type is average. + Average, + + ///Summary type is minimum. + Minimum, + + ///Summary type is maximum. + Maximum, + + ///Summary type is count. + Count, + + ///Summary type is sum. + Sum, + + ///Summary type is custom. + Custom, + + ///Summary type is true count. + TrueCount, + + ///Summary type is false count. + FalseCount +} + + +enum ToolBarItems{ + + ///Toolbar item is add. + Add, + + ///Toolbar item is edit. + Edit, + + ///Toolbar item is delete. + Delete, + + ///Toolbar item is update. + Update, + + ///Toolbar item is cancel. + Cancel, + + ///Toolbar item is search. + Search, + + ///Toolbar item is pdfExport. + PdfExport, + + ///Toolbar item is printGrid. + PrintGrid, + + ///Toolbar item is wordExport. + WordExport +} + +} + +class PivotGrid extends ej.Widget { + static fn: PivotGrid; + constructor(element: JQuery, options?: PivotGrid.Model); + constructor(element: Element, options?: PivotGrid.Model); + model:PivotGrid.Model; + defaults:PivotGrid.Model; + + /** Perform an asynchronous HTTP (AJAX) request. + * @returns {void} + */ + doAjaxPost(): void; + + /** Perform an asynchronous HTTP (FullPost) submit. + * @returns {void} + */ + doPostBack(): void; + + /** Exports the PivotGrid to an appropriate format based on the parameter passed. + * @returns {void} + */ + exportPivotGrid(): void; + + /** This function re-renders the PivotGrid on clicking the navigation buttons on PivotPager. + * @returns {void} + */ + refreshPagedPivotGrid(): void; + + /** This function receives the JSON formatted datasource to render the PivotGrid control. + * @returns {void} + */ + renderControlFromJSON(): void; +} +export module PivotGrid{ + +export interface Model { + + /**Sets the mode for the PivotGrid widget for binding either OLAP or relational data source. + * @Default {ej.PivotGrid.AnalysisMode.Olap} + */ + analysisMode?: any; + + /**Specifies the CSS class to PivotGrid to achieve custom theme. + * @Default {“”} + */ + cssClass?: string; + + /**Contains the serialized OlapReport at that instant. + * @Default {“”} + */ + currentReport?: string; + + /**Initializes the data source for the PivotGrid widget, when it functions completely on client-side. + * @Default {{}} + */ + dataSource?: DataSource; + + /**Used to bind the drilled members by default through report. + * @Default {[]} + */ + drilledItems?: Array; + + /**Object utilized to pass additional information between client-end and service-end. + * @Default {null} + */ + customObject?: any; + + /**Allows the user to access each cell on right-click. + * @Default {false} + */ + enableCellContext?: boolean; + + /**Enables the cell selection for a specified range of value cells. + * @Default {false} + */ + enableCellSelection?: boolean; + + /**Collapses the Pivot Items along rows and columns by default. It works only for relational data source. + * @Default {false} + */ + enableCollapseByDefault?: boolean; + + /**Enables the display of grand total for all the columns. + * @Default {true} + */ + enableColumnGrandTotal?: boolean; + + /**Allows the user to format a specific set of cells based on the condition. + * @Default {false} + */ + enableConditionalFormatting?: boolean; + + /**Allows the user to refresh the control on-demand and not during every UI operation. + * @Default {false} + */ + enableDeferUpdate?: boolean; + + /**Enables the display of GroupingBar allowing you to filter, sort and remove fields obtained from relational datasource. + * @Default {false} + */ + enableGroupingBar?: boolean; + + /**Enables the display of grand total for rows and columns. + * @Default {true} + */ + enableGrandTotal?: boolean; + + /**Allows the user to load PivotGrid using JSON data. + * @Default {false} + */ + enableJSONRendering?: boolean; + + /**Enables rendering of PivotGrid widget along with the PivotTable Field List, which allows UI operation. + * @Default {true} + */ + enablePivotFieldList?: boolean; + + /**Enables the display of grand total for all the rows. + * @Default {true} + */ + enableRowGrandTotal?: boolean; + + /**Allows the user to view PivotGrid from right to left. + * @Default {false} + */ + enableRTL?: boolean; + + /**Allows the user to enable ToolTip option. + * @Default {false} + */ + enableToolTip?: boolean; + + /**Allows the user to view large amount of data through virtual scrolling. + * @Default {false} + */ + enableVirtualScrolling?: boolean; + + /**Allows the user to configure hyperlink settings of PivotGrid control. + * @Default {{}} + */ + hyperlinkSettings?: HyperlinkSettings; + + /**This is used for identifying whether the member is Named Set or not. + * @Default {false} + */ + isNamedSets?: boolean; + + /**Allows the user to enable PivotGrid’s responsiveness in the browser layout. + * @Default {false} + */ + isResponsive?: boolean; + + /**Contains the serialized JSON string which renders PivotGrid. + * @Default {“”} + */ + jsonRecords?: string; + + /**Sets the summary layout for PivotGrid. Following are the ways in which summary can be positioned: normal summary (bottom), top summary, no summary and excel-like summary. + * @Default {ej.PivotGrid.Layout.Normal} + */ + layout?: ej.PivotGrid.Layout|string; + + /**Allows the user to set the localized language for the widget. + * @Default {en-US} + */ + locale?: string; + + /**Sets the mode for the PivotGrid widget for binding data source either in server-side or client-side. + * @Default {ej.PivotGrid.OperationalMode.ClientMode} + */ + operationalMode?: any; + + /**Allows the user to set custom name for the methods at service-end, communicated during AJAX post. + * @Default {{}} + */ + serviceMethodSettings?: ServiceMethodSettings; + + /**Connects the service using the specified URL for any server updates. + * @Default {“”} + */ + url?: string; + + /**Triggers when it reaches client-side after any AJAX request.*/ + afterServiceInvoke? (e: AfterServiceInvokeEventArgs): void; + + /**Triggers before any AJAX request is passed from PivotGrid to service methods.*/ + beforeServiceInvoke? (e: BeforeServiceInvokeEventArgs): void; + + /**Triggers when right-click action is performed on a cell.*/ + cellContext? (e: CellContextEventArgs): void; + + /**Triggers when a specific range of value cells are selected.*/ + cellSelection? (e: CellSelectionEventArgs): void; + + /**Triggers when the hyperlink of column header is clicked.*/ + columnHeaderHyperlinkClick? (e: ColumnHeaderHyperlinkClickEventArgs): void; + + /**Triggers after performing drill operation in PivotGrid.*/ + drillSuccess? (e: DrillSuccessEventArgs): void; + + /**Triggers when PivotGrid loading is initiated.*/ + load? (e: LoadEventArgs): void; + + /**Triggers when PivotGrid widget completes all operations at client-side after any AJAX request.*/ + renderComplete? (e: RenderCompleteEventArgs): void; + + /**Triggers when any error occurred during AJAX request.*/ + renderFailure? (e: RenderFailureEventArgs): void; + + /**Triggers when PivotGrid successfully reaches client-side after any AJAX request.*/ + renderSuccess? (e: RenderSuccessEventArgs): void; + + /**Triggers when the hyperlink of row header is clicked.*/ + rowHeaderHyperlinkClick? (e: RowHeaderHyperlinkClickEventArgs): void; + + /**Triggers when the hyperlink of summary cell is clicked.*/ + summaryCellHyperlinkClick? (e: SummaryCellHyperlinkClickEventArgs): void; + + /**Triggers when the hyperlink of value cell is clicked.*/ + valueCellHyperlinkClick? (e: ValueCellHyperlinkClickEventArgs): void; +} + +export interface AfterServiceInvokeEventArgs { + + /**return the current action of PivotGrid control. + */ + action?: string; + + /**return the custom object bounds with PivotGrid control. + */ + customObject?: any; + + /**return the outer HTML of PivotGrid control. + */ + element?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the PivotGrid model + */ + model?: ej.PivotGrid.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface BeforeServiceInvokeEventArgs { + + /**return the current action of PivotGrid control. + */ + action?: string; + + /**return the custom object bounds with PivotGrid control. + */ + customObject?: any; + + /**return the outer HTML of PivotGrid control. + */ + element?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the PivotGrid model + */ + model?: ej.PivotGrid.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface CellContextEventArgs { + + /**returns the original event args. + */ + args?: any; + + /**returns the cell position (row index and column index) in table. + */ + cellPosition?: string; + + /**returns the type of the cell. + */ + cellType?: string; + + /**returns the serialized data of the header cells. + */ + rowData?: string; + + /**returns the unique name of levels/members. + */ + uniqueName?: string; +} + +export interface CellSelectionEventArgs { + + /**returns the original event args. + */ + args?: any; + + /**Returns the selected cell values. + */ + cellvalue?: any; + + /**Returns the selected value cells row headers. + */ + rowheaders?: any; + + /**Returns the selected value cells column headers. + */ + colheaders?: any; + + /**Returns the selected value cells measure. + */ + measure?: any; + + /**Return the row and column measure count. + */ + measureValue?: any; +} + +export interface ColumnHeaderHyperlinkClickEventArgs { + + /**returns the original event args. + */ + args?: any; + + /**returns the cell position (row index and column index) in table. + */ + cellPosition?: string; + + /**returns the type of the cell. + */ + cellType?: string; + + /**returns the serialized data of the header cells. + */ + rowData?: string; + + /**returns the unique name of levels/members. + */ + uniqueName?: string; +} + +export interface DrillSuccessEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the PivotGrid model + */ + model?: ej.PivotGrid.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface LoadEventArgs { + + /**returns the original event args. + */ + args?: any; + + /**returns the current action of PivotGrid control. + */ + action?: string; + + /**returns the custom object bounded with the control. + */ + customObject?: any; + + /**returns the HTML of PivotGrid control. + */ + element?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the PivotGrid model. + */ + model?: ej.PivotGrid.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface RenderCompleteEventArgs { + + /**returns the original event args. + */ + args?: any; + + /**returns the current action of PivotGrid control. + */ + action?: string; + + /**returns the custom object bounded with the control. + */ + customObject?: any; + + /**returns the HTML of PivotGrid control. + */ + element?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the PivotGrid model. + */ + model?: ej.PivotGrid.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface RenderFailureEventArgs { + + /**returns the original event args. + */ + args?: any; + + /**returns the current action of PivotGrid control. + */ + action?: string; + + /**returns the custom object bounded with the control. + */ + customObject?: any; + + /**returns the HTML of PivotGrid control. + */ + element?: string; + + /**returns the error message with error code. + */ + message?: any; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the PivotGrid model. + */ + model?: ej.PivotGrid.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface RenderSuccessEventArgs { + + /**returns the original event args. + */ + args?: any; + + /**returns the current action of PivotGrid control. + */ + action?: string; + + /**returns the custom object bounded with the control. + */ + customObject?: any; + + /**returns the HTML of PivotGrid control. + */ + element?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the PivotGrid model. + */ + model?: ej.PivotGrid.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface RowHeaderHyperlinkClickEventArgs { + + /**returns the original event args. + */ + args?: any; + + /**returns the cell position (row index and column index) in table. + */ + cellPosition?: string; + + /**returns the type of the cell. + */ + cellType?: string; + + /**returns the serialized data of the header cells. + */ + rowData?: string; + + /**returns the unique name of levels/members. + */ + uniqueName?: string; +} + +export interface SummaryCellHyperlinkClickEventArgs { + + /**returns the original event args. + */ + args?: any; + + /**returns the cell position (row index and column index) in table. + */ + cellPosition?: string; + + /**returns the type of the cell. + */ + cellType?: string; + + /**returns the serialized data of the header cells. + */ + rowData?: string; + + /**returns the unique name of levels/members. + */ + uniqueName?: string; +} + +export interface ValueCellHyperlinkClickEventArgs { + + /**returns the original event args. + */ + args?: any; + + /**returns the cell position (row index and column index) in table. + */ + cellPosition?: string; + + /**returns the type of the cell. + */ + cellType?: string; + + /**returns the serialized data of the header cells. + */ + rowData?: string; + + /**returns the unique name of levels/members. + */ + uniqueName?: string; +} + +export interface DataSourceValues { + + /**This holds the measures unique names to bind the measures from Cube. + * @Default {[]} + */ + measures?: Array; + + /**To set the axis name in-order to place the measures. + * @Default {“”} + */ + axis?: string; +} + +export interface DataSource { + + /**Contains the database name as string type to fetch the data from the given connection string. + * @Default {“”} + */ + catalog?: string; + + /**Lists out the items to be arranged in column section of PivotGrid. + * @Default {[]} + */ + columns?: Array; + + /**Contains the respective Cube name as string type. + * @Default {“”} + */ + cube?: string; + + /**Provides the raw data source for the PivotGrid. + * @Default {null} + */ + data?: any; + + /**Lists out the items to be arranged in row section of PivotGrid. + * @Default {[]} + */ + rows?: Array; + + /**Lists out the items which supports calculation in PivotGrid. + * @Default {[]} + */ + values?: Array; + + /**Lists out the items which supports filtering of values in PivotGrid. + * @Default {[]} + */ + filters?: Array; +} + +export interface HyperlinkSettings { + + /**Allows the user to enable/disable hyperlink for column header. + * @Default {false} + */ + enableColumnHeaderHyperlink?: boolean; + + /**Allows the user to enable/disable hyperlink for row header. + * @Default {false} + */ + enableRowHeaderHyperlink?: boolean; + + /**Allows the user to enable/disable hyperlink for summary cells. + * @Default {false} + */ + enableSummaryCellHyperlink?: boolean; + + /**Allows the user to enable/disable hyperlink for value cells. + * @Default {false} + */ + enableValueCellHyperlink?: boolean; +} + +export interface ServiceMethodSettings { + + /**Allows the user to set the custom name for the service method that's responsible for drill up/down operation in PivotGrid. + * @Default {DrillGrid} + */ + drillDown?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for exporting. + * @Default {Export} + */ + exportPivotGrid?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for performing server-side actions on defer update. + * @Default {DeferUpdate} + */ + deferUpdate?: string; + + /**Allows the user to set the custom name for the service method that’s responsible to getting the values for the tree-view inside filter dialog. + * @Default {FetchMembers} + */ + fetchMembers?: string; + + /**Allows the user to set the custom name for the service method that's responsible for filtering operation in PivotGrid. + * @Default {Filtering} + */ + filtering?: string; + + /**Allows the user to set the custom name for the service method that's responsible for initializing PivotGrid. + * @Default {InitializeGrid} + */ + initialize?: string; + + /**Allows the user to set the custom name for the service method that's responsible for the server-side action, on dropping a node into Field List. + * @Default {NodeDropped} + */ + nodeDropped?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for the server-side action on changing the checked state of a node in Field List. + * @Default {NodeStateModified} + */ + nodeStateModified?: string; + + /**Allows the user to set the custom name for the service method that's responsible for performing paging operation in PivotGrid. + * @Default {Paging} + */ + paging?: string; + + /**Allows the user to set the custom name for the service method that's responsible for sorting operation in PivotGrid. + * @Default {Sorting} + */ + sorting?: string; +} + +enum Layout{ + + ///To set normal summary layout in PivotGrid. + Normal, + + ///To set layout with summaries at the top in PivotGrid. + NormalTopSummary, + + ///To set layout without summaries in PivotGrid. + NoSummaries, + + ///To set excel-like layout in PivotGrid. + ExcelLikeLayout +} + +} + +class PivotSchemaDesigner extends ej.Widget { + static fn: PivotSchemaDesigner; + constructor(element: JQuery, options?: PivotSchemaDesigner.Model); + constructor(element: Element, options?: PivotSchemaDesigner.Model); + model:PivotSchemaDesigner.Model; + defaults:PivotSchemaDesigner.Model; + + /** Perform an asynchronous HTTP (AJAX) request. + * @returns {void} + */ + doAjaxPost(): void; +} +export module PivotSchemaDesigner{ + +export interface Model { + + /**Specifies the CSS class to PivotSchemaDesigner to achieve custom theme. + * @Default {“”} + */ + cssClass?: string; + + /**Object utilized to pass additional information between client-end and service-end. + * @Default {{}} + */ + customObject?: any; + + /**For ASP.NET and MVC Wrapper, Pivots Schema Designer will be initialized and rendered empty initially. Once PivotGrid widget is rendered completely, Pivots Schema Designer will just be populated with data source by setting this property to “true”. + * @Default {false} + */ + enableWrapper?: boolean; + + /**Allows the user to set the list of filters in filter section. + * @Default {newArray()} + */ + filters?: Array; + + /**Sets the height for PivotSchemaDesigner. + * @Default {“”} + */ + height?: string; + + /**Allows the user to set the localized language for the widget. + * @Default {en-US} + */ + locale?: string; + + /**Allows the user to set list of PivotCalculations in values section. + * @Default {newArray()} + */ + pivotCalculations?: Array; + + /**Allows the user to set the list of PivotItems in column section. + * @Default {newArray()} + */ + pivotColumns?: Array; + + /**Sets the Pivot control bound with this PivotSchemaDesigner. + * @Default {null} + */ + pivotControl?: any; + + /**Allows the user to set the list of PivotItems in row section. + * @Default {newArray()} + */ + pivotRows?: Array; + + /**Allows the user to arrange the fields inside Field List of PivotSchemaDesigner. + * @Default {newArray()} + */ + pivotTableFields?: Array; + + /**Allows the user to set custom name for the methods at service-end, communicated during AJAX post. + * @Default {{}} + */ + serviceMethod?: ServiceMethod; + + /**Connects the service using the specified URL for any server updates. + * @Default {“”} + */ + url?: string; + + /**Sets the width for PivotSchemaDesigner. + * @Default {“”} + */ + width?: string; + + /**Triggers when it reaches client-side after any AJAX request.*/ + afterServiceInvoke? (e: AfterServiceInvokeEventArgs): void; + + /**Triggers before any AJAX request is passed from PivotSchemaDesigner to service methods.*/ + beforeServiceInvoke? (e: BeforeServiceInvokeEventArgs): void; +} + +export interface AfterServiceInvokeEventArgs { + + /**return the current action of PivotSchemaDesigner control. + */ + action?: string; + + /**return the custom object bounds with PivotSchemaDesigner control. + */ + customObject?: any; + + /**return the outer HTML of PivotSchemaDesigner control. + */ + element?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the PivotSchemaDesigner model + */ + model?: ej.PivotSchemaDesigner.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface BeforeServiceInvokeEventArgs { + + /**return the current action of PivotSchemaDesigner control. + */ + action?: string; + + /**return the custom object bounds with PivotSchemaDesigner control. + */ + customObject?: any; + + /**return the outer HTML of PivotSchemaDesigner control. + */ + element?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the PivotSchemaDesigner model + */ + model?: ej.PivotSchemaDesigner.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface ServiceMethod { + + /**Allows the user to set the custom name for the service method that’s responsible for getting the values for the tree-view inside filter dialog. + * @Default {FetchMembers} + */ + fetchMembers?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for filtering operation in Field List. + * @Default {Filtering} + */ + filtering?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for the server-side action, on expanding members in Field List. + * @Default {MemberExpanded} + */ + memberExpand?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for the server-side action, on dropping a node into Field List. + * @Default {NodeDropped} + */ + nodeDropped?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for the server-side action on changing the checked state of a node in Field List. + * @Default {NodeStateModified} + */ + nodeStateModified?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for remove operation in Field List. + * @Default {RemoveButton} + */ + removeButton?: string; +} +} + +class PivotPager extends ej.Widget { + static fn: PivotPager; + constructor(element: JQuery, options?: PivotPager.Model); + constructor(element: Element, options?: PivotPager.Model); + model:PivotPager.Model; + defaults:PivotPager.Model; + + /** This function initializes the page counts and page numbers for the PivotPager. + * @returns {void} + */ + initPagerProperties(): void; +} +export module PivotPager{ + +export interface Model { + + /**Contains the current page number in categorical axis. + * @Default {1} + */ + categoricalCurrentPage?: number; + + /**Contains the total page count in categorical axis. + * @Default {1} + */ + categoricalPageCount?: number; + + /**Allows the user to set the localized language for the widget. + * @Default {en-US} + */ + locale?: string; + + /**Sets the pager mode (Only Categorical Pager/Only Series Pager/Both) for the PivotPager. + * @Default {ej.PivotPager.Mode.Both} + */ + mode?: ej.PivotPager.Mode|string; + + /**Contains the current page number in series axis. + * @Default {1} + */ + seriesCurrentPage?: number; + + /**Contains the total page count in series axis. + * @Default {1} + */ + seriesPageCount?: number; + + /**Contains the ID of the target element for which paging needs to be done. + * @Default {“”} + */ + targetControlID?: string; +} + +enum Mode{ + + ///To set both categorical and series pager for paging. + Both, + + ///To set only categorical pager for paging. + Categorical, + + ///To set only series pager for paging. + Series +} + +} + +class Schedule extends ej.Widget { + static fn: Schedule; + constructor(element: JQuery, options?: Schedule.Model); + constructor(element: Element, options?: Schedule.Model); + model:Schedule.Model; + defaults:Schedule.Model; + + /** This method is used to delete the appointment based on the guid value or the appointment data passed to it. + * @param {string|any} GUID value of an appointment element or an appointment object + * @returns {void} + */ + deleteAppointment(data: string|any): void; + + /** Destroys the Schedule widget. All the events bound using this._on are unbound automatically and the control is moved to pre-init state. + * @returns {void} + */ + destroy(): void; + + /** Exports the appointments from the Schedule control. + * @param {string} It refers the controller action name to redirect. (For MVC) + * @param {string} It refers the server event name.(For ASP) + * @param {string|number} Pass the id of an appointment, in case if a single appointment needs to be exported. Otherwise, it takes the null value. + * @returns {void} + */ + exportSchedule(action: string, serverEvent: string, id: string|number): void; + + /** Searches the appointments from appointment list of Schedule control. + * @param {Array} Holds array of one or more conditional objects for filtering the appointments based on it. + * @returns {void} + */ + filterAppointments(filterConditions: Array): void; + + /** Gets the appointment list of Schedule control. + * @returns {void} + */ + getAppointments(): void; + + /** Prints the Scheduler. + * @returns {void} + */ + print(): void; + + /** Refreshes the Scroller within Scheduler while using it with some other controls or application. + * @returns {void} + */ + refreshScroller(): void; + + /** It is used to save the appointment. The appointment obj is based on the argument passed along with this method. + * @param {any} appointment object which includes appointment details + * @returns {void} + */ + saveAppointment(appointmentObject: any): void; + + /** Retrieves the time slot information (start/end time and resource details) of the given element. The parameter is optional - as when no element is passed to it, the currently selected cell information will be retrieved. When multiple cells are selected in the Scheduler, it is not necessary to provide the parameter. + * @param {any} TD element object rendered as Scheduler work cell + * @returns {void} + */ + getSlotByElement(element: any): void; + + /** Searches the appointments from the appointment list of Schedule control. + * @param {any|string} Defines the search word or the filter condition, based on which the appointments are filtered from the list. + * @param {string} Defines the field name on which the search is to be made. + * @param {string|string} Defines the filterOperator value for the search operation. + * @param {boolean} Defines the ignoreCase value for performing the search operation. + * @returns {void} + */ + searchAppointments(searchString: any|string, field: string, operator: string|string, ignoreCase: boolean): void; + + /** To refresh the Schedule control. + * @returns {void} + */ + refresh(): void; + + /** Refreshes only the appointments within the Schedule control. + * @returns {void} + */ + refreshAppointment(): void; +} +export module Schedule{ + +export interface Model { + + /**When set to true, Schedule allows the appointments to be dragged and dropped at required time. + * @Default {true} + */ + allowDragAndDrop?: boolean; + + /**When set to true, Scheduler allows interaction through keyboard shortcut keys. + * @Default {true} + */ + allowKeyboardNavigation?: boolean; + + /**It includes the dataSource option and the fields related to Schedule appointments. The appointment fields within the appointmentSettings can accept both string and object type values. To apply validation rules on the appointment window fields, then the appointment fields needs to be defined with object type values. + */ + appointmentSettings?: AppointmentSettings; + + /**Default Value + * @Default {null} + */ + appointmentTemplateId?: string; + + /**Default Value + */ + cssClass?: string; + + /**Sets various categorize colors to the Schedule appointments to differentiate it. + */ + categorizeSettings?: CategorizeSettings; + + /**Sets the height for Schedule cells. + * @Default {20px} + */ + cellHeight?: string; + + /**Sets the width for Schedule cells. + */ + cellWidth?: string; + + /**Holds all options related to the context menu settings of the Schedule. + */ + contextMenuSettings?: ContextMenuSettings; + + /**Sets current date of the Schedule. The Schedule displays initially with the date that is provided here. + * @Default {new Date()} + */ + currentDate?: any; + + /**Sets current view of the Schedule. Schedule renders initially with the view that is specified here. The available views are day, week, workweek, month, agenda and custom view - from which any one of the required view can be set to the Schedule. It accepts both string or enum values. The enum values that are accepted by currentView(ej.Schedule.CurrentView) are as follows, + * @Default {ej.Schedule.CurrentView.Week} + */ + currentView?: string|ej.Schedule.CurrentView; + + /**Sets the date format for Schedule. + */ + dateFormat?: string; + + /**When set to true, shows the previous/next appointment navigator button on the Scheduler. + * @Default {true} + */ + showAppointmentNavigator?: boolean; + + /**When set to true, enables the resize behavior of appointments within the Schedule. + * @Default {true} + */ + enableAppointmentResize?: boolean; + + /**When set to true, enables the loading of Schedule appointments based on your demand. With this load on demand concept, the data consumption of the Schedule can be limited. + * @Default {false} + */ + enableLoadOnDemand?: boolean; + + /**Saves the current model value to browser cookies for state maintenance. When the page gets refreshed, Schedule control values are retained. + * @Default {false} + */ + enablePersistence?: boolean; + + /**When set to true, the Schedule layout and behavior changes as per the common RTL conventions. + * @Default {false} + */ + enableRTL?: boolean; + + /**Sets the end hour time limit to be displayed on the Schedule. + * @Default {24} + */ + endHour?: number; + + /**To configure resource grouping on the Schedule. + */ + group?: Group; + + /**Sets the height of the Schedule. Accepts both pixel and percentage values. + * @Default {1120px} + */ + height?: string; + + /**To define the work hours within the Schedule control. + */ + workHours?: WorkHours; + + /**When set to true, enables the Schedule to observe Daylight Saving Time for supported timezones. + * @Default {false} + */ + isDST?: boolean; + + /**When set to true, adapts the Schedule layout to fit the screen size of devices on which it renders. + * @Default {true} + */ + isResponsive?: boolean; + + /**Sets the specific culture to the Schedule. + * @Default {en-US} + */ + locale?: string; + + /**Sets the maximum date limit to display on the Schedule. Setting maxDate with specific date value disallows the Schedule to navigate beyond that date. + * @Default {new Date(2099, 12, 31)} + */ + maxDate?: any; + + /**Sets the minimum date limit to display on the Schedule. Setting minDate with specific date value disallows the Schedule to navigate beyond that date. + * @Default {new Date(1900, 01, 01)} + */ + minDate?: any; + + /**Sets the mode of Schedule rendering either in a vertical or horizontal direction. It accepts either string("vertical" or "horizontal") or enum values. The enum values that are accepted by orientation(ej.Schedule.Orientation) are as follows, + * @Default {ej.Schedule.Orientation.Vertical} + */ + orientation?: string|ej.Schedule.Orientation; + + /**Holds all the options related to priority settings of the Schedule. + */ + prioritySettings?: PrioritySettings; + + /**When set to true, disables the interaction with the Schedule appointments, simply allowing the date and view navigation to occur. + * @Default {false} + */ + readOnly?: boolean; + + /**Holds all the options related to reminder settings of the Schedule. + */ + reminderSettings?: ReminderSettings; + + /**Defines the specific start and end dates to be rendered in the Schedule control. To render such user-specified custom date ranges in the Schedule control, set the currentView property to customview. + * @Default {null} + */ + renderDates?: RenderDates; + + /**Template design that applies on the Schedule resource header. + * @Default {null} + */ + resourceHeaderTemplateId?: string; + + /**Holds all the options related to the resources settings of the Schedule. It is a collection of one or more resource objects, where the levels of resources are rendered on the Schedule based on the order of the resource data provided within this collection. + * @Default {null} + */ + resources?: Array; + + /**When set to true, displays the all-day row cells on the Schedule. + * @Default {true} + */ + showAllDayRow?: boolean; + + /**When set to true, displays the current time indicator on the Schedule. + * @Default {true} + */ + showCurrentTimeIndicator?: boolean; + + /**When set to true, displays the header bar on the Schedule. + * @Default {true} + */ + showHeaderBar?: boolean; + + /**When set to true, displays the location field additionally on Schedule appointment window. + * @Default {false} + */ + showLocationField?: boolean; + + /**When set to true, displays the quick window for every single click made on the Schedule cells or appointments. + * @Default {true} + */ + showQuickWindow?: boolean; + + /**When set to true, displays the timescale on the left side of the Schedule. + * @Default {true} + */ + showTimeScale?: boolean; + + /**Sets the start hour time range to be displayed on the Schedule. + * @Default {0} + */ + startHour?: number; + + /**Sets either 12 or 24 hour time mode on the Schedule. It accepts either the string value("12" or "24") or the below mentioned enum values. The enum values that are accepted by timeMode(ej.Schedule.TimeMode) are as follows, + * @Default {null} + */ + timeMode?: string|ej.Schedule.TimeMode; + + /**Sets the timezone for the Schedule. + * @Default {null} + */ + timeZone?: string; + + /**Sets the collection of timezone items to be bound to the Schedule. Only the items bound to this property gets listed out in the timezone field of the appointment window. + */ + timeZoneCollection?: TimeZoneCollection; + + /**Defines the view collection to be displayed on the Schedule. By default, it displays all the views namely, Day, Week, WorkWeek and Month. + * @Default {[Day, Week, WorkWeek, Month, Agenda]} + */ + views?: Array; + + /**Sets the width of the Schedule. Accepts both pixel and percentage values. + * @Default {100%} + */ + width?: string; + + /**When set to true, Schedule allows the validation of recurrence pattern to take place before it is being assigned to the appointments. For example, when one of the instance of recurrence appointment is dragged beyond the next or previous instance of the same recurrence appointment, a pop-up is displayed with the validation message disallowing the drag functionality. + * @Default {true} + */ + enableRecurrenceValidation?: boolean; + + /**Sets the week to display more than one week appointment summary. + */ + agendaViewSettings?: AgendaViewSettings; + + /**You can change or set the starting day of the week. + * @Default {null} + */ + firstDayOfWeek?: string; + + /**You can set the workWeek days of the workWeek. + * @Default {[Monday, Tuesday, Wednesday, Thursday, Friday]} + */ + workWeek?: Array; + + /**The tooltip allows to display appointment details in a tooltip while hovering on it. + */ + tooltipSettings?: TooltipSettings; + + /**Holds all the options related to the time scale of Scheduler. The timeslots either major or minor slots can be customized with this property. + */ + timeScale?: TimeScale; + + /**When set to true, shows the delete confirmation dialog before deleting an appointment. + * @Default {true} + */ + showDeleteConfirmationDialog?: boolean; + + /**Accepts the id value of the template layout defined for the all-day cells. + * @Default {null} + */ + allDayCellsTemplateId?: string; + + /**Accepts the id value of the template layout defined for the work cells and month cells. + * @Default {null} + */ + workCellsTemplateId?: string; + + /**Accepts the id value of the template layout defined for the date header cells. + * @Default {null} + */ + dateHeaderTemplateId?: string; + + /**when set to false, allows the height of the work-cells to adjust automatically based on the number of appointment count it has. + * @Default {true} + */ + showOverflowButton?: boolean; + + /**Allows setting draggable area for the Scheduler appointments. Also, turns on the external drag and drop, when set with some specific external drag area name. + */ + appointmentDragArea?: string; + + /**When set to true, displays the other months days from the current month on the Schedule. + * @Default {true} + */ + showNextPrevMonth?: boolean; + + /**Triggers before the action begin of the Schedule.*/ + actionBegin? (e: ActionBeginEventArgs): void; + + /**Triggers after the completion of action in the Schedule.*/ + actionComplete? (e: ActionCompleteEventArgs): void; + + /**Triggers after the appointment is clicked.*/ + appointmentClick? (e: AppointmentClickEventArgs): void; + + /**Triggers before the appointment is being removed from the Scheduler.*/ + beforeAppointmentRemove? (e: BeforeAppointmentRemoveEventArgs): void; + + /**Triggers before the edited appointment is being saved.*/ + beforeAppointmentChange? (e: BeforeAppointmentChangeEventArgs): void; + + /**Triggers after the appointment is hovered.*/ + appointmentHover? (e: AppointmentHoverEventArgs): void; + + /**Triggers before the appointment gets saved.*/ + beforeAppointmentCreate? (e: BeforeAppointmentCreateEventArgs): void; + + /**Triggers before the appointment window opens.*/ + appointmentWindowOpen? (e: AppointmentWindowOpenEventArgs): void; + + /**Triggers before the context menu opens.*/ + beforeContextMenuOpen? (e: BeforeContextMenuOpenEventArgs): void; + + /**Triggers after the cell is clicked.*/ + cellClick? (e: CellClickEventArgs): void; + + /**Triggers after the cell is clicked twice.*/ + cellDoubleClick? (e: CellDoubleClickEventArgs): void; + + /**Triggers after the cell is hovered.*/ + cellHover? (e: CellHoverEventArgs): void; + + /**Triggers while the appointment is being dragged over the work cells.*/ + drag? (e: DragEventArgs): void; + + /**Triggers when the appointment dragging begins.*/ + dragStart? (e: DragStartEventArgs): void; + + /**Triggers when the appointment is dropped.*/ + dragStop? (e: DragStopEventArgs): void; + + /**Triggers after the context menu is clicked.*/ + menuItemClick? (e: MenuItemClickEventArgs): void; + + /**Triggers after the Schedule view or date is navigated.*/ + navigation? (e: NavigationEventArgs): void; + + /**Triggers every time before the elements of the scheduler such as work cells, time cells or header cells and so on renders or re-renders on a page.*/ + queryCellInfo? (e: QueryCellInfoEventArgs): void; + + /**Triggers when the reminder is raised for an appointment.*/ + reminder? (e: ReminderEventArgs): void; + + /**Triggers while resizing the appointment.*/ + resize? (e: ResizeEventArgs): void; + + /**Triggers when the appointment resizing begins.*/ + resizeStart? (e: ResizeStartEventArgs): void; + + /**Triggers when appointment resizing stops.*/ + resizeStop? (e: ResizeStopEventArgs): void; + + /**Triggers when the overflow button is clicked.*/ + overflowButtonClick? (e: OverflowButtonClickEventArgs): void; + + /**Triggers while mouse hovering on the overflow button.*/ + overflowButtonHover? (e: OverflowButtonHoverEventArgs): void; + + /**Triggers when any of the keyboard keys are pressed.*/ + keyDown? (e: KeyDownEventArgs): void; + + /**Triggers after the appointment is saved.*/ + appointmentCreated? (e: AppointmentCreatedEventArgs): void; + + /**Triggers after the appointment is edited.*/ + appointmentChanged? (e: AppointmentChangedEventArgs): void; + + /**Triggers after the appointment is deleted.*/ + appointmentRemoved? (e: AppointmentRemovedEventArgs): void; +} + +export interface ActionBeginEventArgs { + + /**Returns the current date value. + */ + currentDate?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the current view value. + */ + currentView?: string; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the action begin request type. + */ + requestType?: string; + + /**Returns the target of the click. + */ + target?: any; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the save appointment value. + */ + data?: any; + + /**Returns the id of delete appointment. + */ + id?: number; +} + +export interface ActionCompleteEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the data about view change action. + */ + data?: any; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the action complete request type. + */ + requestType?: string; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the appointment data dropped. + */ + appointment?: any; +} + +export interface AppointmentClickEventArgs { + + /**Returns the object of appointmentClick event. + */ + object?: any; + + /**Returns the clicked appointment object. + */ + appointment?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface BeforeAppointmentRemoveEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the deleted appointment object. + */ + appointment?: any; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the name of the Scheduler event. + */ + type?: string; +} + +export interface BeforeAppointmentChangeEventArgs { + + /**Returns the edited appointment object. + */ + appointment?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the name of the Scheduler event. + */ + type?: string; +} + +export interface AppointmentHoverEventArgs { + + /**Returns the object of appointmentHover event. + */ + object?: any; + + /**Returns the hovered appointment object. + */ + appointment?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface BeforeAppointmentCreateEventArgs { + + /**Returns the appointment object. + */ + appointment?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the name of the Scheduler event. + */ + type?: string; +} + +export interface AppointmentWindowOpenEventArgs { + + /**returns the object of appointmentWindowOpen event while selecting the detail option from quick window or edit appointment or edit series option. + */ + object?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the end time of the double clicked cell. + */ + endTime?: any; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the action name that triggers window open. + */ + originalEventType?: string; + + /**Returns the start time of the double clicked cell. + */ + startTime?: any; + + /**Returns the target of the double clicked cell. + */ + target?: any; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the edit appointment object. + */ + appointment?: any; + + /**Returns the edit occurrence option value. + */ + edit?: boolean; +} + +export interface BeforeContextMenuOpenEventArgs { + + /**Returns the object of beforeContextMenuOpen event. + */ + object?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the current cell index value. + */ + cellIndex?: number; + + /**Returns the current date value. + */ + currentDate?: any; + + /**Returns the current resource details, when multiple resources are present, otherwise returns null. + */ + resources?: any; + + /**Returns the current appointment details while opening the menu from appointment. + */ + appointment?: any; + + /**Returns the object of before opening menu target. + */ + events?: any; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface CellClickEventArgs { + + /**Returns the object of cellClick event. + */ + object?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the end time of the clicked cell. + */ + endTime?: any; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the start time of the clicked cell. + */ + startTime?: any; + + /**Returns the target of the clicked cell. + */ + target?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface CellDoubleClickEventArgs { + + /**Returns the object of cellDoubleClick event. + */ + object?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the end time of the double clicked cell. + */ + endTime?: any; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the start time of the double clicked cell. + */ + startTime?: any; + + /**Returns the target of the double clicked cell. + */ + target?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface CellHoverEventArgs { + + /**Returns the object of cellHover event. + */ + object?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the index of the hovered cell. + */ + cellIndex?: any; + + /**Returns the current date of the hovered cell. + */ + currentDate?: any; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the target of the clicked cell. + */ + target?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface DragEventArgs { + + /**Returns the object of dragOver event. + */ + object?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the target of the drag over appointment. + */ + target?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface DragStartEventArgs { + + /**Returns the object of dragStart event. + */ + object?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the target of the dragging appointment. + */ + target?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface DragStopEventArgs { + + /**Returns the object of dragDrop event. + */ + object?: any; + + /**Returns the dropped appointment object. + */ + appointment?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface MenuItemClickEventArgs { + + /**Returns the object of menuItemClick event. + */ + object?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the object of menu item event. + */ + events?: any; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface NavigationEventArgs { + + /**Returns the current date object. + */ + currentDate?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the current view value. + */ + currentView?: string; + + /**Returns the previous view value. + */ + previousView?: string; + + /**Returns the target of the action. + */ + target?: any; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the previous date of the Schedule. + */ + previousDate?: any; +} + +export interface QueryCellInfoEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the current appontment data. + */ + appointment?: any; + + /**Returns the currently rendering DOM element. + */ + element?: any; + + /**Returns the name of the currently rendering element on the scheduler. + */ + requestType?: string; + + /**Returns the cell type which is currently rendering on the Scheduler. + */ + cellType?: string; + + /**Returns the start date of the currently rendering appointment. + */ + currentAppointmentDate?: any; + + /**Returns the currently rendering cell information. + */ + cell?: any; + + /**Returns the currently rendering resource details. + */ + resource?: any; + + /**Returns the currently rendering date information. + */ + currentDay?: any; +} + +export interface ReminderEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the appointment object for which the reminder is raised. + */ + reminderAppointment?: any; +} + +export interface ResizeEventArgs { + + /**Returns the object of resizing event. + */ + object?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the resize element value. + */ + element?: any; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface ResizeStartEventArgs { + + /**Returns the object of resizeStart event. + */ + object?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the resize element value. + */ + element?: any; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface ResizeStopEventArgs { + + /**Returns the object of resizeStop event. + */ + object?: any; + + /**Returns the resized appointment value. + */ + appointment?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the target of the resized appointment. + */ + target?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface OverflowButtonClickEventArgs { + + /**Returns the object consisting of starttime, endtime and resource value of the underlying cell on which the clicked overflow button is present. + */ + object?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the object of menu item event. + */ + events?: any; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface OverflowButtonHoverEventArgs { + + /**Returns the object consisting of starttime, endtime and resource value of the underlying cell on which the overflow button is currently hovered. + */ + object?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the object of menu item event. + */ + events?: any; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface KeyDownEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the object of menu item event. + */ + events?: any; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface AppointmentCreatedEventArgs { + + /**Returns the appointment object. + */ + appointment?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the name of the Scheduler event. + */ + type?: string; +} + +export interface AppointmentChangedEventArgs { + + /**Returns the edited appointment object. + */ + appointment?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the name of the Scheduler event. + */ + type?: string; +} + +export interface AppointmentRemovedEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the deleted appointment object. + */ + appointment?: any; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the name of the Scheduler event. + */ + type?: string; +} + +export interface AppointmentSettings { + + /**Default Value + * @Default {Array} + */ + dataSource?: any|Array; + + /**Default Value + * @Default {null} + */ + query?: string; + + /**Default Value + * @Default {null} + */ + tableName?: string; + + /**Binds the id field name in dataSource to the id of Schedule appointments. It denotes the unique id assigned to appointments. + */ + id?: string; + + /**Binds the name of startTime field in the dataSource with start time of the Schedule appointments. It indicates the date and Time when Schedule appointment actually starts. + */ + startTime?: string; + + /**Binds the name of endTime field in dataSource with the end time of Schedule appointments. It indicates the date and time when Schedule appointment actually ends. + */ + endTime?: string; + + /**Binds the name of subject field in the dataSource to appointment Subject. Indicates the Subject or title that gets displayed on Schedule appointments. + */ + subject?: string; + + /**Binds the description field name in dataSource. It indicates the appointment description. + */ + description?: string; + + /**Binds the name of recurrence field in dataSource. It indicates whether the appointment is a recurrence appointment or not. + */ + recurrence?: string; + + /**Binds the name of recurrenceRule field in dataSource. It indicates the recurrence pattern associated with appointments. + */ + recurrenceRule?: string; + + /**Binds the name of allDay field in dataSource. It indicates whether the appointment is an allday appointment or not. + * @Default {AllDay} + */ + allDay?: string; + + /**Default Value + * @Default {null} + */ + resourceFields?: string; + + /**Default Value + * @Default {null} + */ + categorize?: string; + + /**Default Value + * @Default {null} + */ + location?: string; + + /**Default Value + * @Default {null} + */ + priority?: string; + + /**Default Value + * @Default {StartTimeZone} + */ + startTimeZone?: string; + + /**Default Value + * @Default {EndTimeZone} + */ + endTimeZone?: string; +} + +export interface CategorizeSettings { + + /**Default Value + * @Default {false} + */ + allowMultiple?: boolean; + + /**Default Value + * @Default {false} + */ + enable?: boolean; + + /**Default Value + * @Default {Array} + */ + dataSource?: Array|any; + + /**Binds id field name in the dataSource to id of category data. + * @Default {id} + */ + id?: string; + + /**Binds text field name in the dataSource to category text. + * @Default {text} + */ + text?: string; + + /**Binds color field name in the dataSource to category color. + * @Default {color} + */ + color?: string; + + /**Binds fontColor field name in the dataSource to category font. + * @Default {fontColor} + */ + fontColor?: string; +} + +export interface ContextMenuSettings { + + /**When set to true, enables the context menu options available for the Schedule cells and appointments. + * @Default {false} + */ + enable?: boolean; + + /**Contains all the default context menu options that are applicable for both Schedule cells and appointments. It also supports adding custom menu items to cells or appointment collection. + * @Default {[]} + */ + menuItems?: any; +} + +export interface Group { + + /**Holds the array of resource names to be grouped on the Schedule. + */ + resources?: any; +} + +export interface WorkHours { + + /**When set to true, highlights the work hours of the Schedule. + * @Default {true} + */ + highlight?: boolean; + + /**Sets the start time to depict the start of working or business hour in a day. + * @Default {null} + */ + start?: number; + + /**Sets the end time to depict the end of working or business hour in a day. + * @Default {null} + */ + end?: number; +} + +export interface PrioritySettings { + + /**When set to true, enables the priority options available for the Schedule appointments. + * @Default {false} + */ + enable?: boolean; + + /**The dataSource option can accept the JSON object collection that contains the priority related data. + * @Default {Array} + */ + dataSource?: any|Array; + + /**Binds text field name in the dataSource to prioritySettings text. These text gets listed out in priority field of the appointment window. + * @Default {text} + */ + text?: string; + + /**Binds value field name in the dataSource to prioritySettings value. These field names usually accepts four priority values by default, high, low, medium and none. + * @Default {value} + */ + value?: string; + + /**Allows priority field customization in the appointment window to add custom icons denoting the priority level for the appointments. + * @Default {null} + */ + template?: string; +} + +export interface ReminderSettings { + + /**When set to true, enables the reminder option available for the Schedule appointments. + * @Default {false} + */ + enable?: boolean; + + /**Sets the timing, when the reminders are to be alerted for the Schedule appointments. + * @Default {5} + */ + alertBefore?: number; +} + +export interface RenderDates { + + /**Sets the start of custom date range to be rendered in the Schedule. + * @Default {null} + */ + start?: any; + + /**Sets the end limit of the custom date range. + * @Default {null} + */ + end?: any; +} + +export interface ResourcesResourceSettings { + + /**The dataSource option accepts either JSON object collection or DataManager (ej.DataManager) instance that contains the resources related data. + */ + dataSource?: any|Array; + + /**Binds text field name in the dataSource to resourceSettings text. These text gets listed out in resources field of the appointment window. + */ + text?: string; + + /**Binds id field name in the dataSource to resourceSettings id. + */ + id?: string; + + /**Binds groupId field name in the dataSource to resourceSettings groupId. + */ + groupId?: string; + + /**Binds color field name in the dataSource to resourceSettings color. The color specified here gets applied to the Schedule appointments denoting to the resource it belongs. + */ + color?: string; + + /**Binds the starting work hour field name in the dataSource. It's optional, but when provided with some numeric value will set the starting work hour for specific resources. + */ + start?: string; + + /**Binds the end work hour field name in the dataSource. It's optional, but when provided with some numeric value will set the end work hour for specific resources. + */ + end?: string; + + /**Binds the resources working days field name in the dataSource. It's optional, and accepts the array of strings (week day names). When provided with some values (array of day names), only those days will render for the specific resources. + */ + workWeek?: string; + + /**Binds appointmentClass field name in the dataSource. It applies custom CSS class name to appointments depicting to the resource it belongs. + */ + appointmentClass?: string; +} + +export interface Resources { + + /**It holds the name of the resource field to be bound to the Schedule appointments that contains the resource Id. + * @Default {[]} + */ + field?: string; + + /**It holds the title name of the resource field to be displayed on the Schedule appointment window. + * @Default {[]} + */ + title?: string; + + /**A unique resource name that is used for differentiating various resource objects while grouping it in various levels. + * @Default {[]} + */ + name?: string; + + /**When set to true, allows multiple selection of resource names, thus creating multiple instances of same appointment for the selected resources. + * @Default {[]} + */ + allowMultiple?: string; + + /**It holds the field names of the resources to be bound to the Schedule and also the dataSource. + */ + resourceSettings?: ResourcesResourceSettings; +} + +export interface TimeZoneCollection { + + /**Sets the collection of timezone items to the dataSource that accepts either JSON object collection or DataManager (ej.DataManager) instance that contains Schedule timezones. + */ + dataSource?: any; + + /**Binds text field name in the dataSource to timeZoneCollection text. These text gets listed out in the timezone fields of the appointment window. + */ + text?: string; + + /**Binds id field name in the dataSource to timeZoneCollection id. + */ + id?: string; + + /**Binds value field name in the dataSource to timeZoneCollection value. + */ + value?: string; +} + +export interface AgendaViewSettings { + + /**You can display the summary of multiple week's appointment by setting this value. + * @Default {7} + */ + daysInAgenda?: number; + + /**You can customize the Date column display based on the requirement. + * @Default {null} + */ + dateColumnTemplateId?: string; + + /**You can customize the time column display based on the requirement. + * @Default {null} + */ + timeColumnTemplateId?: string; +} + +export interface TooltipSettings { + + /**To enable or disable the tooltip display. + * @Default {false} + */ + enable?: boolean; + + /**To customize the tooltip display based on your requirements. + * @Default {null} + */ + templateId?: string; +} + +export interface TimeScale { + + /**When set to true, displays the timescale on the Scheduler. + * @Default {null} + */ + enable?: boolean; + + /**When set with some specific value, defines the number of time divisions split per hour(as per value given for the majorTimeSlot). Those time divisions are meant to be the minor slots. + * @Default {2} + */ + minorSlotCount?: number; + + /**Accepts the value in minutes. When provided with specific value, displays the appropriate time interval on the Scheduler + * @Default {60} + */ + majorSlot?: number; + + /**Accepts id value of the template defined for minor time slots + * @Default {null} + */ + minorSlotTemplateId?: string; + + /**Accepts id value of the template defined for major time slots. + * @Default {null} + */ + majorSlotTemplateId?: string; +} + +enum CurrentView{ + + ///Set currentView as Day to Scheduler + Day, + + ///Set currentView as Week to Scheduler + Week, + + ///Set currentView as Workweek to Scheduler + Workweek, + + ///Set currentView as Month to Scheduler + Month, + + ///Set currentView as Agenda to Scheduler + Agenda, + + ///Set currentView as CustomView to Scheduler + CustomView +} + + +enum Orientation{ + + ///Set orientation as vertical to Scheduler + Vertical, + + ///Set orientation as horizontal to Scheduler + Horizontal +} + + +enum TimeMode{ + + ///Set timeMode as 12 hours to Scheduler + Hour12, + + ///Set timeMode as 24 hours to Scheduler + Hour24 +} + +} + +class RecurrenceEditor extends ej.Widget { + static fn: RecurrenceEditor; + static Locale:any; + constructor(element: JQuery, options?: RecurrenceEditorOptions); + constructor(element: Element, options?: RecurrenceEditorOptions); + model:RecurrenceEditorOptions; + defaults:RecurrenceEditorOptions; + recurrenceDateGenerator(recurrenceString: string,strDate:Object): string; + closeRecurPublic(): string; + getRecurrenceRule(): void; + recurrenceRuleSplit(recurrenceRule: string, recurrenceExDate?: string): Object; + +} +interface RecurrenceEditorOptions { + frequencies?: Array; + firstDayOfWeek?: string; + name?: string; + enableSpinners?: boolean; + startDate?: Date; + locale?: string; + enableRTL?: boolean; + value?: string; + dateFormat?: string; + selectedRecurrenceType?: number; + enableRecurrenceValidation?: boolean; + minDate?: Date; + maxDate?: Date; + cssClass?: string; + change?(e: RecurrenceEditorChangeEvent): void; + create?(e: RecurrenceEditorBaseEvent): void; +} +interface RecurrenceEditorBaseEvent extends ej.BaseEvent { + model: RecurrenceEditorOptions; +} +interface RecurrenceEditorChangeEvent extends RecurrenceEditorBaseEvent { + requestType?: string; +} +class Gantt extends ej.Widget { + static fn: Gantt; + constructor(element: JQuery, options?: Gantt.Model); + constructor(element: Element, options?: Gantt.Model); + model:Gantt.Model; + defaults:Gantt.Model; + + /** To add item in gantt + * @param {any} Item to add in Gantt row. + * @param {string} Defines in which position the row wants to add + * @returns {void} + */ + addRecord(data: any, rowPosition: string): void; + + /** Positions the splitter by the specified column index. + * @param {number} Set the splitter position based on column index. + * @returns {void} + */ + setSplitterIndex(index: number): void; + + /** To cancel the edited state of an item in gantt + * @returns {void} + */ + cancelEdit(): void; + + /** To collapse all the parent items in gantt + * @returns {void} + */ + collapseAllItems(): void; + + /** To delete a selected item in gantt + * @returns {void} + */ + deleteItem(): void; + + /** destroy the gantt widget all events bound using this._on will be unbind automatically and bring the control to pre-init state. + * @returns {void} + */ + destroy(): void; + + /** To Expand all the parent items in gantt + * @returns {void} + */ + expandAllItems(): void; + + /** To expand and collapse an item in gantt using item's ID + * @param {number} Exapnd or Collapse a record based on task id. + * @returns {void} + */ + expandCollapseRecord(taskId: number): void; + + /** To hide the column by using header text + * @param {string} you can pass a header text of a column to hide + * @returns {void} + */ + hideColumn(headerText: string): void; + + /** To indent a selected item in gantt + * @returns {void} + */ + indentItem(): void; + + /** To Open the dialog to add new task to the gantt + * @returns {void} + */ + openAddDialog(): void; + + /** To Open the dialog to edit existing task to the gantt + * @returns {void} + */ + openEditDialog(): void; + + /** To outdent a selected item in gantt + * @returns {void} + */ + outdentItem(): void; + + /** To save the edited state of an item in gantt + * @returns {void} + */ + saveEdit(): void; + + /** To search an item with search string provided at the run time + * @param {string} you can pass a text to search in Gantt Control. + * @returns {void} + */ + searchItem(searchString: string): void; + + /** To set the grid width in gantt + * @param {string} you can give either percentage or pixels value + * @returns {void} + */ + setSplitterPosition(width: string): void; + + /** To show the column by using header text + * @param {string} you can pass a header text of a column to show + * @returns {void} + */ + showColumn(headerText: string): void; +} +export module Gantt{ + +export interface Model { + + /**Specifies the fields to be included in the add dialog in gantt + * @Default {[]} + */ + addDialogFields?: Array; + + /**Enables or disables the ability to resize column. + * @Default {false} + */ + allowColumnResize?: boolean; + + /**Enables or Disables gantt chart editing in gantt + * @Default {true} + */ + allowGanttChartEditing?: boolean; + + /**Enables or Disables Keyboard navigation in gantt + * @Default {true} + */ + allowKeyboardNavigation?: boolean; + + /**Specifies enabling or disabling multiple sorting for Gantt columns + * @Default {false} + */ + allowMultiSorting?: boolean; + + /**Enables or disables the interactive selection of a row. + * @Default {true} + */ + allowSelection?: boolean; + + /**Enables or disables sorting. When enabled, we can sort the column by clicking on the column. + * @Default {false} + */ + allowSorting?: boolean; + + /**Enable or disable predecessor validation. When it is true, all the task's start and end dates are aligned based on its predecessors start and end dates. + * @Default {true} + */ + enablePredecessorValidation?: boolean; + + /**Specifies the baseline background color in gantt + * @Default {#fba41c} + */ + baselineColor?: string; + + /**Specifies the mapping property path for baseline end date in datasource + */ + baselineEndDateMapping?: string; + + /**Specifies the mapping property path for baseline start date of a task in datasource + */ + baselineStartDateMapping?: string; + + /**Specifies the mapping property path for sub tasks in datasource + */ + childMapping?: string; + + /**Specifies the background of connector lines in Gantt + */ + connectorLineBackground?: string; + + /**Specifies the width of the connector lines in gantt + * @Default {1} + */ + connectorlineWidth?: number; + + /**Specify the CSS class for gantt to achieve custom theme. + */ + cssClass?: string; + + /**Collection of data or hierarchical data to represent in gantt + * @Default {null} + */ + dataSource?: Array; + + /**Specifies the dateFormat for gantt , given format is displayed in tooltip , grid . + * @Default {MM/dd/yyyy} + */ + dateFormat?: string; + + /**Specifies the mapping property path for duration of a task in datasource + */ + durationMapping?: string; + + /**Specifies the duration unit for each tasks whether days or hours or minutes + * @Default {ej.Gantt.DurationUnit.Day} + */ + durationUnit?: ej.Gantt.DurationUnit|string; + + /**Specifies the fields to be included in the edit dialog in gantt + * @Default {[]} + */ + editDialogFields?: Array; + + /**Option to configure the splitter position. + */ + splitterSettings?: SplitterSettings; + + /**Specifies the editSettings options in gantt. + */ + editSettings?: EditSettings; + + /**Enables or Disables enableAltRow row effect in gantt + * @Default {true} + */ + enableAltRow?: boolean; + + /**Enables or disables the collapse all records when loading the gantt. + * @Default {false} + */ + enableCollapseAll?: boolean; + + /**Enables or disables the contextmenu for gantt , when enabled contextmenu appears on right clicking gantt + * @Default {false} + */ + enableContextMenu?: boolean; + + /**Indicates whether we can edit the progress of a task interactively in gantt chart. + * @Default {true} + */ + enableProgressBarResizing?: boolean; + + /**Enables or disables the option for dynamically updating the Gantt size on window resizing + * @Default {false} + */ + enableResize?: boolean; + + /**Enables or disables tooltip while editing (dragging/resizing) the taskbar. + * @Default {true} + */ + enableTaskbarDragTooltip?: boolean; + + /**Enables or disables tooltip for taskbar. + * @Default {true} + */ + enableTaskbarTooltip?: boolean; + + /**Enables/Disables virtualization for rendering gantt items. + * @Default {false} + */ + enableVirtualization?: boolean; + + /**Specifies the mapping property path for end Date of a task in datasource + */ + endDateMapping?: string; + + /**Specifies whether to highlight the weekends in gantt . + * @Default {true} + */ + highlightWeekends?: boolean; + + /**Collection of holidays with date, background and label information to be displayed in gantt. + * @Default {[]} + */ + holidays?: Array; + + /**Specifies whether to include weekends while calculating the duration of a task. + * @Default {true} + */ + includeWeekend?: boolean; + + /**Specify the locale for gantt + * @Default {en-US} + */ + locale?: string; + + /**Specifies the mapping property path for milestone in datasource + */ + milestoneMapping?: string; + + /**Specifies the background of parent progressbar in gantt + */ + parentProgressbarBackground?: string; + + /**Specifies the background of parent taskbar in gantt + */ + parentTaskbarBackground?: string; + + /**Specifies the mapping property path for parent task Id in self reference datasource + */ + parentTaskIdMapping?: string; + + /**Specifies the mapping property path for predecessors of a task in datasource + */ + predecessorMapping?: string; + + /**Specifies the background of progressbar in gantt + */ + progressbarBackground?: string; + + /**Specified the height of the progressbar in taskbar + * @Default {100} + */ + progressbarHeight?: number; + + /**Specifies the template for tooltip on resizing progressbar + * @Default {null} + */ + progressbarTooltipTemplate?: string; + + /**Specifies the template ID for customized tooltip for progressbar editing in gantt + * @Default {null} + */ + progressbarTooltipTemplateId?: string; + + /**Specifies the mapping property path for progress percentage of a task in datasource + */ + progressMapping?: string; + + /**It receives query to retrieve data from the table (query is same as SQL). + * @Default {null} + */ + query?: any; + + /**Enables or Disables rendering baselines in Gantt , when enabled baseline is rendered in gantt + * @Default {false} + */ + renderBaseline?: boolean; + + /**Specifies the mapping property name for resource ID in resource Collection in gantt + */ + resourceIdMapping?: string; + + /**Specifies the mapping property path for resources of a task in datasource + */ + resourceInfoMapping?: string; + + /**Specifies the mapping property path for resource name of a task in gantt + */ + resourceNameMapping?: string; + + /**Collection of data regarding resources involved in entire project + * @Default {[]} + */ + resources?: Array; + + /**Specifies whether rounding off the day working time edits + * @Default {true} + */ + roundOffDayworkingTime?: boolean; + + /**Specifies the height of a single row in gantt. Also, we need to set same height in the CSS style with class name e-rowcell. + * @Default {30} + */ + rowHeight?: number; + + /**Specifies end date of the gantt schedule. By default, end date will be rounded to its next Saturday. + * @Default {null} + */ + scheduleEndDate?: string; + + /**Specifies the options for customizing schedule header. + */ + scheduleHeaderSettings?: ScheduleHeaderSettings; + + /**Specifies start date of the gantt schedule. By default, start date will be rounded to its previous Sunday. + * @Default {null} + */ + scheduleStartDate?: string; + + /**Specifies the selected row index in gantt + * @Default {null} + */ + selectedItem?: number; + + /**Specifies the selected row Index in gantt , the row with given index will highlighted + * @Default {-1} + */ + selectedRowIndex?: number; + + /**Enables or disables the column chooser. + * @Default {false} + */ + showColumnChooser?: boolean; + + /**Specifies whether to show grid cell tooltip. + * @Default {true} + */ + showGridCellTooltip?: boolean; + + /**Specifies whether to show grid cell tooltip over expander cell alone. + * @Default {true} + */ + showGridExpandCellTooltip?: boolean; + + /**Specifies whether display task progress inside taskbar. + * @Default {true} + */ + showProgressStatus?: boolean; + + /**Specifies whether to display resource names for a task beside taskbar. + * @Default {true} + */ + showResourceNames?: boolean; + + /**Specifies whether to display task name beside task bar. + * @Default {true} + */ + showTaskNames?: boolean; + + /**Specifies the size option of gantt control. + */ + sizeSettings?: SizeSettings; + + /**Specifies the sorting options for gantt. + */ + sortSettings?: SortSettings; + + /**Specifies splitter position in gantt. + * @Default {null} + */ + splitterPosition?: string; + + /**Specifies the mapping property path for start date of a task in datasource + */ + startDateMapping?: string; + + /**Specifies the options for striplines + * @Default {[]} + */ + stripLines?: Array; + + /**Specifies the background of the taskbar in gantt + */ + taskbarBackground?: string; + + /**Specifies the template script for customized tooltip for taskbar editing in gantt + */ + taskbarEditingTooltipTemplate?: string; + + /**Specifies the template Id for customized tooltip for taskbar editing in gantt + */ + taskbarEditingTooltipTemplateId?: string; + + /**Specifies the template for tooltip on mouse action on taskbars + */ + taskbarTooltipTemplate?: string; + + /**Specifies the template id for tooltip on mouse action on taskbars + */ + taskbarTooltipTemplateId?: string; + + /**Specifies the mapping property path for task Id in datasource + */ + taskIdMapping?: string; + + /**Specifies the mapping property path for task name in datasource + */ + taskNameMapping?: string; + + /**Specifies the toolbarSettings options. + */ + toolbarSettings?: ToolbarSettings; + + /**Specifies the tree expander column in gantt + * @Default {0} + */ + treeColumnIndex?: number; + + /**Specifies the weekendBackground color in gantt + * @Default {#F2F2F2} + */ + weekendBackground?: string; + + /**Specifies the working time schedule of day + * @Default {ej.Gantt.workingTimeScale.TimeScale8Hours} + */ + workingTimeScale?: ej.Gantt.workingTimeScale|string; + + /**Triggered for every gantt action before its starts.*/ + actionBegin? (e: ActionBeginEventArgs): void; + + /**Triggered for every gantt action success event.*/ + actionComplete? (e: ActionCompleteEventArgs): void; + + /**Triggered while enter the edit mode in the tree grid cell*/ + beginEdit? (e: BeginEditEventArgs): void; + + /**Triggered after collapsed the gantt record*/ + collapsed? (e: CollapsedEventArgs): void; + + /**Triggered while collapsing the gantt record*/ + collapsing? (e: CollapsingEventArgs): void; + + /**Triggered while Context Menu is rendered in Gantt control*/ + contextMenuOpen? (e: ContextMenuOpenEventArgs): void; + + /**Triggered after save the modified cellValue in gantt.*/ + endEdit? (e: EndEditEventArgs): void; + + /**Triggered after expand the record*/ + expanded? (e: ExpandedEventArgs): void; + + /**Triggered while expanding the gantt record*/ + expanding? (e: ExpandingEventArgs): void; + + /**Triggered while gantt is loaded*/ + load? (e: LoadEventArgs): void; + + /**Triggered while rendering each cell in the tree grid*/ + queryCellInfo? (e: QueryCellInfoEventArgs): void; + + /**Triggered while rendering each taskbar in the gantt chart*/ + queryTaskbarInfo? (e: QueryTaskbarInfoEventArgs): void; + + /**Triggered while rendering each row*/ + rowDataBound? (e: RowDataBoundEventArgs): void; + + /**Triggered after the row is selected.*/ + rowSelected? (e: RowSelectedEventArgs): void; + + /**Triggered before the row is going to be selected.*/ + rowSelecting? (e: RowSelectingEventArgs): void; + + /**Triggered after completing the editing operation in taskbar*/ + taskbarEdited? (e: TaskbarEditedEventArgs): void; + + /**Triggered while editing the gantt chart (dragging, resizing the taskbar )*/ + taskbarEditing? (e: TaskbarEditingEventArgs): void; + + /**Triggered when toolbar item is clicked in Gantt.*/ + toolbarClick? (e: ToolbarClickEventArgs): void; +} + +export interface ActionBeginEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the current grouped column field name. + */ + columnName?: string; + + /**Returns request type. + */ + requestType?: string; + + /**Returns the direction of sorting ascending or descending + */ + columnSortDirection?: string; + + /**Returns the value of searching element. + */ + keyValue?: string; + + /**Returns the data of deleting element. + */ + data?: string; + + /**Returns selected record index + */ + recordIndex?: number; +} + +export interface ActionCompleteEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the current grouped column field name. + */ + columnName?: string; + + /**Returns request type. + */ + requestType?: string; + + /**Returns the direction of sorting ascending or descending + */ + columnSortDirection?: string; + + /**Returns the value of searched element. + */ + keyValue?: string; + + /**Returns the data of deleted element. + */ + data?: string; + + /**Returns selected record index + */ + recordIndex?: number; +} + +export interface BeginEditEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the row element of editing cell. + */ + rowElement?: any; + + /**Returns the Element of editing cell. + */ + cellElement?: any; + + /**Returns the data of current cell record. + */ + data?: any; + + /**Returns the column Index of cell belongs. + */ + columnIndex?: number; +} + +export interface CollapsedEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the row index of collapsed record. + */ + recordIndex?: number; + + /**Returns the data of collapsed record. + */ + data?: any; + + /**Returns Request Type. + */ + requestType?: string; + + /**Returns state of a record whether it is in expanded or collapsed state. + */ + expanded?: boolean; +} + +export interface CollapsingEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the row index of collapsing record. + */ + recordIndex?: number; + + /**Returns the data of edited cell record.. + */ + data?: any; + + /**Returns state of a record whether it is in expanded or collapsed state. + */ + expanded?: boolean; +} + +export interface ContextMenuOpenEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the default context menu items to which we add custom items. + */ + contextMenuItems?: Array; + + /**Returns the gantt model. + */ + model?: any; + + /**Returns request type. + */ + requestType?: string; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface EndEditEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the row element of editing cell. + */ + rowElement?: any; + + /**Returns the Element of editing cell. + */ + cellElement?: any; + + /**Returns the data of edited cell record. + */ + data?: any; + + /**Returns the column name of edited cell belongs. + */ + columnName?: string; + + /**Returns the column object of edited cell belongs. + */ + columnObject?: any; +} + +export interface ExpandedEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the row index of record. + */ + recordIndex?: number; + + /**Returns the data of expanded record. + */ + data?: any; + + /**Returns Request Type. + */ + requestType?: string; + + /**Returns state of a record whether it is in expanded or collapsed state. + */ + expanded?: boolean; +} + +export interface ExpandingEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the row index of record. + */ + recordIndex?: any; + + /**Returns the data of edited cell record.. + */ + data?: any; + + /**Returns state of a record whether it is in expanded or collapsed state. + */ + expanded?: boolean; +} + +export interface LoadEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the gantt model + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface QueryCellInfoEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the selecting cell element. + */ + cellElement?: any; + + /**Returns the value of cell. + */ + cellValue?: string; + + /**Returns the data of current cell record. + */ + data?: any; + + /**Returns the column of cell belongs. + */ + column?: any; +} + +export interface QueryTaskbarInfoEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the taskbar background of current item. + */ + TaskbarBackground?: string; + + /**Returns the progressbar background of current item. + */ + ProgressbarBackground?: string; + + /**Returns the parent taskbar background of current item. + */ + parentTaskbarBackground?: string; + + /**Returns the parent progressbar background of current item. + */ + parentProgressbarBackground?: string; + + /**Returns the data of the record. + */ + data?: any; +} + +export interface RowDataBoundEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the row element of rendering row. + */ + rowElement?: any; + + /**Returns the data of rendering row record.. + */ + data?: any; +} + +export interface RowSelectedEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the selecting row element. + */ + targetRow?: any; + + /**Returns the index of selecting row record. + */ + recordIndex?: number; + + /**Returns the data of selected record. + */ + data?: any; +} + +export interface RowSelectingEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the data selecting record. + */ + data?: any; + + /**Returns the index of selecting row record. + */ + recordIndex?: string; + + /**Returns the selecting row chart element. + */ + targetChartRow?: any; + + /**Returns the selecting row grid element. + */ + targetGridRow?: any; + + /**Returns the previous selected data. + */ + previousData?: any; + + /**Returns the previous selected row index. + */ + previousIndex?: string; + + /**Returns the previous selected row chart element. + */ + previousChartRow?: any; + + /**Returns the previous selected row grid element. + */ + previousGridRow?: any; +} + +export interface TaskbarEditedEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the data of edited record. + */ + data?: any; + + /**Returns the previous data value of edited record. + */ + previousData?: any; + + /**Returns 'true' if taskbar is dragged. + */ + dragging?: boolean; + + /**Returns 'true' if taskbar is left resized. + */ + leftResizing?: boolean; + + /**Returns 'true' if taskbar is right resized. + */ + rightResizing?: boolean; + + /**Returns 'true' if taskbar is progress resized. + */ + progressResizing?: boolean; + + /**Returns the field values of record being edited. + */ + editingFields?: any; + + /**Returns the gantt model. + */ + model?: any; +} + +export interface TaskbarEditingEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the gantt model. + */ + model?: any; + + /**Returns the row object being edited. + */ + rowData?: any; + + /**Returns the field values of record being edited. + */ + editingFields?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface ToolbarClickEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the current item. + */ + currentTarget?: any; + + /**Returns the Gantt model. + */ + model?: any; + + /**Returns the name of the toolbar item on which mouse click has been performed + */ + itemName?: string; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface SplitterSettings { + + /**Specifies position of the splitter in Gantt , splitter can be placed either based on percentage values or pixel values. + */ + position?: string; + + /**Specifies the position of splitter in Gantt, based on column index in Gantt. + */ + index?: string; +} + +export interface EditSettings { + + /**Enables or disables add record icon in gantt toolbar + * @Default {false} + */ + allowAdding?: boolean; + + /**Enables or disables delete icon in gantt toolbar + * @Default {false} + */ + allowDeleting?: boolean; + + /**Specifies the option for enabling or disabling editing in Gantt grid part + * @Default {false} + */ + allowEditing?: boolean; + + /**Specifies the edit mode in Gantt, "normal" is for dialog editing ,"cellEditing" is for cell type editing + * @Default {normal} + */ + editMode?: string; +} + +export interface ScheduleHeaderSettings { + + /**Specified the format for day view in schedule header + * @Default {ddd} + */ + dayHeaderFormat?: string; + + /**Specified the format for Hour view in schedule header + * @Default {HH} + */ + hourHeaderFormat?: string; + + /**Specifies the number of minutes per interval + * @Default {ej.Gantt.minutesPerInterval.Auto} + */ + minutesPerInterval?: ej.Gantt.minutesPerInterval|string; + + /**Specified the format for month view in schedule header + * @Default {MMM} + */ + monthHeaderFormat?: string; + + /**Specifies the schedule mode + * @Default {ej.Gantt.ScheduleHeaderType.Week} + */ + scheduleHeaderType?: ej.Gantt.ScheduleHeaderType|string; + + /**Specified the background for weekends in gantt + * @Default {#F2F2F2} + */ + weekendBackground?: string; + + /**Specified the format for week view in schedule header + * @Default {ddd} + */ + weekHeaderFormat?: string; + + /**Specified the format for year view in schedule header + * @Default {yyyy} + */ + yearHeaderFormat?: string; +} + +export interface SizeSettings { + + /**Specifies the height of gantt control + * @Default {450px} + */ + height?: string; + + /**Specifies the width of gantt control + * @Default {1000px} + */ + width?: string; +} + +export interface SortSettings { + + /**Specifies the sorted columns for gantt + * @Default {[]} + */ + sortedColumns?: Array; +} + +export interface ToolbarSettings { + + /**Specifies the state of enabling or disabling toolbar + * @Default {true} + */ + showToolBar?: boolean; + + /**Specifies the list of toolbar items to rendered in toolbar + * @Default {[]} + */ + toolbarItems?: Array; +} + +enum DurationUnit{ + + ///Sets the Duration Unit as day. + Day, + + ///Sets the Duration Unit as hour. + Hour, + + ///Sets the Duration Unit as minute. + Minute +} + + +enum minutesPerInterval{ + + ///Sets the interval automatically according with schedule start and end date. + Auto, + + ///Sets one minute intervals per hour. + OneMinute, + + ///Sets Five minute intervals per hour. + FiveMinutes, + + ///Sets fifteen minute intervals per hour. + FifteenMinutes, + + ///Sets thirty minute intervals per hour. + ThirtyMinutes +} + + +enum ScheduleHeaderType{ + + ///Sets year Schedule Mode. + Year, + + ///Sets month Schedule Mode. + Month, + + ///Sets week Schedule Mode. + Week, + + ///Sets day Schedule Mode. + Day, + + ///Sets hour Schedule Mode. + Hour +} + + +enum workingTimeScale{ + + ///Sets eight hour timescale. + TimeScale8Hours, + + ///Sets twenty four hour timescale. + TimeScale24Hours +} + +} + +class ReportViewer extends ej.Widget { + static fn: ReportViewer; + constructor(element: JQuery, options?: ReportViewer.Model); + constructor(element: Element, options?: ReportViewer.Model); + model:ReportViewer.Model; + defaults:ReportViewer.Model; + + /** Export the report to the specified format. + * @returns {void} + */ + exportReport(): void; + + /** Fit the report page to the container. + * @returns {void} + */ + fitToPage(): void; + + /** Fit the report page height to the container. + * @returns {void} + */ + fitToPageHeight(): void; + + /** Fit the report page width to the container. + * @returns {void} + */ + fitToPageWidth(): void; + + /** Get the available datasets name of the rdlc report. + * @returns {void} + */ + getDataSetNames(): void; + + /** Get the available parameters of the report. + * @returns {void} + */ + getParameters(): void; + + /** Navigate to first page of report. + * @returns {void} + */ + gotoFirstPage(): void; + + /** Navigate to last page of the report. + * @returns {void} + */ + gotoLastPage(): void; + + /** Navigate to next page from the current page. + * @returns {void} + */ + gotoNextPage(): void; + + /** Go to specific page index of the report. + * @returns {void} + */ + gotoPageIndex(): void; + + /** Navigate to previous page from the current page. + * @returns {void} + */ + gotoPreviousPage(): void; + + /** Print the report. + * @returns {void} + */ + print(): void; + + /** Apply print layout to the report. + * @returns {void} + */ + printLayout(): void; + + /** Refresh the report. + * @returns {void} + */ + refresh(): void; +} +export module ReportViewer{ + +export interface Model { + + /**Gets or sets the list of data sources for the RDLC report. + * @Default {[]} + */ + dataSources?: Array; + + /**Enables or disables the page cache of report. + * @Default {false} + */ + enablePageCache?: boolean; + + /**Specifies the export settings. + */ + exportSettings?: ExportSettings; + + /**When set to true, adapts the report layout to fit the screen size of devices on which it renders. + * @Default {true} + */ + isResponsive?: boolean; + + /**Specifies the locale for report viewer. + * @Default {en-US} + */ + locale?: string; + + /**Specifies the page settings. + */ + pageSettings?: PageSettings; + + /**Gets or sets the list of parameters associated with the report. + * @Default {[]} + */ + parameters?: Array; + + /**Enables and disables the print mode. + * @Default {false} + */ + printMode?: boolean; + + /**Specifies the print option of the report. + * @Default {ej.ReportViewer.PrintOptions.Default} + */ + printOptions?: ej.ReportViewer.PrintOptions|string; + + /**Specifies the processing mode of the report. + * @Default {ej.ReportViewer.ProcessingMode.Remote} + */ + processingMode?: ej.ReportViewer.ProcessingMode|string; + + /**Specifies the render layout. + * @Default {ej.ReportViewer.RenderMode.Default} + */ + renderMode?: ej.ReportViewer.RenderMode|string; + + /**Gets or sets the path of the report file. + * @Default {empty} + */ + reportPath?: string; + + /**Gets or sets the reports server url. + * @Default {empty} + */ + reportServerUrl?: string; + + /**Specifies the report Web API service url. + * @Default {empty} + */ + reportServiceUrl?: string; + + /**Specifies the toolbar settings. + */ + toolbarSettings?: ToolbarSettings; + + /**Gets or sets the zoom factor for report viewer. + * @Default {1} + */ + zoomFactor?: number; + + /**Fires when the report viewer is destroyed successfully.If you want to perform any operation after destroying the reportviewer control,you can make use of the destroy event.*/ + destroy? (e: DestroyEventArgs): void; + + /**Fires during drill through action done in report.If you want to perform any operation when a drill through action is performed, you can make use of the drillThrough event.*/ + drillThrough? (e: DrillThroughEventArgs): void; + + /**Fires before report rendering is completed.If you want to perform any operation before the rendering of report,you can make use of the renderingBegin event.*/ + renderingBegin? (e: RenderingBeginEventArgs): void; + + /**Fires after report rendering completed.If you want to perform any operation after the rendering of report,you can make use of this renderingComplete event.*/ + renderingComplete? (e: RenderingCompleteEventArgs): void; + + /**Fires when any error occurred while rendering the report.If you want to perform any operation when an error occurs in the report, you can make use of the reportError event.*/ + reportError? (e: ReportErrorEventArgs): void; + + /**Fires when the report is being exported.If you want to perform any operation before exporting of report, you can make use of the reportExport event.*/ + reportExport? (e: ReportExportEventArgs): void; + + /**Fires when the report is loaded.If you want to perform any operation after the successful loading of report, you can make use of the reportLoaded event.*/ + reportLoaded? (e: ReportLoadedEventArgs): void; + + /**Fires when click the View Report Button.*/ + viewReportClick? (e: ViewReportClickEventArgs): void; +} + +export interface DestroyEventArgs { + + /**true if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the report model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface DrillThroughEventArgs { + + /**true if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the actionInfo's parameters bookmarkLink, hyperLink, reportName, parameters. + */ + actionInfo?: any; + + /**returns the report model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface RenderingBeginEventArgs { + + /**true if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the report model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface RenderingCompleteEventArgs { + + /**true if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the report model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; + + /**returns the collection of parameters. + */ + reportParameters?: any; +} + +export interface ReportErrorEventArgs { + + /**true if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the error details. + */ + error?: string; + + /**returns the report model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface ReportExportEventArgs { + + /**true if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the report model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface ReportLoadedEventArgs { + + /**true if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the report model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface ViewReportClickEventArgs { + + /**true if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the parameter collection. + */ + parameters?: any; + + /**returns the report model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface DataSources { + + /**Gets or sets the name of the data source. + * @Default {empty} + */ + name?: string; + + /**Gets or sets the values of data source. + * @Default {[]} + */ + values?: Array; +} + +export interface ExportSettings { + + /**Specifies the export formats. + * @Default {ej.ReportViewer.ExportOptions.All} + */ + exportOptions?: ej.ReportViewer.ExportOptions|string; + + /**Specifies the excel export format. + * @Default {ej.ReportViewer.ExcelFormats.Excel97to2003} + */ + excelFormat?: ej.ReportViewer.ExcelFormats|string; + + /**Specifies the word export format. + * @Default {ej.ReportViewer.WordFormats.Doc} + */ + wordFormat?: ej.ReportViewer.WordFormats|string; +} + +export interface PageSettings { + + /**Specifies the print layout orientation. + * @Default {null} + */ + orientation?: ej.ReportViewer.Orientation|string; + + /**Specifies the paper size of print layout. + * @Default {null} + */ + paperSize?: ej.ReportViewer.PaperSize|string; +} + +export interface Parameters { + + /**Gets or sets the parameter labels. + * @Default {null} + */ + labels?: Array; + + /**Gets or sets the name of the parameter. + * @Default {empty} + */ + name?: string; + + /**Gets or sets whether the parameter allows nullable value or not. + * @Default {false} + */ + nullable?: boolean; + + /**Gets or sets the prompt message associated with the specified parameter. + * @Default {empty} + */ + prompt?: string; + + /**Gets or sets the parameter values. + * @Default {[]} + */ + values?: Array; +} + +export interface ToolbarSettings { + + /**Fires when user click on toolbar item in the toolbar. + * @Default {empty} + */ + click?: string; + + /**Specifies the toolbar items. + * @Default {ej.ReportViewer.ToolbarItems.All} + */ + items?: ej.ReportViewer.ToolbarItems|string; + + /**Shows or hides the toolbar. + * @Default {true} + */ + showToolbar?: boolean; + + /**Shows or hides the tooltip of toolbar items. + * @Default {true} + */ + showTooltip?: boolean; + + /**Specifies the toolbar template ID. + * @Default {empty} + */ + templateId?: string; +} + +enum ExportOptions{ + + ///Specifies the All property in ExportOptions to get all availble options. + All, + + ///Specifies the Pdf property in ExportOptions to get Pdf option. + Pdf, + + ///Specifies the Word property in ExportOptions to get Word option. + Word, + + ///Specifies the Excel property in ExportOptions to get Excel option. + Excel, + + ///Specifies the Html property in ExportOptions to get Html option. + Html +} + + +enum ExcelFormats{ + + ///Specifies the Excel97to2003 property in ExcelFormats to get specified version of exported format. + Excel97to2003, + + ///Specifies the Excel2007 property in ExcelFormats to get specified version of exported format. + Excel2007, + + ///Specifies the Excel2010 property in ExcelFormats to get specified version of exported format. + Excel2010, + + ///Specifies the Excel2013 property in ExcelFormats to get specified version of exported format. + Excel2013 +} + + +enum WordFormats{ + + ///Specifies the Doc property in WordFormats to get specified version of exported format. + Doc, + + ///Specifies the Dot property in WordFormats to get specified version of exported format. + Dot, + + ///Specifies the Docx property in WordFormats to get specified version of exported format. + Docx, + + ///Specifies the Word2007 property in WordFormats to get specified version of exported format. + Word2007, + + ///Specifies the Word2010 property in WordFormats to get specified version of exported format. + Word2010, + + ///Specifies the Word2013 property in WordFormats to get specified version of exported format. + Word2013, + + ///Specifies the Word2007Dotx property in WordFormats to get specified version of exported format. + Word2007Dotx, + + ///Specifies the Word2010Dotx property in WordFormats to get specified version of exported format. + Word2010Dotx, + + ///Specifies the Word2013Dotx property in WordFormats to get specified version of exported format. + Word2013Dotx, + + ///Specifies the Word2007Docm property in WordFormats to get specified version of exported format. + Word2007Docm, + + ///Specifies the Word2010Docm property in WordFormats to get specified version of exported format. + Word2010Docm, + + ///Specifies the Word2013Docm property in WordFormats to get specified version of exported format. + Word2013Docm, + + ///Specifies the Word2007Dotm property in WordFormats to get specified version of exported format. + Word2007Dotm, + + ///Specifies the Word2010Dotm property in WordFormats to get specified version of exported format. + Word2010Dotm, + + ///Specifies the Word2013Dotm property in WordFormats to get specified version of exported format. + Word2013Dotm, + + ///Specifies the Rtf property in WordFormats to get specified version of exported format. + Rtf, + + ///Specifies the Txt property in WordFormats to get specified version of exported format. + Txt, + + ///Specifies the EPub property in WordFormats to get specified version of exported format. + EPub, + + ///Specifies the Html property in WordFormats to get specified version of exported format. + Html, + + ///Specifies the Xml property in WordFormats to get specified version of exported format. + Xml, + + ///Specifies the Automatic property in WordFormats to get specified version of exported format. + Automatic +} + + +enum Orientation{ + + ///Specifies the Landscape property in pageSettings.orientation to get specified layout. + Landscape, + + ///Specifies the portrait property in pageSettings.orientation to get specified layout. + Portrait +} + + +enum PaperSize{ + + ///Specifies the A3 as value in pageSettings.paperSize to get specified size. + A3, + + ///Specifies the A4 as value in pageSettings.paperSize to get specified size. + Portrait, + + ///Specifies the B4(JIS) as value in pageSettings.paperSize to get specified size. + B4_JIS, + + ///Specifies the B5(JIS) as value in pageSettings.paperSize to get specified size. + B5_JIS, + + ///Specifies the Envelope #10 as value in pageSettings.paperSize to get specified size. + Envelope_10, + + ///Specifies the Envelope as value in pageSettings.paperSize to get specified size. + Envelope_Monarch, + + ///Specifies the Executive as value in pageSettings.paperSize to get specified size. + Executive, + + ///Specifies the Legal as value in pageSettings.paperSize to get specified size. + Legal, + + ///Specifies the Letter as value in pageSettings.paperSize to get specified size. + Letter, + + ///Specifies the Tabloid as value in pageSettings.paperSize to get specified size. + Tabloid, + + ///Specifies the Custom as value in pageSettings.paperSize to get specified size. + Custom +} + + +enum PrintOptions{ + + ///Specifies the Default property in printOptions. + Default, + + ///Specifies the NewTab property in printOptions. + NewTab, + + ///Specifies the None property in printOptions. + None +} + + +enum ProcessingMode{ + + ///Specifies the Remote property in processingMode. + Remote, + + ///Specifies the Local property in processingMode. + Local +} + + +enum RenderMode{ + + ///Specifies the Default property in RenderMode to get default output. + Default, + + ///Specifies the Mobile property in RenderMode to get specified output. + Mobile, + + ///Specifies the Desktop property in RenderMode to get specified output. + Desktop +} + + +enum ToolbarItems{ + + ///Specifies the Print as value in ToolbarItems to get specified item. + Print, + + ///Specifies the Refresh as value in ToolbarItems to get specified item. + Refresh, + + ///Specifies the Zoom as value in ToolbarItems to get specified item. + Zoom, + + ///Specifies the FittoPage as value in ToolbarItems to get specified item. + FittoPage, + + ///Specifies the Export as value in ToolbarItems to get specified item. + Export, + + ///Specifies the PageNavigation as value in ToolbarItems to get specified item. + PageNavigation, + + ///Specifies the Parameters as value in ToolbarItems to get specified item. + Parameters, + + ///Specifies the PrintLayout as value in ToolbarItems to get specified item. + PrintLayout, + + ///Specifies the PageSetup as value in ToolbarItems to get specified item. + PageSetup +} + +} + +class TreeGrid extends ej.Widget { + static fn: TreeGrid; + constructor(element: JQuery, options?: TreeGrid.Model); + constructor(element: Element, options?: TreeGrid.Model); + model:TreeGrid.Model; + defaults:TreeGrid.Model; + + /** To clear all the selection in TreeGrid + * @param {number} you can pass a row index to clear the row selection. + * @returns {void} + */ + clearSelection(index: number): void; + + /** To collapse all the parent items in tree grid + * @returns {void} + */ + collapseAll(): void; + + /** To hide the column by using header text + * @param {string} you can pass a header text of a column to hide. + * @returns {void} + */ + hideColumn(headerText: string): void; + + /** To refresh the changes in tree grid + * @param {Array} Pass which data source you want to show in tree grid + * @param {any} Pass which data you want to show in tree grid + * @returns {void} + */ + refresh(dataSource: Array, query: any): void; + + /** Freeze all the columns preceding to the column specified by the field name. + * @param {string} Freeze all Columns before this field column. + * @returns {void} + */ + freezePrecedingColumns (field: string): void; + + /** Freeze/unfreeze the specified column. + * @param {string} Freeze/Unfreeze this field column. + * @param {boolean} Decides to Freeze/Unfreeze this field column. + * @returns {void} + */ + freezeColumn (field: string, isFrozen: boolean): void; + + /** To save the edited cell in TreeGrid + * @returns {void} + */ + saveCell(): void; + + /** To search an item with search string provided at the run time + * @param {string} you can pass a searchString to search the tree grid + * @returns {void} + */ + search(searchString: string): void; + + /** To show the column by using header text + * @param {string} you can pass a header text of a column to show. + * @returns {void} + */ + showColumn(headerText: string): void; + + /** To sorting the data based on the particular fields + * @param {string} you can pass a name of column to sort. + * @param {string} you can pass a sort direction to sort the column. + * @returns {void} + */ + sortColumn(columnName: string, columnSortDirection: string): void; +} +export module TreeGrid{ + +export interface Model { + + /**Enables or disables the ability to resize the column width interactively. + * @Default {false} + */ + allowColumnResize?: boolean; + + /**Enables or disables the ability to drag and drop the row interactively to reorder the rows. + * @Default {false} + */ + allowDragAndDrop?: boolean; + + /**Enables or disables the ability to filter the data on all the columns. Enabling this property will display a row with editor controls corresponding to each column. You can restrict filtering on particular column by disabling this property directly on that column instance itself. + * @Default {false} + */ + allowFiltering?: boolean; + + /**Enables or disables keyboard navigation. + * @Default {true} + */ + allowKeyboardNavigation?: boolean; + + /**Enables or disables the ability to sort the rows based on multiple columns/fields by clicking on each column header. Rows will be sorted recursively on clicking the column headers. + * @Default {false} + */ + allowMultiSorting?: boolean; + + /**Enables or disables the ability to select a row interactively. + * @Default {true} + */ + allowSelection?: boolean; + + /**Enables or disables the ability to sort the rows based on a single field/column by clicking on that column header. When enabled, rows can be sorted only by single field/column. + * @Default {false} + */ + allowSorting?: boolean; + + /**Specifies the id of the template that has to be applied for alternate rows. + */ + altRowTemplateID?: string; + + /**Specifies the mapping property path for sub tasks in datasource + */ + childMapping?: string; + + /**Option for adding columns; each column has the option to bind to a field in the dataSource. + */ + columns?: Array; + + /**Options for displaying and customizing context menu items. + */ + contextMenuSettings?: ContextMenuSettings; + + /**Specifies hierarchical or self-referential data to populate the TreeGrid. + * @Default {null} + */ + dataSource?: Array; + + /**Specifies whether to wrap the header text when it is overflown i.e., when it exceeds the header width. + * @Default {none} + */ + headerTextOverflow?: string; + + /**Options for displaying and customizing the tooltip. This tooltip will show the preview of the row that is being dragged. + */ + dragTooltip?: DragTooltip; + + /**Options for enabling and configuring the editing related operations. + */ + editSettings?: EditSettings; + + /**Specifies whether to render alternate rows in different background colors. + * @Default {true} + */ + enableAltRow?: boolean; + + /**Specifies whether to load all the rows in collapsed state when the TreeGrid is rendered for the first time. + * @Default {false} + */ + enableCollapseAll?: boolean; + + /**Specifies whether to resize TreeGrid whenever window size changes. + * @Default {false} + */ + enableResize?: boolean; + + /**Specifies whether to render only the visual elements that are visible in the UI. When you enable this property, it will reduce the loading time for loading large number of records. + * @Default {false} + */ + enableVirtualization?: boolean; + + /**Specifies if the filtering should happen immediately on each key press or only on pressing enter key. + * @Default {immediate} + */ + filterBarMode?: string; + + /**Specifies the name of the field in the dataSource, which contains the id of that row. + */ + idMapping?: string; + + /**Specifies the name of the field in the dataSource, which contains the parent’s id. This is necessary to form a parent-child hierarchy, if the dataSource contains self-referential data. + */ + parentIdMapping?: string; + + /**Specifies ej.Query to select data from the dataSource. This property is applicable only when the dataSource is ej.DataManager. + * @Default {null} + */ + query?: any; + + /**Specifies the height of a single row in tree grid. Also, we need to set same height in the CSS style with class name e-rowcell. + * @Default {30} + */ + rowHeight?: number; + + /**Specifies the id of the template to be applied for all the rows. + */ + rowTemplateID?: string; + + /**Specifies the index of the selected row. + * @Default {-1} + */ + selectedRowIndex?: number; + + /**Specifies the type of selection whether to select single row or multiple rows. + * @Default {ej.TreeGrid.SelectionType.Single} + */ + selectionType?: ej.Gantt.SelectionType|string; + + /**Controls the visibility of the menu button, which is displayed on the column header. Clicking on this button will show a popup menu. When you choose “Columns” item from this popup, a list box with column names will be shown, from which you can select/deselect a column name to control the visibility of the respective columns. + * @Default {false} + */ + showColumnChooser?: boolean; + + /**Specifies whether to show tooltip when mouse is hovered on the cell. + * @Default {true} + */ + showGridCellTooltip?: boolean; + + /**Specifies whether to show tooltip for the cells, which has expander button. + * @Default {true} + */ + showGridExpandCellTooltip?: boolean; + + /**Options for setting width and height for TreeGrid. + */ + sizeSettings?: SizeSettings; + + /**Options for sorting the rows. + */ + sortSettings?: SortSettings; + + /**Options for displaying and customizing the toolbar items. + */ + toolbarSettings?: ToolbarSettings; + + /**Specifies the index of the column that needs to have the expander button. By default, cells in the first column contain the expander button. + * @Default {0} + */ + treeColumnIndex?: number; + + /**Triggered before every success event of TreeGrid action.*/ + actionBegin? (e: ActionBeginEventArgs): void; + + /**Triggered for every TreeGrid action success event.*/ + actionComplete? (e: ActionCompleteEventArgs): void; + + /**Triggered while enter the edit mode in the TreeGrid cell*/ + beginEdit? (e: BeginEditEventArgs): void; + + /**Triggered after collapsed the TreeGrid record*/ + collapsed? (e: CollapsedEventArgs): void; + + /**Triggered while collapsing the TreeGrid record*/ + collapsing? (e: CollapsingEventArgs): void; + + /**Triggered while Context Menu is rendered in TreeGrid control*/ + contextMenuOpen? (e: ContextMenuOpenEventArgs): void; + + /**Triggered after saved the modified cellValue in TreeGrid*/ + endEdit? (e: EndEditEventArgs): void; + + /**Triggered after expand the record*/ + expanded? (e: ExpandedEventArgs): void; + + /**Triggered while expanding the TreeGrid record*/ + expanding? (e: ExpandingEventArgs): void; + + /**Triggered while Treegrid is loaded*/ + load? (e: LoadEventArgs): void; + + /**Triggered while rendering each cell in the TreeGrid*/ + queryCellInfo? (e: QueryCellInfoEventArgs): void; + + /**Triggered while rendering each row*/ + rowDataBound? (e: RowDataBoundEventArgs): void; + + /**Triggered while dragging a row in TreeGrid control*/ + rowDrag? (e: RowDragEventArgs): void; + + /**Triggered while start to drag row in TreeGrid control*/ + rowDragStart? (e: RowDragStartEventArgs): void; + + /**Triggered while drop a row in TreeGrid control*/ + rowDragStop? (e: RowDragStopEventArgs): void; + + /**Triggered after the row is selected.*/ + rowSelected? (e: RowSelectedEventArgs): void; + + /**Triggered before the row is going to be selected.*/ + rowSelecting? (e: RowSelectingEventArgs): void; + + /**Triggered when toolbar item is clicked in TreeGrid.*/ + toolbarClick? (e: ToolbarClickEventArgs): void; +} + +export interface ActionBeginEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the current grouped column field name. + */ + columnName?: string; + + /**Returns the TreeGrid model. + */ + model?: any; + + /**Returns request type. + */ + requestType?: string; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the direction of sorting ascending or descending. + */ + columnSortDirection?: string; + + /**Returns the value of expanding parent element. + */ + keyValue?: string; + + /**Returns the data or deleting element. + */ + data?: string; +} + +export interface ActionCompleteEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the current grouped column field name. + */ + columnName?: string; + + /**Returns request type. + */ + requestType?: string; + + /**Returns the direction of sorting ascending or descending + */ + columnSortDirection?: string; + + /**Returns the value of searched element. + */ + keyValue?: string; + + /**Returns the data of deleted element. + */ + data?: string; + + /**Returns selected record index + */ + recordIndex?: number; +} + +export interface BeginEditEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the row element of editing cell. + */ + rowElement?: any; + + /**Returns the Element of editing cell. + */ + cellElement?: any; + + /**Returns the data of current cell record. + */ + data?: any; + + /**Returns the column Index of cell belongs. + */ + columnIndex?: number; +} + +export interface CollapsedEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the row index of collapsed record. + */ + recordIndex?: number; + + /**Returns the data of collpsed record.. + */ + data?: any; + + /**Returns Request Type. + */ + requestType?: string; + + /**Returns state of a record whether it is in expanded or collapsed state. + */ + expanded?: boolean; + + /**Returns the event type. + */ + type?: string; +} + +export interface CollapsingEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the row index of collapsing record. + */ + recordIndex?: number; + + /**Returns the data of collapsing record.. + */ + data?: any; + + /**Returns the event Type. + */ + type?: string; + + /**Returns state of a record whether it is in expanded or collapsing state. + */ + expanded?: boolean; +} + +export interface ContextMenuOpenEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the default context menu items to which we add custom items. + */ + contextMenuItems?: Array; + + /**Returns the TreeGrid model. + */ + model?: any; + + /**Returns request type. + */ + requestType?: string; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface EndEditEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the row element of editing cell. + */ + rowElement?: any; + + /**Returns the Element of editing cell. + */ + cellElement?: any; + + /**Returns the data of edited cell record. + */ + data?: any; + + /**Returns the column name of edited cell belongs. + */ + columnName?: string; + + /**Returns the column object of edited cell belongs. + */ + columnObject?: any; +} + +export interface ExpandedEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the row index of expanded record. + */ + recordIndex?: number; + + /**Returns the data of expanded record.. + */ + data?: any; + + /**Returns Request Type. + */ + requestType?: string; + + /**Returns state of a record whether it is in expanded or expanded state. + */ + expanded?: boolean; + + /**Returns the event type. + */ + type?: string; +} + +export interface ExpandingEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the row index of expanding record. + */ + recordIndex?: number; + + /**Returns the data of expanding record.. + */ + data?: any; + + /**Returns the event Type. + */ + type?: string; + + /**Returns state of a record whether it is in expanded or collapsed state. + */ + expanded?: boolean; +} + +export interface LoadEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the TreeGrid model + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface QueryCellInfoEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the selecting cell element. + */ + cellElement?: any; + + /**Returns the value of cell. + */ + cellValue?: string; + + /**Returns the data of current cell record. + */ + data?: any; + + /**Returns the column of cell belongs. + */ + column?: any; +} + +export interface RowDataBoundEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the row element of rendering row. + */ + rowElement?: any; + + /**Returns the data of rendering row record. + */ + data?: any; +} + +export interface RowDragEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the row which we start to drag. + */ + draggedRow?: any; + + /**Returns the row index which we start to drag. + */ + draggedRowIndex?: number; + + /**Returns the row on which we are dragging. + */ + targetRow?: any; + + /**Returns the row index on which we are dragging. + */ + targetRowIndex?: number; + + /**Returns that we can drop over that record or not. + */ + canDrop?: boolean; + + /**Returns the TreeGrid model. + */ + model?: any; + + /**Returns request type. + */ + requestType?: string; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface RowDragStartEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the row which we start to drag. + */ + draggedRow?: any; + + /**Returns the row index which we start to drag. + */ + draggedRowIndex?: boolean; + + /**Returns the TreeGrid model. + */ + model?: any; + + /**Returns request type. + */ + requestType?: string; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface RowDragStopEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the row which we start to drag. + */ + draggedRow?: any; + + /**Returns the row index which we start to drag. + */ + draggedRowIndex?: number; + + /**Returns the row which we are dropped to row. + */ + targetRow?: any; + + /**Returns the row index which we are dropped to row. + */ + targetRowIndex?: number; + + /**Returns the TreeGrid model. + */ + model?: any; + + /**Returns request type. + */ + requestType?: string; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface RowSelectedEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the selecting row element. + */ + targetRow?: any; + + /**Returns the index of selecting row record. + */ + recordIndex?: number; + + /**Returns the data of selected record. + */ + data?: any; + + /**Returns the event type. + */ + type?: string; +} + +export interface RowSelectingEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the data selecting record. + */ + data?: any; + + /**Returns the index of selecting row record. + */ + recordIndex?: string; + + /**Returns the selecting row element. + */ + targetRow?: any; + + /**Returns the previous selected data. + */ + previousData?: any; + + /**Returns the previous selected row index. + */ + previousIndex?: string; + + /**Returns the previous selected row element. + */ + previousTreeGridRow?: any; +} + +export interface ToolbarClickEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the current item. + */ + currentTarget?: any; + + /**Returns the TreeGrid model. + */ + model?: any; + + /**Returns the name of the toolbar item on which mouse click has been performed + */ + itemName?: string; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface Columns { + + /**Enables or disables the ability to filter the rows based on this column. + * @Default {false} + */ + allowFiltering?: boolean; + + /**Enables or disables the ability to sort the rows based on this column/field. + * @Default {false} + */ + allowSorting?: boolean; + + /**Specifies the edit type of the column. + * @Default {ej.TreeGrid.EditingType.String} + */ + editType?: ej.TreeGrid.EditingType|string; + + /**Specifies the name of the field from the dataSource to bind with this column. + */ + field?: string; + + /**Specifies the type of the editor control to be used to filter the rows. + * @Default {ej.TreeGrid.EditingType.String} + */ + filterEditType?: ej.TreeGrid.EditingType|string; + + /**Header text of the column. + * @Default {null} + */ + headerText?: string; + + /**Controls the visibility of the column. + * @Default {true} + */ + visible?: boolean; + + /**Specifies the header template value for the column header + */ + headerTemplateID?: string; + + /**Specifies whether the column is frozen + * @Default {false} + */ + isFrozen?: boolean; + + /**Enables or disables the ability to freeze/unfreeze the columns + * @Default {false} + */ + allowFreezing?: boolean; +} + +export interface ContextMenuSettings { + + /**Option for adding items to context menu. + * @Default {[]} + */ + contextMenuItems?: Array; + + /**Shows/hides the context menu. + * @Default {false} + */ + showContextMenu?: boolean; +} + +export interface DragTooltip { + + /**Specifies whether to show tooltip while dragging a row. + * @Default {true} + */ + showTooltip?: boolean; + + /**Option to add field names whose corresponding values in the dragged row needs to be shown in the preview tooltip. + * @Default {[]} + */ + tooltipItems?: Array; + + /**Custom template for that tooltip that is shown while dragging a row. + * @Default {null} + */ + tooltipTemplate?: string; +} + +export interface EditSettings { + + /**Enables or disables the button to add new row in context menu as well as in toolbar. + * @Default {true} + */ + allowAdding?: boolean; + + /**Enables or disables the button to delete the selected row in context menu as well as in toolbar. + * @Default {true} + */ + allowDeleting?: boolean; + + /**Enables or disables the ability to edit a row or cell. + * @Default {false} + */ + allowEditing?: boolean; + + /**specifies the edit mode in TreeGrid , "cellEditing" is for cell type editing and "rowEditing" is for entire row. + * @Default {ej.TreeGrid.EditMode.CellEditing} + */ + editMode?: ej.TreeGrid.EditMode|string; + + /**Specifies the position where the new row has to be added. + * @Default {top} + */ + rowPosition?: ej.TreeGrid.RowPosition|string; +} + +export interface SizeSettings { + + /**Height of the TreeGrid. + * @Default {null} + */ + height?: string; + + /**Width of the TreeGrid. + * @Default {null} + */ + width?: string; +} + +export interface SortSettings { + + /**Option to add columns based on which the rows have to be sorted recursively. + * @Default {[]} + */ + sortedColumns?: Array; +} + +export interface ToolbarSettings { + + /**Shows/hides the toolbar. + * @Default {false} + */ + showToolBar?: boolean; + + /**Option to add items to the toolbar. + * @Default {[]} + */ + toolbarItems?: Array; +} + +enum EditingType{ + + ///It Specifies String edit type. + String, + + ///It Specifies Boolean edit type. + Boolean, + + ///It Specifies Numeric edit type. + Numeric, + + ///It Specifies Dropdown edit type. + Dropdown, + + ///It Specifies DatePicker edit type. + DatePicker, + + ///It Specifies DateTimePicker edit type. + DateTimePicker, + + ///It Specifies Maskedit edit type. + Maskedit +} + + +enum EditMode{ + + ///you can edit a cell. + CellEditing, + + ///you can edit a row. + RowEditing +} + + +enum RowPosition{ + + ///you can add a new row at top. + Top, + + ///you can add a new row at bottom. + Bottom, + + ///you can add a new row to above selected row. + Above, + + ///you can add a new row to below selected row. + Below, + + ///you can add a new row as a child for selected row. + Child +} + +} +module Gantt +{ +enum SelectionType +{ +//you can select a single row. +Single, +//you can select a multiple row. +Multiple, +} +} + +class NavigationDrawer extends ej.Widget { + static fn: NavigationDrawer; + constructor(element: JQuery, options?: NavigationDrawer.Model); + constructor(element: Element, options?: NavigationDrawer.Model); + model:NavigationDrawer.Model; + defaults:NavigationDrawer.Model; + + /** To close the navigation drawer control + * @returns {void} + */ + close(): void; + + /** To open the navigation drawer control + * @returns {void} + */ + open(): void; + + /** To Toggle the navigation drawer control + * @returns {void} + */ + toggle(): void; +} +export module NavigationDrawer{ + +export interface Model { + + /**Specifies the contentId for navigation drawer, where the ajax content need to updated + * @Default {null} + */ + contentid?: string; + + /**Sets the root class for NavigationDrawer theme. This cssClass API helps to use custom skinning option for NavigationDrawer control. By defining the root class using this API, we need to include this root class in CSS. + */ + cssclass?: string; + + /**Sets the Direction for the control. See Direction + * @Default {left} + */ + direction?: ej.Direction|string; + + /**Sets the listview to be enabled or not + * @Default {false} + */ + enablelistview?: boolean; + + /**Specifies the listview items as an array of object. + * @Default {[]} + */ + items?: Array; + + /**Sets all the properties of listview to render in navigation drawer + */ + listviewsettings?: any; + + /**Specifies position whether it is in fixed or relative to the page. See Position + * @Default {normal} + */ + position?: string; + + /**Specifies the targetId for navigation drawer + */ + targetid?: string; + + /**Sets the rendering type of the control. See Type + * @Default {overlay} + */ + type?: string; + + /**Specifies the width of the control + * @Default {auto} + */ + width?: number; + + /**Event triggers before the control gets closed.*/ + beforeclose? (e: BeforecloseEventArgs): void; + + /**Event triggers when the control open.*/ + open? (e: OpenEventArgs): void; + + /**Event triggers when the Swipe happens.*/ + swipe? (e: SwipeEventArgs): void; +} + +export interface BeforecloseEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the Navigation Drawer model + */ + model?: ej.NavigationDrawer.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the item of element + */ + item?: any; + + /**returns the name of item + */ + itemName?: string; +} + +export interface OpenEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the Navigation Drawer model + */ + model?: ej.NavigationDrawer.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the item of element + */ + item?: any; + + /**returns the name of item + */ + itemName?: string; +} + +export interface SwipeEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the Navigation Drawer model + */ + model?: ej.NavigationDrawer.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the item of element + */ + item?: any; + + /**returns the name of item + */ + itemName?: string; +} +} + +class RadialMenu extends ej.Widget { + static fn: RadialMenu; + constructor(element: JQuery, options?: RadialMenu.Model); + constructor(element: Element, options?: RadialMenu.Model); + model:RadialMenu.Model; + defaults:RadialMenu.Model; + + /** To hide the redialmenu + * @returns {void} + */ + hide(): void; + + /** To hide the redialmenu items + * @returns {void} + */ + menuHide(): void; + + /** To Show the redialmenu + * @returns {void} + */ + show(): void; +} +export module RadialMenu{ + +export interface Model { + + /**To show the Radial in intial render. + */ + autoOpen?: boolean; + + /**Renders the back button Image for Radial using class. + */ + backImageClass?: string; + + /**Sets the root class for RadialMenu theme. This cssClass API helps to use custom skinning option for RadialMenu control. By defining the root class using this API, we need to include this root class in CSS. + */ + cssClass?: string; + + /**To enable Animation for Radial Menu. + */ + enableAnimation?: boolean; + + /**Renders the Image for Radial using Class. + */ + imageClass?: string; + + /**Specifies the radius of radial menu + */ + radius?: number; + + /**To show the Radial while clicking given target element. + */ + targetElementId?: string; + + /**Event triggers when the mouse down happens.*/ + mouseDown? (e: MouseDownEventArgs): void; + + /**Event triggers when the mouse up happens.*/ + mouseUp? (e: MouseUpEventArgs): void; + + /**Event triggers when we select an item.*/ + select? (e: SelectEventArgs): void; +} + +export interface MouseDownEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the Radialmenu model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; + + /**returns the item of element + */ + item?: any; + + /**returns the name of item + */ + itemName?: string; +} + +export interface MouseUpEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the Radialmenu model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; + + /**returns the item of element + */ + item?: any; + + /**returns the name of item + */ + itemName?: string; +} + +export interface SelectEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the Radialmenu model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; + + /**returns the item of element + */ + item?: any; + + /**returns the name of item + */ + itemName?: string; +} +} + +class Tile extends ej.Widget { + static fn: Tile; + constructor(element: JQuery, options?: Tile.Model); + constructor(element: Element, options?: Tile.Model); + model:Tile.Model; + defaults:Tile.Model; + + /** Update the image template of tile item to another one. + * @param {string} UpdateTemplate by using id + * @returns {void} + */ + updateTemplate(name: string): void; +} +export module Tile{ + +export interface Model { + + /**Section for badge specific functionalities and it represents the notification for tile items. + */ + badge?: Badge; + + /**Specifies the tile caption in outside of template content. + * @Default {null} + */ + captionTemplateId?: string; + + /**Sets the root class for Tile theme. This cssClass API helps to use custom skinning option for Tile control. By defining the root class using this API, we need to include this root class in CSS. + */ + cssClass?: string; + + /**Saves current model value to browser cookies for state maintains. While refreshing the page retains the model value applies from browser cookies. + * @Default {false} + */ + enablePersistence?: boolean; + + /**Customize the tile size height. + * @Default {null} + */ + height?: number; + + /**Specifies Tile imageClass, using this property we can give images for each tile through css classes. + * @Default {null} + */ + imageClass?: string; + + /**Specifies the position of tile image. See imagePosition + * @Default {center} + */ + imagePosition?: ej.Tile.ImagePosition|string; + + /**Specifies the tile image in outside of template content. + * @Default {null} + */ + imageTemplateId?: string; + + /**Specifies the url of tile image. + * @Default {null} + */ + imageUrl?: string; + + /**Section for livetile specific functionalities. + */ + livetile?: Livetile; + + /**Specifies whether the tile text to be shown or hidden. + * @Default {true} + */ + showText?: boolean; + + /**Changes the text of a tile. + * @Default {Text} + */ + text?: string; + + /**Aligns the text of a tile. See textAlignment + * @Default {normal} + */ + textAlignment?: ej.Tile.TextAlignment|string; + + /**Specifies the size of a tile. See tileSize + * @Default {small} + */ + tileSize?: ej.Tile.TileSize|string; + + /**Customize the tile size width. + * @Default {null} + */ + width?: number; + + /**Sets the rounded corner to tile. + * @Default {false} + */ + showRoundedCorner?: boolean; + + /**Sets allowSelection to tile. + * @Default {false} + */ + allowSelection?: boolean; + + /**Sets the background color to tile. + * @Default {false} + */ + backgroundColor?: string; + + /**Event triggers when the mouse down happens in the tile*/ + mouseDown? (e: MouseDownEventArgs): void; + + /**Event triggers when the mouse up happens in the tile*/ + mouseUp? (e: MouseUpEventArgs): void; +} + +export interface MouseDownEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the tile model + */ + model?: boolean; + + /**returns the name of the event + */ + type?: boolean; + + /**returns the current tile text + */ + text?: string; + + /**returns the index of current tile item + */ + index?: number; +} + +export interface MouseUpEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the tile model + */ + model?: boolean; + + /**returns the name of the event + */ + type?: boolean; + + /**returns the current tile text + */ + text?: boolean; + + /**returns the index of current tile item + */ + index?: number; +} + +export interface Badge { + + /**Specifies whether to enable badge or not. + * @Default {false} + */ + enabled?: boolean; + + /**Specifies maximum value for tile badge. + * @Default {100} + */ + maxValue?: number; + + /**Specifies minimum value for tile badge. + * @Default {1} + */ + minValue?: number; + + /**Specifies text instead of number for tile badge. + * @Default {null} + */ + text?: string; + + /**Sets value for tile badge. + * @Default {1} + */ + value?: number; + + /**Sets position for tile badge. + * @Default {“bottomright”} + */ + position?: ej.Tile.BadgePosition|string; +} + +export interface Livetile { + + /**Specifies whether to enable livetile or not. + * @Default {false} + */ + enabled?: boolean; + + /**Specifies liveTile images in css classes. + * @Default {null} + */ + imageClass?: string; + + /**Specifies liveTile images in templates. + * @Default {null} + */ + imageTemplateId?: string; + + /**Specifies liveTile images in css classes. + * @Default {null} + */ + imageUrl?: string; + + /**Specifies liveTile type for Tile. See orientation + * @Default {flip} + */ + type?: ej.Tile.LiveTileType|string; + + /**Specifies time interval between two successive livetile animation + * @Default {2000} + */ + updateInterval?: number; + + /**Sets the text to each living tile + * @Default {Null} + */ + text?: Array; +} + +enum BadgePosition{ + + ///To set the topright position of tile badge + Topright, + + ///To set the bottomright of tile image + Bottomright +} + + +enum ImagePosition{ + + ///To set the center position of tile image + Center, + + ///To set the top position of tile image + Top, + + ///To set the bottom position of tile image + Bottom, + + ///To set the right position of tile image + Right, + + ///To set the left position of tile image + Left, + + ///To set the topleft position of tile image + TopLeft, + + ///To set the topright position of tile image + TopRight, + + ///To set the bottomright position of tile image + BottomRight, + + ///To set the bottomleft position of tile image + BottomLeft, + + ///To set the fill position of tile image + Fill +} + + +enum LiveTileType{ + + ///To set flip type of liveTile for tile control + Flip, + + ///To set slide type of liveTile for tile control + Slide, + + ///To set carousel type of liveTile for tile control + Carousel +} + + +enum TextAlignment{ + + ///To set the normal alignment of text for tile control + Normal, + + ///To set the left alignment of text for tile control + Left, + + ///To set the right alignment of text for tile control + Right, + + ///To set the center alignment of text for tile control + Center +} + + +enum TextPosition{ + + ///To set the innertop position of the tile text + Innertop, + + ///To set the innerbottom position of the tile text + Innerbottom, + + ///To set the outer position of the tile text + Outer +} + + +enum TileSize{ + + ///To set the medium size for tile control + Medium, + + ///To set the small size for tile control + Small, + + ///To set the large size for tile control + Large, + + ///To set the wide size for tile control + Wide +} + +} + +class RadialSlider extends ej.Widget { + static fn: RadialSlider; + element: JQuery; + constructor(element: JQuery, options?: RadialSliderOptions); + constructor(element: Element, options?: RadialSliderOptions); + model:RadialSliderOptions; + defaults:RadialSliderOptions; + show(): void; + hide(): void; +} + +interface RadialSliderOptions { + radius?: number; + endAngle?: number; + startAngle?: number; + ticks?: Int32Array; + enableRoundOff?: boolean; + value?: number; + strokeWidth?: number; + autoOpen?: boolean; + enableAnimation?: boolean; + cssClass?: string; + innerCircleImageClass?: string; + innerCircleImageUrl?: string; + showInnerCircle?: boolean; + inline?: boolean; + stop? (e: RadialSliderStopEventArgs): void; + start? (e: RadialSliderStartEventArgs): void; + slide? (e: RadialSliderSlideEventArgs): void; + change? (e: RadialSliderChangeEventArgs): void; + mouseover? (e: RadialSliderMouseOverEventArgs): void; + create? (e: RadialSliderCreateEventArgs): void; + destory? (e: RadialSliderDestroyEventArgs): void; +} +interface RadialSliderCreateEventArgs { + cancel: boolean; + model: RadialSliderOptions; + type: string; +} +interface RadialSliderDestroyEventArgs { + cancel: boolean; + model: RadialSliderOptions; + type: string; +} +interface RadialSliderStopEventArgs { + cancel: boolean; + model: RadialSliderOptions; + type: string; + value: number; +} + +interface RadialSliderStartEventArgs { + cancel: boolean; + model: RadialSliderOptions; + type: string; + value: number; +} +interface RadialSliderSlideEventArgs { + cancel: boolean; + model: RadialSliderOptions; + type: string; + value: number; + selectedValue: number; +} +interface RadialSliderChangeEventArgs { + cancel: boolean; + model: RadialSliderOptions; + type: string; + value: number; + oldValue: number; +} +interface RadialSliderMouseOverEventArgs { + cancel: boolean; + model: RadialSliderOptions; + type: string; + value: number; + selectedValue: number; +} +class Spreadsheet extends ej.Widget { + static fn: Spreadsheet; + constructor(element: JQuery, options?: Spreadsheet.Model); + constructor(element: Element, options?: Spreadsheet.Model); + model:Spreadsheet.Model; + defaults:Spreadsheet.Model; + + /** This method is used to add a new sheet in the last position of the sheet container. + * @returns {void} + */ + addNewSheet(): void; + + /** It is used to clear all the data and format in the specified range of cells in Spreadsheet. + * @param {string} Optional. If range is specified, then it will clear all content in the specified range else it will use the current selected range. + * @returns {void} + */ + clearAll(range: string): void; + + /** This property is used to clear all the formats applied in the specified range in Spreadsheet. + * @param {string} Optional. If range is specified, then it will clear all format in the specified range else it will use the current selected range. + * @returns {void} + */ + clearAllFormat(range: string): void; + + /** Used to clear the applied border in the specified range in Spreadsheet. + * @param {string} Optional. If range is specified, then it will clear border in the specified range else it will use the current selected range. + * @returns {void} + */ + clearBorder(range: string): void; + + /** This property is used to clear the contents in the specified range in Spreadsheet. + * @param {string} Optional. If the range is specified, then it will clear the content in the specified range else it will use the current selected range. + * @returns {void} + */ + clearContents(range: string): void; + + /** This method is used to remove only the data in the range denoted by the specified range name. + * @param {string} Pass the defined rangeSettings property name. + * @returns {void} + */ + clearRange(rangeName: string): void; + + /** It is used to remove data in the specified range of cells based on the defined property. + * @param {Array|string} Optional. If range is specified, it will clear data for the specified range else it will use the current selected range. + * @param {string} Optional. If property is specified, it will remove the specified property in the range else it will remove default properties + * @param {boolean} Optional. If pass true, if you want to skip the hidden rows + * @returns {void} + */ + clearRangeData(range: Array|string, property: string, skipHiddenRow: boolean): void; + + /** This method is used to copy sheets in Spreadsheet. + * @param {number} Pass the sheet index that you want to copy. + * @param {number} Pass the position index where you want to copy. + * @returns {void} + */ + copySheet(fromIdx: number, toIdx: number): void; + + /** This method is used to delete the entire column which is selected. + * @param {number} Pass the start column index. + * @param {number} Pass the end column index. + * @returns {void} + */ + deleteEntireColumn(startCol: number, endCol: number): void; + + /** This method is used to delete the entire row which is selected. + * @param {number} Pass the start row index. + * @param {number} Pass the end row index. + * @returns {void} + */ + deleteEntireRow(startRow: number, endRow: number): void; + + /** This method is used to delete a particular sheet in the Spreadsheet. + * @param {number} Pass the sheet index to perform delete action. + * @returns {void} + */ + deleteSheet(idx: number): void; + + /** This method is used to delete the selected cells and shift the remaining cells to left. + * @param {any} Row index and column index of the starting cell. + * @param {any} Row index and column index of the ending cell. + * @returns {void} + */ + deleteShiftLeft(startCell: any, endCell: any): void; + + /** This method is used to delete the selected cells and shift the remaining cells up. + * @param {any} Row index and column index of the start cell. + * @param {any} Row index and column index of the end cell. + * @returns {void} + */ + deleteShiftUp(startCell: any, endCell: any): void; + + /** This method is used to edit data in the specified range of cells based on its corresponding rangeSettings. + * @param {string} Pass the defined rangeSettings property name. + * @param {Function} Pass the function that you want to perform range edit. + * @returns {void} + */ + editRange(rangeName: string, fn: Function): void; + + /** This method is used to get the activation panel in the Spreadsheet. + * @returns {HTMLElement} + */ + getActivationPanel(): HTMLElement; + + /** This method is used to get the active cell object in Spreadsheet. It will returns object which contains rowIndex and colIndex of the active cell. + * @param {number} Optional. If sheetIdx is specified, it will return the active cell object in specified sheet index else it will use the current sheet index + * @returns {any} + */ + getActiveCell(sheetIdx: number): any; + + /** This method is used to get the active cell element based on the given sheet index in the Spreadsheet. + * @param {number} Optional. If sheetIndex is specified, it will return the active cell element in specified sheet index else it will use the current active sheet index. + * @returns {HTMLElement} + */ + getActiveCellElem(sheetIdx: number): HTMLElement; + + /** This method is used to get the current active sheet index in Spreadsheet. + * @returns {number} + */ + getActiveSheetIndex(): number; + + /** This method is used to get the auto fill element in Spreadsheet. + * @returns {HTMLElement} + */ + getAutoFillElem(): HTMLElement; + + /** This method is used to get the cell element based on specified row and column index in the Spreadsheet. + * @param {number} Pass the row index. + * @param {number} Pass the column index. + * @param {number} Optional. Pass the sheet index that you want to get cell. + * @returns {HTMLElement} + */ + getCell(rowIdx: number, colIdx: number, sheetIdx: number): HTMLElement; + + /** This method is used to get the frozen columns index in the Spreadsheet. + * @param {number} Pass the sheet index. + * @returns {number} + */ + getFrozenColumns(sheetIdx: number): number; + + /** This method is used to get the frozen row’s index in Spreadsheet. + * @param {number} Pass the sheet index. + * @returns {number} + */ + getFrozenRows(sheetIdx: number): number; + + /** This method is used to get the hyperlink data as object from the specified cell in Spreadsheet. + * @param {HTMLElement} Pass the DOM element to get hyperlink + * @returns {any} + */ + getHyperlink(cell: HTMLElement): any; + + /** This method is used to get all cell elements in the specified range. + * @param {number} Pass the row index of the start cell. + * @param {number} Pass the column index of the start cell. + * @param {number} Pass the row index of the end cell. + * @param {number} Pass the column index of the end cell. + * @param {number} Pass the index of the sheet. + * @returns {HTMLElement} + */ + getRange(startRIndex: number, startCIndex: number, endRIndex: number, endCIndex: number, sheetIdx: number): HTMLElement; + + /** This method is used to get the data in specified range in Spreadsheet. + * @param {Array|string} Optional. If range is specified, it will get range data for the specified range else it will use the current selected range. + * @param {boolean} Pass 'true' if you want cell values alone. + * @param {Array|string} Optional. If property is specified, it will get the specified property in the range else it will get default properties. + * @param {number} Optional. Pass the index of the sheet. + * @param {boolean} Optional. When skipDateTime is set as true, it return 'value2' cell value (cell type as 'datetime') + * @param {boolean} Optional. Pass true, if you want to get the calculated formula value else it return formula string. + * @param {boolean} Optional. Pass true, if you want to skip the hidden rows data. + * @param {number} Optional. Pass virtual row index of sheet. + * @param {number} Optional. Pass virtual row count of sheet. + * @returns {Array} + */ + getRangeData(range: Array|string, valueOnly: boolean, property: Array|string, sheetIdx: number, skipDateTime: boolean, skipFormula: boolean, skipHiddenRow: boolean, virtualRowIdx: number, virtualRowCount: number): Array; + + /** This method is used to get the range indices array based on the specified alpha range in Spreadsheet. + * @param {string} Pass the alpha range that you want to get range indices. + * @returns {Array} + */ + getRangeIndices(range: string): Array; + + /** This method is used to get the sheet details based on the given sheet index in Spreadsheet. + * @param {number} Pass the sheet index to get the sheet object. + * @returns {any} + */ + getSheet(sheetIdx: number): any; + + /** This method is used to get the sheet content div element of Spreadsheet. + * @param {number} Pass the sheet index to get the sheet content. + * @returns {HTMLElement} + */ + getSheetElement(sheetIdx: number): HTMLElement; + + /** This method is used to send a paging request to the specified sheet Index in the Spreadsheet. + * @param {number} Pass the sheet index to perform paging at specified sheet index + * @param {boolean} Pass 'true' to create a new sheet. If the specified sheet index is already exist, it navigate to that sheet else it create a new sheet. + * @returns {void} + */ + gotoPage(sheetIdx: number, newSheet: boolean): void; + + /** This method is used to hide the entire columns from the specified range (startCol, endCol) in Spreadsheet. + * @param {number} Index of the start column. + * @param {number} Index of the end column. + * @returns {void} + */ + hideColumn(startCol: number, endCol: number): void; + + /** This method is used to hide the formula bar in Spreadsheet. + * @returns {void} + */ + hideFormulaBar(): void; + + /** This method is used to hide the rows, based on the specified row index in Spreadsheet. + * @param {number} Index of the start row. + * @param {number} Index of the end row. + * @returns {void} + */ + hideRow(startRow: number, endRow: number): void; + + /** This method is used to hide the sheet based on the specified sheetIndex or sheet name in the Spreadsheet. + * @param {string|number} Pass the sheet name or index that you want to hide. + * @returns {void} + */ + hideSheet(sheetIdx: string|number): void; + + /** This method is used to hide the displayed waiting pop-up in Spreadsheet. + * @returns {void} + */ + hideWaitingPopUp(): void; + + /** This method is used to insert a column before the active cell's column in the Spreadsheet. + * @param {number} Pass start column. + * @param {number} Pass end column. + * @returns {void} + */ + insertEntireColumn(startCol: number, endCol: number): void; + + /** This method is used to insert a row before the active cell's row in the Spreadsheet. + * @param {number} Pass start row. + * @param {number} Pass end row. + * @returns {void} + */ + insertEntireRow(startRow: number, endRow: number): void; + + /** This method is used to insert a new sheet to the left of the current active sheet. + * @returns {void} + */ + insertSheet(): void; + + /** This method is used to insert cells in the selected or specified range and shift remaining cells to bottom. + * @param {any} Row index and column index of the start cell. + * @param {any} Row index and column index of the end cell. + * @returns {void} + */ + insertShiftBottom(startCell: any, endCell: any): void; + + /** This method is used to insert cells in the selected or specified range and shift remaining cells to right. + * @param {any} Row index and column index of the start cell. + * @param {any} Row index and column index of the end cell. + * @returns {void} + */ + insertShiftRight(startCell: any, endCell: any): void; + + /** This method is used to import excel file manually by using form data. + * @param {any} Pass the form data object to import files manually. + * @returns {void} + */ + import(importRequest: any): void; + + /** This method is used to lock/unlock the range of cells in active sheet. Lock cells are activated only after the sheet is protected. Once the sheet is protected it is unable to lock/unlock cells. + * @param {string|Array} Pass the alpha range cells or array range of cells. + * @param {string} Optional. By default is true. If it is false locked cells are unlocked. + * @returns {void} + */ + lockCells(range: string|Array, isLocked: string): void; + + /** This method is used to merge cells by across in the Spreadsheet. + * @param {string} Optional. To pass the cell range or selected cells are process. + * @param {boolean} Optional. If pass true it does not show alert. + * @returns {void} + */ + mergeAcrossCells(range: string, alertStatus: boolean): void; + + /** This method is used to merge the selected cells in the Spreadsheet. + * @param {string} Optional. To pass the cell range or selected cells are process. + * @param {boolean} Optional. If pass true it does not show alert. + * @returns {void} + */ + mergeCells(range: string, alertStatus: boolean): void; + + /** This method is used to move sheets in Spreadsheet. + * @param {number} Pass the sheet index that you want to move. + * @param {number} Pass the position index where you want to move. + * @returns {void} + */ + moveSheet(fromIdx: number, toIdx: number): void; + + /** This method is used to protect or unprotect active sheet. + * @param {boolean} Optional. By default is true. If it is false active sheet is unprotected. + * @returns {void} + */ + protectSheet(isProtected: boolean): void; + + /** This method is used to remove the hyperlink from selected cells of current sheet. + * @param {string} Hyperlink remove from the specified range. + * @param {boolean} Optional. If it is true, It will clear link only not format. + * @returns {void} + */ + removeHyperlink(range: string, isClearHLink: boolean): void; + + /** This method is used to remove the range data and its defined rangeSettings property based on the specified range name. + * @param {string} Pass the defined rangeSetting property name. + * @returns {void} + */ + removeRange(rangeName: string): void; + + /** This method is used to set the active cell in the Spreadsheet. + * @param {number} Pass the row index. + * @param {number} Pass the column index. + * @param {number} Pass the index of the sheet. + * @returns {void} + */ + setActiveCell(rowIdx: number, colIdx: number, sheetIdx: number): void; + + /** This method is used to set active sheet index for the Spreadsheet. + * @param {number} Pass the active sheet index for Spreadsheet. + * @returns {void} + */ + setActiveSheetIndex(sheetIdx: number): void; + + /** This method is used to set border for the specified range of cells in the Spreadsheet. + * @param {any} Pass the border properties that you want to set. + * @param {string} Optional. If range is specified, it will set border for the specified range else it will use the selected range. + * @returns {void} + */ + setBorder(property: any, range: string): void; + + /** This method is used to set the hyperlink in selected cells of the current sheet. + * @param {string} If range is specified, it will set the hyperlink in range of the cells. + * @param {any} Pass cellAddress or webAddress + * @param {number} If we pass cellAddress then which sheet to be navigate in the applied link. + * @returns {void} + */ + setHyperlink(range: string, link: any, sheetIdx: number): void; + + /** This method is used to set the focus to the Spreadsheet. + * @returns {void} + */ + setSheetFocus(): void; + + /** This method is used to set the width for the columns in the Spreadsheet. + * @param {Array|any} Pass the cell index and width of the cells. + * @returns {void} + */ + setWidthToColumns(widthColl: Array|any): void; + + /** This method is used to rename the active sheet. + * @param {string} Pass the sheet name that you want to change the current active sheet name. + * @returns {void} + */ + sheetRename(sheetName: string): void; + + /** This method is used to display the activationPanel for the specified range name. + * @param {string} Pass the range name that you want to display the activation panel. + * @returns {void} + */ + showActivationPanel(rangeName: string): void; + + /** This method is used to show the hidden columns within the specified range in the Spreadsheet. + * @param {number} Index of the start column. + * @param {number} Index of the end column. + * @returns {void} + */ + showColumn(startColIdx: number, endColIdx: number): void; + + /** This method is used to show the formula bar in Spreadsheet. + * @returns {void} + */ + showFormulaBar(): void; + + /** This method is used to show the hidden rows in the specified range in the Spreadsheet. + * @param {number} Index of the start row. + * @param {number} Index of the end row. + * @returns {void} + */ + showRow(startRow: number, endRow: number): void; + + /** This method is used to show waiting pop-up in Spreadsheet. + * @returns {void} + */ + showWaitingPopUp(): void; + + /** This method is used to unfreeze the frozen rows and columns in the Spreadsheet. + * @returns {void} + */ + unfreezePanes(): void; + + /** This method is used to unhide the sheet based on specified sheet name or sheet index. + * @param {string|number} Pass the sheet name or index that you want to unhide. + * @returns {void} + */ + unhideSheet(sheetInfo: string|number): void; + + /** This method is used to unmerge the selected range of cells in the Spreadsheet. + * @param {string} Optional. If the range is specified, then it will un merge the specified range else it will use the current selected range. + * @returns {void} + */ + unmergeCells(range: string): void; + + /** This method is used to unwrap the selected range of cells in the Spreadsheet. + * @param {Array|string} Optional. If the range is specified, then it will update unwrap in the specified range else it will use the current selected range. + * @returns {void} + */ + unWrapText(range: Array|string): void; + + /** This method is used to update the data for the specified range of cells in the Spreadsheet. + * @param {any} Pass the cells data that you want to update. + * @param {Array} Optional. If range is specified, it will update data for the specified range else it will use the current selected range. + * @returns {void} + */ + updateData(data: any, range: Array): void; + + /** This method is used to update the formula bar in the Spreadsheet. + * @returns {void} + */ + updateFormulaBar(): void; + + /** This method is used to update the range of cells based on the specified settings which we want to update in the Spreadsheet. + * @param {number} Pass the sheet index that you want to update. + * @param {any} Pass the dataSource, startCell and showHeader values as settings. + * @returns {void} + */ + updateRange(sheetIdx: number, settings: any): void; + + /** This method is used to update the unique data for the specified range of cells in Spreadsheet. + * @param {any} Pass the data that you want to update in the particular range + * @param {Array|string} Optional. If range is specified, it will update data for the specified range else it will use the current selected range. + * @returns {void} + */ + updateUniqueData(data: any, range: Array|string): void; + + /** This method is used to wrap the selected range of cells in the Spreadsheet. + * @param {Array|string} Optional. If the range is specified, then it will update wrap in the specified range else it will use the current selected range. + * @returns {void} + */ + wrapText(range: Array|string): void; + + XLCellType: Spreadsheet.XLCellType; + + XLCFormat: Spreadsheet.XLCFormat; + + XLChart: Spreadsheet.XLChart; + + XLClipboard: Spreadsheet.XLClipboard; + + XLComment: Spreadsheet.XLComment; + + XLDragDrop: Spreadsheet.XLDragDrop; + + XLDragFill: Spreadsheet.XLDragFill; + + XLEdit: Spreadsheet.XLEdit; + + XLExport: Spreadsheet.XLExport; + + XLFilter: Spreadsheet.XLFilter; + + XLFormat: Spreadsheet.XLFormat; + + XLFreeze: Spreadsheet.XLFreeze; + + XLPrint: Spreadsheet.XLPrint; + + XLResize: Spreadsheet.XLResize; + + XLRibbon: Spreadsheet.XLRibbon; + + XLSearch: Spreadsheet.XLSearch; + + XLSelection: Spreadsheet.XLSelection; + + XLSort: Spreadsheet.XLSort; + + XLValidate: Spreadsheet.XLValidate; +} +export module Spreadsheet{ + +export interface XLCellType { + + /** This method is used to set a cell type from the specified range of cells in the spreadsheet. + * @param {string} Pass the range where you want apply cell type. + * @param {any} Pass type of cell type and its settings. + * @param {number} Optional. Pass sheet index. + * @returns {void} + */ + addCellTypes(range: string,settings: any,sheetIdx: number): void; + + /** This method is used to remove cell type from the specified range of cells in the Spreadsheet. + * @param {string} Pass the range where you want remove cell type. + * @param {number} Optional. Pass sheet index. + * @returns {void} + */ + removeCellTypes(range: string,sheetIdx: number): void; +} + +export interface XLCFormat { + + /** This method is used to clear the applied conditional formatting rules in the Spreadsheet. + * @param {boolean} Pass true if you want to clear rules from selected cells else it will clear rules from entire sheet. + * @param {Array|string} Optional. If range is specified, it will clear rules for the specified range else it will use the current selected range. + * @returns {void} + */ + clearCF(isSelected: boolean,range: Array|string): void; + + /** This method is used to get the applied conditional formatting rules as array of objects based on the specified row Index and column Index in the Spreadsheet. + * @param {number} Pass the row index. + * @param {number} Pass the column index. + * @returns {Array} + */ + getCFRule(rowIdx: number,colIdx: number): Array; + + /** This method is used to set the conditional formatting rule in the Spreadsheet. + * @param {any} Pass the rule to set. + * @returns {void} + */ + setCFRule(rule: any): void; +} + +export interface XLChart { + + /** This method is used to create a chart for specified range in Spreadsheet. + * @param {string} Optional. If range is specified, it will create chart for the specified range else it will use the current selected range. + * @param {any} To pass the type of chart and chart name. + * @returns {void} + */ + createChart(range: string,options: any): void; + + /** This method is used to refresh the chart in the Spreadsheet. + * @param {string} To pass the chart Id. + * @param {any} To pass the type of chart and chart name. + * @returns {void} + */ + refreshChart(id: string,options: any): void; + + /** This method is used to resize the chart of specified id in the Spreadsheet. + * @param {string} To pass the chart id. + * @param {number} To pass height value. + * @param {number} To pass the width value. + * @returns {void} + */ + resizeChart(id: string,height: number,width: number): void; +} + +export interface XLClipboard { + + /** This method is used to copy the selected cells in the Spreadsheet. + * @returns {void} + */ + copy(): void; + + /** This method is used to cut the selected cells in the Spreadsheet. + * @returns {void} + */ + cut(): void; + + /** This method is used to paste the cut or copied cells data in the Spreadsheet. + * @returns {void} + */ + paste(): void; +} + +export interface XLComment { + + /** This method is used to delete the comment in the specified range in Spreadsheet. + * @param {Array|string} Optional. If range is specified, it will delete comments for the specified range else it will use the current selected range. + * @param {number} Optional. If sheetIdx is specified, it will delete comment in specified sheet else it will use active sheet. + * @param {boolean} Optional. Pass true, if you want to skip the hidden rows data. + * @returns {void} + */ + deleteComment(range: Array|string,sheetIdx: number,skipHiddenRow: boolean): void; + + /** This method is used to edit the comment in the target Cell in Spreadsheet. + * @param {any} Optional. Pass the row index and column index of the cell which contains comment. + * @returns {void} + */ + editComment(targetCell: any): void; + + /** This method is used to find the next comment from the active cell in Spreadsheet. + * @returns {boolean} + */ + findNextComment(): boolean; + + /** This method is used to find the previous comment from the active cell in Spreadsheet. + * @returns {boolean} + */ + findPrevComment(): boolean; + + /** This method is used to get comment data for the specified cell. + * @param {HTMLElement} Pass the DOM element to get comment data as object. + * @returns {any} + */ + getComment(cell: HTMLElement): any; + + /** This method is used to set new comment in Spreadsheet. + * @param {string|Array} Optional. If we pass the range comment will set in the range otherwise it will set with selected cells. + * @param {string} Pass the comment data. + * @param {boolean} Optional. Pass true to show comment in edit mode + * @returns {void} + */ + setComment(range: string|Array,data: string,showEditPanel: boolean): void; + + /** This method is used to show all the comments in the Spreadsheet. + * @returns {void} + */ + showAllComments(): void; + + /** This method is used to show or hide the specific comment in the Spreadsheet. + * @param {HTMLElement} Optional. Pass the cell DOM element to show or hide its comment. If pass empty argument active cell will processed. + * @returns {void} + */ + showHideComment(targetCell: HTMLElement): void; +} + +export interface XLDragDrop { + + /** This method is used to drag and drop the selected range of cells to destination range in the Spreadsheet. + * @param {any|Array} Pass the source range to perform drag and drop. + * @param {any|Array} Pass the destination range to drop the dragged cells. + * @returns {void} + */ + moveRangeTo(sourceRange: any|Array,destinationRange: any|Array): void; +} + +export interface XLDragFill { + + /** This method is used to perform auto fill in Spreadsheet. + * @param {any} Pass the options to perform auto fill in Spreadsheet. + * @returns {void} + */ + autoFill(options: any): void; + + /** This method is used to hide the auto fill element in the Spreadsheet. + * @returns {void} + */ + hideAutoFillElement(): void; + + /** This method is used to hide the auto fill options in the Spreadsheet. + * @returns {void} + */ + hideAutoFillOptions(): void; + + /** This method is used to set position of the auto fill element in the Spreadsheet. + * @param {boolean} Pass the drag fill status as boolean value for show auto fill options in Spreadsheet. + * @returns {void} + */ + positionAutoFillElement(isDragFill: boolean): void; +} + +export interface XLEdit { + + /** This method is used to calculate formulas in the specified sheet. + * @param {number} Optional. If sheet index is specified, then it will calculate formulas in the specified sheet only else it will calculate formulas in all sheets. + * @returns {void} + */ + calcNow(sheetIdx: number): void; + + /** This method is used to edit a particular cell based on the row index and column index in the Spreadsheet. + * @param {number} Pass the row index to edit particular cell. + * @param {number} Pass the column index to edit particular cell. + * @param {boolean} Pass true, if you want to maintain previous cell value. + * @returns {void} + */ + editCell(rowIdx: number,colIdx: number,oldData: boolean): void; + + /** This method is used to get the property value of particular cell, based on the row and column index in the Spreadsheet. + * @param {number} Pass the row index to get the property value. + * @param {number} Pass the column index to get the property value. + * @param {string} Optional. Pass the property name that you want("value", "value2", "type", "cFormatRule", "range", "thousandSeparator", "rule", "format", "border", "picture", "chart", "calcValue", "align", "hyperlink", "formats", "borders", "tformats", "tborders", "isFilterHeader", "filterState", "tableName", "comment", "formatStr", "decimalPlaces", "cellType"). + * @param {number} Optional. Pass the index of the sheet. + * @returns {any|string|Array} + */ + getPropertyValue(rowIdx: number,colIdx: number,prop: string,sheetIdx: number): any|string|Array; + + /** This method is used to get the property value in specified cell in Spreadsheet. + * @param {HTMLElement} Pass the cell element to get property value. + * @param {string} Pass the property name that you want ("value", "value2", "type", "cFormatRule", "range", "thousandSeparator", "rule", "format", "border", "picture", "chart", "calcValue", "align", "hyperlink", "formats", "borders", "tformats", "tborders", "isFilterHeader", "filterState", "tableName", "comment", "formatStr", "decimalPlaces", "cellType"). + * @param {number} Pass the index of sheet. + * @returns {void} + */ + getPropertyValueByElem(elem: HTMLElement,property: string,sheetIdx: number): void; + + /** This method is used to save the edited cell value in the Spreadsheet. + * @returns {void} + */ + saveCell(): void; + + /** This method is used to update a particular cell value in the Spreadsheet. + * @param {any} Pass row index and column index of the cell. + * @param {string|number} Pass the cell value. + * @returns {void} + */ + updateCell(cell: any,value: string|number): void; + + /** This method is used to update a particular cell value and its format in the Spreadsheet. + * @param {any} Pass row index and column index of the cell. + * @param {string|number} Pass the cell value. + * @param {string} Pass the class name to update format. + * @param {number} Pass sheet index. + * @returns {void} + */ + updateCellValue(cellIdx: any,val: string|number,formatClass: string,sheetIdx: number): void; +} + +export interface XLExport { + + /** This method is used to save the sheet data as Excel or CSV document (.xls, .xlsx and .csv) in Spreadsheet. + * @param {string} Pass the export type that you want. + * @returns {void} + */ + export(type: string): void; +} + +export interface XLFilter { + + /** This method is used to clear the filter in filtered columns in the Spreadsheet. + * @returns {void} + */ + clearFilter(): void; + + /** This method is used to apply filter for the selected range of cells in the Spreadsheet. + * @param {string} Pass the range of the selected cells. + * @returns {void} + */ + filter(range: string): void; + + /** This method is used to apply filter for the column by active cell's value in the Spreadsheet. + * @returns {void} + */ + filterByActiveCell(): void; +} + +export interface XLFormat { + + /** This method is used to create a table for the selected range of cells in the Spreadsheet. + * @param {any} Pass the table object. + * @param {string} Optional. If the range is specified, then it will create table in the specified range else it will use the current selected range. + * @returns {void} + */ + createTable(tableObject: any,range: string): void; + + /** This method is used to set format style and values in a cell or range of cells. + * @param {any} Pass the formatObject which contains style, type, format, groupSeparator and decimalPlaces. + * @param {string} Pass the range indices to format cells. + * @returns {void} + */ + format(formatObj: any,range: string): void; + + /** This method is used to remove table with specified tableId in the Spreadsheet. + * @param {number} Pass the tableId that you want to remove. + * @returns {void} + */ + removeTable(tableId: number): void; + + /** This method is used to update the decimal places for numeric value for the selected range of cells in the Spreadsheet. + * @param {string} Pass the decimal places type in increment/decrement. + * @param {string} Pass the range indices. + * @returns {void} + */ + updateDecimalPlaces(type: string,range: string): void; + + /** This method is used to update the format for the selected range of cells in the Spreadsheet. + * @param {any} Pass the format object that you want to update. + * @param {Array} Optional. If the range is specified, then it will update format in the specified range else it will use the current selected range. + * @returns {void} + */ + updateFormat(formatObj: any,range: Array): void; + + /** This method is used to update the unique format for selected range of cells in the Spreadsheet. + * @param {string} Pass the unique format class. + * @param {Array} Optional. If the range is specified, then it will update format in the specified range else it will use the current selected range. + * @returns {void} + */ + updateUniqueFormat(formatClass: string,range: Array): void; +} + +export interface XLFreeze { + + /** This method is used to freeze columns upto the specified column index in the Spreadsheet. + * @param {number} Index of the column to be freeze. + * @returns {void} + */ + freezeColumns(colIdx: number): void; + + /** This method is used to freeze the first column in the Spreadsheet. + * @returns {void} + */ + freezeLeftColumn(): void; + + /** This method is used to freeze rows and columns before the specified cell in the Spreadsheet. + * @param {any} Row index and column index of the cell which you want to freeze. + * @returns {void} + */ + freezePanes(cell: any): void; + + /** This method is used to freeze rows upto the specified row index in the Spreadsheet. + * @param {number} Index of the row to be freeze. + * @returns {void} + */ + freezeRows(rowIdx: number): void; + + /** This method is used to freeze the top row in the Spreadsheet. + * @returns {void} + */ + freezeTopRow(): void; +} + +export interface XLPrint { + + /** This method is used to print the selected contents in the Spreadsheet. + * @returns {void} + */ + printSelection(): void; + + /** This method is used to print the entire contents in the active sheet. + * @returns {void} + */ + printSheet(): void; +} + +export interface XLResize { + + /** This method is used to get the column width of the specified column index in the Spreadsheet. + * @param {number} Pass the column index. + * @returns {number} + */ + getColWidth(colIdx: number): number; + + /** This method is used to get the row height of the specified row index in the Spreadsheet. + * @param {number} Pass the row index which you want to find its height. + * @returns {number} + */ + getRowHeight(rowIdx: number): number; + + /** This method is used to set the column width of the specified column index in the Spreadsheet. + * @param {number} Pass the column index. + * @param {number} Pass the width value that you want to set. + * @returns {void} + */ + setColWidth(colIdx: number,size: number): void; + + /** This method is used to set the row height of the specified row index in the Spreadsheet. + * @param {number} Pass the row index. + * @param {number} Pass the height value that you want to set. + * @returns {void} + */ + setRowHeight(rowIdx: number,size: number): void; +} + +export interface XLRibbon { + + /** This method is used to add a new name in the Spreadsheet name manager. + * @param {string} Pass the name that you want to define in name manager. + * @param {string} Pass the cell reference. + * @param {string} Optional. Pass comment, if you want. + * @param {number} Optional. Pass the sheet index. + * @returns {void} + */ + addNamedRange(name: string,refersTo: string,comment: string,sheetIdx: number): void; + + /** This method is used to insert the few type (SUM, MAX, MIN, AVG, COUNT) of formulas in the selected range of cells in the Spreadsheet. + * @param {string} To pass the type("SUM","MAX","MIN","AVG","COUNT"). + * @param {string} If range is specified, it will apply auto sum for the specified range else it will use the current selected range. + * @returns {void} + */ + autoSum(type: string,range: string): void; + + /** This method is used to delete the defined name in the Spreadsheet name manager. + * @param {string} Pass the defined name that you want to remove from name manager. + * @returns {void} + */ + removeNamedRange(name: string): void; +} + +export interface XLSearch { + + /** This method is used to find and replace all data by workbook in the Spreadsheet. + * @param {string} Pass the search data. + * @param {string} Pass the replace data. + * @param {boolean} Pass true, if you want to match with case-sensitive. + * @param {boolean} Pass true, if you want to match with entire cell contents. + * @returns {void} + */ + replaceAllByBook(findData: string,replaceData: string,isCSen: boolean,isEMatch: boolean): void; + + /** This method is used to find and replace all data by sheet in Spreadsheet. + * @param {string} Pass the search data. + * @param {string} Pass the replace data. + * @param {boolean} Pass true, if you want to match with case-sensitive. + * @param {boolean} Pass true, if you want to match with entire cell contents. + * @returns {void} + */ + replaceAllBySheet(findData: string,replaceData: string,isCSen: boolean,isEMatch: boolean): void; +} + +export interface XLSelection { + + /** This method is used to get the selected cells element based on specified sheet index in the Spreadsheet. + * @param {number} Pass the sheet index to get the cells element. + * @returns {HTMLElement} + */ + getSelectedCells(sheetIdx: number): HTMLElement; + + /** This method is used to refresh the selection in the Spreadsheet. + * @param {Array} Optional. Pass range to refresh selection. + * @returns {void} + */ + refreshSelection(range: Array): void; + + /** This method is used to select a single column in the Spreadsheet. + * @param {number} Pass the column index value. + * @returns {void} + */ + selectColumn(colIdx: number): void; + + /** This method is used to select entire columns in a specified range (start index and end index) in the Spreadsheet. + * @param {number} Pass the column start index. + * @param {number} Pass the column end index. + * @returns {void} + */ + selectColumns(startIdx: number,endIdx: number): void; + + /** This method is used to select the specified range of cells in the Spreadsheet. + * @param {string} Pass range which want to select. + * @param {any} Pass the row and column index of the end cell. + * @returns {void} + */ + selectRange(range: string,endCell: any): void; + + /** This method is used to select a single row in the Spreadsheet. + * @param {number} Pass the row index value. + * @returns {void} + */ + selectRow(rowIdx: number): void; + + /** This method is used to select entire rows in a specified range (start index and end index) in the Spreadsheet. + * @param {number} Pass the start row index. + * @param {number} Pass the end row index. + * @returns {void} + */ + selectRows(startIdx: number,endIdx: number): void; + + /** This method is used to select all cells in active sheet. + * @returns {void} + */ + selectSheet(): void; +} + +export interface XLSort { + + /** This method is used to sort a particular range of cells based on its cell or font color in the Spreadsheet. + * @param {string} Pass 'PutCellColor' to sort by cell color or 'PutFontColor' for by font color. + * @param {any} Pass the HEX color code to sort. + * @param {string} Pass the range + * @returns {void} + */ + sortByColor(operation: string,color: any,range: string): void; + + /** This method is used to sort a particular range of cells based on its values in the Spreadsheet. + * @param {Array|string} Pass the range to sort. + * @param {string} Pass the column name. + * @param {any} Pass the direction to sort (ascending or descending). + * @returns {void} + */ + sortByRange(range: Array|string,columnName: string,direction: any): void; +} + +export interface XLValidate { + + /** This method is used to apply data validation rules in a selected range of cells based on the defined condition in the Spreadsheet. + * @param {string} If range is specified, it will apply rules for the specified range else it will use the current selected range. + * @param {Array} Pass the validation condition, value1 and value2. + * @param {string} Pass the data type. + * @param {boolean} Pass 'true' if you ignore blank values. + * @param {boolean} Pass 'true' if you want to show an error alert. + * @returns {void} + */ + applyDVRules(range: string,values: Array,type: string,required: boolean,showErrorAlert: boolean): void; + + /** This method is used to clear the applied validation rules in a specified range of cells in the Spreadsheet. + * @param {string} Optional. If range is specified, it will clear rules for the specified range else it will use the current selected range. + * @returns {void} + */ + clearDV(range: string): void; + + /** This method is used to highlight invalid data in a specified range of cells in the Spreadsheet. + * @param {string} Optional. If range is specified, it will clear rules for the specified range else it will use the current selected range. + * @returns {void} + */ + highlightInvalidData(range: string): void; +} + +export interface Model { + + /**Gets or sets an active sheet index in the Spreadsheet. By defining this value, you can specify which sheet should be active in workbook. + * @Default {1} + */ + activeSheetIndex?: number; + + /**Gets or sets a value that indicates whether to enable or disable auto rendering of cell type in the Spreadsheet. + * @Default {false} + */ + allowAutoCellType?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable auto fill feature in the Spreadsheet. + * @Default {true} + */ + allowAutoFill?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable auto sum feature in the Spreadsheet. + * @Default {true} + */ + allowAutoSum?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable cell format feature in the Spreadsheet. By enabling this, you can customize styles and number formats. + * @Default {true} + */ + allowCellFormatting?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable cell type feature in the Spreadsheet. + * @Default {false} + */ + allowCellType?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable chart feature in the Spreadsheet. By enabling this feature, you can create and customize charts in Spreadsheet. + * @Default {true} + */ + allowCharts?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable clipboard feature in the Spreadsheet. By enabling this feature, you can perform cut/copy and paste operations in Spreadsheet. + * @Default {true} + */ + allowClipboard?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable comment feature in the Spreadsheet. By enabling this, you can add/delete/modify comments in Spreadsheet. + * @Default {true} + */ + allowComments?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable Conditional Format feature in the Spreadsheet. By enabling this, you can apply formatting to the selected range of cells based on the provided conditions (Greater than, Less than, Equal, Between, Contains, etc.).Note: allowCellFormatting must be true while using conditional formatting. + * @Default {true} + */ + allowConditionalFormats?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable data validation feature in the Spreadsheet. + * @Default {true} + */ + allowDataValidation?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable the delete action in the Spreadsheet. By enabling this feature, you can delete existing rows, columns, cells and sheet. + * @Default {true} + */ + allowDelete?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable drag and drop feature in the Spreadsheet. + * @Default {true} + */ + allowDragAndDrop?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable the edit action in the Spreadsheet. + * @Default {true} + */ + allowEditing?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable filtering feature in the Spreadsheet. Filtering can be used to limit the data displayed using required criteria. + * @Default {true} + */ + allowFiltering?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable table feature in the Spreadsheet. By enabling this, you can render table in selected range. + * @Default {true} + */ + allowFormatAsTable?: boolean; + + /**Get or sets a value that indicates whether to enable or disable format painter feature in the Spreadsheet. By enabling this feature, you can copy the format from the selected range and apply it to another range. + * @Default {true} + */ + allowFormatPainter?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable formula bar in the Spreadsheet. + * @Default {true} + */ + allowFormulaBar?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable freeze pane support in Spreadsheet. After enabling this feature, you can use freeze top row, freeze first column and freeze panes options. + * @Default {true} + */ + allowFreezing?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable hyperlink feature in the Spreadsheet. By enabling this feature, you can add hyperlink which is used to easily navigate to the cell reference from one sheet to another or a web page. + * @Default {true} + */ + allowHyperlink?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable import feature in the Spreadsheet. By enabling this feature, you can open existing Spreadsheet documents. + * @Default {true} + */ + allowImport?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable the insert action in the Spreadsheet. By enabling this feature, you can insert new rows, columns, cells and sheet. + * @Default {true} + */ + allowInsert?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable keyboard navigation feature in the Spreadsheet. + * @Default {true} + */ + allowKeyboardNavigation?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable lock cell feature in the Spreadsheet. + * @Default {true} + */ + allowLockCell?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable merge feature in the Spreadsheet. + * @Default {true} + */ + allowMerging?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable resizing feature in the Spreadsheet. By enabling this feature, you can change the column width and row height by dragging its header boundaries. + * @Default {true} + */ + allowResizing?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable find and replace feature in the Spreadsheet. By enabling this, you can easily find and replace a specific value in the sheet or workbook. By using goto behavior, you can select and highlight all cells that contains specific data or data types. + * @Default {true} + */ + allowSearching?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable selection in the Spreadsheet. By enabling this feature, selected items will be highlighted. + * @Default {true} + */ + allowSelection?: boolean; + + /**Gets or sets a value that indicates whether to enable the sorting feature in the Spreadsheet. + * @Default {true} + */ + allowSorting?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable undo and redo feature in the Spreadsheet. + * @Default {true} + */ + allowUndoRedo?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable wrap text feature in the Spreadsheet. By enabling this, cell content can wrap to the next line, if the cell content exceeds the boundary of the cell. + * @Default {true} + */ + allowWrap?: boolean; + + /**Gets or sets a value that indicates to define the width of the activation panel in Spreadsheet. + * @Default {200} + */ + apWidth?: number; + + /**Gets or sets an object that indicates to customize the auto fill behavior in the Spreadsheet. + */ + autoFillSettings?: AutoFillSettings; + + /**Gets or sets an object that indicates to customize the chart behavior in the Spreadsheet. + */ + chartSettings?: ChartSettings; + + /**Gets or sets a value that defines the number of columns displayed in the sheet. + * @Default {21} + */ + columnCount?: number; + + /**Gets or sets a value that indicates to define the common width for each column in the Spreadsheet. + * @Default {60} + */ + columnWidth?: number; + + /**Gets or sets a value that indicates to render the spreadsheet with custom theme. + */ + cssClass?: string; + + /**Gets or sets a value that indicates whether to enable or disable context menu in the Spreadsheet. + * @Default {true} + */ + enableContextMenu?: boolean; + + /**Gets or sets an object that indicates to customize the exporting behavior in Spreadsheet. + */ + exportSettings?: ExportSettings; + + /**Gets or sets an object that indicates to customize the format behavior in the Spreadsheet. + */ + formatSettings?: FormatSettings; + + /**Gets or sets an object that indicates to customize the import behavior in the Spreadsheet. + */ + importSettings?: ImportSettings; + + /**Gets or sets a value that indicates whether to customizing the user interface (UI) as locale-specific in order to display regional data (i.e.) in a language and culture specific to a particular country or region. + * @Default {en-US} + */ + locale?: string; + + /**Gets or sets an object that indicates to customize the picture behavior in the Spreadsheet. + */ + pictureSettings?: PictureSettings; + + /**Gets or sets an object that indicates to customize the print option in Spreadsheet. + */ + printSettings?: PrintSettings; + + /**Gets or sets a value that indicates whether to define the number of rows to be displayed in the sheet. + * @Default {20} + */ + rowCount?: number; + + /**Gets or sets a value that indicates to define the common height for each row in the sheet. + * @Default {20} + */ + rowHeight?: number; + + /**Gets or sets an object that indicates to customize the scroll options in the Spreadsheet. + */ + scrollSettings?: ScrollSettings; + + /**Gets or sets an object that indicates to customize the selection options in the Spreadsheet. + */ + selectionSettings?: SelectionSettings; + + /**Gets or sets a value that indicates to define the number of sheets to be created at the initial load. + * @Default {1} + */ + sheetCount?: number; + + /**Gets or sets an object that indicates to customize the sheet behavior in Spreadsheet. + */ + sheets?: Array; + + /**Gets or sets a value that indicates whether to show or hide ribbon in the Spreadsheet. + * @Default {true} + */ + showRibbon?: boolean; + + /**This is used to set the number of undo-redo steps in the Spreadsheet. + * @Default {20} + */ + undoRedoStep?: number; + + /**Define the username for the Spreadsheet which is displayed in comment. + * @Default {User Name} + */ + userName?: string; + + /**Triggered for every action before its starts.*/ + actionBegin? (e: ActionBeginEventArgs): void; + + /**Triggered for every action complete.*/ + actionComplete? (e: ActionCompleteEventArgs): void; + + /**Triggered when the auto fill operation begins.*/ + autoFillBegin? (e: AutoFillBeginEventArgs): void; + + /**Triggered when the auto fill operation completes.*/ + autoFillComplete? (e: AutoFillCompleteEventArgs): void; + + /**Triggered before the cells to be formatted.*/ + beforeCellFormat? (e: BeforeCellFormatEventArgs): void; + + /**Triggered before the cell selection.*/ + beforeCellSelect? (e: BeforeCellSelectEventArgs): void; + + /**Triggered before the selected cells are dropped.*/ + beforeDrop? (e: BeforeDropEventArgs): void; + + /**Triggered before the contextmenu is open.*/ + beforeOpen? (e: BeforeOpenEventArgs): void; + + /**Triggered before the activation panel is open.*/ + beforePanelOpen? (e: BeforePanelOpenEventArgs): void; + + /**Triggered when click on sheet cell.*/ + cellClick? (e: CellClickEventArgs): void; + + /**Triggered when the cell is edited.*/ + cellEdit? (e: CellEditEventArgs): void; + + /**Triggered when mouse hover on cell in sheets.*/ + cellHover? (e: CellHoverEventArgs): void; + + /**Triggered when save the edited cell.*/ + cellSave? (e: CellSaveEventArgs): void; + + /**Triggered when click the contextmenu items.*/ + contextMenuClick? (e: ContextMenuClickEventArgs): void; + + /**Triggered when the selected cells are being dragged.*/ + drag? (e: DragEventArgs): void; + + /**Triggered when the selected cells are initiated to drag.*/ + dragStart? (e: DragStartEventArgs): void; + + /**Triggered when the selected cells are dropped.*/ + drop? (e: DropEventArgs): void; + + /**Triggered before the range editing starts.*/ + editRangeBegin? (e: EditRangeBeginEventArgs): void; + + /**Triggered after range editing completes.*/ + editRangeComplete? (e: EditRangeCompleteEventArgs): void; + + /**Triggered before the sheet is loaded.*/ + load? (e: LoadEventArgs): void; + + /**Triggered after the sheet is loaded.*/ + loadComplete? (e: LoadCompleteEventArgs): void; + + /**Triggered every click of the menu item.*/ + menuClick? (e: MenuClickEventArgs): void; + + /**Triggered when import sheet is failed to open.*/ + openFailure? (e: OpenFailureEventArgs): void; + + /**Triggered when pager item is clicked in the Spreadsheet.*/ + pagerClick? (e: PagerClickEventArgs): void; + + /**Triggered when click on the ribbon.*/ + ribbonClick? (e: RibbonClickEventArgs): void; + + /**Triggered when the chart series rendering.*/ + seriesRendering? (e: SeriesRenderingEventArgs): void; + + /**Triggered when click the ribbon tab.*/ + tabClick? (e: TabClickEventArgs): void; + + /**Triggered when select the ribbon tab.*/ + tabSelect? (e: TabSelectEventArgs): void; +} + +export interface ActionBeginEventArgs { + + /**Returns the applied style format object. + */ + afterFormat?: any; + + /**Returns the applied style format object. + */ + beforeFormat?: any; + + /**Returns the sheet index. + */ + sheetIdx?: number; + + /**Returns the cell range. + */ + range?: Array; + + /**Returns the action format. + */ + reqType?: string; + + /**Returns goto index while paging. + */ + gotoIdx?: number; + + /**Returns boolean value. If create new sheet it returns true. + */ + newSheet?: boolean; + + /**Return column name while sorting. + */ + columnName?: string; + + /**Returns selected columns while sorting or filtering begins. + */ + colSelected?: number; + + /**Returns sort direction while sort action begins. + */ + sortDirection?: string; +} + +export interface ActionCompleteEventArgs { + + /**Returns Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the applied cell format object. + */ + selectedCell?: Array|any; + + /**Returns the sheet index. + */ + sheetIdx?: number; + + /**Returns the request type. + */ + reqType?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface AutoFillBeginEventArgs { + + /**Returns auto fill begin cell range. + */ + dataRange?: Array; + + /**Returns which direction drag the auto fill. + */ + direction?: string; + + /**Returns fill cells range. + */ + fillRange?: Array; + + /**Returns the auto fill type. + */ + fillType?: string; + + /**Returns the sheet index. + */ + sheetIdx?: number; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface AutoFillCompleteEventArgs { + + /**Returns auto fill begin cell range. + */ + dataRange?: Array; + + /**Returns which direction to drag the auto fill. + */ + direction?: string; + + /**Returns fill cells range. + */ + fillRange?: Array; + + /**Returns the auto fill type. + */ + fillType?: string; + + /**Returns the sheet index. + */ + sheetIdx?: number; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface BeforeCellFormatEventArgs { + + /**Returns the sheet index. + */ + sheetIdx?: number; + + /**Returns the applied style format object. + */ + format?: any; + + /**Returns the selected cells. + */ + cells?: Array|any; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface BeforeCellSelectEventArgs { + + /**Returns the previous cell range. + */ + prevRange?: Array; + + /**Returns the current cell range. + */ + currRange?: Array; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface BeforeDropEventArgs { + + /**Returns the sheet index. + */ + sheetIdx?: number; + + /**Returns the current cell row and column index. + */ + currentCell?: any; + + /**Returns the drag cells range object. + */ + dragAndDropRange?: any; + + /**Returns the cell Overwriting alert option value. + */ + preventAlert?: boolean; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the target item. + */ + target?: HTMLElement; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface BeforeOpenEventArgs { + + /**Returns the target element. + */ + target?: HTMLElement; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface BeforePanelOpenEventArgs { + + /**Returns the sheet index. + */ + sheetIdx?: number; + + /**Returns the activation panel element. + */ + activationPanel?: any; + + /**Returns the range option value. + */ + range?: any; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface CellClickEventArgs { + + /**Returns the click cell element. + */ + cell?: HTMLElement; + + /**Returns the column index of clicked cell. + */ + columnIndex?: number; + + /**Returns the row index of clicked cell. + */ + rowIndex?: number; + + /**Returns the column name of clicked cell. + */ + columnName?: string; + + /**Returns the column information. + */ + columnObject?: any; +} + +export interface CellEditEventArgs { + + /**Returns the click cell element. + */ + cell?: HTMLElement; + + /**Returns the columnName of clicked cell. + */ + columnName?: string; + + /**Returns the column field information. + */ + columnObject?: any; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface CellHoverEventArgs { + + /**Returns the target element. + */ + target?: HTMLElement; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface CellSaveEventArgs { + + /**Returns the save cell element. + */ + cell?: HTMLElement; + + /**Returns the columnName of clicked cell. + */ + columnName?: string; + + /**Returns the column field information. + */ + columnObject?: any; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the cell previous value. + */ + pValue?: string; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the cell value. + */ + value?: string; +} + +export interface ContextMenuClickEventArgs { + + /**Returns target element Id. + */ + Id?: string; + + /**Returns the target element. + */ + element?: HTMLElement; + + /**Returns event information. + */ + event?: any; + + /**Returns target element and event information. + */ + events?: any; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns target element parent Id. + */ + parentId?: string; + + /**Returns target element parent text. + */ + parentText?: string; + + /**Returns target element text. + */ + text?: string; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface DragEventArgs { + + /**Returns the sheet index. + */ + sheetIdx?: number; + + /**Returns the current cell row and column index. + */ + currentCell?: any; + + /**Returns the drag cells range object. + */ + dragAndDropRange?: any; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the target item. + */ + target?: HTMLElement; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface DragStartEventArgs { + + /**Returns the sheet index. + */ + sheetIdx?: number; + + /**Returns the current cell row and column index. + */ + currentCell?: any; + + /**Returns the drag cells range object. + */ + dragAndDropRange?: any; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the target item. + */ + target?: HTMLElement; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface DropEventArgs { + + /**Returns the sheet index. + */ + sheetIdx?: number; + + /**Returns the current cell row and column index. + */ + currentCell?: any; + + /**Returns the drag cells range object. + */ + dragAndDropRange?: any; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the target item. + */ + target?: HTMLElement; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface EditRangeBeginEventArgs { + + /**Returns the sheet index. + */ + sheetIdx?: number; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the range option value. + */ + range?: any; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface EditRangeCompleteEventArgs { + + /**Returns the sheet index. + */ + sheetIdx?: number; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the range option value. + */ + range?: any; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface LoadEventArgs { + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the active sheet index. + */ + sheetIndex?: number; +} + +export interface LoadCompleteEventArgs { + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface MenuClickEventArgs { + + /**Returns menu click element. + */ + element?: HTMLElement; + + /**Returns the event information. + */ + event?: any; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns target element parent Id. + */ + parentId?: string; + + /**Returns target element parent text. + */ + parentText?: string; + + /**Returns target element text. + */ + text?: string; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface OpenFailureEventArgs { + + /**Returns the failure type. + */ + failureType?: string; + + /**Returns the status index. + */ + status?: number; + + /**Returns the status in text. + */ + statusText?: string; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface PagerClickEventArgs { + + /**Returns the active sheet index. + */ + activeSheet?: number; + + /**Returns the new sheet index. + */ + gotoSheet?: number; + + /**Returns whether new sheet icon is clicked. + */ + newSheet?: boolean; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface RibbonClickEventArgs { + + /**Returns element Id. + */ + Id?: string; + + /**Returns target information. + */ + prop?: any; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns status. + */ + status?: boolean; + + /**Returns isChecked in boolean. + */ + isChecked?: boolean; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface SeriesRenderingEventArgs { + + /**Returns chart data and chart information. + */ + data?: any; + + /**Returns the chart model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface TabClickEventArgs { + + /**Returns the active tab index. + */ + activeIndex?: number; + + /**Returns active tab header element. + */ + activeHeader?: any; + + /**Returns previous active tab header element. + */ + prevActiveHeader?: any; + + /**Returns previous active tab index. + */ + prevActiveIndex?: number; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface TabSelectEventArgs { + + /**Returns the active tab index. + */ + activeIndex?: number; + + /**Returns active tab header element. + */ + activeHeader?: any; + + /**Returns previous active tab header element. + */ + prevActiveHeader?: any; + + /**Returns previous active tab index. + */ + prevActiveIndex?: number; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface AutoFillSettings { + + /**This property is used to set fillType unit in Spreadsheet. It has five types which are CopyCells, FillSeries, FillFormattingOnly, FillWithoutFormatting and FlashFill. + * @Default {ej.Spreadsheet.AutoFillOptions.FillSeries} + */ + fillType?: ej.Spreadsheet.AutoFillOptions|string; + + /**Gets or sets a value that indicates to enable or disable auto fill options in the Spreadsheet. + * @Default {true} + */ + showFillOptions?: boolean; +} + +export interface ChartSettings { + + /**Gets or sets a value that defines the chart height in Spreadsheet. + * @Default {220} + */ + height?: number; + + /**Gets or sets a value that defines the chart width in the Spreadsheet. + * @Default {440} + */ + width?: number; +} + +export interface ExportSettings { + + /**Gets or sets a value that indicates whether to enable or disable save feature in Spreadsheet. By enabling this feature, you can save existing Spreadsheet. + * @Default {true} + */ + allowExporting?: boolean; + + /**Gets or sets a value that indicates to define csvUrl for export to csv format. + * @Default {null} + */ + csvUrl?: string; + + /**Gets or sets a value that indicates to define excelUrl for export to excel format.Note: User must specify allowExporting true while use this property. + * @Default {null} + */ + excelUrl?: string; + + /**Gets or sets a value that indicates to define password while export to excel format. + * @Default {null} + */ + password?: string; +} + +export interface FormatSettings { + + /**Gets or sets a value that indicates whether to enable or disable cell border feature in the Spreadsheet. + * @Default {true} + */ + allowCellBorder?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable decimal places in the Spreadsheet. + * @Default {true} + */ + allowDecimalPlaces?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable font family feature in Spreadsheet. + * @Default {true} + */ + allowFontFamily?: boolean; +} + +export interface ImportSettings { + + /**Sets import mapper to perform import feature in Spreadsheet. + */ + importMapper?: string; + + /**Sets import Url to access the online files in the Spreadsheet. + */ + importUrl?: string; + + /**Gets or sets a value that indicates to define password while importing in the Spreadsheet. + */ + password?: string; +} + +export interface PictureSettings { + + /**Gets or sets a value that indicates whether to enable or disable picture feature in Spreadsheet. By enabling this, you can add pictures in Spreadsheet. + * @Default {true} + */ + allowPictures?: boolean; + + /**Gets or sets a value that indicates to define height to picture in the Spreadsheet. + * @Default {220} + */ + height?: number; + + /**Gets or sets a value that indicates to define width to picture in the Spreadsheet. + * @Default {440} + */ + width?: number; +} + +export interface PrintSettings { + + /**Gets or sets a value that indicates whether to enable or disable page setup support for printing in Spreadsheet. + * @Default {true} + */ + allowPageSetup?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable page size support for printing in Spreadsheet. + * @Default {false} + */ + allowPageSize?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable print feature in the Spreadsheet. + * @Default {true} + */ + allowPrinting?: boolean; +} + +export interface ScrollSettings { + + /**Gets or sets a value that indicates whether to enable or disable scrolling in Spreadsheet. + * @Default {true} + */ + allowScrolling?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable sheet on demand. By enabling this, it render only the active sheet element while paging remaining sheets are created one by one. + * @Default {false} + */ + allowSheetOnDemand?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable virtual scrolling feature in the Spreadsheet. + * @Default {true} + */ + allowVirtualScrolling?: boolean; + + /**Gets or sets the value that indicates to define the height of spreadsheet. + * @Default {550} + */ + height?: number|string; + + /**Gets or sets the value that indicates whether to enable or disable responsive mode in the Spreadsheet. + * @Default {false} + */ + isResponsive?: boolean; + + /**Gets or sets a value that indicates to set scroll mode in Spreadsheet. It has two scroll modes, Normal and Infinite. + * @Default {ej.Spreadsheet.scrollMode.Infinite} + */ + scrollMode?: ej.Spreadsheet.scrollMode|string; + + /**Gets or sets the value that indicates to define the height off spreadsheet. + * @Default {1200} + */ + width?: number|string; +} + +export interface SelectionSettings { + + /**Gets or sets a value that indicates to define active cell in spreadsheet. + */ + activeCell?: string; + + /**Gets or sets a value that indicates to define animation time while selection in the Spreadsheet. + * @Default {0.001} + */ + animationTime?: number; + + /**Gets or sets a value that indicates to enable or disable animation while selection.Note: allowSelection must be true while using this property. + * @Default {false} + */ + enableAnimation?: boolean; + + /**Gets or sets a value that indicates to set selection type in Spreadsheet. It has three types which are Column, Row and default. + * @Default {ej.Spreadsheet.SelectionType.Default} + */ + selectionType?: ej.Spreadsheet.SelectionType|string; + + /**Gets or sets a value that indicates to set selection unit in Spreadsheet. It has three types which are Single, Range and MultiRange. + * @Default {ej.Spreadsheet.SelectionUnit.MultiRange} + */ + selectionUnit?: ej.Spreadsheet.SelectionUnit|string; +} + +export interface SheetsRangeSettings { + + /**Gets or sets the data to render the Spreadsheet. + */ + dataSource?: any; + + /**Specifies the header styles for the datasource range in Spreadsheet. + * @Default {null} + */ + headerStyles?: any; + + /**Specifies the primary key for the datasource in Spreadsheet. + */ + primaryKey?: string; + + /**Specifies the query for the datasource in Spreadsheet. + * @Default {null} + */ + query?: any; + + /**Gets or sets a value that indicates whether to enable or disable the datasource header in Spreadsheet. + * @Default {false} + */ + showHeader?: boolean; + + /**Specifies the start cell for the datasource range in Spreadsheet. + * @Default {A1} + */ + startCell?: string; +} + +export interface Sheets { + + /**Gets or sets a value that indicates to define column count in the Spreadsheet. + * @Default {21} + */ + colCount?: number; + + /**Gets or sets a value that indicates to define column width in the Spreadsheet. + * @Default {64} + */ + columnWidth?: number; + + /**Gets or sets the data to render the Spreadsheet. + */ + dataSource?: any; + + /**Gets or sets a value that indicates whether to enable or disable field as column header in the Spreadsheet. + * @Default {false} + */ + fieldAsColumnHeader?: boolean; + + /**Specifies the header styles for the datasource range in Spreadsheet. + * @Default {null} + */ + headerStyles?: any; + + /**Specifies the primary key for the datasource in Spreadsheet. + */ + primaryKey?: string; + + /**Specifies the query for the datasource in Spreadsheet. + * @Default {null} + */ + query?: any; + + /**Specifies single range or multiple range settings for a sheet in Spreadsheet. + */ + rangeSettings?: Array; + + /**Gets or sets a value that indicates to define row count in the Spreadsheet. + * @Default {20} + */ + rowCount?: number; + + /**Gets or sets a value that indicates whether to show or hide grid lines in the Spreadsheet. + * @Default {true} + */ + showGridlines?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable the datasource header in Spreadsheet. + * @Default {false} + */ + showHeader?: boolean; + + /**Gets or sets a value that indicates whether to show or hide headings in the Spreadsheet. + * @Default {true} + */ + showHeadings?: boolean; + + /**Specifies the start cell for the datasource range in Spreadsheet. + * @Default {A1} + */ + startCell?: string; +} + +enum AutoFillOptions{ + + ///Specifies the CopyCells property in AutoFillOptions. + CopyCells, + + ///Specifies the FillSeries property in AutoFillOptions. + FillSeries, + + ///Specifies the FillFormattingOnly property in AutoFillOptions. + FillFormattingOnly, + + ///Specifies the FillWithoutFormatting property in AutoFillOptions. + FillWithoutFormatting, + + ///Specifies the FlashFill property in AutoFillOptions. + FlashFill +} + + +enum scrollMode{ + + ///To enable Infinite scroll mode for Spreadsheet. + Infinite, + + ///To enable Normal scroll mode for Spreadsheet. + Normal +} + + +enum SelectionType{ + + ///To select only Column in Spreadsheet. + Column, + + ///To select only Row in Spreadsheet. + Row, + + ///To select both Column/Row in Spreadsheet. + Default +} + + +enum SelectionUnit{ + + ///To enable Single selection in Spreadsheet. + Single, + + ///To enable Range selection in Spreadsheet. + Range, + + ///To enable MultiRange selection in Spreadsheet. + MultiRange +} + +} + +} +declare module ej.olap { + +class OlapChart extends ej.Widget { + static fn: OlapChart; + constructor(element: JQuery, options?: OlapChart.Model); + constructor(element: Element, options?: OlapChart.Model); + model:OlapChart.Model; + defaults:OlapChart.Model; + + /** Perform an asynchronous HTTP (AJAX) request. + * @returns {void} + */ + doAjaxPost(): void; + + /** Perform an asynchronous HTTP (FullPost) submit. + * @returns {void} + */ + doPostBack(): void; + + /** Exports the OlapChart to an appropriate format based on the parameter passed. + * @returns {void} + */ + exportOlapChart(): void; + + /** This function receives the JSON formatted datasource to render the OlapChart control. + * @returns {void} + */ + renderChartFromJSON(): void; + + /** This function receives the update from service-end, which would be utilized for rendering the widget. + * @returns {void} + */ + renderControlSuccess(): void; +} +export module OlapChart{ + +export interface Model { + + /**Specifies the CSS class to OlapChart to achieve custom theme. + * @Default {“”} + */ + cssClass?: string; + + /**Contains the serialized OlapReport at that instant, that is, current OlapReport. + * @Default {“”} + */ + currentReport?: string; + + /**Object utilized to pass additional information between client-end and service-end. + * @Default {{}} + */ + customObject?: any; + + /**Allows the user to enable 3D view of OlapChart. + * @Default {false} + */ + enable3D?: boolean; + + /**Allows the user to enable OlapChart’s responsiveness in the browser layout. + * @Default {false} + */ + isResponsive?: boolean; + + /**Allows the user to set the localized language for the widget. + * @Default {en-US} + */ + locale?: string; + + /**Allows the user to rotate the angle of OlapChart in 3D view. + * @Default {0} + */ + rotation?: number; + + /**Allows the user to set custom name for the methods at service-end, communicated on AJAX post. + * @Default {{}} + */ + serviceMethodSettings?: ServiceMethodSettings; + + /**Connects the service using the specified URL for any server updates. + * @Default {“”} + */ + url?: string; + + /**Triggers when it reaches client-side after any AJAX request.*/ + afterServiceInvoke? (e: AfterServiceInvokeEventArgs): void; + + /**Triggers before any AJAX request is passed from OlapChart to service methods.*/ + beforeServiceInvoke? (e: BeforeServiceInvokeEventArgs): void; + + /**Triggers when drill up/down happens in OlapChart control.*/ + drillSuccess? (e: DrillSuccessEventArgs): void; + + /**Triggers when OlapChart widget completes all operations at client-side after any AJAX request.*/ + renderComplete? (e: RenderCompleteEventArgs): void; + + /**Triggers when any error occurred during AJAX request.*/ + renderFailure? (e: RenderFailureEventArgs): void; + + /**Triggers when OlapChart successfully reaches client-side after any AJAX request.*/ + renderSuccess? (e: RenderSuccessEventArgs): void; +} + +export interface AfterServiceInvokeEventArgs { + + /**return the current action of OlapChart control. + */ + action?: string; + + /**return the custom object bounds with OlapChart control. + */ + customObject?: any; + + /**return the outer HTML of OlapChart control. + */ + element?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the OlapChart model. + */ + model?: ej.olap.OlapChart.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface BeforeServiceInvokeEventArgs { + + /**return the current action of OlapChart control. + */ + action?: string; + + /**return the custom object bounds with OlapChart control. + */ + customObject?: any; + + /**return the outer HTML of OlapChart control. + */ + element?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the OlapChart model. + */ + model?: ej.olap.OlapChart.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface DrillSuccessEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the OlapChart model. + */ + model?: ej.olap.OlapChart.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface RenderCompleteEventArgs { + + /**return the current action of OlapChart control. + */ + action?: string; + + /**return the custom object bounds with OlapChart control. + */ + customObject?: any; + + /**return the outer HTML of OlapChart control. + */ + element?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the OlapChart model. + */ + model?: ej.olap.OlapChart.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface RenderFailureEventArgs { + + /**return the current action of OlapChart control. + */ + action?: string; + + /**return the custom object bounds with OlapChart control. + */ + customObject?: any; + + /**return the error stack trace of the original exception. + */ + message?: any; + + /**return the outer HTML of OlapChart control. + */ + element?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the OlapChart model. + */ + model?: ej.olap.OlapChart.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface RenderSuccessEventArgs { + + /**return the current action of OlapChart control. + */ + action?: string; + + /**return the custom object bounds with OlapChart control. + */ + customObject?: any; + + /**return the outer HTML of OlapChart control. + */ + element?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the OlapChart model. + */ + model?: ej.olap.OlapChart.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface ServiceMethodSettings { + + /**Allows the user to set the custom name for the service method that’s responsible for exporting. + * @Default {Export} + */ + exportOlapChart?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for drilling up/down operation in OlapChart. + * @Default {DrillChart} + */ + drillDown?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for initializing OlapChart. + * @Default {InitializeChart} + */ + initialize?: string; +} +} + +class OlapClient extends ej.Widget { + static fn: OlapClient; + constructor(element: JQuery, options?: OlapClient.Model); + constructor(element: Element, options?: OlapClient.Model); + model:OlapClient.Model; + defaults:OlapClient.Model; + + /** Perform an asynchronous HTTP (AJAX) request. + * @returns {void} + */ + doAjaxPost(): void; + + /** Perform an asynchronous HTTP (FullPost) submit. + * @returns {void} + */ + doPostBack(): void; +} +export module OlapClient{ + +export interface Model { + + /**Allows the user to set the specific chart type for OlapChart. + * @Default {ej.olap.OlapChart.ChartTypes.Column} + */ + chartType?: ej.olap.OlapChart.ChartTypes|string; + + /**Sets the mode to export the OLAP visualization components such as OlapChart and PivotGrid in OlapClient. Based on the option, either Chart or Grid or both gets exported. + * @Default {ej.olap.OlapClient.ClientExportMode.ChartAndGrid} + */ + clientExportMode?: string; + + /**Specifies the CSS class to OlapClient to achieve custom theme. + * @Default {“”} + */ + cssClass?: string; + + /**Object utilized to pass additional information between client-end and service-end. + * @Default {{}} + */ + customObject?: any; + + /**Allows the user to customize the widgets layout and appearance. + * @Default {{}} + */ + displaySettings?: DisplaySettings; + + /**Allows the user to refresh the control on-demand and not during every UI operation. + * @Default {false} + */ + enableDeferUpdate?: boolean; + + /**Enables/disables the visibility of measure group selector drop-down in Cube Browser. + * @Default {false} + */ + enableMeasureGroups?: boolean; + + /**Sets the summary layout for PivotGrid. Following are the ways in which summary can be positioned: normal summary (bottom), top summary, no summary and excel-like summary. + * @Default {ej.PivotGrid.Layout.Normal} + */ + gridLayout?: ej.PivotGrid.Layout|string; + + /**Allows the user to set the localized language for the widget. + * @Default {en-US} + */ + locale?: string; + + /**Allows the user to set custom name for the methods at service-end, communicated during AJAX post. + * @Default {{}} + */ + serviceMethodSettings?: ServiceMethodSettings; + + /**Sets the title for OlapClient widget. + * @Default {null} + */ + title?: string; + + /**Connects the service using the specified URL for any server updates. + * @Default {null} + */ + url?: string; + + /**Triggers when it reaches client-side after any AJAX request.*/ + afterServiceInvoke? (e: AfterServiceInvokeEventArgs): void; + + /**Triggers before any AJAX request is passed from OlapClient to service methods.*/ + beforeServiceInvoke? (e: BeforeServiceInvokeEventArgs): void; + + /**Triggers before rendering the OlapChart.*/ + chartLoad? (e: ChartLoadEventArgs): void; + + /**Triggers while we initiate loading of the widget.*/ + load? (e: LoadEventArgs): void; + + /**Triggers when OlapClient widget completes all operations at client-end after any AJAX request.*/ + renderComplete? (e: RenderCompleteEventArgs): void; + + /**Triggers when any error occurred during AJAX request.*/ + renderFailure? (e: RenderFailureEventArgs): void; + + /**Triggers when OlapClient successfully reaches client-side after any AJAX request.*/ + renderSuccess? (e: RenderSuccessEventArgs): void; +} + +export interface AfterServiceInvokeEventArgs { + + /**return the current action of OlapClient control. + */ + action?: string; + + /**return the custom object bounds with OlapClient control. + */ + customObject?: any; + + /**return the outer HTML of OlapClient control. + */ + element?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the OlapClient model. + */ + model?: ej.olap.OlapClient.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface BeforeServiceInvokeEventArgs { + + /**return the current action of OlapClient control. + */ + action?: string; + + /**return the custom object bounds with OlapClient control. + */ + customObject?: any; + + /**return the outer HTML of OlapClient control. + */ + element?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the OlapClient model. + */ + model?: ej.olap.OlapClient.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface ChartLoadEventArgs { + + /**return the current action of OlapChart control. + */ + action?: string; + + /**return the custom object bounds with OlapChart control. + */ + customObject?: any; + + /**return the outer HTML of OlapChart control. + */ + element?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the OlapChart model. + */ + model?: ej.olap.OlapClient.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface LoadEventArgs { + + /**returns the outer HTML of OlapClient component. + */ + element?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the OlapClient model. + */ + model?: ej.olap.OlapClient.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface RenderCompleteEventArgs { + + /**returns the custom object bounded with the control. + */ + customObject?: any; + + /**returns the outer HTML of OlapClient control. + */ + element?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the OlapClient model. + */ + model?: ej.olap.OlapClient.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface RenderFailureEventArgs { + + /**returns the custom object bounded with the control. + */ + customObject?: any; + + /**returns the outer HTML of OlapClient control. + */ + element?: string; + + /**returns the error message with error code. + */ + message?: any; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the OlapClient model. + */ + model?: ej.olap.OlapClient.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface RenderSuccessEventArgs { + + /**returns the custom object bounded with the control. + */ + customObject?: any; + + /**returns the outer HTML of OlapClient control. + */ + element?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the OlapClient model. + */ + model?: ej.olap.OlapClient.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface DisplaySettings { + + /**Let’s the user to customize the display of OlapChart and PivotGrid widgets, either in tab view or in tile view. + * @Default {ej.olap.OlapClient.ControlPlacement.Tab} + */ + controlPlacement?: ej.olap.OlapClient.ControlPlacement|string; + + /**Let’s the user to set either Chart or Grid as the start-up widget. + * @Default {ej.olap.OlapClient.DefaultView.Grid} + */ + defaultView?: ej.olap.OlapClient.DefaultView|string; + + /**Enables/disables the full screen view of OlapChart and PivotGrid in OlapClient. + * @Default {false} + */ + enableFullScreen?: boolean; + + /**Enhances the space for PivotGrid and OlapChart, by hiding Cube Browser and Axis Element Builder. + * @Default {false} + */ + enableTogglePanel?: boolean; + + /**Allows the user to enable OlapClient’s responsiveness in the browser layout. + * @Default {false} + */ + isResponsive?: boolean; + + /**Sets the display mode (Only Chart/Only Grid/Both) in OlapClient. + * @Default {ej.olap.OlapClient.DisplayMode.ChartAndGrid} + */ + mode?: ej.olap.OlapClient.DisplayMode|string; +} + +export interface ServiceMethodSettings { + + /**Allows the user to set the custom name for the service method that’s responsible for updating the entire report and widget, while changing the Cube. + * @Default {CubeChanged} + */ + cubeChanged?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for exporting. + * @Default {Export} + */ + exportOlapClient?: string; + + /**Allows the user to set the custom name for the service method that’s responsible to get the members, for the tree-view inside member-editor dialog. + * @Default {FetchMemberTreeNodes} + */ + fetchMemberTreeNodes?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for fetching the report names from the database. + * @Default {FetchReportListFromDB} + */ + fetchReportList?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for updating report while filtering members. + * @Default {FilterElement} + */ + filterElement?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for initializing OlapClient. + * @Default {InitializeClient} + */ + initialize?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for loading the report collection from the database. + * @Default {LoadReportFromDB} + */ + loadReport?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for retrieving the MDX query for the current report. + * @Default {GetMDXQuery} + */ + mdxQuery?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for updating the tree-view inside Cube Browser, while changing the measure group. + * @Default {MeasureGroupChanged} + */ + measureGroupChanged?: string; + + /**Allows the user to set the custom name for the service method that’s responsible to get the child members, on tree-view node expansion. + * @Default {MemberExpanded} + */ + memberExpand?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for updating report while dropping a node/SplitButton inside Axis Element Builder. + * @Default {NodeDropped} + */ + nodeDropped?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for updating report while removing SplitButton from Axis Element Builder. + * @Default {RemoveSplitButton} + */ + removeSplitButton?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for saving the report collection to database. + * @Default {SaveReportToDB} + */ + saveReport?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for toggling the elements in row and column axes. + * @Default {ToggleAxis} + */ + toggleAxis?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for any toolbar operation. + * @Default {ToolbarOperations} + */ + toolbarServices?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for updating report collection. + * @Default {UpdateReport} + */ + updateReport?: string; +} +} +module OlapChart +{ +enum ChartTypes +{ +//To render a Line type for OlapChart. +Line, +//To render a Spline type for OlapChart. +Spline, +//To render a Column type for OlapChart. +Column, +//To render a Area type for OlapChart. +Area, +//To render a SplineArea type for OlapChart. +SplineArea, +//To render a StepLine type for OlapChart. +StepLine, +//To render a StepArea type for OlapChart. +StepArea, +//To render a Pie type for OlapChart. +Pie, +//To render a Bar type for OlapChart. +Bar, +//To render a StackingArea type for OlapChart. +StackingArea, +//To render a StackingColumn type for OlapChart. +StackingColumn, +//To render a StackingBar type for OlapChart. +StackingBar, +//To render a Pyramid type for OlapChart. +Pyramid, +//To render a Funnel type for OlapChart. +Funnel, +//To render a Doughnut type for OlapChart. +Doughnut, +//To render a Scatter type for OlapChart. +Scatter, +//To render a Bubble type for OlapChart. +Bubble, +} +} +module OlapClient +{ +enum ControlPlacement +{ +//To display OlapChart and PivotGrid widgets in tab view. +Tab, +//To display OlapChart and PivotGrid widgets within the same view, one below the other. +Tile, +} +} +module OlapClient +{ +enum DefaultView +{ +//To set OlapChart as a default control in view when the OlapClient widget is loaded for the first time. +Chart, +//To set PivotGrid as a default control in view when the OlapClient widget is loaded for the first time. +Grid, +} +} +module OlapClient +{ +enum DisplayMode +{ +//To display only OlapChart widget. +ChartOnly, +//To display only PivotGrid widget. +GridOnly, +//To display both OlapChart and PivotGrid widgets. +ChartAndGrid, +} +} + +class OlapGauge extends ej.Widget { + static fn: OlapGauge; + constructor(element: JQuery, options?: OlapGauge.Model); + constructor(element: Element, options?: OlapGauge.Model); + model:OlapGauge.Model; + defaults:OlapGauge.Model; + + /** Perform an asynchronous HTTP (AJAX) request. + * @returns {void} + */ + doAjaxPost(): void; + + /** This function is used to refresh the OlapGauge at client-side itself. + * @returns {void} + */ + refresh(): void; + + /** This function removes the KPI related images from OlapGauge. + * @returns {void} + */ + removeImg(): void; + + /** This function receives the JSON formatted datasource to render the OlapGauge control. + * @returns {void} + */ + renderControlFromJSON(): void; +} +export module OlapGauge{ + +export interface Model { + + /**Sets the number of column count to arrange the OlapGauge's. + * @Default {0} + */ + columnsCount?: number; + + /**Specify the CSS class to OlapGauge to achieve custom theme. + * @Default {“”} + */ + cssClass?: string; + + /**Object utilized to pass additional information between client-end and service-end. + * @Default {{}} + */ + customObject?: any; + + /**Enables/disables tooltip visibility in OlapGauge. + * @Default {false} + */ + enableTooltip?: boolean; + + /**Allows the user to enable OlapGauge’s responsiveness in the browser layout. + * @Default {false} + */ + isResponsive?: boolean; + + /**Allows the user to change the format of the label values in OlapGauge. + * @Default {ej.olap.OlapGauge.NumberFormat.Default} + */ + labelFormatSettings?: ej.olap.OlapGauge.NumberFormat|string; + + /**Allows the user to set the localized language for the widget. + * @Default {en-US} + */ + locale?: string; + + /**Sets the number of row count to arrange the OlapGauge's. + * @Default {0} + */ + rowsCount?: number; + + /**Sets the scale values such as pointers, indicators, etc... for OlapGauge. + * @Default {{}} + */ + scales?: any; + + /**Allows the user to set the custom name for the methods at service-end, communicated during AJAX post. + * @Default {{}} + */ + serviceMethodSettings?: ServiceMethodSettings; + + /**Enables/disables the header labels in OlapGauge. + * @Default {true} + */ + showHeaderLabel?: boolean; + + /**Connects the service using the specified URL for any server updates. + * @Default {“”} + */ + url?: string; + + /**Triggers when it reaches client-side after any AJAX request.*/ + afterServiceInvoke? (e: AfterServiceInvokeEventArgs): void; + + /**Triggers before any AJAX request is passed from OlapGauge to service methods.*/ + beforeServiceInvoke? (e: BeforeServiceInvokeEventArgs): void; + + /**Triggers when OlapGauge started loading at client-side.*/ + load? (e: LoadEventArgs): void; + + /**Triggers when OlapGauge widget completes all operations at client-side after any AJAX request.*/ + renderComplete? (e: RenderCompleteEventArgs): void; + + /**Triggers when any error occurred during AJAX request.*/ + renderFailure? (e: RenderFailureEventArgs): void; + + /**Triggers when OlapGauge successfully reaches client-side after any AJAX request.*/ + renderSuccess? (e: RenderSuccessEventArgs): void; +} + +export interface AfterServiceInvokeEventArgs { + + /**return the current action of OlapGauge control. + */ + action?: string; + + /**return the custom object bounds with OlapGauge control. + */ + customObject?: any; + + /**return the outer HTML of OlapGauge control. + */ + element?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the OlapGauge model. + */ + model?: ej.olap.OlapGauge.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface BeforeServiceInvokeEventArgs { + + /**return the current action of OlapGauge control. + */ + action?: string; + + /**return the custom object bounds with OlapGauge control. + */ + customObject?: any; + + /**return the outer HTML of OlapGauge control. + */ + element?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the OlapGauge model. + */ + model?: ej.olap.OlapGauge.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface LoadEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the OlapGauge model. + */ + model?: ej.olap.OlapGauge.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface RenderCompleteEventArgs { + + /**returns the outer HTML of OlapGauge control. + */ + element?: string; + + /**returns the custom object bounded with the control. + */ + customObject?: any; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the OlapGauge model. + */ + model?: ej.olap.OlapGauge.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface RenderFailureEventArgs { + + /**returns the outer HTML of OlapGauge control. + */ + element?: string; + + /**returns the custom object bounded with the control. + */ + customObject?: any; + + /**returns the error message with error code. + */ + message?: any; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the OlapGauge model. + */ + model?: ej.olap.OlapGauge.Model; + + /**returns the name of the event. + */ + type?: string; + + /**returns the JSON formatted response while error occurs. + */ + responseJSON?: any; +} + +export interface RenderSuccessEventArgs { + + /**returns the outer HTML of OlapGauge control. + */ + element?: string; + + /**returns the custom object bounded with the control. + */ + customObject?: any; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the OlapGauge model. + */ + model?: ej.olap.OlapGauge.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface LabelFormatSettings { + + /**Allows the user to change the number format of the label values in OlapGauge. + * @Default {ej.olap.OlapGauge.NumberFormat.Default} + */ + numberFormat?: ej.olap.OlapGauge.NumberFormat|string; + + /**Allows you to change the position of a digit on the right-hand side of the decimal point for label value. + * @Default {5} + */ + decimalPlaces?: number; + + /**Allows you to add a text at the beginning of the label. + */ + prefixText?: string; + + /**Allows you to add text at the end of the label. + */ + suffixText?: string; +} + +export interface ServiceMethodSettings { + + /**Allows the user to set the custom name for the service method that’s responsible for initializing OlapGauge. + * @Default {InitializeGauge} + */ + initialize?: string; +} +} +module OlapGauge +{ +enum NumberFormat +{ +//To set default format for label values. +Default, +//To set currency format for label values. +Currency, +//To set percentage format for label values. +Percentage, +//To set fraction format for label values. +Fraction, +//To set scientific format for label values. +Scientific, +//To set text format for label values. +Text, +//To set notation format for label values. +Notation, +} +} + +} +declare module ej.datavisualization { + +class LinearGauge extends ej.Widget { + static fn: LinearGauge; + constructor(element: JQuery, options?: LinearGauge.Model); + constructor(element: Element, options?: LinearGauge.Model); + model:LinearGauge.Model; + defaults:LinearGauge.Model; + + /** destroy the linear gauge all events bound using this._on will be unbind automatically and bring the control to pre-init state. + * @returns {void} + */ + destroy(): void; + + /** To export Image + * @returns {void} + */ + exportImage(): void; + + /** To get Bar Distance From Scale in number + * @returns {void} + */ + getBarDistanceFromScale(): void; + + /** To get Bar Pointer Value in number + * @returns {void} + */ + getBarPointerValue(): void; + + /** To get Bar Width in number + * @returns {void} + */ + getBarWidth(): void; + + /** To get CustomLabel Angle in number + * @returns {void} + */ + getCustomLabelAngle(): void; + + /** To get CustomLabel Value in string + * @returns {void} + */ + getCustomLabelValue(): void; + + /** To get Label Angle in number + * @returns {void} + */ + getLabelAngle(): void; + + /** To get LabelPlacement in number + * @returns {void} + */ + getLabelPlacement(): void; + + /** To get LabelStyle in number + * @returns {void} + */ + getLabelStyle(): void; + + /** To get Label XDistance From Scale in number + * @returns {void} + */ + getLabelXDistanceFromScale(): void; + + /** To get PointerValue in number + * @returns {void} + */ + getLabelYDistanceFromScale(): void; + + /** To get Major Interval Value in number + * @returns {void} + */ + getMajorIntervalValue(): void; + + /** To get MarkerStyle in number + * @returns {void} + */ + getMarkerStyle(): void; + + /** To get Maximum Value in number + * @returns {void} + */ + getMaximumValue(): void; + + /** To get PointerValue in number + * @returns {void} + */ + getMinimumValue(): void; + + /** To get Minor Interval Value in number + * @returns {void} + */ + getMinorIntervalValue(): void; + + /** To get Pointer Distance From Scale in number + * @returns {void} + */ + getPointerDistanceFromScale(): void; + + /** To get PointerHeight in number + * @returns {void} + */ + getPointerHeight(): void; + + /** To get Pointer Placement in String + * @returns {void} + */ + getPointerPlacement(): void; + + /** To get PointerValue in number + * @returns {void} + */ + getPointerValue(): void; + + /** To get PointerWidth in number + * @returns {void} + */ + getPointerWidth(): void; + + /** To get Range Border Width in number + * @returns {void} + */ + getRangeBorderWidth(): void; + + /** To get Range Distance From Scale in number + * @returns {void} + */ + getRangeDistanceFromScale(): void; + + /** To get Range End Value in number + * @returns {void} + */ + getRangeEndValue(): void; + + /** To get Range End Width in number + * @returns {void} + */ + getRangeEndWidth(): void; + + /** To get Range Position in number + * @returns {void} + */ + getRangePosition(): void; + + /** To get Range Start Value in number + * @returns {void} + */ + getRangeStartValue(): void; + + /** To get Range Start Width in number + * @returns {void} + */ + getRangeStartWidth(): void; + + /** To get ScaleBarLength in number + * @returns {void} + */ + getScaleBarLength(): void; + + /** To get Scale Bar Size in number + * @returns {void} + */ + getScaleBarSize(): void; + + /** To get Scale Border Width in number + * @returns {void} + */ + getScaleBorderWidth(): void; + + /** To get Scale Direction in number + * @returns {void} + */ + getScaleDirection(): void; + + /** To get Scale Location in object + * @returns {void} + */ + getScaleLocation(): void; + + /** To get Scale Style in string + * @returns {void} + */ + getScaleStyle(): void; + + /** To get Tick Angle in number + * @returns {void} + */ + getTickAngle(): void; + + /** To get Tick Height in number + * @returns {void} + */ + getTickHeight(): void; + + /** To get getTickPlacement in number + * @returns {void} + */ + getTickPlacement(): void; + + /** To get Tick Style in string + * @returns {void} + */ + getTickStyle(): void; + + /** To get Tick Width in number + * @returns {void} + */ + getTickWidth(): void; + + /** To get get Tick XDistance From Scale in number + * @returns {void} + */ + getTickXDistanceFromScale(): void; + + /** To get Tick YDistance From Scale in number + * @returns {void} + */ + getTickYDistanceFromScale(): void; + + /** Specifies the scales. + * @returns {void} + */ + scales(): void; + + /** To set setBarDistanceFromScale + * @returns {void} + */ + setBarDistanceFromScale(): void; + + /** To set setBarPointerValue + * @returns {void} + */ + setBarPointerValue(): void; + + /** To set setBarWidth + * @returns {void} + */ + setBarWidth(): void; + + /** To set setCustomLabelAngle + * @returns {void} + */ + setCustomLabelAngle(): void; + + /** To set setCustomLabelValue + * @returns {void} + */ + setCustomLabelValue(): void; + + /** To set setLabelAngle + * @returns {void} + */ + setLabelAngle(): void; + + /** To set setLabelPlacement + * @returns {void} + */ + setLabelPlacement(): void; + + /** To set setLabelStyle + * @returns {void} + */ + setLabelStyle(): void; + + /** To set setLabelXDistanceFromScale + * @returns {void} + */ + setLabelXDistanceFromScale(): void; + + /** To set setLabelYDistanceFromScale + * @returns {void} + */ + setLabelYDistanceFromScale(): void; + + /** To set setMajorIntervalValue + * @returns {void} + */ + setMajorIntervalValue(): void; + + /** To set setMarkerStyle + * @returns {void} + */ + setMarkerStyle(): void; + + /** To set setMaximumValue + * @returns {void} + */ + setMaximumValue(): void; + + /** To set setMinimumValue + * @returns {void} + */ + setMinimumValue(): void; + + /** To set setMinorIntervalValue + * @returns {void} + */ + setMinorIntervalValue(): void; + + /** To set setPointerDistanceFromScale + * @returns {void} + */ + setPointerDistanceFromScale(): void; + + /** To set PointerHeight + * @returns {void} + */ + setPointerHeight(): void; + + /** To set setPointerPlacement + * @returns {void} + */ + setPointerPlacement(): void; + + /** To set PointerValue + * @returns {void} + */ + setPointerValue(): void; + + /** To set PointerWidth + * @returns {void} + */ + setPointerWidth(): void; + + /** To set setRangeBorderWidth + * @returns {void} + */ + setRangeBorderWidth(): void; + + /** To set setRangeDistanceFromScale + * @returns {void} + */ + setRangeDistanceFromScale(): void; + + /** To set setRangeEndValue + * @returns {void} + */ + setRangeEndValue(): void; + + /** To set setRangeEndWidth + * @returns {void} + */ + setRangeEndWidth(): void; + + /** To set setRangePosition + * @returns {void} + */ + setRangePosition(): void; + + /** To set setRangeStartValue + * @returns {void} + */ + setRangeStartValue(): void; + + /** To set setRangeStartWidth + * @returns {void} + */ + setRangeStartWidth(): void; + + /** To set setScaleBarLength + * @returns {void} + */ + setScaleBarLength(): void; + + /** To set setScaleBarSize + * @returns {void} + */ + setScaleBarSize(): void; + + /** To set setScaleBorderWidth + * @returns {void} + */ + setScaleBorderWidth(): void; + + /** To set setScaleDirection + * @returns {void} + */ + setScaleDirection(): void; + + /** To set setScaleLocation + * @returns {void} + */ + setScaleLocation(): void; + + /** To set setScaleStyle + * @returns {void} + */ + setScaleStyle(): void; + + /** To set setTickAngle + * @returns {void} + */ + setTickAngle(): void; + + /** To set setTickHeight + * @returns {void} + */ + setTickHeight(): void; + + /** To set setTickPlacement + * @returns {void} + */ + setTickPlacement(): void; + + /** To set setTickStyle + * @returns {void} + */ + setTickStyle(): void; + + /** To set setTickWidth + * @returns {void} + */ + setTickWidth(): void; + + /** To set setTickXDistanceFromScale + * @returns {void} + */ + setTickXDistanceFromScale(): void; + + /** To set setTickYDistanceFromScale + * @returns {void} + */ + setTickYDistanceFromScale(): void; +} +export module LinearGauge{ + +export interface Model { + + /**Specifies the animationSpeed + * @Default {500} + */ + animationSpeed?: number; + + /**Specifies the backgroundColor for Linear gauge. + * @Default {null} + */ + backgroundColor?: string; + + /**Specifies the borderColor for Linear gauge. + * @Default {null} + */ + borderColor?: string; + + /**Specifies the animate state + * @Default {true} + */ + enableAnimation?: boolean; + + /**Specifies the animate state for marker pointer + * @Default {true} + */ + enableMarkerPointerAnimation?: boolean; + + /**Specifies the can resize state. + * @Default {false} + */ + enableResize?: boolean; + + /**Specify frame of linear gauge + * @Default {null} + */ + frame?: Frame; + + /**Specifies the height of Linear gauge. + * @Default {400} + */ + height?: number; + + /**Specifies the labelColor for Linear gauge. + * @Default {null} + */ + labelColor?: string; + + /**Specifies the maximum value of Linear gauge. + * @Default {100} + */ + maximum?: number; + + /**Specifies the minimum value of Linear gauge. + * @Default {0} + */ + minimum?: number; + + /**Specifies the orientation for Linear gauge. + * @Default {Vertical} + */ + orientation?: string; + + /**Specify labelPosition value of Linear gauge See OuterCustomLabelPosition + * @Default {bottom} + */ + outerCustomLabelPosition?: ej.datavisualization.LinearGauge.OuterCustomLabelPosition|string; + + /**Specifies the pointerGradient1 for Linear gauge. + * @Default {null} + */ + pointerGradient1?: any; + + /**Specifies the pointerGradient2 for Linear gauge. + * @Default {null} + */ + pointerGradient2?: any; + + /**Specifies the read only state. + * @Default {true} + */ + readOnly?: boolean; + + /**Specifies the scales + * @Default {null} + */ + scales?: Scales; + + /**Specifies the theme for Linear gauge. See LinearGauge.Themes + * @Default {flatlight} + */ + theme?: ej.datavisualization.LinearGauge.Themes|string; + + /**Specifies the tick Color for Linear gauge. + * @Default {null} + */ + tickColor?: string; + + /**Specify tooltip options of linear gauge + * @Default {false} + */ + tooltip?: Tooltip; + + /**Specifies the value of the Gauge. + * @Default {0} + */ + value?: number; + + /**Specifies the width of Linear gauge. + * @Default {150} + */ + width?: number; + + /**Triggers while the bar pointer are being drawn on the gauge.*/ + drawBarPointers? (e: DrawBarPointersEventArgs): void; + + /**Triggers while the customLabel are being drawn on the gauge.*/ + drawCustomLabel? (e: DrawCustomLabelEventArgs): void; + + /**Triggers while the Indicator are being drawn on the gauge.*/ + drawIndicators? (e: DrawIndicatorsEventArgs): void; + + /**Triggers while the label are being drawn on the gauge.*/ + drawLabels? (e: DrawLabelsEventArgs): void; + + /**Triggers while the marker are being drawn on the gauge.*/ + drawMarkerPointers? (e: DrawMarkerPointersEventArgs): void; + + /**Triggers while the range are being drawn on the gauge.*/ + drawRange? (e: DrawRangeEventArgs): void; + + /**Triggers while the ticks are being drawn on the gauge.*/ + drawTicks? (e: DrawTicksEventArgs): void; + + /**Triggers when the gauge is initialized.*/ + init? (e: InitEventArgs): void; + + /**Triggers while the gauge start to Load.*/ + load? (e: LoadEventArgs): void; + + /**Triggers when the left mouse button is clicked.*/ + mouseClick? (e: MouseClickEventArgs): void; + + /**Triggers when clicking and dragging the mouse pointer over the gauge pointer.*/ + mouseClickMove? (e: MouseClickMoveEventArgs): void; + + /**Triggers when the mouse click is released.*/ + mouseClickUp? (e: MouseClickUpEventArgs): void; + + /**Triggers while the rendering of the gauge completed.*/ + renderComplete? (e: RenderCompleteEventArgs): void; +} + +export interface DrawBarPointersEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the startX and startY of the pointer + */ + position?: any; + + /**returns the gauge model + */ + Model?: any; + + /**returns the options of the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the pointer belongs. + */ + scaleIndex?: number; + + /**returns the pointer style + */ + style?: string; + + /**returns the current Bar pointer element. + */ + barElement?: any; + + /**returns the index of the bar pointer. + */ + barPointerIndex?: number; + + /**returns the value of the bar pointer. + */ + PointerValue?: number; + + /**returns the name of the event + */ + type?: any; +} + +export interface DrawCustomLabelEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the startX and startY of the customLabel + */ + position?: any; + + /**returns the gauge model + */ + Model?: any; + + /**returns the options of the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the pointer belongs. + */ + scaleIndex?: number; + + /**returns the customLabel style + */ + style?: any; + + /**returns the current customLabel element. + */ + customLabelElement?: any; + + /**returns the index of the customLabel. + */ + customLabelIndex?: number; + + /**returns the name of the event + */ + type?: any; +} + +export interface DrawIndicatorsEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the startX and startY of the Indicator + */ + position?: any; + + /**returns the gauge model + */ + Model?: any; + + /**returns the options of the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the pointer belongs. + */ + scaleIndex?: number; + + /**returns the Indicator style + */ + style?: string; + + /**returns the current Indicator element. + */ + IndicatorElement?: any; + + /**returns the index of the Indicator. + */ + IndicatorIndex?: number; + + /**returns the name of the event + */ + type?: any; +} + +export interface DrawLabelsEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the startX and startY of the label + */ + position?: any; + + /**returns the gauge model + */ + Model?: any; + + /**returns the options of the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the label belongs. + */ + scaleIndex?: number; + + /**returns the label style + */ + style?: string; + + /**returns the angle of the label. + */ + angle?: number; + + /**returns the current label element. + */ + element?: any; + + /**returns the index of the label. + */ + index?: number; + + /**returns the label value of the label. + */ + value?: number; + + /**returns the name of the event + */ + type?: any; +} + +export interface DrawMarkerPointersEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the startX and startY of the pointer + */ + position?: any; + + /**returns the gauge model + */ + Model?: any; + + /**returns the options of the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the pointer belongs. + */ + scaleIndex?: number; + + /**returns the ticks style + */ + style?: string; + + /**returns the current marker pointer element. + */ + markerElement?: any; + + /**returns the index of the marker pointer. + */ + markerPointerIndex?: number; + + /**returns the value of the marker pointer. + */ + pointerValue?: number; + + /**returns the angle of the marker pointer. + */ + pointerAngle?: number; + + /**returns the name of the event + */ + type?: any; +} + +export interface DrawRangeEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the startX and startY of the range + */ + position?: any; + + /**returns the gauge model + */ + Model?: any; + + /**returns the options of the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the pointer belongs. + */ + scaleIndex?: number; + + /**returns the range style + */ + style?: string; + + /**returns the current range element. + */ + rangeElement?: any; + + /**returns the index of the range. + */ + rangeIndex?: number; + + /**returns the name of the event + */ + type?: any; +} + +export interface DrawTicksEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the startX and startY of the ticks + */ + position?: any; + + /**returns the gauge model + */ + Model?: any; + + /**returns the options of the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the tick belongs. + */ + scaleIndex?: number; + + /**returns the ticks style + */ + style?: string; + + /**returns the angle of the tick. + */ + angle?: number; + + /**returns the current tick element. + */ + element?: any; + + /**returns the index of the tick. + */ + index?: number; + + /**returns the tick value of the tick. + */ + value?: number; + + /**returns the name of the event + */ + type?: any; +} + +export interface InitEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the gauge model + */ + Model?: any; + + /**returns the entire scale element. + */ + scaleElement?: any; + + /**returns the context element + */ + context?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface LoadEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the gauge model + */ + Model?: any; + + /**returns the entire scale element. + */ + scaleElement?: any; + + /**returns the context element + */ + context?: any; + + /**returns the name of the event + */ + type?: any; +} + +export interface MouseClickEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the gauge model + */ + model?: any; + + /**returns the name of the event + */ + type?: any; + + /**returns the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the pointer belongs. + */ + scaleIndex?: number; + + /**returns the context element* @param {Object} args.markerpointer returns the context element + */ + context?: any; + + /**returns the pointer Index + */ + markerpointerindex?: number; + + /**returns the pointer element. + */ + markerpointerelement?: any; + + /**returns the value of the pointer. + */ + markerpointervalue?: number; + + /**returns the pointer style + */ + style?: string; + + /**returns the startX and startY of the pointer. + */ + position?: any; +} + +export interface MouseClickMoveEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the gauge model + */ + model?: any; + + /**returns the name of the event + */ + type?: any; + + /**returns the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the pointer belongs. + */ + scaleIndex?: number; + + /**returns the context element + */ + context?: any; + + /**returns the pointer Index + */ + index?: number; + + /**returns the pointer element. + */ + element?: any; + + /**returns the value of the pointer. + */ + value?: number; + + /**returns the pointer style + */ + style?: string; + + /**returns the startX and startY of the pointer. + */ + position?: any; +} + +export interface MouseClickUpEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the gauge model + */ + model?: any; + + /**returns the name of the event + */ + type?: any; + + /**returns the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the pointer belongs. + */ + scaleIndex?: number; + + /**returns the context element* @param {Object} args.markerpointer returns the context element + */ + context?: any; + + /**returns the pointer Index + */ + markerpointerIndex?: number; + + /**returns the pointer element. + */ + markerpointerElement?: any; + + /**returns the value of the pointer. + */ + markerpointerValue?: number; + + /**returns the pointer style + */ + style?: string; + + /**returns the startX and startY of the pointer. + */ + position?: any; +} + +export interface RenderCompleteEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the gauge model + */ + Model?: any; + + /**returns the entire scale element. + */ + scaleElement?: any; + + /**returns the context element + */ + context?: any; + + /**returns the name of the event + */ + type?: any; +} + +export interface Frame { + + /**Specifies the frame background image url of linear gauge + * @Default {null} + */ + backgroundImageUrl?: string; + + /**Specifies the frame InnerWidth + * @Default {8} + */ + innerWidth?: number; + + /**Specifies the frame OuterWidth + * @Default {12} + */ + outerWidth?: number; +} + +export interface ScalesBarPointersBorder { + + /**Specifies the border Color of bar pointer + * @Default {null} + */ + color?: string; + + /**Specifies the border Width of bar pointer + * @Default {1.5} + */ + width?: number; +} + +export interface ScalesBarPointers { + + /**Specifies the backgroundColor of bar pointer + * @Default {null} + */ + backgroundColor?: string; + + /**Specifies the border of bar pointer + * @Default {null} + */ + border?: ScalesBarPointersBorder; + + /**Specifies the distanceFromScale of bar pointer + * @Default {0} + */ + distanceFromScale?: number; + + /**Specifies the scaleBar Gradient of bar pointer + * @Default {null} + */ + gradients?: any; + + /**Specifies the opacity of bar pointer + * @Default {1} + */ + opacity?: number; + + /**Specifies the value of bar pointer + * @Default {null} + */ + value?: number; + + /**Specifies the pointer Width of bar pointer + * @Default {width=30} + */ + width?: number; +} + +export interface ScalesBorder { + + /**Specifies the border color of the Scale. + * @Default {null} + */ + color?: string; + + /**Specifies the border width of the Scale. + * @Default {1.5} + */ + width?: number; +} + +export interface ScalesCustomLabelsFont { + + /**Specifies the fontFamily in customLabels + * @Default {Arial} + */ + fontFamily?: string; + + /**Specifies the fontStyle in customLabels. See FontStyle + * @Default {Bold} + */ + fontStyle?: ej.datavisualization.LinearGauge.FontStyle|string; + + /**Specifies the font size in customLabels + * @Default {11px} + */ + size?: string; +} + +export interface ScalesCustomLabelsPosition { + + /**Specifies the position x in customLabels + * @Default {0} + */ + x?: number; + + /**Specifies the y in customLabels + * @Default {0} + */ + y?: number; +} + +export interface ScalesCustomLabels { + + /**Specifies the label Color in customLabels + * @Default {null} + */ + color?: number; + + /**Specifies the font in customLabels + * @Default {null} + */ + font?: ScalesCustomLabelsFont; + + /**Specifies the opacity in customLabels + * @Default {0} + */ + opacity?: string; + + /**Specifies the position in customLabels + * @Default {null} + */ + position?: ScalesCustomLabelsPosition; + + /**Specifies the positionType in customLabels.See CustomLabelPositionType + * @Default {null} + */ + positionType?: any; + + /**Specifies the textAngle in customLabels + * @Default {0} + */ + textAngle?: number; + + /**Specifies the label Value in customLabels + */ + value?: string; +} + +export interface ScalesIndicatorsBorder { + + /**Specifies the border Color in bar indicators + * @Default {null} + */ + color?: string; + + /**Specifies the border Width in bar indicators + * @Default {1.5} + */ + width?: number; +} + +export interface ScalesIndicatorsFont { + + /**Specifies the fontFamily of font in bar indicators + * @Default {Arial} + */ + fontFamily?: string; + + /**Specifies the fontStyle of font in bar indicators. See FontStyle + * @Default {ej.datavisualization.LinearGauge.FontStyle.Bold} + */ + fontStyle?: ej.datavisualization.LinearGauge.FontStyle|string; + + /**Specifies the size of font in bar indicators + * @Default {11px} + */ + size?: string; +} + +export interface ScalesIndicatorsPosition { + + /**Specifies the x position in bar indicators + * @Default {0} + */ + x?: number; + + /**Specifies the y position in bar indicators + * @Default {0} + */ + y?: number; +} + +export interface ScalesIndicatorsStateRanges { + + /**Specifies the backgroundColor in bar indicators state ranges + * @Default {null} + */ + backgroundColor?: string; + + /**Specifies the borderColor in bar indicators state ranges + * @Default {null} + */ + borderColor?: string; + + /**Specifies the endValue in bar indicators state ranges + * @Default {60} + */ + endValue?: number; + + /**Specifies the startValue in bar indicators state ranges + * @Default {50} + */ + startValue?: number; + + /**Specifies the text in bar indicators state ranges + */ + text?: string; + + /**Specifies the textColor in bar indicators state ranges + * @Default {null} + */ + textColor?: string; +} + +export interface ScalesIndicatorsTextLocation { + + /**Specifies the textLocation position in bar indicators + * @Default {0} + */ + x?: number; + + /**Specifies the Y position in bar indicators + * @Default {0} + */ + y?: number; +} + +export interface ScalesIndicators { + + /**Specifies the backgroundColor in bar indicators + * @Default {null} + */ + backgroundColor?: string; + + /**Specifies the border in bar indicators + * @Default {null} + */ + border?: ScalesIndicatorsBorder; + + /**Specifies the font of bar indicators + * @Default {null} + */ + font?: ScalesIndicatorsFont; + + /**Specifies the indicator Height of bar indicators + * @Default {30} + */ + height?: number; + + /**Specifies the opacity in bar indicators + * @Default {NaN} + */ + opacity?: number; + + /**Specifies the position in bar indicators + * @Default {null} + */ + position?: ScalesIndicatorsPosition; + + /**Specifies the state ranges in bar indicators + * @Default {Array} + */ + stateRanges?: Array; + + /**Specifies the textLocation in bar indicators + * @Default {null} + */ + textLocation?: ScalesIndicatorsTextLocation; + + /**Specifies the indicator Style of font in bar indicators + * @Default {ej.datavisualization.LinearGauge.IndicatorType.Rectangle} + */ + type?: ej.datavisualization.LinearGauge.IndicatorTypes|string; + + /**Specifies the indicator Width in bar indicators + * @Default {30} + */ + width?: number; +} + +export interface ScalesLabelsDistanceFromScale { + + /**Specifies the xDistanceFromScale of labels. + * @Default {-10} + */ + x?: number; + + /**Specifies the yDistanceFromScale of labels. + * @Default {0} + */ + y?: number; +} + +export interface ScalesLabelsFont { + + /**Specifies the fontFamily of font. + * @Default {Arial} + */ + fontFamily?: string; + + /**Specifies the fontStyle of font.See FontStyle + * @Default {ej.datavisualization.LinearGauge.FontStyle.Bold} + */ + fontStyle?: ej.datavisualization.LinearGauge.FontStyle|string; + + /**Specifies the size of font. + * @Default {11px} + */ + size?: string; +} + +export interface ScalesLabels { + + /**Specifies the angle of labels. + * @Default {0} + */ + angle?: number; + + /**Specifies the DistanceFromScale of labels. + * @Default {null} + */ + distanceFromScale?: ScalesLabelsDistanceFromScale; + + /**Specifies the font of labels. + * @Default {null} + */ + font?: ScalesLabelsFont; + + /**need to includeFirstValue. + * @Default {true} + */ + includeFirstValue?: boolean; + + /**Specifies the opacity of label. + * @Default {0} + */ + opacity?: number; + + /**Specifies the label Placement of label. See LabelPlacement + * @Default {Near} + */ + placement?: ej.datavisualization.LinearGauge.PointerPlacement|string; + + /**Specifies the textColor of font. + * @Default {null} + */ + textColor?: string; + + /**Specifies the label Style of label. See LabelType + * @Default {ej.datavisualization.LinearGauge.LabelType.Major} + */ + type?: ej.datavisualization.LinearGauge.ScaleType|string; + + /**Specifies the unitText of label. + */ + unitText?: string; + + /**Specifies the unitText Position of label.See UnitTextPlacement + * @Default {Back} + */ + unitTextPlacement?: ej.datavisualization.LinearGauge.UnitTextPlacement|string; +} + +export interface ScalesMarkerPointersBorder { + + /**Specifies the border color of marker pointer + * @Default {null} + */ + color?: string; + + /**Specifies the border of marker pointer + * @Default {number} + */ + width?: number; +} + +export interface ScalesMarkerPointers { + + /**Specifies the backgroundColor of marker pointer + * @Default {null} + */ + backgroundColor?: string; + + /**Specifies the border of marker pointer + * @Default {null} + */ + border?: ScalesMarkerPointersBorder; + + /**Specifies the distanceFromScale of marker pointer + * @Default {0} + */ + distanceFromScale?: number; + + /**Specifies the pointer Gradient of marker pointer + * @Default {null} + */ + gradients?: any; + + /**Specifies the pointer Length of marker pointer + * @Default {30} + */ + length?: number; + + /**Specifies the opacity of marker pointer + * @Default {1} + */ + opacity?: number; + + /**Specifies the pointer Placement of marker pointer See PointerPlacement + * @Default {Far} + */ + placement?: ej.datavisualization.LinearGauge.PointerPlacement|string; + + /**Specifies the marker Style of marker pointerSee MarkerType + * @Default {Triangle} + */ + type?: ej.datavisualization.LinearGauge.MarkerType|string; + + /**Specifies the value of marker pointer + * @Default {null} + */ + value?: number; + + /**Specifies the pointer Width of marker pointer + * @Default {30} + */ + width?: number; +} + +export interface ScalesPosition { + + /**Specifies the Horizontal position + * @Default {50} + */ + x?: number; + + /**Specifies the vertical position + * @Default {50} + */ + y?: number; +} + +export interface ScalesRangesBorder { + + /**Specifies the border color in the ranges. + * @Default {null} + */ + color?: string; + + /**Specifies the border width in the ranges. + * @Default {1.5} + */ + width?: number; +} + +export interface ScalesRanges { + + /**Specifies the backgroundColor in the ranges. + * @Default {null} + */ + backgroundColor?: string; + + /**Specifies the border in the ranges. + * @Default {null} + */ + border?: ScalesRangesBorder; + + /**Specifies the distanceFromScale in the ranges. + * @Default {0} + */ + distanceFromScale?: number; + + /**Specifies the endValue in the ranges. + * @Default {60} + */ + endValue?: number; + + /**Specifies the endWidth in the ranges. + * @Default {10} + */ + endWidth?: number; + + /**Specifies the range Gradient in the ranges. + * @Default {null} + */ + gradients?: any; + + /**Specifies the opacity in the ranges. + * @Default {null} + */ + opacity?: number; + + /**Specifies the range Position in the ranges. See RangePlacement + * @Default {Center} + */ + placement?: ej.datavisualization.LinearGauge.PointerPlacement|string; + + /**Specifies the startValue in the ranges. + * @Default {20} + */ + startValue?: number; + + /**Specifies the startWidth in the ranges. + * @Default {10} + */ + startWidth?: number; +} + +export interface ScalesTicksDistanceFromScale { + + /**Specifies the xDistanceFromScale in the tick. + * @Default {0} + */ + x?: number; + + /**Specifies the yDistanceFromScale in the tick. + * @Default {0} + */ + y?: number; +} + +export interface ScalesTicks { + + /**Specifies the angle in the tick. + * @Default {0} + */ + angle?: number; + + /**Specifies the tick Color in the tick. + * @Default {null} + */ + color?: string; + + /**Specifies the DistanceFromScale in the tick. + * @Default {null} + */ + distanceFromScale?: ScalesTicksDistanceFromScale; + + /**Specifies the tick Height in the tick. + * @Default {10} + */ + height?: number; + + /**Specifies the opacity in the tick. + * @Default {0} + */ + opacity?: number; + + /**Specifies the tick Placement in the tick. See TickPlacement + * @Default {Near} + */ + placement?: ej.datavisualization.LinearGauge.PointerPlacement|string; + + /**Specifies the tick Style in the tick. See TickType + * @Default {MajorInterval} + */ + type?: ej.datavisualization.LinearGauge.TicksType|string; + + /**Specifies the tick Width in the tick. + * @Default {3} + */ + width?: number; +} + +export interface Scales { + + /**Specifies the backgroundColor of the Scale. + * @Default {null} + */ + backgroundColor?: string; + + /**Specifies the scaleBar Gradient of bar pointer + * @Default {Array} + */ + barPointers?: Array; + + /**Specifies the border of the Scale. + * @Default {null} + */ + border?: ScalesBorder; + + /**Specifies the customLabel + * @Default {Array} + */ + customLabels?: Array; + + /**Specifies the scale Direction of the Scale. See Directions + * @Default {CounterClockwise} + */ + direction?: ej.datavisualization.LinearGauge.Direction|string; + + /**Specifies the indicator + * @Default {Array} + */ + indicators?: Array; + + /**Specifies the labels. + * @Default {Array} + */ + labels?: Array; + + /**Specifies the scaleBar Length. + * @Default {290} + */ + length?: number; + + /**Specifies the majorIntervalValue of the Scale. + * @Default {10} + */ + majorIntervalValue?: number; + + /**Specifies the markerPointers + * @Default {Array} + */ + markerPointers?: Array; + + /**Specifies the maximum of the Scale. + * @Default {null} + */ + maximum?: number; + + /**Specifies the minimum of the Scale. + * @Default {null} + */ + minimum?: number; + + /**Specifies the minorIntervalValue of the Scale. + * @Default {2} + */ + minorIntervalValue?: number; + + /**Specifies the opacity of the Scale. + * @Default {NaN} + */ + opacity?: number; + + /**Specifies the position + * @Default {null} + */ + position?: ScalesPosition; + + /**Specifies the ranges in the tick. + * @Default {Array} + */ + ranges?: Array; + + /**Specifies the shadowOffset. + * @Default {0} + */ + shadowOffset?: number; + + /**Specifies the showBarPointers state. + * @Default {true} + */ + showBarPointers?: boolean; + + /**Specifies the showCustomLabels state. + * @Default {false} + */ + showCustomLabels?: boolean; + + /**Specifies the showIndicators state. + * @Default {false} + */ + showIndicators?: boolean; + + /**Specifies the showLabels state. + * @Default {true} + */ + showLabels?: boolean; + + /**Specifies the showMarkerPointers state. + * @Default {true} + */ + showMarkerPointers?: boolean; + + /**Specifies the showRanges state. + * @Default {false} + */ + showRanges?: boolean; + + /**Specifies the showTicks state. + * @Default {true} + */ + showTicks?: boolean; + + /**Specifies the ticks in the scale. + * @Default {Array} + */ + ticks?: Array; + + /**Specifies the scaleBar type .See ScaleType + * @Default {Rectangle} + */ + type?: ej.datavisualization.LinearGauge.ScaleType|string; + + /**Specifies the scaleBar width. + * @Default {30} + */ + width?: number; +} + +export interface Tooltip { + + /**Specify showCustomLabelTooltip value of linear gauge + * @Default {false} + */ + showCustomLabelTooltip?: boolean; + + /**Specify showLabelTooltip value of linear gauge + * @Default {false} + */ + showLabelTooltip?: boolean; + + /**Specify templateID value of linear gauge + * @Default {false} + */ + templateID?: string; +} +} +module LinearGauge +{ +enum OuterCustomLabelPosition +{ +//string +Left, +//string +Right, +//string +Top, +//string +Bottom, +} +} +module LinearGauge +{ +enum FontStyle +{ +//string +Bold, +//string +Italic, +//string +Regular, +//string +Strikeout, +//string +Underline, +} +} +module LinearGauge +{ +enum Direction +{ +//string +Clockwise, +//string +CounterClockwise, +} +} +module LinearGauge +{ +enum IndicatorTypes +{ +//string +Rectangle, +//string +Circle, +//string +RoundedRectangle, +//string +Text, +} +} +module LinearGauge +{ +enum PointerPlacement +{ +//string +Near, +//string +Far, +//string +Center, +} +} +module LinearGauge +{ +enum ScaleType +{ +//string +Major, +//string +Minor, +} +} +module LinearGauge +{ +enum UnitTextPlacement +{ +//string +Back, +//string +From, +} +} +module LinearGauge +{ +enum MarkerType +{ +//string +Rectangle, +//string +Triangle, +//string +Ellipse, +//string +Diamond, +//string +Pentagon, +//string +Circle, +//string +Star, +//string +Slider, +//string +Pointer, +//string +Wedge, +//string +Trapezoid, +//string +RoundedRectangle, +} +} +module LinearGauge +{ +enum TicksType +{ +//string +Majorinterval, +//string +Minorinterval, +} +} +module LinearGauge +{ +enum Themes +{ +//string +FlatLight, +//string +FlatDark, +} +} + +class CircularGauge extends ej.Widget { + static fn: CircularGauge; + constructor(element: JQuery, options?: CircularGauge.Model); + constructor(element: Element, options?: CircularGauge.Model); + model:CircularGauge.Model; + defaults:CircularGauge.Model; + + /** destroy the circular gauge widget. all events bound using this._on will be unbind automatically and bring the control to pre-init state. + * @returns {void} + */ + destroy(): void; + + /** To export Image + * @returns {void} + */ + exportImage(): void; + + /** To get BackNeedleLength + * @returns {void} + */ + getBackNeedleLength(): void; + + /** To get CustomLabelAngle + * @returns {void} + */ + getCustomLabelAngle(): void; + + /** To get CustomLabelValue + * @returns {void} + */ + getCustomLabelValue(): void; + + /** To get LabelAngle + * @returns {void} + */ + getLabelAngle(): void; + + /** To get LabelDistanceFromScale + * @returns {void} + */ + getLabelDistanceFromScale(): void; + + /** To get LabelPlacement + * @returns {void} + */ + getLabelPlacement(): void; + + /** To get LabelStyle + * @returns {void} + */ + getLabelStyle(): void; + + /** To get MajorIntervalValue + * @returns {void} + */ + getMajorIntervalValue(): void; + + /** To get MarkerDistanceFromScale + * @returns {void} + */ + getMarkerDistanceFromScale(): void; + + /** To get MarkerStyle + * @returns {void} + */ + getMarkerStyle(): void; + + /** To get MaximumValue + * @returns {void} + */ + getMaximumValue(): void; + + /** To get MinimumValue + * @returns {void} + */ + getMinimumValue(): void; + + /** To get MinorIntervalValue + * @returns {void} + */ + getMinorIntervalValue(): void; + + /** To get NeedleStyle + * @returns {void} + */ + getNeedleStyle(): void; + + /** To get PointerCapBorderWidth + * @returns {void} + */ + getPointerCapBorderWidth(): void; + + /** To get PointerCapRadius + * @returns {void} + */ + getPointerCapRadius(): void; + + /** To get PointerLength + * @returns {void} + */ + getPointerLength(): void; + + /** To get PointerNeedleType + * @returns {void} + */ + getPointerNeedleType(): void; + + /** To get PointerPlacement + * @returns {void} + */ + getPointerPlacement(): void; + + /** To get PointerValue + * @returns {void} + */ + getPointerValue(): void; + + /** To get PointerWidth + * @returns {void} + */ + getPointerWidth(): void; + + /** To get RangeBorderWidth + * @returns {void} + */ + getRangeBorderWidth(): void; + + /** To get RangeDistanceFromScale + * @returns {void} + */ + getRangeDistanceFromScale(): void; + + /** To get RangeEndValue + * @returns {void} + */ + getRangeEndValue(): void; + + /** To get RangePosition + * @returns {void} + */ + getRangePosition(): void; + + /** To get RangeSize + * @returns {void} + */ + getRangeSize(): void; + + /** To get RangeStartValue + * @returns {void} + */ + getRangeStartValue(): void; + + /** To get ScaleBarSize + * @returns {void} + */ + getScaleBarSize(): void; + + /** To get ScaleBorderWidth + * @returns {void} + */ + getScaleBorderWidth(): void; + + /** To get ScaleDirection + * @returns {void} + */ + getScaleDirection(): void; + + /** To get ScaleRadius + * @returns {void} + */ + getScaleRadius(): void; + + /** To get StartAngle + * @returns {void} + */ + getStartAngle(): void; + + /** To get SubGaugeLocation + * @returns {void} + */ + getSubGaugeLocation(): void; + + /** To get SweepAngle + * @returns {void} + */ + getSweepAngle(): void; + + /** To get TickAngle + * @returns {void} + */ + getTickAngle(): void; + + /** To get TickDistanceFromScale + * @returns {void} + */ + getTickDistanceFromScale(): void; + + /** To get TickHeight + * @returns {void} + */ + getTickHeight(): void; + + /** To get TickPlacement + * @returns {void} + */ + getTickPlacement(): void; + + /** To get TickStyle + * @returns {void} + */ + getTickStyle(): void; + + /** To get TickWidth + * @returns {void} + */ + getTickWidth(): void; + + /** To set includeFirstValue + * @returns {void} + */ + includeFirstValue(): void; + + /** Switching the redraw option for the gauge + * @returns {void} + */ + redraw(): void; + + /** To set BackNeedleLength + * @returns {void} + */ + setBackNeedleLength(): void; + + /** To set CustomLabelAngle + * @returns {void} + */ + setCustomLabelAngle(): void; + + /** To set CustomLabelValue + * @returns {void} + */ + setCustomLabelValue(): void; + + /** To set LabelAngle + * @returns {void} + */ + setLabelAngle(): void; + + /** To set LabelDistanceFromScale + * @returns {void} + */ + setLabelDistanceFromScale(): void; + + /** To set LabelPlacement + * @returns {void} + */ + setLabelPlacement(): void; + + /** To set LabelStyle + * @returns {void} + */ + setLabelStyle(): void; + + /** To set MajorIntervalValue + * @returns {void} + */ + setMajorIntervalValue(): void; + + /** To set MarkerDistanceFromScale + * @returns {void} + */ + setMarkerDistanceFromScale(): void; + + /** To set MarkerStyle + * @returns {void} + */ + setMarkerStyle(): void; + + /** To set MaximumValue + * @returns {void} + */ + setMaximumValue(): void; + + /** To set MinimumValue + * @returns {void} + */ + setMinimumValue(): void; + + /** To set MinorIntervalValue + * @returns {void} + */ + setMinorIntervalValue(): void; + + /** To set NeedleStyle + * @returns {void} + */ + setNeedleStyle(): void; + + /** To set PointerCapBorderWidth + * @returns {void} + */ + setPointerCapBorderWidth(): void; + + /** To set PointerCapRadius + * @returns {void} + */ + setPointerCapRadius(): void; + + /** To set PointerLength + * @returns {void} + */ + setPointerLength(): void; + + /** To set PointerNeedleType + * @returns {void} + */ + setPointerNeedleType(): void; + + /** To set PointerPlacement + * @returns {void} + */ + setPointerPlacement(): void; + + /** To set PointerValue + * @returns {void} + */ + setPointerValue(): void; + + /** To set PointerWidth + * @returns {void} + */ + setPointerWidth(): void; + + /** To set RangeBorderWidth + * @returns {void} + */ + setRangeBorderWidth(): void; + + /** To set RangeDistanceFromScale + * @returns {void} + */ + setRangeDistanceFromScale(): void; + + /** To set RangeEndValue + * @returns {void} + */ + setRangeEndValue(): void; + + /** To set RangePosition + * @returns {void} + */ + setRangePosition(): void; + + /** To set RangeSize + * @returns {void} + */ + setRangeSize(): void; + + /** To set RangeStartValue + * @returns {void} + */ + setRangeStartValue(): void; + + /** To set ScaleBarSize + * @returns {void} + */ + setScaleBarSize(): void; + + /** To set ScaleBorderWidth + * @returns {void} + */ + setScaleBorderWidth(): void; + + /** To set ScaleDirection + * @returns {void} + */ + setScaleDirection(): void; + + /** To set ScaleRadius + * @returns {void} + */ + setScaleRadius(): void; + + /** To set StartAngle + * @returns {void} + */ + setStartAngle(): void; + + /** To set SubGaugeLocation + * @returns {void} + */ + setSubGaugeLocation(): void; + + /** To set SweepAngle + * @returns {void} + */ + setSweepAngle(): void; + + /** To set TickAngle + * @returns {void} + */ + setTickAngle(): void; + + /** To set TickDistanceFromScale + * @returns {void} + */ + setTickDistanceFromScale(): void; + + /** To set TickHeight + * @returns {void} + */ + setTickHeight(): void; + + /** To set TickPlacement + * @returns {void} + */ + setTickPlacement(): void; + + /** To set TickStyle + * @returns {void} + */ + setTickStyle(): void; + + /** To set TickWidth + * @returns {void} + */ + setTickWidth(): void; +} +export module CircularGauge{ + +export interface Model { + + /**Specifies animationSpeed of circular gauge + * @Default {500} + */ + animationSpeed?: number; + + /**Specifies the background color of circular gauge. + * @Default {null} + */ + backgroundColor?: string; + + /**Specify distanceFromCorner value of circular gauge + * @Default {center} + */ + distanceFromCorner?: number; + + /**Specify animate value of circular gauge + * @Default {true} + */ + enableAnimation?: boolean; + + /**Specify enableResize value of circular gauge + * @Default {false} + */ + enableResize?: boolean; + + /**Specify the frame of circular gauge + * @Default {Object} + */ + frame?: Frame; + + /**Specify gaugePosition value of circular gauge See GaugePosition + * @Default {center} + */ + gaugePosition?: ej.datavisualization.CircularGauge.gaugePosition|string; + + /**Specifies the height of circular gauge. + * @Default {360} + */ + height?: number; + + /**Specifies the interiorGradient of circular gauge. + * @Default {null} + */ + interiorGradient?: any; + + /**Specify isRadialGradient value of circular gauge + * @Default {false} + */ + isRadialGradient?: boolean; + + /**Specifies the maximum value of circular gauge. + * @Default {100} + */ + maximum?: number; + + /**Specifies the minimum value of circular gauge. + * @Default {0} + */ + minimum?: number; + + /**Specify outerCustomLabelPosition value of circular gauge See OuterCustomLabelPosition + * @Default {bottom} + */ + outerCustomLabelPosition?: ej.datavisualization.CircularGauge.CustomLabelPositionType|string; + + /**Specifies the radius of circular gauge. + * @Default {180} + */ + radius?: number; + + /**Specify readonly value of circular gauge + * @Default {true} + */ + readOnly?: boolean; + + /**Specify the pointers, ticks, labels, indicators, ranges of circular gauge + * @Default {null} + */ + scales?: Scales; + + /**Specify the theme of circular gauge. + * @Default {flatlight} + */ + theme?: string; + + /**Specify tooltip option of circular gauge + * @Default {object} + */ + tooltip?: Tooltip; + + /**Specifies the value of circular gauge. + * @Default {0} + */ + value?: number; + + /**Specifies the width of circular gauge. + * @Default {360} + */ + width?: number; + + /**Triggers while the custom labels are being drawn on the gauge.*/ + drawCustomLabel? (e: DrawCustomLabelEventArgs): void; + + /**Triggers while the indicators are being started to drawn on the gauge.*/ + drawIndicators? (e: DrawIndicatorsEventArgs): void; + + /**Triggers while the labels are being drawn on the gauge.*/ + drawLabels? (e: DrawLabelsEventArgs): void; + + /**Triggers while the pointer cap is being drawn on the gauge.*/ + drawPointerCap? (e: DrawPointerCapEventArgs): void; + + /**Triggers while the pointers are being drawn on the gauge.*/ + drawPointers? (e: DrawPointersEventArgs): void; + + /**Triggers when the ranges begin to be getting drawn on the gauge.*/ + drawRange? (e: DrawRangeEventArgs): void; + + /**Triggers while the ticks are being drawn on the gauge.*/ + drawTicks? (e: DrawTicksEventArgs): void; + + /**Triggers while the gauge start to Load.*/ + load? (e: LoadEventArgs): void; + + /**Triggers when the left mouse button is clicked.*/ + mouseClick? (e: MouseClickEventArgs): void; + + /**Triggers when clicking and dragging the mouse pointer over the gauge pointer.*/ + mouseClickMove? (e: MouseClickMoveEventArgs): void; + + /**Triggers when the mouse click is released.*/ + mouseClickUp? (e: MouseClickUpEventArgs): void; + + /**Triggers when the rendering of the gauge is completed.*/ + renderComplete? (e: RenderCompleteEventArgs): void; +} + +export interface DrawCustomLabelEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the startX and startY of the custom label + */ + position?: any; + + /**returns the gauge model + */ + model?: any; + + /**returns the options of the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the custom label belongs. + */ + scaleIndex?: number; + + /**returns the custom label style + */ + style?: string; + + /**returns the current custom label element. + */ + customLabelElement?: any; + + /**returns the index of the custom label. + */ + customLabelIndex?: number; + + /**returns the name of the event + */ + type?: string; +} + +export interface DrawIndicatorsEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the startX and startY of the indicator + */ + position?: any; + + /**returns the gauge model + */ + model?: any; + + /**returns the options of the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the indicator belongs. + */ + scaleIndex?: number; + + /**returns the indicator style + */ + style?: string; + + /**returns the current indicator element. + */ + indicatorElement?: any; + + /**returns the index of the indicator. + */ + indicatorIndex?: number; + + /**returns the name of the event + */ + type?: string; +} + +export interface DrawLabelsEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the startX and startY of the labels + */ + position?: any; + + /**returns the gauge model + */ + model?: any; + + /**returns the options of the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the label belongs. + */ + scaleIndex?: number; + + /**returns the label style + */ + style?: string; + + /**returns the angle of the labels. + */ + angle?: number; + + /**returns the current label element. + */ + element?: any; + + /**returns the index of the label. + */ + index?: number; + + /**returns the value of the label. + */ + pointerValue?: number; + + /**returns the name of the event + */ + type?: string; +} + +export interface DrawPointerCapEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the options of the scale element. + */ + scaleElement?: any; + + /**returns the startX and startY of the pointer cap. + */ + position?: any; + + /**returns the gauge model + */ + model?: any; + + /**returns the pointer cap style + */ + style?: string; + + /**returns the name of the event + */ + type?: string; +} + +export interface DrawPointersEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the startX and startY of the pointer + */ + position?: any; + + /**returns the gauge model + */ + model?: any; + + /**returns the options of the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the pointer belongs. + */ + scaleIndex?: number; + + /**returns the pointer style + */ + style?: string; + + /**returns the angle of the pointer. + */ + angle?: number; + + /**returns the current pointer element. + */ + element?: any; + + /**returns the index of the pointer. + */ + index?: number; + + /**returns the value of the pointer. + */ + value?: number; + + /**returns the name of the event + */ + type?: string; +} + +export interface DrawRangeEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the startX and startY of the range + */ + position?: any; + + /**returns the gauge model + */ + model?: any; + + /**returns the options of the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the range belongs. + */ + scaleIndex?: number; + + /**returns the range style + */ + style?: string; + + /**returns the current range element. + */ + rangeElement?: any; + + /**returns the index of the range. + */ + rangeIndex?: number; + + /**returns the name of the event + */ + type?: string; +} + +export interface DrawTicksEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the startX and startY of the ticks + */ + position?: any; + + /**returns the gauge model + */ + model?: any; + + /**returns the options of the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the tick belongs. + */ + scaleIndex?: number; + + /**returns the ticks style + */ + style?: string; + + /**returns the angle of the tick. + */ + angle?: number; + + /**returns the current tick element. + */ + element?: any; + + /**returns the index of the tick. + */ + index?: number; + + /**returns the label value of the tick. + */ + pointerValue?: number; + + /**returns the name of the event + */ + type?: string; +} + +export interface LoadEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the gauge model + */ + Model?: any; + + /**returns the entire scale element. + */ + scaleElement?: any; + + /**returns the context element + */ + context?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface MouseClickEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the gauge model + */ + model?: any; + + /**returns the name of the event + */ + type?: any; + + /**returns the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the pointer belongs. + */ + scaleIndex?: number; + + /**returns the context element + */ + context?: any; + + /**returns the pointer Index + */ + index?: number; + + /**returns the pointer element. + */ + element?: any; + + /**returns the value of the pointer. + */ + value?: number; + + /**returns the angle of the pointer. + */ + angle?: number; + + /**returns the pointer style + */ + style?: string; + + /**returns the startX and startY of the pointer. + */ + position?: any; +} + +export interface MouseClickMoveEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the gauge model + */ + model?: any; + + /**returns the name of the event + */ + type?: any; + + /**returns the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the pointer belongs. + */ + scaleIndex?: number; + + /**returns the context element + */ + context?: any; + + /**returns the pointer Index + */ + index?: number; + + /**returns the pointer element. + */ + element?: any; + + /**returns the value of the pointer. + */ + value?: number; + + /**returns the angle of the pointer. + */ + angle?: number; + + /**returns the pointer style + */ + style?: string; + + /**returns the startX and startY of the pointer. + */ + position?: any; +} + +export interface MouseClickUpEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the gauge model + */ + model?: any; + + /**returns the name of the event + */ + type?: any; + + /**returns the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the pointer belongs. + */ + scaleIndex?: number; + + /**returns the context element + */ + context?: any; + + /**returns the pointer Index + */ + index?: number; + + /**returns the pointer element. + */ + element?: any; + + /**returns the value of the pointer. + */ + value?: number; + + /**returns the angle of the pointer. + */ + angle?: number; + + /**returns the pointer style + */ + style?: string; + + /**returns the startX and startY of the pointer. + */ + position?: any; +} + +export interface RenderCompleteEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the entire scale element. + */ + scaleElement?: any; + + /**returns the gauge model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface Frame { + + /**Specify the url of the frame background image for circular gauge + * @Default {null} + */ + backgroundImageUrl?: string; + + /**Specifies the frameType of circular gauge. See Frame + * @Default {FullCircle} + */ + frameType?: ej.datavisualization.CircularGauge.FrameType|string; + + /**Specifies the end angle for the half circular frame. + * @Default {360} + */ + halfCircleFrameEndAngle?: number; + + /**Specifies the start angle for the half circular frame. + * @Default {180} + */ + halfCircleFrameStartAngle?: number; +} + +export interface ScalesBorder { + + /**Specify border color for scales of circular gauge + * @Default {null} + */ + color?: string; + + /**Specify border width of circular gauge + * @Default {1.5} + */ + width?: number; +} + +export interface ScalesIndicatorsPosition { + + /**Specify x-axis of position of circular gauge + * @Default {0} + */ + x?: number; + + /**Specify y-axis of position of circular gauge + * @Default {0} + */ + y?: number; +} + +export interface ScalesIndicatorsStateRanges { + + /**Specify backgroundColor for indicator of circular gauge + * @Default {null} + */ + backgroundColor?: string; + + /**Specify borderColor for indicator of circular gauge + * @Default {null} + */ + borderColor?: string; + + /**Specify end value for each specified state of circular gauge + * @Default {0} + */ + endValue?: number; + + /**Specify value of the font as the indicator when the indicator style is set with the value "text" of circular gauge + * @Default {null} + */ + font?: any; + + /**Specify start value for each specified state of circular gauge + * @Default {0} + */ + startValue?: number; + + /**Specify value of the text as the indicator when the indicator style is set with the value "text" of circular gauge + */ + text?: string; + + /**Specify value of the textColor as the indicator when the indicator style is set with the value "text" of circular gauge + * @Default {null} + */ + textColor?: string; +} + +export interface ScalesIndicators { + + /**Specify indicator height of circular gauge + * @Default {15} + */ + height?: number; + + /**Specify imageUrl of circular gauge + * @Default {null} + */ + imageUrl?: string; + + /**Specify position of circular gauge + * @Default {Object} + */ + position?: ScalesIndicatorsPosition; + + /**Specify the various states of circular gauge + * @Default {Array} + */ + stateRanges?: Array; + + /**Specify indicator style of circular gauge. See IndicatorType + * @Default {Circle} + */ + type?: ej.datavisualization.CircularGauge.IndicatorTypes|string; + + /**Specify indicator width of circular gauge + * @Default {15} + */ + width?: number; +} + +export interface ScalesLabelsFont { + + /**Specify font fontFamily for labels of circular gauge + * @Default {Arial} + */ + fontFamily?: string; + + /**Specify font Style for labels of circular gauge + * @Default {Bold} + */ + fontStyle?: string; + + /**Specify font size for labels of circular gauge + * @Default {11px} + */ + size?: string; +} + +export interface ScalesLabels { + + /**Specify the angle for the labels of circular gauge + * @Default {0} + */ + angle?: number; + + /**Specify labels autoAngle value of circular gauge + * @Default {false} + */ + autoAngle?: boolean; + + /**Specify label color of circular gauge + * @Default {null} + */ + color?: string; + + /**Specify distanceFromScale value for labels of circular gauge + * @Default {0} + */ + distanceFromScale?: number; + + /**Specify font for labels of circular gauge + * @Default {Object} + */ + font?: ScalesLabelsFont; + + /**Specify includeFirstValue of circular gauge + * @Default {true} + */ + includeFirstValue?: boolean; + + /**Specify opacity value for labels of circular gauge + * @Default {null} + */ + opacity?: number; + + /**Specify label placement of circular gauge. See LabelPlacement + * @Default {Near} + */ + placement?: ej.datavisualization.CircularGauge.Placement|string; + + /**Specify label Style of circular gauge. See LabelType + * @Default {Major} + */ + type?: ej.datavisualization.CircularGauge.LabelType|string; + + /**Specify unitText of circular gauge + */ + unitText?: string; + + /**Specify unitTextPosition of circular gauge. See UnitTextPosition + * @Default {Back} + */ + unitTextPosition?: ej.datavisualization.CircularGauge.UnitTextPlacement|string; +} + +export interface ScalesPointerCap { + + /**Specify cap backgroundColor of circular gauge + * @Default {null} + */ + backgroundColor?: string; + + /**Specify cap borderColor of circular gauge + * @Default {null} + */ + borderColor?: string; + + /**Specify pointerCap borderWidth value of circular gauge + * @Default {3} + */ + borderWidth?: number; + + /**Specify cap interiorGradient value of circular gauge + * @Default {null} + */ + interiorGradient?: any; + + /**Specify pointerCap Radius value of circular gauge + * @Default {7} + */ + radius?: number; +} + +export interface ScalesPointersBorder { + + /**Specify border color for pointer of circular gauge + * @Default {null} + */ + color?: string; + + /**Specify border width for pointers of circular gauge + * @Default {1.5} + */ + width?: number; +} + +export interface ScalesPointersPointerValueTextFont { + + /**Specify pointer value text font family of circular gauge. + * @Default {Arial} + */ + fontFamily?: string; + + /**Specify pointer value text font style of circular gauge. + * @Default {Bold} + */ + fontStyle?: string; + + /**Specify pointer value text size of circular gauge. + * @Default {11px} + */ + size?: string; +} + +export interface ScalesPointersPointerValueText { + + /**Specify pointer text angle of circular gauge. + * @Default {0} + */ + angle?: number; + + /**Specify pointer text auto angle of circular gauge. + * @Default {false} + */ + autoAngle?: boolean; + + /**Specify pointer value text color of circular gauge. + * @Default {#8c8c8c} + */ + color?: string; + + /**Specify pointer value text distance from pointer of circular gauge. + * @Default {20} + */ + distance?: number; + + /**Specify pointer value text font option of circular gauge. + * @Default {object} + */ + font?: ScalesPointersPointerValueTextFont; + + /**Specify pointer value text opacity of circular gauge. + * @Default {1} + */ + opacity?: number; + + /**enable pointer value text visibility of circular gauge. + * @Default {false} + */ + showValue?: boolean; +} + +export interface ScalesPointers { + + /**Specify backgroundColor for the pointer of circular gauge + * @Default {null} + */ + backgroundColor?: string; + + /**Specify backNeedleLength of circular gauge + * @Default {10} + */ + backNeedleLength?: number; + + /**Specify the border for pointers of circular gauge + * @Default {Object} + */ + border?: ScalesPointersBorder; + + /**Specify distanceFromScale value for pointers of circular gauge + * @Default {0} + */ + distanceFromScale?: number; + + /**Specify pointer gradients of circular gauge + * @Default {null} + */ + gradients?: any; + + /**Specify pointer image of circular gauge.It is applicable for both marker as well as needle type pointers. + * @Default {NULL} + */ + imageUrl?: string; + + /**Specify pointer length of circular gauge + * @Default {150} + */ + length?: number; + + /**Specify marker Style value of circular gauge. See MarkerType + * @Default {Rectangle} + */ + markerType?: ej.datavisualization.CircularGauge.MarkerType|string; + + /**Specify needle Style value of circular gauge. See NeedleType + * @Default {Triangle} + */ + needleType?: ej.datavisualization.CircularGauge.NeedleType|string; + + /**Specify opacity value for pointer of circular gauge + * @Default {1} + */ + opacity?: number; + + /**Specify pointer Placement value of circular gauge. See PointerPlacement + * @Default {Near} + */ + placement?: ej.datavisualization.CircularGauge.Placement|string; + + /**Specify pointer value text of circular gauge. + * @Default {Object} + */ + pointerValueText?: ScalesPointersPointerValueText; + + /**Specify showBackNeedle value of circular gauge + * @Default {false} + */ + showBackNeedle?: boolean; + + /**Specify pointer type value of circular gauge. See PointerType + * @Default {Needle} + */ + type?: ej.datavisualization.CircularGauge.PointerType|string; + + /**Specify value of the pointer of circular gauge + * @Default {null} + */ + value?: number; + + /**Specify pointer width of circular gauge + * @Default {7} + */ + width?: number; +} + +export interface ScalesRangesBorder { + + /**Specify border color for ranges of circular gauge + * @Default {#32b3c6} + */ + color?: string; + + /**Specify border width for ranges of circular gauge + * @Default {1.5} + */ + width?: number; +} + +export interface ScalesRanges { + + /**Specify backgroundColor for the ranges of circular gauge + * @Default {#32b3c6} + */ + backgroundColor?: string; + + /**Specify border for ranges of circular gauge + * @Default {Object} + */ + border?: ScalesRangesBorder; + + /**Specify distanceFromScale value for ranges of circular gauge + * @Default {25} + */ + distanceFromScale?: number; + + /**Specify endValue for ranges of circular gauge + * @Default {null} + */ + endValue?: number; + + /**Specify endWidth for ranges of circular gauge + * @Default {10} + */ + endWidth?: number; + + /**Specify range gradients of circular gauge + * @Default {null} + */ + gradients?: any; + + /**Specify opacity value for ranges of circular gauge + * @Default {null} + */ + opacity?: number; + + /**Specify placement of circular gauge. See RangePlacement + * @Default {Near} + */ + placement?: ej.datavisualization.CircularGauge.Placement|string; + + /**Specify size of the range value of circular gauge + * @Default {5} + */ + size?: number; + + /**Specify startValue for ranges of circular gauge + * @Default {null} + */ + startValue?: number; + + /**Specify startWidth of circular gauge + * @Default {[Array.number] scale.ranges.startWidth = 10} + */ + startWidth?: number; +} + +export interface ScalesSubGaugesPosition { + + /**Specify x-axis position for sub-gauge of circular gauge + * @Default {0} + */ + x?: number; + + /**Specify y-axis position for sub-gauge of circular gauge + * @Default {0} + */ + y?: number; +} + +export interface ScalesSubGauges { + + /**Specify subGauge Height of circular gauge + * @Default {150} + */ + height?: number; + + /**Specify position for sub-gauge of circular gauge + * @Default {Object} + */ + position?: ScalesSubGaugesPosition; + + /**Specify subGauge Width of circular gauge + * @Default {150} + */ + width?: number; +} + +export interface ScalesTicks { + + /**Specify the angle for the ticks of circular gauge + * @Default {0} + */ + angle?: number; + + /**Specify tick color of circular gauge + * @Default {null} + */ + color?: string; + + /**Specify distanceFromScale value for ticks of circular gauge + * @Default {0} + */ + distanceFromScale?: number; + + /**Specify tick height of circular gauge + * @Default {16} + */ + height?: number; + + /**Specify tick placement of circular gauge. See TickPlacement + * @Default {Near} + */ + placement?: ej.datavisualization.CircularGauge.Placement|string; + + /**Specify tick Style of circular gauge. See TickType + * @Default {Major} + */ + type?: ej.datavisualization.CircularGauge.LabelType|string; + + /**Specify tick width of circular gauge + * @Default {3} + */ + width?: number; +} + +export interface Scales { + + /**Specify backgroundColor for the scale of circular gauge + * @Default {null} + */ + backgroundColor?: string; + + /**Specify border for scales of circular gauge + * @Default {Object} + */ + border?: ScalesBorder; + + /**Specify scale direction of circular gauge. See Directions + * @Default {Clockwise} + */ + direction?: ej.datavisualization.CircularGauge.Direction|string; + + /**Specify representing state of circular gauge + * @Default {Array} + */ + indicators?: Array; + + /**Specify the text values displayed in a meaningful manner alongside the ticks of circular gauge + * @Default {Array} + */ + labels?: Array; + + /**Specify majorIntervalValue of circular gauge + * @Default {10} + */ + majorIntervalValue?: number; + + /**Specify maximum scale value of circular gauge + * @Default {null} + */ + maximum?: number; + + /**Specify minimum scale value of circular gauge + * @Default {null} + */ + minimum?: number; + + /**Specify minorIntervalValue of circular gauge + * @Default {2} + */ + minorIntervalValue?: number; + + /**Specify opacity value of circular gauge + * @Default {1} + */ + opacity?: number; + + /**Specify pointer cap of circular gauge + * @Default {Object} + */ + pointerCap?: ScalesPointerCap; + + /**Specify pointers value of circular gauge + * @Default {Array} + */ + pointers?: Array; + + /**Specify scale radius of circular gauge + * @Default {170} + */ + radius?: number; + + /**Specify ranges value of circular gauge + * @Default {Array} + */ + ranges?: Array; + + /**Specify shadowOffset value of circular gauge + * @Default {0} + */ + shadowOffset?: number; + + /**Specify showIndicators of circular gauge + * @Default {false} + */ + showIndicators?: boolean; + + /**Specify showLabels of circular gauge + * @Default {true} + */ + showLabels?: boolean; + + /**Specify showPointers of circular gauge + * @Default {true} + */ + showPointers?: boolean; + + /**Specify showRanges of circular gauge + * @Default {false} + */ + showRanges?: boolean; + + /**Specify showScaleBar of circular gauge + * @Default {false} + */ + showScaleBar?: boolean; + + /**Specify showTicks of circular gauge + * @Default {true} + */ + showTicks?: boolean; + + /**Specify scaleBar size of circular gauge + * @Default {6} + */ + size?: number; + + /**Specify startAngle of circular gauge + * @Default {115} + */ + startAngle?: number; + + /**Specify subGauge of circular gauge + * @Default {Array} + */ + subGauges?: Array; + + /**Specify sweepAngle of circular gauge + * @Default {310} + */ + sweepAngle?: number; + + /**Specify ticks of circular gauge + * @Default {Array} + */ + ticks?: Array; +} + +export interface Tooltip { + + /**enable showCustomLabelTooltip of circular gauge + * @Default {false} + */ + showCustomLabelTooltip?: boolean; + + /**enable showLabelTooltip of circular gauge + * @Default {false} + */ + showLabelTooltip?: boolean; + + /**Specify tooltip templateID of circular gauge + * @Default {false} + */ + templateID?: string; +} +} +module CircularGauge +{ +enum FrameType +{ +//string +FullCircle, +//string +HalfCircle, +} +} +module CircularGauge +{ +enum gaugePosition +{ +//string +TopLeft, +//string +TopRight, +//string +TopCenter, +//string +MiddleLeft, +//string +MiddleRight, +//string +Center, +//string +BottomLeft, +//string +BottomRight, +//string +BottomCenter, +} +} +module CircularGauge +{ +enum CustomLabelPositionType +{ +//string +Top, +//string +Bottom, +//string +Right, +//string +Left, +} +} +module CircularGauge +{ +enum Direction +{ +//string +Clockwise, +//string +CounterClockwise, +} +} +module CircularGauge +{ +enum IndicatorTypes +{ +//string +Rectangle, +//string +Circle, +//string +Text, +//string +RoundedRectangle, +//string +Image, +} +} +module CircularGauge +{ +enum Placement +{ +//string +Near, +//string +Far, +} +} +module CircularGauge +{ +enum LabelType +{ +//string +Major, +//string +Minor, +} +} +module CircularGauge +{ +enum UnitTextPlacement +{ +//string +Back, +//string +Front, +} +} +module CircularGauge +{ +enum MarkerType +{ +//string +Rectangle, +//string +Circle, +//string +Triangle, +//string +Ellipse, +//string +Diamond, +//string +Pentagon, +//string +Slider, +//string +Pointer, +//string +Wedge, +//string +Trapezoid, +//string +RoundedRectangle, +//string +Image, +} +} +module CircularGauge +{ +enum NeedleType +{ +//string +Triangle, +//string +Rectangle, +//string +Arrow, +//string +Image, +//string +Trapezoid, +} +} +module CircularGauge +{ +enum PointerType +{ +//string +Needle, +//string +Marker, +} +} + +class DigitalGauge extends ej.Widget { + static fn: DigitalGauge; + constructor(element: JQuery, options?: DigitalGauge.Model); + constructor(element: Element, options?: DigitalGauge.Model); + model:DigitalGauge.Model; + defaults:DigitalGauge.Model; + + /** To destroy the digital gauge + * @returns {void} + */ + destroy(): void; + + /** To export Digital Gauge as Image + * @param {string} fileName for the Image + * @param {string} fileType for the Image + * @returns {void} + */ + exportImage(fileName: string, fileType: string): void; + + /** Gets the location of an item that is displayed on the gauge. + * @param {number} Position value of an item that is displayed on the gauge. + * @returns {void} + */ + getPosition(itemIndex: number): void; + + /** ClientSideMethod getValue Gets the value of an item that is displayed on the gauge + * @param {number} Index value of an item that displayed on the gauge + * @returns {void} + */ + getValue(itemIndex: number): void; + + /** Refresh the digital gauge widget + * @returns {void} + */ + refresh(): void; + + /** ClientSideMethod Set Position Sets the location of an item to be displayed in the gauge + * @param {number} Index value of the digital gauge item + * @param {any} Location value of the digital gauge + * @returns {void} + */ + setPosition(itemIndex: number, value: any): void; + + /** ClientSideMethod SetValue Sets the value of an item to be displayed in the gauge. + * @param {number} Index value of the digital gauge item + * @param {string} Text value to be displayed in the gaugeS + * @returns {void} + */ + setValue(itemIndex: number, value: string): void; +} +export module DigitalGauge{ + +export interface Model { + + /**Specifies the resize option of the DigitalGauge. + * @Default {false} + */ + enableResize?: boolean; + + /**Specifies the frame of the Digital gauge. + * @Default {{backgroundImageUrl: null, innerWidth: 6, outerWidth: 10}} + */ + frame?: Frame; + + /**Specifies the height of the DigitalGauge. + * @Default {150} + */ + height?: number; + + /**Specifies the items for the DigitalGauge. + * @Default {null} + */ + items?: Items; + + /**Specifies the matrixSegmentData for the DigitalGauge. + */ + matrixSegmentData?: any; + + /**Specifies the segmentData for the DigitalGauge. + */ + segmentData?: any; + + /**Specifies the themes for the Digital gauge. See Themes + * @Default {flatlight} + */ + themes?: string; + + /**Specifies the value to the DigitalGauge. + * @Default {text} + */ + value?: string; + + /**Specifies the width for the Digital gauge. + * @Default {400} + */ + width?: number; + + /**Triggers when the gauge is initialized.*/ + init? (e: InitEventArgs): void; + + /**Triggers when the gauge item rendering.*/ + itemRendering? (e: ItemRenderingEventArgs): void; + + /**Triggers when the gauge is start to load.*/ + load? (e: LoadEventArgs): void; + + /**Triggers when the gauge render is completed.*/ + renderComplete? (e: RenderCompleteEventArgs): void; +} + +export interface InitEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the all the options of the items. + */ + items?: any; + + /**returns the context element + */ + context?: any; + + /**returns the gauge model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface ItemRenderingEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the all the options of the items. + */ + items?: any; + + /**returns the context element + */ + context?: any; + + /**returns the gauge model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface LoadEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the all the options of the items. + */ + items?: any; + + /**returns the context element + */ + context?: any; + + /**returns the gauge model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface RenderCompleteEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the all the options of the items. + */ + items?: any; + + /**returns the context element + */ + context?: any; + + /**returns the gauge model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface Frame { + + /**Specifies the url of an image to be displayed as background of the Digital gauge. + * @Default {null} + */ + backgroundImageUrl?: string; + + /**Specifies the inner width for the frame, when the background image has been set for the Digital gauge.. + * @Default {6} + */ + innerWidth?: number; + + /**Specifies the outer width of the frame, when the background image has been set for the Digital gauge. + * @Default {10} + */ + outerWidth?: number; +} + +export interface ItemsCharacterSettings { + + /**Specifies the CharacterCount value for the DigitalGauge. + * @Default {4} + */ + count?: number; + + /**Specifies the opacity value for the DigitalGauge. + * @Default {1} + */ + opacity?: number; + + /**Specifies the value for spacing between the characters + * @Default {2} + */ + spacing?: number; + + /**Specifies the character type for the text to be displayed. + * @Default {ej.datavisualization.DigitalGauge.CharacterType.EightCrossEightDotMatrix} + */ + type?: ej.datavisualization.DigitalGauge.CharacterType|string; +} + +export interface ItemsFont { + + /**Set the font family value + * @Default {Arial} + */ + fontFamily?: string; + + /**Set the font style for the font + * @Default {italic} + */ + fontStyle?: ej.datavisualization.DigitalGauge.FontStyle|string; + + /**Set the font size value + * @Default {11px} + */ + size?: string; +} + +export interface ItemsPosition { + + /**Set the horizontal location for the text, where it needs to be placed within the gauge. + * @Default {0} + */ + x?: number; + + /**Set the vertical location for the text, where it needs to be placed within the gauge. + * @Default {0} + */ + y?: number; +} + +export interface ItemsSegmentSettings { + + /**Set the color for the text segments. + * @Default {null} + */ + color?: string; + + /**Set the gradient for the text segments. + * @Default {null} + */ + gradient?: any; + + /**Set the length for the text segments. + * @Default {2} + */ + length?: number; + + /**Set the opacity for the text segments. + * @Default {0} + */ + opacity?: number; + + /**Set the spacing for the text segments. + * @Default {1} + */ + spacing?: number; + + /**Set the width for the text segments. + * @Default {1} + */ + width?: number; +} + +export interface Items { + + /**Specifies the Character settings for the DigitalGauge. + * @Default {null} + */ + characterSettings?: ItemsCharacterSettings; + + /**Enable/Disable the custom font to be applied to the text in the gauge. + * @Default {false} + */ + enableCustomFont?: boolean; + + /**Set the specific font for the text, when the enableCustomFont is set to true + * @Default {null} + */ + font?: ItemsFont; + + /**Set the location for the text, where it needs to be placed within the gauge. + * @Default {null} + */ + position?: ItemsPosition; + + /**Set the segment settings for the digital gauge. + * @Default {null} + */ + segmentSettings?: ItemsSegmentSettings; + + /**Set the value for enabling/disabling the blurring effect for the shadows of the text + * @Default {0} + */ + shadowBlur?: number; + + /**Specifies the color of the text shadow. + * @Default {null} + */ + shadowColor?: string; + + /**Set the x offset value for the shadow of the text, indicating the location where it needs to be displayed. + * @Default {1} + */ + shadowOffsetX?: number; + + /**Set the y offset value for the shadow of the text, indicating the location where it needs to be displayed. + * @Default {1} + */ + shadowOffsetY?: number; + + /**Set the alignment of the text that is displayed within the gauge.See TextAlign + * @Default {left} + */ + textAlign?: string; + + /**Specifies the color of the text. + * @Default {null} + */ + textColor?: string; + + /**Specifies the text value. + * @Default {null} + */ + value?: string; +} +} +module DigitalGauge +{ +enum CharacterType +{ +//string +SevenSegment, +//string +FourteenSegment, +//string +SixteenSegment, +//string +EightCrossEightDotMatrix, +//string +EightCrossEightSquareMatrix, +} +} +module DigitalGauge +{ +enum FontStyle +{ +//string +Normal, +//string +Bold, +//string +Italic, +//string +Underline, +//string +Strikeout, +} +} + +class Chart extends ej.Widget { + static fn: Chart; + constructor(element: JQuery, options?: Chart.Model); + constructor(element: Element, options?: Chart.Model); + model:Chart.Model; + defaults:Chart.Model; + + /** Animates the series and/or indicators in Chart. When parameter is not passed to this method, then all the series and indicators present in Chart are animated. + * @param {Array} Series and indicator objects passed in the array collection are animated.Example + * @param {any} Series or indicator object passed to this method are animated.Example, + * @returns {void} + */ + animate(options: Array, option: any): void; + + /** Exports chart as an image or to an excel file. Chart can be exported as an image only when exportCanvasRendering option is set to true. + * @param {string} Type of the export operation to be performed. Following are the two export types that are supported now,1. 'image'2. 'excel'Example + * @param {string} URL of the service, where the chart will be exported to excel.Example, + * @param {boolean} When this parameter is true, all the chart objects initialized to the same document are exported to a single excel file. This is an optional parameter. By default, it is false.Example, + * @returns {void} + */ + export(type: string, url: string, exportMultipleChart: boolean): void; + + /** Redraws the entire chart. You can call this method whenever you update, add or remove points from the data source or whenever you want to refresh the UI. + * @returns {void} + */ + redraw(): void; +} +export module Chart{ + +export interface Model { + + /**Options for adding and customizing annotations in Chart. + */ + annotations?: Array; + + /**Url of the image to be used as chart background. + * @Default {null} + */ + backGroundImageUrl?: string; + + /**Options for customizing the color, opacity and width of the chart border. + */ + border?: Border; + + /**Controls whether Chart has to be responsive or not. + * @Default {false} + */ + canResize?: boolean; + + /**Options for configuring the border and background of the plot area. + */ + chartArea?: ChartArea; + + /**Options to split Chart into multiple plotting areas vertically. Each object in the collection represents a plotting area in Chart. + */ + columnDefinitions?: Array; + + /**Options for configuring the properties of all the series. You can also override the options for specific series by using series collection. + */ + commonSeriesOptions?: CommonSeriesOptions; + + /**Options for displaying and customizing the crosshair. + */ + crosshair?: Crosshair; + + /**Depth of the 3D Chart from front view of series to background wall. This property is applicable only for 3D view. + * @Default {100} + */ + depth?: number; + + /**Controls whether 3D view has to be enabled or not. 3D view is supported only for column, bar. Stacking column, stacking bar, pie and doughnut series types. + * @Default {false} + */ + enable3D?: boolean; + + /**Controls whether Chart has to be rendered as Canvas or SVG. Canvas rendering supports all functionalities in SVG rendering except 3D Charts. + * @Default {false} + */ + enableCanvasRendering?: boolean; + + /**Controls whether 3D view has to be rotated on dragging. This property is applicable only for 3D view. + * @Default {false} + */ + enableRotation?: boolean; + + /**Options to customize the technical indicators. + */ + indicators?: Array; + + /**Options to customize the legend items and legend title. + */ + legend?: Legend; + + /**Name of the culture based on which chart should be localized. Number and date time values are localized with respect to the culture name.String type properties like title text are not localized automatically. Provide localized text as value to string type properties. + * @Default {en-US} + */ + locale?: string; + + /**Palette is used to store the series fill color in array and apply the color to series collection in the order of series index. + * @Default {null} + */ + palette?: Array; + + /**Options to customize the left, right, top and bottom margins of chart area. + */ + Margin?: any; + + /**Perspective angle of the 3D view. Chart appears closer when perspective angle is decreased, and distant when perspective angle is increased.This property is applicable only when 3D view is enabled + * @Default {90} + */ + perspectiveAngle?: number; + + /**This is a horizontal axis that contains options to configure axis and it is the primary x axis for all the series in series array. To override x axis for particular series, create an axis object by providing unique name by using name property and add it to axes array. Then, assign the name to the series’s xAxisName property to link both axis and series. + */ + primaryXAxis?: PrimaryXAxis; + + /**This is a vertical axis that contains options to configure axis. This is the primary y axis for all the series in series array. To override y axis for particular series, create an axis object by providing unique name by using name property and add it to axes array. Then, assign the name to the series’s yAxisName property to link both axis and series. + */ + primaryYAxis?: PrimaryYAxis; + + /**Rotation angle of the 3D view. This property is applicable only when 3D view is enabled. + * @Default {0} + */ + rotation?: number; + + /**Options to split Chart into multiple plotting areas horizontally. Each object in the collection represents a plotting area in Chart. + */ + rowDefinitions?: Array; + + /**Specifies the properties used for customizing the series. + */ + series?: Array; + + /**Controls whether data points has to be displayed side by side or along the depth of the axis. + * @Default {false} + */ + sideBySideSeriesPlacement?: boolean; + + /**Options to customize the Chart size. + */ + size?: Size; + + /**Specifies the theme for Chart. + * @Default {Flatlight. See Theme} + */ + theme?: ej.datavisualization.Chart.Theme|string; + + /**Slope angle of 3D Chart. This property is applicable only when 3D view is enabled. + * @Default {0} + */ + tilt?: number; + + /**Options for customizing the title and subtitle of Chart. + */ + title?: Title; + + /**Width of the wall used in 3D Chart. Wall is present only in Cartesian type 3D series and not in 3D pie or Doughnut series. This property is applicable only when 3D view is enabled. + * @Default {2} + */ + wallSize?: number; + + /**Options for enabling zooming feature of chart. + */ + zooming?: Zooming; + + /**Fires after the series animation is completed. This event will be triggered for each series when animation is enabled.*/ + animationComplete? (e: AnimationCompleteEventArgs): void; + + /**Fires before rendering the labels. This event is fired for each label in axis. You can use this event to add custom text to axis labels.*/ + axesLabelRendering? (e: AxesLabelRenderingEventArgs): void; + + /**Fires during the initialization of axis labels.*/ + axesLabelsInitialize? (e: AxesLabelsInitializeEventArgs): void; + + /**Fires during axes range calculation. This event is fired for each axis present in Chart. You can use this event to customize axis range as required.*/ + axesRangeCalculate? (e: AxesRangeCalculateEventArgs): void; + + /**Fires before rendering the axis title. This event is triggered for each axis with title. You can use this event to add custom text to axis title.*/ + axesTitleRendering? (e: AxesTitleRenderingEventArgs): void; + + /**Fires during the calculation of chart area bounds. You can use this event to customize the bounds of chart area.*/ + chartAreaBoundsCalculate? (e: ChartAreaBoundsCalculateEventArgs): void; + + /**Fires after chart is created.*/ + create? (e: CreateEventArgs): void; + + /**Fires when chart is destroyed completely.*/ + destroy? (e: DestroyEventArgs): void; + + /**Fires before rendering the data labels. This event is triggered for each data label in the series. You can use this event to add custom text in data labels.*/ + displayTextRendering? (e: DisplayTextRenderingEventArgs): void; + + /**Fires during the calculation of legend bounds. You can use this event to customize the bounds of legend.*/ + legendBoundsCalculate? (e: LegendBoundsCalculateEventArgs): void; + + /**Fires on clicking the legend item.*/ + legendItemClick? (e: LegendItemClickEventArgs): void; + + /**Fires when moving mouse over legend item. You can use this event for hit testing on legend items.*/ + legendItemMouseMove? (e: LegendItemMouseMoveEventArgs): void; + + /**Fires before rendering the legend item. This event is fired for each legend item in Chart. You can use this event to customize legend item shape or add custom text to legend item.*/ + legendItemRendering? (e: LegendItemRenderingEventArgs): void; + + /**Fires before loading the chart.*/ + load? (e: LoadEventArgs): void; + + /**Fires on clicking a point in chart. You can use this event to handle clicks made on points.*/ + pointRegionClick? (e: PointRegionClickEventArgs): void; + + /**Fires when mouse is moved over a point.*/ + pointRegionMouseMove? (e: PointRegionMouseMoveEventArgs): void; + + /**Fires before rendering chart.*/ + preRender? (e: PreRenderEventArgs): void; + + /**Fires after selecting a series. This event is triggered after selecting a series only if selection mode is series.*/ + seriesRegionClick? (e: SeriesRegionClickEventArgs): void; + + /**Fires before rendering a series. This event is fired for each series in Chart.*/ + seriesRendering? (e: SeriesRenderingEventArgs): void; + + /**Fires before rendering the marker symbols. This event is triggered for each marker in Chart.*/ + symbolRendering? (e: SymbolRenderingEventArgs): void; + + /**Fires before rendering the Chart title. You can use this event to add custom text in Chart title.*/ + titleRendering? (e: TitleRenderingEventArgs): void; + + /**Fires before rendering the tooltip. This event is fired when tooltip is enabled and mouse is hovered on a Chart point. You can use this event to customize tooltip before rendering.*/ + toolTipInitialize? (e: ToolTipInitializeEventArgs): void; + + /**Fires before rendering crosshair tooltip in axis. This event is fired for each axis with crosshair label enabled. You can use this event to customize crosshair label before rendering*/ + trackAxisToolTip? (e: TrackAxisToolTipEventArgs): void; + + /**Fires before rendering trackball tooltip. This event is fired for each series in Chart because trackball tooltip is displayed for all the series. You can use this event to customize the text displayed in trackball tooltip.*/ + trackToolTip? (e: TrackToolTipEventArgs): void; + + /**Fires, on clicking the axis label.*/ + axisLabelClick? (e: AxisLabelClickEventArgs): void; + + /**Fires on moving mouse over the axis label.*/ + axisLabelMouseMove? (e: AxisLabelMouseMoveEventArgs): void; + + /**Fires, on the clicking the chart.*/ + chartClick? (e: ChartClickEventArgs): void; + + /**Fires on moving mouse over the chart.*/ + chartMouseMove? (e: ChartMouseMoveEventArgs): void; + + /**Fires, on double clicking the chart.*/ + chartDoubleClick? (e: ChartDoubleClickEventArgs): void; + + /**Fires on clicking the annotation.*/ + annotationClick? (e: AnnotationClickEventArgs): void; + + /**Fires, after the chart is resized.*/ + afterResize? (e: AfterResizeEventArgs): void; + + /**Fires, when chart size is changing.*/ + beforeResize? (e: BeforeResizeEventArgs): void; + + /**Fires, when error bar is rendering.*/ + errorBarRendering? (e: ErrorBarRenderingEventArgs): void; +} + +export interface AnimationCompleteEventArgs { + + /**Instance of the series that completed has animation. + */ + series?: any; + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; +} + +export interface AxesLabelRenderingEventArgs { + + /**Instance of the corresponding axis. + */ + Axis?: any; + + /**Formatted text of the respective label. You can also add custom text to the label. + */ + LabelText?: string; + + /**Actual value of the label. + */ + LabelValue?: string; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the chart model object. + */ + model?: any; + + /**Name of the event + */ + type?: string; +} + +export interface AxesLabelsInitializeEventArgs { + + /**Collection of axes in Chart + */ + dataAxes?: any; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the chart model object. + */ + model?: any; + + /**Name of the event + */ + type?: string; +} + +export interface AxesRangeCalculateEventArgs { + + /**Difference between minimum and maximum value of axis range. + */ + delta?: number; + + /**Interval value of axis range. Grid lines, tick lines and axis labels are drawn based on this interval value. + */ + interval?: number; + + /**Maximum value of axis range. + */ + max?: number; + + /**Minimum value of axis range. + */ + min?: number; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the chart model object. + */ + model?: any; + + /**Name of the event + */ + type?: string; +} + +export interface AxesTitleRenderingEventArgs { + + /**Instance of the axis whose title is being rendered + */ + axes?: any; + + /**X-coordinate of title location + */ + locationX?: number; + + /**Y-coordinate of title location + */ + locationY?: number; + + /**Axis title text. You can add custom text to the title. + */ + title?: string; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the chart model object. + */ + model?: any; + + /**Name of the event + */ + type?: string; +} + +export interface ChartAreaBoundsCalculateEventArgs { + + /**Height of the chart area. + */ + areaBoundsHeight?: number; + + /**Width of the chart area. + */ + areaBoundsWidth?: number; + + /**X-coordinate of the chart area. + */ + areaBoundsX?: number; + + /**Y-coordinate of the chart area. + */ + areaBoundsY?: number; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the chart model object. + */ + model?: any; + + /**Name of the event + */ + type?: string; +} + +export interface CreateEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the chart model object. + */ + model?: any; + + /**Name of the event + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the chart model object. + */ + model?: any; + + /**Name of the event + */ + type?: string; +} + +export interface DisplayTextRenderingEventArgs { + + /**Text displayed in data label. You can add custom text to the data label + */ + text?: string; + + /**X-coordinate of data label location + */ + locationX?: number; + + /**Y-coordinate of data label location + */ + locationY?: number; + + /**Index of the series in series Collection whose data label is being rendered + */ + seriesIndex?: number; + + /**Index of the point in series whose data label is being rendered + */ + pointIndex?: number; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the chart model object. + */ + model?: any; + + /**Name of the event + */ + type?: string; +} + +export interface LegendBoundsCalculateEventArgs { + + /**Height of the legend. + */ + legendBoundsHeight?: number; + + /**Width of the legend. + */ + legendBoundsWidth?: number; + + /**Number of rows to display the legend items + */ + legendBoundsRows?: number; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the chart model object. + */ + model?: any; + + /**Name of the event + */ + type?: string; +} + +export interface LegendItemClickEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**X-coordinate of legend item in pixel + */ + startX?: number; + + /**Y-coordinate of legend item in pixel + */ + startY?: number; + + /**Instance of the legend item object that is about to be rendered + */ + LegendItem?: any; + + /**Options to customize the legend item styles such as border, color, size, etc…, + */ + style?: any; + + /**Instance that holds information about legend bounds and legend item bounds. + */ + Bounds?: any; + + /**Name of the legend item shape. Use this option to customize legend item shape before rendering + */ + symbolShape?: string; + + /**Instance of the series object corresponding to the legend item + */ + series?: any; +} + +export interface LegendItemMouseMoveEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**X-coordinate of legend item in pixel + */ + startX?: number; + + /**Y-coordinate of legend item in pixel + */ + startY?: number; + + /**Instance of the legend item object that is about to be rendered + */ + LegendItem?: any; + + /**Options to customize the legend item styles such as border, color, size, etc…, + */ + style?: any; + + /**Options to customize the legend item styles such as border, color, size, etc…, + */ + Bounds?: any; + + /**Name of the legend item shape. Use this option to customize legend item shape before rendering + */ + symbolShape?: string; + + /**Instance of the series object corresponding to the legend item + */ + series?: any; +} + +export interface LegendItemRenderingEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**X-coordinate of legend item in pixel + */ + startX?: number; + + /**Y-coordinate of legend item in pixel + */ + startY?: number; + + /**Instance of the legend item object that is about to be rendered + */ + legendItem?: any; + + /**Options to customize the legend item styles such as border, color, size, etc. + */ + style?: any; + + /**Name of the legend item shape. Use this option to customize legend item shape before rendering + */ + symbolShape?: string; +} + +export interface LoadEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; +} + +export interface PointRegionClickEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**X-coordinate of point in pixel + */ + locationX?: number; + + /**Y-coordinate of point in pixel + */ + locationY?: number; + + /**Index of the point in series + */ + pointIndex?: number; + + /**Index of the series in series collection to which the point belongs + */ + seriesIndex?: number; +} + +export interface PointRegionMouseMoveEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**X-coordinate of point in pixel + */ + locationX?: number; + + /**Y-coordinate of point in pixel + */ + locationY?: number; + + /**Index of the point in series + */ + pointIndex?: number; + + /**Index of the series in series collection to which the point belongs + */ + seriesIndex?: number; +} + +export interface PreRenderEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; +} + +export interface SeriesRegionClickEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**Instance of the selected series + */ + series?: any; + + /**Index of the selected series + */ + seriesIndex?: number; +} + +export interface SeriesRenderingEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**Instance of the series which is about to get rendered + */ + series?: any; +} + +export interface SymbolRenderingEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**Instance that holds the location of marker symbol + */ + location?: any; + + /**Options to customize the marker style such as color, border and size + */ + style?: any; +} + +export interface TitleRenderingEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**Option to customize the title location in pixels + */ + location?: any; + + /**Read-only option to find the size of the title + */ + size?: any; + + /**Use this option to add custom text in title + */ + title?: string; +} + +export interface ToolTipInitializeEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**Text to be displayed in tooltip. Set this option to customize the text displayed in tooltip + */ + currentText?: string; + + /**Index of the point on which mouse is hovered + */ + pointIndex?: number; + + /**Index of the series in series collection whose point is hovered by mouse + */ + seriesIndex?: number; +} + +export interface TrackAxisToolTipEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**Location of the crosshair label in pixels + */ + location?: any; + + /**Index of the axis for which crosshair label is displayed + */ + axisIndex?: number; + + /**Instance of the chart axis object for which cross hair label is displayed + */ + crossAxis?: number; + + /**Text to be displayed in crosshair label. Use this option to add custom text in crosshair label + */ + currentTrackText?: string; +} + +export interface TrackToolTipEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**Location of the trackball tooltip in pixels + */ + location?: any; + + /**Index of the point for which trackball tooltip is displayed + */ + pointIndex?: number; + + /**Index of the series in series collection + */ + seriesIndex?: number; + + /**Text to be displayed in trackball tooltip. Use this option to add custom text in trackball tooltip + */ + currentText?: string; + + /**Instance of the series object for which trackball tooltip is displayed. + */ + series?: any; +} + +export interface AxisLabelClickEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**X and Y co-ordinate of the labels in chart area. + */ + location?: any; + + /**Index of the label. + */ + index?: number; + + /**Instance of the corresponding axis. + */ + axis?: any; + + /**Label that is clicked. + */ + text?: string; +} + +export interface AxisLabelMouseMoveEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**X and Y co-ordinate of the labels in chart area. + */ + location?: any; + + /**Index of the label. + */ + index?: number; + + /**Instance of the corresponding axis. + */ + axis?: any; + + /**Label that is hovered. + */ + text?: string; +} + +export interface ChartClickEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**X and Y co-ordinate of the points with respect to chart area. + */ + location?: any; + + /**ID of the target element. + */ + id?: string; + + /**Width and height of the chart. + */ + size?: any; + + /**x-coordinate of the pointer, relative to the page + */ + pageX?: number; + + /**y-coordinate of the pointer, relative to the page + */ + pageY?: number; +} + +export interface ChartMouseMoveEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**X and Y co-ordinate of the points with respect to chart area. + */ + location?: any; + + /**ID of the target element. + */ + id?: string; + + /**Width and height of the chart. + */ + size?: any; + + /**x-coordinate of the pointer, relative to the page + */ + pageX?: number; + + /**y-coordinate of the pointer, relative to the page + */ + pageY?: number; +} + +export interface ChartDoubleClickEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**X and Y co-ordinate of the points with respect to chart area. + */ + location?: any; + + /**ID of the target element. + */ + id?: string; + + /**Width and height of the chart. + */ + size?: any; + + /**x-coordinate of the pointer, relative to the page + */ + pageX?: number; + + /**y-coordinate of the pointer, relative to the page + */ + pageY?: number; +} + +export interface AnnotationClickEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**X and Y co-ordinate of the annotation in chart area. + */ + location?: any; + + /**Information about the annotation, like Coordinate unit, Region, content + */ + contentData?: any; + + /**x-coordinate of the pointer, relative to the page + */ + pageX?: number; + + /**y-coordinate of the pointer, relative to the page + */ + pageY?: number; +} + +export interface AfterResizeEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**Chart width, after resize + */ + width?: number; + + /**Chart height, after resize + */ + height?: number; + + /**Chart width, before resize + */ + prevWidth?: number; + + /**Chart height, before resize + */ + prevHeight?: number; + + /**Chart width, when the chart was first rendered + */ + originalWidth?: number; + + /**Chart height, when the chart was first rendered + */ + originalHeight?: number; +} + +export interface BeforeResizeEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**Chart width, before resize + */ + currentWidth?: number; + + /**Chart height, before resize + */ + currentHeight?: number; + + /**Chart width, after resize + */ + newWidth?: number; + + /**Chart height, after resize + */ + newHeight?: number; +} + +export interface ErrorBarRenderingEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**Error bar Object + */ + errorbar?: any; +} + +export interface AnnotationsMargin { + + /**Annotation is placed at the specified value above its original position. + * @Default {0} + */ + bottom?: number; + + /**Annotation is placed at the specified value from left side of its original position. + * @Default {0} + */ + left?: number; + + /**Annotation is placed at the specified value from the right side of its original position. + * @Default {0} + */ + right?: number; + + /**Annotation is placed at the specified value under its original position. + * @Default {0} + */ + top?: number; +} + +export interface Annotations { + + /**Angle to rotate the annotation in degrees. + * @Default {'0'} + */ + angle?: number; + + /**Text content or id of a HTML element to be displayed as annotation. + */ + content?: string; + + /**Specifies how annotations have to be placed in Chart. + * @Default {none. See CoordinateUnit} + */ + coordinateUnit?: ej.datavisualization.Chart.CoordinateUnit|string; + + /**Specifies the horizontal alignment of the annotation. + * @Default {middle. See HorizontalAlignment} + */ + horizontalAlignment?: ej.datavisualization.Chart.HorizontalAlignment|string; + + /**Options to customize the margin of annotation. + */ + margin?: AnnotationsMargin; + + /**Controls the opacity of the annotation. + * @Default {1} + */ + opacity?: number; + + /**Specifies whether annotation has to be placed with respect to chart or series. + * @Default {chart. See Region} + */ + region?: ej.datavisualization.Chart.Region|string; + + /**Specifies the vertical alignment of the annotation. + * @Default {middle. See VerticalAlignment} + */ + verticalAlignment?: ej.datavisualization.Chart.VerticalAlignment|string; + + /**Controls the visibility of the annotation. + * @Default {false} + */ + visible?: boolean; + + /**Represents the horizontal offset when coordinateUnit is pixels.when coordinateUnit is points, it represents the x-coordinate of axis bounded with xAxisName property or primary X axis when xAxisName is not provided.This property is not applicable when coordinateUnit is none. + * @Default {0} + */ + x?: number; + + /**Name of the horizontal axis to be used for positioning the annotation. This property is applicable only when coordinateUnit is points. + */ + xAxisName?: string; + + /**Represents the vertical offset when coordinateUnit is pixels.When coordinateUnit is points, it represents the y-coordinate of axis bounded with yAxisName property or primary Y axis when yAxisName is not provided.This property is not applicable when coordinateUnit is none. + * @Default {0} + */ + y?: number; + + /**Name of the vertical axis to be used for positioning the annotation.This property is applicable only when coordinateUnit is points. + */ + yAxisName?: string; +} + +export interface Border { + + /**Border color of the chart. + * @Default {null} + */ + color?: string; + + /**Opacity of the chart border. + * @Default {0.3} + */ + opacity?: number; + + /**Width of the Chart border. + * @Default {0} + */ + width?: number; +} + +export interface ChartAreaBorder { + + /**Border color of the plot area. + * @Default {Gray} + */ + color?: string; + + /**Opacity of the plot area border. + * @Default {0.3} + */ + opacity?: number; + + /**Border width of the plot area. + * @Default {0.5} + */ + width?: number; +} + +export interface ChartArea { + + /**Background color of the plot area. + * @Default {transparent} + */ + background?: string; + + /**Options for customizing the border of the plot area. + */ + border?: ChartAreaBorder; +} + +export interface ColumnDefinitions { + + /**Specifies the unit to measure the width of the column in plotting area. + * @Default {'pixel'. See Unit} + */ + unit?: ej.datavisualization.Chart.Unit|string; + + /**Width of the column in plotting area. Width is measured in either pixel or percentage based on the value of unit property. + * @Default {50} + */ + columnWidth?: number; + + /**Color of the line that indicates the starting point of the column in plotting area. + * @Default {transparent} + */ + lineColor?: string; + + /**Width of the line that indicates the starting point of the column in plot area. + * @Default {1} + */ + lineWidth?: number; +} + +export interface CommonSeriesOptionsBorder { + + /**Border color of all series. + * @Default {transparent} + */ + color?: string; + + /**DashArray for border of the series. + * @Default {null} + */ + dashArray?: string; + + /**Border width of all series. + * @Default {1} + */ + width?: number; +} + +export interface CommonSeriesOptionsFont { + + /**Font color of the text in all series. + * @Default {#707070} + */ + color?: string; + + /**Font Family for all the series. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Specifies the font Style for all the series. + * @Default {normal} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Specifies the font weight for all the series. + * @Default {regular} + */ + fontWeight?: ej.datavisualization.Chart.FontWeight|string; + + /**Opacity for text in all the series. + * @Default {1} + */ + opacity?: number; + + /**Font size for text in all the series. + * @Default {12px} + */ + size?: string; +} + +export interface CommonSeriesOptionsMarkerBorder { + + /**Border color of the marker shape. + * @Default {white} + */ + color?: string; + + /**Border width of the marker shape. + * @Default {3} + */ + width?: number; +} + +export interface CommonSeriesOptionsMarkerDataLabelBorder { + + /**Border color of the data label. + * @Default {null} + */ + color?: string; + + /**Border width of the data label. + * @Default {0.1} + */ + width?: number; +} + +export interface CommonSeriesOptionsMarkerDataLabelConnectorLine { + + /**Specifies when the connector has to be drawn as Bezier curve or straight line. This is applicable only for Pie and Doughnut chart types. + * @Default {line. See ConnectorLineType} + */ + type?: ej.datavisualization.Chart.ConnectorLineType|string; + + /**Width of the connector. + * @Default {0.5} + */ + width?: number; +} + +export interface CommonSeriesOptionsMarkerDataLabelFont { + + /**Font family of the data label. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Font style of the data label. + * @Default {normal. See FontStyle} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Font weight of the data label. + * @Default {regular. See FontWeight} + */ + fontWeight?: ej.datavisualization.Chart.FontWeight|string; + + /**Opacity of the text. + * @Default {1} + */ + opacity?: number; + + /**Font size of the data label. + * @Default {12px} + */ + size?: string; +} + +export interface CommonSeriesOptionsMarkerDataLabelMargin { + + /**Bottom margin of the text. + * @Default {5} + */ + bottom?: number; + + /**Left margin of the text. + * @Default {5} + */ + left?: number; + + /**Right margin of the text. + * @Default {5} + */ + right?: number; + + /**Top margin of the text. + * @Default {5} + */ + top?: number; +} + +export interface CommonSeriesOptionsMarkerDataLabel { + + /**Angle of the data label in degrees. Only the text gets rotated, whereas the background and border does not rotate. + * @Default {null} + */ + angle?: number; + + /**Options for customizing the border of the data label. + */ + border?: CommonSeriesOptionsMarkerDataLabelBorder; + + /**Options for displaying and customizing the line that connects point and data label. + */ + connectorLine?: CommonSeriesOptionsMarkerDataLabelConnectorLine; + + /**Background color of the data label. + * @Default {null} + */ + fill?: string; + + /**Options for customizing the data label font. + */ + font?: CommonSeriesOptionsMarkerDataLabelFont; + + /**Horizontal alignment of the data label. + * @Default {center} + */ + horizontalTextAlignment?: ej.datavisualization.Chart.HorizontalTextAlignment|string; + + /**Margin of the text to its background shape. The size of the background shape increases based on the margin applied to its text. + */ + margin?: CommonSeriesOptionsMarkerDataLabelMargin; + + /**Opacity of the data label. + * @Default {1} + */ + opacity?: number; + + /**Background shape of the data label. + * @Default {none. See Shape} + */ + shape?: ej.datavisualization.Chart.Shape|string; + + /**Name of a field in data source, where datalabel text is displayed. + */ + textMappingName?: string; + + /**Specifies the position of the data label. This property can be used only for the series such as column, bar, stacked column, stacked bar, 100% stacked column, 100% stacked bar, candle and OHLC. + * @Default {top. See TextPosition} + */ + textPosition?: ej.datavisualization.Chart.TextPosition|string; + + /**Vertical alignment of the data label. + * @Default {center} + */ + verticalTextAlignment?: ej.datavisualization.Chart.VerticalTextAlignment|string; + + /**Controls the visibility of the data labels. + * @Default {false} + */ + visible?: boolean; +} + +export interface CommonSeriesOptionsMarkerSize { + + /**Height of the marker. + * @Default {6} + */ + height?: number; + + /**Width of the marker. + * @Default {6} + */ + width?: number; +} + +export interface CommonSeriesOptionsMarker { + + /**Options for customizing the border of the marker shape. + */ + border?: CommonSeriesOptionsMarkerBorder; + + /**Options for displaying and customizing data labels. + */ + dataLabel?: CommonSeriesOptionsMarkerDataLabel; + + /**Color of the marker shape. + * @Default {null} + */ + fill?: string; + + /**The URL for the Image to be displayed as marker. In order to display image as marker, set series.marker.shape as ‘image’. + */ + imageUrl?: string; + + /**Opacity of the marker. + * @Default {1} + */ + opacity?: number; + + /**Specifies the shape of the marker. + * @Default {circle. See Shape} + */ + shape?: ej.datavisualization.Chart.Shape|string; + + /**Options for customizing the size of the marker shape. + */ + size?: CommonSeriesOptionsMarkerSize; + + /**Controls the visibility of the marker shape. + * @Default {false} + */ + visible?: boolean; +} + +export interface CommonSeriesOptionsTooltipBorder { + + /**Border color of the tooltip. + * @Default {null} + */ + color?: string; + + /**Border width of the tooltip. + * @Default {1} + */ + width?: number; +} + +export interface CommonSeriesOptionsTooltip { + + /**Options for customizing the border of the tooltip. + */ + border?: CommonSeriesOptionsTooltipBorder; + + /**Customize the corner radius of the tooltip rectangle. + * @Default {0} + */ + rx?: number; + + /**Customize the corner radius of the tooltip rectangle. + * @Default {0} + */ + ry?: number; + + /**Specifies the duration, the tooltip has to be displayed. + * @Default {500ms} + */ + duration?: string; + + /**Enables/disables the animation of the tooltip when moving from one point to other. + * @Default {true} + */ + enableAnimation?: boolean; + + /**Background color of the tooltip. + * @Default {null} + */ + fill?: string; + + /**Format of the tooltip content. + * @Default {#point.x# : #point.y#} + */ + format?: string; + + /**Opacity of the tooltip. + * @Default {0.5} + */ + opacity?: number; + + /**Custom template to format the tooltip content. Use “point.x” and “point.y” as a placeholder text to display the corresponding data point’s x and y value. + * @Default {null} + */ + template?: string; + + /**Controls the visibility of the tooltip. + * @Default {false} + */ + visible?: boolean; +} + +export interface CommonSeriesOptionsEmptyPointSettingsStyleBorder { + + /**Border color of the empty point. + */ + color?: string; + + /**Border width of the empty point. + * @Default {1} + */ + width?: number; +} + +export interface CommonSeriesOptionsEmptyPointSettingsStyle { + + /**Color of the empty point. + */ + color?: string; + + /**Options for customizing border of the empty point in the series. + */ + border?: CommonSeriesOptionsEmptyPointSettingsStyleBorder; +} + +export interface CommonSeriesOptionsEmptyPointSettings { + + /**Controls the visibility of the empty point. + * @Default {true} + */ + visible?: boolean; + + /**Specifies the mode of empty point. + * @Default {gap} + */ + displayMode?: ej.datavisualization.Chart.EmptyPointMode|string; + + /**Options for customizing the color and border of the empty point in the series. + */ + style?: CommonSeriesOptionsEmptyPointSettingsStyle; +} + +export interface CommonSeriesOptionsConnectorLine { + + /**Width of the connector line. + * @Default {1} + */ + width?: number; + + /**Color of the connector line. + * @Default {#565656} + */ + color?: string; + + /**DashArray of the connector line. + * @Default {null} + */ + dashArray?: string; + + /**DashArray of the connector line. + * @Default {1} + */ + opacity?: number; +} + +export interface CommonSeriesOptionsErrorBarCap { + + /**Show/Hides the error bar cap. + * @Default {true} + */ + visible?: boolean; + + /**Width of the error bar cap. + * @Default {1} + */ + width?: number; + + /**Length of the error bar cap. + * @Default {1} + */ + length?: number; + + /**Color of the error bar cap. + * @Default {“#000000”} + */ + fill?: string; +} + +export interface CommonSeriesOptionsErrorBar { + + /**Show/hides the error bar + * @Default {visible} + */ + visibility?: boolean; + + /**Specifies the type of error bar. + * @Default {FixedValue} + */ + type?: ej.datavisualization.Chart.ErrorBarType|string; + + /**Specifies the mode of error bar. + * @Default {vertical} + */ + mode?: ej.datavisualization.Chart.ErrorBarMode|string; + + /**Specifies the direction of error bar. + * @Default {both} + */ + direction?: ej.datavisualization.Chart.ErrorBarDirection|string; + + /**Value of vertical error bar. + * @Default {3} + */ + verticalErrorValue?: number; + + /**Value of horizontal error bar. + * @Default {1} + */ + horizontalErrorValue?: number; + + /**Value of positive horizontal error bar. + * @Default {1} + */ + horizontalPositiveErrorValue?: number; + + /**Value of negative horizontal error bar. + * @Default {1} + */ + horizontalNegativeErrorValue?: number; + + /**Value of positive vertical error bar. + * @Default {5} + */ + verticalPositiveErrorValue?: number; + + /**Value of negative vertical error bar. + * @Default {5} + */ + verticalNegativeErrorValue?: number; + + /**Fill color of the error bar. + * @Default {#000000} + */ + fill?: string; + + /**Width of the error bar. + * @Default {1} + */ + width?: number; + + /**Options for customizing the error bar cap. + */ + cap?: CommonSeriesOptionsErrorBarCap; +} + +export interface CommonSeriesOptionsTrendlines { + + /**Show/hides the trendline. + */ + visibility?: boolean; + + /**Specifies the type of the trendline for the series. + * @Default {linear. See TrendlinesType} + */ + type?: string; + + /**Name for the trendlines that is to be displayed in the legend text. + * @Default {trendline} + */ + name?: string; + + /**Fill color of the trendlines. + * @Default {#0000FF} + */ + fill?: string; + + /**Width of the trendlines. + * @Default {1} + */ + width?: number; + + /**Opacity of the trendline. + * @Default {1} + */ + opacity?: number; + + /**Pattern of dashes and gaps used to stroke the trendline. + */ + dashArray?: string; + + /**Future trends of the current series. + * @Default {0} + */ + forwardForecast?: number; + + /**Past trends of the current series. + * @Default {0} + */ + backwardForecast?: number; + + /**Specifies the order of the polynomial trendlines. + * @Default {0} + */ + polynomialOrder?: number; + + /**Specifies the moving average starting period value. + * @Default {2} + */ + period?: number; +} + +export interface CommonSeriesOptionsHighlightSettingsBorder { + + /**Border color of the series/point on highlight. + */ + color?: string; + + /**Border width of the series/point on highlight. + * @Default {2} + */ + width?: string; +} + +export interface CommonSeriesOptionsHighlightSettings { + + /**Enables/disables the ability to highlight the series or data point interactively. + * @Default {false} + */ + enable?: boolean; + + /**Specifies whether the series or data point has to be highlighted. + * @Default {series. See Mode} + */ + mode?: ej.datavisualization.Chart.Mode|string; + + /**Color of the series/point on highlight. + */ + color?: string; + + /**Opacity of the series/point on highlight. + * @Default {0.6} + */ + opacity?: number; + + /**Options for customizing the border of series on highlight. + */ + border?: CommonSeriesOptionsHighlightSettingsBorder; + + /**Specifies the pattern for the series/point on highlight. + * @Default {none. See Pattern} + */ + pattern?: string; + + /**Custom pattern for the series on highlight. + */ + customPattern?: string; +} + +export interface CommonSeriesOptionsSelectionSettingsBorder { + + /**Border color of the series/point on selection. + */ + color?: string; + + /**Border width of the series/point on selection. + * @Default {2} + */ + width?: string; +} + +export interface CommonSeriesOptionsSelectionSettings { + + /**Enables/disables the ability to select a series/data point interactively. + * @Default {false} + */ + enable?: boolean; + + /**Specifies the type of selection. + * @Default {single} + */ + type?: ej.datavisualization.Chart.SelectionType|string; + + /**Specifies whether the series or data point has to be selected. + * @Default {series. See Mode} + */ + mode?: ej.datavisualization.Chart.Mode|string; + + /**Color of the series/point on selection. + */ + color?: string; + + /**Opacity of the series/point on selection. + * @Default {0.6} + */ + opacity?: number; + + /**Options for customizing the border of the series on selection. + */ + border?: CommonSeriesOptionsSelectionSettingsBorder; + + /**Specifies the pattern for the series/point on selection. + * @Default {none. See Pattern} + */ + pattern?: string; + + /**Custom pattern for the series on selection. + */ + customPattern?: string; +} + +export interface CommonSeriesOptions { + + /**Options to customize the border of all the series. + */ + border?: CommonSeriesOptionsBorder; + + /**Pattern of dashes and gaps used to stroke all the line type series. + */ + dashArray?: string; + + /**Set the dataSource for all series. It can be an array of JSON objects or an instance of ej.DataManager. + * @Default {null} + */ + dataSource?: any; + + /**Controls the size of the hole in doughnut series. Value ranges from 0 to 1 + * @Default {0.4} + */ + doughnutCoefficient?: number; + + /**Controls the size of the doughnut series. Value ranges from 0 to 1. + * @Default {0.8} + */ + doughnutSize?: number; + + /**Specifies the type of series to be drawn in radar or polar series. + * @Default {line. See DrawType} + */ + drawType?: ej.datavisualization.Chart.DrawType|string; + + /**Enable/disable the animation for all the series. + * @Default {true} + */ + enableAnimation?: boolean; + + /**To avoid overlapping of data labels smartly. + * @Default {true} + */ + enableSmartLabels?: boolean; + + /**Start angle of pie/doughnut series. + * @Default {null} + */ + endAngle?: number; + + /**Explodes the pie/doughnut slices on mouse move. + * @Default {false} + */ + explode?: boolean; + + /**Explodes all the slice of pie/doughnut on render. + * @Default {false} + */ + explodeAll?: boolean; + + /**Index of the point to be exploded from pie/doughnut/pyramid/funnel. + * @Default {null} + */ + explodeIndex?: number; + + /**Specifies the distance of the slice from the center, when it is exploded. + * @Default {0.4} + */ + explodeOffset?: number; + + /**Fill color for all the series. + * @Default {null} + */ + fill?: string; + + /**Options for customizing the font of all the series. + */ + font?: CommonSeriesOptionsFont; + + /**Sets the height of the funnel in funnel series. Values can be either pixel or percentage. + * @Default {32.7%} + */ + funnelHeight?: string; + + /**Sets the width of the funnel in funnel series. Values can be either pixel or percentage. + * @Default {11.6%} + */ + funnelWidth?: string; + + /**Gap between the slices in pyramid and funnel series. + * @Default {0} + */ + gapRatio?: number; + + /**Specifies whether to join start and end point of a line/area series used in polar/radar chart to form a closed path. + * @Default {true} + */ + isClosed?: boolean; + + /**Specifies whether to stack the column series in polar/radar charts. + * @Default {false} + */ + isStacking?: boolean; + + /**Renders the chart vertically. This is applicable only for cartesian type series. + * @Default {false} + */ + isTransposed?: boolean; + + /**Position of the data label in pie/doughnut/pyramid/funnel series. OutsideExtended position is not applicable for pyramid/funnel. + * @Default {inside. See LabelPosition} + */ + labelPosition?: ej.datavisualization.Chart.LabelPosition|string; + + /**Specifies the line cap of the series. + * @Default {butt. See LineCap} + */ + lineCap?: ej.datavisualization.Chart.LineCap|string; + + /**Specifies the type of shape to be used where two lines meet. + * @Default {round. See LineJoin} + */ + lineJoin?: ej.datavisualization.Chart.LineJoin|string; + + /**Options for displaying and customizing marker for individual point in a series. Marker contains shapes and/or data labels. + */ + marker?: CommonSeriesOptionsMarker; + + /**Opacity of the series. + * @Default {1} + */ + opacity?: number; + + /**Name of a field in data source, where the fill color for all the data points is generated. + */ + palette?: string; + + /**Controls the size of pie series. Value ranges from 0 to 1. + * @Default {0.8} + */ + pieCoefficient?: number; + + /**Specifies the mode of the pyramid series. + * @Default {linear. See PyramidMode} + */ + pyramidMode?: ej.datavisualization.Chart.PyramidMode|string; + + /**Start angle from where the pie/doughnut series renders. By default it starts from 0. + * @Default {null} + */ + startAngle?: number; + + /**Options for customizing the tooltip of chart. + */ + tooltip?: CommonSeriesOptionsTooltip; + + /**Specifies the type of the series to render in chart. + * @Default {column. See Type} + */ + type?: ej.datavisualization.Chart.Type|string; + + /**Specifies the name of the x-axis that has to be associated with this series. Add an axis instance with this name to axes collection. + * @Default {null} + */ + xAxisName?: string; + + /**Name of the property in the datasource that contains x value for the series. + * @Default {null} + */ + xName?: string; + + /**Specifies the name of the y-axis that has to be associated with this series. Add an axis instance with this name to axes collection. + * @Default {null} + */ + yAxisName?: string; + + /**Name of the property in the datasource that contains y value for the series. + * @Default {null} + */ + yName?: string; + + /**Name of the property in the datasource that contains high value for the series. + * @Default {null} + */ + high?: string; + + /**Name of the property in the datasource that contains low value for the series. + * @Default {null} + */ + low?: string; + + /**Name of the property in the datasource that contains open value for the series. + * @Default {null} + */ + open?: string; + + /**Name of the property in the datasource that contains close value for the series. + * @Default {null} + */ + close?: string; + + /**Name of the property in the datasource that contains the size value for the bubble series. + * @Default {null} + */ + size?: string; + + /**Options for customizing the empty point in the series. + */ + emptyPointSettings?: CommonSeriesOptionsEmptyPointSettings; + + /**Fill color for the positive column of the waterfall. + * @Default {null} + */ + positiveFill?: string; + + /**Options for customizing the waterfall connector line. + */ + connectorLine?: CommonSeriesOptionsConnectorLine; + + /**Options to customize the error bar in series. + */ + errorBar?: CommonSeriesOptionsErrorBar; + + /**Option to add the trendlines to chart. + */ + trendlines?: Array; + + /**Options for customizing the appearance of the series or data point while highlighting. + */ + highlightSettings?: CommonSeriesOptionsHighlightSettings; + + /**Options for customizing the appearance of the series/data point on selection. + */ + selectionSettings?: CommonSeriesOptionsSelectionSettings; +} + +export interface CrosshairMarkerBorder { + + /**Border width of the marker. + * @Default {3} + */ + width?: number; +} + +export interface CrosshairMarkerSize { + + /**Height of the marker. + * @Default {10} + */ + height?: number; + + /**Width of the marker. + * @Default {10} + */ + width?: number; +} + +export interface CrosshairMarker { + + /**Options for customizing the border. + */ + border?: CrosshairMarkerBorder; + + /**Opacity of the marker. + * @Default {true} + */ + opacity?: boolean; + + /**Options for customizing the size of the marker. + */ + size?: CrosshairMarkerSize; + + /**Show/hides the marker. + * @Default {true} + */ + visible?: boolean; +} + +export interface Crosshair { + + /**Options for customizing the marker in crosshair. + */ + marker?: CrosshairMarker; + + /**Specifies the type of the crosshair. It can be trackball or crosshair + * @Default {crosshair. See CrosshairType} + */ + type?: ej.datavisualization.Chart.CrosshairType|string; + + /**Show/hides the crosshair/trackball visibility. + * @Default {false} + */ + visible?: boolean; +} + +export interface IndicatorsHistogramBorder { + + /**Color of the histogram border in MACD indicator. + * @Default {#9999ff} + */ + color?: string; + + /**Controls the width of histogram border line in MACD indicator. + * @Default {1} + */ + width?: number; +} + +export interface IndicatorsHistogram { + + /**Options to customize the histogram border in MACD indicator. + */ + border?: IndicatorsHistogramBorder; + + /**Color of histogram columns in MACD indicator. + * @Default {#ccccff} + */ + fill?: string; + + /**Opacity of histogram columns in MACD indicator. + * @Default {1} + */ + opacity?: number; +} + +export interface IndicatorsLowerLine { + + /**Color of lower line. + * @Default {#008000} + */ + fill?: string; + + /**Width of the lower line. + * @Default {2} + */ + width?: number; +} + +export interface IndicatorsMacdLine { + + /**Color of MACD line. + * @Default {#ff9933} + */ + fill?: string; + + /**Width of the MACD line. + * @Default {2} + */ + width?: number; +} + +export interface IndicatorsPeriodLine { + + /**Color of period line in indicator. + * @Default {blue} + */ + fill?: string; + + /**Width of the period line in indicators. + * @Default {2} + */ + width?: number; +} + +export interface IndicatorsTooltipBorder { + + /**Border color of indicator tooltip. + * @Default {null} + */ + color?: string; + + /**Border width of indicator tooltip. + * @Default {1} + */ + width?: number; +} + +export interface IndicatorsTooltip { + + /**Option to customize the border of indicator tooltip. + */ + border?: IndicatorsTooltipBorder; + + /**Specifies the animation duration of indicator tooltip. + * @Default {500ms} + */ + duration?: string; + + /**Enables/disables the tooltip animation. + * @Default {true} + */ + enableAnimation?: boolean; + + /**Format of indicator tooltip. Use “point.x” and “point.y” as a placeholder text to display the corresponding data point’s x and y value. + * @Default {#point.x# : #point.y#} + */ + format?: string; + + /**Background color of indicator tooltip. + * @Default {null} + */ + fill?: string; + + /**Opacity of indicator tooltip. + * @Default {0.95} + */ + opacity?: number; + + /**Controls the visibility of indicator tooltip. + * @Default {false} + */ + visible?: boolean; +} + +export interface IndicatorsUpperLine { + + /**Fill color of the upper line in indicators + * @Default {#ff9933} + */ + fill?: string; + + /**Width of the upper line in indicators. + * @Default {2} + */ + width?: number; +} + +export interface Indicators { + + /**The dPeriod value for stochastic indicator. + * @Default {3} + */ + dPeriod?: number; + + /**Enables/disables the animation. + * @Default {false} + */ + enableAnimation?: boolean; + + /**Color of the technical indicator. + * @Default {#00008B} + */ + fill?: string; + + /**Options to customize the histogram in MACD indicator. + */ + histogram?: IndicatorsHistogram; + + /**Specifies the k period in stochastic indicator. + * @Default {3} + */ + kPeriod?: number; + + /**Specifies the long period in MACD indicator. + * @Default {26} + */ + longPeriod?: number; + + /**Options to customize the lower line in indicators. + */ + lowerLine?: IndicatorsLowerLine; + + /**Options to customize the MACD line. + */ + macdLine?: IndicatorsMacdLine; + + /**Specifies the type of the MACD indicator. + * @Default {line. See MACDType} + */ + macdType?: string; + + /**Specifies period value in indicator. + * @Default {14} + */ + period?: number; + + /**Options to customize the period line in indicators. + */ + periodLine?: IndicatorsPeriodLine; + + /**Name of the series for which indicator has to be drawn. + */ + seriesName?: string; + + /**Specifies the short period in MACD indicator. + * @Default {13} + */ + shortPeriod?: number; + + /**Specifies the standard deviation value for Bollinger band indicator. + * @Default {2} + */ + standardDeviations?: number; + + /**Options to customize the tooltip. + */ + tooltip?: IndicatorsTooltip; + + /**Trigger value of MACD indicator. + * @Default {9} + */ + trigger?: number; + + /**Specifies the visibility of indicator. + * @Default {visible} + */ + visibility?: string; + + /**Specifies the type of indicator that has to be rendered. + * @Default {sma. See IndicatorsType} + */ + type?: string; + + /**Options to customize the upper line in indicators + */ + upperLine?: IndicatorsUpperLine; + + /**Width of the indicator line. + * @Default {2} + */ + width?: number; + + /**Name of the horizontal axis used for indicator. Primary X axis is used when x axis name is not specified. + */ + xAxisName?: string; + + /**Name of the vertical axis used for indicator. Primary Y axis is used when y axis name is not specified + */ + yAxisName?: string; +} + +export interface LegendBorder { + + /**Border color of the legend. + * @Default {transparent} + */ + color?: string; + + /**Border width of the legend. + * @Default {1} + */ + width?: number; +} + +export interface LegendFont { + + /**Font family for legend item text. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Font style for legend item text. + * @Default {Normal. See FontStyle} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Font weight for legend item text. + * @Default {Regular. See FontWeight} + */ + fontWeight?: ej.datavisualization.Chart.FontWeight|string; + + /**Font size for legend item text. + * @Default {12px} + */ + size?: string; +} + +export interface LegendItemStyleBorder { + + /**Border color of the legend items. + * @Default {transparent} + */ + color?: string; + + /**Border width of the legend items. + * @Default {1} + */ + width?: number; +} + +export interface LegendItemStyle { + + /**Options for customizing the border of legend items. + */ + border?: LegendItemStyleBorder; + + /**Height of the shape in legend items. + * @Default {10} + */ + height?: number; + + /**Width of the shape in legend items. + * @Default {10} + */ + width?: number; +} + +export interface LegendLocation { + + /**X value or horizontal offset to position the legend in chart. + * @Default {0} + */ + x?: number; + + /**Y value or vertical offset to position the legend. + * @Default {0} + */ + y?: number; +} + +export interface LegendSize { + + /**Height of the legend. Height can be specified in either pixel or percentage. + * @Default {null} + */ + height?: string; + + /**Width of the legend. Width can be specified in either pixel or percentage. + * @Default {null} + */ + width?: string; +} + +export interface LegendTitleFont { + + /**Font family for the text in legend title. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Font style for legend title. + * @Default {normal. See FontStyle} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Font weight for legend title. + * @Default {normal. See FontWeight} + */ + fontWeight?: ej.datavisualization.Chart.FontWeight|string; + + /**Font size for legend title. + * @Default {12px} + */ + size?: string; +} + +export interface LegendTitle { + + /**Options to customize the font used for legend title + */ + font?: LegendTitleFont; + + /**Text to be displayed in legend title. + */ + text?: string; + + /**Alignment of the legend title. + * @Default {center. See Alignment} + */ + textAlignment?: ej.datavisualization.Chart.Alignment|string; +} + +export interface Legend { + + /**Horizontal alignment of the legend. + * @Default {Center. See Alignment} + */ + alignment?: ej.datavisualization.Chart.Alignment|string; + + /**Background for the legend. Use this property to add a background image or background color for the legend. + */ + background?: string; + + /**Options for customizing the legend border. + */ + border?: LegendBorder; + + /**Number of columns to arrange the legend items. + * @Default {null} + */ + columnCount?: number; + + /**Controls whether legend has to use scrollbar or not. When enabled, scroll bar appears depending upon size and position properties of legend. + * @Default {true} + */ + enableScrollbar?: boolean; + + /**Fill color for the legend items. By using this property, it displays all legend item shapes in same color.Legend items representing invisible series is displayed in gray color. + * @Default {null} + */ + fill?: string; + + /**Options to customize the font used for legend item text. + */ + font?: LegendFont; + + /**Gap or padding between the legend items. + * @Default {10} + */ + itemPadding?: number; + + /**Options to customize the style of legend items. + */ + itemStyle?: LegendItemStyle; + + /**Options to customize the location of chart legend. Legend is placed in provided location only when value of position property is custom + */ + location?: LegendLocation; + + /**Opacity of the legend. + * @Default {1} + */ + opacity?: number; + + /**Places the legend at specified position. Legend can be placed at left, right, top or bottom of the chart area.To manually specify the location of legend, set custom as value to this property. + * @Default {Bottom. See Position} + */ + position?: ej.datavisualization.Chart.Position|string; + + /**Number of rows to arrange the legend items. + * @Default {null} + */ + rowCount?: number; + + /**Shape of the legend items. Default shape for pie and doughnut series is circle and all other series uses rectangle. + * @Default {None. See Shape} + */ + shape?: ej.datavisualization.Chart.Shape|string; + + /**Options to customize the size of the legend. + */ + size?: LegendSize; + + /**Options to customize the legend title. + */ + title?: LegendTitle; + + /**Specifies the action taken when the legend width is more than the textWidth. + * @Default {none. See textOverflow} + */ + textOverflow?: ej.datavisualization.Chart.TextOverflow|string; + + /**Text width for legend item. + * @Default {34} + */ + textWidth?: number; + + /**Controls the visibility of the legend. + * @Default {true} + */ + visible?: boolean; +} + +export interface PrimaryXAxisAlternateGridBandEven { + + /**Fill color for the even grid bands. + * @Default {transparent} + */ + fill?: string; + + /**Opacity of the even grid band. + * @Default {1} + */ + opacity?: number; +} + +export interface PrimaryXAxisAlternateGridBandOdd { + + /**Fill color of the odd grid bands + * @Default {transparent} + */ + fill?: string; + + /**Opacity of odd grid band + * @Default {1} + */ + opacity?: number; +} + +export interface PrimaryXAxisAlternateGridBand { + + /**Options for customizing even grid band. + */ + even?: PrimaryXAxisAlternateGridBandEven; + + /**Options for customizing odd grid band. + */ + odd?: PrimaryXAxisAlternateGridBandOdd; +} + +export interface PrimaryXAxisAxisLine { + + /**Pattern of dashes and gaps to be applied to the axis line. + * @Default {null} + */ + dashArray?: string; + + /**Padding for axis line. Normally, it is used along with plotOffset to pad the plot area. + * @Default {null} + */ + offset?: number; + + /**Show/hides the axis line. + * @Default {true} + */ + visible?: boolean; + + /**Width of axis line. + * @Default {1} + */ + width?: number; +} + +export interface PrimaryXAxisCrosshairLabel { + + /**Show/hides the crosshair label associated with this axis. + * @Default {false} + */ + visible?: boolean; +} + +export interface PrimaryXAxisFont { + + /**Font family of labels. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Font style of labels. + * @Default {ej.datavisualization.Chart.FontStyle.Normal. See FontStyle} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Font weight of the label. + * @Default {ej.datavisualization.Chart.FontWeight.Regular. See FontWeight} + */ + fontWeight?: ej.datavisualization.Chart.FontWeight|string; + + /**Opacity of the axis labels. + * @Default {1} + */ + opacity?: number; + + /**Font size of the axis labels. + * @Default {13px} + */ + size?: string; +} + +export interface PrimaryXAxisMajorGridLines { + + /**Pattern of dashes and gaps used to stroke the major grid lines. + * @Default {null} + */ + dashArray?: string; + + /**Opacity of major grid lines. + * @Default {1} + */ + opacity?: number; + + /**Show/hides the major grid lines. + * @Default {true} + */ + visible?: boolean; + + /**Width of the major grid lines. + * @Default {1} + */ + width?: number; +} + +export interface PrimaryXAxisMajorTickLines { + + /**Length of the major tick lines. + * @Default {5} + */ + size?: number; + + /**Show/hides the major tick lines. + * @Default {true} + */ + visible?: boolean; + + /**Width of the major tick lines. + * @Default {1} + */ + width?: number; +} + +export interface PrimaryXAxisMinorGridLines { + + /**Patterns of dashes and gaps used to stroke the minor grid lines. + * @Default {null} + */ + dashArray?: string; + + /**Show/hides the minor grid lines. + * @Default {true} + */ + visible?: boolean; + + /**Width of the minorGridLines. + * @Default {1} + */ + width?: number; +} + +export interface PrimaryXAxisMinorTickLines { + + /**Length of the minor tick lines. + * @Default {5} + */ + size?: number; + + /**Show/hides the minor tick lines. + * @Default {true} + */ + visible?: boolean; + + /**Width of the minor tick line. + * @Default {1} + */ + width?: number; +} + +export interface PrimaryXAxisRange { + + /**Minimum value of the axis range. + * @Default {null} + */ + minimum?: number; + + /**Maximum value of the axis range. + * @Default {null} + */ + maximum?: number; + + /**Interval of the axis range. + * @Default {null} + */ + interval?: number; +} + +export interface PrimaryXAxisStripLineFont { + + /**Font color of the strip line text. + * @Default {black} + */ + color?: string; + + /**Font family of the strip line text. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Font style of the strip line text. + * @Default {Normal} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Font weight of the strip line text. + * @Default {regular} + */ + fontWeight?: string; + + /**Opacity of the strip line text. + * @Default {1} + */ + opacity?: number; + + /**Font size of the strip line text. + * @Default {12px} + */ + size?: string; +} + +export interface PrimaryXAxisStripLine { + + /**Border color of the strip line. + * @Default {gray} + */ + borderColor?: string; + + /**Background color of the strip line. + * @Default {gray} + */ + color?: string; + + /**End value of the strip line. + * @Default {null} + */ + end?: number; + + /**Options for customizing the font of the text. + */ + font?: PrimaryXAxisStripLineFont; + + /**Start value of the strip line. + * @Default {null} + */ + start?: number; + + /**Indicates whether to render the strip line from the minimum/start value of the axis. This property does not work when start property is set. + * @Default {false} + */ + startFromAxis?: boolean; + + /**Specifies text to be displayed inside the strip line. + * @Default {stripLine} + */ + text?: string; + + /**Specifies the alignment of the text inside the strip line. + * @Default {middlecenter. See TextAlignment} + */ + textAlignment?: ej.datavisualization.Chart.TextAlignment|string; + + /**Show/hides the strip line. + * @Default {false} + */ + visible?: boolean; + + /**Width of the strip line. + * @Default {0} + */ + width?: number; + + /**Specifies the order where the strip line and the series have to be rendered. When zOrder is “behind”, strip line is rendered under the series and when it is “over”, it is rendered above the series. + * @Default {over. See ZIndex} + */ + zIndex?: ej.datavisualization.Chart.ZIndex|string; +} + +export interface PrimaryXAxisTitleFont { + + /**Font family of the title text. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Font style of the title text. + * @Default {ej.datavisualization.Chart.FontStyle.Normal} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Font weight of the title text. + * @Default {ej.datavisualization.Chart.FontWeight.Regular. See FontWeight} + */ + fontWeight?: ej.datavisualization.Chart.FontWeight|string; + + /**Opacity of the axis title text. + * @Default {1} + */ + opacity?: number; + + /**Font size of the axis title. + * @Default {16px} + */ + size?: string; +} + +export interface PrimaryXAxisTitle { + + /**Specifies whether to trim the axis title when it exceeds the chart area or the maximum width of the title. + * @Default {false} + */ + enableTrim?: boolean; + + /**Options for customizing the title font. + */ + font?: PrimaryXAxisTitleFont; + + /**Maximum width of the title, when the title exceeds this width, the title gets trimmed, when enableTrim is true. + * @Default {34} + */ + maximumTitleWidth?: number; + + /**Title for the axis. + */ + text?: string; + + /**Controls the visibility of axis title. + * @Default {true} + */ + visible?: boolean; +} + +export interface PrimaryXAxis { + + /**Options for customizing horizontal axis alternate grid band. + */ + alternateGridBand?: PrimaryXAxisAlternateGridBand; + + /**Options for customizing the axis line. + */ + axisLine?: PrimaryXAxisAxisLine; + + /**Specifies the index of the column where the axis is associated, when the chart area is divided into multiple plot areas by using columnDefinitions. + * @Default {null} + */ + columnIndex?: number; + + /**Specifies the number of columns or plot areas an axis has to span horizontally. + * @Default {null} + */ + columnSpan?: number; + + /**Options to customize the crosshair label. + */ + crosshairLabel?: PrimaryXAxisCrosshairLabel; + + /**With this setting, you can request axis to calculate intervals approximately equal to your desired interval. + * @Default {null} + */ + desiredIntervals?: number; + + /**Specifies the position of labels at the edge of the axis. + * @Default {ej.datavisualization.Chart.EdgeLabelPlacement.None. See EdgeLabelPlacement} + */ + edgeLabelPlacement?: ej.datavisualization.Chart.EdgeLabelPlacement|string; + + /**Specifies whether to trim the axis label when the width of the label exceeds the maximumLabelWidth. + * @Default {false} + */ + enableTrim?: boolean; + + /**Options for customizing the font of the axis Labels. + */ + font?: PrimaryXAxisFont; + + /**Specifies the type of interval in date time axis. + * @Default {null. See IntervalType} + */ + intervalType?: ej.datavisualization.Chart.IntervalType|string; + + /**Specifies whether to inverse the axis. + * @Default {false} + */ + isInversed?: boolean; + + /**Custom formatting for axis label and supports all standard formatting type of numerical and date time values. + * @Default {null} + */ + labelFormat?: string; + + /**Specifies the action to take when the axis labels are overlapping with each other. + * @Default {ej.datavisualization.Chart.LabelIntersectAction.None. See LabelIntersectAction} + */ + labelIntersectAction?: ej.datavisualization.Chart.LabelIntersectAction|string; + + /**Specifies the position of the axis labels. + * @Default {outside. See LabelPosition} + */ + labelPosition?: ej.datavisualization.Chart.LabelPosition|string; + + /**Angle in degrees to rotate the axis labels. + * @Default {null} + */ + labelRotation?: number; + + /**Logarithmic base value. This is applicable only for logarithmic axis. + * @Default {10} + */ + logBase?: number; + + /**Options for customizing major gird lines. + */ + majorGridLines?: PrimaryXAxisMajorGridLines; + + /**Options for customizing the major tick lines. + */ + majorTickLines?: PrimaryXAxisMajorTickLines; + + /**Maximum number of labels to be displayed in every 100 pixels. + * @Default {3} + */ + maximumLabels?: number; + + /**Maximum width of the axis label. When the label exceeds the width, the label gets trimmed when the enableTrim is set to true. + * @Default {34} + */ + maximumLabelWidth?: number; + + /**Options for customizing the minor grid lines. + */ + minorGridLines?: PrimaryXAxisMinorGridLines; + + /**Options for customizing the minor tick lines. + */ + minorTickLines?: PrimaryXAxisMinorTickLines; + + /**Specifies the number of minor ticks per interval. + * @Default {null} + */ + minorTicksPerInterval?: number; + + /**Unique name of the axis. To associate an axis with the series, you have to set this name to the xAxisName/yAxisName property of the series. + * @Default {null} + */ + name?: string; + + /**Specifies whether to render the axis at the opposite side of its default position. + * @Default {false} + */ + opposedPosition?: boolean; + + /**Specifies the padding for the plot area. + * @Default {10} + */ + plotOffset?: number; + + /**Options to customize the range of the axis. + */ + range?: PrimaryXAxisRange; + + /**Specifies the padding for the axis range. + * @Default {None. See RangePadding} + */ + rangePadding?: ej.datavisualization.Chart.RangePadding|string; + + /**Rounds the number to the given number of decimals. + * @Default {null} + */ + roundingPlaces?: number; + + /**Options for customizing the strip lines. + * @Default {[ ]} + */ + stripLine?: Array; + + /**Specifies the position of the axis tick lines. + * @Default {outside. See TickLinesPosition} + */ + tickLinesPosition?: ej.datavisualization.Chart.TickLinesPosition|string; + + /**Options for customizing the axis title. + */ + title?: PrimaryXAxisTitle; + + /**Specifies the type of data the axis is handling. + * @Default {null. See ValueType} + */ + valueType?: ej.datavisualization.Chart.ValueType|string; + + /**Show/hides the axis. + * @Default {true} + */ + visible?: boolean; + + /**The axis is scaled by this factor. When zoomFactor is 0.5, the chart is scaled by 200% along this axis. Value ranges from 0 to 1. + * @Default {1} + */ + zoomFactor?: number; + + /**Position of the zoomed axis. Value ranges from 0 to 1. + * @Default {0} + */ + zoomPosition?: number; +} + +export interface PrimaryYAxisAlternateGridBandEven { + + /**Fill color for the even grid bands. + * @Default {transparent} + */ + fill?: string; + + /**Opacity of the even grid band. + * @Default {1} + */ + opacity?: number; +} + +export interface PrimaryYAxisAlternateGridBandOdd { + + /**Fill color of the odd grid bands. + * @Default {transparent} + */ + fill?: string; + + /**Opacity of odd grid band. + * @Default {1} + */ + opacity?: number; +} + +export interface PrimaryYAxisAlternateGridBand { + + /**Options for customizing even grid band. + */ + even?: PrimaryYAxisAlternateGridBandEven; + + /**Options for customizing odd grid band. + */ + odd?: PrimaryYAxisAlternateGridBandOdd; +} + +export interface PrimaryYAxisAxisLine { + + /**Pattern of dashes and gaps to be applied to the axis line. + * @Default {null} + */ + dashArray?: string; + + /**Padding for axis line. Normally, it is used along with plotOffset to pad the plot area. + * @Default {null} + */ + offset?: number; + + /**Show/hides the axis line. + * @Default {true} + */ + visible?: boolean; + + /**Width of axis line. + * @Default {1} + */ + width?: number; +} + +export interface PrimaryYAxisCrosshairLabel { + + /**Show/hides the crosshair label associated with this axis. + * @Default {false} + */ + visible?: boolean; +} + +export interface PrimaryYAxisFont { + + /**Font family of labels. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Font style of labels. + * @Default {ej.datavisualization.Chart.FontStyle.Normal. See FontStyle} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Font weight of the label. + * @Default {ej.datavisualization.Chart.FontWeight.Regular. See FontWeight} + */ + fontWeight?: ej.datavisualization.Chart.FontWeight|string; + + /**Opacity of the axis labels. + * @Default {1} + */ + opacity?: number; + + /**Font size of the axis labels. + * @Default {13px} + */ + size?: string; +} + +export interface PrimaryYAxisMajorGridLines { + + /**Pattern of dashes and gaps used to stroke the major grid lines. + * @Default {null} + */ + dashArray?: string; + + /**Opacity of major grid lines. + * @Default {1} + */ + opacity?: number; + + /**Show/hides the major grid lines. + * @Default {true} + */ + visible?: boolean; + + /**Width of the major grid lines. + * @Default {1} + */ + width?: number; +} + +export interface PrimaryYAxisMajorTickLines { + + /**Length of the major tick lines. + * @Default {5} + */ + size?: number; + + /**Show/hides the major tick lines. + * @Default {true} + */ + visible?: boolean; + + /**Width of the major tick lines. + * @Default {1} + */ + width?: number; +} + +export interface PrimaryYAxisMinorGridLines { + + /**Patterns of dashes and gaps used to stroke the minor grid lines. + * @Default {null} + */ + dashArray?: string; + + /**Show/hides the minor grid lines. + * @Default {true} + */ + visible?: boolean; + + /**Width of the minorGridLines. + * @Default {1} + */ + width?: number; +} + +export interface PrimaryYAxisMinorTickLines { + + /**Length of the minor tick lines. + * @Default {5} + */ + size?: number; + + /**Show/hides the minor tick lines. + * @Default {true} + */ + visible?: boolean; + + /**Width of the minor tick line + * @Default {1} + */ + width?: number; +} + +export interface PrimaryYAxisStripLineFont { + + /**Font color of the strip line text. + * @Default {black} + */ + color?: string; + + /**Font family of the strip line text. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Font style of the strip line text. + * @Default {Normal} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Font weight of the strip line text. + * @Default {regular} + */ + fontWeight?: string; + + /**Opacity of the strip line text. + * @Default {1} + */ + opacity?: number; + + /**Font size of the strip line text. + * @Default {12px} + */ + size?: string; +} + +export interface PrimaryYAxisStripLine { + + /**Border color of the strip line. + * @Default {gray} + */ + borderColor?: string; + + /**Background color of the strip line. + * @Default {gray} + */ + color?: string; + + /**End value of the strip line. + * @Default {null} + */ + end?: number; + + /**Options for customizing the font of the text. + */ + font?: PrimaryYAxisStripLineFont; + + /**Start value of the strip line. + * @Default {null} + */ + start?: number; + + /**Indicates whether to render the strip line from the minimum/start value of the axis. This property won’t work when start property is set. + * @Default {false} + */ + startFromAxis?: boolean; + + /**Specifies text to be displayed inside the strip line. + * @Default {stripLine} + */ + text?: string; + + /**Specifies the alignment of the text inside the strip line. + * @Default {middlecenter. See TextAlignment} + */ + textAlignment?: ej.datavisualization.Chart.TextAlignment|string; + + /**Show/hides the strip line. + * @Default {false} + */ + visible?: boolean; + + /**Width of the strip line. + * @Default {0} + */ + width?: number; + + /**Specifies the order in which strip line and the series have to be rendered. When zOrder is “behind”, strip line is rendered below the series and when it is “over”, it is rendered above the series. + * @Default {over. See ZIndex} + */ + zIndex?: ej.datavisualization.Chart.ZIndex|string; +} + +export interface PrimaryYAxisTitleFont { + + /**Font family of the title text. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Font style of the title text. + * @Default {ej.datavisualization.Chart.FontStyle.Normal} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Font weight of the title text. + * @Default {ej.datavisualization.Chart.FontWeight.Regular. See FontWeight} + */ + fontWeight?: ej.datavisualization.Chart.FontWeight|string; + + /**Opacity of the axis title text. + * @Default {1} + */ + opacity?: number; + + /**Font size of the axis title. + * @Default {16px} + */ + size?: string; +} + +export interface PrimaryYAxisTitle { + + /**Specifies whether to trim the axis title when it exceeds the chart area or the maximum width of the title. + * @Default {ej.datavisualization.Chart.enableTrim} + */ + enableTrim?: boolean; + + /**Options for customizing the title font. + */ + font?: PrimaryYAxisTitleFont; + + /**Maximum width of the title, when the title exceeds this width, the title gets trimmed, when enableTrim is true. + * @Default {ej.datavisualization.Chart.maximumTitleWidth.null} + */ + maximumTitleWidth?: number; + + /**Title for the axis. + */ + text?: string; + + /**Controls the visibility of axis title. + * @Default {true} + */ + visible?: boolean; +} + +export interface PrimaryYAxis { + + /**Options for customizing vertical axis alternate grid band. + */ + alternateGridBand?: PrimaryYAxisAlternateGridBand; + + /**Options for customizing the axis line. + */ + axisLine?: PrimaryYAxisAxisLine; + + /**Options to customize the crosshair label. + */ + crosshairLabel?: PrimaryYAxisCrosshairLabel; + + /**With this setting, you can request axis to calculate intervals approximately equal to your desired interval. + * @Default {null} + */ + desiredIntervals?: number; + + /**Specifies the position of labels at the edge of the axis. + * @Default {ej.datavisualization.Chart.EdgeLabelPlacement.None. See EdgeLabelPlacement} + */ + edgeLabelPlacement?: ej.datavisualization.Chart.EdgeLabelPlacement|string; + + /**Specifies whether to trim the axis label when the width of the label exceeds the maximumLabelWidth. + * @Default {false} + */ + enableTrim?: boolean; + + /**Options for customizing the font of the axis Labels. + */ + font?: PrimaryYAxisFont; + + /**Specifies the type of interval in date time axis. + * @Default {null. See IntervalType} + */ + intervalType?: ej.datavisualization.Chart.IntervalType|string; + + /**Specifies whether to inverse the axis. + * @Default {false} + */ + isInversed?: boolean; + + /**Custom formatting for axis label and supports all standard formatting type of numerical and date time values. + * @Default {null} + */ + labelFormat?: string; + + /**Specifies the action to take when the axis labels are overlapping with each other. + * @Default {ej.datavisualization.Chart.LabelIntersectAction.None} + */ + labelIntersectAction?: ej.datavisualization.Chart.LabelIntersectAction|string; + + /**Default Value + * @Default {outside. See LabelPosition} + */ + labelPosition?: ej.datavisualization.Chart.LabelPosition|string; + + /**Logarithmic base value. This is applicable only for logarithmic axis. + * @Default {10} + */ + logBase?: number; + + /**Options for customizing major gird lines. + */ + majorGridLines?: PrimaryYAxisMajorGridLines; + + /**Options for customizing the major tick lines. + */ + majorTickLines?: PrimaryYAxisMajorTickLines; + + /**Maximum number of labels to be displayed in every 100 pixels. + * @Default {3} + */ + maximumLabels?: number; + + /**Maximum width of the axis label. When the label exceeds the width, the label gets trimmed when the enableTrim is set to true. + * @Default {ej.datavisualization.Chart.maximumLabelWidth type {int}} + */ + maximumLabelWidth?: number; + + /**Options for customizing the minor grid lines. + */ + minorGridLines?: PrimaryYAxisMinorGridLines; + + /**Options for customizing the minor tick lines. + */ + minorTickLines?: PrimaryYAxisMinorTickLines; + + /**Specifies the number of minor ticks per interval. + * @Default {null} + */ + minorTicksPerInterval?: number; + + /**Unique name of the axis. To associate an axis with the series, you have to set this name to the xAxisName/yAxisName property of the series. + * @Default {null} + */ + name?: string; + + /**Specifies whether to render the axis at the opposite side of its default position. + * @Default {false} + */ + opposedPosition?: boolean; + + /**Specifies the padding for the plot area. + * @Default {10} + */ + plotOffset?: number; + + /**Specifies the padding for the axis range. + * @Default {ej.datavisualization.Chart.RangePadding.None. See RangePadding} + */ + rangePadding?: ej.datavisualization.Chart.RangePadding|string; + + /**Rounds the number to the given number of decimals. + * @Default {null} + */ + roundingPlaces?: number; + + /**Specifies the index of the row to which the axis is associated, when the chart area is divided into multiple plot areas by using rowDefinitions. + * @Default {null} + */ + rowIndex?: number; + + /**Specifies the number of row or plot areas an axis has to span vertically. + * @Default {null} + */ + rowSpan?: number; + + /**Options for customizing the strip lines. + * @Default {[ ]} + */ + stripLine?: Array; + + /**Specifies the position of the axis tick lines. + * @Default {outside. See TickLinesPosition} + */ + tickLinesPosition?: ej.datavisualization.Chart.TickLinesPosition|string; + + /**Options for customizing the axis title. + */ + title?: PrimaryYAxisTitle; + + /**Specifies the type of data the axis is handling. + * @Default {null. See ValueType} + */ + valueType?: ej.datavisualization.Chart.ValueType|string; + + /**Show/hides the axis. + * @Default {true} + */ + visible?: boolean; + + /**The axis is scaled by this factor. When zoomFactor is 0.5, the chart is scaled by 200% along this axis. Values ranges from 0 to 1. + * @Default {1} + */ + zoomFactor?: number; + + /**Position of the zoomed axis. Value ranges from 0 to 1 + * @Default {0} + */ + zoomPosition?: number; +} + +export interface RowDefinitions { + + /**Specifies the unit to measure the height of the row in plotting area. + * @Default {'pixel'. See Unit} + */ + unit?: ej.datavisualization.Chart.Unit|string; + + /**Height of the row in plotting area. Height is measured in either pixel or percentage based on the value of unit property. + * @Default {50} + */ + rowHeight?: number; + + /**Color of the line that indicates the starting point of the row in plotting area. + * @Default {transparent} + */ + lineColor?: string; + + /**Width of the line that indicates the starting point of the row in plot area. + * @Default {1} + */ + lineWidth?: number; +} + +export interface SeriesBorder { + + /**Border color of the series. + * @Default {transparent} + */ + color?: string; + + /**Border width of the series. + * @Default {1} + */ + width?: number; + + /**DashArray for border of the series. + * @Default {null} + */ + dashArray?: string; +} + +export interface SeriesFont { + + /**Font color of the series text. + * @Default {#707070} + */ + color?: string; + + /**Font Family of the series. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Font Style of the series. + * @Default {Normal} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Font weight of the series. + * @Default {Regular} + */ + fontWeight?: ej.datavisualization.Chart.FontWeight|string; + + /**Opacity of series text. + * @Default {1} + */ + opacity?: number; + + /**Size of the series text. + * @Default {12px} + */ + size?: string; +} + +export interface SeriesMarkerBorder { + + /**Border color of the marker shape. + * @Default {white} + */ + color?: string; + + /**Border width of the marker shape. + * @Default {3} + */ + width?: number; +} + +export interface SeriesMarkerDataLabelBorder { + + /**Border color of the data label. + * @Default {null} + */ + color?: string; + + /**Border width of the data label. + * @Default {0.1} + */ + width?: number; +} + +export interface SeriesMarkerDataLabelConnectorLine { + + /**Specifies when the connector has to be drawn as Bezier curve or straight line. This is applicable only for Pie and Doughnut chart types. + * @Default {line. See ConnectorLineType} + */ + type?: ej.datavisualization.Chart.Type|string; + + /**Width of the connector. + * @Default {0.5} + */ + width?: number; +} + +export interface SeriesMarkerDataLabelFont { + + /**Font family of the data label. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Font style of the data label. + * @Default {normal. See FontStyle} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Font weight of the data label. + * @Default {regular. See FontWeight} + */ + fontWeight?: ej.datavisualization.Chart.FontWeight|string; + + /**Opacity of the text. + * @Default {1} + */ + opacity?: number; + + /**Font size of the data label. + * @Default {12px} + */ + size?: string; +} + +export interface SeriesMarkerDataLabelMargin { + + /**Bottom margin of the text. + * @Default {5} + */ + bottom?: number; + + /**Left margin of the text. + * @Default {5} + */ + left?: number; + + /**Right margin of the text. + * @Default {5} + */ + right?: number; + + /**Top margin of the text. + * @Default {5} + */ + top?: number; +} + +export interface SeriesMarkerDataLabel { + + /**Angle of the data label in degrees. Only the text gets rotated, whereas the background and border does not rotate. + * @Default {null} + */ + angle?: number; + + /**Options for customizing the border of the data label. + */ + border?: SeriesMarkerDataLabelBorder; + + /**Options for displaying and customizing the line that connects point and data label. + */ + connectorLine?: SeriesMarkerDataLabelConnectorLine; + + /**Background color of the data label. + * @Default {null} + */ + fill?: string; + + /**Options for customizing the data label font. + */ + font?: SeriesMarkerDataLabelFont; + + /**Horizontal alignment of the data label. + * @Default {center} + */ + horizontalTextAlignment?: ej.datavisualization.Chart.HorizontalTextAlignment|string; + + /**Margin of the text to its background shape. The size of the background shape increases based on the margin applied to its text. + */ + margin?: SeriesMarkerDataLabelMargin; + + /**Opacity of the data label. + * @Default {1} + */ + opacity?: number; + + /**Background shape of the data label. + * @Default {No shape is rendered by default, so its value is ‘none’. See Shape} + */ + shape?: ej.datavisualization.Chart.Shape|string; + + /**Name of a field in data source where datalabel text is displayed. + */ + textMappingName?: string; + + /**Specifies the position of the data label. This property can be used only for the series such as column, bar, stacked column, stacked bar, 100% stacked column, 100% stacked bar, candle and OHLC. + * @Default {top. See TextPosition} + */ + textPosition?: ej.datavisualization.Chart.TextPosition|string; + + /**Vertical alignment of the data label. + * @Default {'center'} + */ + verticalTextAlignment?: ej.datavisualization.Chart.VerticalTextAlignment|string; + + /**Controls the visibility of the data labels. + * @Default {false} + */ + visible?: boolean; + + /**Custom template to format the data label content. Use “point.x” and “point.y” as a placeholder text to display the corresponding data point’s x and y value. + */ + template?: string; + + /**Moves the label vertically by some offset. + * @Default {0} + */ + offset?: number; +} + +export interface SeriesMarkerSize { + + /**Height of the marker. + * @Default {6} + */ + height?: number; + + /**Width of the marker. + * @Default {6} + */ + width?: number; +} + +export interface SeriesMarker { + + /**Options for customizing the border of the marker shape. + */ + border?: SeriesMarkerBorder; + + /**Options for displaying and customizing data labels. + */ + dataLabel?: SeriesMarkerDataLabel; + + /**Color of the marker shape. + * @Default {null} + */ + fill?: string; + + /**The URL for the Image that is to be displayed as marker. In order to display image as marker, set series.marker.shape as ‘image’. + */ + imageUrl?: string; + + /**Opacity of the marker. + * @Default {1} + */ + opacity?: number; + + /**Specifies the shape of the marker. + * @Default {circle. See Shape} + */ + shape?: ej.datavisualization.Chart.Shape|string; + + /**Options for customizing the size of the marker shape. + */ + size?: SeriesMarkerSize; + + /**Controls the visibility of the marker shape. + * @Default {false} + */ + visible?: boolean; +} + +export interface SeriesEmptyPointSettingsStyleBorder { + + /**Border color of the empty point. + */ + color?: string; + + /**Border width of the empty point. + * @Default {1} + */ + width?: number; +} + +export interface SeriesEmptyPointSettingsStyle { + + /**Color of the empty point. + */ + color?: string; + + /**Options for customizing border of the empty point in the series. + */ + border?: SeriesEmptyPointSettingsStyleBorder; +} + +export interface SeriesEmptyPointSettings { + + /**Controls the visibility of the empty point. + * @Default {true} + */ + visible?: boolean; + + /**Specifies the mode of empty point. + * @Default {gap} + */ + displayMode?: ej.datavisualization.Chart.EmptyPointMode|string; + + /**Options for customizing the color and border of the empty point in the series. + */ + style?: SeriesEmptyPointSettingsStyle; +} + +export interface SeriesConnectorLine { + + /**Width of the connector line. + * @Default {1} + */ + width?: number; + + /**Color of the connector line. + * @Default {#565656} + */ + color?: string; + + /**DashArray of the connector line. + * @Default {null} + */ + dashArray?: string; + + /**DashArray of the connector line. + * @Default {1} + */ + opacity?: number; +} + +export interface SeriesErrorBarCap { + + /**Show/Hides the error bar cap. + * @Default {true} + */ + visible?: boolean; + + /**Width of the error bar cap. + * @Default {1} + */ + width?: number; + + /**Length of the error bar cap. + * @Default {1} + */ + length?: number; + + /**Color of the error bar cap. + * @Default {#000000} + */ + fill?: string; +} + +export interface SeriesErrorBar { + + /**Show/hides the error bar + * @Default {visible} + */ + visibility?: boolean; + + /**Specifies the type of error bar. + * @Default {FixedValue} + */ + type?: ej.datavisualization.Chart.ErrorBarType|string; + + /**Specifies the mode of error bar. + * @Default {vertical} + */ + mode?: ej.datavisualization.Chart.ErrorBarMode|string; + + /**Specifies the direction of error bar. + * @Default {both} + */ + direction?: ej.datavisualization.Chart.ErrorBarDirection|string; + + /**Value of vertical error bar. + * @Default {3} + */ + verticalErrorValue?: number; + + /**Value of horizontal error bar. + * @Default {1} + */ + horizontalErrorValue?: number; + + /**Value of positive horizontal error bar. + * @Default {1} + */ + horizontalPositiveErrorValue?: number; + + /**Value of negative horizontal error bar. + * @Default {1} + */ + horizontalNegativeErrorValue?: number; + + /**Value of positive vertical error bar. + * @Default {5} + */ + verticalPositiveErrorValue?: number; + + /**Value of negative vertical error bar. + * @Default {5} + */ + verticalNegativeErrorValue?: number; + + /**Fill color of the error bar. + * @Default {#000000} + */ + fill?: string; + + /**Width of the error bar. + * @Default {1} + */ + width?: number; + + /**Options for customizing the error bar cap. + */ + cap?: SeriesErrorBarCap; +} + +export interface SeriesPointsBorder { + + /**Border color of the point. + * @Default {null} + */ + color?: string; + + /**Border width of the point. + * @Default {null} + */ + width?: number; +} + +export interface SeriesPointsMarkerBorder { + + /**Border color of the marker shape. + * @Default {white} + */ + color?: string; + + /**Border width of the marker shape. + * @Default {3} + */ + width?: number; +} + +export interface SeriesPointsMarkerDataLabelBorder { + + /**Border color of the data label. + * @Default {null} + */ + color?: string; + + /**Border width of the data label. + * @Default {0.1} + */ + width?: number; +} + +export interface SeriesPointsMarkerDataLabelConnectorLine { + + /**Specifies when the connector has to be drawn as Bezier curve or straight line. This is applicable only for Pie and Doughnut chart types. + * @Default {line. See ConnectorLineType} + */ + type?: ej.datavisualization.Chart.ConnectorLineType|string; + + /**Width of the connector. + * @Default {0.5} + */ + width?: number; +} + +export interface SeriesPointsMarkerDataLabelFont { + + /**Font family of the data label. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Font style of the data label. + * @Default {normal. See FontStyle} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Font weight of the data label. + * @Default {regular. See FontWeight} + */ + fontWeight?: ej.datavisualization.Chart.FontWeight|string; + + /**Opacity of the text. + * @Default {1} + */ + opacity?: number; + + /**Font size of the data label. + * @Default {12px} + */ + size?: string; +} + +export interface SeriesPointsMarkerDataLabelMargin { + + /**Bottom margin of the text. + * @Default {5} + */ + bottom?: number; + + /**Left margin of the text. + * @Default {5} + */ + left?: number; + + /**Right margin of the text. + * @Default {5} + */ + right?: number; + + /**Top margin of the text. + * @Default {5} + */ + top?: number; +} + +export interface SeriesPointsMarkerDataLabel { + + /**Angle of the data label in degrees. Only the text gets rotated, whereas the background and border does not rotate. + * @Default {null} + */ + angle?: number; + + /**Options for customizing the border of the data label. + */ + border?: SeriesPointsMarkerDataLabelBorder; + + /**Options for displaying and customizing the line that connects point and data label. + */ + connectorLine?: SeriesPointsMarkerDataLabelConnectorLine; + + /**Background color of the data label. + * @Default {null} + */ + fill?: string; + + /**Options for customizing the data label font. + */ + font?: SeriesPointsMarkerDataLabelFont; + + /**Horizontal alignment of the data label. + * @Default {center} + */ + horizontalTextAlignment?: ej.datavisualization.Chart.HorizontalTextAlignment|string; + + /**Margin of the text to its background shape. The size of the background shape increases based on the margin applied to its text. + */ + margin?: SeriesPointsMarkerDataLabelMargin; + + /**Opacity of the data label. + * @Default {1} + */ + opacity?: number; + + /**Background shape of the data label. + * @Default {No shape is rendered by default, so its value is ‘none’. See Shape} + */ + shape?: ej.datavisualization.Chart.Shape|string; + + /**Specifies the position of the data label. This property can be used only for the series such as column, bar, stacked column, stacked bar, 100% stacked column, 100% stacked bar, candle and OHLC. + * @Default {top. See TextPosition} + */ + textPosition?: ej.datavisualization.Chart.TextPosition|string; + + /**Vertical alignment of the data label. + * @Default {'center'} + */ + verticalTextAlignment?: ej.datavisualization.Chart.VerticalTextAlignment|string; + + /**Controls the visibility of the data labels. + * @Default {false} + */ + visible?: boolean; + + /**Custom template to format the data label content. Use “point.x” and “point.y” as a placeholder text to display the corresponding data point’s x and y value. + */ + template?: string; + + /**Moves the label vertically by specified offset. + * @Default {0} + */ + offset?: number; +} + +export interface SeriesPointsMarkerSize { + + /**Height of the marker. + * @Default {6} + */ + height?: number; + + /**Width of the marker. + * @Default {6} + */ + width?: number; +} + +export interface SeriesPointsMarker { + + /**Options for customizing the border of the marker shape. + */ + border?: SeriesPointsMarkerBorder; + + /**Options for displaying and customizing data label. + */ + dataLabel?: SeriesPointsMarkerDataLabel; + + /**Color of the marker shape. + * @Default {null} + */ + fill?: string; + + /**The URL for the Image that is to be displayed as marker. In order to display image as marker, set series.marker.shape as ‘image’. + */ + imageUrl?: string; + + /**Opacity of the marker. + * @Default {1} + */ + opacity?: number; + + /**Specifies the shape of the marker. + * @Default {circle. See Shape} + */ + shape?: ej.datavisualization.Chart.Shape|string; + + /**Options for customizing the size of the marker shape. + */ + size?: SeriesPointsMarkerSize; + + /**Controls the visibility of the marker shape. + * @Default {false} + */ + visible?: boolean; +} + +export interface SeriesPoints { + + /**Options for customizing the border of a point. This is applicable only for column type series and accumulation type series. + */ + border?: SeriesPointsBorder; + + /**To show/hide the intermediate summary from the last intermediate point. + * @Default {false} + */ + showIntermediateSum?: boolean; + + /**To show/hide the total summary of the waterfall series. + * @Default {false} + */ + showTotalSum?: boolean; + + /**Close value of the point. Close value is applicable only for financial type series. + * @Default {null} + */ + close?: number; + + /**Size of a bubble in the bubble series. This is applicable only for the bubble series. + * @Default {null} + */ + size?: number; + + /**Background color of the point. This is applicable only for column type series and accumulation type series. + * @Default {null} + */ + fill?: string; + + /**High value of the point. High value is applicable only for financial type series, range area series and range column series. + * @Default {null} + */ + high?: number; + + /**Low value of the point. Low value is applicable only for financial type series, range area series and range column series. + * @Default {null} + */ + low?: number; + + /**Options for displaying and customizing marker for a data point. Marker contains shapes and/or data labels. + */ + marker?: SeriesPointsMarker; + + /**Open value of the point. This is applicable only for financial type series. + * @Default {null} + */ + open?: number; + + /**Datalabel text for the point. + * @Default {null} + */ + text?: string; + + /**X value of the point. + * @Default {null} + */ + x?: number; + + /**Y value of the point. + * @Default {null} + */ + y?: number; +} + +export interface SeriesTooltipBorder { + + /**Border Color of the tooltip. + * @Default {null} + */ + color?: string; + + /**Border Width of the tooltip. + * @Default {1} + */ + width?: number; +} + +export interface SeriesTooltip { + + /**Options for customizing the border of the tooltip. + */ + border?: SeriesTooltipBorder; + + /**Customize the corner radius of the tooltip rectangle. + * @Default {0} + */ + rx?: number; + + /**Customize the corner radius of the tooltip rectangle. + * @Default {0} + */ + ry?: number; + + /**Specifies the duration, the tooltip has to be displayed. + * @Default {500ms} + */ + duration?: string; + + /**Enables/disables the animation of the tooltip when moving from one point to another. + * @Default {true} + */ + enableAnimation?: boolean; + + /**Background color of the tooltip. + * @Default {null} + */ + fill?: string; + + /**Format of the tooltip content. + * @Default {#point.x# : #point.y#} + */ + format?: string; + + /**Opacity of the tooltip. + * @Default {0.95} + */ + opacity?: number; + + /**Custom template to format the tooltip content. Use “point.x” and “point.y” as a placeholder text to display the corresponding data point’s x and y value. + * @Default {null} + */ + template?: string; + + /**Controls the visibility of the tooltip. + * @Default {false} + */ + visible?: boolean; +} + +export interface SeriesTrendlines { + + /**Show/hides the trendline. + */ + visibility?: boolean; + + /**Specifies the type of trendline for the series. + * @Default {linear. See TrendlinesType} + */ + type?: string; + + /**Name for the trendlines that is to be displayed in legend text. + * @Default {Trendline} + */ + name?: string; + + /**Fill color of the trendlines. + * @Default {#0000FF} + */ + fill?: string; + + /**Width of the trendlines. + * @Default {1} + */ + width?: number; + + /**Opacity of the trendline. + * @Default {1} + */ + opacity?: number; + + /**Pattern of dashes and gaps used to stroke the trendline. + */ + dashArray?: string; + + /**Future trends of the current series. + * @Default {0} + */ + forwardForecast?: number; + + /**Past trends of the current series. + * @Default {0} + */ + backwardForecast?: number; + + /**Specifies the order of polynomial trendlines. + * @Default {0} + */ + polynomialOrder?: number; + + /**Specifies the moving average starting period value. + * @Default {2} + */ + period?: number; +} + +export interface SeriesHighlightSettingsBorder { + + /**Border color of the series/point on highlight. + */ + color?: string; + + /**Border width of the series/point on highlight. + * @Default {2} + */ + width?: string; +} + +export interface SeriesHighlightSettings { + + /**Enables/disables the ability to highlight series or data point interactively. + * @Default {false} + */ + enable?: boolean; + + /**Specifies whether series or data point has to be highlighted. + * @Default {series. See Mode} + */ + mode?: ej.datavisualization.Chart.Mode|string; + + /**Color of the series/point on highlight. + */ + color?: string; + + /**Opacity of the series/point on highlight. + * @Default {0.6} + */ + opacity?: number; + + /**Options for customizing the border of series on highlight. + */ + border?: SeriesHighlightSettingsBorder; + + /**Specifies the pattern for the series/point on highlight. + * @Default {none. See Pattern} + */ + pattern?: string; + + /**Custom pattern for the series on highlight. + */ + customPattern?: string; +} + +export interface SeriesSelectionSettingsBorder { + + /**Border color of the series/point on selection. + */ + color?: string; + + /**Border width of the series/point on selection. + * @Default {2} + */ + width?: string; +} + +export interface SeriesSelectionSettings { + + /**Enables/disables the ability to select a series/data point interactively. + * @Default {false} + */ + enable?: boolean; + + /**Specifies whether series or data point has to be selected. + * @Default {series. See Mode} + */ + mode?: ej.datavisualization.Chart.Mode|string; + + /**Specifies the type of selection. + * @Default {single} + */ + type?: ej.datavisualization.Chart.SelectionType|string; + + /**Color of the series/point on selection. + */ + color?: string; + + /**Opacity of the series/point on selection. + * @Default {0.6} + */ + opacity?: number; + + /**Options for customizing the border of series on selection. + */ + border?: SeriesSelectionSettingsBorder; + + /**Specifies the pattern for the series/point on selection. + * @Default {none. See Pattern} + */ + pattern?: string; + + /**Custom pattern for the series on selection. + */ + customPattern?: string; +} + +export interface Series { + + /**Color of the point, where the close is up in financial chart. + * @Default {null} + */ + bearFillColor?: string; + + /**Options for customizing the border of the series. + */ + border?: SeriesBorder; + + /**Color of the point, where the close is down in financial chart. + * @Default {null} + */ + bullFillColor?: string; + + /**Pattern of dashes and gaps used to stroke the line type series. + */ + dashArray?: string; + + /**Specifies the dataSource for the series. It can be an array of JSON objects or an instance of ej.DataManager. + * @Default {null} + */ + dataSource?: any; + + /**Controls the size of the hole in doughnut series. Value ranges from 0 to 1. + * @Default {0.4} + */ + doughnutCoefficient?: number; + + /**Controls the size of the doughnut series. Value ranges from 0 to 1. + * @Default {0.8} + */ + doughnutSize?: number; + + /**Type of series to be drawn in radar or polar series. + * @Default {line. See DrawType} + */ + drawType?: boolean; + + /**Enable/disable the animation of series. + * @Default {false} + */ + enableAnimation?: boolean; + + /**To avoid overlapping of data labels smartly. + * @Default {null} + */ + enableSmartLabels?: number; + + /**End angle of pie/doughnut series. For a complete circle, it has to be 360, by default. + * @Default {null} + */ + endAngle?: number; + + /**Explodes the pie/doughnut slices on mouse move. + * @Default {false} + */ + explode?: boolean; + + /**Explodes all the slice of pie/doughnut on render. + * @Default {null} + */ + explodeAll?: boolean; + + /**Index of the point to be exploded from pie/doughnut/pyramid/funnel. + * @Default {null} + */ + explodeIndex?: number; + + /**Specifies the distance of the slice from the center, when it is exploded. + * @Default {25} + */ + explodeOffset?: number; + + /**Fill color of the series. + * @Default {null} + */ + fill?: string; + + /**Options for customizing the series font. + */ + font?: SeriesFont; + + /**Specifies the height of the funnel in funnel series. Values can be in both pixel and percentage. + * @Default {32.7%} + */ + funnelHeight?: string; + + /**Specifies the width of the funnel in funnel series. Values can be in both pixel and percentage. + * @Default {11.6%} + */ + funnelWidth?: string; + + /**Gap between the slices of pyramid/funnel series. + * @Default {0} + */ + gapRatio?: number; + + /**Specifies whether to join start and end point of a line/area series used in polar/radar chart to form a closed path. + * @Default {true} + */ + isClosed?: boolean; + + /**Specifies whether to stack the column series in polar/radar charts. + * @Default {true} + */ + isStacking?: boolean; + + /**Renders the chart vertically. This is applicable only for cartesian type series. + * @Default {false} + */ + isTransposed?: boolean; + + /**Position of the data label in pie/doughnut/pyramid/funnel series. OutsideExtended position is not applicable for pyramid/funnel. + * @Default {inside. See LabelPosition} + */ + labelPosition?: ej.datavisualization.Chart.LabelPosition|string; + + /**Specifies the line cap of the series. + * @Default {Butt. See LineCap} + */ + lineCap?: ej.datavisualization.Chart.LineCap|string; + + /**Specifies the type of shape to be used where two lines meet. + * @Default {Round. See LineJoin} + */ + lineJoin?: ej.datavisualization.Chart.LineJoin|string; + + /**Options for displaying and customizing marker for individual point in a series. Marker contains shapes and/or data labels. + */ + marker?: SeriesMarker; + + /**Opacity of the series. + * @Default {1} + */ + opacity?: number; + + /**Name of a field in data source where fill color for all the data points is generated. + */ + palette?: string; + + /**Controls the size of pie series. Value ranges from 0 to 1. + * @Default {0.8} + */ + pieCoefficient?: number; + + /**Options for customizing the empty point in the series. + */ + emptyPointSettings?: SeriesEmptyPointSettings; + + /**Fill color for the positive column of the waterfall. + * @Default {null} + */ + positiveFill?: string; + + /**Options for customizing the waterfall connector line. + */ + connectorLine?: SeriesConnectorLine; + + /**Options to customize the error bar in series. + */ + errorBar?: SeriesErrorBar; + + /**Option to add data points; each point should have x and y property. Also, optionally, you can customize the points color, border, marker by using fill, border and marker options. + */ + points?: Array; + + /**Specifies the mode of the pyramid series. + * @Default {linear} + */ + pyramidMode?: ej.datavisualization.Chart.PyramidMode|string; + + /**Specifies ej.Query to select data from dataSource. This property is applicable only when the dataSource is ej.DataManager. + * @Default {null} + */ + query?: any; + + /**Start angle from where the pie/doughnut series renders. It starts from 0, by default. + * @Default {null} + */ + startAngle?: number; + + /**Options for customizing the tooltip of chart. + */ + tooltip?: SeriesTooltip; + + /**Specifies the type of the series to render in chart. + * @Default {column. see Type} + */ + type?: ej.datavisualization.Chart.Type|string; + + /**Controls the visibility of the series. + * @Default {visible} + */ + visibility?: string; + + /**Specifies the name of the x-axis that has to be associated with this series. Add an axis instance with this name to axes collection. + * @Default {null} + */ + xAxisName?: string; + + /**Name of the property in the datasource that contains x value for the series. + * @Default {null} + */ + xName?: string; + + /**Specifies the name of the y-axis that has to be associated with this series. Add an axis instance with this name to axes collection. + * @Default {null} + */ + yAxisName?: string; + + /**Name of the property in the datasource that contains y value for the series. + * @Default {null} + */ + yName?: string; + + /**Name of the property in the datasource that contains high value for the series. + * @Default {null} + */ + high?: string; + + /**Name of the property in the datasource that contains low value for the series. + * @Default {null} + */ + low?: string; + + /**Name of the property in the datasource that contains open value for the series. + * @Default {null} + */ + open?: string; + + /**Name of the property in the datasource that contains close value for the series. + * @Default {null} + */ + close?: string; + + /**Name of the property in the datasource that contains the size value for the bubble series. + * @Default {null} + */ + size?: string; + + /**Option to add trendlines to chart. + */ + trendlines?: Array; + + /**Options for customizing the appearance of the series or data point while highlighting. + */ + highlightSettings?: SeriesHighlightSettings; + + /**Options for customizing the appearance of the series/data point on selection. + */ + selectionSettings?: SeriesSelectionSettings; +} + +export interface Size { + + /**Height of the Chart. Height can be specified in either pixel or percentage. + * @Default {'450'} + */ + height?: string; + + /**Width of the Chart. Width can be specified in either pixel or percentage. + * @Default {'450'} + */ + width?: string; +} + +export interface TitleBorder { + + /**Width of the title border. + * @Default {1} + */ + width?: number; + + /**color of the title border. + * @Default {transparent} + */ + color?: string; + + /**opacity of the title border. + * @Default {0.8} + */ + opacity?: number; + + /**opacity of the title border. + * @Default {0.8} + */ + cornerRadius?: number; +} + +export interface TitleFont { + + /**Font family for Chart title. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Font style for Chart title. + * @Default {Normal. See FontStyle} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Font weight for Chart title. + * @Default {Regular. See FontWeight} + */ + fontWeight?: ej.datavisualization.Chart.FontWeight|string; + + /**Opacity of the Chart title. + * @Default {0.5} + */ + opacity?: number; + + /**Font size for Chart title. + * @Default {20px} + */ + size?: string; +} + +export interface TitleSubTitleFont { + + /**Font family of sub title. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Font style for sub title. + * @Default {Normal. See FontStyle} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Font weight for sub title. + * @Default {Regular. See FontWeight} + */ + fontWeight?: ej.datavisualization.Chart.FontWeight|string; + + /**Opacity of the sub title. + * @Default {1} + */ + opacity?: number; + + /**Font size for sub title. + * @Default {12px} + */ + size?: string; +} + +export interface TitleSubTitleBorder { + + /**Width of the subtitle border. + * @Default {1} + */ + width?: number; + + /**color of the subtitle border. + * @Default {transparent} + */ + color?: string; + + /**opacity of the subtitle border. + * @Default {0.8} + */ + opacity?: number; + + /**opacity of the subtitle border. + * @Default {0.8} + */ + cornerRadius?: number; +} + +export interface TitleSubTitle { + + /**Options for customizing the font of sub title. + */ + font?: TitleSubTitleFont; + + /**Background color for the chart subtitle. + * @Default {transparent} + */ + background?: string; + + /**Options to customize the border of the title. + */ + border?: TitleSubTitleBorder; + + /**Text to be displayed in sub title. + */ + text?: string; + + /**Alignment of sub title text. + * @Default {far. See TextAlignment} + */ + textAlignment?: ej.datavisualization.Chart.Alignment|string; +} + +export interface Title { + + /**Background color for the chart title. + * @Default {transparent} + */ + background?: string; + + /**Options to customize the border of the title. + */ + border?: TitleBorder; + + /**Options for customizing the font of Chart title. + */ + font?: TitleFont; + + /**Options to customize the sub title of Chart. + */ + subTitle?: TitleSubTitle; + + /**Text to be displayed in Chart title. + */ + text?: string; + + /**Alignment of the title text. + * @Default {Center. See TextAlignment} + */ + textAlignment?: ej.datavisualization.Chart.Alignment|string; +} + +export interface Zooming { + + /**Enables or disables zooming. + * @Default {false} + */ + enable?: boolean; + + /**Enable or disables the differed zooming. When it is enabled, chart is updated only on mouse up action while zooming and panning. + * @Default {false} + */ + enableDeferredZoom?: boolean; + + /**Enables/disables the ability to zoom the chart on moving the mouse wheel. + * @Default {false} + */ + enableMouseWheel?: boolean; + + /**Specifies whether to allow zooming the chart vertically or horizontally or in both ways. + * @Default {'x,y'} + */ + type?: string; + + /**To display user specified buttons in zooming toolbar. + * @Default {[zoomIn, zoomOut, zoom, pan, reset]} + */ + toolbarItems?: Array; +} +} +module Chart +{ +enum CoordinateUnit +{ +//string +None, +//string +Pixels, +//string +Points, +} +} +module Chart +{ +enum HorizontalAlignment +{ +//string +Left, +//string +Right, +//string +Middle, +} +} +module Chart +{ +enum Region +{ +//string +Chart, +//string +Series, +} +} +module Chart +{ +enum VerticalAlignment +{ +//string +Top, +//string +Bottom, +//string +Middle, +} +} +module Chart +{ +enum Unit +{ +//string +Percentage, +//string +Pixel, +} +} +module Chart +{ +enum DrawType +{ +//string +Line, +//string +Area, +//string +Column, +} +} +module Chart +{ +enum FontStyle +{ +//string +Normal, +//string +Italic, +} +} +module Chart +{ +enum FontWeight +{ +//string +Regular, +//string +Bold, +//string +Lighter, +} +} +module Chart +{ +enum LabelPosition +{ +//string +Inside, +//string +Outside, +//string +OutsideExtended, +} +} +module Chart +{ +enum LineCap +{ +//string +Butt, +//string +Round, +//string +Square, +} +} +module Chart +{ +enum LineJoin +{ +//string +Round, +//string +Bevel, +//string +Miter, +} +} +module Chart +{ +enum ConnectorLineType +{ +//string +Line, +//string +Bezier, +} +} +module Chart +{ +enum HorizontalTextAlignment +{ +//string +Center, +//string +Near, +//string +Far, +} +} +module Chart +{ +enum Shape +{ +//string +None, +//string +LeftArrow, +//string +RightArrow, +//string +Circle, +//string +Cross, +//string +HorizLine, +//string +VertLine, +//string +Diamond, +//string +Rectangle, +//string +Triangle, +//string +Hexagon, +//string +Pentagon, +//string +Star, +//string +Ellipse, +//string +Trapezoid, +//string +UpArrow, +//string +DownArrow, +//string +Image, +//string +SeriesType, +} +} +module Chart +{ +enum TextPosition +{ +//string +Top, +//string +Bottom, +//string +Middle, +} +} +module Chart +{ +enum VerticalTextAlignment +{ +//string +Center, +//string +Near, +//string +Far, +} +} +module Chart +{ +enum PyramidMode +{ +//string +Linear, +//string +Surface, +} +} +module Chart +{ +enum Type +{ +//string +Area, +//string +Line, +//string +Spline, +//string +Column, +//string +Scatter, +//string +Bubble, +//string +SplineArea, +//string +StepArea, +//string +StepLine, +//string +Pie, +//string +Hilo, +//string +HiloOpenClose, +//string +Candle, +//string +Bar, +//string +StackingArea, +//string +StackingArea100, +//string +RangeColumn, +//string +StackingColumn, +//string +StackingColumn100, +//string +StackingBar, +//string +StackingBar100, +//string +Pyramid, +//string +Funnel, +//string +Doughnut, +//string +Polar, +//string +Radar, +//string +RangeArea, +} +} +module Chart +{ +enum EmptyPointMode +{ +//string +Gap, +//string +Zero, +//string +Average, +} +} +module Chart +{ +enum ErrorBarType +{ +//string +FixedValue, +//string +Percentage, +//string +StandardDeviation, +//string +StandardError, +} +} +module Chart +{ +enum ErrorBarMode +{ +//string +Both, +//string +Vertical, +//string +Horizontal, +} +} +module Chart +{ +enum ErrorBarDirection +{ +//string +Both, +//string +Plus, +//string +Minus, +} +} +module Chart +{ +enum Mode +{ +//string +Series, +//string +Point, +//string +Cluster, +} +} +module Chart +{ +enum SelectionType +{ +//string +Single, +//string +Multiple, +} +} +module Chart +{ +enum CrosshairType +{ +//string +Crosshair, +//string +Trackball, +} +} +module Chart +{ +enum Alignment +{ +//string +Center, +//string +Near, +//string +Far, +} +} +module Chart +{ +enum Position +{ +//string +Left, +//string +Right, +//string +Top, +//string +Bottom, +} +} +module Chart +{ +enum TextOverflow +{ +//string +None, +//string +Trim, +//string +Wrap, +//string +WrapAndTrim, +} +} +module Chart +{ +enum EdgeLabelPlacement +{ +//string +None, +//string +Shift, +//string +Hide, +} +} +module Chart +{ +enum IntervalType +{ +//string +Days, +//string +Hours, +//string +Seconds, +//string +Milliseconds, +//string +Minutes, +//string +Months, +//string +Years, +} +} +module Chart +{ +enum LabelIntersectAction +{ +//string +None, +//string +Rotate90, +//string +Rotate45, +//string +Wrap, +//string +WrapByword, +//string +Trim, +//string +Hide, +//string +MultipleRows, +} +} +module Chart +{ +enum RangePadding +{ +//string +Additional, +//string +Normal, +//string +None, +//string +Round, +} +} +module Chart +{ +enum TextAlignment +{ +//string +MiddleTop, +//string +MiddleCenter, +//string +MiddleBottom, +} +} +module Chart +{ +enum ZIndex +{ +//string +Inside, +//string +Over, +} +} +module Chart +{ +enum TickLinesPosition +{ +//string +Inside, +//string +Outside, +} +} +module Chart +{ +enum ValueType +{ +//string +Double, +//string +Category, +//string +DateTime, +//string +Logarithmic, +} +} +module Chart +{ +enum Theme +{ +//string +Azure, +//string +FlatLight, +//string +FlatDark, +//string +Azuredark, +//string +Lime, +//string +LimeDark, +//string +Saffron, +//string +SaffronDark, +//string +GradientLight, +//string +GradientDark, +} +} + +class RangeNavigator extends ej.Widget { + static fn: RangeNavigator; + constructor(element: JQuery, options?: RangeNavigator.Model); + constructor(element: Element, options?: RangeNavigator.Model); + model:RangeNavigator.Model; + defaults:RangeNavigator.Model; + + /** destroy the range navigator widget + * @returns {void} + */ + _destroy (): void; +} +export module RangeNavigator{ + +export interface Model { + + /**Toggles the placement of slider exactly on the place it left or on the nearest interval. + * @Default {false} + */ + allowSnapping?: boolean; + + /**Specifies the data source for range navigator. + */ + dataSource?: any; + + /**Sets a value whether to make the range navigator responsive on resize. + * @Default {false} + */ + enableAutoResizing?: boolean; + + /**Toggles the redrawing of chart on moving the sliders. + * @Default {true} + */ + enableDeferredUpdate?: boolean; + + /**Toggles the direction of rendering the range navigator control. + * @Default {false} + */ + enableRTL?: boolean; + + /**Options for customizing the labels colors, font, style, size, horizontalAlignment and opacity. + */ + labelSettings?: LabelSettings; + + /**This property is to specify the localization of range navigator. + * @Default {en-US} + */ + locale?: string; + + /**Options for customizing the range navigator. + */ + navigatorStyleSettings?: NavigatorStyleSettings; + + /**Padding specifies the gap between the container and the range navigator. + * @Default {0} + */ + padding?: string; + + /**If the range is not given explicitly, range will be calculated automatically. + * @Default {none} + */ + rangePadding?: ej.datavisualization.RangeNavigator.RangePadding|string; + + /**Options for customizing the starting and ending ranges. + */ + rangeSettings?: RangeSettings; + + /**selectedData is for getting the data when the "rangeChanged" event trigger from client side. + */ + selectedData?: any; + + /**Options for customizing the start and end range values. + */ + selectedRangeSettings?: SelectedRangeSettings; + + /**Contains property to customize the hight and width of range navigator. + */ + sizeSettings?: SizeSettings; + + /**By specifying this property the user can change the theme of the range navigator. + * @Default {null} + */ + theme?: string; + + /**Options for customizing the tooltip in range navigator. + */ + tooltipSettings?: TooltipSettings; + + /**Options for configuring minor grid lines, major grid lines, axis line of axis. + */ + valueAxisSettings?: ValueAxisSettings; + + /**You can plot data of type date time or numeric. This property determines the type of data that this axis will handle. + * @Default {datetime} + */ + valueType?: ej.datavisualization.RangeNavigator.ValueType|string; + + /**Specifies the xName for dataSource. This is used to take the x values from dataSource + */ + xName?: any; + + /**Specifies the yName for dataSource. This is used to take the y values from dataSource + */ + yName?: any; + + /**Fires on load of range navigator.*/ + load? (e: LoadEventArgs): void; + + /**Fires after range navigator is loaded.*/ + loaded? (e: LoadedEventArgs): void; + + /**Fires on changing the range of range navigator.*/ + rangeChanged? (e: RangeChangedEventArgs): void; +} + +export interface LoadEventArgs { + + /**parameters from range navigator + */ + Data?: any; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the range navigator model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface LoadedEventArgs { + + /**parameters from range navigator + */ + Data?: any; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the range navigator model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface RangeChangedEventArgs { + + /**parameters from range navigator + */ + Data?: any; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the range navigator model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface LabelSettingsHigherLevelBorder { + + /**Specifies the border color of grid lines. + * @Default {transparent} + */ + color?: string; + + /**Specifies the border width of grid lines. + * @Default {0.5} + */ + width?: string; +} + +export interface LabelSettingsHigherLevelGridLineStyle { + + /**Specifies the color of grid lines in higher level. + * @Default {#B5B5B5} + */ + color?: string; + + /**Specifies the dashArray of grid lines in higher level. + * @Default {20 5 0} + */ + dashArray?: string; + + /**Specifies the width of grid lines in higher level. + * @Default {#B5B5B5} + */ + width?: string; +} + +export interface LabelSettingsHigherLevelStyleFont { + + /**Specifies the label font color. Labels render with the specified font color. + * @Default {black} + */ + color?: string; + + /**Specifies the label font family. Labels render with the specified font family. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Specifies the label font style. Labels render with the specified font style. + * @Default {Normal} + */ + fontStyle?: string; + + /**Specifies the label font weight. Labels render with the specified font weight. + * @Default {regular} + */ + fontWeight?: string; + + /**Specifies the label opacity. Labels render with the specified opacity. + * @Default {1} + */ + opacity?: number; + + /**Specifies the label font size. Labels render with the specified font size. + * @Default {12px} + */ + size?: string; +} + +export interface LabelSettingsHigherLevelStyle { + + /**Options for customizing the font properties. + */ + font?: LabelSettingsHigherLevelStyleFont; + + /**Specifies the horizontal text alignment of the text in label. + * @Default {middle} + */ + horizontalAlignment?: string; +} + +export interface LabelSettingsHigherLevel { + + /**Options for customizing the border of grid lines in higher level. + */ + border?: LabelSettingsHigherLevelBorder; + + /**Specifies the fill color of higher level labels. + * @Default {transparent} + */ + fill?: string; + + /**Options for customizing the grid line colors, width, dashArray, border. + */ + gridLineStyle?: LabelSettingsHigherLevelGridLineStyle; + + /**Specifies the intervalType for higher level labels. See IntervalType + * @Default {years} + */ + intervalType?: ej.datavisualization.RangeNavigator.IntervalType|string; + + /**Specifies the position of the labels to render either inside or outside of plot area + * @Default {outside} + */ + labelPlacement?: ej.datavisualization.RangeNavigator.LabelPlacement|string; + + /**Specifies the position of the labels in higher level + * @Default {top} + */ + position?: ej.datavisualization.RangeNavigator.Position|string; + + /**Options for customizing the style of higher level labels. + */ + style?: LabelSettingsHigherLevelStyle; + + /**Toggles the visibility of higher level labels. + * @Default {true} + */ + visible?: boolean; +} + +export interface LabelSettingsLowerLevelBorder { + + /**Specifies the border color of grid lines. + * @Default {transparent} + */ + color?: string; + + /**Specifies the border width of grid lines. + * @Default {0.5} + */ + width?: string; +} + +export interface LabelSettingsLowerLevelGridLineStyle { + + /**Specifies the color of grid lines in lower level. + * @Default {#B5B5B5} + */ + color?: string; + + /**Specifies the dashArray of gridLines in lowerLevel. + * @Default {20 5 0} + */ + dashArray?: string; + + /**Specifies the width of grid lines in lower level. + * @Default {#B5B5B5} + */ + width?: string; +} + +export interface LabelSettingsLowerLevelStyleFont { + + /**Specifies the color of labels. Label text render in this specified color. + * @Default {black} + */ + color?: string; + + /**Specifies the font family of labels. Label text render in this specified font family. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Specifies the font style of labels. Label text render in this specified font style. + * @Default {Normal} + */ + fontStyle?: string; + + /**Specifies the font weight of labels. Label text render in this specified font weight. + * @Default {regular} + */ + fontWeight?: string; + + /**Specifies the opacity of labels. Label text render in this specified opacity. + * @Default {12px} + */ + opacity?: string; + + /**Specifies the size of labels. Label text render in this specified size. + * @Default {12px} + */ + size?: string; +} + +export interface LabelSettingsLowerLevelStyle { + + /**Options for customizing the font of labels. + */ + font?: LabelSettingsLowerLevelStyleFont; + + /**Specifies the horizontal text alignment of the text in label. + * @Default {middle} + */ + horizontalAlignment?: string; +} + +export interface LabelSettingsLowerLevel { + + /**Options for customizing the border of grid lines in lower level. + */ + border?: LabelSettingsLowerLevelBorder; + + /**Specifies the fill color of labels in lower level. + * @Default {transparent} + */ + fill?: string; + + /**Options for customizing the grid lines in lower level. + */ + gridLineStyle?: LabelSettingsLowerLevelGridLineStyle; + + /**Specifies the intervalType of the labels in lower level.See IntervalType + * @Default {years} + */ + intervalType?: ej.datavisualization.RangeNavigator.IntervalType|string; + + /**Specifies the position of the labels to render either inside or outside of plot area. See LabelPlacement + * @Default {outside} + */ + labelPlacement?: ej.datavisualization.RangeNavigator.LabelPlacement|string; + + /**Specifies the position of the labels in lower level.See Position + * @Default {bottom} + */ + position?: ej.datavisualization.RangeNavigator.Position|string; + + /**Options for customizing the style of labels. + */ + style?: LabelSettingsLowerLevelStyle; + + /**Toggles the visibility of labels in lower level. + * @Default {true} + */ + visible?: boolean; +} + +export interface LabelSettingsStyleFont { + + /**Specifies the label color. This color is applied to the labels in range navigator. + * @Default {#FFFFFF} + */ + color?: string; + + /**Specifies the label font family. Labels render with the specified font family. + * @Default {Segoe UI} + */ + family?: string; + + /**Specifies the label font opacity. Labels render with the specified font opacity. + * @Default {1} + */ + opacity?: number; + + /**Specifies the label font size. Labels render with the specified font size. + * @Default {1px} + */ + size?: string; + + /**Specifies the label font style. Labels render with the specified font style.. + * @Default {Normal} + */ + style?: ej.datavisualization.RangeNavigator.FontStyle|string; + + /**Specifies the lable font weight + * @Default {regular} + */ + weight?: ej.datavisualization.RangeNavigator.FontWeight|string; +} + +export interface LabelSettingsStyle { + + /**Options for customizing the font of labels in range navigator. + */ + font?: LabelSettingsStyleFont; + + /**Specifies the horizontalAlignment of the label in RangeNavigator + * @Default {middle} + */ + horizontalAlignment?: ej.datavisualization.RangeNavigator.HorizontalAlignment|string; +} + +export interface LabelSettings { + + /**Options for customizing the higher level labels in range navigator. + */ + higherLevel?: LabelSettingsHigherLevel; + + /**Options for customizing the labels in lower level. + */ + lowerLevel?: LabelSettingsLowerLevel; + + /**Options for customizing the style of labels in range navigator. + */ + style?: LabelSettingsStyle; +} + +export interface NavigatorStyleSettingsBorder { + + /**Specifies the border color of range navigator. + * @Default {transparent} + */ + color?: string; + + /**Specifies the dash array of range navigator. + * @Default {null} + */ + dashArray?: string; + + /**Specifies the border width of range navigator. + * @Default {0.5} + */ + width?: number; +} + +export interface NavigatorStyleSettingsMajorGridLineStyle { + + /**Specifies the color of major grid lines in range navigator. + * @Default {#B5B5B5} + */ + color?: string; + + /**Toggles the visibility of major grid lines. + * @Default {true} + */ + visible?: boolean; +} + +export interface NavigatorStyleSettingsMinorGridLineStyle { + + /**Specifies the color of minor grid lines in range navigator. + * @Default {#B5B5B5} + */ + color?: string; + + /**Toggles the visibility of minor grid lines. + * @Default {true} + */ + visible?: boolean; +} + +export interface NavigatorStyleSettings { + + /**Specifies the background color of range navigator. + * @Default {#dddddd} + */ + background?: string; + + /**Options for customizing the border color and width of range navigator. + */ + border?: NavigatorStyleSettingsBorder; + + /**Specifies the left side thumb template in range navigator we can give either div id or html string + * @Default {null} + */ + leftThumbTemplate?: string; + + /**Options for customizing the major grid lines. + */ + majorGridLineStyle?: NavigatorStyleSettingsMajorGridLineStyle; + + /**Options for customizing the minor grid lines. + */ + minorGridLineStyle?: NavigatorStyleSettingsMinorGridLineStyle; + + /**Specifies the opacity of RangeNavigator. + * @Default {1} + */ + opacity?: number; + + /**Specifies the right side thumb template in range navigator we can give either div id or html string + * @Default {null} + */ + rightThumbTemplate?: string; + + /**Specifies the color of the selected region in range navigator. + * @Default {#EFEFEF} + */ + selectedRegionColor?: string; + + /**Specifies the opacity of Selected Region. + * @Default {0} + */ + selectedRegionOpacity?: number; + + /**Specifies the color of the thumb in range navigator. + * @Default {#2382C3} + */ + thumbColor?: string; + + /**Specifies the radius of the thumb in range navigator. + * @Default {10} + */ + thumbRadius?: number; + + /**Specifies the stroke color of the thumb in range navigator. + * @Default {#303030} + */ + thumbStroke?: string; + + /**Specifies the color of the unselected region in range navigator. + * @Default {#5EABDE} + */ + unselectedRegionColor?: string; + + /**Specifies the opacity of Unselected Region. + * @Default {0.3} + */ + unselectedRegionOpacity?: number; +} + +export interface RangeSettings { + + /**Specifies the ending range of range navigator. + * @Default {null} + */ + end?: string; + + /**Specifies the starting range of range navigator. + * @Default {null} + */ + start?: string; +} + +export interface SelectedRangeSettings { + + /**Specifies the ending range of range navigator. + * @Default {null} + */ + end?: string; + + /**Specifies the starting range of range navigator. + * @Default {null} + */ + start?: string; +} + +export interface SizeSettings { + + /**Specifies height of the range navigator. + * @Default {null} + */ + height?: string; + + /**Specifies width of the range navigator. + * @Default {null} + */ + width?: string; +} + +export interface TooltipSettingsFont { + + /**Specifies the color of text in tooltip. Tooltip text render in the specified color. + * @Default {#FFFFFF} + */ + color?: string; + + /**Specifies the font family of text in tooltip. Tooltip text render in the specified font family. + * @Default {Segoe UI} + */ + family?: string; + + /**Specifies the font style of text in tooltip. Tooltip text render in the specified font style. + * @Default {ej.datavisualization.RangeNavigator.fontStyle.Normal} + */ + fontStyle?: string; + + /**Specifies the opacity of text in tooltip. Tooltip text render in the specified opacity. + * @Default {1} + */ + opacity?: number; + + /**Specifies the size of text in tooltip. Tooltip text render in the specified size. + * @Default {10px} + */ + size?: string; + + /**Specifies the weight of text in tooltip. Tooltip text render in the specified weight. + * @Default {ej.datavisualization.RangeNavigator.weight.Regular} + */ + weight?: string; +} + +export interface TooltipSettings { + + /**Specifies the background color of tooltip. + * @Default {#303030} + */ + backgroundColor?: string; + + /**Options for customizing the font in tooltip. + */ + font?: TooltipSettingsFont; + + /**Specifies the format of text to be displayed in tooltip. + * @Default {MM/dd/yyyy} + */ + labelFormat?: string; + + /**Specifies the mode of displaying the tooltip. Neither to display the tooltip always nor on demand. + * @Default {null} + */ + tooltipDisplayMode?: string; + + /**Toggles the visibility of tooltip. + * @Default {true} + */ + visible?: boolean; +} + +export interface ValueAxisSettingsAxisLine { + + /**Toggles the visibility of axis line. + * @Default {none} + */ + visible?: string; +} + +export interface ValueAxisSettingsFont { + + /**Text in axis render with the specified size. + * @Default {0px} + */ + size?: string; +} + +export interface ValueAxisSettingsMajorGridLines { + + /**Toggles the visibility of major grid lines. + * @Default {false} + */ + visible?: boolean; +} + +export interface ValueAxisSettingsMajorTickLines { + + /**Specifies the size of the majorTickLines in range navigator + * @Default {0} + */ + size?: number; + + /**Toggles the visibility of major tick lines. + * @Default {true} + */ + visible?: boolean; + + /**Specifies width of the major tick lines. + * @Default {0} + */ + width?: number; +} + +export interface ValueAxisSettings { + + /**Options for customizing the axis line. + */ + axisLine?: ValueAxisSettingsAxisLine; + + /**Options for customizing the font of the axis. + */ + font?: ValueAxisSettingsFont; + + /**Options for customizing the major grid lines. + */ + majorGridLines?: ValueAxisSettingsMajorGridLines; + + /**Options for customizing the major tick lines in axis. + */ + majorTickLines?: ValueAxisSettingsMajorTickLines; + + /**If the range is not given explicitly, range will be calculated automatically. You can customize the automatic range calculation using rangePadding. + * @Default {none} + */ + rangePadding?: string; + + /**Toggles the visibility of axis in range navigator. + * @Default {false} + */ + visible?: boolean; +} +} +module RangeNavigator +{ +enum IntervalType +{ +//string +Years, +//string +Quarters, +//string +Months, +//string +Weeks, +//string +Days, +//string +Hours, +} +} +module RangeNavigator +{ +enum LabelPlacement +{ +//string +Inside, +//string +Outside, +} +} +module RangeNavigator +{ +enum Position +{ +//string +Top, +//string +Bottom, +} +} +module RangeNavigator +{ +enum FontStyle +{ +//string +Normal, +//string +Bold, +//string +Italic, +} +} +module RangeNavigator +{ +enum FontWeight +{ +//string +Regular, +//string +Lighter, +} +} +module RangeNavigator +{ +enum HorizontalAlignment +{ +//string +Middle, +//string +Left, +//string +Right, +} +} +module RangeNavigator +{ +enum RangePadding +{ +//string +Additional, +//string +Normal, +//string +None, +//string +Round, +} +} +module RangeNavigator +{ +enum ValueType +{ +//string +Numeric, +//string +DateTime, +} +} + +class BulletGraph extends ej.Widget { + static fn: BulletGraph; + constructor(element: JQuery, options?: BulletGraph.Model); + constructor(element: Element, options?: BulletGraph.Model); + model:BulletGraph.Model; + defaults:BulletGraph.Model; + + /** To destroy the bullet graph + * @returns {void} + */ + destroy (): void; + + /** To redraw the bulet graph + * @returns {void} + */ + redraw(): void; + + /** To set the value for comparative measure in bullet graph. + * @returns {void} + */ + setComparativeMeasureSymbol(): void; + + /** To set the value for feature measure bar. + * @returns {void} + */ + setFeatureMeasureBarValue(): void; +} +export module BulletGraph{ + +export interface Model { + + /**Toggles the visibility of the range stroke color of the labels. + * @Default {false} + */ + applyRangeStrokeToLabels?: boolean; + + /**Toggles the visibility of the range stroke color of the ticks. + * @Default {false} + */ + applyRangeStrokeToTicks?: boolean; + + /**Contains property to customize the caption in bullet graph. + */ + captionSettings?: CaptionSettings; + + /**Comparative measure bar in bullet graph render till the specified value. + * @Default {0} + */ + comparativeMeasureValue?: number; + + /**Toggles the animation of bullet graph. + * @Default {true} + */ + enableAnimation?: boolean; + + /**Sets a value whether to make the bullet graph responsive on resize. + * @Default {true} + */ + enableResizing?: boolean; + + /**Specifies the direction of flow in bullet graph. Neither it may be backward nor forward. + * @Default {forward} + */ + flowDirection?: ej.datavisualization.BulletGraph.FlowDirection|string; + + /**Specifies the height of the bullet graph. + * @Default {90} + */ + height?: number; + + /**Bullet graph will render in the specified orientation. + * @Default {horizontal} + */ + orientation?: ej.datavisualization.BulletGraph.Orientation|string; + + /**Contains property to customize the qualitative ranges. + */ + qualitativeRanges?: Array; + + /**Size of the qualitative range depends up on the specified value. + * @Default {32} + */ + qualitativeRangeSize?: number; + + /**Length of the quantitative range depends up on the specified value. + * @Default {475} + */ + quantitativeScaleLength?: number; + + /**Contains all the properties to customize quantitative scale. + */ + quantitativeScaleSettings?: QuantitativeScaleSettings; + + /**By specifying this property the user can change the theme of the bullet graph. + * @Default {flatlight} + */ + theme?: string; + + /**Contains all the properties to customize tooltip. + */ + tooltipSettings?: TooltipSettings; + + /**Feature measure bar in bullet graph render till the specified value. + * @Default {0} + */ + value?: number; + + /**Specifies the width of the bullet graph. + * @Default {595} + */ + width?: number; + + /**Fires on rendering the caption of bullet graph.*/ + drawCaption? (e: DrawCaptionEventArgs): void; + + /**Fires on rendering the category.*/ + drawCategory? (e: DrawCategoryEventArgs): void; + + /**Fires on rendering the comparative measure symbol.*/ + drawComparativeMeasureSymbol? (e: DrawComparativeMeasureSymbolEventArgs): void; + + /**Fires on rednering the feature measure bar.*/ + drawFeatureMeasureBar? (e: DrawFeatureMeasureBarEventArgs): void; + + /**Fires on rendering the indicator of bullet graph.*/ + drawIndicator? (e: DrawIndicatorEventArgs): void; + + /**Fires on rendering the labels.*/ + drawLabels? (e: DrawLabelsEventArgs): void; + + /**Fires on rendering the qualitative ranges.*/ + drawQualitativeRanges? (e: DrawQualitativeRangesEventArgs): void; + + /**Fires on loading bullet graph.*/ + load? (e: LoadEventArgs): void; +} + +export interface DrawCaptionEventArgs { + + /**returns the object of the bullet graph. + */ + Object?: any; + + /**returns the options of the scale element. + */ + scaleElement?: HTMLElement; + + /**returns the current captionSettings element. + */ + captionElement?: HTMLElement; + + /**returns the type of the captionSettings. + */ + captionType?: string; +} + +export interface DrawCategoryEventArgs { + + /**returns the object of the bullet graph. + */ + Object?: any; + + /**returns the options of the scale element. + */ + scaleElement?: HTMLElement; + + /**returns the options of category element. + */ + categoryElement?: HTMLElement; + + /**returns the text value of the category that is drawn. + */ + Value?: string; +} + +export interface DrawComparativeMeasureSymbolEventArgs { + + /**returns the object of the bullet graph. + */ + Object?: any; + + /**returns the options of the scale element. + */ + scaleElement?: HTMLElement; + + /**returns the options of comparative measure element. + */ + targetElement?: HTMLElement; + + /**returns the value of the comparative measure symbol. + */ + Value?: number; +} + +export interface DrawFeatureMeasureBarEventArgs { + + /**returns the object of the bullet graph. + */ + Object?: any; + + /**returns the options of the scale element. + */ + scaleElement?: HTMLElement; + + /**returns the options of feature measure element. + */ + currentElement?: HTMLElement; + + /**returns the value of the feature measure bar. + */ + Value?: number; +} + +export interface DrawIndicatorEventArgs { + + /**returns an object to customize bullet graph indicator text and symbol before rendering it. + */ + indicatorSettings?: any; + + /**returns the object of bullet graph. + */ + model?: any; + + /**returns the type of event. + */ + type?: string; + + /**for cancelling the event. + */ + cancel?: boolean; +} + +export interface DrawLabelsEventArgs { + + /**returns the object of the bullet graph. + */ + Object?: any; + + /**returns the options of the scale element. + */ + scaleElement?: HTMLElement; + + /**returns the current label element. + */ + tickElement?: HTMLElement; + + /**returns the label type. + */ + labelType?: string; +} + +export interface DrawQualitativeRangesEventArgs { + + /**returns the object of the bullet graph. + */ + Object?: any; + + /**returns the index of current range. + */ + rangeIndex?: number; + + /**returns the settings for current range. + */ + rangeOptions?: any; + + /**returns the end value of current range. + */ + rangeEndValue?: number; +} + +export interface LoadEventArgs { +} + +export interface CaptionSettingsFont { + + /**Specifies the color of the text in caption. + * @Default {null} + */ + color?: string; + + /**Specifies the fontFamily of caption. Caption text render with this fontFamily + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Specifies the fontStyle of caption + * @Default {Normal} + */ + fontStyle?: ej.datavisualization.BulletGraph.FontStyle|string; + + /**Specifies the fontWeight of caption + * @Default {regular} + */ + fontWeight?: ej.datavisualization.BulletGraph.FontWeight|string; + + /**Specifies the opacity of caption. Caption text render with this opacity. + * @Default {1} + */ + opacity?: number; + + /**Specifies the size of caption. Caption text render with this size + * @Default {12px} + */ + size?: string; +} + +export interface CaptionSettingsIndicatorFont { + + /**Specifies the color of the indicator's text. + * @Default {null} + */ + color?: string; + + /**Specifies the fontFamily of indicator. Indicator text render with this fontFamily. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Specifies the fontStyle of indicator. Indicator text render with this fontStyle. See FontStyle + * @Default {Normal} + */ + fontStyle?: ej.datavisualization.BulletGraph.FontStyle|string; + + /**Specifies the fontWeight of indicator. Indicator text render with this fontWeight. See FontWeight + * @Default {regular} + */ + fontWeight?: ej.datavisualization.BulletGraph.FontWeight|string; + + /**Specifies the opacity of indicator text. Indicator text render with this Opacity. + * @Default {1} + */ + opacity?: number; + + /**Specifies the size of indicator. Indicator text render with this size. + * @Default {12px} + */ + size?: string; +} + +export interface CaptionSettingsIndicatorLocation { + + /**Specifies the horizontal position of the indicator. + * @Default {10} + */ + x?: number; + + /**Specifies the vertical position of the indicator. + * @Default {60} + */ + y?: number; +} + +export interface CaptionSettingsIndicatorSymbolBorder { + + /**Specifies the border color of indicator symbol. + * @Default {null} + */ + color?: string; + + /**Specifies the border width of indicator symbol. + * @Default {1} + */ + width?: number; +} + +export interface CaptionSettingsIndicatorSymbolSize { + + /**Specifies the height of indicator symbol. + * @Default {10} + */ + height?: number; + + /**Specifies the width of indicator symbol. + * @Default {10} + */ + width?: number; +} + +export interface CaptionSettingsIndicatorSymbol { + + /**Contains property to customize the border of indicator symbol. + */ + border?: CaptionSettingsIndicatorSymbolBorder; + + /**Specifies the color of indicator symbol. + * @Default {null} + */ + color?: string; + + /**Specifies the url of image that represents indicator symbol. + */ + imageURL?: string; + + /**Specifies the opacity of indicator symbol. + * @Default {1} + */ + opacity?: number; + + /**Specifies the shape of indicator symbol. + */ + shape?: string; + + /**Contains property to customize the size of indicator symbol. + */ + size?: CaptionSettingsIndicatorSymbolSize; +} + +export interface CaptionSettingsIndicator { + + /**Contains property to customize the font of indicator. + */ + font?: CaptionSettingsIndicatorFont; + + /**Contains property to customize the location of indicator. + */ + location?: CaptionSettingsIndicatorLocation; + + /**Specifies the padding to be applied when text position is used. + * @Default {2} + */ + padding?: number; + + /**Contains property to customize the symbol of indicator. + */ + symbol?: CaptionSettingsIndicatorSymbol; + + /**Specifies the text to be displayed as indicator text. By default difference between current value and target will be displayed + */ + text?: string; + + /**Specifies the alignement of indicator with respect to scale based on text position + * @Default {'Near'} + */ + textAlignment?: ej.datavisualization.BulletGraph.TextAlignment|string; + + /**Specifies where indicator text should be anchored when indicator overlaps with other caption group text. Text will be anchored when overlapping caption group text are at same position. Anchoring is not applicable for float position. + * @Default {'start'} + */ + textAnchor?: ej.datavisualization.BulletGraph.TextAnchor|string; + + /**indicator text render in the specified angle. + * @Default {0} + */ + textAngle?: number; + + /**Specifies where indicator should be placed + * @Default {'float'} + */ + textPosition?: ej.datavisualization.BulletGraph.TextPosition|string; + + /**Specifies the space between indicator symbol and text. + * @Default {3} + */ + textSpacing?: number; + + /**Specifies whether indicator will be visible or not. + * @Default {false} + */ + visibile?: boolean; +} + +export interface CaptionSettingsLocation { + + /**Specifies the position in horizontal direction + * @Default {17} + */ + x?: number; + + /**Specifies the position in horizontal direction + * @Default {30} + */ + y?: number; +} + +export interface CaptionSettingsSubTitleFont { + + /**Specifies the color of the subtitle's text. + * @Default {null} + */ + color?: string; + + /**Specifies the fontFamily of subtitle. Subtitle text render with this fontFamily. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Specifies the fontStyle of subtitle. Subtitle text render with this fontStyle. See FontStyle + * @Default {Normal} + */ + fontStyle?: ej.datavisualization.BulletGraph.FontStyle|string; + + /**Specifies the fontWeight of subtitle. Subtitle text render with this fontWeight. See FontWeight + * @Default {regular} + */ + fontWeight?: ej.datavisualization.BulletGraph.FontWeight|string; + + /**Specifies the opacity of subtitle. Subtitle text render with this opacity. + * @Default {1} + */ + opacity?: number; + + /**Specifies the size of subtitle. Subtitle text render with this size. + * @Default {12px} + */ + size?: string; +} + +export interface CaptionSettingsSubTitleLocation { + + /**Specifies the horizontal position of the subtitle. + * @Default {10} + */ + x?: number; + + /**Specifies the vertical position of the subtitle. + * @Default {45} + */ + y?: number; +} + +export interface CaptionSettingsSubTitle { + + /**Contains property to customize the font of subtitle. + */ + font?: CaptionSettingsSubTitleFont; + + /**Contains property to customize the location of subtitle. + */ + location?: CaptionSettingsSubTitleLocation; + + /**Specifies the padding to be applied when text position is used. + * @Default {5} + */ + padding?: number; + + /**Specifies the text to be displayed as subtitle. + */ + text?: string; + + /**Specifies the alignment of sub title text with respect to scale. Alignment will not be applied in float position. + * @Default {'Near'} + */ + textAlignment?: ej.datavisualization.BulletGraph.TextAlignment|string; + + /**Specifies where subtitle text should be anchored when sub title text overlaps with other caption group text. Text will be anchored when overlapping caption group text are at same position. Anchoring is not applicable for float position. + * @Default {'start'} + */ + textAnchor?: ej.datavisualization.BulletGraph.TextAnchor|string; + + /**Subtitle render in the specified angle. + * @Default {0} + */ + textAngle?: number; + + /**Specifies where sub title text should be placed. + * @Default {'float'} + */ + textPosition?: ej.datavisualization.BulletGraph.TextPosition|string; +} + +export interface CaptionSettings { + + /**Specifies whether trim the labels will be true or false. + * @Default {true} + */ + enableTrim?: boolean; + + /**Contains property to customize the font of caption. + */ + font?: CaptionSettingsFont; + + /**Contains property to customize the indicator. + */ + indicator?: CaptionSettingsIndicator; + + /**Contains property to customize the location. + */ + location?: CaptionSettingsLocation; + + /**Specifies the padding to be applied when text position is used. + * @Default {5} + */ + padding?: number; + + /**Contains property to customize the subtitle. + */ + subTitle?: CaptionSettingsSubTitle; + + /**Specifies the text to be displayed on bullet graph. + */ + text?: string; + + /**Specifies the alignment of caption text with respect to scale. This property will not be applied when text position is float. + * @Default {'Near'} + */ + textAlignment?: ej.datavisualization.BulletGraph.TextAlignment|string; + + /**Specifies caption text anchoring when caption text overlaps with other caption group text. Text will be anchored when overlapping caption group text are at same position. Anchoring is not applicable for float position. + * @Default {'start'} + */ + textAnchor?: ej.datavisualization.BulletGraph.TextAnchor|string; + + /**Specifies the angel in which the caption is rendered. + * @Default {0} + */ + textAngle?: number; + + /**Specifies how caption text should be placed. + * @Default {'float'} + */ + textPosition?: ej.datavisualization.BulletGraph.TextPosition|string; +} + +export interface QualitativeRanges { + + /**Specifies the ending range to which the qualitative ranges will render. + * @Default {3} + */ + rangeEnd?: number; + + /**Specifies the opacity for the qualitative ranges. + * @Default {1} + */ + rangeOpacity?: number; + + /**Specifies the stroke for the qualitative ranges. + * @Default {null} + */ + rangeStroke?: string; +} + +export interface QuantitativeScaleSettingsComparativeMeasureSettings { + + /**Specifies the stroke of the comparative measure. + * @Default {null} + */ + stroke?: number; + + /**Specifies the width of the comparative measure. + * @Default {5} + */ + width?: number; +} + +export interface QuantitativeScaleSettingsFeaturedMeasureSettings { + + /**Specifies the Stroke of the featured measure in bullet graph. + * @Default {null} + */ + stroke?: number; + + /**Specifies the width of the featured measure in bullet graph. + * @Default {2} + */ + width?: number; +} + +export interface QuantitativeScaleSettingsFeatureMeasures { + + /**Specifies the category of feature measure. + * @Default {null} + */ + category?: string; + + /**Comparative measure render till the specified value. + * @Default {null} + */ + comparativeMeasureValue?: number; + + /**Feature measure render till the specified value. + * @Default {null} + */ + value?: number; +} + +export interface QuantitativeScaleSettingsFields { + + /**Specifies the category of the bullet graph. + * @Default {null} + */ + category?: string; + + /**Comparative measure render based on the values in the specified field. + * @Default {null} + */ + comparativeMeasure?: string; + + /**Specifies the dataSource for the bullet graph. + * @Default {null} + */ + dataSource?: any; + + /**Feature measure render based on the values in the specified field. + * @Default {null} + */ + featureMeasures?: string; + + /**Specifies the query for fetching the values form data source to render the bullet graph. + * @Default {null} + */ + query?: string; + + /**Specifies the name of the table. + * @Default {null} + */ + tableName?: string; +} + +export interface QuantitativeScaleSettingsLabelSettingsFont { + + /**Specifies the fontFamily of labels in bullet graph. Labels render with this fontFamily. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Specifies the fontStyle of labels in bullet graph. Labels render with this fontStyle. See FontStyle + * @Default {Normal} + */ + fontStyle?: ej.datavisualization.BulletGraph.FontStyle|string; + + /**Specifies the fontWeight of labels in bullet graph. Labels render with this fontWeight. See FontWeight + * @Default {regular} + */ + fontWeight?: ej.datavisualization.BulletGraph.FontWeight|string; + + /**Specifies the opacity of labels in bullet graph. Labels render with this opacity + * @Default {1} + */ + opacity?: number; +} + +export interface QuantitativeScaleSettingsLabelSettings { + + /**Contains property to customize the font of the labels in bullet graph. + */ + font?: QuantitativeScaleSettingsLabelSettingsFont; + + /**Specifies the placement of labels in bullet graph scale. + * @Default {outside} + */ + labelPlacement?: ej.datavisualization.BulletGraph.LabelPlacement|string; + + /**Specifies the prefix to be added with labels in bullet graph. + * @Default {Empty string} + */ + labelPrefix?: string; + + /**Specifies the suffix to be added after labels in bullet graph. + * @Default {Empty string} + */ + labelSuffix?: string; + + /**Specifies the horizontal/vertical padding of labels. + * @Default {15} + */ + offset?: number; + + /**Specifies the position of the labels to render either above or below the graph. See Position + * @Default {below} + */ + position?: ej.datavisualization.BulletGraph.LabelPosition|string; + + /**Specifies the Size of the labels. + * @Default {12} + */ + size?: number; + + /**Specifies the stroke color of the labels in bullet graph. + * @Default {null} + */ + stroke?: string; +} + +export interface QuantitativeScaleSettingsLocation { + + /**This property specifies the x position for rendering quantitative scale. + * @Default {10} + */ + x?: number; + + /**This property specifies the y position for rendering quantitative scale. + * @Default {10} + */ + y?: number; +} + +export interface QuantitativeScaleSettingsMajorTickSettings { + + /**Specifies the size of the major ticks. + * @Default {13} + */ + size?: number; + + /**Specifies the stroke color of the major tick lines. + * @Default {null} + */ + stroke?: string; + + /**Specifies the width of the major tick lines. + * @Default {2} + */ + width?: number; +} + +export interface QuantitativeScaleSettingsMinorTickSettings { + + /**Specifies the size of minor ticks. + * @Default {7} + */ + size?: number; + + /**Specifies the stroke color of minor ticks in bullet graph. + * @Default {null} + */ + stroke?: string; + + /**Specifies the width of the minor ticks in bullet graph. + * @Default {2} + */ + width?: number; +} + +export interface QuantitativeScaleSettings { + + /**Contains property to customize the comparative measure. + */ + comparativeMeasureSettings?: QuantitativeScaleSettingsComparativeMeasureSettings; + + /**Contains property to customize the featured measure. + */ + featuredMeasureSettings?: QuantitativeScaleSettingsFeaturedMeasureSettings; + + /**Contains property to customize the featured measure. + */ + featureMeasures?: Array; + + /**Contains property to customize the fields. + */ + fields?: QuantitativeScaleSettingsFields; + + /**Specifies the interval for the Graph. + * @Default {1} + */ + interval?: number; + + /**Contains property to customize the labels. + */ + labelSettings?: QuantitativeScaleSettingsLabelSettings; + + /**Contains property to customize the position of the quantitative scale + */ + location?: QuantitativeScaleSettingsLocation; + + /**Contains property to customize the major tick lines. + */ + majorTickSettings?: QuantitativeScaleSettingsMajorTickSettings; + + /**Specifies the maximum value of the Graph. + * @Default {10} + */ + maximum?: number; + + /**Specifies the minimum value of the Graph. + * @Default {0} + */ + minimum?: number; + + /**Contains property to customize the minor ticks. + */ + minorTickSettings?: QuantitativeScaleSettingsMinorTickSettings; + + /**The specified number of minor ticks will be rendered per interval. + * @Default {4} + */ + minorTicksPerInterval?: number; + + /**Specifies the placement of ticks to render either inside or outside the scale. + * @Default {ej.datavisualization.BulletGraph.TickPlacement.Outside} + */ + tickPlacement?: ej.datavisualization.BulletGraph.TickPlacement|string; + + /**Specifies the position of the ticks to render either above,below or inside + * @Default {ej.datavisualization.BulletGraph.TickPosition.Far} + */ + tickPosition?: ej.datavisualization.BulletGraph.TickPosition|string; +} + +export interface TooltipSettings { + + /**Specifies template for caption tooltip + * @Default {null} + */ + captionTemplate?: string; + + /**Toggles the visibility of caption tooltip + * @Default {false} + */ + enableCaptionTooltip?: boolean; + + /**Specifies the ID of a div, which is to be displayed as tooltip. + * @Default {null} + */ + template?: string; + + /**Toggles the visibility of tooltip + * @Default {true} + */ + visible?: boolean; +} +} +module BulletGraph +{ +enum FontStyle +{ +//string +Normal, +//string +Italic, +//string +Oblique, +} +} +module BulletGraph +{ +enum FontWeight +{ +//string +Normal, +//string +Bold, +//string +Bolder, +//string +Lighter, +} +} +module BulletGraph +{ +enum TextAlignment +{ +//string +Near, +//string +Far, +//string +Center, +} +} +module BulletGraph +{ +enum TextAnchor +{ +//string +Start, +//string +Middle, +//string +End, +} +} +module BulletGraph +{ +enum TextPosition +{ +//string +Top, +//string +Right, +//string +Left, +//string +Bottom, +//string +Float, +} +} +module BulletGraph +{ +enum FlowDirection +{ +//string +Forward, +//string +Backward, +} +} +module BulletGraph +{ +enum Orientation +{ +//string +Horizontal, +//string +Vertical, +} +} +module BulletGraph +{ +enum LabelPlacement +{ +//string +Inside, +//string +Outside, +} +} +module BulletGraph +{ +enum LabelPosition +{ +//string +Above, +//string +Below, +} +} +module BulletGraph +{ +enum TickPlacement +{ +//string +Inside, +//string +Outside, +} +} +module BulletGraph +{ +enum TickPosition +{ +//string +Below, +//string +Above, +//string +Cross, +} +} + +class Barcode extends ej.Widget { + static fn: Barcode; + constructor(element: JQuery, options?: Barcode.Model); + constructor(element: Element, options?: Barcode.Model); + model:Barcode.Model; + defaults:Barcode.Model; + + /** To disable the barcode + * @returns {void} + */ + disable(): void; + + /** To enable the barcode + * @returns {void} + */ + enable(): void; +} +export module Barcode{ + +export interface Model { + + /**Specifies the distance between the barcode and text below it. + */ + barcodeToTextGapHeight?: number; + + /**Specifies the height of bars in the Barcode. By modifying the barHeight, the entire barcode height can be customized. Please refer to xDimension for two dimensional barcode height customization. + */ + barHeight?: number; + + /**Specifies the dark bar color of the Barcode. One dimensional barcode contains a series of dark and light bars which are usually colored as black and white respectively. + */ + darkBarColor?: any; + + /**Specifies whether the text below the barcode is visible or hidden. + */ + displayText?: boolean; + + /**Specifies whether the control is enabled. + */ + enabled?: boolean; + + /**Specifies the start and stop encode symbol in the Barcode. In one dimensional barcodes, an additional character is added as start and stop delimiters. These symbols are optional and the unique of the symbol allows the reader to determine the direction of the barcode being scanned. + */ + encodeStartStopSymbol?: number; + + /**Specifies the light bar color of the Barcode. One dimensional barcode contains a series of dark and light bars which are usually colored as black and white respectively. + */ + lightBarColor?: any; + + /**Specifies the width of the narrow bars in the barcode. The dark bars in the one dimensional barcode contains random narrow and wide bars based on the provided input which can be specified during initialization. + */ + narrowBarWidth?: number; + + /**Specifies the width of the quiet zone. In barcode, a quiet zone is the blank margin on either side of a barcode which informs the reader where a barcode's symbology starts and stops. The purpose of a quiet zone is to prevent the reader from picking up unrelated information. + */ + quietZone?: QuietZone; + + /**Specifies the type of the Barcode. See SymbologyType + */ + symbologyType?: ej.datavisualization.Barcode.SymbologyType|string; + + /**Specifies the text to be encoded in the barcode. + */ + text?: string; + + /**Specifies the color of the text/data at the bottom of the barcode. + */ + textColor?: any; + + /**Specifies the width of the wide bars in the barcode. One dimensional barcode usually contains random narrow and wide bars based on the provided which can be customized during initialization. + */ + wideBarWidth?: number; + + /**Specifies the width of the narrowest element(bar or space) in a barcode. The greater the x dimension, the more easily a barcode reader will scan. + */ + xDimension?: number; + + /**Fires after Barcode control is loaded.*/ + load? (e: LoadEventArgs): void; +} + +export interface LoadEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the barcode model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; + + /**return the barcode state + */ + status?: boolean; +} + +export interface QuietZone { + + /**Specifies the quiet zone around the Barcode. + */ + all?: number; + + /**Specifies the bottom quiet zone of the Barcode. + */ + bottom?: number; + + /**Specifies the left quiet zone of the Barcode. + */ + left?: number; + + /**Specifies the right quiet zone of the Barcode. + */ + right?: number; + + /**Specifies the top quiet zone of the Barcode. + */ + top?: number; +} +} +module Barcode +{ +enum SymbologyType +{ +//Represents the QR code +QRBarcode, +//Represents the Data Matrix barcode +DataMatrix, +//Represents the Code 39 barcode +Code39, +//Represents the Code 39 Extended barcode +Code39Extended, +//Represents the Code 11 barcode +Code11, +//Represents the Codabar barcode +Codabar, +//Represents the Code 32 barcode +Code32, +//Represents the Code 93 barcode +Code93, +//Represents the Code 93 Extended barcode +Code93Extended, +//Represents the Code 128 A barcode +Code128A, +//Represents the Code 128 B barcode +Code128B, +//Represents the Code 128 C barcode +Code128C, +} +} + +class Map extends ej.Widget { + static fn: Map; + constructor(element: JQuery, options?: Map.Model); + constructor(element: Element, options?: Map.Model); + model:Map.Model; + defaults:Map.Model; + + /** Method for navigating to specific shape based on latitude, longitude and zoomlevel. + * @param {number} Pass the latitude value for map + * @param {number} Pass the longitude value for map + * @param {number} Pass the zoom level for map + * @returns {void} + */ + navigateTo(latitude: number, longitude: number, level: number): void; + + /** Method to perform map panning + * @param {string} Pass the direction in which map should be panned + * @returns {void} + */ + pan(direction: string): void; + + /** Method to reload the map. + * @returns {void} + */ + refresh(): void; + + /** Method to reload the shapeLayers with updated values + * @returns {void} + */ + refreshLayers(): void; + + /** Method to reload the navigation control with updated values. + * @param {any} Pass the navigation control instance + * @returns {void} + */ + refreshNavigationControl(navigation: any): void; + + /** Method to perform map zooming. + * @param {number} Pass the zoom level for map to be zoomed + * @param {boolean} Pass the boolean value to enable or disable animation while zooming + * @returns {void} + */ + zoom(level: number, isAnimate: boolean): void; +} +export module Map{ + +export interface Model { + + /**Specifies the background color for map + * @Default {white} + */ + background?: string; + + /**Specifies the base map-index of the map to determine the shapelayer to be displayed + * @Default {0} + */ + baseMapIndex?: number; + + /**Specify the center position where map should be displayed + * @Default {[0,0]} + */ + centerPosition?: any; + + /**Enables or Disables the map animation + * @Default {false} + */ + enableAnimation?: boolean; + + /**Enables or Disables the animation for layer change in map + * @Default {false} + */ + enableLayerChangeAnimation?: boolean; + + /**Enables or Disables the map panning + * @Default {true} + */ + enablePan?: boolean; + + /**Determines whether map need to resize when container is resized + * @Default {true} + */ + enableResize?: boolean; + + /**Enables or Disables the zooming of map + * @Default {true} + */ + enableZoom?: boolean; + + /**Enables or Disables the zoom on selecting the map shape + * @Default {false} + */ + enableZoomOnSelection?: boolean; + + /**Specifies the zoom factor for map zoom value. + * @Default {1} + */ + factor?: number; + + /**Hold the shapelayers to be displayed in map + * @Default {[]} + */ + layers?: Array; + + /**Specifies the zoom level value for which map to be zoomed + * @Default {1} + */ + level?: number; + + /**Specifies the maximum zoom level of the map + * @Default {100} + */ + maxValue?: number; + + /**Specifies the minimum zoomSettings level of the map + * @Default {1} + */ + minValue?: number; + + /**Enables or Disables the navigation control for map to perform zooming and panning on map shapes. + */ + navigationControl?: any; + + /**Layer for holding the map shapes + */ + shapeLayer?: ShapeLayer; + + /**Enables or Disables the Zooming for map. + */ + zoomSettings?: any; + + /**Triggered on selecting the map markers.*/ + markerSelected? (e: MarkerSelectedEventArgs): void; + + /**Triggers while leaving the hovered map shape*/ + mouseleave? (e: MouseleaveEventArgs): void; + + /**Triggers while hovering the map shape.*/ + mouseover? (e: MouseoverEventArgs): void; + + /**Triggers once map render completed.*/ + onRenderComplete? (e: OnRenderCompleteEventArgs): void; + + /**Triggers when map panning ends.*/ + panned? (e: PannedEventArgs): void; + + /**Triggered on selecting the map shapes.*/ + shapeSelected? (e: ShapeSelectedEventArgs): void; + + /**Triggered when map is zoomed-in.*/ + zoomedIn? (e: ZoomedInEventArgs): void; + + /**Triggers when map is zoomed out.*/ + zoomedOut? (e: ZoomedOutEventArgs): void; +} + +export interface MarkerSelectedEventArgs { + + /**Returns marker object. + */ + originalEvent?: any; +} + +export interface MouseleaveEventArgs { + + /**Returns hovered map shape object. + */ + originalEvent?: any; +} + +export interface MouseoverEventArgs { + + /**Returns hovered map shape object. + */ + originalEvent?: any; +} + +export interface OnRenderCompleteEventArgs { + + /**Event parameters from map + */ + originalEvent?: any; +} + +export interface PannedEventArgs { + + /**Event parameters from map + */ + originalEvent?: any; +} + +export interface ShapeSelectedEventArgs { + + /**Returns selected shape object. + */ + originalEvent?: any; +} + +export interface ZoomedInEventArgs { + + /**Event parameters from map + */ + originalEvent?: any; + + /**Returns zoom level value for which the map is zoomed. + */ + zoomLevel?: any; +} + +export interface ZoomedOutEventArgs { + + /**Event parameters from map + */ + originalEvent?: any; + + /**Returns zoom level value for which the map is zoomed. + */ + zoomLevel?: any; +} + +export interface ShapeLayerBubbleSettings { + + /**Specifies the bubble Opacity value of bubbles for shape layer in map + * @Default {0.9} + */ + bubbleOpacity?: number; + + /**Specifies the mouse hover color of the shape layer in map + * @Default {gray} + */ + color?: string; + + /**Specifies the colorMappings of the shape layer in map + * @Default {null} + */ + colorMappings?: any; + + /**Specifies the bubble color valuePath of the shape layer in map + * @Default {null} + */ + colorValuePath?: string; + + /**Specifies the maximum size value of bubbles for shape layer in map + * @Default {20} + */ + maxValue?: number; + + /**Specifies the minimum size value of bubbles for shape layer in map + * @Default {10} + */ + minValue?: number; + + /**Specifies the showBubble visibility status map + * @Default {true} + */ + showBubble?: boolean; + + /**Specifies the tooltip visibility status of the shape layer in map + * @Default {false} + */ + showTooltip?: boolean; + + /**Specifies the bubble tooltip template of the shape layer in map + * @Default {null} + */ + tooltipTemplate?: string; + + /**Specifies the bubble valuePath of the shape layer in map + * @Default {null} + */ + valuePath?: string; +} + +export interface ShapeLayerLabelSettings { + + /**enable or disable the enableSmartLabel property + * @Default {false} + */ + enableSmartLabel?: boolean; + + /**set the labelLength property + * @Default {'2'} + */ + labelLength?: number; + + /**set the labelPath property + * @Default {null} + */ + labelPath?: string; + + /**enable or disable the showlabel property + * @Default {false} + */ + showLabels?: boolean; + + /**set the smartLabelSize property + * @Default {fixed} + */ + smartLabelSize?: ej.datavisualization.Map.LabelSize|string; +} + +export interface ShapeLayerLegendSettings { + + /**Determines whether the legend should be placed outside or inside the map bounds + * @Default {false} + */ + dockOnMap?: boolean; + + /**Determines the legend placement and it is valid only when dockOnMap is true + * @Default {top} + */ + dockPosition?: ej.datavisualization.Map.DockPosition|string; + + /**height value for legend setting + * @Default {0} + */ + height?: number; + + /**to get icon value for legend setting + * @Default {rectangle} + */ + icon?: ej.datavisualization.Map.LegendIcons|string; + + /**icon height value for legend setting + * @Default {20} + */ + iconHeight?: number; + + /**icon Width value for legend setting + * @Default {20} + */ + iconWidth?: number; + + /**set the orientation of legend labels + * @Default {vertical} + */ + labelOrientation?: ej.datavisualization.Map.LabelOrientation|string; + + /**to get leftLabel value for legend setting + * @Default {null} + */ + leftLabel?: string; + + /**to get mode of legend setting + * @Default {default} + */ + mode?: ej.datavisualization.Map.LegendMode|string; + + /**set the position of legend settings + * @Default {topleft} + */ + position?: ej.datavisualization.Map.Position|string; + + /**x position value for legend setting + * @Default {0} + */ + positionX?: number; + + /**y position value for legend setting + * @Default {0} + */ + positionY?: number; + + /**to get rightLabel value for legend setting + * @Default {null} + */ + rightLabel?: string; + + /**Enables or Disables the showLabels + * @Default {false} + */ + showLabels?: boolean; + + /**Enables or Disables the showLegend + * @Default {false} + */ + showLegend?: boolean; + + /**to get title of legend setting + * @Default {null} + */ + title?: string; + + /**to get type of legend setting + * @Default {layers} + */ + type?: ej.datavisualization.Map.LegendType|string; + + /**width value for legend setting + * @Default {0} + */ + width?: number; +} + +export interface ShapeLayerShapeSettings { + + /**Enables or Disables the auto fill colors for shape layer in map. When this property value set to true, shapes will be filled with palette colors. + * @Default {false} + */ + autoFill?: boolean; + + /**Specifies the colorMappings of the shape layer in map + * @Default {null} + */ + colorMappings?: any; + + /**Specifies the shape color palette value of the shape layer in map. Accepted colorPalette values are palette1, palette2, palette3 and custompalette. + * @Default {palette1} + */ + colorPalette?: string; + + /**Specifies the shape color valuePath of the shape layer in map + * @Default {null} + */ + colorValuePath?: string; + + /**Enables or Disables the gradient colors for map shapes. + * @Default {false} + */ + enableGradient?: boolean; + + /**Specifies the shape fill color of the shape layer in map + * @Default {#E5E5E5} + */ + fill?: string; + + /**Specifies the mouse over width of the shape layer in map + * @Default {1} + */ + highlightBorderWidth?: number; + + /**Specifies the mouse hover color of the shape layer in map + * @Default {gray} + */ + highlightColor?: string; + + /**Specifies the mouse over stroke color of the shape layer in map + * @Default {#C1C1C1} + */ + highlightStroke?: string; + + /**Specifies the shape selection color of the shape layer in map + * @Default {gray} + */ + selectionColor?: string; + + /**Specifies the shape selection stroke color of the shape layer in map + * @Default {#C1C1C1} + */ + selectionStroke?: string; + + /**Specifies the shape selection stroke width of the shape layer in map + * @Default {1} + */ + selectionStrokeWidth?: number; + + /**Specifies the shape stroke color of the shape layer in map + * @Default {#C1C1C1} + */ + stroke?: string; + + /**Specifies the shape stroke thickness value of the shape layer in map + * @Default {0.2} + */ + strokeThickness?: number; + + /**Specifies the shape valuePath of the shape layer in map + * @Default {null} + */ + valuePath?: string; +} + +export interface ShapeLayer { + + /**to get the type of bing map. + * @Default {aerial} + */ + bingMapType?: ej.datavisualization.Map.BingMapType|string; + + /**Specifies the bubble settings for map + */ + bubbleSettings?: ShapeLayerBubbleSettings; + + /**Specifies the datasource for the shape layer + */ + dataSource?: any; + + /**Enables or disables the animation + * @Default {false} + */ + enableAnimation?: boolean; + + /**Enables or disables the shape mouse hover + * @Default {false} + */ + enableMouseHover?: boolean; + + /**Enables or disables the shape selection + * @Default {true} + */ + enableSelection?: boolean; + + /**to get the key of bing map + * @Default {null} + */ + key?: string; + + /**Options for enabling and configuring labelSettings labelPath, smartLabelSize, labelLength etc., + */ + labelSettings?: ShapeLayerLabelSettings; + + /**Specifies the map type. + * @Default {'geometry'} + */ + layerType?: ej.datavisualization.Map.LayerType|string; + + /**Options for enabling and configuring legendSettings position, height, width, mode, type etc., + */ + legendSettings?: ShapeLayerLegendSettings; + + /**Specifies the map items template for shapes. + */ + mapItemsTemplate?: string; + + /**Specify markers for shape layer. + * @Default {[]} + */ + markers?: Array; + + /**Specifies the map marker template for map layer. + * @Default {null} + */ + markerTemplate?: string; + + /**Specify selectedMapShapes for shape layer + * @Default {[]} + */ + selectedMapShapes?: Array; + + /**Specifies the selection mode of the map. Accepted selection mode values are Default and Multiple. + * @Default {default} + */ + selectionMode?: ej.datavisualization.Map.SelectionMode|string; + + /**Specifies the shape data for the shape layer + */ + shapeDataobject?: any; + + /**Specifies the shape settings of map layer + */ + shapeSettings?: ShapeLayerShapeSettings; + + /**Shows or hides the map items. + * @Default {false} + */ + showMapItems?: boolean; + + /**Shows or hides the tooltip for shapes + * @Default {false} + */ + showTooltip?: boolean; + + /**Specifies the sub shape layers + * @Default {[]} + */ + subLayers?: Array; + + /**Specifies the tooltip template for shapes. + */ + tooltipTemplate?: string; + + /**Specifies the url template for the OSM type map. + * @Default {'http://a.tile.openstreetmap.org/level/tileX/tileY.png'} + */ + urlTemplate?: string; +} +} +module Map +{ +enum Position +{ +//specifies the none position +None, +//specifies the topleft position +Topleft, +//specifies the topcenter position +Topcenter, +//specifies the topright position +Topright, +//specifies the centerleft position +Centerleft, +//specifies the center position +Center, +//specifies the centerright position +Centerright, +//specifies the bottomleft position +Bottomleft, +//specifies the bottomcenter position +Bottomcenter, +//specifies the bottomright position +Bottomright, +} +} +module Map +{ +enum Orientation +{ +//specifies the horizontal position +Horizontal, +//specifies the vertical position +Vertical, +} +} +module Map +{ +enum BingMapType +{ +//specifies the aerial type +Aerial, +//specifies the aerialwithlabel type +Aerialwithlabel, +//specifies the road type +Road, +} +} +module Map +{ +enum LabelSize +{ +//specifies the fixed size +Fixed, +//specifies the default size +Default, +} +} +module Map +{ +enum LayerType +{ +//specifies the geometry type +Geometry, +//specifies the osm type +Osm, +//specifies the bing type +Bing, +} +} +module Map +{ +enum DockPosition +{ +//specifies the top position +Top, +//specifies the bottom position +Bottom, +//specifies the bottom position +Right, +//specifies the left position +Left, +} +} +module Map +{ +enum LegendIcons +{ +//specifies the rectangle position +Rectangle, +//specifies the circle position +Circle, +} +} +module Map +{ +enum LabelOrientation +{ +//specifies the horizontal position +Horizontal, +//specifies the vertical position +Vertical, +} +} +module Map +{ +enum LegendMode +{ +//specifies the default mode +Default, +//specifies the interactive mode +Interactive, +} +} +module Map +{ +enum LegendType +{ +//specifies the layers type +Layers, +//specifies the bubbles type +Bubbles, +} +} +module Map +{ +enum SelectionMode +{ +//specifies the default position +Default, +//specifies the multiple position +Multiple, +} +} + +class TreeMap extends ej.Widget { + static fn: TreeMap; + constructor(element: JQuery, options?: TreeMap.Model); + constructor(element: Element, options?: TreeMap.Model); + model:TreeMap.Model; + defaults:TreeMap.Model; + + /** Method to reload treemap with updated values. + * @returns {void} + */ + refresh(): void; +} +export module TreeMap{ + +export interface Model { + + /**Specifies the border brush color of the treemap + * @Default {white} + */ + borderBrush?: string; + + /**Specifies the border thickness of the treemap + * @Default {1} + */ + borderThickness?: number; + + /**Specifies the colors of the paletteColorMapping + * @Default {[]} + */ + colors?: Array; + + /**Specifies the color valuepath of the treemap + * @Default {null} + */ + colorValuePath?: string; + + /**Specifies the datasource of the treemap + * @Default {null} + */ + dataSource?: any; + + /**Specifies the desaturationColorMapping settings of the treemap + */ + desaturationColorMapping?: any; + + /**Specifies the dockPosition for legend + * @Default {top} + */ + dockPosition?: ej.datavisualization.TreeMap.DockPosition|string; + + /**specifies the drillDown header color + * @Default {'null'} + */ + drillDownHeaderColor?: string; + + /**specifies the drillDown selection color + * @Default {'#000000'} + */ + drillDownSelectionColor?: string; + + /**Enable/Disable the drillDown for treemap + * @Default {false} + */ + enableDrillDown?: boolean; + + /**Specifies whether treemap need to resize when container is resized + * @Default {true} + */ + enableResize?: boolean; + + /**Specifies the from value for desaturation color mapping + * @Default {0} + */ + from?: number; + + /**Specifies the group color mapping of the treemap + * @Default {[]} + */ + groupColorMapping?: Array; + + /**Specifies the height for legend + * @Default {30} + */ + height?: number; + + /**Specifies the highlight border brush of treemap + * @Default {gray} + */ + highlightBorderBrush?: string; + + /**Specifies the border thickness when treemap items is highlighted in the treemap + * @Default {5} + */ + highlightBorderThickness?: number; + + /**Specifies the highlight border brush of treemap + * @Default {gray} + */ + highlightGroupBorderBrush?: string; + + /**Specifies the border thickness when treemap items is highlighted in the treemap + * @Default {5} + */ + highlightGroupBorderThickness?: number; + + /**Specifies whether treemap item need to highlighted on selection + * @Default {false} + */ + highlightGroupOnSelection?: boolean; + + /**Specifies whether treemap item need to highlighted on selection + * @Default {false} + */ + highlightOnSelection?: boolean; + + /**Specifies the iconHeight for legend + * @Default {15} + */ + iconHeight?: number; + + /**Specifies the iconWidth for legend + * @Default {15} + */ + iconWidth?: number; + + /**Specifies the items layout mode of the treemap. Accepted itemsLayoutMode values are Squarified, SliceAndDiceHorizontal, SliceAndDiceVertical and SliceAndDiceAuto + * @Default {Squarified} + */ + itemsLayoutMode?: ej.datavisualization.TreeMap.ItemsLayoutMode|string; + + /**Specifies the leaf settings of the treemap + */ + leafItemSettings?: LeafItemSettings; + + /**Specifies the legend settings of the treemap + */ + legendSettings?: any; + + /**Specify levels of treemap for grouped visualization of datas + * @Default {[]} + */ + levels?: Array; + + /**Specifies the paletteColorMapping of the treemap + */ + paletteColorMapping?: any; + + /**Specifies the rangeColorMapping settings of the treemap + */ + rangeColorMapping?: Array; + + /**Specifies the rangeMaximum value for desaturation color mapping + * @Default {0} + */ + rangeMaximum?: number; + + /**Specifies the rangeMinimum value for desaturation color mapping + * @Default {0} + */ + rangeMinimum?: number; + + /**Specifies the legend visibility status of the treemap + * @Default {false} + */ + showLegend?: boolean; + + /**Specifies whether treemap tooltip need to be visible + * @Default {false} + */ + showTooltip?: boolean; + + /**Specifies the template for legendSettings + * @Default {null} + */ + template?: string; + + /**Specifies the to value for desaturation color mapping + * @Default {0} + */ + to?: number; + + /**Specifies the tooltip template of the treemap + * @Default {null} + */ + tooltipTemplate?: string; + + /**Hold the treeMapItems to be displayed in treemap + * @Default {[]} + */ + treeMapItems?: Array; + + /**Hold the Level settings of TreeMap + */ + treeMapLevel?: TreeMapLevel; + + /**Specifies the uniColorMapping settings of the treemap + */ + uniColorMapping?: any; + + /**Specifies the weight valuepath of the treemap + * @Default {null} + */ + weightValuePath?: string; + + /**Specifies the width for legend + * @Default {100} + */ + width?: number; + + /**Triggers on treemap item selected.*/ + treeMapItemSelected? (e: TreeMapItemSelectedEventArgs): void; +} + +export interface TreeMapItemSelectedEventArgs { + + /**Returns selected treeMapItem object. + */ + originalEvent?: any; +} + +export interface LeafItemSettings { + + /**Specifies the border bruch color of the leaf item. + * @Default {white} + */ + borderBrush?: string; + + /**Specifies the border thickness of the leaf item. + * @Default {1} + */ + borderThickness?: number; + + /**Specifies the label template of the leaf item. + * @Default {null} + */ + itemTemplate?: string; + + /**Specifies the label path of the leaf item. + * @Default {null} + */ + labelPath?: string; + + /**Specifies the position of the leaf labels. + * @Default {center} + */ + labelPosition?: ej.datavisualization.TreeMap.Position|string; + + /**Specifies the mode of label visibility + * @Default {visible} + */ + labelVisibilityMode?: ej.datavisualization.TreeMap.VisibilityMode|string; + + /**Shows or hides the label of the leaf item. + * @Default {false} + */ + showLabels?: boolean; +} + +export interface TreeMapLevel { + + /**specifies the group background + * @Default {null} + */ + groupBackground?: string; + + /**Specifies the group border color for tree map level. + * @Default {null} + */ + groupBorderColor?: string; + + /**Specifies the group border thickness for tree map level. + * @Default {1} + */ + groupBorderThickness?: number; + + /**Specifies the group gap for tree map level. + * @Default {1} + */ + groupGap?: number; + + /**Specifies the group padding for tree map level. + * @Default {4} + */ + groupPadding?: number; + + /**Specifies the group path for tree map level. + */ + groupPath?: string; + + /**Specifies the header height for tree map level. + * @Default {0} + */ + headerHeight?: number; + + /**Specifies the header template for tree map level. + * @Default {null} + */ + headerTemplate?: string; + + /**Specifies the mode of header visibility + * @Default {visible} + */ + headerVisibilityMode?: ej.datavisualization.TreeMap.VisibilityMode|string; + + /**Specifies the position of the labels. + * @Default {center} + */ + labelPosition?: ej.datavisualization.TreeMap.Position|string; + + /**Specifies the label template for tree map level. + * @Default {null} + */ + labelTemplate?: string; + + /**Specifies the mode of label visibility + * @Default {visible} + */ + labelVisibilityMode?: ej.datavisualization.TreeMap.VisibilityMode|string; + + /**Shows or hides the header for tree map level. + * @Default {false} + */ + showHeader?: boolean; + + /**Shows or hides the labels for tree map level. + * @Default {false} + */ + showLabels?: boolean; +} +} +module TreeMap +{ +enum DockPosition +{ +//specifies the top position +Top, +//specifies the bottom position +Bottom, +//specifies the bottom position +Right, +//specifies the left position +Left, +} +} +module TreeMap +{ +enum ItemsLayoutMode +{ +//specifies the squarified as layout type position +Squarified, +//specifies the sliceanddicehorizontal as layout type position +Sliceanddicehorizontal, +//specifies the sliceanddicevertical as layout type position +Sliceanddicevertical, +//specifies the sliceanddiceauto as layout type position +Sliceanddiceauto, +} +} +module TreeMap +{ +enum Position +{ +//specifies the none position +None, +//specifies the topleft position +Topleft, +//specifies the topcenter position +Topcenter, +//specifies the topright position +Topright, +//specifies the centerleft position +Centerleft, +//specifies the center position +Center, +//specifies the centerright position +Centerright, +//specifies the bottomleft position +Bottomleft, +//specifies the bottomcenter position +Bottomcenter, +//specifies the bottomright position +Bottomright, +} +} +module TreeMap +{ +enum VisibilityMode +{ +//specifies the visible mode +Top, +//specifies the hideonexceededlength mode +Hideonexceededlength, +} +} +module TreeMap +{ +enum groupSelectionMode +{ +//specifies the default mode +Default, +//specifies the multiple mode +Multiple, +} +} + +class Diagram extends ej.Widget { + static fn: Diagram; + constructor(element: JQuery, options?: Diagram.Model); + constructor(element: Element, options?: Diagram.Model); + model:Diagram.Model; + defaults:Diagram.Model; + + /** Add nodes and connectors to diagram at runtime + * @param {any} a JSON to define a node/connector or an array of nodes and connector + * @returns {void} + */ + add(node: any): void; + + /** Add a label to a node at runtime + * @param {string} name of the node to which label will be added + * @param {any} JSON for the new label to be added + * @returns {void} + */ + addLabel(nodeName: string, newLabel: any): void; + + /** Add a phase to a swimlane at runtime + * @param {string} name of the swimlane to which the phase will be added + * @param {any} JSON object to define the phase to be added + * @returns {void} + */ + addPhase(name: string, options: any): void; + + /** Add a collection of ports to the node specified by name + * @param {string} name of the node to which the ports have to be added + * @param {Array} a collection of ports to be added to the specified node + * @returns {void} + */ + addPorts(name: string, ports: Array): void; + + /** Add the specified node to selection list + * @param {any} the node to be selected + * @param {boolean} to define whether to clear the existing selection or not + * @returns {void} + */ + addSelection(node: any, clearSelection: boolean): void; + + /** Align the selected objects based on the reference object and direction + * @param {string} to specify the direction towards which the selected objects are to be aligned("left","right",top","bottom") + * @returns {void} + */ + align(direction: string): void; + + /** Bring the specified portion of the diagram content to the diagram viewport + * @param {any} the rectangular region that is to be brought into diagram viewport + * @returns {void} + */ + bringIntoView(rect: any): void; + + /** Bring the specified portion of the diagram content to the center of the diagram viewport + * @param {any} the rectangular region that is to be brought to the center of diagram viewport + * @returns {void} + */ + bringToCenter(rect: any): void; + + /** Visually move the selected object over all other intersected objects + * @returns {void} + */ + bringToFront(): void; + + /** Remove all the elements from diagram + * @returns {void} + */ + clear(): void; + + /** Remove the current selection in diagram + * @returns {void} + */ + clearSelection(): void; + + /** Copy the selected object to internal clipboard and get the copied object + * @returns {any} + */ + copy(): any; + + /** Cut the selected object from diagram to diagram internal clipboard + * @returns {void} + */ + cut(): void; + + /** Export the diagram as downloadable files or as data + * @param {Diagram.Options} options to export the desired region of diagram to the desired formats.NameTypeDescriptionfileNamestringname of the file to be downloaded.formatstringformat of the exported file/data. See [File Formats](/js/api/global#fileformats).modestringto set whether to export diagram as a file or as raw data. See [Export Modes](/js/api/global#exportmodes).regionstringto set the region of the diagram to be exported. See [Region](/js/api/global#region).boundsobjectto export any custom region of diagram.marginobjectto set margin to the exported data. + * @returns {string} + */ + exportDiagram(options: Diagram.Options): string; + + /** Read a node/connector object by its name + * @param {string} name of the node/connector that is to be identified + * @returns {any} + */ + findNode(name: string): any; + + /** Fit the diagram content into diagram viewport + * @param {string} to set the mode of fit to command. See [Fit Mode](/js/api/global#fitmode) + * @param {string} to set whether the region to be fit will be based on diagram elements or page settings [Region](/js/api/global#region) + * @param {any} to set the required margin + * @returns {void} + */ + fitToPage(mode: string, region: string, margin: any): void; + + /** Group the selected nodes and connectors + * @returns {void} + */ + group(): void; + + /** Insert a label into a node's label collection at runtime + * @param {string} name of the node to which the label has to be inserted + * @param {any} JSON to define the new label + * @param {number} index to insert the label into the node + * @returns {void} + */ + insertLabel(name: string, label: any, index: number): void; + + /** Refresh the diagram with the specified layout + * @returns {void} + */ + layout(): void; + + /** Load the diagram + * @param {any} JSON data to load the diagram + * @returns {void} + */ + load(data: any): void; + + /** Visually move the selected object over its closest intersected object + * @returns {void} + */ + moveForward(): void; + + /** Move the selected objects by either one pixel or by the pixels specified through argument + * @param {string} specifies the direction to move the selected objects ("left","right",top","bottom") + * @param {number} specifies the number of pixels by which the selected objects have to be moved + * @returns {void} + */ + nudge(direction: string, delta: number): void; + + /** Paste the selected object from internal clipboard to diagram + * @param {any} object to be added to diagram + * @param {boolean} to define whether the specified object is to be renamed or not + * @returns {void} + */ + paste(object: any, rename: boolean): void; + + /** Print the diagram as image + * @returns {void} + */ + print(): void; + + /** Restore the last action that was reverted + * @returns {void} + */ + redo(): void; + + /** Refresh the diagram at runtime + * @returns {void} + */ + refresh(): void; + + /** Remove either the given node/connector or the selected element from diagram + * @param {any} the node/connector to be removed from diagram + * @returns {void} + */ + remove(node: any): void; + + /** Remove a particular object from selection list + * @param {any} the node/connector to be removed from selection list + * @returns {void} + */ + removeSelection(node: any): void; + + /** Scale the selected objects to the height of the first selected object + * @returns {void} + */ + sameHeight(): void; + + /** Scale the selected objects to the size of the first selected object + * @returns {void} + */ + sameSize(): void; + + /** Scale the selected objects to the width of the first selected object + * @returns {void} + */ + sameWidth(): void; + + /** Returns the diagram as serialized JSON + * @returns {any} + */ + save(): any; + + /** Bring the node into view + * @param {any} the node/connector to be brought into view + * @returns {void} + */ + scrollToNode(node: any): void; + + /** Select all nodes and connector in diagram + * @returns {void} + */ + selectAll(): void; + + /** Visually move the selected object behind its closest intersected object + * @returns {void} + */ + sendBackward(): void; + + /** Visually move the selected object behind all other intersected objects + * @returns {void} + */ + sendToBack(): void; + + /** Update the horizontal space between the selected objects as equal and within the selection boundary + * @returns {void} + */ + spaceAcross(): void; + + /** Update the vertical space between the selected objects as equal and within the selection boundary + * @returns {void} + */ + spaceDown(): void; + + /** Move the specified label to edit mode + * @param {any} node/connector that contains the label to be edited + * @param {any} to be edited + * @returns {void} + */ + startLabelEdit(node: any, label: any): void; + + /** Reverse the last action that was performed + * @returns {void} + */ + undo(): void; + + /** Ungroup the selected group + * @returns {void} + */ + ungroup(): void; + + /** Update diagram at runtime + * @param {any} JSON to specify the diagram properties that have to be modified + * @returns {void} + */ + update(options: any): void; + + /** Update Connectors at runtime + * @param {string} name of the connector to be updated + * @param {any} JSON to specify the connector properties that have to be updated + * @returns {void} + */ + updateConnector(name: string, options: any): void; + + /** Update the given label at runtime + * @param {string} the name of node/connector which contains the label to be updated + * @param {any} the label to be modified + * @param {any} JSON to specify the label properties that have to be updated + * @returns {any} + */ + updateLabel(nodeName: string, label: any, options: any): any; + + /** Update nodes at runtime + * @param {string} name of the node that is to be updated + * @param {any} JSON to specify the properties of node that have to be updated + * @returns {void} + */ + updateNode(name: string, options: any): void; + + /** Update a port with its modified properties at runtime + * @param {string} the name of node which contains the port to be updated + * @param {any} the port to be updated + * @param {any} JSON to specify the properties of the port that have to be updated + * @returns {void} + */ + updatePort(nodeName: string, port: any, options: any): void; + + /** Update the specified node as selected object + * @param {string} name of the node to be updated as selected object + * @returns {void} + */ + updateSelectedObject(name: string): void; + + /** Update the selection at runtime + * @param {boolean} to specify whether to show the user handles or not + * @returns {void} + */ + updateSelection(showUserHandles: boolean): void; + + /** Update userhandles with respect to the given node + * @param {any} node/connector with respect to which, the user handles have to be updated + * @returns {void} + */ + updateUserHandles(node: any): void; + + /** Update the diagram viewport at runtime + * @returns {void} + */ + updateViewPort(): void; + + /** Upgrade the diagram from old version + * @param {any} to be upgraded + * @returns {void} + */ + upgrade(data: any): void; + + /** Used to zoomIn/zoomOut diagram + * @param {any} options to zoom the diagram(zoom factor, zoomIn/zoomOut) + * @returns {void} + */ + zoomTo(zoom: any): void; +} +export module Diagram{ + +export interface Options { + + /**name of the file to be downloaded. + */ + fileName?: string; + + /**format of the exported file/data. See [File Formats](/js/api/global#fileformats). + */ + format?: string; + + /**to set whether to export diagram as a file or as raw data. See [Export Modes](/js/api/global#exportmodes). + */ + mode?: string; + + /**to set the region of the diagram to be exported. See [Region](/js/api/global#region). + */ + region?: string; + + /**to export any custom region of diagram. + */ + bounds?: any; + + /**to set margin to the exported data. + */ + margin?: any; +} + +export interface Model { + + /**Defines the background color of diagram elements + * @Default {transparent} + */ + backgroundColor?: string; + + /**Defines the path of the background image of diagram elements + * @Default {null} + */ + backgroundImage?: string; + + /**Sets the direction of line bridges. + * @Default {ej.datavisualization.Diagram.BridgeDirection.Top} + */ + bridgeDirection?: ej.datavisualization.Diagram.BridgeDirection|string; + + /**Defines a set of custom commands and binds them with a set of desired key gestures. + */ + commandManager?: CommandManager; + + /**A collection of JSON objects where each object represents a connector + * @Default {[]} + */ + connectors?: Array; + + /**Binds the custom JSON data with connector properties + * @Default {null} + */ + connectorTemplate?: any; + + /**Enables/Disables the default behaviors of the diagram. + * @Default {ej.datavisualization.Diagram.DiagramConstraints.All} + */ + constraints?: ej.datavisualization.Diagram.DiagramConstraints|string; + + /**An object to customize the context menu of diagram + */ + contextMenu?: ContextMenu; + + /**Configures the data source that is to be bound with diagram + */ + dataSourceSettings?: DataSourceSettings; + + /**Initializes the default values for nodes and connectors + * @Default {{}} + */ + defaultSettings?: DefaultSettings; + + /**Sets the type of Json object to be drawn through drawing tool + * @Default {{}} + */ + drawType?: any; + + /**Enables or disables auto scroll in diagram + * @Default {true} + */ + enableAutoScroll?: boolean; + + /**Enables or disables diagram context menu + * @Default {true} + */ + enableContextMenu?: boolean; + + /**Specifies the height of the diagram + * @Default {null} + */ + height?: string; + + /**Customizes the undo redo functionality + */ + historyManager?: HistoryManager; + + /**Automatically arranges the nodes and connectors in a predefined manner + */ + layout?: Layout; + + /**Defines the current culture of diagram + * @Default {en-US} + */ + locale?: string; + + /**Array of JSON objects where each object represents a node + * @Default {[]} + */ + nodes?: Array; + + /**Binds the custom JSON data with node properties + * @Default {null} + */ + nodeTemplate?: any; + + /**Defines the size and appearance of diagram page + */ + pageSettings?: PageSettings; + + /**Defines the zoom value, zoom factor, scroll status and view port size of the diagram + */ + scrollSettings?: ScrollSettings; + + /**Defines the size and position of selected items and defines the appearance of selector + */ + selectedItems?: SelectedItems; + + /**Enables or disables tooltip of diagram + * @Default {true} + */ + showTooltip?: boolean; + + /**Defines the gridlines and defines how and when the objects have to be snapped + */ + snapSettings?: SnapSettings; + + /**Enables/Disables the interactive behaviors of diagram. + * @Default {ej.datavisualization.Diagram.Tool.All} + */ + tool?: ej.datavisualization.Diagram.Tool|string; + + /**An object that defines the description, appearance and alignments of tooltips + * @Default {null} + */ + tooltip?: Tooltip; + + /**Specifies the width of the diagram + * @Default {null} + */ + width?: string; + + /**Sets the factor by which we can zoom in or zoom out + * @Default {0.2} + */ + zoomFactor?: number; + + /**Triggers When auto scroll is changed*/ + autoScrollChange? (e: AutoScrollChangeEventArgs): void; + + /**Triggers when a node, connector or diagram is clicked*/ + click? (e: ClickEventArgs): void; + + /**Triggers when the connection is changed*/ + connectionChange? (e: ConnectionChangeEventArgs): void; + + /**Triggers when the connector collection is changed*/ + connectorCollectionChange? (e: ConnectorCollectionChangeEventArgs): void; + + /**Triggers when the connectors' source point is changed*/ + connectorSourceChange? (e: ConnectorSourceChangeEventArgs): void; + + /**Triggers when the connectors' target point is changed*/ + connectorTargetChange? (e: ConnectorTargetChangeEventArgs): void; + + /**Triggers before opening the context menu*/ + contextMenuBeforeOpen? (e: ContextMenuBeforeOpenEventArgs): void; + + /**Triggers when a context menu item is clicked*/ + contextMenuClick? (e: ContextMenuClickEventArgs): void; + + /**Triggers when a node, connector or diagram model is clicked twice*/ + doubleClick? (e: DoubleClickEventArgs): void; + + /**Triggers while dragging the elements in diagram*/ + drag? (e: DragEventArgs): void; + + /**Triggers when a symbol is dragged into diagram from symbol palette*/ + dragEnter? (e: DragEnterEventArgs): void; + + /**Triggers when a symbol is dragged outside of the diagram.*/ + dragLeave? (e: DragLeaveEventArgs): void; + + /**Triggers when a symbol is dragged over diagram*/ + dragOver? (e: DragOverEventArgs): void; + + /**Triggers when a symbol is dragged and dropped from symbol palette to drawing area*/ + drop? (e: DropEventArgs): void; + + /**Triggers when a child is added to or removed from a group*/ + groupChange? (e: GroupChangeEventArgs): void; + + /**Triggers when a diagram element is clicked*/ + itemClick? (e: ItemClickEventArgs): void; + + /**Triggers when mouse enters a node/connector*/ + mouseEnter? (e: MouseEnterEventArgs): void; + + /**Triggers when mouse leaves node/connector*/ + mouseLeave? (e: MouseLeaveEventArgs): void; + + /**Triggers when mouse hovers over a node/connector*/ + mouseOver? (e: MouseOverEventArgs): void; + + /**Triggers when node collection is changed*/ + nodeCollectionChange? (e: NodeCollectionChangeEventArgs): void; + + /**Triggers when the node properties(x, y,width and height alone) are changed using nudge commands or updateNode API.*/ + propertyChange? (e: PropertyChangeEventArgs): void; + + /**Triggers when the diagram elements are rotated*/ + rotationChange? (e: RotationChangeEventArgs): void; + + /**Triggers when the diagram is zoomed or panned*/ + scrollChange? (e: ScrollChangeEventArgs): void; + + /**Triggers when a connector segment is edited*/ + segmentChange? (e: SegmentChangeEventArgs): void; + + /**Triggers when the selection is changed in diagram*/ + selectionChange? (e: SelectionChangeEventArgs): void; + + /**Triggers when a node is resized*/ + sizeChange? (e: SizeChangeEventArgs): void; + + /**Triggers when label editing is ended*/ + textChange? (e: TextChangeEventArgs): void; +} + +export interface AutoScrollChangeEventArgs { + + /**Returns the delay between subsequent auto scrolls + */ + delay?: string; +} + +export interface ClickEventArgs { + + /**parameter returns the clicked node, connector or diagram + */ + element?: any; + + /**parameter returns the object that is actually clicked + */ + actualObject?: number; + + /**parameter returns the horizontal coordinate of the mouse pointer, relative to the diagram + */ + offsetX?: number; + + /**parameter returns the vertical coordinate of the mouse pointer, relative to the diagram + */ + offsetY?: number; + + /**parameter returns the count of how many times the mouse button is pressed + */ + count?: number; + + /**parameter returns the actual click event arguments that explains which button is clicked + */ + event?: any; +} + +export interface ConnectionChangeEventArgs { + + /**parameter returns the connection that is changed between nodes, ports or points + */ + element?: any; + + /**parameter returns the new source node or target node of the connector + */ + connection?: string; + + /**parameter returns the new source port or target port of the connector + */ + port?: any; + + /**parameter defines whether to cancel the change or not + */ + cancel?: boolean; +} + +export interface ConnectorCollectionChangeEventArgs { + + /**parameter returns whether the connector is inserted or removed + */ + changeType?: string; + + /**parameter returns the connector that is to be added or deleted + */ + element?: any; + + /**parameter defines whether to cancel the collection change or not + */ + cancel?: boolean; +} + +export interface ConnectorSourceChangeEventArgs { + + /**returns the connector, the source point of which is being dragged + */ + element?: any; + + /**returns the source node of the element + */ + node?: any; + + /**returns the source point of the element + */ + point?: any; + + /**returns the source port of the element + */ + port?: any; + + /**returns the state of connection end point dragging(starting, dragging, completed) + */ + dragState?: string; + + /**parameter defines whether to cancel the change or not + */ + cancel?: boolean; +} + +export interface ConnectorTargetChangeEventArgs { + + /**parameter returns the connector, the target point of which is being dragged + */ + element?: any; + + /**returns the target node of the element + */ + node?: any; + + /**returns the target point of the element + */ + point?: any; + + /**returns the target port of the element + */ + port?: any; + + /**returns the state of connection end point dragging(starting, dragging, completed) + */ + dragState?: string; + + /**parameter defines whether to cancel the change or not + */ + cancel?: boolean; +} + +export interface ContextMenuBeforeOpenEventArgs { + + /**parameter returns the diagram object + */ + diagram?: any; + + /**parameter returns the actual arguments from context menu + */ + contextmenu?: any; + + /**parameter returns the object that was clicked + */ + target?: any; +} + +export interface ContextMenuClickEventArgs { + + /**parameter returns the id of the selected context menu item + */ + id?: string; + + /**parameter returns the text of the selected context menu item + */ + text?: string; + + /**parameter returns the parent id of the selected context menu item + */ + parentId?: string; + + /**parameter returns the parent text of the selected context menu item + */ + parentText?: string; + + /**parameter returns the object that was clicked + */ + target?: any; + + /**parameter defines whether to execute the click event or not + */ + canExecute?: boolean; +} + +export interface DoubleClickEventArgs { + + /**parameter returns the object that is actually clicked + */ + actualObject?: any; + + /**parameter returns the selected object + */ + element?: any; +} + +export interface DragEventArgs { + + /**parameter returns the node or connector that is being dragged + */ + element?: any; + + /**parameter returns the previous position of the node/connector + */ + oldValue?: any; + + /**parameter returns the new position of the node/connector + */ + newValue?: any; + + /**parameter returns the state of drag event (Starting, dragging, completed) + */ + dragState?: string; + + /**parameter returns whether or not to cancel the drag event + */ + cancel?: boolean; +} + +export interface DragEnterEventArgs { + + /**parameter returns the node or connector that is dragged into diagram + */ + element?: any; + + /**parameter returns whether to add or remove the symbol from diagram + */ + cancel?: boolean; +} + +export interface DragLeaveEventArgs { + + /**parameter returns the node or connector that is dragged outside of the diagram + */ + element?: any; +} + +export interface DragOverEventArgs { + + /**parameter returns the node or connector that is dragged over diagram + */ + element?: any; + + /**parameter defines whether the symbol can be dropped at the current mouse position + */ + allowDrop?: boolean; + + /**parameter returns the node/connector over which the symbol is dragged + */ + target?: any; + + /**parameter returns the previous position of the node/connector + */ + oldValue?: any; + + /**parameter returns the new position of the node/connector + */ + newValue?: any; + + /**parameter returns whether or not to cancel the dragOver event + */ + cancel?: boolean; +} + +export interface DropEventArgs { + + /**parameter returns node or connector that is being dropped + */ + element?: any; + + /**parameter returns whether or not to cancel the drop event + */ + cancel?: boolean; + + /**parameter returns the object from where the element is dragged + */ + source?: any; + + /**parameter returns the object over which the object will be dropped + */ + target?: any; + + /**parameter returns the enum which defines the type of the source + */ + sourceType?: string; +} + +export interface GroupChangeEventArgs { + + /**parameter returns the object that is added to/removed from a group + */ + element?: any; + + /**parameter returns the old parent group(if any) of the object + */ + oldParent?: any; + + /**parameter returns the new parent group(if any) of the object + */ + newParent?: any; + + /**parameter returns the cause of group change("group", unGroup") + */ + cause?: string; +} + +export interface ItemClickEventArgs { + + /**parameter returns the object that was actually clicked + */ + actualObject?: any; + + /**parameter returns the object that is selected + */ + selectedObject?: any; + + /**parameter returns whether or not to cancel the drop event + */ + cancel?: boolean; + + /**parameter returns the actual click event arguments that explains which button is clicked + */ + event?: any; +} + +export interface MouseEnterEventArgs { + + /**parameter returns the target node or connector + */ + element?: any; + + /**parameter returns the object from where the selected object is dragged + */ + source?: any; + + /**parameter returns the target object over which the selected object is dragged + */ + target?: any; +} + +export interface MouseLeaveEventArgs { + + /**parameter returns the target node or connector + */ + element?: any; + + /**parameter returns the object from where the selected object is dragged + */ + source?: any; + + /**parameter returns the target object over which the selected object is dragged + */ + target?: any; +} + +export interface MouseOverEventArgs { + + /**parameter returns the target node or connector + */ + element?: any; + + /**parameter returns the object from where the element is dragged + */ + source?: any; + + /**parameter returns the object over which the element is being dragged. + */ + target?: any; +} + +export interface NodeCollectionChangeEventArgs { + + /**parameter returns whether the node is to be added or removed + */ + changeType?: string; + + /**parameter returns the node which needs to be added or deleted + */ + element?: any; + + /**parameter defines whether to cancel the collection change or not + */ + cancel?: boolean; +} + +export interface PropertyChangeEventArgs { + + /**parameter returns the selected element + */ + element?: any; + + /**parameter returns the action is nudge or not + */ + cause?: string; + + /**parameter returns the new value of the node property that is being changed + */ + newValue?: any; + + /**parameter returns the old value of the property that is being changed + */ + oldValue?: any; + + /**parameter returns the name of the property that is changed + */ + propertyName?: string; +} + +export interface RotationChangeEventArgs { + + /**parameter returns the node that is rotated + */ + element?: any; + + /**parameter returns the previous rotation angle + */ + oldValue?: any; + + /**parameter returns the new rotation angle + */ + newValue?: any; + + /**parameter to specify whether or not to cancel the event + */ + cancel?: boolean; +} + +export interface ScrollChangeEventArgs { + + /**Parameter returns the new zoom value, horizontal and vertical scroll offsets. + */ + newValues?: any; + + /**parameter returns the previous zoom value, horizontal and vertical scroll offsets. + */ + oldValues?: any; +} + +export interface SegmentChangeEventArgs { + + /**Parameter returns the connector that is being edited + */ + element?: any; + + /**parameter returns the state of editing (starting, dragging, completed) + */ + dragState?: string; + + /**parameter returns the current mouse position + */ + point?: any; + + /**parameter to specify whether or not to cancel the event + */ + cancel?: boolean; +} + +export interface SelectionChangeEventArgs { + + /**parameter returns whether the item is selected or removed selection + */ + changeType?: string; + + /**parameter returns the item which is selected or to be selected + */ + element?: any; + + /**parameter returns the collection of nodes and connectors that have to be removed from selection list + */ + oldItems?: Array; + + /**parameter returns the collection of nodes and connectors that have to be added to selection list + */ + newItems?: Array; + + /**parameter returns the collection of nodes and connectors that will be selected after selection change + */ + selectedItems?: Array; + + /**parameter to specify whether or not to cancel the selection change event + */ + cancel?: boolean; +} + +export interface SizeChangeEventArgs { + + /**parameter returns node that was resized + */ + element?: any; + + /**parameter to cancel the size change + */ + cancel?: boolean; + + /**parameter returns the new width, height, offsetX and offsetY values of the element that is being resized + */ + newValue?: any; + + /**parameter returns the previous width,height,offsetX and offsetY values of the element that is being resized + */ + oldValue?: any; + + /**parameter returns the state of resizing(starting,resizing,completed) + */ + resizeState?: string; + + /**parameter returns the difference between new and old value + */ + offset?: any; +} + +export interface TextChangeEventArgs { + + /**parameter returns the node that contains the text being edited + */ + element?: any; + + /**parameter returns the new text + */ + value?: string; + + /**parameter returns the keyCode of the key entered + */ + keyCode?: string; +} + +export interface CommandManagerCommandsGesture { + + /**Sets the key value, on recognition of which the command will be executed. + * @Default {ej.datavisualization.Diagram.Keys.None} + */ + key?: ej.datavisualization.Diagram.Keys|string; + + /**Sets a combination of key modifiers, on recognition of which the command will be executed. + * @Default {ej.datavisualization.Diagram.KeyModifiers.None} + */ + keyModifiers?: ej.datavisualization.Diagram.KeyModifiers|string; +} + +export interface CommandManagerCommands { + + /**A method that defines whether the command is executable at the moment or not. + */ + canExecute?: Function; + + /**A method that defines what to be executed when the key combination is recognized. + */ + execute?: Function; + + /**Defines a combination of keys and key modifiers, on recognition of which the command will be executed + */ + gesture?: CommandManagerCommandsGesture; + + /**Defines any additional parameters that are required at runtime + * @Default {null} + */ + parameter?: any; +} + +export interface CommandManager { + + /**An object that maps a set of command names with the corresponding command objects + * @Default {{}} + */ + commands?: CommandManagerCommands; +} + +export interface ConnectorsSegments { + + /**Sets the direction of orthogonal segment + */ + direction?: string; + + /**Describes the length of orthogonal segment + * @Default {undefined} + */ + length?: number; + + /**Describes the end point of bezier/straight segment + * @Default {Diagram.Point()} + */ + point?: ej.datavisualization.Diagram.ConnectorsSourcePoint|string; + + /**Defines the first control point of the bezier segment + * @Default {null} + */ + point1?: ej.datavisualization.Diagram.ConnectorsSourcePoint|string; + + /**Defines the second control point of bezier segment + * @Default {null} + */ + point2?: ej.datavisualization.Diagram.ConnectorsSourcePoint|string; + + /**Sets the type of the segment. + * @Default {ej.datavisualization.Diagram.Segments.Straight} + */ + type?: ej.datavisualization.Diagram.Segments|string; + + /**Describes the length and angle between the first control point and the start point of bezier segment + * @Default {null} + */ + vector1?: any; + + /**Describes the length and angle between the second control point and end point of bezier segment + * @Default {null} + */ + vector2?: any; +} + +export interface ConnectorsSourceDecorator { + + /**Sets the border color of the source decorator + * @Default {black} + */ + borderColor?: string; + + /**Sets the border width of the decorator + * @Default {1} + */ + borderWidth?: number; + + /**Sets the fill color of the source decorator + * @Default {black} + */ + fillColor?: string; + + /**Sets the height of the source decorator + * @Default {8} + */ + height?: number; + + /**Defines the custom shape of the source decorator + */ + pathData?: string; + + /**Defines the shape of the source decorator. + * @Default {ej.datavisualization.Diagram.DecoratorShapes.Arrow} + */ + shape?: ej.datavisualization.Diagram.DecoratorShapes|string; + + /**Defines the width of the source decorator + * @Default {8} + */ + width?: number; +} + +export interface ConnectorsSourcePoint { + + /**Defines the x-coordinate of a position + * @Default {0} + */ + x?: number; + + /**Defines the y-coordinate of a position + * @Default {0} + */ + y?: number; +} + +export interface ConnectorsTargetDecorator { + + /**Sets the border color of the decorator + * @Default {black} + */ + borderColor?: string; + + /**Sets the color with which the decorator will be filled + * @Default {black} + */ + fillColor?: string; + + /**Defines the height of the target decorator + * @Default {8} + */ + height?: number; + + /**Defines the custom shape of the target decorator + */ + pathData?: string; + + /**Defines the shape of the target decorator. + * @Default {ej.datavisualization.Diagram.DecoratorShapes.Arrow} + */ + shape?: ej.datavisualization.Diagram.DecoratorShapes|string; + + /**Defines the width of the target decorator + * @Default {8} + */ + width?: number; +} + +export interface Connectors { + + /**To maintain additional information about connectors + * @Default {null} + */ + addInfo?: any; + + /**Defines the width of the line bridges + * @Default {10} + */ + bridgeSpace?: number; + + /**Enables or disables the behaviors of connectors. + * @Default {ej.datavisualization.Diagram.ConnectorConstraints.Default} + */ + constraints?: ej.datavisualization.Diagram.ConnectorConstraints|string; + + /**Defines the radius of the rounded corner + * @Default {0} + */ + cornerRadius?: number; + + /**Configures the styles of shapes + */ + cssClass?: string; + + /**Sets the horizontal alignment of the connector. Applicable, if the parent of the connector is a container. + * @Default {ej.datavisualization.Diagram.HorizontalAlignment.Left} + */ + horizontalAlign?: ej.datavisualization.Diagram.HorizontalAlignment|string; + + /**A collection of JSON objects where each object represents a label. For label properties, refer Labels + * @Default {[]} + */ + labels?: Array; + + /**Sets the stroke color of the connector + * @Default {black} + */ + lineColor?: string; + + /**Sets the pattern of dashes and gaps used to stroke the path of the connector + */ + lineDashArray?: string; + + /**Defines the padding value to ease the interaction with connectors + * @Default {10} + */ + lineHitPadding?: number; + + /**Sets the width of the line + * @Default {1} + */ + lineWidth?: number; + + /**Defines the minimum space to be left between the bottom of parent bounds and the connector. Applicable, if the parent is a container. + * @Default {0} + */ + marginBottom?: number; + + /**Defines the minimum space to be left between the left of parent bounds and the connector. Applicable, if the parent is a container. + * @Default {0} + */ + marginLeft?: number; + + /**Defines the minimum space to be left between the right of parent bounds and the connector. Applicable, if the parent is a container. + * @Default {0} + */ + marginRight?: number; + + /**Defines the minimum space to be left between the top of parent bounds and the connector. Applicable, if the parent is a container. + * @Default {0} + */ + marginTop?: number; + + /**Sets a unique name for the connector + */ + name?: string; + + /**Defines the transparency of the connector + * @Default {1} + */ + opacity?: number; + + /**Defines the size and preview size of the node to add that to symbol palette. To explore palette item, refer Palette Item + * @Default {null} + */ + paletteItem?: any; + + /**Sets the parent name of the connector. + */ + parent?: string; + + /**An array of JSON objects where each object represents a segment + * @Default {[ { type:straight } ]} + */ + segments?: Array; + + /**Defines the source decorator of the connector + * @Default {{ shape:arrow, width: 8, height:8, borderColor:black, fillColor:black }} + */ + sourceDecorator?: ConnectorsSourceDecorator; + + /**Sets the source node of the connector + */ + sourceNode?: string; + + /**Defines the space to be left between the source node and the source point of a connector + * @Default {0} + */ + sourcePadding?: number; + + /**Describes the start point of the connector + * @Default {ej.datavisualization.Diagram.Point()} + */ + sourcePoint?: ConnectorsSourcePoint; + + /**Sets the source port of the connector + */ + sourcePort?: string; + + /**Defines the target decorator of the connector + * @Default {{ shape:arrow, width: 8, height:8, borderColor:black, fillColor:black }} + */ + targetDecorator?: ConnectorsTargetDecorator; + + /**Sets the target node of the connector + */ + targetNode?: string; + + /**Defines the space to be left between the target node and the target point of the connector + * @Default {0} + */ + targetPadding?: number; + + /**Describes the end point of the connector + * @Default {ej.datavisualization.Diagram.Point()} + */ + targetPoint?: ej.datavisualization.Diagram.ConnectorsSourcePoint|string; + + /**Sets the targetPort of the connector + */ + targetPort?: string; + + /**Defines the tooltip that should be shown when the mouse hovers over connector. For tooltip properties, refer Tooltip + * @Default {null} + */ + tooltip?: any; + + /**To set the vertical alignment of connector (Applicable,if the parent is group). + * @Default {ej.datavisualization.Diagram.VerticalAlignment.Top} + */ + verticalAlign?: ej.datavisualization.Diagram.VerticalAlignment|string; + + /**Enables or disables the visibility of connector + * @Default {true} + */ + visible?: boolean; + + /**Sets the z-index of the connector + * @Default {0} + */ + zOrder?: number; +} + +export interface ContextMenu { + + /**Defines the collection of context menu items + * @Default {[]} + */ + items?: Array; + + /**To set whether to display the default context menu items or not + * @Default {false} + */ + showCustomMenuItemsOnly?: boolean; +} + +export interface DataSourceSettings { + + /**Defines the data source either as a collection of objects or as an instance of ej.DataManager + * @Default {null} + */ + dataSource?: any; + + /**Sets the unique id of the data source items + */ + id?: string; + + /**Defines the parent id of the data source item + * @Default {''} + */ + parent?: string; + + /**Describes query to retrieve a set of data from the specified datasource + * @Default {null} + */ + query?: string; + + /**Sets the unique id of the root data source item + */ + root?: string; + + /**Describes the name of the table on which the specified query has to be executed + * @Default {null} + */ + tableName?: string; +} + +export interface DefaultSettings { + + /**Initializes the default connector properties + * @Default {null} + */ + connector?: any; + + /**Initializes the default properties of groups + * @Default {null} + */ + group?: any; + + /**Initializes the default properties for nodes + * @Default {null} + */ + node?: any; +} + +export interface HistoryManager { + + /**A method that takes a history entry as argument and returns whether the specific entry can be popped or not + */ + canPop?: Function; + + /**A method that ends grouping the changes + */ + closeGroupAction?: Function; + + /**A method that removes the history of a recent change made in diagram + */ + pop?: Function; + + /**A method that allows to track the custom changes made in diagram + */ + push?: Function; + + /**Defines what should be happened while trying to restore a custom change + * @Default {null} + */ + redo?: Function; + + /**A method that starts to group the changes to revert/restore them in a single undo or redo + */ + startGroupAction?: Function; + + /**Defines what should be happened while trying to revert a custom change + */ + undo?: Function; +} + +export interface Layout { + + /**Defines the fixed node with reference to which, the layout will be arranged and fixed node will not be repositioned + */ + fixedNode?: string; + + /**Customizes the orientation of trees/sub trees. For orientations, see Chart Orientations. For chart types, see Chart Types + * @Default {null} + */ + getLayoutInfo?: any; + + /**Sets the space to be horizontally left between nodes + * @Default {30} + */ + horizontalSpacing?: number; + + /**Sets the margin value to be horizontally left between the layout and diagram + * @Default {0} + */ + marginX?: number; + + /**Sets the margin value to be vertically left between layout and diagram + * @Default {0} + */ + marginY?: number; + + /**Sets the orientation/direction to arrange the diagram elements. + * @Default {ej.datavisualization.Diagram.LayoutOrientations.TopToBottom} + */ + orientation?: ej.datavisualization.Diagram.LayoutOrientations|string; + + /**Sets the type of the layout based on which the elements will be arranged. + * @Default {ej.datavisualization.Diagram.LayoutTypes.None} + */ + type?: ej.datavisualization.Diagram.LayoutTypes|string; + + /**Sets the space to be vertically left between nodes + * @Default {30} + */ + verticalSpacing?: number; +} + +export interface NodesContainer { + + /**Defines the orientation of the container. Applicable, if the group is a container. + * @Default {vertical} + */ + orientation?: string; + + /**Sets the type of the container. Applicable if the group is a container. + * @Default {ej.datavisualization.Diagram.ContainerType.Canvas} + */ + type?: ej.datavisualization.Diagram.ContainerType|string; +} + +export interface NodesGradientLinearGradient { + + /**Defines the different colors and the region of color transitions + * @Default {[]} + */ + stops?: Array; + + /**Defines the left most position(relative to node) of the rectangular region that needs to be painted + * @Default {0} + */ + x1?: number; + + /**Defines the right most position(relative to node) of the rectangular region that needs to be painted + * @Default {0} + */ + x2?: number; + + /**Defines the top most position(relative to node) of the rectangular region that needs to be painted + * @Default {0} + */ + y1?: number; + + /**Defines the bottom most position(relative to node) of the rectangular region that needs to be painted + * @Default {0} + */ + y2?: number; +} + +export interface NodesGradientRadialGradient { + + /**Defines the position of the outermost circle + * @Default {0} + */ + cx?: number; + + /**Defines the outer most circle of the radial gradient + * @Default {0} + */ + cy?: number; + + /**Defines the innermost circle of the radial gradient + * @Default {0} + */ + fx?: number; + + /**Defines the innermost circle of the radial gradient + * @Default {0} + */ + fy?: number; + + /**Defines the different colors and the region of color transitions. + * @Default {[]} + */ + stops?: Array; +} + +export interface NodesGradientStop { + + /**Sets the color to be filled over the specified region + */ + color?: string; + + /**Sets the position where the previous color transition ends and a new color transition starts + * @Default {0} + */ + offset?: number; + + /**Describes the transparency level of the region + * @Default {1} + */ + opacity?: number; +} + +export interface NodesGradient { + + /**Paints the node with linear color transitions + */ + LinearGradient?: NodesGradientLinearGradient; + + /**Paints the node with radial color transitions. A focal point defines the beginning of the gradient, and a circle defines the end point of the gradient. + */ + RadialGradient?: NodesGradientRadialGradient; + + /**Defines the color and a position where the previous color transition ends and a new color transition starts + */ + Stop?: NodesGradientStop; +} + +export interface NodesLabels { + + /**Enables/disables the bold style + * @Default {false} + */ + bold?: boolean; + + /**Sets the border color of the label + * @Default {transparent} + */ + borderColor?: string; + + /**Sets the border width of the label + * @Default {0} + */ + borderWidth?: number; + + /**Sets the fill color of the text area + * @Default {transparent} + */ + fillColor?: string; + + /**Sets the font color of the text + * @Default {black} + */ + fontColor?: string; + + /**Sets the font family of the text + * @Default {Arial} + */ + fontFamily?: string; + + /**Defines the font size of the text + * @Default {12} + */ + fontSize?: number; + + /**Sets the horizontal alignment of the label. + * @Default {ej.datavisualization.Diagram.HorizontalAlignment.Center} + */ + horizontalAlignment?: ej.datavisualization.Diagram.HorizontalAlignment|string; + + /**Enables/disables the italic style + * @Default {false} + */ + italic?: boolean; + + /**To set the margin of the label + * @Default {ej.datavisualization.Diagram.Margin()} + */ + margin?: any; + + /**Gets whether the label is currently being edited or not. + * @Default {ej.datavisualization.Diagram.LabelEditMode.Edit} + */ + mode?: ej.datavisualization.Diagram.LabelEditMode|string; + + /**Sets the unique identifier of the label + */ + name?: string; + + /**Sets the fraction/ratio(relative to node) that defines the position of the label + * @Default {ej.datavisualization.Diagram.Point(0.5, 0.5)} + */ + offset?: any; + + /**Defines whether the label is editable or not + * @Default {false} + */ + readOnly?: boolean; + + /**Defines the angle to which the label needs to be rotated + * @Default {0} + */ + rotateAngle?: number; + + /**Defines the label text + */ + text?: string; + + /**Defines how to align the text inside the label. + * @Default {ej.datavisualization.Diagram.TextAlign.Center} + */ + textAlign?: ej.datavisualization.Diagram.TextAlign|string; + + /**Sets how to decorate the label text. + * @Default {ej.datavisualization.Diagram.TextDecorations.None} + */ + textDecoration?: ej.datavisualization.Diagram.TextDecorations|string; + + /**Sets the vertical alignment of the label. + * @Default {ej.datavisualization.Diagram.VerticalAlignment.Center} + */ + verticalAlignment?: ej.datavisualization.Diagram.VerticalAlignment|string; + + /**Enables or disables the visibility of the label + * @Default {true} + */ + visible?: boolean; + + /**Sets the width of the label(the maximum value of label width and the node width will be considered as label width) + * @Default {50} + */ + width?: number; + + /**Defines how the label text needs to be wrapped. + * @Default {ej.datavisualization.Diagram.TextWrapping.WrapWithOverflow} + */ + wrapping?: ej.datavisualization.Diagram.TextWrapping|string; +} + +export interface NodesLanes { + + /**Allows to maintain additional information about lane + * @Default {{}} + */ + addInfo?: any; + + /**An array of objects where each object represents a child node of the lane + * @Default {[]} + */ + children?: Array; + + /**Defines the fill color of the lane + * @Default {white} + */ + fillColor?: string; + + /**Defines the header of the lane + * @Default {{ text: Function, fontSize: 11 }} + */ + header?: any; + + /**Defines the object as a lane + * @Default {false} + */ + isLane?: boolean; + + /**Sets the unique identifier of the lane + */ + name?: string; + + /**Sets the orientation of the lane. + * @Default {vertical} + */ + orientation?: string; +} + +export interface NodesPaletteItem { + + /**Defines whether the symbol should be drawn at its actual size regardless of precedence factors or not + * @Default {true} + */ + enableScale?: boolean; + + /**Defines the height of the symbol + * @Default {0} + */ + height?: number; + + /**Defines the margin of the symbol item + * @Default {{ left: 4, right: 4, top: 4, bottom: 4 }} + */ + margin?: any; + + /**Defines the preview height of the symbol + * @Default {undefined} + */ + previewHeight?: number; + + /**Defines the preview width of the symbol + * @Default {undefined} + */ + previewWidth?: number; + + /**Defines the width of the symbol + * @Default {0} + */ + width?: number; +} + +export interface NodesPhases { + + /**Defines the header of the smaller regions + * @Default {null} + */ + label?: any; + + /**Defines the line color of the splitter that splits adjacent phases. + * @Default {#606060} + */ + lineColor?: string; + + /**Sets the dash array that used to stroke the phase splitter + * @Default {3,3} + */ + lineDashArray?: string; + + /**Sets the lineWidth of the phase + * @Default {1} + */ + lineWidth?: number; + + /**Sets the unique identifier of the phase + */ + name?: string; + + /**Sets the length of the smaller region(phase) of a swimlane + * @Default {100} + */ + offset?: number; + + /**Sets the orientation of the phase + * @Default {horizontal} + */ + orientation?: string; + + /**Sets the type of the object as phase + * @Default {phase} + */ + type?: string; +} + +export interface NodesPorts { + + /**Sets the border color of the port + * @Default {#1a1a1a} + */ + borderColor?: string; + + /**Sets the stroke width of the port + * @Default {1} + */ + borderWidth?: number; + + /**Defines the space to be left between the port bounds and its incoming and outgoing connections. + * @Default {0} + */ + connectorPadding?: number; + + /**Defines whether connections can be created with the port + * @Default {ej.datavisualization.Diagram.PortConstraints.Connect} + */ + constraints?: ej.datavisualization.Diagram.PortConstraints|string; + + /**Sets the fill color of the port + * @Default {white} + */ + fillColor?: string; + + /**Sets the unique identifier of the port + */ + name?: string; + + /**Defines the position of the port as fraction/ ratio relative to node + * @Default {ej.datavisualization.Diagram.Point(0, 0)} + */ + offset?: any; + + /**Defines the path data to draw the port. Applicable, if the port shape is path. + */ + pathData?: string; + + /**Defines the shape of the port. + * @Default {ej.datavisualization.Diagram.PortShapes.Square} + */ + shape?: ej.datavisualization.Diagram.PortShapes|string; + + /**Defines the size of the port + * @Default {8} + */ + size?: number; + + /**Defines when the port should be visible. + * @Default {ej.datavisualization.Diagram.PortVisibility.Default} + */ + visibility?: ej.datavisualization.Diagram.PortVisibility|string; +} + +export interface NodesShadow { + + /**Defines the angle of the shadow relative to node + * @Default {45} + */ + angle?: number; + + /**Sets the distance to move the shadow relative to node + * @Default {5} + */ + distance?: number; + + /**Defines the opaque of the shadow + * @Default {0.7} + */ + opacity?: number; +} + +export interface NodesSubProcess { + + /**Defines whether the bpmn sub process is without any prescribed order or not + * @Default {false} + */ + adhoc?: boolean; + + /**Sets the boundary of the BPMN process + * @Default {ej.datavisualization.Diagram.BPMNBoundary.Default} + */ + boundary?: ej.datavisualization.Diagram.BPMNBoundary|string; + + /**Sets whether the bpmn subprocess is triggered as a compensation of a specific activity + * @Default {false} + */ + compensation?: boolean; + + /**Defines the loop type of a sub process. + * @Default {ej.datavisualization.Diagram.BPMNLoops.None} + */ + loop?: ej.datavisualization.Diagram.BPMNLoops|string; +} + +export interface NodesTask { + + /**To set whether the task is a global task or not + * @Default {false} + */ + call?: boolean; + + /**Sets whether the task is triggered as a compensation of another specific activity + * @Default {false} + */ + compensation?: boolean; + + /**Sets the loop type of a bpmn task. + * @Default {ej.datavisualization.Diagram.BPMNLoops.None} + */ + loop?: ej.datavisualization.Diagram.BPMNLoops|string; + + /**Sets the type of the BPMN task. + * @Default {ej.datavisualization.Diagram.BPMNTasks.None} + */ + type?: ej.datavisualization.Diagram.BPMNTasks|string; +} + +export interface Nodes { + + /**Defines the type of BPMN Activity. Applicable, if the node is a bpmn activity. + * @Default {ej.datavisualization.Diagram.BPMNActivity.Task} + */ + activity?: ej.datavisualization.Diagram.BPMNActivity|string; + + /**To maintain additional information about nodes + * @Default {{}} + */ + addInfo?: any; + + /**Sets the border color of node + * @Default {black} + */ + borderColor?: string; + + /**Sets the pattern of dashes and gaps to stroke the border + */ + borderDashArray?: string; + + /**Sets the border width of the node + * @Default {1} + */ + borderWidth?: number; + + /**Defines whether the group can be ungrouped or not + * @Default {true} + */ + canUngroup?: boolean; + + /**Array of JSON objects where each object represents a child node/connector + * @Default {[]} + */ + children?: Array; + + /**Defines whether the BPMN data object is a collection or not + * @Default {false} + */ + collection?: boolean; + + /**Defines the distance to be left between a node and its connections(In coming and out going connections). + * @Default {0} + */ + connectorPadding?: number; + + /**Enables or disables the default behaviors of the node. + * @Default {ej.datavisualization.Diagram.NodeConstraints.Default} + */ + constraints?: ej.datavisualization.Diagram.NodeConstraints|string; + + /**Defines how the child objects need to be arranged(Either in any predefined manner or automatically). Applicable, if the node is a group. + * @Default {null} + */ + container?: NodesContainer; + + /**Defines the corner radius of rectangular shapes. + * @Default {0} + */ + cornerRadius?: number; + + /**Configures the styles of shapes + */ + cssClass?: string; + + /**Sets the type of the BPMN Events. Applicable, if the node is a bpmn event. + * @Default {ej.datavisualization.Diagram.BPMNEvents.Start} + */ + event?: ej.datavisualization.Diagram.BPMNEvents|string; + + /**Defines whether the node can be automatically arranged using layout or not + * @Default {false} + */ + excludeFromLayout?: boolean; + + /**Defines the fill color of the node + * @Default {white} + */ + fillColor?: string; + + /**Sets the type of the BPMN Gateway. Applicable, if the node is a bpmn gateway. + * @Default {ej.datavisualization.Diagram.BPMNGateways.None} + */ + gateway?: ej.datavisualization.Diagram.BPMNGateways|string; + + /**Paints the node with a smooth transition from one color to another color + */ + gradient?: NodesGradient; + + /**Defines the header of a swimlane/lane + * @Default {{ text: Title, fontSize: 11 }} + */ + header?: any; + + /**Defines the height of the node + * @Default {0} + */ + height?: number; + + /**Sets the horizontal alignment of the node. Applicable, if the parent of the node is a container. + * @Default {ej.datavisualization.Diagram.HorizontalAlignment.Left} + */ + horizontalAlign?: ej.datavisualization.Diagram.HorizontalAlignment|string; + + /**A read only collection of the incoming connectors/edges of the node + * @Default {[]} + */ + inEdges?: Array; + + /**Defines whether the sub tree of the node is expanded or collapsed + * @Default {true} + */ + isExpanded?: boolean; + + /**Sets the node as a swimlane + * @Default {false} + */ + isSwimlane?: boolean; + + /**A collection of objects where each object represents a label + * @Default {[]} + */ + labels?: Array; + + /**An array of objects where each object represents a lane. Applicable, if the node is a swimlane. + * @Default {[]} + */ + lanes?: Array; + + /**Defines the minimum space to be left between the bottom of parent bounds and the node. Applicable, if the parent is a container. + * @Default {0} + */ + marginBottom?: number; + + /**Defines the minimum space to be left between the left of parent bounds and the node. Applicable, if the parent is a container. + * @Default {0} + */ + marginLeft?: number; + + /**Defines the minimum space to be left between the right of the parent bounds and the node. Applicable, if the parent is a container. + * @Default {0} + */ + marginRight?: number; + + /**Defines the minimum space to be left between the top of parent bounds and the node. Applicable, if the parent is a container. + * @Default {0} + */ + marginTop?: number; + + /**Defines the maximum height limit of the node + * @Default {0} + */ + maxHeight?: number; + + /**Defines the maximum width limit of the node + * @Default {0} + */ + maxWidth?: number; + + /**Defines the minimum height limit of the node + * @Default {0} + */ + minHeight?: number; + + /**Defines the minimum width limit of the node + * @Default {0} + */ + minWidth?: number; + + /**Sets the unique identifier of the node + */ + name?: string; + + /**Defines the position of the node on X-Axis + * @Default {0} + */ + offsetX?: number; + + /**Defines the position of the node on Y-Axis + * @Default {0} + */ + offsetY?: number; + + /**Defines the opaque of the node + * @Default {1} + */ + opacity?: number; + + /**Defines the orientation of nodes. Applicable, if the node is a swimlane. + * @Default {vertical} + */ + orientation?: string; + + /**A read only collection of outgoing connectors/edges of the node + * @Default {[]} + */ + outEdges?: Array; + + /**Defines the minimum padding value to be left between the bottom most position of a group and its children. Applicable, if the group is a container. + * @Default {0} + */ + paddingBottom?: number; + + /**Defines the minimum padding value to be left between the left most position of a group and its children. Applicable, if the group is a container. + * @Default {0} + */ + paddingLeft?: number; + + /**Defines the minimum padding value to be left between the right most position of a group and its children. Applicable, if the group is a container. + * @Default {0} + */ + paddingRight?: number; + + /**Defines the minimum padding value to be left between the top most position of a group and its children. Applicable, if the group is a container. + * @Default {0} + */ + paddingTop?: number; + + /**Defines the size and preview size of the node to add that to symbol palette + * @Default {null} + */ + paletteItem?: NodesPaletteItem; + + /**Sets the name of the parent group + */ + parent?: string; + + /**Sets the path geometry that defines the shape of a path node + */ + pathData?: string; + + /**An array of objects, where each object represents a smaller region(phase) of a swimlane. + * @Default {[]} + */ + phases?: Array; + + /**Sets the height of the phase headers + * @Default {0} + */ + phaseSize?: number; + + /**Sets the ratio/ fractional value relative to node, based on which the node will be transformed(positioning, scaling and rotation) + * @Default {ej.datavisualization.Diagram.Points(0.5,0.5)} + */ + pivot?: any; + + /**Defines a collection of points to draw a polygon. Applicable, if the shape is a polygon. + * @Default {[]} + */ + points?: Array; + + /**An array of objects where each object represents a port + * @Default {[]} + */ + ports?: Array; + + /**Sets the angle to which the node should be rotated + * @Default {0} + */ + rotateAngle?: number; + + /**Defines the opacity and the position of shadow + * @Default {ej.datavisualization.Diagram.Shadow()} + */ + shadow?: NodesShadow; + + /**Sets the shape of the node. It depends upon the type of node. + * @Default {ej.datavisualization.Diagram.BasicShapes.Rectangle} + */ + shape?: ej.datavisualization.Diagram.BasicShapes|string; + + /**Sets the source path of the image. Applicable, if the type of the node is image. + */ + source?: string; + + /**Defines the sub process of a BPMN Activity. Applicable, if the type of the bpmn activity is sub process. + * @Default {ej.datavisualization.Diagram.BPMNSubProcess()} + */ + subProcess?: NodesSubProcess; + + /**Defines the task of the bpmn activity. Applicable, if the type of activity is set as task. + * @Default {ej.datavisualization.Diagram.BPMNTask()} + */ + task?: NodesTask; + + /**Sets the id of svg/html templates. Applicable, if the node is html or native. + */ + templateId?: string; + + /**Defines the textBlock of a text node + * @Default {null} + */ + textBlock?: any; + + /**Defines the tooltip that should be shown when the mouse hovers over node. For tooltip properties, refer Tooltip + * @Default {null} + */ + tooltip?: any; + + /**Sets the type of BPMN Event Triggers. + * @Default {ej.datavisualization.Diagram.BPMNTriggers.None} + */ + trigger?: ej.datavisualization.Diagram.BPMNTriggers|string; + + /**Defines the type of the node. + * @Default {ej.datavisualization.Diagram.Shapes.Basic} + */ + type?: ej.datavisualization.Diagram.Shapes|string; + + /**Sets the vertical alignment of a node. Applicable, if the parent of a node is a container. + * @Default {ej.datavisualization.Diagram.VerticalAlignment.Top} + */ + verticalAlign?: ej.datavisualization.Diagram.VerticalAlignment|string; + + /**Defines the visibility of the node + * @Default {true} + */ + visible?: boolean; + + /**Defines the width of the node + * @Default {0} + */ + width?: number; + + /**Defines the z-index of the node + * @Default {0} + */ + zOrder?: number; +} + +export interface PageSettings { + + /**Defines the maximum distance to be left between the object and the scroll bar to trigger auto scrolling + * @Default {{ left: 15, top: 15, right: 15, bottom: 15 }} + */ + autoScrollBorder?: any; + + /**Sets whether multiple pages can be created to fit all nodes and connectors + * @Default {false} + */ + multiplePage?: boolean; + + /**Defines the background color of diagram pages + * @Default {#ffffff} + */ + pageBackgroundColor?: string; + + /**Defines the page border color + * @Default {#565656} + */ + pageBorderColor?: string; + + /**Sets the border width of diagram pages + * @Default {0} + */ + pageBorderWidth?: number; + + /**Defines the height of a page + * @Default {null} + */ + pageHeight?: number; + + /**Defines the page margin + * @Default {24} + */ + pageMargin?: number; + + /**Sets the orientation of the page. + * @Default {ej.datavisualization.Diagram.PageOrientations.Portrait} + */ + pageOrientation?: ej.datavisualization.Diagram.PageOrientations|string; + + /**Defines the height of a diagram page + * @Default {null} + */ + pageWidth?: number; + + /**Defines the scrollable area of diagram. Applicable, if the scroll limit is "limited". + * @Default {null} + */ + scrollableArea?: any; + + /**Defines the scrollable region of diagram. + * @Default {ej.datavisualization.Diagram.ScrollLimit.Infinite} + */ + scrollLimit?: ej.datavisualization.Diagram.ScrollLimit|string; + + /**Enables or disables the page breaks + * @Default {false} + */ + showPageBreak?: boolean; +} + +export interface ScrollSettings { + + /**Allows to read the zoom value of diagram + * @Default {0} + */ + currentZoom?: number; + + /**Sets the horizontal scroll offset + * @Default {0} + */ + horizontalOffset?: number; + + /**Allows to extend the scrollable region that is based on the scroll limit + * @Default {{left: 0, right: 0, top:0, bottom: 0}} + */ + padding?: any; + + /**Sets the vertical scroll offset + * @Default {0} + */ + verticalOffset?: number; + + /**Allows to read the view port height of the diagram + * @Default {0} + */ + viewPortHeight?: number; + + /**Allows to read the view port width of the diagram + * @Default {0} + */ + viewPortWidth?: number; +} + +export interface SelectedItems { + + /**A read only collection of the selected items + * @Default {[]} + */ + children?: Array; + + /**Controls the visibility of selector. + * @Default {ej.datavisualization.Diagram.SelectorConstraints.All} + */ + constraints?: ej.datavisualization.Diagram.SelectorConstraints|string; + + /**Defines a method that dynamically enables/ disables the interaction with multiple selection. + * @Default {null} + */ + getConstraints?: any; + + /**Sets the height of the selected items + * @Default {0} + */ + height?: number; + + /**Sets the x position of the selector + * @Default {0} + */ + offsetX?: number; + + /**Sets the y position of the selector + * @Default {0} + */ + offsetY?: number; + + /**Sets the angle to rotate the selected items + * @Default {0} + */ + rotateAngle?: number; + + /**Sets the angle to rotate the selected items. For tooltip properties, refer Tooltip + * @Default {ej.datavisualization.Diagram.Tooltip()} + */ + tooltip?: any; + + /**A collection of frequently using commands that have to be added around the selector. + * @Default {[]} + */ + userHandles?: Array; + + /**Sets the width of the selected items + * @Default {0} + */ + width?: number; +} + +export interface SnapSettingsHorizontalGridLines { + + /**Defines the line color of horizontal grid lines + * @Default {lightgray} + */ + lineColor?: string; + + /**Specifies the pattern of dashes and gaps used to stroke horizontal grid lines + */ + lineDashArray?: string; + + /**A pattern of lines and gaps that defines a set of horizontal gridlines + * @Default {[1.25, 18.75, 0.25, 19.75, 0.25, 19.75, 0.25, 19.75, 0.25, 19.75]} + */ + linesInterval?: Array; + + /**Specifies a set of intervals to snap the objects + * @Default {[20]} + */ + snapInterval?: Array; +} + +export interface SnapSettingsVerticalGridLines { + + /**Defines the line color of horizontal grid lines + * @Default {lightgray} + */ + lineColor?: string; + + /**Specifies the pattern of dashes and gaps used to stroke horizontal grid lines + */ + lineDashArray?: string; + + /**A pattern of lines and gaps that defines a set of horizontal gridlines + * @Default {[1.25, 18.75, 0.25, 19.75, 0.25, 19.75, 0.25, 19.75, 0.25, 19.75]} + */ + linesInterval?: Array; + + /**Specifies a set of intervals to snap the objects + * @Default {[20]} + */ + snapInterval?: Array; +} + +export interface SnapSettings { + + /**Enables or disables snapping nodes/connectors to objects + * @Default {true} + */ + enableSnapToObject?: boolean; + + /**Defines the appearance of horizontal gridlines + */ + horizontalGridLines?: SnapSettingsHorizontalGridLines; + + /**Defines the angle by which the object needs to be snapped + * @Default {5} + */ + snapAngle?: number; + + /**Defines the minimum distance between the selected object and the nearest object + * @Default {5} + */ + snapObjectDistance?: number; + + /**Defines the appearance of horizontal gridlines + */ + verticalGridLines?: SnapSettingsVerticalGridLines; +} + +export interface TooltipAlignment { + + /**Defines the horizontal alignment of tooltip. + * @Default {ej.datavisualization.Diagram.HorizontalAlignment.Center} + */ + horizontal?: ej.datavisualization.Diagram.HorizontalAlignment|string; + + /**Defines the vertical alignment of tooltip. + * @Default {ej.datavisualization.Diagram.VerticalAlignment.Bottom} + */ + vertical?: ej.datavisualization.Diagram.VerticalAlignment|string; +} + +export interface Tooltip { + + /**Aligns the tooltip around nodes/connectors + */ + alignment?: TooltipAlignment; + + /**Sets the margin of the tooltip + * @Default {{ left: 5, right: 5, top: 5, bottom: 5 }} + */ + margin?: any; + + /**Defines whether the tooltip should be shown at the mouse position or around node. + * @Default {ej.datavisualization.Diagram.RelativeMode.Object} + */ + relativeMode?: ej.datavisualization.Diagram.RelativeMode|string; + + /**Sets the svg/html template to be bound with tooltip + */ + templateId?: string; +} +} +module Diagram +{ +enum BridgeDirection +{ +//Used to set the direction of line bridges as left +Left, +//Used to set the direction of line bridges as right +Right, +//Used to set the direction of line bridges as top +Top, +//Used to set the direction of line bridges as bottom +Bottom, +} +} +module Diagram +{ +enum Keys +{ +//No key pressed. +None, +//The A key. +A, +//The B key. +B, +//The C key. +C, +//The D Key. +D, +//The E key. +E, +//The F key. +F, +//The G key. +G, +//The H Key. +H, +//The I key. +I, +//The J key. +J, +//The K key. +K, +//The L Key. +L, +//The M key. +M, +//The N key. +N, +//The O key. +O, +//The P Key. +P, +//The Q key. +Q, +//The R key. +R, +//The S key. +S, +//The T Key. +T, +//The U key. +U, +//The V key. +V, +//The W key. +W, +//The X key. +X, +//The Y key. +Y, +//The Z key. +Z, +//The 0 key. +Number0, +//The 1 key. +Number1, +//The 2 key. +Number2, +//The 3 key. +Number3, +//The 4 key. +Number4, +//The 5 key. +Number5, +//The 6 key. +Number6, +//The 7 key. +Number7, +//The 8 key. +Number8, +//The 9 key. +Number9, +//The LEFT ARROW key. +Left, +//The UP ARROW key. +Up, +//The RIGHT ARROW key. +Right, +//The DOWN ARROW key. +Down, +//The ESC key. +Escape, +//The DEL key. +Delete, +//The TAB key. +Tab, +//The ENTER key. +Enter, +} +} +module Diagram +{ +enum KeyModifiers +{ +//No modifiers are pressed. +None, +//The ALT key. +Alt, +//The CTRL key. +Control, +//The SHIFT key. +Shift, +} +} +module Diagram +{ +enum ConnectorConstraints +{ +//Disable all connector Constraints +None, +//Enables connector to be selected +Select, +//Enables connector to be Deleted +Delete, +//Enables connector to be Dragged +Drag, +//Enables connectors source end to be selected +DragSourceEnd, +//Enables connectors target end to be selected +DragTargetEnd, +//Enables control point and end point of every segment in a connector for editing +DragSegmentThumb, +//Enables bridging to the connector +Bridging, +//Enables label of node to be Dragged +DragLabel, +//Enables bridging to the connector +InheritBridging, +//Enables all constraints +Default, +} +} +module Diagram +{ +enum HorizontalAlignment +{ +//Used to align text horizontally on left side of node/connector +Left, +//Used to align text horizontally on center of node/connector +Center, +//Used to align text horizontally on right side of node/connector +Right, +} +} +module Diagram +{ +enum Segments +{ +//Used to specify the lines as Straight +Straight, +//Used to specify the lines as Orthogonal +Orthogonal, +//Used to specify the lines as Bezier +Bezier, +} +} +module Diagram +{ +enum DecoratorShapes +{ +//Used to set decorator shape as none +None, +//Used to set decorator shape as Arrow +Arrow, +//Used to set decorator shape as Open Arrow +OpenArrow, +//Used to set decorator shape as Circle +Circle, +//Used to set decorator shape as Diamond +Diamond, +//Used to set decorator shape as path +Path, +} +} +module Diagram +{ +enum VerticalAlignment +{ +//Used to align text Vertically on left side of node/connector +Top, +//Used to align text Vertically on center of node/connector +Center, +//Used to align text Vertically on bottom of node/connector +Bottom, +} +} +module Diagram +{ +enum DiagramConstraints +{ +//Disables all DiagramConstraints +None, +//Enables/Disables PageEditing +PageEditable, +//Enables/Disables Bridging +Bridging, +//Enables/Disables Zooming +Zoomable, +//Enables/Disables panning on horizontal axis +PannableX, +//Enables/Disables panning on vertical axis +PannableY, +//Enables/Disables Panning +Pannable, +//Enables/Disables undo actions +Undoable, +//Enables all Constraints +Default, +} +} +module Diagram +{ +enum LayoutOrientations +{ +//Used to set LayoutOrientation from top to bottom +TopToBottom, +//Used to set LayoutOrientation from bottom to top +BottomToTop, +//Used to set LayoutOrientation from left to right +LeftToRight, +//Used to set LayoutOrientation from right to left +RightToLeft, +} +} +module Diagram +{ +enum LayoutTypes +{ +//Used not to set any specific layout +None, +//Used to set layout type as hierarchical layout +HierarchicalTree, +//Used to set layout type as organnizational chart +OrganizationalChart, +} +} +module Diagram +{ +enum BPMNActivity +{ +//Used to set BPMN Activity as None +None, +//Used to set BPMN Activity as Task +Task, +//Used to set BPMN Activity as SubProcess +SubProcess, +} +} +module Diagram +{ +enum NodeConstraints +{ +//Disable all node Constraints +None, +//Enables node to be selected +Select, +//Enables node to be Deleted +Delete, +//Enables node to be Dragged +Drag, +//Enables node to be Rotated +Rotate, +//Enables node to be connected +Connect, +//Enables node to be resize north east +ResizeNorthEast, +//Enables node to be resize east +ResizeEast, +//Enables node to be resize south east +ResizeSouthEast, +//Enables node to be resize south +ResizeSouth, +//Enables node to be resize south west +ResizeSouthWest, +//Enables node to be resize west +ResizeWest, +//Enables node to be resize north west +ResizeNorthWest, +//Enables node to be resize north +ResizeNorth, +//Enables node to be Resized +Resize, +//Enables shadow +Shadow, +//Enables label of node to be Dragged +DragLabel, +//Enables panning should be done while node dragging +AllowPan, +//Enables Proportional resize for node +AspectRatio, +//Enables all node constraints +Default, +} +} +module Diagram +{ +enum ContainerType +{ +//Sets the container type as Canvas +Canvas, +//Sets the container type as Stack +Stack, +} +} +module Diagram +{ +enum BPMNEvents +{ +//Used to set BPMN Event as Start +Start, +//Used to set BPMN Event as Intermediate +Intermediate, +//Used to set BPMN Event as End +End, +//Used to set BPMN Event as NonInterruptingStart +NonInterruptingStart, +//Used to set BPMN Event as NonInterruptingIntermediate +NonInterruptingIntermediate, +} +} +module Diagram +{ +enum BPMNGateways +{ +//Used to set BPMN Gateway as None +None, +//Used to set BPMN Gateway as Exclusive +Exclusive, +//Used to set BPMN Gateway as Inclusive +Inclusive, +//Used to set BPMN Gateway as Parallel +Parallel, +//Used to set BPMN Gateway as Complex +Complex, +//Used to set BPMN Gateway as EventBased +EventBased, +} +} +module Diagram +{ +enum LabelEditMode +{ +//Used to set label edit mode as edit +Edit, +//Used to set label edit mode as view +View, +} +} +module Diagram +{ +enum TextAlign +{ +//Used to align text on left side of node/connector +Left, +//Used to align text on center of node/connector +Center, +//Used to align text on Right side of node/connector +Right, +} +} +module Diagram +{ +enum TextDecorations +{ +//Used to set text decoration of the label as Underline +Underline, +//Used to set text decoration of the label as Overline +Overline, +//Used to set text decoration of the label as LineThrough +LineThrough, +//Used to set text decoration of the label as None +None, +} +} +module Diagram +{ +enum TextWrapping +{ +//Disables wrapping +NoWrap, +//Enables Line-break at normal word break points +Wrap, +//Enables Line-break at normal word break points with longer word overflows +WrapWithOverflow, +} +} +module Diagram +{ +enum PortConstraints +{ +//Disable all constraints +None, +//Enables connections with connector +Connect, +} +} +module Diagram +{ +enum PortShapes +{ +//Used to set port shape as X +X, +//Used to set port shape as Circle +Circle, +//Used to set port shape as Square +Square, +//Used to set port shape as Path +Path, +} +} +module Diagram +{ +enum PortVisibility +{ +//Set the port visibility as Visible +Visible, +//Set the port visibility as Hidden +Hidden, +//Port get visible when hover connector on node +Hover, +//Port gets visible when connect connector to node +Connect, +//Specifies the port visibility as default +Default, +} +} +module Diagram +{ +enum BasicShapes +{ +//Used to specify node Shape as Rectangle +Rectangle, +//Used to specify node Shape as Ellipse +Ellipse, +//Used to specify node Shape as Path +Path, +//Used to specify node Shape as Polygon +Polygon, +//Used to specify node Shape as Triangle +Triangle, +//Used to specify node Shape as Plus +Plus, +//Used to specify node Shape as Star +Star, +//Used to specify node Shape as Pentagon +Pentagon, +//Used to specify node Shape as Heptagon +Heptagon, +//Used to specify node Shape as Octagon +Octagon, +//Used to specify node Shape as Trapezoid +Trapezoid, +//Used to specify node Shape as Decagon +Decagon, +//Used to specify node Shape as RightTriangle +RightTriangle, +//Used to specify node Shape as Cylinder +Cylinder, +} +} +module Diagram +{ +enum BPMNBoundary +{ +//Used to set BPMN SubProcess's Boundary as Default +Default, +//Used to set BPMN SubProcess's Boundary as Call +Call, +//Used to set BPMN SubProcess's Boundary as Event +Event, +} +} +module Diagram +{ +enum BPMNLoops +{ +//Used to set BPMN Activity's Loop as None +None, +//Used to set BPMN Activity's Loop as Standard +Standard, +//Used to set BPMN Activity's Loop as ParallelMultiInstance +ParallelMultiInstance, +//Used to set BPMN Activity's Loop as SequenceMultiInstance +SequenceMultiInstance, +} +} +module Diagram +{ +enum BPMNTasks +{ +//Used to set BPMN Task Type as None +None, +//Used to set BPMN Task Type as Service +Service, +//Used to set BPMN Task Type as Receive +Receive, +//Used to set BPMN Task Type as Send +Send, +//Used to set BPMN Task Type as InstantiatingReceive +InstantiatingReceive, +//Used to set BPMN Task Type as Manual +Manual, +//Used to set BPMN Task Type as BusinessRule +BusinessRule, +//Used to set BPMN Task Type as User +User, +//Used to set BPMN Task Type as Script +Script, +//Used to set BPMN Task Type as Parallel +Parallel, +} +} +module Diagram +{ +enum BPMNTriggers +{ +//Used to set Event Trigger as None +None, +//Used to set Event Trigger as Message +Message, +//Used to set Event Trigger as Timer +Timer, +//Used to set Event Trigger as Escalation +Escalation, +//Used to set Event Trigger as Link +Link, +//Used to set Event Trigger as Error +Error, +//Used to set Event Trigger as Compensation +Compensation, +//Used to set Event Trigger as Signal +Signal, +//Used to set Event Trigger as Multiple +Multiple, +//Used to set Event Trigger as Parallel +Parallel, +} +} +module Diagram +{ +enum Shapes +{ +//Used to set decorator shape as none +None, +//Used to set decorator shape as Arrow +Arrow, +//Used to set decorator shape as Open Arrow +OpenArrow, +//Used to set decorator shape as Circle +Circle, +//Used to set decorator shape as Diamond +Diamond, +//Used to set decorator shape as path +Path, +} +} +module Diagram +{ +enum PageOrientations +{ +//Used to set orientation as Landscape +Landscape, +//Used to set orientation as portrait +Portrait, +} +} +module Diagram +{ +enum ScrollLimit +{ +//Used to set scrollLimit as Infinite +Infinite, +//Used to set scrollLimit as Diagram +Diagram, +//Used to set scrollLimit as Limited +Limited, +} +} +module Diagram +{ +enum SelectorConstraints +{ +//Hides the selector +None, +//Sets the visibility of rotation handle as visible +Rotator, +//Sets the visibility of resize handles as visible +Resizer, +//Sets the visibility of user handles as visible +UserHandles, +//Sets the visibility of all selection handles as visible +All, +} +} +module Diagram +{ +enum Tool +{ +//Disables all Tools +None, +//Enables/Disables SingleSelect tool +SingleSelect, +//Enables/Disables MultiSelect tool +MultipleSelect, +//Enables/Disables ZoomPan tool +ZoomPan, +//Enables/Disables DrawOnce tool +DrawOnce, +//Enables/Disables ContinuousDraw tool +ContinuesDraw, +} +} +module Diagram +{ +enum RelativeMode +{ +//Shows tooltip around the node +Object, +//Shows tooltip at the mouse position +Mouse, +} +} + +} + +interface JQueryXHR { +} +interface JQueryPromise { +} +interface JQueryDeferred extends JQueryPromise { +} +interface JQueryParam { +} +interface JQuery { + data(key: any): any; +} +interface JQuery { + + ejButton(): JQuery; + ejButton(options?: ej.Button.Model): JQuery; + data(key: "ejButton"): ej.Button; + + ejCaptcha(): JQuery; + ejCaptcha(options?: ej.Captcha.Model): JQuery; + data(key: "ejCaptcha"): ej.Captcha; + + ejAccordion(): JQuery; + ejAccordion(options?: ej.Accordion.Model): JQuery; + data(key: "ejAccordion"): ej.Accordion; + + ejAutocomplete(): JQuery; + ejAutocomplete(options?: ej.Autocomplete.Model): JQuery; + data(key: "ejAutocomplete"): ej.Autocomplete; + + ejDatePicker(): JQuery; + ejDatePicker(options?: ej.DatePicker.Model): JQuery; + data(key: "ejDatePicker"): ej.DatePicker; + + ejDateTimePicker(): JQuery; + ejDateTimePicker(options?: ej.DateTimePicker.Model): JQuery; + data(key: "ejDateTimePicker"): ej.DateTimePicker; + + ejDialog(): JQuery; + ejDialog(options?: ej.Dialog.Model): JQuery; + data(key: "ejDialog"): ej.Dialog; + + ejDropDownList(): JQuery; + ejDropDownList(options?: ej.DropDownList.Model): JQuery; + data(key: "ejDropDownList"): ej.DropDownList; + + ejFileExplorer(): JQuery; + ejFileExplorer(options?: ej.FileExplorer.Model): JQuery; + data(key: "ejFileExplorer"): ej.FileExplorer; + + ejListBox(): JQuery; + ejListBox(options?: ej.ListBox.Model): JQuery; + data(key: "ejListBox"): ej.ListBox; + + ejListView(): JQuery; + ejListView(options?: ej.ListView.Model): JQuery; + data(key: "ejListView"): ej.ListView; + + ejNumericTextbox(): JQuery; + ejNumericTextbox(options?: ej.Editor.Model): JQuery; + data(key: "ejNumericTextbox"): ej.NumericTextbox; + + ejCurrencyTextbox(): JQuery; + ejCurrencyTextbox(options?: ej.Editor.Model): JQuery; + data(key: "ejCurrencyTextbox"): ej.CurrencyTextbox; + + ejPercentageTextbox(): JQuery; + ejPercentageTextbox(options?: ej.Editor.Model): JQuery; + data(key: "ejPercentageTextbox"): ej.PercentageTextbox; + + ejMaskEdit(): JQuery; + ejMaskEdit(options?: ej.MaskEdit.Model): JQuery; + data(key: "ejMaskEdit"): ej.MaskEdit; + + ejMenu(): JQuery; + ejMenu(options?: ej.Menu.Model): JQuery; + data(key: "ejMenu"): ej.Menu; + + ejPager(): JQuery; + ejPager(options?: ej.Pager.Model): JQuery; + data(key: "ejPager"): ej.Pager; + + ejProgressBar(): JQuery; + ejProgressBar(options?: ej.ProgressBar.Model): JQuery; + data(key: "ejProgressBar"): ej.ProgressBar; + + ejRadioButton(): JQuery; + ejRadioButton(options?: ej.RadioButton.Model): JQuery; + data(key: "ejRadioButton"): ej.RadioButton; + + ejCheckBox(): JQuery; + ejCheckBox(options?: ej.CheckBox.Model): JQuery; + data(key: "ejCheckBox"): ej.CheckBox; + + ejRibbon(): JQuery; + ejRibbon(options?: ej.Ribbon.Model): JQuery; + data(key: "ejRibbon"): ej.Ribbon; + + ejKanban(): JQuery; + ejKanban(options?: ej.Kanban.Model): JQuery; + data(key: "ejKanban"): ej.Kanban; + + ejRating(): JQuery; + ejRating(options?: ej.Rating.Model): JQuery; + data(key: "ejRating"): ej.Rating; + + ejRotator(): JQuery; + ejRotator(options?: ej.Rotator.Model): JQuery; + data(key: "ejRotator"): ej.Rotator; + + ejRTE(): JQuery; + ejRTE(options?: ej.RTE.Model): JQuery; + data(key: "ejRTE"): ej.RTE; + + ejSlider(): JQuery; + ejSlider(options?: ej.Slider.Model): JQuery; + data(key: "ejSlider"): ej.Slider; + + ejSplitButton(): JQuery; + ejSplitButton(options?: ej.SplitButton.Model): JQuery; + data(key: "ejSplitButton"): ej.SplitButton; + + ejSplitter(): JQuery; + ejSplitter(options?: ej.Splitter.Model): JQuery; + data(key: "ejSplitter"): ej.Splitter; + + ejTab(): JQuery; + ejTab(options?: ej.Tab.Model): JQuery; + data(key: "ejTab"): ej.Tab; + + ejTagCloud(): JQuery; + ejTagCloud(options?: ej.TagCloud.Model): JQuery; + data(key: "ejTagCloud"): ej.TagCloud; + + ejTimePicker(): JQuery; + ejTimePicker(options?: ej.TimePicker.Model): JQuery; + data(key: "ejTimePicker"): ej.TimePicker; + + ejTile(): JQuery; + ejTile(options?: ej.Tile.Model): JQuery; + data(key: "ejTile"): ej.Tile; + + ejToggleButton(): JQuery; + ejToggleButton(options?: ej.ToggleButton.Model): JQuery; + data(key: "ejToggleButton"): ej.ToggleButton; + + ejToolbar(): JQuery; + ejToolbar(options?: ej.Toolbar.Model): JQuery; + data(key: "ejToolbar"): ej.Toolbar; + + ejNavigationDrawer(): JQuery; + ejNavigationDrawer(options?: ej.NavigationDrawer.Model): JQuery; + data(key: "ejNavigationDrawer"): ej.NavigationDrawer; + + ejRadialMenu(): JQuery; + ejRadialMenu(options?: ej.RadialMenu.Model): JQuery; + data(key: "ejRadialMenu"): ej.RadialMenu; + + ejTreeView(): JQuery; + ejTreeView(options?: ej.TreeView.Model): JQuery; + data(key: "ejTreeView"): ej.TreeView; + + ejUploadbox(): JQuery; + ejUploadbox(options?: ej.Uploadbox.Model): JQuery; + data(key: "ejUploadbox"): ej.Uploadbox; + + ejWaitingPopup(): JQuery; + ejWaitingPopup(options?: ej.WaitingPopup.Model): JQuery; + data(key: "ejWaitingPopup"): ej.WaitingPopup; + + ejSchedule(): JQuery; + ejSchedule(options?: ej.Schedule.Model): JQuery; + data(key: "ejSchedule"): ej.Schedule; + + ejRecurrenceEditor(): JQuery; + ejRecurrenceEditor(options?: ej.RecurrenceEditorOptions): JQuery; + data(key: "ejRecurrenceEditor"): ej.RecurrenceEditor; + + ejGrid(): JQuery; + ejGrid(options?: ej.Grid.Model): JQuery; + data(key: "ejGrid"): ej.Grid; + + /*ReportViewer*/ + ejReportViewer(): JQuery; + ejReportViewer(options?: ej.ReportViewer.Model): JQuery; + data(key: "ejReportViewer"): ej.ReportViewer; + /*ReportViewer*/ + + ejLinearGauge(): JQuery; + ejLinearGauge(options?: ej.datavisualization.LinearGauge.Model): JQuery; + data(key: "ejLinearGauge"): ej.datavisualization.LinearGauge; + + ejDigitalGauge(): JQuery; + ejDigitalGauge(options?: ej.datavisualization.DigitalGauge.Model): JQuery; + data(key: "ejDigitalGauge"): ej.datavisualization.DigitalGauge; + + ejCircularGauge(): JQuery; + ejCircularGauge(options?: ej.datavisualization.CircularGauge.Model): JQuery; + data(key: "ejCircularGauge"): ej.datavisualization.CircularGauge; + + ejChart(): JQuery; + ejChart(options?: ej.datavisualization.Chart.Model): JQuery; + data(key: "ejChart"): ej.datavisualization.Chart; + + ejRangeNavigator(): JQuery; + ejRangeNavigator(options?: ej.datavisualization.RangeNavigator.Model): JQuery; + data(key: "ejRangeNavigator"): ej.datavisualization.RangeNavigator; + + ejBulletGraph(): JQuery; + ejBulletGraph(options?: ej.datavisualization.BulletGraph.Model): JQuery; + data(key: "ejBulletGraph"): ej.datavisualization.BulletGraph; + + ejGantt(): JQuery; + ejGantt(options?: ej.Gantt.Model): JQuery; + data(key: "ejGantt"): ej.Gantt; + + ejTreeGrid(): JQuery; + ejTreeGrid(options?: ej.TreeGrid.Model): JQuery; + data(key: "ejTreeGrid"): ej.TreeGrid; + + ejMap(): JQuery; + ejMap(options?: ej.datavisualization.Map.Model): JQuery; + data(key: "ejMap"): ej.datavisualization.Map; + + ejTreeMap(): JQuery; + ejTreeMap(options?: ej.datavisualization.TreeMap.Model): JQuery; + data(key: "ejTreeMap"): ej.datavisualization.TreeMap; + + ejBarcode(): JQuery; + ejBarcode(options?: ej.datavisualization.Barcode.Model): JQuery; + data(key: "ejBarcode"): ej.datavisualization.Barcode; + + ejDiagram(): JQuery; + ejDiagram(options?: ej.datavisualization.Diagram.Model): JQuery; + data(key: "ejDiagram"): ej.datavisualization.Diagram; + + // ejSymbolPalette(): JQuery; + // ejSymbolPalette(options?: ej.datavisualization.SymbolPalette.Model): JQuery; + // data(key: "ejSymbolPalette"): ej.datavisualization.SymbolPalette; + + ejOlapChart(): JQuery; + ejOlapChart(options?: ej.olap.OlapChart.Model): JQuery; + data(key: "ejOlapChart"): ej.olap.OlapChart; + + ejPivotGrid(): JQuery; + ejPivotGrid(options?: ej.PivotGrid.Model): JQuery; + data(key: "ejPivotGrid"): ej.PivotGrid; + + ejPivotSchemaDesigner(): JQuery; + ejPivotSchemaDesigner(options?: ej.PivotSchemaDesigner.Model): JQuery; + data(key: "ejPivotSchemaDesigner"): ej.PivotSchemaDesigner; + + ejOlapClient(): JQuery; + ejOlapClient(options?: ej.olap.OlapClient.Model): JQuery; + data(key: "ejOlapClient"): ej.olap.OlapClient; + + ejOlapGauge(): JQuery; + ejOlapGauge(options?: ej.olap.OlapGauge.Model): JQuery; + data(key: "ejOlapGauge"): ej.olap.OlapGauge; + + ejPivotPager(): JQuery; + ejPivotPager(options?: ej.PivotPager.Model): JQuery; + data(key: "ejPivotPager"): ej.PivotPager; + + /* Spreadsheet */ + ejSpreadsheet(): JQuery; + ejSpreadsheet(options?: ej.Spreadsheet.Model): JQuery; + data(key: "ejSpreadsheet"): ej.Spreadsheet; + /* Spreadsheet */ + + ejScroller(): JQuery; + ejScroller(options?: ej.Scroller.Model): JQuery; + data(key: "ejScroller"): ej.Scroller; + + ejDraggable(): JQuery; + ejDraggable(options?: ej.DraggableOptions): JQuery; + data(key: "ejDraggable"): ej.Draggable; + + ejDroppable(): JQuery; + ejDroppable(options?: ej.DroppableOptions): JQuery; + data(key: "ejDroppable"): ej.Droppable; + + ejResizable(): JQuery; + ejResizable(options?: ej.ResizableOptions): JQuery; + data(key: "ejResizable"): ej.Resizable; + + ejColorPicker(): JQuery; + ejColorPicker(options?: ej.ColorPicker.Model): JQuery; + data(key: "ejColorPicker"): ej.ColorPicker; + + ejRadialSlider(): JQuery; + ejRadialSlider(options?: ej.RadialSliderOptions): JQuery; + data(key: "ejRadialSlider"): ej.RadialSlider; + +} \ No newline at end of file diff --git a/ej.widgets.all/ej.widgets.all-tests.ts b/ej.widgets.all/ej.widgets.all-tests.ts new file mode 100644 index 0000000000..1f8412ad8d --- /dev/null +++ b/ej.widgets.all/ej.widgets.all-tests.ts @@ -0,0 +1,1260 @@ +/// +/// + +$(document).ready(function () { + + //Properties + $("#draggable1").ejDraggable({ + drag: ondrag1, dragStart: ondragstart1, dragStop: ondragstop1 + }); + $("#droppable1").ejDroppable(); + +}); +//Events + +function ondrag1() { + console.log("The mouse is moved during the dragging."); +} +function ondragstart1() { + console.log("To handle the drag start event as an init option."); +} +function ondragstop1() { + console.log("The mouse is moved during the dragging.."); +} + + + + + +$(document).ready(function () { + + //Properties + $("#draggable1").ejDraggable({ + drag: ondrag2, dragStart: ondragstart2, dragStop: ondragstop2 + }); + $("#droppable1").ejDroppable(); + +}); +//Events + +function ondrag2() { + console.log("The mouse is moved during the dragging."); +} +function ondragstart2() { + console.log("To handle the drag start event as an init option."); +} +function ondragstop2() { + console.log("The mouse is moved during the dragging.."); +} + + + + + +$(document).ready(function () { + + //Properties + $("#resizable1").ejResizable({resizeStart: onresizestart , resizeStop: onresizestop }); + +}); +//Events +function onresizestart() { + console.log("The resizing is start"); +} +function onresizestop() { + console.log("The resizing is stop"); +} + + + + + +$(document).ready(function () { + + //Properties + $("#scroller1").ejScroller({ height: 300, width: 500, create: onScrollCreate }); + $("#scroller2").ejScroller({ height: 300, width: 500,scrollTop:40 }); + +}); +//Events +function onScrollCreate() { + console.log("control created"); +} + +$(document).ready(function () { + + $("#accordion1").ejAccordion({cssClass: "gradient-lime" , create: AccordionCreate }); + $("#accordion2").ejAccordion({ enabled: true , activate: AccordionActivate }); + +}); + +function AccordionCreate() { + console.log("create"); +} +function AccordionActivate(){ + console.log("activate") +} + +$(document).ready(function () { + + $("#Text1").ejButton({ text: "Button", enabled: false , create: onButtoncreate }); + $("#Text2").ejButton({ text: "Button", cssClass: "customclass" , click: onButtonclick }); +}); + +function onButtoncreate() { + console.log("create"); +} +function onButtonclick(){ + console.log("click") +} +$(document).ready(function () { + + //Properties + $("#listbox1").ejListBox({ allowMultiSelection: true, create: onlistBoxcreate }); + $("#listbox2").ejListBox({ showCheckbox: true,checkChange: onlistBoxcheckchange }); + +}); +//Events +function onlistBoxcreate() { + console.log("control created"); +} +function onlistBoxcheckchange() { + console.log("list item is checked or unchecked"); +} + + + + + +$(document).ready(function () { + + $("#checkbox1").ejCheckBox({ enableTriState: true, create: onCheckboxcreate }); + $("#checkbox2").ejCheckBox({ checked: true , change: onCheckboxchange }); + +}); + +function onCheckboxcreate() { + console.log("create"); +} +function onCheckboxchange(){ + console.log("change") +} + + + +$(document).ready(function () { + + $("#colorpicker1").ejColorPicker({ value: "#278787" , open: oncolorPickeropen }); + $("#colorpicker2").ejColorPicker({ enabled: true, create: oncolorPickercreate }); + +}); +function oncolorPickeropen() { + console.log("open"); +} +function oncolorPickercreate(){ + console.log("create") +} + + +$(document).ready(function () { + + $("#fileExplorer").ejFileExplorer({ + isResponsive: true, + fileTypes: "*.png, *.gif, *.jpg, *.jpeg, *.docx", + layout: "largeicons", + path: "http://mvc.syncfusion.com/ODataServices/FileBrowser/", + ajaxAction: "http://mvc.syncfusion.com/OdataServices/fileExplorer/fileoperation/doJSONPAction", + ajaxDataType: "jsonp", + }); +}); + + +$(document).ready(function () { + + $("#datepicker1").ejDatePicker({dateFormat: "dd/MM/yyyy" ,open: ondatePickeropen }); + $("#datepicker3").ejDatePicker({value: "21/2/2010" , select: ondatePickerselect }); + +}); +function ondatePickeropen() { + console.log("open"); +} +function ondatePickerselect(){ + console.log("select") +} + + +$(document).ready(function () { + + $("#datetimepicker1").ejDateTimePicker({width:"100%" , create: ondatetimePickercreate }); + $("#datetimepicker2").ejDateTimePicker({enableRTL: true , open: ondatetimePickeropen }); +}); +function ondatetimePickercreate() { + console.log("create"); +} +function ondatetimePickeropen(){ + console.log("open") +} + + +$(document).ready(function () { + $("#Div1").ejDialog({ enabled: true , open : ondialogOpen }); + $("#Div2").ejDialog({ title: "Low battery" , beforeClose : ondialogbeforeClose }); +}); +function ondialogbeforeClose() { + console.log("beforeClose"); +} +function ondialogOpen() { + console.log("open"); +} +$(document).ready(function () { + + $("#dropdownlist1").ejDropDownList({ targetID: "carsList", create: ondropDowncreate }); + $("#dropdownlist2").ejDropDownList({ watermarkText: "Select a car", change: ondropDownchange }); +}); + +function ondropDowncreate() { + console.log("create"); +} +function ondropDownchange(){ + console.log("change") +} +$(document).ready(function () { + $("#num1").ejNumericTextbox({ value:"35" ,create: onEditorcreate }); + $("#num2").ejNumericTextbox({ width:"100%" , change: onEditorchange }); + + $("#num3").ejPercentageTextbox({ value:"3" ,create: onEditorcreate }); + $("#num4").ejPercentageTextbox({ width:"100%" , change: onEditorchange }); + + $("#num5").ejCurrencyTextbox({ value:"555" ,create: onEditorcreate }); + $("#num6").ejCurrencyTextbox({ width:"100%" , change: onEditorchange }); + +}); + +function onEditorcreate() { + console.log("create"); +} +function onEditorchange(){ + console.log("change") +} + +$(document).ready(function () { + + //Properties + $("#listview1").ejListView({ width: 200,mouseUP: onlistViewmouseup }); + $("#listview2").ejListView({ height: 300, mouseDown: onlistViewmousedown }); + +}); +//Events +function onlistViewmouseup() { + console.log("mouse up happens on the item."); +} +function onlistViewmousedown() { + console.log("mouse down happens on the item."); +} + + + + + + + + + +$(document).ready(function () { + $("#num1").ejMaskEdit({ maskFormat: "99-999-99999" ,create: onmaskEditcreate }); + $("#num2").ejMaskEdit({ watermarkText: "99-999-99999", width:"100%" , change: onmaskEditchange }); +}); + +function onmaskEditcreate() { + console.log("create"); +} +function onmaskEditchange(){ + console.log("change") +} +$(document).ready(function () { + + //Properties + $("#menu1").ejMenu({ enabled: false ,create: onMenucreate }); + $("#menu2").ejMenu({ width: "800px",click: onMenuclick }); + +}); +//Events +function onMenucreate() { + console.log("control created"); +} +function onMenuclick() { + console.log("mouse click on menu items"); +} + + + + + +$(document).ready(function () { + $("#pager1").ejPager({ click : onclickpager }); + $("#pager2").ejPager({ enableRTL: true }); +}); + +function onclickpager(){ + console.log("click") +} +$(document).ready(function () { + + $("#progress1").ejProgressBar({ text: 'loading...' , value: 50 , create: ProgressBarCreate }); + $("#progress2").ejProgressBar({ width: 200, value: 50 , change: ProgressBarChange }); + +}); + +function ProgressBarCreate() { + console.log("create"); +} +function ProgressBarChange(){ + console.log("change"); +} + +$(document).ready(function () { + $("#r1").ejRadioButton({ create: onradioButtoncreate }); + $("#r2").ejRadioButton({ text: "RadioButton",change: onradioButtonchange }); + $("#r3").ejRadioButton({ text: "RadioButton1", enabled: false }); +}); + +function onradioButtonchange() { + console.log("Change triggered"); +} +function onradioButtoncreate() { + console.log("Create triggered"); +} +$(document).ready(function () { + $("#Div1").ejRating({ enabled: true, click: onRatingclick }); + $("#Div2").ejRating({ incrementStep: 1, change: RatingvalueChanged }); +}); + +function RatingvalueChanged() { + console.log("Value changed"); +} +function onRatingclick() { + console.log("Entered"); +} +$(document).ready(function () { + + + $("#test1").ejRibbon({ + allowResizing:true,applicationTab: { + menuSettings: { + openOnClick: false + } + }, + tabs: [{ + id: "home", + text: "HOME", + groups: [{ + text: "New", + type: "custom", + contentID: "btn" + }] + }], + }); + $("#test2").ejRibbon({ + width: "100%", + applicationTab: { + menuSettings: { + openOnClick: false + } + }, + tabs: [{ + id: "home", + text: "HOME", + groups: [{ + text: "New", + type: "custom", + contentID: "btn" + }] + }], tabClick: onRibbonTabClick + }); +}); + +function onRibbonTabClick() { + console.log("Tab Clicked.."); +} + +$(function() { + $("#Kanban").ejKanban( + { + enableRTL: true, + columns: [ + { headerText: "Backlog", key: "Open" }, + { headerText: "In Progress", key: "InProgress" }, + { headerText: "Testing", key: "Testing" }, + { headerText: "Done", key: "Close" } + ], + keyField: "Status", + + + }); + }); + +$(document).ready(function () { + var imageData = [ + { + "imageurl": "../themes/images/rose.jpg", + }, + { + "imageurl": "../themes/images/rose.jpg", + } + + ]; + $("#test1").ejRotator({ + dataSource:imageData, allowKeyboardNavigation : false,create: onRotatorCreate + }); + $("#test2").ejRotator({ + dataSource:imageData, displayItemsCount : "1",pagerClick: onRotatorpagerClick + + }); + + +}); + +function onRotatorCreate() { + console.log("created"); +} +function onRotatorpagerClick() { + console.log("page clicked.."); +} + + +$(document).ready(function () { + $("#rteSample").ejRTE({ allowEditing: false , enableRTL: true }); + $("#rteSample").ejRTE({ change: onRtechange , execute: onRteExecute }); +}); + +function onRtechange() { + console.log("Change triggered"); +} +function onRteExecute() { + console.log("Executed"); +} +$(document).ready(function() { + $("#test1").ejSlider({ showRoundedCorner: true }); + $("#test2").ejSlider({ orientation: ej.Orientation.Vertical }); + $("#test3").ejSlider({ minValue: 20, maxValue: 80 }); + $("#test4").ejSlider({ start: Sliderstart }); + $("#test5").ejSlider({ enabled: false }); + $("#test6").ejSlider({ slide: onSliderslide }); +}); +function Sliderstart() { + console.log("Slider Started"); +} +function onSliderslide() { + console.log("Moving"); +} + +$(document).ready(function () { + $("#sbutton").ejSplitButton({ + width: "120px", + height: "50px", + buttonMode: ej.ButtonMode.Dropdown, + create: splitButtonopen, + targetID: "target", + }); +}); + +function splitButtonopen() +{ +alert("Opened"); +} + + + +$(document).ready(function () { + + $("#splitter1").ejSplitter({ enableRTL: true , create: onSplitterCreate }); + $("#splitter2").ejSplitter({allowKeyboardNavigation: false , expandCollapse: onSplitterExpandCollapse }); + +}); +function onSplitterCreate() { + console.log("Created"); +} +function onSplitterExpandCollapse(){ + console.log("expand and collapsed") +} + +$(document).ready(function () { + + $("#tab1").ejTab({ enableRTL: true , create: onTabCreate }); + $("#tab2").ejTab({ showRoundedCorner: true , ajaxSuccess: onTabAjaxSuccess }); + +}); +function onTabCreate() { + console.log("created"); +} + +function onTabAjaxSuccess() { + console.log("ajaxsuccess"); +} + + +$(function () { + // declaration + var websiteCollection = [ + { text: "Google", url: "http://www.google.com", frequency: 12 }, + { text: "All Things Digital", url: "http://allthingsd.com/", frequency: 3 }, + + ]; + $("#tagtest").ejTagCloud({ + titleText: "Tech Sites", + dataSource: websiteCollection, + enableRTL: true, mouseout: onTagMouseout + }); + $("#tagtest1").ejTagCloud({ + titleText: "Tech Sites", + dataSource: websiteCollection, + maxFontSize: "10px", create: onTagCreate + }); + function onTagCreate() { + console.log("created"); + } + function onTagMouseout() { + console.log("mouseout"); + } +}); + + + + $(function () { + $("#time").ejTimePicker({ enabled : true, height : "35",close: TimeClose,create: TimeCreate}); + }); + + function TimeClose() { + console.log("close"); + } + function TimeCreate() { + console.log("create"); + } + + + $(function () { + $("#tbutton").ejToggleButton({ + size: "large", + height: "28px", + click:ToggleClick, + create:ToggleCreate + }); + }); + + function ToggleClick() { + console.log("click"); + } + function ToggleCreate() { + console.log("create"); + } + +$(function () {// document ready + // Toolbar control creation + $("#ToolbarItem").ejToolbar({ + width: "auto", // width of the Toolbar + height: "33px", // height of the Toolbar + create:ToolBarCreate, + click:ToolBarClick + }); + }); + +function ToolBarCreate() { + console.log("click"); +} +function ToolBarClick() { + console.log("create"); +} + +$(document).ready(function () { + + $("#treeView").ejTreeView({ width: 300 , cssClass: 'customclass' , create: TreeViewCreate }); + + $("#treeView1").ejTreeView({ height: 300 , enabled: true , nodeClick: TreeViewClick }); +}); + + +function TreeViewCreate() { + console.log("create"); +} +function TreeViewClick(){ + console.log("click"); +} + +$(document).ready(function () { + + //Properties + $("#uploadbbox1").ejUploadbox({ height: "60px", create: onuploadBoxcreate }); + $("#uploadbbox2").ejUploadbox({ enableRTL: true, fileSelect: onuploadBoxfileselect }); + +}); +//Events +function onuploadBoxcreate() { + console.log("control created"); +} +function onuploadBoxfileselect() { + console.log("file has been selected"); +} + + + + + + + + + +$(document).ready(function () { + + //Properties + $("#waitingpopup1").ejWaitingPopup({ showOnInit: true, create: onwaitingPopupcreate }); + $("#waitingpopup2").ejWaitingPopup({ showOnInit: true, showImage: false }); + +}); +//Events +function onwaitingPopupcreate() { + console.log("control created"); +} + + + + + +$(function () { + $("#Grid").ejGrid({ + allowPaging: true, + allowSorting: true, + rowSelected: onGridRowSelect, + columnSelected: onGridColumnSelect, + rightClick: onGridRightClick, + columns: [ + { field: "OrderID", headerText: "Order ID", width: 75 , textAlign: ej.TextAlign.Right }, + { field: "CustomerID", headerText: "Customer ID", width: 80 }, + { field: "EmployeeID", headerText: "Employee ID", width: 75, textAlign: ej.TextAlign.Right }, + { field: "Freight", width: 75, format: "{0:C}", textAlign: ej.TextAlign.Right }, + { field: "OrderDate", headerText: "Order Date", width: 80, format: "{0:MM/dd/yyyy}", textAlign: ej.TextAlign.Right }, + { field: "ShipCity", headerText: "Ship City", width: 110 } + ] + }); + }); + +function onGridRowSelect() +{ +console.log("Row Selected"); +} +function onGridRightClick() +{ +console.log("Right Click Button Clicked"); +} +function onGridColumnSelect() +{ +console.log("Column Selected"); +} + + $(function () { + $("#PivotGrid").ejPivotGrid({ + load: PivotGridload, + renderComplete: PivotGridrenderComplete, + url: "/wcf/PivotGridService.svc", + isResponsive: true + + }); + }); + + function PivotGridload() { + console.log("load"); + } + function PivotGridrenderComplete() { + console.log("rendercomplete"); + } + + + $(function () { + $("#PivotSchemaDesigner1").ejPivotSchemaDesigner({ + height: "630px", + url: "/wcf/PivotService.svc" + }); + }); + + + +$(document).ready(function () { + $("#pivotpager1").ejPivotPager({ categoricalCurrentPage: 1 }); + $("#pivotpager2").ejPivotPager({ seriesPageCount: 0 }); +}); + +$(document).ready(function () { + $("#test1").ejSchedule({ + cellHeight:"35px", cellClick: onScheduleCellClick + }); + $("#test2").ejSchedule({ + enableRTL: true, menuItemClick: onScheduleMenuItemClick + }); +}); +function onScheduleCellClick() { + console.log("cell clicked.."); +} +function onScheduleMenuItemClick() { + console.log("Menu Item Clicked.."); +} + + + $(function () { + $("#RecurrenceEditor").ejRecurrenceEditor({ + selectedRecurrenceType: 0, + create: RecurrenceEditorOncreate + }); + + }); + + function RecurrenceEditorOncreate() { + this.element.find("#recurrencetype_wrapper").css("width", "33%"); + } + +$(document).ready(function () { + +$("#GanttContainer").ejGantt({ + allowSelection: true, + allowColumnResize: true, + taskIdMapping: "TaskID", + taskNameMapping: "TaskName", + scheduleStartDate: "02/23/2014", + scheduleEndDate: "03/31/2014", + startDateMapping: "StartDate", + endDateMapping: "EndDate", + progressMapping: "Progress", + childMapping: "Children", + allowGanttChartEditing: false, + treeColumnIndex: 1, + enableResize: true, + expanded: onGanttExpand, + load: onGanttLoad + }); +}); + +function onGanttExpand() +{ +console.log("Expanded"); +} +function onGanttLoad() +{ +console.log("Loading"); +} +$(document).ready(function () { + + + $("#test1").ejReportViewer({ reportServiceUrl: "../api/RDLReport",enablePageCache: false,reportLoaded: onReportReportLoaded }); + $("#test2").ejReportViewer({ + renderMode: ej.ReportViewer.RenderMode.Default,reportServiceUrl: "../api/RDLReport",renderingBegin: onReportRenderingBegin }); +}); +function onReportRenderingBegin() { + console.log("Rendering Begin.."); +} +function onReportReportLoaded() { + console.log("Report Loaded.."); +} + +$(document).ready(function () { + var dataManager = [ + { + taskID: 1, + taskName: "Planning", + startDate: "02/03/2014", + endDate: "02/07/2014", + progress: 100, + duration: 5, + priority: "Normal", + approved: false, + subtasks: [ + { taskID: 2, taskName: "Plan timeline", startDate: "02/03/2014", endDate: "02/07/2014", duration: 5, progress: 100, priority: "Normal", approved: false }, + { taskID: 3, taskName: "Plan budget", startDate: "02/03/2014", endDate: "02/07/2014", duration: 5, progress: 100, approved: true }, + { taskID: 4, taskName: "Allocate resources", startDate: "02/03/2014", endDate: "02/07/2014", duration: 5, progress: 100, priority: "Critical", approved: false }, + { taskID: 5, taskName: "Planning complete", startDate: "02/07/2014", endDate: "02/07/2014", duration: 0, progress: 0, priority: "Low", approved: true } + ] + }]; + +$("#test1").ejTreeGrid({ + dataSource:dataManager,allowColumnResize: true, + columns: [ + { field: "taskID", headerText: "Task Id", editType: "numericedit" }, + { field: "taskName", headerText: "Task Name", editType: "stringedit" }, + { field: "startDate", headerText: "Start Date", editType: "datepicker" }, + { field: "endDate", headerText: "End Date", editType: "datepicker" }, + { field: "duration", headerText: "Duration", editType: "numericedit" }, + { field: "progress", headerText: "Progress", editType: "numericedit" } + ],load: onTreeLoad + }); + $("#test2").ejTreeGrid({ + dataSource:dataManager,rowHeight : 30, + columns: [ + { field: "taskID", headerText: "Task Id", editType: "numericedit" }, + { field: "taskName", headerText: "Task Name", editType: "stringedit" }, + { field: "startDate", headerText: "Start Date", editType: "datepicker" }, + { field: "endDate", headerText: "End Date", editType: "datepicker" }, + { field: "duration", headerText: "Duration", editType: "numericedit" }, + { field: "progress", headerText: "Progress", editType: "numericedit" } + ],rowSelected: onTreeRowSelected + + }); + + +}); +function onTreeLoad() { + console.log("loaded.."); +} +function onTreeRowSelected() { + console.log("row Selected.."); +} + + +$(document).ready(function () { + $("#navpane").ejNavigationDrawer({ type: "overlay", direction: "left", position: "fixed",open: NavigationDrawerOpen }); +}); + +function NavigationDrawerOpen() +{ + console.log("open"); +} + + + $(function () { + $('#radialmenu').ejRadialMenu({ targetElementId: "radialtarget", "autoOpen":true,select: RadialMenuSelect , mouseUp: RadialMenuMouseUp }); + }); + + function RadialMenuMouseUp() { + console.log("mouseUp"); + } + function RadialMenuSelect() { + console.log("select"); + } + + + +$(function () +{ + $("#tile1").ejTile({ text: "Map", tileSize: "medium", imageUrl: 'http://js.syncfusion.com/ug/web/content/tile/map.png', mouseUp: TileMouseUp, mouseDown: TileMouseDown }); +}); + +function TileMouseUp() { + console.log("mouseUp"); +} + +function TileMouseDown() { + console.log("mousedown"); +} + + + + + $(function () { + $("#radialSlider").ejRadialSlider({ innerCircleImageUrl: "chevron-right.png",autoOpen:true, create: RadialSliderCreate , start: RadialSliderStart }); + }); + + function RadialSliderCreate() { + console.log("create"); + } + function RadialSliderStart() { + console.log("start"); + } + +$(document).ready(function () { + $("#test1").ejSpreadsheet({ + allowDelete: true, cellEdit: onSpreadsheetCellEdit + }); + $("#test2").ejSpreadsheet({ + cssClass: "gradient-lime", drag: onSpreadsheetDrag + }); +}); +function onSpreadsheetDrag() { + console.log("item drag.."); +} +function onSpreadsheetCellEdit() { + console.log("cell edited.."); +} + + + $(function() + { + $("#OlapChart").ejOlapChart( + { + url: "OlapChartService.svc", + renderFailure: OlapChartRenderFailure, + renderSuccess: OlapChartRenderSuccess + }); + }); + + function OlapChartRenderFailure() { + console.log("failure"); + } + function OlapChartRenderSuccess() { + console.log("success"); + } + + + $(function() + { + $("#OlapClient").ejOlapClient( + { + url: "/wcf/OlapClientService.svc", + title: "OLAP Browser", + renderFailure: OlapClientRenderFailure, + renderSuccess: OlapClientRenderSuccess + }); + }); + + function OlapClientRenderFailure() { + console.log("failure"); + } + function OlapClientRenderSuccess() { + console.log("success"); + } + +$(document).ready(function() + { + $("#olapgauge1").ejOlapGauge( + { + url: "../wcf/OlapGaugeService.svc", + enableTooltip: true, + renderFailure: olapGaugerenderFailure, + renderSuccess: olapGaugerenderSuccess + }); + }); +function olapGaugerenderFailure() { + console.log("failure"); + } +function olapGaugerenderSuccess() { + console.log("success"); + } + +$(document).ready(function () { + + $("#CoreLinearGauge").ejLinearGauge({ + labelColor: "#8c8c8c", width: 500, + scales: [{ + width: 4, border: { color: "transparent",width:0 }, showBarPointers: false, showRanges: true, length: 310, + position: { x: 52, y: 50 }, markerPointers: [{ + value: 50, length: 10, width: 10, backgroundColor: "#4D4D4D", border: { color: "#4D4D4D" } + }], + labels: [{ font: { size: "11px", fontFamily: "Segoe UI", fontStyle: "bold" }, distanceFromScale:{x: -13} }], + ticks: [{ type: "majorinterval", width: 1, color: "#8c8c8c" }], + ranges: [{ + endValue: 60, + startValue: 0, + backgroundColor: "#F6B53F", + border: { color: "#F6B53F" }, startWidth: 4, endWidth: 4 + }, { + endValue: 100, + startValue: 60, + backgroundColor: "#E94649", + border: { color: "#E94649" }, startWidth: 4, endWidth: 4 + }] + }], + init:onLinearGaugeinit, + mouseClick:onLinearGaugemouseClick + }); +}); + +function onLinearGaugeinit() +{ + console.log("init"); +} +function onLinearGaugemouseClick() +{ + console.log("mouseClick"); +} + +$(document).ready(function () { + + $("#CoreCircularGauge").ejCircularGauge({ + backgroundColor: "transparent", width: 500, + scales: [{ + showRanges: true, + startAngle: 122, sweepAngle: 296, radius: 130, showScaleBar: true, size: 1, maximum: 120, majorIntervalValue: 20, minorIntervalValue: 10, + border: { + width: 0.5, + }, + pointers: [{ + value: 60, + showBackNeedle: true, + backNeedleLength: 20, + length: 95, + width: 7, + pointerCap: { radius: 12 } + }], + ticks: [{ + type: "major", + distanceFromScale: 2, + height: 16, + width: 1, color: "#8c8c8c" + }, { type: "minor", height: 8, width: 1, distanceFromScale: 2, color: "#8c8c8c" }], + labels: [{ + color: "#8c8c8c" + }], + ranges: [{ + distanceFromScale: -30, + startValue: 0, + endValue: 70 + }, { + distanceFromScale: -30, + startValue: 70, + endValue: 110, + backgroundColor: "#fc0606", + border: { color: "#fc0606" } + }, + { + distanceFromScale: -30, + startValue: 110, + endValue: 120, + backgroundColor: "#f5b43f", + border: { color: "#f5b43f" } + }] + }], + mouseClick:onCircularMouseClick + }); + +}); + +function onCircularMouseClick() +{ + console.log("Mouse click.."); +} + +$(document).ready(function () { + + $("#DigitalCore").ejDigitalGauge({ + width: 525, + height: 305, + items: [{ + segmentSettings: { + width: 1, + spacing: 0, + color: "#8c8c8c" + }, + characterSettings: { + opacity: 0.8, + }, + value: "123456789", + position: { x: 52, y: 52 } + }], + init:onDigitalGaugeinit, + itemRendering:onDigitalGaugeItemRendering + }); +}); + +function onDigitalGaugeinit() +{ + console.log("init"); +} +function onDigitalGaugeItemRendering() +{ + console.log("itemRendering"); +} + +$(document).ready(function () { + + $("#container").ejChart( + { + + + + //Initializing Common Properties for all the series + commonSeriesOptions: + { + type: 'line', enableAnimation: true, + tooltip:{ visible :true, template:'Tooltip'}, + marker: + { + shape: 'circle', + size: + { + height: 10, width: 10 + }, + visible: true + }, + border : {width: 2} + }, + + + + title :{text: 'Efficiency of oil-fired power production'}, + size: { height: "600" }, + legend: { visible: true}, + create:onChartCreate + }); + +}); + +function onChartCreate() +{ + console.log("create"); +} + +$(document).ready(function () { + + $("#scrollcontent").ejRangeNavigator({ + + enableDeferredUpdate: true, + padding: "15", + allowSnapping:true, + selectedRangeSettings: { + start:"2015/5/25", end:"2016/5/25" + }, + + }) +}); + +$(document).ready(function () { + $("#BulletGraph1").ejBulletGraph({ + qualitativeRangeSize: 32, + quantitativeScaleLength: 475, tooltipSettings: {template: "Tooltip", visible: true}, orientation: ej.datavisualization.BulletGraph.Orientation.Horizontal, + flowDirection: ej.datavisualization.BulletGraph.FlowDirection.Forward, + quantitativeScaleSettings: { + location: { x: 110, y: 10 }, + minimum: 0, + maximum: 10, + interval: 1, + minorTicksPerInterval: 4, + majorTickSettings:{ size: 13, width: 1, stroke: 'gray'}, + minorTickSettings:{ size: 5, width: 1, stroke: 'gray'}, + + labelSettings: { + position: ej.datavisualization.BulletGraph.LabelPosition.Below, offset: 14, size: 10 + }, + featuredMeasureSettings: { width: 6 }, + comparativeMeasureSettings:{ + width: 5 + }, + featureMeasures: [{ value: 8, comparativeMeasureValue: 6.7, category: ""}] + }, + qualitativeRanges: [{ + rangeEnd: 4.3 + }, { + rangeEnd: 7.3 + }, { + rangeEnd: 10 + }], + captionSettings: { textAngle: 0, + location: { x: 17, y: 20 }, text: "Revenue YTD", font: { color: null, fontFamily: 'Segoe UI', fontStyle: ej.datavisualization.BulletGraph.FontStyle.Normal, size: '12px', fontWeight: ej.datavisualization.BulletGraph.FontWeight.Normal, opacity: 1 }, //'#707070' + subTitle: { textAngle: 0, + text: "$ in Thousands", location: { x: 10, y: 35 }, font: { color: null, fontFamily: 'Segoe UI', fontStyle: ej.datavisualization.BulletGraph.FontStyle.Normal, size: '12px', fontWeight: ej.datavisualization.BulletGraph.FontWeight.Normal, opacity: 1} //'#707070' + } + } + + + + }); + + $("#BulletGraph2").ejBulletGraph({ qualitativeRangeSize: 32, height:140, + quantitativeScaleLength: 475, orientation: ej.datavisualization.BulletGraph.Orientation.Horizontal, + flowDirection: ej.datavisualization.BulletGraph.FlowDirection.Forward, + quantitativeScaleSettings: { + location: { x: 110, y: 10 }, + minimum: -10, + maximum: 10, + interval: 2, + minorTicksPerInterval: 4, + majorTickSettings:{ size: 13, width: 1}, + minorTickSettings:{ size: 5, width: 1}, + + labelSettings: { + position: ej.datavisualization.BulletGraph.LabelPosition.Below, offset: 14, size: 10, labelSuffix: ' %' + }, + featuredMeasureSettings: { width: 6 }, + comparativeMeasureSettings:{ width: 5 }, + featureMeasures: [{ value: 8, comparativeMeasureValue: 6.7}] + }, + qualitativeRanges: [{ + rangeEnd: -4, rangeStroke: "#61a301" + }, { + rangeEnd: 3, rangeStroke: "#fcda21" + }, { + rangeEnd: 10, rangeStroke: "#d61e3f" + }], + captionSettings: { textAngle: 0, + location: { x: 60, y: 25 }, text: "Profit", font: { color: null, fontFamily: 'Segoe UI', fontStyle: ej.datavisualization.BulletGraph.FontStyle.Normal, size: '13px', fontWeight: ej.datavisualization.BulletGraph.FontWeight.Normal, opacity: 1 }, //'#707070' + //subTitle: { textAngle: 0, + // text: "profit in %", location: { x: 35, y: 35 }, font: { color: null, fontFamily: 'Segoe UI', fontStyle: ej.datavisualization.BulletGraph.FontStyle.Normal, size: '12px', fontWeight: ej.datavisualization.BulletGraph.FontWeight.Normal, opacity: 1} //'#707070' + //} + }, + drawLabels:onBulletDrawLabel + }); + +}); + + function onBulletDrawLabel() + { + console.log("drawLabel"); + } + + +$(document).ready(function () { + + $("#barcode").ejBarcode({ text: "HTTP://WWW.SYNCFUSION.COM", symbologyType: "qrbarcode", xDimension: 8, displayText: true, load:onBarcodeLoad }); + +}); + +function onBarcodeLoad() + { + console.log("load"); + } + + jQuery(function ($) { + $("#container").ejMap({ + mouseover:MapMouseOver, + onRenderComplete:MapOnRenderComplete, + navigationControl:{enableNavigation:true,orientation:'vertical',absolutePosition:{x:5,y:15},dockPosition: 'none'}, + background:'white', + enableAnimation: true, + layers: [ + { + layerType: "geometry", + enableSelection: false, + enableMouseHover:false, + + showMapItems: false, + markerTemplate: 'template', + shapeSettings: { + fill: "#626171", + strokeThickness: "1", + stroke: "#6F6F79", + highlightStroke:"#6F6F79", + valuePath: "name", + highlightColor: "gray" + + }, + + } + ] + + }); + }); + function MapMouseOver() { + console.log("mouseover"); + } + function MapOnRenderComplete() { + console.log("onRenderComplete"); + } + + + jQuery(function ($) { + $("#treemapContainer").ejTreeMap({ + treeMapItemSelected:onTreeMapItemSelected, + + levels: [ + { groupPath: "Continent", groupGap: 5} + ], + colorValuePath: "Growth", + rangeColorMapping: [ + { color: "#DC562D", from: "0", to: "1" }, + { color: "#FED124", from: "1", to: "1.5" }, + { color: "#487FC1", from: "1.5", to: "2" }, + { color: "#0E9F49", from: "2", to: "3" } + ], + showTooltip:true, + leafItemSettings: { labelPath: "Region" } + }); + }); + function onTreeMapItemSelected() { + console.log("TreeMapItemSelected"); + } + + \ No newline at end of file diff --git a/ej.widgets.all/ej.widgets.all.d.ts b/ej.widgets.all/ej.widgets.all.d.ts new file mode 100644 index 0000000000..bd73834e52 --- /dev/null +++ b/ej.widgets.all/ej.widgets.all.d.ts @@ -0,0 +1,49995 @@ +// Type definitions for ej.widgets.all v14.1.0.41 +// Project: http://help.syncfusion.com/js/typescript +// Definitions by: Syncfusion +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/*! +* filename: ej.widgets.all.d.ts +* version : 14.1.0.41 +* Copyright Syncfusion Inc. 2001 - 2016. All rights reserved. +* Use of this code is subject to the terms of our license. +* A copy of the current license can be obtained at any time by e-mailing +* licensing@syncfusion.com. Any infringement will be prosecuted under +* applicable laws. +*/ +declare module ej { + + var dataUtil: dataUtil; + function isMobile(): boolean; + function isIOS(): boolean; + function isAndroid(): boolean; + function isFlat(): boolean; + function isWindows(): boolean; + function isCssCalc(): boolean; + function getCurrentPage(): JQuery; + function isLowerResolution(): boolean; + function browserInfo(): browserInfoOptions; + function isTouchDevice(): boolean; + function addPrefix(style: string): string; + function animationEndEvent(): string; + function blockDefaultActions(e: Object): void; + function buildTag(tag: string, innerHtml: string, styles: Object, attrs: Object): JQuery; + function cancelEvent(): string; + function copyObject(): string; + function createObject(nameSpace: string, value: Object, initIn: string): JQuery; + function defineClass(className: string, constructor:any, proto: Object, replace: boolean): Object; + function destroyWidgets(element: Object): void; + function endEvent(): string; + function event(type: string, data: any, eventProp: Object): Object; + function getAndroidVersion(): Object; + function getAttrVal(ele: Object, val: string, option: Object): Object; + function getBooleanVal(ele: Object, val: string, option: Object): Object; + function getClearString(): string; + function getDimension(element: Object, method: string): Object; + function getFontString(fontObj: Object): string; + function getFontStyle(style: string): string; + function getMaxZindex(): number; + function getNameSpace(className: string): string; + function getObject(nameSpace: string): Object; + function getOffset(ele: string): Object; + function getRenderMode(): string; + function getScrollableParents(element: Object): void; + function getTheme(): string; + function getZindexPartial(element: Object, popupEle: string): number; + function hasRenderMode(element: string): void; + function hasStyle(prop: string): boolean; + function hasTheme(element: string): string; + function hexFromRGB(color: string): string; + function ieClearRemover(element: string): void; + function isAndroidWebView(): string; + function isDevice(): boolean; + function isIOS7(): boolean; + function isIOSWebView(): boolean; + function isLowerAndroid(): boolean; + function isNullOrUndefined(value: Object): boolean; + function isPlainObject(): JQuery; + function isPortrait(): any; + function isTablet(): boolean; + function isWindowsWebView(): string; + function listenEvents(selectors:any, eventTypes: any, handlers: any, remove?: any, pluginObj?: any, disableMouse?: boolean): void; + function listenTouchEvent(selectors:any, eventTypes: any, handlers: any, remove?: any, pluginObj?: any, disableMouse?: boolean): void; + function logBase(val: string, base: string): number; + function measureText(text: string, maxwidth: number, font: string): string; + function moveEvent(): string; + function print(element: string): void; + function proxy(fn: Object, context: string, arg: string): boolean; + function round(value: string, div: string, up: string): any; + function sendAjaxRequest(ajaxOptions: Object): void; + function setCaretToPos(nput: string, pos1: string, pos2: string): void; + function setRenderMode(element: string): void; + function setTheme(): Object; + function startEvent(): string; + function tapEvent(): string; + function tapHoldEvent(): string; + function throwError(): Object; + function transitionEndEvent(): Object; + function userAgent(): boolean; + function widget(pluginName: string, className: string, proto: Object): Object; + function avg(json: Object, filedName: string): any; + function getGuid(prefix: string): number; + function group(jsonArray: any, field: string, agg: string, level: number, groupDs: string): Object; + function isJson(jsonData: string): string; + function max(jsonArray: any, fieldName: string, comparer: string): any; + function min(jsonArray: any, fieldName: string, comparer: string): any; + function merge(first: string, second: string): any; + function mergeshort(jsonArray: any, fieldName: string, comparer: string): any; + function parseJson(jsonText: string): string; + function parseTable(table: number, headerOption: string, headerRowIndex: string): Object; + function select(jsonArray: any, fields: string): any; + function setTransition(): boolean; + function sum(json: string, fieldName: string): string; + function swap(array: any, x: string, y: string): any; + var cssUA: string; + var serverTimezoneOffset: number; + var transform: string; + var transformOrigin: string; + var transformStyle: string; + var transition: string; + var transitionDelay: string; + var transitionDuration: string; + var transitionProperty: string; + var transitionTimingFunction: string; + export module device { + function isAndroid(): boolean; + function isIOS(): boolean; + function isFlat(): boolean; + function isIOS7(): boolean; + function isWindows(): boolean; + } + export module widget { + var autoInit: boolean; + var registeredInstances: Array; + var registeredWidgets: Array; + function register(pluginName: string, className: string, prototype: any): void; + function destroyAll(elements: Element): void; + function init(element: Element): void; + function registerInstance(element: Element, pluginName: string, className: string, prototype: any):void; + } + + interface browserInfoOptions { + name: string; + version: string; + culture: Object; + isMSPointerEnabled: boolean; + } + class WidgetBase { + destroy(): void; + element: JQuery; + setModel(options: Object, forceSet?: boolean):any; + option(prop?: Object, value?: Object, forceSet?: boolean): any; + persistState(): void; + restoreState(silent: boolean): void; + } + + class Widget extends WidgetBase { + constructor(pluginName: string, className: string, proto: any); + static fn: Widget; + static extend(widget: Widget): any; + register(pluginName: string, className: string, prototype: any): void; + destroyAll(elements: Element): void; + model: any; + } + + + interface BaseEvent { + cancel: boolean; + type: string; + } + class DataManager { + constructor(dataSource?: any, query?: ej.Query, adaptor?: any); + setDefaultQuery(query: ej.Query): void; + executeQuery(query?: ej.Query, done?: any, fail?: any, always?: any): JQueryPromise; + executeLocal(query?: ej.Query): ej.DataManager; + saveChanges(changes?: Changes, key?: string, tableName?: string): JQueryDeferred; + insert(data: Object, tableName: string): JQueryPromise; + remove(keyField: string, value: any, tableName: string): Object; + update(keyField: string, value: any, tableName: string): Object; + } + + class Query { + constructor(); + static fn: Query; + static extend(prototype: Object): Query; + key(field: string): ej.Query; + using(dataManager: ej.DataManager): ej.Query; + execute(dataManager: ej.DataManager, done: any, fail?: string, always?: string): any; + executeLocal(dataManager: ej.DataManager): ej.DataManager; + clone(): ej.Query; + from(tableName: any): ej.Query; + addParams(key: string, value: string): ej.Query; + expand(tables: any): ej.Query; + where(fieldName: string, operator: ej.FilterOperators, value: string, ignoreCase?: boolean): ej.Query; + where(predicate:ej.Predicate):ej.Query; + search(searchKey: any, fieldNames?: any, operator?: string, ignoreCase?: boolean): ej.Query; + sortBy(fieldName: string, comparer?: ej.SortOrder, isFromGroup?: boolean): ej.Query; + sortByDesc(fieldName: string): ej.Query; + group(fieldName: string): ej.Query; + page(pageIndex: number, pageSize: number): ej.Query; + take(nos: number): ej.Query; + skip(nos: number): ej.Query; + select(fieldNames: any): ej.Query; + hierarchy(query: ej.Query, selectorFn: any): ej.Query; + foreignKey(key: string): ej.Query; + requiresCount(): ej.Query; + range(start:number, end:number): ej.Query; + } + + class Adaptor { + constructor(ds: any); + pvt: Object; + type: ej.Adaptor; + options: AdaptorOptions; + extend(overrides: any): ej.Adaptor; + processQuery(dm: ej.DataManager, query: ej.Query):any; + processResponse(data: Object, ds: any, query: ej.Query, xhr: JQueryXHR, request?: Object, changes?: Changes): Object; + convertToQueryString(req: any, query: ej.Query, dm: ej.DataManager): JQueryParam; + } + + interface AdaptorOptions { + from?: string; + requestType?: string; + sortBy?: string; + select?: string; + skip?: string; + group?: string; + take?: string; + search?: string; + count?: string; + where?: string; + aggregates?: string; + } + + class UrlAdaptor extends ej.Adaptor { + constructor(); + processQuery(dm: ej.DataManager, query: ej.Query, hierarchyFilters?: Object): { + type: string; url: string; ejPvtData: Object; contentType?: string; data?: Object; + } + convertToQueryString(req: Object, query: ej.Query, dm: ej.DataManager): JQueryParam; + processResponse(data: Object, ds: any, query: ej.Query, xhr: JQueryXHR, request?: Object, changes?: Changes): Object; + onGroup(e: any): void; + batchRequest(dm: ej.DataManager, changes: Changes, e: any): void; + beforeSend(dm: ej.DataManager, request: any, settings?:any): void; + insert(dm: ej.DataManager, data: Object, tableName: string): { url: string; data: any }; + remove(dm: ej.DataManager, keyField: string, value: any, tableName: string): { type: string; url: string; data?: any }; + update(dm: ej.DataManager, keyField: string, value: any, tableName: string): { type: string; url: string; data: any }; + getFiltersFrom(data: Object, query: ej.Query): ej.Predicate; + } + + class ODataAdaptor extends ej.UrlAdaptor { + constructor(); + options: UrlAdaptorOptions; + onEachWhere(filter: any, requiresCast: boolean): any; + onPredicate(pred: ej.Predicate, query: ej.Query, requiresCast: boolean): string; + onComplexPredicate(pred: ej.Predicate, requiresCast: boolean): string; + onWhere(filters: Array): string; + onEachSearch(e: Object): void; + onSearch(e: Object): string; + onEachSort(e: Object): string; + onSortBy(e: Object): string; + onGroup(e: Object): string; + onSelect(e: Object): string; + onCount(e: Object): string; + beforeSend(dm: ej.DataManager, request: any, settings?: any): void; + processResponse(data: Object, ds: Object, query: ej.Query, xhr:any, request: any, changes: Changes): { + result: Object; count: number + }; + convertToQueryString(req: Object, query: ej.Query, dm: ej.DataManager): JQueryParam; + insert(dm: ej.DataManager, data: Object, tableName: string): { url: string; data: Object; } + remove(dm: ej.DataManager, keyField: string, value: any, tableName: string): { url: string; type: string; } + update(dm: ej.DataManager, keyField: string, value: any, tableName: string): { url: string; type: string; data: Object; accept: string; } + batchRequest(dm: ej.DataManager, changes: Changes, e: any): { url: string; type: string; data: Object; contentType: string; } + generateDeleteRequest(arr: Array, e: any): string; + generateInsertRequest(arr: Array, e: any): string; + generateUpdateRequest(arr: Array, e: any): string; + } + interface UrlAdaptorOptions { + requestType?: string; + accept?: string; + multipartAccept?: string; + sortBy?: string; + select?: string; + skip?: string; + take?: string; + count?: string; + where?: string; + expand?: string; + batch?: string; + changeSet?: string; + batchPre?: string; + contentId?: string; + batchContent?: string; + changeSetContent?: string; + batchChangeSetContentType?: string; + } + + class ODataV4Adaptor extends ej.ODataAdaptor { + constructor(); + options: ODataAdaptorOptions; + onCount(e: Object): string; + onEachSearch(e: Object): void; + onSearch(e: Object): string; + beforeSend(dm: ej.DataManager, request: any, settings?: any): void; + processResponse(data: Object, ds: Object, query: ej.Query, xhr:any, request: any, changes: Changes): { + result: Object; count: number + }; + + } + interface ODataAdaptorOptions { + requestType?: string; + accept?: string; + multipartAccept?: string; + sortBy?: string; + select?: string; + skip?: string; + take?: string; + count?: string; + search?: string; + where?: string; + expand?: string; + batch?: string; + changeSet?: string; + batchPre?: string; + contentId?: string; + batchContent?: string; + changeSetContent?: string; + batchChangeSetContentType?: string; + } + + class JsonAdaptor extends ej.Adaptor { + constructor(); + processQuery(ds: Object, query: ej.Query): string; + batchRequest(dm: ej.DataManager, changes: Changes, e:any): Changes; + onWhere(ds: Object, e: any): any; + onSearch(ds: Object, e: any): any + onSortBy(ds: Object, e: any, query: ej.Query): Object; + onGroup(ds: Object, e: any, query: ej.Query): Object; + onPage(ds: Object, e: any, query: ej.Query): Object; + onRange(ds: Object, e: any): Object; + onTake(ds: Object, e: any): Object; + onSkip(ds: Object, e: any): Object; + onSelect(ds: Object, e: any): Object; + insert(dm: ej.DataManager, data: any): Object; + remove(dm: ej.DataManager, keyField: string, value:any, tableName: string): Object; + update(dm: ej.DataManager, keyField: string, value:any, tableName: string): Object; + } + class TableModel { + constructor(name: string, jsonArray: Array, dataManager: ej.DataManager, modelComputed: any); + on(eventName: string, handler: any): void; + off(eventName: string, handler: any): void; + setDataManager(dataManager: DataManager): void; + saveChanges(): void; + rejectChanges(): void; + insert(json: any): void; + update(value: any): void; + remove(key: string): void; + isDirty(): boolean; + getChanges(): Changes; + toArray(): Array; + setDirty(dirty:any, model:any): void; + get(index: number): void; + length(): number; + bindTo(element: any): void; + } + class Model { + constructor(json: any, table: string, name: string); + formElements: Array; + computes(value: any): void; + on(eventName: string, handler: any): void; + off(eventName: string, handler: any): void; + set(field: string, value: any): void; + get(field: string): any; + revert(suspendEvent: any): void; + save(dm: ej.DataManager, key: string): void; + markCommit(): void; + markDelete(): void; + changeState(state: boolean, args: any): void; + properties(): any; + bindTo(element: any): void; + unbind(element: any): void; + } + interface Changes { + changed?: Array; + added?: Array; + deleted?: Array; + } + class Predicate { + constructor(field: string, operator: ej.FilterOperators, value: any, ignoreCase: boolean); + and(field: string, operator: any, value:any, ignoreCase:boolean): void; + or(field: string, operator: any, value: any, ignoreCase: boolean): void; + validate(record: Object): boolean; + toJSON(): { + isComplex: boolean; + field: string; + operator: string; + value: any; + ignoreCase: boolean; + condition: string; + predicates: any; + }; + } + interface dataUtil { + swap(array: Array, x: number, y: number): void; + mergeSort(jsonArray: Array, fieldName: string, comparer:any): Array; + max(jsonArray: Array, fieldName: string, comparer: string): Array; + min(jsonArray: Array, fieldName: string, comparer: string): Array; + distinct(jsonArray: Array, fieldName: string, requiresCompleteRecord:any): Array; + sum(json:any, fieldName: string): number; + avg(json:any, fieldName: string): number; + select(jsonArray: Array, fieldName: string, fields:string): Array; + group(jsonArray: Array, field: string, /* internal */ level: number): Array; + parseTable(table: string, headerOption: ej.headerOption, headerRowIndex: number): Object; + } + interface AjaxSettings { + type?: string; + cache: boolean; + data?: any; + dataType?: string; + contentType?: any; + async?: boolean; + } + enum FilterOperators { + contains, + endsWith, + equal, + greaterThan, + greaterThanOrEqual, + lessThan, + lessThanOrEqual, + notEqual, + startsWith + } + + enum MatrixDefaults { + m11, + m12, + m21, + m22, + offsetX, + offsetY, + type + } + enum MatrixTypes { + Identity, + Scaling, + Translation, + Unknown + } + + enum Orientation { + Horizontal, + Vertical + } + + enum SliderType { + Default, + MinRange, + Range + } + + enum eventType { + click, + mouseDown, + mouseLeave, + mouseMove, + mouseUp + } + enum headerOption { + row, + tHead + } + + enum filterType{ + StartsWith, + Contains, + EndsWith, + LessThan, + GreaterThan, + LessThanOrEqual , + GreaterThanOrEqual, + Equal, + NotEqual + } + enum Animation{ + Fade, + None, + Slide + } + enum Type{ + Overlay, + Slide + } +class Draggable extends ej.Widget { + static fn: Draggable; + constructor(element: JQuery, options?: DraggableOptions); + constructor(element: Element, options?: DraggableOptions); + model: DraggableOptions; +} + +interface DraggableOptions { + scope?: string; + handle?: Object; + dragArea?: Object; + clone?: boolean; + distance?: number; + helper?: any; + cursorAt?: DragAtPositon; + destroy? (e: DraggableEvent): void; + drag? (e: DraggableDragEvent): void; + dragStart? (e: DraggableDragStartEvent): void; + dragStop? (e: DraggableDragStopEvent): void; + +} + +interface DragAtPositon { + top?: number; + left?: number; +} + +interface DraggableEvent extends ej.BaseEvent { + model: DraggableOptions; +} +interface DraggableDragStartEvent extends ej.BaseEvent, DraggableEvent { + element: Object; + target: Object; +} +interface DraggableDragStopEvent extends ej.BaseEvent, DraggableEvent { + element: Object; + target: Object; +} +interface DraggableDragEvent extends ej.BaseEvent, DraggableEvent { + element: Object; + target: Object; +} +class Droppable extends ej.Widget { + static fn: Droppable; + constructor(element: JQuery, options?: DroppableOptions); + constructor(element: Element, options?: DroppableOptions); + model: DroppableOptions; +} + +interface DroppableOptions { + scope?: string; + accept?: Object; + drop? (e: DroppableDropEvent): void; + over? (e: DroppableOverEvent): void; + out? (e: DroppableOutEvent): void; +} + +interface DroppableEvent extends ej.BaseEvent { + model: DroppableOptions; +} +interface DroppableDropEvent extends ej.BaseEvent, DraggableEvent { + targetElement: Object; +} +interface DroppableOverEvent extends ej.BaseEvent, DraggableEvent { + targetElement: Object; +} +interface DroppableOutEvent extends ej.BaseEvent, DraggableEvent { + targetElement: Object; +} +class Resizable extends ej.Widget { + static fn: Resizable; + constructor(element: JQuery, options?: ResizableOptions); + constructor(element: Element, options?: ResizableOptions); + model: ResizableOptions; +} + +interface ResizableOptions { + scope?: string; + handle?: Object; + distance?: number; + cursorAt?: resizeAtPositon; + helper?: any; + maxHeight?: (number|string); + maxWidth?: (number|string); + minHeight?: (number|string); + minWidth?: (number|string); + destroy? (e: ResizeEvent): void; + resizeStart? (e: ResizableStartEvent): void; + resize? (e: ResizableEvent): void; + resizeStop? (e: ResizableStopEvent): void; +} + +interface resizeAtPositon { + top?: number; + left?: number; +} + +interface ResizeEvent extends ej.BaseEvent { + model: ResizableOptions; +} +interface ResizableStartEvent extends ej.BaseEvent, ResizeEvent { + targetElement: Object; +} +interface ResizableEvent extends ej.BaseEvent, ResizeEvent { + targetElement: Object; +} +interface ResizableStopEvent extends ej.BaseEvent, ResizeEvent { + targetElement: Object; +} + + var globalize:globalize; + var cultures:culture; + function addCulture(name: string, culture ?: any): void; + function preferredCulture(culture ?: string): culture; + function format(value: any, format: string, culture ?: string): string; + function parseInt(value: string, radix?: any, culture ?: string): number; + function parseFloat(value: string, radix?: any, culture ?: string): number; + function parseDate(value: string, format: string, culture ?: string): Date; + function getLocalizedConstants(controlName: string, culture ?: string): any; + +interface globalize { + addCulture(name: string, culture?: any): void; + preferredCulture(culture?: string): culture; + format(value: any, format: string, culture?: string): string; + parseInt(value: string, radix?: any, culture?: string): number; + parseFloat(value: string, radix?: any, culture?: string): number; + parseDate(value: string, format: string, culture?: string): Date; + getLocalizedConstants(controlName: string, culture?: string): any; + } + interface culture { + name?: string; + englishName?: string; + namtiveName?: string; + language?: string; + isRTL: boolean; + numberFormat?: formatSettings; + calendars?: calendarsSettings; + } + interface formatSettings { + pattern: Array; + decimals: number; + groupSizes: Array; + percent: percentSettings; + currency: currencySettings; + } + interface percentSettings { + pattern: Array; + decimals: number; + groupSizes: Array; + symbol: string; + } + interface currencySettings { + pattern: Array; + decimals: number; + groupSizes: Array; + symbol: string; + } + interface calendarsSettings { + standard: standardSettings; + } + interface standardSettings { + firstDay: number; + days: daySettings; + months: monthSettings; + AM: Array; + PM: Array; + twoDigitYearMax: number; + patterns: patternSettings; + } + interface daySettings { + names: Array; + namesAbbr: Array; + namesShort: Array; + } + interface monthSettings { + names: Array; + namesAbbr: Array; + } + interface patternSettings { + d: string; + D: string; + t: string; + T: string; + f: string; + F: string; + M: string; + Y: string; + S: string; + } +class Scroller extends ej.Widget { + static fn: Scroller; + constructor(element: JQuery, options?: Scroller.Model); + constructor(element: Element, options?: Scroller.Model); + model:Scroller.Model; + defaults:Scroller.Model; + + /** destroy the Scroller control, unbind the all ej control related events automatically and bring the control to pre-init state. + * @returns {void} + */ + destroy(): void; + + /** User disables the Scroller control at any time. + * @returns {void} + */ + disable(): void; + + /** User enables the Scroller control at any time. + * @returns {void} + */ + enable(): void; + + /** Returns true if horizontal scrollbar is shown, else return false. + * @returns {boolean} + */ + isHScroll(): boolean; + + /** Returns true if vertical scrollbar is shown, else return false. + * @returns {boolean} + */ + isVScroll(): boolean; + + /** User refreshes the Scroller control at any time. + * @returns {void} + */ + refresh(): void; + + /** Scroller moves to given pixel in X (left) position. We can also specify the animation speed,in which the scroller has to move while re-positioning it. + * @returns {void} + */ + scrollX(): void; + + /** Scroller moves to given pixel in Y (top) position. We can also specify the animation speed,in which the scroller has to move while re-positioning it. + * @returns {void} + */ + scrollY(): void; +} +export module Scroller{ + +export interface Model { + + /**Set true to hides the scrollbar, when mouseout the content area. + * @Default {false} + */ + autoHide?: boolean; + + /**Specifies the height and width of button in the scrollbar. + * @Default {18} + */ + buttonSize?: number; + + /**Specifies to enable or disable the scroller + * @Default {true} + */ + enabled?: boolean; + + /**Save current model value to browser cookies for state maintenance. While refresh the page Rating control values are retained. + * @Default {false} + */ + enablePersistence?: boolean; + + /**Indicates the Right to Left direction to scroller + * @Default {undefined} + */ + enableRTL?: boolean; + + /**Enables or Disable the touch Scroll + * @Default {true} + */ + enableTouchScroll?: boolean; + + /**Specifies the height of Scroll panel and scrollbars. + * @Default {250} + */ + height?: number; + + /**If the scrollbar has vertical it set as width, else it will set as height of the handler. + * @Default {18} + */ + scrollerSize?: number; + + /**The Scroller content and scrollbars move left with given value. + * @Default {0} + */ + scrollLeft?: number; + + /**While press on the arrow key the scrollbar position added to the given pixel value. + * @Default {57} + */ + scrollOneStepBy?: number; + + /**The Scroller content and scrollbars move to top position with specified value. + * @Default {0} + */ + scrollTop?: number; + + /**Indicates the target area to which scroller have to appear. + * @Default {null} + */ + targetPane?: string; + + /**Specifies the width of Scroll panel and scrollbars. + * @Default {0} + */ + width?: number; + + /**Fires when Scroller control is created.*/ + create? (e: CreateEventArgs): void; + + /**Fires when Scroller control is destroyed.*/ + destroy? (e: DestroyEventArgs): void; +} + +export interface CreateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the scroller model + */ + model?: ej.Scroller.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the scroller model + */ + model?: ej.Scroller.Model; + + /**returns the name of the event. + */ + type?: string; +} +} + +class Accordion extends ej.Widget { + static fn: Accordion; + constructor(element: JQuery, options?: Accordion.Model); + constructor(element: Element, options?: Accordion.Model); + model:Accordion.Model; + defaults:Accordion.Model; + + /** AddItem method is used to add the panel in dynamically. It receives the following parameters + * @param {string} specify the name of the header + * @param {string} content of the new panel + * @param {number} insertion place of the new panel + * @param {boolean} Enable or disable the ajax request to the added panel + * @returns {void} + */ + addItem(header_name: string, content: string, index: number, isAjaxReq: boolean): void; + + /** This method used to collapse the all the expanded items in accordion at a time. + * @returns {void} + */ + collapseAll(): void; + + /** destroy the Accordion widget all events bound using this._on will be unbind automatically and bring the control to pre-init state. + * @returns {void} + */ + destroy(): void; + + /** Disables the accordion widget includes all the headers and content panels. + * @returns {void} + */ + disable(): void; + + /** Disable the accordion widget item based on specified header index. + * @param {Array} index values to disable the panels + * @returns {void} + */ + disableItems(index: Array): void; + + /** Enable the accordion widget includes all the headers and content panels. + * @returns {void} + */ + enable(): void; + + /** Enable the accordion widget item based on specified header index. + * @param {Array} index values to enable the panels + * @returns {void} + */ + enableItems(index: Array): void; + + /** To expand all the accordion widget items. + * @returns {void} + */ + expandAll(): void; + + /** Returns the total number of panels in the control. + * @returns {number} + */ + getItemsCount(): number; + + /** Hides the visible Accordion control. + * @returns {void} + */ + hide(): void; + + /** The refresh method is used to adjust the control size based on the parent element dimension. + * @returns {void} + */ + refresh(): void; + + /** RemoveItem method is used to remove the specified index panel.It receives the parameter as number. + * @param {number} specify the index value for remove the accordion panel. + * @returns {void} + */ + removeItem( index : number): void; + + /** Shows the hidden Accordion control. + * @returns {void} + */ + show(): void; +} +export module Accordion{ + +export interface Model { + + /**Specifies the ajaxSettings option to load the content to the accordion control. + * @Default {null} + */ + ajaxSettings?: AjaxSettings; + + /**Accordion headers can be expanded and collapsed on keyboard action. + * @Default {true} + */ + allowKeyboardNavigation?: boolean; + + /**To set the Accordion headers Collapse Speed. + * @Default {300} + */ + collapseSpeed?: number; + + /**Specifies the collapsible state of accordion control. + * @Default {false} + */ + collapsible?: boolean; + + /**Sets the root CSS class for Accordion theme, which is used customize. + */ + cssClass?: string; + + /**Allows you to set the custom header Icon. It accepts two key values “header”, ”selectedHeader”. + * @Default {{ header: e-collapse, selectedHeader: e-expand }} + */ + customIcon?: CustomIcon; + + /**Disables the specified indexed items in accordion. + * @Default {[]} + */ + disabledItems?: number[]; + + /**Specifies the animation behavior in accordion. + * @Default {true} + */ + enableAnimation?: boolean; + + /**With this enabled property, you can enable or disable the Accordion. + * @Default {true} + */ + enabled?: boolean; + + /**Used to enable the disabled items in accordion. + * @Default {[]} + */ + enabledItems?: number[]; + + /**Multiple content panels to activate at a time. + * @Default {false} + */ + enableMultipleOpen?: boolean; + + /**Save current model value to browser cookies for maintaining states. When refreshing the accordion control page, the model value is applied from browser cookies or HTML 5local storage. + * @Default {false} + */ + enablePersistence?: boolean; + + /**Display headers and panel text from right-to-left. + * @Default {false} + */ + enableRTL?: boolean; + + /**The events API binds the action for activating the accordion header. Users can activate the header by using mouse actions such as mouse-over, mouse-up, mouse-down, and soon. + * @Default {click} + */ + events?: string; + + /**To set the Accordion headers Expand Speed. + * @Default {300} + */ + expandSpeed?: number; + + /**Sets the height for Accordion items header. + */ + headerSize?: number|string; + + /**Specifies height of the accordion. + * @Default {null} + */ + height?: number|string; + + /**Adjusts the content panel height based on the given option (content, auto, or fill). By default, the panel heights are adjusted based on the content. + * @Default {content} + */ + heightAdjustMode?: ej.Accordion.HeightAdjustMode|string; + + /**It allows to define the characteristics of the Accordion control. It will helps to extend the capability of an HTML element. + * @Default {{}} + */ + htmlAttributes?: any; + + /**The given index header will activate (open). If collapsible is set to true, and a negative value is given, then all headers are collapsed. Otherwise, the first panel isactivated. + * @Default {0} + */ + selectedItemIndex?: number|string; + + /**Activate the specified indexed items of the accordion + * @Default {[0]} + */ + selectedItems?: number[]; + + /**Used to determines the close button visibility an each accordion items. This close button helps to remove the accordion item from the control. + * @Default {false} + */ + showCloseButton?: boolean; + + /**Displays rounded corner borders on the Accordion control's panels and headers. + * @Default {false} + */ + showRoundedCorner?: boolean; + + /**Specifies width of the accordion. + * @Default {null} + */ + width?: number|string; + + /**Triggered after a Accordion item is active or inactive. Argument values are activeIndex, activeHeader, inActiveHeader, inActiveIndex and current model value.*/ + activate? (e: ActivateEventArgs): void; + + /**Triggered before the AJAX content is loaded in a content panel. Arguments have location of the content (URL) and current model value.*/ + ajaxBeforeLoad? (e: AjaxBeforeLoadEventArgs): void; + + /**Triggered after AJAX load failed action. Arguments have URL, error message, and current model value.*/ + ajaxError? (e: AjaxErrorEventArgs): void; + + /**Triggered after the AJAX content loads. Arguments have current model values.*/ + ajaxLoad? (e: AjaxLoadEventArgs): void; + + /**Triggered after AJAX success action. Arguments have URL, content, and current model values.*/ + ajaxSuccess? (e: AjaxSuccessEventArgs): void; + + /**Triggered before a tab item is active. Arguments have active index and model values.*/ + beforeActivate? (e: BeforeActivateEventArgs): void; + + /**Triggered after a Accordion item is active or inactive. Argument values are activeIndex, activeHeader, inActiveHeader, inActiveIndex and current model value.*/ + beforeInactivate? (e: BeforeInactivateEventArgs): void; + + /**Triggered after Accordion control creation.*/ + create? (e: CreateEventArgs): void; + + /**Triggered after Accordion control destroy.*/ + destroy? (e: DestroyEventArgs): void; + + /**Triggered after a Accordion item is active or inactive. Argument values are activeIndex, activeHeader, inActiveHeader, inActiveIndex and current model value.*/ + inActivate? (e: InActivateEventArgs): void; +} + +export interface ActivateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the accordion model + */ + model ?: ej.Accordion.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns active index + */ + activeIndex ?: number; + + /**returns current active header + */ + activeHeader ?: any; + + /**returns true when the Accordion index activated by user interaction otherwise returns false + */ + isInteraction ?: boolean; +} + +export interface AjaxBeforeLoadEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the accordion model + */ + model ?: ej.Accordion.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns current ajax content location + */ + url ?: string; +} + +export interface AjaxErrorEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the accordion model + */ + model ?: ej.Accordion.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns current ajax content location + */ + url ?: string; + + /**returns the failed data sent. + */ + data ?: string; +} + +export interface AjaxLoadEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the accordion model + */ + model ?: ej.Accordion.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the name of the url + */ + url ?: string; +} + +export interface AjaxSuccessEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the accordion model + */ + model ?: ej.Accordion.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns current ajax content location + */ + url ?: string; + + /**returns the successful data sent. + */ + data ?: string; + + /**returns the ajax content. + */ + content ?: string; +} + +export interface BeforeActivateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the accordion model + */ + model ?: ej.Accordion.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns active index + */ + activeIndex ?: number; + + /**returns true when the Accordion index activated by user interaction otherwise returns false + */ + isInteraction ?: boolean; +} + +export interface BeforeInactivateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the accordion model + */ + model ?: ej.Accordion.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns active index + */ + inActiveIndex ?: number; + + /**returns true when the Accordion index activated by user interaction otherwise returns false + */ + isInteraction ?: boolean; +} + +export interface CreateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the accordion model + */ + model ?: ej.Accordion.Model; + + /**returns the name of the event + */ + type ?: string; +} + +export interface DestroyEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the accordion model + */ + model ?: ej.Accordion.Model; + + /**returns the name of the event + */ + type ?: string; +} + +export interface InActivateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the accordion model + */ + model ?: ej.Accordion.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns active index + */ + inActiveIndex ?: number; + + /**returns in active element + */ + inActiveHeader ?: any; + + /**returns true when the Accordion index activated by user interaction otherwise returns false + */ + isInteraction ?: boolean; +} + +export interface AjaxSettings { + + /**It specifies, whether to enable or disable asynchronous request. + */ + async?: boolean; + + /**It specifies the page will be cached in the web browser. + */ + cache?: boolean; + + /**It specifies the type of data is send in the query string. + */ + contentType?: string; + + /**It specifies the data as an object, will be passed in the query string. + */ + data?: any; + + /**It specifies the type of data that you're expecting back from the response. + */ + dataType?: string; + + /**It specifies the HTTP request type. + */ + type?: string; +} + +export interface CustomIcon { + + /**This class name set to collapsing header. + */ + header?: string; + + /**This class name set to expanded (active) header. + */ + selectedHeader?: string; +} + +enum HeightAdjustMode{ + + ///Height fit to the content in the panel + Content, + + ///Height set to the largest content in the panel + Auto, + + ///Height filled to the content of the panel + Fill +} + +} + +class Autocomplete extends ej.Widget { + static fn: Autocomplete; + constructor(element: JQuery, options?: Autocomplete.Model); + constructor(element: Element, options?: Autocomplete.Model); + model:Autocomplete.Model; + defaults:Autocomplete.Model; + + /** Clears the text in the Autocomplete textbox. + * @returns {void} + */ + clearText(): void; + + /** Destroys the Autocomplete widget. + * @returns {void} + */ + destroy(): void; + + /** Disables the autocomplete widget. + * @returns {void} + */ + disable(): void; + + /** Enables the autocomplete widget. + * @returns {void} + */ + enable(): void; + + /** Returns objects (data object) of all the selected items in the autocomplete textbox. + * @returns {void} + */ + getSelectedItems(): void; + + /** Returns the current selected value from the Autocomplete textbox. + * @returns {void} + */ + getValue(): void; + + /** Search the entered text and show it in the suggestion list if available. + * @returns {void} + */ + search(): void; + + /** Open up the autocomplete suggestion popup with all list items. + * @returns {void} + */ + open(): void; + + /** Sets the value of the Autocomplete textbox based on the given key value. + * @param {string} The key value of the specific suggestion item. + * @returns {void} + */ + selectValueByKey(Key: string): void; + + /** Sets the value of the Autocomplete textbox based on the given input text value. + * @param {string} The text (label) value of the specific suggestion item. + * @returns {void} + */ + selectValueByText(Text: string): void; +} +export module Autocomplete{ + +export interface Model { + + /**Customize "Add New" text (label) to be added in the autocomplete popup list for the entered text when there are no suggestions for it. + * @Default {Add New} + */ + addNewText?: boolean; + + /**Allows new values to be added to the autocomplete input other than the values in the suggestion list. Normally, when there are no suggestions it will display “No suggestions” label in the popup. + * @Default {false} + */ + allowAddNew?: boolean; + + /**Enables or disables the sorting of suggestion list item. The default sort order is ascending order. You customize sort order. + * @Default {true} + */ + allowSorting?: boolean; + + /**To focus the items in the suggestion list when the popup is shown. By default first item will be focused. + * @Default {false} + */ + autoFocus?: boolean; + + /**Enables or disables the case sensitive search. + * @Default {false} + */ + caseSensitiveSearch?: boolean; + + /**The root class for the Autocomplete textbox widget which helps in customizing its theme. + * @Default {””} + */ + cssClass?: string; + + /**The data source contains the list of data for the suggestions list. It can be a string array or json array. + * @Default {null} + */ + dataSource?: any|Array; + + /**The time delay (in milliseconds) after which the suggestion popup will be shown. + * @Default {200} + */ + delaySuggestionTimeout?: number; + + /**The special character which acts as a separator for the given words for multi-mode search i.e. the text after the delimiter are considered as a separate word or query for search operation. + * @Default {’,’} + */ + delimiterChar?: string; + + /**The text to be displayed in the popup when there are no suggestions available for the entered text. + * @Default {“No suggestions”} + */ + emptyResultText?: string; + + /**Fills the autocomplete textbox with the first matched item from the suggestion list automatically based on the entered text when enabled. + * @Default {false} + */ + enableAutoFill?: boolean; + + /**Enables or disables the Autocomplete textbox widget. + * @Default {true} + */ + enabled?: boolean; + + /**Enables or disables displaying the duplicate names present in the search result. + * @Default {false} + */ + enableDistinct?: boolean; + + /**Allows the current model values to be saved in local storage or browser cookies for state maintenance when it is set to true. While refreshing the page, it retains the model value from browser cookies or local storage. + * @Default {false} + */ + enablePersistence?: boolean; + + /**Displays the Autocomplete widget’s content from right to left when enabled. + * @Default {false} + */ + enableRTL?: boolean; + + /**Mapping fields for the suggestion items of the Autocomplete textbox widget. + * @Default {null} + */ + fields?: any; + + /**Specifies the search filter type. There are several types of search filter available such as ‘startswith’, ‘contains’, ‘endswith’, ‘lessthan’, ‘lessthanorequal’, ‘greaterthan’, ‘greaterthanorequal’, ‘equal’, ‘notequal’. + * @Default {ej.filterType.StartsWith} + */ + filterType?: string; + + /**The height of the Autocomplete textbox. + * @Default {null} + */ + height?: string; + + /**The search text can be highlighted in the AutoComplete suggestion list when enabled. + * @Default {false} + */ + highlightSearch?: boolean; + + /**Number of items to be displayed in the suggestion list. + * @Default {0} + */ + itemsCount?: number; + + /**Minimum number of character to be entered in the Autocomplete textbox to show the suggestion list. + * @Default {1} + */ + minCharacter?: number; + + /**Enables or disables selecting multiple values from the suggestion list. Multiple values can be selected through either of the following options, + * @Default {ej.MultiSelectMode.None} + */ + multiSelectMode?: ej.Autocomplete.MultiSelectMode|string; + + /**The height of the suggestion list. + * @Default {“152px”} + */ + popupHeight?: string; + + /**The width of the suggestion list. + * @Default {“auto”} + */ + popupWidth?: string; + + /**The query to retrieve the data from the data source. + * @Default {null} + */ + query?: ej.Query|string; + + /**Indicates that the autocomplete textbox values can only be readable. + * @Default {false} + */ + readOnly?: boolean; + + /**Enables or disables showing the message when there are no suggestions for the entered text. + * @Default {true} + */ + showEmptyResultText?: boolean; + + /**Enables or disables the loading icon to intimate the searching operation. The loading icon is visible when there is a time delay to perform the search. + * @Default {true} + */ + showLoadingIcon?: boolean; + + /**Enables the showPopup button in autocomplete textbox. When the Showpopup button is clicked, it displays all the available data from the data source. + * @Default {false} + */ + showPopupButton?: boolean; + + /**Enables or disables rounded corner. + * @Default {false} + */ + showRoundedCorner?: boolean; + + /**Sort order specifies whether the suggestion list values has to be displayed in ascending or descending order. + * @Default {ej.SortOrder.Ascending} + */ + sortOrder?: ej.Autocomplete.SortOrder|string; + + /**The template to display the suggestion list items with customized appearance. + * @Default {null} + */ + template?: string; + + /**The jQuery validation error message to be displayed on form validation. + * @Default {null} + */ + validationMessage?: any; + + /**The jQuery validation rules for form validation. + * @Default {null} + */ + validationRules?: any; + + /**The value to be displayed in the autocomplete textbox. + * @Default {null} + */ + value?: string; + + /**Enables or disables the visibility of the autocomplete textbox. + * @Default {true} + */ + visible?: boolean; + + /**The text to be displayed when the value of the autocomplete textbox is empty. + * @Default {null} + */ + watermarkText?: string; + + /**The width of the Autocomplete textbox. + * @Default {null} + */ + width?: string; + + /**Triggers when the data requested from AJAX will get successfully loaded in the Autocomplete widget.*/ + actionSuccess? (e: ActionSuccessEventArgs): void; + + /**Triggers when the AJAX requests complete. The request may get failed or succeed.*/ + actionComplete? (e: ActionCompleteEventArgs): void; + + /**Triggers when the data requested from AJAX get failed.*/ + actionFailure? (e: ActionFailureEventArgs): void; + + /**Triggers when the text box value is changed.*/ + change? (e: ChangeEventArgs): void; + + /**Triggers after the suggestion popup is closed.*/ + close? (e: CloseEventArgs): void; + + /**Triggers when Autocomplete widget is created.*/ + create? (e: CreateEventArgs): void; + + /**Triggers after the Autocomplete widget is destroyed.*/ + destroy? (e: DestroyEventArgs): void; + + /**Triggers after the autocomplete textbox is focused.*/ + focusIn? (e: FocusInEventArgs): void; + + /**Triggers after the Autocomplete textbox gets out of the focus.*/ + focusOut? (e: FocusOutEventArgs): void; + + /**Triggers after the suggestion list is opened.*/ + open? (e: OpenEventArgs): void; + + /**Triggers when an item has been selected from the suggestion list.*/ + select? (e: SelectEventArgs): void; +} + +export interface ActionSuccessEventArgs { +} + +export interface ActionCompleteEventArgs { +} + +export interface ActionFailureEventArgs { +} + +export interface ChangeEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the autocomplete model object. + */ + model?: any; + + /**Name of the event. + */ + type?: string; + + /**Value of the autocomplete textbox. + */ + value?: string; +} + +export interface CloseEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the autocomplete model object. + */ + model?: any; + + /**Name of the event. + */ + type?: string; +} + +export interface CreateEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the autocomplete model object. + */ + model?: ej.Autocomplete.Model; + + /**Name of the event. + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the autocomplete model object. + */ + model?: ej.Autocomplete.Model; + + /**Name of the event. + */ + type?: string; +} + +export interface FocusInEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the autocomplete model object. + */ + model?: ej.Autocomplete.Model; + + /**Name of the event. + */ + type?: string; + + /**Value of the autocomplete textbox. + */ + value?: string; +} + +export interface FocusOutEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the autocomplete model object. + */ + model?: ej.Autocomplete.Model; + + /**Name of the event. + */ + type?: string; + + /**Value of the autocomplete textbox. + */ + value?: string; +} + +export interface OpenEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the autocomplete model object. + */ + model?: ej.Autocomplete.Model; + + /**Name of the event. + */ + type?: string; +} + +export interface SelectEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the autocomplete model object. + */ + model?: ej.Autocomplete.Model; + + /**Name of the event. + */ + type?: string; + + /**Value of the autocomplete textbox. + */ + value?: string; + + /**Text of the selected item. + */ + text?: string; + + /**Key of the selected item. + */ + key?: string; + + /**Data object of the selected item. + */ + Item?: ej.Autocomplete.Model; +} + +enum MultiSelectMode{ + + ///Multiple values are separated using a given special character. + Delimiter, + + ///Each values are displayed in separate box with close button. + VisualMode +} + + +enum SortOrder{ + + ///Items to be displayed in the suggestion list in ascending order. + Ascending, + + ///Items to be displayed in the suggestion list in descending order. + Descending +} + +} + +class Button extends ej.Widget { + static fn: Button; + constructor(element: JQuery, options?: Button.Model); + constructor(element: Element, options?: Button.Model); + model:Button.Model; + defaults:Button.Model; + + /** destroy the button widget all events bound using this._on will be unbind automatically and bring the control to pre-init state. + * @returns {void} + */ + destroy(): void; + + /** To disable the button + * @returns {void} + */ + disable(): void; + + /** To enable the button + * @returns {void} + */ + enable(): void; +} +export module Button{ + +export interface Model { + + /**Specifies the contentType of the Button. See below to know available ContentType + * @Default {ej.ContentType.TextOnly} + */ + contentType?: ej.ContentType|string; + + /**Sets the root CSS class for Button theme, which is used customize. + */ + cssClass?: string; + + /**Specifies the button control state. + * @Default {true} + */ + enabled?: boolean; + + /**Specify the Right to Left direction to button + * @Default {false} + */ + enableRTL?: boolean; + + /**Specifies the height of the Button. + * @Default {28} + */ + height?: number; + + /**It allows to define the characteristics of the Button control. It will helps to extend the capability of an HTML element. + * @Default {{}} + */ + htmlAttributes?: any; + + /**Specifies the image position of the Button. This image position is applicable only with the textandimage contentType property. The images can be positioned in both imageLeft and imageRight options. See below to know about available ImagePosition + * @Default {ej.ImagePosition.ImageLeft} + */ + imagePosition?: ej.ImagePosition|string; + + /**Specifies the primary icon for Button. This icon will be displayed from the left margin of the button. + * @Default {null} + */ + prefixIcon?: string; + + /**Convert the button as repeat button. It raises the 'Click' event repeatedly from the it is pressed until it is released. + * @Default {false} + */ + repeatButton?: boolean; + + /**Displays the Button with rounded corners. + * @Default {false} + */ + showRoundedCorner?: boolean; + + /**Specifies the size of the Button. See below to know available ButtonSize + * @Default {ej.ButtonSize.Normal} + */ + size?: ej.ButtonSize|string; + + /**Specifies the secondary icon for Button. This icon will be displayed from the right margin of the button. + * @Default {null} + */ + suffixIcon?: string; + + /**Specifies the text content for Button. + * @Default {null} + */ + text?: string; + + /**Specified the time interval between two consecutive 'click' event on the button. + * @Default {150} + */ + timeInterval?: string; + + /**Specifies the Type of the Button. See below to know available ButtonType + * @Default {ej.ButtonType.Submit} + */ + type?: ej.ButtonType|string; + + /**Specifies the width of the Button. + * @Default {100} + */ + width?: number; + + /**Fires when Button control is clicked successfully.Consider the scenario to perform any validation,modification of content or any other operations click on button,we can make use of this click event to achieve the scenario.*/ + click? (e: ClickEventArgs): void; + + /**Fires after Button control is created.If the user want to perform any operation after the button control creation then the user can make use of this create event.*/ + create? (e: CreateEventArgs): void; + + /**Fires when the button is destroyed successfully.If the user want to perform any operation after the destroy button control then the user can make use of this destroy event.*/ + destroy? (e: DestroyEventArgs): void; +} + +export interface ClickEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the button model + */ + model?: ej.Button.Model; + + /**returns the name of the event + */ + type?: string; + + /**return the button state + */ + status?: boolean; + + /**return the event model for sever side processing. + */ + e?: any; +} + +export interface CreateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the button model + */ + model?: ej.Button.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the button model + */ + model?: ej.Button.Model; + + /**returns the name of the event + */ + type?: string; +} +} +enum ContentType +{ +//To display the text content only in button +TextOnly, +//To display the image only in button +ImageOnly, +//Supports to display image for both ends of the button +ImageBoth, +//Supports to display image with the text content +TextAndImage, +//Supports to display image with both ends of the text +ImageTextImage, +} +enum ImagePosition +{ +//support for aligning text in left and image in right +ImageRight, +//support for aligning text in right and image in left +ImageLeft, +//support for aligning text in bottom and image in top. +ImageTop, +//support for aligning text in top and image in bottom +ImageBottom, +} +enum ButtonSize +{ +//Creates button with inbuilt default size height, width specified +Normal, +//Creates button with inbuilt mini size height, width specified +Mini, +//Creates button with inbuilt small size height, width specified +Small, +//Creates button with inbuilt medium size height, width specified +Medium, +//Creates button with inbuilt large size height, width specified +Large, +} +enum ButtonType +{ +//Creates button with inbuilt button type specified +Button, +//Creates button with inbuilt reset type specified +Reset, +//Creates button with inbuilt submit type specified +Submit, +} + +class Captcha extends ej.Widget { + static fn: Captcha; + constructor(element: JQuery, options?: Captcha.Model); + constructor(element: Element, options?: Captcha.Model); + model:Captcha.Model; + defaults:Captcha.Model; +} +export module Captcha{ + +export interface Model { + + /**Specifies the character set of the Captcha that will be used to generate captcha text randomly. + */ + characterSet?: string; + + /**Specifies the error message to be displayed when the Captcha mismatch. + */ + customErrorMessage?: string; + + /**Set the Captcha validation automatically. + */ + enableAutoValidation?: boolean; + + /**Specifies the case sensitivity for the characters typed in the Captcha. + */ + enableCaseSensitivity?: boolean; + + /**Specifies the background patterns for the Captcha. + */ + enablePattern?: boolean; + + /**Sets the Captcha direction as right to left alignment. + */ + enableRTL?: boolean; + + /**Specifies the background apperance for the captcha. + */ + hatchStyle?: ej.HatchStyle|string; + + /**Specifies the height of the Captcha. + */ + height?: number; + + /**Specifies the method with values to be mapped in the Captcha. + */ + mapper?: string; + + /**Specifies the maximum number of characters used in the Captcha. + */ + maximumLength?: number; + + /**Specifies the minimum number of characters used in the Captcha. + */ + minimumLength?: number; + + /**Specifies the method to map values to Captcha. + */ + requestMapper?: string; + + /**Sets the Captcha with audio support, that enables to dictate the captcha text. + */ + showAudioButton?: boolean; + + /**Sets the Captcha with a refresh button. + */ + showRefreshButton?: boolean; + + /**Specifies the target button of the Captcha to validate the entered text and captcha text. + */ + targetButton?: string; + + /**Specifies the target input element that will verify the Captcha. + */ + targetInput?: string; + + /**Specifies the width of the Captcha. + */ + width?: number; + + /**Fires when captch refresh begins.*/ + refreshBegin? (e: RefreshBeginEventArgs): void; + + /**Fires after captch refresh completed.*/ + refreshComplete? (e: RefreshCompleteEventArgs): void; + + /**Fires when captch refresh fails to load.*/ + refreshFailure? (e: RefreshFailureEventArgs): void; + + /**Fires after captch refresh succeeded.*/ + refreshSuccess? (e: RefreshSuccessEventArgs): void; +} + +export interface RefreshBeginEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the Captcha model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface RefreshCompleteEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the Captcha model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface RefreshFailureEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the Captcha model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface RefreshSuccessEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the Captcha model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; +} +} +enum HatchStyle +{ +//Set background as None to Captcha +None, +//Set background as BackwardDiagonal to Captcha +BackwardDiagonal, +//Set background as Cross to Captcha +Cross, +//Set background as DarkDownwardDiagonal to Captcha +DarkDownwardDiagonal, +//Set background as DarkHorizontal to Captcha +DarkHorizontal, +//Set background as DarkUpwardDiagonal to Captcha +DarkUpwardDiagonal, +//Set background as DarkVertical to Captcha +DarkVertical, +//Set background as DashedDownwardDiagonal to Captcha +DashedDownwardDiagonal, +//Set background as DashedHorizontal to Captcha +DashedHorizontal, +//Set background as DashedUpwardDiagonal to Captcha +DashedUpwardDiagonal, +//Set background as DashedVertical to Captcha +DashedVertical, +//Set background as DiagonalBrick to Captcha +DiagonalBrick, +//Set background as DiagonalCross to Captcha +DiagonalCross, +//Set background as Divot to Captcha +Divot, +//Set background as DottedDiamond to Captcha +DottedDiamond, +//Set background as DottedGrid to Captcha +DottedGrid, +//Set background as ForwardDiagonal to Captcha +ForwardDiagonal, +//Set background as Horizontal to Captcha +Horizontal, +//Set background as HorizontalBrick to Captcha +HorizontalBrick, +//Set background as LargeCheckerBoard to Captcha +LargeCheckerBoard, +//Set background as LargeConfetti to Captcha +LargeConfetti, +//Set background as LargeGrid to Captcha +LargeGrid, +//Set background as LightDownwardDiagonal to Captcha +LightDownwardDiagonal, +//Set background as LightHorizontal to Captcha +LightHorizontal, +//Set background as LightUpwardDiagonal to Captcha +LightUpwardDiagonal, +//Set background as LightVertical to Captcha +LightVertical, +//Set background as Max to Captcha +Max, +//Set background as Min to Captcha +Min, +//Set background as NarrowHorizontal to Captcha +NarrowHorizontal, +//Set background as NarrowVertical to Captcha +NarrowVertical, +//Set background as OutlinedDiamond to Captcha +OutlinedDiamond, +//Set background as Percent90 to Captcha +Percent90, +//Set background as Wave to Captcha +Wave, +//Set background as Weave to Captcha +Weave, +//Set background as WideDownwardDiagonal to Captcha +WideDownwardDiagonal, +//Set background as WideUpwardDiagonal to Captcha +WideUpwardDiagonal, +//Set background as ZigZag to Captcha +ZigZag, +} + +class ListBox extends ej.Widget { + static fn: ListBox; + constructor(element: JQuery, options?: ListBox.Model); + constructor(element: Element, options?: ListBox.Model); + model:ListBox.Model; + defaults:ListBox.Model; + + /** Adds a given list items in the ListBox widget at a specified index. It accepts two parameters. + * @param {any|string} This can be a list item object (for JSON binding) or a string (for UL and LI rendering). Also we can the specify this as an array of list item object or an array of strings to add multiple items. + * @param {number} The index value to add the given items at the specified index. If index is not specified, the given items will be added at the end of the list. + * @returns {void} + */ + addItem(listItem: any|string, index: number): void; + + /** Checks all the list items in the ListBox widget. It is dependent on showCheckbox property. + * @returns {void} + */ + checkAll(): void; + + /** Checks a list item by using its index. It is dependent on showCheckbox property. + * @param {number} Index of the listbox item to be checked. If index is not specified, the given items will be added at the end of the list. + * @returns {void} + */ + checkItemByIndex(index: number): void; + + /** Checks multiple list items by using its index values. It is dependent on showCheckbox property. + * @param {number[]} Index/Indices of the listbox items to be checked. If index is not specified, the given items will be added at the end of the list. + * @returns {void} + */ + checkItemsByIndices(indices: number[]): void; + + /** Disables the ListBox widget. + * @returns {void} + */ + disable(): void; + + /** Disables a list item by passing the item text as parameter. + * @param {string} Text of the listbox item to be disabled. + * @returns {void} + */ + disableItem(text: string): void; + + /** Disables a list Item using its index value. + * @param {number} Index of the listbox item to be disabled. + * @returns {void} + */ + disableItemByIndex(index: number): void; + + /** Disables set of list Items using its index values. + * @param {number[]|string} Indices of the listbox items to be disabled. + * @returns {void} + */ + disableItemsByIndices(Indices: number[]|string): void; + + /** Enables the ListBox widget when it is disabled. + * @returns {void} + */ + enable(): void; + + /** Enables a list Item using its item text value. + * @param {string} Text of the listbox item to be enabled. + * @returns {void} + */ + enableItem(text: string): void; + + /** Enables a list item using its index value. + * @param {number} Index of the listbox item to be enabled. + * @returns {void} + */ + enableItemByIndex(index: number): void; + + /** Enables a set of list Items using its index values. + * @param {number[]|string} Indices of the listbox items to be enabled. + * @returns {void} + */ + enableItemsByIndices(indices: number[]|string): void; + + /** Returns the list of checked items in the ListBox widget. It is dependent on showCheckbox property. + * @returns {any} + */ + getCheckedItems(): any; + + /** Returns the list of selected items in the ListBox widget. + * @returns {any} + */ + getSelectedItems(): any; + + /** Returns an item’s index based on the given text. + * @param {string} The list item text (label) + * @returns {number} + */ + getIndexByText(text: string): number; + + /** Returns an item’s index based on the value given. + * @param {string} The list item’s value + * @returns {number} + */ + getIndexByValue(indices: string): number; + + /** Returns an item’s text (label) based on the index given. + * @returns {string} + */ + getTextByIndex(): string; + + /** Returns a list item’s object using its index. + * @returns {any} + */ + getItemByIndex(): any; + + /** Returns a list item’s object based on the text given. + * @param {string} The list item text. + * @returns {any} + */ + getItemByText(text: string): any; + + /** Merges the given data with the existing data items in the listbox. + * @param {Array} Data to merge in listbox. + * @returns {void} + */ + mergeData(data: Array): void; + + /** Selects the next item based on the current selection. + * @returns {void} + */ + moveDown(): void; + + /** Selects the previous item based on the current selection. + * @returns {void} + */ + moveUp(): void; + + /** Refreshes the ListBox widget. + * @param {boolean} Refreshes both the datasource and the dimensions of the ListBox widget when the parameter is passed as true, otherwise only the ListBox dimensions will be refreshed. + * @returns {void} + */ + refresh(refreshData: boolean): void; + + /** Removes all the list items from listbox. + * @returns {void} + */ + removeAll(): void; + + /** Removes the selected list items from the listbox. + * @returns {void} + */ + removeSelectedItems(): void; + + /** Removes a list item by using its text. + * @param {string} Text of the listbox item to be removed. + * @returns {void} + */ + removeItemByText(text: string): void; + + /** Removes a list item by using its index value. + * @param {number} Index of the listbox item to be removed. + * @returns {void} + */ + removeItemByIndex(index: number): void; + + /** + * @returns {void} + */ + selectAll(): void; + + /** Selects the list tem using its text value. + * @param {string} Text of the listbox item to be selected. + * @returns {void} + */ + selectItemByText(text: string): void; + + /** Selects list tem using its value property. + * @param {string} Value of the listbox item to be selected. + * @returns {void} + */ + selectItemByValue(value: string): void; + + /** Selects list item using its index value. + * @param {number} Index of the listbox item to be selected. + * @returns {void} + */ + selectItemByIndex(index: number): void; + + /** Selects a set of list items through its index values. + * @param {number|number[]} Index/Indices of the listbox item to be selected. + * @returns {void} + */ + selectItemsByIndices(Indices: number|number[]): void; + + /** Unchecks all the checked list items in the ListBox widget. To use this method showCheckbox property to be set as true. + * @returns {void} + */ + uncheckAll(): void; + + /** Unchecks a checked list item using its index value. To use this method showCheckbox property to be set as true. + * @param {number} Index of the listbox item to be unchecked. + * @returns {void} + */ + uncheckItemByIndex(index: number): void; + + /** Unchecks the set of checked list items using its index values. To use this method showCheckbox property must be set to true. + * @param {number[]|string} Indices of the listbox item to be unchecked. + * @returns {void} + */ + uncheckItemsByIndices(indices: number[]|string): void; + + /** + * @returns {void} + */ + unselectAll(): void; + + /** Unselects a selected list item using its index value + * @param {number} Index of the listbox item to be unselected. + * @returns {void} + */ + unselectItemByIndex(index: number): void; + + /** Unselects a selected list item using its text value. + * @param {string} Text of the listbox item to be unselected. + * @returns {void} + */ + unselectItemByText(text: string): void; + + /** Unselects a selected list item using its value. + * @param {string} Value of the listbox item to be unselected. + * @returns {void} + */ + unselectItemByValue(value: string): void; + + /** Unselects a set of list items using its index values. + * @param {number[]|string} Indices of the listbox item to be unselected. + * @returns {void} + */ + unselectItemsByIndices(indices: number[]|string): void; + + /** Hides all the checked items in the listbox. + * @returns {void} + */ + hideCheckedItems (): void; + + /** Shows a set of hidden list Items using its index values. + * @param {number[]|string} Indices of the listbox items to be shown. + * @returns {void} + */ + showItemByIndices(indices: number[]|string): void; + + /** Hides a set of list Items using its index values. + * @param {number[]|string} Indices of the listbox items to be hidden. + * @returns {void} + */ + hideItemsByIndices(indices: number[]|string): void; + + /** Shows the hidden list items using its values. + * @param {Array} Values of the listbox items to be shown. + * @returns {void} + */ + showItemsByValues(values: Array): void; + + /** Hides the list item using its values. + * @param {Array} Values of the listbox items to be hidden. + * @returns {void} + */ + hideItemsByValues(values: Array): void; + + /** Shows a hidden list item using its value. + * @param {string} Value of the listbox item to be shown. + * @returns {void} + */ + showItemByValue(value: string): void; + + /** Hide a list item using its value. + * @param {string} Value of the listbox item to be hidden. + * @returns {void} + */ + hideItemByValue(value: string): void; + + /** Shows a hidden list item using its index value. + * @param {number} Index of the listbox item to be shown. + * @returns {void} + */ + showItemByIndex(index: number): void; + + /** Hides a list item using its index value. + * @param {number} Index of the listbox item to be hidden. + * @returns {void} + */ + hideItemByIndex (index: number): void; + + /** + * @returns {void} + */ + show(): void; + + /** Hides the listbox. + * @returns {void} + */ + hide(): void; + + /** Hides all the listbox items in the listbox. + * @returns {void} + */ + hideAllItems(): void; + + /** Shows all the listbox items in the listbox. + * @returns {void} + */ + showAllItems(): void; +} +export module ListBox{ + +export interface Model { + + /**Enables/disables the dragging behavior of the items in ListBox widget. + * @Default {false} + */ + allowDrag?: boolean; + + /**Accepts the items which are dropped in to it, when it is set to true. + * @Default {false} + */ + allowDrop?: boolean; + + /**Enables or disables multiple selection. + * @Default {false} + */ + allowMultiSelection?: boolean; + + /**Loads the list data on demand via scrolling behavior to improve the application’s performance. There are two ways to load data which can be defined using “virtualScrollMode” property. + * @Default {false} + */ + allowVirtualScrolling?: boolean; + + /**Enables or disables the case sensitive search for list item by typing the text (search) value. + * @Default {false} + */ + caseSensitiveSearch?: boolean; + + /**Dynamically populate data of a list box while selecting an item in another list box i.e. rendering child list box based on the item selection in parent list box. This property accepts the id of the child ListBox widget to populate the data. + * @Default {null} + */ + cascadeTo?: string; + + /**Set of list items to be checked by default using its index. It works only when the showCheckbox property is set to true. + * @Default {null} + */ + checkedIndices?: string; + + /**The root class for the ListBox widget to customize the existing theme. + * @Default {“”} + */ + cssClass?: string; + + /**Contains the list of data for generating the list items. + * @Default {null} + */ + dataSource?: any; + + /**Enables or disables the ListBox widget. + * @Default {true} + */ + enabled?: boolean; + + /**Enables or disables the search behavior to find the specific list item by typing the text value. + * @Default {false} + */ + enableIncrementalSearch?: boolean; + + /**Allows the current model values to be saved in local storage or browser cookies for state maintenance when it is set to true. + * @Default {false} + */ + enablePersistence?: boolean; + + /**Displays the ListBox widget’s content from right to left when enabled. + * @Default {false} + */ + enableRTL?: boolean; + + /**Mapping fields for the data items of the ListBox widget. + * @Default {null} + */ + fields?: any; + + /**Defines the height of the ListBox widget. + * @Default {null} + */ + height?: string; + + /**The number of list items to be shown in the ListBox widget. The remaining list items will be scrollable. + * @Default {null} + */ + itemsCount?: number; + + /**The total number of list items to be rendered in the ListBox widget. + * @Default {null} + */ + totalItemsCount?: number; + + /**The number of list items to be loaded in the list box while enabling virtual scrolling and when virtualScrollMode is set to continuous. + * @Default {5} + */ + itemRequestCount?: number; + + /**Loads data for the listbox by default (i.e. on initialization) when it is set to true. It creates empty ListBox if it is set to false. + */ + loadDataOnInit?: boolean; + + /**The query to retrieve required data from the data source. + * @Default {ej.Query()} + */ + query?: ej.Query|string; + + /**The list item to be selected by default using its index. + * @Default {null} + */ + selectedIndex?: number; + + /**The list items to be selected by default using its indices. To use this property allowMultiSelection should be enabled. + * @Default {[]} + */ + selectedIndices?: Array; + + /**Enables/Disables the multi selection option with the help of checkbox control. + * @Default {false} + */ + showCheckbox?: boolean; + + /**To display the ListBox container with rounded corners. + * @Default {false} + */ + showRoundedCorner?: boolean; + + /**The template to display the ListBox widget with customized appearance. + * @Default {null} + */ + template?: string; + + /**Holds the selected items values and used to bind value to the list item using angular and knockout. + * @Default {“”} + */ + value?: number; + + /**Specifies the virtual scroll mode to load the list data on demand via scrolling behavior. There are two types of mode. + */ + virtualScrollMode?: ej.VirtualScrollMode|string; + + /**Defines the width of the ListBox widget. + * @Default {null} + */ + width?: string; + + /**Specifies the targetID for the listbox items. + */ + targetID?: string; + + /**Triggers before the AJAX request begins to load data in the ListBox widget.*/ + actionBegin? (e: ActionBeginEventArgs): void; + + /**Triggers after the data requested via AJAX is successfully loaded in the ListBox widget.*/ + actionSuccess? (e: ActionSuccessEventArgs): void; + + /**Triggers when the AJAX requests complete. The request may get failed or succeed.*/ + actionComplete? (e: ActionCompleteEventArgs): void; + + /**Triggers when the data requested from AJAX get failed.*/ + actionFailure? (e: ActionFailureEventArgs): void; + + /**Event will be triggered before the requested data via AJAX once loaded in successfully.*/ + actionBeforeSuccess? (e: ActionBeforeSuccessEventArgs): void; + + /**Triggers when the item selection is changed.*/ + change? (e: ChangeEventArgs): void; + + /**Triggers when the list item is checked or unchecked.*/ + checkChange? (e: CheckChangeEventArgs): void; + + /**Triggers when the ListBox widget is created successfully.*/ + create? (e: CreateEventArgs): void; + + /**Triggers when the ListBox widget is destroyed successfully.*/ + destroy? (e: DestroyEventArgs): void; + + /**Triggers when focus the listbox items.*/ + focusIn? (e: FocusInEventArgs): void; + + /**Triggers when focus out from listbox items.*/ + focusOut? (e: FocusOutEventArgs): void; + + /**Triggers when the list item is being dragged.*/ + itemDrag? (e: ItemDragEventArgs): void; + + /**Triggers when the list item is ready to be dragged.*/ + itemDragStart? (e: ItemDragStartEventArgs): void; + + /**Triggers when the list item stops dragging.*/ + itemDragStop? (e: ItemDragStopEventArgs): void; + + /**Triggers when the list item is dropped.*/ + itemDrop? (e: ItemDropEventArgs): void; + + /**Triggers when a list item gets selected.*/ + select? (e: SelectEventArgs): void; + + /**Triggers when a list item gets unselected.*/ + unselect? (e: UnselectEventArgs): void; +} + +export interface ActionBeginEventArgs { +} + +export interface ActionSuccessEventArgs { +} + +export interface ActionCompleteEventArgs { +} + +export interface ActionFailureEventArgs { +} + +export interface ActionBeforeSuccessEventArgs { + + /**Instance of the listbox model object. + */ + model?: any; + + /**Name of the event. + */ + type?: string; + + /**List of actual object. + */ + actual?: any; + + /**Object of ListBox widget which contains DataManager arguments + */ + request?: any; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**List of array object + */ + result?: Array; + + /**ExcuteQuery object of DataManager + */ + xhr?: any; +} + +export interface ChangeEventArgs { + + /**Instance of the listbox model object. + */ + model?: any; + + /**Name of the event. + */ + type?: string; + + /**List item object. + */ + item?: any; + + /**The Datasource of the listbox. + */ + data?: any; + + /**List item’s index. + */ + index?: number; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Boolean value based on whether the list item is checked or not. + */ + isChecked?: boolean; + + /**Boolean value based on whether the list item is selected or not. + */ + isSelected?: boolean; + + /**Boolean value based on the list item is enabled or not. + */ + isEnabled?: boolean; + + /**List item’s text (label). + */ + text?: string; + + /**List item’s value. + */ + value?: string; +} + +export interface CheckChangeEventArgs { + + /**Instance of the listbox model object. + */ + model?: any; + + /**Name of the event. + */ + type?: string; + + /**List item object. + */ + item?: any; + + /**The Datasource of the listbox. + */ + data?: any; + + /**List item’s index. + */ + index?: number; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Boolean value based on whether the list item is checked or not. + */ + isChecked?: boolean; + + /**Boolean value based on whether the list item is selected or not. + */ + isSelected?: boolean; + + /**Boolean value based on the list item is enabled or not. + */ + isEnabled?: boolean; + + /**List item’s text (label). + */ + text?: string; + + /**List item’s value. + */ + value?: string; +} + +export interface CreateEventArgs { + + /**Instance of the listbox model object. + */ + model?: ej.ListBox.Model; + + /**Name of the event. + */ + type?: string; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; +} + +export interface DestroyEventArgs { + + /**Instance of the listbox model object. + */ + model?: any; + + /**Name of the event. + */ + type?: string; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; +} + +export interface FocusInEventArgs { + + /**Instance of the listbox model object. + */ + model?: any; + + /**Name of the event. + */ + type?: string; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; +} + +export interface FocusOutEventArgs { + + /**Instance of the listbox model object. + */ + model?: any; + + /**Name of the event. + */ + type?: string; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; +} + +export interface ItemDragEventArgs { + + /**Instance of the listbox model object. + */ + model?: any; + + /**Name of the event. + */ + type?: string; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**The Datasource of the listbox. + */ + data?: any; + + /**List item’s index. + */ + index?: number; + + /**Boolean value based on whether the list item is checked or not. + */ + isChecked?: boolean; + + /**Boolean value based on whether the list item is selected or not. + */ + isSelected?: boolean; + + /**Boolean value based on whether the list item is enabled or not. + */ + isEnabled?: boolean; + + /**List item’s text (label). + */ + text?: string; + + /**List item’s value. + */ + value?: string; +} + +export interface ItemDragStartEventArgs { + + /**Instance of the listbox model object. + */ + model?: any; + + /**Name of the event. + */ + type?: string; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**The Datasource of the listbox. + */ + data?: any; + + /**List item’s index. + */ + index?: number; + + /**Boolean value based on whether the list item is checked or not. + */ + isChecked?: boolean; + + /**Boolean value based on whether the list item is selected or not. + */ + isSelected?: boolean; + + /**Boolean value based on whether the list item is enabled or not. + */ + isEnabled?: boolean; + + /**List item’s text (label). + */ + text?: string; + + /**List item’s value. + */ + value?: string; +} + +export interface ItemDragStopEventArgs { + + /**Instance of the listbox model object. + */ + model?: any; + + /**Name of the event. + */ + type?: string; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**The Datasource of the listbox. + */ + data?: any; + + /**List item’s index. + */ + index?: number; + + /**Boolean value based on whether the list item is checked or not. + */ + isChecked?: boolean; + + /**Boolean value based on whether the list item is selected or not. + */ + isSelected?: boolean; + + /**Boolean value based on whether the list item is enabled or not. + */ + isEnabled?: boolean; + + /**List item’s text (label). + */ + text?: string; + + /**List item’s value. + */ + value?: string; +} + +export interface ItemDropEventArgs { + + /**Instance of the listbox model object. + */ + model?: any; + + /**Name of the event. + */ + type?: string; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**The Datasource of the listbox. + */ + data?: any; + + /**List item’s index. + */ + index?: number; + + /**Boolean value based on whether the list item is checked or not. + */ + isChecked?: boolean; + + /**Boolean value based on whether the list item is selected or not. + */ + isSelected?: boolean; + + /**Boolean value based on whether the list item is enabled or not. + */ + isEnabled?: boolean; + + /**List item’s text (label). + */ + text?: string; + + /**List item’s value. + */ + value?: string; +} + +export interface SelectEventArgs { + + /**Instance of the listbox model object. + */ + model?: any; + + /**Name of the event. + */ + type?: string; + + /**List item object. + */ + item?: any; + + /**The Datasource of the listbox. + */ + data?: any; + + /**List item’s index. + */ + index?: number; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Boolean value based on whether the list item is checked or not. + */ + isChecked?: boolean; + + /**Boolean value based on whether the list item is selected or not. + */ + isSelected?: boolean; + + /**Boolean value based on the list item is enabled or not. + */ + isEnabled?: boolean; + + /**List item’s text (label). + */ + text?: string; + + /**List item’s value. + */ + value?: string; +} + +export interface UnselectEventArgs { + + /**Instance of the listbox model object. + */ + model?: any; + + /**Name of the event. + */ + type?: string; + + /**List item object. + */ + item?: any; + + /**The Datasource of the listbox. + */ + data?: any; + + /**List item’s index. + */ + index?: number; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Boolean value based on whether the list item is checked or not. + */ + isChecked?: boolean; + + /**Boolean value based on whether the list item is selected or not. + */ + isSelected?: boolean; + + /**Boolean value based on the list item is enabled or not. + */ + isEnabled?: boolean; + + /**List item’s text (label). + */ + text?: string; + + /**List item’s value. + */ + value?: string; +} +} + +class Calculate extends ej.Widget { + static fn: Calculate; + constructor(element: JQuery, options?: Calculate.Model); + constructor(element: Element, options?: Calculate.Model); + model:Calculate.Model; + defaults:Calculate.Model; + + /** Add the custom formuls with function in CalcEngine library + * @param {string} pass the formula name + * @param {string} pass the custom function name to call + * @returns {void} + */ + addCustomFunction(FormulaName: string, FunctionName: string): void; + + /** Adds a named range to the NamedRanges collection + * @param {string} pass the namedRange's name + * @param {string} pass the cell range of NamedRange + * @returns {void} + */ + addNamedRange(Name: string, cellRange: string): void; + + /** Accepts a possible parsed formula and returns the calculated value without quotes. + * @param {string} pass the cell range to adjust its range + * @returns {string} + */ + adjustRangeArg(Name: string): string; + + /** When a formula cell changes, call this method to clear it from its dependent cells. + * @param {string} pass the changed cell address + * @returns {void} + */ + clearFormulaDependentCells(Cell: string): void; + + /** Call this method to clear whether an exception was raised during the computation of a library function. + * @returns {void} + */ + clearLibraryComputationException(): void; + + /** Get the column index from a cell reference passed in. + * @param {string} pass the cell address + * @returns {void} + */ + colIndex(Cell: string): void; + + /** Evaluates a parsed formula. + * @param {string} pass the parsed formula + * @returns {string} + */ + computedValue(Formula: string): string; + + /** Evaluates a parsed formula. + * @param {string} pass the parsed formula + * @returns {string} + */ + computeFormula(Formula: string): string; +} +export module Calculate{ + +export interface Model { +} +} + +class CheckBox extends ej.Widget { + static fn: CheckBox; + constructor(element: JQuery, options?: CheckBox.Model); + constructor(element: Element, options?: CheckBox.Model); + model:CheckBox.Model; + defaults:CheckBox.Model; + + /** Destroy the CheckBox widget all events bound using this._on will be unbind automatically and bring the control to pre-init state. + * @returns {void} + */ + destroy(): void; + + /** Disable the CheckBox to prevent all user interactions. + * @returns {void} + */ + disable(): void; + + /** To enable the CheckBox + * @returns {void} + */ + enable(): void; + + /** To Check the status of CheckBox + * @returns {boolean} + */ + isChecked(): boolean; +} +export module CheckBox{ + +export interface Model { + + /**Specifies whether CheckBox has to be in checked or not. We can also specify array of string as value for this property. If any of the value in the specified array matches the value of the textbox, then it will be considered as checked. It will be useful in MVVM binding, specify array type to identify the values of the checked CheckBoxes. + * @Default {false} + */ + checked?: boolean|string[]; + + /**Specifies the State of CheckBox.See below to get available CheckState + * @Default {null} + */ + checkState?: ej.CheckState|string; + + /**Sets the root CSS class for CheckBox theme, which is used customize. + */ + cssClass?: string; + + /**Specifies the checkbox control state. + * @Default {true} + */ + enabled?: boolean; + + /**Specifies the persist property for CheckBox while initialization. The persist API save current model value to browser cookies for state maintains. While refreshing the CheckBox control page the model value apply from browser cookies. + * @Default {false} + */ + enablePersistence?: boolean; + + /**Specify the Right to Left direction to Checkbox + * @Default {false} + */ + enableRTL?: boolean; + + /**Specifies the enable or disable Tri-State for checkbox control. + * @Default {false} + */ + enableTriState?: boolean; + + /**It allows to define the characteristics of the CheckBox control. It will helps to extend the capability of an HTML element. + * @Default {{}} + */ + htmlAttributes?: any; + + /**Specified value to be added an id attribute of the CheckBox. + * @Default {null} + */ + id?: string; + + /**Specify the prefix value of id to be added before the current id of the CheckBox. + * @Default {ej} + */ + idPrefix?: string; + + /**Specifies the name attribute of the CheckBox. + * @Default {null} + */ + name?: string; + + /**Displays rounded corner borders to CheckBox + * @Default {false} + */ + showRoundedCorner?: boolean; + + /**Specifies the size of the CheckBox.See below to know available CheckboxSize + * @Default {small} + */ + size?: ej.CheckboxSize|string; + + /**Specifies the text content to be displayed for CheckBox. + */ + text?: string; + + /**Set the jQuery validation error message in CheckBox. + * @Default {null} + */ + validationMessage?: any; + + /**Set the jQuery validation rules in CheckBox. + * @Default {null} + */ + validationRules?: any; + + /**Specifies the value attribute of the CheckBox. + * @Default {null} + */ + value?: string; + + /**Fires before the CheckBox is going to changed its state successfully*/ + beforeChange? (e: BeforeChangeEventArgs): void; + + /**Fires when the CheckBox state is changed successfully*/ + change? (e: ChangeEventArgs): void; + + /**Fires when the CheckBox state is created successfully*/ + create? (e: CreateEventArgs): void; + + /**Fires when the CheckBox state is destroyed successfully*/ + destroy? (e: DestroyEventArgs): void; +} + +export interface BeforeChangeEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the CheckBox model + */ + model?: ej.CheckBox.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the event model values + */ + event?: any; + + /**returns the status whether the element is checked or not. + */ + isChecked?: boolean; +} + +export interface ChangeEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the CheckBox model + */ + model?: ej.CheckBox.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the event arguments + */ + event?: any; + + /**returns the status whether the element is checked or not. + */ + isChecked?: boolean; + + /**returns the state of the checkbox + */ + checkState?: string; +} + +export interface CreateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the CheckBox model + */ + model?: ej.CheckBox.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the CheckBox model + */ + model?: ej.CheckBox.Model; + + /**returns the name of the event + */ + type?: string; +} +} +enum CheckState +{ +//string +Uncheck, +//string +Check, +//string +Indeterminate, +} +enum CheckboxSize +{ +//Displays the CheckBox in medium size +Medium, +//Displays the CheckBox in small size +Small, +} + +class ColorPicker extends ej.Widget { + static fn: ColorPicker; + constructor(element: JQuery, options?: ColorPicker.Model); + constructor(element: Element, options?: ColorPicker.Model); + model:ColorPicker.Model; + defaults:ColorPicker.Model; + + /** Disables the color picker control + * @returns {void} + */ + disable(): void; + + /** Enable the color picker control + * @returns {void} + */ + enable(): void; + + /** Gets the selected color in RGB format + * @returns {any} + */ + getColor(): any; + + /** Gets the selected color value as string + * @returns {string} + */ + getValue(): string; + + /** To Convert color value from hexCode to RGB + * @returns {any} + */ + hexCodeToRGB(): any; + + /** Hides the ColorPicker popup, if in opened state. + * @returns {void} + */ + hide(): void; + + /** Convert color value from HSV to RGB + * @returns {any} + */ + HSVToRGB(): any; + + /** Convert color value from RGB to HEX + * @returns {string} + */ + RGBToHEX(): string; + + /** Convert color value from RGB to HSV + * @returns {any} + */ + RGBToHSV(): any; + + /** Open the ColorPicker popup. + * @returns {void} + */ + show(): void; +} +export module ColorPicker{ + +export interface Model { + + /**The ColorPicker control allows to define the customized text to displayed in button elements. Using the property to achieve the customized culture values. + * @Default {buttonText.apply= Apply, buttonText.cancel= Cancel,buttonText.swatches=Swatches} + */ + buttonText?: any; + + /**Allows to change the mode of the button. Please refer below to know available button mode + * @Default {ej.ButtonMode.Split} + */ + buttonMode?: ej.ButtonMode|string; + + /**Specifies the number of columns to be displayed color palette model. + * @Default {10} + */ + columns?: number; + + /**This property allows you to customize its appearance using user-defined CSS and custom skin options such as colors and backgrounds. + */ + cssClass?: string; + + /**This property allows to define the custom colors in the palette model.Custom palettes are created by passing a comma delimited string of HEX values or an array of colors. + * @Default {empty} + */ + custom?: Array; + + /**This property allows to embed the popup in the order of DOM element flow . When we set the value as true, the color picker popup is always in visible state. + * @Default {false} + */ + displayInline?: boolean; + + /**This property allows to change the control in enabled or disabled state. + * @Default {true} + */ + enabled?: boolean; + + /**This property allows to enable or disable the opacity slider in the color picker control + * @Default {true} + */ + enableOpacity?: boolean; + + /**It allows to define the characteristics of the ColorPicker control. It will helps to extend the capability of an HTML element. + * @Default {{}} + */ + htmlAttributes?: any; + + /**Specifies the model type to be rendered initially in the color picker control. See below to get available ModelType + * @Default {ej.ColorPicker.ModelType.Default} + */ + modelType?: ej.ColorPicker.ModelType|string; + + /**This property allows to change the opacity value .The selected color opacity will be adjusted by using this opacity value. + * @Default {100} + */ + opacityValue?: number; + + /**Specifies the palette type to be displayed at initial time in palette model.There two types of palette model available in ColorPicker control. See below available Palette + * @Default {ej.ColorPicker.Palette.BasicPalette} + */ + palette?: ej.ColorPicker.Palette|string; + + /**This property allows to define the preset model to be rendered initially in palette type.It consists of 12 different types of presets. Each presets have 50 colors. See below available Presets + * @Default {ej.ColorPicker.Presets.Basic} + */ + presetType?: ej.ColorPicker.Presets|string; + + /**Allows to show/hides the apply and cancel buttons in ColorPicker control + * @Default {true} + */ + showApplyCancel?: boolean; + + /**Allows to show/hides the clear button in ColorPicker control + * @Default {true} + */ + showClearButton?: boolean; + + /**This property allows to provides live preview support for current cursor selection color and selected color. + * @Default {true} + */ + showPreview?: boolean; + + /**This property allows to store the color values in custom list.The ColorPicker will keep up to 11 colors in a custom list.By clicking the add button, the selected color from picker or palette will get added in the recent color list. + * @Default {false} + */ + showRecentColors?: boolean; + + /**This property allows to shows tooltip to notify the slider value in color picker control. + * @Default {false} + */ + showTooltip?: boolean; + + /**Specifies the toolIcon to be displayed in dropdown control color area. + * @Default {null} + */ + toolIcon?: string; + + /**This property allows to define the customized text or content to displayed when mouse over the following elements. This property also allows to use the culture values. + * @Default {tooltipText: { switcher: Switcher, addbutton: Add Color, basic: Basic, monochrome: Mono Chrome, flatcolors: Flat Color, seawolf: Sea Wolf, webcolors: Web Colors, sandy: Sandy, pinkshades: Pink Shades, misty: Misty, citrus: Citrus, vintage: Vintage, moonlight: Moon Light, candycrush: Candy Crush, currentcolor: Current Color, selectedcolor: Selected Color }} + */ + tooltipText?: any; + + /**Specifies the color value for color picker control, the value is in hexadecimal form with prefix of "#". + * @Default {null} + */ + value?: string; + + /**Fires after Color value has been changed successfully.If the user want to perform any operation after the color value changed then the user can make use of this change event.*/ + change? (e: ChangeEventArgs): void; + + /**Fires after closing the color picker popup.*/ + close? (e: CloseEventArgs): void; + + /**Fires after Color picker control is created. If the user want to perform any operation after the color picker control creation then the user can make use of this create event.*/ + create? (e: CreateEventArgs): void; + + /**Fires after Color picker control is destroyed. If the user want to perform any operation after the color picker control destroyed then the user can make use of this destroy event.*/ + destroy? (e: DestroyEventArgs): void; + + /**Fires after opening the color picker popup*/ + open? (e: OpenEventArgs): void; + + /**Fires after Color value has been selected successfully. If the user want to perform any operation after the color value selected then the user can make use of this select event.*/ + select? (e: SelectEventArgs): void; +} + +export interface ChangeEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the color picker model + */ + model?: ej.ColorPicker.Model; + + /**returns the name of the event + */ + type?: string; + + /**return the changed color value + */ + value?: string; +} + +export interface CloseEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the color picker model + */ + model?: ej.ColorPicker.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface CreateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the color picker model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the color picker model + */ + model?: ej.ColorPicker.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface OpenEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the color picker model + */ + model?: ej.ColorPicker.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface SelectEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the color picker model + */ + model?: ej.ColorPicker.Model; + + /**returns the name of the event + */ + type?: string; + + /**return the selected color value + */ + value?: string; +} + +enum ModelType{ + + ///support palette type mode in color picker. + Palette, + + ///support palette type mode in color picker. + Picker +} + + +enum Palette{ + + ///used to show the basic palette + BasicPalette, + + ///used to show the custompalette + CustomPalette +} + + +enum Presets{ + + ///used to show the basic presets + Basic, + + ///used to show the CandyCrush colors presets + CandyCrush, + + ///used to show the Citrus colors presets + Citrus, + + ///used to show the FlatColors presets + FlatColors, + + ///used to show the Misty presets + Misty, + + ///used to show the MoonLight presets + MoonLight, + + ///used to show the PinkShades presets + PinkShades, + + ///used to show the Sandy presets + Sandy, + + ///used to show the Seawolf presets + SeaWolf, + + ///used to show the Vintage presets + Vintage, + + ///used to show the WebColors presets + WebColors +} + +} +enum ButtonMode +{ +//Displays the button in split mode +Split, +//Displays the button in Dropdown mode +Dropdown, +} + +class FileExplorer extends ej.Widget { + static fn: FileExplorer; + constructor(element: JQuery, options?: FileExplorer.Model); + constructor(element: Element, options?: FileExplorer.Model); + model:FileExplorer.Model; + defaults:FileExplorer.Model; + + /** Refresh the size of FileExplorer control. + * @returns {void} + */ + adjustSize(): void; + + /** Disable the particular context menu item. + * @param {string|HTMLElement} Id of the menu item/ Menu element to be disabled + * @returns {void} + */ + disableMenuItem(item: string|HTMLElement): void; + + /** Disable the particular toolbar item. + * @param {string|HTMLElement} Id of the toolbar item/ Tool item element to be disabled + * @returns {void} + */ + disableToolbarItem(item: string|HTMLElement): void; + + /** Enable the particular context menu item. + * @param {string|HTMLElement} Id of the menu item/ Menu element to be Enabled + * @returns {void} + */ + enableMenuItem(item: string|HTMLElement): void; + + /** Enable the particular toolbar item + * @param {string|HTMLElement} Id of the tool item/ Tool item element to be Enabled + * @returns {void} + */ + enableToolbarItem(item: string|HTMLElement): void; + + /** Refresh the content of the selected folder in FileExplorer control. + * @returns {void} + */ + refresh(): void; + + /** Remove the particular toolbar item. + * @param {string|HTMLElement} Id of the tool item/ tool item element to be removed + * @returns {void} + */ + removeToolbarItem(item: string|HTMLElement): void; +} +export module FileExplorer{ + +export interface Model { + + /**Sets the URL of server side ajax handling method that handles file operation like Read, Remove, Rename, Create, Upload, Download, Copy and Move in File Explorer. + */ + ajaxAction?: string; + + /**Specifies the data type of server side ajax handling method. + * @Default {json} + */ + ajaxDataType?: string; + + /**By using ajaxSettings property, you can customize the ajax configurations. Normally you can customize the following option in ajax handling data, url, type, async, contentType, dataType and success. For upload, download and getImage API, you can only customize url. + * @Default {{ read: {}, createFolder: {}, remove: {}, rename: {}, paste: {}, getDetails: {}, download: {}, upload: {}, getImage: {}}} + */ + ajaxSettings?: any; + + /**The FileExplorer allows to select multiple files by enabling the allowMultiSelection property. You can perform multi selection by pressing the Ctrl key or Shift key. + * @Default {true} + */ + allowMultiSelection?: boolean; + + /**Sets the root class for FileExplorer theme. This cssClass API allows to use custom skinning option for File Explorer control. By defining the root class by using this API, you have to include this root class in CSS. + */ + cssClass?: string; + + /**Enables or disables the resize support in FileExplorer control. + * @Default {false} + */ + enableResize?: boolean; + + /**Enables or disables the Right to Left alignment support in FileExplorer control. + * @Default {false} + */ + enableRTL?: boolean; + + /**Allows specified type of files only to display in FileExplorer control. + * @Default {.} + */ + fileTypes?: string; + + /**By using filterSettings property, you can customize the search functionality of the search bar in FileExplorer control. + */ + filterSettings?: FilterSettings; + + /**By using the gridSettings property, you can customize the grid behavior in the FileExplorer control. + */ + gridSettings?: GridSettings; + + /**Specifies the height of FileExplorer control. + * @Default {400} + */ + height?: string|number; + + /**Enables or disables the responsive support for FileExplorer control during the window resizing time. + * @Default {false} + */ + isResponsive?: boolean; + + /**Sets the file view type. There are two view types available, such as grid, tile. See layoutType. + * @Default {ej.FileExplorer.layoutType.Grid} + */ + layout?: ej.FileExplorer.layoutType|string; + + /**Sets the culture in FileExplorer. + * @Default {en-US} + */ + locale?: string; + + /**Sets the maximum height of FileExplorer control. + * @Default {null} + */ + maxHeight?: string|number; + + /**Sets the maximum width of FileExplorer control. + * @Default {null} + */ + maxWidth?: string|number; + + /**Sets the minimum height of FileExplorer control. + * @Default {250} + */ + minHeight?: string|number; + + /**Sets the minimum width of FileExplorer control. + * @Default {400} + */ + minWidth?: string|number; + + /**The property path denotes the filesystem path that are to be explored. The path for the filesystem can be physical path or relative path, but it has to be relevant to where the Web API is hosted. + */ + path?: string; + + /**The selectedFolder is used to select the specified folder of FileExplorer control. + */ + selectedFolder?: string; + + /**The selectedItems is used to select the specified items (file, folder) of FileExplorer control. + */ + selectedItems?: string|Array; + + /**Enables or disables the context menu option in FileExplorer control. + * @Default {true} + */ + showContextMenu?: boolean; + + /**Enables or disables the footer in FileExplorer control. The footer element displays the details of the current selected files and folders. And also the footer having the switcher to change the layout view. + * @Default {true} + */ + showFooter?: boolean; + + /**Shows or disables the toolbar in FileExplorer control. + * @Default {true} + */ + showToolbar?: boolean; + + /**Enables or disables the navigation pane in FileExplorer control. The navigation pane contains a tree view element that displays all the folders from the filesystem in a hierarchical manner. This is useful to a quick navigation of any folder in the filesystem. + * @Default {true} + */ + showNavigationPane?: boolean; + + /**The tools property is used to configure and group required toolbar items in FileExplorer control. + * @Default {{ creation:[NewFolder, Open], navigation: [Back, Forward, Upward], addressBar: [Addressbar], editing: [Refresh, Upload, Delete, Rename, Download], copyPaste: [Cut, Copy, Paste], getProperties: [Details], searchBar: [Searchbar] }} + */ + tools?: any; + + /**The toolsList property is used to arrange the toolbar items in the FileExplorer control. + * @Default {[creation, navigation, addressBar, editing, copyPaste, getProperties, searchBar]} + */ + toolsList?: Array; + + /**Gets or sets an object that indicates whether to customize the upload behavior in the FileExplorer. + */ + uploadSettings?: UploadSettings; + + /**Specifies the width of FileExplorer control. + * @Default {850} + */ + width?: string|number; + + /**Fires before the ajax request is performed.*/ + beforeAjaxRequest? (e: BeforeAjaxRequestEventArgs): void; + + /**Fires before downloading the files.*/ + beforeDownload? (e: BeforeDownloadEventArgs): void; + + /**Fires before files or folders open.*/ + beforeOpen? (e: BeforeOpenEventArgs): void; + + /**Fires before uploading the files.*/ + beforeUpload? (e: BeforeUploadEventArgs): void; + + /**Fires when file or folder is copied successfully.*/ + copy? (e: CopyEventArgs): void; + + /**Fires when new folder is created successfully in file system.*/ + createFolder? (e: CreateFolderEventArgs): void; + + /**Fires when file or folder is cut successfully.*/ + cut? (e: CutEventArgs): void; + + /**Fires when the file view type is changed.*/ + layoutChange? (e: LayoutChangeEventArgs): void; + + /**Fires when files are successfully opened.*/ + open? (e: OpenEventArgs): void; + + /**Fires when a file or folder is pasted successfully.*/ + paste? (e: PasteEventArgs): void; + + /**Fires when file or folder is deleted successfully.*/ + remove? (e: RemoveEventArgs): void; + + /**Fires when resizing is performed for FileExplorer.*/ + resize? (e: ResizeEventArgs): void; + + /**Fires when resizing is started for FileExplorer.*/ + resizeStart? (e: ResizeStartEventArgs): void; + + /**Fires this event when the resizing is stopped for FileExplorer.*/ + resizeStop? (e: ResizeStopEventArgs): void; + + /**Fires when the items from grid view or tile view of FileExplorer control is selected.*/ + select? (e: SelectEventArgs): void; +} + +export interface BeforeAjaxRequestEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the ajax response data + */ + data?: any; + + /**returns the FileExplorer model + */ + model?: ej.FileExplorer.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface BeforeDownloadEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the downloaded file names. + */ + files?: string[]; + + /**returns the FileExplorer model. + */ + model?: ej.FileExplorer.Model; + + /**returns the path of currently opened item. + */ + path?: string; + + /**returns the selected item details. + */ + selectedItems?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface BeforeOpenEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the opened item type. + */ + itemType?: string; + + /**returns the FileExplorer model. + */ + model?: ej.FileExplorer.Model; + + /**returns the path of currently opened item. + */ + path?: string; + + /**returns the selected item details. + */ + selectedItems?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface BeforeUploadEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the FileExplorer model. + */ + model?: ej.FileExplorer.Model; + + /**returns the path of currently opened item. + */ + path?: string; + + /**returns the selected item details. + */ + selectedItems?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface CopyEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the FileExplorer model. + */ + model?: ej.FileExplorer.Model; + + /**returns the name of copied file/folder. + */ + name?: string[]; + + /**returns the selected item details. + */ + selectedItems?: any; + + /**returns the source path. + */ + sourcePath?: string; + + /**returns the name of the event. + */ + type?: string; +} + +export interface CreateFolderEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the ajax response data + */ + data?: any; + + /**returns the FileExplorer model + */ + model?: ej.FileExplorer.Model; + + /**returns the selected item details + */ + selectedItems?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface CutEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the FileExplorer model. + */ + model?: ej.FileExplorer.Model; + + /**returns the name of moved file or folder. + */ + name?: string[]; + + /**returns the selected item details. + */ + selectedItems?: any; + + /**returns the source path. + */ + sourcePath?: string; + + /**returns the name of the event. + */ + type?: string; +} + +export interface LayoutChangeEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the current view type. + */ + layoutType?: string; + + /**returns the FileExplorer model. + */ + model?: ej.FileExplorer.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface OpenEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the opened item type. + */ + itemType?: any; + + /**returns the FileExplorer model. + */ + model?: ej.FileExplorer.Model; + + /**returns the path of currently opened item. + */ + path?: string; + + /**returns the selected item details. + */ + selectedItems?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface PasteEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the FileExplorer model. + */ + model?: ej.FileExplorer.Model; + + /**returns the name of moved file or folder. + */ + name?: string[]; + + /**returns the selected item details. + */ + selectedItems?: any; + + /**returns the target folder item details. + */ + targetFolder?: any; + + /**returns the target path. + */ + targetPath?: string; + + /**returns the name of the event. + */ + type?: string; +} + +export interface RemoveEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the ajax response data. + */ + data?: any; + + /**returns the FileExplorer model. + */ + model?: ej.FileExplorer.Model; + + /**returns the names of deleted items. + */ + name?: string; + + /**returns the path of deleted item. + */ + path?: string; + + /**returns the selected item details. + */ + selectedItems?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface ResizeEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the mouse move event args. + */ + event?: any; + + /**returns the FileExplorer model. + */ + model?: ej.FileExplorer.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface ResizeStartEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the mouse down event args. + */ + event?: any; + + /**returns the FileExplorer model. + */ + model?: ej.FileExplorer.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface ResizeStopEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the mouse leave event args. + */ + event?: any; + + /**returns the FileExplorer model. + */ + model?: ej.FileExplorer.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface SelectEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the FileExplorer model. + */ + model?: ej.FileExplorer.Model; + + /**returns the name of clicked item. + */ + name?: string; + + /**returns the path of clicked item. + */ + path?: string; + + /**returns the selected item details + */ + selectedItems?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface FilterSettings { + + /**Enables or disables to perform the filter operation with case sensitive. + * @Default {false} + */ + caseSensitiveSearch?: boolean; + + /**Sets the search filter type. There are several filter types available, such as "startswith", "contains", "endswith". See filterType + * @Default {ej.FileExplorer.filterType.Contains} + */ + filterType?: ej.FilterType|string; +} + +export interface GridSettings { + + /**Gets or sets a value that indicates whether to enable the dynamic sorting behavior on grid data. Sorting can be done through clicking on particular column header. + * @Default {true} + */ + allowSorting?: boolean; + + /**Gets or sets an object that indicates to render the grid with specified columns. You can use this property same as the column property in Grid control. + * @Default {[{ field: name, headerText: Name, width: 25% }, { field: type, headerText: Type, width: 20% }, { field: dateModified, headerText: Date Modified, width: 35% }, { field: size, headerText: Size, width: 15%, textAlign: right, headerTextAlign: left }]} + */ + columns?: Array; +} + +export interface UploadSettings { + + /**Specifies the maximum file size allowed to upload. It accepts the value in bytes. + * @Default {31457280} + */ + maxFileSize?: number; + + /**Enables or disables the multiple files upload. When it is enabled, you can upload multiple files at a time and when disabled, you can upload only one file at a time. + * @Default {true} + */ + allowMultipleFile?: boolean; + + /**Enables or disables the auto upload option while uploading files in FileExplorer control. + * @Default {false} + */ + autoUpload?: boolean; +} + +enum layoutType{ + + ///Supports to display files in tile view + Tile, + + ///Supports to display files in grid view + Grid, + + ///Supports to display files as large icons + LargeIcons +} + +} + +class DatePicker extends ej.Widget { + static fn: DatePicker; + constructor(element: JQuery, options?: DatePicker.Model); + constructor(element: Element, options?: DatePicker.Model); + model:DatePicker.Model; + defaults:DatePicker.Model; + + /** Disables the DatePicker control. + * @returns {void} + */ + disable(): void; + + /** Enable the DatePicker control, if it is in disabled state. + * @returns {void} + */ + enable(): void; + + /** Returns the current date value in the DatePicker control. + * @returns {string} + */ + getValue(): string; + + /** Close the DatePicker popup, if it is in opened state. + * @returns {void} + */ + hide(): void; + + /** Opens the DatePicker popup. + * @returns {void} + */ + show(): void; +} +export module DatePicker{ + +export interface Model { + + /**Used to allow or restrict the editing in DatePicker input field directly. By setting false to this API, You can only pick the date from DatePicker popup. + * @Default {true} + */ + allowEdit?: boolean; + + /**allow or restrict the drill down to multiple levels of view (month/year/decade) in DatePicker calendar + * @Default {true} + */ + allowDrillDown?: boolean; + + /**Sets the specified text value to the today button in the DatePicker calendar. + * @Default {Today} + */ + buttonText?: string; + + /**Sets the root CSS class for Accordion theme, which is used customize. + */ + cssClass?: string; + + /**Formats the value of the DatePicker in to the specified date format. If this API is not specified, dateFormat will be set based on the current culture of DatePicker. + * @Default {MM/dd/yyyy} + */ + dateFormat?: string; + + /**Specifies the header format of days in DatePicker calendar. See below to get available Headers options + * @Default {ej.DatePicker.Header.Min} + */ + dayHeaderFormat?: string | ej.DatePicker.Header; + + /**Specifies the navigation depth level in DatePicker calendar. This option is not applied when start level view option is lower than depth level view. See below to know available levels in DatePicker Calendar + */ + depthLevel?: string | ej.DatePicker.Level; + + /**Allows to embed the DatePicker calendar in the page. Also associates DatePicker with div element instead of input. + * @Default {false} + */ + displayInline?: boolean; + + /**Enables or disables the animation effect with DatePicker calendar. + * @Default {true} + */ + enableAnimation?: boolean; + + /**Enable or disable the DatePicker control. + * @Default {true} + */ + enabled?: boolean; + + /**Sustain the entire widget model of DatePicker even after form post or browser refresh + * @Default {false} + */ + enablePersistence?: boolean; + + /**Displays DatePicker calendar along with DatePicker input field in Right to Left direction. + * @Default {false} + */ + enableRTL?: boolean; + + /**Allows to enter valid or invalid date in input textbox and indicate as error if it is invalid value, when this API value is set to true. For false value, invalid date is not allowed to input field and corrected to valid date automatically, even if invalid date is given. + * @Default {false} + */ + enableStrictMode?: boolean; + + /**Used the required fields for special Dates in DatePicker in order to customize the special dates in a calendar. + * @Default {null} + */ + fields?: Fields; + + /**Specifies the header format to be displayed in the DatePicker calendar. + * @Default {MMMM yyyy} + */ + headerFormat?: string; + + /**Specifies the height of the DatePicker input text. + * @Default {28px} + */ + height?: string; + + /**HighlightSection is used to highlight currently selected date's month/week/workdays. See below to get available HighlightSection options + * @Default {none} + */ + highlightSection?: string | ej.DatePicker.HighlightSection; + + /**Weekend dates will be highlighted when this property is set to true. + * @Default {false} + */ + highlightWeekend?: boolean; + + /**Specifies the HTML Attributes of the DatePicker. + * @Default {{}} + */ + htmlAttributes?: any; + + /**Change the DatePicker calendar and date format based on given culture. + * @Default {en-US} + */ + locale?: string; + + /**Specifies the maximum date in the calendar that the user can select. + * @Default {new Date(2099, 11, 31)} + */ + maxDate?: string|Date; + + /**Specifies the minimum date in the calendar that the user can select. + * @Default {new Date(1900, 00, 01)} + */ + minDate?: string|Date; + + /**Allows to toggles the read only state of the DatePicker. When the widget is readOnly, it doesn't allow your input. + * @Default {false} + */ + readOnly?: boolean; + + /**It allows to display footer in DatePicker calendar. + * @Default {true} + */ + showFooter?: boolean; + + /**It allows to display/hides the other months days from the current month calendar in a DatePicker. + * @Default {true} + */ + showOtherMonths?: boolean; + + /**Shows/hides the date icon button at right side of textbox, which is used to open or close the DatePicker calendar popup. + * @Default {true} + */ + showPopupButton?: boolean; + + /**DatePicker input is displayed with rounded corner when this property is set to true. + * @Default {false} + */ + showRoundedCorner?: boolean; + + /**Used to show the tooltip when hovering on the days in the DatePicker calendar. + * @Default {true} + */ + showTooltip?: boolean; + + /**Specifies the special dates in DatePicker. + * @Default {null} + */ + specialDates?: any; + + /**Specifies the start day of the week in DatePicker calendar. + * @Default {0} + */ + startDay?: number; + + /**Specifies the start level view in DatePicker calendar. See below available Levels + * @Default {ej.DatePicker.Level.Month} + */ + startLevel?: string | ej.DatePicker.Level; + + /**Specifies the number of months to be navigate for one click of next and previous button in a DatePicker Calendar. + * @Default {1} + */ + stepMonths?: number; + + /**Provides option to customize the tooltip format. + * @Default {ddd MMM dd yyyy} + */ + tooltipFormat?: string; + + /**Sets the jQuery validation support to DatePicker Date value. See validation + * @Default {null} + */ + validationMessage?: any; + + /**Sets the jQuery validation custom rules to the DatePicker. see validation + * @Default {null} + */ + validationRules?: any; + + /**sets or returns the current value of DatePicker + * @Default {null} + */ + value?: string|Date; + + /**Specifies the water mark text to be displayed in input text. + * @Default {Select date} + */ + watermarkText?: string; + + /**Specifies the width of the DatePicker input text. + * @Default {160px} + */ + width?: string; + + /**Fires before closing the DatePicker popup.*/ + beforeClose? (e: BeforeCloseEventArgs): void; + + /**Fires when each date is created in the DatePicker popup calendar.*/ + beforeDateCreate? (e: BeforeDateCreateEventArgs): void; + + /**Fires before opening the DatePicker popup.*/ + beforeOpen? (e: BeforeOpenEventArgs): void; + + /**Fires when the DatePicker input value is changed.*/ + change? (e: ChangeEventArgs): void; + + /**Fires when DatePicker popup is closed.*/ + close? (e: CloseEventArgs): void; + + /**Fires when the DatePicker is created successfully.*/ + create? (e: CreateEventArgs): void; + + /**Fires when the DatePicker is destroyed successfully.*/ + destroy? (e: DestroyEventArgs): void; + + /**NameTypeDescriptioncancelbooleanSet to true when the event has to be canceled, else false.modelobjectreturns the DatePicker model.typestringreturns the name of the event.valuestringreturns the currently selected date value.*/ + focusIn? (e: FocusInEventArgs): void; + + /**Fires when DatePicker input loses the focus.*/ + focusOut? (e: FocusOutEventArgs): void; + + /**Fires when DatePicker popup is opened.*/ + open? (e: OpenEventArgs): void; + + /**Fires when a date is selected from the DatePicker popup.*/ + select? (e: SelectEventArgs): void; +} + +export interface BeforeCloseEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the DatePicker model. + */ + model?: ej.DatePicker.Model; + + /**returns the name of the event. + */ + type?: string; + + /**returns the event parameters from DatePicker. + */ + events?: any; + + /**returns the DatePicker popup. + */ + element?: HTMLElement; +} + +export interface BeforeDateCreateEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the DatePicker model. + */ + model?: ej.DatePicker.Model; + + /**returns the name of the event. + */ + type?: string; + + /**returns the currently created date object. + */ + date?: any; + + /**returns the current DOM object of the date from the Calendar. + */ + element?: HTMLElement; +} + +export interface BeforeOpenEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the DatePicker model. + */ + model?: ej.DatePicker.Model; + + /**returns the name of the event. + */ + type?: string; + + /**returns the event parameters from DatePicker. + */ + events?: any; + + /**returns the DatePicker popup. + */ + element?: HTMLElement; +} + +export interface ChangeEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the DatePicker model. + */ + model?: ej.DatePicker.Model; + + /**returns the name of the event. + */ + type?: string; + + /**returns the DatePicker input value. + */ + value?: string; + + /**returns the previously selected value. + */ + prevDate?: string; +} + +export interface CloseEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the DatePicker model. + */ + model?: ej.DatePicker.Model; + + /**returns the name of the event. + */ + type?: string; + + /**returns the current date value. + */ + value?: string; + + /**returns the previously selected value. + */ + prevDate?: string; +} + +export interface CreateEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the DatePicker model. + */ + model?: ej.DatePicker.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the DatePicker model. + */ + model?: ej.DatePicker.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface FocusInEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the DatePicker model. + */ + model?: ej.DatePicker.Model; + + /**returns the name of the event. + */ + type?: string; + + /**returns the currently selected date value. + */ + value?: string; +} + +export interface FocusOutEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the DatePicker model. + */ + model?: ej.DatePicker.Model; + + /**returns the name of the event. + */ + type?: string; + + /**returns the currently selected date value. + */ + value?: string; + + /**returns the previously selected date value. + */ + prevDate?: string; +} + +export interface OpenEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the DatePicker model. + */ + model?: ej.DatePicker.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the current date value. + */ + value?: string; + + /**returns the previously selected value. + */ + prevDate?: string; +} + +export interface SelectEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the DatePicker model. + */ + model?: ej.DatePicker.Model; + + /**returns the name of the event. + */ + type?: string; + + /**returns the current date value. + */ + value?: string; + + /**returns the previously selected value. + */ + prevDate?: string; + + /**returns whether the currently selected date is special date or not. + */ + isSpecialDay?: string; +} + +export interface Fields { + + /**Specifies the specials dates + */ + date?: string; + + /**Specifies the icon class to special dates. + */ + iconClass?: string; + + /**Specifies the tooltip to special dates. + */ + tooltip?: string; +} + +enum Header{ + + ///Removes day header in DatePicker + None, + + ///sets the short format of day name (like Sun) in header in DatePicker + Short, + + ///sets the Min format of day name (like su) in header format DatePicker + Min +} + + +enum Level{ + + ///allow navigation upto year level in DatePicker + Year, + + ///allow navigation upto decade level in DatePicker + Decade, + + ///allow navigation upto Century level in DatePicker + Century +} + + +enum HighlightSection{ + + ///Highlight the week of the currently selected date in DatePicker popup calendar + Week, + + ///Highlight the workdays in a currently selected date's week in DatePicker popup calendar + WorkDays, + + ///Nothing will be highlighted, remove highlights from DatePicker popup calendar if already exists + None +} + +} + +class DateTimePicker extends ej.Widget { + static fn: DateTimePicker; + constructor(element: JQuery, options?: DateTimePicker.Model); + constructor(element: Element, options?: DateTimePicker.Model); + model:DateTimePicker.Model; + defaults:DateTimePicker.Model; + + /** Disables the DateTimePicker control. + * @returns {void} + */ + disable(): void; + + /** Enables the DateTimePicker control. + * @returns {void} + */ + enable(): void; + + /** Returns the current datetime value in the DateTimePicker. + * @returns {string} + */ + getValue(): string; + + /** Hides or closes the DateTimePicker popup. + * @returns {void} + */ + hide(): void; + + /** Updates the current system date value and time value to the DateTimePicker. + * @returns {void} + */ + setCurrentDateTime(): void; + + /** Shows or opens the DateTimePicker popup. + * @returns {void} + */ + show(): void; +} +export module DateTimePicker{ + +export interface Model { + + /**Displays the custom text for the buttons inside the DateTimePicker popup. when the culture value changed, we can change the buttons text based on the culture. + * @Default {{ today: Today, timeNow: Time Now, done: Done, timeTitle: Time }} + */ + buttonText?: ButtonText; + + /**Set the root class for DateTimePicker theme. This cssClass API helps to use custom skinning option for DateTimePicker control. + */ + cssClass?: string; + + /**Defines the datetime format displayed in the DateTimePicker. The value should be a combination of date format and time format. + * @Default {M/d/yyyy h:mm tt} + */ + dateTimeFormat?: string; + + /**Specifies the header format of the datepicker inside the DateTimePicker popup. See DatePicker.Header + * @Default {ej.DatePicker.Header.Min} + */ + dayHeaderFormat?: ej.DatePicker.Header|string; + + /**Specifies the drill down level in datepicker inside the DateTimePicker popup. See ej.DatePicker.Level + */ + depthLevel?: ej.DatePicker.Level|string; + + /**Enable or disable the animation effect in DateTimePicker. + * @Default {true} + */ + enableAnimation?: boolean; + + /**When this property is set to false, it disables the DateTimePicker control. + * @Default {false} + */ + enabled?: boolean; + + /**Enables or disables the state maintenance of DateTimePicker. + * @Default {false} + */ + enablePersistence?: boolean; + + /**Sets the DateTimePicker direction as right to left alignment. + * @Default {false} + */ + enableRTL?: boolean; + + /**When enableStrictMode true it allows the value outside of the range also but it highlights the textbox with error class, otherwise it internally changed to the correct value. + * @Default {false} + */ + enableStrictMode?: boolean; + + /**Specifies the header format to be displayed in the DatePicker calendar inside the DateTimePicker popup. + * @Default {MMMM yyyy} + */ + headerFormat?: string; + + /**Defines the height of the DateTimePicker textbox. + * @Default {30} + */ + height?: string|number; + + /**Specifies the HTML Attributes of the ejDateTimePicker + * @Default {{}} + */ + htmlAttributes?: any; + + /**Sets the time interval between the two adjacent time values in the time popup. + * @Default {30} + */ + interval?: number; + + /**Defines the localization culture for DateTimePicker. + * @Default {en-US} + */ + locale?: string; + + /**Sets the maximum value to the DateTimePicker. Beyond the maximum value an error class is added to the wrapper element when we set true to enableStrictMode. + * @Default {new Date(12/31/2099 11:59:59 PM)} + */ + maxDateTime?: string|Date; + + /**Sets the minimum value to the DateTimePicker. Behind the minimum value an error class is added to the wrapper element. + * @Default {new Date(1/1/1900 12:00:00 AM)} + */ + minDateTime?: string|Date; + + /**Specifies the popup position of DateTimePicker.See below to know available popup positions + * @Default {ej.DateTimePicker.Bottom} + */ + popupPosition?: string | ej.popupPosition; + + /**Indicates that the DateTimePicker value can only be read and can’t change. + * @Default {false} + */ + readOnly?: boolean; + + /**It allows showing days in other months of DatePicker calendar inside the DateTimePicker popup. + * @Default {true} + */ + showOtherMonths?: boolean; + + /**Shows or hides the arrow button from the DateTimePicker textbox. When the button disabled, the DateTimePicker popup opens while focus in the textbox and hides while focus out from the textbox. + * @Default {true} + */ + showPopupButton?: boolean; + + /**Changes the sharped edges into rounded corner for the DateTimePicker textbox and popup. + * @Default {false} + */ + showRoundedCorner?: boolean; + + /**Specifies the start day of the week in datepicker inside the DateTimePicker popup. + * @Default {1} + */ + startDay?: number; + + /**Specifies the start level view in datepicker inside the DateTimePicker popup. See DatePicker.Level + * @Default {ej.DatePicker.Level.Month or month} + */ + startLevel?: ej.DatePicker.Level|string; + + /**Specifies the number of months to navigate at one click of next and previous button in datepicker inside the DateTimePicker popup. + * @Default {1} + */ + stepMonths?: number; + + /**Defines the time format displayed in the time dropdown inside the DateTimePicker popup. + * @Default {h:mm tt} + */ + timeDisplayFormat?: string; + + /**We can drill down up to time interval on selected date with meridian details. + * @Default {{ enabled: false, interval: 5, showMeridian: false, autoClose: true }} + */ + timeDrillDown?: TimeDrillDown; + + /**Defines the width of the time dropdown inside the DateTimePicker popup. + * @Default {100} + */ + timePopupWidth?: string|number; + + /**Set the jquery validation error message in DateTimePicker. + * @Default {null} + */ + validationMessage?: any; + + /**Set the jquery validation rules in DateTimePicker. + * @Default {null} + */ + validationRules?: any; + + /**Sets the DateTime value to the control. + */ + value?: string|Date; + + /**Defines the width of the DateTimePicker textbox. + * @Default {143} + */ + width?: string|number; + + /**Fires when the datetime value changed in the DateTimePicker textbox.*/ + change? (e: ChangeEventArgs): void; + + /**Fires when DateTimePicker popup closes.*/ + close? (e: CloseEventArgs): void; + + /**Fires after DateTimePicker control is created.*/ + create? (e: CreateEventArgs): void; + + /**Fires when the DateTimePicker is destroyed successfully*/ + destroy? (e: DestroyEventArgs): void; + + /**Fires when the focus-in happens in the DateTimePicker textbox.*/ + focusIn? (e: FocusInEventArgs): void; + + /**Fires when the focus-out happens in the DateTimePicker textbox.*/ + focusOut? (e: FocusOutEventArgs): void; + + /**Fires when DateTimePicker popup opens.*/ + open? (e: OpenEventArgs): void; +} + +export interface ChangeEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the TimePicker model + */ + model?: ej.DateTimePicker.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the current value is valid or not + */ + isValidState?: boolean; + + /**returns the modified datetime value + */ + value?: string; + + /**returns the previously selected date time value + */ + prevDateTime?: string; + + /**returns true if change event triggered by interaction, otherwise returns false + */ + isInteraction?: boolean; +} + +export interface CloseEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the TimePicker model + */ + model?: ej.DateTimePicker.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the modified datetime value + */ + value?: string; + + /**returns the previously selected date time value + */ + prevDateTime?: string; +} + +export interface CreateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the DateTimePicker model + */ + model?: ej.DateTimePicker.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the DateTimePicker model + */ + model?: ej.DateTimePicker.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface FocusInEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the TimePicker model + */ + model?: ej.DateTimePicker.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the datetime value, which is in text box + */ + value?: string; +} + +export interface FocusOutEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the TimePicker model + */ + model?: ej.DateTimePicker.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the datetime value, which is in text box + */ + value?: string; +} + +export interface OpenEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the TimePicker model + */ + model?: ej.DateTimePicker.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the modified datetime value + */ + value?: string; + + /**returns the previously selected date time value + */ + prevDateTime?: string; +} + +export interface ButtonText { + + /**Sets the text for the Done button inside the datetime popup. + */ + done?: string; + + /**Sets the text for the Now button inside the datetime popup. + */ + timeNow?: string; + + /**Sets the header text for the Time dropdown. + */ + timeTitle?: string; + + /**Sets the text for the Today button inside the datetime popup. + */ + today?: string; +} + +export interface TimeDrillDown { + + /**This is the field to show/hide the timeDrillDown in DateTimePicker. + */ + enabled?: boolean; + + /**Sets the interval time of minutes on selected date. + */ + interval?: number; + + /**Allows the user to show or hide the meridian with time in DateTimePicker. + */ + showMeridian?: boolean; + + /**After choosing the time, the popup will close automatically if we set it as true, otherwise we focus out the DateTimePicker or choose timeNow button for closing the popup. + */ + autoClose?: boolean; +} +} +enum popupPosition +{ +//Opens the DateTimePicker popup below to the DateTimePicker input box +Bottom, +//Opens the DateTimePicker popup above to the DateTimePicker input box +Top, +} + +class Dialog extends ej.Widget { + static fn: Dialog; + constructor(element: JQuery, options?: Dialog.Model); + constructor(element: Element, options?: Dialog.Model); + model:Dialog.Model; + defaults:Dialog.Model; + + /** Closes the dialog widget dynamically. + * @returns {void} + */ + close(): void; + + /** Collapses the content area when it is expanded. + * @returns {void} + */ + collapse(): void; + + /** Destroys the Dialog widget. + * @returns {void} + */ + destroy(): void; + + /** Expands the content area when it is collapsed. + * @returns {void} + */ + expand(): void; + + /** Checks whether the Dialog widget is opened or not. This methods returns Boolean value. + * @returns {void} + */ + isOpen(): void; + + /** Maximizes the Dialog widget. + * @returns {void} + */ + maximize(): void; + + /** Minimizes the Dialog widget. + * @returns {void} + */ + minimize(): void; + + /** Opens the Dialog widget. + * @returns {void} + */ + open(): void; + + /** Pins the dialog in its current position. + * @returns {void} + */ + pin(): void; + + /** Restores the dialog. + * @returns {void} + */ + restore(): void; + + /** Unpins the Dialog widget. + * @returns {void} + */ + unpin(): void; + + /** Sets the title for the Dialog widget. + * @param {string} The title for the dialog widget. + * @returns {void} + */ + setTitle(Title: string): void; + + /** Sets the content for the Dialog widget dynamically. + * @param {string} The content for the dialog widget. It accepts both string and html string. + * @returns {void} + */ + setContent(content: string): void; + + /** Sets the focus on the Dialog widget. + * @returns {void} + */ + focus(): void; +} +export module Dialog{ + +export interface Model { + + /**Adds action buttons like close, minimize, pin, maximize in the dialog header. + */ + actionButtons?: string[]; + + /**Enables or disables draggable. + */ + allowDraggable?: boolean; + + /**Enables or disables keyboard interaction. + */ + allowKeyboardNavigation?: boolean; + + /**Customizes the Dialog widget animations. The Dialog widget can be animated while opening and closing the dialog. In order to customize animation effects, you need to set “enableAnimation” as true. It contains the following sub properties. + */ + animation?: any; + + /**The tooltip text for the dialog close button. + */ + closeIconTooltip?: string; + + /**Closes the dialog widget on pressing the ESC key when it is set to true. + */ + closeOnEscape?: boolean; + + /**The selector for the container element. If the property is set, then dialog will append to the selected element and it is restricted to move only within the specified container element. + */ + containment?: string; + + /**The content type to load the dialog content at run time. The possible values are null, ajax, iframe and image. When it is null (default value), the content inside dialog element will be displayed as content and when it is not null, the content will be loaded from the URL specified in the contentUrl property. + */ + contentType?: string; + + /**The URL to load the dialog content (such as AJAX, image, and iframe). In order to load content from URL, you need to set contentType as ‘ajax’ or ‘iframe’ or ‘image’. + */ + contentUrl?: string; + + /**The root class for the Dialog widget to customize the existing theme. + */ + cssClass?: string; + + /**Enable or disables animation when the dialog is opened or closed. + */ + enableAnimation?: boolean; + + /**Enables or disables the Dialog widget. + */ + enabled?: boolean; + + /**Enable or disables modal dialog. The modal dialog acts like a child window that is displayed on top of the main window/screen and disables the main window interaction until it is closed. + */ + enableModal?: boolean; + + /**Allows the current model values to be saved in local storage or browser cookies for state maintenance when it is set to true. + */ + enablePersistence?: boolean; + + /**Allows the dialog to be resized. The dialog cannot be resized less than the minimum height, width values and greater than the maximum height and width. + */ + enableResize?: boolean; + + /**Displays dialog content from right to left when set to true. + */ + enableRTL?: boolean; + + /**The CSS class name to display the favicon in the dialog header. In order to display favicon, you need to set showHeader as true since the favicon will be displayed in the dialog header. + */ + faviconCSS?: string; + + /**Sets the height for the dialog widget. It accepts both string and integer values. For example, it can accepts values like “auto”, “100%”, “100px” as string type and “100”, “500” as integer type. The unit of integer type value is “px”. + */ + height?: string|number; + + /**Enable or disables responsive behavior. + */ + isResponsive?: boolean; + + /**Default Value:{:.param}“en-US” + */ + locale?: number; + + /**Sets the maximum height for the dialog widget. + */ + maxHeight?: number; + + /**Sets the maximum width for the dialog widget. + */ + maxWidth?: number; + + /**Sets the minimum height for the dialog widget. + */ + minHeight?: number; + + /**Sets the minimum width for the dialog widget. + */ + minWidth?: number; + + /**Displays the Dialog widget at the given X and Y position. + */ + position?: any; + + /**Shows or hides the dialog header. + */ + showHeader?: boolean; + + /**The Dialog widget can be opened by default i.e. on initialization, when it is set to true. + */ + showOnInit?: boolean; + + /**Enables or disables the rounder corner. + */ + showRoundedCorner?: boolean; + + /**The selector for the container element. If this property is set, the dialog will be displayed (positioned) based on its container. + */ + target?: string; + + /**The title text to be displayed in the dialog header. In order to set title, you need to set showHeader as true since the title will be displayed in the dialog header. + */ + title?: string; + + /**Add or configure the tooltip text for actionButtons in the dialog header. + */ + tooltip?: any; + + /**Sets the height for the dialog widget. It accepts both string and integer values. For example, it can accepts values like “auto”, “100%”, “100px” as string type and “100”, “500” as integer type. The unit of integer type value is “px”. + */ + width?: string|number; + + /**Sets the z-index value for the Dialog widget. + */ + zIndex?: number; + + /**This event is triggered before the dialog widgets gets open.*/ + beforeOpen? (e: BeforeOpenEventArgs): void; + + /**This event is triggered whenever the Ajax request fails to retrieve the dialog content.*/ + ajaxError? (e: AjaxErrorEventArgs): void; + + /**This event is triggered whenever the Ajax request to retrieve the dialog content, gets succeed.*/ + ajaxSuccess? (e: AjaxSuccessEventArgs): void; + + /**This event is triggered before the dialog widgets get closed.*/ + beforeClose? (e: BeforeCloseEventArgs): void; + + /**This event is triggered after the dialog widget is closed.*/ + close? (e: CloseEventArgs): void; + + /**Triggered after the dialog content is loaded in DOM.*/ + contentLoad? (e: ContentLoadEventArgs): void; + + /**Triggered after the dialog is created successfully*/ + create? (e: CreateEventArgs): void; + + /**Triggered after the dialog widget is destroyed successfully*/ + destroy? (e: DestroyEventArgs): void; + + /**Triggered while the dialog is dragged.*/ + drag? (e: DragEventArgs): void; + + /**Triggered when the user starts dragging the dialog.*/ + dragStart? (e: DragStartEventArgs): void; + + /**Triggered when the user stops dragging the dialog.*/ + dragStop? (e: DragStopEventArgs): void; + + /**Triggered after the dialog is opened.*/ + open? (e: OpenEventArgs): void; + + /**Triggered while the dialog is resized.*/ + resize? (e: ResizeEventArgs): void; + + /**Triggered when the user starts resizing the dialog.*/ + resizeStart? (e: ResizeStartEventArgs): void; + + /**Triggered when the user stops resizing the dialog.*/ + resizeStop? (e: ResizeStopEventArgs): void; + + /**Triggered when the dialog content is expanded.*/ + expand? (e: ExpandEventArgs): void; + + /**Triggered when the dialog content is collapsed.*/ + collapse? (e: CollapseEventArgs): void; +} + +export interface BeforeOpenEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the dialog model object. + */ + model?: ej.Dialog.Model; + + /**Name of the event + */ + type?: string; +} + +export interface AjaxErrorEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the dialog model object. + */ + model?: ej.Dialog.Model; + + /**Name of the event. + */ + type?: string; + + /**URL of the content. + */ + url?: string; + + /**Error page content. + */ + responseText?: string; + + /**Error code. + */ + status?: number; + + /**The corresponding error description. + */ + statusText?: string; +} + +export interface AjaxSuccessEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the dialog model object. + */ + model?: ej.Dialog.Model; + + /**Name of the event. + */ + type?: string; + + /**URL of the content. + */ + url?: string; + + /**Response content. + */ + data?: string; +} + +export interface BeforeCloseEventArgs { + + /**Current event object. + */ + event?: any; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the dialog model object. + */ + model?: ej.Dialog.Model; + + /**Name of the event. + */ + type?: string; +} + +export interface CloseEventArgs { + + /**Current event object. + */ + event?: any; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the dialog model object. + */ + model?: ej.Dialog.Model; + + /**Name of the event + */ + type?: string; +} + +export interface ContentLoadEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the dialog model object. + */ + model?: ej.Dialog.Model; + + /**Name of the event. + */ + type?: string; + + /**URL of the content. + */ + url?: string; + + /**Content type + */ + contentType?: any; +} + +export interface CreateEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the dialog model object. + */ + model?: ej.Dialog.Model; + + /**Name of the event. + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the dialog model object. + */ + model?: ej.Dialog.Model; + + /**Name of the event. + */ + type?: string; +} + +export interface DragEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the dialog model object. + */ + model?: ej.Dialog.Model; + + /**Name of the event. + */ + type?: string; + + /**Current event object. + */ + event?: any; +} + +export interface DragStartEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the dialog model object. + */ + model?: ej.Dialog.Model; + + /**Name of the event. + */ + type?: string; + + /**Current event object. + */ + event?: any; +} + +export interface DragStopEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the dialog model object. + */ + model?: ej.Dialog.Model; + + /**Name of the event. + */ + type?: string; + + /**Current event object. + */ + event?: any; +} + +export interface OpenEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the dialog model object. + */ + model?: ej.Dialog.Model; + + /**Name of the event. + */ + type?: string; +} + +export interface ResizeEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the dialog model object. + */ + model?: ej.Dialog.Model; + + /**Name of the event. + */ + type?: string; + + /**Current event object. + */ + event?: any; +} + +export interface ResizeStartEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the dialog model object. + */ + model?: ej.Dialog.Model; + + /**Name of the event + */ + type?: string; + + /**Current event object. + */ + event?: any; +} + +export interface ResizeStopEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the dialog model object. + */ + model?: ej.Dialog.Model; + + /**Name of the event + */ + type?: string; + + /**Current event object. + */ + event?: any; +} + +export interface ExpandEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the dialog model object. + */ + model?: ej.Dialog.Model; + + /**Name of the event. + */ + type?: string; +} + +export interface CollapseEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the dialog model object. + */ + model?: ej.Dialog.Model; + + /**Name of the event. + */ + type?: string; +} +} + +class DropDownList extends ej.Widget { + static fn: DropDownList; + constructor(element: JQuery, options?: DropDownList.Model); + constructor(element: Element, options?: DropDownList.Model); + model:DropDownList.Model; + defaults:DropDownList.Model; + + /** Adding a single item or an array of items into the DropDownList allows you to specify all the field attributes such as value, template, image URL, and html attributes for those items. + * @param {any|Array} this parameter should have field attributes with respect to mapped field attributes and it's corresponding values to fields + * @returns {void} + */ + addItem(data: any|Array): void; + + /** This method is used to select all the items in the DropDownList. + * @returns {void} + */ + checkAll(): void; + + /** Clears the text in the DropDownList textbox. + * @returns {void} + */ + clearText(): void; + + /** Destroys the DropDownList widget. + * @returns {void} + */ + destroy(): void; + + /** This property is used to disable the DropDownList widget. + * @returns {void} + */ + disable(): void; + + /** This property disables the set of items in the DropDownList. + * @param {string|number|Array} disable the given index list items + * @returns {void} + */ + disableItemsByIndices(index: string|number|Array): void; + + /** This property enables the DropDownList control. + * @returns {void} + */ + enable(): void; + + /** Enables an Item or set of Items that are disabled in the DropDownList + * @param {string|number|Array} enable the given index list items if it's disabled + * @returns {void} + */ + enableItemsByIndices(index: string|number|Array): void; + + /** This method retrieves the items using given value. + * @param {string|number|any} Return the whole object of data based on given value + * @returns {any} + */ + getItemDataByValue(value: string|number|any): any; + + /** This method is used to retrieve the items that are bound with the DropDownList. + * @returns {any} + */ + getListData(): any; + + /** This method is used to get the selected items in the DropDownList. + * @returns {HTMLElement} + */ + getSelectedItem(): HTMLElement; + + /** This method is used to retrieve the items value that are selected in the DropDownList. + * @returns {string} + */ + getSelectedValue(): string; + + /** This method hides the suggestion popup in the DropDownList. + * @returns {void} + */ + hidePopup(): void; + + /** This method is used to select the list of items in the DropDownList through the Index of the items. + * @param {string|number|Array} select the given index list items + * @returns {void} + */ + selectItemsByIndices(index: string|number|Array): void; + + /** This method is used to select an item in the DropDownList by using the given text value. + * @param {string|number|Array} select the list items relates to given text + * @returns {void} + */ + selectItemByText(index: string|number|Array): void; + + /** This method is used to select an item in the DropDownList by using the given value. + * @param {string|number|Array} select the list items relates to given values + * @returns {void} + */ + selectItemByValue(index: string|number|Array): void; + + /** This method shows the DropDownList control with the suggestion popup. + * @returns {void} + */ + showPopup(): void; + + /** This method is used to unselect all the items in the DropDownList. + * @returns {void} + */ + unCheckAll(): void; + + /** This method is used to unselect the list of items in the DropDownList through Index of the items. + * @param {string|number|Array} unselect the given index list items + * @returns {void} + */ + unselectItemsByIndices(index: string|number|Array): void; + + /** This method is used to unselect an item in the DropDownList by using the given text value. + * @param {string|number|Array} unselect the list items realtes to given text + * @returns {void} + */ + unselectItemByText(index: string|number|Array): void; + + /** This method is used to unselect an item in the DropDownList by using the given value. + * @param {string|number|Array} unselect the list items realtes to given values + * @returns {void} + */ + unselectItemByValue(index: string|number|Array): void; +} +export module DropDownList{ + +export interface Model { + + /**The cascading DropDownLists is a series of two or more DropDownLists in which each DropDownList is filtered according to the previous DropDownList’s value. + * @Default {null} + */ + cascadeTo?: string; + + /**Sets the case sensitivity of the search operation. It supports both enableFilterSearch and enableIncrementalSearch property. + * @Default {false} + */ + caseSensitiveSearch?: boolean; + + /**Dropdown widget's style and appearance can be controlled based on 13 different default built-in themes.You can customize the appearance of the dropdown by using the cssClass property. You need to specify a class name in the cssClass property and the same class name is used before the class definitions wherever the custom styles are applied. + */ + cssClass?: string; + + /**This property is used to serve data from the data services based on the query provided. To bind the data to the dropdown widget, the dataSource property is assigned with the instance of the ej.DataManager. + * @Default {null} + */ + dataSource?: any; + + /**Sets the separator when the multiSelectMode with delimiter option or checkbox is enabled with the dropdown. When you enter the delimiter value, the texts after the delimiter are considered as a separate word or query. The delimiter string is a single character and must be a symbol. Mostly, the delimiter symbol is used as comma (,) or semi-colon (;) or any other special character. + * @Default {','} + */ + delimiterChar?: string; + + /**The enabled Animation property uses the easeOutQuad animation to SlideDown and SlideUp the Popup list in 200 and 100 milliseconds, respectively. + * @Default {false} + */ + enableAnimation?: boolean; + + /**This property is used to indicate whether the DropDownList control responds to the user interaction or not. By default, the control is in the enabled mode and you can disable it by setting it to false. + * @Default {true} + */ + enabled?: boolean; + + /**Specifies to perform incremental search for the selection of items from the DropDownList with the help of this property. This helps in selecting the item by using the typed character. + * @Default {true} + */ + enableIncrementalSearch?: boolean; + + /**This property selects the item in the DropDownList when the item is entered in the Search textbox. + * @Default {false} + */ + enableFilterSearch?: boolean; + + /**Saves the current model value to the browser cookies for state maintenance. While refreshing the DropDownList control page, it retains the model value and it is applied from the browser cookies. + * @Default {false} + */ + enablePersistence?: boolean; + + /**This enables the resize handler to resize the popup to any size. + * @Default {false} + */ + enablePopupResize?: boolean; + + /**Sets the DropDownList textbox direction from right to left align. + * @Default {false} + */ + enableRTL?: boolean; + + /**This property is used to sort the Items in the DropDownList. By default, it sorts the items in an ascending order. + * @Default {false} + */ + enableSorting?: boolean; + + /**Specifies the mapping fields for the data items of the DropDownList. + * @Default {null} + */ + fields?: Fields; + + /**When the enableFilterSearch property value is set to true, the values in the DropDownList shows the items starting with or containing the key word/letter typed in the Search textbox. + * @Default {ej.FilterType.Contains} + */ + filterType?: ej.FilterType|string; + + /**Used to create visualized header for dropdown items + * @Default {null} + */ + headerTemplate?: string; + + /**Defines the height of the DropDownList textbox. + * @Default {null} + */ + height?: string|number; + + /**It sets the given HTML attributes for the DropDownList control such as ID, name, disabled, etc. + * @Default {null} + */ + htmlAttributes?: any; + + /**Data can be fetched in the DropDownList control by using the DataSource, specifying the number of items. + * @Default {5} + */ + itemsCount?: number; + + /**Defines the maximum height of the suggestion box. This property restricts the maximum height of the popup when resize is enabled. + * @Default {null} + */ + maxPopupHeight?: string|number; + + /**Defines the minimum height of the suggestion box. This property restricts the minimum height of the popup when resize is enabled. + * @Default {null} + */ + minPopupHeight?: string|number; + + /**Defines the maximum width of the suggestion box. This property restricts the maximum width of the popup when resize is enabled. + * @Default {null} + */ + maxPopupWidth?: string|number; + + /**Defines the minimum height of the suggestion box. This property restricts the minimum height of the popup when resize is enabled. + * @Default {0} + */ + minPopupWidth?: string|number; + + /**With the help of this property, you can make a single or multi selection with the DropDownList and display the text in two modes, delimiter and visual mode. In delimiter mode, you can separate the items by using the delimiter character such as comma (,) or semi-colon (;) or any other special character. In the visual mode, the items are showcased like boxes with close icon in the textbox. + * @Default {ej.MultiSelectMode.None} + */ + multiSelectMode?: ej.MultiSelectMode|string; + + /**Defines the height of the suggestion popup box in the DropDownList control. + * @Default {152px} + */ + popupHeight?: string|number; + + /**Defines the width of the suggestion popup box in the DropDownList control. + * @Default {auto} + */ + popupWidth?: string|number; + + /**Specifies the query to retrieve the data from the DataSource. + * @Default {null} + */ + query?: any; + + /**Specifies that the DropDownList textbox values should be read-only. + * @Default {false} + */ + readOnly?: boolean; + + /**Specifies an item to be selected in the DropDownList. + * @Default {null} + */ + selectedIndex?: number; + + /**Specifies the selectedItems for the DropDownList. + * @Default {[]} + */ + selectedIndices?: Array; + + /**Selects multiple items in the DropDownList with the help of the checkbox control. To achieve this, enable the showCheckbox option to true. + * @Default {false} + */ + showCheckbox?: boolean; + + /**DropDownList control is displayed with the popup seen. + * @Default {false} + */ + showPopupOnLoad?: boolean; + + /**DropDownList textbox displayed with the rounded corner style. + * @Default {false} + */ + showRoundedCorner?: boolean; + + /**When the enableSorting property value is set to true, this property helps to sort the items either in ascending or descending order + * @Default {ej.sortOrder.Ascending} + */ + sortOrder?: ej.SortOrder|string; + + /**Specifies the targetID for the DropDownList’s items. + * @Default {null} + */ + targetID?: string; + + /**By default, you can add any text or image to the DropDownList item. To customize the item layout or to create your own visualized elements, you can use this template support. + * @Default {null} + */ + template?: string; + + /**Defines the text value that is displayed in the DropDownList textbox. + * @Default {null} + */ + text?: string; + + /**Sets the jQuery validation error message in the DropDownList + * @Default {null} + */ + validationMessage?: any; + + /**Sets the jquery validation rules in the Dropdownlist. + * @Default {null} + */ + validationRules?: any; + + /**Specifies the value (text content) for the DropDownList control. + * @Default {null} + */ + value?: string; + + /**Specifies a short hint that describes the expected value of the DropDownList control. + * @Default {null} + */ + watermarkText?: string; + + /**Defines the width of the DropDownList textbox. + * @Default {null} + */ + width?: string|number; + + /**The Virtual Scrolling feature is used to display a large amount of records in the DropDownList, that is, when scrolling, an Ajax request is sent to fetch some amount of data from the server dynamically. To achieve this scenario with DropDownList, set the allowVirtualScrolling to true. You can set the itemsCount property that represents the number of items to be fetched from the server on every Ajax request. + * @Default {normal} + */ + virtualScrollMode?: ej.VirtualScrollMode|string; + + /**Fires the action before the XHR request.*/ + actionBegin? (e: ActionBeginEventArgs): void; + + /**Fires the action when the list of items is bound to the DropDownList by xhr post calling*/ + actionComplete? (e: ActionCompleteEventArgs): void; + + /**Fires the action when the xhr post calling failed on remote data binding with the DropDownList control.*/ + actionFailure? (e: ActionFailureEventArgs): void; + + /**Fires the action when the xhr post calling succeed on remote data binding with the DropDownList control*/ + actionSuccess? (e: ActionSuccessEventArgs): void; + + /**Fires the action before the popup is ready to hide.*/ + beforePopupHide? (e: BeforePopupHideEventArgs): void; + + /**Fires the action before the popup is ready to be displayed.*/ + beforePopupShown? (e: BeforePopupShownEventArgs): void; + + /**Fires when the cascading happens between two DropDownList exactly after the value changes in the first dropdown and before filtering in the second Dropdown.*/ + cascade? (e: CascadeEventArgs): void; + + /**Fires the action when the DropDownList control’s value is changed.*/ + change? (e: ChangeEventArgs): void; + + /**Fires the action when the list item checkbox value is changed.*/ + checkChange? (e: CheckChangeEventArgs): void; + + /**Fires the action once the DropDownList is created.*/ + create? (e: CreateEventArgs): void; + + /**Fires the action when the list items is bound to the DropDownList.*/ + dataBound? (e: DataBoundEventArgs): void; + + /**Fires the action when the DropDownList is destroyed.*/ + destroy? (e: DestroyEventArgs): void; + + /**Fires the action, once the popup is closed*/ + popupHide? (e: PopupHideEventArgs): void; + + /**Fires the action, when the popup is resized.*/ + popupResize? (e: PopupResizeEventArgs): void; + + /**Fires the action, once the popup is opened.*/ + popupShown? (e: PopupShownEventArgs): void; + + /**Fires the action, when resizing a popup starts.*/ + popupResizeStart? (e: PopupResizeStartEventArgs): void; + + /**Fires the action, when the popup resizing is stopped.*/ + popupResizeStop? (e: PopupResizeStopEventArgs): void; + + /**Fires the action before filtering the list items that starts in the DropDownList when the enableFilterSearch is enabled.*/ + search? (e: SearchEventArgs): void; + + /**Fires the action, when the list of item is selected.*/ + select? (e: SelectEventArgs): void; +} + +export interface ActionBeginEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the DropDownList model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface ActionCompleteEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**Returns number of times trying to fetch the data + */ + count?: number; + + /**returns the DropDownList model + */ + model?: any; + + /**Returns the query for data retrieval + */ + query?: any; + + /**Returns the query for data retrieval from the Database + */ + request?: any; + + /**returns the name of the event + */ + type?: string; + + /**Returns the number of items fetched from remote data + */ + result?: Array; + + /**Returns the requested data + */ + xhr?: any; +} + +export interface ActionFailureEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**Returns the error message + */ + error?: any; + + /**returns the DropDownList model + */ + model?: any; + + /**Returns the query for data retrieval + */ + query?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface ActionSuccessEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**Returns number of times trying to fetch the data + */ + count?: number; + + /**returns the DropDownList model + */ + model?: any; + + /**Returns the query for data retrieval + */ + query?: any; + + /**Returns the query for data retrieval from the Database + */ + request?: any; + + /**returns the name of the event + */ + type?: string; + + /**Returns the number of items fetched from remote data + */ + result?: Array; + + /**Returns the requested data + */ + xhr?: any; +} + +export interface BeforePopupHideEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the DropDownList model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; + + /**returns the selected text + */ + text?: string; + + /**returns the selected value + */ + value?: string; +} + +export interface BeforePopupShownEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the DropDownList model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; + + /**returns the selected text + */ + text?: string; + + /**returns the selected value + */ + value?: string; +} + +export interface CascadeEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**Returns the cascading dropdown model. + */ + cascadeModel?: any; + + /**returns the current selected value in first dropdown. + */ + cascadeValue?: string; + + /**returns the DropDownList model + */ + model?: any; + + /**returns the default filter action for second dropdown data should happen or not. + */ + requiresDefaultFilter?: boolean; + + /**returns the name of the event + */ + type?: string; +} + +export interface ChangeEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**Returns the selected item with checkbox checked or not. + */ + isChecked?: boolean; + + /**Returns the selected item ID. + */ + itemId?: string; + + /**returns the DropDownList model + */ + model?: any; + + /**Returns the selected item text. + */ + selectedText?: string; + + /**returns the name of the event + */ + type?: string; + + /**Returns the selected text. + */ + text?: string; + + /**Returns the selected value. + */ + value?: string; +} + +export interface CheckChangeEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**Returns the selected item with checkbox checked or not. + */ + isChecked?: boolean; + + /**Returns the selected item ID. + */ + itemId?: string; + + /**returns the DropDownList model + */ + model?: any; + + /**Returns the selected item text. + */ + selectedText?: string; + + /**returns the name of the event + */ + type?: string; + + /**Returns the selected text. + */ + text?: string; + + /**Returns the selected value. + */ + value?: string; +} + +export interface CreateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the DropDownList model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface DataBoundEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the DropDownList model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; + + /**returns the data that is bound to DropDownList + */ + data?: any; +} + +export interface DestroyEventArgs { + + /**its value is set as true,if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the DropDownList model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface PopupHideEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the DropDownList model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; + + /**returns the selected text + */ + text?: string; + + /**returns the selected value + */ + value?: string; +} + +export interface PopupResizeEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the DropDownList model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; + + /**Returns the data from the resizable plugin. + */ + event?: any; +} + +export interface PopupShownEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the DropDownList model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; + + /**returns the selected text + */ + text?: string; + + /**returns the selected value + */ + value?: string; +} + +export interface PopupResizeStartEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the DropDownList model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; + + /**Returns the data from the resizable plugin. + */ + event?: any; +} + +export interface PopupResizeStopEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the DropDownList model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; + + /**Returns the data from the resizable plugin. + */ + event?: any; +} + +export interface SearchEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**Returns the data bound to the DropDownList. + */ + items?: any; + + /**returns the DropDownList model + */ + model?: any; + + /**Returns the selected item text. + */ + selectedText?: string; + + /**returns the name of the event + */ + type?: string; + + /**Returns the search string typed in search box. + */ + searchString?: string; +} + +export interface SelectEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**Returns the selected item with checkbox checked or not. + */ + isChecked?: boolean; + + /**Returns the selected item ID. + */ + itemId?: string; + + /**returns the DropDownList model + */ + model?: any; + + /**Returns the selected item text. + */ + selectedText?: string; + + /**returns the name of the event + */ + type?: string; + + /**Returns the selected text. + */ + text?: string; + + /**Returns the selected value. + */ + value?: string; +} + +export interface Fields { + + /**Used to group the items. + */ + groupBy?: string; + + /**Defines the HTML attributes such as ID, class, and styles for the item. + */ + htmlAttributes?: any; + + /**Defines the ID for the tag. + */ + id?: string; + + /**Defines the image attributes such as height, width, styles, and so on. + */ + imageAttributes?: string; + + /**Defines the imageURL for the image location. + */ + imageUrl?: string; + + /**Defines the tag value to be selected initially. + */ + selected?: boolean; + + /**Defines the sprite css for the image tag. + */ + spriteCssClass?: string; + + /**Defines the table name for tag value or display text while rendering remote data. + */ + tableName?: string; + + /**Defines the text content for the tag. + */ + text?: string; + + /**Defines the tag value. + */ + value?: string; +} +} +enum FilterType +{ +//filter the data wherever contains search key +Contains, +//filter the data based on search key present at start position +StartsWith, +} +enum MultiSelectMode +{ +// can select only single item in DropDownList +None, +//can select multiple items and it's seperated by delimiterChar +Delimiter, +// can select multiple items and it's show's like visual box in textbox +VisualMode, +} +enum SortOrder +{ +// Sort the data in ascending order +Ascending, +//Sort the data in descending order +Descending, +} +enum VirtualScrollMode +{ +// The data is loaded only to the corresponding page (display items). When scrolling some other position, it enables the load on demand with the DropDownList. +Normal, +//The data items are loaded from the remote when scroll handle reaches the end of the scrollbar like infinity scrolling. +Continuous, +} + +class Editor extends ej.Widget { + static fn: Editor; + constructor(element: JQuery, options?: Editor.Model); + constructor(element: Element, options?: Editor.Model); + model:Editor.Model; + defaults:Editor.Model; + + /** destroy the editor widgets all events are unbind automatically and bring the control to pre-init state. + * @returns {void} + */ + destroy(): void; + + /** To disable the corresponding Editors + * @returns {void} + */ + disable(): void; + + /** To enable the corresponding Editors + * @returns {void} + */ + enable(): void; + + /** To get value from corresponding Editors + * @returns {number} + */ + getValue(): number; +} + + class NumericTextbox extends Editor{ +} + + class CurrencyTextbox extends Editor{ +} + + class PercentageTextbox extends Editor{ +} +export module Editor{ + +export interface Model { + + /**Sets the root CSS class for Accordion theme, which is used customize. + */ + cssClass?: string; + + /**DecimalPlaces declares the number of digits to be displayed right side of the value. + * @Default {0} + */ + decimalPlaces?: number; + + /**Specify the editor control state. + * @Default {true} + */ + enabled?: boolean; + + /**Specify the enablePersistence to editor to save current model value to browser cookies for state maintains + * @Default {false} + */ + enablePersistence?: boolean; + + /**Specify the Right to Left Direction to editor. + * @Default {false} + */ + enableRTL?: boolean; + + /**Strict mode option to restrict entering values defined outside the range in the editor. + * @Default {false} + */ + enableStrictMode?: boolean; + + /**It provides the options to get the customized character to separate the digits. If not set, the separator defined by the current culture. + * @Default {null} + */ + groupSeparator?: string; + + /**Specifies the height of the editor. + * @Default {30} + */ + height?: number|string; + + /**It allows to define the characteristics of the Editors control. It will helps to extend the capability of an HTML element. + * @Default {{}} + */ + htmlAttributes?: any; + + /**The Editor value increment or decrement based an increment step value. + * @Default {1} + */ + incrementStep?: number; + + /**Specifies the Localization info used by the editor. + * @Default {en-US} + */ + locale?: string; + + /**Specifies the maximum value of the editor. + * @Default {Number.MAX_VALUE} + */ + maxValue?: number; + + /**Specifies the minimum value of the editor. + * @Default {-(Number.MAX_VALUE) and 0 for Currency Textbox.} + */ + minValue?: number; + + /**Specifies the name of the editor. + * @Default {Sets id as name if it is null.} + */ + name?: string; + + /**Toggles the readonly state of the editor. When the Editor is readonly it doesn't allow user interactions. + * @Default {false} + */ + readOnly?: boolean; + + /**Specify the rounded corner to editor + * @Default {false} + */ + showRoundedCorner?: boolean; + + /**Specifies whether the up and down spin buttons should be displayed in editor. + * @Default {true} + */ + showSpinButton?: boolean; + + /**Enables decimal separator position validation on type . + * @Default {false} + */ + validateOnType?: boolean; + + /**Set the jQuery validation error message in editor. + * @Default {null} + */ + validationMessage?: any; + + /**Set the jQuery validation rules to the editor. + * @Default {null} + */ + validationRules?: any; + + /**Specifies the value of the editor. + * @Default {null} + */ + value?: number|string; + + /**Specify the watermark text to editor. + */ + watermarkText?: string; + + /**Specifies the width of the editor. + * @Default {143} + */ + width?: number|string; + + /**Fires after Editor control value is changed.*/ + change? (e: ChangeEventArgs): void; + + /**Fires after Editor control is created.*/ + create? (e: CreateEventArgs): void; + + /**Fires when the Editor is destroyed successfully.*/ + destroy? (e: DestroyEventArgs): void; + + /**Fires after Editor control is focused.*/ + focusIn? (e: FocusInEventArgs): void; + + /**Fires after Editor control is loss the focus.*/ + focusOut? (e: FocusOutEventArgs): void; +} + +export interface ChangeEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the corresponding editor model. + */ + model ?: ej.Editor.Model; + + /**returns the name of the event. + */ + type?: string; + + /**returns the corresponding editor control value. + */ + value ?: number; + + /**returns true when the value changed by user interaction otherwise returns false + */ + isInteraction ?: boolean; +} + +export interface CreateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the editor model + */ + model ?: ej.Editor.Model; + + /**returns the name of the event + */ + type ?: string; +} + +export interface DestroyEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the editor model + */ + model ?: ej.Editor.Model; + + /**returns the name of the event + */ + type ?: string; +} + +export interface FocusInEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the corresponding editor model. + */ + model?: ej.Editor.Model; + + /**returns the name of the event. + */ + type?: string; + + /**returns the corresponding editor control value. + */ + value?: number; +} + +export interface FocusOutEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the corresponding editor model. + */ + model?: ej.Editor.Model; + + /**returns the name of the event. + */ + type?: string; + + /**returns the corresponding editor control value. + */ + value?: number; +} +} + +class ListView extends ej.Widget { + static fn: ListView; + constructor(element: JQuery, options?: ListView.Model); + constructor(element: Element, options?: ListView.Model); + model:ListView.Model; + defaults:ListView.Model; + + /** To add item in the given index. + * @param {string} Specifies the item to be added in ListView + * @param {number} Specifies the index where item to be added + * @returns {void} + */ + addItem(item: string, index: number): void; + + /** To check all the items. + * @returns {void} + */ + checkAllItem(): void; + + /** To check item in the given index. + * @param {number} Specifies the index of the item to be checked + * @returns {void} + */ + checkItem(index: number): void; + + /** To clear all the list item in the control before updating with new datasource. + * @returns {void} + */ + clear(): void; + + /** To make the item in the given index to be default state. + * @param {number} Specifies the index to make the item to be in default state. + * @returns {void} + */ + deActive(index: number): void; + + /** To disable item in the given index. + * @param {number} Specifies the index value to be disabled. + * @returns {void} + */ + disableItem(index: number): void; + + /** To enable item in the given index. + * @param {number} Specifies the index value to be enabled. + * @returns {void} + */ + enableItem(index: number): void; + + /** To get the active item. + * @returns {HTMLElement} + */ + getActiveItem(): HTMLElement; + + /** To get the text of the active item. + * @returns {string} + */ + getActiveItemText(): string; + + /** To get all the checked items. + * @returns {Array} + */ + getCheckedItems(): Array; + + /** To get the text of all the checked items. + * @returns {Array} + */ + getCheckedItemsText(): Array; + + /** To get the total item count. + * @returns {number} + */ + getItemsCount(): number; + + /** To get the text of the item in the given index. + * @param {string|number} Specifies the index value to get the textvalue. + * @returns {string} + */ + getItemText(index: string|number): string; + + /** To check whether the item in the given index has child item. + * @param {number} Specifies the index value to check the item has child or not. + * @returns {boolean} + */ + hasChild(index: number): boolean; + + /** To hide the list. + * @returns {void} + */ + hide(): void; + + /** To hide item in the given index. + * @param {number} Specifies the index value to hide the item. + * @returns {void} + */ + hideItem(index: number): void; + + /** To check whether item in the given index is checked. + * @returns {boolean} + */ + isChecked(): boolean; + + /** To load the ajax content while selecting the item. + * @param {string} Specifies the item to load the ajax content. + * @returns {void} + */ + loadAjaxContent(item: string): void; + + /** To remove the check mark either for specific item in the given index or for all items. + * @param {number} Specifies the index value to remove the checkbox. + * @returns {void} + */ + removeCheckMark(index: number): void; + + /** To remove item in the given index. + * @param {number} Specifies the index value to remove the item. + * @returns {void} + */ + removeItem(index: number): void; + + /** To select item in the given index. + * @param {number} Specifies the index value to select the item. + * @returns {void} + */ + selectItem(index: number): void; + + /** To make the item in the given index to be active state. + * @param {number} Specifies the index value to make the item in active state. + * @returns {void} + */ + setActive(index: number): void; + + /** To show the list. + * @returns {void} + */ + show(): void; + + /** To show item in the given index. + * @param {number} Specifies the index value to show the hided item. + * @returns {void} + */ + showItem(index: number): void; + + /** To uncheck all the items. + * @returns {void} + */ + unCheckAllItem(): void; + + /** To uncheck item in the given index. + * @param {number} Specifies the index value to uncheck the item. + * @returns {void} + */ + unCheckItem(index: number): void; +} +export module ListView{ + +export interface Model { + + /**Sets the root class for ListView theme. This cssClass API helps to use custom skinning option for ListView control. By defining the root class using this API, we need to include this root class in CSS. + */ + cssClass?: string; + + /**Contains the list of data for generating the ListView items. + * @Default {[]} + */ + dataSource?: Array; + + /**Specifies whether to load ajax content while selecting item. + * @Default {false} + */ + enableAjax?: boolean; + + /**Specifies whether to enable caching the content. + * @Default {false} + */ + enableCache?: boolean; + + /**Specifies whether to enable check mark for the item. + * @Default {false} + */ + enableCheckMark?: boolean; + + /**Specifies whether to enable the filtering feature to filter the item. + * @Default {false} + */ + enableFiltering?: boolean; + + /**Specifies whether to group the list item. + * @Default {false} + */ + enableGroupList?: boolean; + + /**Specifies to maintain the current model value to browser cookies for state maintenance. While refresh the page, the model value will get apply to the control from browser cookies. + * @Default {false} + */ + enablePersistence?: boolean; + + /**Specifies the field settings to map the datasource. + */ + fieldSettings?: any; + + /**Specifies the text of the back button in the header. + * @Default {null} + */ + headerBackButtonText?: string; + + /**Specifies the title of the header. + * @Default {Title} + */ + headerTitle?: string; + + /**Specifies the height. + * @Default {null} + */ + height?: number; + + /**Specifies whether to retain the selection of the item. + * @Default {false} + */ + persistSelection?: boolean; + + /**Specifies whether to prevent the selection of the item. + * @Default {false} + */ + preventSelection?: boolean; + + /**Specifies the query to execute with the datasource. + * @Default {null} + */ + query?: any; + + /**Specifies whether need to render the control with the template contents. + * @Default {false} + */ + renderTemplate?: boolean; + + /**Specifies the index of item which need to be in selected state initially while loading. + * @Default {0} + */ + selectedItemIndex?: number; + + /**Specifies whether to show the header. + * @Default {true} + */ + showHeader?: boolean; + + /**Specifies ID of the element contains template contents. + * @Default {false} + */ + templateId?: boolean; + + /**Specifies the width. + * @Default {null} + */ + width?: number; + + /**Event triggers before the ajax request happens.*/ + ajaxBeforeLoad? (e: AjaxBeforeLoadEventArgs): void; + + /**Event triggers after the ajax content loaded completely.*/ + ajaxComplete? (e: AjaxCompleteEventArgs): void; + + /**Event triggers when the ajax request failed.*/ + ajaxError? (e: AjaxErrorEventArgs): void; + + /**Event triggers after the ajax content loaded successfully.*/ + ajaxSuccess? (e: AjaxSuccessEventArgs): void; + + /**Event triggers before the items loaded.*/ + load? (e: LoadEventArgs): void; + + /**Event triggers after the items loaded.*/ + loadComplete? (e: LoadCompleteEventArgs): void; + + /**Event triggers when mouse down happens on the item.*/ + mouseDown? (e: MouseDownEventArgs): void; + + /**Event triggers when mouse up happens on the item.*/ + mouseUP? (e: MouseUPEventArgs): void; +} + +export interface AjaxBeforeLoadEventArgs { + + /**returns true if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the name of the event. + */ + type?: string; + + /**returns the model value of the control. + */ + model?: any; + + /**returns the ajax settings. + */ + ajaxData?: any; +} + +export interface AjaxCompleteEventArgs { + + /**returns true if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the name of the event. + */ + type?: string; + + /**returns the model value of the control. + */ + model?: any; +} + +export interface AjaxErrorEventArgs { + + /**returns true if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the name of the event. + */ + type?: string; + + /**returns the model value of the control. + */ + model?: any; + + /**returns the error thrown in the ajax post. + */ + errorThrown?: any; + + /**returns the status. + */ + textStatus?: any; + + /**returns the current list item. + */ + item?: any; + + /**returns the current item text. + */ + text?: string; + + /**returns the current item index. + */ + index?: number; +} + +export interface AjaxSuccessEventArgs { + + /**returns true if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the name of the event. + */ + type?: string; + + /**returns the model value of the control. + */ + model?: any; + + /**returns the ajax current content. + */ + content?: string; + + /**returns the current list item. + */ + item?: any; + + /**returns the current item text. + */ + text?: string; + + /**returns the current item index. + */ + index?: number; + + /**returns the current url of the ajax post. + */ + url?: string; +} + +export interface LoadEventArgs { + + /**returns true if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the name of the event. + */ + type?: string; + + /**returns the model value of the control. + */ + model?: any; +} + +export interface LoadCompleteEventArgs { + + /**returns true if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the name of the event. + */ + type?: string; + + /**returns the model value of the control. + */ + model?: any; +} + +export interface MouseDownEventArgs { + + /**returns true if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the name of the event. + */ + type?: string; + + /**returns the model value of the control. + */ + model?: any; + + /**If the child element exist return true; otherwise, false. + */ + hasChild?: boolean; + + /**returns the current list item. + */ + item?: string; + + /**returns the current text of item. + */ + text?: string; + + /**returns the current Index of the item. + */ + index?: number; + + /**If checked return true; otherwise, false. + */ + isChecked?: boolean; + + /**returns the list of checked items. + */ + checkedItems?: number; + + /**returns the current checked item text. + */ + checkedItemsText?: string; +} + +export interface MouseUPEventArgs { + + /**returns true if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the name of the event. + */ + type?: string; + + /**returns the model value of the control. + */ + model?: any; + + /**If the child element exist return true; otherwise, false. + */ + hasChild?: boolean; + + /**returns the current list item. + */ + item?: string; + + /**returns the current text of item. + */ + text?: string; + + /**returns the current Index of the item. + */ + index?: number; + + /**If checked return true; otherwise, false. + */ + isChecked?: boolean; + + /**returns the list of checked items. + */ + checkedItems?: number; + + /**returns the current checked item text. + */ + checkedItemsText?: string; +} +} + +class MaskEdit extends ej.Widget { + static fn: MaskEdit; + constructor(element: JQuery, options?: MaskEdit.Model); + constructor(element: Element, options?: MaskEdit.Model); + model:MaskEdit.Model; + defaults:MaskEdit.Model; + + /** To clear the text in mask edit textbox control. + * @returns {void} + */ + clear(): void; + + /** To disable the mask edit textbox control. + * @returns {void} + */ + disable(): void; + + /** To enable the mask edit textbox control. + * @returns {void} + */ + enable(): void; + + /** To obtained the pure value of the text value, removes all the symbols in mask edit textbox control. + * @returns {string} + */ + get_StrippedValue(): string; + + /** To obtained the textbox value as such that, Just replace all '_' to ' '(space) in mask edit textbox control. + * @returns {string} + */ + get_UnstrippedValue(): string; +} +export module MaskEdit{ + +export interface Model { + + /**Specify the cssClass to achieve custom theme. + * @Default {null} + */ + cssClass?: string; + + /**Specify the custom character allowed to entered in mask edit textbox control. + * @Default {null} + */ + customCharacter?: string; + + /**Specify the state of the mask edit textbox control. + * @Default {true} + */ + enabled?: boolean; + + /**Specify the enablePersistence to mask edit textbox to save current model value to browser cookies for state maintains. + */ + enablePersistence?: boolean; + + /**Specifies the height for the mask edit textbox control. + * @Default {28 px} + */ + height?: string; + + /**Specifies whether hide the prompt characters with spaces on blur. Prompt chars will be shown again on focus the textbox. + * @Default {false} + */ + hidePromptOnLeave?: boolean; + + /**Specifies the list of html attributes to be added to mask edit textbox. + * @Default {{}} + */ + htmlAttributes?: any; + + /**Specify the inputMode for mask edit textbox control. See InputMode + * @Default {ej.InputMode.Text} + */ + inputMode?: ej.InputMode|string; + + /**Specifies the input mask. + * @Default {null} + */ + maskFormat?: string; + + /**Specifies the name attribute value for the mask edit textbox. + * @Default {null} + */ + name?: string; + + /**Toggles the readonly state of the mask edit textbox. When the mask edit textbox is readonly, it doesn't allow your input. + * @Default {false} + */ + readOnly?: boolean; + + /**Specifies whether the error will show until correct value entered in the mask edit textbox control. + * @Default {false} + */ + showError?: boolean; + + /**MaskEdit input is displayed in rounded corner style when this property is set to true. + * @Default {false} + */ + showRoundedCorner?: boolean; + + /**Specify the text alignment for mask edit textbox control.See TextAlign + * @Default {left} + */ + textAlign?: ej.TextAlign|string; + + /**Sets the jQuery validation error message in mask edit. This property works when the widget is present inside the form. Include jquery.validate.min.js plugin additionally. + * @Default {null} + */ + validationMessage?: any; + + /**Sets the jQuery validation rules to the MaskEdit. This property works when the widget is present inside the form. Include jquery.validate.min.js plugin additionally. + * @Default {null} + */ + validationRules?: any; + + /**Specifies the value for the mask edit textbox control. + * @Default {null} + */ + value?: string; + + /**Specifies the water mark text to be displayed in input text. + * @Default {null} + */ + watermarkText?: string; + + /**Specifies the width for the mask edit textbox control. + * @Default {143pixel} + */ + width?: string; + + /**Fires when value changed in mask edit textbox control.*/ + change? (e: ChangeEventArgs): void; + + /**Fires after MaskEdit control is created.*/ + create? (e: CreateEventArgs): void; + + /**Fires when the MaskEdit is destroyed successfully.*/ + destroy? (e: DestroyEventArgs): void; + + /**Fires when focused in mask edit textbox control.*/ + focusIn? (e: FocusInEventArgs): void; + + /**Fires when focused out in mask edit textbox control.*/ + focusOut? (e: FocusOutEventArgs): void; + + /**Fires when keydown in mask edit textbox control.*/ + keydown? (e: KeydownEventArgs): void; + + /**Fires when key press in mask edit textbox control.*/ + keyPress? (e: KeyPressEventArgs): void; + + /**Fires when keyup in mask edit textbox control.*/ + keyup? (e: KeyupEventArgs): void; + + /**Fires when mouse out in mask edit textbox control.*/ + mouseout? (e: MouseoutEventArgs): void; + + /**Fires when mouse over in mask edit textbox control.*/ + mouseover? (e: MouseoverEventArgs): void; +} + +export interface ChangeEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the mask edit model + */ + model?: ej.MaskEdit.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the mask edit value + */ + value?: number; + + /**returns unstripped value in mask edit textbox control. + */ + unmaskedValue?: string; +} + +export interface CreateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the MaskEdit model + */ + model?: ej.MaskEdit.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the MaskEdit model + */ + model?: ej.MaskEdit.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface FocusInEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the mask edit model + */ + model?: ej.MaskEdit.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the mask edit value + */ + value?: number; + + /**returns unstripped value in mask edit textbox control. + */ + unmaskedValue?: string; +} + +export interface FocusOutEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the mask edit model + */ + model?: ej.MaskEdit.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the mask edit value + */ + value?: number; + + /**returns unstripped value in mask edit textbox control. + */ + unmaskedValue?: string; +} + +export interface KeydownEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the mask edit model + */ + model?: ej.MaskEdit.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the mask edit value + */ + value?: number; + + /**returns unstripped value in mask edit textbox control. + */ + unmaskedValue?: string; +} + +export interface KeyPressEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the mask edit model + */ + model?: ej.MaskEdit.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the mask edit value + */ + value?: number; + + /**returns unstripped value in mask edit textbox control. + */ + unmaskedValue?: string; +} + +export interface KeyupEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the mask edit model + */ + model?: ej.MaskEdit.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the mask edit value + */ + value?: number; + + /**returns unstripped value in mask edit textbox control. + */ + unmaskedValue?: string; +} + +export interface MouseoutEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the mask edit model + */ + model?: ej.MaskEdit.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the mask edit value + */ + value?: number; + + /**returns unstripped value in mask edit textbox control. + */ + unmaskedValue?: string; +} + +export interface MouseoverEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the mask edit model + */ + model?: ej.MaskEdit.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the mask edit value + */ + value?: number; + + /**returns unstripped value in mask edit textbox control. + */ + unmaskedValue?: string; +} +} +enum InputMode +{ +//string +Password, +//string +Text, +} +enum TextAlign +{ +//string +Center, +//string +Justify, +//string +Left, +//string +Right, +} + +class Menu extends ej.Widget { + static fn: Menu; + constructor(element: JQuery, options?: Menu.Model); + constructor(element: Element, options?: Menu.Model); + model:Menu.Model; + defaults:Menu.Model; + + /** Disables the Menu control. + * @returns {void} + */ + disable(): void; + + /** Specifies the Menu Item to be disabled by using the Menu Item Text. + * @param {string} Specifies the Menu Item Text to be disabled. + * @returns {void} + */ + disableItem(itemtext: string): void; + + /** Specifies the Menu Item to be disabled by using the Menu Item Id. + * @param {string|number} Specifies the Menu Item id to be disabled + * @returns {void} + */ + disableItembyID(itemid: string|number): void; + + /** Enables the Menu control. + * @returns {void} + */ + enable(): void; + + /** Specifies the Menu Item to be enabled by using the Menu Item Text. + * @param {string} Specifies the Menu Item Text to be enabled. + * @returns {void} + */ + enableItem(itemtext: string): void; + + /** Specifies the Menu Item to be enabled by using the Menu Item Id. + * @param {string|number} Specifies the Menu Item id to be enabled. + * @returns {void} + */ + enableItembyID(itemid: string|number): void; + + /** Hides the Context Menu control. + * @returns {void} + */ + hide(): void; + + /** Insert the menu item as child of target node. + * @param {any} Information about Menu item. + * @param {string|any} Selector of target node or Object of target node. + * @returns {void} + */ + insert(item: any, target: string|any): void; + + /** Insert the menu item after the target node. + * @param {any} Information about Menu item. + * @param {string|any} Selector of target node or Object of target node. + * @returns {void} + */ + insertAfter(item: any, target: string|any): void; + + /** Insert the menu item before the target node. + * @param {any} Information about Menu item. + * @param {string|any} Selector of target node or Object of target node. + * @returns {void} + */ + insertBefore(item: any, target: string|any): void; + + /** Remove Menu item. + * @param {any|Array} Selector of target node or Object of target node. + * @returns {void} + */ + remove(target: any|Array): void; + + /** To show the Menu control. + * @param {number} x co-ordinate position of context menu. + * @param {number} y co-ordinate position of context menu. + * @param {any} target element + * @param {any} name of the event + * @returns {void} + */ + show(locationX: number, locationY: number, targetElement: any, event: any): void; +} +export module Menu{ + +export interface Model { + + /**To enable or disable the Animation while hover or click an menu items.See AnimationType + * @Default {ej.AnimationType.Default} + */ + animationType?: ej.AnimationType|string; + + /**Specifies the target id of context menu. On right clicking the specified contextTarget element, context menu gets shown. + * @Default {null} + */ + contextMenuTarget?: string; + + /**Specify the CSS class to achieve custom theme. + */ + cssClass?: string; + + /**To enable or disable the Animation effect while hover or click an menu items. + * @Default {true} + */ + enableAnimation?: boolean; + + /**Specifies the root menu items to be aligned center in horizontal menu. + * @Default {false} + */ + enableCenterAlign?: boolean; + + /**Enable / Disable the Menu control. + * @Default {true} + */ + enabled?: boolean; + + /**Specifies the menu items to be displayed in right to left direction. + * @Default {false} + */ + enableRTL?: boolean; + + /**When this property sets to false, the menu items is displayed without any separators. + * @Default {true} + */ + enableSeparator?: boolean; + + /**Specifies the target which needs to be excluded. i.e., The context menu will not be displayed in those specified targets. + * @Default {null} + */ + excludeTarget?: string; + + /**Fields used to bind the data source and it includes following field members to make databind easier. + * @Default {null} + */ + fields?: Fields; + + /**Specifies the height of the root menu. + * @Default {auto} + */ + height?: string|number; + + /**Specifies the list of html attributes to be added to menu control. + * @Default {{}} + */ + htmlAttributes?: any; + + /**Specifies the type of the menu. Essential JavaScript Menu consists of two type of menu, they are Normal Menu and Context Menu mode.See MenuType + * @Default {ej.MenuType.NormalMenu} + */ + menuType?: string|ej.MenuType; + + /**Specifies the sub menu items to be show or open only on click. + * @Default {false} + */ + openOnClick?: boolean; + + /**Specifies the orientation of normal menu. Normal menu can rendered in horizontal or vertical direction by using this API. See Orientation + * @Default {ej.Orientation.Horizontal} + */ + orientation?: string|ej.Orientation; + + /**Specifies the main menu items arrows only to be shown if it contains child items. + * @Default {true} + */ + showRooltLevelArrows?: boolean; + + /**Specifies the sub menu items arrows only to be shown if it contains child items. + * @Default {true} + */ + showSubLevelArrows?: boolean; + + /**Specifies position of pulldown submenus that will appear on mouse over.See Direction + * @Default {ej.Direction.Right} + */ + subMenuDirection?: string|ej.Direction; + + /**Specifies the title to responsive menu. + * @Default {Menu} + */ + titleText?: string; + + /**Specifies the width of the main menu. + * @Default {auto} + */ + width?: string|number; + + /**Fires before context menu gets open.*/ + beforeOpen? (e: BeforeOpenEventArgs): void; + + /**Fires when mouse click on menu items.*/ + click? (e: ClickEventArgs): void; + + /**Fire when context menu on close.*/ + close? (e: CloseEventArgs): void; + + /**Fires when context menu on open.*/ + open? (e: OpenEventArgs): void; + + /**Fires to create menu items.*/ + create? (e: CreateEventArgs): void; + + /**Fires to destroy menu items.*/ + destroy? (e: DestroyEventArgs): void; + + /**Fires when key down on menu items.*/ + keydown? (e: KeydownEventArgs): void; + + /**Fires when mouse out from menu items.*/ + mouseout? (e: MouseoutEventArgs): void; + + /**Fires when mouse over the Menu items.*/ + mouseover? (e: MouseoverEventArgs): void; +} + +export interface BeforeOpenEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the menu model + */ + model?: ej.Menu.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the target element + */ + target?: any; +} + +export interface ClickEventArgs { + + /**returns the menu model + */ + model?: ej.Menu.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns clicked menu item text + */ + text?: string; + + /**returns clicked menu item element + */ + element?: any; + + /**returns the event + */ + event?: any; + + /**returns the selected item + */ + selectedItem?: number; +} + +export interface CloseEventArgs { + + /**returns the menu model + */ + model?: ej.Menu.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the target element + */ + target?: any; +} + +export interface OpenEventArgs { + + /**returns the menu model + */ + model?: ej.Menu.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the target element + */ + target?: any; +} + +export interface CreateEventArgs { + + /**returns the menu model + */ + model?: ej.Menu.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**returns the menu model + */ + model?: ej.Menu.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface KeydownEventArgs { + + /**returns the menu model + */ + model?: ej.Menu.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns clicked menu item text + */ + menuText?: string; + + /**returns clicked menu item element + */ + element?: any; + + /**returns the event + */ + event?: any; +} + +export interface MouseoutEventArgs { + + /**returns the menu model + */ + model?: ej.Menu.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns clicked menu item text + */ + text?: string; + + /**returns clicked menu item element + */ + element?: any; + + /**returns the event + */ + event?: any; +} + +export interface MouseoverEventArgs { + + /**returns the menu model + */ + model?: ej.Menu.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns clicked menu item text + */ + text?: string; + + /**returns clicked menu item element + */ + element?: any; + + /**returns the event + */ + event?: any; +} + +export interface Fields { + + /**It receives the child data for the inner level. + */ + child?: any; + + /**It receives datasource as Essential DataManager object and JSON object. + */ + dataSource?: any; + + /**Specifies the html attributes to “li” item list. + */ + htmlAttribute?: string; + + /**Specifies the id to menu items list + */ + id?: string; + + /**Specifies the image attribute to “img” tag inside items list. + */ + imageAttribute?: string; + + /**Specifies the image URL to “img” tag inside item list. + */ + imageUrl?: string; + + /**Adds custom attributes like "target" to the anchor tag of the menu items. + */ + linkAttribute?: string; + + /**Specifies the parent id of the table. + */ + parentId?: string; + + /**It receives query to retrieve data from the table (query is same as SQL). + */ + query?: any; + + /**Specifies the sprite CSS class to “li” item list. + */ + spriteCssClass?: string; + + /**It receives table name to execute query on the corresponding table. + */ + tableName?: string; + + /**Specifies the text of menu items list. + */ + text?: string; + + /**Specifies the url to the anchor tag in menu item list. + */ + url?: string; +} +} +enum AnimationType +{ +//string +Default, +//string +None, +} +enum MenuType +{ +//string +ContextMenu, +//string +NormalMenu, +} +enum Direction +{ +//string +Left, +//string +None, +//string +Right, +} + +class Pager extends ej.Widget { + static fn: Pager; + constructor(element: JQuery, options?: Pager.Model); + constructor(element: Element, options?: Pager.Model); + model:Pager.Model; + defaults:Pager.Model; + + /** Send a paging request to specified page through the pagerControl. + * @returns {void} + */ + gotoPage(): void; +} +export module Pager{ + +export interface Model { + + /**Gets or sets a value that indicates whether to define the number of records displayed per page. + * @Default {12} + */ + pageSize?: number; + + /**Gets or sets a value that indicates whether to define the number of pages displayed in the pager for navigation. + * @Default {10} + */ + pageCount?: number; + + /**Gets or sets a value that indicates whether to define which page to display currently in pager. + * @Default {1} + */ + currentPage?: number; + + /**Get or sets a value of total number of pages in the pager. The totalPages value is calculated based on pagesize and totalrecords. + * @Default {null} + */ + totalPages?: number; + + /**Get the value of total number of records which is bound to a data item. + * @Default {null} + */ + totalRecordsCount?: number; + + /**Gets or sets a value that indicates whether to pass the current page information as a query string along with the url while navigating to other page. + * @Default {false} + */ + enableQueryString?: boolean; + + /**Gets or sets a value that indicates whether to customizing the user interface (UI) as locale-specific in order to display regional data i.e. in a language and culture specific to a particular country or region. + * @Default {en-US} + */ + locale?: string; + + /**Align content in the pager control from right to left by setting the property as true. + * @Default {false} + */ + enableRTL?: boolean; + + /**Triggered when pager numeric item is clicked in pager control.*/ + click? (e: ClickEventArgs): void; +} + +export interface ClickEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the current page index. + */ + currentPage?: number; + + /**Returns the pager model. + */ + model?: any; + + /**Returns the name of event + */ + type?: string; + + /**Returns current action event type and its target. + */ + event?: any; +} +} + +class ProgressBar extends ej.Widget { + static fn: ProgressBar; + constructor(element: JQuery, options?: ProgressBar.Model); + constructor(element: Element, options?: ProgressBar.Model); + model:ProgressBar.Model; + defaults:ProgressBar.Model; + + /** Destroy the progressbar widget + * @returns {void} + */ + destroy(): void; + + /** Disables the progressbar control + * @returns {void} + */ + disable(): void; + + /** Enables the progressbar control + * @returns {void} + */ + enable(): void; + + /** Returns the current progress value in percent. + * @returns {number} + */ + getPercentage(): number; + + /** Returns the current progress value + * @returns {number} + */ + getValue(): number; +} +export module ProgressBar{ + +export interface Model { + + /**Sets the root CSS class for ProgressBar theme, which is used customize. + * @Default {null} + */ + cssClass?: string; + + /**When this property sets to false, it disables the ProgressBar control + * @Default {true} + */ + enabled?: boolean; + + /**Save current model value to browser cookies for state maintains. While refresh the progressBar control page retains the model value apply from browser cookies + * @Default {false} + */ + enablePersistence?: boolean; + + /**Sets the ProgressBar direction as right to left alignment. + * @Default {false} + */ + enableRTL?: boolean; + + /**Defines the height of the ProgressBar. + * @Default {null} + */ + height?: number|string; + + /**It allows to define the characteristics of the progressBar control. It will helps to extend the capability of an HTML element. + * @Default {{}} + */ + htmlAttributes?: any; + + /**Sets the maximum value of the ProgressBar. + * @Default {100} + */ + maxValue?: number; + + /**Sets the minimum value of the ProgressBar. + * @Default {0} + */ + minValue?: number; + + /**Sets the ProgressBar value in percentage. The value should be in between 0 to 100. + * @Default {0} + */ + percentage?: number; + + /**Displays rounded corner borders on the progressBar control. + * @Default {false} + */ + showRoundedCorner?: boolean; + + /**Sets the custom text for the ProgressBar. The text placed in the middle of the ProgressBar and it can be customizable using the class 'e-progress-text'. + * @Default {null} + */ + text?: string; + + /**Sets the ProgressBar value. The value should be in between min and max values. + * @Default {0} + */ + value?: number; + + /**Defines the width of the ProgressBar. + * @Default {null} + */ + width?: number|string; + + /**Event triggers when the progress value changed*/ + change? (e: ChangeEventArgs): void; + + /**Event triggers when the process completes (at 100%)*/ + complete? (e: CompleteEventArgs): void; + + /**Event triggers when the progressbar are created*/ + create? (e: CreateEventArgs): void; + + /**Event triggers when the progressbar are destroyed*/ + destroy? (e: DestroyEventArgs): void; + + /**Event triggers when the process starts (from 0%)*/ + start? (e: StartEventArgs): void; +} + +export interface ChangeEventArgs { + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the ProgressBar model + */ + model?: ej.ProgressBar.Model; + + /**returns the current progress percentage + */ + percentage?: any; + + /**returns the name of the event + */ + type?: string; + + /**returns the current progress value + */ + value?: string; +} + +export interface CompleteEventArgs { + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the ProgressBar model + */ + model?: ej.ProgressBar.Model; + + /**returns the current progress percentage + */ + percentage?: any; + + /**returns the name of the event + */ + type?: string; + + /**returns the current progress value + */ + value?: string; +} + +export interface CreateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the progressbar model + */ + model?: ej.ProgressBar.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the progressbar model + */ + model?: ej.ProgressBar.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface StartEventArgs { + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the ProgressBar model + */ + model?: ej.ProgressBar.Model; + + /**returns the current progress percentage + */ + percentage?: any; + + /**returns the name of the event + */ + type?: string; + + /**returns the current progress value + */ + value?: string; +} +} + +class RadioButton extends ej.Widget { + static fn: RadioButton; + constructor(element: JQuery, options?: RadioButton.Model); + constructor(element: Element, options?: RadioButton.Model); + model:RadioButton.Model; + defaults:RadioButton.Model; + + /** To disable the RadioButton + * @returns {void} + */ + disable(): void; + + /** To enable the RadioButton + * @returns {void} + */ + enable(): void; +} +export module RadioButton{ + +export interface Model { + + /**Specifies the check attribute of the Radio Button. + * @Default {false} + */ + checked?: boolean; + + /**Specify the CSS class to RadioButton to achieve custom theme. + */ + cssClass?: string; + + /**Specifies the RadioButton control state. + * @Default {true} + */ + enabled?: boolean; + + /**Specifies the enablePersistence property for RadioButton while initialization. The enablePersistence API save current model value to browser cookies for state maintains. While refreshing the radio button control page the model value apply from browser cookies. + * @Default {false} + */ + enablePersistence?: boolean; + + /**Specify the Right to Left direction to RadioButton + * @Default {false} + */ + enableRTL?: boolean; + + /**Specifies the HTML Attributes of the Checkbox + * @Default {{}} + */ + htmlAttributes?: any; + + /**Specifies the id attribute for the Radio Button while initialization. + * @Default {null} + */ + id?: string; + + /**Specify the idPrefix value to be added before the current id of the RadioButton. + * @Default {ej} + */ + idPrefix?: string; + + /**Specifies the name attribute for the Radio Button while initialization. + * @Default {Sets id as name if it is null} + */ + name?: string; + + /**Specifies the size of the RadioButton. + * @Default {small} + */ + size?: ej.RadioButtonSize|string; + + /**Specifies the text content for RadioButton. + */ + text?: string; + + /**Set the jquery validation error message in radio button. + * @Default {null} + */ + validationMessage?: any; + + /**Set the jquery validation rules in radio button. + * @Default {null} + */ + validationRules?: any; + + /**Specifies the value attribute of the Radio Button. + * @Default {null} + */ + value?: string; + + /**Fires before the RadioButton is going to changed its state successfully*/ + beforeChange? (e: BeforeChangeEventArgs): void; + + /**Fires when the RadioButton state is changed successfully*/ + change? (e: ChangeEventArgs): void; + + /**Fires when the RadioButton created successfully*/ + create? (e: CreateEventArgs): void; + + /**Fires when the RadioButton destroyed successfully*/ + destroy? (e: DestroyEventArgs): void; +} + +export interface BeforeChangeEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the RadioButton model + */ + model?: ej.RadioButton.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns true if element is checked, otherwise returns false + */ + isChecked?: boolean; + + /**returns true if change event triggered by interaction, otherwise returns false + */ + isInteraction?: boolean; +} + +export interface ChangeEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the RadioButton model + */ + model?: ej.RadioButton.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns true if element is checked, otherwise returns false + */ + isChecked?: boolean; + + /**returns true if change event triggered by interaction, otherwise returns false + */ + isInteraction?: boolean; +} + +export interface CreateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the RadioButton model + */ + model?: ej.RadioButton.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the RadioButton model + */ + model?: ej.RadioButton.Model; + + /**returns the name of the event + */ + type?: string; +} +} +enum RadioButtonSize +{ +//Shows small size radio button +Small, +//Shows medium size radio button +Medium, +} + +class Rating extends ej.Widget { + static fn: Rating; + constructor(element: JQuery, options?: Rating.Model); + constructor(element: Element, options?: Rating.Model); + model:Rating.Model; + defaults:Rating.Model; + + /** Destroy the Rating widget all events bound will be unbind automatically and bring the control to pre-init state. + * @returns {void} + */ + destroy(): void; + + /** To get the current value of rating control. + * @returns {number} + */ + getValue(): number; + + /** To hide the rating control. + * @returns {void} + */ + hide(): void; + + /** User can refresh the rating control to identify changes. + * @returns {void} + */ + refresh(): void; + + /** To reset the rating value. + * @returns {void} + */ + reset(): void; + + /** To set the rating value. + * @param {string|number} Specifies the rating value. + * @returns {void} + */ + setValue(value: string|number): void; + + /** To show the rating control + * @returns {void} + */ + show(): void; +} +export module Rating{ + +export interface Model { + + /**Enables the rating control with reset button.It can be used to reset the rating control value. + * @Default {true} + */ + allowReset?: boolean; + + /**Specify the CSS class to achieve custom theme. + */ + cssClass?: string; + + /**When this property is set to false, it disables the rating control. + * @Default {true} + */ + enabled?: boolean; + + /**Save current model value to browser cookies for state maintenance. While refresh the page Rating control values are retained. + * @Default {false} + */ + enablePersistence?: boolean; + + /**Specifies the height of the Rating control wrapper. + * @Default {null} + */ + height?: string; + + /**Specifies the value to be increased while navigating between shapes(stars) in Rating control. + * @Default {1} + */ + incrementStep?: number; + + /**Allow to render the maximum number of Rating shape(star). + * @Default {5} + */ + maxValue?: number; + + /**Allow to render the minimum number of Rating shape(star). + * @Default {0} + */ + minValue?: number; + + /**Specifies the orientation of Rating control. See Orientation + * @Default {ej.Rating.Orientation.Horizontal} + */ + orientation?: ej.Orientation|string; + + /**Helps to provide more precise ratings.Rating control supports three precision modes - full, half, and exact. See Precision + * @Default {full} + */ + precision?: ej.Rating.Precision|string; + + /**Interaction with Rating control can be prevented by enabling this API. + * @Default {false} + */ + readOnly?: boolean; + + /**To specify the height of each shape in Rating control. + * @Default {23} + */ + shapeHeight?: number; + + /**To specify the width of each shape in Rating control. + * @Default {23} + */ + shapeWidth?: number; + + /**Enables the tooltip option.Currently selected value will be displayed in tooltip. + * @Default {true} + */ + showTooltip?: boolean; + + /**To specify the number of stars to be selected while rendering. + * @Default {1} + */ + value?: number; + + /**Specifies the width of the Rating control wrapper. + * @Default {null} + */ + width?: string; + + /**Fires when Rating value changes.*/ + change? (e: ChangeEventArgs): void; + + /**Fires when Rating control is clicked successfully.*/ + click? (e: ClickEventArgs): void; + + /**Fires when Rating control is created.*/ + create? (e: CreateEventArgs): void; + + /**Fires when Rating control is destroyed successfully.*/ + destroy? (e: DestroyEventArgs): void; + + /**Fires when mouse hover is removed from Rating control.*/ + mouseout? (e: MouseoutEventArgs): void; + + /**Fires when mouse hovered over the Rating control.*/ + mouseover? (e: MouseoverEventArgs): void; +} + +export interface ChangeEventArgs { + + /**returns the current value. + */ + value?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the rating model + */ + model?: ej.Rating.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the mouse click event args values. + */ + event?: any; +} + +export interface ClickEventArgs { + + /**returns the current value. + */ + value?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the rating model + */ + model?: ej.Rating.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the mouse click event args values. + */ + event?: any; +} + +export interface CreateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the rating model + */ + model?: ej.Rating.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the rating model + */ + model?: ej.Rating.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface MouseoutEventArgs { + + /**returns the current value. + */ + value?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the rating model + */ + model?: ej.Rating.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the mouse click event args values. + */ + event?: any; +} + +export interface MouseoverEventArgs { + + /**returns the current value. + */ + value?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the rating model + */ + model?: ej.Rating.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the mouse click event args values. + */ + event?: any; + + /**returns the current index value. + */ + index?: any; +} + +enum Precision{ + + ///string + Exact, + + ///string + Full, + + ///string + Half +} + +} + +class Ribbon extends ej.Widget { + static fn: Ribbon; + constructor(element: JQuery, options?: Ribbon.Model); + constructor(element: Element, options?: Ribbon.Model); + model:Ribbon.Model; + defaults:Ribbon.Model; + + /** Adds contextual tab or contextual tab set dynamically in the ribbon control with contextual tabs object and index position. When index is null, ribbon contextual tab or contextual tab set is added at the last index. + * @param {any} contextual tab or contextual tab set object. + * @param {number} index of the contextual tab or contextual tab set, this is optional. + * @returns {void} + */ + addContextualTabs(contextualTabSet: any, index: number): void; + + /** Adds tab dynamically in the ribbon control with given name, tab group array and index position. When index is null, ribbon tab is added at the last index. + * @param {string} ribbon tab display text. + * @param {Array} groups to be displayed in ribbon tab . + * @param {number} index of the ribbon tab,this is optional. + * @returns {void} + */ + addTab(tabText: string, ribbonGroups: Array, index: number): void; + + /** Adds tab group dynamically in the ribbon control with given tab index, tab group object and group index position. When group index is null, ribbon group is added at the last index. + * @param {number} ribbon tab index. + * @param {any} group to be displayed in ribbon tab . + * @param {number} index of the ribbon group,this is optional. + * @returns {void} + */ + addTabGroup(tabIndex: number, tabGroup: any, groupIndex: number): void; + + /** Adds group content dynamically in the ribbon control with given tab index, group index, sub group index, content and content index position. When content index is null, content is added at the last index. + * @param {number} ribbon tab index. + * @param {number} ribbon group index. + * @param {number} sub group index in the ribbon group, + * @param {any} content to be displayed in the ribbon group. + * @param {number} ribbon content index .this is optional. + * @returns {void} + */ + addTabGroupContent(tabIndex: number, groupIndex: number, subGroupIndex: number, content: any, contentIndex: number): void; + + /** Hides the ribbon backstage page. + * @returns {void} + */ + hideBackstage(): void; + + /** Collapses the ribbon tab content. + * @returns {void} + */ + collapse(): void; + + /** Destroys the ribbon widget. All the events bound using this._on are unbound automatically and the ribbon control is moved to pre-init state. + * @returns {void} + */ + destroy(): void; + + /** Expands the ribbon tab content. + * @returns {void} + */ + expand(): void; + + /** Gets text of the given index tab in the ribbon control. + * @param {number} index of the tab item. + * @returns {string} + */ + getTabText(index: number): string; + + /** Hides the given text tab in the ribbon control. + * @param {string} text of the tab item. + * @returns {void} + */ + hideTab(string: string): void; + + /** Checks whether the given text tab in the ribbon control is enabled or not. + * @param {string} text of the tab item. + * @returns {boolean} + */ + isEnable(string: string): boolean; + + /** Checks whether the given text tab in the ribbon control is visible or not. + * @param {string} text of the tab item. + * @returns {boolean} + */ + isVisible(string: string): boolean; + + /** Removes the given index tab item from the ribbon control. + * @param {number} index of tab item. + * @returns {void} + */ + removeTab(index: number): void; + + /** Sets new text to the given text tab in the ribbon control. + * @param {string} current text of the tab item. + * @param {string} new text of the tab item. + * @returns {void} + */ + setTabText(tabText: string, newText: string): void; + + /** Displays the ribbon backstage page. + * @returns {void} + */ + showBackstage(): void; + + /** Displays the given text tab in the ribbon control. + * @param {string} text of the tab item. + * @returns {void} + */ + showTab(string: string): void; +} +export module Ribbon{ + +export interface Model { + + /**Enables the ribbon resize feature. + * @Default {false} + */ + allowResizing?: boolean; + + /**Specifies the height, width, enableRTL, showRoundedCorner,enabled,cssClass property to the controls in the ribbon commonly andit will work only when those properties are not defined in buttonSettings and content defaults. + * @Default {object} + */ + buttonDefaults?: any; + + /**Property to enable the ribbon quick access toolbar. + * @Default {false} + */ + showQAT?: boolean; + + /**Sets custom setting to the collapsible pin in the ribbon. + * @Default {Object} + */ + collapsePinSettings?: CollapsePinSettings; + + /**Sets custom setting to the expandable pin in the ribbon. + * @Default {Object} + */ + expandPinSettings?: ExpandPinSettings; + + /**Specifies the application tab to contain application menu or backstage page in the ribbon control. + * @Default {Object} + */ + applicationTab?: ApplicationTab; + + /**Specifies the contextual tabs and tab set to the ribbon control with the background color and border color. Refer to the tabs section for adding tabs into the contextual tab and contextual tab set. + * @Default {array} + */ + contextualTabs?: Array; + + /**Specifies the index or indexes to disable the given index tab or indexes tabs in the ribbon control. + * @Default {0} + */ + disabledItemIndex?: Array; + + /**Specifies the index or indexes to enable the given index tab or indexes tabs in the ribbon control. + * @Default {null} + */ + enabledItemIndex?: Array; + + /**Specifies the index of the ribbon tab to select the given index tab item in the ribbon control. + * @Default {1} + */ + selectedItemIndex?: number; + + /**Specifies the tabs and its groups. Also specifies the control details that has to be placed in the tab area in the ribbon control. + * @Default {array} + */ + tabs?: Array; + + /**Gets or sets a value that indicates whether to customizing the user interface (UI) as locale-specific in order to display regional data i.e. in a language and culture specific to a particular country or region and it will need to use the user's preference. + * @Default {en-US} + */ + locale?: string; + + /**Specifies the width to the ribbon control. You can set width in string or number format. + * @Default {null} + */ + width?: string|number; + + /**Triggered before the ribbon tab item is removed.*/ + beforeTabRemove? (e: BeforeTabRemoveEventArgs): void; + + /**Triggered before the ribbon control is created.*/ + create? (e: CreateEventArgs): void; + + /**Triggered before the ribbon control is destroyed.*/ + destroy? (e: DestroyEventArgs): void; + + /**Triggered when the control in the group is clicked successfully.*/ + groupClick? (e: GroupClickEventArgs): void; + + /**Triggered when the groupexpander in the group is clicked successfully.*/ + groupExpand? (e: GroupExpandEventArgs): void; + + /**Triggered when an item in the Gallery control is clicked successfully.*/ + galleryItemClick? (e: GalleryItemClickEventArgs): void; + + /**Triggered when a tab or button in the backstage page is clicked successfully.*/ + backstageItemClick? (e: BackstageItemClickEventArgs): void; + + /**Triggered when the ribbon control is collapsed.*/ + collapse? (e: CollapseEventArgs): void; + + /**Triggered when the ribbon control is expanded.*/ + expand? (e: ExpandEventArgs): void; + + /**Triggered after adding the new ribbon tab item.*/ + tabAdd? (e: TabAddEventArgs): void; + + /**Triggered when tab is clicked successfully in the ribbon control.*/ + tabClick? (e: TabClickEventArgs): void; + + /**Triggered before the ribbon tab is created.*/ + tabCreate? (e: TabCreateEventArgs): void; + + /**Triggered after the tab item is removed from the ribbon control.*/ + tabRemove? (e: TabRemoveEventArgs): void; + + /**Triggered after the ribbon tab item is selected in the ribbon control.*/ + tabSelect? (e: TabSelectEventArgs): void; + + /**Triggered when the expand/collapse button is clicked successfully .*/ + toggleButtonClick? (e: ToggleButtonClickEventArgs): void; + + /**Triggered when the QAT menu item is clicked successfully .*/ + qatMenuItemClick? (e: QatMenuItemClickEventArgs): void; +} + +export interface BeforeTabRemoveEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the ribbon model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; + + /**returns current tab item index in the ribbon control. + */ + index?: number; +} + +export interface CreateEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the ribbon model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**Set to true when the event has to be cancelled, else false. + */ + cancel?: boolean; + + /**returns the ribbon model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; + + /**returns current ribbon tab item index + */ + deleteIndex?: number; +} + +export interface GroupClickEventArgs { + + /**Set to true when the event has to be cancelled, else false. + */ + cancel?: boolean; + + /**returns the ribbon model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; + + /**returns the control clicked in the group. + */ + target?: number; +} + +export interface GroupExpandEventArgs { + + /**Set to true when the event has to be cancelled, else false. + */ + cancel?: boolean; + + /**returns the ribbon model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; + + /**returns the clicked groupexpander. + */ + target?: number; +} + +export interface GalleryItemClickEventArgs { + + /**Set to true when the event has to be cancelled, else false. + */ + cancel?: boolean; + + /**returns the ribbon model. + */ + model?: any; + + /**returns the gallery model. + */ + galleryModel?: any; + + /**returns the name of the event. + */ + type?: string; + + /**returns the item clicked in the gallery. + */ + target?: number; +} + +export interface BackstageItemClickEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the ribbon model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; + + /**returns the item clicked in the gallery. + */ + target?: number; + + /**returns the id of the target item. + */ + id?: string; + + /**returns the text of the target item. + */ + text?: string; +} + +export interface CollapseEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the ribbon model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface ExpandEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the ribbon model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface TabAddEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the ribbon model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; + + /**returns new added tab header. + */ + tabHeader?: any; + + /**returns new added tab content panel. + */ + tabContent?: any; +} + +export interface TabClickEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the ribbon model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; + + /**returns previous active tab header. + */ + prevActiveHeader?: any; + + /**returns previous active index. + */ + prevActiveIndex?: number; + + /**returns current active tab header . + */ + activeHeader?: any; + + /**returns current active index. + */ + activeIndex?: number; +} + +export interface TabCreateEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the ribbon model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; + + /**returns current ribbon tab item index + */ + deleteIndex?: number; +} + +export interface TabRemoveEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the ribbon model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; + + /**returns the removed index. + */ + removedIndex?: number; +} + +export interface TabSelectEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the ribbon model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; + + /**returns previous active tab header. + */ + prevActiveHeader?: any; + + /**returns previous active index. + */ + prevActiveIndex?: number; + + /**returns current active tab header . + */ + activeHeader?: any; + + /**returns current active index. + */ + activeIndex?: number; +} + +export interface ToggleButtonClickEventArgs { + + /**Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /**returns the ribbon model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; + + /**returns the expand/collapse button. + */ + target?: number; +} + +export interface QatMenuItemClickEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the ribbon model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; + + /**returns the clicked menu item text. + */ + text?: string; +} + +export interface CollapsePinSettings { + + /**Sets tooltip for the collapse pin . + * @Default {null} + */ + toolTip?: string; + + /**Specifies the custom tooltip for collapse pin.Refer to ejRibbon#tabs->groups->content->groups->customToolTip for its inner properties. + * @Default {Object} + */ + customToolTip?: any; +} + +export interface ExpandPinSettings { + + /**Sets tooltip for the expand pin. + * @Default {null} + */ + toolTip?: string; + + /**Specifies the custom tooltip for expand pin.Refer to ejRibbon#tabs->groups->content->groups->customToolTip for its inner properties. + * @Default {Object} + */ + customToolTip?: any; +} + +export interface ApplicationTabBackstageSettingsPages { + + /**Specifies the id for ribbon backstage page's tab and button elements. + * @Default {null} + */ + id?: string; + + /**Specifies the text for ribbon backstage page's tab header and button elements. + * @Default {null} + */ + text?: string; + + /**Specifies the type for ribbon backstage page's contents. Set "ej.Ribbon.backStageItemType.tab" to render the tab or "ej.Ribbon.backStageItemType.button" to render the button. + * @Default {ej.Ribbon.itemType.tab} + */ + itemType?: ej.Ribbon.itemType|string; + + /**Specifies the id of html elements like div, ul, etc., as ribbon backstage page's tab content. + * @Default {null} + */ + contentID?: string; + + /**Specifies the separator between backstage page's tab and button elements. + * @Default {false} + */ + enableSeparator?: boolean; +} + +export interface ApplicationTabBackstageSettings { + + /**Specifies the display text of application tab. + * @Default {null} + */ + text?: string; + + /**Specifies the height of ribbon backstage page. + * @Default {null} + */ + height?: string|number; + + /**Specifies the width of ribbon backstage page. + * @Default {null} + */ + width?: string|number; + + /**Specifies the ribbon backstage page with its tab and button elements. + * @Default {array} + */ + pages?: Array; + + /**Specifies the width of backstage page header that contains tabs and buttons. + * @Default {null} + */ + headerWidth?: string|number; +} + +export interface ApplicationTab { + + /**Specifies the ribbon backstage page items. + * @Default {object} + */ + backstageSettings?: ApplicationTabBackstageSettings; + + /**Specifies the ID of 'ul' list to create application menu in the ribbon control. + * @Default {null} + */ + menuItemID?: string; + + /**Specifies the menu members, events by using the menu settings for the menu in the application tab. + * @Default {object} + */ + menuSettings?: any; + + /**Specifies the application menu or backstage page. Specify the type of application tab as "ej.Ribbon.applicationTabType.menu" to render the application menu or "ej.Ribbon.applicationTabType.backstage" to render backstage page in the ribbon control. + * @Default {ej.Ribbon.applicationTabType.menu} + */ + type?: ej.Ribbon.applicationTabType|string; +} + +export interface ContextualTabs { + + /**Specifies the backgroundColor of the contextual tabs and tab set in the ribbon control. + * @Default {null} + */ + backgroundColor?: string; + + /**Specifies the borderColor of the contextual tabs and tab set in the ribbon control. + * @Default {null} + */ + borderColor?: string; + + /**Specifies the tabs to present in the contextual tabs and tab set. Refer to the tabs section for adding tabs into the contextual tabs and tab set. + * @Default {array} + */ + tabs?: Array; +} + +export interface TabsGroupsContentGroupsCustomGalleryItems { + + /**Specifies the syncfusion button members, events by using buttonSettings. + * @Default {object} + */ + buttonSettings?: any; + + /**Specifies the type as ej.Ribbon.customItemType.menu or ej.Ribbon.customItemType.button to render Syncfusion button and menu. + * @Default {ej.Ribbon.customItemType.button} + */ + customItemType?: ej.Ribbon.customItemType|string; + + /**Specifies the custom tooltip for gallery extra item's button. Refer to ejRibbon#tabs->groups->content->groups->customToolTip for its inner properties. + * @Default {object} + */ + customToolTip?: any; + + /**Specifies the UL list id to render menu as gallery extra item. + * @Default {null} + */ + menuId?: string; + + /**Specifies the Syncfusion menu members, events by using menuSettings. + * @Default {object} + */ + menuSettings?: any; + + /**Specifies the text for gallery extra item's button. + * @Default {null} + */ + text?: string; + + /**Specifies the tooltip for gallery extra item's button. + * @Default {null} + */ + toolTip?: string; +} + +export interface TabsGroupsContentGroupsCustomToolTip { + + /**Sets content to the custom tooltip. Text and html support are provided for content. + * @Default {null} + */ + content?: string; + + /**Sets icon to the custom tooltip content. + * @Default {null} + */ + prefixIcon?: string; + + /**Sets title to the custom tooltip. Text and html support are provided for title and the title is in bold for text format. + * @Default {null} + */ + title?: string; +} + +export interface TabsGroupsContentGroupsGalleryItems { + + /**Specifies the Syncfusion button members, events by using buttonSettings. + * @Default {object} + */ + buttonSettings?: any; + + /**Specifies the custom tooltip for gallery content. Refer to ejRibbon#tabs->groups->content->groups->customToolTip for its inner properties. + * @Default {object} + */ + customToolTip?: any; + + /**Sets text for the gallery content. + * @Default {null} + */ + text?: string; + + /**Sets tooltip for the gallery content. + * @Default {null} + */ + toolTip?: string; +} + +export interface TabsGroupsContentGroups { + + /**Specifies the Syncfusion button members, events by using this buttonSettings. + * @Default {object} + */ + buttonSettings?: any; + + /**It is used to set the count of gallery contents in a row. + * @Default {null} + */ + columns?: number; + + /**Specifies the custom items such as div, table, controls as custom controls with the type "ej.Ribbon.type.custom" in the groups. + * @Default {null} + */ + contentID?: string; + + /**Specifies the css class property to apply styles to the button, split, dropdown controls in the groups. + * @Default {null} + */ + cssClass?: string; + + /**Specifies the Syncfusion button and menu as gallery extra items. + * @Default {array} + */ + customGalleryItems?: Array; + + /**Provides custom tooltip for button, split button, dropdown list, toggle button, custom controls in the sub groups. Text and html support are also provided for title and content. + * @Default {Object} + */ + customToolTip?: TabsGroupsContentGroupsCustomToolTip; + + /**Specifies the Syncfusion dropdown list members, events by using this dropdownSettings. + * @Default {object} + */ + dropdownSettings?: any; + + /**Specifies the separator to the control that is in row type group. The separator separates the control from the next control in the group. Set "true" to enable the separator. + * @Default {false} + */ + enableSeparator?: boolean; + + /**Sets the count of gallery contents in a row, when the gallery is in expanded state. + * @Default {null} + */ + expandedColumns?: number; + + /**Defines each gallery content. + * @Default {array} + */ + galleryItems?: Array; + + /**Specifies the Id for button, split button, dropdown list, toggle button, gallery, custom controls in the sub groups. + * @Default {null} + */ + id?: string; + + /**Specifies the size for button, split button controls. Set "true" for big size and "false" for small size. + * @Default {null} + */ + isBig?: boolean; + + /**Sets the height of each gallery content. + * @Default {null} + */ + itemHeight?: string|number; + + /**Sets the width of each gallery content. + * @Default {null} + */ + itemWidth?: string|number; + + /**Specifies the Syncfusion split button members, events by using this splitButtonSettings. + * @Default {object} + */ + splitButtonSettings?: any; + + /**Specifies the text for button, split button, toggle button controls in the sub groups. + * @Default {null} + */ + text?: string; + + /**Specifies the Syncfusion toggle button members, events by using toggleButtonSettings. + * @Default {object} + */ + toggleButtonSettings?: any; + + /**Specifies the tooltip for button, split button, dropdown list, toggle button, custom controls in the sub groups. + * @Default {null} + */ + toolTip?: string; + + /**To add,show and hide controls in Quick Access toolbar. + * @Default {ej.Ribbon.quickAccessMode.none} + */ + quickAccessMode?: ej.Ribbon.quickAccessMode|string; + + /**Specifies the type as "ej.Ribbon.type.button" or "ej.Ribbon.type.splitButton" or "ej.Ribbon.type.dropDownList" or "ej.Ribbon.type.toggleButton" or "ej.Ribbon.type.custom" or "ej.Ribbon.type.gallery" to render button, split, dropdown, toggle button, gallery, custom controls. + * @Default {ej.Ribbon.type.button} + */ + type?: ej.Ribbon.type|string; +} + +export interface TabsGroupsContent { + + /**Specifies the height, width, type, isBig property to the controls in the group commonly. + * @Default {object} + */ + defaults?: any; + + /**Specifies the controls such as Syncfusion button, split button, dropdown list, toggle button, gallery, custom controls in the subgroup of the ribbon tab . + * @Default {array} + */ + groups?: Array; +} + +export interface TabsGroupsGroupExpanderSettings { + + /**Sets tooltip for the group expander of the group. + * @Default {null} + */ + toolTip?: string; + + /**Specifies the custom tooltip for group expander.Refer to ejRibbon#tabs->groups->content->groups->customToolTip for its inner properties. + * @Default {Object} + */ + customToolTip?: any; +} + +export interface TabsGroups { + + /**Specifies the alignment of controls in the groups in 'row' type or 'column' type. Value for row type is "ej.Ribbon.alignType.rows" and for column type is "ej.Ribbon.alignType.columns". + * @Default {ej.Ribbon.alignType.rows} + */ + alignType?: ej.Ribbon.alignType|string; + + /**Specifies the Syncfusion button, split button, dropdown list, toggle button, gallery, custom controls to the groups in the ribbon control. + * @Default {array} + */ + content?: Array; + + /**Specifies the ID of custom items to be placed in the groups. + * @Default {null} + */ + contentID?: string; + + /**Specifies the HTML contents to place into the groups. + * @Default {null} + */ + customContent?: string; + + /**Specifies the group expander for groups in the ribbon control. Set "true" to enable the group expander. + * @Default {false} + */ + enableGroupExpander?: boolean; + + /**Sets custom setting to the groups in the ribbon control. + * @Default {Object} + */ + groupExpanderSettings?: TabsGroupsGroupExpanderSettings; + + /**Specifies the text to the groups in the ribbon control. + * @Default {null} + */ + text?: string; + + /**Specifies the custom items such as div, table, controls by using the "custom" type. + * @Default {null} + */ + type?: string; +} + +export interface Tabs { + + /**Specifies single group or multiple groups and its contents to each tab in the ribbon control. + * @Default {array} + */ + groups?: Array; + + /**Specifies the ID for each tab's content panel. + * @Default {null} + */ + id?: string; + + /**Specifies the text of the tab in the ribbon control. + * @Default {null} + */ + text?: string; +} + +enum itemType{ + + ///To render the button for ribbon backstage page’s contents + Button, + + ///To render the tab for ribbon backstage page’s contents + Tab +} + + +enum applicationTabType{ + + ///applicationTab display as menu + Menu, + + ///applicationTab display as backstage + Backstage +} + + +enum alignType{ + + ///To align the group content's in row + Rows, + + ///To align group content's in columns + Columns +} + + +enum customItemType{ + + ///Specifies the button type in customGalleryItems + Button, + + ///Specifies the menu type in customGalleryItems + Menu +} + + +enum quickAccessMode{ + + ///Controls are hidden in Quick Access toolbar + None, + + ///Add controls in toolBar + ToolBar, + + ///Add controls in menu + Menu +} + + +enum type{ + + ///Specifies the button control + Button, + + ///Specifies the split button + SplitButton, + + ///Specifies the dropDown + DropDownList, + + ///To append external element's + Custom, + + ///Specifies the toggle button + ToggleButton, + + ///Specifies the ribbon gallery + Gallery +} + +} + +class Kanban extends ej.Widget { + static fn: Kanban; + constructor(element: JQuery, options?: Kanban.Model); + constructor(element: Element, options?: Kanban.Model); + model:Kanban.Model; + defaults:Kanban.Model; + + /** Add a new card in kanban control.If parameters are not given default dialog will be open + * @param {string} Pass the primary key field Name of the column + * @param {Array} Pass the edited json data of card need to be add. + * @returns {void} + */ + addCard(primaryKey: string, card: Array): void; + + /** Method used for send a clear search request to kanban. + * @returns {void} + */ + clearSearch(): void; + + /** It is used to clear all the card selection. + * @returns {void} + */ + clearSelection(): void; + + /** Collapse all the swimlane rows in kanban. + * @returns {void} + */ + collapseAll(): void; + + /** Add or remove columns in kanban columns collections + * @param {Array|string} Pass array of columns or string of headerText to add/remove the column in kanban + * @param {Array|string} Pass array of columns or string of keyvalue to add/remove the column in kanban + * @param {string} optional Pass add/remove action to be performed. By default "add" action will perform + * @returns {void} + */ + columns(columndetails: Array|string, keyvalue: Array|string, action: string): void; + + /** Send a cancel request of add/edit card in kanban + * @returns {void} + */ + cancelEdit(): void; + + /** Destroy the kanban widget all events bound using this._on will be unbind automatically and bring the control to pre-init state. + * @returns {void} + */ + destroy(): void; + + /** Delete a card in kanban control. + * @param {string|number} Pass the key of card to be delete + * @returns {void} + */ + deleteCard(Key: string|number): void; + + /** Refresh the kanban with new data source. + * @param {Array} Pass new data source to the kanban + * @returns {void} + */ + dataSource(datasource: Array): void; + + /** Send a save request in kanban when any card is in edit/new add card state. + * @returns {void} + */ + endEdit(): void; + + /** toggleColumn based on the headerText in kanban. + * @param {any} Pass the header text of the column to get the corresponding column object + * @returns {void} + */ + toggleColumn( headerText : any): void; + + /** Expand or collapse the card based on the state of target "div" + * @param {string|number} Pass the key of card to be toggle + * @returns {void} + */ + toggleCard( key : string|number): void; + + /** Expand or collapse the swimlane row based on the state of target "div" + * @param {any} Pass the div object to toggleSwimlane row based on its row state + * @returns {void} + */ + toggleSwimlane( $div : any): void; + + /** Expand all the swimlane rows in kanban. + * @returns {void} + */ + expandAll(): void; + + /** used for get the names of all the visible column name collections in kanban. + * @returns {void} + */ + getVisibleColumnNames(): void; + + /** Get the scroller object of kanban. + * @returns {void} + */ + getScrollObject(): void; + + /** Get the column details based on the given header text in kanban. + * @param {string} Pass the header text of the column to get the corresponding column object + * @returns {string} + */ + getColumnByHeaderText( headerText : string): string; + + /** Hide columns from the kanban based on the header text + * @param {Array|string} you can pass either array of header text of various columns or a header text of a column to hide + * @returns {void} + */ + hideColumns( headerText : Array|string): void; + + /** Refresh the template of the kanban + * @returns {void} + */ + refreshTemplate(): void; + + /** Refresh the kanban contents.The template refreshment is based on the argument passed along with this method + * @param {boolean} optional When templateRefresh is set true, template and kanban contents both are refreshed in kanban else only kanban content is refreshed + * @returns {void} + */ + refresh( templateRefresh : boolean): void; + + /** send a search request to kanban with specified string passed in it. + * @param {string} Pass the string to search in Kanban card + * @returns {void} + */ + searchCards( searchString: string): void; + + /** Method used for set validation to a field during editing. + * @param {string} Specify the name of the column to set validation rules + * @param {any} Specify the validation rules for the field + * @returns {void} + */ + setValidationToField(name: string, rules: any): void; + + /** Send an edit card request in kanban.Parameter will be Html element or primary key + * @param {any} Pass the div selected row element to be edited in kanban + * @returns {void} + */ + startEdit( $div : any): void; + + /** Show columns in the kanban based on the header text. + * @param {Array|string} You can pass either array of header text of various columns or a header text of a column to show + * @returns {void} + */ + showColumns( headerText : Array|string): void; + + /** Update a card in kanban control based on key and json data given. + * @param {string} Pass the key field Name of the column + * @param {Array} Pass the edited json data of card need to be update. + * @returns {void} + */ + updateCard( key : string, data : Array): void; +} +export module Kanban{ + +export interface Model { + + /**Gets or sets a value that indicates whether to enable allowDragAndDrop behavior on kanban. + * @Default {true} + */ + allowDragAndDrop?: boolean; + + /**To enable or disable the title of the card. + * @Default {false} + */ + allowTitle?: boolean; + + /**Customize the settings for swimlane. + * @Default {Object} + */ + swimlaneSettings?: SwimlaneSettings; + + /**To enable or disable the column expand /collapse. + * @Default {false} + */ + allowToggleColumn?: boolean; + + /**To enable Searching operation in kanban. + * @Default {false} + */ + allowSearching?: boolean; + + /**Gets or sets a value that indicates whether to enable allowSelection behavior on kanban.User can select card and the selected card will be highlighted on kanban. + * @Default {true} + */ + allowSelection?: boolean; + + /**Gets or sets a value that indicates whether to allow card hover actions. + * @Default {true} + */ + allowHover?: boolean; + + /**To allow keyboard navigation actions. + * @Default {true} + */ + allowKeyboardNavigation?: boolean; + + /**Gets or sets a value that indicates whether to enable the scrollbar in the kanban and view the card by scroll through the kanban manually. + * @Default {false} + */ + allowScrolling?: boolean; + + /**Gets or sets an object that indicates whether to customize the context menu behavior of the kanban. + * @Default {Object} + */ + contextMenuSettings?: ContextMenuSettings; + + /**Gets or sets an object that indicates to render the kanban with specified columns. + * @Default {array} + */ + columns?: Array; + + /**Gets or sets an object that indicates whether to Customize the card based on the Mapping Fields. + * @Default {Object} + */ + cardSettings?: CardSettings; + + /**Gets or sets a value that indicates to render the kanban with custom theme. + * @Default {null} + */ + cssClass?: string; + + /**Gets or sets the data to render the kanban with card. + * @Default {Object} + */ + dataSource?: any; + + /**Align content in the kanban control from right to left by setting the property as true. + * @Default {false} + */ + enableRTL?: boolean; + + /**To show Total count of cards in each column + * @Default {true} + */ + enableTotalCount?: boolean; + + /**Gets or sets a value that indicates whether to enablehover support for performing card hover actions. + * @Default {true} + */ + enableHover?: boolean; + + /**Get or sets an object that indicates whether to customize the editing behavior of the kanban. + * @Default {Object} + */ + editSettings?: EditSettings; + + /**To customize field mappings for card , editing title and control key parameters + * @Default {Object} + */ + fields?: Fields; + + /**To map datasource field for column values mapping + * @Default {null} + */ + keyField?: string; + + /**Gets or sets a value that indicates whether the kanban design has be to made responsive. + * @Default {false} + */ + isResponsive?: boolean; + + /**Gets or sets a value that indicates whether to set the minimum width of the responsive kanban while isResponsive property is true and enableResponsiveRow property is set as false. + * @Default {null} + */ + minWidth?: number; + + /**To customize the filtering behavior based on queries given. + * @Default {array} + */ + filterSettings?: Array; + + /**The primarykey field is get as property of kanban. And this will used for Drag and drop and editing mainly + * @Default {null} + */ + primaryKeyField?: string; + + /**ej Query to query database of kanban. + * @Default {Object} + */ + query?: any; + + /**To change the key in keyboard interaction to kanban control. + * @Default {Object} + */ + keySettings?: KeySettings; + + /**Gets or sets an object that indicates whether to customize the scrolling behavior of the kanban. + * @Default {Object} + */ + scrollSettings?: any; + + /**To customize the searching behavior of the kanban. + * @Default {Object} + */ + searchSettings?: SearchSettings; + + /**To allow customize selection type. Accepting types are "single" and "multiple". + * @Default {ej.Kanban.SelectionType.Single} + */ + selectionType?: ej.Kanban.SelectionType|string; + + /**Gets or sets an object that indicates to managing the collection of stacked header rows for the kanban. + * @Default {Array} + */ + stackedHeaderRows?: Array; + + /**The tooltip allows to display card details in a tooltip while hovering on it. + */ + tooltipSettings?: TooltipSettings; + + /**Gets or sets a value that indicates whether to customizing the user interface (UI) as locale-specific in order to display regional data i.e. in a language and culture specific to a particular country or region. + * @Default {en-US} + */ + locale?: string; + + /**Triggered for every kanban action before its starts.*/ + actionBegin? (e: ActionBeginEventArgs): void; + + /**tiggered for every kanban action success event.*/ + actionComplete? (e: ActionCompleteEventArgs): void; + + /**Triggered for every kanban action server failure event.*/ + actionFailure? (e: ActionFailureEventArgs): void; + + /**Triggered before the task is going to be edited.*/ + beginEdit? (e: BeginEditEventArgs): void; + + /**Triggered before the task is going to be added*/ + beginAdd? (e: BeginAddEventArgs): void; + + /**triggered before the card is going to be selecting.*/ + beforeCardSelect? (e: BeforeCardSelectEventArgs): void; + + /**Trigger after the card is clicked.*/ + cardClick? (e: CardClickEventArgs): void; + + /**Triggered when the card is being dragged.*/ + cardDrag? (e: CardDragEventArgs): void; + + /**Triggered when card dragging start.*/ + cardDragStart? (e: CardDragStartEventArgs): void; + + /**triggered when card dragging stops.*/ + cardDragStop? (e: CardDragStopEventArgs): void; + + /**Triggered when the card is Drop.*/ + cardDrop? (e: CardDropEventArgs): void; + + /**Triggered after the card is select.*/ + cardSelect? (e: CardSelectEventArgs): void; + + /**Triggered when card is double clicked.*/ + cardDoubleClick? (e: CardDoubleClickEventArgs): void; +} + +export interface ActionBeginEventArgs { + + /**Returns the kanban model. + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the current action event type. + */ + originalEventType?: string; + + /**Returns primary key value. + */ + primaryKeyValue?: string; + + /**Returns request type. + */ + requestType?: string; + + /**Returns the edited row index. + */ + rowIndex?: number; + + /**Returns the card object (JSON). + */ + data?: any; + + /**Returns current filtering object field name. + */ + currentFilteringobject?: any; + + /**Returns filter details. + */ + filterCollection?: any; +} + +export interface ActionCompleteEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the kanban model. + */ + model?: any; + + /**Returns request type. + */ + requestType?: string; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns current action event type. + */ + originalEventType?: string; + + /**Returns primary key. + */ + primaryKey?: string; + + /**Returns primary key value. + */ + primaryKeyValue?: string; + + /**Returns kanban element. + */ + target?: any; + + /**Returns the card object (JSON). + */ + data?: any; + + /**Returns the selectedRow index. + */ + selectedRow?: number; + + /**Returns current filtering column field name. + */ + currentFilteringColumn?: string; + + /**Returns filter details. + */ + filterCollection?: any; +} + +export interface ActionFailureEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the kanban model. + */ + model?: any; + + /**Returns request type. + */ + requestType?: string; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the error return by server. + */ + error?: any; + + /**Returns current action event type. + */ + originalEventType?: string; + + /**Returns primary key value. + */ + primaryKeyValue?: string; + + /**Returns kanban element. + */ + target?: any; + + /**Returns the card object (JSON). + */ + data?: any; + + /**Returns current filtering column field name. + */ + currentFilteringColumn?: string; + + /**Returns filter details. + */ + filterCollection?: any; +} + +export interface BeginEditEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the kanban model. + */ + model?: any; + + /**Returns primary key value. + */ + primaryKeyValue?: string; + + /**Returns beginedit data. + */ + data?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface BeginAddEventArgs { + + /**Returns the kanban model. + */ + model?: any; + + /**Returns primary key value. + */ + primaryKeyValue?: string; + + /**Returns beginAdd data. + */ + data?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface BeforeCardSelectEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the select cell index value. + */ + cellIndex?: number; + + /**Returns the select card index value. + */ + cardIndex?: number; + + /**Returns the select cell element + */ + currentCell?: any; + + /**Returns the previously select the card element + */ + previousCard?: any; + + /**Returns the previously select card indexes + */ + previousRowcellindex?: Array; + + /**Returns the Target item. + */ + Target?: any; + + /**Returns the kanban model. + */ + model?: any; + + /**Returns select card data. + */ + data?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface CardClickEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns current record object (JSON). + */ + data?: any; + + /**Returns the current card to the kanban. + */ + currentCard?: string; + + /**Returns kanban element. + */ + target?: any; + + /**Returns the kanban model. + */ + model?: any; + + /**Returns the Header text of the column corresponding to the selected card. + */ + columnName?: string; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface CardDragEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns drag data. + */ + data?: any; + + /**Returns drag start element. + */ + dragtarget?: any; + + /**Returns dragged element. + */ + draggedElement?: any; + + /**Returns the kanban model. + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface CardDragStartEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns carddragstart data. + */ + data?: any; + + /**Returns dragged element. + */ + draggedElement?: any; + + /**Returns the kanban model. + */ + model?: any; + + /**Returns drag start element. + */ + dragtarget?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface CardDragStopEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns dragged element. + */ + draggedElement?: any; + + /**Returns the kanban model. + */ + model?: any; + + /**Returns drag stop element. + */ + droptarget?: any; + + /**Returns dragg stop data. + */ + data?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface CardDropEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns dragged element. + */ + draggedElement?: any; + + /**Returns dragged data. + */ + data?: any; + + /**Returns the kanban model. + */ + model?: any; + + /**Returns drop element. + */ + target?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface CardSelectEventArgs { + + /**Returns the select cell index value. + */ + cellIndex?: number; + + /**Returns the select card index value. + */ + cardIndex?: number; + + /**Returns the select cell element + */ + currentCell?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the previously select the card element + */ + previousCard?: any; + + /**Returns the previously select card indexes + */ + previousRowcellindex?: Array; + + /**Returns the current item. + */ + currentTarget?: any; + + /**Returns the kanban model. + */ + model?: any; + + /**Returns select card data. + */ + data?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface CardDoubleClickEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns current card object (JSON). + */ + data?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface SwimlaneSettings { + + /**To enable or disable items count in swimlane + * @Default {true} + */ + showCount?: boolean; +} + +export interface ContextMenuSettingsCustomMenuItems { + + /**Sets context menu to target element. + * @Default {ej.Kanban.Target.All} + */ + target?: ej.Kanban.Target|string; + + /**Gets the name to custom menu. + * @Default {null} + */ + text?: string; + + /**Gets the template to render custom menu. + * @Default {null} + */ + template?: string; +} + +export interface ContextMenuSettings { + + /**To enable Context menu , All default context menu will show. + * @Default {false} + */ + enable?: boolean; + + /**Gets or sets a value that indicates the list of items needs to be diable from default context menu + * @Default {array} + */ + disableDefaultItems?: Array; + + /**Gets or sets a value that indicates whether to add custom contextMenu items + * @Default {array} + */ + customMenuItems?: Array; +} + +export interface ColumnsConstraints { + + /**It is used to specify the type whether the constraints based on column or swimlane. + * @Default {null} + */ + type?: string; + + /**It is used to specify the minimum amount of card in particular column cell or swimlane cell can hold. + * @Default {null} + */ + min?: number; + + /**It is used to specify the maximum amount of card in particular column cell or swimlane cell can hold. + * @Default {null} + */ + max?: number; +} + +export interface Columns { + + /**Gets or sets an object that indicates to render the kanban with specified columns headertext. + * @Default {null} + */ + headerText?: string; + + /**Gets or sets an object that indicates to render the kanban with specified columns key. + * @Default {null} + */ + key?: string|number; + + /**To set column collape or expand state + * @Default {false} + */ + isCollapsed?: boolean; + + /**To customize the column constraints whether the constraints contains minimum limit or maximum limit or both. + * @Default {object} + */ + constraints?: ColumnsConstraints; + + /**Gets or sets a value that indicates to add the template within the header element. + * @Default {null} + */ + headerTemplate?: string; + + /**Gets or sets an object that indicates to render the kanban with specified columns width. + * @Default {null} + */ + width?: string|number; + + /**Gets or sets an object that indicates to render the kanban with specified columns visible. + * @Default {true} + */ + visible?: boolean; +} + +export interface CardSettings { + + /**Gets or sets a value that indicates to add the template of card . + * @Default {null} + */ + template?: string; + + /**To customize the card bordercolor based on assinged task. Colors and corresponding values defined here will be mapped with colorField mapped data source column. + * @Default {Object} + */ + colorMapping?: any; +} + +export interface EditSettingsEditItems { + + /**It is used to map editing field in the card. + * @Default {null} + */ + field?: string; + + /**It is used to set the particular editType in the card for editing. + * @Default {ej.Kanban.EditingType.String} + */ + editType?: ej.Kanban.EditingType|string; + + /**Gets or sets a value that indicates to define constraints for saving data to the database. + * @Default {Object} + */ + validationRules?: any; + + /**It is used to set the particular editparams in the card for editing. + * @Default {Object} + */ + editParams?: any; + + /**It is used to specify defaultValue in the card. + * @Default {null} + */ + defaultValue?: string|number; +} + +export interface EditSettings { + + /**Gets or sets a value that indicates whether to enable the editing action in cards of kanban. + * @Default {false} + */ + allowEditing?: boolean; + + /**Gets or sets a value that indicates whether to enable the adding action in cards behavior on kanban. + * @Default {false} + */ + allowAdding?: boolean; + + /**This specifies the id of the template.which is require to be edited using the Dialog Box + * @Default {null} + */ + dialogTemplate?: string; + + /**Get or sets an object that indicates whether to customize the editMode of the kanban. + * @Default {ej.Kanban.EditMode.Dialog} + */ + editMode?: ej.Kanban.EditMode|string; + + /**Get or sets an object that indicates whether to customize the editing fields of kanban card. + * @Default {Array} + */ + editItems?: Array; +} + +export interface Fields { + + /**The primarykey field is get as property of kanban. And this will used for Drag and drop and editing mainly. + * @Default {null} + */ + primaryKey?: string; + + /**To enable swimlane grouping based on the given key field. + * @Default {null} + */ + swimlaneKey?: string; + + /**Priority field has been mapped data source field to maintain card priority + * @Default {null} + */ + priority?: string; + + /**ContentField has been Mapped into card text. + * @Default {null} + */ + content?: string; + + /**TagField has been Mapped into card tag. + * @Default {null} + */ + tag?: string; + + /**TitleField has been Mapped to field in datasource for title content. If titlefield specified , card expand/collapse will be enabled with header and content section + * @Default {null} + */ + title?: string; + + /**To customize the card has been Mapped into card colorfield. + * @Default {null} + */ + color?: string; + + /**ImageUrlField has been Mapped into card image. + * @Default {null} + */ + imageUrl?: string; +} + +export interface FilterSettings { + + /**Gets or sets an object of display name to filter queries. + * @Default {null} + */ + text?: string; + + /**Gets or sets an object that Queries to perform filtering + * @Default {Object} + */ + query?: any; + + /**Gets or sets an object of tooltip to filter buttons. + * @Default {null} + */ + description?: string; +} + +export interface KeySettings { + + /**To specify the focus in kanban control. + * @Default {Object} + */ + focus?: any; + + /**To specify the key value to insert the card. + * @Default {null} + */ + insertCard?: string; + + /**To specify the key value to delete the card. + * @Default {null} + */ + deleteCard?: string; + + /**TTo specify the key value to edit the card. + * @Default {null} + */ + editCard?: string; + + /**TTo specify the key value to save request. + * @Default {null} + */ + saveRequest?: string; + + /**To specify the key value to cancel request. + * @Default {null} + */ + cancelRequest?: string; + + /**To specify the key value to first card selection. + * @Default {null} + */ + firstCardSelection?: string; + + /**To specify the key value to last card selection. + * @Default {null} + */ + lastCardSelection?: string; + + /**To specify the key value to upArrow. + * @Default {null} + */ + upArrow?: string; + + /**To specify the key value to downArrow. + * @Default {null} + */ + downArrow?: string; + + /**To specify the key value to rightArrow. + * @Default {null} + */ + rightArrow?: string; + + /**To specify the key value to leftArrow. + * @Default {null} + */ + leftArrow?: string; + + /**To specify the key value to swimlane expand all. + * @Default {null} + */ + swimlaneExpandAll?: string; + + /**To specify the key value to swimlane collapse all. + * @Default {null} + */ + swimlaneCollapseAll?: string; + + /**To specify the key value to selected group expand. + * @Default {null} + */ + selectedGroupExpand?: string; + + /**To specify the key value to selected group collapse. + * @Default {null} + */ + selectedGroupCollapse?: string; + + /**To specify the key value to selected column collapse. + * @Default {null} + */ + selectedColumnCollapse?: string; + + /**To specify the key value to selected column expand. + * @Default {null} + */ + selectedColumnExpand?: string; + + /**To specify the key value to multi selection by up arrow. + * @Default {null} + */ + multiSelectionByUpArrow?: string; + + /**To specify the key value to multi selection by left arrow. + * @Default {null} + */ + multiSelectionByLeftArrow?: string; + + /**To specify the key value to multi selection by right arrow. + * @Default {null} + */ + multiSelectionByRightArrow?: string; +} + +export interface SearchSettings { + + /**To customize the fields the searching operation can be perform. + * @Default {Array} + */ + fields?: Array; + + /**To customize the searching string. + * @Default {null} + */ + key?: string; + + /**To customize the operator based on searching. + * @Default {null} + */ + operator?: string; + + /**To customize the ignorecase based on searching. + * @Default {true} + */ + ignoreCase?: boolean; +} + +export interface StackedHeaderRowsStackedHeaderColumns { + + /**Gets or sets a value that indicates the headerText for the particular stacked header column. + * @Default {null} + */ + headerText?: string; + + /**Gets or sets a value that indicates the column for the particular stacked header column. + * @Default {null} + */ + column?: string; +} + +export interface StackedHeaderRows { + + /**Gets or sets a value that indicates whether to add stacked header columns into the stacked header rows. + * @Default {Array} + */ + stackedHeaderColumns?: Array; +} + +export interface TooltipSettings { + + /**To enable or disable the tooltip display. + * @Default {false} + */ + enable?: boolean; + + /**To customize the tooltip display based on your requirements. + * @Default {null} + */ + template?: string; +} + +enum Target{ + + ///Sets context menu to kanban header + Header, + + ///Sets context menu to kanban content + Content, + + ///Sets context menu to kanban + All +} + + +enum EditMode{ + + ///Creates kanban with editMode as Dialog + Dialog, + + ///Creates kanban with editMode as DialogTemplate + DialogTemplate +} + + +enum EditingType{ + + ///Allows to set edit type as string edit type + String, + + ///Allows to set edit type as numeric edit type + Numeric, + + ///Allows to set edit type as drop down edit type + Dropdown, + + ///Allows to set edit type as date picker edit type + DatePicker, + + ///Allows to set edit type as date time picker edit type + DateTimePicker, + + ///Allows to set edit type as text area edit type + TextArea, + + ///Allows to set edit type as RTE edit type + RTE +} + + +enum SelectionType{ + + ///Support for Single selection in Kanban + Single, + + ///Support for multiple selections in Kanban + Multiple +} + +} + +class Rotator extends ej.Widget { + static fn: Rotator; + constructor(element: JQuery, options?: Rotator.Model); + constructor(element: Element, options?: Rotator.Model); + model:Rotator.Model; + defaults:Rotator.Model; + + /** Disables the Rotator control. + * @returns {void} + */ + disable(): void; + + /** Enables the Rotator control. + * @returns {void} + */ + enable(): void; + + /** This method is used to get the current slide index. + * @returns {number} + */ + getIndex(): number; + + /** This method is used to move a slide to the specified index. + * @param {number} index of an slide + * @returns {void} + */ + gotoIndex(index: number): void; + + /** This method is used to pause autoplay. + * @returns {void} + */ + pause(): void; + + /** This method is used to move slides continuously (or start autoplay) in the specified autoplay direction. + * @returns {void} + */ + play(): void; + + /** This method is used to move to the next slide from the current slide. If the current slide is the last slide, then the first slide will be treated as the next slide. + * @returns {void} + */ + slideNext(): void; + + /** This method is used to move to the previous slide from the current slide. If the current slide is the first slide, then the last slide will be treated as the previous slide. + * @returns {void} + */ + slidePrevious(): void; +} +export module Rotator{ + +export interface Model { + + /**Turns on keyboard interaction with the Rotator items. You must set this property to true to access the following keyboard shortcuts: + * @Default {true} + */ + allowKeyboardNavigation?: boolean; + + /**Sets the animationSpeed of slide transition. + * @Default {600} + */ + animationSpeed?: string|number; + + /**Specifies the animationType type for the Rotator Item. animationType options include slide, fastSlide, slowSlide, and other custom easing animationTypes. + * @Default {slide} + */ + animationType?: string; + + /**Enables the circular mode item rotation. + * @Default {true} + */ + circularMode?: boolean; + + /**Specify the CSS class to Rotator to achieve custom theme. + */ + cssClass?: string; + + /**Specify the list of data which contains a set of data fields. Each data value is used to render an item for the Rotator. + * @Default {null} + */ + dataSource?: any; + + /**Sets the delay between the Rotator Items move after the slide transition. + * @Default {500} + */ + delay?: number; + + /**Specifies the number of Rotator Items to be displayed. + * @Default {1} + */ + displayItemsCount?: string|number; + + /**Rotates the Rotator Items continuously without user interference. + * @Default {false} + */ + enableAutoPlay?: boolean; + + /**Enables or disables the Rotator control. + * @Default {true} + */ + enabled?: boolean; + + /**Specifies right to left transition of slides. + * @Default {false} + */ + enableRTL?: boolean; + + /**Defines mapping fields for the data items of the Rotator. + * @Default {null} + */ + fields?: Fields; + + /**Sets the space between the Rotator Items. + */ + frameSpace?: string|number; + + /**Resizes the Rotator when the browser is resized. + * @Default {false} + */ + isResponsive?: boolean; + + /**Specifies the number of Rotator Items to navigate on a single click (next/previous/play buttons). The navigateSteps property value must be less than or equal to the displayItemsCount property value. + * @Default {1} + */ + navigateSteps?: string|number; + + /**Specifies the orientation for the Rotator control, that is, whether it must be rendered horizontally or vertically. See Orientation + * @Default {ej.Orientation.Horizontal} + */ + orientation?: ej.Orientation|string; + + /**Specifies the position of the showPager in the Rotator Item. See PagerPosition + * @Default {outside} + */ + pagerPosition?: string|ej.Rotator.PagerPosition; + + /**Retrieves data from remote data. This property is applicable only when a remote data source is used. + * @Default {null} + */ + query?: string; + + /**If the Rotator Item is an image, you can specify a caption for the Rotator Item. The caption text for each Rotator Item must be set by using the title attribute of the respective tag. The caption cannot be displayed if multiple Rotator Items are present. + * @Default {false} + */ + showCaption?: boolean; + + /**Turns on or off the slide buttons (next and previous) in the Rotator Items. Slide buttons are used to navigate the Rotator Items. + * @Default {true} + */ + showNavigateButton?: boolean; + + /**Turns on or off the pager support in the Rotator control. The Pager is used to navigate the Rotator Items. + * @Default {true} + */ + showPager?: boolean; + + /**Enable play / pause button on rotator. + * @Default {false} + */ + showPlayButton?: boolean; + + /**Turns on or off thumbnail support in the Rotator control. Thumbnail is used to navigate between slides. Thumbnail supports only single slide transition You must specify the source for thumbnail elements through the thumbnailSourceID property. + * @Default {false} + */ + showThumbnail?: boolean; + + /**Sets the height of a Rotator Item. + */ + slideHeight?: string|number; + + /**Sets the width of a Rotator Item. + */ + slideWidth?: string|number; + + /**Sets the index of the slide that must be displayed first. + * @Default {0} + */ + startIndex?: string|number; + + /**Pause the auto play while hover on the rotator content. + * @Default {false} + */ + stopOnHover?: boolean; + + /**Specifies the source for thumbnail elements. + * @Default {null} + */ + thumbnailSourceID?: any; + + /**This event is fired when the Rotator slides are changed.*/ + change? (e: ChangeEventArgs): void; + + /**This event is fired when the Rotator control is initialized.*/ + create? (e: CreateEventArgs): void; + + /**This event is fired when the Rotator control is destroyed.*/ + destroy? (e: DestroyEventArgs): void; + + /**This event is fired when a pager is clicked.*/ + pagerClick? (e: PagerClickEventArgs): void; + + /**This event is fired when enableAutoPlay is started.*/ + start? (e: StartEventArgs): void; + + /**This event is fired when autoplay is stopped or paused.*/ + stop? (e: StopEventArgs): void; + + /**This event is fired when a thumbnail pager is clicked.*/ + thumbItemClick? (e: ThumbItemClickEventArgs): void; +} + +export interface ChangeEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the rotator model + */ + model?: ej.Rotator.Model; + + /**returns the name of the event + */ + type?: string; + + /**the current rotator id. + */ + itemId?: string; + + /**returns the current slide index. + */ + activeItemIndex?: number; +} + +export interface CreateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the rotator model + */ + model?: ej.Rotator.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the rotator model + */ + model?: ej.Rotator.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface PagerClickEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the rotator model + */ + model?: ej.Rotator.Model; + + /**returns the name of the event + */ + type?: string; + + /**the current rotator id. + */ + itemId?: string; + + /**returns the current slide index. + */ + activeItemIndex?: number; +} + +export interface StartEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the rotator model + */ + model?: ej.Rotator.Model; + + /**returns the name of the event + */ + type?: string; + + /**the current rotator id. + */ + itemId?: string; + + /**returns the current slide index. + */ + activeItemIndex?: number; +} + +export interface StopEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the rotator model + */ + model?: ej.Rotator.Model; + + /**returns the name of the event + */ + type?: string; + + /**the current rotator id. + */ + itemId?: string; + + /**returns the current slide index. + */ + activeItemIndex?: number; +} + +export interface ThumbItemClickEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the rotator model + */ + model?: ej.Rotator.Model; + + /**returns the name of the event + */ + type?: string; + + /**the current rotator id. + */ + itemId?: string; + + /**returns the current slide index. + */ + activeItemIndex?: number; +} + +export interface Fields { + + /**Specifies a link for the image. + */ + linkAttribute?: string; + + /**Specifies where to open a given link. + */ + targetAttribute?: string; + + /**Specifies a caption for the image. + */ + text?: string; + + /**Specifies a caption for the thumbnail image. + */ + thumbnailText?: string; + + /**Specifies the URL for an thumbnail image. + */ + thumbnailUrl?: string; + + /**Specifies the URL for an image. + */ + url?: string; +} + +enum PagerPosition{ + + ///string + BottomLeft, + + ///string + BottomRight, + + ///string + Outside, + + ///string + TopCenter, + + ///string + TopLeft, + + ///string + TopRight +} + +} + +class RTE extends ej.Widget { + static fn: RTE; + constructor(element: JQuery, options?: RTE.Model); + constructor(element: Element, options?: RTE.Model); + model:RTE.Model; + defaults:RTE.Model; + + /** Returns the range object. + * @returns {void} + */ + createRange(): void; + + /** Disables the RTE control. + * @returns {void} + */ + disable(): void; + + /** Disables the corresponding tool in the RTE ToolBar. + * @returns {void} + */ + disableToolbarItem(): void; + + /** Enables the RTE control. + * @returns {void} + */ + enable(): void; + + /** Enables the corresponding tool in the toolbar when the tool is disabled. + * @returns {void} + */ + enableToolbarItem(): void; + + /** Performs the action value based on the given command. + * @returns {void} + */ + executeCommand(): void; + + /** Focuses the RTE control. + * @returns {void} + */ + focus(): void; + + /** Gets the command status of the selected text based on the given comment in the RTE control. + * @returns {void} + */ + getCommandStatus(): void; + + /** Gets the HTML string from the RTE control. + * @returns {void} + */ + getDocument(): void; + + /** Gets the HTML string from the RTE control. + * @returns {void} + */ + getHtml(): void; + + /** Gets the selected html string from the RTE control. + * @returns {void} + */ + getSelectedHtml(): void; + + /** Gets the content as string from the RTE control. + * @returns {void} + */ + getText(): void; + + /** Hides the RTE control. + * @returns {void} + */ + hide(): void; + + /** Inserts new item to the target contextmenu node. + * @returns {void} + */ + insertMenuOption(): void; + + /** This method helps to insert/paste the content at the current cursor (caret) position or the selected content to be replaced with our text by passing the value as parameter to the pasteContent method in the Editor. + * @returns {void} + */ + pasteContent(): void; + + /** Refreshes the RTE control. + * @returns {void} + */ + refresh(): void; + + /** Removes the target menu item from the RTE contextmenu. + * @returns {void} + */ + removeMenuOption (): void; + + /** Removes the given tool from the RTE Toolbar. + * @returns {void} + */ + removeToolbarItem(): void; + + /** Selects all the contents within the RTE. + * @returns {void} + */ + selectAll(): void; + + /** Selects the contents in the given range. + * @returns {void} + */ + selectRange(): void; + + /** Sets the color picker model type rendered initially in the RTE control. + * @returns {void} + */ + setColorPickerType(): void; + + /** Sets the HTML string from the RTE control. + * @returns {void} + */ + setHtml(): void; + + /** Displays the RTE control. + * @returns {void} + */ + show(): void; +} +export module RTE{ + +export interface Model { + + /**Enables/disables the editing of the content. + * @Default {True} + */ + allowEditing?: boolean; + + /**RTE control can be accessed through the keyboard shortcut keys. + * @Default {True} + */ + allowKeyboardNavigation?: boolean; + + /**When the property is set to true, it focuses the RTE at the time of rendering. + * @Default {false} + */ + autoFocus?: boolean; + + /**Based on the content size, its height is adjusted instead of adding the scrollbar. + * @Default {false} + */ + autoHeight?: boolean; + + /**Sets the colorCode to display the color of the fontColor and backgroundColor in the font tools of the RTE. + * @Default {[000000, FFFFFF, C4C4C4, ADADAD, 595959, 262626, 4f81bd, dbe5f1, b8cce4, 95b3d7, 366092, 244061, c0504d, f2dcdb, e5b9b7, d99694, 953734,632423, 9bbb59, ebf1dd, d7e3bc, c3d69b, 76923c, 4f6128, 8064a2, e5e0ec, ccc1d9, b2a2c7, 5f497a, 3f3151, f79646, fdeada, fbd5b5, fac08f,e36c09, 974806]} + */ + colorCode?: any; + + /**The number of columns given are rendered in the color palate popup. + * @Default {6} + */ + colorPaletteColumns?: number; + + /**The number of rows given are rendered in the color palate popup. + * @Default {6} + */ + colorPaletteRows?: number; + + /**Sets the root class for the RTE theme. This cssClass API helps the usage of custom skinning option for the RTE control by including this root class in CSS. + */ + cssClass?: string; + + /**Enables/disables the RTE control’s accessibility or interaction. + * @Default {True} + */ + enabled?: boolean; + + /**When the property is set to true, it returns the encrypted text. + * @Default {false} + */ + enableHtmlEncode?: boolean; + + /**Maintain the values of the RTE after page reload. + * @Default {false} + */ + enablePersistence?: boolean; + + /**Shows the resize icon and enables the resize option in the RTE. + * @Default {True} + */ + enableResize?: boolean; + + /**Shows the RTE in the RTL direction. + * @Default {false} + */ + enableRTL?: boolean; + + /**Formats the contents based on the XHTML rules. + * @Default {false} + */ + enableXHTML?: boolean; + + /**Enables the tab key action with the RichTextEditor content. + * @Default {True} + */ + enableTabKeyNavigation?: boolean; + + /**Load the external CSS file inside Iframe. + * @Default {null} + */ + externalCSS?: string; + + /**This API allows to enable the file browser support in the RTE control to browse, create, delete and upload the files in the specified current directory. + * @Default {null} + */ + fileBrowser?: FileBrowser; + + /**Sets the fontName in the RTE. + * @Default {{text: Segoe UI, value: Segoe UI },{text: Arial, value: Arial,Helvetica,sans-serif },{text: Courier New, value: Courier New,Courier,Monospace },{text: Georgia, value: Georgia,serif },{text: Impact, value: Impact,Charcoal,sans-serif },{text: Lucida Console, value: Lucida Console,Monaco,Monospace },{text: Tahoma, value: Tahoma,Geneva,sans-serif },{text: Times New Roman, value: Times New Roman },{text: Trebuchet MS, value: Trebuchet MS,Helvetica,sans-serif },{text: Verdana, value: Verdana,Geneva,sans-serif}} + */ + fontName?: any; + + /**Sets the fontSize in the RTE. + * @Default {{ text: 1, value: 1 },{ text: 2 (10pt), value: 2 },{ text: 3 (12pt), value: 3 },{ text: 4 (14pt), value: 4 },{ text: 5 (18pt), value: 5 },{ text: 6 (24pt), value: 6 },{ text: 7 (36pt), value: 7 }} + */ + fontSize?: any; + + /**Sets the format in the RTE. + * @Default {{ text: Paragraph, value: <p>, spriteCssClass: e-paragraph },{ text: Quotation, value: <blockquote>, spriteCssClass: e-quotation },{ text: Heading 1, value: <h1>, spriteCssClass: e-h1 },{ text: Heading 2, value: <h2>, spriteCssClass: e-h2 },{ text: Heading 3, value: <h3>, spriteCssClass: e-h3 },{ text: Heading 4, value: <h4>, spriteCssClass: e-h4 },{ text: Heading 5, value: <h5>, spriteCssClass: e-h5 },{ text: Heading 6, value: <h6>, spriteCssClass: e-h6}} + */ + format?: string; + + /**Defines the height of the RTE textbox. + * @Default {370} + */ + height?: string|number; + + /**Specifies the HTML Attributes of the ejRTE. + * @Default {{}} + */ + htmlAttributes?: any; + + /**Sets the given attributes to the iframe body element. + * @Default {{}} + */ + iframeAttributes?: any; + + /**This API allows the image browser to support in the RTE control to browse, create, delete, and upload the image files to the specified current directory. + * @Default {null} + */ + imageBrowser?: ImageBrowser; + + /**Enables/disables responsive support for the RTE control toolbar items during the window resizing time. + * @Default {false} + */ + isResponsive?: boolean; + + /**Sets the culture in the RTE when you set the localization values are needs to be assigned to the corresponding text as follows. + * @Default {en-US} + */ + locale?: string; + + /**Sets the maximum height for the RTE outer wrapper element. + * @Default {null} + */ + maxHeight?: string|number; + + /**Sets the maximum length for the RTE outer wrapper element. + * @Default {7000} + */ + maxLength?: number; + + /**Sets the maximum width for the RTE outer wrapper element. + * @Default {null} + */ + maxWidth?: string|number; + + /**Sets the minimum height for the RTE outer wrapper element. + * @Default {280} + */ + minHeight?: string|number; + + /**Sets the minimum width for the RTE outer wrapper element. + * @Default {400} + */ + minWidth?: string|number; + + /**Sets the name in the RTE. When the name value is not initialized, the ID value is assigned to the name. + */ + name?: string; + + /**Shows ClearAll icon in the RTE footer. + * @Default {false} + */ + showClearAll?: boolean; + + /**Shows the clear format in the RTE footer. + * @Default {true} + */ + showClearFormat?: boolean; + + /**Shows the Custom Table in the RTE. + * @Default {True} + */ + showCustomTable?: boolean; + + /**Shows custom contextmenu with the RTE. + * @Default {True} + */ + showContextMenu?: boolean; + + /**This API is used to set the default dimensions for the image and video. When this property is set to true, the image and video dialog displays the dimension option. + * @Default {false} + */ + showDimensions?: boolean; + + /**Shows the FontOption in the RTE. + * @Default {True} + */ + showFontOption?: boolean; + + /**Shows footer in the RTE. When the footer is enabled, it displays the html tag, word Count, character count, clear format, resize icon and clear all the content icons, by default. + * @Default {false} + */ + showFooter?: boolean; + + /**Shows the HtmlSource in the RTE footer. + * @Default {false} + */ + showHtmlSource?: boolean; + + /**When the cursor is placed or when the text is selected in the RTE, it displays the tag info in the footer. + * @Default {True} + */ + showHtmlTagInfo?: boolean; + + /**Shows the toolbar in the RTE. + * @Default {True} + */ + showToolbar?: boolean; + + /**Counts the total characters and displays it in the RTE footer. + * @Default {True} + */ + showCharCount?: boolean; + + /**Counts the total words and displays it in the RTE footer. + * @Default {True} + */ + showWordCount?: boolean; + + /**The given number of columns render the insert table pop. + * @Default {10} + */ + tableColumns?: number; + + /**The given number of rows render the insert table pop. + * @Default {8} + */ + tableRows?: number; + + /**Sets the tools in the RTE and gets the inner display order of the corresponding group element. Tools are dependent on the toolsList property. + * @Default {formatStyle: [format],style: [bold, italic, underline, strikethrough],alignment: [justifyLeft, justifyCenter, justifyRight, justifyFull],lists: [unorderedList, orderedList],indenting: [outdent, indent],doAction: [undo, redo],links: [createLink,removeLink],images: [image],media: [video],tables: [createTable, addRowAbove, addRowBelow, addColumnLeft, addColumnRight, deleteRow, deleteColumn, deleteTable]],view:[“fullScreen”,zoomIn,zoomOut],print:[print]} + */ + tools?: Tools; + + /**Specifies the list of groups and order of those groups displayed in the RTE toolbar. The toolsList property is used to get the root group order and tools property is used to get the inner order of the corresponding groups displayed. When the value is not specified, it gets its default display order and tools. + * @Default {[formatStyle, font, style, effects, alignment, lists, indenting, clipboard, doAction, clear, links, images, media, tables, casing,view, customTools,print,edit]} + */ + toolsList?: Array; + + /**Gets the undo stack limit. + * @Default {50} + */ + undoStackLimit?: number; + + /**The given string value is displayed in the editable area. + * @Default {null} + */ + value?: string; + + /**Sets the jquery validation rules to the Rich Text Editor. + * @Default {null} + */ + validationRules?: any; + + /**Sets the jquery validation error message to the Rich Text Editor. + * @Default {null} + */ + validationMessage?: any; + + /**Defines the width of the RTE textbox. + * @Default {786} + */ + width?: string|number; + + /**Increases and decreases the contents zoom range in percentage + * @Default {0.05} + */ + zoomStep?: string|number; + + /**Fires when changed successfully.*/ + change? (e: ChangeEventArgs): void; + + /**Fires when the RTE is created successfully*/ + create? (e: CreateEventArgs): void; + + /**Fires when mouse click on menu items.*/ + contextMenuClick? (e: ContextMenuClickEventArgs): void; + + /**Fires before the RTE is destroyed.*/ + destroy? (e: DestroyEventArgs): void; + + /**Fires when the commands are executed successfully.*/ + execute? (e: ExecuteEventArgs): void; + + /**Fires when the keydown action is successful.*/ + keydown? (e: KeydownEventArgs): void; + + /**Fires when the keyup action is successful.*/ + keyup? (e: KeyupEventArgs): void; + + /**Fires before the RTE Edit area is rendered and after the toolbar is rendered.*/ + preRender? (e: PreRenderEventArgs): void; +} + +export interface ChangeEventArgs { + + /**When the event is canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the RTE model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface CreateEventArgs { + + /**When the event is canceled; otherwise, false. + */ + cancel?: boolean; + + /**Returns the RTE model + */ + model?: any; + + /**Returns the name of the event + */ + type?: string; +} + +export interface ContextMenuClickEventArgs { + + /**returns clicked menu item text. + */ + text?: string; + + /**returns clicked menu item element. + */ + element?: any; + + /**returns the selected item. + */ + selectedItem?: number; +} + +export interface DestroyEventArgs { + + /**When the event is canceled; otherwise, false. + */ + cancel?: boolean; + + /**Returns the RTE model + */ + model?: any; + + /**Returns the name of the event + */ + type?: string; +} + +export interface ExecuteEventArgs { + + /**When the event is canceled; otherwise, false. + */ + cancel?: boolean; + + /**Returns the RTE model + */ + model?: any; + + /**Returns the name of the event + */ + type?: string; +} + +export interface KeydownEventArgs { + + /**When the event is canceled; otherwise, false. + */ + cancel?: boolean; + + /**Returns the RTE model + */ + model?: any; + + /**Returns the name of the event + */ + type?: string; +} + +export interface KeyupEventArgs { + + /**When the event is canceled; otherwise, false. + */ + cancel?: boolean; + + /**Returns the RTE model + */ + model?: any; + + /**Returns the name of the event + */ + type?: string; +} + +export interface PreRenderEventArgs { + + /**When the event is canceled; otherwise, false. + */ + cancel?: boolean; + + /**Returns the RTE model + */ + model?: any; + + /**Returns the name of the event + */ + type?: string; +} + +export interface FileBrowser { + + /**This API is used to receive the server-side handler for file related operations. + */ + ajaxAction?: string; + + /**Specifies the file type extension shown in the file browser window. + */ + extensionAllow?: string; + + /**Specifies the directory to perform operations like create, delete and rename folder and files, and upload the selected files to the current directory. + */ + filePath?: string; +} + +export interface ImageBrowser { + + /**This API is used to receive the server-side handler for the file related operations. + */ + ajaxAction?: string; + + /**Specifies the file type extension shown in the image browser window. + */ + extensionAllow?: string; + + /**Specifies the directory to perform operations like create, delete and rename folder and files, and upload the selected images to the current directory. + */ + filePath?: string; +} + +export interface ToolsCustomOrderedList { + + /**Specifies the name for customOrderedList item. + */ + name?: string; + + /**Specifies the title for customOrderedList item. + */ + tooltip?: string; + + /**Specifies the styles for customOrderedList item. + */ + css?: string; + + /**Specifies the text for customOrderedList item. + */ + text?: string; + + /**Specifies the list style for customOrderedList item. + */ + listStyle?: string; + + /**Specifies the image for customOrderedList item. + */ + listImage?: string; +} + +export interface ToolsCustomUnorderedList { + + /**Specifies the name for customUnorderedList item. + */ + name?: string; + + /**Specifies the title for customUnorderedList item. + */ + tooltip?: string; + + /**Specifies the styles for customUnorderedList item. + */ + css?: string; + + /**Specifies the text for customUnorderedList item. + */ + text?: string; + + /**Specifies the list style for customUnorderedList item. + */ + listStyle?: string; + + /**Specifies the image for customUnorderedList item. + */ + listImage?: string; +} + +export interface Tools { + + /**Specifies the alignment tools and the display order of this tool in the RTE toolbar. + */ + alignment?: any; + + /**Specifies the casing tools and the display order of this tool in the RTE toolbar. + */ + casing?: Array; + + /**Specifies the clear tools and the display order of this tool in the RTE toolbar. + */ + clear?: Array; + + /**Specifies the clipboard tools and the display order of this tool in the RTE toolbar. + */ + clipboard?: Array; + + /**Specifies the edit tools and the displays tool in the RTE toolbar. + */ + edit?: Array; + + /**Specifies the doAction tools and the display order of this tool in the RTE toolbar. + */ + doAction?: Array; + + /**Specifies the effect of tools and the display order of this tool in RTE toolbar. + */ + effects?: Array; + + /**Specifies the font tools and the display order of this tool in the RTE toolbar. + */ + font?: Array; + + /**Specifies the formatStyle tools and the display order of this tool in the RTE toolbar. + */ + formatStyle?: Array; + + /**Specifies the image tools and the display order of this tool in the RTE toolbar. + */ + images?: Array; + + /**Specifies the indent tools and the display order of this tool in the RTE toolbar. + */ + indenting?: Array; + + /**Specifies the link tools and the display order of this tool in the RTE toolbar. + */ + links?: Array; + + /**Specifies the list tools and the display order of this tool in the RTE toolbar. + */ + lists?: Array; + + /**Specifies the media tools and the display order of this tool in the RTE toolbar. + */ + media?: Array; + + /**Specifies the style tools and the display order of this tool in the RTE toolbar. + */ + style?: Array; + + /**Specifies the table tools and the display order of this tool in the RTE toolbar. + */ + tables?: Array; + + /**Specifies the view tools and the display order of this tool in the RTE toolbar. + */ + view?: Array; + + /**Specifies the print tools and the display order of this tool in the RTE toolbar. + */ + print?: Array; + + /**Specifies the customOrderedList tools and the display order of this tool in the RTE toolbar. + */ + customOrderedList?: Array; + + /**Specifies the customUnOrderedList tools and the display order of this tool in the RTE toolbar. + */ + customUnorderedList?: Array; +} +} + +class Slider extends ej.Widget { + static fn: Slider; + constructor(element: JQuery, options?: Slider.Model); + constructor(element: Element, options?: Slider.Model); + model:Slider.Model; + defaults:Slider.Model; + + /** To disable the slider + * @returns {void} + */ + disable(): void; + + /** To enable the slider + * @returns {void} + */ + enable(): void; + + /** To get value from slider handle + * @returns {number} + */ + getValue(): number; + + /** To set value to slider handle + * @returns {void} + */ + setValue(): void; +} +export module Slider{ + +export interface Model { + + /**Specifies the animationSpeed of the slider. + * @Default {500} + */ + animationSpeed?: number; + + /**Specify the CSS class to slider to achieve custom theme. + */ + cssClass?: string; + + /**Specifies the animation behavior of the slider. + * @Default {true} + */ + enableAnimation?: boolean; + + /**Specifies the state of the slider. + * @Default {true} + */ + enabled?: boolean; + + /**Specify the enablePersistence to slider to save current model value to browser cookies for state maintains + * @Default {false} + */ + enablePersistence?: boolean; + + /**Specifies the Right to Left Direction of the slider. + * @Default {false} + */ + enableRTL?: boolean; + + /**Specifies the height of the slider. + * @Default {14} + */ + height?: string; + + /**Specifies the HTML Attributes of the ejSlider. + * @Default {{}} + */ + htmlAttributes?: any; + + /**Specifies the incremental step value of the slider. + * @Default {1} + */ + incrementStep?: number; + + /**Specifies the distance between two major (large) ticks from the scale of the slider. + * @Default {10} + */ + largeStep?: number; + + /**Specifies the ending value of the slider. + * @Default {100} + */ + maxValue?: number; + + /**Specifies the starting value of the slider. + * @Default {0} + */ + minValue?: number; + + /**Specifies the orientation of the slider. + * @Default {ej.orientation.Horizontal} + */ + orientation?: ej.Orientation|string; + + /**Specifies the readOnly of the slider. + * @Default {false} + */ + readOnly?: boolean; + + /**Specifies the rounded corner behavior for slider. + * @Default {false} + */ + showRoundedCorner?: boolean; + + /**Shows/Hide the major (large) and minor (small) ticks in the scale of the slider. + * @Default {false} + */ + showScale?: boolean; + + /**Specifies the small ticks from the scale of the slider. + * @Default {true} + */ + showSmallTicks?: boolean; + + /**Specifies the showTooltip to shows the current Slider value, while moving the Slider handle or clicking on the slider handle of the slider. + * @Default {true} + */ + showTooltip?: boolean; + + /**Specifies the sliderType of the slider. + * @Default {ej.SliderType.Default} + */ + sliderType?: ej.slider.sliderType|string; + + /**Specifies the distance between two minor (small) ticks from the scale of the slider. + * @Default {1} + */ + smallStep?: number; + + /**Specifies the value of the slider. But it's not applicable for range slider. To range slider we can use values property. + * @Default {0} + */ + value?: number; + + /**Specifies the values of the range slider. But it's not applicable for default and minRange sliders. we can use value property for default and minRange sliders. + * @Default {[minValue,maxValue]} + */ + values?: Array; + + /**Specifies the width of the slider. + * @Default {100%} + */ + width?: string; + + /**Fires once Slider control value is changed successfully.*/ + change? (e: ChangeEventArgs): void; + + /**Fires once Slider control has been created successfully.*/ + create? (e: CreateEventArgs): void; + + /**Fires when Slider control has been destroyed successfully.*/ + destroy? (e: DestroyEventArgs): void; + + /**Fires once Slider control is sliding successfully.*/ + slide? (e: SlideEventArgs): void; + + /**Fires once Slider control is started successfully.*/ + start? (e: StartEventArgs): void; + + /**Fires when Slider control is stopped successfully.*/ + stop? (e: StopEventArgs): void; +} + +export interface ChangeEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns current handle number or index + */ + sliderIndex?: number; + + /**returns slider id. + */ + id?: string; + + /**returns the slider model. + */ + model?: ej.Slider.Model; + + /**returns the name of the event. + */ + type?: string; + + /**returns the slider value. + */ + value?: number; + + /**returns true if event triggered by interaction else returns false. + */ + isInteraction?: boolean; +} + +export interface CreateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the slider model + */ + model?: ej.Slider.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the slider model + */ + model?: ej.Slider.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface SlideEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns current handle number or index + */ + sliderIndex?: number; + + /**returns slider id + */ + id?: string; + + /**returns the slider model + */ + model?: ej.Slider.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the slider value + */ + value?: number; +} + +export interface StartEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns current handle number or index + */ + sliderIndex?: number; + + /**returns slider id + */ + id?: string; + + /**returns the slider model + */ + model?: ej.Slider.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the slider value + */ + value?: number; +} + +export interface StopEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns current handle number or index + */ + sliderIndex?: number; + + /**returns slider id + */ + id?: string; + + /**returns the slider model + */ + model?: ej.Slider.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the slider value + */ + value?: number; +} +} +module slider +{ +enum sliderType +{ +//Shows default slider +Default, +//Shows minRange slider +MinRange, +//Shows Range slider +Range, +} +} + +class SplitButton extends ej.Widget { + static fn: SplitButton; + constructor(element: JQuery, options?: SplitButton.Model); + constructor(element: Element, options?: SplitButton.Model); + model:SplitButton.Model; + defaults:SplitButton.Model; + + /** destroy the split button widget all events bound using this._on will be unbind automatically and bring the control to pre-init state. + * @returns {void} + */ + destroy(): void; + + /** To disable the split button + * @returns {void} + */ + disable(): void; + + /** To Enable the split button + * @returns {void} + */ + enable(): void; + + /** To Hide the list content of the split button. + * @returns {void} + */ + hide(): void; + + /** To show the list content of the split button. + * @returns {void} + */ + show(): void; +} +export module SplitButton{ + +export interface Model { + + /**Specifies the arrowPosition of the Split or Dropdown Button.See arrowPosition + * @Default {ej.ArrowPosition.Right} + */ + arrowPosition?: string|ej.ArrowPosition; + + /**Specifies the buttonMode like Split or Dropdown Button.See ButtonMode + * @Default {ej.ButtonMode.Split} + */ + buttonMode?: string|ej.ButtonMode; + + /**Specifies the contentType of the Split Button.See ContentType + * @Default {ej.ContentType.TextOnly} + */ + contentType?: string|ej.ContentType; + + /**Set the root class for Split Button control theme + */ + cssClass?: string; + + /**Specifies the disabling of Split Button if enabled is set to false. + * @Default {true} + */ + enabled?: boolean; + + /**Specifies the enableRTL property for Split Button while initialization. + * @Default {false} + */ + enableRTL?: boolean; + + /**Specifies the height of the Split Button. + * @Default {“”} + */ + height?: string|number; + + /**Specifies the HTML Attributes of the Split Button. + * @Default {{}} + */ + htmlAttributes?: any; + + /**Specifies the imagePosition of the Split Button.See imagePositions + * @Default {ej.ImagePosition.ImageRight} + */ + imagePosition?: string|ej.ImagePosition; + + /**Specifies the image content for Split Button while initialization. + */ + prefixIcon?: string; + + /**Specifies the showRoundedCorner property for Split Button while initialization. + * @Default {false} + */ + showRoundedCorner?: string; + + /**Specifies the size of the Button. See ButtonSize + * @Default {ej.ButtonSize.Normal} + */ + size?: string|ej.ButtonSize; + + /**Specifies the image content for Split Button while initialization. + */ + suffixIcon?: string; + + /**Specifies the list content for Split Button while initialization + */ + targetID?: string; + + /**Specifies the text content for Split Button while initialization. + */ + text?: string; + + /**Specifies the width of the Split Button. + * @Default {“”} + */ + width?: string|number; + + /**Fires before menu of the split button control is opened.*/ + beforeOpen? (e: BeforeOpenEventArgs): void; + + /**Fires when Button control is clicked successfully*/ + click? (e: ClickEventArgs): void; + + /**Fires before the list content of Button control is closed*/ + close? (e: CloseEventArgs): void; + + /**Fires after Split Button control is created.*/ + create? (e: CreateEventArgs): void; + + /**Fires when the Split Button is destroyed successfully*/ + destroy? (e: DestroyEventArgs): void; + + /**Fires when a menu item is Hovered out successfully*/ + itemMouseOut? (e: ItemMouseOutEventArgs): void; + + /**Fires when a menu item is Hovered in successfully*/ + itemMouseOver? (e: ItemMouseOverEventArgs): void; + + /**Fires when a menu item is clicked successfully*/ + itemSelected? (e: ItemSelectedEventArgs): void; + + /**Fires before the list content of Button control is opened*/ + open? (e: OpenEventArgs): void; +} + +export interface BeforeOpenEventArgs { + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the split button model + */ + model?: ej.SplitButton.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface ClickEventArgs { + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the split button model + */ + model?: ej.SplitButton.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the target of the current object. + */ + target?: any; + + /**return the button state + */ + status?: boolean; +} + +export interface CloseEventArgs { + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the split button model + */ + model?: ej.SplitButton.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface CreateEventArgs { + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the split button model + */ + model?: ej.SplitButton.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the split button model + */ + model?: ej.SplitButton.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface ItemMouseOutEventArgs { + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the split button model + */ + model?: ej.SplitButton.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the clicked menu item element + */ + element?: any; + + /**returns the event + */ + event?: any; +} + +export interface ItemMouseOutEvent { + + /**return the menu item id + */ + ID?: string; + + /**return the clicked menu item text + */ + Text?: string; +} + +export interface ItemMouseOverEventArgs { + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the split button model + */ + model?: ej.SplitButton.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the clicked menu item element + */ + element?: any; + + /**returns the event + */ + event?: any; +} + +export interface ItemMouseOverEvent { + + /**return the menu item id + */ + ID?: string; + + /**return the clicked menu item text + */ + Text?: string; +} + +export interface ItemSelectedEventArgs { + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the split button model + */ + model?: ej.SplitButton.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the clicked menu item element + */ + element?: any; + + /**returns the selected item + */ + selectedItem?: any; + + /**return the menu id + */ + menuId?: string; + + /**return the clicked menu item text + */ + menuText?: string; +} + +export interface OpenEventArgs { + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the split button model + */ + model?: ej.SplitButton.Model; + + /**returns the name of the event + */ + type?: string; +} +} +enum ArrowPosition +{ +//To set Left arrowPosition of the split button +Left, +//To set Right arrowPosition of the split button +Right, +//To set Top arrowPosition of the split button +Top, +//To set Bottom arrowPosition of the split button +Bottom, +} + +class Splitter extends ej.Widget { + static fn: Splitter; + constructor(element: JQuery, options?: Splitter.Model); + constructor(element: Element, options?: Splitter.Model); + model:Splitter.Model; + defaults:Splitter.Model; + + /** To add a new pane to splitter control. + * @param {string} content of pane. + * @param {any} pane properties. + * @param {number} index of pane. + * @returns {HTMLElement} + */ + addItem(content: string, property: any, index: number): HTMLElement; + + /** To collapse the splitter control pane. + * @param {number} index number of pane. + * @returns {void} + */ + collapse(paneIndex: number): void; + + /** To expand the splitter control pane. + * @param {number} index number of pane. + * @returns {void} + */ + expand(paneIndex: number): void; + + /** To refresh the splitter control pane resizing. + * @returns {void} + */ + refresh(): void; + + /** To remove a specified pane from the splitter control. + * @param {number} index of pane. + * @returns {void} + */ + removeItem(index: number): void; +} +export module Splitter{ + +export interface Model { + + /**Turns on keyboard interaction with the Splitter panes. You must set this property to true to access the keyboard shortcuts of ejSplitter. + * @Default {true} + */ + allowKeyboardNavigation?: boolean; + + /**Specify animation speed for the Splitter pane movement, while collapsing and expanding. + * @Default {300} + */ + animationSpeed?: number; + + /**Specify the CSS class to splitter control to achieve custom theme. + * @Default {“”} + */ + cssClass?: string; + + /**Specifies the animation behavior of the splitter. + * @Default {true} + */ + enableAnimation?: boolean; + + /**Specifies the splitter control to be displayed in right to left direction. + * @Default {false} + */ + enableRTL?: boolean; + + /**Specify height for splitter control. + * @Default {null} + */ + height?: string; + + /**Specifies the HTML Attributes of the Splitter. + * @Default {{}} + */ + htmlAttributes?: any; + + /**Specify window resizing behavior for splitter control. + * @Default {false} + */ + isResponsive?: boolean; + + /**Specify the orientation for spliter control. See orientation + * @Default {ej.orientation.Horizontal or “horizontal”} + */ + orientation?: ej.Orientation|string; + + /**Specify properties for each pane like paneSize, minSize, maxSize, collapsible, resizable. + * @Default {[]} + */ + properties?: Array; + + /**Specify width for splitter control. + * @Default {null} + */ + width?: string; + + /**Fires before expanding / collapsing the split pane of splitter control.*/ + beforeExpandCollapse? (e: BeforeExpandCollapseEventArgs): void; + + /**Fires when splitter control pane has been created.*/ + create? (e: CreateEventArgs): void; + + /**Fires when splitter control pane has been destroyed.*/ + destroy? (e: DestroyEventArgs): void; + + /**Fires when expand / collapse operation in splitter control pane has been performed successfully.*/ + expandCollapse? (e: ExpandCollapseEventArgs): void; + + /**Fires when resize in splitter control pane.*/ + resize? (e: ResizeEventArgs): void; +} + +export interface BeforeExpandCollapseEventArgs { + + /**if the event should be cancelled; otherwise, false. + */ + cancel?: boolean; + + /**returns collapsed pane details. + */ + collapsed?: any; + + /**returns expanded pane details. + */ + expanded?: any; + + /**returns the splitter model. + */ + model?: ej.Splitter.Model; + + /**returns the current split bar index. + */ + splitbarIndex?: number; + + /**returns the name of the event. + */ + type?: string; +} + +export interface CreateEventArgs { + + /**if the event should be cancelled; otherwise, false. + */ + cancel?: boolean; + + /**returns the splitter model. + */ + model?: ej.Splitter.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**if the event should be cancelled; otherwise, false. + */ + cancel?: boolean; + + /**returns the splitter model. + */ + model?: ej.Splitter.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface ExpandCollapseEventArgs { + + /**if the event should be cancelled; otherwise, false. + */ + cancel?: boolean; + + /**returns collapsed pane details. + */ + collapsed?: any; + + /**returns expanded pane details. + */ + expanded?: any; + + /**returns the splitter model. + */ + model?: ej.Splitter.Model; + + /**returns the current split bar index. + */ + splitbarIndex?: number; + + /**returns the name of the event. + */ + type?: string; +} + +export interface ResizeEventArgs { + + /**if the event should be cancelled; otherwise, false. + */ + cancel?: boolean; + + /**returns previous pane details. + */ + prevPane?: any; + + /**returns next pane details. + */ + nextPane?: any; + + /**returns the splitter model. + */ + model?: ej.Splitter.Model; + + /**returns the current split bar index. + */ + splitbarIndex?: number; + + /**returns the name of the event. + */ + type?: string; +} +} + +class Tab extends ej.Widget { + static fn: Tab; + constructor(element: JQuery, options?: Tab.Model); + constructor(element: Element, options?: Tab.Model); + model:Tab.Model; + defaults:Tab.Model; + + /** Add new tab items with given name, url and given index position, if index null it’s add last item. + * @param {string} URL name / tab id. + * @param {string} Tab Display name. + * @param {number} Index position to placed , this is optional. + * @param {string} specifies cssClass, this is optional. + * @param {string} specifies id of tab, this is optional. + * @returns {void} + */ + addItem(url: string, displayLabel: string, index: number, cssClass: string, id: string): void; + + /** To disable the tab control. + * @returns {void} + */ + disable(): void; + + /** To enable the tab control. + * @returns {void} + */ + enable(): void; + + /** This function get the number of tab rendered + * @returns {number} + */ + getItemsCount(): number; + + /** This function hides the tab control. + * @returns {void} + */ + hide(): void; + + /** This function hides the specified item tab in tab control. + * @param {number} index of tab item. + * @returns {void} + */ + hideItem(index: number): void; + + /** Remove the given index tab item. + * @param {number} index of tab item. + * @returns {void} + */ + removeItem(index: number): void; + + /** This function is to show the tab control. + * @returns {void} + */ + show(): void; + + /** This function helps to show the specified hidden tab item in tab control. + * @param {number} index of tab item. + * @returns {void} + */ + showItem(index: number): void; +} +export module Tab{ + +export interface Model { + + /**Specifies the ajaxSettings option to load the content to the Tab control. + */ + ajaxSettings?: AjaxSettings; + + /**Tab items interaction with keyboard keys, like headers active navigation. + * @Default {true} + */ + allowKeyboardNavigation?: boolean; + + /**Allow to collapsing the active item, while click on the active header. + * @Default {false} + */ + collapsible?: boolean; + + /**Set the root class for Tab theme. This cssClass API helps to use custom skinning option for Tab control. + */ + cssClass?: string; + + /**Disables the given tab headers and content panels. + * @Default {[]} + */ + disabledItemIndex?: number[]; + + /**Specifies the animation behavior of the tab. + * @Default {true} + */ + enableAnimation?: boolean; + + /**When this property is set to false, it disables the tab control. + * @Default {true} + */ + enabled?: boolean; + + /**Enables the given tab headers and content panels. + * @Default {[]} + */ + enabledItemIndex?: number[]; + + /**Save current model value to browser cookies for state maintains. While refresh the Tab control page the model value apply from browser cookies. + * @Default {false} + */ + enablePersistence?: boolean; + + /**Display Right to Left direction for headers and panels text of tab. + * @Default {false} + */ + enableRTL?: boolean; + + /**Specify to enable scrolling for Tab header. + * @Default {false} + */ + enableTabScroll?: boolean; + + /**The event API to bind the action for active the tab items. + * @Default {click} + */ + events?: string; + + /**Specifies the position of Tab header as top, bottom, left or right. See below to get availanle Position + * @Default {top} + */ + headerPosition?: string | ej.Tab.Position; + + /**Set the height of the tab header element. Default this property value is null, so height take content height. + * @Default {null} + */ + headerSize?: string|number; + + /**Height set the outer panel element. Default this property value is null, so height take content height. + * @Default {null} + */ + height?: string|number; + + /**Adjust the content panel height for given option (content, auto and fill), by default panels height adjust based on the content.See below to get available HeightAdjustMode + * @Default {content} + */ + heightAdjustMode?: string | ej.Tab.HeightAdjustMode; + + /**Specifies to hide a pane of Tab control. + * @Default {[]} + */ + hiddenItemIndex?: Array; + + /**Specifies the HTML Attributes of the Tab. + * @Default {{}} + */ + htmlAttributes?: any; + + /**The idPrefix property appends the given string on the added tab item id’s in runtime. + * @Default {ej-tab-} + */ + idPrefix?: string; + + /**Specifies the Tab header in active for given index value. + * @Default {0} + */ + selectedItemIndex?: number; + + /**Display the close button for each tab items. While clicking on the close icon, particular tab item will be removed. + * @Default {false} + */ + showCloseButton?: boolean; + + /**Display the Reload button for each tab items. + * @Default {false} + */ + showReloadIcon?: boolean; + + /**Tab panels and headers to be displayed in rounded corner style. + * @Default {false} + */ + showRoundedCorner?: boolean; + + /**Set the width for outer panel element, if not it’s take parent width. + * @Default {null} + */ + width?: string|number; + + /**Triggered after a tab item activated.*/ + itemActive? (e: ItemActiveEventArgs): void; + + /**Triggered before ajax content has been loaded.*/ + ajaxBeforeLoad? (e: AjaxBeforeLoadEventArgs): void; + + /**Triggered if error occurs in Ajax request.*/ + ajaxError? (e: AjaxErrorEventArgs): void; + + /**Triggered after ajax content load action.*/ + ajaxLoad? (e: AjaxLoadEventArgs): void; + + /**Triggered after a tab item activated.*/ + ajaxSuccess? (e: AjaxSuccessEventArgs): void; + + /**Triggered before a tab item activated.*/ + beforeActive? (e: BeforeActiveEventArgs): void; + + /**Triggered before a tab item remove.*/ + beforeItemRemove? (e: BeforeItemRemoveEventArgs): void; + + /**Triggered before a tab item Create.*/ + create? (e: CreateEventArgs): void; + + /**Triggered before a tab item destroy.*/ + destroy? (e: DestroyEventArgs): void; + + /**Triggered after new tab item add*/ + itemAdd? (e: ItemAddEventArgs): void; + + /**Triggered after tab item removed.*/ + itemRemove? (e: ItemRemoveEventArgs): void; +} + +export interface ItemActiveEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the tab model. + */ + model?: ej.Tab.Model; + + /**returns the name of the event. + */ + type?: string; + + /**returns previous active tab header. + */ + prevActiveHeader?: HTMLElement; + + /**returns previous active index. + */ + prevActiveIndex?: number; + + /**returns current active tab header . + */ + activeHeader?: HTMLElement; + + /**returns current active index. + */ + activeIndex?: number; + + /**returns, is it triggered by interaction or not. + */ + isInteraction?: boolean; +} + +export interface AjaxBeforeLoadEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the tab model. + */ + model?: ej.Tab.Model; + + /**returns the name of the event. + */ + type?: string; + + /**returns previous active tab header. + */ + prevActiveHeader?: HTMLElement; + + /**returns previous active index. + */ + prevActiveIndex?: number; + + /**returns current active tab header . + */ + activeHeader?: HTMLElement; + + /**returns current active index. + */ + activeIndex?: number; + + /**returns the url of ajax request + */ + url?: string; + + /**returns, is it triggered by interaction or not. + */ + isInteraction?: boolean; +} + +export interface AjaxErrorEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the tab model. + */ + model?: ej.Tab.Model; + + /**returns the name of the event. + */ + type?: string; + + /**returns ajax data details. + */ + data?: any; + + /**returns the url of ajax request. + */ + url?: string; +} + +export interface AjaxLoadEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the tab model. + */ + model?: ej.Tab.Model; + + /**returns the name of the event. + */ + type?: string; + + /**returns previous active tab header. + */ + prevActiveHeader?: HTMLElement; + + /**returns previous active index. + */ + prevActiveIndex?: number; + + /**returns current active tab header . + */ + activeHeader?: HTMLElement; + + /**returns current active index. + */ + activeIndex?: number; + + /**returns the url of ajax request + */ + url?: string; + + /**returns, is it triggered by interaction or not. + */ + isInteraction?: boolean; +} + +export interface AjaxSuccessEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the tab model. + */ + model?: ej.Tab.Model; + + /**returns the name of the event. + */ + type?: string; + + /**return ajax data. + */ + data?: any; + + /**returns ajax url + */ + url?: string; + + /**returns content of ajax request. + */ + content?: any; +} + +export interface BeforeActiveEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the tab model. + */ + model?: ej.Tab.Model; + + /**returns the name of the event. + */ + type?: string; + + /**returns previous active tab header. + */ + prevActiveHeader?: HTMLElement; + + /**returns previous active index. + */ + prevActiveIndex?: number; + + /**returns current active tab header . + */ + activeHeader?: HTMLElement; + + /**returns current active index. + */ + activeIndex?: number; + + /**returns, is it triggered by interaction or not. + */ + isInteraction?: boolean; +} + +export interface BeforeItemRemoveEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the tab model. + */ + model?: ej.Tab.Model; + + /**returns the name of the event. + */ + type?: string; + + /**returns current tab item index + */ + index?: number; +} + +export interface CreateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the tab model. + */ + model?: ej.Tab.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the tab model. + */ + model?: ej.Tab.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface ItemAddEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the tab model. + */ + model?: ej.Tab.Model; + + /**returns the name of the event. + */ + type?: string; + + /**returns new added tab header. + */ + tabHeader?: HTMLElement; + + /**returns new added tab content panel. + */ + tabContent?: any; +} + +export interface ItemRemoveEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the tab model. + */ + model?: ej.Tab.Model; + + /**returns the name of the event. + */ + type?: string; + + /**returns removed tab header. + */ + removedTab?: HTMLElement; +} + +export interface AjaxSettings { + + /**It specifies, whether to enable or disable asynchronous request. + * @Default {true} + */ + async?: boolean; + + /**It specifies the page will be cached in the web browser. + * @Default {false} + */ + cache?: boolean; + + /**It specifies the type of data is send in the query string. + * @Default {html} + */ + contentType?: string; + + /**It specifies the data as an object, will be passed in the query string. + * @Default {{}} + */ + data?: any; + + /**It specifies the type of data that you're expecting back from the response. + * @Default {html} + */ + dataType?: string; + + /**It specifies the HTTP request type. + * @Default {get} + */ + type?: string; +} + +enum Position{ + + ///Tab headers display to top position + Top, + + ///Tab headers display to bottom position + Bottom, + + ///Tab headers display to left position. + Left, + + ///Tab headers display to right position. + Right +} + + +enum HeightAdjustMode{ + + ///string + None, + + ///string + Content, + + ///string + Auto, + + ///string + Fill +} + +} + +class TagCloud extends ej.Widget { + static fn: TagCloud; + constructor(element: JQuery, options?: TagCloud.Model); + constructor(element: Element, options?: TagCloud.Model); + model:TagCloud.Model; + defaults:TagCloud.Model; + + /** Inserts a new item into the TagCloud + * @param {string} Insert new item into the TagCloud + * @returns {void} + */ + insert(name: string): void; + + /** Inserts a new item into the TagCloud at a particular position. + * @param {string} Inserts a new item into the TagCloud + * @param {number} Inserts a new item into the TagCloud with the specified position + * @returns {void} + */ + insertAt(name: string, position: number): void; + + /** Removes the item from the TagCloud based on the name. It removes all the tags which have the corresponding name + * @param {string} name of the tag. + * @returns {void} + */ + remove(name: string): void; + + /** Removes the item from the TagCloud based on the position. It removes the tags from the the corresponding position only. + * @param {number} position of tag item. + * @returns {void} + */ + removeAt(position: number): void; +} +export module TagCloud{ + +export interface Model { + + /**Specify the CSS class to button to achieve custom theme. + */ + cssClass?: string; + + /**The dataSource contains the list of data to display in a cloud format. Each data contains a link url, frequency to categorize the font size and a display text. + * @Default {null} + */ + dataSource?: any; + + /**Sets the TagCloud and tag items direction as right to left alignment. + * @Default {false} + */ + enableRTL?: boolean; + + /**Defines the mapping fields for the data items of the TagCloud. + * @Default {null} + */ + fields?: Fields; + + /**Defines the format for the TagCloud to display the tag items.See Format + * @Default {ej.Format.Cloud} + */ + format?: string|ej.Format; + + /**Sets the maximum font size value for the tag items. The font size for the tag items will be generated in between the minimum and maximum font size values. + * @Default {40px} + */ + maxFontSize?: string|number; + + /**Sets the minimum font size value for the tag items. The font size for the tag items will be generated in between the minimum and maximum font size values. + * @Default {10px} + */ + minFontSize?: string|number; + + /**Define the query to retrieve the data from online server. The query is used only when the online dataSource is used. + * @Default {null} + */ + query?: any; + + /**Shows or hides the TagCloud title. When this set to false, it hides the TagCloud header. + * @Default {true} + */ + showTitle?: boolean; + + /**Sets the title image for the TagCloud. To show the title image, the showTitle property should be enabled. + * @Default {null} + */ + titleImage?: string; + + /**Sets the title text for the TagCloud. To show the title text, the showTitle property should be enabled. + * @Default {Title} + */ + titleText?: string; + + /**Event triggers when the TagCloud items are clicked*/ + click? (e: ClickEventArgs): void; + + /**Event triggers when the TagCloud are created*/ + create? (e: CreateEventArgs): void; + + /**Event triggers when the TagCloud are destroyed*/ + destroy? (e: DestroyEventArgs): void; + + /**Event triggers when the cursor leaves out from a tag item*/ + mouseout? (e: MouseoutEventArgs): void; + + /**Event triggers when the cursor hovers on a tag item*/ + mouseover? (e: MouseoverEventArgs): void; +} + +export interface ClickEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the TagCloud model + */ + model?: ej.TagCloud.Model; + + /**returns the name of the event + */ + type?: string; + + /**return current tag name + */ + text?: string; + + /**return current url link + */ + url?: string; +} + +export interface CreateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the TagCloud model + */ + model?: ej.TagCloud.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the TagCloud model + */ + model?: ej.TagCloud.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface MouseoutEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the TagCloud model + */ + model?: ej.TagCloud.Model; + + /**returns the name of the event + */ + type?: string; + + /**return current tag name + */ + text?: string; + + /**return current url link + */ + url?: string; +} + +export interface MouseoverEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the TagCloud model + */ + model?: ej.TagCloud.Model; + + /**returns the name of the event + */ + type?: string; + + /**return current tag name + */ + text?: string; + + /**return current url link + */ + url?: string; +} + +export interface Fields { + + /**Defines the frequency number to categorize the font size. + */ + frequency?: number; + + /**Defines the html attributes for the anchor elements inside the each tag items. + */ + htmlAttributes?: any; + + /**Defines the tag value or display text. + */ + text?: string; + + /**Defines the url link to navigate while click the tag. + */ + url?: string; +} +} +enum Format +{ +//To render the TagCloud items in cloud format +Cloud, +//To render the TagCloud items in list format +List, +} + +class TimePicker extends ej.Widget { + static fn: TimePicker; + constructor(element: JQuery, options?: TimePicker.Model); + constructor(element: Element, options?: TimePicker.Model); + model:TimePicker.Model; + defaults:TimePicker.Model; + + /** Allows you to disable the TimePicker. + * @returns {void} + */ + disable(): void; + + /** Allows you to enable the TimePicker. + * @returns {void} + */ + enable(): void; + + /** It returns the current time value. + * @returns {string} + */ + getValue(): string; + + /** This method will hide the TimePicker control popup. + * @returns {void} + */ + hide(): void; + + /** Updates the current system time in TimePicker. + * @returns {void} + */ + setCurrentTime(): void; + + /** This method will show the TimePicker control popup. + * @returns {void} + */ + show(): void; +} +export module TimePicker{ + +export interface Model { + + /**Sets the root CSS class for the TimePicker theme, which is used to customize. + */ + cssClass?: string; + + /**Specifies the animation behavior in TimePicker. + * @Default {true} + */ + enableAnimation?: boolean; + + /**When this property is set to false, it disables the TimePicker control. + * @Default {true} + */ + enabled?: boolean; + + /**Save current model value to browser cookies for maintaining states. When refreshing the TimePicker control page, the model value is applied from browser cookies or HTML 5local storage. + * @Default {false} + */ + enablePersistence?: boolean; + + /**Displays the TimePicker as right to left alignment. + * @Default {false} + */ + enableRTL?: boolean; + + /**When the enableStrictMode is set as true it allows the value outside of the range and also indicate with red color border, otherwise it internally changed to the min or max range value based an input value. + * @Default {false} + */ + enableStrictMode?: boolean; + + /**Defines the height of the TimePicker textbox. + */ + height?: string|number; + + /**Sets the step value for increment an hour value through arrow keys or mouse scroll. + * @Default {1} + */ + hourInterval?: number; + + /**It allows to define the characteristics of the TimePicker control. It will helps to extend the capability of an HTML element. + * @Default {{}} + */ + htmlAttributes?: any; + + /**Sets the time interval between the two adjacent time values in the popup. + * @Default {30} + */ + interval?: number; + + /**Defines the localization info used by the TimePicker. + * @Default {en-US} + */ + locale?: string; + + /**Sets the maximum time value to the TimePicker. + * @Default {11:59:59 PM} + */ + maxTime?: string; + + /**Sets the minimum time value to the TimePicker. + * @Default {12:00:00 AM} + */ + minTime?: string; + + /**Sets the step value for increment the minute value through arrow keys or mouse scroll. + * @Default {1} + */ + minutesInterval?: number; + + /**Defines the height of the TimePicker popup. + * @Default {191px} + */ + popupHeight?: string|number; + + /**Defines the width of the TimePicker popup. + * @Default {auto} + */ + popupWidth?: string|number; + + /**Toggles the readonly state of the TimePicker + * @Default {false} + */ + readOnly?: boolean; + + /**Sets the step value for increment the seconds value through arrow keys or mouse scroll. + * @Default {1} + */ + secondsInterval?: number; + + /**shows or hides the drop down button in TimePicker. + * @Default {true} + */ + showPopupButton?: boolean; + + /**TimePicker is displayed with rounded corner when this property is set to true. + * @Default {false} + */ + showRoundedCorner?: boolean; + + /**Defines the time format displayed in the TimePicker. + * @Default {h:mm tt} + */ + timeFormat?: string; + + /**Sets a specified time value on the TimePicker. + * @Default {null} + */ + value?: string|Date; + + /**Defines the width of the TimePicker textbox. + */ + width?: string|number; + + /**Fires when the time value changed in the TimePicker.*/ + beforeChange? (e: BeforeChangeEventArgs): void; + + /**Fires when the TimePicker popup before opened.*/ + beforeOpen? (e: BeforeOpenEventArgs): void; + + /**Fires when the time value changed in the TimePicker.*/ + change? (e: ChangeEventArgs): void; + + /**Fires when the TimePicker popup closed.*/ + close? (e: CloseEventArgs): void; + + /**Fires when create TimePicker successfully.*/ + create? (e: CreateEventArgs): void; + + /**Fires when the TimePicker is destroyed successfully.*/ + destroy? (e: DestroyEventArgs): void; + + /**Fires when the TimePicker control gets focus.*/ + focusIn? (e: FocusInEventArgs): void; + + /**Fires when the TimePicker control get lost focus.*/ + focusOut? (e: FocusOutEventArgs): void; + + /**Fires when the TimePicker popup opened.*/ + open? (e: OpenEventArgs): void; + + /**Fires when the value is selected from the TimePicker dropdown list.*/ + select? (e: SelectEventArgs): void; +} + +export interface BeforeChangeEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the TimePicker model + */ + model?: ej.TimePicker.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the previously selected time value + */ + prevTime?: string; + + /**returns the modified time value + */ + value?: string; +} + +export interface BeforeOpenEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the TimePicker model + */ + model?: ej.TimePicker.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the previously selected time value + */ + prevTime?: string; + + /**returns the time value + */ + value?: string; +} + +export interface ChangeEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the TimePicker model + */ + model?: ej.TimePicker.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns true when the value changed by user interaction otherwise returns false + */ + isInteraction?: boolean; + + /**returns the previously selected time value + */ + prevTime?: string; + + /**returns the modified time value + */ + value?: string; +} + +export interface CloseEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the TimePicker model + */ + model?: ej.TimePicker.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the previously selected time value + */ + prevTime?: string; + + /**returns the time value + */ + value?: string; +} + +export interface CreateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the TimePicker model + */ + model?: ej.TimePicker.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the TimePicker model + */ + model?: ej.TimePicker.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface FocusInEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the TimePicker model + */ + model?: ej.TimePicker.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the previously selected time value + */ + prevTime?: string; + + /**returns the current time value + */ + value?: string; +} + +export interface FocusOutEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the TimePicker model + */ + model?: ej.TimePicker.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the previously selected time value + */ + prevTime?: string; + + /**returns the current time value + */ + value?: string; +} + +export interface OpenEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the TimePicker model + */ + model?: ej.TimePicker.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the time value + */ + value?: string; +} + +export interface SelectEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the TimePicker model + */ + model?: ej.TimePicker.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the previously selected time value + */ + prevTime?: string; + + /**returns the selected time value + */ + value?: string; +} +} + +class ToggleButton extends ej.Widget { + static fn: ToggleButton; + constructor(element: JQuery, options?: ToggleButton.Model); + constructor(element: Element, options?: ToggleButton.Model); + model:ToggleButton.Model; + defaults:ToggleButton.Model; + + /** Allows you to destroy the ToggleButton widget. + * @returns {void} + */ + destroy(): void; + + /** To disable the ToggleButton to prevent all user interactions. + * @returns {void} + */ + disable(): void; + + /** To enable the ToggleButton. + * @returns {void} + */ + enable(): void; +} +export module ToggleButton{ + +export interface Model { + + /**Specify the icon in active state to the toggle button and it will be aligned from left margin of the button. + */ + activePrefixIcon?: string; + + /**Specify the icon in active state to the toggle button and it will be aligned from right margin of the button. + */ + activeSuffixIcon?: string; + + /**Sets the text when ToggleButton is in active state i.e.,checked state. + * @Default {null} + */ + activeText?: string; + + /**Specifies the contentType of the ToggleButton. See ContentType as below + * @Default {ej.ContentType.TextOnly} + */ + contentType?: ej.ContentType|string; + + /**Specify the CSS class to the ToggleButton to achieve custom theme. + */ + cssClass?: string; + + /**Specify the icon in default state to the toggle button and it will be aligned from left margin of the button. + */ + defaultPrefixIcon?: string; + + /**Specify the icon in default state to the toggle button and it will be aligned from right margin of the button. + */ + defaultSuffixIcon?: string; + + /**Specifies the text of the ToggleButton, when the control is a default state. i.e., unChecked state. + * @Default {null} + */ + defaultText?: string; + + /**Specifies the state of the ToggleButton. + * @Default {true} + */ + enabled?: boolean; + + /**Save current model value to browser cookies for maintaining states. When refreshing the ToggleButton control page, the model value is applied from browser cookies or HTML 5local storage. + * @Default {false} + */ + enablePersistence?: boolean; + + /**Specify the Right to Left direction of the ToggleButton. + * @Default {false} + */ + enableRTL?: boolean; + + /**Specifies the height of the ToggleButton. + * @Default {28pixel} + */ + height?: number|string; + + /**It allows to define the characteristics of the ToggleButton control. It will helps to extend the capability of an HTML element. + * @Default {{}} + */ + htmlAttributes?: any; + + /**Specifies the image position of the ToggleButton. + * @Default {ej.ImagePosition.ImageLeft} + */ + imagePosition?: ej.ImagePosition|string; + + /**Allows to prevents the control switched to checked (active) state. + * @Default {false} + */ + preventToggle?: boolean; + + /**Displays the ToggleButton with rounded corners. + * @Default {false} + */ + showRoundedCorner?: boolean; + + /**Specifies the size of the ToggleButton. See ButtonSize as below + * @Default {ej.ButtonSize.Normal} + */ + size?: ej.ButtonSize|string; + + /**It allows to define the ToggleButton state to checked(Active) or unchecked(Default) at initial time. + * @Default {false} + */ + toggleState?: boolean; + + /**Specifies the type of the ToggleButton. See ButtonType as below + * @Default {ej.ButtonType.Button} + */ + type?: ej.ButtonType|string; + + /**Specifies the width of the ToggleButton. + * @Default {100pixel} + */ + width?: number|string; + + /**Fires when ToggleButton control state is changed successfully.*/ + change? (e: ChangeEventArgs): void; + + /**Fires when ToggleButton control is clicked successfully.*/ + click? (e: ClickEventArgs): void; + + /**Fires when ToggleButton control is created successfully.*/ + create? (e: CreateEventArgs): void; + + /**Fires when ToggleButton control is destroyed successfully.*/ + destroy? (e: DestroyEventArgs): void; +} + +export interface ChangeEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**return the toggle button checked state + */ + isChecked?: boolean; + + /**returns the toggle button model + */ + model?: ej.ToggleButton.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface ClickEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**return the toggle button checked state + */ + isChecked?: boolean; + + /**returns the toggle button model + */ + model?: ej.ToggleButton.Model; + + /**return the toggle button state + */ + status?: boolean; + + /**returns the name of the event + */ + type?: string; +} + +export interface CreateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the toggle button model + */ + model?: ej.ToggleButton.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the toggle button model + */ + model?: ej.ToggleButton.Model; + + /**returns the name of the event + */ + type?: string; +} +} + +class Toolbar extends ej.Widget { + static fn: Toolbar; + constructor(element: JQuery, options?: Toolbar.Model); + constructor(element: Element, options?: Toolbar.Model); + model:Toolbar.Model; + defaults:Toolbar.Model; + + /** Deselect the specified Toolbar item. + * @param {any} The element need to be deselected + * @returns {void} + */ + deselectItem(element: any): void; + + /** Deselect the Toolbar item based on specified id. + * @param {string} The ID of the element need to be deselected + * @returns {void} + */ + deselectItemByID(ID: string): void; + + /** Allows you to destroy the Toolbar widget. + * @returns {void} + */ + destroy(): void; + + /** To disable all items in the Toolbar control. + * @returns {void} + */ + disable(): void; + + /** Disable the specified Toolbar item. + * @param {any} The element need to be disabled + * @returns {void} + */ + disableItem(element: any): void; + + /** Disable the Toolbar item based on specified item id in the Toolbar. + * @param {string} The ID of the element need to be disabled + * @returns {void} + */ + disableItemByID(ID: string): void; + + /** Enable the Toolbar if it is in disabled state. + * @returns {void} + */ + enable(): void; + + /** Enable the Toolbar item based on specified item. + * @param {any} The element need to be enabled + * @returns {void} + */ + enableItem(element: any): void; + + /** Enable the Toolbar item based on specified item id in the Toolbar. + * @param {string} The ID of the element need to be enabled + * @returns {void} + */ + enableItemByID(ID: string): void; + + /** To hide the Toolbar + * @returns {void} + */ + hide(): void; + + /** Remove the item from toolbar, based on specified item. + * @param {any} The element need to be removed + * @returns {void} + */ + removeItem(element: any): void; + + /** Remove the item from toolbar, based on specified item id in the Toolbar. + * @param {string} The ID of the element need to be removed + * @returns {void} + */ + removeItemByID(ID: string): void; + + /** Selects the item from toolbar, based on specified item. + * @param {any} The element need to be selected + * @returns {void} + */ + selectItem(element: any): void; + + /** Selects the item from toolbar, based on specified item id in the Toolbar. + * @param {string} The ID of the element need to be selected + * @returns {void} + */ + selectItemByID(ID: string): void; + + /** To show the Toolbar. + * @returns {void} + */ + show(): void; +} +export module Toolbar{ + +export interface Model { + + /**Sets the root CSS class for Toolbar control to achieve the custom theme. + */ + cssClass?: string; + + /**Specifies dataSource value for the Toolbar control during initialization. + * @Default {null} + */ + dataSource?: any; + + /**Specifies the Toolbar control state. + * @Default {true} + */ + enabled?: boolean; + + /**Specifies enableRTL property to align the Toolbar control from right to left direction. + * @Default {false} + */ + enableRTL?: boolean; + + /**Allows to separate the each UL items in the Toolbar control. + * @Default {false} + */ + enableSeparator?: boolean; + + /**Specifies the mapping fields for the data items of the Toolbar + * @Default {null} + */ + fields?: string; + + /**Specifies the height of the Toolbar. + * @Default {28} + */ + height?: number|string; + + /**Specifies whether the Toolbar control is need to be show or hide. + * @Default {false} + */ + hide?: boolean; + + /**Enables/Disables the responsive support for Toolbar items during the window resizing time. + * @Default {false} + */ + isResponsive?: boolean; + + /**Specifies the Toolbar orientation. See orientation + * @Default {Horizontal} + */ + orientation?: ej.Orientation|string; + + /**Specifies the query to retrieve the data from the online server. The query is used only when the online dataSource is used. + * @Default {null} + */ + query?: any; + + /**Displays the Toolbar with rounded corners. + * @Default {false} + */ + showRoundedCorner?: boolean; + + /**Specifies the width of the Toolbar. + */ + width?: number|string; + + /**Fires after Toolbar control is clicked.*/ + click? (e: ClickEventArgs): void; + + /**Fires after Toolbar control is created.*/ + create? (e: CreateEventArgs): void; + + /**Fires when the Toolbar is destroyed successfully.*/ + destroy? (e: DestroyEventArgs): void; + + /**Fires after Toolbar control item is hovered.*/ + itemHover? (e: ItemHoverEventArgs): void; + + /**Fires after mouse leave from Toolbar control item.*/ + itemLeave? (e: ItemLeaveEventArgs): void; +} + +export interface ClickEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the Toolbar model + */ + model?: ej.Toolbar.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the target of the current object. + */ + target?: any; + + /**returns the target of the current object. + */ + currentTarget?: any; + + /**return the Toolbar state + */ + status?: boolean; +} + +export interface CreateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the Toolbar model + */ + model?: ej.Toolbar.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the Toolbar model + */ + model?: ej.Toolbar.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface ItemHoverEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the Toolbar model + */ + model?: ej.Toolbar.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the target of the current object. + */ + target?: any; + + /**returns the target of the current object. + */ + currentTarget?: any; + + /**return the Toolbar state + */ + status?: boolean; +} + +export interface ItemLeaveEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the Toolbar model + */ + model?: ej.Toolbar.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the target of the current object. + */ + target?: any; + + /**returns the target of the current object. + */ + currentTarget?: any; + + /**return the Toolbar state + */ + status?: boolean; +} + +export interface Fields { + + /**Defines the group name for the item. + */ + group?: string; + + /**Defines the html attributes such as id, class, styles for the item to extend the capability. + */ + htmlAttributes?: any; + + /**Defines id for the tag. + */ + id?: string; + + /**Defines the image attributes such as height, width, styles and so on. + */ + imageAttributes?: string; + + /**Defines the imageURL for the image location. + */ + imageUrl?: string; + + /**Defines the sprite CSS for the image tag. + */ + spriteCssClass?: string; + + /**Defines the text content for the tag. + */ + text?: string; + + /**Defines the tooltip text for the tag. + */ + tooltipText?: string; +} +} + +class TreeView extends ej.Widget { + static fn: TreeView; + constructor(element: JQuery, options?: TreeView.Model); + constructor(element: Element, options?: TreeView.Model); + model:TreeView.Model; + defaults:TreeView.Model; + + /** To add a Node or collection of nodes in TreeView. If target tree node is specified, then the given nodes are added as child of target tree node, otherwise nodes are added in TreeView. + * @param {string|any} New node text or JSON object + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {void} + */ + addNode(newNodeText: string|any, target: string|any): void; + + /** To add a collection of nodes in TreeView. If target tree node is specified, then the given nodes are added as child of target tree node, otherwise nodes are added in TreeView. + * @param {any|Array} New node details in JSON object + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {void} + */ + addNodes(collection: any|Array, target : string|any): void; + + /** To check all the nodes in TreeView. + * @returns {void} + */ + checkAll(): void; + + /** To check a node in TreeView. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {void} + */ + checkNode( element : string|any): void; + + /** To collapse all the TreeView nodes. + * @returns {void} + */ + collapseAll(): void; + + /** To collapse a particular node in TreeView. + * @param {string|any} ID of TreeView node|object of TreeView node + * @returns {void} + */ + collapseNode( element : string|any): void; + + /** To disable the node in the TreeView. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {void} + */ + disableNode( element : string|any): void; + + /** To enable the node in the TreeView. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {void} + */ + enableNode( element : string|any): void; + + /** To ensure that the TreeView node is visible in the TreeView. This method is useful if we need select a TreeView node dynamically. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {boolean} + */ + ensureVisible( element : string|any): boolean; + + /** To expand all the TreeView nodes. + * @returns {void} + */ + expandAll(): void; + + /** To expandNode particular node in TreeView. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {void} + */ + expandNode( element : string|any): void; + + /** To get currently checked nodes in TreeView. + * @returns {any} + */ + getCheckedNodes(): any; + + /** To get currently checked nodes indexes in TreeView. + * @returns {Array} + */ + getCheckedNodesIndex(): Array; + + /** To get number of nodes in TreeView. + * @returns {number} + */ + getNodeCount(): number; + + /** To get currently expanded nodes in TreeView. + * @returns {any} + */ + getExpandedNodes(): any; + + /** To get currently expanded nodes indexes in TreeView. + * @returns {Array} + */ + getExpandedNodesIndex(): Array; + + /** To get TreeView node by using index position in TreeView. + * @param {number} Index position of TreeView node + * @returns {any} + */ + getNodeByIndex( index : number): any; + + /** To get TreeView node data such as id, text, parentId, selected, checked, expanded, level, childs and index. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {any} + */ + getNode(element: string|any): any; + + /** To get current index position of TreeView node. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {number} + */ + getNodeIndex(element : string|any): number; + + /** To get immediate parent TreeView node of particular TreeView node. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {any} + */ + getParent(element : string|any): any; + + /** To get the currently selected node in TreeView. + * @returns {any} + */ + getSelectedNode(): any; + + /** To get the index position of currently selected node in TreeView. + * @returns {number} + */ + getSelectedNodeIndex(): number; + + /** To get the text of a node in TreeView. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {string} + */ + getText( element : string|any): string; + + /** To get the updated datasource of TreeView after performing some operation like drag and drop, node editing, adding and removing node. + * @returns {Array} + */ + getTreeData(): Array; + + /** To get currently visible nodes in TreeView. + * @returns {any} + */ + getVisibleNodes(): any; + + /** To check a node having child or not. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {boolean} + */ + hasChildNode( element : string|any): boolean; + + /** To show nodes in TreeView. + * @returns {void} + */ + hide(): void; + + /** To hide particular node in TreeView. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {void} + */ + hideNode( element : string|any): void; + + /** To add a Node or collection of nodes after the particular TreeView node. + * @param {string|any} New node text or JSON object + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {void} + */ + insertAfter( newNodeText : string|any, target : string|any): void; + + /** To add a Node or collection of nodes before the particular TreeView node. + * @param {string|any} New node text or JSON object + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {void} + */ + insertBefore( newNodeText : string|any, target : string|any): void; + + /** To check the given TreeView node is checked or unchecked. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {boolean} + */ + isNodeChecked( element : string|any): boolean; + + /** To check whether the child nodes are loaded of the given TreeView node. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {boolean} + */ + isChildLoaded( element : string|any): boolean; + + /** To check the given TreeView node is disabled or enabled. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {boolean} + */ + isDisabled( element : string|any): boolean; + + /** To check the given node is exist in TreeView. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {boolean} + */ + isExist( element : string|any): boolean; + + /** To get the expand status of the given TreeView node. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {boolean} + */ + isExpanded( element : string|any): boolean; + + /** To get the select status of the given TreeView node. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {boolean} + */ + isSelected( element : string|any): boolean; + + /** To get the visibility status of the given TreeView node. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {boolean} + */ + isVisible( element : string|any): boolean; + + /** To load the TreeView nodes from the particular URL. If target tree node is specified, then the given nodes are added as child of target tree node, otherwise nodes are added in TreeView. + * @param {string} URL location, the data returned from the URL will be loaded in TreeView + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {void} + */ + loadData( URL : string, target : string|any): void; + + /** To move the TreeView node with in same TreeView. The new poistion of given TreeView node will be based on destionation node and index position. + * @param {string|any} ID of TreeView node/object of TreeView node + * @param {string|any} ID of TreeView node/object of TreeView node + * @param {number} New index position of given source node + * @returns {void} + */ + moveNode( sourceNode : string|any, destinationNode : string|any, index : number): void; + + /** To refresh the TreeView + * @returns {void} + */ + refresh(): void; + + /** To remove all the nodes in TreeView. + * @returns {void} + */ + removeAll(): void; + + /** To remove a node in TreeView. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {void} + */ + removeNode( element : string|any): void; + + /** To select a node in TreeView. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {void} + */ + selectNode( element : string|any): void; + + /** To show nodes in TreeView. + * @returns {void} + */ + show(): void; + + /** To show a node in TreeView. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {void} + */ + showNode( element : string|any): void; + + /** To uncheck all the nodes in TreeView. + * @returns {void} + */ + unCheckAll(): void; + + /** To uncheck a node in TreeView. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {void} + */ + uncheckNode( element : string|any): void; + + /** To unselect the node in the TreeView. + * @param {string|any} ID of TreeView node/object of TreeView node + * @returns {void} + */ + unselectNode( element : string|any): void; + + /** To edit or update the text of the TreeView node. + * @param {string|any} ID of TreeView node/object of TreeView node + * @param {string} New text + * @returns {void} + */ + updateText( target : string|any, newText : string): void; +} +export module TreeView{ + +export interface Model { + + /**Gets or sets a value that indicates whether to enable drag and drop a node within the same tree. + * @Default {false} + */ + allowDragAndDrop?: boolean; + + /**Gets or sets a value that indicates whether to enable drag and drop a node in inter ej.TreeView. + * @Default {true} + */ + allowDragAndDropAcrossControl?: boolean; + + /**Gets or sets a value that indicates whether to drop a node to a sibling of particular node. + * @Default {true} + */ + allowDropSibling?: boolean; + + /**Gets or sets a value that indicates whether to drop a node to a child of particular node. + * @Default {true} + */ + allowDropChild?: boolean; + + /**Gets or sets a value that indicates whether to enable node editing support for TreeView. + * @Default {false} + */ + allowEditing?: boolean; + + /**Gets or sets a value that indicates whether to enable keyboard support for TreeView actions like nodeSelection, nodeEditing, nodeExpand, nodeCollapse, nodeCut and Paste. + * @Default {true} + */ + allowKeyboardNavigation?: boolean; + + /**Allow us to specify the parent and child nodes to get auto check while we check or uncheck a node. + * @Default {true} + */ + autoCheck?: boolean; + + /**Allow us to specify the parent node to be retain in checked or unchecked state instead of going for indeterminate state. + * @Default {false} + */ + autoCheckParentNode?: boolean; + + /**Gets or sets a value that indicates the checkedNodes index collection as an array. The given array index position denotes the nodes, that are checked while rendering TreeView. + * @Default {[]} + */ + checkedNodes?: Array; + + /**Sets the root CSS class for TreeView which allow us to customize the appearance. + */ + cssClass?: string; + + /**Gets or sets a value that indicates whether to enable or disable the animation effect while expanding or collapsing a node. + * @Default {true} + */ + enableAnimation?: boolean; + + /**Gets or sets a value that indicates whether a TreeView can be enabled or disabled. No actions can be performed while this property is set as false + * @Default {true} + */ + enabled?: boolean; + + /**Allow us to prevent multiple nodes to be in expanded state. If it set to false, previously expanded node will be collapsed automatically, while we expand a node. + * @Default {true} + */ + enableMultipleExpand?: boolean; + + /**Sets a value that indicates whether to persist the TreeView model state in page using applicable medium i.e., HTML5 localStorage or cookies + * @Default {false} + */ + enablePersistence?: boolean; + + /**Gets or sets a value that indicates to align content in the TreeView control from right to left by setting the property as true. + * @Default {false} + */ + enableRTL?: boolean; + + /**Gets or sets a array of value that indicates the expandedNodes index collection as an array. The given array index position denotes the nodes, that are expanded while rendering TreeView. + * @Default {[]} + */ + expandedNodes?: Array; + + /**Gets or sets a value that indicates the TreeView node can be expand or collapse by using the specified action. + * @Default {dblclick} + */ + expandOn?: string; + + /**Gets or sets a fields object that allow us to map the data members with field properties in order to make the data binding easier. + * @Default {null} + */ + fields?: Fields; + + /**Defines the height of the TreeView. + * @Default {Null} + */ + height?: string|number; + + /**Specifies the HTML Attributes for the TreeView. Using this API we can add custom attributes in TreeView control. + * @Default {{}} + */ + htmlAttributes?: any; + + /**Specifies the child nodes to be loaded on demand + * @Default {false} + */ + loadOnDemand?: boolean; + + /**Gets or Sets a value that indicates the index position of a tree node. The particular index tree node will be selected while rendering the TreeView. + * @Default {-1} + */ + selectedNode?: number; + + /**Gets or sets a value that indicates whether to display or hide checkbox for all TreeView nodes. + * @Default {false} + */ + showCheckbox?: boolean; + + /**By using sortSettings property, you can customize the sorting option in TreeView control. + */ + sortSettings?: SortSettings; + + /**Allow us to use custom template in order to create TreeView. + * @Default {null} + */ + template?: string; + + /**Defines the width of the TreeView. + * @Default {Null} + */ + width?: string|number; + + /**Fires before adding node to TreeView.*/ + beforeAdd? (e: BeforeAddEventArgs): void; + + /**Fires before collapse a node.*/ + beforeCollapse? (e: BeforeCollapseEventArgs): void; + + /**Fires before cut node in TreeView.*/ + beforeCut? (e: BeforeCutEventArgs): void; + + /**Fires before deleting node in TreeView.*/ + beforeDelete? (e: BeforeDeleteEventArgs): void; + + /**Fires before editing the node in TreeView.*/ + beforeEdit? (e: BeforeEditEventArgs): void; + + /**Fires before expanding the node.*/ + beforeExpand? (e: BeforeExpandEventArgs): void; + + /**Fires before loading nodes to TreeView.*/ + beforeLoad? (e: BeforeLoadEventArgs): void; + + /**Fires before paste node in TreeView.*/ + beforePaste? (e: BeforePasteEventArgs): void; + + /**Fires before selecting node in TreeView.*/ + beforeSelect? (e: BeforeSelectEventArgs): void; + + /**Fires when TreeView created successfully.*/ + create? (e: CreateEventArgs): void; + + /**Fires when TreeView destroyed successfully.*/ + destroy? (e: DestroyEventArgs): void; + + /**Fires before nodeEdit Successful.*/ + inlineEditValidation? (e: InlineEditValidationEventArgs): void; + + /**Fires when key pressed successfully.*/ + keyPress? (e: KeyPressEventArgs): void; + + /**Fires when data load fails.*/ + loadError? (e: LoadErrorEventArgs): void; + + /**Fires when data loaded successfully.*/ + loadSuccess? (e: LoadSuccessEventArgs): void; + + /**Fires once node added successfully.*/ + nodeAdd? (e: NodeAddEventArgs): void; + + /**Fires once node checked successfully.*/ + nodeCheck? (e: NodeCheckEventArgs): void; + + /**Fires when node clicked successfully.*/ + nodeClick? (e: NodeClickEventArgs): void; + + /**Fires when node collapsed successfully.*/ + nodeCollapse? (e: NodeCollapseEventArgs): void; + + /**Fires when node cut successfully.*/ + nodeCut? (e: NodeCutEventArgs): void; + + /**Fires when node deleted successfully.*/ + nodeDelete? (e: NodeDeleteEventArgs): void; + + /**Fires when node dragging.*/ + nodeDrag? (e: NodeDragEventArgs): void; + + /**Fires once node drag start successfully.*/ + nodeDragStart? (e: NodeDragStartEventArgs): void; + + /**Fires before the dragged node to be dropped.*/ + nodeDragStop? (e: NodeDragStopEventArgs): void; + + /**Fires once node dropped successfully.*/ + nodeDropped? (e: NodeDroppedEventArgs): void; + + /**Fires once node edited successfully.*/ + nodeEdit? (e: NodeEditEventArgs): void; + + /**Fires once node expanded successfully.*/ + nodeExpand? (e: NodeExpandEventArgs): void; + + /**Fires once node pasted successfully.*/ + nodePaste? (e: NodePasteEventArgs): void; + + /**Fires when node selected successfully.*/ + nodeSelect? (e: NodeSelectEventArgs): void; + + /**Fires once node unchecked successfully.*/ + nodeUncheck? (e: NodeUncheckEventArgs): void; +} + +export interface BeforeAddEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the given new node data + */ + data ?: string|any; + + /**returns the parent element, the given new nodes to be appended to the given parent element + */ + targetParent ?: any; + + /**returns the given parent node details + */ + parentDetails ?: any; +} + +export interface BeforeCollapseEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the value of the node + */ + value ?: string; + + /**returns the current element of the node clicked + */ + currentElement ?: any; + + /**returns the child nodes are loaded or not + */ + isChildLoaded ?: boolean; + + /**returns the id of currently clicked node + */ + id ?: string; + + /**returns the parent id of currently clicked node + */ + parentId ?: string; + + /**returns the format asynchronous or synchronous + */ + async ?: boolean; +} + +export interface BeforeCutEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the event object + */ + event ?: any; + + /**returns the target element, the given node to be cut + */ + target ?: any; + + /**returns the given target node values + */ + nodeDetails ?: any; + + /**returns the keypressed keycode value + */ + keyCode ?: number; +} + +export interface BeforeDeleteEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the event object + */ + event ?: any; + + /**returns the target element, the given node to be deleted + */ + target ?: any; + + /**returns the given target node values + */ + nodeDetails ?: any; + + /**returns the current parent element of the target node + */ + parentElement ?: any; + + /**returns the parent node values + */ + parentDetails ?: any; +} + +export interface BeforeEditEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the current element of the node clicked + */ + currentElement ?: any; +} + +export interface BeforeExpandEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the value of the node + */ + value ?: string; + + /**if the child node is ready to expanded state; otherwise, false. + */ + isChildLoaded ?: boolean; + + /**returns the current element of the node clicked + */ + currentElement ?: any; + + /**returns the id of currently clicked node + */ + id ?: string; + + /**returns the parent id of currently clicked node + */ + parentId ?: string; + + /**returns the format asynchronous or synchronous + */ + async ?: boolean; +} + +export interface BeforeLoadEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the AJAX settings object + */ + ajaxOptions ?: any; +} + +export interface BeforePasteEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the event object + */ + event ?: any; + + /**returns the target element, the given node to be pasted + */ + target ?: any; + + /**returns the given target node values + */ + nodeDetails ?: any; + + /**returns the keypressed keycode value + */ + keyCode ?: number; +} + +export interface BeforeSelectEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the target element, the given node to be selected + */ + target ?: any; + + /**returns the given target node values + */ + nodeDetails ?: any; +} + +export interface CreateEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; +} + +export interface DestroyEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; +} + +export interface InlineEditValidationEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the new entered text for the node + */ + newText ?: string; + + /**returns the current node element id + */ + id ?: any; + + /**returns the old node text + */ + oldText ?: string; +} + +export interface KeyPressEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the event object + */ + event ?: any; + + /**returns the current element of the node clicked + */ + currentElement ?: any; + + /**returns the value of the node + */ + value ?: string; + + /**returns node path from root element + */ + path ?: string; + + /**returns the keypressed keycode value + */ + keyCode ?: number; + + /**it returns when the current node is in expanded state; otherwise, false. + */ + isExpanded ?: boolean; +} + +export interface LoadErrorEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the AJAX error object + */ + error ?: any; +} + +export interface LoadSuccessEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the success data from the URL + */ + data ?: any; + + /**returns the target parent element, the data returned from the URL to be appended to the given parent element, else in TreeView + */ + targetParent ?: any; + + /**returns the given parent node details + */ + parentDetails ?: any; +} + +export interface NodeAddEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the added data, that are given initially + */ + data ?: any; + + /**returns the newly added elements + */ + nodes ?: any; + + /**returns the target parent element of the added element + */ + parentElement ?: any; + + /**returns the given parent node details + */ + parentDetails ?: any; +} + +export interface NodeCheckEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the event object + */ + event ?: any; + + /**returns the value of the node + */ + value ?: string; + + /**returns the id of the current element of the node clicked + */ + id ?: string; + + /**returns the id of the parent element of current element of the node clicked + */ + parentId ?: string; + + /**returns the current element of the node clicked + */ + currentElement ?: any; + + /**it returns true when the node checkbox is checked; otherwise, false. + */ + isChecked ?: boolean; + + /**it returns the currently checked node name + */ + currentNode ?: Array; + + /**it returns the currently checked and its child node details + */ + currentCheckedNodes ?: Array; +} + +export interface NodeClickEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the event object + */ + event ?: any; + + /**returns the current element of the node clicked + */ + currentElement ?: any; + + /**returns the id of current element + */ + id ?: string; + + /**returns the parentId of current element + */ + parentId ?: string; +} + +export interface NodeCollapseEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the id of the current element of the node clicked + */ + id ?: string; + + /**returns the name of the event + */ + type ?: string; + + /**returns the id of the parent element of current element of the node clicked + */ + parentId ?: string; + + /**returns the value of the node + */ + value ?: string; + + /**returns the current element of the node clicked + */ + currentElement ?: any; + + /**returns the child nodes are loaded or not + */ + isChildLoaded ?: boolean; + + /**returns the format asynchronous or synchronous + */ + async ?: boolean; +} + +export interface NodeCutEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the event object + */ + event ?: any; + + /**returns the current parent element of the cut node + */ + parentElement ?: any; + + /**returns the given parent node details + */ + parentDetails ?: any; + + /**returns the keypressed keycode value + */ + keyCode ?: number; +} + +export interface NodeDeleteEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the event object + */ + event ?: any; + + /**returns the current parent element of the deleted node + */ + parentElement ?: any; + + /**returns the given parent node details + */ + parentDetails ?: any; +} + +export interface NodeDragEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the original drag target + */ + dragTarget ?: any; + + /**returns the current target TreeView node + */ + target ?: any; + + /**returns the current target details + */ + targetElementData ?: any; + + /**returns the current parent element of the target node + */ + draggedElement ?: any; + + /**returns the given parent node details + */ + draggedElementData ?: any; + + /**returns the event object + */ + event ?: any; +} + +export interface NodeDragStartEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the original drag target + */ + dragTarget ?: any; + + /**returns the current dragging parent TreeView node + */ + parentElement ?: any; + + /**returns the current dragging parent TreeView node details + */ + parentElementData ?: any; + + /**returns the current parent element of the dragging node + */ + target ?: any; + + /**returns the given parent node details + */ + targetElementData ?: any; + + /**returns the event object + */ + event ?: any; +} + +export interface NodeDragStopEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the original drop target + */ + dropTarget ?: any; + + /**returns the current dragged TreeView node + */ + draggedElement ?: any; + + /**returns the current dragged TreeView node details + */ + draggedElementData ?: any; + + /**returns the current parent element of the dragged node + */ + target ?: any; + + /**returns the given parent node details + */ + targetElementData ?: any; + + /**returns the drop position such as before, after or over + */ + position ?: string; + + /**returns the event object + */ + event ?: any; +} + +export interface NodeDroppedEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the original drop target + */ + dropTarget ?: any; + + /**returns the current dropped TreeView node + */ + droppedElement ?: any; + + /**returns the current dropped TreeView node details + */ + droppedElementData ?: any; + + /**returns the current parent element of the dropped node + */ + target ?: any; + + /**returns the given parent node details + */ + targetElementData ?: any; + + /**returns the drop position such as before, after or over + */ + position ?: string; + + /**returns the event object + */ + event ?: any; +} + +export interface NodeEditEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the id of the element + */ + id ?: string; + + /**returns the oldText of the element + */ + oldText ?: string; + + /**returns the newText of the element + */ + newText ?: string; + + /**returns the event object + */ + event ?: any; + + /**returns the target element, the given node to be cut + */ + target ?: any; + + /**returns the given target node values + */ + nodeDetails ?: any; +} + +export interface NodeExpandEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the value of the node + */ + value ?: string; + + /**if the child node is ready to expanded state; otherwise, false. + */ + isChildLoaded ?: boolean; + + /**returns the current element of the node clicked + */ + currentElement ?: any; + + /**returns the id of currently clicked node + */ + id ?: string; + + /**returns the parent id of currently clicked node + */ + parentId ?: string; + + /**returns the format asynchronous or synchronous + */ + async ?: boolean; +} + +export interface NodePasteEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the event object + */ + event ?: any; + + /**returns the pasted element + */ + target ?: any; + + /**returns the given target node values + */ + nodeDetails ?: any; + + /**returns the keypressed keycode value + */ + keyCode ?: number; +} + +export interface NodeSelectEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the id of the current element of the node clicked + */ + id ?: any; + + /**returns the id of the parent element of current element of the node clicked + */ + parentId ?: any; + + /**returns the value of the node + */ + value ?: string; + + /**returns the current element of the node clicked + */ + currentElement ?: any; +} + +export interface NodeUncheckEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel ?: boolean; + + /**returns the TreeView model + */ + model ?: ej.TreeView.Model; + + /**returns the name of the event + */ + type ?: string; + + /**returns the event object + */ + event ?: any; + + /**returns the id of the current element of the node clicked + */ + id ?: any; + + /**returns the id of the parent element of current element of the node clicked + */ + parentId ?: any; + + /**returns the value of the node + */ + value ?: string; + + /**returns the current element of the node clicked + */ + currentElement ?: any; + + /**it returns true when the node checkbox is checked; otherwise, false. + */ + isChecked ?: boolean; + + /**it returns currently unchecked node name + */ + currentNode ?: string; + + /**it returns currently unchecked node and its child node details. + */ + currentUncheckedNodes ?: Array; +} + +export interface Fields { + + /**It receives the child level or inner level data source such as Essential DataManager object and JSON object. + */ + child?: any; + + /**It receives Essential DataManager object and JSON object. + */ + dataSource?: any; + + /**Specifies the node to be in expanded state. + */ + expanded?: boolean; + + /**Its allow us to indicate whether the node has child or not in load on demand + */ + hasChild?: boolean; + + /**Specifies the html attributes to “li” item list. + */ + htmlAttribute?: any; + + /**Specifies the id to TreeView node items list. + */ + id?: string; + + /**Specifies the image attribute to “img” tag inside items list + */ + imageAttribute?: any; + + /**Specifies the html attributes to “li” item list. + */ + imageUrl?: string; + + /**If its true Checkbox node will be checked when rendered with checkbox. + */ + isChecked?: boolean; + + /**Specifies the link attribute to “a” tag in item list. + */ + linkAttribute?: any; + + /**Specifies the parent id of the node. The nodes are listed as child nodes of the specified parent node by using its parent id. + */ + parentId?: string; + + /**It receives query to retrieve data from the table (query is same as SQL). + */ + query?: any; + + /**Allow us to specify the node to be in selected state + */ + selected?: boolean; + + /**Specifies the sprite CSS class to “li” item list. + */ + spriteCssClass?: string; + + /**It receives the table name to execute query on the corresponding table. + */ + tableName?: string; + + /**Specifies the text of TreeView node items list. + */ + text?: string; +} + +export interface SortSettings { + + /**Enables or disables the sorting option in TreeView control + * @Default {false} + */ + allowSorting?: boolean; + + /**Sets the sorting order type. There are two sorting types available, such as "ascending", "descending". + * @Default {ej.sortOrder.Ascending} + */ + sortOrder?: ej.sortOrder|string; +} +} +enum sortOrder +{ +//Enum for Ascending sort order +Ascending, +//Enum for Descending sort order +Descending, +} + +class Uploadbox extends ej.Widget { + static fn: Uploadbox; + constructor(element: JQuery, options?: Uploadbox.Model); + constructor(element: Element, options?: Uploadbox.Model); + model:Uploadbox.Model; + defaults:Uploadbox.Model; + + /** The destroy method destroys the control and brings the control to a pre-init state. All the events of the Upload control is bound by using this._on unbinds automatically. + * @returns {void} + */ + destroy(): void; + + /** Disables the Uploadbox control + * @returns {void} + */ + disable(): void; + + /** Enables the Uploadbox control + * @returns {void} + */ + enable(): void; +} +export module Uploadbox{ + +export interface Model { + + /**Enables the file drag and drop support to the Uploadbox control. + * @Default {false} + */ + allowDragAndDrop?: boolean; + + /**Uploadbox supports both synchronous and asynchronous upload. This can be achieved by using the asyncUpload property. + * @Default {true} + */ + asyncUpload?: boolean; + + /**Uploadbox supports auto uploading of files after the file selection is done. + * @Default {false} + */ + autoUpload?: boolean; + + /**Sets the text for each action button. + * @Default {{browse: Browse, upload: Upload, cancel: Cancel, close: Close}} + */ + buttonText?: ButtonText; + + /**Sets the root class for the Uploadbox control theme. This cssClass API helps to use custom skinning option for the Uploadbox button and dialog content. + */ + cssClass?: string; + + /**Specifies the custom file details in the dialog popup on initialization. + * @Default {{ title:true, name:true, size:true, status:true, action:true}} + */ + customFileDetails?: CustomFileDetails; + + /**Specifies the actions for dialog popup while initialization. + * @Default {{ modal:false, closeOnComplete:false, content:null, drag:true}} + */ + dialogAction?: DialogAction; + + /**Displays the Uploadbox dialog at the given X and Y positions. X: Dialog sets the left position value. Y: Dialog sets the top position value. + * @Default {null} + */ + dialogPosition?: any; + + /**Property for applying the text to the Dialog title and content headers. + * @Default {{ title: Upload Box, name: Name, size: Size, status: Status}} + */ + dialogText?: DialogText; + + /**The dropAreaText is displayed when the draganddrop support is enabled in the Uploadbox control. + * @Default {Drop files or click to upload} + */ + dropAreaText?: string; + + /**Specifies the dropAreaHeight when the draganddrop support is enabled in the Uploadbox control. + * @Default {100%} + */ + dropAreaHeight?: number|string; + + /**Specifies the dropAreaWidth when the draganddrop support is enabled in the Uploadbox control. + * @Default {100%} + */ + dropAreaWidth?: number|string; + + /**Based on the property value, Uploadbox is enabled or disabled. + * @Default {true} + */ + enabled?: boolean; + + /**Sets the right-to-left direction property for the Uploadbox control. + * @Default {false} + */ + enableRTL?: boolean; + + /**Only the files with the specified extension is allowed to upload. This is mentioned in the string format. + */ + extensionsAllow?: string; + + /**Only the files with the specified extension is denied for upload. This is mentioned in the string format. + */ + extensionsDeny?: string; + + /**Sets the maximum size limit for uploading the file. This is mentioned in the number format. + * @Default {31457280} + */ + fileSize?: number; + + /**Sets the height of the browse button. + * @Default {35px} + */ + height?: string; + + /**Configures the culture data and sets the culture to the Uploadbox. + * @Default {en-US} + */ + locale?: string; + + /**Enables multiple file selection for upload. + * @Default {true} + */ + multipleFilesSelection?: boolean; + + /**You can push the file to the Uploadbox in the client-side of the XHR supported browsers alone. + * @Default {null} + */ + pushFile?: any; + + /**Specifies the remove action to be performed after the file uploading is completed. Here, mention the server address for removal. + */ + removeUrl?: string; + + /**Specifies the save action to be performed after the file is pushed for uploading. Here, mention the server address to be saved. + */ + saveUrl?: string; + + /**Enables the browse button support to the Uploadbox control. + * @Default {true} + */ + showBrowseButton?: boolean; + + /**Specifies the file details to be displayed when selected for uploading. This can be done when the showFileDetails is set to true. + * @Default {true} + */ + showFileDetails?: boolean; + + /**Sets the name for the Uploadbox control. This API helps to Map the action in code behind to retrieve the files. + */ + uploadName?: string; + + /**Sets the width of the browse button. + * @Default {100px} + */ + width?: string; + + /**Fires when the upload progress begins.*/ + begin? (e: BeginEventArgs): void; + + /**Fires when the upload progress is cancelled.*/ + cancel? (e: CancelEventArgs): void; + + /**Fires when the file upload progress is completed.*/ + complete? (e: CompleteEventArgs): void; + + /**Fires when the file upload progress is completed.*/ + success? (e: SuccessEventArgs): void; + + /**Fires when the Uploadbox control is created.*/ + create? (e: CreateEventArgs): void; + + /**Fires when the Uploadbox control is destroyed.*/ + destroy? (e: DestroyEventArgs): void; + + /**Fires when the Upload process ends in Error.*/ + error? (e: ErrorEventArgs): void; + + /**Fires when the file is selected for upload successfully.*/ + fileSelect? (e: FileSelectEventArgs): void; + + /**Fires when the uploaded file is removed successfully.*/ + remove? (e: RemoveEventArgs): void; +} + +export interface BeginEventArgs { + + /**To pass additional information to the server. + */ + data?: any; + + /**Selected FileList Object. + */ + files?: any; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the Uploadbox model + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface CancelEventArgs { + + /**Canceled FileList Object. + */ + fileStatus?: any; + + /**returns the Uploadbox model + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface CompleteEventArgs { + + /**AJAX event argument for reference. + */ + e?: any; + + /**Uploaded file list. + */ + files?: any; + + /**response from the server. + */ + responseText?: string; + + /**XHR-AJAX Object for reference. + */ + xhr?: any; + + /**returns the Uploadbox model + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface SuccessEventArgs { + + /**response from the server. + */ + responseText?: string; + + /**AJAX event argument for reference. + */ + e?: any; + + /**successfully uploaded files list. + */ + success?: any; + + /**Uploaded file list. + */ + files?: any; + + /**XHR-AJAX Object for reference. + */ + xhr?: any; + + /**returns the Uploadbox model + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface CreateEventArgs { + + /**returns the Uploadbox model + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**returns the Uploadbox model + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface ErrorEventArgs { + + /**details about the error information. + */ + error?: string; + + /**returns the name of the event. + */ + type?: string; + + /**error event action details. + */ + action?: string; + + /**returns the file details of the file uploaded + */ + files?: any; +} + +export interface FileSelectEventArgs { + + /**returns Selected FileList objects + */ + files?: any; + + /**returns the Uploadbox model + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface RemoveEventArgs { + + /**returns the Uploadbox model + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; + + /**returns the file details of the file object + */ + fileStatus?: any; +} + +export interface ButtonText { + + /**Sets the text for the browse button. + */ + browse?: string; + + /**Sets the text for the cancel button. + */ + cancel?: string; + + /**Sets the text for the close button. + */ + Close?: string; + + /**Sets the text for the Upload button inside the dialog popup. + */ + upload?: string; +} + +export interface CustomFileDetails { + + /**Enables the file upload interactions like remove/cancel in File details of the dialog popup. + */ + action?: boolean; + + /**Enables the name in the File details of the dialog popup. + */ + name?: boolean; + + /**Enables or disables the File size details of the dialog popup. + */ + size?: boolean; + + /**Enables or disables the file uploading status visibility in the dialog file details content. + */ + status?: boolean; + + /**Enables the title in File details for the dialog popup. + */ + title?: boolean; +} + +export interface DialogAction { + + /**Once uploaded successfully, the dialog popup closes immediately. + */ + closeOnComplete?: boolean; + + /**Sets the content container option to the Uploadbox dialog popup. + */ + content?: string; + + /**Enables the drag option to the dialog popup. + */ + drag?: boolean; + + /**Enables or disables the Uploadbox dialog’s modal property to the dialog popup. + */ + modal?: boolean; +} + +export interface DialogText { + + /**Sets the uploaded file’s Name (header text) to the Dialog popup. + */ + name?: string; + + /**Sets the upload file Size (header text) to the dialog popup. + */ + size?: string; + + /**Sets the upload file Status (header text) to the dialog popup. + */ + status?: string; + + /**Sets the title text of the dialog popup. + */ + title?: string; +} +} + +class WaitingPopup extends ej.Widget { + static fn: WaitingPopup; + constructor(element: JQuery, options?: WaitingPopup.Model); + constructor(element: Element, options?: WaitingPopup.Model); + model:WaitingPopup.Model; + defaults:WaitingPopup.Model; + + /** To hide the waiting popup + * @returns {void} + */ + hide(): void; + + /** Refreshes the WaitingPopup control by resetting the pop-up panel position and content position + * @returns {void} + */ + refresh(): void; + + /** To show the waiting popup + * @returns {void} + */ + show(): void; +} +export module WaitingPopup{ + +export interface Model { + + /**Sets the root class for the WaitingPopup control theme + * @Default {null} + */ + cssClass?: string; + + /**Enables or disables the default loading icon. + * @Default {true} + */ + showImage?: boolean; + + /**Enables the visibility of the WaitingPopup control + * @Default {false} + */ + showOnInit?: boolean; + + /**Loads HTML content inside the popup panel instead of the default icon + * @Default {null} + */ + template?: any; + + /**Sets the custom text in the pop-up panel to notify the waiting process + * @Default {null} + */ + text?: string; + + /**Fires after Create WaitingPopup successfully*/ + create? (e: CreateEventArgs): void; + + /**Fires after Destroy WaitingPopup successfully*/ + destroy? (e: DestroyEventArgs): void; +} + +export interface CreateEventArgs { + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the WaitingPopup model + */ + model?: ej.WaitingPopup.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the WaitingPopup model + */ + model?: ej.WaitingPopup.Model; + + /**returns the name of the event + */ + type?: string; +} +} + +class Grid extends ej.Widget { + static fn: Grid; + constructor(element: JQuery, options?: Grid.Model); + constructor(element: Element, options?: Grid.Model); + model:Grid.Model; + defaults:Grid.Model; + + /** Adds a grid model property which is to be ignored upon exporting. + * @returns {void} + */ + addIgnoreOnExport(): void; + + /** Add a new record in grid control when allowAdding is set as true. + * @returns {void} + */ + addRecord(): void; + + /** Cancel the modified changes in grid control when edit mode is "batch". + * @returns {void} + */ + batchCancel(): void; + + /** Save the modified changes to data source in grid control when edit mode is "batch". + * @returns {void} + */ + batchSave(): void; + + /** Send a cancel request in grid. + * @returns {void} + */ + cancelEdit(): void; + + /** Send a cancel request to the edited cell in grid. + * @returns {void} + */ + cancelEditCell(): void; + + /** It is used to clear all the cell selection. + * @returns {boolean} + */ + clearCellSelection(): boolean; + + /** It is used to clear all the row selection or at specific row selection based on the index provided. + * @param {number} optional If index of the column is specified then it will remove the selection from the particular column else it will clears all of the column selection + * @returns {boolean} + */ + clearColumnSelection(index: number): boolean; + + /** It is used to clear all the filtering done. + * @param {string} If field of the column is specified then it will clear the particular filtering column + * @returns {void} + */ + clearFiltering(field: string): void; + + /** Clear the searching from the grid + * @returns {void} + */ + clearSearching(): void; + + /** Clear all the row selection or at specific row selection based on the index provided + * @param {number} optional If index of the row is specified then it will remove the selection from the particular row else it will clears all of the row selection + * @returns {boolean} + */ + clearSelection(index: number): boolean; + + /** Clear the sorting from columns in the grid + * @returns {void} + */ + clearSorting(): void; + + /** Collapse all the group caption rows in grid + * @returns {void} + */ + collapseAll(): void; + + /** Collapse the group drop area in grid + * @returns {void} + */ + collapseGroupDropArea(): void; + + /** Add or remove columns in grid column collections + * @param {Array|string} Pass array of columns or string of field name to add/remove the column in grid + * @param {string} optional Pass add/remove action to be performed. By default "add" action will perform + * @returns {void} + */ + columns(columnDetails: Array|string, action: string): void; + + /** Refresh the grid with new data source + * @param {Array} Pass new data source to the grid + * @returns {void} + */ + dataSource(datasource: Array): void; + + /** Delete a record in grid control when allowDeleting is set as true + * @param {string} Pass the primary key field Name of the column + * @param {Array} Pass the json data of record need to be delete. + * @returns {void} + */ + deleteRecord(fieldName: string, data: Array): void; + + /** Destroy the grid widget all events bound using this._on will be unbind automatically and bring the control to pre-init state. + * @returns {void} + */ + destroy(): void; + + /** Edit a particular cell based on the row index and field name provided in "batch" edit mode. + * @param {number} Pass row index to edit particular cell + * @param {string} Pass the field name of the column to perform batch edit + * @returns {void} + */ + editCell(index: number, fieldName: string): void; + + /** Send a save request in grid. + * @returns {void} + */ + endEdit(): void; + + /** Expand all the group caption rows in grid. + * @returns {void} + */ + expandAll(): void; + + /** Expand or collapse the row based on the row state in grid + * @param {JQuery} Pass the target object to expand/collapse the row based on its row state + * @returns {HTMLElement} + */ + expandCollapse($target: JQuery): HTMLElement; + + /** Expand the group drop area in grid. + * @returns {void} + */ + expandGroupDropArea(): void; + + /** Export the grid content to excel, word or pdf document. + * @param {string} Pass the controller action name corresponding to exporting + * @param {string} optionalASP server event name corresponding to exporting + * @param {boolean} optionalPass the multiple exporting value as true/false + * @param {Array} optionalPass the array of the gridIds to be filtered + * @returns {void} + */ + export(action: string, serverEvent: string, multipleExport: boolean, gridIds: Array): void; + + /** Send a filtering request to filter one column in grid. + * @param {string} Pass the field name of the column + * @param {string} string/integer/dateTime operator + * @param {string|number} Pass the value to be filtered in a column + * @param {string} Pass the predicate as and/or + * @param {boolean} optional Pass the match case value as true/false + * @returns {void} + */ + filterColumn(fieldName: string, filterOperator: string, filterValue: string|number, predicate: string, matchcase: boolean): void; + + /** Send a filtering request to filter single or multiple column in grid. + * @param {Array} Pass array of filterColumn query for performing filter operation + * @returns {void} + */ + filterColumn(filterQueries: Array): void; + + /** Get the batch changes of edit, delete and add operations of grid. + * @returns {any} + */ + getBatchChanges(): any; + + /** Get the browser details + * @returns {any} + */ + getBrowserDetails(): any; + + /** Get the column details based on the given field in grid + * @param {string} Pass the field name of the column to get the corresponding column object + * @returns {any} + */ + getColumnByField(fieldName: string): any; + + /** Get the column details based on the given header text in grid. + * @param {string} Pass the header text of the column to get the corresponding column object + * @returns {any} + */ + getColumnByHeaderText(headerText: string): any; + + /** Get the column details based on the given column index in grid + * @param {number} Pass the index of the column to get the corresponding column object + * @returns {any} + */ + getColumnByIndex(columnIndex: number): any; + + /** Get the list of field names from column collection in grid. + * @returns {Array} + */ + getColumnFieldNames(): Array; + + /** Get the column index of the given field in grid. + * @param {string} Pass the field name of the column to get the corresponding column index + * @returns {number} + */ + getColumnIndexByField(fieldName: string): number; + + /** Get the content div element of grid. + * @returns {HTMLElement} + */ + getContent(): HTMLElement; + + /** Get the content table element of grid + * @returns {HTMLElement} + */ + getContentTable(): HTMLElement; + + /** Get the data of currently edited cell value in "batch" edit mode + * @returns {any} + */ + getCurrentEditCellData(): any; + + /** Get the current page index in grid pager. + * @returns {number} + */ + getCurrentIndex(): number; + + /** Get the current page data source of grid. + * @returns {Array} + */ + getCurrentViewData(): Array; + + /** Get the column field name from the given header text in grid. + * @param {string} Pass header text of the column to get its corresponding field name + * @returns {string} + */ + getFieldNameByHeaderText(headerText: string): string; + + /** Get the filter bar of grid + * @returns {HTMLElement} + */ + getFilterBar(): HTMLElement; + + /** Get the records filtered or searched in Grid + * @returns {Array} + */ + getFilteredRecords(): Array; + + /** Get the footer content of grid. + * @returns {HTMLElement} + */ + getFooterContent(): HTMLElement; + + /** Get the footer table element of grid. + * @returns {HTMLElement} + */ + getFooterTable(): HTMLElement; + + /** Get the header content div element of grid. + * @returns {HTMLElement} + */ + getHeaderContent(): HTMLElement; + + /** Get the header table element of grid + * @returns {HTMLElement} + */ + getHeaderTable(): HTMLElement; + + /** Get the column header text from the given field name in grid. + * @param {string} Pass field name of the column to get its corresponding header text + * @returns {string} + */ + getHeaderTextByFieldName(field: string): string; + + /** Get the names of all the hidden column collections in grid. + * @returns {Array} + */ + getHiddenColumnNames(): Array; + + /** Get the row index based on the given tr element in grid. + * @param {JQuery} Pass the tr element in grid content to get its row index + * @returns {number} + */ + getIndexByRow($tr: JQuery): number; + + /** Get the pager of grid. + * @returns {HTMLElement} + */ + getPager(): HTMLElement; + + /** Get the names of primary key columns in Grid + * @returns {Array} + */ + getPrimaryKeyFieldNames(): Array; + + /** Get the rows(tr element) from the given from and to row index in grid + * @param {number} Pass the from index from which the rows to be returned + * @param {number} Pass the to index to which the rows to be returned + * @returns {HTMLElement} + */ + getRowByIndex(from: number, to: number): HTMLElement; + + /** Get the row height of grid. + * @returns {number} + */ + getRowHeight(): number; + + /** Get the rows(tr element)of grid which is displayed in the current page. + * @returns {HTMLElement} + */ + getRows(): HTMLElement; + + /** Get the scroller object of grid. + * @returns {any} + */ + getScrollObject(): any; + + /** Get the selected records details in grid. + * @returns {void} + */ + getSelectedRecords(): void; + + /** Get the names of all the visible column collections in grid + * @returns {Array} + */ + getVisibleColumnNames(): Array; + + /** Send a paging request to specified page in grid + * @param {number} Pass the page index to perform paging at specified page index + * @returns {void} + */ + gotoPage(pageIndex: number): void; + + /** Send a column grouping request in grid. + * @param {string} Pass the field Name of the column to be grouped in grid control + * @returns {void} + */ + groupColumn(fieldName: string): void; + + /** Hide columns from the grid based on the header text + * @param {Array|string} you can pass either array of header text of various columns or a header text of a column to hide + * @returns {void} + */ + hideColumns(headerText: Array|string): void; + + /** Print the grid control + * @returns {void} + */ + print(): void; + + /** It is used to refresh and reset the changes made in "batch" edit mode + * @returns {void} + */ + refreshBatchEditChanges(): void; + + /** Refresh the grid contents. The template refreshment is based on the argument passed along with this method + * @param {boolean} optional When templateRefresh is set true, template and grid contents both are refreshed in grid else only grid content is refreshed + * @returns {void} + */ + refreshContent(templateRefresh: boolean): void; + + /** Refresh the template of the grid + * @returns {void} + */ + refreshTemplate(): void; + + /** Refresh the toolbar items in grid. + * @returns {void} + */ + refreshToolbar(): void; + + /** Remove a column or collection of columns from a sorted column collections in grid. + * @param {Array|string} Pass array of field names of the columns to remove a collection of sorted columns or pass a string of field name to remove a column from sorted column collections + * @returns {void} + */ + removeSortedColumns(fieldName: Array|string): void; + + /** Creates a grid control + * @returns {void} + */ + render(): void; + + /** Re-order the column in grid + * @param {string} Pass the from field name of the column needs to be changed + * @param {string} Pass the to field name of the column needs to be changed + * @returns {void} + */ + reorderColumns(fromFieldName: string, toFieldName: string): void; + + /** Reset the model collections like pageSettings, groupSettings, filterSettings, sortSettings and summaryRows. + * @returns {void} + */ + resetModelCollections(): void; + + /** Resize the columns by giving column name and width for the corresponding one. + * @param {string} Pass the column name that needs to be changed + * @param {string} Pass the width to resize the particular columns + * @returns {void} + */ + resizeColumns(column: string, width: string): void; + + /** Resolves row height issue when unbound column is used with FrozenColumn + * @returns {void} + */ + rowHeightRefresh(): void; + + /** Save the particular edited cell in grid. + * @returns {boolean} + */ + saveCell(): boolean; + + /** Set dimension for grid with corresponding to grid parent. + * @returns {void} + */ + setDimension(): void; + + /** Send a request to grid to refresh the width set to columns + * @returns {void} + */ + setWidthToColumns(): void; + + /** Send a search request to grid with specified string passed in it + * @param {string} Pass the string to search in Grid records + * @returns {void} + */ + search(searchString: string): void; + + /** Select cells in grid. + * @param {any} It is used to set the starting index of row and indexes of cells for that corresponding row for selecting cells. + * @returns {void} + */ + selectCells(rowCellIndexes: any): void; + + /** Select columns in grid. + * @param {number} It is used to set the starting index of column for selecting columns. + * @returns {void} + */ + selectColumns(fromIndex: number): void; + + /** Select rows in grid. + * @param {number} It is used to set the starting index of row for selecting rows. + * @param {number} It is used to set the ending index of row for selecting rows. + * @returns {void} + */ + selectRows(fromIndex: number, toIndex: number): void; + + /** Select rows in grid. + * @param {Array} Pass array of rowIndexes for selecting rows + * @returns {void} + */ + selectRows(rowIndexes: Array): void; + + /** Used to update a particular cell value.Note: It will work only for Local Data. + * @returns {void} + */ + setCellText(): void; + + /** Used to update a particular cell value based on specified row Index and the fieldName. + * @param {number} It is used to set the index for selecting the row. + * @param {string} It is used to set the field name for selecting column. + * @param {any} It is used to set the value for the selected cell. + * @returns {void} + */ + setCellValue(Index: number, fieldName: string, value: any): void; + + /** Set validation to a field during editing. + * @param {string} Specify the field name of the column to set validation rules + * @param {any} Specify the validation rules for the field + * @returns {void} + */ + setValidationToField(fieldName: string, rules: any): void; + + /** Show columns in the grid based on the header text + * @param {Array|string} you can pass either array of header text of various columns or a header text of a column to show + * @returns {void} + */ + showColumns(headerText: Array|string): void; + + /** Send a sorting request in grid. + * @param {string} Pass the field name of the column as columnName for which sorting have to be performed + * @param {string} optional Pass the sort direction ascending/descending by which the column have to be sort. By default it is sorting in an ascending order + * @returns {void} + */ + sortColumn(columnName: string, sortingDirection: string): void; + + /** Send an edit record request in grid + * @param {JQuery} Pass the tr- selected row element to be edited in grid + * @returns {HTMLElement} + */ + startEdit($tr: JQuery): HTMLElement; + + /** Un-group a column from grouped columns collection in grid + * @param {string} Pass the field Name of the column to be ungrouped from grouped column collection + * @returns {void} + */ + ungroupColumn(fieldName: string): void; + + /** Update a edited record in grid control when allowEditing is set as true. + * @param {string} Pass the primary key field Name of the column + * @param {Array} Pass the edited json data of record need to be update. + * @returns {void} + */ + updateRecord(fieldName: string, data: Array): void; + + /** It adapts grid to its parent element or to the browsers window. + * @returns {void} + */ + windowonresize(): void; +} +export module Grid{ + +export interface Model { + + /**Gets or sets a value that indicates whether to customizing cell based on our needs. + * @Default {false} + */ + allowCellMerging?: boolean; + + /**Gets or sets a value that indicates whether to enable dynamic grouping behavior. Grouping can be done by drag on drop desired columns to grid’s GroupDropArea. This can be further customized through “groupSettings” property. + * @Default {false} + */ + allowGrouping?: boolean; + + /**Gets or sets a value that indicates whether to enable keyboard support for performing grid actions. selectionType – Gets or sets a value that indicates whether to enable single row or multiple rows selection behavior in grid. Multiple selection can be done through by holding CTRL and clicking the grid rows + * @Default {true} + */ + allowKeyboardNavigation?: boolean; + + /**Gets or sets a value that indicates whether to enable dynamic filtering behavior on grid. Filtering can be used to limit the records displayed using required criteria and this can be further customized through “filterSettings” property + * @Default {false} + */ + allowFiltering?: boolean; + + /**Gets or sets a value that indicates whether to enable the dynamic sorting behavior on grid data. Sorting can be done through clicking on particular column header. + * @Default {false} + */ + allowSorting?: boolean; + + /**Gets or sets a value that indicates whether to enable multi columns sorting behavior in grid. Sort multiple columns by holding CTRL and click on the corresponding column header. + * @Default {false} + */ + allowMultiSorting?: boolean; + + /**This specifies the grid to show the paginated data. Also enables pager control at the bottom of grid for dynamic navigation through data source. Paging can be further customized through “pageSettings” property. + * @Default {false} + */ + allowPaging?: boolean; + + /**Gets or sets a value that indicates whether to enable the columns reordering behavior in the grid. Reordering can be done through by drag and drop the particular column from one index to another index within the grid. + * @Default {false} + */ + allowReordering?: boolean; + + /**Gets or sets a value that indicates whether the column is non resizable. Column width is set automatically based on the content or header text which is large. + * @Default {false} + */ + allowResizeToFit?: boolean; + + /**Gets or sets a value that indicates whether to enable dynamic resizable of columns. Resize the width of the columns by simply click and move the particular column header line + * @Default {false} + */ + allowResizing?: boolean; + + /**Gets or sets a value that indicates whether to enable the scrollbar in the grid and view the records by scroll through the grid manually + * @Default {false} + */ + allowScrolling?: boolean; + + /**Gets or sets a value that indicates whether to enable dynamic searching behavior in grid. Currently search box can be enabled through “toolbarSettings” + * @Default {false} + */ + allowSearching?: boolean; + + /**Gets or sets a value that indicates whether user can select rows on grid. On enabling feature, selected row will be highlighted. + * @Default {true} + */ + allowSelection?: boolean; + + /**Gets or sets a value that indicates whether the Content will wrap to the next line if the content exceeds the boundary of the Column Cells. + * @Default {false} + */ + allowTextWrap?: boolean; + + /**Gets or sets a value that indicates whether to enable the multiple exporting behavior on grid data. + * @Default {false} + */ + allowMultipleExporting?: boolean; + + /**Gets or sets a value that indicates to define common width for all the columns in the grid. + */ + commonWidth?: number; + + /**Gets or sets a value that indicates to enable the visibility of the grid lines. + * @Default {ej.Grid.GridLines.Both} + */ + gridLines?: ej.Grid.GridLines|string; + + /**This specifies the grid to add the grid control inside the grid row of the parent with expand/collapse options + * @Default {null} + */ + childGrid?: any; + + /**Used to enable or disable static width settings for column. If the columnLayout is set as fixed, then column width will be static. + * @Default {ej.Grid.ColumnLayout.Auto} + */ + columnLayout?: ej.Grid.ColumnLayout|string; + + /**Gets or sets an object that indicates to render the grid with specified columns + * @Default {[]} + */ + columns?: Array; + + /**Gets or sets an object that indicates whether to customize the context menu behavior of the grid. + */ + contextMenuSettings?: ContextMenuSettings; + + /**Gets or sets a value that indicates to render the grid with custom theme. allowScrolling – Gets or sets a value that indicates whether to enable the scrollbar in the grid and view the records by scroll through the grid manually + */ + cssClass?: string; + + /**Gets or sets the data to render the grid with records + * @Default {null} + */ + dataSource?: any; + + /**Default Value: + * @Default {null} + */ + detailsTemplate?: string; + + /**Gets or sets an object that indicates whether to customize the editing behavior of the grid. + */ + editSettings?: EditSettings; + + /**Gets or sets a value that indicates whether to enable the alternative rows differentiation in the grid records based on corresponding theme. + * @Default {true} + */ + enableAltRow?: boolean; + + /**Gets or sets a value that indicates whether to enable the save action in the grid through row selection + * @Default {true} + */ + enableAutoSaveOnSelectionChange?: boolean; + + /**Gets or sets a value that indicates whether to enable mouse over effect on the corresponding column header cell of the grid + * @Default {false} + */ + enableHeaderHover?: boolean; + + /**Gets or sets a value that indicates whether to persist the grid model state in page using applicable medium i.e., HTML5 localStorage or cookies + * @Default {false} + */ + enablePersistence?: boolean; + + /**Gets or sets a value that indicates whether the grid rows has to be rendered as detail view in mobile mode + * @Default {false} + */ + enableResponsiveRow?: boolean; + + /**Gets or sets a value that indicates whether to enable mouse over effect on corresponding grid row. + * @Default {true} + */ + enableRowHover?: boolean; + + /**Align content in the grid control from right to left by setting the property as true. + * @Default {false} + */ + enableRTL?: boolean; + + /**To Disable the mouse swipe property as false. + * @Default {true} + */ + enableTouch?: boolean; + + /**Gets or sets an object that indicates whether to customize the filtering behavior of the grid + */ + filterSettings?: FilterSettings; + + /**Gets or sets an object that indicates whether to customize the grouping behavior of the grid. + */ + groupSettings?: GroupSettings; + + /**Gets or sets an object that indicates whether to auto wrap the grid header or content or both + */ + textWrapSettings?: TextWrapSettings; + + /**Gets or sets a value that indicates whether the grid design has be to made responsive. + * @Default {false} + */ + isResponsive?: boolean; + + /**This specifies to change the key in keyboard interaction to grid control + * @Default {null} + */ + keySettings?: any; + + /**Gets or sets a value that indicates whether to customizing the user interface (UI) as locale-specific in order to display regional data i.e. in a language and culture specific to a particular country or region. + * @Default {en-US} + */ + locale?: string; + + /**Gets or sets a value that indicates whether to set the minimum width of the responsive grid while isResponsive property is true and enableResponsiveRow property is set as false. + * @Default {0} + */ + minWidth?: number; + + /**Gets or sets an object that indicates whether to modify the pager default configuration. + */ + pageSettings?: PageSettings; + + /**Query the dataSource from the table for Grid. + * @Default {null} + */ + query?: any; + + /**Gets or sets a value that indicates to render the grid with template rows. The template row must be a table row. That table row must have the JavaScript render binding format ({{:columnName}}) then the grid data source binds the data to the corresponding table row of the template. + * @Default {null} + */ + rowTemplate?: string; + + /**Gets or sets an object that indicates whether to customize the scrolling behavior of the grid. + */ + scrollSettings?: ScrollSettings; + + /**Gets or sets an object that indicates whether to customize the searching behavior of the grid + */ + searchSettings?: SearchSettings; + + /**Gets a value that indicates whether the grid model to hold multiple selected records . selectedRecords can be used to displayed hold the single or multiple selected records using “selectedRecords” property + * @Default {null} + */ + selectedRecords?: Array; + + /**Gets or sets a value that indicates to select the row while initializing the grid + * @Default {-1} + */ + selectedRowIndex?: number; + + /**This property is used to configure the selection behavior of the grid. + */ + selectionSettings?: SelectionSettings; + + /**The row selection behavior of grid. Accepting types are "single" and "multiple". + * @Default {ej.Grid.SelectionType.Single} + */ + selectionType?: ej.Grid.SelectionType|string; + + /**This specifies to add new editable row dynamically at the either top or bottom of the grid. + * @Default {false} + */ + showAddNewRow?: boolean; + + /**Default Value: + * @Default {false} + */ + showColumnChooser?: boolean; + + /**Default Value: + * @Default {true} + */ + showInColumnChooser?: boolean; + + /**Gets or sets a value that indicates stacked header should be shown on grid layout when the property “stackedHeaderRows” is set. + * @Default {false} + */ + showStackedHeader?: boolean; + + /**Gets or sets a value that indicates summary rows should be shown on grid layout when the property “summaryRows” is set + * @Default {false} + */ + showSummary?: boolean; + + /**Gets or sets a value that indicates whether to customize the sorting behavior of the grid. + */ + sortSettings?: SortSettings; + + /**Gets or sets an object that indicates to managing the collection of stacked header rows for the grid. + * @Default {[]} + */ + stackedHeaderRows?: Array; + + /**Gets or sets an object that indicates to managing the collection of summary rows for the grid. + * @Default {[]} + */ + summaryRows?: Array; + + /**Gets or sets an object that indicates whether to enable the toolbar in the grid and add toolbar items + */ + toolbarSettings?: ToolbarSettings; + + /**Triggered for every grid action before its starts.*/ + actionBegin? (e: ActionBeginEventArgs): void; + + /**Triggered for every grid action success event.*/ + actionComplete? (e: ActionCompleteEventArgs): void; + + /**Triggered for every grid action server failure event.*/ + actionFailure? (e: ActionFailureEventArgs): void; + + /**Triggered when record batch add.*/ + batchAdd? (e: BatchAddEventArgs): void; + + /**Triggered when record batch delete.*/ + batchDelete? (e: BatchDeleteEventArgs): void; + + /**Triggered before the batch add.*/ + beforeBatchAdd? (e: BeforeBatchAddEventArgs): void; + + /**Triggered before the batch delete.*/ + beforeBatchDelete? (e: BeforeBatchDeleteEventArgs): void; + + /**Triggered before the batch save.*/ + beforeBatchSave? (e: BeforeBatchSaveEventArgs): void; + + /**Triggered before the record is going to be edited.*/ + beginEdit? (e: BeginEditEventArgs): void; + + /**Triggered when record cell edit.*/ + cellEdit? (e: CellEditEventArgs): void; + + /**Triggered when record cell save.*/ + cellSave? (e: CellSaveEventArgs): void; + + /**Triggered after the cell is selected.*/ + cellSelected? (e: CellSelectedEventArgs): void; + + /**Triggered before the cell is going to be selected.*/ + cellSelecting? (e: CellSelectingEventArgs): void; + + /**Triggered when the column is being dragged.*/ + columnDrag? (e: ColumnDragEventArgs): void; + + /**Triggered when column dragging begins.*/ + columnDragStart? (e: ColumnDragStartEventArgs): void; + + /**Triggered when the column is dropped.*/ + columnDrop? (e: ColumnDropEventArgs): void; + + /**Triggered after the column is selected.*/ + columnSelected? (e: ColumnSelectedEventArgs): void; + + /**Triggered before the column is going to be selected.*/ + columnSelecting? (e: ColumnSelectingEventArgs): void; + + /**Triggered when context menu item is clicked*/ + contextClick? (e: ContextClickEventArgs): void; + + /**Triggered before the context menu is opened.*/ + contextOpen? (e: ContextOpenEventArgs): void; + + /**Triggered when the grid is rendered completely.*/ + create? (e: CreateEventArgs): void; + + /**Triggered when the grid is bound with data during initial rendering.*/ + dataBound? (e: DataBoundEventArgs): void; + + /**Triggered when grid going to destroy.*/ + destroy? (e: DestroyEventArgs): void; + + /**Triggered when detail template row is clicked to collapse.*/ + detailsCollapse? (e: DetailsCollapseEventArgs): void; + + /**Triggered detail template row is initialized.*/ + detailsDataBound? (e: DetailsDataBoundEventArgs): void; + + /**Triggered when detail template row is clicked to expand.*/ + detailsExpand? (e: DetailsExpandEventArgs): void; + + /**Triggered after the record is added.*/ + endAdd? (e: EndAddEventArgs): void; + + /**Triggered after the record is deleted.*/ + endDelete? (e: EndDeleteEventArgs): void; + + /**Triggered after the record is edited.*/ + endEdit? (e: EndEditEventArgs): void; + + /**Triggered initial load.*/ + load? (e: LoadEventArgs): void; + + /**Triggered every time a request is made to access particular cell information, element and data.*/ + mergeCellInfo? (e: MergeCellInfoEventArgs): void; + + /**Triggered every time a request is made to access particular cell information, element and data.*/ + queryCellInfo? (e: QueryCellInfoEventArgs): void; + + /**Triggered when record is clicked.*/ + recordClick? (e: RecordClickEventArgs): void; + + /**Triggered when record is double clicked.*/ + recordDoubleClick? (e: RecordDoubleClickEventArgs): void; + + /**Triggered after column resized.*/ + resized? (e: ResizedEventArgs): void; + + /**Triggered when column resize end.*/ + resizeEnd? (e: ResizeEndEventArgs): void; + + /**Triggered when column resize start.*/ + resizeStart? (e: ResizeStartEventArgs): void; + + /**Triggered when right clicked on grid element.*/ + rightClick? (e: RightClickEventArgs): void; + + /**Triggered every time a request is made to access row information, element and data.*/ + rowDataBound? (e: RowDataBoundEventArgs): void; + + /**Triggered after the row is selected.*/ + rowSelected? (e: RowSelectedEventArgs): void; + + /**Triggered before the row is going to be selected.*/ + rowSelecting? (e: RowSelectingEventArgs): void; + + /**Triggered when refresh the template column elements in the Grid.*/ + templateRefresh? (e: TemplateRefreshEventArgs): void; + + /**Triggered when toolbar item is clicked in grid.*/ + toolBarClick? (e: ToolBarClickEventArgs): void; +} + +export interface ActionBeginEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the current selected page number. + */ + currentPage?: number; + + /**Returns the previous selected page number. + */ + previousPage?: number; + + /**Returns the end row index of that current page. + */ + endIndex?: number; + + /**Returns request type. + */ + requestType?: string; + + /**Returns the start row index of that current page. + */ + startIndex?: number; + + /**Returns the current grouped column field name. + */ + columnName?: string; + + /**Returns the column sort direction. + */ + columnSortDirection?: string; + + /**Returns current edited row. + */ + row?: any; + + /**Returns the current action event type. + */ + originalEventType?: string; + + /**Returns primary key. + */ + primaryKey?: string; + + /**Returns primary key value. + */ + primaryKeyValue?: string; + + /**Returns the edited row index. + */ + rowIndex?: number; + + /**Returns the record object (JSON). + */ + data?: any; + + /**Returns the foreign key record object (JSON). + */ + foreignKeyData?: any; + + /**Returns the selected row index. + */ + selectedRow?: number; + + /**Returns selected row for delete. + */ + tr?: any; + + /**Returns current filtering column field name. + */ + currentFilteringColumn?: any; + + /**Returns filter details. + */ + filterCollection?: any; + + /**Returns type of the column like number, string and so on. + */ + columnType?: string; + + /**Returns the excel filter model. + */ + filtermodel?: any; + + /**Returns the dataSource. + */ + dataSource?: any; + + /**Returns the query manager. + */ + query?: any; + + /**Returns the customfilter option value. + */ + isCustomFilter?: boolean; +} + +export interface ActionCompleteEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the grid model. + */ + model?: any; + + /**Returns request type. + */ + requestType?: string; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the current selected page number. + */ + currentPage?: number; + + /**Returns the previous selected page number. + */ + previousPage?: number; + + /**Returns the end row index of that current page. + */ + endIndex?: number; + + /**Returns current action event type. + */ + originalEventType?: string; + + /**Returns the start row index of the current page. + */ + startIndex?: number; + + /**Returns grid element. + */ + target?: any; + + /**Returns the current sorted column field name. + */ + columnName?: string; + + /**Returns the column sort direction. + */ + columnSortDirection?: string; + + /**Returns current edited row. + */ + row?: any; + + /**Returns primary key. + */ + primaryKey?: string; + + /**Returns primary key value. + */ + primaryKeyValue?: string; + + /**Returns the edited row index. + */ + rowIndex?: number; + + /**Returns the record object (JSON). + */ + data?: any; + + /**Returns the selectedRow index. + */ + selectedRow?: number; + + /**Returns the foreign key record object (JSON). + */ + foreignKeyData?: any; + + /**Returns selected row for delete. + */ + tr?: any; + + /**Returns current filtering column field name. + */ + currentFilteringColumn?: string; + + /**Returns filter details. + */ + filterCollection?: any; + + /**Returns the dataSource. + */ + dataSource?: any; + + /**Returns the excel filter model. + */ + filtermodel?: any; + + /**Returns type of the column like number, string and so on. + */ + columnType?: string; + + /**Returns the customfilter option value. + */ + isCustomFilter?: boolean; +} + +export interface ActionFailureEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the grid model. + */ + model?: any; + + /**Returns request type. + */ + requestType?: string; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the error return by server. + */ + error?: any; + + /**Returns the current selected page number. + */ + currentPage?: number; + + /**Returns the previous selected page number. + */ + previousPage?: number; + + /**Returns the end row index of that current page. + */ + endIndex?: number; + + /**Returns current action event type. + */ + originalEventType?: string; + + /**Returns the start row index of the current page. + */ + startIndex?: number; + + /**Returns grid element. + */ + target?: any; + + /**Returns the current sorted column field name. + */ + columnName?: string; + + /**Returns the column sort direction. + */ + columnSortDirection?: string; + + /**Returns current edited row. + */ + row?: any; + + /**Returns primary key. + */ + primaryKey?: string; + + /**Returns primary key value. + */ + primaryKeyValue?: string; + + /**Returns the edited row index. + */ + rowIndex?: number; + + /**Returns the record object (JSON). + */ + data?: any; + + /**Returns the selectedRow index. + */ + selectedRow?: number; + + /**Returns the foreign key record object (JSON). + */ + foreignKeyData?: any; + + /**Returns selected row for delete. + */ + tr?: any; + + /**Returns current filtering column field name. + */ + currentFilteringColumn?: string; + + /**Returns filter details. + */ + filterCollection?: any; +} + +export interface BatchAddEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the grid model. + */ + model?: any; + + /**Returns deleted data. + */ + data?: any; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the column object. + */ + columnObject?: any; + + /**Returns the column index. + */ + columnIndex?: number; + + /**Returns the row element. + */ + row?: any; + + /**Returns the primaryKey. + */ + primaryKey?: any; + + /**Returns the cell object. + */ + cell?: any; +} + +export interface BatchDeleteEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the grid model. + */ + model?: any; + + /**Returns deleted data. + */ + data?: any; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the primary key. + */ + primaryKey?: any; + + /**Returns the row Index. + */ + rowIndex?: number; +} + +export interface BeforeBatchAddEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the grid model. + */ + model?: any; + + /**Returns deleted data. + */ + data?: any; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the default data object. + */ + defaultData?: any; + + /**Returns the primaryKey. + */ + primaryKey?: any; +} + +export interface BeforeBatchDeleteEventArgs { + + /**Returns the grid model. + */ + model?: any; + + /**Returns deleted data. + */ + data?: any; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the primaryKey. + */ + primaryKey?: any; + + /**Returns the row index. + */ + rowIndex?: number; + + /**Returns the row data. + */ + rowData?: any; + + /**Returns the row element. + */ + row?: any; +} + +export interface BeforeBatchSaveEventArgs { + + /**Returns the grid model. + */ + model?: any; + + /**Returns deleted data. + */ + data?: any; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the changed record object. + */ + batchChanges?: any; +} + +export interface BeginEditEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the current edited row. + */ + row?: any; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the primary key. + */ + primaryKey?: any; + + /**Returns the primary key value. + */ + primaryKeyValue?: any; + + /**Returns the edited row index. + */ + rowIndex?: number; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface CellEditEventArgs { + + /**Returns the grid model. + */ + model?: any; + + /**Returns deleted data. + */ + data?: any; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the validation rules. + */ + validationRules?: any; + + /**Returns the column name. + */ + columnName?: string; + + /**Returns the cell value. + */ + value?: string; + + /**Returns the row data object. + */ + rowData?: any; + + /**Returns the previous value of the cell. + */ + previousValue?: string; + + /**Returns the column object. + */ + columnObject?: any; + + /**Returns the cell object. + */ + cell?: any; + + /**Returns isForeignKey option value. + */ + isForeignKey?: boolean; +} + +export interface CellSaveEventArgs { + + /**Returns the grid model. + */ + model?: any; + + /**Returns deleted data. + */ + data?: any; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the column name. + */ + columnName?: string; + + /**Returns the cell value. + */ + value?: string; + + /**Returns the row data object. + */ + rowData?: any; + + /**Returns the previous value of the cell. + */ + previousValue?: string; + + /**Returns the column object. + */ + columnObject?: any; + + /**Returns the cell object. + */ + cell?: any; + + /**Returns isForeignKey option value. + */ + isForeignKey?: boolean; +} + +export interface CellSelectedEventArgs { + + /**Returns the selected cell index value. + */ + cellIndex?: number; + + /**Returns the previous selected cell index value. + */ + previousRowCellIndex?: number; + + /**Returns the selected cell element. + */ + currentCell?: any; + + /**Returns the previous selected cell element. + */ + previousRowCell?: any; + + /**Returns current record object (JSON). + */ + data?: any; + + /**Returns the selected row cell index values. + */ + selectedRowCellIndex?: Array; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface CellSelectingEventArgs { + + /**Returns the selected cell index value. + */ + cellIndex?: number; + + /**Returns the previous selected cell index value. + */ + previousRowCellIndex?: number; + + /**Returns the selected cell element. + */ + currentCell?: any; + + /**Returns the previous selected cell element. + */ + previousRowCell?: any; + + /**Returns current record object (JSON). + */ + data?: any; + + /**Returns whether the ctrl key is pressed while selecting cell + */ + isCtrlKeyPressed?: boolean; + + /**Returns whether the shift key is pressed while selecting cell + */ + isShiftKeyPressed?: boolean; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface ColumnDragEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns draggable element type. + */ + draggableType?: any; + + /**Returns the draggable column object. + */ + column?: any; + + /**Returns the grid model. + */ + model?: any; + + /**Returns target elements based on mouse move position. + */ + target?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface ColumnDragStartEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns draggable element type. + */ + draggableType?: any; + + /**Returns the draggable column object. + */ + column?: any; + + /**Returns the grid model. + */ + model?: any; + + /**Returns drag start element. + */ + target?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface ColumnDropEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns draggable element type. + */ + draggableType?: string; + + /**Returns the draggable column object. + */ + column?: any; + + /**Returns the grid model. + */ + model?: any; + + /**Returns dropped dragged element. + */ + target?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface ColumnSelectedEventArgs { + + /**Returns the selected cell index value. + */ + columnIndex?: number; + + /**Returns the previous selected column index value. + */ + previousColumnIndex?: number; + + /**Returns the selected header cell element. + */ + headerCell?: any; + + /**Returns the previous selected header cell element. + */ + prevColumnHeaderCell?: any; + + /**Returns corresponding column object (JSON). + */ + column?: any; + + /**Returns the selected columns values. + */ + selectedColumnsIndex?: Array; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface ColumnSelectingEventArgs { + + /**Returns the selected column index value. + */ + columnIndex?: number; + + /**Returns the previous selected column index value. + */ + previousColumnIndex?: number; + + /**Returns the selected header cell element. + */ + headerCell?: any; + + /**Returns the previous selected header cell element. + */ + prevColumnHeaderCell?: any; + + /**Returns corresponding column object (JSON). + */ + column?: any; + + /**Returns whether the ctrl key is pressed while selecting cell + */ + isCtrlKeyPressed?: boolean; + + /**Returns whether the shift key is pressed while selecting cell + */ + isShiftKeyPressed?: boolean; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface ContextClickEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the current item. + */ + currentTarget?: any; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the status of contextmenu item which denotes its enabled state + */ + status?: boolean; + + /**Returns the target item. + */ + target?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface ContextOpenEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the current item. + */ + currentTarget?: any; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the status of contextmenu item which denotes its enabled state + */ + status?: boolean; + + /**Returns the target item. + */ + target?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface CreateEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface DataBoundEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**Returns the grid model. + */ + model?: any; + + /**Returns deleted data. + */ + data?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface DetailsCollapseEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns detail row element. + */ + detailsRow?: any; + + /**Returns master row of detail row record object (JSON). + */ + masterData?: any; + + /**Returns the foreign key record object (JSON). + */ + foreignKeyData?: any; + + /**Returns master row element. + */ + masterRow?: any; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface DetailsDataBoundEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns details row element. + */ + detailsElement?: any; + + /**Returns the details row data. + */ + data?: any; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface DetailsExpandEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns detail row element. + */ + detailsRow?: any; + + /**Returns master row of detail row record object (JSON). + */ + masterData?: any; + + /**Returns the foreign key record object (JSON). + */ + foreignKeyData?: any; + + /**Returns master row element. + */ + masterRow?: any; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface EndAddEventArgs { + + /**Returns the grid model. + */ + model?: any; + + /**Returns added data. + */ + data?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface EndDeleteEventArgs { + + /**Returns the grid model. + */ + model?: any; + + /**Returns deleted data. + */ + data?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface EndEditEventArgs { + + /**Returns the grid model. + */ + model?: any; + + /**Returns modified data. + */ + data?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface LoadEventArgs { + + /**Returns the grid model. + */ + model?: any; + + /**Returns deleted data. + */ + data?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface MergeCellInfoEventArgs { + + /**Returns grid cell. + */ + cell?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns current row record object (JSON). + */ + data?: any; + + /**Returns the text value in the cell. + */ + text?: string; + + /**Returns the column object. + */ + column?: any; + + /**Method to merge Grid rows. + */ + rowMerge?: void; + + /**Method to merge Grid columns. + */ + colMerge?: void; + + /**Method to merge Grid rows and columns. + */ + merge?: void; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface QueryCellInfoEventArgs { + + /**Returns grid cell. + */ + cell?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns current row record object (JSON). + */ + data?: any; + + /**Returns the text value in the cell. + */ + text?: string; + + /**Returns the column object. + */ + column?: any; + + /**Returns the foreign key record object (JSON). + */ + foreignKeyData?: any; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface RecordClickEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns current record object (JSON). + */ + data?: any; + + /**Returns the row index of the selected row. + */ + rowIndex?: number; + + /**Returns the jquery object of the current selected row. + */ + row?: any; + + /**Returns the current selected cell. + */ + cell?: any; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the cell index value. + */ + cellIndex?: number; + + /**Returns the corresponding cell value. + */ + cellValue?: string; + + /**Returns the Header text of the column corresponding to the selected cell. + */ + columnName?: string; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface RecordDoubleClickEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns current record object (JSON). + */ + data?: any; + + /**Returns the row index of the selected row. + */ + rowIndex?: number; + + /**Returns the jquery object of the current selected row. + */ + row?: any; + + /**Returns the current selected cell. + */ + cell?: any; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the selected cell index value. + */ + cellIndex?: number; + + /**Returns the corresponding cell value. + */ + cellValue?: string; + + /**Returns the Header text of the column corresponding to the selected cell. + */ + columnName?: string; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface ResizedEventArgs { + + /**Returns the grid model. + */ + model?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns deleted data. + */ + data?: any; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the column index. + */ + columnIndex?: number; + + /**Returns the column object. + */ + column?: any; + + /**Returns the grid object. + */ + target?: any; + + /**Returns the old width value. + */ + oldWidth?: number; + + /**Returns the new width value. + */ + newWidth?: number; +} + +export interface ResizeEndEventArgs { + + /**Returns the grid model. + */ + model?: any; + + /**Returns deleted data. + */ + data?: any; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the column index. + */ + columnIndex?: number; + + /**Returns the column object. + */ + column?: any; + + /**Returns the grid object. + */ + target?: any; + + /**Returns the old width value. + */ + oldWidth?: number; + + /**Returns the new width value. + */ + newWidth?: number; + + /**Returns the extra width value. + */ + extra?: number; +} + +export interface ResizeStartEventArgs { + + /**Returns the grid model. + */ + model?: any; + + /**Returns deleted data. + */ + data?: any; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the column index. + */ + columnIndex?: number; + + /**Returns the column object. + */ + column?: any; + + /**Returns the grid object. + */ + target?: any; + + /**Returns the old width value. + */ + oldWidth?: number; +} + +export interface RightClickEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns current record object (JSON). + */ + currentData?: any; + + /**Returns the row index of the selected row. + */ + rowIndex?: number; + + /**Returns the current selected row. + */ + row?: any; + + /**Returns the selected row data object. + */ + data?: any; + + /**Returns the cell index of the selected cell. + */ + cellIndex?: number; + + /**Returns the cell value. + */ + cellValue?: string; + + /**Returns the cell object. + */ + cell?: any; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface RowDataBoundEventArgs { + + /**Returns grid row. + */ + row?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns current row record object (JSON). + */ + data?: any; + + /**Returns the foreign key record object (JSON). + */ + foreignKeyData?: any; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface RowSelectedEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns current record object (JSON). + */ + data?: any; + + /**Returns the foreign key record object (JSON). + */ + foreignKeyData?: any; + + /**Returns the row index of the selected row. + */ + rowIndex?: number; + + /**Returns the current selected row. + */ + row?: any; + + /**Returns the previous selected row element. + */ + prevRow?: any; + + /**Returns the previous selected row index. + */ + prevRowIndex?: number; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface RowSelectingEventArgs { + + /**Returns the selected row index value. + */ + rowIndex?: number; + + /**Returns the selected row element. + */ + row?: any; + + /**Returns the previous selected row element. + */ + prevRow?: any; + + /**Returns the previous selected row index. + */ + prevRowIndex?: number; + + /**Returns current record object (JSON). + */ + data?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface TemplateRefreshEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the cell object. + */ + cell?: any; + + /**Returns the column object. + */ + column?: any; + + /**Returns the current row data. + */ + data?: any; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the current row index. + */ + rowIndex?: number; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface ToolBarClickEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the current item. + */ + currentTarget?: any; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the status of toolbar item which denotes its enabled state + */ + status?: boolean; + + /**Returns the target item. + */ + target?: any; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the grid model. + */ + gridModel?: any; + + /**Returns the toolbar object of the selected toolbar element. + */ + toolbarData?: any; +} + +export interface ColumnsCommands { + + /**Gets or sets an object that indicates to define all the button options which are available in ejButton. + */ + buttonOptions?: any; + + /**Gets or sets a value that indicates to add the command column button. See unboundType + */ + type?: ej.Grid.UnboundType|string; +} + +export interface Columns { + + /**Gets or sets a value that indicates whether to enable editing behavior for particular column. + * @Default {true} + */ + allowEditing?: boolean; + + /**Gets or sets a value that indicates whether to enable dynamic filtering behavior for particular column. + * @Default {true} + */ + allowFiltering?: boolean; + + /**Gets or sets a value that indicates whether to enable dynamic grouping behavior for particular column. + * @Default {true} + */ + allowGrouping?: boolean; + + /**Gets or sets a value that indicates whether to enable dynamic sorting behavior for particular column. + * @Default {true} + */ + allowSorting?: boolean; + + /**Gets or sets a value that indicates whether to enable dynamic resizable for particular column. + * @Default {true} + */ + allowResizing?: boolean; + + /**Used to hide the particular column in column chooser by giving value as false. + * @Default {true} + */ + showInColumnChooser?: boolean; + + /**Gets or sets an object that indicates to define a command column in the grid. + * @Default {[]} + */ + commands?: Array; + + /**Gets or sets a value that indicates to provide custom css for an individual column. + */ + cssClass?: string; + + /**Gets or sets a value that indicates the attribute values to the td element of a particular column + */ + customAttributes?: any; + + /**Gets or sets a value that indicates to bind the external datasource to the particular column when columnEditType as "dropdownedit" and also it is used to bind the datasource to the foreign key column while editing the grid. //Where data is array of JSON objects of text and value for the drop-down and array of JSON objects for foreign key column. + * @Default {null} + */ + dataSource?: Array; + + /**Gets or sets a value that indicates to display the specified default value while adding a new record to the grid + */ + defaultValue?: string|number|boolean|Date; + + /**Gets or sets a value that indicates to render the grid content and header with an html elements + * @Default {false} + */ + disableHtmlEncode?: boolean; + + /**Gets or sets a value that indicates to display a column value as checkbox or string + * @Default {true} + */ + displayAsCheckBox?: boolean; + + /**Gets or sets a value that indicates to customize ejNumericTextbox of an editable column. See editingType + */ + editParams?: any; + + /**Gets or sets a template that displays a custom editor used to edit column values. See editTemplate + * @Default {null} + */ + editTemplate?: any; + + /**Gets or sets a value that indicates to render the element(based on edit type) for editing the grid record. See editingType + * @Default {ej.Grid.EditingType.String} + */ + editType?: ej.Grid.EditingType|string; + + /**Gets or sets a value that indicates to display the columns in the grid mapping with column name of the dataSource. + */ + field?: string; + + /**Gets or sets a value that indicates to define foreign key field name of the grid datasource. + * @Default {null} + */ + foreignKeyField?: string; + + /**Gets or sets a value that indicates to bind the field which is in foreign column datasource based on the foreignKeyField + * @Default {null} + */ + foreignKeyValue?: string; + + /**Gets or sets a value that indicates the format for the text applied on the column + */ + format?: string; + + /**Gets or sets a value that indicates to add the template within the header element of the particular column. + * @Default {null} + */ + headerTemplateID?: string; + + /**Gets or sets a value that indicates to display the title of that particular column. + */ + headerText?: string; + + /**This defines the text alignment of a particular column header cell value. See headerTextAlign + * @Default {ej.TextAlign.Left} + */ + headerTextAlign?: ej.TextAlign|string; + + /**You can use this property to freeze selected columns in grid at the time of scrolling. + * @Default {false} + */ + isFrozen?: boolean; + + /**Gets or sets a value that indicates the column has an identity in the database. + * @Default {false} + */ + isIdentity?: boolean; + + /**Gets or sets a value that indicates the column is act as a primary key(read-only) of the grid. The editing is performed based on the primary key column + * @Default {false} + */ + isPrimaryKey?: boolean; + + /**Gets or sets a value that indicates whether to bind the column which are not in the datasource + * @Default {false} + */ + isUnbound?: boolean; + + /**Gets or sets a value that indicates whether to enables column template for a particular column. + * @Default {false} + */ + template?: boolean|string; + + /**Gets or sets a value that indicates to add the template as a particular column data . + * @Default {null} + */ + templateID?: string; + + /**Gets or sets a value that indicates to align the text within the column. See textAlign + * @Default {ej.TextAlign.Left} + */ + textAlign?: ej.TextAlign|string; + + /**Sets the template for Tooltip in Grid Columns(both header and content) + */ + tooltip?: string; + + /**Sets the clip mode for Grid cell as ellipsis or clipped content(both header and content) + * @Default {ej.Grid.ClipMode.Clip} + */ + clipMode?: ej.Grid.ClipMode|string; + + /**Gets or sets a value that indicates to specify the data type of the specified columns. + */ + type?: string; + + /**Gets or sets a value that indicates to define constraints for saving data to the database. + */ + validationRules?: any; + + /**Gets or sets a value that indicates whether this column is visible in the grid. + * @Default {true} + */ + visible?: boolean; + + /**Gets or sets a value that indicates to define the width for a particular column in the grid. + */ + width?: number; +} + +export interface ContextMenuSettingsSubContextMenu { + + /**Used to get or set the corresponding custom context menu item to which the submenu to be appended. + * @Default {null} + */ + contextMenuItem?: string; + + /**Used to get or set the sub menu items to the custom context menu item. + * @Default {[]} + */ + subMenu?: Array; +} + +export interface ContextMenuSettings { + + /**Gets or sets a value that indicates whether to add the default context menu actions as a context menu items If enableContextMenu is true it will show all the items related to the target, if you want selected items from contextmenu you have to mention in the contextMenuItems + * @Default {[]} + */ + contextMenuItems?: Array; + + /**Gets or sets a value that indicates whether to add custom contextMenu items within the toolbar to perform any action in the grid + * @Default {[]} + */ + customContextMenuItems?: Array; + + /**Gets or sets a value that indicates whether to enable the context menu action in the grid. + * @Default {false} + */ + enableContextMenu?: boolean; + + /**Used to get or set the subMenu to the corresponding custom context menu item. + */ + subContextMenu?: Array; + + /**Gets or sets a value that indicates whether to disable the default context menu items in the grid. + * @Default {false} + */ + disabledefaultitems?: boolean; +} + +export interface EditSettings { + + /**Gets or sets a value that indicates whether to enable insert action in the editing mode. + * @Default {false} + */ + allowAdding?: boolean; + + /**Gets or sets a value that indicates whether to enable the delete action in the editing mode. + * @Default {false} + */ + allowDeleting?: boolean; + + /**Gets or sets a value that indicates whether to enable the edit action in the editing mode. + * @Default {false} + */ + allowEditing?: boolean; + + /**Gets or sets a value that indicates whether to enable the editing action while double click on the record + * @Default {true} + */ + allowEditOnDblClick?: boolean; + + /**This specifies the id of the template. This template can be used to display the data that you require to be edited using the Dialog Box + * @Default {null} + */ + dialogEditorTemplateID?: string; + + /**Gets or sets a value that indicates whether to define the mode of editing See editMode + * @Default {ej.Grid.EditMode.Normal} + */ + editMode?: ej.Grid.EditMode|string; + + /**This specifies the id of the template. This template can be used to display the data that you require to be edited using the External edit form + * @Default {null} + */ + externalFormTemplateID?: string; + + /**This specifies to set the position of an External edit form either in the top-right or bottom-left of the grid + * @Default {ej.Grid.FormPosition.BottomLeft} + */ + formPosition?: ej.Grid.FormPosition|string; + + /**This specifies the id of the template. This template can be used to display the data that you require to be edited using the Inline edit form + * @Default {null} + */ + inlineFormTemplateID?: string; + + /**This specifies to set the position of an adding new row either in the top or bottom of the grid + * @Default {ej.Grid.RowPosition.top} + */ + rowPosition?: ej.Grid.RowPosition|string; + + /**Gets or sets a value that indicates whether the confirm dialog has to be shown while saving or discarding the batch changes + * @Default {true} + */ + showConfirmDialog?: boolean; + + /**Gets or sets a value that indicates whether the confirm dialog has to be shown while deleting record + * @Default {false} + */ + showDeleteConfirmDialog?: boolean; + + /**Gets or sets a value that indicates whether the title for edit form is different from the primarykey column. + * @Default {null} + */ + titleColumn?: string; + + /**Gets or sets a value that indicates whether to display the add new form by default in the grid. + * @Default {false} + */ + showAddNewRow?: boolean; +} + +export interface FilterSettingsFilteredColumns { + + /**Gets or sets a value that indicates whether to define the field name of the column to be filter. + */ + field?: string; + + /**Gets or sets a value that indicates whether to define the filter condition to filtered column. + */ + operator?: ej.FilterOperators|string; + + /**Gets or sets a value that indicates whether to define the predicate as and/or. + */ + predicate?: string; + + /**Gets or sets a value that indicates whether to define the value to be filtered in a column. + */ + value?: string|number; +} + +export interface FilterSettings { + + /**Gets or sets a value that indicates to perform the filter operation with case sensitive in excel styled filter menu mode + * @Default {false} + */ + enableCaseSensitivity?: boolean; + + /**This specifies the grid to starts the filter action while typing in the filterBar or after pressing the enter key. based on the filterBarMode. See filterBarMode + * @Default {ej.Grid.FilterBarMode.Immediate} + */ + filterBarMode?: ej.Grid.FilterBarMode|string; + + /**Gets or sets a value that indicates whether to define the filtered columns details programmatically at initial load + * @Default {[]} + */ + filteredColumns?: Array; + + /**This specifies the grid to show the filterBar or filterMenu to the grid records. See filterType + * @Default {ej.Grid.FilterType.FilterBar} + */ + filterType?: ej.Grid.FilterType|string; + + /**Gets or sets a value that indicates the maximum number of filter choices that can be showed in the excel styled filter menu. + * @Default {1000} + */ + maxFilterChoices?: number; + + /**This specifies the grid to show the filter text within the grid pager itself. + * @Default {true} + */ + showFilterBarMessage?: boolean; + + /**Gets or sets a value that indicates whether to enable the predicate options in the filtering menu + * @Default {false} + */ + showPredicate?: boolean; +} + +export interface GroupSettings { + + /**Gets or sets a value that customize the group caption format. + * @Default {null} + */ + captionFormat?: string; + + /**Gets or sets a value that indicates whether to enable the animation effects to the group drop area + * @Default {true} + */ + enableDropAreaAnimation?: boolean; + + /**Gets or sets a value that indicates whether to enable animation button option in the group drop area of the grid. + * @Default {false} + */ + enableDropAreaAutoSizing?: boolean; + + /**Gets or sets a value that indicates whether to add grouped columns programmatically at initial load + * @Default {[]} + */ + groupedColumns?: Array; + + /**Gets or sets a value that indicates whether to show the group drop area just above the column header. It can be used to avoid ungrouping the already grouped column using groupsettings. + * @Default {true} + */ + showDropArea?: boolean; + + /**Gets or sets a value that indicates whether to hide the grouped columns from the grid + * @Default {false} + */ + showGroupedColumn?: boolean; + + /**Gets or sets a value that indicates whether to show the group button image(toggle button)in the column header and also in the grouped column in the group drop area . It can be used to group/ungroup the columns by click on the toggle button. + * @Default {false} + */ + showToggleButton?: boolean; + + /**Gets or sets a value that indicates whether to enable the close button in the grouped column which is in the group drop area to ungroup the grouped column + * @Default {false} + */ + showUngroupButton?: boolean; +} + +export interface TextWrapSettings { + + /**This specifies the grid to apply the auto wrap for grid content or header or both. + * @Default {ej.Grid.WrapMode.Both} + */ + wrapMode?: ej.Grid.WrapMode|string; +} + +export interface PageSettings { + + /**Gets or sets a value that indicates whether to define which page to display currently in the grid + * @Default {1} + */ + currentPage?: number; + + /**Gets or sets a value that indicates whether to pass the current page information as a query string along with the url while navigating to other page. + * @Default {false} + */ + enableQueryString?: boolean; + + /**Gets or sets a value that indicates whether to enables pager template for the grid. + * @Default {false} + */ + enableTemplates?: boolean; + + /**Gets or sets a value that indicates whether to define the number of pages displayed in the pager for navigation + * @Default {8} + */ + pageCount?: number; + + /**Gets or sets a value that indicates whether to define the number of records displayed per page + * @Default {12} + */ + pageSize?: number; + + /**Gets or sets a value that indicates whether to enables default pager for the grid. + * @Default {false} + */ + showDefaults?: boolean; + + /**Gets or sets a value that indicates to add the template as a pager template for grid. + * @Default {null} + */ + template?: string; + + /**Get the value of total number of pages in the grid. The totalPages value is calculated based on page size and total records of grid + * @Default {null} + */ + totalPages?: number; + + /**Get the value of total number of records which is bound to the grid. The totalRecordsCount value is calculated based on dataSource bound to the grid. + * @Default {null} + */ + totalRecordsCount?: number; + + /**Gets or sets a value that indicates whether to define the number of pages to print + * @Default {ej.Grid.PrintMode.AllPages} + */ + printMode?: ej.Grid.PrintMode|string; +} + +export interface ScrollSettings { + + /**This specify the grid to to view data that you require without buffering the entire load of a huge database + * @Default {false} + */ + allowVirtualScrolling?: boolean; + + /**This specify the grid to enable/disable touch control for scrolling. + * @Default {true} + */ + enableTouchScroll?: boolean; + + /**This specify the grid to freeze particular columns at the time of scrolling. + * @Default {0} + */ + frozenColumns?: number; + + /**This specify the grid to freeze particular rows at the time of scrolling. + * @Default {0} + */ + frozenRows?: number; + + /**This specify the grid to show the vertical scroll bar, to scroll and view the grid contents. + * @Default {0} + */ + height?: number; + + /**This is used to define the mode of virtual scrolling in grid. See virtualScrollMode + * @Default {ej.Grid.VirtualScrollMode.Normal} + */ + virtualScrollMode?: ej.Grid.VirtualScrollMode|string; + + /**This specify the grid to show the horizontal scroll bar, to scroll and view the grid contents + * @Default {250} + */ + width?: number; + + /**This specify the scroll down pixel of mouse wheel, to scroll mouse wheel and view the grid contents. + * @Default {57} + */ + scrollOneStepBy?: number; +} + +export interface SearchSettings { + + /**This specify the grid to search for the value in particular columns that is mentioned in the field. + * @Default {[]} + */ + field?: any; + + /**This specifies the grid to search the particular data that is mentioned in the key. + */ + key?: string; + + /**It specifies the grid to search the records based on operator. + * @Default {contains} + */ + operator?: string; + + /**It enables or disables case-sensitivity while searching the search key in grid. + * @Default {true} + */ + ignoreCase?: boolean; +} + +export interface SelectionSettings { + + /**Gets or sets a value that indicates whether to enable the toggle selction behavior for row, cell and column. + * @Default {false} + */ + enableToggle?: boolean; + + /**Gets or sets a value that indicates whether to add the default selection actions as a seleciton mode.See selectionMode + * @Default {[row]} + */ + selectionMode?: ej.Grid.SelectionMode|string; +} + +export interface SortSettingsSortedColumns { + + /**Gets or sets a value that indicates whether to define the direction to sort the column. + */ + direction?: string; + + /**Gets or sets a value that indicates whether to define the field name of the column to be sort + */ + field?: string; +} + +export interface SortSettings { + + /**Gets or sets a value that indicates whether to define the direction and field to sort the column. + */ + sortedColumns?: Array; +} + +export interface StackedHeaderRowsStackedHeaderColumns { + + /**Gets or sets a value that indicates the header text for the particular stacked header column. + * @Default {null} + */ + column?: string; + + /**Gets or sets a value that indicates class to the corresponding stackedHeaderColumn. + * @Default {null} + */ + cssClass?: string; + + /**Gets or sets a value that indicates the header text for the particular stacked header column. + * @Default {null} + */ + headerText?: string; + + /**Gets or sets a value that indicates the text alignment of the corresponding headerText. + * @Default {ej.TextAlign.Left} + */ + textAlign?: string; +} + +export interface StackedHeaderRows { + + /**Gets or sets a value that indicates whether to add stacked header columns into the stacked header rows + * @Default {[]} + */ + stackedHeaderColumns?: Array; +} + +export interface SummaryRowsSummaryColumns { + + /**Gets or sets a value that indicates the text displayed in the summary column as a value + * @Default {null} + */ + customSummaryValue?: string; + + /**This specifies summary column used to perform the summary calculation + * @Default {null} + */ + dataMember?: string; + + /**Gets or sets a value that indicates to define the target column at which to display the summary. + * @Default {null} + */ + displayColumn?: string; + + /**Gets or sets a value that indicates the format for the text applied on the column + * @Default {null} + */ + format?: string; + + /**Gets or sets a value that indicates the text displayed before the summary column value + * @Default {null} + */ + prefix?: string; + + /**Gets or sets a value that indicates the text displayed after the summary column value + * @Default {null} + */ + suffix?: string; + + /**Gets or sets a value that indicates the type of calculations to be performed for the corresponding summary column + * @Default {[]} + */ + summaryType?: ej.Grid.SummaryType|string; + + /**Gets or sets a value that indicates to add the template for the summary value of dataMember given. + * @Default {null} + */ + template?: string; +} + +export interface SummaryRows { + + /**Gets or sets a value that indicates whether to show the summary value within the group caption area for the corresponding summary column while grouping the column + * @Default {false} + */ + showCaptionSummary?: boolean; + + /**Gets or sets a value that indicates whether to show the group summary value for the corresponding summary column while grouping a column + * @Default {false} + */ + showGroupSummary?: boolean; + + /**Gets or sets a value that indicates whether to show the total summary value the for the corresponding summary column. The summary row is added after the grid content. + * @Default {true} + */ + showTotalSummary?: boolean; + + /**Gets or sets a value that indicates whether to add summary columns into the summary rows. + * @Default {[]} + */ + summaryColumns?: Array; + + /**This specifies the grid to show the title for the summary rows. + */ + title?: string; + + /**This specifies the grid to show the title of summary row in the specified column. + * @Default {null} + */ + titleColumn?: string; +} + +export interface ToolbarSettings { + + /**Gets or sets a value that indicates whether to add custom toolbar items within the toolbar to perform any action in the grid + * @Default {[]} + */ + customToolbarItems?: Array; + + /**Gets or sets a value that indicates whether to enable toolbar in the grid. + * @Default {false} + */ + showToolbar?: boolean; + + /**Gets or sets a value that indicates whether to add the default editing actions as a toolbar items + * @Default {[]} + */ + toolbarItems?: ej.Grid.ToolBarItems|string; +} + +enum GridLines{ + + ///Displays both the horizontal and vertical grid lines. + Both, + + ///Displays the horizontal grid lines only. + Horizontal, + + ///Displays the vertical grid lines only. + Vertical, + + ///No grid lines are displayed. + None +} + + +enum ColumnLayout{ + + ///Column layout is auto(based on width). + Auto, + + ///Column layout is fixed(based on width). + Fixed +} + + +enum UnboundType{ + + ///Unbound type is edit. + Edit, + + ///Unbound type is save. + Save, + + ///Unbound type is delete. + Delete, + + ///Unbound type is cancel. + Cancel +} + + +enum EditingType{ + + ///Specifies editing type as string edit. + String, + + ///Specifies editing type as boolean edit. + Boolean, + + ///Specifies editing type as numeric edit. + Numeric, + + ///Specifies editing type as dropdown edit. + Dropdown, + + ///Specifies editing type as datepicker. + DatePicker, + + ///Specifies editing type as datetime picker. + DateTimePicker +} + + +enum ClipMode{ + + ///Shows ellipsis for the overflown cell. + Ellipsis, + + ///Truncate the text in the cell + Clip, + + ///Shows ellipsis and tooltip for the overflown cell. + EllipsisWithTooltip +} + + +enum EditMode{ + + ///Edit mode is normal. + Normal, + + ///Truncate the text in the cell + Clip, + + ///Edit mode is dialog. + Dialog, + + ///Edit mode is dialog template. + DialogTemplate, + + ///Edit mode is batch. + Batch, + + ///Edit mode is inline form. + InlineForm, + + ///Edit mode is inline template form. + InlineTemplateForm, + + ///Edit mode is external form. + ExternalForm, + + ///Edit mode is external form template. + ExternalFormTemplate +} + + +enum FormPosition{ + + ///Form position is bottomleft. + BottomLeft, + + ///Form position is topright. + TopRight +} + + +enum RowPosition{ + + ///Specifies position of add new row as top. + Top, + + ///Specifies position of add new row as bottom. + Bottom +} + + +enum FilterBarMode{ + + ///Initiate filter operation on typing the filter query. + Immediate, + + ///Initiate filter operation after Enter key is pressed. + OnEnter +} + + +enum FilterType{ + + ///Specifies the filter type as menu. + Menu, + + ///Specifies the filter type as excel. + Excel, + + ///Specifies the filter type as filterbar. + FilterBar +} + + +enum WrapMode{ + + ///Auto wrap is applied for both content and header. + Both, + + ///Auto wrap is applied only for content. + Content, + + ///Auto wrap is applied only for header. + Header +} + + +enum PrintMode{ + + ///Prints all pages. + AllPages, + + ///Prints curren tpage. + CurrentPage +} + + +enum VirtualScrollMode{ + + ///virtual scroll mode is normal. + Normal, + + ///virtual scroll mode is continuous. + Continuous +} + + +enum SelectionMode{ + + ///Selection is row basis. + Row, + + ///Selection is cell basis. + Cell, + + ///Selection is column basis. + Column +} + + +enum SelectionType{ + + ///Specifies the selection type as single. + Single, + + ///Specifies the selection type as multiple. + Multiple +} + + +enum SummaryType{ + + ///Summary type is average. + Average, + + ///Summary type is minimum. + Minimum, + + ///Summary type is maximum. + Maximum, + + ///Summary type is count. + Count, + + ///Summary type is sum. + Sum, + + ///Summary type is custom. + Custom, + + ///Summary type is true count. + TrueCount, + + ///Summary type is false count. + FalseCount +} + + +enum ToolBarItems{ + + ///Toolbar item is add. + Add, + + ///Toolbar item is edit. + Edit, + + ///Toolbar item is delete. + Delete, + + ///Toolbar item is update. + Update, + + ///Toolbar item is cancel. + Cancel, + + ///Toolbar item is search. + Search, + + ///Toolbar item is pdfExport. + PdfExport, + + ///Toolbar item is printGrid. + PrintGrid, + + ///Toolbar item is wordExport. + WordExport +} + +} + +class PivotGrid extends ej.Widget { + static fn: PivotGrid; + constructor(element: JQuery, options?: PivotGrid.Model); + constructor(element: Element, options?: PivotGrid.Model); + model:PivotGrid.Model; + defaults:PivotGrid.Model; + + /** Perform an asynchronous HTTP (AJAX) request. + * @returns {void} + */ + doAjaxPost(): void; + + /** Perform an asynchronous HTTP (FullPost) submit. + * @returns {void} + */ + doPostBack(): void; + + /** Exports the PivotGrid to an appropriate format based on the parameter passed. + * @returns {void} + */ + exportPivotGrid(): void; + + /** This function re-renders the PivotGrid on clicking the navigation buttons on PivotPager. + * @returns {void} + */ + refreshPagedPivotGrid(): void; + + /** This function receives the JSON formatted datasource to render the PivotGrid control. + * @returns {void} + */ + renderControlFromJSON(): void; +} +export module PivotGrid{ + +export interface Model { + + /**Sets the mode for the PivotGrid widget for binding either OLAP or relational data source. + * @Default {ej.PivotGrid.AnalysisMode.Olap} + */ + analysisMode?: any; + + /**Specifies the CSS class to PivotGrid to achieve custom theme. + * @Default {“”} + */ + cssClass?: string; + + /**Contains the serialized OlapReport at that instant. + * @Default {“”} + */ + currentReport?: string; + + /**Initializes the data source for the PivotGrid widget, when it functions completely on client-side. + * @Default {{}} + */ + dataSource?: DataSource; + + /**Used to bind the drilled members by default through report. + * @Default {[]} + */ + drilledItems?: Array; + + /**Object utilized to pass additional information between client-end and service-end. + * @Default {null} + */ + customObject?: any; + + /**Allows the user to access each cell on right-click. + * @Default {false} + */ + enableCellContext?: boolean; + + /**Enables the cell selection for a specified range of value cells. + * @Default {false} + */ + enableCellSelection?: boolean; + + /**Collapses the Pivot Items along rows and columns by default. It works only for relational data source. + * @Default {false} + */ + enableCollapseByDefault?: boolean; + + /**Enables the display of grand total for all the columns. + * @Default {true} + */ + enableColumnGrandTotal?: boolean; + + /**Allows the user to format a specific set of cells based on the condition. + * @Default {false} + */ + enableConditionalFormatting?: boolean; + + /**Allows the user to refresh the control on-demand and not during every UI operation. + * @Default {false} + */ + enableDeferUpdate?: boolean; + + /**Enables the display of GroupingBar allowing you to filter, sort and remove fields obtained from relational datasource. + * @Default {false} + */ + enableGroupingBar?: boolean; + + /**Enables the display of grand total for rows and columns. + * @Default {true} + */ + enableGrandTotal?: boolean; + + /**Allows the user to load PivotGrid using JSON data. + * @Default {false} + */ + enableJSONRendering?: boolean; + + /**Enables rendering of PivotGrid widget along with the PivotTable Field List, which allows UI operation. + * @Default {true} + */ + enablePivotFieldList?: boolean; + + /**Enables the display of grand total for all the rows. + * @Default {true} + */ + enableRowGrandTotal?: boolean; + + /**Allows the user to view PivotGrid from right to left. + * @Default {false} + */ + enableRTL?: boolean; + + /**Allows the user to enable ToolTip option. + * @Default {false} + */ + enableToolTip?: boolean; + + /**Allows the user to view large amount of data through virtual scrolling. + * @Default {false} + */ + enableVirtualScrolling?: boolean; + + /**Allows the user to configure hyperlink settings of PivotGrid control. + * @Default {{}} + */ + hyperlinkSettings?: HyperlinkSettings; + + /**This is used for identifying whether the member is Named Set or not. + * @Default {false} + */ + isNamedSets?: boolean; + + /**Allows the user to enable PivotGrid’s responsiveness in the browser layout. + * @Default {false} + */ + isResponsive?: boolean; + + /**Contains the serialized JSON string which renders PivotGrid. + * @Default {“”} + */ + jsonRecords?: string; + + /**Sets the summary layout for PivotGrid. Following are the ways in which summary can be positioned: normal summary (bottom), top summary, no summary and excel-like summary. + * @Default {ej.PivotGrid.Layout.Normal} + */ + layout?: ej.PivotGrid.Layout|string; + + /**Allows the user to set the localized language for the widget. + * @Default {en-US} + */ + locale?: string; + + /**Sets the mode for the PivotGrid widget for binding data source either in server-side or client-side. + * @Default {ej.PivotGrid.OperationalMode.ClientMode} + */ + operationalMode?: any; + + /**Allows the user to set custom name for the methods at service-end, communicated during AJAX post. + * @Default {{}} + */ + serviceMethodSettings?: ServiceMethodSettings; + + /**Connects the service using the specified URL for any server updates. + * @Default {“”} + */ + url?: string; + + /**Triggers when it reaches client-side after any AJAX request.*/ + afterServiceInvoke? (e: AfterServiceInvokeEventArgs): void; + + /**Triggers before any AJAX request is passed from PivotGrid to service methods.*/ + beforeServiceInvoke? (e: BeforeServiceInvokeEventArgs): void; + + /**Triggers when right-click action is performed on a cell.*/ + cellContext? (e: CellContextEventArgs): void; + + /**Triggers when a specific range of value cells are selected.*/ + cellSelection? (e: CellSelectionEventArgs): void; + + /**Triggers when the hyperlink of column header is clicked.*/ + columnHeaderHyperlinkClick? (e: ColumnHeaderHyperlinkClickEventArgs): void; + + /**Triggers after performing drill operation in PivotGrid.*/ + drillSuccess? (e: DrillSuccessEventArgs): void; + + /**Triggers when PivotGrid loading is initiated.*/ + load? (e: LoadEventArgs): void; + + /**Triggers when PivotGrid widget completes all operations at client-side after any AJAX request.*/ + renderComplete? (e: RenderCompleteEventArgs): void; + + /**Triggers when any error occurred during AJAX request.*/ + renderFailure? (e: RenderFailureEventArgs): void; + + /**Triggers when PivotGrid successfully reaches client-side after any AJAX request.*/ + renderSuccess? (e: RenderSuccessEventArgs): void; + + /**Triggers when the hyperlink of row header is clicked.*/ + rowHeaderHyperlinkClick? (e: RowHeaderHyperlinkClickEventArgs): void; + + /**Triggers when the hyperlink of summary cell is clicked.*/ + summaryCellHyperlinkClick? (e: SummaryCellHyperlinkClickEventArgs): void; + + /**Triggers when the hyperlink of value cell is clicked.*/ + valueCellHyperlinkClick? (e: ValueCellHyperlinkClickEventArgs): void; +} + +export interface AfterServiceInvokeEventArgs { + + /**return the current action of PivotGrid control. + */ + action?: string; + + /**return the custom object bounds with PivotGrid control. + */ + customObject?: any; + + /**return the outer HTML of PivotGrid control. + */ + element?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the PivotGrid model + */ + model?: ej.PivotGrid.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface BeforeServiceInvokeEventArgs { + + /**return the current action of PivotGrid control. + */ + action?: string; + + /**return the custom object bounds with PivotGrid control. + */ + customObject?: any; + + /**return the outer HTML of PivotGrid control. + */ + element?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the PivotGrid model + */ + model?: ej.PivotGrid.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface CellContextEventArgs { + + /**returns the original event args. + */ + args?: any; + + /**returns the cell position (row index and column index) in table. + */ + cellPosition?: string; + + /**returns the type of the cell. + */ + cellType?: string; + + /**returns the serialized data of the header cells. + */ + rowData?: string; + + /**returns the unique name of levels/members. + */ + uniqueName?: string; +} + +export interface CellSelectionEventArgs { + + /**returns the original event args. + */ + args?: any; + + /**Returns the selected cell values. + */ + cellvalue?: any; + + /**Returns the selected value cells row headers. + */ + rowheaders?: any; + + /**Returns the selected value cells column headers. + */ + colheaders?: any; + + /**Returns the selected value cells measure. + */ + measure?: any; + + /**Return the row and column measure count. + */ + measureValue?: any; +} + +export interface ColumnHeaderHyperlinkClickEventArgs { + + /**returns the original event args. + */ + args?: any; + + /**returns the cell position (row index and column index) in table. + */ + cellPosition?: string; + + /**returns the type of the cell. + */ + cellType?: string; + + /**returns the serialized data of the header cells. + */ + rowData?: string; + + /**returns the unique name of levels/members. + */ + uniqueName?: string; +} + +export interface DrillSuccessEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the PivotGrid model + */ + model?: ej.PivotGrid.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface LoadEventArgs { + + /**returns the original event args. + */ + args?: any; + + /**returns the current action of PivotGrid control. + */ + action?: string; + + /**returns the custom object bounded with the control. + */ + customObject?: any; + + /**returns the HTML of PivotGrid control. + */ + element?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the PivotGrid model. + */ + model?: ej.PivotGrid.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface RenderCompleteEventArgs { + + /**returns the original event args. + */ + args?: any; + + /**returns the current action of PivotGrid control. + */ + action?: string; + + /**returns the custom object bounded with the control. + */ + customObject?: any; + + /**returns the HTML of PivotGrid control. + */ + element?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the PivotGrid model. + */ + model?: ej.PivotGrid.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface RenderFailureEventArgs { + + /**returns the original event args. + */ + args?: any; + + /**returns the current action of PivotGrid control. + */ + action?: string; + + /**returns the custom object bounded with the control. + */ + customObject?: any; + + /**returns the HTML of PivotGrid control. + */ + element?: string; + + /**returns the error message with error code. + */ + message?: any; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the PivotGrid model. + */ + model?: ej.PivotGrid.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface RenderSuccessEventArgs { + + /**returns the original event args. + */ + args?: any; + + /**returns the current action of PivotGrid control. + */ + action?: string; + + /**returns the custom object bounded with the control. + */ + customObject?: any; + + /**returns the HTML of PivotGrid control. + */ + element?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the PivotGrid model. + */ + model?: ej.PivotGrid.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface RowHeaderHyperlinkClickEventArgs { + + /**returns the original event args. + */ + args?: any; + + /**returns the cell position (row index and column index) in table. + */ + cellPosition?: string; + + /**returns the type of the cell. + */ + cellType?: string; + + /**returns the serialized data of the header cells. + */ + rowData?: string; + + /**returns the unique name of levels/members. + */ + uniqueName?: string; +} + +export interface SummaryCellHyperlinkClickEventArgs { + + /**returns the original event args. + */ + args?: any; + + /**returns the cell position (row index and column index) in table. + */ + cellPosition?: string; + + /**returns the type of the cell. + */ + cellType?: string; + + /**returns the serialized data of the header cells. + */ + rowData?: string; + + /**returns the unique name of levels/members. + */ + uniqueName?: string; +} + +export interface ValueCellHyperlinkClickEventArgs { + + /**returns the original event args. + */ + args?: any; + + /**returns the cell position (row index and column index) in table. + */ + cellPosition?: string; + + /**returns the type of the cell. + */ + cellType?: string; + + /**returns the serialized data of the header cells. + */ + rowData?: string; + + /**returns the unique name of levels/members. + */ + uniqueName?: string; +} + +export interface DataSourceValues { + + /**This holds the measures unique names to bind the measures from Cube. + * @Default {[]} + */ + measures?: Array; + + /**To set the axis name in-order to place the measures. + * @Default {“”} + */ + axis?: string; +} + +export interface DataSource { + + /**Contains the database name as string type to fetch the data from the given connection string. + * @Default {“”} + */ + catalog?: string; + + /**Lists out the items to be arranged in column section of PivotGrid. + * @Default {[]} + */ + columns?: Array; + + /**Contains the respective Cube name as string type. + * @Default {“”} + */ + cube?: string; + + /**Provides the raw data source for the PivotGrid. + * @Default {null} + */ + data?: any; + + /**Lists out the items to be arranged in row section of PivotGrid. + * @Default {[]} + */ + rows?: Array; + + /**Lists out the items which supports calculation in PivotGrid. + * @Default {[]} + */ + values?: Array; + + /**Lists out the items which supports filtering of values in PivotGrid. + * @Default {[]} + */ + filters?: Array; +} + +export interface HyperlinkSettings { + + /**Allows the user to enable/disable hyperlink for column header. + * @Default {false} + */ + enableColumnHeaderHyperlink?: boolean; + + /**Allows the user to enable/disable hyperlink for row header. + * @Default {false} + */ + enableRowHeaderHyperlink?: boolean; + + /**Allows the user to enable/disable hyperlink for summary cells. + * @Default {false} + */ + enableSummaryCellHyperlink?: boolean; + + /**Allows the user to enable/disable hyperlink for value cells. + * @Default {false} + */ + enableValueCellHyperlink?: boolean; +} + +export interface ServiceMethodSettings { + + /**Allows the user to set the custom name for the service method that's responsible for drill up/down operation in PivotGrid. + * @Default {DrillGrid} + */ + drillDown?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for exporting. + * @Default {Export} + */ + exportPivotGrid?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for performing server-side actions on defer update. + * @Default {DeferUpdate} + */ + deferUpdate?: string; + + /**Allows the user to set the custom name for the service method that’s responsible to getting the values for the tree-view inside filter dialog. + * @Default {FetchMembers} + */ + fetchMembers?: string; + + /**Allows the user to set the custom name for the service method that's responsible for filtering operation in PivotGrid. + * @Default {Filtering} + */ + filtering?: string; + + /**Allows the user to set the custom name for the service method that's responsible for initializing PivotGrid. + * @Default {InitializeGrid} + */ + initialize?: string; + + /**Allows the user to set the custom name for the service method that's responsible for the server-side action, on dropping a node into Field List. + * @Default {NodeDropped} + */ + nodeDropped?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for the server-side action on changing the checked state of a node in Field List. + * @Default {NodeStateModified} + */ + nodeStateModified?: string; + + /**Allows the user to set the custom name for the service method that's responsible for performing paging operation in PivotGrid. + * @Default {Paging} + */ + paging?: string; + + /**Allows the user to set the custom name for the service method that's responsible for sorting operation in PivotGrid. + * @Default {Sorting} + */ + sorting?: string; +} + +enum Layout{ + + ///To set normal summary layout in PivotGrid. + Normal, + + ///To set layout with summaries at the top in PivotGrid. + NormalTopSummary, + + ///To set layout without summaries in PivotGrid. + NoSummaries, + + ///To set excel-like layout in PivotGrid. + ExcelLikeLayout +} + +} + +class PivotSchemaDesigner extends ej.Widget { + static fn: PivotSchemaDesigner; + constructor(element: JQuery, options?: PivotSchemaDesigner.Model); + constructor(element: Element, options?: PivotSchemaDesigner.Model); + model:PivotSchemaDesigner.Model; + defaults:PivotSchemaDesigner.Model; + + /** Perform an asynchronous HTTP (AJAX) request. + * @returns {void} + */ + doAjaxPost(): void; +} +export module PivotSchemaDesigner{ + +export interface Model { + + /**Specifies the CSS class to PivotSchemaDesigner to achieve custom theme. + * @Default {“”} + */ + cssClass?: string; + + /**Object utilized to pass additional information between client-end and service-end. + * @Default {{}} + */ + customObject?: any; + + /**For ASP.NET and MVC Wrapper, Pivots Schema Designer will be initialized and rendered empty initially. Once PivotGrid widget is rendered completely, Pivots Schema Designer will just be populated with data source by setting this property to “true”. + * @Default {false} + */ + enableWrapper?: boolean; + + /**Allows the user to set the list of filters in filter section. + * @Default {newArray()} + */ + filters?: Array; + + /**Sets the height for PivotSchemaDesigner. + * @Default {“”} + */ + height?: string; + + /**Allows the user to set the localized language for the widget. + * @Default {en-US} + */ + locale?: string; + + /**Allows the user to set list of PivotCalculations in values section. + * @Default {newArray()} + */ + pivotCalculations?: Array; + + /**Allows the user to set the list of PivotItems in column section. + * @Default {newArray()} + */ + pivotColumns?: Array; + + /**Sets the Pivot control bound with this PivotSchemaDesigner. + * @Default {null} + */ + pivotControl?: any; + + /**Allows the user to set the list of PivotItems in row section. + * @Default {newArray()} + */ + pivotRows?: Array; + + /**Allows the user to arrange the fields inside Field List of PivotSchemaDesigner. + * @Default {newArray()} + */ + pivotTableFields?: Array; + + /**Allows the user to set custom name for the methods at service-end, communicated during AJAX post. + * @Default {{}} + */ + serviceMethod?: ServiceMethod; + + /**Connects the service using the specified URL for any server updates. + * @Default {“”} + */ + url?: string; + + /**Sets the width for PivotSchemaDesigner. + * @Default {“”} + */ + width?: string; + + /**Triggers when it reaches client-side after any AJAX request.*/ + afterServiceInvoke? (e: AfterServiceInvokeEventArgs): void; + + /**Triggers before any AJAX request is passed from PivotSchemaDesigner to service methods.*/ + beforeServiceInvoke? (e: BeforeServiceInvokeEventArgs): void; +} + +export interface AfterServiceInvokeEventArgs { + + /**return the current action of PivotSchemaDesigner control. + */ + action?: string; + + /**return the custom object bounds with PivotSchemaDesigner control. + */ + customObject?: any; + + /**return the outer HTML of PivotSchemaDesigner control. + */ + element?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the PivotSchemaDesigner model + */ + model?: ej.PivotSchemaDesigner.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface BeforeServiceInvokeEventArgs { + + /**return the current action of PivotSchemaDesigner control. + */ + action?: string; + + /**return the custom object bounds with PivotSchemaDesigner control. + */ + customObject?: any; + + /**return the outer HTML of PivotSchemaDesigner control. + */ + element?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the PivotSchemaDesigner model + */ + model?: ej.PivotSchemaDesigner.Model; + + /**returns the name of the event + */ + type?: string; +} + +export interface ServiceMethod { + + /**Allows the user to set the custom name for the service method that’s responsible for getting the values for the tree-view inside filter dialog. + * @Default {FetchMembers} + */ + fetchMembers?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for filtering operation in Field List. + * @Default {Filtering} + */ + filtering?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for the server-side action, on expanding members in Field List. + * @Default {MemberExpanded} + */ + memberExpand?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for the server-side action, on dropping a node into Field List. + * @Default {NodeDropped} + */ + nodeDropped?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for the server-side action on changing the checked state of a node in Field List. + * @Default {NodeStateModified} + */ + nodeStateModified?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for remove operation in Field List. + * @Default {RemoveButton} + */ + removeButton?: string; +} +} + +class PivotPager extends ej.Widget { + static fn: PivotPager; + constructor(element: JQuery, options?: PivotPager.Model); + constructor(element: Element, options?: PivotPager.Model); + model:PivotPager.Model; + defaults:PivotPager.Model; + + /** This function initializes the page counts and page numbers for the PivotPager. + * @returns {void} + */ + initPagerProperties(): void; +} +export module PivotPager{ + +export interface Model { + + /**Contains the current page number in categorical axis. + * @Default {1} + */ + categoricalCurrentPage?: number; + + /**Contains the total page count in categorical axis. + * @Default {1} + */ + categoricalPageCount?: number; + + /**Allows the user to set the localized language for the widget. + * @Default {en-US} + */ + locale?: string; + + /**Sets the pager mode (Only Categorical Pager/Only Series Pager/Both) for the PivotPager. + * @Default {ej.PivotPager.Mode.Both} + */ + mode?: ej.PivotPager.Mode|string; + + /**Contains the current page number in series axis. + * @Default {1} + */ + seriesCurrentPage?: number; + + /**Contains the total page count in series axis. + * @Default {1} + */ + seriesPageCount?: number; + + /**Contains the ID of the target element for which paging needs to be done. + * @Default {“”} + */ + targetControlID?: string; +} + +enum Mode{ + + ///To set both categorical and series pager for paging. + Both, + + ///To set only categorical pager for paging. + Categorical, + + ///To set only series pager for paging. + Series +} + +} + +class Schedule extends ej.Widget { + static fn: Schedule; + constructor(element: JQuery, options?: Schedule.Model); + constructor(element: Element, options?: Schedule.Model); + model:Schedule.Model; + defaults:Schedule.Model; + + /** This method is used to delete the appointment based on the guid value or the appointment data passed to it. + * @param {string|any} GUID value of an appointment element or an appointment object + * @returns {void} + */ + deleteAppointment(data: string|any): void; + + /** Destroys the Schedule widget. All the events bound using this._on are unbound automatically and the control is moved to pre-init state. + * @returns {void} + */ + destroy(): void; + + /** Exports the appointments from the Schedule control. + * @param {string} It refers the controller action name to redirect. (For MVC) + * @param {string} It refers the server event name.(For ASP) + * @param {string|number} Pass the id of an appointment, in case if a single appointment needs to be exported. Otherwise, it takes the null value. + * @returns {void} + */ + exportSchedule(action: string, serverEvent: string, id: string|number): void; + + /** Searches the appointments from appointment list of Schedule control. + * @param {Array} Holds array of one or more conditional objects for filtering the appointments based on it. + * @returns {void} + */ + filterAppointments(filterConditions: Array): void; + + /** Gets the appointment list of Schedule control. + * @returns {void} + */ + getAppointments(): void; + + /** Prints the Scheduler. + * @returns {void} + */ + print(): void; + + /** Refreshes the Scroller within Scheduler while using it with some other controls or application. + * @returns {void} + */ + refreshScroller(): void; + + /** It is used to save the appointment. The appointment obj is based on the argument passed along with this method. + * @param {any} appointment object which includes appointment details + * @returns {void} + */ + saveAppointment(appointmentObject: any): void; + + /** Retrieves the time slot information (start/end time and resource details) of the given element. The parameter is optional - as when no element is passed to it, the currently selected cell information will be retrieved. When multiple cells are selected in the Scheduler, it is not necessary to provide the parameter. + * @param {any} TD element object rendered as Scheduler work cell + * @returns {void} + */ + getSlotByElement(element: any): void; + + /** Searches the appointments from the appointment list of Schedule control. + * @param {any|string} Defines the search word or the filter condition, based on which the appointments are filtered from the list. + * @param {string} Defines the field name on which the search is to be made. + * @param {string|string} Defines the filterOperator value for the search operation. + * @param {boolean} Defines the ignoreCase value for performing the search operation. + * @returns {void} + */ + searchAppointments(searchString: any|string, field: string, operator: string|string, ignoreCase: boolean): void; + + /** To refresh the Schedule control. + * @returns {void} + */ + refresh(): void; + + /** Refreshes only the appointments within the Schedule control. + * @returns {void} + */ + refreshAppointment(): void; +} +export module Schedule{ + +export interface Model { + + /**When set to true, Schedule allows the appointments to be dragged and dropped at required time. + * @Default {true} + */ + allowDragAndDrop?: boolean; + + /**When set to true, Scheduler allows interaction through keyboard shortcut keys. + * @Default {true} + */ + allowKeyboardNavigation?: boolean; + + /**It includes the dataSource option and the fields related to Schedule appointments. The appointment fields within the appointmentSettings can accept both string and object type values. To apply validation rules on the appointment window fields, then the appointment fields needs to be defined with object type values. + */ + appointmentSettings?: AppointmentSettings; + + /**Default Value + * @Default {null} + */ + appointmentTemplateId?: string; + + /**Default Value + */ + cssClass?: string; + + /**Sets various categorize colors to the Schedule appointments to differentiate it. + */ + categorizeSettings?: CategorizeSettings; + + /**Sets the height for Schedule cells. + * @Default {20px} + */ + cellHeight?: string; + + /**Sets the width for Schedule cells. + */ + cellWidth?: string; + + /**Holds all options related to the context menu settings of the Schedule. + */ + contextMenuSettings?: ContextMenuSettings; + + /**Sets current date of the Schedule. The Schedule displays initially with the date that is provided here. + * @Default {new Date()} + */ + currentDate?: any; + + /**Sets current view of the Schedule. Schedule renders initially with the view that is specified here. The available views are day, week, workweek, month, agenda and custom view - from which any one of the required view can be set to the Schedule. It accepts both string or enum values. The enum values that are accepted by currentView(ej.Schedule.CurrentView) are as follows, + * @Default {ej.Schedule.CurrentView.Week} + */ + currentView?: string|ej.Schedule.CurrentView; + + /**Sets the date format for Schedule. + */ + dateFormat?: string; + + /**When set to true, shows the previous/next appointment navigator button on the Scheduler. + * @Default {true} + */ + showAppointmentNavigator?: boolean; + + /**When set to true, enables the resize behavior of appointments within the Schedule. + * @Default {true} + */ + enableAppointmentResize?: boolean; + + /**When set to true, enables the loading of Schedule appointments based on your demand. With this load on demand concept, the data consumption of the Schedule can be limited. + * @Default {false} + */ + enableLoadOnDemand?: boolean; + + /**Saves the current model value to browser cookies for state maintenance. When the page gets refreshed, Schedule control values are retained. + * @Default {false} + */ + enablePersistence?: boolean; + + /**When set to true, the Schedule layout and behavior changes as per the common RTL conventions. + * @Default {false} + */ + enableRTL?: boolean; + + /**Sets the end hour time limit to be displayed on the Schedule. + * @Default {24} + */ + endHour?: number; + + /**To configure resource grouping on the Schedule. + */ + group?: Group; + + /**Sets the height of the Schedule. Accepts both pixel and percentage values. + * @Default {1120px} + */ + height?: string; + + /**To define the work hours within the Schedule control. + */ + workHours?: WorkHours; + + /**When set to true, enables the Schedule to observe Daylight Saving Time for supported timezones. + * @Default {false} + */ + isDST?: boolean; + + /**When set to true, adapts the Schedule layout to fit the screen size of devices on which it renders. + * @Default {true} + */ + isResponsive?: boolean; + + /**Sets the specific culture to the Schedule. + * @Default {en-US} + */ + locale?: string; + + /**Sets the maximum date limit to display on the Schedule. Setting maxDate with specific date value disallows the Schedule to navigate beyond that date. + * @Default {new Date(2099, 12, 31)} + */ + maxDate?: any; + + /**Sets the minimum date limit to display on the Schedule. Setting minDate with specific date value disallows the Schedule to navigate beyond that date. + * @Default {new Date(1900, 01, 01)} + */ + minDate?: any; + + /**Sets the mode of Schedule rendering either in a vertical or horizontal direction. It accepts either string("vertical" or "horizontal") or enum values. The enum values that are accepted by orientation(ej.Schedule.Orientation) are as follows, + * @Default {ej.Schedule.Orientation.Vertical} + */ + orientation?: string|ej.Schedule.Orientation; + + /**Holds all the options related to priority settings of the Schedule. + */ + prioritySettings?: PrioritySettings; + + /**When set to true, disables the interaction with the Schedule appointments, simply allowing the date and view navigation to occur. + * @Default {false} + */ + readOnly?: boolean; + + /**Holds all the options related to reminder settings of the Schedule. + */ + reminderSettings?: ReminderSettings; + + /**Defines the specific start and end dates to be rendered in the Schedule control. To render such user-specified custom date ranges in the Schedule control, set the currentView property to customview. + * @Default {null} + */ + renderDates?: RenderDates; + + /**Template design that applies on the Schedule resource header. + * @Default {null} + */ + resourceHeaderTemplateId?: string; + + /**Holds all the options related to the resources settings of the Schedule. It is a collection of one or more resource objects, where the levels of resources are rendered on the Schedule based on the order of the resource data provided within this collection. + * @Default {null} + */ + resources?: Array; + + /**When set to true, displays the all-day row cells on the Schedule. + * @Default {true} + */ + showAllDayRow?: boolean; + + /**When set to true, displays the current time indicator on the Schedule. + * @Default {true} + */ + showCurrentTimeIndicator?: boolean; + + /**When set to true, displays the header bar on the Schedule. + * @Default {true} + */ + showHeaderBar?: boolean; + + /**When set to true, displays the location field additionally on Schedule appointment window. + * @Default {false} + */ + showLocationField?: boolean; + + /**When set to true, displays the quick window for every single click made on the Schedule cells or appointments. + * @Default {true} + */ + showQuickWindow?: boolean; + + /**When set to true, displays the timescale on the left side of the Schedule. + * @Default {true} + */ + showTimeScale?: boolean; + + /**Sets the start hour time range to be displayed on the Schedule. + * @Default {0} + */ + startHour?: number; + + /**Sets either 12 or 24 hour time mode on the Schedule. It accepts either the string value("12" or "24") or the below mentioned enum values. The enum values that are accepted by timeMode(ej.Schedule.TimeMode) are as follows, + * @Default {null} + */ + timeMode?: string|ej.Schedule.TimeMode; + + /**Sets the timezone for the Schedule. + * @Default {null} + */ + timeZone?: string; + + /**Sets the collection of timezone items to be bound to the Schedule. Only the items bound to this property gets listed out in the timezone field of the appointment window. + */ + timeZoneCollection?: TimeZoneCollection; + + /**Defines the view collection to be displayed on the Schedule. By default, it displays all the views namely, Day, Week, WorkWeek and Month. + * @Default {[Day, Week, WorkWeek, Month, Agenda]} + */ + views?: Array; + + /**Sets the width of the Schedule. Accepts both pixel and percentage values. + * @Default {100%} + */ + width?: string; + + /**When set to true, Schedule allows the validation of recurrence pattern to take place before it is being assigned to the appointments. For example, when one of the instance of recurrence appointment is dragged beyond the next or previous instance of the same recurrence appointment, a pop-up is displayed with the validation message disallowing the drag functionality. + * @Default {true} + */ + enableRecurrenceValidation?: boolean; + + /**Sets the week to display more than one week appointment summary. + */ + agendaViewSettings?: AgendaViewSettings; + + /**You can change or set the starting day of the week. + * @Default {null} + */ + firstDayOfWeek?: string; + + /**You can set the workWeek days of the workWeek. + * @Default {[Monday, Tuesday, Wednesday, Thursday, Friday]} + */ + workWeek?: Array; + + /**The tooltip allows to display appointment details in a tooltip while hovering on it. + */ + tooltipSettings?: TooltipSettings; + + /**Holds all the options related to the time scale of Scheduler. The timeslots either major or minor slots can be customized with this property. + */ + timeScale?: TimeScale; + + /**When set to true, shows the delete confirmation dialog before deleting an appointment. + * @Default {true} + */ + showDeleteConfirmationDialog?: boolean; + + /**Accepts the id value of the template layout defined for the all-day cells. + * @Default {null} + */ + allDayCellsTemplateId?: string; + + /**Accepts the id value of the template layout defined for the work cells and month cells. + * @Default {null} + */ + workCellsTemplateId?: string; + + /**Accepts the id value of the template layout defined for the date header cells. + * @Default {null} + */ + dateHeaderTemplateId?: string; + + /**when set to false, allows the height of the work-cells to adjust automatically based on the number of appointment count it has. + * @Default {true} + */ + showOverflowButton?: boolean; + + /**Allows setting draggable area for the Scheduler appointments. Also, turns on the external drag and drop, when set with some specific external drag area name. + */ + appointmentDragArea?: string; + + /**When set to true, displays the other months days from the current month on the Schedule. + * @Default {true} + */ + showNextPrevMonth?: boolean; + + /**Triggers before the action begin of the Schedule.*/ + actionBegin? (e: ActionBeginEventArgs): void; + + /**Triggers after the completion of action in the Schedule.*/ + actionComplete? (e: ActionCompleteEventArgs): void; + + /**Triggers after the appointment is clicked.*/ + appointmentClick? (e: AppointmentClickEventArgs): void; + + /**Triggers before the appointment is being removed from the Scheduler.*/ + beforeAppointmentRemove? (e: BeforeAppointmentRemoveEventArgs): void; + + /**Triggers before the edited appointment is being saved.*/ + beforeAppointmentChange? (e: BeforeAppointmentChangeEventArgs): void; + + /**Triggers after the appointment is hovered.*/ + appointmentHover? (e: AppointmentHoverEventArgs): void; + + /**Triggers before the appointment gets saved.*/ + beforeAppointmentCreate? (e: BeforeAppointmentCreateEventArgs): void; + + /**Triggers before the appointment window opens.*/ + appointmentWindowOpen? (e: AppointmentWindowOpenEventArgs): void; + + /**Triggers before the context menu opens.*/ + beforeContextMenuOpen? (e: BeforeContextMenuOpenEventArgs): void; + + /**Triggers after the cell is clicked.*/ + cellClick? (e: CellClickEventArgs): void; + + /**Triggers after the cell is clicked twice.*/ + cellDoubleClick? (e: CellDoubleClickEventArgs): void; + + /**Triggers after the cell is hovered.*/ + cellHover? (e: CellHoverEventArgs): void; + + /**Triggers while the appointment is being dragged over the work cells.*/ + drag? (e: DragEventArgs): void; + + /**Triggers when the appointment dragging begins.*/ + dragStart? (e: DragStartEventArgs): void; + + /**Triggers when the appointment is dropped.*/ + dragStop? (e: DragStopEventArgs): void; + + /**Triggers after the context menu is clicked.*/ + menuItemClick? (e: MenuItemClickEventArgs): void; + + /**Triggers after the Schedule view or date is navigated.*/ + navigation? (e: NavigationEventArgs): void; + + /**Triggers every time before the elements of the scheduler such as work cells, time cells or header cells and so on renders or re-renders on a page.*/ + queryCellInfo? (e: QueryCellInfoEventArgs): void; + + /**Triggers when the reminder is raised for an appointment.*/ + reminder? (e: ReminderEventArgs): void; + + /**Triggers while resizing the appointment.*/ + resize? (e: ResizeEventArgs): void; + + /**Triggers when the appointment resizing begins.*/ + resizeStart? (e: ResizeStartEventArgs): void; + + /**Triggers when appointment resizing stops.*/ + resizeStop? (e: ResizeStopEventArgs): void; + + /**Triggers when the overflow button is clicked.*/ + overflowButtonClick? (e: OverflowButtonClickEventArgs): void; + + /**Triggers while mouse hovering on the overflow button.*/ + overflowButtonHover? (e: OverflowButtonHoverEventArgs): void; + + /**Triggers when any of the keyboard keys are pressed.*/ + keyDown? (e: KeyDownEventArgs): void; + + /**Triggers after the appointment is saved.*/ + appointmentCreated? (e: AppointmentCreatedEventArgs): void; + + /**Triggers after the appointment is edited.*/ + appointmentChanged? (e: AppointmentChangedEventArgs): void; + + /**Triggers after the appointment is deleted.*/ + appointmentRemoved? (e: AppointmentRemovedEventArgs): void; +} + +export interface ActionBeginEventArgs { + + /**Returns the current date value. + */ + currentDate?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the current view value. + */ + currentView?: string; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the action begin request type. + */ + requestType?: string; + + /**Returns the target of the click. + */ + target?: any; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the save appointment value. + */ + data?: any; + + /**Returns the id of delete appointment. + */ + id?: number; +} + +export interface ActionCompleteEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the data about view change action. + */ + data?: any; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the action complete request type. + */ + requestType?: string; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the appointment data dropped. + */ + appointment?: any; +} + +export interface AppointmentClickEventArgs { + + /**Returns the object of appointmentClick event. + */ + object?: any; + + /**Returns the clicked appointment object. + */ + appointment?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface BeforeAppointmentRemoveEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the deleted appointment object. + */ + appointment?: any; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the name of the Scheduler event. + */ + type?: string; +} + +export interface BeforeAppointmentChangeEventArgs { + + /**Returns the edited appointment object. + */ + appointment?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the name of the Scheduler event. + */ + type?: string; +} + +export interface AppointmentHoverEventArgs { + + /**Returns the object of appointmentHover event. + */ + object?: any; + + /**Returns the hovered appointment object. + */ + appointment?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface BeforeAppointmentCreateEventArgs { + + /**Returns the appointment object. + */ + appointment?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the name of the Scheduler event. + */ + type?: string; +} + +export interface AppointmentWindowOpenEventArgs { + + /**returns the object of appointmentWindowOpen event while selecting the detail option from quick window or edit appointment or edit series option. + */ + object?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the end time of the double clicked cell. + */ + endTime?: any; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the action name that triggers window open. + */ + originalEventType?: string; + + /**Returns the start time of the double clicked cell. + */ + startTime?: any; + + /**Returns the target of the double clicked cell. + */ + target?: any; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the edit appointment object. + */ + appointment?: any; + + /**Returns the edit occurrence option value. + */ + edit?: boolean; +} + +export interface BeforeContextMenuOpenEventArgs { + + /**Returns the object of beforeContextMenuOpen event. + */ + object?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the current cell index value. + */ + cellIndex?: number; + + /**Returns the current date value. + */ + currentDate?: any; + + /**Returns the current resource details, when multiple resources are present, otherwise returns null. + */ + resources?: any; + + /**Returns the current appointment details while opening the menu from appointment. + */ + appointment?: any; + + /**Returns the object of before opening menu target. + */ + events?: any; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface CellClickEventArgs { + + /**Returns the object of cellClick event. + */ + object?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the end time of the clicked cell. + */ + endTime?: any; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the start time of the clicked cell. + */ + startTime?: any; + + /**Returns the target of the clicked cell. + */ + target?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface CellDoubleClickEventArgs { + + /**Returns the object of cellDoubleClick event. + */ + object?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the end time of the double clicked cell. + */ + endTime?: any; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the start time of the double clicked cell. + */ + startTime?: any; + + /**Returns the target of the double clicked cell. + */ + target?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface CellHoverEventArgs { + + /**Returns the object of cellHover event. + */ + object?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the index of the hovered cell. + */ + cellIndex?: any; + + /**Returns the current date of the hovered cell. + */ + currentDate?: any; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the target of the clicked cell. + */ + target?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface DragEventArgs { + + /**Returns the object of dragOver event. + */ + object?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the target of the drag over appointment. + */ + target?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface DragStartEventArgs { + + /**Returns the object of dragStart event. + */ + object?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the target of the dragging appointment. + */ + target?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface DragStopEventArgs { + + /**Returns the object of dragDrop event. + */ + object?: any; + + /**Returns the dropped appointment object. + */ + appointment?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface MenuItemClickEventArgs { + + /**Returns the object of menuItemClick event. + */ + object?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the object of menu item event. + */ + events?: any; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface NavigationEventArgs { + + /**Returns the current date object. + */ + currentDate?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the current view value. + */ + currentView?: string; + + /**Returns the previous view value. + */ + previousView?: string; + + /**Returns the target of the action. + */ + target?: any; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the previous date of the Schedule. + */ + previousDate?: any; +} + +export interface QueryCellInfoEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the current appontment data. + */ + appointment?: any; + + /**Returns the currently rendering DOM element. + */ + element?: any; + + /**Returns the name of the currently rendering element on the scheduler. + */ + requestType?: string; + + /**Returns the cell type which is currently rendering on the Scheduler. + */ + cellType?: string; + + /**Returns the start date of the currently rendering appointment. + */ + currentAppointmentDate?: any; + + /**Returns the currently rendering cell information. + */ + cell?: any; + + /**Returns the currently rendering resource details. + */ + resource?: any; + + /**Returns the currently rendering date information. + */ + currentDay?: any; +} + +export interface ReminderEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the appointment object for which the reminder is raised. + */ + reminderAppointment?: any; +} + +export interface ResizeEventArgs { + + /**Returns the object of resizing event. + */ + object?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the resize element value. + */ + element?: any; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface ResizeStartEventArgs { + + /**Returns the object of resizeStart event. + */ + object?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the resize element value. + */ + element?: any; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface ResizeStopEventArgs { + + /**Returns the object of resizeStop event. + */ + object?: any; + + /**Returns the resized appointment value. + */ + appointment?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the target of the resized appointment. + */ + target?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface OverflowButtonClickEventArgs { + + /**Returns the object consisting of starttime, endtime and resource value of the underlying cell on which the clicked overflow button is present. + */ + object?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the object of menu item event. + */ + events?: any; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface OverflowButtonHoverEventArgs { + + /**Returns the object consisting of starttime, endtime and resource value of the underlying cell on which the overflow button is currently hovered. + */ + object?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the object of menu item event. + */ + events?: any; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface KeyDownEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the object of menu item event. + */ + events?: any; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface AppointmentCreatedEventArgs { + + /**Returns the appointment object. + */ + appointment?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the name of the Scheduler event. + */ + type?: string; +} + +export interface AppointmentChangedEventArgs { + + /**Returns the edited appointment object. + */ + appointment?: any; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the name of the Scheduler event. + */ + type?: string; +} + +export interface AppointmentRemovedEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the deleted appointment object. + */ + appointment?: any; + + /**Returns the Schedule model. + */ + model?: ej.Schedule.Model; + + /**Returns the name of the Scheduler event. + */ + type?: string; +} + +export interface AppointmentSettings { + + /**Default Value + * @Default {Array} + */ + dataSource?: any|Array; + + /**Default Value + * @Default {null} + */ + query?: string; + + /**Default Value + * @Default {null} + */ + tableName?: string; + + /**Binds the id field name in dataSource to the id of Schedule appointments. It denotes the unique id assigned to appointments. + */ + id?: string; + + /**Binds the name of startTime field in the dataSource with start time of the Schedule appointments. It indicates the date and Time when Schedule appointment actually starts. + */ + startTime?: string; + + /**Binds the name of endTime field in dataSource with the end time of Schedule appointments. It indicates the date and time when Schedule appointment actually ends. + */ + endTime?: string; + + /**Binds the name of subject field in the dataSource to appointment Subject. Indicates the Subject or title that gets displayed on Schedule appointments. + */ + subject?: string; + + /**Binds the description field name in dataSource. It indicates the appointment description. + */ + description?: string; + + /**Binds the name of recurrence field in dataSource. It indicates whether the appointment is a recurrence appointment or not. + */ + recurrence?: string; + + /**Binds the name of recurrenceRule field in dataSource. It indicates the recurrence pattern associated with appointments. + */ + recurrenceRule?: string; + + /**Binds the name of allDay field in dataSource. It indicates whether the appointment is an allday appointment or not. + * @Default {AllDay} + */ + allDay?: string; + + /**Default Value + * @Default {null} + */ + resourceFields?: string; + + /**Default Value + * @Default {null} + */ + categorize?: string; + + /**Default Value + * @Default {null} + */ + location?: string; + + /**Default Value + * @Default {null} + */ + priority?: string; + + /**Default Value + * @Default {StartTimeZone} + */ + startTimeZone?: string; + + /**Default Value + * @Default {EndTimeZone} + */ + endTimeZone?: string; +} + +export interface CategorizeSettings { + + /**Default Value + * @Default {false} + */ + allowMultiple?: boolean; + + /**Default Value + * @Default {false} + */ + enable?: boolean; + + /**Default Value + * @Default {Array} + */ + dataSource?: Array|any; + + /**Binds id field name in the dataSource to id of category data. + * @Default {id} + */ + id?: string; + + /**Binds text field name in the dataSource to category text. + * @Default {text} + */ + text?: string; + + /**Binds color field name in the dataSource to category color. + * @Default {color} + */ + color?: string; + + /**Binds fontColor field name in the dataSource to category font. + * @Default {fontColor} + */ + fontColor?: string; +} + +export interface ContextMenuSettings { + + /**When set to true, enables the context menu options available for the Schedule cells and appointments. + * @Default {false} + */ + enable?: boolean; + + /**Contains all the default context menu options that are applicable for both Schedule cells and appointments. It also supports adding custom menu items to cells or appointment collection. + * @Default {[]} + */ + menuItems?: any; +} + +export interface Group { + + /**Holds the array of resource names to be grouped on the Schedule. + */ + resources?: any; +} + +export interface WorkHours { + + /**When set to true, highlights the work hours of the Schedule. + * @Default {true} + */ + highlight?: boolean; + + /**Sets the start time to depict the start of working or business hour in a day. + * @Default {null} + */ + start?: number; + + /**Sets the end time to depict the end of working or business hour in a day. + * @Default {null} + */ + end?: number; +} + +export interface PrioritySettings { + + /**When set to true, enables the priority options available for the Schedule appointments. + * @Default {false} + */ + enable?: boolean; + + /**The dataSource option can accept the JSON object collection that contains the priority related data. + * @Default {Array} + */ + dataSource?: any|Array; + + /**Binds text field name in the dataSource to prioritySettings text. These text gets listed out in priority field of the appointment window. + * @Default {text} + */ + text?: string; + + /**Binds value field name in the dataSource to prioritySettings value. These field names usually accepts four priority values by default, high, low, medium and none. + * @Default {value} + */ + value?: string; + + /**Allows priority field customization in the appointment window to add custom icons denoting the priority level for the appointments. + * @Default {null} + */ + template?: string; +} + +export interface ReminderSettings { + + /**When set to true, enables the reminder option available for the Schedule appointments. + * @Default {false} + */ + enable?: boolean; + + /**Sets the timing, when the reminders are to be alerted for the Schedule appointments. + * @Default {5} + */ + alertBefore?: number; +} + +export interface RenderDates { + + /**Sets the start of custom date range to be rendered in the Schedule. + * @Default {null} + */ + start?: any; + + /**Sets the end limit of the custom date range. + * @Default {null} + */ + end?: any; +} + +export interface ResourcesResourceSettings { + + /**The dataSource option accepts either JSON object collection or DataManager (ej.DataManager) instance that contains the resources related data. + */ + dataSource?: any|Array; + + /**Binds text field name in the dataSource to resourceSettings text. These text gets listed out in resources field of the appointment window. + */ + text?: string; + + /**Binds id field name in the dataSource to resourceSettings id. + */ + id?: string; + + /**Binds groupId field name in the dataSource to resourceSettings groupId. + */ + groupId?: string; + + /**Binds color field name in the dataSource to resourceSettings color. The color specified here gets applied to the Schedule appointments denoting to the resource it belongs. + */ + color?: string; + + /**Binds the starting work hour field name in the dataSource. It's optional, but when provided with some numeric value will set the starting work hour for specific resources. + */ + start?: string; + + /**Binds the end work hour field name in the dataSource. It's optional, but when provided with some numeric value will set the end work hour for specific resources. + */ + end?: string; + + /**Binds the resources working days field name in the dataSource. It's optional, and accepts the array of strings (week day names). When provided with some values (array of day names), only those days will render for the specific resources. + */ + workWeek?: string; + + /**Binds appointmentClass field name in the dataSource. It applies custom CSS class name to appointments depicting to the resource it belongs. + */ + appointmentClass?: string; +} + +export interface Resources { + + /**It holds the name of the resource field to be bound to the Schedule appointments that contains the resource Id. + * @Default {[]} + */ + field?: string; + + /**It holds the title name of the resource field to be displayed on the Schedule appointment window. + * @Default {[]} + */ + title?: string; + + /**A unique resource name that is used for differentiating various resource objects while grouping it in various levels. + * @Default {[]} + */ + name?: string; + + /**When set to true, allows multiple selection of resource names, thus creating multiple instances of same appointment for the selected resources. + * @Default {[]} + */ + allowMultiple?: string; + + /**It holds the field names of the resources to be bound to the Schedule and also the dataSource. + */ + resourceSettings?: ResourcesResourceSettings; +} + +export interface TimeZoneCollection { + + /**Sets the collection of timezone items to the dataSource that accepts either JSON object collection or DataManager (ej.DataManager) instance that contains Schedule timezones. + */ + dataSource?: any; + + /**Binds text field name in the dataSource to timeZoneCollection text. These text gets listed out in the timezone fields of the appointment window. + */ + text?: string; + + /**Binds id field name in the dataSource to timeZoneCollection id. + */ + id?: string; + + /**Binds value field name in the dataSource to timeZoneCollection value. + */ + value?: string; +} + +export interface AgendaViewSettings { + + /**You can display the summary of multiple week's appointment by setting this value. + * @Default {7} + */ + daysInAgenda?: number; + + /**You can customize the Date column display based on the requirement. + * @Default {null} + */ + dateColumnTemplateId?: string; + + /**You can customize the time column display based on the requirement. + * @Default {null} + */ + timeColumnTemplateId?: string; +} + +export interface TooltipSettings { + + /**To enable or disable the tooltip display. + * @Default {false} + */ + enable?: boolean; + + /**To customize the tooltip display based on your requirements. + * @Default {null} + */ + templateId?: string; +} + +export interface TimeScale { + + /**When set to true, displays the timescale on the Scheduler. + * @Default {null} + */ + enable?: boolean; + + /**When set with some specific value, defines the number of time divisions split per hour(as per value given for the majorTimeSlot). Those time divisions are meant to be the minor slots. + * @Default {2} + */ + minorSlotCount?: number; + + /**Accepts the value in minutes. When provided with specific value, displays the appropriate time interval on the Scheduler + * @Default {60} + */ + majorSlot?: number; + + /**Accepts id value of the template defined for minor time slots + * @Default {null} + */ + minorSlotTemplateId?: string; + + /**Accepts id value of the template defined for major time slots. + * @Default {null} + */ + majorSlotTemplateId?: string; +} + +enum CurrentView{ + + ///Set currentView as Day to Scheduler + Day, + + ///Set currentView as Week to Scheduler + Week, + + ///Set currentView as Workweek to Scheduler + Workweek, + + ///Set currentView as Month to Scheduler + Month, + + ///Set currentView as Agenda to Scheduler + Agenda, + + ///Set currentView as CustomView to Scheduler + CustomView +} + + +enum Orientation{ + + ///Set orientation as vertical to Scheduler + Vertical, + + ///Set orientation as horizontal to Scheduler + Horizontal +} + + +enum TimeMode{ + + ///Set timeMode as 12 hours to Scheduler + Hour12, + + ///Set timeMode as 24 hours to Scheduler + Hour24 +} + +} + +class RecurrenceEditor extends ej.Widget { + static fn: RecurrenceEditor; + static Locale:any; + constructor(element: JQuery, options?: RecurrenceEditorOptions); + constructor(element: Element, options?: RecurrenceEditorOptions); + model:RecurrenceEditorOptions; + defaults:RecurrenceEditorOptions; + recurrenceDateGenerator(recurrenceString: string,strDate:Object): string; + closeRecurPublic(): string; + getRecurrenceRule(): void; + recurrenceRuleSplit(recurrenceRule: string, recurrenceExDate?: string): Object; + +} +interface RecurrenceEditorOptions { + frequencies?: Array; + firstDayOfWeek?: string; + name?: string; + enableSpinners?: boolean; + startDate?: Date; + locale?: string; + enableRTL?: boolean; + value?: string; + dateFormat?: string; + selectedRecurrenceType?: number; + enableRecurrenceValidation?: boolean; + minDate?: Date; + maxDate?: Date; + cssClass?: string; + change?(e: RecurrenceEditorChangeEvent): void; + create?(e: RecurrenceEditorBaseEvent): void; +} +interface RecurrenceEditorBaseEvent extends ej.BaseEvent { + model: RecurrenceEditorOptions; +} +interface RecurrenceEditorChangeEvent extends RecurrenceEditorBaseEvent { + requestType?: string; +} +class Gantt extends ej.Widget { + static fn: Gantt; + constructor(element: JQuery, options?: Gantt.Model); + constructor(element: Element, options?: Gantt.Model); + model:Gantt.Model; + defaults:Gantt.Model; + + /** To add item in gantt + * @param {any} Item to add in Gantt row. + * @param {string} Defines in which position the row wants to add + * @returns {void} + */ + addRecord(data: any, rowPosition: string): void; + + /** Positions the splitter by the specified column index. + * @param {number} Set the splitter position based on column index. + * @returns {void} + */ + setSplitterIndex(index: number): void; + + /** To cancel the edited state of an item in gantt + * @returns {void} + */ + cancelEdit(): void; + + /** To collapse all the parent items in gantt + * @returns {void} + */ + collapseAllItems(): void; + + /** To delete a selected item in gantt + * @returns {void} + */ + deleteItem(): void; + + /** destroy the gantt widget all events bound using this._on will be unbind automatically and bring the control to pre-init state. + * @returns {void} + */ + destroy(): void; + + /** To Expand all the parent items in gantt + * @returns {void} + */ + expandAllItems(): void; + + /** To expand and collapse an item in gantt using item's ID + * @param {number} Exapnd or Collapse a record based on task id. + * @returns {void} + */ + expandCollapseRecord(taskId: number): void; + + /** To hide the column by using header text + * @param {string} you can pass a header text of a column to hide + * @returns {void} + */ + hideColumn(headerText: string): void; + + /** To indent a selected item in gantt + * @returns {void} + */ + indentItem(): void; + + /** To Open the dialog to add new task to the gantt + * @returns {void} + */ + openAddDialog(): void; + + /** To Open the dialog to edit existing task to the gantt + * @returns {void} + */ + openEditDialog(): void; + + /** To outdent a selected item in gantt + * @returns {void} + */ + outdentItem(): void; + + /** To save the edited state of an item in gantt + * @returns {void} + */ + saveEdit(): void; + + /** To search an item with search string provided at the run time + * @param {string} you can pass a text to search in Gantt Control. + * @returns {void} + */ + searchItem(searchString: string): void; + + /** To set the grid width in gantt + * @param {string} you can give either percentage or pixels value + * @returns {void} + */ + setSplitterPosition(width: string): void; + + /** To show the column by using header text + * @param {string} you can pass a header text of a column to show + * @returns {void} + */ + showColumn(headerText: string): void; +} +export module Gantt{ + +export interface Model { + + /**Specifies the fields to be included in the add dialog in gantt + * @Default {[]} + */ + addDialogFields?: Array; + + /**Enables or disables the ability to resize column. + * @Default {false} + */ + allowColumnResize?: boolean; + + /**Enables or Disables gantt chart editing in gantt + * @Default {true} + */ + allowGanttChartEditing?: boolean; + + /**Enables or Disables Keyboard navigation in gantt + * @Default {true} + */ + allowKeyboardNavigation?: boolean; + + /**Specifies enabling or disabling multiple sorting for Gantt columns + * @Default {false} + */ + allowMultiSorting?: boolean; + + /**Enables or disables the interactive selection of a row. + * @Default {true} + */ + allowSelection?: boolean; + + /**Enables or disables sorting. When enabled, we can sort the column by clicking on the column. + * @Default {false} + */ + allowSorting?: boolean; + + /**Enable or disable predecessor validation. When it is true, all the task's start and end dates are aligned based on its predecessors start and end dates. + * @Default {true} + */ + enablePredecessorValidation?: boolean; + + /**Specifies the baseline background color in gantt + * @Default {#fba41c} + */ + baselineColor?: string; + + /**Specifies the mapping property path for baseline end date in datasource + */ + baselineEndDateMapping?: string; + + /**Specifies the mapping property path for baseline start date of a task in datasource + */ + baselineStartDateMapping?: string; + + /**Specifies the mapping property path for sub tasks in datasource + */ + childMapping?: string; + + /**Specifies the background of connector lines in Gantt + */ + connectorLineBackground?: string; + + /**Specifies the width of the connector lines in gantt + * @Default {1} + */ + connectorlineWidth?: number; + + /**Specify the CSS class for gantt to achieve custom theme. + */ + cssClass?: string; + + /**Collection of data or hierarchical data to represent in gantt + * @Default {null} + */ + dataSource?: Array; + + /**Specifies the dateFormat for gantt , given format is displayed in tooltip , grid . + * @Default {MM/dd/yyyy} + */ + dateFormat?: string; + + /**Specifies the mapping property path for duration of a task in datasource + */ + durationMapping?: string; + + /**Specifies the duration unit for each tasks whether days or hours or minutes + * @Default {ej.Gantt.DurationUnit.Day} + */ + durationUnit?: ej.Gantt.DurationUnit|string; + + /**Specifies the fields to be included in the edit dialog in gantt + * @Default {[]} + */ + editDialogFields?: Array; + + /**Option to configure the splitter position. + */ + splitterSettings?: SplitterSettings; + + /**Specifies the editSettings options in gantt. + */ + editSettings?: EditSettings; + + /**Enables or Disables enableAltRow row effect in gantt + * @Default {true} + */ + enableAltRow?: boolean; + + /**Enables or disables the collapse all records when loading the gantt. + * @Default {false} + */ + enableCollapseAll?: boolean; + + /**Enables or disables the contextmenu for gantt , when enabled contextmenu appears on right clicking gantt + * @Default {false} + */ + enableContextMenu?: boolean; + + /**Indicates whether we can edit the progress of a task interactively in gantt chart. + * @Default {true} + */ + enableProgressBarResizing?: boolean; + + /**Enables or disables the option for dynamically updating the Gantt size on window resizing + * @Default {false} + */ + enableResize?: boolean; + + /**Enables or disables tooltip while editing (dragging/resizing) the taskbar. + * @Default {true} + */ + enableTaskbarDragTooltip?: boolean; + + /**Enables or disables tooltip for taskbar. + * @Default {true} + */ + enableTaskbarTooltip?: boolean; + + /**Enables/Disables virtualization for rendering gantt items. + * @Default {false} + */ + enableVirtualization?: boolean; + + /**Specifies the mapping property path for end Date of a task in datasource + */ + endDateMapping?: string; + + /**Specifies whether to highlight the weekends in gantt . + * @Default {true} + */ + highlightWeekends?: boolean; + + /**Collection of holidays with date, background and label information to be displayed in gantt. + * @Default {[]} + */ + holidays?: Array; + + /**Specifies whether to include weekends while calculating the duration of a task. + * @Default {true} + */ + includeWeekend?: boolean; + + /**Specify the locale for gantt + * @Default {en-US} + */ + locale?: string; + + /**Specifies the mapping property path for milestone in datasource + */ + milestoneMapping?: string; + + /**Specifies the background of parent progressbar in gantt + */ + parentProgressbarBackground?: string; + + /**Specifies the background of parent taskbar in gantt + */ + parentTaskbarBackground?: string; + + /**Specifies the mapping property path for parent task Id in self reference datasource + */ + parentTaskIdMapping?: string; + + /**Specifies the mapping property path for predecessors of a task in datasource + */ + predecessorMapping?: string; + + /**Specifies the background of progressbar in gantt + */ + progressbarBackground?: string; + + /**Specified the height of the progressbar in taskbar + * @Default {100} + */ + progressbarHeight?: number; + + /**Specifies the template for tooltip on resizing progressbar + * @Default {null} + */ + progressbarTooltipTemplate?: string; + + /**Specifies the template ID for customized tooltip for progressbar editing in gantt + * @Default {null} + */ + progressbarTooltipTemplateId?: string; + + /**Specifies the mapping property path for progress percentage of a task in datasource + */ + progressMapping?: string; + + /**It receives query to retrieve data from the table (query is same as SQL). + * @Default {null} + */ + query?: any; + + /**Enables or Disables rendering baselines in Gantt , when enabled baseline is rendered in gantt + * @Default {false} + */ + renderBaseline?: boolean; + + /**Specifies the mapping property name for resource ID in resource Collection in gantt + */ + resourceIdMapping?: string; + + /**Specifies the mapping property path for resources of a task in datasource + */ + resourceInfoMapping?: string; + + /**Specifies the mapping property path for resource name of a task in gantt + */ + resourceNameMapping?: string; + + /**Collection of data regarding resources involved in entire project + * @Default {[]} + */ + resources?: Array; + + /**Specifies whether rounding off the day working time edits + * @Default {true} + */ + roundOffDayworkingTime?: boolean; + + /**Specifies the height of a single row in gantt. Also, we need to set same height in the CSS style with class name e-rowcell. + * @Default {30} + */ + rowHeight?: number; + + /**Specifies end date of the gantt schedule. By default, end date will be rounded to its next Saturday. + * @Default {null} + */ + scheduleEndDate?: string; + + /**Specifies the options for customizing schedule header. + */ + scheduleHeaderSettings?: ScheduleHeaderSettings; + + /**Specifies start date of the gantt schedule. By default, start date will be rounded to its previous Sunday. + * @Default {null} + */ + scheduleStartDate?: string; + + /**Specifies the selected row index in gantt + * @Default {null} + */ + selectedItem?: number; + + /**Specifies the selected row Index in gantt , the row with given index will highlighted + * @Default {-1} + */ + selectedRowIndex?: number; + + /**Enables or disables the column chooser. + * @Default {false} + */ + showColumnChooser?: boolean; + + /**Specifies whether to show grid cell tooltip. + * @Default {true} + */ + showGridCellTooltip?: boolean; + + /**Specifies whether to show grid cell tooltip over expander cell alone. + * @Default {true} + */ + showGridExpandCellTooltip?: boolean; + + /**Specifies whether display task progress inside taskbar. + * @Default {true} + */ + showProgressStatus?: boolean; + + /**Specifies whether to display resource names for a task beside taskbar. + * @Default {true} + */ + showResourceNames?: boolean; + + /**Specifies whether to display task name beside task bar. + * @Default {true} + */ + showTaskNames?: boolean; + + /**Specifies the size option of gantt control. + */ + sizeSettings?: SizeSettings; + + /**Specifies the sorting options for gantt. + */ + sortSettings?: SortSettings; + + /**Specifies splitter position in gantt. + * @Default {null} + */ + splitterPosition?: string; + + /**Specifies the mapping property path for start date of a task in datasource + */ + startDateMapping?: string; + + /**Specifies the options for striplines + * @Default {[]} + */ + stripLines?: Array; + + /**Specifies the background of the taskbar in gantt + */ + taskbarBackground?: string; + + /**Specifies the template script for customized tooltip for taskbar editing in gantt + */ + taskbarEditingTooltipTemplate?: string; + + /**Specifies the template Id for customized tooltip for taskbar editing in gantt + */ + taskbarEditingTooltipTemplateId?: string; + + /**Specifies the template for tooltip on mouse action on taskbars + */ + taskbarTooltipTemplate?: string; + + /**Specifies the template id for tooltip on mouse action on taskbars + */ + taskbarTooltipTemplateId?: string; + + /**Specifies the mapping property path for task Id in datasource + */ + taskIdMapping?: string; + + /**Specifies the mapping property path for task name in datasource + */ + taskNameMapping?: string; + + /**Specifies the toolbarSettings options. + */ + toolbarSettings?: ToolbarSettings; + + /**Specifies the tree expander column in gantt + * @Default {0} + */ + treeColumnIndex?: number; + + /**Specifies the weekendBackground color in gantt + * @Default {#F2F2F2} + */ + weekendBackground?: string; + + /**Specifies the working time schedule of day + * @Default {ej.Gantt.workingTimeScale.TimeScale8Hours} + */ + workingTimeScale?: ej.Gantt.workingTimeScale|string; + + /**Triggered for every gantt action before its starts.*/ + actionBegin? (e: ActionBeginEventArgs): void; + + /**Triggered for every gantt action success event.*/ + actionComplete? (e: ActionCompleteEventArgs): void; + + /**Triggered while enter the edit mode in the tree grid cell*/ + beginEdit? (e: BeginEditEventArgs): void; + + /**Triggered after collapsed the gantt record*/ + collapsed? (e: CollapsedEventArgs): void; + + /**Triggered while collapsing the gantt record*/ + collapsing? (e: CollapsingEventArgs): void; + + /**Triggered while Context Menu is rendered in Gantt control*/ + contextMenuOpen? (e: ContextMenuOpenEventArgs): void; + + /**Triggered after save the modified cellValue in gantt.*/ + endEdit? (e: EndEditEventArgs): void; + + /**Triggered after expand the record*/ + expanded? (e: ExpandedEventArgs): void; + + /**Triggered while expanding the gantt record*/ + expanding? (e: ExpandingEventArgs): void; + + /**Triggered while gantt is loaded*/ + load? (e: LoadEventArgs): void; + + /**Triggered while rendering each cell in the tree grid*/ + queryCellInfo? (e: QueryCellInfoEventArgs): void; + + /**Triggered while rendering each taskbar in the gantt chart*/ + queryTaskbarInfo? (e: QueryTaskbarInfoEventArgs): void; + + /**Triggered while rendering each row*/ + rowDataBound? (e: RowDataBoundEventArgs): void; + + /**Triggered after the row is selected.*/ + rowSelected? (e: RowSelectedEventArgs): void; + + /**Triggered before the row is going to be selected.*/ + rowSelecting? (e: RowSelectingEventArgs): void; + + /**Triggered after completing the editing operation in taskbar*/ + taskbarEdited? (e: TaskbarEditedEventArgs): void; + + /**Triggered while editing the gantt chart (dragging, resizing the taskbar )*/ + taskbarEditing? (e: TaskbarEditingEventArgs): void; + + /**Triggered when toolbar item is clicked in Gantt.*/ + toolbarClick? (e: ToolbarClickEventArgs): void; +} + +export interface ActionBeginEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the current grouped column field name. + */ + columnName?: string; + + /**Returns request type. + */ + requestType?: string; + + /**Returns the direction of sorting ascending or descending + */ + columnSortDirection?: string; + + /**Returns the value of searching element. + */ + keyValue?: string; + + /**Returns the data of deleting element. + */ + data?: string; + + /**Returns selected record index + */ + recordIndex?: number; +} + +export interface ActionCompleteEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the current grouped column field name. + */ + columnName?: string; + + /**Returns request type. + */ + requestType?: string; + + /**Returns the direction of sorting ascending or descending + */ + columnSortDirection?: string; + + /**Returns the value of searched element. + */ + keyValue?: string; + + /**Returns the data of deleted element. + */ + data?: string; + + /**Returns selected record index + */ + recordIndex?: number; +} + +export interface BeginEditEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the row element of editing cell. + */ + rowElement?: any; + + /**Returns the Element of editing cell. + */ + cellElement?: any; + + /**Returns the data of current cell record. + */ + data?: any; + + /**Returns the column Index of cell belongs. + */ + columnIndex?: number; +} + +export interface CollapsedEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the row index of collapsed record. + */ + recordIndex?: number; + + /**Returns the data of collapsed record. + */ + data?: any; + + /**Returns Request Type. + */ + requestType?: string; + + /**Returns state of a record whether it is in expanded or collapsed state. + */ + expanded?: boolean; +} + +export interface CollapsingEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the row index of collapsing record. + */ + recordIndex?: number; + + /**Returns the data of edited cell record.. + */ + data?: any; + + /**Returns state of a record whether it is in expanded or collapsed state. + */ + expanded?: boolean; +} + +export interface ContextMenuOpenEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the default context menu items to which we add custom items. + */ + contextMenuItems?: Array; + + /**Returns the gantt model. + */ + model?: any; + + /**Returns request type. + */ + requestType?: string; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface EndEditEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the row element of editing cell. + */ + rowElement?: any; + + /**Returns the Element of editing cell. + */ + cellElement?: any; + + /**Returns the data of edited cell record. + */ + data?: any; + + /**Returns the column name of edited cell belongs. + */ + columnName?: string; + + /**Returns the column object of edited cell belongs. + */ + columnObject?: any; +} + +export interface ExpandedEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the row index of record. + */ + recordIndex?: number; + + /**Returns the data of expanded record. + */ + data?: any; + + /**Returns Request Type. + */ + requestType?: string; + + /**Returns state of a record whether it is in expanded or collapsed state. + */ + expanded?: boolean; +} + +export interface ExpandingEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the row index of record. + */ + recordIndex?: any; + + /**Returns the data of edited cell record.. + */ + data?: any; + + /**Returns state of a record whether it is in expanded or collapsed state. + */ + expanded?: boolean; +} + +export interface LoadEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the gantt model + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface QueryCellInfoEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the selecting cell element. + */ + cellElement?: any; + + /**Returns the value of cell. + */ + cellValue?: string; + + /**Returns the data of current cell record. + */ + data?: any; + + /**Returns the column of cell belongs. + */ + column?: any; +} + +export interface QueryTaskbarInfoEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the taskbar background of current item. + */ + TaskbarBackground?: string; + + /**Returns the progressbar background of current item. + */ + ProgressbarBackground?: string; + + /**Returns the parent taskbar background of current item. + */ + parentTaskbarBackground?: string; + + /**Returns the parent progressbar background of current item. + */ + parentProgressbarBackground?: string; + + /**Returns the data of the record. + */ + data?: any; +} + +export interface RowDataBoundEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the row element of rendering row. + */ + rowElement?: any; + + /**Returns the data of rendering row record.. + */ + data?: any; +} + +export interface RowSelectedEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the selecting row element. + */ + targetRow?: any; + + /**Returns the index of selecting row record. + */ + recordIndex?: number; + + /**Returns the data of selected record. + */ + data?: any; +} + +export interface RowSelectingEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the data selecting record. + */ + data?: any; + + /**Returns the index of selecting row record. + */ + recordIndex?: string; + + /**Returns the selecting row chart element. + */ + targetChartRow?: any; + + /**Returns the selecting row grid element. + */ + targetGridRow?: any; + + /**Returns the previous selected data. + */ + previousData?: any; + + /**Returns the previous selected row index. + */ + previousIndex?: string; + + /**Returns the previous selected row chart element. + */ + previousChartRow?: any; + + /**Returns the previous selected row grid element. + */ + previousGridRow?: any; +} + +export interface TaskbarEditedEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the data of edited record. + */ + data?: any; + + /**Returns the previous data value of edited record. + */ + previousData?: any; + + /**Returns 'true' if taskbar is dragged. + */ + dragging?: boolean; + + /**Returns 'true' if taskbar is left resized. + */ + leftResizing?: boolean; + + /**Returns 'true' if taskbar is right resized. + */ + rightResizing?: boolean; + + /**Returns 'true' if taskbar is progress resized. + */ + progressResizing?: boolean; + + /**Returns the field values of record being edited. + */ + editingFields?: any; + + /**Returns the gantt model. + */ + model?: any; +} + +export interface TaskbarEditingEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the gantt model. + */ + model?: any; + + /**Returns the row object being edited. + */ + rowData?: any; + + /**Returns the field values of record being edited. + */ + editingFields?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface ToolbarClickEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the current item. + */ + currentTarget?: any; + + /**Returns the Gantt model. + */ + model?: any; + + /**Returns the name of the toolbar item on which mouse click has been performed + */ + itemName?: string; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface SplitterSettings { + + /**Specifies position of the splitter in Gantt , splitter can be placed either based on percentage values or pixel values. + */ + position?: string; + + /**Specifies the position of splitter in Gantt, based on column index in Gantt. + */ + index?: string; +} + +export interface EditSettings { + + /**Enables or disables add record icon in gantt toolbar + * @Default {false} + */ + allowAdding?: boolean; + + /**Enables or disables delete icon in gantt toolbar + * @Default {false} + */ + allowDeleting?: boolean; + + /**Specifies the option for enabling or disabling editing in Gantt grid part + * @Default {false} + */ + allowEditing?: boolean; + + /**Specifies the edit mode in Gantt, "normal" is for dialog editing ,"cellEditing" is for cell type editing + * @Default {normal} + */ + editMode?: string; +} + +export interface ScheduleHeaderSettings { + + /**Specified the format for day view in schedule header + * @Default {ddd} + */ + dayHeaderFormat?: string; + + /**Specified the format for Hour view in schedule header + * @Default {HH} + */ + hourHeaderFormat?: string; + + /**Specifies the number of minutes per interval + * @Default {ej.Gantt.minutesPerInterval.Auto} + */ + minutesPerInterval?: ej.Gantt.minutesPerInterval|string; + + /**Specified the format for month view in schedule header + * @Default {MMM} + */ + monthHeaderFormat?: string; + + /**Specifies the schedule mode + * @Default {ej.Gantt.ScheduleHeaderType.Week} + */ + scheduleHeaderType?: ej.Gantt.ScheduleHeaderType|string; + + /**Specified the background for weekends in gantt + * @Default {#F2F2F2} + */ + weekendBackground?: string; + + /**Specified the format for week view in schedule header + * @Default {ddd} + */ + weekHeaderFormat?: string; + + /**Specified the format for year view in schedule header + * @Default {yyyy} + */ + yearHeaderFormat?: string; +} + +export interface SizeSettings { + + /**Specifies the height of gantt control + * @Default {450px} + */ + height?: string; + + /**Specifies the width of gantt control + * @Default {1000px} + */ + width?: string; +} + +export interface SortSettings { + + /**Specifies the sorted columns for gantt + * @Default {[]} + */ + sortedColumns?: Array; +} + +export interface ToolbarSettings { + + /**Specifies the state of enabling or disabling toolbar + * @Default {true} + */ + showToolBar?: boolean; + + /**Specifies the list of toolbar items to rendered in toolbar + * @Default {[]} + */ + toolbarItems?: Array; +} + +enum DurationUnit{ + + ///Sets the Duration Unit as day. + Day, + + ///Sets the Duration Unit as hour. + Hour, + + ///Sets the Duration Unit as minute. + Minute +} + + +enum minutesPerInterval{ + + ///Sets the interval automatically according with schedule start and end date. + Auto, + + ///Sets one minute intervals per hour. + OneMinute, + + ///Sets Five minute intervals per hour. + FiveMinutes, + + ///Sets fifteen minute intervals per hour. + FifteenMinutes, + + ///Sets thirty minute intervals per hour. + ThirtyMinutes +} + + +enum ScheduleHeaderType{ + + ///Sets year Schedule Mode. + Year, + + ///Sets month Schedule Mode. + Month, + + ///Sets week Schedule Mode. + Week, + + ///Sets day Schedule Mode. + Day, + + ///Sets hour Schedule Mode. + Hour +} + + +enum workingTimeScale{ + + ///Sets eight hour timescale. + TimeScale8Hours, + + ///Sets twenty four hour timescale. + TimeScale24Hours +} + +} + +class ReportViewer extends ej.Widget { + static fn: ReportViewer; + constructor(element: JQuery, options?: ReportViewer.Model); + constructor(element: Element, options?: ReportViewer.Model); + model:ReportViewer.Model; + defaults:ReportViewer.Model; + + /** Export the report to the specified format. + * @returns {void} + */ + exportReport(): void; + + /** Fit the report page to the container. + * @returns {void} + */ + fitToPage(): void; + + /** Fit the report page height to the container. + * @returns {void} + */ + fitToPageHeight(): void; + + /** Fit the report page width to the container. + * @returns {void} + */ + fitToPageWidth(): void; + + /** Get the available datasets name of the rdlc report. + * @returns {void} + */ + getDataSetNames(): void; + + /** Get the available parameters of the report. + * @returns {void} + */ + getParameters(): void; + + /** Navigate to first page of report. + * @returns {void} + */ + gotoFirstPage(): void; + + /** Navigate to last page of the report. + * @returns {void} + */ + gotoLastPage(): void; + + /** Navigate to next page from the current page. + * @returns {void} + */ + gotoNextPage(): void; + + /** Go to specific page index of the report. + * @returns {void} + */ + gotoPageIndex(): void; + + /** Navigate to previous page from the current page. + * @returns {void} + */ + gotoPreviousPage(): void; + + /** Print the report. + * @returns {void} + */ + print(): void; + + /** Apply print layout to the report. + * @returns {void} + */ + printLayout(): void; + + /** Refresh the report. + * @returns {void} + */ + refresh(): void; +} +export module ReportViewer{ + +export interface Model { + + /**Gets or sets the list of data sources for the RDLC report. + * @Default {[]} + */ + dataSources?: Array; + + /**Enables or disables the page cache of report. + * @Default {false} + */ + enablePageCache?: boolean; + + /**Specifies the export settings. + */ + exportSettings?: ExportSettings; + + /**When set to true, adapts the report layout to fit the screen size of devices on which it renders. + * @Default {true} + */ + isResponsive?: boolean; + + /**Specifies the locale for report viewer. + * @Default {en-US} + */ + locale?: string; + + /**Specifies the page settings. + */ + pageSettings?: PageSettings; + + /**Gets or sets the list of parameters associated with the report. + * @Default {[]} + */ + parameters?: Array; + + /**Enables and disables the print mode. + * @Default {false} + */ + printMode?: boolean; + + /**Specifies the print option of the report. + * @Default {ej.ReportViewer.PrintOptions.Default} + */ + printOptions?: ej.ReportViewer.PrintOptions|string; + + /**Specifies the processing mode of the report. + * @Default {ej.ReportViewer.ProcessingMode.Remote} + */ + processingMode?: ej.ReportViewer.ProcessingMode|string; + + /**Specifies the render layout. + * @Default {ej.ReportViewer.RenderMode.Default} + */ + renderMode?: ej.ReportViewer.RenderMode|string; + + /**Gets or sets the path of the report file. + * @Default {empty} + */ + reportPath?: string; + + /**Gets or sets the reports server url. + * @Default {empty} + */ + reportServerUrl?: string; + + /**Specifies the report Web API service url. + * @Default {empty} + */ + reportServiceUrl?: string; + + /**Specifies the toolbar settings. + */ + toolbarSettings?: ToolbarSettings; + + /**Gets or sets the zoom factor for report viewer. + * @Default {1} + */ + zoomFactor?: number; + + /**Fires when the report viewer is destroyed successfully.If you want to perform any operation after destroying the reportviewer control,you can make use of the destroy event.*/ + destroy? (e: DestroyEventArgs): void; + + /**Fires during drill through action done in report.If you want to perform any operation when a drill through action is performed, you can make use of the drillThrough event.*/ + drillThrough? (e: DrillThroughEventArgs): void; + + /**Fires before report rendering is completed.If you want to perform any operation before the rendering of report,you can make use of the renderingBegin event.*/ + renderingBegin? (e: RenderingBeginEventArgs): void; + + /**Fires after report rendering completed.If you want to perform any operation after the rendering of report,you can make use of this renderingComplete event.*/ + renderingComplete? (e: RenderingCompleteEventArgs): void; + + /**Fires when any error occurred while rendering the report.If you want to perform any operation when an error occurs in the report, you can make use of the reportError event.*/ + reportError? (e: ReportErrorEventArgs): void; + + /**Fires when the report is being exported.If you want to perform any operation before exporting of report, you can make use of the reportExport event.*/ + reportExport? (e: ReportExportEventArgs): void; + + /**Fires when the report is loaded.If you want to perform any operation after the successful loading of report, you can make use of the reportLoaded event.*/ + reportLoaded? (e: ReportLoadedEventArgs): void; + + /**Fires when click the View Report Button.*/ + viewReportClick? (e: ViewReportClickEventArgs): void; +} + +export interface DestroyEventArgs { + + /**true if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the report model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface DrillThroughEventArgs { + + /**true if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the actionInfo's parameters bookmarkLink, hyperLink, reportName, parameters. + */ + actionInfo?: any; + + /**returns the report model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface RenderingBeginEventArgs { + + /**true if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the report model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface RenderingCompleteEventArgs { + + /**true if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the report model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; + + /**returns the collection of parameters. + */ + reportParameters?: any; +} + +export interface ReportErrorEventArgs { + + /**true if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the error details. + */ + error?: string; + + /**returns the report model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface ReportExportEventArgs { + + /**true if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the report model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface ReportLoadedEventArgs { + + /**true if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the report model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface ViewReportClickEventArgs { + + /**true if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the parameter collection. + */ + parameters?: any; + + /**returns the report model. + */ + model?: any; + + /**returns the name of the event. + */ + type?: string; +} + +export interface DataSources { + + /**Gets or sets the name of the data source. + * @Default {empty} + */ + name?: string; + + /**Gets or sets the values of data source. + * @Default {[]} + */ + values?: Array; +} + +export interface ExportSettings { + + /**Specifies the export formats. + * @Default {ej.ReportViewer.ExportOptions.All} + */ + exportOptions?: ej.ReportViewer.ExportOptions|string; + + /**Specifies the excel export format. + * @Default {ej.ReportViewer.ExcelFormats.Excel97to2003} + */ + excelFormat?: ej.ReportViewer.ExcelFormats|string; + + /**Specifies the word export format. + * @Default {ej.ReportViewer.WordFormats.Doc} + */ + wordFormat?: ej.ReportViewer.WordFormats|string; +} + +export interface PageSettings { + + /**Specifies the print layout orientation. + * @Default {null} + */ + orientation?: ej.ReportViewer.Orientation|string; + + /**Specifies the paper size of print layout. + * @Default {null} + */ + paperSize?: ej.ReportViewer.PaperSize|string; +} + +export interface Parameters { + + /**Gets or sets the parameter labels. + * @Default {null} + */ + labels?: Array; + + /**Gets or sets the name of the parameter. + * @Default {empty} + */ + name?: string; + + /**Gets or sets whether the parameter allows nullable value or not. + * @Default {false} + */ + nullable?: boolean; + + /**Gets or sets the prompt message associated with the specified parameter. + * @Default {empty} + */ + prompt?: string; + + /**Gets or sets the parameter values. + * @Default {[]} + */ + values?: Array; +} + +export interface ToolbarSettings { + + /**Fires when user click on toolbar item in the toolbar. + * @Default {empty} + */ + click?: string; + + /**Specifies the toolbar items. + * @Default {ej.ReportViewer.ToolbarItems.All} + */ + items?: ej.ReportViewer.ToolbarItems|string; + + /**Shows or hides the toolbar. + * @Default {true} + */ + showToolbar?: boolean; + + /**Shows or hides the tooltip of toolbar items. + * @Default {true} + */ + showTooltip?: boolean; + + /**Specifies the toolbar template ID. + * @Default {empty} + */ + templateId?: string; +} + +enum ExportOptions{ + + ///Specifies the All property in ExportOptions to get all availble options. + All, + + ///Specifies the Pdf property in ExportOptions to get Pdf option. + Pdf, + + ///Specifies the Word property in ExportOptions to get Word option. + Word, + + ///Specifies the Excel property in ExportOptions to get Excel option. + Excel, + + ///Specifies the Html property in ExportOptions to get Html option. + Html +} + + +enum ExcelFormats{ + + ///Specifies the Excel97to2003 property in ExcelFormats to get specified version of exported format. + Excel97to2003, + + ///Specifies the Excel2007 property in ExcelFormats to get specified version of exported format. + Excel2007, + + ///Specifies the Excel2010 property in ExcelFormats to get specified version of exported format. + Excel2010, + + ///Specifies the Excel2013 property in ExcelFormats to get specified version of exported format. + Excel2013 +} + + +enum WordFormats{ + + ///Specifies the Doc property in WordFormats to get specified version of exported format. + Doc, + + ///Specifies the Dot property in WordFormats to get specified version of exported format. + Dot, + + ///Specifies the Docx property in WordFormats to get specified version of exported format. + Docx, + + ///Specifies the Word2007 property in WordFormats to get specified version of exported format. + Word2007, + + ///Specifies the Word2010 property in WordFormats to get specified version of exported format. + Word2010, + + ///Specifies the Word2013 property in WordFormats to get specified version of exported format. + Word2013, + + ///Specifies the Word2007Dotx property in WordFormats to get specified version of exported format. + Word2007Dotx, + + ///Specifies the Word2010Dotx property in WordFormats to get specified version of exported format. + Word2010Dotx, + + ///Specifies the Word2013Dotx property in WordFormats to get specified version of exported format. + Word2013Dotx, + + ///Specifies the Word2007Docm property in WordFormats to get specified version of exported format. + Word2007Docm, + + ///Specifies the Word2010Docm property in WordFormats to get specified version of exported format. + Word2010Docm, + + ///Specifies the Word2013Docm property in WordFormats to get specified version of exported format. + Word2013Docm, + + ///Specifies the Word2007Dotm property in WordFormats to get specified version of exported format. + Word2007Dotm, + + ///Specifies the Word2010Dotm property in WordFormats to get specified version of exported format. + Word2010Dotm, + + ///Specifies the Word2013Dotm property in WordFormats to get specified version of exported format. + Word2013Dotm, + + ///Specifies the Rtf property in WordFormats to get specified version of exported format. + Rtf, + + ///Specifies the Txt property in WordFormats to get specified version of exported format. + Txt, + + ///Specifies the EPub property in WordFormats to get specified version of exported format. + EPub, + + ///Specifies the Html property in WordFormats to get specified version of exported format. + Html, + + ///Specifies the Xml property in WordFormats to get specified version of exported format. + Xml, + + ///Specifies the Automatic property in WordFormats to get specified version of exported format. + Automatic +} + + +enum Orientation{ + + ///Specifies the Landscape property in pageSettings.orientation to get specified layout. + Landscape, + + ///Specifies the portrait property in pageSettings.orientation to get specified layout. + Portrait +} + + +enum PaperSize{ + + ///Specifies the A3 as value in pageSettings.paperSize to get specified size. + A3, + + ///Specifies the A4 as value in pageSettings.paperSize to get specified size. + Portrait, + + ///Specifies the B4(JIS) as value in pageSettings.paperSize to get specified size. + B4_JIS, + + ///Specifies the B5(JIS) as value in pageSettings.paperSize to get specified size. + B5_JIS, + + ///Specifies the Envelope #10 as value in pageSettings.paperSize to get specified size. + Envelope_10, + + ///Specifies the Envelope as value in pageSettings.paperSize to get specified size. + Envelope_Monarch, + + ///Specifies the Executive as value in pageSettings.paperSize to get specified size. + Executive, + + ///Specifies the Legal as value in pageSettings.paperSize to get specified size. + Legal, + + ///Specifies the Letter as value in pageSettings.paperSize to get specified size. + Letter, + + ///Specifies the Tabloid as value in pageSettings.paperSize to get specified size. + Tabloid, + + ///Specifies the Custom as value in pageSettings.paperSize to get specified size. + Custom +} + + +enum PrintOptions{ + + ///Specifies the Default property in printOptions. + Default, + + ///Specifies the NewTab property in printOptions. + NewTab, + + ///Specifies the None property in printOptions. + None +} + + +enum ProcessingMode{ + + ///Specifies the Remote property in processingMode. + Remote, + + ///Specifies the Local property in processingMode. + Local +} + + +enum RenderMode{ + + ///Specifies the Default property in RenderMode to get default output. + Default, + + ///Specifies the Mobile property in RenderMode to get specified output. + Mobile, + + ///Specifies the Desktop property in RenderMode to get specified output. + Desktop +} + + +enum ToolbarItems{ + + ///Specifies the Print as value in ToolbarItems to get specified item. + Print, + + ///Specifies the Refresh as value in ToolbarItems to get specified item. + Refresh, + + ///Specifies the Zoom as value in ToolbarItems to get specified item. + Zoom, + + ///Specifies the FittoPage as value in ToolbarItems to get specified item. + FittoPage, + + ///Specifies the Export as value in ToolbarItems to get specified item. + Export, + + ///Specifies the PageNavigation as value in ToolbarItems to get specified item. + PageNavigation, + + ///Specifies the Parameters as value in ToolbarItems to get specified item. + Parameters, + + ///Specifies the PrintLayout as value in ToolbarItems to get specified item. + PrintLayout, + + ///Specifies the PageSetup as value in ToolbarItems to get specified item. + PageSetup +} + +} + +class TreeGrid extends ej.Widget { + static fn: TreeGrid; + constructor(element: JQuery, options?: TreeGrid.Model); + constructor(element: Element, options?: TreeGrid.Model); + model:TreeGrid.Model; + defaults:TreeGrid.Model; + + /** To clear all the selection in TreeGrid + * @param {number} you can pass a row index to clear the row selection. + * @returns {void} + */ + clearSelection(index: number): void; + + /** To collapse all the parent items in tree grid + * @returns {void} + */ + collapseAll(): void; + + /** To hide the column by using header text + * @param {string} you can pass a header text of a column to hide. + * @returns {void} + */ + hideColumn(headerText: string): void; + + /** To refresh the changes in tree grid + * @param {Array} Pass which data source you want to show in tree grid + * @param {any} Pass which data you want to show in tree grid + * @returns {void} + */ + refresh(dataSource: Array, query: any): void; + + /** Freeze all the columns preceding to the column specified by the field name. + * @param {string} Freeze all Columns before this field column. + * @returns {void} + */ + freezePrecedingColumns (field: string): void; + + /** Freeze/unfreeze the specified column. + * @param {string} Freeze/Unfreeze this field column. + * @param {boolean} Decides to Freeze/Unfreeze this field column. + * @returns {void} + */ + freezeColumn (field: string, isFrozen: boolean): void; + + /** To save the edited cell in TreeGrid + * @returns {void} + */ + saveCell(): void; + + /** To search an item with search string provided at the run time + * @param {string} you can pass a searchString to search the tree grid + * @returns {void} + */ + search(searchString: string): void; + + /** To show the column by using header text + * @param {string} you can pass a header text of a column to show. + * @returns {void} + */ + showColumn(headerText: string): void; + + /** To sorting the data based on the particular fields + * @param {string} you can pass a name of column to sort. + * @param {string} you can pass a sort direction to sort the column. + * @returns {void} + */ + sortColumn(columnName: string, columnSortDirection: string): void; +} +export module TreeGrid{ + +export interface Model { + + /**Enables or disables the ability to resize the column width interactively. + * @Default {false} + */ + allowColumnResize?: boolean; + + /**Enables or disables the ability to drag and drop the row interactively to reorder the rows. + * @Default {false} + */ + allowDragAndDrop?: boolean; + + /**Enables or disables the ability to filter the data on all the columns. Enabling this property will display a row with editor controls corresponding to each column. You can restrict filtering on particular column by disabling this property directly on that column instance itself. + * @Default {false} + */ + allowFiltering?: boolean; + + /**Enables or disables keyboard navigation. + * @Default {true} + */ + allowKeyboardNavigation?: boolean; + + /**Enables or disables the ability to sort the rows based on multiple columns/fields by clicking on each column header. Rows will be sorted recursively on clicking the column headers. + * @Default {false} + */ + allowMultiSorting?: boolean; + + /**Enables or disables the ability to select a row interactively. + * @Default {true} + */ + allowSelection?: boolean; + + /**Enables or disables the ability to sort the rows based on a single field/column by clicking on that column header. When enabled, rows can be sorted only by single field/column. + * @Default {false} + */ + allowSorting?: boolean; + + /**Specifies the id of the template that has to be applied for alternate rows. + */ + altRowTemplateID?: string; + + /**Specifies the mapping property path for sub tasks in datasource + */ + childMapping?: string; + + /**Option for adding columns; each column has the option to bind to a field in the dataSource. + */ + columns?: Array; + + /**Options for displaying and customizing context menu items. + */ + contextMenuSettings?: ContextMenuSettings; + + /**Specifies hierarchical or self-referential data to populate the TreeGrid. + * @Default {null} + */ + dataSource?: Array; + + /**Specifies whether to wrap the header text when it is overflown i.e., when it exceeds the header width. + * @Default {none} + */ + headerTextOverflow?: string; + + /**Options for displaying and customizing the tooltip. This tooltip will show the preview of the row that is being dragged. + */ + dragTooltip?: DragTooltip; + + /**Options for enabling and configuring the editing related operations. + */ + editSettings?: EditSettings; + + /**Specifies whether to render alternate rows in different background colors. + * @Default {true} + */ + enableAltRow?: boolean; + + /**Specifies whether to load all the rows in collapsed state when the TreeGrid is rendered for the first time. + * @Default {false} + */ + enableCollapseAll?: boolean; + + /**Specifies whether to resize TreeGrid whenever window size changes. + * @Default {false} + */ + enableResize?: boolean; + + /**Specifies whether to render only the visual elements that are visible in the UI. When you enable this property, it will reduce the loading time for loading large number of records. + * @Default {false} + */ + enableVirtualization?: boolean; + + /**Specifies if the filtering should happen immediately on each key press or only on pressing enter key. + * @Default {immediate} + */ + filterBarMode?: string; + + /**Specifies the name of the field in the dataSource, which contains the id of that row. + */ + idMapping?: string; + + /**Specifies the name of the field in the dataSource, which contains the parent’s id. This is necessary to form a parent-child hierarchy, if the dataSource contains self-referential data. + */ + parentIdMapping?: string; + + /**Specifies ej.Query to select data from the dataSource. This property is applicable only when the dataSource is ej.DataManager. + * @Default {null} + */ + query?: any; + + /**Specifies the height of a single row in tree grid. Also, we need to set same height in the CSS style with class name e-rowcell. + * @Default {30} + */ + rowHeight?: number; + + /**Specifies the id of the template to be applied for all the rows. + */ + rowTemplateID?: string; + + /**Specifies the index of the selected row. + * @Default {-1} + */ + selectedRowIndex?: number; + + /**Specifies the type of selection whether to select single row or multiple rows. + * @Default {ej.TreeGrid.SelectionType.Single} + */ + selectionType?: ej.Gantt.SelectionType|string; + + /**Controls the visibility of the menu button, which is displayed on the column header. Clicking on this button will show a popup menu. When you choose “Columns” item from this popup, a list box with column names will be shown, from which you can select/deselect a column name to control the visibility of the respective columns. + * @Default {false} + */ + showColumnChooser?: boolean; + + /**Specifies whether to show tooltip when mouse is hovered on the cell. + * @Default {true} + */ + showGridCellTooltip?: boolean; + + /**Specifies whether to show tooltip for the cells, which has expander button. + * @Default {true} + */ + showGridExpandCellTooltip?: boolean; + + /**Options for setting width and height for TreeGrid. + */ + sizeSettings?: SizeSettings; + + /**Options for sorting the rows. + */ + sortSettings?: SortSettings; + + /**Options for displaying and customizing the toolbar items. + */ + toolbarSettings?: ToolbarSettings; + + /**Specifies the index of the column that needs to have the expander button. By default, cells in the first column contain the expander button. + * @Default {0} + */ + treeColumnIndex?: number; + + /**Triggered before every success event of TreeGrid action.*/ + actionBegin? (e: ActionBeginEventArgs): void; + + /**Triggered for every TreeGrid action success event.*/ + actionComplete? (e: ActionCompleteEventArgs): void; + + /**Triggered while enter the edit mode in the TreeGrid cell*/ + beginEdit? (e: BeginEditEventArgs): void; + + /**Triggered after collapsed the TreeGrid record*/ + collapsed? (e: CollapsedEventArgs): void; + + /**Triggered while collapsing the TreeGrid record*/ + collapsing? (e: CollapsingEventArgs): void; + + /**Triggered while Context Menu is rendered in TreeGrid control*/ + contextMenuOpen? (e: ContextMenuOpenEventArgs): void; + + /**Triggered after saved the modified cellValue in TreeGrid*/ + endEdit? (e: EndEditEventArgs): void; + + /**Triggered after expand the record*/ + expanded? (e: ExpandedEventArgs): void; + + /**Triggered while expanding the TreeGrid record*/ + expanding? (e: ExpandingEventArgs): void; + + /**Triggered while Treegrid is loaded*/ + load? (e: LoadEventArgs): void; + + /**Triggered while rendering each cell in the TreeGrid*/ + queryCellInfo? (e: QueryCellInfoEventArgs): void; + + /**Triggered while rendering each row*/ + rowDataBound? (e: RowDataBoundEventArgs): void; + + /**Triggered while dragging a row in TreeGrid control*/ + rowDrag? (e: RowDragEventArgs): void; + + /**Triggered while start to drag row in TreeGrid control*/ + rowDragStart? (e: RowDragStartEventArgs): void; + + /**Triggered while drop a row in TreeGrid control*/ + rowDragStop? (e: RowDragStopEventArgs): void; + + /**Triggered after the row is selected.*/ + rowSelected? (e: RowSelectedEventArgs): void; + + /**Triggered before the row is going to be selected.*/ + rowSelecting? (e: RowSelectingEventArgs): void; + + /**Triggered when toolbar item is clicked in TreeGrid.*/ + toolbarClick? (e: ToolbarClickEventArgs): void; +} + +export interface ActionBeginEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the current grouped column field name. + */ + columnName?: string; + + /**Returns the TreeGrid model. + */ + model?: any; + + /**Returns request type. + */ + requestType?: string; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the direction of sorting ascending or descending. + */ + columnSortDirection?: string; + + /**Returns the value of expanding parent element. + */ + keyValue?: string; + + /**Returns the data or deleting element. + */ + data?: string; +} + +export interface ActionCompleteEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the grid model. + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the current grouped column field name. + */ + columnName?: string; + + /**Returns request type. + */ + requestType?: string; + + /**Returns the direction of sorting ascending or descending + */ + columnSortDirection?: string; + + /**Returns the value of searched element. + */ + keyValue?: string; + + /**Returns the data of deleted element. + */ + data?: string; + + /**Returns selected record index + */ + recordIndex?: number; +} + +export interface BeginEditEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the row element of editing cell. + */ + rowElement?: any; + + /**Returns the Element of editing cell. + */ + cellElement?: any; + + /**Returns the data of current cell record. + */ + data?: any; + + /**Returns the column Index of cell belongs. + */ + columnIndex?: number; +} + +export interface CollapsedEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the row index of collapsed record. + */ + recordIndex?: number; + + /**Returns the data of collpsed record.. + */ + data?: any; + + /**Returns Request Type. + */ + requestType?: string; + + /**Returns state of a record whether it is in expanded or collapsed state. + */ + expanded?: boolean; + + /**Returns the event type. + */ + type?: string; +} + +export interface CollapsingEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the row index of collapsing record. + */ + recordIndex?: number; + + /**Returns the data of collapsing record.. + */ + data?: any; + + /**Returns the event Type. + */ + type?: string; + + /**Returns state of a record whether it is in expanded or collapsing state. + */ + expanded?: boolean; +} + +export interface ContextMenuOpenEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the default context menu items to which we add custom items. + */ + contextMenuItems?: Array; + + /**Returns the TreeGrid model. + */ + model?: any; + + /**Returns request type. + */ + requestType?: string; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface EndEditEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the row element of editing cell. + */ + rowElement?: any; + + /**Returns the Element of editing cell. + */ + cellElement?: any; + + /**Returns the data of edited cell record. + */ + data?: any; + + /**Returns the column name of edited cell belongs. + */ + columnName?: string; + + /**Returns the column object of edited cell belongs. + */ + columnObject?: any; +} + +export interface ExpandedEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the row index of expanded record. + */ + recordIndex?: number; + + /**Returns the data of expanded record.. + */ + data?: any; + + /**Returns Request Type. + */ + requestType?: string; + + /**Returns state of a record whether it is in expanded or expanded state. + */ + expanded?: boolean; + + /**Returns the event type. + */ + type?: string; +} + +export interface ExpandingEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the row index of expanding record. + */ + recordIndex?: number; + + /**Returns the data of expanding record.. + */ + data?: any; + + /**Returns the event Type. + */ + type?: string; + + /**Returns state of a record whether it is in expanded or collapsed state. + */ + expanded?: boolean; +} + +export interface LoadEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the TreeGrid model + */ + model?: any; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface QueryCellInfoEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the selecting cell element. + */ + cellElement?: any; + + /**Returns the value of cell. + */ + cellValue?: string; + + /**Returns the data of current cell record. + */ + data?: any; + + /**Returns the column of cell belongs. + */ + column?: any; +} + +export interface RowDataBoundEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the row element of rendering row. + */ + rowElement?: any; + + /**Returns the data of rendering row record. + */ + data?: any; +} + +export interface RowDragEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the row which we start to drag. + */ + draggedRow?: any; + + /**Returns the row index which we start to drag. + */ + draggedRowIndex?: number; + + /**Returns the row on which we are dragging. + */ + targetRow?: any; + + /**Returns the row index on which we are dragging. + */ + targetRowIndex?: number; + + /**Returns that we can drop over that record or not. + */ + canDrop?: boolean; + + /**Returns the TreeGrid model. + */ + model?: any; + + /**Returns request type. + */ + requestType?: string; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface RowDragStartEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the row which we start to drag. + */ + draggedRow?: any; + + /**Returns the row index which we start to drag. + */ + draggedRowIndex?: boolean; + + /**Returns the TreeGrid model. + */ + model?: any; + + /**Returns request type. + */ + requestType?: string; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface RowDragStopEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the row which we start to drag. + */ + draggedRow?: any; + + /**Returns the row index which we start to drag. + */ + draggedRowIndex?: number; + + /**Returns the row which we are dropped to row. + */ + targetRow?: any; + + /**Returns the row index which we are dropped to row. + */ + targetRowIndex?: number; + + /**Returns the TreeGrid model. + */ + model?: any; + + /**Returns request type. + */ + requestType?: string; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface RowSelectedEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the selecting row element. + */ + targetRow?: any; + + /**Returns the index of selecting row record. + */ + recordIndex?: number; + + /**Returns the data of selected record. + */ + data?: any; + + /**Returns the event type. + */ + type?: string; +} + +export interface RowSelectingEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the data selecting record. + */ + data?: any; + + /**Returns the index of selecting row record. + */ + recordIndex?: string; + + /**Returns the selecting row element. + */ + targetRow?: any; + + /**Returns the previous selected data. + */ + previousData?: any; + + /**Returns the previous selected row index. + */ + previousIndex?: string; + + /**Returns the previous selected row element. + */ + previousTreeGridRow?: any; +} + +export interface ToolbarClickEventArgs { + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the current item. + */ + currentTarget?: any; + + /**Returns the TreeGrid model. + */ + model?: any; + + /**Returns the name of the toolbar item on which mouse click has been performed + */ + itemName?: string; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface Columns { + + /**Enables or disables the ability to filter the rows based on this column. + * @Default {false} + */ + allowFiltering?: boolean; + + /**Enables or disables the ability to sort the rows based on this column/field. + * @Default {false} + */ + allowSorting?: boolean; + + /**Specifies the edit type of the column. + * @Default {ej.TreeGrid.EditingType.String} + */ + editType?: ej.TreeGrid.EditingType|string; + + /**Specifies the name of the field from the dataSource to bind with this column. + */ + field?: string; + + /**Specifies the type of the editor control to be used to filter the rows. + * @Default {ej.TreeGrid.EditingType.String} + */ + filterEditType?: ej.TreeGrid.EditingType|string; + + /**Header text of the column. + * @Default {null} + */ + headerText?: string; + + /**Controls the visibility of the column. + * @Default {true} + */ + visible?: boolean; + + /**Specifies the header template value for the column header + */ + headerTemplateID?: string; + + /**Specifies whether the column is frozen + * @Default {false} + */ + isFrozen?: boolean; + + /**Enables or disables the ability to freeze/unfreeze the columns + * @Default {false} + */ + allowFreezing?: boolean; +} + +export interface ContextMenuSettings { + + /**Option for adding items to context menu. + * @Default {[]} + */ + contextMenuItems?: Array; + + /**Shows/hides the context menu. + * @Default {false} + */ + showContextMenu?: boolean; +} + +export interface DragTooltip { + + /**Specifies whether to show tooltip while dragging a row. + * @Default {true} + */ + showTooltip?: boolean; + + /**Option to add field names whose corresponding values in the dragged row needs to be shown in the preview tooltip. + * @Default {[]} + */ + tooltipItems?: Array; + + /**Custom template for that tooltip that is shown while dragging a row. + * @Default {null} + */ + tooltipTemplate?: string; +} + +export interface EditSettings { + + /**Enables or disables the button to add new row in context menu as well as in toolbar. + * @Default {true} + */ + allowAdding?: boolean; + + /**Enables or disables the button to delete the selected row in context menu as well as in toolbar. + * @Default {true} + */ + allowDeleting?: boolean; + + /**Enables or disables the ability to edit a row or cell. + * @Default {false} + */ + allowEditing?: boolean; + + /**specifies the edit mode in TreeGrid , "cellEditing" is for cell type editing and "rowEditing" is for entire row. + * @Default {ej.TreeGrid.EditMode.CellEditing} + */ + editMode?: ej.TreeGrid.EditMode|string; + + /**Specifies the position where the new row has to be added. + * @Default {top} + */ + rowPosition?: ej.TreeGrid.RowPosition|string; +} + +export interface SizeSettings { + + /**Height of the TreeGrid. + * @Default {null} + */ + height?: string; + + /**Width of the TreeGrid. + * @Default {null} + */ + width?: string; +} + +export interface SortSettings { + + /**Option to add columns based on which the rows have to be sorted recursively. + * @Default {[]} + */ + sortedColumns?: Array; +} + +export interface ToolbarSettings { + + /**Shows/hides the toolbar. + * @Default {false} + */ + showToolBar?: boolean; + + /**Option to add items to the toolbar. + * @Default {[]} + */ + toolbarItems?: Array; +} + +enum EditingType{ + + ///It Specifies String edit type. + String, + + ///It Specifies Boolean edit type. + Boolean, + + ///It Specifies Numeric edit type. + Numeric, + + ///It Specifies Dropdown edit type. + Dropdown, + + ///It Specifies DatePicker edit type. + DatePicker, + + ///It Specifies DateTimePicker edit type. + DateTimePicker, + + ///It Specifies Maskedit edit type. + Maskedit +} + + +enum EditMode{ + + ///you can edit a cell. + CellEditing, + + ///you can edit a row. + RowEditing +} + + +enum RowPosition{ + + ///you can add a new row at top. + Top, + + ///you can add a new row at bottom. + Bottom, + + ///you can add a new row to above selected row. + Above, + + ///you can add a new row to below selected row. + Below, + + ///you can add a new row as a child for selected row. + Child +} + +} +module Gantt +{ +enum SelectionType +{ +//you can select a single row. +Single, +//you can select a multiple row. +Multiple, +} +} + +class NavigationDrawer extends ej.Widget { + static fn: NavigationDrawer; + constructor(element: JQuery, options?: NavigationDrawer.Model); + constructor(element: Element, options?: NavigationDrawer.Model); + model:NavigationDrawer.Model; + defaults:NavigationDrawer.Model; + + /** To close the navigation drawer control + * @returns {void} + */ + close(): void; + + /** To open the navigation drawer control + * @returns {void} + */ + open(): void; + + /** To Toggle the navigation drawer control + * @returns {void} + */ + toggle(): void; +} +export module NavigationDrawer{ + +export interface Model { + + /**Specifies the contentId for navigation drawer, where the ajax content need to updated + * @Default {null} + */ + contentid?: string; + + /**Sets the root class for NavigationDrawer theme. This cssClass API helps to use custom skinning option for NavigationDrawer control. By defining the root class using this API, we need to include this root class in CSS. + */ + cssclass?: string; + + /**Sets the Direction for the control. See Direction + * @Default {left} + */ + direction?: ej.Direction|string; + + /**Sets the listview to be enabled or not + * @Default {false} + */ + enablelistview?: boolean; + + /**Specifies the listview items as an array of object. + * @Default {[]} + */ + items?: Array; + + /**Sets all the properties of listview to render in navigation drawer + */ + listviewsettings?: any; + + /**Specifies position whether it is in fixed or relative to the page. See Position + * @Default {normal} + */ + position?: string; + + /**Specifies the targetId for navigation drawer + */ + targetid?: string; + + /**Sets the rendering type of the control. See Type + * @Default {overlay} + */ + type?: string; + + /**Specifies the width of the control + * @Default {auto} + */ + width?: number; + + /**Event triggers before the control gets closed.*/ + beforeclose? (e: BeforecloseEventArgs): void; + + /**Event triggers when the control open.*/ + open? (e: OpenEventArgs): void; + + /**Event triggers when the Swipe happens.*/ + swipe? (e: SwipeEventArgs): void; +} + +export interface BeforecloseEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the Navigation Drawer model + */ + model?: ej.NavigationDrawer.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the item of element + */ + item?: any; + + /**returns the name of item + */ + itemName?: string; +} + +export interface OpenEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the Navigation Drawer model + */ + model?: ej.NavigationDrawer.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the item of element + */ + item?: any; + + /**returns the name of item + */ + itemName?: string; +} + +export interface SwipeEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the Navigation Drawer model + */ + model?: ej.NavigationDrawer.Model; + + /**returns the name of the event + */ + type?: string; + + /**returns the item of element + */ + item?: any; + + /**returns the name of item + */ + itemName?: string; +} +} + +class RadialMenu extends ej.Widget { + static fn: RadialMenu; + constructor(element: JQuery, options?: RadialMenu.Model); + constructor(element: Element, options?: RadialMenu.Model); + model:RadialMenu.Model; + defaults:RadialMenu.Model; + + /** To hide the redialmenu + * @returns {void} + */ + hide(): void; + + /** To hide the redialmenu items + * @returns {void} + */ + menuHide(): void; + + /** To Show the redialmenu + * @returns {void} + */ + show(): void; +} +export module RadialMenu{ + +export interface Model { + + /**To show the Radial in intial render. + */ + autoOpen?: boolean; + + /**Renders the back button Image for Radial using class. + */ + backImageClass?: string; + + /**Sets the root class for RadialMenu theme. This cssClass API helps to use custom skinning option for RadialMenu control. By defining the root class using this API, we need to include this root class in CSS. + */ + cssClass?: string; + + /**To enable Animation for Radial Menu. + */ + enableAnimation?: boolean; + + /**Renders the Image for Radial using Class. + */ + imageClass?: string; + + /**Specifies the radius of radial menu + */ + radius?: number; + + /**To show the Radial while clicking given target element. + */ + targetElementId?: string; + + /**Event triggers when the mouse down happens.*/ + mouseDown? (e: MouseDownEventArgs): void; + + /**Event triggers when the mouse up happens.*/ + mouseUp? (e: MouseUpEventArgs): void; + + /**Event triggers when we select an item.*/ + select? (e: SelectEventArgs): void; +} + +export interface MouseDownEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the Radialmenu model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; + + /**returns the item of element + */ + item?: any; + + /**returns the name of item + */ + itemName?: string; +} + +export interface MouseUpEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the Radialmenu model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; + + /**returns the item of element + */ + item?: any; + + /**returns the name of item + */ + itemName?: string; +} + +export interface SelectEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the Radialmenu model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; + + /**returns the item of element + */ + item?: any; + + /**returns the name of item + */ + itemName?: string; +} +} + +class Tile extends ej.Widget { + static fn: Tile; + constructor(element: JQuery, options?: Tile.Model); + constructor(element: Element, options?: Tile.Model); + model:Tile.Model; + defaults:Tile.Model; + + /** Update the image template of tile item to another one. + * @param {string} UpdateTemplate by using id + * @returns {void} + */ + updateTemplate(name: string): void; +} +export module Tile{ + +export interface Model { + + /**Section for badge specific functionalities and it represents the notification for tile items. + */ + badge?: Badge; + + /**Specifies the tile caption in outside of template content. + * @Default {null} + */ + captionTemplateId?: string; + + /**Sets the root class for Tile theme. This cssClass API helps to use custom skinning option for Tile control. By defining the root class using this API, we need to include this root class in CSS. + */ + cssClass?: string; + + /**Saves current model value to browser cookies for state maintains. While refreshing the page retains the model value applies from browser cookies. + * @Default {false} + */ + enablePersistence?: boolean; + + /**Customize the tile size height. + * @Default {null} + */ + height?: number; + + /**Specifies Tile imageClass, using this property we can give images for each tile through css classes. + * @Default {null} + */ + imageClass?: string; + + /**Specifies the position of tile image. See imagePosition + * @Default {center} + */ + imagePosition?: ej.Tile.ImagePosition|string; + + /**Specifies the tile image in outside of template content. + * @Default {null} + */ + imageTemplateId?: string; + + /**Specifies the url of tile image. + * @Default {null} + */ + imageUrl?: string; + + /**Section for livetile specific functionalities. + */ + livetile?: Livetile; + + /**Specifies whether the tile text to be shown or hidden. + * @Default {true} + */ + showText?: boolean; + + /**Changes the text of a tile. + * @Default {Text} + */ + text?: string; + + /**Aligns the text of a tile. See textAlignment + * @Default {normal} + */ + textAlignment?: ej.Tile.TextAlignment|string; + + /**Specifies the size of a tile. See tileSize + * @Default {small} + */ + tileSize?: ej.Tile.TileSize|string; + + /**Customize the tile size width. + * @Default {null} + */ + width?: number; + + /**Sets the rounded corner to tile. + * @Default {false} + */ + showRoundedCorner?: boolean; + + /**Sets allowSelection to tile. + * @Default {false} + */ + allowSelection?: boolean; + + /**Sets the background color to tile. + * @Default {false} + */ + backgroundColor?: string; + + /**Event triggers when the mouse down happens in the tile*/ + mouseDown? (e: MouseDownEventArgs): void; + + /**Event triggers when the mouse up happens in the tile*/ + mouseUp? (e: MouseUpEventArgs): void; +} + +export interface MouseDownEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the tile model + */ + model?: boolean; + + /**returns the name of the event + */ + type?: boolean; + + /**returns the current tile text + */ + text?: string; + + /**returns the index of current tile item + */ + index?: number; +} + +export interface MouseUpEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the tile model + */ + model?: boolean; + + /**returns the name of the event + */ + type?: boolean; + + /**returns the current tile text + */ + text?: boolean; + + /**returns the index of current tile item + */ + index?: number; +} + +export interface Badge { + + /**Specifies whether to enable badge or not. + * @Default {false} + */ + enabled?: boolean; + + /**Specifies maximum value for tile badge. + * @Default {100} + */ + maxValue?: number; + + /**Specifies minimum value for tile badge. + * @Default {1} + */ + minValue?: number; + + /**Specifies text instead of number for tile badge. + * @Default {null} + */ + text?: string; + + /**Sets value for tile badge. + * @Default {1} + */ + value?: number; + + /**Sets position for tile badge. + * @Default {“bottomright”} + */ + position?: ej.Tile.BadgePosition|string; +} + +export interface Livetile { + + /**Specifies whether to enable livetile or not. + * @Default {false} + */ + enabled?: boolean; + + /**Specifies liveTile images in css classes. + * @Default {null} + */ + imageClass?: string; + + /**Specifies liveTile images in templates. + * @Default {null} + */ + imageTemplateId?: string; + + /**Specifies liveTile images in css classes. + * @Default {null} + */ + imageUrl?: string; + + /**Specifies liveTile type for Tile. See orientation + * @Default {flip} + */ + type?: ej.Tile.LiveTileType|string; + + /**Specifies time interval between two successive livetile animation + * @Default {2000} + */ + updateInterval?: number; + + /**Sets the text to each living tile + * @Default {Null} + */ + text?: Array; +} + +enum BadgePosition{ + + ///To set the topright position of tile badge + Topright, + + ///To set the bottomright of tile image + Bottomright +} + + +enum ImagePosition{ + + ///To set the center position of tile image + Center, + + ///To set the top position of tile image + Top, + + ///To set the bottom position of tile image + Bottom, + + ///To set the right position of tile image + Right, + + ///To set the left position of tile image + Left, + + ///To set the topleft position of tile image + TopLeft, + + ///To set the topright position of tile image + TopRight, + + ///To set the bottomright position of tile image + BottomRight, + + ///To set the bottomleft position of tile image + BottomLeft, + + ///To set the fill position of tile image + Fill +} + + +enum LiveTileType{ + + ///To set flip type of liveTile for tile control + Flip, + + ///To set slide type of liveTile for tile control + Slide, + + ///To set carousel type of liveTile for tile control + Carousel +} + + +enum TextAlignment{ + + ///To set the normal alignment of text for tile control + Normal, + + ///To set the left alignment of text for tile control + Left, + + ///To set the right alignment of text for tile control + Right, + + ///To set the center alignment of text for tile control + Center +} + + +enum TextPosition{ + + ///To set the innertop position of the tile text + Innertop, + + ///To set the innerbottom position of the tile text + Innerbottom, + + ///To set the outer position of the tile text + Outer +} + + +enum TileSize{ + + ///To set the medium size for tile control + Medium, + + ///To set the small size for tile control + Small, + + ///To set the large size for tile control + Large, + + ///To set the wide size for tile control + Wide +} + +} + +class RadialSlider extends ej.Widget { + static fn: RadialSlider; + element: JQuery; + constructor(element: JQuery, options?: RadialSliderOptions); + constructor(element: Element, options?: RadialSliderOptions); + model:RadialSliderOptions; + defaults:RadialSliderOptions; + show(): void; + hide(): void; +} + +interface RadialSliderOptions { + radius?: number; + endAngle?: number; + startAngle?: number; + ticks?: Int32Array; + enableRoundOff?: boolean; + value?: number; + strokeWidth?: number; + autoOpen?: boolean; + enableAnimation?: boolean; + cssClass?: string; + innerCircleImageClass?: string; + innerCircleImageUrl?: string; + showInnerCircle?: boolean; + inline?: boolean; + stop? (e: RadialSliderStopEventArgs): void; + start? (e: RadialSliderStartEventArgs): void; + slide? (e: RadialSliderSlideEventArgs): void; + change? (e: RadialSliderChangeEventArgs): void; + mouseover? (e: RadialSliderMouseOverEventArgs): void; + create? (e: RadialSliderCreateEventArgs): void; + destory? (e: RadialSliderDestroyEventArgs): void; +} +interface RadialSliderCreateEventArgs { + cancel: boolean; + model: RadialSliderOptions; + type: string; +} +interface RadialSliderDestroyEventArgs { + cancel: boolean; + model: RadialSliderOptions; + type: string; +} +interface RadialSliderStopEventArgs { + cancel: boolean; + model: RadialSliderOptions; + type: string; + value: number; +} + +interface RadialSliderStartEventArgs { + cancel: boolean; + model: RadialSliderOptions; + type: string; + value: number; +} +interface RadialSliderSlideEventArgs { + cancel: boolean; + model: RadialSliderOptions; + type: string; + value: number; + selectedValue: number; +} +interface RadialSliderChangeEventArgs { + cancel: boolean; + model: RadialSliderOptions; + type: string; + value: number; + oldValue: number; +} +interface RadialSliderMouseOverEventArgs { + cancel: boolean; + model: RadialSliderOptions; + type: string; + value: number; + selectedValue: number; +} +class Spreadsheet extends ej.Widget { + static fn: Spreadsheet; + constructor(element: JQuery, options?: Spreadsheet.Model); + constructor(element: Element, options?: Spreadsheet.Model); + model:Spreadsheet.Model; + defaults:Spreadsheet.Model; + + /** This method is used to add a new sheet in the last position of the sheet container. + * @returns {void} + */ + addNewSheet(): void; + + /** It is used to clear all the data and format in the specified range of cells in Spreadsheet. + * @param {string} Optional. If range is specified, then it will clear all content in the specified range else it will use the current selected range. + * @returns {void} + */ + clearAll(range: string): void; + + /** This property is used to clear all the formats applied in the specified range in Spreadsheet. + * @param {string} Optional. If range is specified, then it will clear all format in the specified range else it will use the current selected range. + * @returns {void} + */ + clearAllFormat(range: string): void; + + /** Used to clear the applied border in the specified range in Spreadsheet. + * @param {string} Optional. If range is specified, then it will clear border in the specified range else it will use the current selected range. + * @returns {void} + */ + clearBorder(range: string): void; + + /** This property is used to clear the contents in the specified range in Spreadsheet. + * @param {string} Optional. If the range is specified, then it will clear the content in the specified range else it will use the current selected range. + * @returns {void} + */ + clearContents(range: string): void; + + /** This method is used to remove only the data in the range denoted by the specified range name. + * @param {string} Pass the defined rangeSettings property name. + * @returns {void} + */ + clearRange(rangeName: string): void; + + /** It is used to remove data in the specified range of cells based on the defined property. + * @param {Array|string} Optional. If range is specified, it will clear data for the specified range else it will use the current selected range. + * @param {string} Optional. If property is specified, it will remove the specified property in the range else it will remove default properties + * @param {boolean} Optional. If pass true, if you want to skip the hidden rows + * @returns {void} + */ + clearRangeData(range: Array|string, property: string, skipHiddenRow: boolean): void; + + /** This method is used to copy sheets in Spreadsheet. + * @param {number} Pass the sheet index that you want to copy. + * @param {number} Pass the position index where you want to copy. + * @returns {void} + */ + copySheet(fromIdx: number, toIdx: number): void; + + /** This method is used to delete the entire column which is selected. + * @param {number} Pass the start column index. + * @param {number} Pass the end column index. + * @returns {void} + */ + deleteEntireColumn(startCol: number, endCol: number): void; + + /** This method is used to delete the entire row which is selected. + * @param {number} Pass the start row index. + * @param {number} Pass the end row index. + * @returns {void} + */ + deleteEntireRow(startRow: number, endRow: number): void; + + /** This method is used to delete a particular sheet in the Spreadsheet. + * @param {number} Pass the sheet index to perform delete action. + * @returns {void} + */ + deleteSheet(idx: number): void; + + /** This method is used to delete the selected cells and shift the remaining cells to left. + * @param {any} Row index and column index of the starting cell. + * @param {any} Row index and column index of the ending cell. + * @returns {void} + */ + deleteShiftLeft(startCell: any, endCell: any): void; + + /** This method is used to delete the selected cells and shift the remaining cells up. + * @param {any} Row index and column index of the start cell. + * @param {any} Row index and column index of the end cell. + * @returns {void} + */ + deleteShiftUp(startCell: any, endCell: any): void; + + /** This method is used to edit data in the specified range of cells based on its corresponding rangeSettings. + * @param {string} Pass the defined rangeSettings property name. + * @param {Function} Pass the function that you want to perform range edit. + * @returns {void} + */ + editRange(rangeName: string, fn: Function): void; + + /** This method is used to get the activation panel in the Spreadsheet. + * @returns {HTMLElement} + */ + getActivationPanel(): HTMLElement; + + /** This method is used to get the active cell object in Spreadsheet. It will returns object which contains rowIndex and colIndex of the active cell. + * @param {number} Optional. If sheetIdx is specified, it will return the active cell object in specified sheet index else it will use the current sheet index + * @returns {any} + */ + getActiveCell(sheetIdx: number): any; + + /** This method is used to get the active cell element based on the given sheet index in the Spreadsheet. + * @param {number} Optional. If sheetIndex is specified, it will return the active cell element in specified sheet index else it will use the current active sheet index. + * @returns {HTMLElement} + */ + getActiveCellElem(sheetIdx: number): HTMLElement; + + /** This method is used to get the current active sheet index in Spreadsheet. + * @returns {number} + */ + getActiveSheetIndex(): number; + + /** This method is used to get the auto fill element in Spreadsheet. + * @returns {HTMLElement} + */ + getAutoFillElem(): HTMLElement; + + /** This method is used to get the cell element based on specified row and column index in the Spreadsheet. + * @param {number} Pass the row index. + * @param {number} Pass the column index. + * @param {number} Optional. Pass the sheet index that you want to get cell. + * @returns {HTMLElement} + */ + getCell(rowIdx: number, colIdx: number, sheetIdx: number): HTMLElement; + + /** This method is used to get the frozen columns index in the Spreadsheet. + * @param {number} Pass the sheet index. + * @returns {number} + */ + getFrozenColumns(sheetIdx: number): number; + + /** This method is used to get the frozen row’s index in Spreadsheet. + * @param {number} Pass the sheet index. + * @returns {number} + */ + getFrozenRows(sheetIdx: number): number; + + /** This method is used to get the hyperlink data as object from the specified cell in Spreadsheet. + * @param {HTMLElement} Pass the DOM element to get hyperlink + * @returns {any} + */ + getHyperlink(cell: HTMLElement): any; + + /** This method is used to get all cell elements in the specified range. + * @param {number} Pass the row index of the start cell. + * @param {number} Pass the column index of the start cell. + * @param {number} Pass the row index of the end cell. + * @param {number} Pass the column index of the end cell. + * @param {number} Pass the index of the sheet. + * @returns {HTMLElement} + */ + getRange(startRIndex: number, startCIndex: number, endRIndex: number, endCIndex: number, sheetIdx: number): HTMLElement; + + /** This method is used to get the data in specified range in Spreadsheet. + * @param {Array|string} Optional. If range is specified, it will get range data for the specified range else it will use the current selected range. + * @param {boolean} Pass 'true' if you want cell values alone. + * @param {Array|string} Optional. If property is specified, it will get the specified property in the range else it will get default properties. + * @param {number} Optional. Pass the index of the sheet. + * @param {boolean} Optional. When skipDateTime is set as true, it return 'value2' cell value (cell type as 'datetime') + * @param {boolean} Optional. Pass true, if you want to get the calculated formula value else it return formula string. + * @param {boolean} Optional. Pass true, if you want to skip the hidden rows data. + * @param {number} Optional. Pass virtual row index of sheet. + * @param {number} Optional. Pass virtual row count of sheet. + * @returns {Array} + */ + getRangeData(range: Array|string, valueOnly: boolean, property: Array|string, sheetIdx: number, skipDateTime: boolean, skipFormula: boolean, skipHiddenRow: boolean, virtualRowIdx: number, virtualRowCount: number): Array; + + /** This method is used to get the range indices array based on the specified alpha range in Spreadsheet. + * @param {string} Pass the alpha range that you want to get range indices. + * @returns {Array} + */ + getRangeIndices(range: string): Array; + + /** This method is used to get the sheet details based on the given sheet index in Spreadsheet. + * @param {number} Pass the sheet index to get the sheet object. + * @returns {any} + */ + getSheet(sheetIdx: number): any; + + /** This method is used to get the sheet content div element of Spreadsheet. + * @param {number} Pass the sheet index to get the sheet content. + * @returns {HTMLElement} + */ + getSheetElement(sheetIdx: number): HTMLElement; + + /** This method is used to send a paging request to the specified sheet Index in the Spreadsheet. + * @param {number} Pass the sheet index to perform paging at specified sheet index + * @param {boolean} Pass 'true' to create a new sheet. If the specified sheet index is already exist, it navigate to that sheet else it create a new sheet. + * @returns {void} + */ + gotoPage(sheetIdx: number, newSheet: boolean): void; + + /** This method is used to hide the entire columns from the specified range (startCol, endCol) in Spreadsheet. + * @param {number} Index of the start column. + * @param {number} Index of the end column. + * @returns {void} + */ + hideColumn(startCol: number, endCol: number): void; + + /** This method is used to hide the formula bar in Spreadsheet. + * @returns {void} + */ + hideFormulaBar(): void; + + /** This method is used to hide the rows, based on the specified row index in Spreadsheet. + * @param {number} Index of the start row. + * @param {number} Index of the end row. + * @returns {void} + */ + hideRow(startRow: number, endRow: number): void; + + /** This method is used to hide the sheet based on the specified sheetIndex or sheet name in the Spreadsheet. + * @param {string|number} Pass the sheet name or index that you want to hide. + * @returns {void} + */ + hideSheet(sheetIdx: string|number): void; + + /** This method is used to hide the displayed waiting pop-up in Spreadsheet. + * @returns {void} + */ + hideWaitingPopUp(): void; + + /** This method is used to insert a column before the active cell's column in the Spreadsheet. + * @param {number} Pass start column. + * @param {number} Pass end column. + * @returns {void} + */ + insertEntireColumn(startCol: number, endCol: number): void; + + /** This method is used to insert a row before the active cell's row in the Spreadsheet. + * @param {number} Pass start row. + * @param {number} Pass end row. + * @returns {void} + */ + insertEntireRow(startRow: number, endRow: number): void; + + /** This method is used to insert a new sheet to the left of the current active sheet. + * @returns {void} + */ + insertSheet(): void; + + /** This method is used to insert cells in the selected or specified range and shift remaining cells to bottom. + * @param {any} Row index and column index of the start cell. + * @param {any} Row index and column index of the end cell. + * @returns {void} + */ + insertShiftBottom(startCell: any, endCell: any): void; + + /** This method is used to insert cells in the selected or specified range and shift remaining cells to right. + * @param {any} Row index and column index of the start cell. + * @param {any} Row index and column index of the end cell. + * @returns {void} + */ + insertShiftRight(startCell: any, endCell: any): void; + + /** This method is used to import excel file manually by using form data. + * @param {any} Pass the form data object to import files manually. + * @returns {void} + */ + import(importRequest: any): void; + + /** This method is used to lock/unlock the range of cells in active sheet. Lock cells are activated only after the sheet is protected. Once the sheet is protected it is unable to lock/unlock cells. + * @param {string|Array} Pass the alpha range cells or array range of cells. + * @param {string} Optional. By default is true. If it is false locked cells are unlocked. + * @returns {void} + */ + lockCells(range: string|Array, isLocked: string): void; + + /** This method is used to merge cells by across in the Spreadsheet. + * @param {string} Optional. To pass the cell range or selected cells are process. + * @param {boolean} Optional. If pass true it does not show alert. + * @returns {void} + */ + mergeAcrossCells(range: string, alertStatus: boolean): void; + + /** This method is used to merge the selected cells in the Spreadsheet. + * @param {string} Optional. To pass the cell range or selected cells are process. + * @param {boolean} Optional. If pass true it does not show alert. + * @returns {void} + */ + mergeCells(range: string, alertStatus: boolean): void; + + /** This method is used to move sheets in Spreadsheet. + * @param {number} Pass the sheet index that you want to move. + * @param {number} Pass the position index where you want to move. + * @returns {void} + */ + moveSheet(fromIdx: number, toIdx: number): void; + + /** This method is used to protect or unprotect active sheet. + * @param {boolean} Optional. By default is true. If it is false active sheet is unprotected. + * @returns {void} + */ + protectSheet(isProtected: boolean): void; + + /** This method is used to remove the hyperlink from selected cells of current sheet. + * @param {string} Hyperlink remove from the specified range. + * @param {boolean} Optional. If it is true, It will clear link only not format. + * @returns {void} + */ + removeHyperlink(range: string, isClearHLink: boolean): void; + + /** This method is used to remove the range data and its defined rangeSettings property based on the specified range name. + * @param {string} Pass the defined rangeSetting property name. + * @returns {void} + */ + removeRange(rangeName: string): void; + + /** This method is used to set the active cell in the Spreadsheet. + * @param {number} Pass the row index. + * @param {number} Pass the column index. + * @param {number} Pass the index of the sheet. + * @returns {void} + */ + setActiveCell(rowIdx: number, colIdx: number, sheetIdx: number): void; + + /** This method is used to set active sheet index for the Spreadsheet. + * @param {number} Pass the active sheet index for Spreadsheet. + * @returns {void} + */ + setActiveSheetIndex(sheetIdx: number): void; + + /** This method is used to set border for the specified range of cells in the Spreadsheet. + * @param {any} Pass the border properties that you want to set. + * @param {string} Optional. If range is specified, it will set border for the specified range else it will use the selected range. + * @returns {void} + */ + setBorder(property: any, range: string): void; + + /** This method is used to set the hyperlink in selected cells of the current sheet. + * @param {string} If range is specified, it will set the hyperlink in range of the cells. + * @param {any} Pass cellAddress or webAddress + * @param {number} If we pass cellAddress then which sheet to be navigate in the applied link. + * @returns {void} + */ + setHyperlink(range: string, link: any, sheetIdx: number): void; + + /** This method is used to set the focus to the Spreadsheet. + * @returns {void} + */ + setSheetFocus(): void; + + /** This method is used to set the width for the columns in the Spreadsheet. + * @param {Array|any} Pass the cell index and width of the cells. + * @returns {void} + */ + setWidthToColumns(widthColl: Array|any): void; + + /** This method is used to rename the active sheet. + * @param {string} Pass the sheet name that you want to change the current active sheet name. + * @returns {void} + */ + sheetRename(sheetName: string): void; + + /** This method is used to display the activationPanel for the specified range name. + * @param {string} Pass the range name that you want to display the activation panel. + * @returns {void} + */ + showActivationPanel(rangeName: string): void; + + /** This method is used to show the hidden columns within the specified range in the Spreadsheet. + * @param {number} Index of the start column. + * @param {number} Index of the end column. + * @returns {void} + */ + showColumn(startColIdx: number, endColIdx: number): void; + + /** This method is used to show the formula bar in Spreadsheet. + * @returns {void} + */ + showFormulaBar(): void; + + /** This method is used to show the hidden rows in the specified range in the Spreadsheet. + * @param {number} Index of the start row. + * @param {number} Index of the end row. + * @returns {void} + */ + showRow(startRow: number, endRow: number): void; + + /** This method is used to show waiting pop-up in Spreadsheet. + * @returns {void} + */ + showWaitingPopUp(): void; + + /** This method is used to unfreeze the frozen rows and columns in the Spreadsheet. + * @returns {void} + */ + unfreezePanes(): void; + + /** This method is used to unhide the sheet based on specified sheet name or sheet index. + * @param {string|number} Pass the sheet name or index that you want to unhide. + * @returns {void} + */ + unhideSheet(sheetInfo: string|number): void; + + /** This method is used to unmerge the selected range of cells in the Spreadsheet. + * @param {string} Optional. If the range is specified, then it will un merge the specified range else it will use the current selected range. + * @returns {void} + */ + unmergeCells(range: string): void; + + /** This method is used to unwrap the selected range of cells in the Spreadsheet. + * @param {Array|string} Optional. If the range is specified, then it will update unwrap in the specified range else it will use the current selected range. + * @returns {void} + */ + unWrapText(range: Array|string): void; + + /** This method is used to update the data for the specified range of cells in the Spreadsheet. + * @param {any} Pass the cells data that you want to update. + * @param {Array} Optional. If range is specified, it will update data for the specified range else it will use the current selected range. + * @returns {void} + */ + updateData(data: any, range: Array): void; + + /** This method is used to update the formula bar in the Spreadsheet. + * @returns {void} + */ + updateFormulaBar(): void; + + /** This method is used to update the range of cells based on the specified settings which we want to update in the Spreadsheet. + * @param {number} Pass the sheet index that you want to update. + * @param {any} Pass the dataSource, startCell and showHeader values as settings. + * @returns {void} + */ + updateRange(sheetIdx: number, settings: any): void; + + /** This method is used to update the unique data for the specified range of cells in Spreadsheet. + * @param {any} Pass the data that you want to update in the particular range + * @param {Array|string} Optional. If range is specified, it will update data for the specified range else it will use the current selected range. + * @returns {void} + */ + updateUniqueData(data: any, range: Array|string): void; + + /** This method is used to wrap the selected range of cells in the Spreadsheet. + * @param {Array|string} Optional. If the range is specified, then it will update wrap in the specified range else it will use the current selected range. + * @returns {void} + */ + wrapText(range: Array|string): void; + + XLCellType: Spreadsheet.XLCellType; + + XLCFormat: Spreadsheet.XLCFormat; + + XLChart: Spreadsheet.XLChart; + + XLClipboard: Spreadsheet.XLClipboard; + + XLComment: Spreadsheet.XLComment; + + XLDragDrop: Spreadsheet.XLDragDrop; + + XLDragFill: Spreadsheet.XLDragFill; + + XLEdit: Spreadsheet.XLEdit; + + XLExport: Spreadsheet.XLExport; + + XLFilter: Spreadsheet.XLFilter; + + XLFormat: Spreadsheet.XLFormat; + + XLFreeze: Spreadsheet.XLFreeze; + + XLPrint: Spreadsheet.XLPrint; + + XLResize: Spreadsheet.XLResize; + + XLRibbon: Spreadsheet.XLRibbon; + + XLSearch: Spreadsheet.XLSearch; + + XLSelection: Spreadsheet.XLSelection; + + XLSort: Spreadsheet.XLSort; + + XLValidate: Spreadsheet.XLValidate; +} +export module Spreadsheet{ + +export interface XLCellType { + + /** This method is used to set a cell type from the specified range of cells in the spreadsheet. + * @param {string} Pass the range where you want apply cell type. + * @param {any} Pass type of cell type and its settings. + * @param {number} Optional. Pass sheet index. + * @returns {void} + */ + addCellTypes(range: string,settings: any,sheetIdx: number): void; + + /** This method is used to remove cell type from the specified range of cells in the Spreadsheet. + * @param {string} Pass the range where you want remove cell type. + * @param {number} Optional. Pass sheet index. + * @returns {void} + */ + removeCellTypes(range: string,sheetIdx: number): void; +} + +export interface XLCFormat { + + /** This method is used to clear the applied conditional formatting rules in the Spreadsheet. + * @param {boolean} Pass true if you want to clear rules from selected cells else it will clear rules from entire sheet. + * @param {Array|string} Optional. If range is specified, it will clear rules for the specified range else it will use the current selected range. + * @returns {void} + */ + clearCF(isSelected: boolean,range: Array|string): void; + + /** This method is used to get the applied conditional formatting rules as array of objects based on the specified row Index and column Index in the Spreadsheet. + * @param {number} Pass the row index. + * @param {number} Pass the column index. + * @returns {Array} + */ + getCFRule(rowIdx: number,colIdx: number): Array; + + /** This method is used to set the conditional formatting rule in the Spreadsheet. + * @param {any} Pass the rule to set. + * @returns {void} + */ + setCFRule(rule: any): void; +} + +export interface XLChart { + + /** This method is used to create a chart for specified range in Spreadsheet. + * @param {string} Optional. If range is specified, it will create chart for the specified range else it will use the current selected range. + * @param {any} To pass the type of chart and chart name. + * @returns {void} + */ + createChart(range: string,options: any): void; + + /** This method is used to refresh the chart in the Spreadsheet. + * @param {string} To pass the chart Id. + * @param {any} To pass the type of chart and chart name. + * @returns {void} + */ + refreshChart(id: string,options: any): void; + + /** This method is used to resize the chart of specified id in the Spreadsheet. + * @param {string} To pass the chart id. + * @param {number} To pass height value. + * @param {number} To pass the width value. + * @returns {void} + */ + resizeChart(id: string,height: number,width: number): void; +} + +export interface XLClipboard { + + /** This method is used to copy the selected cells in the Spreadsheet. + * @returns {void} + */ + copy(): void; + + /** This method is used to cut the selected cells in the Spreadsheet. + * @returns {void} + */ + cut(): void; + + /** This method is used to paste the cut or copied cells data in the Spreadsheet. + * @returns {void} + */ + paste(): void; +} + +export interface XLComment { + + /** This method is used to delete the comment in the specified range in Spreadsheet. + * @param {Array|string} Optional. If range is specified, it will delete comments for the specified range else it will use the current selected range. + * @param {number} Optional. If sheetIdx is specified, it will delete comment in specified sheet else it will use active sheet. + * @param {boolean} Optional. Pass true, if you want to skip the hidden rows data. + * @returns {void} + */ + deleteComment(range: Array|string,sheetIdx: number,skipHiddenRow: boolean): void; + + /** This method is used to edit the comment in the target Cell in Spreadsheet. + * @param {any} Optional. Pass the row index and column index of the cell which contains comment. + * @returns {void} + */ + editComment(targetCell: any): void; + + /** This method is used to find the next comment from the active cell in Spreadsheet. + * @returns {boolean} + */ + findNextComment(): boolean; + + /** This method is used to find the previous comment from the active cell in Spreadsheet. + * @returns {boolean} + */ + findPrevComment(): boolean; + + /** This method is used to get comment data for the specified cell. + * @param {HTMLElement} Pass the DOM element to get comment data as object. + * @returns {any} + */ + getComment(cell: HTMLElement): any; + + /** This method is used to set new comment in Spreadsheet. + * @param {string|Array} Optional. If we pass the range comment will set in the range otherwise it will set with selected cells. + * @param {string} Pass the comment data. + * @param {boolean} Optional. Pass true to show comment in edit mode + * @returns {void} + */ + setComment(range: string|Array,data: string,showEditPanel: boolean): void; + + /** This method is used to show all the comments in the Spreadsheet. + * @returns {void} + */ + showAllComments(): void; + + /** This method is used to show or hide the specific comment in the Spreadsheet. + * @param {HTMLElement} Optional. Pass the cell DOM element to show or hide its comment. If pass empty argument active cell will processed. + * @returns {void} + */ + showHideComment(targetCell: HTMLElement): void; +} + +export interface XLDragDrop { + + /** This method is used to drag and drop the selected range of cells to destination range in the Spreadsheet. + * @param {any|Array} Pass the source range to perform drag and drop. + * @param {any|Array} Pass the destination range to drop the dragged cells. + * @returns {void} + */ + moveRangeTo(sourceRange: any|Array,destinationRange: any|Array): void; +} + +export interface XLDragFill { + + /** This method is used to perform auto fill in Spreadsheet. + * @param {any} Pass the options to perform auto fill in Spreadsheet. + * @returns {void} + */ + autoFill(options: any): void; + + /** This method is used to hide the auto fill element in the Spreadsheet. + * @returns {void} + */ + hideAutoFillElement(): void; + + /** This method is used to hide the auto fill options in the Spreadsheet. + * @returns {void} + */ + hideAutoFillOptions(): void; + + /** This method is used to set position of the auto fill element in the Spreadsheet. + * @param {boolean} Pass the drag fill status as boolean value for show auto fill options in Spreadsheet. + * @returns {void} + */ + positionAutoFillElement(isDragFill: boolean): void; +} + +export interface XLEdit { + + /** This method is used to calculate formulas in the specified sheet. + * @param {number} Optional. If sheet index is specified, then it will calculate formulas in the specified sheet only else it will calculate formulas in all sheets. + * @returns {void} + */ + calcNow(sheetIdx: number): void; + + /** This method is used to edit a particular cell based on the row index and column index in the Spreadsheet. + * @param {number} Pass the row index to edit particular cell. + * @param {number} Pass the column index to edit particular cell. + * @param {boolean} Pass true, if you want to maintain previous cell value. + * @returns {void} + */ + editCell(rowIdx: number,colIdx: number,oldData: boolean): void; + + /** This method is used to get the property value of particular cell, based on the row and column index in the Spreadsheet. + * @param {number} Pass the row index to get the property value. + * @param {number} Pass the column index to get the property value. + * @param {string} Optional. Pass the property name that you want("value", "value2", "type", "cFormatRule", "range", "thousandSeparator", "rule", "format", "border", "picture", "chart", "calcValue", "align", "hyperlink", "formats", "borders", "tformats", "tborders", "isFilterHeader", "filterState", "tableName", "comment", "formatStr", "decimalPlaces", "cellType"). + * @param {number} Optional. Pass the index of the sheet. + * @returns {any|string|Array} + */ + getPropertyValue(rowIdx: number,colIdx: number,prop: string,sheetIdx: number): any|string|Array; + + /** This method is used to get the property value in specified cell in Spreadsheet. + * @param {HTMLElement} Pass the cell element to get property value. + * @param {string} Pass the property name that you want ("value", "value2", "type", "cFormatRule", "range", "thousandSeparator", "rule", "format", "border", "picture", "chart", "calcValue", "align", "hyperlink", "formats", "borders", "tformats", "tborders", "isFilterHeader", "filterState", "tableName", "comment", "formatStr", "decimalPlaces", "cellType"). + * @param {number} Pass the index of sheet. + * @returns {void} + */ + getPropertyValueByElem(elem: HTMLElement,property: string,sheetIdx: number): void; + + /** This method is used to save the edited cell value in the Spreadsheet. + * @returns {void} + */ + saveCell(): void; + + /** This method is used to update a particular cell value in the Spreadsheet. + * @param {any} Pass row index and column index of the cell. + * @param {string|number} Pass the cell value. + * @returns {void} + */ + updateCell(cell: any,value: string|number): void; + + /** This method is used to update a particular cell value and its format in the Spreadsheet. + * @param {any} Pass row index and column index of the cell. + * @param {string|number} Pass the cell value. + * @param {string} Pass the class name to update format. + * @param {number} Pass sheet index. + * @returns {void} + */ + updateCellValue(cellIdx: any,val: string|number,formatClass: string,sheetIdx: number): void; +} + +export interface XLExport { + + /** This method is used to save the sheet data as Excel or CSV document (.xls, .xlsx and .csv) in Spreadsheet. + * @param {string} Pass the export type that you want. + * @returns {void} + */ + export(type: string): void; +} + +export interface XLFilter { + + /** This method is used to clear the filter in filtered columns in the Spreadsheet. + * @returns {void} + */ + clearFilter(): void; + + /** This method is used to apply filter for the selected range of cells in the Spreadsheet. + * @param {string} Pass the range of the selected cells. + * @returns {void} + */ + filter(range: string): void; + + /** This method is used to apply filter for the column by active cell's value in the Spreadsheet. + * @returns {void} + */ + filterByActiveCell(): void; +} + +export interface XLFormat { + + /** This method is used to create a table for the selected range of cells in the Spreadsheet. + * @param {any} Pass the table object. + * @param {string} Optional. If the range is specified, then it will create table in the specified range else it will use the current selected range. + * @returns {void} + */ + createTable(tableObject: any,range: string): void; + + /** This method is used to set format style and values in a cell or range of cells. + * @param {any} Pass the formatObject which contains style, type, format, groupSeparator and decimalPlaces. + * @param {string} Pass the range indices to format cells. + * @returns {void} + */ + format(formatObj: any,range: string): void; + + /** This method is used to remove table with specified tableId in the Spreadsheet. + * @param {number} Pass the tableId that you want to remove. + * @returns {void} + */ + removeTable(tableId: number): void; + + /** This method is used to update the decimal places for numeric value for the selected range of cells in the Spreadsheet. + * @param {string} Pass the decimal places type in increment/decrement. + * @param {string} Pass the range indices. + * @returns {void} + */ + updateDecimalPlaces(type: string,range: string): void; + + /** This method is used to update the format for the selected range of cells in the Spreadsheet. + * @param {any} Pass the format object that you want to update. + * @param {Array} Optional. If the range is specified, then it will update format in the specified range else it will use the current selected range. + * @returns {void} + */ + updateFormat(formatObj: any,range: Array): void; + + /** This method is used to update the unique format for selected range of cells in the Spreadsheet. + * @param {string} Pass the unique format class. + * @param {Array} Optional. If the range is specified, then it will update format in the specified range else it will use the current selected range. + * @returns {void} + */ + updateUniqueFormat(formatClass: string,range: Array): void; +} + +export interface XLFreeze { + + /** This method is used to freeze columns upto the specified column index in the Spreadsheet. + * @param {number} Index of the column to be freeze. + * @returns {void} + */ + freezeColumns(colIdx: number): void; + + /** This method is used to freeze the first column in the Spreadsheet. + * @returns {void} + */ + freezeLeftColumn(): void; + + /** This method is used to freeze rows and columns before the specified cell in the Spreadsheet. + * @param {any} Row index and column index of the cell which you want to freeze. + * @returns {void} + */ + freezePanes(cell: any): void; + + /** This method is used to freeze rows upto the specified row index in the Spreadsheet. + * @param {number} Index of the row to be freeze. + * @returns {void} + */ + freezeRows(rowIdx: number): void; + + /** This method is used to freeze the top row in the Spreadsheet. + * @returns {void} + */ + freezeTopRow(): void; +} + +export interface XLPrint { + + /** This method is used to print the selected contents in the Spreadsheet. + * @returns {void} + */ + printSelection(): void; + + /** This method is used to print the entire contents in the active sheet. + * @returns {void} + */ + printSheet(): void; +} + +export interface XLResize { + + /** This method is used to get the column width of the specified column index in the Spreadsheet. + * @param {number} Pass the column index. + * @returns {number} + */ + getColWidth(colIdx: number): number; + + /** This method is used to get the row height of the specified row index in the Spreadsheet. + * @param {number} Pass the row index which you want to find its height. + * @returns {number} + */ + getRowHeight(rowIdx: number): number; + + /** This method is used to set the column width of the specified column index in the Spreadsheet. + * @param {number} Pass the column index. + * @param {number} Pass the width value that you want to set. + * @returns {void} + */ + setColWidth(colIdx: number,size: number): void; + + /** This method is used to set the row height of the specified row index in the Spreadsheet. + * @param {number} Pass the row index. + * @param {number} Pass the height value that you want to set. + * @returns {void} + */ + setRowHeight(rowIdx: number,size: number): void; +} + +export interface XLRibbon { + + /** This method is used to add a new name in the Spreadsheet name manager. + * @param {string} Pass the name that you want to define in name manager. + * @param {string} Pass the cell reference. + * @param {string} Optional. Pass comment, if you want. + * @param {number} Optional. Pass the sheet index. + * @returns {void} + */ + addNamedRange(name: string,refersTo: string,comment: string,sheetIdx: number): void; + + /** This method is used to insert the few type (SUM, MAX, MIN, AVG, COUNT) of formulas in the selected range of cells in the Spreadsheet. + * @param {string} To pass the type("SUM","MAX","MIN","AVG","COUNT"). + * @param {string} If range is specified, it will apply auto sum for the specified range else it will use the current selected range. + * @returns {void} + */ + autoSum(type: string,range: string): void; + + /** This method is used to delete the defined name in the Spreadsheet name manager. + * @param {string} Pass the defined name that you want to remove from name manager. + * @returns {void} + */ + removeNamedRange(name: string): void; +} + +export interface XLSearch { + + /** This method is used to find and replace all data by workbook in the Spreadsheet. + * @param {string} Pass the search data. + * @param {string} Pass the replace data. + * @param {boolean} Pass true, if you want to match with case-sensitive. + * @param {boolean} Pass true, if you want to match with entire cell contents. + * @returns {void} + */ + replaceAllByBook(findData: string,replaceData: string,isCSen: boolean,isEMatch: boolean): void; + + /** This method is used to find and replace all data by sheet in Spreadsheet. + * @param {string} Pass the search data. + * @param {string} Pass the replace data. + * @param {boolean} Pass true, if you want to match with case-sensitive. + * @param {boolean} Pass true, if you want to match with entire cell contents. + * @returns {void} + */ + replaceAllBySheet(findData: string,replaceData: string,isCSen: boolean,isEMatch: boolean): void; +} + +export interface XLSelection { + + /** This method is used to get the selected cells element based on specified sheet index in the Spreadsheet. + * @param {number} Pass the sheet index to get the cells element. + * @returns {HTMLElement} + */ + getSelectedCells(sheetIdx: number): HTMLElement; + + /** This method is used to refresh the selection in the Spreadsheet. + * @param {Array} Optional. Pass range to refresh selection. + * @returns {void} + */ + refreshSelection(range: Array): void; + + /** This method is used to select a single column in the Spreadsheet. + * @param {number} Pass the column index value. + * @returns {void} + */ + selectColumn(colIdx: number): void; + + /** This method is used to select entire columns in a specified range (start index and end index) in the Spreadsheet. + * @param {number} Pass the column start index. + * @param {number} Pass the column end index. + * @returns {void} + */ + selectColumns(startIdx: number,endIdx: number): void; + + /** This method is used to select the specified range of cells in the Spreadsheet. + * @param {string} Pass range which want to select. + * @param {any} Pass the row and column index of the end cell. + * @returns {void} + */ + selectRange(range: string,endCell: any): void; + + /** This method is used to select a single row in the Spreadsheet. + * @param {number} Pass the row index value. + * @returns {void} + */ + selectRow(rowIdx: number): void; + + /** This method is used to select entire rows in a specified range (start index and end index) in the Spreadsheet. + * @param {number} Pass the start row index. + * @param {number} Pass the end row index. + * @returns {void} + */ + selectRows(startIdx: number,endIdx: number): void; + + /** This method is used to select all cells in active sheet. + * @returns {void} + */ + selectSheet(): void; +} + +export interface XLSort { + + /** This method is used to sort a particular range of cells based on its cell or font color in the Spreadsheet. + * @param {string} Pass 'PutCellColor' to sort by cell color or 'PutFontColor' for by font color. + * @param {any} Pass the HEX color code to sort. + * @param {string} Pass the range + * @returns {void} + */ + sortByColor(operation: string,color: any,range: string): void; + + /** This method is used to sort a particular range of cells based on its values in the Spreadsheet. + * @param {Array|string} Pass the range to sort. + * @param {string} Pass the column name. + * @param {any} Pass the direction to sort (ascending or descending). + * @returns {void} + */ + sortByRange(range: Array|string,columnName: string,direction: any): void; +} + +export interface XLValidate { + + /** This method is used to apply data validation rules in a selected range of cells based on the defined condition in the Spreadsheet. + * @param {string} If range is specified, it will apply rules for the specified range else it will use the current selected range. + * @param {Array} Pass the validation condition, value1 and value2. + * @param {string} Pass the data type. + * @param {boolean} Pass 'true' if you ignore blank values. + * @param {boolean} Pass 'true' if you want to show an error alert. + * @returns {void} + */ + applyDVRules(range: string,values: Array,type: string,required: boolean,showErrorAlert: boolean): void; + + /** This method is used to clear the applied validation rules in a specified range of cells in the Spreadsheet. + * @param {string} Optional. If range is specified, it will clear rules for the specified range else it will use the current selected range. + * @returns {void} + */ + clearDV(range: string): void; + + /** This method is used to highlight invalid data in a specified range of cells in the Spreadsheet. + * @param {string} Optional. If range is specified, it will clear rules for the specified range else it will use the current selected range. + * @returns {void} + */ + highlightInvalidData(range: string): void; +} + +export interface Model { + + /**Gets or sets an active sheet index in the Spreadsheet. By defining this value, you can specify which sheet should be active in workbook. + * @Default {1} + */ + activeSheetIndex?: number; + + /**Gets or sets a value that indicates whether to enable or disable auto rendering of cell type in the Spreadsheet. + * @Default {false} + */ + allowAutoCellType?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable auto fill feature in the Spreadsheet. + * @Default {true} + */ + allowAutoFill?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable auto sum feature in the Spreadsheet. + * @Default {true} + */ + allowAutoSum?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable cell format feature in the Spreadsheet. By enabling this, you can customize styles and number formats. + * @Default {true} + */ + allowCellFormatting?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable cell type feature in the Spreadsheet. + * @Default {false} + */ + allowCellType?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable chart feature in the Spreadsheet. By enabling this feature, you can create and customize charts in Spreadsheet. + * @Default {true} + */ + allowCharts?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable clipboard feature in the Spreadsheet. By enabling this feature, you can perform cut/copy and paste operations in Spreadsheet. + * @Default {true} + */ + allowClipboard?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable comment feature in the Spreadsheet. By enabling this, you can add/delete/modify comments in Spreadsheet. + * @Default {true} + */ + allowComments?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable Conditional Format feature in the Spreadsheet. By enabling this, you can apply formatting to the selected range of cells based on the provided conditions (Greater than, Less than, Equal, Between, Contains, etc.).Note: allowCellFormatting must be true while using conditional formatting. + * @Default {true} + */ + allowConditionalFormats?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable data validation feature in the Spreadsheet. + * @Default {true} + */ + allowDataValidation?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable the delete action in the Spreadsheet. By enabling this feature, you can delete existing rows, columns, cells and sheet. + * @Default {true} + */ + allowDelete?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable drag and drop feature in the Spreadsheet. + * @Default {true} + */ + allowDragAndDrop?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable the edit action in the Spreadsheet. + * @Default {true} + */ + allowEditing?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable filtering feature in the Spreadsheet. Filtering can be used to limit the data displayed using required criteria. + * @Default {true} + */ + allowFiltering?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable table feature in the Spreadsheet. By enabling this, you can render table in selected range. + * @Default {true} + */ + allowFormatAsTable?: boolean; + + /**Get or sets a value that indicates whether to enable or disable format painter feature in the Spreadsheet. By enabling this feature, you can copy the format from the selected range and apply it to another range. + * @Default {true} + */ + allowFormatPainter?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable formula bar in the Spreadsheet. + * @Default {true} + */ + allowFormulaBar?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable freeze pane support in Spreadsheet. After enabling this feature, you can use freeze top row, freeze first column and freeze panes options. + * @Default {true} + */ + allowFreezing?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable hyperlink feature in the Spreadsheet. By enabling this feature, you can add hyperlink which is used to easily navigate to the cell reference from one sheet to another or a web page. + * @Default {true} + */ + allowHyperlink?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable import feature in the Spreadsheet. By enabling this feature, you can open existing Spreadsheet documents. + * @Default {true} + */ + allowImport?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable the insert action in the Spreadsheet. By enabling this feature, you can insert new rows, columns, cells and sheet. + * @Default {true} + */ + allowInsert?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable keyboard navigation feature in the Spreadsheet. + * @Default {true} + */ + allowKeyboardNavigation?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable lock cell feature in the Spreadsheet. + * @Default {true} + */ + allowLockCell?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable merge feature in the Spreadsheet. + * @Default {true} + */ + allowMerging?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable resizing feature in the Spreadsheet. By enabling this feature, you can change the column width and row height by dragging its header boundaries. + * @Default {true} + */ + allowResizing?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable find and replace feature in the Spreadsheet. By enabling this, you can easily find and replace a specific value in the sheet or workbook. By using goto behavior, you can select and highlight all cells that contains specific data or data types. + * @Default {true} + */ + allowSearching?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable selection in the Spreadsheet. By enabling this feature, selected items will be highlighted. + * @Default {true} + */ + allowSelection?: boolean; + + /**Gets or sets a value that indicates whether to enable the sorting feature in the Spreadsheet. + * @Default {true} + */ + allowSorting?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable undo and redo feature in the Spreadsheet. + * @Default {true} + */ + allowUndoRedo?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable wrap text feature in the Spreadsheet. By enabling this, cell content can wrap to the next line, if the cell content exceeds the boundary of the cell. + * @Default {true} + */ + allowWrap?: boolean; + + /**Gets or sets a value that indicates to define the width of the activation panel in Spreadsheet. + * @Default {200} + */ + apWidth?: number; + + /**Gets or sets an object that indicates to customize the auto fill behavior in the Spreadsheet. + */ + autoFillSettings?: AutoFillSettings; + + /**Gets or sets an object that indicates to customize the chart behavior in the Spreadsheet. + */ + chartSettings?: ChartSettings; + + /**Gets or sets a value that defines the number of columns displayed in the sheet. + * @Default {21} + */ + columnCount?: number; + + /**Gets or sets a value that indicates to define the common width for each column in the Spreadsheet. + * @Default {60} + */ + columnWidth?: number; + + /**Gets or sets a value that indicates to render the spreadsheet with custom theme. + */ + cssClass?: string; + + /**Gets or sets a value that indicates whether to enable or disable context menu in the Spreadsheet. + * @Default {true} + */ + enableContextMenu?: boolean; + + /**Gets or sets an object that indicates to customize the exporting behavior in Spreadsheet. + */ + exportSettings?: ExportSettings; + + /**Gets or sets an object that indicates to customize the format behavior in the Spreadsheet. + */ + formatSettings?: FormatSettings; + + /**Gets or sets an object that indicates to customize the import behavior in the Spreadsheet. + */ + importSettings?: ImportSettings; + + /**Gets or sets a value that indicates whether to customizing the user interface (UI) as locale-specific in order to display regional data (i.e.) in a language and culture specific to a particular country or region. + * @Default {en-US} + */ + locale?: string; + + /**Gets or sets an object that indicates to customize the picture behavior in the Spreadsheet. + */ + pictureSettings?: PictureSettings; + + /**Gets or sets an object that indicates to customize the print option in Spreadsheet. + */ + printSettings?: PrintSettings; + + /**Gets or sets a value that indicates whether to define the number of rows to be displayed in the sheet. + * @Default {20} + */ + rowCount?: number; + + /**Gets or sets a value that indicates to define the common height for each row in the sheet. + * @Default {20} + */ + rowHeight?: number; + + /**Gets or sets an object that indicates to customize the scroll options in the Spreadsheet. + */ + scrollSettings?: ScrollSettings; + + /**Gets or sets an object that indicates to customize the selection options in the Spreadsheet. + */ + selectionSettings?: SelectionSettings; + + /**Gets or sets a value that indicates to define the number of sheets to be created at the initial load. + * @Default {1} + */ + sheetCount?: number; + + /**Gets or sets an object that indicates to customize the sheet behavior in Spreadsheet. + */ + sheets?: Array; + + /**Gets or sets a value that indicates whether to show or hide ribbon in the Spreadsheet. + * @Default {true} + */ + showRibbon?: boolean; + + /**This is used to set the number of undo-redo steps in the Spreadsheet. + * @Default {20} + */ + undoRedoStep?: number; + + /**Define the username for the Spreadsheet which is displayed in comment. + * @Default {User Name} + */ + userName?: string; + + /**Triggered for every action before its starts.*/ + actionBegin? (e: ActionBeginEventArgs): void; + + /**Triggered for every action complete.*/ + actionComplete? (e: ActionCompleteEventArgs): void; + + /**Triggered when the auto fill operation begins.*/ + autoFillBegin? (e: AutoFillBeginEventArgs): void; + + /**Triggered when the auto fill operation completes.*/ + autoFillComplete? (e: AutoFillCompleteEventArgs): void; + + /**Triggered before the cells to be formatted.*/ + beforeCellFormat? (e: BeforeCellFormatEventArgs): void; + + /**Triggered before the cell selection.*/ + beforeCellSelect? (e: BeforeCellSelectEventArgs): void; + + /**Triggered before the selected cells are dropped.*/ + beforeDrop? (e: BeforeDropEventArgs): void; + + /**Triggered before the contextmenu is open.*/ + beforeOpen? (e: BeforeOpenEventArgs): void; + + /**Triggered before the activation panel is open.*/ + beforePanelOpen? (e: BeforePanelOpenEventArgs): void; + + /**Triggered when click on sheet cell.*/ + cellClick? (e: CellClickEventArgs): void; + + /**Triggered when the cell is edited.*/ + cellEdit? (e: CellEditEventArgs): void; + + /**Triggered when mouse hover on cell in sheets.*/ + cellHover? (e: CellHoverEventArgs): void; + + /**Triggered when save the edited cell.*/ + cellSave? (e: CellSaveEventArgs): void; + + /**Triggered when click the contextmenu items.*/ + contextMenuClick? (e: ContextMenuClickEventArgs): void; + + /**Triggered when the selected cells are being dragged.*/ + drag? (e: DragEventArgs): void; + + /**Triggered when the selected cells are initiated to drag.*/ + dragStart? (e: DragStartEventArgs): void; + + /**Triggered when the selected cells are dropped.*/ + drop? (e: DropEventArgs): void; + + /**Triggered before the range editing starts.*/ + editRangeBegin? (e: EditRangeBeginEventArgs): void; + + /**Triggered after range editing completes.*/ + editRangeComplete? (e: EditRangeCompleteEventArgs): void; + + /**Triggered before the sheet is loaded.*/ + load? (e: LoadEventArgs): void; + + /**Triggered after the sheet is loaded.*/ + loadComplete? (e: LoadCompleteEventArgs): void; + + /**Triggered every click of the menu item.*/ + menuClick? (e: MenuClickEventArgs): void; + + /**Triggered when import sheet is failed to open.*/ + openFailure? (e: OpenFailureEventArgs): void; + + /**Triggered when pager item is clicked in the Spreadsheet.*/ + pagerClick? (e: PagerClickEventArgs): void; + + /**Triggered when click on the ribbon.*/ + ribbonClick? (e: RibbonClickEventArgs): void; + + /**Triggered when the chart series rendering.*/ + seriesRendering? (e: SeriesRenderingEventArgs): void; + + /**Triggered when click the ribbon tab.*/ + tabClick? (e: TabClickEventArgs): void; + + /**Triggered when select the ribbon tab.*/ + tabSelect? (e: TabSelectEventArgs): void; +} + +export interface ActionBeginEventArgs { + + /**Returns the applied style format object. + */ + afterFormat?: any; + + /**Returns the applied style format object. + */ + beforeFormat?: any; + + /**Returns the sheet index. + */ + sheetIdx?: number; + + /**Returns the cell range. + */ + range?: Array; + + /**Returns the action format. + */ + reqType?: string; + + /**Returns goto index while paging. + */ + gotoIdx?: number; + + /**Returns boolean value. If create new sheet it returns true. + */ + newSheet?: boolean; + + /**Return column name while sorting. + */ + columnName?: string; + + /**Returns selected columns while sorting or filtering begins. + */ + colSelected?: number; + + /**Returns sort direction while sort action begins. + */ + sortDirection?: string; +} + +export interface ActionCompleteEventArgs { + + /**Returns Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the applied cell format object. + */ + selectedCell?: Array|any; + + /**Returns the sheet index. + */ + sheetIdx?: number; + + /**Returns the request type. + */ + reqType?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface AutoFillBeginEventArgs { + + /**Returns auto fill begin cell range. + */ + dataRange?: Array; + + /**Returns which direction drag the auto fill. + */ + direction?: string; + + /**Returns fill cells range. + */ + fillRange?: Array; + + /**Returns the auto fill type. + */ + fillType?: string; + + /**Returns the sheet index. + */ + sheetIdx?: number; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface AutoFillCompleteEventArgs { + + /**Returns auto fill begin cell range. + */ + dataRange?: Array; + + /**Returns which direction to drag the auto fill. + */ + direction?: string; + + /**Returns fill cells range. + */ + fillRange?: Array; + + /**Returns the auto fill type. + */ + fillType?: string; + + /**Returns the sheet index. + */ + sheetIdx?: number; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface BeforeCellFormatEventArgs { + + /**Returns the sheet index. + */ + sheetIdx?: number; + + /**Returns the applied style format object. + */ + format?: any; + + /**Returns the selected cells. + */ + cells?: Array|any; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the name of the event. + */ + type?: string; +} + +export interface BeforeCellSelectEventArgs { + + /**Returns the previous cell range. + */ + prevRange?: Array; + + /**Returns the current cell range. + */ + currRange?: Array; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface BeforeDropEventArgs { + + /**Returns the sheet index. + */ + sheetIdx?: number; + + /**Returns the current cell row and column index. + */ + currentCell?: any; + + /**Returns the drag cells range object. + */ + dragAndDropRange?: any; + + /**Returns the cell Overwriting alert option value. + */ + preventAlert?: boolean; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the target item. + */ + target?: HTMLElement; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface BeforeOpenEventArgs { + + /**Returns the target element. + */ + target?: HTMLElement; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface BeforePanelOpenEventArgs { + + /**Returns the sheet index. + */ + sheetIdx?: number; + + /**Returns the activation panel element. + */ + activationPanel?: any; + + /**Returns the range option value. + */ + range?: any; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface CellClickEventArgs { + + /**Returns the click cell element. + */ + cell?: HTMLElement; + + /**Returns the column index of clicked cell. + */ + columnIndex?: number; + + /**Returns the row index of clicked cell. + */ + rowIndex?: number; + + /**Returns the column name of clicked cell. + */ + columnName?: string; + + /**Returns the column information. + */ + columnObject?: any; +} + +export interface CellEditEventArgs { + + /**Returns the click cell element. + */ + cell?: HTMLElement; + + /**Returns the columnName of clicked cell. + */ + columnName?: string; + + /**Returns the column field information. + */ + columnObject?: any; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface CellHoverEventArgs { + + /**Returns the target element. + */ + target?: HTMLElement; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface CellSaveEventArgs { + + /**Returns the save cell element. + */ + cell?: HTMLElement; + + /**Returns the columnName of clicked cell. + */ + columnName?: string; + + /**Returns the column field information. + */ + columnObject?: any; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the cell previous value. + */ + pValue?: string; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the cell value. + */ + value?: string; +} + +export interface ContextMenuClickEventArgs { + + /**Returns target element Id. + */ + Id?: string; + + /**Returns the target element. + */ + element?: HTMLElement; + + /**Returns event information. + */ + event?: any; + + /**Returns target element and event information. + */ + events?: any; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns target element parent Id. + */ + parentId?: string; + + /**Returns target element parent text. + */ + parentText?: string; + + /**Returns target element text. + */ + text?: string; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface DragEventArgs { + + /**Returns the sheet index. + */ + sheetIdx?: number; + + /**Returns the current cell row and column index. + */ + currentCell?: any; + + /**Returns the drag cells range object. + */ + dragAndDropRange?: any; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the target item. + */ + target?: HTMLElement; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface DragStartEventArgs { + + /**Returns the sheet index. + */ + sheetIdx?: number; + + /**Returns the current cell row and column index. + */ + currentCell?: any; + + /**Returns the drag cells range object. + */ + dragAndDropRange?: any; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the target item. + */ + target?: HTMLElement; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface DropEventArgs { + + /**Returns the sheet index. + */ + sheetIdx?: number; + + /**Returns the current cell row and column index. + */ + currentCell?: any; + + /**Returns the drag cells range object. + */ + dragAndDropRange?: any; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the target item. + */ + target?: HTMLElement; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface EditRangeBeginEventArgs { + + /**Returns the sheet index. + */ + sheetIdx?: number; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the range option value. + */ + range?: any; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface EditRangeCompleteEventArgs { + + /**Returns the sheet index. + */ + sheetIdx?: number; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the range option value. + */ + range?: any; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface LoadEventArgs { + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the cancel option value. + */ + cancel?: boolean; + + /**Returns the active sheet index. + */ + sheetIndex?: number; +} + +export interface LoadCompleteEventArgs { + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface MenuClickEventArgs { + + /**Returns menu click element. + */ + element?: HTMLElement; + + /**Returns the event information. + */ + event?: any; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns target element parent Id. + */ + parentId?: string; + + /**Returns target element parent text. + */ + parentText?: string; + + /**Returns target element text. + */ + text?: string; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface OpenFailureEventArgs { + + /**Returns the failure type. + */ + failureType?: string; + + /**Returns the status index. + */ + status?: number; + + /**Returns the status in text. + */ + statusText?: string; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface PagerClickEventArgs { + + /**Returns the active sheet index. + */ + activeSheet?: number; + + /**Returns the new sheet index. + */ + gotoSheet?: number; + + /**Returns whether new sheet icon is clicked. + */ + newSheet?: boolean; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface RibbonClickEventArgs { + + /**Returns element Id. + */ + Id?: string; + + /**Returns target information. + */ + prop?: any; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns status. + */ + status?: boolean; + + /**Returns isChecked in boolean. + */ + isChecked?: boolean; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface SeriesRenderingEventArgs { + + /**Returns chart data and chart information. + */ + data?: any; + + /**Returns the chart model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface TabClickEventArgs { + + /**Returns the active tab index. + */ + activeIndex?: number; + + /**Returns active tab header element. + */ + activeHeader?: any; + + /**Returns previous active tab header element. + */ + prevActiveHeader?: any; + + /**Returns previous active tab index. + */ + prevActiveIndex?: number; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface TabSelectEventArgs { + + /**Returns the active tab index. + */ + activeIndex?: number; + + /**Returns active tab header element. + */ + activeHeader?: any; + + /**Returns previous active tab header element. + */ + prevActiveHeader?: any; + + /**Returns previous active tab index. + */ + prevActiveIndex?: number; + + /**Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /**Returns the name of the event. + */ + type?: string; + + /**Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface AutoFillSettings { + + /**This property is used to set fillType unit in Spreadsheet. It has five types which are CopyCells, FillSeries, FillFormattingOnly, FillWithoutFormatting and FlashFill. + * @Default {ej.Spreadsheet.AutoFillOptions.FillSeries} + */ + fillType?: ej.Spreadsheet.AutoFillOptions|string; + + /**Gets or sets a value that indicates to enable or disable auto fill options in the Spreadsheet. + * @Default {true} + */ + showFillOptions?: boolean; +} + +export interface ChartSettings { + + /**Gets or sets a value that defines the chart height in Spreadsheet. + * @Default {220} + */ + height?: number; + + /**Gets or sets a value that defines the chart width in the Spreadsheet. + * @Default {440} + */ + width?: number; +} + +export interface ExportSettings { + + /**Gets or sets a value that indicates whether to enable or disable save feature in Spreadsheet. By enabling this feature, you can save existing Spreadsheet. + * @Default {true} + */ + allowExporting?: boolean; + + /**Gets or sets a value that indicates to define csvUrl for export to csv format. + * @Default {null} + */ + csvUrl?: string; + + /**Gets or sets a value that indicates to define excelUrl for export to excel format.Note: User must specify allowExporting true while use this property. + * @Default {null} + */ + excelUrl?: string; + + /**Gets or sets a value that indicates to define password while export to excel format. + * @Default {null} + */ + password?: string; +} + +export interface FormatSettings { + + /**Gets or sets a value that indicates whether to enable or disable cell border feature in the Spreadsheet. + * @Default {true} + */ + allowCellBorder?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable decimal places in the Spreadsheet. + * @Default {true} + */ + allowDecimalPlaces?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable font family feature in Spreadsheet. + * @Default {true} + */ + allowFontFamily?: boolean; +} + +export interface ImportSettings { + + /**Sets import mapper to perform import feature in Spreadsheet. + */ + importMapper?: string; + + /**Sets import Url to access the online files in the Spreadsheet. + */ + importUrl?: string; + + /**Gets or sets a value that indicates to define password while importing in the Spreadsheet. + */ + password?: string; +} + +export interface PictureSettings { + + /**Gets or sets a value that indicates whether to enable or disable picture feature in Spreadsheet. By enabling this, you can add pictures in Spreadsheet. + * @Default {true} + */ + allowPictures?: boolean; + + /**Gets or sets a value that indicates to define height to picture in the Spreadsheet. + * @Default {220} + */ + height?: number; + + /**Gets or sets a value that indicates to define width to picture in the Spreadsheet. + * @Default {440} + */ + width?: number; +} + +export interface PrintSettings { + + /**Gets or sets a value that indicates whether to enable or disable page setup support for printing in Spreadsheet. + * @Default {true} + */ + allowPageSetup?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable page size support for printing in Spreadsheet. + * @Default {false} + */ + allowPageSize?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable print feature in the Spreadsheet. + * @Default {true} + */ + allowPrinting?: boolean; +} + +export interface ScrollSettings { + + /**Gets or sets a value that indicates whether to enable or disable scrolling in Spreadsheet. + * @Default {true} + */ + allowScrolling?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable sheet on demand. By enabling this, it render only the active sheet element while paging remaining sheets are created one by one. + * @Default {false} + */ + allowSheetOnDemand?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable virtual scrolling feature in the Spreadsheet. + * @Default {true} + */ + allowVirtualScrolling?: boolean; + + /**Gets or sets the value that indicates to define the height of spreadsheet. + * @Default {550} + */ + height?: number|string; + + /**Gets or sets the value that indicates whether to enable or disable responsive mode in the Spreadsheet. + * @Default {false} + */ + isResponsive?: boolean; + + /**Gets or sets a value that indicates to set scroll mode in Spreadsheet. It has two scroll modes, Normal and Infinite. + * @Default {ej.Spreadsheet.scrollMode.Infinite} + */ + scrollMode?: ej.Spreadsheet.scrollMode|string; + + /**Gets or sets the value that indicates to define the height off spreadsheet. + * @Default {1200} + */ + width?: number|string; +} + +export interface SelectionSettings { + + /**Gets or sets a value that indicates to define active cell in spreadsheet. + */ + activeCell?: string; + + /**Gets or sets a value that indicates to define animation time while selection in the Spreadsheet. + * @Default {0.001} + */ + animationTime?: number; + + /**Gets or sets a value that indicates to enable or disable animation while selection.Note: allowSelection must be true while using this property. + * @Default {false} + */ + enableAnimation?: boolean; + + /**Gets or sets a value that indicates to set selection type in Spreadsheet. It has three types which are Column, Row and default. + * @Default {ej.Spreadsheet.SelectionType.Default} + */ + selectionType?: ej.Spreadsheet.SelectionType|string; + + /**Gets or sets a value that indicates to set selection unit in Spreadsheet. It has three types which are Single, Range and MultiRange. + * @Default {ej.Spreadsheet.SelectionUnit.MultiRange} + */ + selectionUnit?: ej.Spreadsheet.SelectionUnit|string; +} + +export interface SheetsRangeSettings { + + /**Gets or sets the data to render the Spreadsheet. + */ + dataSource?: any; + + /**Specifies the header styles for the datasource range in Spreadsheet. + * @Default {null} + */ + headerStyles?: any; + + /**Specifies the primary key for the datasource in Spreadsheet. + */ + primaryKey?: string; + + /**Specifies the query for the datasource in Spreadsheet. + * @Default {null} + */ + query?: any; + + /**Gets or sets a value that indicates whether to enable or disable the datasource header in Spreadsheet. + * @Default {false} + */ + showHeader?: boolean; + + /**Specifies the start cell for the datasource range in Spreadsheet. + * @Default {A1} + */ + startCell?: string; +} + +export interface Sheets { + + /**Gets or sets a value that indicates to define column count in the Spreadsheet. + * @Default {21} + */ + colCount?: number; + + /**Gets or sets a value that indicates to define column width in the Spreadsheet. + * @Default {64} + */ + columnWidth?: number; + + /**Gets or sets the data to render the Spreadsheet. + */ + dataSource?: any; + + /**Gets or sets a value that indicates whether to enable or disable field as column header in the Spreadsheet. + * @Default {false} + */ + fieldAsColumnHeader?: boolean; + + /**Specifies the header styles for the datasource range in Spreadsheet. + * @Default {null} + */ + headerStyles?: any; + + /**Specifies the primary key for the datasource in Spreadsheet. + */ + primaryKey?: string; + + /**Specifies the query for the datasource in Spreadsheet. + * @Default {null} + */ + query?: any; + + /**Specifies single range or multiple range settings for a sheet in Spreadsheet. + */ + rangeSettings?: Array; + + /**Gets or sets a value that indicates to define row count in the Spreadsheet. + * @Default {20} + */ + rowCount?: number; + + /**Gets or sets a value that indicates whether to show or hide grid lines in the Spreadsheet. + * @Default {true} + */ + showGridlines?: boolean; + + /**Gets or sets a value that indicates whether to enable or disable the datasource header in Spreadsheet. + * @Default {false} + */ + showHeader?: boolean; + + /**Gets or sets a value that indicates whether to show or hide headings in the Spreadsheet. + * @Default {true} + */ + showHeadings?: boolean; + + /**Specifies the start cell for the datasource range in Spreadsheet. + * @Default {A1} + */ + startCell?: string; +} + +enum AutoFillOptions{ + + ///Specifies the CopyCells property in AutoFillOptions. + CopyCells, + + ///Specifies the FillSeries property in AutoFillOptions. + FillSeries, + + ///Specifies the FillFormattingOnly property in AutoFillOptions. + FillFormattingOnly, + + ///Specifies the FillWithoutFormatting property in AutoFillOptions. + FillWithoutFormatting, + + ///Specifies the FlashFill property in AutoFillOptions. + FlashFill +} + + +enum scrollMode{ + + ///To enable Infinite scroll mode for Spreadsheet. + Infinite, + + ///To enable Normal scroll mode for Spreadsheet. + Normal +} + + +enum SelectionType{ + + ///To select only Column in Spreadsheet. + Column, + + ///To select only Row in Spreadsheet. + Row, + + ///To select both Column/Row in Spreadsheet. + Default +} + + +enum SelectionUnit{ + + ///To enable Single selection in Spreadsheet. + Single, + + ///To enable Range selection in Spreadsheet. + Range, + + ///To enable MultiRange selection in Spreadsheet. + MultiRange +} + +} + +} +declare module ej.olap { + +class OlapChart extends ej.Widget { + static fn: OlapChart; + constructor(element: JQuery, options?: OlapChart.Model); + constructor(element: Element, options?: OlapChart.Model); + model:OlapChart.Model; + defaults:OlapChart.Model; + + /** Perform an asynchronous HTTP (AJAX) request. + * @returns {void} + */ + doAjaxPost(): void; + + /** Perform an asynchronous HTTP (FullPost) submit. + * @returns {void} + */ + doPostBack(): void; + + /** Exports the OlapChart to an appropriate format based on the parameter passed. + * @returns {void} + */ + exportOlapChart(): void; + + /** This function receives the JSON formatted datasource to render the OlapChart control. + * @returns {void} + */ + renderChartFromJSON(): void; + + /** This function receives the update from service-end, which would be utilized for rendering the widget. + * @returns {void} + */ + renderControlSuccess(): void; +} +export module OlapChart{ + +export interface Model { + + /**Specifies the CSS class to OlapChart to achieve custom theme. + * @Default {“”} + */ + cssClass?: string; + + /**Contains the serialized OlapReport at that instant, that is, current OlapReport. + * @Default {“”} + */ + currentReport?: string; + + /**Object utilized to pass additional information between client-end and service-end. + * @Default {{}} + */ + customObject?: any; + + /**Allows the user to enable 3D view of OlapChart. + * @Default {false} + */ + enable3D?: boolean; + + /**Allows the user to enable OlapChart’s responsiveness in the browser layout. + * @Default {false} + */ + isResponsive?: boolean; + + /**Allows the user to set the localized language for the widget. + * @Default {en-US} + */ + locale?: string; + + /**Allows the user to rotate the angle of OlapChart in 3D view. + * @Default {0} + */ + rotation?: number; + + /**Allows the user to set custom name for the methods at service-end, communicated on AJAX post. + * @Default {{}} + */ + serviceMethodSettings?: ServiceMethodSettings; + + /**Connects the service using the specified URL for any server updates. + * @Default {“”} + */ + url?: string; + + /**Triggers when it reaches client-side after any AJAX request.*/ + afterServiceInvoke? (e: AfterServiceInvokeEventArgs): void; + + /**Triggers before any AJAX request is passed from OlapChart to service methods.*/ + beforeServiceInvoke? (e: BeforeServiceInvokeEventArgs): void; + + /**Triggers when drill up/down happens in OlapChart control.*/ + drillSuccess? (e: DrillSuccessEventArgs): void; + + /**Triggers when OlapChart widget completes all operations at client-side after any AJAX request.*/ + renderComplete? (e: RenderCompleteEventArgs): void; + + /**Triggers when any error occurred during AJAX request.*/ + renderFailure? (e: RenderFailureEventArgs): void; + + /**Triggers when OlapChart successfully reaches client-side after any AJAX request.*/ + renderSuccess? (e: RenderSuccessEventArgs): void; +} + +export interface AfterServiceInvokeEventArgs { + + /**return the current action of OlapChart control. + */ + action?: string; + + /**return the custom object bounds with OlapChart control. + */ + customObject?: any; + + /**return the outer HTML of OlapChart control. + */ + element?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the OlapChart model. + */ + model?: ej.olap.OlapChart.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface BeforeServiceInvokeEventArgs { + + /**return the current action of OlapChart control. + */ + action?: string; + + /**return the custom object bounds with OlapChart control. + */ + customObject?: any; + + /**return the outer HTML of OlapChart control. + */ + element?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the OlapChart model. + */ + model?: ej.olap.OlapChart.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface DrillSuccessEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the OlapChart model. + */ + model?: ej.olap.OlapChart.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface RenderCompleteEventArgs { + + /**return the current action of OlapChart control. + */ + action?: string; + + /**return the custom object bounds with OlapChart control. + */ + customObject?: any; + + /**return the outer HTML of OlapChart control. + */ + element?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the OlapChart model. + */ + model?: ej.olap.OlapChart.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface RenderFailureEventArgs { + + /**return the current action of OlapChart control. + */ + action?: string; + + /**return the custom object bounds with OlapChart control. + */ + customObject?: any; + + /**return the error stack trace of the original exception. + */ + message?: any; + + /**return the outer HTML of OlapChart control. + */ + element?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the OlapChart model. + */ + model?: ej.olap.OlapChart.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface RenderSuccessEventArgs { + + /**return the current action of OlapChart control. + */ + action?: string; + + /**return the custom object bounds with OlapChart control. + */ + customObject?: any; + + /**return the outer HTML of OlapChart control. + */ + element?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the OlapChart model. + */ + model?: ej.olap.OlapChart.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface ServiceMethodSettings { + + /**Allows the user to set the custom name for the service method that’s responsible for exporting. + * @Default {Export} + */ + exportOlapChart?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for drilling up/down operation in OlapChart. + * @Default {DrillChart} + */ + drillDown?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for initializing OlapChart. + * @Default {InitializeChart} + */ + initialize?: string; +} +} + +class OlapClient extends ej.Widget { + static fn: OlapClient; + constructor(element: JQuery, options?: OlapClient.Model); + constructor(element: Element, options?: OlapClient.Model); + model:OlapClient.Model; + defaults:OlapClient.Model; + + /** Perform an asynchronous HTTP (AJAX) request. + * @returns {void} + */ + doAjaxPost(): void; + + /** Perform an asynchronous HTTP (FullPost) submit. + * @returns {void} + */ + doPostBack(): void; +} +export module OlapClient{ + +export interface Model { + + /**Allows the user to set the specific chart type for OlapChart. + * @Default {ej.olap.OlapChart.ChartTypes.Column} + */ + chartType?: ej.olap.OlapChart.ChartTypes|string; + + /**Sets the mode to export the OLAP visualization components such as OlapChart and PivotGrid in OlapClient. Based on the option, either Chart or Grid or both gets exported. + * @Default {ej.olap.OlapClient.ClientExportMode.ChartAndGrid} + */ + clientExportMode?: string; + + /**Specifies the CSS class to OlapClient to achieve custom theme. + * @Default {“”} + */ + cssClass?: string; + + /**Object utilized to pass additional information between client-end and service-end. + * @Default {{}} + */ + customObject?: any; + + /**Allows the user to customize the widgets layout and appearance. + * @Default {{}} + */ + displaySettings?: DisplaySettings; + + /**Allows the user to refresh the control on-demand and not during every UI operation. + * @Default {false} + */ + enableDeferUpdate?: boolean; + + /**Enables/disables the visibility of measure group selector drop-down in Cube Browser. + * @Default {false} + */ + enableMeasureGroups?: boolean; + + /**Sets the summary layout for PivotGrid. Following are the ways in which summary can be positioned: normal summary (bottom), top summary, no summary and excel-like summary. + * @Default {ej.PivotGrid.Layout.Normal} + */ + gridLayout?: ej.PivotGrid.Layout|string; + + /**Allows the user to set the localized language for the widget. + * @Default {en-US} + */ + locale?: string; + + /**Allows the user to set custom name for the methods at service-end, communicated during AJAX post. + * @Default {{}} + */ + serviceMethodSettings?: ServiceMethodSettings; + + /**Sets the title for OlapClient widget. + * @Default {null} + */ + title?: string; + + /**Connects the service using the specified URL for any server updates. + * @Default {null} + */ + url?: string; + + /**Triggers when it reaches client-side after any AJAX request.*/ + afterServiceInvoke? (e: AfterServiceInvokeEventArgs): void; + + /**Triggers before any AJAX request is passed from OlapClient to service methods.*/ + beforeServiceInvoke? (e: BeforeServiceInvokeEventArgs): void; + + /**Triggers before rendering the OlapChart.*/ + chartLoad? (e: ChartLoadEventArgs): void; + + /**Triggers while we initiate loading of the widget.*/ + load? (e: LoadEventArgs): void; + + /**Triggers when OlapClient widget completes all operations at client-end after any AJAX request.*/ + renderComplete? (e: RenderCompleteEventArgs): void; + + /**Triggers when any error occurred during AJAX request.*/ + renderFailure? (e: RenderFailureEventArgs): void; + + /**Triggers when OlapClient successfully reaches client-side after any AJAX request.*/ + renderSuccess? (e: RenderSuccessEventArgs): void; +} + +export interface AfterServiceInvokeEventArgs { + + /**return the current action of OlapClient control. + */ + action?: string; + + /**return the custom object bounds with OlapClient control. + */ + customObject?: any; + + /**return the outer HTML of OlapClient control. + */ + element?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the OlapClient model. + */ + model?: ej.olap.OlapClient.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface BeforeServiceInvokeEventArgs { + + /**return the current action of OlapClient control. + */ + action?: string; + + /**return the custom object bounds with OlapClient control. + */ + customObject?: any; + + /**return the outer HTML of OlapClient control. + */ + element?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the OlapClient model. + */ + model?: ej.olap.OlapClient.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface ChartLoadEventArgs { + + /**return the current action of OlapChart control. + */ + action?: string; + + /**return the custom object bounds with OlapChart control. + */ + customObject?: any; + + /**return the outer HTML of OlapChart control. + */ + element?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the OlapChart model. + */ + model?: ej.olap.OlapClient.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface LoadEventArgs { + + /**returns the outer HTML of OlapClient component. + */ + element?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the OlapClient model. + */ + model?: ej.olap.OlapClient.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface RenderCompleteEventArgs { + + /**returns the custom object bounded with the control. + */ + customObject?: any; + + /**returns the outer HTML of OlapClient control. + */ + element?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the OlapClient model. + */ + model?: ej.olap.OlapClient.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface RenderFailureEventArgs { + + /**returns the custom object bounded with the control. + */ + customObject?: any; + + /**returns the outer HTML of OlapClient control. + */ + element?: string; + + /**returns the error message with error code. + */ + message?: any; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the OlapClient model. + */ + model?: ej.olap.OlapClient.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface RenderSuccessEventArgs { + + /**returns the custom object bounded with the control. + */ + customObject?: any; + + /**returns the outer HTML of OlapClient control. + */ + element?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the OlapClient model. + */ + model?: ej.olap.OlapClient.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface DisplaySettings { + + /**Let’s the user to customize the display of OlapChart and PivotGrid widgets, either in tab view or in tile view. + * @Default {ej.olap.OlapClient.ControlPlacement.Tab} + */ + controlPlacement?: ej.olap.OlapClient.ControlPlacement|string; + + /**Let’s the user to set either Chart or Grid as the start-up widget. + * @Default {ej.olap.OlapClient.DefaultView.Grid} + */ + defaultView?: ej.olap.OlapClient.DefaultView|string; + + /**Enables/disables the full screen view of OlapChart and PivotGrid in OlapClient. + * @Default {false} + */ + enableFullScreen?: boolean; + + /**Enhances the space for PivotGrid and OlapChart, by hiding Cube Browser and Axis Element Builder. + * @Default {false} + */ + enableTogglePanel?: boolean; + + /**Allows the user to enable OlapClient’s responsiveness in the browser layout. + * @Default {false} + */ + isResponsive?: boolean; + + /**Sets the display mode (Only Chart/Only Grid/Both) in OlapClient. + * @Default {ej.olap.OlapClient.DisplayMode.ChartAndGrid} + */ + mode?: ej.olap.OlapClient.DisplayMode|string; +} + +export interface ServiceMethodSettings { + + /**Allows the user to set the custom name for the service method that’s responsible for updating the entire report and widget, while changing the Cube. + * @Default {CubeChanged} + */ + cubeChanged?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for exporting. + * @Default {Export} + */ + exportOlapClient?: string; + + /**Allows the user to set the custom name for the service method that’s responsible to get the members, for the tree-view inside member-editor dialog. + * @Default {FetchMemberTreeNodes} + */ + fetchMemberTreeNodes?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for fetching the report names from the database. + * @Default {FetchReportListFromDB} + */ + fetchReportList?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for updating report while filtering members. + * @Default {FilterElement} + */ + filterElement?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for initializing OlapClient. + * @Default {InitializeClient} + */ + initialize?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for loading the report collection from the database. + * @Default {LoadReportFromDB} + */ + loadReport?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for retrieving the MDX query for the current report. + * @Default {GetMDXQuery} + */ + mdxQuery?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for updating the tree-view inside Cube Browser, while changing the measure group. + * @Default {MeasureGroupChanged} + */ + measureGroupChanged?: string; + + /**Allows the user to set the custom name for the service method that’s responsible to get the child members, on tree-view node expansion. + * @Default {MemberExpanded} + */ + memberExpand?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for updating report while dropping a node/SplitButton inside Axis Element Builder. + * @Default {NodeDropped} + */ + nodeDropped?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for updating report while removing SplitButton from Axis Element Builder. + * @Default {RemoveSplitButton} + */ + removeSplitButton?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for saving the report collection to database. + * @Default {SaveReportToDB} + */ + saveReport?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for toggling the elements in row and column axes. + * @Default {ToggleAxis} + */ + toggleAxis?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for any toolbar operation. + * @Default {ToolbarOperations} + */ + toolbarServices?: string; + + /**Allows the user to set the custom name for the service method that’s responsible for updating report collection. + * @Default {UpdateReport} + */ + updateReport?: string; +} +} +module OlapChart +{ +enum ChartTypes +{ +//To render a Line type for OlapChart. +Line, +//To render a Spline type for OlapChart. +Spline, +//To render a Column type for OlapChart. +Column, +//To render a Area type for OlapChart. +Area, +//To render a SplineArea type for OlapChart. +SplineArea, +//To render a StepLine type for OlapChart. +StepLine, +//To render a StepArea type for OlapChart. +StepArea, +//To render a Pie type for OlapChart. +Pie, +//To render a Bar type for OlapChart. +Bar, +//To render a StackingArea type for OlapChart. +StackingArea, +//To render a StackingColumn type for OlapChart. +StackingColumn, +//To render a StackingBar type for OlapChart. +StackingBar, +//To render a Pyramid type for OlapChart. +Pyramid, +//To render a Funnel type for OlapChart. +Funnel, +//To render a Doughnut type for OlapChart. +Doughnut, +//To render a Scatter type for OlapChart. +Scatter, +//To render a Bubble type for OlapChart. +Bubble, +} +} +module OlapClient +{ +enum ControlPlacement +{ +//To display OlapChart and PivotGrid widgets in tab view. +Tab, +//To display OlapChart and PivotGrid widgets within the same view, one below the other. +Tile, +} +} +module OlapClient +{ +enum DefaultView +{ +//To set OlapChart as a default control in view when the OlapClient widget is loaded for the first time. +Chart, +//To set PivotGrid as a default control in view when the OlapClient widget is loaded for the first time. +Grid, +} +} +module OlapClient +{ +enum DisplayMode +{ +//To display only OlapChart widget. +ChartOnly, +//To display only PivotGrid widget. +GridOnly, +//To display both OlapChart and PivotGrid widgets. +ChartAndGrid, +} +} + +class OlapGauge extends ej.Widget { + static fn: OlapGauge; + constructor(element: JQuery, options?: OlapGauge.Model); + constructor(element: Element, options?: OlapGauge.Model); + model:OlapGauge.Model; + defaults:OlapGauge.Model; + + /** Perform an asynchronous HTTP (AJAX) request. + * @returns {void} + */ + doAjaxPost(): void; + + /** This function is used to refresh the OlapGauge at client-side itself. + * @returns {void} + */ + refresh(): void; + + /** This function removes the KPI related images from OlapGauge. + * @returns {void} + */ + removeImg(): void; + + /** This function receives the JSON formatted datasource to render the OlapGauge control. + * @returns {void} + */ + renderControlFromJSON(): void; +} +export module OlapGauge{ + +export interface Model { + + /**Sets the number of column count to arrange the OlapGauge's. + * @Default {0} + */ + columnsCount?: number; + + /**Specify the CSS class to OlapGauge to achieve custom theme. + * @Default {“”} + */ + cssClass?: string; + + /**Object utilized to pass additional information between client-end and service-end. + * @Default {{}} + */ + customObject?: any; + + /**Enables/disables tooltip visibility in OlapGauge. + * @Default {false} + */ + enableTooltip?: boolean; + + /**Allows the user to enable OlapGauge’s responsiveness in the browser layout. + * @Default {false} + */ + isResponsive?: boolean; + + /**Allows the user to change the format of the label values in OlapGauge. + * @Default {ej.olap.OlapGauge.NumberFormat.Default} + */ + labelFormatSettings?: ej.olap.OlapGauge.NumberFormat|string; + + /**Allows the user to set the localized language for the widget. + * @Default {en-US} + */ + locale?: string; + + /**Sets the number of row count to arrange the OlapGauge's. + * @Default {0} + */ + rowsCount?: number; + + /**Sets the scale values such as pointers, indicators, etc... for OlapGauge. + * @Default {{}} + */ + scales?: any; + + /**Allows the user to set the custom name for the methods at service-end, communicated during AJAX post. + * @Default {{}} + */ + serviceMethodSettings?: ServiceMethodSettings; + + /**Enables/disables the header labels in OlapGauge. + * @Default {true} + */ + showHeaderLabel?: boolean; + + /**Connects the service using the specified URL for any server updates. + * @Default {“”} + */ + url?: string; + + /**Triggers when it reaches client-side after any AJAX request.*/ + afterServiceInvoke? (e: AfterServiceInvokeEventArgs): void; + + /**Triggers before any AJAX request is passed from OlapGauge to service methods.*/ + beforeServiceInvoke? (e: BeforeServiceInvokeEventArgs): void; + + /**Triggers when OlapGauge started loading at client-side.*/ + load? (e: LoadEventArgs): void; + + /**Triggers when OlapGauge widget completes all operations at client-side after any AJAX request.*/ + renderComplete? (e: RenderCompleteEventArgs): void; + + /**Triggers when any error occurred during AJAX request.*/ + renderFailure? (e: RenderFailureEventArgs): void; + + /**Triggers when OlapGauge successfully reaches client-side after any AJAX request.*/ + renderSuccess? (e: RenderSuccessEventArgs): void; +} + +export interface AfterServiceInvokeEventArgs { + + /**return the current action of OlapGauge control. + */ + action?: string; + + /**return the custom object bounds with OlapGauge control. + */ + customObject?: any; + + /**return the outer HTML of OlapGauge control. + */ + element?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the OlapGauge model. + */ + model?: ej.olap.OlapGauge.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface BeforeServiceInvokeEventArgs { + + /**return the current action of OlapGauge control. + */ + action?: string; + + /**return the custom object bounds with OlapGauge control. + */ + customObject?: any; + + /**return the outer HTML of OlapGauge control. + */ + element?: string; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the OlapGauge model. + */ + model?: ej.olap.OlapGauge.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface LoadEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the OlapGauge model. + */ + model?: ej.olap.OlapGauge.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface RenderCompleteEventArgs { + + /**returns the outer HTML of OlapGauge control. + */ + element?: string; + + /**returns the custom object bounded with the control. + */ + customObject?: any; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the OlapGauge model. + */ + model?: ej.olap.OlapGauge.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface RenderFailureEventArgs { + + /**returns the outer HTML of OlapGauge control. + */ + element?: string; + + /**returns the custom object bounded with the control. + */ + customObject?: any; + + /**returns the error message with error code. + */ + message?: any; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the OlapGauge model. + */ + model?: ej.olap.OlapGauge.Model; + + /**returns the name of the event. + */ + type?: string; + + /**returns the JSON formatted response while error occurs. + */ + responseJSON?: any; +} + +export interface RenderSuccessEventArgs { + + /**returns the outer HTML of OlapGauge control. + */ + element?: string; + + /**returns the custom object bounded with the control. + */ + customObject?: any; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the OlapGauge model. + */ + model?: ej.olap.OlapGauge.Model; + + /**returns the name of the event. + */ + type?: string; +} + +export interface LabelFormatSettings { + + /**Allows the user to change the number format of the label values in OlapGauge. + * @Default {ej.olap.OlapGauge.NumberFormat.Default} + */ + numberFormat?: ej.olap.OlapGauge.NumberFormat|string; + + /**Allows you to change the position of a digit on the right-hand side of the decimal point for label value. + * @Default {5} + */ + decimalPlaces?: number; + + /**Allows you to add a text at the beginning of the label. + */ + prefixText?: string; + + /**Allows you to add text at the end of the label. + */ + suffixText?: string; +} + +export interface ServiceMethodSettings { + + /**Allows the user to set the custom name for the service method that’s responsible for initializing OlapGauge. + * @Default {InitializeGauge} + */ + initialize?: string; +} +} +module OlapGauge +{ +enum NumberFormat +{ +//To set default format for label values. +Default, +//To set currency format for label values. +Currency, +//To set percentage format for label values. +Percentage, +//To set fraction format for label values. +Fraction, +//To set scientific format for label values. +Scientific, +//To set text format for label values. +Text, +//To set notation format for label values. +Notation, +} +} + +} +declare module App { + +var addMetaTags: boolean; + var allowPopState: boolean; + var allowPushState: boolean; + var activePage: JQuery; + var waitingPopUp: JQuery; + var hashMonitoring: boolean; + var pageTransition: string; + var renderEJMControlByDef: boolean; + function createPage(element: JQuery): void; + function getLoaction(): string; + function initPage(): void; + function loadView(url: string): void; + function transferPage(fromPage: Object, toPage: Object, options?: any, isFromAjax?: boolean): void; + function userAgent(): void; + + var pageHistory: { + activeHistory(): string; + add(url: string, options?: PageOption): void; + clearForward(): void; + find(url: string): number; + lastHistory(): string; + nextHistory(): string; + prevHistory(): string; + makeUrlAbsolute(hashString: string): void; + } + //Pageoption type for appview page + interface PageOption { + title?: string; + href?: string; + hash?: string; + } + var route: { + convertToRelativeUrl(): void; + hasProtocol(url: string): boolean; + setPageRenderMode(element: JQuery): void; + splitUrl(url: string): any; + } +} +declare module ej.mobile { + + //Global Interface + interface windowsOption { + renderDefault?: boolean; + } + enum RenderMode{ + Auto, + IOS7, + Android, + Windows, + Flat + } + enum Theme{ + Auto, + Dark, + Light + } +class Accordion extends ej.Widget { + static fn: Accordion; + constructor(element: JQuery, options?: AccordionOptions); + model: AccordionOptions; + validTags: Array; + defaults: AccordionOptions; + collapseAll(): void; + disableItems(itemIndexes: Array): void; + enableItems(itemIndexes: Array): void; + selectItems(activeList: Array): void; + deselectItems(activeList: Array): void; + expandAll(): void; + hide(): void; + show(): void; + destroy(): void; + getItemsCount(): number; +} +//ejmAccordion Option +interface AccordionOptions { + theme?: ej.mobile.Theme; + renderMode?: ej.mobile.RenderMode; + cssClass?: string; + enableCache?: boolean; + allowMultipleOpen?: boolean; + collapsible?: boolean; + enabled?: boolean; + enableMultipleOpen?: boolean; + heightAdjustMode?: ej.mobile.Accordion.HeightAdjustMode; + windows?: windowsOption; + enablePersistence?: boolean; + selectedItems?: Array; + disabledItems?: Array; + showHeaderIcon?: boolean; + spinnerText?: string; + items?: Array; + active? (e: AccordionActiveEventArgs): void; + ajaxBeforeLoad? (e: AccordionAjaxBeforeLoadEventArgs): void; + ajaxError? (e: AccordionAjaxErrorEventArgs): void; + ajaxLoad? (e: AccordionAjaxLoadEventArgs): void; + ajaxSuccess? (e: AccordionAjaxSuccessEventArgs): void; + beforeActive? (e: AccordionBeforeActiveEventArgs): void; + destroy? (e: AccordionEventArgs): void; + create? (e: AccordionEventArgs): void; +} + +interface itemCollection { + ajaxUrl?: string; + logoClass?: string; +} +//ejmejmAccordionEvent Arugument +interface AccordionEventArgs { + cancel: boolean; + type: string; + model: AccordionOptions; +} +interface AccordionActiveEventArgs extends AccordionEventArgs { + items: string; + lastSelectedItemIndices: number; + selectedItemIndices: number; +} +interface AccordionAjaxBeforeLoadEventArgs extends AccordionEventArgs { + url: string; +} +interface AccordionAjaxErrorEventArgs extends AccordionEventArgs { + title: string; + data: Object; + url: string; +} +interface AccordionAjaxLoadEventArgs extends AccordionEventArgs { +} +interface AccordionAjaxSuccessEventArgs extends AccordionEventArgs { + content: Object; + data: Object; + url: string; +} +interface AccordionBeforeActiveEventArgs extends AccordionEventArgs { + activeItemIndex?: number; +} +export module Accordion { + enum HeightAdjustMode { + Content, + Auto, + Fill + } +} +class Autocomplete extends ej.Widget { + static fn: Autocomplete; + element: JQuery; + constructor(element: JQuery, options?: AutocompleteOptions); + model: AutocompleteOptions; + defaults: AutocompleteOptions; + disable(): void; + enable(): void; + destroy(): void; + clearText(): void; + getSelectedItems(): Array; + getValue(): string; + +} +interface AutocompleteOptions { + allowScrolling?: boolean; + filterType?: ej.mobile.Autocomplete.FilterType; + caseSensitiveSearch?: boolean; + cssClass?: string; + enableAutoFill?: boolean; + delimiterChar?: string; + enableMultiSelect?: boolean; + enableCheckbox?: boolean; + dataSource?: any; + filterMode?: string; + itemsCount?: string|number; + templateId?: string; + fields?: fieldOptions; + imageField?: string; + renderMode?: ej.mobile.RenderMode; + theme?: ej.mobile.Theme; + mapper?: string; + watermarkText?: string; + imageClass?: string; + allowSorting?: boolean; + value?: string; + sortOrder?: ej.mobile.Autocomplete.SortOrder; + emptyResultText?: string; + showEmptyResultText?: boolean; + minCharacter?: number; + enableDistinct?: boolean; + enablePersistence?: boolean; + enabled?: boolean; + mode?: ej.mobile.Autocomplete.Mode; + selectedKeys?: string; + windows?: windowsOption; + touchEnd? (e: AutocompleteTouchEndEventArgs): void; + keyPress? (e: AutocompleteKeyPressEventArgs): void; + select? (e: AutocompleteSelectEventArgs): void; + change? (e: AutocompleteChangeEventArgs): void; + focusIn? (e: AutocompleteFocusInEventArgs): void; + focusOut? (e: AutocompleteFocusOutEventArgs): void; + destroy? (e: AutocompleteEventArgs): void; + create? (e: AutocompleteEventArgs): void; +} +interface fieldOptions { + text?: string; + key?: string; +} +interface AutocompleteEventArgs { + cancel: boolean; + model: AutocompleteOptions; + type: string; +} +interface AutocompleteTouchEndEventArgs extends AutocompleteEventArgs { + text: string; + isChecked: boolean; + checkedItemsText: Object; + value: string; +} +interface AutocompleteKeyPressEventArgs extends AutocompleteEventArgs { + value: string; +} +interface AutocompleteSelectEventArgs extends AutocompleteEventArgs { + text: string; + isChecked: boolean; + checkedItemsText: Object; + value: string; +} +interface AutocompleteChangeEventArgs extends AutocompleteEventArgs { + text: string; + isChecked: boolean; + checkedItemsText: Object; + value: string; +} +interface AutocompleteFocusInEventArgs extends AutocompleteEventArgs { + value: string; +} +interface AutocompleteFocusOutEventArgs extends AutocompleteEventArgs { + value: string; +} +export module Autocomplete { + enum FilterType { + StartsWith, + Contains + } + enum Mode { + Search, + Default + } + enum SortOrder { + Ascending, + Descending + } +} +class Button extends ej.Widget { + static fn: Button; + element: JQuery; + constructor(element: JQuery, options?: ButtonOptions); + model: ButtonOptions; + validTags: Array; + defaults: ButtonOptions; + disable(): void; + enable(): void; +} +class Actionlink extends ej.Widget { + static fn: Actionlink; + element: JQuery; + constructor(element: Element, options?: ButtonOptions); + model: Object; + validTags: Array; + defaults: ButtonOptions; + disable(): void; + enable(): void; +} +interface ButtonOptions { + touchStart?(e: ButtonEventArgs): void; + touchEnd?(e: ButtonEventArgs): void; + cssClass?: string; + enabled?: (boolean | string); + inline?: (boolean | string); + renderMode?: (ej.mobile.RenderMode | string); + text?: string; + theme?: (ej.mobile.Theme | string); + imageClass?: string; + imagePosition?: (ej.mobile.Button.ImagePosition | string); + contentType?: (ej.mobile.Button.ContentType | string); + ios7?: ios7ButtonOptions; + android?: androidButtonOption; + windows?: windowsButtonOptions; + flat?: flatButtonOption; +} +interface ButtonEventArgs { + element: Object; + text: string; +} +interface ios7ButtonOptions { + style?: (ej.mobile.Button.IOS7.Style | string); + color?: (ej.mobile.Button.IOS7.Color | string); +} +interface androidButtonOption { + style?: (ej.mobile.Button.Android.Style | string); +} +interface windowsButtonOptions extends windowsOption { + style?: (ej.mobile.Button.Windows.Style | string); +} +interface flatButtonOption { + style?: (ej.mobile.Button.Flat.Style | string); +} +export module Button{ +export module IOS7{ + enum Style{ + Normal, + Back, + Header, + Dialog + } + enum Color{ + Gray, + Black, + Blue, + Green, + Red + } + } +export module Android{ + enum Style{ + Normal, + Small, + Dialog + } + +} +export module Windows{ + enum Style{ + Normal, + Back + } +} +export module Flat{ + enum Style{ + Normal, + Back, + Header + } +} + enum ImagePosition{ + Left, + Right + } + enum ContentType{ + Text, + Image, + Both + } +} +class DatePicker extends ej.Widget { + static fn: DatePicker; + static Locale:any; + element: JQuery; + constructor(element: JQuery, options?: DatePickerOptions); + model: DatePickerOptions; + defaults: DatePickerOptions; + disable(): void; + enable(): void; + hide(): void; + show(): void; + setCurrentDate(date:string): void; + getValue(): string; + destroy(): void; +} + +//ejmDatePicker Options +interface DatePickerOptions { + cssClass?: string; + renderMode?: ej.mobile.RenderMode; + theme?: ej.mobile.Theme; + culture?: string; + dateFormat?: string; + value?: string; + enabled?: boolean; + enablePersistence?: boolean; + ios7?: ios7Option; + windows?: windowsOption; + maxDate?: string; + minDate?: string; + load? (e: DatePickerEventArgs): void; + select? (e: DatePickerEventArgs): void; + focusIn? (e: DatePickerEventArgs): void; + focusOut? (e: DatePickerEventArgs): void; + open? (e: DatePickerEventArgs): void; + close? (e: DatePickerEventArgs): void; + change? (e: DatePickerEventArgs): void; + destroy? (e: DatePickerArgs): void; + create? (e: DatePickerArgs): void; +} + +interface DatePickerArgs { + type: string; + model: DatePickerOptions; + value: string; +} +//ejmDatePickerEvent Arugument +interface DatePickerEventArgs extends DatePickerArgs { + cancel: boolean; + +} + +interface ios7Option { + renderDefault: boolean; +} + + +//Class ejmDropDownList +class DropDownList extends ej.Widget { + static fn: DropDownList; + constructor(element: JQuery, options?: DropDownListOptions); + model: DropDownListOptions; + defaults: DropDownListOptions; + show(): void; + hide(): void; + getValue():string; + selectItemByIndex(index:(number|string)): void; + unselectItemByIndex(index:(number|string)): void; + selectItemByIndices(indices:Array): void; + unselectItemByIndices(indices: Array): void; + destroy(): void; + getSelectedItemsValue(): Array; + getSelectedItemValue(): string; +} + +//ejmDropDownList WindowsOption +interface windowsDropDownListOption extends windowsOption { + type?: ej.mobile.DropDownList.WindowsType; +} + +interface androidDropDownListOption { + popUpHeight?: number|string; +} + +interface fieldsDropDownListOption { + text?: string; + groupBy?: string; + imageClass?: string; + imageUrl?: string; + checkBy?: string; + enableTemplate?: string; + templateID?: string; + value?: string; +} + +//ejmDropDownList Option +interface DropDownListOptions { + theme?: ej.mobile.Theme; + renderMode?: ej.mobile.RenderMode; + cssClass?: string; + readOnly?: boolean; + targetID?: string; + selectedItemIndex?: number|string; + dataSource?: any; + fields?: fieldsDropDownListOption; + query?: string; + allowVirtualScrolling?: boolean; + virtualScrollMode?: ej.mobile.DropDownList.VirtualScrollingMode; + itemRequestCount?: number|string; + enabled?: boolean; + enableMultiSelect?: boolean; + delimiterChar?: string; + enableGrouping?: boolean; + mode?: ej.mobile.DropDownList.Mode; + enableTemplate?: boolean; + enablePersistence?: boolean; + windows?: windowsDropDownListOption; + android?: androidDropDownListOption; + items?: Array; + focusIn? (e: DropDownArgs): void; + focusOut? (e: DropDownArgs): void; + select? (e: DropDownSelectArgs): void; + change? (e: DropDownSelectArgs): void; + checkChange? (e: DropDownListEventArgs): void; +} + +interface DropDownArgs { + cancel: boolean; + type: string; + model: DropDownListOptions; +} +//ejmDropDownListEvent Arugument +interface DropDownListEventArgs extends DropDownArgs { + checked: boolean; +} + +interface DropDownSelectArgs extends DropDownArgs { + selectedText: string; + value: string; + selectedItem: Object; +} + +export module DropDownList{ + enum VirtualScrollingMode{ + Continuous, + Normal + } + enum WindowsType{ + ComboBox, + List + } + enum Mode { + Normal, + Native + } +} + +class Numeric extends ej.Widget { + static fn: Numeric; + element: JQuery; + constructor(element: JQuery, options?: EditorOptions); + model: EditorOptions; + ValidTags: Array; + defaults: EditorOptions; + disable(): void; + enable(): void; + getValue(): any; + setValue(value:number): void; + +} + +interface EditorOptions { + cssClass?: string; + enableStrictMode?: boolean; + enabled?: boolean; + showBorder?: boolean; + showSpinButton?: boolean; + incrementStep?: number; + maxValue?: number; + minValue?: number; + name?: string; + enablePersistence?: boolean; + readOnly?: boolean; + renderMode?: ej.mobile.RenderMode; + decimalPlaces?: number; + theme?: ej.mobile.Theme; + value?: number; + watermarkText?: string; + windows?: windowsOption; + change? (e: EditorEventArgs): void; + focusIn? (e: EditorEventArgs): void; + focusOut? (e: EditorEventArgs): void; + destroy?(e:EditorBaseArgs):void; + create?(e:EditorBaseArgs):void; +} + +interface EditorBaseArgs{ + cancel: boolean; + type: string; + model: EditorOptions; +} + +interface EditorEventArgs extends EditorBaseArgs { + value: number; + element: Object; +} + + +class Grid extends ej.Widget { + static fn: Grid; + element: JQuery; + constructor(element: JQuery, options?: GridOptions); + model: GridOptions; + validTags: Array; + defaults: GridOptions; + disable(): void; + enable(): void; + destroy(): void; + getColumnByField(field:string): void; + getColumnByHeaderText(headerText:string): void; + getColumnByIndex(index:number): void; + getColumnFieldNames(): void; + getColumnIndexByField(field:string): void; + getColumnMemberByIndex(colIdx:number): void; + hideColumns(col:string): void; + refreshContent(requestType:string): void; + showColumns(col:string): void; +} +interface GridOptions { + cssClass?: string; + allowPaging?: boolean; + allowSorting?: boolean; + allowFiltering?: boolean; + allowScrolling?: boolean; + allowSelection?: boolean; + dataSource: any; + caption?: string; + enablePersistence?: boolean; + selectedRowIndex?: number; + showCaption?: boolean; + allowColumnSelector?: boolean; + transition?: string; + columns?: Array; + theme?: ej.mobile.Theme; + renderMode?: ej.mobile.RenderMode; + rowSelecting? (e: GridEventArgs): void; + rowSelected? (e: GridEventArgs): void; + actionBegin? (e: GridEventArgs): void; + actionComplete? (e: GridEventArgs): void; + actionSuccess? (e: GridEventArgs): void; + actionFailure? (e: GridEventArgs): void; + queryCellInfo? (e: GridEventArgs): void; + rowDataBound? (e: GridEventArgs): void; + modelChange? (e: GridEventArgs): void; + load? (e: GridEventArgs): void; + pageSettings?: PageSettings; + scrollSettings?: ScrollSettings; + sortSettings?: SortSettings; + filterSettings?: FilterSettings; +} + +interface PageSettings { + pageSize?: number; + currentPage?: number; + display?: ej.mobile.Grid.PagerDisplay; + type?: ej.mobile.Grid.PagerType; + totalRecordsCount?: number; +} +interface ScrollSettings { + enableColumnScrolling?: boolean; + height?: any; + width?: any; + enableRowScrolling?: boolean; + enableNativeScrolling?: boolean; +} +interface SortSettings { + allowMultiSorting?: boolean; + sortedColumns?: Array; +} +interface FilterSettings { + isCaseSensitive?: boolean; + filterBarMode?: ej.mobile.Grid.FilterBarMode; + interval?: number; + filteredColumns?: Array; +} + +//ejmGridEvent Arugument +interface GridEventArgs { + cancel: boolean; + type: string; + model: GridOptions; +} + +export module Grid +{ +enum PagerDisplay +{ +Normal, +Fixed +} + +enum PagerType +{ +Normal, +Scrollable +} + +enum FilterBarMode +{ +Immediate, +OnEnter +} +enum Actions +{ +Paging, +Sorting, +Filtering, +Refresh +} +} +class Header extends ej.Widget { + static fn: Header; + element: JQuery; + constructor(element: JQuery, options?: HeaderOptions); + model: HeaderOptions; + defaults: HeaderOptions; + getTitle(): string; + destroy(): void; +} + +interface HeaderOptions { + hideForUnSupportedDevice?: boolean; + leftButtonNavigationUrl?: string; + leftButtonImageClass: string; + leftButtonImageUrl: string; + rightButtonNavigationUrl?: string; + rightButtonImageClass?:string; + rightButtonImageUrl?:string; + cssClass?: string; + title?: string; + showTitle?: boolean; + position?: ej.mobile.Header.Position; + leftButtonCaption?: string; + rightButtonCaption?: string; + leftButtonStyle?:ej.mobile.Header.HeaderLeftButtonStyle; + rightButtonStyle?:ej.mobile.Header.HeaderRightButtonStyle; + renderMode?: ej.mobile.RenderMode; + theme?: ej.mobile.Theme; + showLeftButton?: boolean; + showRightButton?: boolean; + enablePersistence?:boolean; + templateId?: string; + ios7?: Headerios7Options; + flat?: HeaderFlatOptions; + windows?: HeaderWindowsOptions; + android?: HeaderAndroidOptions; + leftButtonTap? (e: HeaderLeftButtonTapEventArgs): void; + rightButtonTap? (e: HeaderRightButtonTapEventArgs): void; + destroy?(e:HeaderBaseArgs):void; + create?(e:HeaderBaseArgs):void; +} +interface HeaderWindowsOptions extends windowsOption { + enableCustomText?: boolean; + renderDefault?: boolean; + rightButtonStyle?: ej.mobile.Header.Windows.HeaderRightButtonStyle; + leftButtonStyle?: ej.mobile.Header.Windows.HeaderLeftButtonStyle; + showLeftButton?: boolean; + showRightButton?: boolean; +} +interface HeaderAndroidOptions { + backButtonImageClass?: string; + rightButtonStyle?: ej.mobile.Header.Android.HeaderRightButtonStyle; + leftButtonStyle?: ej.mobile.Header.Android.HeaderLeftButtonStyle; + showLeftButton?: boolean; + showRightButton?: boolean; +} +interface Headerios7Options { + rightButtonStyle?: ej.mobile.Header.IOS7.HeaderRightButtonStyle; + leftButtonStyle?: ej.mobile.Header.IOS7.HeaderLeftButtonStyle; + showLeftButton?: boolean; + showRightButton?: boolean; +} +interface HeaderFlatOptions { + rightButtonStyle?: ej.mobile.Header.Flat.HeaderRightButtonStyle; + leftButtonStyle?: ej.mobile.Header.Flat.HeaderLeftButtonStyle; + showLeftButton?: boolean; + showRightButton?: boolean; +} + +interface HeaderBaseArgs{ + cancel: boolean; + type: string; + model: FooterOptions; +} +interface HeaderLeftButtonTapEventArgs { + text: string; + cancel: boolean; + model: Object; + type: string; + status: boolean; +} +interface HeaderRightButtonTapEventArgs { + text: string; + cancel: boolean; + model: Object; + type: string; + status: boolean; +} + +export module Header +{ +enum Position +{ + Normal, + Fixed +} +enum HeaderLeftButtonStyle +{ + Back, + Header, + Normal + +} +enum HeaderRightButtonStyle +{ + Header, + Normal +} + +export module IOS7 +{ +enum HeaderLeftButtonStyle +{ + Auto, + Back, + Header, + Normal +} +enum HeaderRightButtonStyle +{ + Auto, + Header, + Normal +} +} + +export module Flat +{ +enum HeaderLeftButtonStyle +{ + Auto, + Back, + Normal, + Header +} +enum HeaderRightButtonStyle +{ + Auto, + Header, + Normal +} +} + +export module Android +{ +enum HeaderLeftButtonStyle +{ + Auto, + Back, + Normal, + Header +} +enum HeaderRightButtonStyle +{ + Auto, + Normal, + Header +} +} + +export module Windows +{ +enum HeaderLeftButtonStyle +{ + Auto, + Back, + Normal, + Header +} +enum HeaderRightButtonStyle +{ + Auto, + Normal, + Header +} +} +} + + + +/* ListView - Start*/ +interface ajaxSettingsOptions { + type?: string; + cache?: boolean; + async?: boolean; + dataType?: string; + contentType?: string; + url?: string; + data?: Array; +} +//Class ejmListView +class ListView extends ej.Widget { + static fn: ListView; + constructor(element: JQuery, options?: ListViewOptions); + model: ListViewOptions; + defaults: ListViewOptions; + addItem(list?:Object, index?:number,groupid?:any): void; + checkAllItem(): void; + checkItem(index:number,childId?:any): void; + deActive(index:number,childId?:any): void; + disableItem(index:number,childId?:any): void; + enableItem(index:number,childId?:any): void; + getActiveItem(): void; + getActiveItemText(): void; + getCheckedItems(): void; + getCheckedItemsText(): void; + getItemsCount(): void; + getItemText(index:number,childId?:any): void; + hasChild(index:number,childId?:any): boolean; + hide(): void; + hideItem(index:number,childId?:any): void; + isChecked(index:number,childId?:any): boolean; + loadAjaxContent(): void; + removeCheckMark(index:number,childId?:any): void; + removeItem(index:number,childId?:any): void; + selectItem(index:number,childId?:any): void; + setActive(index:number,childId?:any): void; + show(): void; + showItem(index:number,childId?:any): void; + unCheckAllItem(): void; + unCheckItem(index: number, childId?: any): void; + clear(): void; + append(data: Object): void; + getActiveItemData(): void; + getSelectedItemValue(): void; + getSelectedItemsValue(): void; + destroy(): void; +} +//ejmListView IOS7Option +interface Ios7Option { + inline?: boolean; +} +//ejmListView IOS7Option +interface windowsListViewOption extends windowsOption { + preventSkew?: boolean; + enableHeaderCustomText?: boolean; +} + +//ejmListView Option +interface ListViewOptions { + theme?: ej.mobile.Theme; + renderMode?: ej.mobile.RenderMode; + enablePullToRefresh?: boolean; + refreshThreshold?: number; + pullToRefreshSettings?: pullToRefreshSettings; + mode?: ej.mobile.ListView.Mode + cssClass?: string; + ios7?: Ios7Option; + windows?: windowsListViewOption; + adjustFixedPosition?: boolean; + ajaxSettings?: ajaxSettingsOptions; + enableCache?: boolean; + allowScrolling?: boolean; + checkDOMChanges?: boolean; + dataBinding?: boolean; + dataSource?: any; + enableAjax?: boolean; + enableCheckMark?: boolean; + enableFiltering?: boolean; + showHeader?: boolean; + showHeaderBackButton?: boolean; + enableNativeScrolling?: boolean; + showScrollbars?: boolean; + fieldSettings?: fieldSettings; + enableGroupList?: boolean; + headerBackButtonText?: string; + hideHeaderForUnSupportedDevice?: boolean; + headerTitle?: string; + height?: number; + persistSelection?: boolean; + preventSelection?: boolean; + query?: string; + renderTemplate?: boolean; + selectedItemIndex?: number; + autoAdjustHeight?: boolean; + autoAdjustScrollHeight?: boolean; + templateId?: string; + transition?: string; + width?: number; + items?: Array; + enablePersistence?: boolean; + create? (e: ListViewBaseEventArgs): void; + destroy? (e: ListViewBaseEventArgs): void; + ajaxComplete? (e: ListViewEventArgs): void; + ajaxError? (e: ListViewEventArgs): void; + ajaxSuccess? (e: ListViewEventArgs): void; + headerBackButtonTap? (e: ListViewEventArgs): void; + load? (e: ListViewBaseEventArgs): void; + loadComplete? (e: ListViewBaseEventArgs): void; + touchEnd? (e: ListViewEventArgs): void; + touchStart? (e: ListViewEventArgs): void; + refreshBegin? (e: ListViewBaseEventArgs): void; + refreshSuccess? (e: ListViewEventArgs): void; + refreshError? (e: ListViewBaseEventArgs): void; + refreshComplete? (e: ListViewBaseEventArgs): void; + ajaxBeforeLoad? (e: ListViewEventArgs): void; +} +interface pullToRefreshSettings{ + pullText?:string; + releaseText?:string; + refreshText?:string; + errorText?:string; + appendData?:boolean; + appendPosition?:ej.mobile.ListView.AppendPosition; +} +interface fieldSettings{ + navigateUrl?:string; + href?:string; + enableAjax?:string; + preventSelection?:string; + persistSelection?:string; + text?:string; + enableCheckMark?:string; + checked?:string; + primaryKey?:string; + parentPrimaryKey?:string; + imageClass?:string; + imageUrl?:string; + childHeaderTitle?:string; + childId?:string; + childHeaderBackButtonText?:string; + renderTemplate?:string; + templateId?:string; + touchStart?:string; + touchEnd?:string; + attributes?:string; + groupID?:string; + id?:string; + value?: string; +} +//ejmListViewEvent Arugument +interface ListViewBaseEventArgs { + cancel: boolean; + type: string; + model: ListViewOptions; +} +interface ListViewEventArgs extends ListViewBaseEventArgs { + ajaxData?: Object; + data?: Object; + errorData?: Object; + successData?: Object; + text?: string; + element?: Object; + id?: string; + hasChild?: boolean; + currentItem?: string; + currentText?: string; + currentItemIndex?: number; + isChecked?: boolean; + checkedItems?: number; + checkedItemsText?: string; +} +export module ListView{ + enum AppendPosition{ + Bottom, + Top + } + enum Mode { + Page, + Container + } +} + +class Menu extends ej.Widget { + static fn: Menu; + element: JQuery; + constructor(element: JQuery, options?: MenuOptions); + model: MenuOptions; + defaults: MenuOptions; + addItem(menu: any, index: number): void; + disable(): void; + disableItem(index: number): void; + disableOverFlow(): void; + disableOverFlowItem(index: number): void; + enable(): void; + enableItem(index: number): void; + enableOverFlow(): void; + enableOverFlowItem(index: number): void; + hide(): void; + removeItem(index: number): void; + show(e: any, existing?: boolean): void; + destroy(): void; +} +//ejmMenu Option +interface MenuOptions { + theme?: ej.mobile.Theme; + renderMode?: ej.mobile.RenderMode; + cssClass?: string; + allowScrolling?: boolean; + showScrollbars?: boolean; + height?: (number|string); + renderTemplate?: boolean; + showOn?: ej.mobile.Menu.ShowOn; + targetId?: string; + target?: any; + enablePersistence?: boolean; + templateId?: string; + width?: (number|string); + items?: Array; + android?: AndroidOptions; + ios7?: Ios7Options; + windows?: WindowsOptions; + hide? (e: MenuEvent): void; + load? (e: MenuEvent): void; + loadComplete? (e: MenuEvent): void; + show? (e: MenuEvent): void; + touchStart? (e: MenuTouchEventArgs): void; + touchEnd? (e: MenuTouchEventArgs): void; + create? (e: MenuEvent): void; + destroy? (e: MenuEvent): void; +} +//ejmMenu IOS7 Option +interface Ios7Options { + cancelButtonColor?: ej.mobile.Menu.IOS7.CancelButtonColor; + cancelButtonText?: string; + cancelButtonTouchEnd? (e: MenuCancelButtonTouchEndEventArgs): void; + type?: ej.mobile.Menu.IOS7.Type; + title?: string; + showTitle?: boolean; + showCancelButton?: boolean; +} + +//ejmMenu Android Option +interface AndroidOptions { + type?: ej.mobile.Menu.Android.Type; +} +interface WindowsOptions { + type?: ej.mobile.Menu.Windows.Type; + renderDefault?: boolean; +} +//ejmMenu Event Arugument +interface MenuEvent { + cancel: boolean; + type: string; + model: MenuOptions; +} +interface MenuTouchEventArgs { + item: Object; + text: string; +} +interface MenuCancelButtonTouchEndEventArgs extends MenuEvent { + item: Object; + text: string; +} + +export module Menu { + export module IOS7 { + enum Type { + Auto, + Animate, + Normal + } + enum CancelButtonColor { + Blue, + Gray, + Black, + Green, + Red + } + } + + export module Android { + enum Type { + Contextual, + Popup, + OptionsList, + OptionsMenu + } + } + export module Windows { + enum Type { + Contextual, + Popup + } + } + enum ShowOn { + Tap, + TapHold + } +} + + + +//Class ejmProgress +class Progress extends ej.Widget { + static fn: Progress; + element: JQuery; + constructor(element: JQuery, options?: ProgressOptions); + model: ProgressOptions; + defaults: ProgressOptions; + getValue(): number; + getPercentage(): number; + setCustomText(text: string): void; + destroy(): void; +} + +//ejmProgressbar Option +interface ProgressOptions { + theme?: ej.mobile.Theme; + renderMode?: ej.mobile.RenderMode; + enableCustomText?: boolean; + enabled?: boolean; + height?: number; + incrementStep?: number; + maxValue?: number; + minValue?: number; + orientation?: ej.mobile.Progress.Orientation; + percentage?: number; + enablePersistence?: boolean; + text?: string; + value?: number; + width?: number; + create? (e: ProgressEvent): void; + destroy? (e: ProgressEvent): void; + start? (e: ProgressStartEventArgs): void; + change? (e: ProgressChangeEvent): void; + complete? (e: ProgressCompleteEvent): void; +} +//ejmProgressbarEvent Arugument +interface ProgressEvent { + cancel: boolean; + type: string; + model: ProgressOptions; +} +interface ProgressStartEventArgs extends ProgressEvent { + value: number; + percentage: number; +} +interface ProgressChangeEvent extends ProgressEvent { + value: number; + element: Object; + text: string; + percentage: number; +} +interface ProgressCompleteEvent extends ProgressEvent { + value: number; + text: string; + percentage: number; +} +export module Progress { + enum Orientation { + Horizontal, + Vertical + } +} + +//Class ejmRadioButton +class RadioButton extends ej.Widget { + static fn: RadioButton; + element: JQuery; + constructor(element: JQuery, options?: RadioButtonOptions); + model: RadioButtonOptions; + defaults: RadioButtonOptions; + destroy(): void; + enable(): void; + disable(): void; +} + +//ejmRadioButton Options +interface RadioButtonOptions { + renderMode?: ej.mobile.RenderMode; + theme?: ej.mobile.Theme; + cssClass?: string; + checked?: boolean; + text?: string; + enabled?: boolean; + enablePersistence?: boolean; + create? (e: RadioButtonBaseEventArgs): void; + destroy? (e: RadioButtonBaseEventArgs): void; + touchStart? (e: RadioButtonEventArgs): void; + touchEnd? (e: RadioButtonEventArgs): void; + change? (e: RadioButtonEventArgs): void; +} +//ejmRadioButtonEvent Arugument +interface RadioButtonBaseEventArgs { + model: RadioButtonOptions; + cancel: boolean; + type: string; +} +interface RadioButtonEventArgs extends RadioButtonBaseEventArgs { + value: string; + isChecked: boolean; +} + class Rating extends ej.Widget { + static fn: Rating; + element: JQuery; + constructor(element?: JQuery, options?: RatingOptions); + model: RatingOptions; + defaults: RatingOptions; + show(): void; + hide(): void; + getValue(): void + reset(): void; + enable(): void; + disable(): void; + setValue(value: number): void; + destroy(): void; + } + + interface RatingOptions { + maxValue?: number; + minValue?: number; + value?: number; + incrementStep?: number; + precision?: ej.mobile.Rating.Precision; + enabled?: boolean; + theme?: ej.mobile.Theme; + renderMode?: ej.mobile.RenderMode; + shape?: ej.mobile.Rating.Shape; + shapeWidth?: number; + shapeHeight?: number; + spaceBetweenShapes?: number; + orientation?: ej.mobile.Rating.Orientation; + readOnly?: boolean; + backgroundColor?: any; + selectionColor?: any; + borderColor?: any; + hoverColor?: any; + enablePersistence?: boolean; + create? (e: RatingBaseEventArgs): void; + destroy? (e: RatingBaseEventArgs): void; + tap? (e: RatingEventArgs): void; + change? (e: RatingEventArgs): void; + touchMove? (e: RatingEventArgs): void; + } + interface RatingBaseEventArgs { + cancel: boolean; + type: string; + model: RatingOptions; + } + interface RatingEventArgs extends RatingBaseEventArgs { + value: number; + } +export module Rating{ + enum Precision{ + Full, + Exact, + Half + } + enum Shape{ + Star, + Circle, + Diamond, + Heart, + Pentagon, + Square, + Triangle + } + enum Orientation{ + Horizontal, + Vertical + } + +} + class Rotator extends ej.Widget { + static fn: Rotator; + element: JQuery; + constructor(element: JQuery, options?: RotatorOptions); + model: RotatorOptions; + validTags: Array; + defaults: RotatorOptions; + renderDatasource(data: any): void; + destroy(): void; + } + interface RotatorOptions { + create? (e: RotatorBaseEventArgs): void; + destroy? (e: RotatorBaseEventArgs): void; + swipeLeft? (e: RotatorEventArgs): void; + swipeRight? (e: RotatorEventArgs): void; + swipeUp? (e: RotatorEventArgs): void; + swipeDown? (e: RotatorEventArgs): void; + change? (e: RotatorEventArgs): void; + pagerSelect? (e: RotatorEventArgs): void; + adjustFixedPosition?: boolean; + targetId?: string; + cssClass?:string; + windows?:windowsOption; + items?:Array; + renderMode?: ej.mobile.RenderMode; + targetHeight?: (number|string); + targetWidth?: (number|string); + enablePersistence?:boolean; + theme?: ej.mobile.Theme; + currentItemIndex?: number; + showPager?: boolean; + showHeader?: boolean; + headerTitle?: string; + dataBinding?: boolean; + dataSource?: any; + orientation?: ej.mobile.Rotator.Orientation; + pagerPosition?: PagerPosition; + } + interface PagerPosition { + horizontal?: ej.mobile.Rotator.PagerPositionHorizontal; + vertical?: ej.mobile.Rotator.PagerPositionVertical; + } + interface RotatorBaseEventArgs { + cancel: boolean; + model: RotatorOptions; + type: string; + } + interface RotatorEventArgs extends RotatorBaseEventArgs { + targetElement: Object; + element: number; + } +export module Rotator{ + enum Orientation{ + Horizontal, + Vertical + } + enum PagerPositionHorizontal{ + Bottom, + Top, + } + enum PagerPositionVertical{ + Right, + Left + } + +} + class Slider extends ej.Widget { + static fn: Slider; + element: JQuery; + constructor(element: JQuery, options?: SliderOptions); + model: SliderOptions; + defaults: SliderOptions; + getValue(): void; + dispose(): void; + destroy(): void; + } + //ejmSlider Option + interface SliderOptions { + theme?: ej.mobile.Theme; + renderMode?: ej.mobile.RenderMode; + minValue?: number; + maxValue?: number; + value?: number; + values?: Array; + orientation?: ej.mobile.Slider.Orientation; + enableRange?: boolean; + readOnly?: boolean; + incrementStep?: number; + enablePersistence?: boolean; + enabled?: boolean; + enableAnimation?: boolean; + animationSpeed?: number; + ios7?: Ios7Option; + windows?: windowsOption; + create? (e: SliderBaseEventArgs): void; + destroy? (e: SliderBaseEventArgs): void; + touchStart? (e: SliderEventArgs): void; + touchEnd? (e: SliderEventArgs): void; + load? (e: SliderEventArgs): void; + change? (e: SliderEventArgs): void; + slide? (e: SliderEventArgs): void; + } + + //ejmSlider IOS7 Option + interface Ios7Option { + thumbStyle?: ej.mobile.Slider.ThumbStyle; + } + //ejmSlider Slide Event Arugument + interface SliderBaseEventArgs { + cancel: boolean; + model: SliderOptions; + type: string; + } + interface SliderEventArgs extends SliderBaseEventArgs { + value?: number; + values?: Array; + } +export module Slider{ + enum Orientation{ + Horizontal, + Vertical + } + enum ThumbStyle{ + Normal, + Small + + } + +} +class Tab extends ej.Widget { + static fn: Tab; + constructor(element: JQuery, options?: TabOptions); + model:TabOptions; + defaults: TabOptions; + showBadge(index: (number|string)): void; + hideBadge(index: (number|string)): void; + updateBadgeValue(index: (number|string), value: (number|string)): void; + selectItem(index?: (number|string)): void; + enableItem(index?: (number|string)): void; + disableItem(index?: (number|string)): void; + enableContent(index?: (number|string)): void; + disableContent(index?: (number|string)): void; + addItem(tab: Object, index: (number|string)): void; + addOverflowItem(tab: Object, index: (number|string)): void; + removeItem(index: (number|string)): void; + removeOverflowItem(index: (number|string)): void; + getItemsCount(): number; + getOverflowItemCount(): number; + getActiveItemText(): string; + getActiveItem(): Object; + destroy(): void; +} + +interface TabOptions { + renderMode?: ej.mobile.RenderMode; + theme?: ej.mobile.Theme; + cssClass?: string; + allowScrolling?: boolean; + enableNativeScrolling?: boolean; + showScrollbars?: boolean; + enableAjax?: boolean; + showAjaxPopup?: boolean; + badge?: badgeTabOptions; + ios7?: ios7TabOptions; + enableCache?: boolean; + selectedItemIndex?: (number|string); + enabled?: boolean; + enablePersistence?: boolean; + prefetchAjaxContent?: boolean; + items?: Array; + overflowBadge?: overflowBadgeTabOptions; + android?: androidTabOptions; + windows?: windowsTabOptions; + flat?: flatTabOptions; + ajaxSettings?: ajaxSettingsTabOptions; + prefetchContentLoaded? (e: TabPrefetchEventArgs): void; + load? (e: TabEventArgs): void; + loadComplete? (e: TabLoadCompleteEventArgs): void; + touchStart? (e: TabEventArgs): void; + touchEnd? (e: TabEventArgs): void; + ajaxSuccess? (e: TabAjaxLoadSuccessEventArgs): void; + ajaxError? (e: TabAjaxLoadErrorEventArgs): void; + ajaxComplete? (e: TabEventArgs): void; + create? (e: TabEventArgs): void; + destroy? (e: TabEventArgs): void; + ajaxBeforeLoad? (e: TabAjaxBeforeLoadEventArgs): void; +} + +interface TabItemOptions { + text?: string; + href?: string; + enableAjax?: boolean; + badge?: badgeTabOptions; + touchStart? (e: TabEventArgs): void; + touchEnd? (e: TabEventArgs): void; + ios7?: ios7TabOptions; + android?: ios7TabOptions; +} + +interface TabEventArgs { + cancel: boolean; + type: string; + model: TabOptions; +} +interface TabAjaxBeforeLoadEventArgs extends TabEventArgs { + content?: any; + item?: any; + index?: number; + text?: string; + url?: string; +} +interface TabLoadCompleteEventArgs extends TabEventArgs { + element: Object; + id: string; +} +interface TabPrefetchEventArgs extends TabEventArgs { + item: Object; + content: string; + text: string; + url: string; + index: number; +} +interface TabAjaxLoadSuccessEventArgs extends TabEventArgs { + element: Object; + currentContent: string; +} + +interface TabAjaxLoadErrorEventArgs extends TabEventArgs { + status: boolean; + error: string; +} +interface badgeTabOptions { + enabled?: boolean; + value?: (number|string); + maxValue?: (number|string); + minValue?: (number|string); +} +interface ios7TabOptions { + imageClass?: string; +} +interface overflowBadgeTabOptions { + enabled?: boolean; + value?: (number|string); + maxValue?: (number|string); + minValue?: (number|string); +} +interface androidTabOptions { + contentType?: ej.mobile.Tab.Android.ContentType; + imageClass?: string; + position?: ej.mobile.Tab.Position; +} +interface windowsTabOptions extends windowsOption { + enableCustomText?: boolean; + position?: ej.mobile.Tab.Position; + enableTouchMove?: boolean; + preventContentSwipe?: boolean; +} +interface flatTabOptions { + position?: ej.mobile.Tab.Position; +} +interface ajaxSettingsTabOptions { + type?: string; + cache?: boolean; + async?: boolean; + dataType?: string; + contentType?: string; + url?: string; + data?: {}; +} + +export module Tab{ +export module Android{ +enum ContentType{ +Text, +Image, +Both +} +} +enum Position{ +Fixed, +Normal +} +} + +class Tile extends ej.Widget { + static fn: Tile; + constructor(element: JQuery, options?: TileOptions); + model: TileOptions; + defaults: TileOptions; + updateTemplate(id: string, index: (number|string)): void; + destroy(): void; +} + +interface TileOptions { + android?: androidTileOptions; + badge?: tileBadgeOptions; + cssClass?: string; + captionTemplateId?: string; + enablePersistence?: boolean; + imageClass?: string; + imagePath?: string; + imagePosition?: ej.mobile.Tile.ImagePosition; + imageTemplateId?: string; + imageUrl?: string; + backgroundColor?: string; + ios7?: ios7TileOptions; + liveTile?: liveTileOptions; + renderMode?: ej.mobile.RenderMode; + theme?: ej.mobile.Theme; + showText?: boolean; + text?: string; + textAlignment?: ej.mobile.Tile.TextAlignment; + tileSize?: ej.mobile.Tile.TileSize; + width?: (number|string); + height?: (number|string); + touchEnd? (e: tileTouchEventArgs): void; + touchStart? (e: tileTouchEventArgs): void; + create? (e: TileEventArgs): void; + destroy? (e: TileEventArgs): void; +} +interface TileEventArgs { + cancel?: boolean; + model?: TileOptions; + type?: string; +} +interface tileBadgeOptions { + enabled?: boolean; + value?: (number|string); + maxValue?: (number|string); + minValue?: (number|string); + text?: string; +} + +interface liveTileOptions { + enabled?: boolean; + imageClass?: string; + imageTemplateId?: string; + imageUrl?: string[]; + type?: string; + updateInterval?: number; +} + +interface ios7TileOptions { + textPosition?: ej.mobile.Tile.TextPosition; +} + +interface androidTileOptions { + textPosition?: ej.mobile.Tile.TextPosition; +} + +interface tileTouchEventArgs extends TileEventArgs { + text?: string; +} + +export module Tile +{ +enum TextPosition +{ + Inner, + Outer +} +enum TileSize +{ + Medium, + Small, + Large, + Wide +} +enum TextAlignment +{ + + Normal, + Left, + Right, + Center +} +enum ImagePosition +{ + Center, + Top, + Bottom, + Right, + Left, + TopLeft, + TopRight, + BottomRight, + BottomLeft, + Fill +} +} + + +class TimePicker extends ej.Widget { + static fn: TimePicker; + static Locale:any; + constructor(element: JQuery, options?: TimePickerOptions); + model: TimePickerOptions; + defaults: TimePickerOptions; + show(e?:any): void; + hide(e?:any): void; + enable(): void; + disable(): void; + getValue(): string; + setCurrentTime(time: any): void; + destroy(): void; +} +interface TimePickerOptions { + renderMode?: ej.mobile.RenderMode; + theme?: ej.mobile.Theme; + cssClass?: string; + hourFormat?: ej.mobile.TimePicker.HourFormat; + value?: string; + culture?: string; + timeFormat?: string; + enabled?: boolean; + enablePersistence?:boolean; + ios7?: ios7TimepickerOptions; + windows?: windowsOption; + select? (e: TimepickerEventArgs): void; + load? (e: TimepickerEventArgs): void; + focusIn? (e: TimepickerEventArgs): void; + focusOut? (e: TimepickerEventArgs): void; + open? (e: TimepickerEventArgs): void; + close? (e: TimepickerEventArgs): void; + change? (e: TimepickerEventArgs): void; + create? (e: TimePickerCommonEventArgs): void; + destroy? (e: TimePickerCommonEventArgs): void; +} +interface TimePickerCommonEventArgs { + cancel: boolean; + type: string; + model: TimePickerOptions; +} +interface TimepickerEventArgs extends TimePickerCommonEventArgs { + value: string; +} +interface ios7TimepickerOptions { + renderDefault?: boolean; +} + +export module TimePicker{ +enum HourFormat{ + TwentyFour, + Twelve +} +} + +//Class ejmToggleButton +class ToggleButton extends ej.Widget { + static fn: ToggleButton; + constructor(element: JQuery, options?: ToggleButtonOptions); + model: ToggleButtonOptions; + defaults: ToggleButtonOptions; + enable(): void; + disable(): void; + destroy(): void; +} + +//ejmToggleButton Option +interface ToggleButtonOptions { + theme?: ej.mobile.Theme; + renderMode?: ej.mobile.RenderMode; + cssClass?: string; + animate?: boolean; + toggleState?: boolean; + windows?: windowsOption; + enablePersistence?: boolean; + enabled?: boolean; + change? (e: ToggleButtonEventArgs): void; + touchStart? (e: ToggleButtonEventArgs): void; + touchEnd? (e: ToggleButtonEventArgs): void; + create? (e: ToggleButtonCommonEventArgs): void; + destroy? (e: ToggleButtonCommonEventArgs): void; +} + +interface ToggleButtonCommonEventArgs { + cancel: boolean; + type: string; + model: ToggleButtonOptions; +} +//ToggleButtonEvent Arugument +interface ToggleButtonEventArgs extends ToggleButtonCommonEventArgs { + state: boolean; +} +//Class ejmToolbar +class Toolbar extends ej.Widget { + static fn: Toolbar; + constructor(element: JQuery, options?: ToolbarOptions); + model: ToolbarOptions; + validTags: Array; + defaults: ToolbarOptions; + removeItem(index:number): void; + addItem(newitem:string): void; + showEllipsis(): void; + disableItem(disableIcon:string): void; + enableItem(enableIcon:string): void; + hideItem(iconName:string): void; + hideEllipsis(): void; + showItem(iconName:string): void; + hideMenu(): void; + showMenu(): void; + destroy(): void; +} + +//ejmToolbar Android Options +interface ToolbarAndroidOptions { + title?: string; + titleIconUrl?: string; + showBackNavigator?: boolean; + showTitleIcon?: boolean; + enableSplitView?: boolean; + showEllipsis?: boolean; + position?: ej.mobile.Toolbar.Position; + +} +//ejmToolbar IOS7 Options +interface ToolbarIOS7Options { + position?: ej.mobile.Toolbar.Position; +} +//ejmToolbar Flat Options +interface ToolbarFlatOptions { + position?: ej.mobile.Toolbar.Position; +} +//ejmToolbar Windows Options +interface ToolbarWindowsOptions { + position?: ej.mobile.Toolbar.Position; +} +//ejmToolbar Option +interface ToolbarOptions { + theme?: ej.mobile.Theme; + renderMode?: ej.mobile.RenderMode; + cssClass?: string; + items?: Array; + enabled?: boolean; + enablePersistence?:boolean; + hide?: boolean; + position?: ej.mobile.Toolbar.Position; + android?: ToolbarAndroidOptions; + windows?: windowsOption; + ios7?: ToolbarIOS7Options; + Flat?: ToolbarFlatOptions; + templateId?: any; + titleIconUrl?: any; + touchStart? (e: ToolbarEventArgs): void; + touchEnd? (e: ToolbarEventArgs): void; + create? (e: ToolbarEventArgs): void; + destroy? (e: ToolbarEventArgs): void; + +} +interface ToolbarItems{ + iconName?: ej.mobile.Toolbar.IconName; + iconUrl?: string; +} +//ejmToolbarEvent Arugument +interface ToolbarEventArgs { + cancel: boolean; + type: string; + model: ToolbarOptions; +} + +export module Toolbar{ + enum Position{ + Normal, + Fixed + } + enum IconName{ + Add, + Back, + Bookmark, + Close, + Compose, + Copy, + Cut, + Delete, + Done, + Edit, + Mail, + Next, + Refresh, + Overflow, + Paste, + Reply, + Save, + Search, + Settings, + Share + } +} +/*Group button*/ +class GroupButton extends ej.Widget { + static fn: GroupButton; + element: JQuery; + constructor(element?: JQuery, options?: GroupButtonOptions); + model: GroupButtonOptions; + defaults: GroupButtonOptions; + destroy(): void; + //add public functions +} +interface GroupButtonOptions { + selectedItemIndex?: (number|string); + renderMode?: ej.mobile.RenderMode; + theme?: ej.mobile.Theme; + cssClass?: string; + enablePersistence?: boolean; + items?: Array; + windows?: windowsOption; + touchStart? (e: GroupButtonEventArgs): void; + touchEnd? (e: GroupButtonEventArgs): void; + destroy? (e: GroupButtonEventArgs): void; + create? (e: GroupButtonEventArgs): void; +} +interface GroupButtonItemsOptions { + text?: string; + type?: string; + imageClass?: string; + imageUrl?: string; +} +interface GroupButtonEventArgs { + cancel: boolean; + type: string; + model: GroupButtonOptions; +} +/* SplitPane */ +class SplitPane extends ej.Widget { + static fn: SplitPane; + constructor(element: JQuery, options?: SplitPaneOptions); + model:SplitPaneOptions; + defaults: SplitPaneOptions; + loadContent(toPage: string, options?: any): void; + transferPage(toPage: any, options: any, existing: any, newPage: any): void; + refreshRightScroller(): void; + refreshLeftScroller(): void; + destroy(): void; +} +interface SplitPaneOptions { + renderMode?: ej.mobile.RenderMode; + theme?: ej.mobile.Theme; + cssClass?: string; + allowLeftPaneScrolling?: boolean; + allowRightPaneScrolling?: boolean; + android?: SplitPaneAndroidOptions; + windows?: SplitPaneWindowsOptions; + ios7?: SplitPaneIOS7Options; + flat?: SplitPaneFlatOptions; + enablePersistence?: boolean; + enableSwipe?: boolean; + overlayLeftPane?: boolean; + overlayDirection?: ej.mobile.SplitPane.OverlayDirection; + leftPaneScrollSettings?: Object; + rightPaneScrollSettings?: Object; + leftHeaderSettings?: Object; + rightHeaderSettings?: Object; + toolbarSettings?: Object; + create? (e: SplitPaneBaseEventArgs): void; + destroy? (e: SplitPaneBaseEventArgs): void; + beforeTransfer? (e: SplitPaneEventArgs): void; + afterLoadSuccess? (e: SplitPaneEventArgs): void; +} +interface SplitPaneBaseEventArgs { + cancel: boolean; + type: string; + model: SplitPaneOptions; +} +interface SplitPaneEventArgs extends SplitPaneBaseEventArgs { + element: Object; + toPage: Object; + leftPaneheader: Object; + rightPaneheader: Object; + toolbar: Object; +} +interface SplitPaneAndroidOptions { + showToolbar?: boolean; +} +interface SplitPaneWindowsOptions { + showLeftPaneHeader?: boolean; + showRightPaneHeader?: boolean; +} +interface SplitPaneIOS7Options { + showLeftPaneHeader?: boolean; + showRightPaneHeader?: boolean; +} +interface SplitPaneFlatOptions { + showLeftPaneHeader?: boolean; + showRightPaneHeader?: boolean; +} + +export module SplitPane{ +enum OverlayDirection{ +Left, +Right +} +} + +class Dialog extends ej.Widget { + static fn: Dialog; + element: JQuery; + constructor(element: JQuery, options?: DialogOptions); + model: DialogOptions; + defaults: DialogOptions; + open(): void; + close(): void; + isOpened(): boolean; + destroy(): void; +} +interface DialogOptions { + cssClass?: string; + enableAutoOpen?: boolean; + title?: string; + beforeClose? (e: DialogBeforeClose): void; + open? (e: DialogOpen): void; + close? (e: DialogClose): void; + buttonTap? (e: DialogButtonTap): void; + renderMode?: ej.mobile.RenderMode; + theme?: ej.mobile.Theme; + enableModal?: boolean; + showButtons?: boolean; + allowScrolling?: boolean; + enableNativeScrolling?: boolean; + mode?: ej.mobile.Dialog.Mode; + leftButtonCaption?: string; + rightButtonCaption?: string; + checkDOMChanges?: boolean; + templateId?: string; + targetHeight?: string|number; + enablePersistence?: boolean; + enableAnimation?: boolean; + windows?: windowsOption; + destroy? (e: DialogEventArgs): void; + create? (e: DialogEventArgs): void; +} +interface DialogEventArgs { + cancel: boolean; + type: string; + model: DialogOptions; +} +interface DialogBeforeClose extends DialogEventArgs{ + title: string; +} +interface DialogOpen extends DialogEventArgs { + element: Object; + title: string; +} +interface DialogClose extends DialogEventArgs { + title: string; + element: Object; +} +interface DialogButtonTap extends DialogEventArgs { + text: string; +} + +export module Dialog{ +enum Mode{ + Alert, + Confirm, + Normal, + FullView +} +} + +class TextboxCommon extends ej.Widget { + model: TextBoxOptions; + disable(): void; + enable(): void; + getStrippedValue(): string; + getUnstrippedValue(): string; + getValue(): string; + getWatermarkText(): string; + refresh(): void; + destroy(): void; +} +class TextBox extends TextboxCommon { + static fn: TextBox; + constructor(element: JQuery, options?: TextBoxOptions); + defaults: TextBoxOptions; +} +/* Password */ +class Password extends TextboxCommon { + static fn: Password; + constructor(element: JQuery, options?: TextBoxOptions); + defaults: TextBoxOptions; +} +/* MaskEdit */ +class MaskEdit extends TextboxCommon { + static fn: MaskEdit; + constructor(element: JQuery, options?: MaskEditOptions); + defaults: MaskEditOptions; + +} +/* TextArea */ +class TextArea extends TextboxCommon { + static fn: TextArea; + constructor(element: JQuery, options?: TextBoxOptions); + defaults: TextBoxOptions; + +} +interface TextBoxOptions { + renderMode?: ej.mobile.RenderMode; + theme?: ej.mobile.Theme; + cssClass?: string; + showBorder?: boolean; + windows?: WindowsTextBoxOptions; + value?: string; + watermarkText?: string; + change? (e: TextBoxChangeEventArgs): void; + create? (e: TextBoxEventArgs): void; + destroy? (e: TextBoxEventArgs): void; + enabled?: boolean; + enablePersistence?: boolean; + readOnly?: boolean; +} +interface TextBoxEventArgs { + cancel: boolean; + type: string; + model: TextBoxOptions; +} +interface MaskEditOptions extends TextBoxOptions { + mask?: string; +} +interface WindowsTextBoxOptions extends windowsOption { + allowReset?: boolean; +} +interface TextBoxChangeEventArgs extends TextBoxEventArgs { + element: Object; + value: string; + isChecked: boolean; +} +class Footer extends ej.Widget { + static fn: Footer; + element: JQuery; + constructor(element: JQuery, options?: FooterOptions); + model: FooterOptions; + defaults: FooterOptions; + getTitle(): string; + destroy(): void; + +} + +interface FooterOptions { + hideForUnSupportedDevice?: boolean; + leftButtonNavigationUrl?: string; + rightButtonNavigationUrl?: string; + title?: string; + cssClass?: string; + showTitle?: boolean; + position?: ej.mobile.Footer.Position; + leftButtonCaption?: string; + rightButtonCaption?: string; + renderMode?: ej.mobile.RenderMode; + theme?: ej.mobile.Theme; + showLeftButton?: boolean; + showRightButton?: boolean; + enablePersistence?:boolean; + leftButtonStyle?:ej.mobile.Footer.FooterLeftButtonStyle; + rightButtonStyle?:ej.mobile.Footer.FooterRightButtonStyle; + ios7?: Footerios7Options; + flat?: FooterFlatOptions; + android?: FooterAndroidOptions; + templateId?: string; + windows?: FooterWindowsOptions; + leftButtonTap? (e: FooterLeftButtonTapEventArgs): void; + rightButtonTap? (e: FooterRightButtonTapEventArgs): void; + destroy?(e:FooterBaseArgs):void; + create?(e:FooterBaseArgs):void; +} + +interface FooterWindowsOptions extends windowsOption { + renderDefault?: boolean; + rightButtonStyle?: ej.mobile.Footer.Windows.FooterRightButtonStyle; + leftButtonStyle?: ej.mobile.Footer.Windows.FooterLeftButtonStyle; + showLeftButton?: boolean; + showRightButton?: boolean; +} +interface Footerios7Options { + rightButtonStyle?: ej.mobile.Footer.IOS7.FooterRightButtonStyle; + leftButtonStyle?: ej.mobile.Footer.IOS7.FooterLeftButtonStyle; + showLeftButton?: boolean; + showRightButton?: boolean; +} +interface FooterFlatOptions { + rightButtonStyle?: ej.mobile.Footer.Flat.FooterRightButtonStyle; + leftButtonStyle?: ej.mobile.Footer.Flat.FooterLeftButtonStyle; + showLeftButton?: boolean; + showRightButton?: boolean; +} +interface FooterAndroidOptions { + rightButtonStyle?: ej.mobile.Footer.Android.FooterRightButtonStyle; + leftButtonStyle?: ej.mobile.Footer.Android.FooterLeftButtonStyle; + showLeftButton?: boolean; + showRightButton?: boolean; +} + +interface FooterBaseArgs{ + cancel: boolean; + type: string; + model: FooterOptions; +} + +interface FooterLeftButtonTapEventArgs { + text: string; + cancel: boolean; + model: Object; + type: string; + status: boolean; +} +interface FooterRightButtonTapEventArgs { + text: string; + cancel: boolean; + model: Object; + type: string; + status: boolean; +} + +export module Footer{ +export module IOS7 +{ +enum FooterLeftButtonStyle +{ + Auto, + Back, + Header, + Normal +} +enum FooterRightButtonStyle +{ + Auto, + Header, + Normal +} +} + +export module Flat +{ +enum FooterLeftButtonStyle +{ + Auto, + Back, + Normal, + Header +} +enum FooterRightButtonStyle +{ + Auto, + Header, + Normal +} +} + +export module Android +{ +enum FooterLeftButtonStyle +{ + Auto, + Back, + Normal, + Header +} +enum FooterRightButtonStyle +{ + Auto, + Normal, + Header +} +} + +export module Windows +{ +enum FooterLeftButtonStyle +{ + Auto, + Back, + Normal, + Header +} +enum FooterRightButtonStyle +{ + Auto, + Normal, + Header +} +} +enum Position{ + Normal, + Fixed +} +enum FooterLeftButtonStyle{ +Back, +Header, +Normal +} +enum FooterRightButtonStyle{ +Header, +Normal +} +} + +class CheckBox extends ej.Widget { + static fn: CheckBox; + constructor(element: JQuery, options?: CheckBoxOptions); + model: CheckBoxOptions; + defaults: CheckBoxOptions; + isChecked(): boolean; + destroy(): void; + +} +interface CheckBoxOptions { + touchStart? (e: CheckBoxTouchStart): void; + touchEnd? (e: CheckBoxTouchEnd): void; + renderMode?: ej.mobile.RenderMode; + cssClass?: string; + preventDefault?: boolean; + theme?: ej.mobile.Theme; + enabled?: boolean; + checked?: boolean; + enableTriState?: boolean; + checkState?: ej.mobile.CheckBox.CheckState; + windows?: windowsOption; + enablePersistence?: boolean; + text?: string; + destroy? (e: checkBoxEventArgs): void; + create? (e: checkBoxEventArgs): void; +} +interface checkBoxEventArgs { + cancel: boolean; + type: string; + model: CheckBoxOptions; +} +interface CheckBoxTouchStart extends checkBoxEventArgs{ + element: Object; + value: string; + isChecked: boolean; +} +interface CheckBoxTouchEnd extends checkBoxEventArgs{ + element: Object; + value: string; + isChecked: boolean; +} +export module CheckBox{ + enum CheckState{ + Uncheck, + Check, + Indeterminate + } +} +class ScrollPanel extends ej.Widget { + static fn: ScrollPanel; + constructor(element: JQuery, target: any, options?: ScrollPanelOptions); + model: ScrollPanelOptions; + defaults: ScrollPanelOptions; + refresh(): void; + disable(): void; + enable(): void; + getComputedPosition(): void; + stop(): void; + getScrollPosition(): void; + destroy(): void; + } + interface ScrollPanelOptions { + renderMode?: ej.mobile.RenderMode; + theme?: ej.mobile.Theme; + enableResize?: boolean; + targetHeight?: number; + targetWidth?: number; + scrollHeight?: number; + scrollWidth?: number; + target: any; + enableFade?: boolean; + enableShrink?: (boolean|string); + autoAdjustHeight?: boolean; + isRelative?: boolean; + wheelSpeed?: number; + enableInteraction?: boolean; + enabled?: boolean; + eventPassthrough?:any; + translateZ?:string; + mode?:ej.mobile.ScrollPanel.Mode; + checkDOMChanges?: boolean; + enableHrScroll?: boolean; + enableVrScroll?: boolean; + zoomMin?: number; + zoomMax?: number; + adjustFixedPosition?: boolean; + startZoom?: number; + startX?: number; + startY?: number; + bounceEasing?:string; + enableDisplacement?:boolean; + displacementValue?:number; + displacementTime?:number; + preventDefaultException?:{tagName?:any} + deceleration?:any; + disablePointer?: boolean; + disableMouse?: boolean; + disableTouch?: boolean; + directionLockThreshold?: number; + momentum?: boolean; + enableBounce?: boolean; + bounceTime?: number; + preventDefault?: boolean; + enableTransform?: boolean; + enableTransition?: boolean; + showScrollbars?: boolean; + enableMouseWheel?: boolean; + enableKeys?: boolean; + enableZoom?: boolean; + enableNativeScrolling?: boolean; + invertWheel?: boolean; + enablePersistence?: boolean; + create? (e: ScrollPanelBaseEventArgs): void; + destroy? (e: ScrollPanelBaseEventArgs): void; + scrollStart? (e: ScrollPanelEventArgs): void; + scroll? (e: ScrollPanelEventArgs): void; + scrollEnd? (e: ScrollPanelEventArgs): void; + zoomStart? (e: ScrollPanelEventArgs): void; + zoomEnd? (e: ScrollPanelEventArgs): void; + } +interface ScrollPanelBaseEventArgs { + cancel: boolean; + type: string; + model: ScrollPanelOptions; +} +interface ScrollPanelEventArgs extends ScrollPanelBaseEventArgs { + x: number; + y: number; + object: Object; +} +export module ScrollPanel{ + enum Mode{ + Page, + Container + } +} +class NavigationDrawer extends ej.Widget { + static fn: NavigationDrawer; + element: JQuery; + constructor(element: JQuery, options?: NavigationDrawerOptions); + model: NavigationDrawerOptions; + defaults: NavigationDrawerOptions; + open(e: any): void; + close(e: any): void; + toggle(e: any): void; + destroy(): void; +} +//ejmNavigationDrawer Option +interface NavigationDrawerOptions { + theme?: ej.mobile.Theme; + renderMode?: ej.mobile.RenderMode; + cssClass?: string; + contentId?: string; + allowScrolling?: boolean; + scrollSettings?: {}; + considerSubPage?: boolean; + direction?: ej.mobile.NavigationDrawer.Direction; + showScrollbars?: boolean; + targetId?: string; + position?: ej.mobile.NavigationDrawer.Position; + enableListView?: boolean; + listViewSettings?: {}; + type?: ej.mobile.NavigationDrawer.Type; + width?: string; + items?: Array; + swipe? (e: NavigationDrawerSwipeEventArgs): void; + open? (e: NavigationDrawerOpenBeforeCloseEventArgs): void; + beforeClose? (e: NavigationDrawerOpenBeforeCloseEventArgs): void; + create? (e: NavigationDrawerEvent): void; + destroy? (e: NavigationDrawerEvent): void; +} + +interface NavigationDrawerEvent { + type: string; + cancel: boolean; + model: NavigationDrawerOptions; +} + +//ejmNavigationDrawer Swipe Event Arugument +interface NavigationDrawerSwipeEventArgs extends NavigationDrawerEvent { + element: Object; + targetElement: Object; + direction: string; +} +//ejmNavigationDrawer Open and BeforeClose Event Arugument +interface NavigationDrawerOpenBeforeCloseEventArgs extends NavigationDrawerEvent { + element: Object; +} + +export module NavigationDrawer { + enum Direction { + Left, + Right + } + enum Position { + Normal, + Fixed + } + enum Type { + Overlay, + Slide + } +} + + +class RadialMenu extends ej.Widget { + static fn: RadialMenu; + constructor(element: JQuery, options?: RadialMenuOptions); + model: RadialMenuOptions; + defaults: RadialMenuOptions; + show(): void; + hide(): void; + menuHide(): void; + hideMenu(): void; + showMenu(): void; + enableItemByIndex(index: number): void; + enableItemsByIndices(itemIndices: Array): void; + disableItemByIndex(itemIndex: number): void; + disableItemsByIndices(itemIndices: Array): void; + updateBadgeValue(index: number, value: number): void; + showBadge(index: number): void; + hideBadge(index: number): void; +} + +interface RadialMenuOptions { + renderMode?: ej.mobile.RenderMode; + theme?: ej.mobile.Theme; + radius?: number; + cssClass?: string; + imageClass?: string; + backImageClass?: string; + position?: ej.mobile.RadialMenu.Position; + enableAnimation?: boolean; + windows?: windowsOption; + items?: any; + touch? (e: RadialMenuEventArgs): void; + open? (e: RadialMenuEventArgs): void; + close? (e: RadialMenuEventArgs): void; + select? (e: RadialMenuEventArgs): void; +} +interface RadialMenuEventArgs { + cancel: boolean; + model: RadialMenuOptions; + type: string; + index: number; + childIndex: number; +} +export module RadialMenu{ + enum Position{ + RightCenter, + RightTop, + RightBottom, + LeftCenter, + LeftTop, + LeftBottom + } +} + + +class RadialSlider extends ej.Widget { + static fn: RadialSlider; + constructor(element: JQuery, options?: RadialSliderOptions); + constructor(element: Element, options?: RadialSliderOptions); + model:RadialSliderOptions; + defaults:RadialSliderOptions; + show(): void; + hide(): void; + destroy(): void; +} + +interface RadialSliderOptions { + radius?: number; + endAngle?: number; + startAngle?: number; + ticks?: Array; + enableRoundOff?: boolean; + value?: number|string; + strokeWidth?: number; + autoOpen?: boolean; + enableAnimation?: boolean; + cssClass?: string; + renderMode?: ej.mobile.RenderMode; + theme?: ej.mobile.Theme; + position?: ej.mobile.RadialSlider.Position; + labelSpace?: string|number; + innerCircleImageClass?: string; + innerCircleImageUrl?: string; + showInnerCircle?: boolean; + inline?: boolean; + stop? (e: RadialSliderStopEventArgs): void; + start? (e: RadialSliderStartEventArgs): void; + slide? (e: RadialSliderSlideEventArgs): void; + change? (e: RadialSliderChangeEventArgs): void; + mouseover? (e: RadialSliderMouseOverEventArgs): void; + create? (e: RadialSliderCreateEventArgs): void; + destroy? (e: RadialSliderCreateEventArgs): void; +} +interface RadialSliderCreateEventArgs { + cancel: boolean; + model: RadialSliderOptions; + type: string; +} +interface RadialSliderStopEventArgs extends RadialSliderCreateEventArgs { + value: number; +} + +interface RadialSliderStartEventArgs extends RadialSliderCreateEventArgs { + value: number; +} +interface RadialSliderSlideEventArgs extends RadialSliderCreateEventArgs { + value: number; + selectedValue: number; +} +interface RadialSliderChangeEventArgs extends RadialSliderCreateEventArgs { + value: number; + oldValue: number; +} +interface RadialSliderMouseOverEventArgs extends RadialSliderCreateEventArgs { + value: number; + selectedValue: number; +} +export module RadialSlider { + enum Position { + RightCenter, + RightTop, + RightBottom, + LeftCenter, + LeftTop, + LeftBottom, + TopLeft, + TopRight, + TopCenter, + BottomLeft, + BottomRight, + BottomCenter + } +} +} +declare module ej.datavisualization { + +class LinearGauge extends ej.Widget { + static fn: LinearGauge; + constructor(element: JQuery, options?: LinearGauge.Model); + constructor(element: Element, options?: LinearGauge.Model); + model:LinearGauge.Model; + defaults:LinearGauge.Model; + + /** destroy the linear gauge all events bound using this._on will be unbind automatically and bring the control to pre-init state. + * @returns {void} + */ + destroy(): void; + + /** To export Image + * @returns {void} + */ + exportImage(): void; + + /** To get Bar Distance From Scale in number + * @returns {void} + */ + getBarDistanceFromScale(): void; + + /** To get Bar Pointer Value in number + * @returns {void} + */ + getBarPointerValue(): void; + + /** To get Bar Width in number + * @returns {void} + */ + getBarWidth(): void; + + /** To get CustomLabel Angle in number + * @returns {void} + */ + getCustomLabelAngle(): void; + + /** To get CustomLabel Value in string + * @returns {void} + */ + getCustomLabelValue(): void; + + /** To get Label Angle in number + * @returns {void} + */ + getLabelAngle(): void; + + /** To get LabelPlacement in number + * @returns {void} + */ + getLabelPlacement(): void; + + /** To get LabelStyle in number + * @returns {void} + */ + getLabelStyle(): void; + + /** To get Label XDistance From Scale in number + * @returns {void} + */ + getLabelXDistanceFromScale(): void; + + /** To get PointerValue in number + * @returns {void} + */ + getLabelYDistanceFromScale(): void; + + /** To get Major Interval Value in number + * @returns {void} + */ + getMajorIntervalValue(): void; + + /** To get MarkerStyle in number + * @returns {void} + */ + getMarkerStyle(): void; + + /** To get Maximum Value in number + * @returns {void} + */ + getMaximumValue(): void; + + /** To get PointerValue in number + * @returns {void} + */ + getMinimumValue(): void; + + /** To get Minor Interval Value in number + * @returns {void} + */ + getMinorIntervalValue(): void; + + /** To get Pointer Distance From Scale in number + * @returns {void} + */ + getPointerDistanceFromScale(): void; + + /** To get PointerHeight in number + * @returns {void} + */ + getPointerHeight(): void; + + /** To get Pointer Placement in String + * @returns {void} + */ + getPointerPlacement(): void; + + /** To get PointerValue in number + * @returns {void} + */ + getPointerValue(): void; + + /** To get PointerWidth in number + * @returns {void} + */ + getPointerWidth(): void; + + /** To get Range Border Width in number + * @returns {void} + */ + getRangeBorderWidth(): void; + + /** To get Range Distance From Scale in number + * @returns {void} + */ + getRangeDistanceFromScale(): void; + + /** To get Range End Value in number + * @returns {void} + */ + getRangeEndValue(): void; + + /** To get Range End Width in number + * @returns {void} + */ + getRangeEndWidth(): void; + + /** To get Range Position in number + * @returns {void} + */ + getRangePosition(): void; + + /** To get Range Start Value in number + * @returns {void} + */ + getRangeStartValue(): void; + + /** To get Range Start Width in number + * @returns {void} + */ + getRangeStartWidth(): void; + + /** To get ScaleBarLength in number + * @returns {void} + */ + getScaleBarLength(): void; + + /** To get Scale Bar Size in number + * @returns {void} + */ + getScaleBarSize(): void; + + /** To get Scale Border Width in number + * @returns {void} + */ + getScaleBorderWidth(): void; + + /** To get Scale Direction in number + * @returns {void} + */ + getScaleDirection(): void; + + /** To get Scale Location in object + * @returns {void} + */ + getScaleLocation(): void; + + /** To get Scale Style in string + * @returns {void} + */ + getScaleStyle(): void; + + /** To get Tick Angle in number + * @returns {void} + */ + getTickAngle(): void; + + /** To get Tick Height in number + * @returns {void} + */ + getTickHeight(): void; + + /** To get getTickPlacement in number + * @returns {void} + */ + getTickPlacement(): void; + + /** To get Tick Style in string + * @returns {void} + */ + getTickStyle(): void; + + /** To get Tick Width in number + * @returns {void} + */ + getTickWidth(): void; + + /** To get get Tick XDistance From Scale in number + * @returns {void} + */ + getTickXDistanceFromScale(): void; + + /** To get Tick YDistance From Scale in number + * @returns {void} + */ + getTickYDistanceFromScale(): void; + + /** Specifies the scales. + * @returns {void} + */ + scales(): void; + + /** To set setBarDistanceFromScale + * @returns {void} + */ + setBarDistanceFromScale(): void; + + /** To set setBarPointerValue + * @returns {void} + */ + setBarPointerValue(): void; + + /** To set setBarWidth + * @returns {void} + */ + setBarWidth(): void; + + /** To set setCustomLabelAngle + * @returns {void} + */ + setCustomLabelAngle(): void; + + /** To set setCustomLabelValue + * @returns {void} + */ + setCustomLabelValue(): void; + + /** To set setLabelAngle + * @returns {void} + */ + setLabelAngle(): void; + + /** To set setLabelPlacement + * @returns {void} + */ + setLabelPlacement(): void; + + /** To set setLabelStyle + * @returns {void} + */ + setLabelStyle(): void; + + /** To set setLabelXDistanceFromScale + * @returns {void} + */ + setLabelXDistanceFromScale(): void; + + /** To set setLabelYDistanceFromScale + * @returns {void} + */ + setLabelYDistanceFromScale(): void; + + /** To set setMajorIntervalValue + * @returns {void} + */ + setMajorIntervalValue(): void; + + /** To set setMarkerStyle + * @returns {void} + */ + setMarkerStyle(): void; + + /** To set setMaximumValue + * @returns {void} + */ + setMaximumValue(): void; + + /** To set setMinimumValue + * @returns {void} + */ + setMinimumValue(): void; + + /** To set setMinorIntervalValue + * @returns {void} + */ + setMinorIntervalValue(): void; + + /** To set setPointerDistanceFromScale + * @returns {void} + */ + setPointerDistanceFromScale(): void; + + /** To set PointerHeight + * @returns {void} + */ + setPointerHeight(): void; + + /** To set setPointerPlacement + * @returns {void} + */ + setPointerPlacement(): void; + + /** To set PointerValue + * @returns {void} + */ + setPointerValue(): void; + + /** To set PointerWidth + * @returns {void} + */ + setPointerWidth(): void; + + /** To set setRangeBorderWidth + * @returns {void} + */ + setRangeBorderWidth(): void; + + /** To set setRangeDistanceFromScale + * @returns {void} + */ + setRangeDistanceFromScale(): void; + + /** To set setRangeEndValue + * @returns {void} + */ + setRangeEndValue(): void; + + /** To set setRangeEndWidth + * @returns {void} + */ + setRangeEndWidth(): void; + + /** To set setRangePosition + * @returns {void} + */ + setRangePosition(): void; + + /** To set setRangeStartValue + * @returns {void} + */ + setRangeStartValue(): void; + + /** To set setRangeStartWidth + * @returns {void} + */ + setRangeStartWidth(): void; + + /** To set setScaleBarLength + * @returns {void} + */ + setScaleBarLength(): void; + + /** To set setScaleBarSize + * @returns {void} + */ + setScaleBarSize(): void; + + /** To set setScaleBorderWidth + * @returns {void} + */ + setScaleBorderWidth(): void; + + /** To set setScaleDirection + * @returns {void} + */ + setScaleDirection(): void; + + /** To set setScaleLocation + * @returns {void} + */ + setScaleLocation(): void; + + /** To set setScaleStyle + * @returns {void} + */ + setScaleStyle(): void; + + /** To set setTickAngle + * @returns {void} + */ + setTickAngle(): void; + + /** To set setTickHeight + * @returns {void} + */ + setTickHeight(): void; + + /** To set setTickPlacement + * @returns {void} + */ + setTickPlacement(): void; + + /** To set setTickStyle + * @returns {void} + */ + setTickStyle(): void; + + /** To set setTickWidth + * @returns {void} + */ + setTickWidth(): void; + + /** To set setTickXDistanceFromScale + * @returns {void} + */ + setTickXDistanceFromScale(): void; + + /** To set setTickYDistanceFromScale + * @returns {void} + */ + setTickYDistanceFromScale(): void; +} +export module LinearGauge{ + +export interface Model { + + /**Specifies the animationSpeed + * @Default {500} + */ + animationSpeed?: number; + + /**Specifies the backgroundColor for Linear gauge. + * @Default {null} + */ + backgroundColor?: string; + + /**Specifies the borderColor for Linear gauge. + * @Default {null} + */ + borderColor?: string; + + /**Specifies the animate state + * @Default {true} + */ + enableAnimation?: boolean; + + /**Specifies the animate state for marker pointer + * @Default {true} + */ + enableMarkerPointerAnimation?: boolean; + + /**Specifies the can resize state. + * @Default {false} + */ + enableResize?: boolean; + + /**Specify frame of linear gauge + * @Default {null} + */ + frame?: Frame; + + /**Specifies the height of Linear gauge. + * @Default {400} + */ + height?: number; + + /**Specifies the labelColor for Linear gauge. + * @Default {null} + */ + labelColor?: string; + + /**Specifies the maximum value of Linear gauge. + * @Default {100} + */ + maximum?: number; + + /**Specifies the minimum value of Linear gauge. + * @Default {0} + */ + minimum?: number; + + /**Specifies the orientation for Linear gauge. + * @Default {Vertical} + */ + orientation?: string; + + /**Specify labelPosition value of Linear gauge See OuterCustomLabelPosition + * @Default {bottom} + */ + outerCustomLabelPosition?: ej.datavisualization.LinearGauge.OuterCustomLabelPosition|string; + + /**Specifies the pointerGradient1 for Linear gauge. + * @Default {null} + */ + pointerGradient1?: any; + + /**Specifies the pointerGradient2 for Linear gauge. + * @Default {null} + */ + pointerGradient2?: any; + + /**Specifies the read only state. + * @Default {true} + */ + readOnly?: boolean; + + /**Specifies the scales + * @Default {null} + */ + scales?: Scales; + + /**Specifies the theme for Linear gauge. See LinearGauge.Themes + * @Default {flatlight} + */ + theme?: ej.datavisualization.LinearGauge.Themes|string; + + /**Specifies the tick Color for Linear gauge. + * @Default {null} + */ + tickColor?: string; + + /**Specify tooltip options of linear gauge + * @Default {false} + */ + tooltip?: Tooltip; + + /**Specifies the value of the Gauge. + * @Default {0} + */ + value?: number; + + /**Specifies the width of Linear gauge. + * @Default {150} + */ + width?: number; + + /**Triggers while the bar pointer are being drawn on the gauge.*/ + drawBarPointers? (e: DrawBarPointersEventArgs): void; + + /**Triggers while the customLabel are being drawn on the gauge.*/ + drawCustomLabel? (e: DrawCustomLabelEventArgs): void; + + /**Triggers while the Indicator are being drawn on the gauge.*/ + drawIndicators? (e: DrawIndicatorsEventArgs): void; + + /**Triggers while the label are being drawn on the gauge.*/ + drawLabels? (e: DrawLabelsEventArgs): void; + + /**Triggers while the marker are being drawn on the gauge.*/ + drawMarkerPointers? (e: DrawMarkerPointersEventArgs): void; + + /**Triggers while the range are being drawn on the gauge.*/ + drawRange? (e: DrawRangeEventArgs): void; + + /**Triggers while the ticks are being drawn on the gauge.*/ + drawTicks? (e: DrawTicksEventArgs): void; + + /**Triggers when the gauge is initialized.*/ + init? (e: InitEventArgs): void; + + /**Triggers while the gauge start to Load.*/ + load? (e: LoadEventArgs): void; + + /**Triggers when the left mouse button is clicked.*/ + mouseClick? (e: MouseClickEventArgs): void; + + /**Triggers when clicking and dragging the mouse pointer over the gauge pointer.*/ + mouseClickMove? (e: MouseClickMoveEventArgs): void; + + /**Triggers when the mouse click is released.*/ + mouseClickUp? (e: MouseClickUpEventArgs): void; + + /**Triggers while the rendering of the gauge completed.*/ + renderComplete? (e: RenderCompleteEventArgs): void; +} + +export interface DrawBarPointersEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the startX and startY of the pointer + */ + position?: any; + + /**returns the gauge model + */ + Model?: any; + + /**returns the options of the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the pointer belongs. + */ + scaleIndex?: number; + + /**returns the pointer style + */ + style?: string; + + /**returns the current Bar pointer element. + */ + barElement?: any; + + /**returns the index of the bar pointer. + */ + barPointerIndex?: number; + + /**returns the value of the bar pointer. + */ + PointerValue?: number; + + /**returns the name of the event + */ + type?: any; +} + +export interface DrawCustomLabelEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the startX and startY of the customLabel + */ + position?: any; + + /**returns the gauge model + */ + Model?: any; + + /**returns the options of the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the pointer belongs. + */ + scaleIndex?: number; + + /**returns the customLabel style + */ + style?: any; + + /**returns the current customLabel element. + */ + customLabelElement?: any; + + /**returns the index of the customLabel. + */ + customLabelIndex?: number; + + /**returns the name of the event + */ + type?: any; +} + +export interface DrawIndicatorsEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the startX and startY of the Indicator + */ + position?: any; + + /**returns the gauge model + */ + Model?: any; + + /**returns the options of the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the pointer belongs. + */ + scaleIndex?: number; + + /**returns the Indicator style + */ + style?: string; + + /**returns the current Indicator element. + */ + IndicatorElement?: any; + + /**returns the index of the Indicator. + */ + IndicatorIndex?: number; + + /**returns the name of the event + */ + type?: any; +} + +export interface DrawLabelsEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the startX and startY of the label + */ + position?: any; + + /**returns the gauge model + */ + Model?: any; + + /**returns the options of the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the label belongs. + */ + scaleIndex?: number; + + /**returns the label style + */ + style?: string; + + /**returns the angle of the label. + */ + angle?: number; + + /**returns the current label element. + */ + element?: any; + + /**returns the index of the label. + */ + index?: number; + + /**returns the label value of the label. + */ + value?: number; + + /**returns the name of the event + */ + type?: any; +} + +export interface DrawMarkerPointersEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the startX and startY of the pointer + */ + position?: any; + + /**returns the gauge model + */ + Model?: any; + + /**returns the options of the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the pointer belongs. + */ + scaleIndex?: number; + + /**returns the ticks style + */ + style?: string; + + /**returns the current marker pointer element. + */ + markerElement?: any; + + /**returns the index of the marker pointer. + */ + markerPointerIndex?: number; + + /**returns the value of the marker pointer. + */ + pointerValue?: number; + + /**returns the angle of the marker pointer. + */ + pointerAngle?: number; + + /**returns the name of the event + */ + type?: any; +} + +export interface DrawRangeEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the startX and startY of the range + */ + position?: any; + + /**returns the gauge model + */ + Model?: any; + + /**returns the options of the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the pointer belongs. + */ + scaleIndex?: number; + + /**returns the range style + */ + style?: string; + + /**returns the current range element. + */ + rangeElement?: any; + + /**returns the index of the range. + */ + rangeIndex?: number; + + /**returns the name of the event + */ + type?: any; +} + +export interface DrawTicksEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the startX and startY of the ticks + */ + position?: any; + + /**returns the gauge model + */ + Model?: any; + + /**returns the options of the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the tick belongs. + */ + scaleIndex?: number; + + /**returns the ticks style + */ + style?: string; + + /**returns the angle of the tick. + */ + angle?: number; + + /**returns the current tick element. + */ + element?: any; + + /**returns the index of the tick. + */ + index?: number; + + /**returns the tick value of the tick. + */ + value?: number; + + /**returns the name of the event + */ + type?: any; +} + +export interface InitEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the gauge model + */ + Model?: any; + + /**returns the entire scale element. + */ + scaleElement?: any; + + /**returns the context element + */ + context?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface LoadEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the gauge model + */ + Model?: any; + + /**returns the entire scale element. + */ + scaleElement?: any; + + /**returns the context element + */ + context?: any; + + /**returns the name of the event + */ + type?: any; +} + +export interface MouseClickEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the gauge model + */ + model?: any; + + /**returns the name of the event + */ + type?: any; + + /**returns the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the pointer belongs. + */ + scaleIndex?: number; + + /**returns the context element* @param {Object} args.markerpointer returns the context element + */ + context?: any; + + /**returns the pointer Index + */ + markerpointerindex?: number; + + /**returns the pointer element. + */ + markerpointerelement?: any; + + /**returns the value of the pointer. + */ + markerpointervalue?: number; + + /**returns the pointer style + */ + style?: string; + + /**returns the startX and startY of the pointer. + */ + position?: any; +} + +export interface MouseClickMoveEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the gauge model + */ + model?: any; + + /**returns the name of the event + */ + type?: any; + + /**returns the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the pointer belongs. + */ + scaleIndex?: number; + + /**returns the context element + */ + context?: any; + + /**returns the pointer Index + */ + index?: number; + + /**returns the pointer element. + */ + element?: any; + + /**returns the value of the pointer. + */ + value?: number; + + /**returns the pointer style + */ + style?: string; + + /**returns the startX and startY of the pointer. + */ + position?: any; +} + +export interface MouseClickUpEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the gauge model + */ + model?: any; + + /**returns the name of the event + */ + type?: any; + + /**returns the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the pointer belongs. + */ + scaleIndex?: number; + + /**returns the context element* @param {Object} args.markerpointer returns the context element + */ + context?: any; + + /**returns the pointer Index + */ + markerpointerIndex?: number; + + /**returns the pointer element. + */ + markerpointerElement?: any; + + /**returns the value of the pointer. + */ + markerpointerValue?: number; + + /**returns the pointer style + */ + style?: string; + + /**returns the startX and startY of the pointer. + */ + position?: any; +} + +export interface RenderCompleteEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the gauge model + */ + Model?: any; + + /**returns the entire scale element. + */ + scaleElement?: any; + + /**returns the context element + */ + context?: any; + + /**returns the name of the event + */ + type?: any; +} + +export interface Frame { + + /**Specifies the frame background image url of linear gauge + * @Default {null} + */ + backgroundImageUrl?: string; + + /**Specifies the frame InnerWidth + * @Default {8} + */ + innerWidth?: number; + + /**Specifies the frame OuterWidth + * @Default {12} + */ + outerWidth?: number; +} + +export interface ScalesBarPointersBorder { + + /**Specifies the border Color of bar pointer + * @Default {null} + */ + color?: string; + + /**Specifies the border Width of bar pointer + * @Default {1.5} + */ + width?: number; +} + +export interface ScalesBarPointers { + + /**Specifies the backgroundColor of bar pointer + * @Default {null} + */ + backgroundColor?: string; + + /**Specifies the border of bar pointer + * @Default {null} + */ + border?: ScalesBarPointersBorder; + + /**Specifies the distanceFromScale of bar pointer + * @Default {0} + */ + distanceFromScale?: number; + + /**Specifies the scaleBar Gradient of bar pointer + * @Default {null} + */ + gradients?: any; + + /**Specifies the opacity of bar pointer + * @Default {1} + */ + opacity?: number; + + /**Specifies the value of bar pointer + * @Default {null} + */ + value?: number; + + /**Specifies the pointer Width of bar pointer + * @Default {width=30} + */ + width?: number; +} + +export interface ScalesBorder { + + /**Specifies the border color of the Scale. + * @Default {null} + */ + color?: string; + + /**Specifies the border width of the Scale. + * @Default {1.5} + */ + width?: number; +} + +export interface ScalesCustomLabelsFont { + + /**Specifies the fontFamily in customLabels + * @Default {Arial} + */ + fontFamily?: string; + + /**Specifies the fontStyle in customLabels. See FontStyle + * @Default {Bold} + */ + fontStyle?: ej.datavisualization.LinearGauge.FontStyle|string; + + /**Specifies the font size in customLabels + * @Default {11px} + */ + size?: string; +} + +export interface ScalesCustomLabelsPosition { + + /**Specifies the position x in customLabels + * @Default {0} + */ + x?: number; + + /**Specifies the y in customLabels + * @Default {0} + */ + y?: number; +} + +export interface ScalesCustomLabels { + + /**Specifies the label Color in customLabels + * @Default {null} + */ + color?: number; + + /**Specifies the font in customLabels + * @Default {null} + */ + font?: ScalesCustomLabelsFont; + + /**Specifies the opacity in customLabels + * @Default {0} + */ + opacity?: string; + + /**Specifies the position in customLabels + * @Default {null} + */ + position?: ScalesCustomLabelsPosition; + + /**Specifies the positionType in customLabels.See CustomLabelPositionType + * @Default {null} + */ + positionType?: any; + + /**Specifies the textAngle in customLabels + * @Default {0} + */ + textAngle?: number; + + /**Specifies the label Value in customLabels + */ + value?: string; +} + +export interface ScalesIndicatorsBorder { + + /**Specifies the border Color in bar indicators + * @Default {null} + */ + color?: string; + + /**Specifies the border Width in bar indicators + * @Default {1.5} + */ + width?: number; +} + +export interface ScalesIndicatorsFont { + + /**Specifies the fontFamily of font in bar indicators + * @Default {Arial} + */ + fontFamily?: string; + + /**Specifies the fontStyle of font in bar indicators. See FontStyle + * @Default {ej.datavisualization.LinearGauge.FontStyle.Bold} + */ + fontStyle?: ej.datavisualization.LinearGauge.FontStyle|string; + + /**Specifies the size of font in bar indicators + * @Default {11px} + */ + size?: string; +} + +export interface ScalesIndicatorsPosition { + + /**Specifies the x position in bar indicators + * @Default {0} + */ + x?: number; + + /**Specifies the y position in bar indicators + * @Default {0} + */ + y?: number; +} + +export interface ScalesIndicatorsStateRanges { + + /**Specifies the backgroundColor in bar indicators state ranges + * @Default {null} + */ + backgroundColor?: string; + + /**Specifies the borderColor in bar indicators state ranges + * @Default {null} + */ + borderColor?: string; + + /**Specifies the endValue in bar indicators state ranges + * @Default {60} + */ + endValue?: number; + + /**Specifies the startValue in bar indicators state ranges + * @Default {50} + */ + startValue?: number; + + /**Specifies the text in bar indicators state ranges + */ + text?: string; + + /**Specifies the textColor in bar indicators state ranges + * @Default {null} + */ + textColor?: string; +} + +export interface ScalesIndicatorsTextLocation { + + /**Specifies the textLocation position in bar indicators + * @Default {0} + */ + x?: number; + + /**Specifies the Y position in bar indicators + * @Default {0} + */ + y?: number; +} + +export interface ScalesIndicators { + + /**Specifies the backgroundColor in bar indicators + * @Default {null} + */ + backgroundColor?: string; + + /**Specifies the border in bar indicators + * @Default {null} + */ + border?: ScalesIndicatorsBorder; + + /**Specifies the font of bar indicators + * @Default {null} + */ + font?: ScalesIndicatorsFont; + + /**Specifies the indicator Height of bar indicators + * @Default {30} + */ + height?: number; + + /**Specifies the opacity in bar indicators + * @Default {NaN} + */ + opacity?: number; + + /**Specifies the position in bar indicators + * @Default {null} + */ + position?: ScalesIndicatorsPosition; + + /**Specifies the state ranges in bar indicators + * @Default {Array} + */ + stateRanges?: Array; + + /**Specifies the textLocation in bar indicators + * @Default {null} + */ + textLocation?: ScalesIndicatorsTextLocation; + + /**Specifies the indicator Style of font in bar indicators + * @Default {ej.datavisualization.LinearGauge.IndicatorType.Rectangle} + */ + type?: ej.datavisualization.LinearGauge.IndicatorTypes|string; + + /**Specifies the indicator Width in bar indicators + * @Default {30} + */ + width?: number; +} + +export interface ScalesLabelsDistanceFromScale { + + /**Specifies the xDistanceFromScale of labels. + * @Default {-10} + */ + x?: number; + + /**Specifies the yDistanceFromScale of labels. + * @Default {0} + */ + y?: number; +} + +export interface ScalesLabelsFont { + + /**Specifies the fontFamily of font. + * @Default {Arial} + */ + fontFamily?: string; + + /**Specifies the fontStyle of font.See FontStyle + * @Default {ej.datavisualization.LinearGauge.FontStyle.Bold} + */ + fontStyle?: ej.datavisualization.LinearGauge.FontStyle|string; + + /**Specifies the size of font. + * @Default {11px} + */ + size?: string; +} + +export interface ScalesLabels { + + /**Specifies the angle of labels. + * @Default {0} + */ + angle?: number; + + /**Specifies the DistanceFromScale of labels. + * @Default {null} + */ + distanceFromScale?: ScalesLabelsDistanceFromScale; + + /**Specifies the font of labels. + * @Default {null} + */ + font?: ScalesLabelsFont; + + /**need to includeFirstValue. + * @Default {true} + */ + includeFirstValue?: boolean; + + /**Specifies the opacity of label. + * @Default {0} + */ + opacity?: number; + + /**Specifies the label Placement of label. See LabelPlacement + * @Default {Near} + */ + placement?: ej.datavisualization.LinearGauge.PointerPlacement|string; + + /**Specifies the textColor of font. + * @Default {null} + */ + textColor?: string; + + /**Specifies the label Style of label. See LabelType + * @Default {ej.datavisualization.LinearGauge.LabelType.Major} + */ + type?: ej.datavisualization.LinearGauge.ScaleType|string; + + /**Specifies the unitText of label. + */ + unitText?: string; + + /**Specifies the unitText Position of label.See UnitTextPlacement + * @Default {Back} + */ + unitTextPlacement?: ej.datavisualization.LinearGauge.UnitTextPlacement|string; +} + +export interface ScalesMarkerPointersBorder { + + /**Specifies the border color of marker pointer + * @Default {null} + */ + color?: string; + + /**Specifies the border of marker pointer + * @Default {number} + */ + width?: number; +} + +export interface ScalesMarkerPointers { + + /**Specifies the backgroundColor of marker pointer + * @Default {null} + */ + backgroundColor?: string; + + /**Specifies the border of marker pointer + * @Default {null} + */ + border?: ScalesMarkerPointersBorder; + + /**Specifies the distanceFromScale of marker pointer + * @Default {0} + */ + distanceFromScale?: number; + + /**Specifies the pointer Gradient of marker pointer + * @Default {null} + */ + gradients?: any; + + /**Specifies the pointer Length of marker pointer + * @Default {30} + */ + length?: number; + + /**Specifies the opacity of marker pointer + * @Default {1} + */ + opacity?: number; + + /**Specifies the pointer Placement of marker pointer See PointerPlacement + * @Default {Far} + */ + placement?: ej.datavisualization.LinearGauge.PointerPlacement|string; + + /**Specifies the marker Style of marker pointerSee MarkerType + * @Default {Triangle} + */ + type?: ej.datavisualization.LinearGauge.MarkerType|string; + + /**Specifies the value of marker pointer + * @Default {null} + */ + value?: number; + + /**Specifies the pointer Width of marker pointer + * @Default {30} + */ + width?: number; +} + +export interface ScalesPosition { + + /**Specifies the Horizontal position + * @Default {50} + */ + x?: number; + + /**Specifies the vertical position + * @Default {50} + */ + y?: number; +} + +export interface ScalesRangesBorder { + + /**Specifies the border color in the ranges. + * @Default {null} + */ + color?: string; + + /**Specifies the border width in the ranges. + * @Default {1.5} + */ + width?: number; +} + +export interface ScalesRanges { + + /**Specifies the backgroundColor in the ranges. + * @Default {null} + */ + backgroundColor?: string; + + /**Specifies the border in the ranges. + * @Default {null} + */ + border?: ScalesRangesBorder; + + /**Specifies the distanceFromScale in the ranges. + * @Default {0} + */ + distanceFromScale?: number; + + /**Specifies the endValue in the ranges. + * @Default {60} + */ + endValue?: number; + + /**Specifies the endWidth in the ranges. + * @Default {10} + */ + endWidth?: number; + + /**Specifies the range Gradient in the ranges. + * @Default {null} + */ + gradients?: any; + + /**Specifies the opacity in the ranges. + * @Default {null} + */ + opacity?: number; + + /**Specifies the range Position in the ranges. See RangePlacement + * @Default {Center} + */ + placement?: ej.datavisualization.LinearGauge.PointerPlacement|string; + + /**Specifies the startValue in the ranges. + * @Default {20} + */ + startValue?: number; + + /**Specifies the startWidth in the ranges. + * @Default {10} + */ + startWidth?: number; +} + +export interface ScalesTicksDistanceFromScale { + + /**Specifies the xDistanceFromScale in the tick. + * @Default {0} + */ + x?: number; + + /**Specifies the yDistanceFromScale in the tick. + * @Default {0} + */ + y?: number; +} + +export interface ScalesTicks { + + /**Specifies the angle in the tick. + * @Default {0} + */ + angle?: number; + + /**Specifies the tick Color in the tick. + * @Default {null} + */ + color?: string; + + /**Specifies the DistanceFromScale in the tick. + * @Default {null} + */ + distanceFromScale?: ScalesTicksDistanceFromScale; + + /**Specifies the tick Height in the tick. + * @Default {10} + */ + height?: number; + + /**Specifies the opacity in the tick. + * @Default {0} + */ + opacity?: number; + + /**Specifies the tick Placement in the tick. See TickPlacement + * @Default {Near} + */ + placement?: ej.datavisualization.LinearGauge.PointerPlacement|string; + + /**Specifies the tick Style in the tick. See TickType + * @Default {MajorInterval} + */ + type?: ej.datavisualization.LinearGauge.TicksType|string; + + /**Specifies the tick Width in the tick. + * @Default {3} + */ + width?: number; +} + +export interface Scales { + + /**Specifies the backgroundColor of the Scale. + * @Default {null} + */ + backgroundColor?: string; + + /**Specifies the scaleBar Gradient of bar pointer + * @Default {Array} + */ + barPointers?: Array; + + /**Specifies the border of the Scale. + * @Default {null} + */ + border?: ScalesBorder; + + /**Specifies the customLabel + * @Default {Array} + */ + customLabels?: Array; + + /**Specifies the scale Direction of the Scale. See Directions + * @Default {CounterClockwise} + */ + direction?: ej.datavisualization.LinearGauge.Direction|string; + + /**Specifies the indicator + * @Default {Array} + */ + indicators?: Array; + + /**Specifies the labels. + * @Default {Array} + */ + labels?: Array; + + /**Specifies the scaleBar Length. + * @Default {290} + */ + length?: number; + + /**Specifies the majorIntervalValue of the Scale. + * @Default {10} + */ + majorIntervalValue?: number; + + /**Specifies the markerPointers + * @Default {Array} + */ + markerPointers?: Array; + + /**Specifies the maximum of the Scale. + * @Default {null} + */ + maximum?: number; + + /**Specifies the minimum of the Scale. + * @Default {null} + */ + minimum?: number; + + /**Specifies the minorIntervalValue of the Scale. + * @Default {2} + */ + minorIntervalValue?: number; + + /**Specifies the opacity of the Scale. + * @Default {NaN} + */ + opacity?: number; + + /**Specifies the position + * @Default {null} + */ + position?: ScalesPosition; + + /**Specifies the ranges in the tick. + * @Default {Array} + */ + ranges?: Array; + + /**Specifies the shadowOffset. + * @Default {0} + */ + shadowOffset?: number; + + /**Specifies the showBarPointers state. + * @Default {true} + */ + showBarPointers?: boolean; + + /**Specifies the showCustomLabels state. + * @Default {false} + */ + showCustomLabels?: boolean; + + /**Specifies the showIndicators state. + * @Default {false} + */ + showIndicators?: boolean; + + /**Specifies the showLabels state. + * @Default {true} + */ + showLabels?: boolean; + + /**Specifies the showMarkerPointers state. + * @Default {true} + */ + showMarkerPointers?: boolean; + + /**Specifies the showRanges state. + * @Default {false} + */ + showRanges?: boolean; + + /**Specifies the showTicks state. + * @Default {true} + */ + showTicks?: boolean; + + /**Specifies the ticks in the scale. + * @Default {Array} + */ + ticks?: Array; + + /**Specifies the scaleBar type .See ScaleType + * @Default {Rectangle} + */ + type?: ej.datavisualization.LinearGauge.ScaleType|string; + + /**Specifies the scaleBar width. + * @Default {30} + */ + width?: number; +} + +export interface Tooltip { + + /**Specify showCustomLabelTooltip value of linear gauge + * @Default {false} + */ + showCustomLabelTooltip?: boolean; + + /**Specify showLabelTooltip value of linear gauge + * @Default {false} + */ + showLabelTooltip?: boolean; + + /**Specify templateID value of linear gauge + * @Default {false} + */ + templateID?: string; +} +} +module LinearGauge +{ +enum OuterCustomLabelPosition +{ +//string +Left, +//string +Right, +//string +Top, +//string +Bottom, +} +} +module LinearGauge +{ +enum FontStyle +{ +//string +Bold, +//string +Italic, +//string +Regular, +//string +Strikeout, +//string +Underline, +} +} +module LinearGauge +{ +enum Direction +{ +//string +Clockwise, +//string +CounterClockwise, +} +} +module LinearGauge +{ +enum IndicatorTypes +{ +//string +Rectangle, +//string +Circle, +//string +RoundedRectangle, +//string +Text, +} +} +module LinearGauge +{ +enum PointerPlacement +{ +//string +Near, +//string +Far, +//string +Center, +} +} +module LinearGauge +{ +enum ScaleType +{ +//string +Major, +//string +Minor, +} +} +module LinearGauge +{ +enum UnitTextPlacement +{ +//string +Back, +//string +From, +} +} +module LinearGauge +{ +enum MarkerType +{ +//string +Rectangle, +//string +Triangle, +//string +Ellipse, +//string +Diamond, +//string +Pentagon, +//string +Circle, +//string +Star, +//string +Slider, +//string +Pointer, +//string +Wedge, +//string +Trapezoid, +//string +RoundedRectangle, +} +} +module LinearGauge +{ +enum TicksType +{ +//string +Majorinterval, +//string +Minorinterval, +} +} +module LinearGauge +{ +enum Themes +{ +//string +FlatLight, +//string +FlatDark, +} +} + +class CircularGauge extends ej.Widget { + static fn: CircularGauge; + constructor(element: JQuery, options?: CircularGauge.Model); + constructor(element: Element, options?: CircularGauge.Model); + model:CircularGauge.Model; + defaults:CircularGauge.Model; + + /** destroy the circular gauge widget. all events bound using this._on will be unbind automatically and bring the control to pre-init state. + * @returns {void} + */ + destroy(): void; + + /** To export Image + * @returns {void} + */ + exportImage(): void; + + /** To get BackNeedleLength + * @returns {void} + */ + getBackNeedleLength(): void; + + /** To get CustomLabelAngle + * @returns {void} + */ + getCustomLabelAngle(): void; + + /** To get CustomLabelValue + * @returns {void} + */ + getCustomLabelValue(): void; + + /** To get LabelAngle + * @returns {void} + */ + getLabelAngle(): void; + + /** To get LabelDistanceFromScale + * @returns {void} + */ + getLabelDistanceFromScale(): void; + + /** To get LabelPlacement + * @returns {void} + */ + getLabelPlacement(): void; + + /** To get LabelStyle + * @returns {void} + */ + getLabelStyle(): void; + + /** To get MajorIntervalValue + * @returns {void} + */ + getMajorIntervalValue(): void; + + /** To get MarkerDistanceFromScale + * @returns {void} + */ + getMarkerDistanceFromScale(): void; + + /** To get MarkerStyle + * @returns {void} + */ + getMarkerStyle(): void; + + /** To get MaximumValue + * @returns {void} + */ + getMaximumValue(): void; + + /** To get MinimumValue + * @returns {void} + */ + getMinimumValue(): void; + + /** To get MinorIntervalValue + * @returns {void} + */ + getMinorIntervalValue(): void; + + /** To get NeedleStyle + * @returns {void} + */ + getNeedleStyle(): void; + + /** To get PointerCapBorderWidth + * @returns {void} + */ + getPointerCapBorderWidth(): void; + + /** To get PointerCapRadius + * @returns {void} + */ + getPointerCapRadius(): void; + + /** To get PointerLength + * @returns {void} + */ + getPointerLength(): void; + + /** To get PointerNeedleType + * @returns {void} + */ + getPointerNeedleType(): void; + + /** To get PointerPlacement + * @returns {void} + */ + getPointerPlacement(): void; + + /** To get PointerValue + * @returns {void} + */ + getPointerValue(): void; + + /** To get PointerWidth + * @returns {void} + */ + getPointerWidth(): void; + + /** To get RangeBorderWidth + * @returns {void} + */ + getRangeBorderWidth(): void; + + /** To get RangeDistanceFromScale + * @returns {void} + */ + getRangeDistanceFromScale(): void; + + /** To get RangeEndValue + * @returns {void} + */ + getRangeEndValue(): void; + + /** To get RangePosition + * @returns {void} + */ + getRangePosition(): void; + + /** To get RangeSize + * @returns {void} + */ + getRangeSize(): void; + + /** To get RangeStartValue + * @returns {void} + */ + getRangeStartValue(): void; + + /** To get ScaleBarSize + * @returns {void} + */ + getScaleBarSize(): void; + + /** To get ScaleBorderWidth + * @returns {void} + */ + getScaleBorderWidth(): void; + + /** To get ScaleDirection + * @returns {void} + */ + getScaleDirection(): void; + + /** To get ScaleRadius + * @returns {void} + */ + getScaleRadius(): void; + + /** To get StartAngle + * @returns {void} + */ + getStartAngle(): void; + + /** To get SubGaugeLocation + * @returns {void} + */ + getSubGaugeLocation(): void; + + /** To get SweepAngle + * @returns {void} + */ + getSweepAngle(): void; + + /** To get TickAngle + * @returns {void} + */ + getTickAngle(): void; + + /** To get TickDistanceFromScale + * @returns {void} + */ + getTickDistanceFromScale(): void; + + /** To get TickHeight + * @returns {void} + */ + getTickHeight(): void; + + /** To get TickPlacement + * @returns {void} + */ + getTickPlacement(): void; + + /** To get TickStyle + * @returns {void} + */ + getTickStyle(): void; + + /** To get TickWidth + * @returns {void} + */ + getTickWidth(): void; + + /** To set includeFirstValue + * @returns {void} + */ + includeFirstValue(): void; + + /** Switching the redraw option for the gauge + * @returns {void} + */ + redraw(): void; + + /** To set BackNeedleLength + * @returns {void} + */ + setBackNeedleLength(): void; + + /** To set CustomLabelAngle + * @returns {void} + */ + setCustomLabelAngle(): void; + + /** To set CustomLabelValue + * @returns {void} + */ + setCustomLabelValue(): void; + + /** To set LabelAngle + * @returns {void} + */ + setLabelAngle(): void; + + /** To set LabelDistanceFromScale + * @returns {void} + */ + setLabelDistanceFromScale(): void; + + /** To set LabelPlacement + * @returns {void} + */ + setLabelPlacement(): void; + + /** To set LabelStyle + * @returns {void} + */ + setLabelStyle(): void; + + /** To set MajorIntervalValue + * @returns {void} + */ + setMajorIntervalValue(): void; + + /** To set MarkerDistanceFromScale + * @returns {void} + */ + setMarkerDistanceFromScale(): void; + + /** To set MarkerStyle + * @returns {void} + */ + setMarkerStyle(): void; + + /** To set MaximumValue + * @returns {void} + */ + setMaximumValue(): void; + + /** To set MinimumValue + * @returns {void} + */ + setMinimumValue(): void; + + /** To set MinorIntervalValue + * @returns {void} + */ + setMinorIntervalValue(): void; + + /** To set NeedleStyle + * @returns {void} + */ + setNeedleStyle(): void; + + /** To set PointerCapBorderWidth + * @returns {void} + */ + setPointerCapBorderWidth(): void; + + /** To set PointerCapRadius + * @returns {void} + */ + setPointerCapRadius(): void; + + /** To set PointerLength + * @returns {void} + */ + setPointerLength(): void; + + /** To set PointerNeedleType + * @returns {void} + */ + setPointerNeedleType(): void; + + /** To set PointerPlacement + * @returns {void} + */ + setPointerPlacement(): void; + + /** To set PointerValue + * @returns {void} + */ + setPointerValue(): void; + + /** To set PointerWidth + * @returns {void} + */ + setPointerWidth(): void; + + /** To set RangeBorderWidth + * @returns {void} + */ + setRangeBorderWidth(): void; + + /** To set RangeDistanceFromScale + * @returns {void} + */ + setRangeDistanceFromScale(): void; + + /** To set RangeEndValue + * @returns {void} + */ + setRangeEndValue(): void; + + /** To set RangePosition + * @returns {void} + */ + setRangePosition(): void; + + /** To set RangeSize + * @returns {void} + */ + setRangeSize(): void; + + /** To set RangeStartValue + * @returns {void} + */ + setRangeStartValue(): void; + + /** To set ScaleBarSize + * @returns {void} + */ + setScaleBarSize(): void; + + /** To set ScaleBorderWidth + * @returns {void} + */ + setScaleBorderWidth(): void; + + /** To set ScaleDirection + * @returns {void} + */ + setScaleDirection(): void; + + /** To set ScaleRadius + * @returns {void} + */ + setScaleRadius(): void; + + /** To set StartAngle + * @returns {void} + */ + setStartAngle(): void; + + /** To set SubGaugeLocation + * @returns {void} + */ + setSubGaugeLocation(): void; + + /** To set SweepAngle + * @returns {void} + */ + setSweepAngle(): void; + + /** To set TickAngle + * @returns {void} + */ + setTickAngle(): void; + + /** To set TickDistanceFromScale + * @returns {void} + */ + setTickDistanceFromScale(): void; + + /** To set TickHeight + * @returns {void} + */ + setTickHeight(): void; + + /** To set TickPlacement + * @returns {void} + */ + setTickPlacement(): void; + + /** To set TickStyle + * @returns {void} + */ + setTickStyle(): void; + + /** To set TickWidth + * @returns {void} + */ + setTickWidth(): void; +} +export module CircularGauge{ + +export interface Model { + + /**Specifies animationSpeed of circular gauge + * @Default {500} + */ + animationSpeed?: number; + + /**Specifies the background color of circular gauge. + * @Default {null} + */ + backgroundColor?: string; + + /**Specify distanceFromCorner value of circular gauge + * @Default {center} + */ + distanceFromCorner?: number; + + /**Specify animate value of circular gauge + * @Default {true} + */ + enableAnimation?: boolean; + + /**Specify enableResize value of circular gauge + * @Default {false} + */ + enableResize?: boolean; + + /**Specify the frame of circular gauge + * @Default {Object} + */ + frame?: Frame; + + /**Specify gaugePosition value of circular gauge See GaugePosition + * @Default {center} + */ + gaugePosition?: ej.datavisualization.CircularGauge.gaugePosition|string; + + /**Specifies the height of circular gauge. + * @Default {360} + */ + height?: number; + + /**Specifies the interiorGradient of circular gauge. + * @Default {null} + */ + interiorGradient?: any; + + /**Specify isRadialGradient value of circular gauge + * @Default {false} + */ + isRadialGradient?: boolean; + + /**Specifies the maximum value of circular gauge. + * @Default {100} + */ + maximum?: number; + + /**Specifies the minimum value of circular gauge. + * @Default {0} + */ + minimum?: number; + + /**Specify outerCustomLabelPosition value of circular gauge See OuterCustomLabelPosition + * @Default {bottom} + */ + outerCustomLabelPosition?: ej.datavisualization.CircularGauge.CustomLabelPositionType|string; + + /**Specifies the radius of circular gauge. + * @Default {180} + */ + radius?: number; + + /**Specify readonly value of circular gauge + * @Default {true} + */ + readOnly?: boolean; + + /**Specify the pointers, ticks, labels, indicators, ranges of circular gauge + * @Default {null} + */ + scales?: Scales; + + /**Specify the theme of circular gauge. + * @Default {flatlight} + */ + theme?: string; + + /**Specify tooltip option of circular gauge + * @Default {object} + */ + tooltip?: Tooltip; + + /**Specifies the value of circular gauge. + * @Default {0} + */ + value?: number; + + /**Specifies the width of circular gauge. + * @Default {360} + */ + width?: number; + + /**Triggers while the custom labels are being drawn on the gauge.*/ + drawCustomLabel? (e: DrawCustomLabelEventArgs): void; + + /**Triggers while the indicators are being started to drawn on the gauge.*/ + drawIndicators? (e: DrawIndicatorsEventArgs): void; + + /**Triggers while the labels are being drawn on the gauge.*/ + drawLabels? (e: DrawLabelsEventArgs): void; + + /**Triggers while the pointer cap is being drawn on the gauge.*/ + drawPointerCap? (e: DrawPointerCapEventArgs): void; + + /**Triggers while the pointers are being drawn on the gauge.*/ + drawPointers? (e: DrawPointersEventArgs): void; + + /**Triggers when the ranges begin to be getting drawn on the gauge.*/ + drawRange? (e: DrawRangeEventArgs): void; + + /**Triggers while the ticks are being drawn on the gauge.*/ + drawTicks? (e: DrawTicksEventArgs): void; + + /**Triggers while the gauge start to Load.*/ + load? (e: LoadEventArgs): void; + + /**Triggers when the left mouse button is clicked.*/ + mouseClick? (e: MouseClickEventArgs): void; + + /**Triggers when clicking and dragging the mouse pointer over the gauge pointer.*/ + mouseClickMove? (e: MouseClickMoveEventArgs): void; + + /**Triggers when the mouse click is released.*/ + mouseClickUp? (e: MouseClickUpEventArgs): void; + + /**Triggers when the rendering of the gauge is completed.*/ + renderComplete? (e: RenderCompleteEventArgs): void; +} + +export interface DrawCustomLabelEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the startX and startY of the custom label + */ + position?: any; + + /**returns the gauge model + */ + model?: any; + + /**returns the options of the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the custom label belongs. + */ + scaleIndex?: number; + + /**returns the custom label style + */ + style?: string; + + /**returns the current custom label element. + */ + customLabelElement?: any; + + /**returns the index of the custom label. + */ + customLabelIndex?: number; + + /**returns the name of the event + */ + type?: string; +} + +export interface DrawIndicatorsEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the startX and startY of the indicator + */ + position?: any; + + /**returns the gauge model + */ + model?: any; + + /**returns the options of the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the indicator belongs. + */ + scaleIndex?: number; + + /**returns the indicator style + */ + style?: string; + + /**returns the current indicator element. + */ + indicatorElement?: any; + + /**returns the index of the indicator. + */ + indicatorIndex?: number; + + /**returns the name of the event + */ + type?: string; +} + +export interface DrawLabelsEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the startX and startY of the labels + */ + position?: any; + + /**returns the gauge model + */ + model?: any; + + /**returns the options of the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the label belongs. + */ + scaleIndex?: number; + + /**returns the label style + */ + style?: string; + + /**returns the angle of the labels. + */ + angle?: number; + + /**returns the current label element. + */ + element?: any; + + /**returns the index of the label. + */ + index?: number; + + /**returns the value of the label. + */ + pointerValue?: number; + + /**returns the name of the event + */ + type?: string; +} + +export interface DrawPointerCapEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the options of the scale element. + */ + scaleElement?: any; + + /**returns the startX and startY of the pointer cap. + */ + position?: any; + + /**returns the gauge model + */ + model?: any; + + /**returns the pointer cap style + */ + style?: string; + + /**returns the name of the event + */ + type?: string; +} + +export interface DrawPointersEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the startX and startY of the pointer + */ + position?: any; + + /**returns the gauge model + */ + model?: any; + + /**returns the options of the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the pointer belongs. + */ + scaleIndex?: number; + + /**returns the pointer style + */ + style?: string; + + /**returns the angle of the pointer. + */ + angle?: number; + + /**returns the current pointer element. + */ + element?: any; + + /**returns the index of the pointer. + */ + index?: number; + + /**returns the value of the pointer. + */ + value?: number; + + /**returns the name of the event + */ + type?: string; +} + +export interface DrawRangeEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the startX and startY of the range + */ + position?: any; + + /**returns the gauge model + */ + model?: any; + + /**returns the options of the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the range belongs. + */ + scaleIndex?: number; + + /**returns the range style + */ + style?: string; + + /**returns the current range element. + */ + rangeElement?: any; + + /**returns the index of the range. + */ + rangeIndex?: number; + + /**returns the name of the event + */ + type?: string; +} + +export interface DrawTicksEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the startX and startY of the ticks + */ + position?: any; + + /**returns the gauge model + */ + model?: any; + + /**returns the options of the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the tick belongs. + */ + scaleIndex?: number; + + /**returns the ticks style + */ + style?: string; + + /**returns the angle of the tick. + */ + angle?: number; + + /**returns the current tick element. + */ + element?: any; + + /**returns the index of the tick. + */ + index?: number; + + /**returns the label value of the tick. + */ + pointerValue?: number; + + /**returns the name of the event + */ + type?: string; +} + +export interface LoadEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the gauge model + */ + Model?: any; + + /**returns the entire scale element. + */ + scaleElement?: any; + + /**returns the context element + */ + context?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface MouseClickEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the gauge model + */ + model?: any; + + /**returns the name of the event + */ + type?: any; + + /**returns the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the pointer belongs. + */ + scaleIndex?: number; + + /**returns the context element + */ + context?: any; + + /**returns the pointer Index + */ + index?: number; + + /**returns the pointer element. + */ + element?: any; + + /**returns the value of the pointer. + */ + value?: number; + + /**returns the angle of the pointer. + */ + angle?: number; + + /**returns the pointer style + */ + style?: string; + + /**returns the startX and startY of the pointer. + */ + position?: any; +} + +export interface MouseClickMoveEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the gauge model + */ + model?: any; + + /**returns the name of the event + */ + type?: any; + + /**returns the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the pointer belongs. + */ + scaleIndex?: number; + + /**returns the context element + */ + context?: any; + + /**returns the pointer Index + */ + index?: number; + + /**returns the pointer element. + */ + element?: any; + + /**returns the value of the pointer. + */ + value?: number; + + /**returns the angle of the pointer. + */ + angle?: number; + + /**returns the pointer style + */ + style?: string; + + /**returns the startX and startY of the pointer. + */ + position?: any; +} + +export interface MouseClickUpEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the gauge model + */ + model?: any; + + /**returns the name of the event + */ + type?: any; + + /**returns the scale element. + */ + scaleElement?: any; + + /**returns the scaleIndex to which the pointer belongs. + */ + scaleIndex?: number; + + /**returns the context element + */ + context?: any; + + /**returns the pointer Index + */ + index?: number; + + /**returns the pointer element. + */ + element?: any; + + /**returns the value of the pointer. + */ + value?: number; + + /**returns the angle of the pointer. + */ + angle?: number; + + /**returns the pointer style + */ + style?: string; + + /**returns the startX and startY of the pointer. + */ + position?: any; +} + +export interface RenderCompleteEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the context element + */ + context?: any; + + /**returns the entire scale element. + */ + scaleElement?: any; + + /**returns the gauge model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface Frame { + + /**Specify the url of the frame background image for circular gauge + * @Default {null} + */ + backgroundImageUrl?: string; + + /**Specifies the frameType of circular gauge. See Frame + * @Default {FullCircle} + */ + frameType?: ej.datavisualization.CircularGauge.FrameType|string; + + /**Specifies the end angle for the half circular frame. + * @Default {360} + */ + halfCircleFrameEndAngle?: number; + + /**Specifies the start angle for the half circular frame. + * @Default {180} + */ + halfCircleFrameStartAngle?: number; +} + +export interface ScalesBorder { + + /**Specify border color for scales of circular gauge + * @Default {null} + */ + color?: string; + + /**Specify border width of circular gauge + * @Default {1.5} + */ + width?: number; +} + +export interface ScalesIndicatorsPosition { + + /**Specify x-axis of position of circular gauge + * @Default {0} + */ + x?: number; + + /**Specify y-axis of position of circular gauge + * @Default {0} + */ + y?: number; +} + +export interface ScalesIndicatorsStateRanges { + + /**Specify backgroundColor for indicator of circular gauge + * @Default {null} + */ + backgroundColor?: string; + + /**Specify borderColor for indicator of circular gauge + * @Default {null} + */ + borderColor?: string; + + /**Specify end value for each specified state of circular gauge + * @Default {0} + */ + endValue?: number; + + /**Specify value of the font as the indicator when the indicator style is set with the value "text" of circular gauge + * @Default {null} + */ + font?: any; + + /**Specify start value for each specified state of circular gauge + * @Default {0} + */ + startValue?: number; + + /**Specify value of the text as the indicator when the indicator style is set with the value "text" of circular gauge + */ + text?: string; + + /**Specify value of the textColor as the indicator when the indicator style is set with the value "text" of circular gauge + * @Default {null} + */ + textColor?: string; +} + +export interface ScalesIndicators { + + /**Specify indicator height of circular gauge + * @Default {15} + */ + height?: number; + + /**Specify imageUrl of circular gauge + * @Default {null} + */ + imageUrl?: string; + + /**Specify position of circular gauge + * @Default {Object} + */ + position?: ScalesIndicatorsPosition; + + /**Specify the various states of circular gauge + * @Default {Array} + */ + stateRanges?: Array; + + /**Specify indicator style of circular gauge. See IndicatorType + * @Default {Circle} + */ + type?: ej.datavisualization.CircularGauge.IndicatorTypes|string; + + /**Specify indicator width of circular gauge + * @Default {15} + */ + width?: number; +} + +export interface ScalesLabelsFont { + + /**Specify font fontFamily for labels of circular gauge + * @Default {Arial} + */ + fontFamily?: string; + + /**Specify font Style for labels of circular gauge + * @Default {Bold} + */ + fontStyle?: string; + + /**Specify font size for labels of circular gauge + * @Default {11px} + */ + size?: string; +} + +export interface ScalesLabels { + + /**Specify the angle for the labels of circular gauge + * @Default {0} + */ + angle?: number; + + /**Specify labels autoAngle value of circular gauge + * @Default {false} + */ + autoAngle?: boolean; + + /**Specify label color of circular gauge + * @Default {null} + */ + color?: string; + + /**Specify distanceFromScale value for labels of circular gauge + * @Default {0} + */ + distanceFromScale?: number; + + /**Specify font for labels of circular gauge + * @Default {Object} + */ + font?: ScalesLabelsFont; + + /**Specify includeFirstValue of circular gauge + * @Default {true} + */ + includeFirstValue?: boolean; + + /**Specify opacity value for labels of circular gauge + * @Default {null} + */ + opacity?: number; + + /**Specify label placement of circular gauge. See LabelPlacement + * @Default {Near} + */ + placement?: ej.datavisualization.CircularGauge.Placement|string; + + /**Specify label Style of circular gauge. See LabelType + * @Default {Major} + */ + type?: ej.datavisualization.CircularGauge.LabelType|string; + + /**Specify unitText of circular gauge + */ + unitText?: string; + + /**Specify unitTextPosition of circular gauge. See UnitTextPosition + * @Default {Back} + */ + unitTextPosition?: ej.datavisualization.CircularGauge.UnitTextPlacement|string; +} + +export interface ScalesPointerCap { + + /**Specify cap backgroundColor of circular gauge + * @Default {null} + */ + backgroundColor?: string; + + /**Specify cap borderColor of circular gauge + * @Default {null} + */ + borderColor?: string; + + /**Specify pointerCap borderWidth value of circular gauge + * @Default {3} + */ + borderWidth?: number; + + /**Specify cap interiorGradient value of circular gauge + * @Default {null} + */ + interiorGradient?: any; + + /**Specify pointerCap Radius value of circular gauge + * @Default {7} + */ + radius?: number; +} + +export interface ScalesPointersBorder { + + /**Specify border color for pointer of circular gauge + * @Default {null} + */ + color?: string; + + /**Specify border width for pointers of circular gauge + * @Default {1.5} + */ + width?: number; +} + +export interface ScalesPointersPointerValueTextFont { + + /**Specify pointer value text font family of circular gauge. + * @Default {Arial} + */ + fontFamily?: string; + + /**Specify pointer value text font style of circular gauge. + * @Default {Bold} + */ + fontStyle?: string; + + /**Specify pointer value text size of circular gauge. + * @Default {11px} + */ + size?: string; +} + +export interface ScalesPointersPointerValueText { + + /**Specify pointer text angle of circular gauge. + * @Default {0} + */ + angle?: number; + + /**Specify pointer text auto angle of circular gauge. + * @Default {false} + */ + autoAngle?: boolean; + + /**Specify pointer value text color of circular gauge. + * @Default {#8c8c8c} + */ + color?: string; + + /**Specify pointer value text distance from pointer of circular gauge. + * @Default {20} + */ + distance?: number; + + /**Specify pointer value text font option of circular gauge. + * @Default {object} + */ + font?: ScalesPointersPointerValueTextFont; + + /**Specify pointer value text opacity of circular gauge. + * @Default {1} + */ + opacity?: number; + + /**enable pointer value text visibility of circular gauge. + * @Default {false} + */ + showValue?: boolean; +} + +export interface ScalesPointers { + + /**Specify backgroundColor for the pointer of circular gauge + * @Default {null} + */ + backgroundColor?: string; + + /**Specify backNeedleLength of circular gauge + * @Default {10} + */ + backNeedleLength?: number; + + /**Specify the border for pointers of circular gauge + * @Default {Object} + */ + border?: ScalesPointersBorder; + + /**Specify distanceFromScale value for pointers of circular gauge + * @Default {0} + */ + distanceFromScale?: number; + + /**Specify pointer gradients of circular gauge + * @Default {null} + */ + gradients?: any; + + /**Specify pointer image of circular gauge.It is applicable for both marker as well as needle type pointers. + * @Default {NULL} + */ + imageUrl?: string; + + /**Specify pointer length of circular gauge + * @Default {150} + */ + length?: number; + + /**Specify marker Style value of circular gauge. See MarkerType + * @Default {Rectangle} + */ + markerType?: ej.datavisualization.CircularGauge.MarkerType|string; + + /**Specify needle Style value of circular gauge. See NeedleType + * @Default {Triangle} + */ + needleType?: ej.datavisualization.CircularGauge.NeedleType|string; + + /**Specify opacity value for pointer of circular gauge + * @Default {1} + */ + opacity?: number; + + /**Specify pointer Placement value of circular gauge. See PointerPlacement + * @Default {Near} + */ + placement?: ej.datavisualization.CircularGauge.Placement|string; + + /**Specify pointer value text of circular gauge. + * @Default {Object} + */ + pointerValueText?: ScalesPointersPointerValueText; + + /**Specify showBackNeedle value of circular gauge + * @Default {false} + */ + showBackNeedle?: boolean; + + /**Specify pointer type value of circular gauge. See PointerType + * @Default {Needle} + */ + type?: ej.datavisualization.CircularGauge.PointerType|string; + + /**Specify value of the pointer of circular gauge + * @Default {null} + */ + value?: number; + + /**Specify pointer width of circular gauge + * @Default {7} + */ + width?: number; +} + +export interface ScalesRangesBorder { + + /**Specify border color for ranges of circular gauge + * @Default {#32b3c6} + */ + color?: string; + + /**Specify border width for ranges of circular gauge + * @Default {1.5} + */ + width?: number; +} + +export interface ScalesRanges { + + /**Specify backgroundColor for the ranges of circular gauge + * @Default {#32b3c6} + */ + backgroundColor?: string; + + /**Specify border for ranges of circular gauge + * @Default {Object} + */ + border?: ScalesRangesBorder; + + /**Specify distanceFromScale value for ranges of circular gauge + * @Default {25} + */ + distanceFromScale?: number; + + /**Specify endValue for ranges of circular gauge + * @Default {null} + */ + endValue?: number; + + /**Specify endWidth for ranges of circular gauge + * @Default {10} + */ + endWidth?: number; + + /**Specify range gradients of circular gauge + * @Default {null} + */ + gradients?: any; + + /**Specify opacity value for ranges of circular gauge + * @Default {null} + */ + opacity?: number; + + /**Specify placement of circular gauge. See RangePlacement + * @Default {Near} + */ + placement?: ej.datavisualization.CircularGauge.Placement|string; + + /**Specify size of the range value of circular gauge + * @Default {5} + */ + size?: number; + + /**Specify startValue for ranges of circular gauge + * @Default {null} + */ + startValue?: number; + + /**Specify startWidth of circular gauge + * @Default {[Array.number] scale.ranges.startWidth = 10} + */ + startWidth?: number; +} + +export interface ScalesSubGaugesPosition { + + /**Specify x-axis position for sub-gauge of circular gauge + * @Default {0} + */ + x?: number; + + /**Specify y-axis position for sub-gauge of circular gauge + * @Default {0} + */ + y?: number; +} + +export interface ScalesSubGauges { + + /**Specify subGauge Height of circular gauge + * @Default {150} + */ + height?: number; + + /**Specify position for sub-gauge of circular gauge + * @Default {Object} + */ + position?: ScalesSubGaugesPosition; + + /**Specify subGauge Width of circular gauge + * @Default {150} + */ + width?: number; +} + +export interface ScalesTicks { + + /**Specify the angle for the ticks of circular gauge + * @Default {0} + */ + angle?: number; + + /**Specify tick color of circular gauge + * @Default {null} + */ + color?: string; + + /**Specify distanceFromScale value for ticks of circular gauge + * @Default {0} + */ + distanceFromScale?: number; + + /**Specify tick height of circular gauge + * @Default {16} + */ + height?: number; + + /**Specify tick placement of circular gauge. See TickPlacement + * @Default {Near} + */ + placement?: ej.datavisualization.CircularGauge.Placement|string; + + /**Specify tick Style of circular gauge. See TickType + * @Default {Major} + */ + type?: ej.datavisualization.CircularGauge.LabelType|string; + + /**Specify tick width of circular gauge + * @Default {3} + */ + width?: number; +} + +export interface Scales { + + /**Specify backgroundColor for the scale of circular gauge + * @Default {null} + */ + backgroundColor?: string; + + /**Specify border for scales of circular gauge + * @Default {Object} + */ + border?: ScalesBorder; + + /**Specify scale direction of circular gauge. See Directions + * @Default {Clockwise} + */ + direction?: ej.datavisualization.CircularGauge.Direction|string; + + /**Specify representing state of circular gauge + * @Default {Array} + */ + indicators?: Array; + + /**Specify the text values displayed in a meaningful manner alongside the ticks of circular gauge + * @Default {Array} + */ + labels?: Array; + + /**Specify majorIntervalValue of circular gauge + * @Default {10} + */ + majorIntervalValue?: number; + + /**Specify maximum scale value of circular gauge + * @Default {null} + */ + maximum?: number; + + /**Specify minimum scale value of circular gauge + * @Default {null} + */ + minimum?: number; + + /**Specify minorIntervalValue of circular gauge + * @Default {2} + */ + minorIntervalValue?: number; + + /**Specify opacity value of circular gauge + * @Default {1} + */ + opacity?: number; + + /**Specify pointer cap of circular gauge + * @Default {Object} + */ + pointerCap?: ScalesPointerCap; + + /**Specify pointers value of circular gauge + * @Default {Array} + */ + pointers?: Array; + + /**Specify scale radius of circular gauge + * @Default {170} + */ + radius?: number; + + /**Specify ranges value of circular gauge + * @Default {Array} + */ + ranges?: Array; + + /**Specify shadowOffset value of circular gauge + * @Default {0} + */ + shadowOffset?: number; + + /**Specify showIndicators of circular gauge + * @Default {false} + */ + showIndicators?: boolean; + + /**Specify showLabels of circular gauge + * @Default {true} + */ + showLabels?: boolean; + + /**Specify showPointers of circular gauge + * @Default {true} + */ + showPointers?: boolean; + + /**Specify showRanges of circular gauge + * @Default {false} + */ + showRanges?: boolean; + + /**Specify showScaleBar of circular gauge + * @Default {false} + */ + showScaleBar?: boolean; + + /**Specify showTicks of circular gauge + * @Default {true} + */ + showTicks?: boolean; + + /**Specify scaleBar size of circular gauge + * @Default {6} + */ + size?: number; + + /**Specify startAngle of circular gauge + * @Default {115} + */ + startAngle?: number; + + /**Specify subGauge of circular gauge + * @Default {Array} + */ + subGauges?: Array; + + /**Specify sweepAngle of circular gauge + * @Default {310} + */ + sweepAngle?: number; + + /**Specify ticks of circular gauge + * @Default {Array} + */ + ticks?: Array; +} + +export interface Tooltip { + + /**enable showCustomLabelTooltip of circular gauge + * @Default {false} + */ + showCustomLabelTooltip?: boolean; + + /**enable showLabelTooltip of circular gauge + * @Default {false} + */ + showLabelTooltip?: boolean; + + /**Specify tooltip templateID of circular gauge + * @Default {false} + */ + templateID?: string; +} +} +module CircularGauge +{ +enum FrameType +{ +//string +FullCircle, +//string +HalfCircle, +} +} +module CircularGauge +{ +enum gaugePosition +{ +//string +TopLeft, +//string +TopRight, +//string +TopCenter, +//string +MiddleLeft, +//string +MiddleRight, +//string +Center, +//string +BottomLeft, +//string +BottomRight, +//string +BottomCenter, +} +} +module CircularGauge +{ +enum CustomLabelPositionType +{ +//string +Top, +//string +Bottom, +//string +Right, +//string +Left, +} +} +module CircularGauge +{ +enum Direction +{ +//string +Clockwise, +//string +CounterClockwise, +} +} +module CircularGauge +{ +enum IndicatorTypes +{ +//string +Rectangle, +//string +Circle, +//string +Text, +//string +RoundedRectangle, +//string +Image, +} +} +module CircularGauge +{ +enum Placement +{ +//string +Near, +//string +Far, +} +} +module CircularGauge +{ +enum LabelType +{ +//string +Major, +//string +Minor, +} +} +module CircularGauge +{ +enum UnitTextPlacement +{ +//string +Back, +//string +Front, +} +} +module CircularGauge +{ +enum MarkerType +{ +//string +Rectangle, +//string +Circle, +//string +Triangle, +//string +Ellipse, +//string +Diamond, +//string +Pentagon, +//string +Slider, +//string +Pointer, +//string +Wedge, +//string +Trapezoid, +//string +RoundedRectangle, +//string +Image, +} +} +module CircularGauge +{ +enum NeedleType +{ +//string +Triangle, +//string +Rectangle, +//string +Arrow, +//string +Image, +//string +Trapezoid, +} +} +module CircularGauge +{ +enum PointerType +{ +//string +Needle, +//string +Marker, +} +} + +class DigitalGauge extends ej.Widget { + static fn: DigitalGauge; + constructor(element: JQuery, options?: DigitalGauge.Model); + constructor(element: Element, options?: DigitalGauge.Model); + model:DigitalGauge.Model; + defaults:DigitalGauge.Model; + + /** To destroy the digital gauge + * @returns {void} + */ + destroy(): void; + + /** To export Digital Gauge as Image + * @param {string} fileName for the Image + * @param {string} fileType for the Image + * @returns {void} + */ + exportImage(fileName: string, fileType: string): void; + + /** Gets the location of an item that is displayed on the gauge. + * @param {number} Position value of an item that is displayed on the gauge. + * @returns {void} + */ + getPosition(itemIndex: number): void; + + /** ClientSideMethod getValue Gets the value of an item that is displayed on the gauge + * @param {number} Index value of an item that displayed on the gauge + * @returns {void} + */ + getValue(itemIndex: number): void; + + /** Refresh the digital gauge widget + * @returns {void} + */ + refresh(): void; + + /** ClientSideMethod Set Position Sets the location of an item to be displayed in the gauge + * @param {number} Index value of the digital gauge item + * @param {any} Location value of the digital gauge + * @returns {void} + */ + setPosition(itemIndex: number, value: any): void; + + /** ClientSideMethod SetValue Sets the value of an item to be displayed in the gauge. + * @param {number} Index value of the digital gauge item + * @param {string} Text value to be displayed in the gaugeS + * @returns {void} + */ + setValue(itemIndex: number, value: string): void; +} +export module DigitalGauge{ + +export interface Model { + + /**Specifies the resize option of the DigitalGauge. + * @Default {false} + */ + enableResize?: boolean; + + /**Specifies the frame of the Digital gauge. + * @Default {{backgroundImageUrl: null, innerWidth: 6, outerWidth: 10}} + */ + frame?: Frame; + + /**Specifies the height of the DigitalGauge. + * @Default {150} + */ + height?: number; + + /**Specifies the items for the DigitalGauge. + * @Default {null} + */ + items?: Items; + + /**Specifies the matrixSegmentData for the DigitalGauge. + */ + matrixSegmentData?: any; + + /**Specifies the segmentData for the DigitalGauge. + */ + segmentData?: any; + + /**Specifies the themes for the Digital gauge. See Themes + * @Default {flatlight} + */ + themes?: string; + + /**Specifies the value to the DigitalGauge. + * @Default {text} + */ + value?: string; + + /**Specifies the width for the Digital gauge. + * @Default {400} + */ + width?: number; + + /**Triggers when the gauge is initialized.*/ + init? (e: InitEventArgs): void; + + /**Triggers when the gauge item rendering.*/ + itemRendering? (e: ItemRenderingEventArgs): void; + + /**Triggers when the gauge is start to load.*/ + load? (e: LoadEventArgs): void; + + /**Triggers when the gauge render is completed.*/ + renderComplete? (e: RenderCompleteEventArgs): void; +} + +export interface InitEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the all the options of the items. + */ + items?: any; + + /**returns the context element + */ + context?: any; + + /**returns the gauge model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface ItemRenderingEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the all the options of the items. + */ + items?: any; + + /**returns the context element + */ + context?: any; + + /**returns the gauge model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface LoadEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the all the options of the items. + */ + items?: any; + + /**returns the context element + */ + context?: any; + + /**returns the gauge model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface RenderCompleteEventArgs { + + /**returns the object of the gauge. + */ + object?: any; + + /**returns the cancel option value + */ + cancel?: boolean; + + /**returns the all the options of the items. + */ + items?: any; + + /**returns the context element + */ + context?: any; + + /**returns the gauge model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface Frame { + + /**Specifies the url of an image to be displayed as background of the Digital gauge. + * @Default {null} + */ + backgroundImageUrl?: string; + + /**Specifies the inner width for the frame, when the background image has been set for the Digital gauge.. + * @Default {6} + */ + innerWidth?: number; + + /**Specifies the outer width of the frame, when the background image has been set for the Digital gauge. + * @Default {10} + */ + outerWidth?: number; +} + +export interface ItemsCharacterSettings { + + /**Specifies the CharacterCount value for the DigitalGauge. + * @Default {4} + */ + count?: number; + + /**Specifies the opacity value for the DigitalGauge. + * @Default {1} + */ + opacity?: number; + + /**Specifies the value for spacing between the characters + * @Default {2} + */ + spacing?: number; + + /**Specifies the character type for the text to be displayed. + * @Default {ej.datavisualization.DigitalGauge.CharacterType.EightCrossEightDotMatrix} + */ + type?: ej.datavisualization.DigitalGauge.CharacterType|string; +} + +export interface ItemsFont { + + /**Set the font family value + * @Default {Arial} + */ + fontFamily?: string; + + /**Set the font style for the font + * @Default {italic} + */ + fontStyle?: ej.datavisualization.DigitalGauge.FontStyle|string; + + /**Set the font size value + * @Default {11px} + */ + size?: string; +} + +export interface ItemsPosition { + + /**Set the horizontal location for the text, where it needs to be placed within the gauge. + * @Default {0} + */ + x?: number; + + /**Set the vertical location for the text, where it needs to be placed within the gauge. + * @Default {0} + */ + y?: number; +} + +export interface ItemsSegmentSettings { + + /**Set the color for the text segments. + * @Default {null} + */ + color?: string; + + /**Set the gradient for the text segments. + * @Default {null} + */ + gradient?: any; + + /**Set the length for the text segments. + * @Default {2} + */ + length?: number; + + /**Set the opacity for the text segments. + * @Default {0} + */ + opacity?: number; + + /**Set the spacing for the text segments. + * @Default {1} + */ + spacing?: number; + + /**Set the width for the text segments. + * @Default {1} + */ + width?: number; +} + +export interface Items { + + /**Specifies the Character settings for the DigitalGauge. + * @Default {null} + */ + characterSettings?: ItemsCharacterSettings; + + /**Enable/Disable the custom font to be applied to the text in the gauge. + * @Default {false} + */ + enableCustomFont?: boolean; + + /**Set the specific font for the text, when the enableCustomFont is set to true + * @Default {null} + */ + font?: ItemsFont; + + /**Set the location for the text, where it needs to be placed within the gauge. + * @Default {null} + */ + position?: ItemsPosition; + + /**Set the segment settings for the digital gauge. + * @Default {null} + */ + segmentSettings?: ItemsSegmentSettings; + + /**Set the value for enabling/disabling the blurring effect for the shadows of the text + * @Default {0} + */ + shadowBlur?: number; + + /**Specifies the color of the text shadow. + * @Default {null} + */ + shadowColor?: string; + + /**Set the x offset value for the shadow of the text, indicating the location where it needs to be displayed. + * @Default {1} + */ + shadowOffsetX?: number; + + /**Set the y offset value for the shadow of the text, indicating the location where it needs to be displayed. + * @Default {1} + */ + shadowOffsetY?: number; + + /**Set the alignment of the text that is displayed within the gauge.See TextAlign + * @Default {left} + */ + textAlign?: string; + + /**Specifies the color of the text. + * @Default {null} + */ + textColor?: string; + + /**Specifies the text value. + * @Default {null} + */ + value?: string; +} +} +module DigitalGauge +{ +enum CharacterType +{ +//string +SevenSegment, +//string +FourteenSegment, +//string +SixteenSegment, +//string +EightCrossEightDotMatrix, +//string +EightCrossEightSquareMatrix, +} +} +module DigitalGauge +{ +enum FontStyle +{ +//string +Normal, +//string +Bold, +//string +Italic, +//string +Underline, +//string +Strikeout, +} +} + +class Chart extends ej.Widget { + static fn: Chart; + constructor(element: JQuery, options?: Chart.Model); + constructor(element: Element, options?: Chart.Model); + model:Chart.Model; + defaults:Chart.Model; + + /** Animates the series and/or indicators in Chart. When parameter is not passed to this method, then all the series and indicators present in Chart are animated. + * @param {Array} Series and indicator objects passed in the array collection are animated.Example + * @param {any} Series or indicator object passed to this method are animated.Example, + * @returns {void} + */ + animate(options: Array, option: any): void; + + /** Exports chart as an image or to an excel file. Chart can be exported as an image only when exportCanvasRendering option is set to true. + * @param {string} Type of the export operation to be performed. Following are the two export types that are supported now,1. 'image'2. 'excel'Example + * @param {string} URL of the service, where the chart will be exported to excel.Example, + * @param {boolean} When this parameter is true, all the chart objects initialized to the same document are exported to a single excel file. This is an optional parameter. By default, it is false.Example, + * @returns {void} + */ + export(type: string, url: string, exportMultipleChart: boolean): void; + + /** Redraws the entire chart. You can call this method whenever you update, add or remove points from the data source or whenever you want to refresh the UI. + * @returns {void} + */ + redraw(): void; +} +export module Chart{ + +export interface Model { + + /**Options for adding and customizing annotations in Chart. + */ + annotations?: Array; + + /**Url of the image to be used as chart background. + * @Default {null} + */ + backGroundImageUrl?: string; + + /**Options for customizing the color, opacity and width of the chart border. + */ + border?: Border; + + /**Controls whether Chart has to be responsive or not. + * @Default {false} + */ + canResize?: boolean; + + /**Options for configuring the border and background of the plot area. + */ + chartArea?: ChartArea; + + /**Options to split Chart into multiple plotting areas vertically. Each object in the collection represents a plotting area in Chart. + */ + columnDefinitions?: Array; + + /**Options for configuring the properties of all the series. You can also override the options for specific series by using series collection. + */ + commonSeriesOptions?: CommonSeriesOptions; + + /**Options for displaying and customizing the crosshair. + */ + crosshair?: Crosshair; + + /**Depth of the 3D Chart from front view of series to background wall. This property is applicable only for 3D view. + * @Default {100} + */ + depth?: number; + + /**Controls whether 3D view has to be enabled or not. 3D view is supported only for column, bar. Stacking column, stacking bar, pie and doughnut series types. + * @Default {false} + */ + enable3D?: boolean; + + /**Controls whether Chart has to be rendered as Canvas or SVG. Canvas rendering supports all functionalities in SVG rendering except 3D Charts. + * @Default {false} + */ + enableCanvasRendering?: boolean; + + /**Controls whether 3D view has to be rotated on dragging. This property is applicable only for 3D view. + * @Default {false} + */ + enableRotation?: boolean; + + /**Options to customize the technical indicators. + */ + indicators?: Array; + + /**Options to customize the legend items and legend title. + */ + legend?: Legend; + + /**Name of the culture based on which chart should be localized. Number and date time values are localized with respect to the culture name.String type properties like title text are not localized automatically. Provide localized text as value to string type properties. + * @Default {en-US} + */ + locale?: string; + + /**Palette is used to store the series fill color in array and apply the color to series collection in the order of series index. + * @Default {null} + */ + palette?: Array; + + /**Options to customize the left, right, top and bottom margins of chart area. + */ + Margin?: any; + + /**Perspective angle of the 3D view. Chart appears closer when perspective angle is decreased, and distant when perspective angle is increased.This property is applicable only when 3D view is enabled + * @Default {90} + */ + perspectiveAngle?: number; + + /**This is a horizontal axis that contains options to configure axis and it is the primary x axis for all the series in series array. To override x axis for particular series, create an axis object by providing unique name by using name property and add it to axes array. Then, assign the name to the series’s xAxisName property to link both axis and series. + */ + primaryXAxis?: PrimaryXAxis; + + /**This is a vertical axis that contains options to configure axis. This is the primary y axis for all the series in series array. To override y axis for particular series, create an axis object by providing unique name by using name property and add it to axes array. Then, assign the name to the series’s yAxisName property to link both axis and series. + */ + primaryYAxis?: PrimaryYAxis; + + /**Rotation angle of the 3D view. This property is applicable only when 3D view is enabled. + * @Default {0} + */ + rotation?: number; + + /**Options to split Chart into multiple plotting areas horizontally. Each object in the collection represents a plotting area in Chart. + */ + rowDefinitions?: Array; + + /**Specifies the properties used for customizing the series. + */ + series?: Array; + + /**Controls whether data points has to be displayed side by side or along the depth of the axis. + * @Default {false} + */ + sideBySideSeriesPlacement?: boolean; + + /**Options to customize the Chart size. + */ + size?: Size; + + /**Specifies the theme for Chart. + * @Default {Flatlight. See Theme} + */ + theme?: ej.datavisualization.Chart.Theme|string; + + /**Slope angle of 3D Chart. This property is applicable only when 3D view is enabled. + * @Default {0} + */ + tilt?: number; + + /**Options for customizing the title and subtitle of Chart. + */ + title?: Title; + + /**Width of the wall used in 3D Chart. Wall is present only in Cartesian type 3D series and not in 3D pie or Doughnut series. This property is applicable only when 3D view is enabled. + * @Default {2} + */ + wallSize?: number; + + /**Options for enabling zooming feature of chart. + */ + zooming?: Zooming; + + /**Fires after the series animation is completed. This event will be triggered for each series when animation is enabled.*/ + animationComplete? (e: AnimationCompleteEventArgs): void; + + /**Fires before rendering the labels. This event is fired for each label in axis. You can use this event to add custom text to axis labels.*/ + axesLabelRendering? (e: AxesLabelRenderingEventArgs): void; + + /**Fires during the initialization of axis labels.*/ + axesLabelsInitialize? (e: AxesLabelsInitializeEventArgs): void; + + /**Fires during axes range calculation. This event is fired for each axis present in Chart. You can use this event to customize axis range as required.*/ + axesRangeCalculate? (e: AxesRangeCalculateEventArgs): void; + + /**Fires before rendering the axis title. This event is triggered for each axis with title. You can use this event to add custom text to axis title.*/ + axesTitleRendering? (e: AxesTitleRenderingEventArgs): void; + + /**Fires during the calculation of chart area bounds. You can use this event to customize the bounds of chart area.*/ + chartAreaBoundsCalculate? (e: ChartAreaBoundsCalculateEventArgs): void; + + /**Fires after chart is created.*/ + create? (e: CreateEventArgs): void; + + /**Fires when chart is destroyed completely.*/ + destroy? (e: DestroyEventArgs): void; + + /**Fires before rendering the data labels. This event is triggered for each data label in the series. You can use this event to add custom text in data labels.*/ + displayTextRendering? (e: DisplayTextRenderingEventArgs): void; + + /**Fires during the calculation of legend bounds. You can use this event to customize the bounds of legend.*/ + legendBoundsCalculate? (e: LegendBoundsCalculateEventArgs): void; + + /**Fires on clicking the legend item.*/ + legendItemClick? (e: LegendItemClickEventArgs): void; + + /**Fires when moving mouse over legend item. You can use this event for hit testing on legend items.*/ + legendItemMouseMove? (e: LegendItemMouseMoveEventArgs): void; + + /**Fires before rendering the legend item. This event is fired for each legend item in Chart. You can use this event to customize legend item shape or add custom text to legend item.*/ + legendItemRendering? (e: LegendItemRenderingEventArgs): void; + + /**Fires before loading the chart.*/ + load? (e: LoadEventArgs): void; + + /**Fires on clicking a point in chart. You can use this event to handle clicks made on points.*/ + pointRegionClick? (e: PointRegionClickEventArgs): void; + + /**Fires when mouse is moved over a point.*/ + pointRegionMouseMove? (e: PointRegionMouseMoveEventArgs): void; + + /**Fires before rendering chart.*/ + preRender? (e: PreRenderEventArgs): void; + + /**Fires after selecting a series. This event is triggered after selecting a series only if selection mode is series.*/ + seriesRegionClick? (e: SeriesRegionClickEventArgs): void; + + /**Fires before rendering a series. This event is fired for each series in Chart.*/ + seriesRendering? (e: SeriesRenderingEventArgs): void; + + /**Fires before rendering the marker symbols. This event is triggered for each marker in Chart.*/ + symbolRendering? (e: SymbolRenderingEventArgs): void; + + /**Fires before rendering the Chart title. You can use this event to add custom text in Chart title.*/ + titleRendering? (e: TitleRenderingEventArgs): void; + + /**Fires before rendering the tooltip. This event is fired when tooltip is enabled and mouse is hovered on a Chart point. You can use this event to customize tooltip before rendering.*/ + toolTipInitialize? (e: ToolTipInitializeEventArgs): void; + + /**Fires before rendering crosshair tooltip in axis. This event is fired for each axis with crosshair label enabled. You can use this event to customize crosshair label before rendering*/ + trackAxisToolTip? (e: TrackAxisToolTipEventArgs): void; + + /**Fires before rendering trackball tooltip. This event is fired for each series in Chart because trackball tooltip is displayed for all the series. You can use this event to customize the text displayed in trackball tooltip.*/ + trackToolTip? (e: TrackToolTipEventArgs): void; + + /**Fires, on clicking the axis label.*/ + axisLabelClick? (e: AxisLabelClickEventArgs): void; + + /**Fires on moving mouse over the axis label.*/ + axisLabelMouseMove? (e: AxisLabelMouseMoveEventArgs): void; + + /**Fires, on the clicking the chart.*/ + chartClick? (e: ChartClickEventArgs): void; + + /**Fires on moving mouse over the chart.*/ + chartMouseMove? (e: ChartMouseMoveEventArgs): void; + + /**Fires, on double clicking the chart.*/ + chartDoubleClick? (e: ChartDoubleClickEventArgs): void; + + /**Fires on clicking the annotation.*/ + annotationClick? (e: AnnotationClickEventArgs): void; + + /**Fires, after the chart is resized.*/ + afterResize? (e: AfterResizeEventArgs): void; + + /**Fires, when chart size is changing.*/ + beforeResize? (e: BeforeResizeEventArgs): void; + + /**Fires, when error bar is rendering.*/ + errorBarRendering? (e: ErrorBarRenderingEventArgs): void; +} + +export interface AnimationCompleteEventArgs { + + /**Instance of the series that completed has animation. + */ + series?: any; + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; +} + +export interface AxesLabelRenderingEventArgs { + + /**Instance of the corresponding axis. + */ + Axis?: any; + + /**Formatted text of the respective label. You can also add custom text to the label. + */ + LabelText?: string; + + /**Actual value of the label. + */ + LabelValue?: string; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the chart model object. + */ + model?: any; + + /**Name of the event + */ + type?: string; +} + +export interface AxesLabelsInitializeEventArgs { + + /**Collection of axes in Chart + */ + dataAxes?: any; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the chart model object. + */ + model?: any; + + /**Name of the event + */ + type?: string; +} + +export interface AxesRangeCalculateEventArgs { + + /**Difference between minimum and maximum value of axis range. + */ + delta?: number; + + /**Interval value of axis range. Grid lines, tick lines and axis labels are drawn based on this interval value. + */ + interval?: number; + + /**Maximum value of axis range. + */ + max?: number; + + /**Minimum value of axis range. + */ + min?: number; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the chart model object. + */ + model?: any; + + /**Name of the event + */ + type?: string; +} + +export interface AxesTitleRenderingEventArgs { + + /**Instance of the axis whose title is being rendered + */ + axes?: any; + + /**X-coordinate of title location + */ + locationX?: number; + + /**Y-coordinate of title location + */ + locationY?: number; + + /**Axis title text. You can add custom text to the title. + */ + title?: string; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the chart model object. + */ + model?: any; + + /**Name of the event + */ + type?: string; +} + +export interface ChartAreaBoundsCalculateEventArgs { + + /**Height of the chart area. + */ + areaBoundsHeight?: number; + + /**Width of the chart area. + */ + areaBoundsWidth?: number; + + /**X-coordinate of the chart area. + */ + areaBoundsX?: number; + + /**Y-coordinate of the chart area. + */ + areaBoundsY?: number; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the chart model object. + */ + model?: any; + + /**Name of the event + */ + type?: string; +} + +export interface CreateEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the chart model object. + */ + model?: any; + + /**Name of the event + */ + type?: string; +} + +export interface DestroyEventArgs { + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the chart model object. + */ + model?: any; + + /**Name of the event + */ + type?: string; +} + +export interface DisplayTextRenderingEventArgs { + + /**Text displayed in data label. You can add custom text to the data label + */ + text?: string; + + /**X-coordinate of data label location + */ + locationX?: number; + + /**Y-coordinate of data label location + */ + locationY?: number; + + /**Index of the series in series Collection whose data label is being rendered + */ + seriesIndex?: number; + + /**Index of the point in series whose data label is being rendered + */ + pointIndex?: number; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the chart model object. + */ + model?: any; + + /**Name of the event + */ + type?: string; +} + +export interface LegendBoundsCalculateEventArgs { + + /**Height of the legend. + */ + legendBoundsHeight?: number; + + /**Width of the legend. + */ + legendBoundsWidth?: number; + + /**Number of rows to display the legend items + */ + legendBoundsRows?: number; + + /**Set this option to true to cancel the event. + */ + cancel?: boolean; + + /**Instance of the chart model object. + */ + model?: any; + + /**Name of the event + */ + type?: string; +} + +export interface LegendItemClickEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**X-coordinate of legend item in pixel + */ + startX?: number; + + /**Y-coordinate of legend item in pixel + */ + startY?: number; + + /**Instance of the legend item object that is about to be rendered + */ + LegendItem?: any; + + /**Options to customize the legend item styles such as border, color, size, etc…, + */ + style?: any; + + /**Instance that holds information about legend bounds and legend item bounds. + */ + Bounds?: any; + + /**Name of the legend item shape. Use this option to customize legend item shape before rendering + */ + symbolShape?: string; + + /**Instance of the series object corresponding to the legend item + */ + series?: any; +} + +export interface LegendItemMouseMoveEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**X-coordinate of legend item in pixel + */ + startX?: number; + + /**Y-coordinate of legend item in pixel + */ + startY?: number; + + /**Instance of the legend item object that is about to be rendered + */ + LegendItem?: any; + + /**Options to customize the legend item styles such as border, color, size, etc…, + */ + style?: any; + + /**Options to customize the legend item styles such as border, color, size, etc…, + */ + Bounds?: any; + + /**Name of the legend item shape. Use this option to customize legend item shape before rendering + */ + symbolShape?: string; + + /**Instance of the series object corresponding to the legend item + */ + series?: any; +} + +export interface LegendItemRenderingEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**X-coordinate of legend item in pixel + */ + startX?: number; + + /**Y-coordinate of legend item in pixel + */ + startY?: number; + + /**Instance of the legend item object that is about to be rendered + */ + legendItem?: any; + + /**Options to customize the legend item styles such as border, color, size, etc. + */ + style?: any; + + /**Name of the legend item shape. Use this option to customize legend item shape before rendering + */ + symbolShape?: string; +} + +export interface LoadEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; +} + +export interface PointRegionClickEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**X-coordinate of point in pixel + */ + locationX?: number; + + /**Y-coordinate of point in pixel + */ + locationY?: number; + + /**Index of the point in series + */ + pointIndex?: number; + + /**Index of the series in series collection to which the point belongs + */ + seriesIndex?: number; +} + +export interface PointRegionMouseMoveEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**X-coordinate of point in pixel + */ + locationX?: number; + + /**Y-coordinate of point in pixel + */ + locationY?: number; + + /**Index of the point in series + */ + pointIndex?: number; + + /**Index of the series in series collection to which the point belongs + */ + seriesIndex?: number; +} + +export interface PreRenderEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; +} + +export interface SeriesRegionClickEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**Instance of the selected series + */ + series?: any; + + /**Index of the selected series + */ + seriesIndex?: number; +} + +export interface SeriesRenderingEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**Instance of the series which is about to get rendered + */ + series?: any; +} + +export interface SymbolRenderingEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**Instance that holds the location of marker symbol + */ + location?: any; + + /**Options to customize the marker style such as color, border and size + */ + style?: any; +} + +export interface TitleRenderingEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**Option to customize the title location in pixels + */ + location?: any; + + /**Read-only option to find the size of the title + */ + size?: any; + + /**Use this option to add custom text in title + */ + title?: string; +} + +export interface ToolTipInitializeEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**Text to be displayed in tooltip. Set this option to customize the text displayed in tooltip + */ + currentText?: string; + + /**Index of the point on which mouse is hovered + */ + pointIndex?: number; + + /**Index of the series in series collection whose point is hovered by mouse + */ + seriesIndex?: number; +} + +export interface TrackAxisToolTipEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**Location of the crosshair label in pixels + */ + location?: any; + + /**Index of the axis for which crosshair label is displayed + */ + axisIndex?: number; + + /**Instance of the chart axis object for which cross hair label is displayed + */ + crossAxis?: number; + + /**Text to be displayed in crosshair label. Use this option to add custom text in crosshair label + */ + currentTrackText?: string; +} + +export interface TrackToolTipEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**Location of the trackball tooltip in pixels + */ + location?: any; + + /**Index of the point for which trackball tooltip is displayed + */ + pointIndex?: number; + + /**Index of the series in series collection + */ + seriesIndex?: number; + + /**Text to be displayed in trackball tooltip. Use this option to add custom text in trackball tooltip + */ + currentText?: string; + + /**Instance of the series object for which trackball tooltip is displayed. + */ + series?: any; +} + +export interface AxisLabelClickEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**X and Y co-ordinate of the labels in chart area. + */ + location?: any; + + /**Index of the label. + */ + index?: number; + + /**Instance of the corresponding axis. + */ + axis?: any; + + /**Label that is clicked. + */ + text?: string; +} + +export interface AxisLabelMouseMoveEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**X and Y co-ordinate of the labels in chart area. + */ + location?: any; + + /**Index of the label. + */ + index?: number; + + /**Instance of the corresponding axis. + */ + axis?: any; + + /**Label that is hovered. + */ + text?: string; +} + +export interface ChartClickEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**X and Y co-ordinate of the points with respect to chart area. + */ + location?: any; + + /**ID of the target element. + */ + id?: string; + + /**Width and height of the chart. + */ + size?: any; + + /**x-coordinate of the pointer, relative to the page + */ + pageX?: number; + + /**y-coordinate of the pointer, relative to the page + */ + pageY?: number; +} + +export interface ChartMouseMoveEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**X and Y co-ordinate of the points with respect to chart area. + */ + location?: any; + + /**ID of the target element. + */ + id?: string; + + /**Width and height of the chart. + */ + size?: any; + + /**x-coordinate of the pointer, relative to the page + */ + pageX?: number; + + /**y-coordinate of the pointer, relative to the page + */ + pageY?: number; +} + +export interface ChartDoubleClickEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**X and Y co-ordinate of the points with respect to chart area. + */ + location?: any; + + /**ID of the target element. + */ + id?: string; + + /**Width and height of the chart. + */ + size?: any; + + /**x-coordinate of the pointer, relative to the page + */ + pageX?: number; + + /**y-coordinate of the pointer, relative to the page + */ + pageY?: number; +} + +export interface AnnotationClickEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**X and Y co-ordinate of the annotation in chart area. + */ + location?: any; + + /**Information about the annotation, like Coordinate unit, Region, content + */ + contentData?: any; + + /**x-coordinate of the pointer, relative to the page + */ + pageX?: number; + + /**y-coordinate of the pointer, relative to the page + */ + pageY?: number; +} + +export interface AfterResizeEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**Chart width, after resize + */ + width?: number; + + /**Chart height, after resize + */ + height?: number; + + /**Chart width, before resize + */ + prevWidth?: number; + + /**Chart height, before resize + */ + prevHeight?: number; + + /**Chart width, when the chart was first rendered + */ + originalWidth?: number; + + /**Chart height, when the chart was first rendered + */ + originalHeight?: number; +} + +export interface BeforeResizeEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**Chart width, before resize + */ + currentWidth?: number; + + /**Chart height, before resize + */ + currentHeight?: number; + + /**Chart width, after resize + */ + newWidth?: number; + + /**Chart height, after resize + */ + newHeight?: number; +} + +export interface ErrorBarRenderingEventArgs { + + /**Set this option to true to cancel the event + */ + cancel?: boolean; + + /**Instance of the chart model object + */ + model?: any; + + /**Name of the event + */ + type?: string; + + /**Error bar Object + */ + errorbar?: any; +} + +export interface AnnotationsMargin { + + /**Annotation is placed at the specified value above its original position. + * @Default {0} + */ + bottom?: number; + + /**Annotation is placed at the specified value from left side of its original position. + * @Default {0} + */ + left?: number; + + /**Annotation is placed at the specified value from the right side of its original position. + * @Default {0} + */ + right?: number; + + /**Annotation is placed at the specified value under its original position. + * @Default {0} + */ + top?: number; +} + +export interface Annotations { + + /**Angle to rotate the annotation in degrees. + * @Default {'0'} + */ + angle?: number; + + /**Text content or id of a HTML element to be displayed as annotation. + */ + content?: string; + + /**Specifies how annotations have to be placed in Chart. + * @Default {none. See CoordinateUnit} + */ + coordinateUnit?: ej.datavisualization.Chart.CoordinateUnit|string; + + /**Specifies the horizontal alignment of the annotation. + * @Default {middle. See HorizontalAlignment} + */ + horizontalAlignment?: ej.datavisualization.Chart.HorizontalAlignment|string; + + /**Options to customize the margin of annotation. + */ + margin?: AnnotationsMargin; + + /**Controls the opacity of the annotation. + * @Default {1} + */ + opacity?: number; + + /**Specifies whether annotation has to be placed with respect to chart or series. + * @Default {chart. See Region} + */ + region?: ej.datavisualization.Chart.Region|string; + + /**Specifies the vertical alignment of the annotation. + * @Default {middle. See VerticalAlignment} + */ + verticalAlignment?: ej.datavisualization.Chart.VerticalAlignment|string; + + /**Controls the visibility of the annotation. + * @Default {false} + */ + visible?: boolean; + + /**Represents the horizontal offset when coordinateUnit is pixels.when coordinateUnit is points, it represents the x-coordinate of axis bounded with xAxisName property or primary X axis when xAxisName is not provided.This property is not applicable when coordinateUnit is none. + * @Default {0} + */ + x?: number; + + /**Name of the horizontal axis to be used for positioning the annotation. This property is applicable only when coordinateUnit is points. + */ + xAxisName?: string; + + /**Represents the vertical offset when coordinateUnit is pixels.When coordinateUnit is points, it represents the y-coordinate of axis bounded with yAxisName property or primary Y axis when yAxisName is not provided.This property is not applicable when coordinateUnit is none. + * @Default {0} + */ + y?: number; + + /**Name of the vertical axis to be used for positioning the annotation.This property is applicable only when coordinateUnit is points. + */ + yAxisName?: string; +} + +export interface Border { + + /**Border color of the chart. + * @Default {null} + */ + color?: string; + + /**Opacity of the chart border. + * @Default {0.3} + */ + opacity?: number; + + /**Width of the Chart border. + * @Default {0} + */ + width?: number; +} + +export interface ChartAreaBorder { + + /**Border color of the plot area. + * @Default {Gray} + */ + color?: string; + + /**Opacity of the plot area border. + * @Default {0.3} + */ + opacity?: number; + + /**Border width of the plot area. + * @Default {0.5} + */ + width?: number; +} + +export interface ChartArea { + + /**Background color of the plot area. + * @Default {transparent} + */ + background?: string; + + /**Options for customizing the border of the plot area. + */ + border?: ChartAreaBorder; +} + +export interface ColumnDefinitions { + + /**Specifies the unit to measure the width of the column in plotting area. + * @Default {'pixel'. See Unit} + */ + unit?: ej.datavisualization.Chart.Unit|string; + + /**Width of the column in plotting area. Width is measured in either pixel or percentage based on the value of unit property. + * @Default {50} + */ + columnWidth?: number; + + /**Color of the line that indicates the starting point of the column in plotting area. + * @Default {transparent} + */ + lineColor?: string; + + /**Width of the line that indicates the starting point of the column in plot area. + * @Default {1} + */ + lineWidth?: number; +} + +export interface CommonSeriesOptionsBorder { + + /**Border color of all series. + * @Default {transparent} + */ + color?: string; + + /**DashArray for border of the series. + * @Default {null} + */ + dashArray?: string; + + /**Border width of all series. + * @Default {1} + */ + width?: number; +} + +export interface CommonSeriesOptionsFont { + + /**Font color of the text in all series. + * @Default {#707070} + */ + color?: string; + + /**Font Family for all the series. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Specifies the font Style for all the series. + * @Default {normal} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Specifies the font weight for all the series. + * @Default {regular} + */ + fontWeight?: ej.datavisualization.Chart.FontWeight|string; + + /**Opacity for text in all the series. + * @Default {1} + */ + opacity?: number; + + /**Font size for text in all the series. + * @Default {12px} + */ + size?: string; +} + +export interface CommonSeriesOptionsMarkerBorder { + + /**Border color of the marker shape. + * @Default {white} + */ + color?: string; + + /**Border width of the marker shape. + * @Default {3} + */ + width?: number; +} + +export interface CommonSeriesOptionsMarkerDataLabelBorder { + + /**Border color of the data label. + * @Default {null} + */ + color?: string; + + /**Border width of the data label. + * @Default {0.1} + */ + width?: number; +} + +export interface CommonSeriesOptionsMarkerDataLabelConnectorLine { + + /**Specifies when the connector has to be drawn as Bezier curve or straight line. This is applicable only for Pie and Doughnut chart types. + * @Default {line. See ConnectorLineType} + */ + type?: ej.datavisualization.Chart.ConnectorLineType|string; + + /**Width of the connector. + * @Default {0.5} + */ + width?: number; +} + +export interface CommonSeriesOptionsMarkerDataLabelFont { + + /**Font family of the data label. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Font style of the data label. + * @Default {normal. See FontStyle} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Font weight of the data label. + * @Default {regular. See FontWeight} + */ + fontWeight?: ej.datavisualization.Chart.FontWeight|string; + + /**Opacity of the text. + * @Default {1} + */ + opacity?: number; + + /**Font size of the data label. + * @Default {12px} + */ + size?: string; +} + +export interface CommonSeriesOptionsMarkerDataLabelMargin { + + /**Bottom margin of the text. + * @Default {5} + */ + bottom?: number; + + /**Left margin of the text. + * @Default {5} + */ + left?: number; + + /**Right margin of the text. + * @Default {5} + */ + right?: number; + + /**Top margin of the text. + * @Default {5} + */ + top?: number; +} + +export interface CommonSeriesOptionsMarkerDataLabel { + + /**Angle of the data label in degrees. Only the text gets rotated, whereas the background and border does not rotate. + * @Default {null} + */ + angle?: number; + + /**Options for customizing the border of the data label. + */ + border?: CommonSeriesOptionsMarkerDataLabelBorder; + + /**Options for displaying and customizing the line that connects point and data label. + */ + connectorLine?: CommonSeriesOptionsMarkerDataLabelConnectorLine; + + /**Background color of the data label. + * @Default {null} + */ + fill?: string; + + /**Options for customizing the data label font. + */ + font?: CommonSeriesOptionsMarkerDataLabelFont; + + /**Horizontal alignment of the data label. + * @Default {center} + */ + horizontalTextAlignment?: ej.datavisualization.Chart.HorizontalTextAlignment|string; + + /**Margin of the text to its background shape. The size of the background shape increases based on the margin applied to its text. + */ + margin?: CommonSeriesOptionsMarkerDataLabelMargin; + + /**Opacity of the data label. + * @Default {1} + */ + opacity?: number; + + /**Background shape of the data label. + * @Default {none. See Shape} + */ + shape?: ej.datavisualization.Chart.Shape|string; + + /**Name of a field in data source, where datalabel text is displayed. + */ + textMappingName?: string; + + /**Specifies the position of the data label. This property can be used only for the series such as column, bar, stacked column, stacked bar, 100% stacked column, 100% stacked bar, candle and OHLC. + * @Default {top. See TextPosition} + */ + textPosition?: ej.datavisualization.Chart.TextPosition|string; + + /**Vertical alignment of the data label. + * @Default {center} + */ + verticalTextAlignment?: ej.datavisualization.Chart.VerticalTextAlignment|string; + + /**Controls the visibility of the data labels. + * @Default {false} + */ + visible?: boolean; +} + +export interface CommonSeriesOptionsMarkerSize { + + /**Height of the marker. + * @Default {6} + */ + height?: number; + + /**Width of the marker. + * @Default {6} + */ + width?: number; +} + +export interface CommonSeriesOptionsMarker { + + /**Options for customizing the border of the marker shape. + */ + border?: CommonSeriesOptionsMarkerBorder; + + /**Options for displaying and customizing data labels. + */ + dataLabel?: CommonSeriesOptionsMarkerDataLabel; + + /**Color of the marker shape. + * @Default {null} + */ + fill?: string; + + /**The URL for the Image to be displayed as marker. In order to display image as marker, set series.marker.shape as ‘image’. + */ + imageUrl?: string; + + /**Opacity of the marker. + * @Default {1} + */ + opacity?: number; + + /**Specifies the shape of the marker. + * @Default {circle. See Shape} + */ + shape?: ej.datavisualization.Chart.Shape|string; + + /**Options for customizing the size of the marker shape. + */ + size?: CommonSeriesOptionsMarkerSize; + + /**Controls the visibility of the marker shape. + * @Default {false} + */ + visible?: boolean; +} + +export interface CommonSeriesOptionsTooltipBorder { + + /**Border color of the tooltip. + * @Default {null} + */ + color?: string; + + /**Border width of the tooltip. + * @Default {1} + */ + width?: number; +} + +export interface CommonSeriesOptionsTooltip { + + /**Options for customizing the border of the tooltip. + */ + border?: CommonSeriesOptionsTooltipBorder; + + /**Customize the corner radius of the tooltip rectangle. + * @Default {0} + */ + rx?: number; + + /**Customize the corner radius of the tooltip rectangle. + * @Default {0} + */ + ry?: number; + + /**Specifies the duration, the tooltip has to be displayed. + * @Default {500ms} + */ + duration?: string; + + /**Enables/disables the animation of the tooltip when moving from one point to other. + * @Default {true} + */ + enableAnimation?: boolean; + + /**Background color of the tooltip. + * @Default {null} + */ + fill?: string; + + /**Format of the tooltip content. + * @Default {#point.x# : #point.y#} + */ + format?: string; + + /**Opacity of the tooltip. + * @Default {0.5} + */ + opacity?: number; + + /**Custom template to format the tooltip content. Use “point.x” and “point.y” as a placeholder text to display the corresponding data point’s x and y value. + * @Default {null} + */ + template?: string; + + /**Controls the visibility of the tooltip. + * @Default {false} + */ + visible?: boolean; +} + +export interface CommonSeriesOptionsEmptyPointSettingsStyleBorder { + + /**Border color of the empty point. + */ + color?: string; + + /**Border width of the empty point. + * @Default {1} + */ + width?: number; +} + +export interface CommonSeriesOptionsEmptyPointSettingsStyle { + + /**Color of the empty point. + */ + color?: string; + + /**Options for customizing border of the empty point in the series. + */ + border?: CommonSeriesOptionsEmptyPointSettingsStyleBorder; +} + +export interface CommonSeriesOptionsEmptyPointSettings { + + /**Controls the visibility of the empty point. + * @Default {true} + */ + visible?: boolean; + + /**Specifies the mode of empty point. + * @Default {gap} + */ + displayMode?: ej.datavisualization.Chart.EmptyPointMode|string; + + /**Options for customizing the color and border of the empty point in the series. + */ + style?: CommonSeriesOptionsEmptyPointSettingsStyle; +} + +export interface CommonSeriesOptionsConnectorLine { + + /**Width of the connector line. + * @Default {1} + */ + width?: number; + + /**Color of the connector line. + * @Default {#565656} + */ + color?: string; + + /**DashArray of the connector line. + * @Default {null} + */ + dashArray?: string; + + /**DashArray of the connector line. + * @Default {1} + */ + opacity?: number; +} + +export interface CommonSeriesOptionsErrorBarCap { + + /**Show/Hides the error bar cap. + * @Default {true} + */ + visible?: boolean; + + /**Width of the error bar cap. + * @Default {1} + */ + width?: number; + + /**Length of the error bar cap. + * @Default {1} + */ + length?: number; + + /**Color of the error bar cap. + * @Default {“#000000”} + */ + fill?: string; +} + +export interface CommonSeriesOptionsErrorBar { + + /**Show/hides the error bar + * @Default {visible} + */ + visibility?: boolean; + + /**Specifies the type of error bar. + * @Default {FixedValue} + */ + type?: ej.datavisualization.Chart.ErrorBarType|string; + + /**Specifies the mode of error bar. + * @Default {vertical} + */ + mode?: ej.datavisualization.Chart.ErrorBarMode|string; + + /**Specifies the direction of error bar. + * @Default {both} + */ + direction?: ej.datavisualization.Chart.ErrorBarDirection|string; + + /**Value of vertical error bar. + * @Default {3} + */ + verticalErrorValue?: number; + + /**Value of horizontal error bar. + * @Default {1} + */ + horizontalErrorValue?: number; + + /**Value of positive horizontal error bar. + * @Default {1} + */ + horizontalPositiveErrorValue?: number; + + /**Value of negative horizontal error bar. + * @Default {1} + */ + horizontalNegativeErrorValue?: number; + + /**Value of positive vertical error bar. + * @Default {5} + */ + verticalPositiveErrorValue?: number; + + /**Value of negative vertical error bar. + * @Default {5} + */ + verticalNegativeErrorValue?: number; + + /**Fill color of the error bar. + * @Default {#000000} + */ + fill?: string; + + /**Width of the error bar. + * @Default {1} + */ + width?: number; + + /**Options for customizing the error bar cap. + */ + cap?: CommonSeriesOptionsErrorBarCap; +} + +export interface CommonSeriesOptionsTrendlines { + + /**Show/hides the trendline. + */ + visibility?: boolean; + + /**Specifies the type of the trendline for the series. + * @Default {linear. See TrendlinesType} + */ + type?: string; + + /**Name for the trendlines that is to be displayed in the legend text. + * @Default {trendline} + */ + name?: string; + + /**Fill color of the trendlines. + * @Default {#0000FF} + */ + fill?: string; + + /**Width of the trendlines. + * @Default {1} + */ + width?: number; + + /**Opacity of the trendline. + * @Default {1} + */ + opacity?: number; + + /**Pattern of dashes and gaps used to stroke the trendline. + */ + dashArray?: string; + + /**Future trends of the current series. + * @Default {0} + */ + forwardForecast?: number; + + /**Past trends of the current series. + * @Default {0} + */ + backwardForecast?: number; + + /**Specifies the order of the polynomial trendlines. + * @Default {0} + */ + polynomialOrder?: number; + + /**Specifies the moving average starting period value. + * @Default {2} + */ + period?: number; +} + +export interface CommonSeriesOptionsHighlightSettingsBorder { + + /**Border color of the series/point on highlight. + */ + color?: string; + + /**Border width of the series/point on highlight. + * @Default {2} + */ + width?: string; +} + +export interface CommonSeriesOptionsHighlightSettings { + + /**Enables/disables the ability to highlight the series or data point interactively. + * @Default {false} + */ + enable?: boolean; + + /**Specifies whether the series or data point has to be highlighted. + * @Default {series. See Mode} + */ + mode?: ej.datavisualization.Chart.Mode|string; + + /**Color of the series/point on highlight. + */ + color?: string; + + /**Opacity of the series/point on highlight. + * @Default {0.6} + */ + opacity?: number; + + /**Options for customizing the border of series on highlight. + */ + border?: CommonSeriesOptionsHighlightSettingsBorder; + + /**Specifies the pattern for the series/point on highlight. + * @Default {none. See Pattern} + */ + pattern?: string; + + /**Custom pattern for the series on highlight. + */ + customPattern?: string; +} + +export interface CommonSeriesOptionsSelectionSettingsBorder { + + /**Border color of the series/point on selection. + */ + color?: string; + + /**Border width of the series/point on selection. + * @Default {2} + */ + width?: string; +} + +export interface CommonSeriesOptionsSelectionSettings { + + /**Enables/disables the ability to select a series/data point interactively. + * @Default {false} + */ + enable?: boolean; + + /**Specifies the type of selection. + * @Default {single} + */ + type?: ej.datavisualization.Chart.SelectionType|string; + + /**Specifies whether the series or data point has to be selected. + * @Default {series. See Mode} + */ + mode?: ej.datavisualization.Chart.Mode|string; + + /**Color of the series/point on selection. + */ + color?: string; + + /**Opacity of the series/point on selection. + * @Default {0.6} + */ + opacity?: number; + + /**Options for customizing the border of the series on selection. + */ + border?: CommonSeriesOptionsSelectionSettingsBorder; + + /**Specifies the pattern for the series/point on selection. + * @Default {none. See Pattern} + */ + pattern?: string; + + /**Custom pattern for the series on selection. + */ + customPattern?: string; +} + +export interface CommonSeriesOptions { + + /**Options to customize the border of all the series. + */ + border?: CommonSeriesOptionsBorder; + + /**Pattern of dashes and gaps used to stroke all the line type series. + */ + dashArray?: string; + + /**Set the dataSource for all series. It can be an array of JSON objects or an instance of ej.DataManager. + * @Default {null} + */ + dataSource?: any; + + /**Controls the size of the hole in doughnut series. Value ranges from 0 to 1 + * @Default {0.4} + */ + doughnutCoefficient?: number; + + /**Controls the size of the doughnut series. Value ranges from 0 to 1. + * @Default {0.8} + */ + doughnutSize?: number; + + /**Specifies the type of series to be drawn in radar or polar series. + * @Default {line. See DrawType} + */ + drawType?: ej.datavisualization.Chart.DrawType|string; + + /**Enable/disable the animation for all the series. + * @Default {true} + */ + enableAnimation?: boolean; + + /**To avoid overlapping of data labels smartly. + * @Default {true} + */ + enableSmartLabels?: boolean; + + /**Start angle of pie/doughnut series. + * @Default {null} + */ + endAngle?: number; + + /**Explodes the pie/doughnut slices on mouse move. + * @Default {false} + */ + explode?: boolean; + + /**Explodes all the slice of pie/doughnut on render. + * @Default {false} + */ + explodeAll?: boolean; + + /**Index of the point to be exploded from pie/doughnut/pyramid/funnel. + * @Default {null} + */ + explodeIndex?: number; + + /**Specifies the distance of the slice from the center, when it is exploded. + * @Default {0.4} + */ + explodeOffset?: number; + + /**Fill color for all the series. + * @Default {null} + */ + fill?: string; + + /**Options for customizing the font of all the series. + */ + font?: CommonSeriesOptionsFont; + + /**Sets the height of the funnel in funnel series. Values can be either pixel or percentage. + * @Default {32.7%} + */ + funnelHeight?: string; + + /**Sets the width of the funnel in funnel series. Values can be either pixel or percentage. + * @Default {11.6%} + */ + funnelWidth?: string; + + /**Gap between the slices in pyramid and funnel series. + * @Default {0} + */ + gapRatio?: number; + + /**Specifies whether to join start and end point of a line/area series used in polar/radar chart to form a closed path. + * @Default {true} + */ + isClosed?: boolean; + + /**Specifies whether to stack the column series in polar/radar charts. + * @Default {false} + */ + isStacking?: boolean; + + /**Renders the chart vertically. This is applicable only for cartesian type series. + * @Default {false} + */ + isTransposed?: boolean; + + /**Position of the data label in pie/doughnut/pyramid/funnel series. OutsideExtended position is not applicable for pyramid/funnel. + * @Default {inside. See LabelPosition} + */ + labelPosition?: ej.datavisualization.Chart.LabelPosition|string; + + /**Specifies the line cap of the series. + * @Default {butt. See LineCap} + */ + lineCap?: ej.datavisualization.Chart.LineCap|string; + + /**Specifies the type of shape to be used where two lines meet. + * @Default {round. See LineJoin} + */ + lineJoin?: ej.datavisualization.Chart.LineJoin|string; + + /**Options for displaying and customizing marker for individual point in a series. Marker contains shapes and/or data labels. + */ + marker?: CommonSeriesOptionsMarker; + + /**Opacity of the series. + * @Default {1} + */ + opacity?: number; + + /**Name of a field in data source, where the fill color for all the data points is generated. + */ + palette?: string; + + /**Controls the size of pie series. Value ranges from 0 to 1. + * @Default {0.8} + */ + pieCoefficient?: number; + + /**Specifies the mode of the pyramid series. + * @Default {linear. See PyramidMode} + */ + pyramidMode?: ej.datavisualization.Chart.PyramidMode|string; + + /**Start angle from where the pie/doughnut series renders. By default it starts from 0. + * @Default {null} + */ + startAngle?: number; + + /**Options for customizing the tooltip of chart. + */ + tooltip?: CommonSeriesOptionsTooltip; + + /**Specifies the type of the series to render in chart. + * @Default {column. See Type} + */ + type?: ej.datavisualization.Chart.Type|string; + + /**Specifies the name of the x-axis that has to be associated with this series. Add an axis instance with this name to axes collection. + * @Default {null} + */ + xAxisName?: string; + + /**Name of the property in the datasource that contains x value for the series. + * @Default {null} + */ + xName?: string; + + /**Specifies the name of the y-axis that has to be associated with this series. Add an axis instance with this name to axes collection. + * @Default {null} + */ + yAxisName?: string; + + /**Name of the property in the datasource that contains y value for the series. + * @Default {null} + */ + yName?: string; + + /**Name of the property in the datasource that contains high value for the series. + * @Default {null} + */ + high?: string; + + /**Name of the property in the datasource that contains low value for the series. + * @Default {null} + */ + low?: string; + + /**Name of the property in the datasource that contains open value for the series. + * @Default {null} + */ + open?: string; + + /**Name of the property in the datasource that contains close value for the series. + * @Default {null} + */ + close?: string; + + /**Name of the property in the datasource that contains the size value for the bubble series. + * @Default {null} + */ + size?: string; + + /**Options for customizing the empty point in the series. + */ + emptyPointSettings?: CommonSeriesOptionsEmptyPointSettings; + + /**Fill color for the positive column of the waterfall. + * @Default {null} + */ + positiveFill?: string; + + /**Options for customizing the waterfall connector line. + */ + connectorLine?: CommonSeriesOptionsConnectorLine; + + /**Options to customize the error bar in series. + */ + errorBar?: CommonSeriesOptionsErrorBar; + + /**Option to add the trendlines to chart. + */ + trendlines?: Array; + + /**Options for customizing the appearance of the series or data point while highlighting. + */ + highlightSettings?: CommonSeriesOptionsHighlightSettings; + + /**Options for customizing the appearance of the series/data point on selection. + */ + selectionSettings?: CommonSeriesOptionsSelectionSettings; +} + +export interface CrosshairMarkerBorder { + + /**Border width of the marker. + * @Default {3} + */ + width?: number; +} + +export interface CrosshairMarkerSize { + + /**Height of the marker. + * @Default {10} + */ + height?: number; + + /**Width of the marker. + * @Default {10} + */ + width?: number; +} + +export interface CrosshairMarker { + + /**Options for customizing the border. + */ + border?: CrosshairMarkerBorder; + + /**Opacity of the marker. + * @Default {true} + */ + opacity?: boolean; + + /**Options for customizing the size of the marker. + */ + size?: CrosshairMarkerSize; + + /**Show/hides the marker. + * @Default {true} + */ + visible?: boolean; +} + +export interface Crosshair { + + /**Options for customizing the marker in crosshair. + */ + marker?: CrosshairMarker; + + /**Specifies the type of the crosshair. It can be trackball or crosshair + * @Default {crosshair. See CrosshairType} + */ + type?: ej.datavisualization.Chart.CrosshairType|string; + + /**Show/hides the crosshair/trackball visibility. + * @Default {false} + */ + visible?: boolean; +} + +export interface IndicatorsHistogramBorder { + + /**Color of the histogram border in MACD indicator. + * @Default {#9999ff} + */ + color?: string; + + /**Controls the width of histogram border line in MACD indicator. + * @Default {1} + */ + width?: number; +} + +export interface IndicatorsHistogram { + + /**Options to customize the histogram border in MACD indicator. + */ + border?: IndicatorsHistogramBorder; + + /**Color of histogram columns in MACD indicator. + * @Default {#ccccff} + */ + fill?: string; + + /**Opacity of histogram columns in MACD indicator. + * @Default {1} + */ + opacity?: number; +} + +export interface IndicatorsLowerLine { + + /**Color of lower line. + * @Default {#008000} + */ + fill?: string; + + /**Width of the lower line. + * @Default {2} + */ + width?: number; +} + +export interface IndicatorsMacdLine { + + /**Color of MACD line. + * @Default {#ff9933} + */ + fill?: string; + + /**Width of the MACD line. + * @Default {2} + */ + width?: number; +} + +export interface IndicatorsPeriodLine { + + /**Color of period line in indicator. + * @Default {blue} + */ + fill?: string; + + /**Width of the period line in indicators. + * @Default {2} + */ + width?: number; +} + +export interface IndicatorsTooltipBorder { + + /**Border color of indicator tooltip. + * @Default {null} + */ + color?: string; + + /**Border width of indicator tooltip. + * @Default {1} + */ + width?: number; +} + +export interface IndicatorsTooltip { + + /**Option to customize the border of indicator tooltip. + */ + border?: IndicatorsTooltipBorder; + + /**Specifies the animation duration of indicator tooltip. + * @Default {500ms} + */ + duration?: string; + + /**Enables/disables the tooltip animation. + * @Default {true} + */ + enableAnimation?: boolean; + + /**Format of indicator tooltip. Use “point.x” and “point.y” as a placeholder text to display the corresponding data point’s x and y value. + * @Default {#point.x# : #point.y#} + */ + format?: string; + + /**Background color of indicator tooltip. + * @Default {null} + */ + fill?: string; + + /**Opacity of indicator tooltip. + * @Default {0.95} + */ + opacity?: number; + + /**Controls the visibility of indicator tooltip. + * @Default {false} + */ + visible?: boolean; +} + +export interface IndicatorsUpperLine { + + /**Fill color of the upper line in indicators + * @Default {#ff9933} + */ + fill?: string; + + /**Width of the upper line in indicators. + * @Default {2} + */ + width?: number; +} + +export interface Indicators { + + /**The dPeriod value for stochastic indicator. + * @Default {3} + */ + dPeriod?: number; + + /**Enables/disables the animation. + * @Default {false} + */ + enableAnimation?: boolean; + + /**Color of the technical indicator. + * @Default {#00008B} + */ + fill?: string; + + /**Options to customize the histogram in MACD indicator. + */ + histogram?: IndicatorsHistogram; + + /**Specifies the k period in stochastic indicator. + * @Default {3} + */ + kPeriod?: number; + + /**Specifies the long period in MACD indicator. + * @Default {26} + */ + longPeriod?: number; + + /**Options to customize the lower line in indicators. + */ + lowerLine?: IndicatorsLowerLine; + + /**Options to customize the MACD line. + */ + macdLine?: IndicatorsMacdLine; + + /**Specifies the type of the MACD indicator. + * @Default {line. See MACDType} + */ + macdType?: string; + + /**Specifies period value in indicator. + * @Default {14} + */ + period?: number; + + /**Options to customize the period line in indicators. + */ + periodLine?: IndicatorsPeriodLine; + + /**Name of the series for which indicator has to be drawn. + */ + seriesName?: string; + + /**Specifies the short period in MACD indicator. + * @Default {13} + */ + shortPeriod?: number; + + /**Specifies the standard deviation value for Bollinger band indicator. + * @Default {2} + */ + standardDeviations?: number; + + /**Options to customize the tooltip. + */ + tooltip?: IndicatorsTooltip; + + /**Trigger value of MACD indicator. + * @Default {9} + */ + trigger?: number; + + /**Specifies the visibility of indicator. + * @Default {visible} + */ + visibility?: string; + + /**Specifies the type of indicator that has to be rendered. + * @Default {sma. See IndicatorsType} + */ + type?: string; + + /**Options to customize the upper line in indicators + */ + upperLine?: IndicatorsUpperLine; + + /**Width of the indicator line. + * @Default {2} + */ + width?: number; + + /**Name of the horizontal axis used for indicator. Primary X axis is used when x axis name is not specified. + */ + xAxisName?: string; + + /**Name of the vertical axis used for indicator. Primary Y axis is used when y axis name is not specified + */ + yAxisName?: string; +} + +export interface LegendBorder { + + /**Border color of the legend. + * @Default {transparent} + */ + color?: string; + + /**Border width of the legend. + * @Default {1} + */ + width?: number; +} + +export interface LegendFont { + + /**Font family for legend item text. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Font style for legend item text. + * @Default {Normal. See FontStyle} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Font weight for legend item text. + * @Default {Regular. See FontWeight} + */ + fontWeight?: ej.datavisualization.Chart.FontWeight|string; + + /**Font size for legend item text. + * @Default {12px} + */ + size?: string; +} + +export interface LegendItemStyleBorder { + + /**Border color of the legend items. + * @Default {transparent} + */ + color?: string; + + /**Border width of the legend items. + * @Default {1} + */ + width?: number; +} + +export interface LegendItemStyle { + + /**Options for customizing the border of legend items. + */ + border?: LegendItemStyleBorder; + + /**Height of the shape in legend items. + * @Default {10} + */ + height?: number; + + /**Width of the shape in legend items. + * @Default {10} + */ + width?: number; +} + +export interface LegendLocation { + + /**X value or horizontal offset to position the legend in chart. + * @Default {0} + */ + x?: number; + + /**Y value or vertical offset to position the legend. + * @Default {0} + */ + y?: number; +} + +export interface LegendSize { + + /**Height of the legend. Height can be specified in either pixel or percentage. + * @Default {null} + */ + height?: string; + + /**Width of the legend. Width can be specified in either pixel or percentage. + * @Default {null} + */ + width?: string; +} + +export interface LegendTitleFont { + + /**Font family for the text in legend title. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Font style for legend title. + * @Default {normal. See FontStyle} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Font weight for legend title. + * @Default {normal. See FontWeight} + */ + fontWeight?: ej.datavisualization.Chart.FontWeight|string; + + /**Font size for legend title. + * @Default {12px} + */ + size?: string; +} + +export interface LegendTitle { + + /**Options to customize the font used for legend title + */ + font?: LegendTitleFont; + + /**Text to be displayed in legend title. + */ + text?: string; + + /**Alignment of the legend title. + * @Default {center. See Alignment} + */ + textAlignment?: ej.datavisualization.Chart.Alignment|string; +} + +export interface Legend { + + /**Horizontal alignment of the legend. + * @Default {Center. See Alignment} + */ + alignment?: ej.datavisualization.Chart.Alignment|string; + + /**Background for the legend. Use this property to add a background image or background color for the legend. + */ + background?: string; + + /**Options for customizing the legend border. + */ + border?: LegendBorder; + + /**Number of columns to arrange the legend items. + * @Default {null} + */ + columnCount?: number; + + /**Controls whether legend has to use scrollbar or not. When enabled, scroll bar appears depending upon size and position properties of legend. + * @Default {true} + */ + enableScrollbar?: boolean; + + /**Fill color for the legend items. By using this property, it displays all legend item shapes in same color.Legend items representing invisible series is displayed in gray color. + * @Default {null} + */ + fill?: string; + + /**Options to customize the font used for legend item text. + */ + font?: LegendFont; + + /**Gap or padding between the legend items. + * @Default {10} + */ + itemPadding?: number; + + /**Options to customize the style of legend items. + */ + itemStyle?: LegendItemStyle; + + /**Options to customize the location of chart legend. Legend is placed in provided location only when value of position property is custom + */ + location?: LegendLocation; + + /**Opacity of the legend. + * @Default {1} + */ + opacity?: number; + + /**Places the legend at specified position. Legend can be placed at left, right, top or bottom of the chart area.To manually specify the location of legend, set custom as value to this property. + * @Default {Bottom. See Position} + */ + position?: ej.datavisualization.Chart.Position|string; + + /**Number of rows to arrange the legend items. + * @Default {null} + */ + rowCount?: number; + + /**Shape of the legend items. Default shape for pie and doughnut series is circle and all other series uses rectangle. + * @Default {None. See Shape} + */ + shape?: ej.datavisualization.Chart.Shape|string; + + /**Options to customize the size of the legend. + */ + size?: LegendSize; + + /**Options to customize the legend title. + */ + title?: LegendTitle; + + /**Specifies the action taken when the legend width is more than the textWidth. + * @Default {none. See textOverflow} + */ + textOverflow?: ej.datavisualization.Chart.TextOverflow|string; + + /**Text width for legend item. + * @Default {34} + */ + textWidth?: number; + + /**Controls the visibility of the legend. + * @Default {true} + */ + visible?: boolean; +} + +export interface PrimaryXAxisAlternateGridBandEven { + + /**Fill color for the even grid bands. + * @Default {transparent} + */ + fill?: string; + + /**Opacity of the even grid band. + * @Default {1} + */ + opacity?: number; +} + +export interface PrimaryXAxisAlternateGridBandOdd { + + /**Fill color of the odd grid bands + * @Default {transparent} + */ + fill?: string; + + /**Opacity of odd grid band + * @Default {1} + */ + opacity?: number; +} + +export interface PrimaryXAxisAlternateGridBand { + + /**Options for customizing even grid band. + */ + even?: PrimaryXAxisAlternateGridBandEven; + + /**Options for customizing odd grid band. + */ + odd?: PrimaryXAxisAlternateGridBandOdd; +} + +export interface PrimaryXAxisAxisLine { + + /**Pattern of dashes and gaps to be applied to the axis line. + * @Default {null} + */ + dashArray?: string; + + /**Padding for axis line. Normally, it is used along with plotOffset to pad the plot area. + * @Default {null} + */ + offset?: number; + + /**Show/hides the axis line. + * @Default {true} + */ + visible?: boolean; + + /**Width of axis line. + * @Default {1} + */ + width?: number; +} + +export interface PrimaryXAxisCrosshairLabel { + + /**Show/hides the crosshair label associated with this axis. + * @Default {false} + */ + visible?: boolean; +} + +export interface PrimaryXAxisFont { + + /**Font family of labels. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Font style of labels. + * @Default {ej.datavisualization.Chart.FontStyle.Normal. See FontStyle} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Font weight of the label. + * @Default {ej.datavisualization.Chart.FontWeight.Regular. See FontWeight} + */ + fontWeight?: ej.datavisualization.Chart.FontWeight|string; + + /**Opacity of the axis labels. + * @Default {1} + */ + opacity?: number; + + /**Font size of the axis labels. + * @Default {13px} + */ + size?: string; +} + +export interface PrimaryXAxisMajorGridLines { + + /**Pattern of dashes and gaps used to stroke the major grid lines. + * @Default {null} + */ + dashArray?: string; + + /**Opacity of major grid lines. + * @Default {1} + */ + opacity?: number; + + /**Show/hides the major grid lines. + * @Default {true} + */ + visible?: boolean; + + /**Width of the major grid lines. + * @Default {1} + */ + width?: number; +} + +export interface PrimaryXAxisMajorTickLines { + + /**Length of the major tick lines. + * @Default {5} + */ + size?: number; + + /**Show/hides the major tick lines. + * @Default {true} + */ + visible?: boolean; + + /**Width of the major tick lines. + * @Default {1} + */ + width?: number; +} + +export interface PrimaryXAxisMinorGridLines { + + /**Patterns of dashes and gaps used to stroke the minor grid lines. + * @Default {null} + */ + dashArray?: string; + + /**Show/hides the minor grid lines. + * @Default {true} + */ + visible?: boolean; + + /**Width of the minorGridLines. + * @Default {1} + */ + width?: number; +} + +export interface PrimaryXAxisMinorTickLines { + + /**Length of the minor tick lines. + * @Default {5} + */ + size?: number; + + /**Show/hides the minor tick lines. + * @Default {true} + */ + visible?: boolean; + + /**Width of the minor tick line. + * @Default {1} + */ + width?: number; +} + +export interface PrimaryXAxisRange { + + /**Minimum value of the axis range. + * @Default {null} + */ + minimum?: number; + + /**Maximum value of the axis range. + * @Default {null} + */ + maximum?: number; + + /**Interval of the axis range. + * @Default {null} + */ + interval?: number; +} + +export interface PrimaryXAxisStripLineFont { + + /**Font color of the strip line text. + * @Default {black} + */ + color?: string; + + /**Font family of the strip line text. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Font style of the strip line text. + * @Default {Normal} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Font weight of the strip line text. + * @Default {regular} + */ + fontWeight?: string; + + /**Opacity of the strip line text. + * @Default {1} + */ + opacity?: number; + + /**Font size of the strip line text. + * @Default {12px} + */ + size?: string; +} + +export interface PrimaryXAxisStripLine { + + /**Border color of the strip line. + * @Default {gray} + */ + borderColor?: string; + + /**Background color of the strip line. + * @Default {gray} + */ + color?: string; + + /**End value of the strip line. + * @Default {null} + */ + end?: number; + + /**Options for customizing the font of the text. + */ + font?: PrimaryXAxisStripLineFont; + + /**Start value of the strip line. + * @Default {null} + */ + start?: number; + + /**Indicates whether to render the strip line from the minimum/start value of the axis. This property does not work when start property is set. + * @Default {false} + */ + startFromAxis?: boolean; + + /**Specifies text to be displayed inside the strip line. + * @Default {stripLine} + */ + text?: string; + + /**Specifies the alignment of the text inside the strip line. + * @Default {middlecenter. See TextAlignment} + */ + textAlignment?: ej.datavisualization.Chart.TextAlignment|string; + + /**Show/hides the strip line. + * @Default {false} + */ + visible?: boolean; + + /**Width of the strip line. + * @Default {0} + */ + width?: number; + + /**Specifies the order where the strip line and the series have to be rendered. When zOrder is “behind”, strip line is rendered under the series and when it is “over”, it is rendered above the series. + * @Default {over. See ZIndex} + */ + zIndex?: ej.datavisualization.Chart.ZIndex|string; +} + +export interface PrimaryXAxisTitleFont { + + /**Font family of the title text. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Font style of the title text. + * @Default {ej.datavisualization.Chart.FontStyle.Normal} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Font weight of the title text. + * @Default {ej.datavisualization.Chart.FontWeight.Regular. See FontWeight} + */ + fontWeight?: ej.datavisualization.Chart.FontWeight|string; + + /**Opacity of the axis title text. + * @Default {1} + */ + opacity?: number; + + /**Font size of the axis title. + * @Default {16px} + */ + size?: string; +} + +export interface PrimaryXAxisTitle { + + /**Specifies whether to trim the axis title when it exceeds the chart area or the maximum width of the title. + * @Default {false} + */ + enableTrim?: boolean; + + /**Options for customizing the title font. + */ + font?: PrimaryXAxisTitleFont; + + /**Maximum width of the title, when the title exceeds this width, the title gets trimmed, when enableTrim is true. + * @Default {34} + */ + maximumTitleWidth?: number; + + /**Title for the axis. + */ + text?: string; + + /**Controls the visibility of axis title. + * @Default {true} + */ + visible?: boolean; +} + +export interface PrimaryXAxis { + + /**Options for customizing horizontal axis alternate grid band. + */ + alternateGridBand?: PrimaryXAxisAlternateGridBand; + + /**Options for customizing the axis line. + */ + axisLine?: PrimaryXAxisAxisLine; + + /**Specifies the index of the column where the axis is associated, when the chart area is divided into multiple plot areas by using columnDefinitions. + * @Default {null} + */ + columnIndex?: number; + + /**Specifies the number of columns or plot areas an axis has to span horizontally. + * @Default {null} + */ + columnSpan?: number; + + /**Options to customize the crosshair label. + */ + crosshairLabel?: PrimaryXAxisCrosshairLabel; + + /**With this setting, you can request axis to calculate intervals approximately equal to your desired interval. + * @Default {null} + */ + desiredIntervals?: number; + + /**Specifies the position of labels at the edge of the axis. + * @Default {ej.datavisualization.Chart.EdgeLabelPlacement.None. See EdgeLabelPlacement} + */ + edgeLabelPlacement?: ej.datavisualization.Chart.EdgeLabelPlacement|string; + + /**Specifies whether to trim the axis label when the width of the label exceeds the maximumLabelWidth. + * @Default {false} + */ + enableTrim?: boolean; + + /**Options for customizing the font of the axis Labels. + */ + font?: PrimaryXAxisFont; + + /**Specifies the type of interval in date time axis. + * @Default {null. See IntervalType} + */ + intervalType?: ej.datavisualization.Chart.IntervalType|string; + + /**Specifies whether to inverse the axis. + * @Default {false} + */ + isInversed?: boolean; + + /**Custom formatting for axis label and supports all standard formatting type of numerical and date time values. + * @Default {null} + */ + labelFormat?: string; + + /**Specifies the action to take when the axis labels are overlapping with each other. + * @Default {ej.datavisualization.Chart.LabelIntersectAction.None. See LabelIntersectAction} + */ + labelIntersectAction?: ej.datavisualization.Chart.LabelIntersectAction|string; + + /**Specifies the position of the axis labels. + * @Default {outside. See LabelPosition} + */ + labelPosition?: ej.datavisualization.Chart.LabelPosition|string; + + /**Angle in degrees to rotate the axis labels. + * @Default {null} + */ + labelRotation?: number; + + /**Logarithmic base value. This is applicable only for logarithmic axis. + * @Default {10} + */ + logBase?: number; + + /**Options for customizing major gird lines. + */ + majorGridLines?: PrimaryXAxisMajorGridLines; + + /**Options for customizing the major tick lines. + */ + majorTickLines?: PrimaryXAxisMajorTickLines; + + /**Maximum number of labels to be displayed in every 100 pixels. + * @Default {3} + */ + maximumLabels?: number; + + /**Maximum width of the axis label. When the label exceeds the width, the label gets trimmed when the enableTrim is set to true. + * @Default {34} + */ + maximumLabelWidth?: number; + + /**Options for customizing the minor grid lines. + */ + minorGridLines?: PrimaryXAxisMinorGridLines; + + /**Options for customizing the minor tick lines. + */ + minorTickLines?: PrimaryXAxisMinorTickLines; + + /**Specifies the number of minor ticks per interval. + * @Default {null} + */ + minorTicksPerInterval?: number; + + /**Unique name of the axis. To associate an axis with the series, you have to set this name to the xAxisName/yAxisName property of the series. + * @Default {null} + */ + name?: string; + + /**Specifies whether to render the axis at the opposite side of its default position. + * @Default {false} + */ + opposedPosition?: boolean; + + /**Specifies the padding for the plot area. + * @Default {10} + */ + plotOffset?: number; + + /**Options to customize the range of the axis. + */ + range?: PrimaryXAxisRange; + + /**Specifies the padding for the axis range. + * @Default {None. See RangePadding} + */ + rangePadding?: ej.datavisualization.Chart.RangePadding|string; + + /**Rounds the number to the given number of decimals. + * @Default {null} + */ + roundingPlaces?: number; + + /**Options for customizing the strip lines. + * @Default {[ ]} + */ + stripLine?: Array; + + /**Specifies the position of the axis tick lines. + * @Default {outside. See TickLinesPosition} + */ + tickLinesPosition?: ej.datavisualization.Chart.TickLinesPosition|string; + + /**Options for customizing the axis title. + */ + title?: PrimaryXAxisTitle; + + /**Specifies the type of data the axis is handling. + * @Default {null. See ValueType} + */ + valueType?: ej.datavisualization.Chart.ValueType|string; + + /**Show/hides the axis. + * @Default {true} + */ + visible?: boolean; + + /**The axis is scaled by this factor. When zoomFactor is 0.5, the chart is scaled by 200% along this axis. Value ranges from 0 to 1. + * @Default {1} + */ + zoomFactor?: number; + + /**Position of the zoomed axis. Value ranges from 0 to 1. + * @Default {0} + */ + zoomPosition?: number; +} + +export interface PrimaryYAxisAlternateGridBandEven { + + /**Fill color for the even grid bands. + * @Default {transparent} + */ + fill?: string; + + /**Opacity of the even grid band. + * @Default {1} + */ + opacity?: number; +} + +export interface PrimaryYAxisAlternateGridBandOdd { + + /**Fill color of the odd grid bands. + * @Default {transparent} + */ + fill?: string; + + /**Opacity of odd grid band. + * @Default {1} + */ + opacity?: number; +} + +export interface PrimaryYAxisAlternateGridBand { + + /**Options for customizing even grid band. + */ + even?: PrimaryYAxisAlternateGridBandEven; + + /**Options for customizing odd grid band. + */ + odd?: PrimaryYAxisAlternateGridBandOdd; +} + +export interface PrimaryYAxisAxisLine { + + /**Pattern of dashes and gaps to be applied to the axis line. + * @Default {null} + */ + dashArray?: string; + + /**Padding for axis line. Normally, it is used along with plotOffset to pad the plot area. + * @Default {null} + */ + offset?: number; + + /**Show/hides the axis line. + * @Default {true} + */ + visible?: boolean; + + /**Width of axis line. + * @Default {1} + */ + width?: number; +} + +export interface PrimaryYAxisCrosshairLabel { + + /**Show/hides the crosshair label associated with this axis. + * @Default {false} + */ + visible?: boolean; +} + +export interface PrimaryYAxisFont { + + /**Font family of labels. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Font style of labels. + * @Default {ej.datavisualization.Chart.FontStyle.Normal. See FontStyle} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Font weight of the label. + * @Default {ej.datavisualization.Chart.FontWeight.Regular. See FontWeight} + */ + fontWeight?: ej.datavisualization.Chart.FontWeight|string; + + /**Opacity of the axis labels. + * @Default {1} + */ + opacity?: number; + + /**Font size of the axis labels. + * @Default {13px} + */ + size?: string; +} + +export interface PrimaryYAxisMajorGridLines { + + /**Pattern of dashes and gaps used to stroke the major grid lines. + * @Default {null} + */ + dashArray?: string; + + /**Opacity of major grid lines. + * @Default {1} + */ + opacity?: number; + + /**Show/hides the major grid lines. + * @Default {true} + */ + visible?: boolean; + + /**Width of the major grid lines. + * @Default {1} + */ + width?: number; +} + +export interface PrimaryYAxisMajorTickLines { + + /**Length of the major tick lines. + * @Default {5} + */ + size?: number; + + /**Show/hides the major tick lines. + * @Default {true} + */ + visible?: boolean; + + /**Width of the major tick lines. + * @Default {1} + */ + width?: number; +} + +export interface PrimaryYAxisMinorGridLines { + + /**Patterns of dashes and gaps used to stroke the minor grid lines. + * @Default {null} + */ + dashArray?: string; + + /**Show/hides the minor grid lines. + * @Default {true} + */ + visible?: boolean; + + /**Width of the minorGridLines. + * @Default {1} + */ + width?: number; +} + +export interface PrimaryYAxisMinorTickLines { + + /**Length of the minor tick lines. + * @Default {5} + */ + size?: number; + + /**Show/hides the minor tick lines. + * @Default {true} + */ + visible?: boolean; + + /**Width of the minor tick line + * @Default {1} + */ + width?: number; +} + +export interface PrimaryYAxisStripLineFont { + + /**Font color of the strip line text. + * @Default {black} + */ + color?: string; + + /**Font family of the strip line text. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Font style of the strip line text. + * @Default {Normal} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Font weight of the strip line text. + * @Default {regular} + */ + fontWeight?: string; + + /**Opacity of the strip line text. + * @Default {1} + */ + opacity?: number; + + /**Font size of the strip line text. + * @Default {12px} + */ + size?: string; +} + +export interface PrimaryYAxisStripLine { + + /**Border color of the strip line. + * @Default {gray} + */ + borderColor?: string; + + /**Background color of the strip line. + * @Default {gray} + */ + color?: string; + + /**End value of the strip line. + * @Default {null} + */ + end?: number; + + /**Options for customizing the font of the text. + */ + font?: PrimaryYAxisStripLineFont; + + /**Start value of the strip line. + * @Default {null} + */ + start?: number; + + /**Indicates whether to render the strip line from the minimum/start value of the axis. This property won’t work when start property is set. + * @Default {false} + */ + startFromAxis?: boolean; + + /**Specifies text to be displayed inside the strip line. + * @Default {stripLine} + */ + text?: string; + + /**Specifies the alignment of the text inside the strip line. + * @Default {middlecenter. See TextAlignment} + */ + textAlignment?: ej.datavisualization.Chart.TextAlignment|string; + + /**Show/hides the strip line. + * @Default {false} + */ + visible?: boolean; + + /**Width of the strip line. + * @Default {0} + */ + width?: number; + + /**Specifies the order in which strip line and the series have to be rendered. When zOrder is “behind”, strip line is rendered below the series and when it is “over”, it is rendered above the series. + * @Default {over. See ZIndex} + */ + zIndex?: ej.datavisualization.Chart.ZIndex|string; +} + +export interface PrimaryYAxisTitleFont { + + /**Font family of the title text. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Font style of the title text. + * @Default {ej.datavisualization.Chart.FontStyle.Normal} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Font weight of the title text. + * @Default {ej.datavisualization.Chart.FontWeight.Regular. See FontWeight} + */ + fontWeight?: ej.datavisualization.Chart.FontWeight|string; + + /**Opacity of the axis title text. + * @Default {1} + */ + opacity?: number; + + /**Font size of the axis title. + * @Default {16px} + */ + size?: string; +} + +export interface PrimaryYAxisTitle { + + /**Specifies whether to trim the axis title when it exceeds the chart area or the maximum width of the title. + * @Default {ej.datavisualization.Chart.enableTrim} + */ + enableTrim?: boolean; + + /**Options for customizing the title font. + */ + font?: PrimaryYAxisTitleFont; + + /**Maximum width of the title, when the title exceeds this width, the title gets trimmed, when enableTrim is true. + * @Default {ej.datavisualization.Chart.maximumTitleWidth.null} + */ + maximumTitleWidth?: number; + + /**Title for the axis. + */ + text?: string; + + /**Controls the visibility of axis title. + * @Default {true} + */ + visible?: boolean; +} + +export interface PrimaryYAxis { + + /**Options for customizing vertical axis alternate grid band. + */ + alternateGridBand?: PrimaryYAxisAlternateGridBand; + + /**Options for customizing the axis line. + */ + axisLine?: PrimaryYAxisAxisLine; + + /**Options to customize the crosshair label. + */ + crosshairLabel?: PrimaryYAxisCrosshairLabel; + + /**With this setting, you can request axis to calculate intervals approximately equal to your desired interval. + * @Default {null} + */ + desiredIntervals?: number; + + /**Specifies the position of labels at the edge of the axis. + * @Default {ej.datavisualization.Chart.EdgeLabelPlacement.None. See EdgeLabelPlacement} + */ + edgeLabelPlacement?: ej.datavisualization.Chart.EdgeLabelPlacement|string; + + /**Specifies whether to trim the axis label when the width of the label exceeds the maximumLabelWidth. + * @Default {false} + */ + enableTrim?: boolean; + + /**Options for customizing the font of the axis Labels. + */ + font?: PrimaryYAxisFont; + + /**Specifies the type of interval in date time axis. + * @Default {null. See IntervalType} + */ + intervalType?: ej.datavisualization.Chart.IntervalType|string; + + /**Specifies whether to inverse the axis. + * @Default {false} + */ + isInversed?: boolean; + + /**Custom formatting for axis label and supports all standard formatting type of numerical and date time values. + * @Default {null} + */ + labelFormat?: string; + + /**Specifies the action to take when the axis labels are overlapping with each other. + * @Default {ej.datavisualization.Chart.LabelIntersectAction.None} + */ + labelIntersectAction?: ej.datavisualization.Chart.LabelIntersectAction|string; + + /**Default Value + * @Default {outside. See LabelPosition} + */ + labelPosition?: ej.datavisualization.Chart.LabelPosition|string; + + /**Logarithmic base value. This is applicable only for logarithmic axis. + * @Default {10} + */ + logBase?: number; + + /**Options for customizing major gird lines. + */ + majorGridLines?: PrimaryYAxisMajorGridLines; + + /**Options for customizing the major tick lines. + */ + majorTickLines?: PrimaryYAxisMajorTickLines; + + /**Maximum number of labels to be displayed in every 100 pixels. + * @Default {3} + */ + maximumLabels?: number; + + /**Maximum width of the axis label. When the label exceeds the width, the label gets trimmed when the enableTrim is set to true. + * @Default {ej.datavisualization.Chart.maximumLabelWidth type {int}} + */ + maximumLabelWidth?: number; + + /**Options for customizing the minor grid lines. + */ + minorGridLines?: PrimaryYAxisMinorGridLines; + + /**Options for customizing the minor tick lines. + */ + minorTickLines?: PrimaryYAxisMinorTickLines; + + /**Specifies the number of minor ticks per interval. + * @Default {null} + */ + minorTicksPerInterval?: number; + + /**Unique name of the axis. To associate an axis with the series, you have to set this name to the xAxisName/yAxisName property of the series. + * @Default {null} + */ + name?: string; + + /**Specifies whether to render the axis at the opposite side of its default position. + * @Default {false} + */ + opposedPosition?: boolean; + + /**Specifies the padding for the plot area. + * @Default {10} + */ + plotOffset?: number; + + /**Specifies the padding for the axis range. + * @Default {ej.datavisualization.Chart.RangePadding.None. See RangePadding} + */ + rangePadding?: ej.datavisualization.Chart.RangePadding|string; + + /**Rounds the number to the given number of decimals. + * @Default {null} + */ + roundingPlaces?: number; + + /**Specifies the index of the row to which the axis is associated, when the chart area is divided into multiple plot areas by using rowDefinitions. + * @Default {null} + */ + rowIndex?: number; + + /**Specifies the number of row or plot areas an axis has to span vertically. + * @Default {null} + */ + rowSpan?: number; + + /**Options for customizing the strip lines. + * @Default {[ ]} + */ + stripLine?: Array; + + /**Specifies the position of the axis tick lines. + * @Default {outside. See TickLinesPosition} + */ + tickLinesPosition?: ej.datavisualization.Chart.TickLinesPosition|string; + + /**Options for customizing the axis title. + */ + title?: PrimaryYAxisTitle; + + /**Specifies the type of data the axis is handling. + * @Default {null. See ValueType} + */ + valueType?: ej.datavisualization.Chart.ValueType|string; + + /**Show/hides the axis. + * @Default {true} + */ + visible?: boolean; + + /**The axis is scaled by this factor. When zoomFactor is 0.5, the chart is scaled by 200% along this axis. Values ranges from 0 to 1. + * @Default {1} + */ + zoomFactor?: number; + + /**Position of the zoomed axis. Value ranges from 0 to 1 + * @Default {0} + */ + zoomPosition?: number; +} + +export interface RowDefinitions { + + /**Specifies the unit to measure the height of the row in plotting area. + * @Default {'pixel'. See Unit} + */ + unit?: ej.datavisualization.Chart.Unit|string; + + /**Height of the row in plotting area. Height is measured in either pixel or percentage based on the value of unit property. + * @Default {50} + */ + rowHeight?: number; + + /**Color of the line that indicates the starting point of the row in plotting area. + * @Default {transparent} + */ + lineColor?: string; + + /**Width of the line that indicates the starting point of the row in plot area. + * @Default {1} + */ + lineWidth?: number; +} + +export interface SeriesBorder { + + /**Border color of the series. + * @Default {transparent} + */ + color?: string; + + /**Border width of the series. + * @Default {1} + */ + width?: number; + + /**DashArray for border of the series. + * @Default {null} + */ + dashArray?: string; +} + +export interface SeriesFont { + + /**Font color of the series text. + * @Default {#707070} + */ + color?: string; + + /**Font Family of the series. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Font Style of the series. + * @Default {Normal} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Font weight of the series. + * @Default {Regular} + */ + fontWeight?: ej.datavisualization.Chart.FontWeight|string; + + /**Opacity of series text. + * @Default {1} + */ + opacity?: number; + + /**Size of the series text. + * @Default {12px} + */ + size?: string; +} + +export interface SeriesMarkerBorder { + + /**Border color of the marker shape. + * @Default {white} + */ + color?: string; + + /**Border width of the marker shape. + * @Default {3} + */ + width?: number; +} + +export interface SeriesMarkerDataLabelBorder { + + /**Border color of the data label. + * @Default {null} + */ + color?: string; + + /**Border width of the data label. + * @Default {0.1} + */ + width?: number; +} + +export interface SeriesMarkerDataLabelConnectorLine { + + /**Specifies when the connector has to be drawn as Bezier curve or straight line. This is applicable only for Pie and Doughnut chart types. + * @Default {line. See ConnectorLineType} + */ + type?: ej.datavisualization.Chart.Type|string; + + /**Width of the connector. + * @Default {0.5} + */ + width?: number; +} + +export interface SeriesMarkerDataLabelFont { + + /**Font family of the data label. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Font style of the data label. + * @Default {normal. See FontStyle} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Font weight of the data label. + * @Default {regular. See FontWeight} + */ + fontWeight?: ej.datavisualization.Chart.FontWeight|string; + + /**Opacity of the text. + * @Default {1} + */ + opacity?: number; + + /**Font size of the data label. + * @Default {12px} + */ + size?: string; +} + +export interface SeriesMarkerDataLabelMargin { + + /**Bottom margin of the text. + * @Default {5} + */ + bottom?: number; + + /**Left margin of the text. + * @Default {5} + */ + left?: number; + + /**Right margin of the text. + * @Default {5} + */ + right?: number; + + /**Top margin of the text. + * @Default {5} + */ + top?: number; +} + +export interface SeriesMarkerDataLabel { + + /**Angle of the data label in degrees. Only the text gets rotated, whereas the background and border does not rotate. + * @Default {null} + */ + angle?: number; + + /**Options for customizing the border of the data label. + */ + border?: SeriesMarkerDataLabelBorder; + + /**Options for displaying and customizing the line that connects point and data label. + */ + connectorLine?: SeriesMarkerDataLabelConnectorLine; + + /**Background color of the data label. + * @Default {null} + */ + fill?: string; + + /**Options for customizing the data label font. + */ + font?: SeriesMarkerDataLabelFont; + + /**Horizontal alignment of the data label. + * @Default {center} + */ + horizontalTextAlignment?: ej.datavisualization.Chart.HorizontalTextAlignment|string; + + /**Margin of the text to its background shape. The size of the background shape increases based on the margin applied to its text. + */ + margin?: SeriesMarkerDataLabelMargin; + + /**Opacity of the data label. + * @Default {1} + */ + opacity?: number; + + /**Background shape of the data label. + * @Default {No shape is rendered by default, so its value is ‘none’. See Shape} + */ + shape?: ej.datavisualization.Chart.Shape|string; + + /**Name of a field in data source where datalabel text is displayed. + */ + textMappingName?: string; + + /**Specifies the position of the data label. This property can be used only for the series such as column, bar, stacked column, stacked bar, 100% stacked column, 100% stacked bar, candle and OHLC. + * @Default {top. See TextPosition} + */ + textPosition?: ej.datavisualization.Chart.TextPosition|string; + + /**Vertical alignment of the data label. + * @Default {'center'} + */ + verticalTextAlignment?: ej.datavisualization.Chart.VerticalTextAlignment|string; + + /**Controls the visibility of the data labels. + * @Default {false} + */ + visible?: boolean; + + /**Custom template to format the data label content. Use “point.x” and “point.y” as a placeholder text to display the corresponding data point’s x and y value. + */ + template?: string; + + /**Moves the label vertically by some offset. + * @Default {0} + */ + offset?: number; +} + +export interface SeriesMarkerSize { + + /**Height of the marker. + * @Default {6} + */ + height?: number; + + /**Width of the marker. + * @Default {6} + */ + width?: number; +} + +export interface SeriesMarker { + + /**Options for customizing the border of the marker shape. + */ + border?: SeriesMarkerBorder; + + /**Options for displaying and customizing data labels. + */ + dataLabel?: SeriesMarkerDataLabel; + + /**Color of the marker shape. + * @Default {null} + */ + fill?: string; + + /**The URL for the Image that is to be displayed as marker. In order to display image as marker, set series.marker.shape as ‘image’. + */ + imageUrl?: string; + + /**Opacity of the marker. + * @Default {1} + */ + opacity?: number; + + /**Specifies the shape of the marker. + * @Default {circle. See Shape} + */ + shape?: ej.datavisualization.Chart.Shape|string; + + /**Options for customizing the size of the marker shape. + */ + size?: SeriesMarkerSize; + + /**Controls the visibility of the marker shape. + * @Default {false} + */ + visible?: boolean; +} + +export interface SeriesEmptyPointSettingsStyleBorder { + + /**Border color of the empty point. + */ + color?: string; + + /**Border width of the empty point. + * @Default {1} + */ + width?: number; +} + +export interface SeriesEmptyPointSettingsStyle { + + /**Color of the empty point. + */ + color?: string; + + /**Options for customizing border of the empty point in the series. + */ + border?: SeriesEmptyPointSettingsStyleBorder; +} + +export interface SeriesEmptyPointSettings { + + /**Controls the visibility of the empty point. + * @Default {true} + */ + visible?: boolean; + + /**Specifies the mode of empty point. + * @Default {gap} + */ + displayMode?: ej.datavisualization.Chart.EmptyPointMode|string; + + /**Options for customizing the color and border of the empty point in the series. + */ + style?: SeriesEmptyPointSettingsStyle; +} + +export interface SeriesConnectorLine { + + /**Width of the connector line. + * @Default {1} + */ + width?: number; + + /**Color of the connector line. + * @Default {#565656} + */ + color?: string; + + /**DashArray of the connector line. + * @Default {null} + */ + dashArray?: string; + + /**DashArray of the connector line. + * @Default {1} + */ + opacity?: number; +} + +export interface SeriesErrorBarCap { + + /**Show/Hides the error bar cap. + * @Default {true} + */ + visible?: boolean; + + /**Width of the error bar cap. + * @Default {1} + */ + width?: number; + + /**Length of the error bar cap. + * @Default {1} + */ + length?: number; + + /**Color of the error bar cap. + * @Default {#000000} + */ + fill?: string; +} + +export interface SeriesErrorBar { + + /**Show/hides the error bar + * @Default {visible} + */ + visibility?: boolean; + + /**Specifies the type of error bar. + * @Default {FixedValue} + */ + type?: ej.datavisualization.Chart.ErrorBarType|string; + + /**Specifies the mode of error bar. + * @Default {vertical} + */ + mode?: ej.datavisualization.Chart.ErrorBarMode|string; + + /**Specifies the direction of error bar. + * @Default {both} + */ + direction?: ej.datavisualization.Chart.ErrorBarDirection|string; + + /**Value of vertical error bar. + * @Default {3} + */ + verticalErrorValue?: number; + + /**Value of horizontal error bar. + * @Default {1} + */ + horizontalErrorValue?: number; + + /**Value of positive horizontal error bar. + * @Default {1} + */ + horizontalPositiveErrorValue?: number; + + /**Value of negative horizontal error bar. + * @Default {1} + */ + horizontalNegativeErrorValue?: number; + + /**Value of positive vertical error bar. + * @Default {5} + */ + verticalPositiveErrorValue?: number; + + /**Value of negative vertical error bar. + * @Default {5} + */ + verticalNegativeErrorValue?: number; + + /**Fill color of the error bar. + * @Default {#000000} + */ + fill?: string; + + /**Width of the error bar. + * @Default {1} + */ + width?: number; + + /**Options for customizing the error bar cap. + */ + cap?: SeriesErrorBarCap; +} + +export interface SeriesPointsBorder { + + /**Border color of the point. + * @Default {null} + */ + color?: string; + + /**Border width of the point. + * @Default {null} + */ + width?: number; +} + +export interface SeriesPointsMarkerBorder { + + /**Border color of the marker shape. + * @Default {white} + */ + color?: string; + + /**Border width of the marker shape. + * @Default {3} + */ + width?: number; +} + +export interface SeriesPointsMarkerDataLabelBorder { + + /**Border color of the data label. + * @Default {null} + */ + color?: string; + + /**Border width of the data label. + * @Default {0.1} + */ + width?: number; +} + +export interface SeriesPointsMarkerDataLabelConnectorLine { + + /**Specifies when the connector has to be drawn as Bezier curve or straight line. This is applicable only for Pie and Doughnut chart types. + * @Default {line. See ConnectorLineType} + */ + type?: ej.datavisualization.Chart.ConnectorLineType|string; + + /**Width of the connector. + * @Default {0.5} + */ + width?: number; +} + +export interface SeriesPointsMarkerDataLabelFont { + + /**Font family of the data label. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Font style of the data label. + * @Default {normal. See FontStyle} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Font weight of the data label. + * @Default {regular. See FontWeight} + */ + fontWeight?: ej.datavisualization.Chart.FontWeight|string; + + /**Opacity of the text. + * @Default {1} + */ + opacity?: number; + + /**Font size of the data label. + * @Default {12px} + */ + size?: string; +} + +export interface SeriesPointsMarkerDataLabelMargin { + + /**Bottom margin of the text. + * @Default {5} + */ + bottom?: number; + + /**Left margin of the text. + * @Default {5} + */ + left?: number; + + /**Right margin of the text. + * @Default {5} + */ + right?: number; + + /**Top margin of the text. + * @Default {5} + */ + top?: number; +} + +export interface SeriesPointsMarkerDataLabel { + + /**Angle of the data label in degrees. Only the text gets rotated, whereas the background and border does not rotate. + * @Default {null} + */ + angle?: number; + + /**Options for customizing the border of the data label. + */ + border?: SeriesPointsMarkerDataLabelBorder; + + /**Options for displaying and customizing the line that connects point and data label. + */ + connectorLine?: SeriesPointsMarkerDataLabelConnectorLine; + + /**Background color of the data label. + * @Default {null} + */ + fill?: string; + + /**Options for customizing the data label font. + */ + font?: SeriesPointsMarkerDataLabelFont; + + /**Horizontal alignment of the data label. + * @Default {center} + */ + horizontalTextAlignment?: ej.datavisualization.Chart.HorizontalTextAlignment|string; + + /**Margin of the text to its background shape. The size of the background shape increases based on the margin applied to its text. + */ + margin?: SeriesPointsMarkerDataLabelMargin; + + /**Opacity of the data label. + * @Default {1} + */ + opacity?: number; + + /**Background shape of the data label. + * @Default {No shape is rendered by default, so its value is ‘none’. See Shape} + */ + shape?: ej.datavisualization.Chart.Shape|string; + + /**Specifies the position of the data label. This property can be used only for the series such as column, bar, stacked column, stacked bar, 100% stacked column, 100% stacked bar, candle and OHLC. + * @Default {top. See TextPosition} + */ + textPosition?: ej.datavisualization.Chart.TextPosition|string; + + /**Vertical alignment of the data label. + * @Default {'center'} + */ + verticalTextAlignment?: ej.datavisualization.Chart.VerticalTextAlignment|string; + + /**Controls the visibility of the data labels. + * @Default {false} + */ + visible?: boolean; + + /**Custom template to format the data label content. Use “point.x” and “point.y” as a placeholder text to display the corresponding data point’s x and y value. + */ + template?: string; + + /**Moves the label vertically by specified offset. + * @Default {0} + */ + offset?: number; +} + +export interface SeriesPointsMarkerSize { + + /**Height of the marker. + * @Default {6} + */ + height?: number; + + /**Width of the marker. + * @Default {6} + */ + width?: number; +} + +export interface SeriesPointsMarker { + + /**Options for customizing the border of the marker shape. + */ + border?: SeriesPointsMarkerBorder; + + /**Options for displaying and customizing data label. + */ + dataLabel?: SeriesPointsMarkerDataLabel; + + /**Color of the marker shape. + * @Default {null} + */ + fill?: string; + + /**The URL for the Image that is to be displayed as marker. In order to display image as marker, set series.marker.shape as ‘image’. + */ + imageUrl?: string; + + /**Opacity of the marker. + * @Default {1} + */ + opacity?: number; + + /**Specifies the shape of the marker. + * @Default {circle. See Shape} + */ + shape?: ej.datavisualization.Chart.Shape|string; + + /**Options for customizing the size of the marker shape. + */ + size?: SeriesPointsMarkerSize; + + /**Controls the visibility of the marker shape. + * @Default {false} + */ + visible?: boolean; +} + +export interface SeriesPoints { + + /**Options for customizing the border of a point. This is applicable only for column type series and accumulation type series. + */ + border?: SeriesPointsBorder; + + /**To show/hide the intermediate summary from the last intermediate point. + * @Default {false} + */ + showIntermediateSum?: boolean; + + /**To show/hide the total summary of the waterfall series. + * @Default {false} + */ + showTotalSum?: boolean; + + /**Close value of the point. Close value is applicable only for financial type series. + * @Default {null} + */ + close?: number; + + /**Size of a bubble in the bubble series. This is applicable only for the bubble series. + * @Default {null} + */ + size?: number; + + /**Background color of the point. This is applicable only for column type series and accumulation type series. + * @Default {null} + */ + fill?: string; + + /**High value of the point. High value is applicable only for financial type series, range area series and range column series. + * @Default {null} + */ + high?: number; + + /**Low value of the point. Low value is applicable only for financial type series, range area series and range column series. + * @Default {null} + */ + low?: number; + + /**Options for displaying and customizing marker for a data point. Marker contains shapes and/or data labels. + */ + marker?: SeriesPointsMarker; + + /**Open value of the point. This is applicable only for financial type series. + * @Default {null} + */ + open?: number; + + /**Datalabel text for the point. + * @Default {null} + */ + text?: string; + + /**X value of the point. + * @Default {null} + */ + x?: number; + + /**Y value of the point. + * @Default {null} + */ + y?: number; +} + +export interface SeriesTooltipBorder { + + /**Border Color of the tooltip. + * @Default {null} + */ + color?: string; + + /**Border Width of the tooltip. + * @Default {1} + */ + width?: number; +} + +export interface SeriesTooltip { + + /**Options for customizing the border of the tooltip. + */ + border?: SeriesTooltipBorder; + + /**Customize the corner radius of the tooltip rectangle. + * @Default {0} + */ + rx?: number; + + /**Customize the corner radius of the tooltip rectangle. + * @Default {0} + */ + ry?: number; + + /**Specifies the duration, the tooltip has to be displayed. + * @Default {500ms} + */ + duration?: string; + + /**Enables/disables the animation of the tooltip when moving from one point to another. + * @Default {true} + */ + enableAnimation?: boolean; + + /**Background color of the tooltip. + * @Default {null} + */ + fill?: string; + + /**Format of the tooltip content. + * @Default {#point.x# : #point.y#} + */ + format?: string; + + /**Opacity of the tooltip. + * @Default {0.95} + */ + opacity?: number; + + /**Custom template to format the tooltip content. Use “point.x” and “point.y” as a placeholder text to display the corresponding data point’s x and y value. + * @Default {null} + */ + template?: string; + + /**Controls the visibility of the tooltip. + * @Default {false} + */ + visible?: boolean; +} + +export interface SeriesTrendlines { + + /**Show/hides the trendline. + */ + visibility?: boolean; + + /**Specifies the type of trendline for the series. + * @Default {linear. See TrendlinesType} + */ + type?: string; + + /**Name for the trendlines that is to be displayed in legend text. + * @Default {Trendline} + */ + name?: string; + + /**Fill color of the trendlines. + * @Default {#0000FF} + */ + fill?: string; + + /**Width of the trendlines. + * @Default {1} + */ + width?: number; + + /**Opacity of the trendline. + * @Default {1} + */ + opacity?: number; + + /**Pattern of dashes and gaps used to stroke the trendline. + */ + dashArray?: string; + + /**Future trends of the current series. + * @Default {0} + */ + forwardForecast?: number; + + /**Past trends of the current series. + * @Default {0} + */ + backwardForecast?: number; + + /**Specifies the order of polynomial trendlines. + * @Default {0} + */ + polynomialOrder?: number; + + /**Specifies the moving average starting period value. + * @Default {2} + */ + period?: number; +} + +export interface SeriesHighlightSettingsBorder { + + /**Border color of the series/point on highlight. + */ + color?: string; + + /**Border width of the series/point on highlight. + * @Default {2} + */ + width?: string; +} + +export interface SeriesHighlightSettings { + + /**Enables/disables the ability to highlight series or data point interactively. + * @Default {false} + */ + enable?: boolean; + + /**Specifies whether series or data point has to be highlighted. + * @Default {series. See Mode} + */ + mode?: ej.datavisualization.Chart.Mode|string; + + /**Color of the series/point on highlight. + */ + color?: string; + + /**Opacity of the series/point on highlight. + * @Default {0.6} + */ + opacity?: number; + + /**Options for customizing the border of series on highlight. + */ + border?: SeriesHighlightSettingsBorder; + + /**Specifies the pattern for the series/point on highlight. + * @Default {none. See Pattern} + */ + pattern?: string; + + /**Custom pattern for the series on highlight. + */ + customPattern?: string; +} + +export interface SeriesSelectionSettingsBorder { + + /**Border color of the series/point on selection. + */ + color?: string; + + /**Border width of the series/point on selection. + * @Default {2} + */ + width?: string; +} + +export interface SeriesSelectionSettings { + + /**Enables/disables the ability to select a series/data point interactively. + * @Default {false} + */ + enable?: boolean; + + /**Specifies whether series or data point has to be selected. + * @Default {series. See Mode} + */ + mode?: ej.datavisualization.Chart.Mode|string; + + /**Specifies the type of selection. + * @Default {single} + */ + type?: ej.datavisualization.Chart.SelectionType|string; + + /**Color of the series/point on selection. + */ + color?: string; + + /**Opacity of the series/point on selection. + * @Default {0.6} + */ + opacity?: number; + + /**Options for customizing the border of series on selection. + */ + border?: SeriesSelectionSettingsBorder; + + /**Specifies the pattern for the series/point on selection. + * @Default {none. See Pattern} + */ + pattern?: string; + + /**Custom pattern for the series on selection. + */ + customPattern?: string; +} + +export interface Series { + + /**Color of the point, where the close is up in financial chart. + * @Default {null} + */ + bearFillColor?: string; + + /**Options for customizing the border of the series. + */ + border?: SeriesBorder; + + /**Color of the point, where the close is down in financial chart. + * @Default {null} + */ + bullFillColor?: string; + + /**Pattern of dashes and gaps used to stroke the line type series. + */ + dashArray?: string; + + /**Specifies the dataSource for the series. It can be an array of JSON objects or an instance of ej.DataManager. + * @Default {null} + */ + dataSource?: any; + + /**Controls the size of the hole in doughnut series. Value ranges from 0 to 1. + * @Default {0.4} + */ + doughnutCoefficient?: number; + + /**Controls the size of the doughnut series. Value ranges from 0 to 1. + * @Default {0.8} + */ + doughnutSize?: number; + + /**Type of series to be drawn in radar or polar series. + * @Default {line. See DrawType} + */ + drawType?: boolean; + + /**Enable/disable the animation of series. + * @Default {false} + */ + enableAnimation?: boolean; + + /**To avoid overlapping of data labels smartly. + * @Default {null} + */ + enableSmartLabels?: number; + + /**End angle of pie/doughnut series. For a complete circle, it has to be 360, by default. + * @Default {null} + */ + endAngle?: number; + + /**Explodes the pie/doughnut slices on mouse move. + * @Default {false} + */ + explode?: boolean; + + /**Explodes all the slice of pie/doughnut on render. + * @Default {null} + */ + explodeAll?: boolean; + + /**Index of the point to be exploded from pie/doughnut/pyramid/funnel. + * @Default {null} + */ + explodeIndex?: number; + + /**Specifies the distance of the slice from the center, when it is exploded. + * @Default {25} + */ + explodeOffset?: number; + + /**Fill color of the series. + * @Default {null} + */ + fill?: string; + + /**Options for customizing the series font. + */ + font?: SeriesFont; + + /**Specifies the height of the funnel in funnel series. Values can be in both pixel and percentage. + * @Default {32.7%} + */ + funnelHeight?: string; + + /**Specifies the width of the funnel in funnel series. Values can be in both pixel and percentage. + * @Default {11.6%} + */ + funnelWidth?: string; + + /**Gap between the slices of pyramid/funnel series. + * @Default {0} + */ + gapRatio?: number; + + /**Specifies whether to join start and end point of a line/area series used in polar/radar chart to form a closed path. + * @Default {true} + */ + isClosed?: boolean; + + /**Specifies whether to stack the column series in polar/radar charts. + * @Default {true} + */ + isStacking?: boolean; + + /**Renders the chart vertically. This is applicable only for cartesian type series. + * @Default {false} + */ + isTransposed?: boolean; + + /**Position of the data label in pie/doughnut/pyramid/funnel series. OutsideExtended position is not applicable for pyramid/funnel. + * @Default {inside. See LabelPosition} + */ + labelPosition?: ej.datavisualization.Chart.LabelPosition|string; + + /**Specifies the line cap of the series. + * @Default {Butt. See LineCap} + */ + lineCap?: ej.datavisualization.Chart.LineCap|string; + + /**Specifies the type of shape to be used where two lines meet. + * @Default {Round. See LineJoin} + */ + lineJoin?: ej.datavisualization.Chart.LineJoin|string; + + /**Options for displaying and customizing marker for individual point in a series. Marker contains shapes and/or data labels. + */ + marker?: SeriesMarker; + + /**Opacity of the series. + * @Default {1} + */ + opacity?: number; + + /**Name of a field in data source where fill color for all the data points is generated. + */ + palette?: string; + + /**Controls the size of pie series. Value ranges from 0 to 1. + * @Default {0.8} + */ + pieCoefficient?: number; + + /**Options for customizing the empty point in the series. + */ + emptyPointSettings?: SeriesEmptyPointSettings; + + /**Fill color for the positive column of the waterfall. + * @Default {null} + */ + positiveFill?: string; + + /**Options for customizing the waterfall connector line. + */ + connectorLine?: SeriesConnectorLine; + + /**Options to customize the error bar in series. + */ + errorBar?: SeriesErrorBar; + + /**Option to add data points; each point should have x and y property. Also, optionally, you can customize the points color, border, marker by using fill, border and marker options. + */ + points?: Array; + + /**Specifies the mode of the pyramid series. + * @Default {linear} + */ + pyramidMode?: ej.datavisualization.Chart.PyramidMode|string; + + /**Specifies ej.Query to select data from dataSource. This property is applicable only when the dataSource is ej.DataManager. + * @Default {null} + */ + query?: any; + + /**Start angle from where the pie/doughnut series renders. It starts from 0, by default. + * @Default {null} + */ + startAngle?: number; + + /**Options for customizing the tooltip of chart. + */ + tooltip?: SeriesTooltip; + + /**Specifies the type of the series to render in chart. + * @Default {column. see Type} + */ + type?: ej.datavisualization.Chart.Type|string; + + /**Controls the visibility of the series. + * @Default {visible} + */ + visibility?: string; + + /**Specifies the name of the x-axis that has to be associated with this series. Add an axis instance with this name to axes collection. + * @Default {null} + */ + xAxisName?: string; + + /**Name of the property in the datasource that contains x value for the series. + * @Default {null} + */ + xName?: string; + + /**Specifies the name of the y-axis that has to be associated with this series. Add an axis instance with this name to axes collection. + * @Default {null} + */ + yAxisName?: string; + + /**Name of the property in the datasource that contains y value for the series. + * @Default {null} + */ + yName?: string; + + /**Name of the property in the datasource that contains high value for the series. + * @Default {null} + */ + high?: string; + + /**Name of the property in the datasource that contains low value for the series. + * @Default {null} + */ + low?: string; + + /**Name of the property in the datasource that contains open value for the series. + * @Default {null} + */ + open?: string; + + /**Name of the property in the datasource that contains close value for the series. + * @Default {null} + */ + close?: string; + + /**Name of the property in the datasource that contains the size value for the bubble series. + * @Default {null} + */ + size?: string; + + /**Option to add trendlines to chart. + */ + trendlines?: Array; + + /**Options for customizing the appearance of the series or data point while highlighting. + */ + highlightSettings?: SeriesHighlightSettings; + + /**Options for customizing the appearance of the series/data point on selection. + */ + selectionSettings?: SeriesSelectionSettings; +} + +export interface Size { + + /**Height of the Chart. Height can be specified in either pixel or percentage. + * @Default {'450'} + */ + height?: string; + + /**Width of the Chart. Width can be specified in either pixel or percentage. + * @Default {'450'} + */ + width?: string; +} + +export interface TitleBorder { + + /**Width of the title border. + * @Default {1} + */ + width?: number; + + /**color of the title border. + * @Default {transparent} + */ + color?: string; + + /**opacity of the title border. + * @Default {0.8} + */ + opacity?: number; + + /**opacity of the title border. + * @Default {0.8} + */ + cornerRadius?: number; +} + +export interface TitleFont { + + /**Font family for Chart title. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Font style for Chart title. + * @Default {Normal. See FontStyle} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Font weight for Chart title. + * @Default {Regular. See FontWeight} + */ + fontWeight?: ej.datavisualization.Chart.FontWeight|string; + + /**Opacity of the Chart title. + * @Default {0.5} + */ + opacity?: number; + + /**Font size for Chart title. + * @Default {20px} + */ + size?: string; +} + +export interface TitleSubTitleFont { + + /**Font family of sub title. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Font style for sub title. + * @Default {Normal. See FontStyle} + */ + fontStyle?: ej.datavisualization.Chart.FontStyle|string; + + /**Font weight for sub title. + * @Default {Regular. See FontWeight} + */ + fontWeight?: ej.datavisualization.Chart.FontWeight|string; + + /**Opacity of the sub title. + * @Default {1} + */ + opacity?: number; + + /**Font size for sub title. + * @Default {12px} + */ + size?: string; +} + +export interface TitleSubTitleBorder { + + /**Width of the subtitle border. + * @Default {1} + */ + width?: number; + + /**color of the subtitle border. + * @Default {transparent} + */ + color?: string; + + /**opacity of the subtitle border. + * @Default {0.8} + */ + opacity?: number; + + /**opacity of the subtitle border. + * @Default {0.8} + */ + cornerRadius?: number; +} + +export interface TitleSubTitle { + + /**Options for customizing the font of sub title. + */ + font?: TitleSubTitleFont; + + /**Background color for the chart subtitle. + * @Default {transparent} + */ + background?: string; + + /**Options to customize the border of the title. + */ + border?: TitleSubTitleBorder; + + /**Text to be displayed in sub title. + */ + text?: string; + + /**Alignment of sub title text. + * @Default {far. See TextAlignment} + */ + textAlignment?: ej.datavisualization.Chart.Alignment|string; +} + +export interface Title { + + /**Background color for the chart title. + * @Default {transparent} + */ + background?: string; + + /**Options to customize the border of the title. + */ + border?: TitleBorder; + + /**Options for customizing the font of Chart title. + */ + font?: TitleFont; + + /**Options to customize the sub title of Chart. + */ + subTitle?: TitleSubTitle; + + /**Text to be displayed in Chart title. + */ + text?: string; + + /**Alignment of the title text. + * @Default {Center. See TextAlignment} + */ + textAlignment?: ej.datavisualization.Chart.Alignment|string; +} + +export interface Zooming { + + /**Enables or disables zooming. + * @Default {false} + */ + enable?: boolean; + + /**Enable or disables the differed zooming. When it is enabled, chart is updated only on mouse up action while zooming and panning. + * @Default {false} + */ + enableDeferredZoom?: boolean; + + /**Enables/disables the ability to zoom the chart on moving the mouse wheel. + * @Default {false} + */ + enableMouseWheel?: boolean; + + /**Specifies whether to allow zooming the chart vertically or horizontally or in both ways. + * @Default {'x,y'} + */ + type?: string; + + /**To display user specified buttons in zooming toolbar. + * @Default {[zoomIn, zoomOut, zoom, pan, reset]} + */ + toolbarItems?: Array; +} +} +module Chart +{ +enum CoordinateUnit +{ +//string +None, +//string +Pixels, +//string +Points, +} +} +module Chart +{ +enum HorizontalAlignment +{ +//string +Left, +//string +Right, +//string +Middle, +} +} +module Chart +{ +enum Region +{ +//string +Chart, +//string +Series, +} +} +module Chart +{ +enum VerticalAlignment +{ +//string +Top, +//string +Bottom, +//string +Middle, +} +} +module Chart +{ +enum Unit +{ +//string +Percentage, +//string +Pixel, +} +} +module Chart +{ +enum DrawType +{ +//string +Line, +//string +Area, +//string +Column, +} +} +module Chart +{ +enum FontStyle +{ +//string +Normal, +//string +Italic, +} +} +module Chart +{ +enum FontWeight +{ +//string +Regular, +//string +Bold, +//string +Lighter, +} +} +module Chart +{ +enum LabelPosition +{ +//string +Inside, +//string +Outside, +//string +OutsideExtended, +} +} +module Chart +{ +enum LineCap +{ +//string +Butt, +//string +Round, +//string +Square, +} +} +module Chart +{ +enum LineJoin +{ +//string +Round, +//string +Bevel, +//string +Miter, +} +} +module Chart +{ +enum ConnectorLineType +{ +//string +Line, +//string +Bezier, +} +} +module Chart +{ +enum HorizontalTextAlignment +{ +//string +Center, +//string +Near, +//string +Far, +} +} +module Chart +{ +enum Shape +{ +//string +None, +//string +LeftArrow, +//string +RightArrow, +//string +Circle, +//string +Cross, +//string +HorizLine, +//string +VertLine, +//string +Diamond, +//string +Rectangle, +//string +Triangle, +//string +Hexagon, +//string +Pentagon, +//string +Star, +//string +Ellipse, +//string +Trapezoid, +//string +UpArrow, +//string +DownArrow, +//string +Image, +//string +SeriesType, +} +} +module Chart +{ +enum TextPosition +{ +//string +Top, +//string +Bottom, +//string +Middle, +} +} +module Chart +{ +enum VerticalTextAlignment +{ +//string +Center, +//string +Near, +//string +Far, +} +} +module Chart +{ +enum PyramidMode +{ +//string +Linear, +//string +Surface, +} +} +module Chart +{ +enum Type +{ +//string +Area, +//string +Line, +//string +Spline, +//string +Column, +//string +Scatter, +//string +Bubble, +//string +SplineArea, +//string +StepArea, +//string +StepLine, +//string +Pie, +//string +Hilo, +//string +HiloOpenClose, +//string +Candle, +//string +Bar, +//string +StackingArea, +//string +StackingArea100, +//string +RangeColumn, +//string +StackingColumn, +//string +StackingColumn100, +//string +StackingBar, +//string +StackingBar100, +//string +Pyramid, +//string +Funnel, +//string +Doughnut, +//string +Polar, +//string +Radar, +//string +RangeArea, +} +} +module Chart +{ +enum EmptyPointMode +{ +//string +Gap, +//string +Zero, +//string +Average, +} +} +module Chart +{ +enum ErrorBarType +{ +//string +FixedValue, +//string +Percentage, +//string +StandardDeviation, +//string +StandardError, +} +} +module Chart +{ +enum ErrorBarMode +{ +//string +Both, +//string +Vertical, +//string +Horizontal, +} +} +module Chart +{ +enum ErrorBarDirection +{ +//string +Both, +//string +Plus, +//string +Minus, +} +} +module Chart +{ +enum Mode +{ +//string +Series, +//string +Point, +//string +Cluster, +} +} +module Chart +{ +enum SelectionType +{ +//string +Single, +//string +Multiple, +} +} +module Chart +{ +enum CrosshairType +{ +//string +Crosshair, +//string +Trackball, +} +} +module Chart +{ +enum Alignment +{ +//string +Center, +//string +Near, +//string +Far, +} +} +module Chart +{ +enum Position +{ +//string +Left, +//string +Right, +//string +Top, +//string +Bottom, +} +} +module Chart +{ +enum TextOverflow +{ +//string +None, +//string +Trim, +//string +Wrap, +//string +WrapAndTrim, +} +} +module Chart +{ +enum EdgeLabelPlacement +{ +//string +None, +//string +Shift, +//string +Hide, +} +} +module Chart +{ +enum IntervalType +{ +//string +Days, +//string +Hours, +//string +Seconds, +//string +Milliseconds, +//string +Minutes, +//string +Months, +//string +Years, +} +} +module Chart +{ +enum LabelIntersectAction +{ +//string +None, +//string +Rotate90, +//string +Rotate45, +//string +Wrap, +//string +WrapByword, +//string +Trim, +//string +Hide, +//string +MultipleRows, +} +} +module Chart +{ +enum RangePadding +{ +//string +Additional, +//string +Normal, +//string +None, +//string +Round, +} +} +module Chart +{ +enum TextAlignment +{ +//string +MiddleTop, +//string +MiddleCenter, +//string +MiddleBottom, +} +} +module Chart +{ +enum ZIndex +{ +//string +Inside, +//string +Over, +} +} +module Chart +{ +enum TickLinesPosition +{ +//string +Inside, +//string +Outside, +} +} +module Chart +{ +enum ValueType +{ +//string +Double, +//string +Category, +//string +DateTime, +//string +Logarithmic, +} +} +module Chart +{ +enum Theme +{ +//string +Azure, +//string +FlatLight, +//string +FlatDark, +//string +Azuredark, +//string +Lime, +//string +LimeDark, +//string +Saffron, +//string +SaffronDark, +//string +GradientLight, +//string +GradientDark, +} +} + +class RangeNavigator extends ej.Widget { + static fn: RangeNavigator; + constructor(element: JQuery, options?: RangeNavigator.Model); + constructor(element: Element, options?: RangeNavigator.Model); + model:RangeNavigator.Model; + defaults:RangeNavigator.Model; + + /** destroy the range navigator widget + * @returns {void} + */ + _destroy (): void; +} +export module RangeNavigator{ + +export interface Model { + + /**Toggles the placement of slider exactly on the place it left or on the nearest interval. + * @Default {false} + */ + allowSnapping?: boolean; + + /**Specifies the data source for range navigator. + */ + dataSource?: any; + + /**Sets a value whether to make the range navigator responsive on resize. + * @Default {false} + */ + enableAutoResizing?: boolean; + + /**Toggles the redrawing of chart on moving the sliders. + * @Default {true} + */ + enableDeferredUpdate?: boolean; + + /**Toggles the direction of rendering the range navigator control. + * @Default {false} + */ + enableRTL?: boolean; + + /**Options for customizing the labels colors, font, style, size, horizontalAlignment and opacity. + */ + labelSettings?: LabelSettings; + + /**This property is to specify the localization of range navigator. + * @Default {en-US} + */ + locale?: string; + + /**Options for customizing the range navigator. + */ + navigatorStyleSettings?: NavigatorStyleSettings; + + /**Padding specifies the gap between the container and the range navigator. + * @Default {0} + */ + padding?: string; + + /**If the range is not given explicitly, range will be calculated automatically. + * @Default {none} + */ + rangePadding?: ej.datavisualization.RangeNavigator.RangePadding|string; + + /**Options for customizing the starting and ending ranges. + */ + rangeSettings?: RangeSettings; + + /**selectedData is for getting the data when the "rangeChanged" event trigger from client side. + */ + selectedData?: any; + + /**Options for customizing the start and end range values. + */ + selectedRangeSettings?: SelectedRangeSettings; + + /**Contains property to customize the hight and width of range navigator. + */ + sizeSettings?: SizeSettings; + + /**By specifying this property the user can change the theme of the range navigator. + * @Default {null} + */ + theme?: string; + + /**Options for customizing the tooltip in range navigator. + */ + tooltipSettings?: TooltipSettings; + + /**Options for configuring minor grid lines, major grid lines, axis line of axis. + */ + valueAxisSettings?: ValueAxisSettings; + + /**You can plot data of type date time or numeric. This property determines the type of data that this axis will handle. + * @Default {datetime} + */ + valueType?: ej.datavisualization.RangeNavigator.ValueType|string; + + /**Specifies the xName for dataSource. This is used to take the x values from dataSource + */ + xName?: any; + + /**Specifies the yName for dataSource. This is used to take the y values from dataSource + */ + yName?: any; + + /**Fires on load of range navigator.*/ + load? (e: LoadEventArgs): void; + + /**Fires after range navigator is loaded.*/ + loaded? (e: LoadedEventArgs): void; + + /**Fires on changing the range of range navigator.*/ + rangeChanged? (e: RangeChangedEventArgs): void; +} + +export interface LoadEventArgs { + + /**parameters from range navigator + */ + Data?: any; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the range navigator model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface LoadedEventArgs { + + /**parameters from range navigator + */ + Data?: any; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the range navigator model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface RangeChangedEventArgs { + + /**parameters from range navigator + */ + Data?: any; + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the range navigator model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; +} + +export interface LabelSettingsHigherLevelBorder { + + /**Specifies the border color of grid lines. + * @Default {transparent} + */ + color?: string; + + /**Specifies the border width of grid lines. + * @Default {0.5} + */ + width?: string; +} + +export interface LabelSettingsHigherLevelGridLineStyle { + + /**Specifies the color of grid lines in higher level. + * @Default {#B5B5B5} + */ + color?: string; + + /**Specifies the dashArray of grid lines in higher level. + * @Default {20 5 0} + */ + dashArray?: string; + + /**Specifies the width of grid lines in higher level. + * @Default {#B5B5B5} + */ + width?: string; +} + +export interface LabelSettingsHigherLevelStyleFont { + + /**Specifies the label font color. Labels render with the specified font color. + * @Default {black} + */ + color?: string; + + /**Specifies the label font family. Labels render with the specified font family. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Specifies the label font style. Labels render with the specified font style. + * @Default {Normal} + */ + fontStyle?: string; + + /**Specifies the label font weight. Labels render with the specified font weight. + * @Default {regular} + */ + fontWeight?: string; + + /**Specifies the label opacity. Labels render with the specified opacity. + * @Default {1} + */ + opacity?: number; + + /**Specifies the label font size. Labels render with the specified font size. + * @Default {12px} + */ + size?: string; +} + +export interface LabelSettingsHigherLevelStyle { + + /**Options for customizing the font properties. + */ + font?: LabelSettingsHigherLevelStyleFont; + + /**Specifies the horizontal text alignment of the text in label. + * @Default {middle} + */ + horizontalAlignment?: string; +} + +export interface LabelSettingsHigherLevel { + + /**Options for customizing the border of grid lines in higher level. + */ + border?: LabelSettingsHigherLevelBorder; + + /**Specifies the fill color of higher level labels. + * @Default {transparent} + */ + fill?: string; + + /**Options for customizing the grid line colors, width, dashArray, border. + */ + gridLineStyle?: LabelSettingsHigherLevelGridLineStyle; + + /**Specifies the intervalType for higher level labels. See IntervalType + * @Default {years} + */ + intervalType?: ej.datavisualization.RangeNavigator.IntervalType|string; + + /**Specifies the position of the labels to render either inside or outside of plot area + * @Default {outside} + */ + labelPlacement?: ej.datavisualization.RangeNavigator.LabelPlacement|string; + + /**Specifies the position of the labels in higher level + * @Default {top} + */ + position?: ej.datavisualization.RangeNavigator.Position|string; + + /**Options for customizing the style of higher level labels. + */ + style?: LabelSettingsHigherLevelStyle; + + /**Toggles the visibility of higher level labels. + * @Default {true} + */ + visible?: boolean; +} + +export interface LabelSettingsLowerLevelBorder { + + /**Specifies the border color of grid lines. + * @Default {transparent} + */ + color?: string; + + /**Specifies the border width of grid lines. + * @Default {0.5} + */ + width?: string; +} + +export interface LabelSettingsLowerLevelGridLineStyle { + + /**Specifies the color of grid lines in lower level. + * @Default {#B5B5B5} + */ + color?: string; + + /**Specifies the dashArray of gridLines in lowerLevel. + * @Default {20 5 0} + */ + dashArray?: string; + + /**Specifies the width of grid lines in lower level. + * @Default {#B5B5B5} + */ + width?: string; +} + +export interface LabelSettingsLowerLevelStyleFont { + + /**Specifies the color of labels. Label text render in this specified color. + * @Default {black} + */ + color?: string; + + /**Specifies the font family of labels. Label text render in this specified font family. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Specifies the font style of labels. Label text render in this specified font style. + * @Default {Normal} + */ + fontStyle?: string; + + /**Specifies the font weight of labels. Label text render in this specified font weight. + * @Default {regular} + */ + fontWeight?: string; + + /**Specifies the opacity of labels. Label text render in this specified opacity. + * @Default {12px} + */ + opacity?: string; + + /**Specifies the size of labels. Label text render in this specified size. + * @Default {12px} + */ + size?: string; +} + +export interface LabelSettingsLowerLevelStyle { + + /**Options for customizing the font of labels. + */ + font?: LabelSettingsLowerLevelStyleFont; + + /**Specifies the horizontal text alignment of the text in label. + * @Default {middle} + */ + horizontalAlignment?: string; +} + +export interface LabelSettingsLowerLevel { + + /**Options for customizing the border of grid lines in lower level. + */ + border?: LabelSettingsLowerLevelBorder; + + /**Specifies the fill color of labels in lower level. + * @Default {transparent} + */ + fill?: string; + + /**Options for customizing the grid lines in lower level. + */ + gridLineStyle?: LabelSettingsLowerLevelGridLineStyle; + + /**Specifies the intervalType of the labels in lower level.See IntervalType + * @Default {years} + */ + intervalType?: ej.datavisualization.RangeNavigator.IntervalType|string; + + /**Specifies the position of the labels to render either inside or outside of plot area. See LabelPlacement + * @Default {outside} + */ + labelPlacement?: ej.datavisualization.RangeNavigator.LabelPlacement|string; + + /**Specifies the position of the labels in lower level.See Position + * @Default {bottom} + */ + position?: ej.datavisualization.RangeNavigator.Position|string; + + /**Options for customizing the style of labels. + */ + style?: LabelSettingsLowerLevelStyle; + + /**Toggles the visibility of labels in lower level. + * @Default {true} + */ + visible?: boolean; +} + +export interface LabelSettingsStyleFont { + + /**Specifies the label color. This color is applied to the labels in range navigator. + * @Default {#FFFFFF} + */ + color?: string; + + /**Specifies the label font family. Labels render with the specified font family. + * @Default {Segoe UI} + */ + family?: string; + + /**Specifies the label font opacity. Labels render with the specified font opacity. + * @Default {1} + */ + opacity?: number; + + /**Specifies the label font size. Labels render with the specified font size. + * @Default {1px} + */ + size?: string; + + /**Specifies the label font style. Labels render with the specified font style.. + * @Default {Normal} + */ + style?: ej.datavisualization.RangeNavigator.FontStyle|string; + + /**Specifies the lable font weight + * @Default {regular} + */ + weight?: ej.datavisualization.RangeNavigator.FontWeight|string; +} + +export interface LabelSettingsStyle { + + /**Options for customizing the font of labels in range navigator. + */ + font?: LabelSettingsStyleFont; + + /**Specifies the horizontalAlignment of the label in RangeNavigator + * @Default {middle} + */ + horizontalAlignment?: ej.datavisualization.RangeNavigator.HorizontalAlignment|string; +} + +export interface LabelSettings { + + /**Options for customizing the higher level labels in range navigator. + */ + higherLevel?: LabelSettingsHigherLevel; + + /**Options for customizing the labels in lower level. + */ + lowerLevel?: LabelSettingsLowerLevel; + + /**Options for customizing the style of labels in range navigator. + */ + style?: LabelSettingsStyle; +} + +export interface NavigatorStyleSettingsBorder { + + /**Specifies the border color of range navigator. + * @Default {transparent} + */ + color?: string; + + /**Specifies the dash array of range navigator. + * @Default {null} + */ + dashArray?: string; + + /**Specifies the border width of range navigator. + * @Default {0.5} + */ + width?: number; +} + +export interface NavigatorStyleSettingsMajorGridLineStyle { + + /**Specifies the color of major grid lines in range navigator. + * @Default {#B5B5B5} + */ + color?: string; + + /**Toggles the visibility of major grid lines. + * @Default {true} + */ + visible?: boolean; +} + +export interface NavigatorStyleSettingsMinorGridLineStyle { + + /**Specifies the color of minor grid lines in range navigator. + * @Default {#B5B5B5} + */ + color?: string; + + /**Toggles the visibility of minor grid lines. + * @Default {true} + */ + visible?: boolean; +} + +export interface NavigatorStyleSettings { + + /**Specifies the background color of range navigator. + * @Default {#dddddd} + */ + background?: string; + + /**Options for customizing the border color and width of range navigator. + */ + border?: NavigatorStyleSettingsBorder; + + /**Specifies the left side thumb template in range navigator we can give either div id or html string + * @Default {null} + */ + leftThumbTemplate?: string; + + /**Options for customizing the major grid lines. + */ + majorGridLineStyle?: NavigatorStyleSettingsMajorGridLineStyle; + + /**Options for customizing the minor grid lines. + */ + minorGridLineStyle?: NavigatorStyleSettingsMinorGridLineStyle; + + /**Specifies the opacity of RangeNavigator. + * @Default {1} + */ + opacity?: number; + + /**Specifies the right side thumb template in range navigator we can give either div id or html string + * @Default {null} + */ + rightThumbTemplate?: string; + + /**Specifies the color of the selected region in range navigator. + * @Default {#EFEFEF} + */ + selectedRegionColor?: string; + + /**Specifies the opacity of Selected Region. + * @Default {0} + */ + selectedRegionOpacity?: number; + + /**Specifies the color of the thumb in range navigator. + * @Default {#2382C3} + */ + thumbColor?: string; + + /**Specifies the radius of the thumb in range navigator. + * @Default {10} + */ + thumbRadius?: number; + + /**Specifies the stroke color of the thumb in range navigator. + * @Default {#303030} + */ + thumbStroke?: string; + + /**Specifies the color of the unselected region in range navigator. + * @Default {#5EABDE} + */ + unselectedRegionColor?: string; + + /**Specifies the opacity of Unselected Region. + * @Default {0.3} + */ + unselectedRegionOpacity?: number; +} + +export interface RangeSettings { + + /**Specifies the ending range of range navigator. + * @Default {null} + */ + end?: string; + + /**Specifies the starting range of range navigator. + * @Default {null} + */ + start?: string; +} + +export interface SelectedRangeSettings { + + /**Specifies the ending range of range navigator. + * @Default {null} + */ + end?: string; + + /**Specifies the starting range of range navigator. + * @Default {null} + */ + start?: string; +} + +export interface SizeSettings { + + /**Specifies height of the range navigator. + * @Default {null} + */ + height?: string; + + /**Specifies width of the range navigator. + * @Default {null} + */ + width?: string; +} + +export interface TooltipSettingsFont { + + /**Specifies the color of text in tooltip. Tooltip text render in the specified color. + * @Default {#FFFFFF} + */ + color?: string; + + /**Specifies the font family of text in tooltip. Tooltip text render in the specified font family. + * @Default {Segoe UI} + */ + family?: string; + + /**Specifies the font style of text in tooltip. Tooltip text render in the specified font style. + * @Default {ej.datavisualization.RangeNavigator.fontStyle.Normal} + */ + fontStyle?: string; + + /**Specifies the opacity of text in tooltip. Tooltip text render in the specified opacity. + * @Default {1} + */ + opacity?: number; + + /**Specifies the size of text in tooltip. Tooltip text render in the specified size. + * @Default {10px} + */ + size?: string; + + /**Specifies the weight of text in tooltip. Tooltip text render in the specified weight. + * @Default {ej.datavisualization.RangeNavigator.weight.Regular} + */ + weight?: string; +} + +export interface TooltipSettings { + + /**Specifies the background color of tooltip. + * @Default {#303030} + */ + backgroundColor?: string; + + /**Options for customizing the font in tooltip. + */ + font?: TooltipSettingsFont; + + /**Specifies the format of text to be displayed in tooltip. + * @Default {MM/dd/yyyy} + */ + labelFormat?: string; + + /**Specifies the mode of displaying the tooltip. Neither to display the tooltip always nor on demand. + * @Default {null} + */ + tooltipDisplayMode?: string; + + /**Toggles the visibility of tooltip. + * @Default {true} + */ + visible?: boolean; +} + +export interface ValueAxisSettingsAxisLine { + + /**Toggles the visibility of axis line. + * @Default {none} + */ + visible?: string; +} + +export interface ValueAxisSettingsFont { + + /**Text in axis render with the specified size. + * @Default {0px} + */ + size?: string; +} + +export interface ValueAxisSettingsMajorGridLines { + + /**Toggles the visibility of major grid lines. + * @Default {false} + */ + visible?: boolean; +} + +export interface ValueAxisSettingsMajorTickLines { + + /**Specifies the size of the majorTickLines in range navigator + * @Default {0} + */ + size?: number; + + /**Toggles the visibility of major tick lines. + * @Default {true} + */ + visible?: boolean; + + /**Specifies width of the major tick lines. + * @Default {0} + */ + width?: number; +} + +export interface ValueAxisSettings { + + /**Options for customizing the axis line. + */ + axisLine?: ValueAxisSettingsAxisLine; + + /**Options for customizing the font of the axis. + */ + font?: ValueAxisSettingsFont; + + /**Options for customizing the major grid lines. + */ + majorGridLines?: ValueAxisSettingsMajorGridLines; + + /**Options for customizing the major tick lines in axis. + */ + majorTickLines?: ValueAxisSettingsMajorTickLines; + + /**If the range is not given explicitly, range will be calculated automatically. You can customize the automatic range calculation using rangePadding. + * @Default {none} + */ + rangePadding?: string; + + /**Toggles the visibility of axis in range navigator. + * @Default {false} + */ + visible?: boolean; +} +} +module RangeNavigator +{ +enum IntervalType +{ +//string +Years, +//string +Quarters, +//string +Months, +//string +Weeks, +//string +Days, +//string +Hours, +} +} +module RangeNavigator +{ +enum LabelPlacement +{ +//string +Inside, +//string +Outside, +} +} +module RangeNavigator +{ +enum Position +{ +//string +Top, +//string +Bottom, +} +} +module RangeNavigator +{ +enum FontStyle +{ +//string +Normal, +//string +Bold, +//string +Italic, +} +} +module RangeNavigator +{ +enum FontWeight +{ +//string +Regular, +//string +Lighter, +} +} +module RangeNavigator +{ +enum HorizontalAlignment +{ +//string +Middle, +//string +Left, +//string +Right, +} +} +module RangeNavigator +{ +enum RangePadding +{ +//string +Additional, +//string +Normal, +//string +None, +//string +Round, +} +} +module RangeNavigator +{ +enum ValueType +{ +//string +Numeric, +//string +DateTime, +} +} + +class BulletGraph extends ej.Widget { + static fn: BulletGraph; + constructor(element: JQuery, options?: BulletGraph.Model); + constructor(element: Element, options?: BulletGraph.Model); + model:BulletGraph.Model; + defaults:BulletGraph.Model; + + /** To destroy the bullet graph + * @returns {void} + */ + destroy (): void; + + /** To redraw the bulet graph + * @returns {void} + */ + redraw(): void; + + /** To set the value for comparative measure in bullet graph. + * @returns {void} + */ + setComparativeMeasureSymbol(): void; + + /** To set the value for feature measure bar. + * @returns {void} + */ + setFeatureMeasureBarValue(): void; +} +export module BulletGraph{ + +export interface Model { + + /**Toggles the visibility of the range stroke color of the labels. + * @Default {false} + */ + applyRangeStrokeToLabels?: boolean; + + /**Toggles the visibility of the range stroke color of the ticks. + * @Default {false} + */ + applyRangeStrokeToTicks?: boolean; + + /**Contains property to customize the caption in bullet graph. + */ + captionSettings?: CaptionSettings; + + /**Comparative measure bar in bullet graph render till the specified value. + * @Default {0} + */ + comparativeMeasureValue?: number; + + /**Toggles the animation of bullet graph. + * @Default {true} + */ + enableAnimation?: boolean; + + /**Sets a value whether to make the bullet graph responsive on resize. + * @Default {true} + */ + enableResizing?: boolean; + + /**Specifies the direction of flow in bullet graph. Neither it may be backward nor forward. + * @Default {forward} + */ + flowDirection?: ej.datavisualization.BulletGraph.FlowDirection|string; + + /**Specifies the height of the bullet graph. + * @Default {90} + */ + height?: number; + + /**Bullet graph will render in the specified orientation. + * @Default {horizontal} + */ + orientation?: ej.datavisualization.BulletGraph.Orientation|string; + + /**Contains property to customize the qualitative ranges. + */ + qualitativeRanges?: Array; + + /**Size of the qualitative range depends up on the specified value. + * @Default {32} + */ + qualitativeRangeSize?: number; + + /**Length of the quantitative range depends up on the specified value. + * @Default {475} + */ + quantitativeScaleLength?: number; + + /**Contains all the properties to customize quantitative scale. + */ + quantitativeScaleSettings?: QuantitativeScaleSettings; + + /**By specifying this property the user can change the theme of the bullet graph. + * @Default {flatlight} + */ + theme?: string; + + /**Contains all the properties to customize tooltip. + */ + tooltipSettings?: TooltipSettings; + + /**Feature measure bar in bullet graph render till the specified value. + * @Default {0} + */ + value?: number; + + /**Specifies the width of the bullet graph. + * @Default {595} + */ + width?: number; + + /**Fires on rendering the caption of bullet graph.*/ + drawCaption? (e: DrawCaptionEventArgs): void; + + /**Fires on rendering the category.*/ + drawCategory? (e: DrawCategoryEventArgs): void; + + /**Fires on rendering the comparative measure symbol.*/ + drawComparativeMeasureSymbol? (e: DrawComparativeMeasureSymbolEventArgs): void; + + /**Fires on rednering the feature measure bar.*/ + drawFeatureMeasureBar? (e: DrawFeatureMeasureBarEventArgs): void; + + /**Fires on rendering the indicator of bullet graph.*/ + drawIndicator? (e: DrawIndicatorEventArgs): void; + + /**Fires on rendering the labels.*/ + drawLabels? (e: DrawLabelsEventArgs): void; + + /**Fires on rendering the qualitative ranges.*/ + drawQualitativeRanges? (e: DrawQualitativeRangesEventArgs): void; + + /**Fires on loading bullet graph.*/ + load? (e: LoadEventArgs): void; +} + +export interface DrawCaptionEventArgs { + + /**returns the object of the bullet graph. + */ + Object?: any; + + /**returns the options of the scale element. + */ + scaleElement?: HTMLElement; + + /**returns the current captionSettings element. + */ + captionElement?: HTMLElement; + + /**returns the type of the captionSettings. + */ + captionType?: string; +} + +export interface DrawCategoryEventArgs { + + /**returns the object of the bullet graph. + */ + Object?: any; + + /**returns the options of the scale element. + */ + scaleElement?: HTMLElement; + + /**returns the options of category element. + */ + categoryElement?: HTMLElement; + + /**returns the text value of the category that is drawn. + */ + Value?: string; +} + +export interface DrawComparativeMeasureSymbolEventArgs { + + /**returns the object of the bullet graph. + */ + Object?: any; + + /**returns the options of the scale element. + */ + scaleElement?: HTMLElement; + + /**returns the options of comparative measure element. + */ + targetElement?: HTMLElement; + + /**returns the value of the comparative measure symbol. + */ + Value?: number; +} + +export interface DrawFeatureMeasureBarEventArgs { + + /**returns the object of the bullet graph. + */ + Object?: any; + + /**returns the options of the scale element. + */ + scaleElement?: HTMLElement; + + /**returns the options of feature measure element. + */ + currentElement?: HTMLElement; + + /**returns the value of the feature measure bar. + */ + Value?: number; +} + +export interface DrawIndicatorEventArgs { + + /**returns an object to customize bullet graph indicator text and symbol before rendering it. + */ + indicatorSettings?: any; + + /**returns the object of bullet graph. + */ + model?: any; + + /**returns the type of event. + */ + type?: string; + + /**for cancelling the event. + */ + cancel?: boolean; +} + +export interface DrawLabelsEventArgs { + + /**returns the object of the bullet graph. + */ + Object?: any; + + /**returns the options of the scale element. + */ + scaleElement?: HTMLElement; + + /**returns the current label element. + */ + tickElement?: HTMLElement; + + /**returns the label type. + */ + labelType?: string; +} + +export interface DrawQualitativeRangesEventArgs { + + /**returns the object of the bullet graph. + */ + Object?: any; + + /**returns the index of current range. + */ + rangeIndex?: number; + + /**returns the settings for current range. + */ + rangeOptions?: any; + + /**returns the end value of current range. + */ + rangeEndValue?: number; +} + +export interface LoadEventArgs { +} + +export interface CaptionSettingsFont { + + /**Specifies the color of the text in caption. + * @Default {null} + */ + color?: string; + + /**Specifies the fontFamily of caption. Caption text render with this fontFamily + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Specifies the fontStyle of caption + * @Default {Normal} + */ + fontStyle?: ej.datavisualization.BulletGraph.FontStyle|string; + + /**Specifies the fontWeight of caption + * @Default {regular} + */ + fontWeight?: ej.datavisualization.BulletGraph.FontWeight|string; + + /**Specifies the opacity of caption. Caption text render with this opacity. + * @Default {1} + */ + opacity?: number; + + /**Specifies the size of caption. Caption text render with this size + * @Default {12px} + */ + size?: string; +} + +export interface CaptionSettingsIndicatorFont { + + /**Specifies the color of the indicator's text. + * @Default {null} + */ + color?: string; + + /**Specifies the fontFamily of indicator. Indicator text render with this fontFamily. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Specifies the fontStyle of indicator. Indicator text render with this fontStyle. See FontStyle + * @Default {Normal} + */ + fontStyle?: ej.datavisualization.BulletGraph.FontStyle|string; + + /**Specifies the fontWeight of indicator. Indicator text render with this fontWeight. See FontWeight + * @Default {regular} + */ + fontWeight?: ej.datavisualization.BulletGraph.FontWeight|string; + + /**Specifies the opacity of indicator text. Indicator text render with this Opacity. + * @Default {1} + */ + opacity?: number; + + /**Specifies the size of indicator. Indicator text render with this size. + * @Default {12px} + */ + size?: string; +} + +export interface CaptionSettingsIndicatorLocation { + + /**Specifies the horizontal position of the indicator. + * @Default {10} + */ + x?: number; + + /**Specifies the vertical position of the indicator. + * @Default {60} + */ + y?: number; +} + +export interface CaptionSettingsIndicatorSymbolBorder { + + /**Specifies the border color of indicator symbol. + * @Default {null} + */ + color?: string; + + /**Specifies the border width of indicator symbol. + * @Default {1} + */ + width?: number; +} + +export interface CaptionSettingsIndicatorSymbolSize { + + /**Specifies the height of indicator symbol. + * @Default {10} + */ + height?: number; + + /**Specifies the width of indicator symbol. + * @Default {10} + */ + width?: number; +} + +export interface CaptionSettingsIndicatorSymbol { + + /**Contains property to customize the border of indicator symbol. + */ + border?: CaptionSettingsIndicatorSymbolBorder; + + /**Specifies the color of indicator symbol. + * @Default {null} + */ + color?: string; + + /**Specifies the url of image that represents indicator symbol. + */ + imageURL?: string; + + /**Specifies the opacity of indicator symbol. + * @Default {1} + */ + opacity?: number; + + /**Specifies the shape of indicator symbol. + */ + shape?: string; + + /**Contains property to customize the size of indicator symbol. + */ + size?: CaptionSettingsIndicatorSymbolSize; +} + +export interface CaptionSettingsIndicator { + + /**Contains property to customize the font of indicator. + */ + font?: CaptionSettingsIndicatorFont; + + /**Contains property to customize the location of indicator. + */ + location?: CaptionSettingsIndicatorLocation; + + /**Specifies the padding to be applied when text position is used. + * @Default {2} + */ + padding?: number; + + /**Contains property to customize the symbol of indicator. + */ + symbol?: CaptionSettingsIndicatorSymbol; + + /**Specifies the text to be displayed as indicator text. By default difference between current value and target will be displayed + */ + text?: string; + + /**Specifies the alignement of indicator with respect to scale based on text position + * @Default {'Near'} + */ + textAlignment?: ej.datavisualization.BulletGraph.TextAlignment|string; + + /**Specifies where indicator text should be anchored when indicator overlaps with other caption group text. Text will be anchored when overlapping caption group text are at same position. Anchoring is not applicable for float position. + * @Default {'start'} + */ + textAnchor?: ej.datavisualization.BulletGraph.TextAnchor|string; + + /**indicator text render in the specified angle. + * @Default {0} + */ + textAngle?: number; + + /**Specifies where indicator should be placed + * @Default {'float'} + */ + textPosition?: ej.datavisualization.BulletGraph.TextPosition|string; + + /**Specifies the space between indicator symbol and text. + * @Default {3} + */ + textSpacing?: number; + + /**Specifies whether indicator will be visible or not. + * @Default {false} + */ + visibile?: boolean; +} + +export interface CaptionSettingsLocation { + + /**Specifies the position in horizontal direction + * @Default {17} + */ + x?: number; + + /**Specifies the position in horizontal direction + * @Default {30} + */ + y?: number; +} + +export interface CaptionSettingsSubTitleFont { + + /**Specifies the color of the subtitle's text. + * @Default {null} + */ + color?: string; + + /**Specifies the fontFamily of subtitle. Subtitle text render with this fontFamily. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Specifies the fontStyle of subtitle. Subtitle text render with this fontStyle. See FontStyle + * @Default {Normal} + */ + fontStyle?: ej.datavisualization.BulletGraph.FontStyle|string; + + /**Specifies the fontWeight of subtitle. Subtitle text render with this fontWeight. See FontWeight + * @Default {regular} + */ + fontWeight?: ej.datavisualization.BulletGraph.FontWeight|string; + + /**Specifies the opacity of subtitle. Subtitle text render with this opacity. + * @Default {1} + */ + opacity?: number; + + /**Specifies the size of subtitle. Subtitle text render with this size. + * @Default {12px} + */ + size?: string; +} + +export interface CaptionSettingsSubTitleLocation { + + /**Specifies the horizontal position of the subtitle. + * @Default {10} + */ + x?: number; + + /**Specifies the vertical position of the subtitle. + * @Default {45} + */ + y?: number; +} + +export interface CaptionSettingsSubTitle { + + /**Contains property to customize the font of subtitle. + */ + font?: CaptionSettingsSubTitleFont; + + /**Contains property to customize the location of subtitle. + */ + location?: CaptionSettingsSubTitleLocation; + + /**Specifies the padding to be applied when text position is used. + * @Default {5} + */ + padding?: number; + + /**Specifies the text to be displayed as subtitle. + */ + text?: string; + + /**Specifies the alignment of sub title text with respect to scale. Alignment will not be applied in float position. + * @Default {'Near'} + */ + textAlignment?: ej.datavisualization.BulletGraph.TextAlignment|string; + + /**Specifies where subtitle text should be anchored when sub title text overlaps with other caption group text. Text will be anchored when overlapping caption group text are at same position. Anchoring is not applicable for float position. + * @Default {'start'} + */ + textAnchor?: ej.datavisualization.BulletGraph.TextAnchor|string; + + /**Subtitle render in the specified angle. + * @Default {0} + */ + textAngle?: number; + + /**Specifies where sub title text should be placed. + * @Default {'float'} + */ + textPosition?: ej.datavisualization.BulletGraph.TextPosition|string; +} + +export interface CaptionSettings { + + /**Specifies whether trim the labels will be true or false. + * @Default {true} + */ + enableTrim?: boolean; + + /**Contains property to customize the font of caption. + */ + font?: CaptionSettingsFont; + + /**Contains property to customize the indicator. + */ + indicator?: CaptionSettingsIndicator; + + /**Contains property to customize the location. + */ + location?: CaptionSettingsLocation; + + /**Specifies the padding to be applied when text position is used. + * @Default {5} + */ + padding?: number; + + /**Contains property to customize the subtitle. + */ + subTitle?: CaptionSettingsSubTitle; + + /**Specifies the text to be displayed on bullet graph. + */ + text?: string; + + /**Specifies the alignment of caption text with respect to scale. This property will not be applied when text position is float. + * @Default {'Near'} + */ + textAlignment?: ej.datavisualization.BulletGraph.TextAlignment|string; + + /**Specifies caption text anchoring when caption text overlaps with other caption group text. Text will be anchored when overlapping caption group text are at same position. Anchoring is not applicable for float position. + * @Default {'start'} + */ + textAnchor?: ej.datavisualization.BulletGraph.TextAnchor|string; + + /**Specifies the angel in which the caption is rendered. + * @Default {0} + */ + textAngle?: number; + + /**Specifies how caption text should be placed. + * @Default {'float'} + */ + textPosition?: ej.datavisualization.BulletGraph.TextPosition|string; +} + +export interface QualitativeRanges { + + /**Specifies the ending range to which the qualitative ranges will render. + * @Default {3} + */ + rangeEnd?: number; + + /**Specifies the opacity for the qualitative ranges. + * @Default {1} + */ + rangeOpacity?: number; + + /**Specifies the stroke for the qualitative ranges. + * @Default {null} + */ + rangeStroke?: string; +} + +export interface QuantitativeScaleSettingsComparativeMeasureSettings { + + /**Specifies the stroke of the comparative measure. + * @Default {null} + */ + stroke?: number; + + /**Specifies the width of the comparative measure. + * @Default {5} + */ + width?: number; +} + +export interface QuantitativeScaleSettingsFeaturedMeasureSettings { + + /**Specifies the Stroke of the featured measure in bullet graph. + * @Default {null} + */ + stroke?: number; + + /**Specifies the width of the featured measure in bullet graph. + * @Default {2} + */ + width?: number; +} + +export interface QuantitativeScaleSettingsFeatureMeasures { + + /**Specifies the category of feature measure. + * @Default {null} + */ + category?: string; + + /**Comparative measure render till the specified value. + * @Default {null} + */ + comparativeMeasureValue?: number; + + /**Feature measure render till the specified value. + * @Default {null} + */ + value?: number; +} + +export interface QuantitativeScaleSettingsFields { + + /**Specifies the category of the bullet graph. + * @Default {null} + */ + category?: string; + + /**Comparative measure render based on the values in the specified field. + * @Default {null} + */ + comparativeMeasure?: string; + + /**Specifies the dataSource for the bullet graph. + * @Default {null} + */ + dataSource?: any; + + /**Feature measure render based on the values in the specified field. + * @Default {null} + */ + featureMeasures?: string; + + /**Specifies the query for fetching the values form data source to render the bullet graph. + * @Default {null} + */ + query?: string; + + /**Specifies the name of the table. + * @Default {null} + */ + tableName?: string; +} + +export interface QuantitativeScaleSettingsLabelSettingsFont { + + /**Specifies the fontFamily of labels in bullet graph. Labels render with this fontFamily. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /**Specifies the fontStyle of labels in bullet graph. Labels render with this fontStyle. See FontStyle + * @Default {Normal} + */ + fontStyle?: ej.datavisualization.BulletGraph.FontStyle|string; + + /**Specifies the fontWeight of labels in bullet graph. Labels render with this fontWeight. See FontWeight + * @Default {regular} + */ + fontWeight?: ej.datavisualization.BulletGraph.FontWeight|string; + + /**Specifies the opacity of labels in bullet graph. Labels render with this opacity + * @Default {1} + */ + opacity?: number; +} + +export interface QuantitativeScaleSettingsLabelSettings { + + /**Contains property to customize the font of the labels in bullet graph. + */ + font?: QuantitativeScaleSettingsLabelSettingsFont; + + /**Specifies the placement of labels in bullet graph scale. + * @Default {outside} + */ + labelPlacement?: ej.datavisualization.BulletGraph.LabelPlacement|string; + + /**Specifies the prefix to be added with labels in bullet graph. + * @Default {Empty string} + */ + labelPrefix?: string; + + /**Specifies the suffix to be added after labels in bullet graph. + * @Default {Empty string} + */ + labelSuffix?: string; + + /**Specifies the horizontal/vertical padding of labels. + * @Default {15} + */ + offset?: number; + + /**Specifies the position of the labels to render either above or below the graph. See Position + * @Default {below} + */ + position?: ej.datavisualization.BulletGraph.LabelPosition|string; + + /**Specifies the Size of the labels. + * @Default {12} + */ + size?: number; + + /**Specifies the stroke color of the labels in bullet graph. + * @Default {null} + */ + stroke?: string; +} + +export interface QuantitativeScaleSettingsLocation { + + /**This property specifies the x position for rendering quantitative scale. + * @Default {10} + */ + x?: number; + + /**This property specifies the y position for rendering quantitative scale. + * @Default {10} + */ + y?: number; +} + +export interface QuantitativeScaleSettingsMajorTickSettings { + + /**Specifies the size of the major ticks. + * @Default {13} + */ + size?: number; + + /**Specifies the stroke color of the major tick lines. + * @Default {null} + */ + stroke?: string; + + /**Specifies the width of the major tick lines. + * @Default {2} + */ + width?: number; +} + +export interface QuantitativeScaleSettingsMinorTickSettings { + + /**Specifies the size of minor ticks. + * @Default {7} + */ + size?: number; + + /**Specifies the stroke color of minor ticks in bullet graph. + * @Default {null} + */ + stroke?: string; + + /**Specifies the width of the minor ticks in bullet graph. + * @Default {2} + */ + width?: number; +} + +export interface QuantitativeScaleSettings { + + /**Contains property to customize the comparative measure. + */ + comparativeMeasureSettings?: QuantitativeScaleSettingsComparativeMeasureSettings; + + /**Contains property to customize the featured measure. + */ + featuredMeasureSettings?: QuantitativeScaleSettingsFeaturedMeasureSettings; + + /**Contains property to customize the featured measure. + */ + featureMeasures?: Array; + + /**Contains property to customize the fields. + */ + fields?: QuantitativeScaleSettingsFields; + + /**Specifies the interval for the Graph. + * @Default {1} + */ + interval?: number; + + /**Contains property to customize the labels. + */ + labelSettings?: QuantitativeScaleSettingsLabelSettings; + + /**Contains property to customize the position of the quantitative scale + */ + location?: QuantitativeScaleSettingsLocation; + + /**Contains property to customize the major tick lines. + */ + majorTickSettings?: QuantitativeScaleSettingsMajorTickSettings; + + /**Specifies the maximum value of the Graph. + * @Default {10} + */ + maximum?: number; + + /**Specifies the minimum value of the Graph. + * @Default {0} + */ + minimum?: number; + + /**Contains property to customize the minor ticks. + */ + minorTickSettings?: QuantitativeScaleSettingsMinorTickSettings; + + /**The specified number of minor ticks will be rendered per interval. + * @Default {4} + */ + minorTicksPerInterval?: number; + + /**Specifies the placement of ticks to render either inside or outside the scale. + * @Default {ej.datavisualization.BulletGraph.TickPlacement.Outside} + */ + tickPlacement?: ej.datavisualization.BulletGraph.TickPlacement|string; + + /**Specifies the position of the ticks to render either above,below or inside + * @Default {ej.datavisualization.BulletGraph.TickPosition.Far} + */ + tickPosition?: ej.datavisualization.BulletGraph.TickPosition|string; +} + +export interface TooltipSettings { + + /**Specifies template for caption tooltip + * @Default {null} + */ + captionTemplate?: string; + + /**Toggles the visibility of caption tooltip + * @Default {false} + */ + enableCaptionTooltip?: boolean; + + /**Specifies the ID of a div, which is to be displayed as tooltip. + * @Default {null} + */ + template?: string; + + /**Toggles the visibility of tooltip + * @Default {true} + */ + visible?: boolean; +} +} +module BulletGraph +{ +enum FontStyle +{ +//string +Normal, +//string +Italic, +//string +Oblique, +} +} +module BulletGraph +{ +enum FontWeight +{ +//string +Normal, +//string +Bold, +//string +Bolder, +//string +Lighter, +} +} +module BulletGraph +{ +enum TextAlignment +{ +//string +Near, +//string +Far, +//string +Center, +} +} +module BulletGraph +{ +enum TextAnchor +{ +//string +Start, +//string +Middle, +//string +End, +} +} +module BulletGraph +{ +enum TextPosition +{ +//string +Top, +//string +Right, +//string +Left, +//string +Bottom, +//string +Float, +} +} +module BulletGraph +{ +enum FlowDirection +{ +//string +Forward, +//string +Backward, +} +} +module BulletGraph +{ +enum Orientation +{ +//string +Horizontal, +//string +Vertical, +} +} +module BulletGraph +{ +enum LabelPlacement +{ +//string +Inside, +//string +Outside, +} +} +module BulletGraph +{ +enum LabelPosition +{ +//string +Above, +//string +Below, +} +} +module BulletGraph +{ +enum TickPlacement +{ +//string +Inside, +//string +Outside, +} +} +module BulletGraph +{ +enum TickPosition +{ +//string +Below, +//string +Above, +//string +Cross, +} +} + +class Barcode extends ej.Widget { + static fn: Barcode; + constructor(element: JQuery, options?: Barcode.Model); + constructor(element: Element, options?: Barcode.Model); + model:Barcode.Model; + defaults:Barcode.Model; + + /** To disable the barcode + * @returns {void} + */ + disable(): void; + + /** To enable the barcode + * @returns {void} + */ + enable(): void; +} +export module Barcode{ + +export interface Model { + + /**Specifies the distance between the barcode and text below it. + */ + barcodeToTextGapHeight?: number; + + /**Specifies the height of bars in the Barcode. By modifying the barHeight, the entire barcode height can be customized. Please refer to xDimension for two dimensional barcode height customization. + */ + barHeight?: number; + + /**Specifies the dark bar color of the Barcode. One dimensional barcode contains a series of dark and light bars which are usually colored as black and white respectively. + */ + darkBarColor?: any; + + /**Specifies whether the text below the barcode is visible or hidden. + */ + displayText?: boolean; + + /**Specifies whether the control is enabled. + */ + enabled?: boolean; + + /**Specifies the start and stop encode symbol in the Barcode. In one dimensional barcodes, an additional character is added as start and stop delimiters. These symbols are optional and the unique of the symbol allows the reader to determine the direction of the barcode being scanned. + */ + encodeStartStopSymbol?: number; + + /**Specifies the light bar color of the Barcode. One dimensional barcode contains a series of dark and light bars which are usually colored as black and white respectively. + */ + lightBarColor?: any; + + /**Specifies the width of the narrow bars in the barcode. The dark bars in the one dimensional barcode contains random narrow and wide bars based on the provided input which can be specified during initialization. + */ + narrowBarWidth?: number; + + /**Specifies the width of the quiet zone. In barcode, a quiet zone is the blank margin on either side of a barcode which informs the reader where a barcode's symbology starts and stops. The purpose of a quiet zone is to prevent the reader from picking up unrelated information. + */ + quietZone?: QuietZone; + + /**Specifies the type of the Barcode. See SymbologyType + */ + symbologyType?: ej.datavisualization.Barcode.SymbologyType|string; + + /**Specifies the text to be encoded in the barcode. + */ + text?: string; + + /**Specifies the color of the text/data at the bottom of the barcode. + */ + textColor?: any; + + /**Specifies the width of the wide bars in the barcode. One dimensional barcode usually contains random narrow and wide bars based on the provided which can be customized during initialization. + */ + wideBarWidth?: number; + + /**Specifies the width of the narrowest element(bar or space) in a barcode. The greater the x dimension, the more easily a barcode reader will scan. + */ + xDimension?: number; + + /**Fires after Barcode control is loaded.*/ + load? (e: LoadEventArgs): void; +} + +export interface LoadEventArgs { + + /**if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /**returns the barcode model + */ + model?: any; + + /**returns the name of the event + */ + type?: string; + + /**return the barcode state + */ + status?: boolean; +} + +export interface QuietZone { + + /**Specifies the quiet zone around the Barcode. + */ + all?: number; + + /**Specifies the bottom quiet zone of the Barcode. + */ + bottom?: number; + + /**Specifies the left quiet zone of the Barcode. + */ + left?: number; + + /**Specifies the right quiet zone of the Barcode. + */ + right?: number; + + /**Specifies the top quiet zone of the Barcode. + */ + top?: number; +} +} +module Barcode +{ +enum SymbologyType +{ +//Represents the QR code +QRBarcode, +//Represents the Data Matrix barcode +DataMatrix, +//Represents the Code 39 barcode +Code39, +//Represents the Code 39 Extended barcode +Code39Extended, +//Represents the Code 11 barcode +Code11, +//Represents the Codabar barcode +Codabar, +//Represents the Code 32 barcode +Code32, +//Represents the Code 93 barcode +Code93, +//Represents the Code 93 Extended barcode +Code93Extended, +//Represents the Code 128 A barcode +Code128A, +//Represents the Code 128 B barcode +Code128B, +//Represents the Code 128 C barcode +Code128C, +} +} + +class Map extends ej.Widget { + static fn: Map; + constructor(element: JQuery, options?: Map.Model); + constructor(element: Element, options?: Map.Model); + model:Map.Model; + defaults:Map.Model; + + /** Method for navigating to specific shape based on latitude, longitude and zoomlevel. + * @param {number} Pass the latitude value for map + * @param {number} Pass the longitude value for map + * @param {number} Pass the zoom level for map + * @returns {void} + */ + navigateTo(latitude: number, longitude: number, level: number): void; + + /** Method to perform map panning + * @param {string} Pass the direction in which map should be panned + * @returns {void} + */ + pan(direction: string): void; + + /** Method to reload the map. + * @returns {void} + */ + refresh(): void; + + /** Method to reload the shapeLayers with updated values + * @returns {void} + */ + refreshLayers(): void; + + /** Method to reload the navigation control with updated values. + * @param {any} Pass the navigation control instance + * @returns {void} + */ + refreshNavigationControl(navigation: any): void; + + /** Method to perform map zooming. + * @param {number} Pass the zoom level for map to be zoomed + * @param {boolean} Pass the boolean value to enable or disable animation while zooming + * @returns {void} + */ + zoom(level: number, isAnimate: boolean): void; +} +export module Map{ + +export interface Model { + + /**Specifies the background color for map + * @Default {white} + */ + background?: string; + + /**Specifies the base map-index of the map to determine the shapelayer to be displayed + * @Default {0} + */ + baseMapIndex?: number; + + /**Specify the center position where map should be displayed + * @Default {[0,0]} + */ + centerPosition?: any; + + /**Enables or Disables the map animation + * @Default {false} + */ + enableAnimation?: boolean; + + /**Enables or Disables the animation for layer change in map + * @Default {false} + */ + enableLayerChangeAnimation?: boolean; + + /**Enables or Disables the map panning + * @Default {true} + */ + enablePan?: boolean; + + /**Determines whether map need to resize when container is resized + * @Default {true} + */ + enableResize?: boolean; + + /**Enables or Disables the zooming of map + * @Default {true} + */ + enableZoom?: boolean; + + /**Enables or Disables the zoom on selecting the map shape + * @Default {false} + */ + enableZoomOnSelection?: boolean; + + /**Specifies the zoom factor for map zoom value. + * @Default {1} + */ + factor?: number; + + /**Hold the shapelayers to be displayed in map + * @Default {[]} + */ + layers?: Array; + + /**Specifies the zoom level value for which map to be zoomed + * @Default {1} + */ + level?: number; + + /**Specifies the maximum zoom level of the map + * @Default {100} + */ + maxValue?: number; + + /**Specifies the minimum zoomSettings level of the map + * @Default {1} + */ + minValue?: number; + + /**Enables or Disables the navigation control for map to perform zooming and panning on map shapes. + */ + navigationControl?: any; + + /**Layer for holding the map shapes + */ + shapeLayer?: ShapeLayer; + + /**Enables or Disables the Zooming for map. + */ + zoomSettings?: any; + + /**Triggered on selecting the map markers.*/ + markerSelected? (e: MarkerSelectedEventArgs): void; + + /**Triggers while leaving the hovered map shape*/ + mouseleave? (e: MouseleaveEventArgs): void; + + /**Triggers while hovering the map shape.*/ + mouseover? (e: MouseoverEventArgs): void; + + /**Triggers once map render completed.*/ + onRenderComplete? (e: OnRenderCompleteEventArgs): void; + + /**Triggers when map panning ends.*/ + panned? (e: PannedEventArgs): void; + + /**Triggered on selecting the map shapes.*/ + shapeSelected? (e: ShapeSelectedEventArgs): void; + + /**Triggered when map is zoomed-in.*/ + zoomedIn? (e: ZoomedInEventArgs): void; + + /**Triggers when map is zoomed out.*/ + zoomedOut? (e: ZoomedOutEventArgs): void; +} + +export interface MarkerSelectedEventArgs { + + /**Returns marker object. + */ + originalEvent?: any; +} + +export interface MouseleaveEventArgs { + + /**Returns hovered map shape object. + */ + originalEvent?: any; +} + +export interface MouseoverEventArgs { + + /**Returns hovered map shape object. + */ + originalEvent?: any; +} + +export interface OnRenderCompleteEventArgs { + + /**Event parameters from map + */ + originalEvent?: any; +} + +export interface PannedEventArgs { + + /**Event parameters from map + */ + originalEvent?: any; +} + +export interface ShapeSelectedEventArgs { + + /**Returns selected shape object. + */ + originalEvent?: any; +} + +export interface ZoomedInEventArgs { + + /**Event parameters from map + */ + originalEvent?: any; + + /**Returns zoom level value for which the map is zoomed. + */ + zoomLevel?: any; +} + +export interface ZoomedOutEventArgs { + + /**Event parameters from map + */ + originalEvent?: any; + + /**Returns zoom level value for which the map is zoomed. + */ + zoomLevel?: any; +} + +export interface ShapeLayerBubbleSettings { + + /**Specifies the bubble Opacity value of bubbles for shape layer in map + * @Default {0.9} + */ + bubbleOpacity?: number; + + /**Specifies the mouse hover color of the shape layer in map + * @Default {gray} + */ + color?: string; + + /**Specifies the colorMappings of the shape layer in map + * @Default {null} + */ + colorMappings?: any; + + /**Specifies the bubble color valuePath of the shape layer in map + * @Default {null} + */ + colorValuePath?: string; + + /**Specifies the maximum size value of bubbles for shape layer in map + * @Default {20} + */ + maxValue?: number; + + /**Specifies the minimum size value of bubbles for shape layer in map + * @Default {10} + */ + minValue?: number; + + /**Specifies the showBubble visibility status map + * @Default {true} + */ + showBubble?: boolean; + + /**Specifies the tooltip visibility status of the shape layer in map + * @Default {false} + */ + showTooltip?: boolean; + + /**Specifies the bubble tooltip template of the shape layer in map + * @Default {null} + */ + tooltipTemplate?: string; + + /**Specifies the bubble valuePath of the shape layer in map + * @Default {null} + */ + valuePath?: string; +} + +export interface ShapeLayerLabelSettings { + + /**enable or disable the enableSmartLabel property + * @Default {false} + */ + enableSmartLabel?: boolean; + + /**set the labelLength property + * @Default {'2'} + */ + labelLength?: number; + + /**set the labelPath property + * @Default {null} + */ + labelPath?: string; + + /**enable or disable the showlabel property + * @Default {false} + */ + showLabels?: boolean; + + /**set the smartLabelSize property + * @Default {fixed} + */ + smartLabelSize?: ej.datavisualization.Map.LabelSize|string; +} + +export interface ShapeLayerLegendSettings { + + /**Determines whether the legend should be placed outside or inside the map bounds + * @Default {false} + */ + dockOnMap?: boolean; + + /**Determines the legend placement and it is valid only when dockOnMap is true + * @Default {top} + */ + dockPosition?: ej.datavisualization.Map.DockPosition|string; + + /**height value for legend setting + * @Default {0} + */ + height?: number; + + /**to get icon value for legend setting + * @Default {rectangle} + */ + icon?: ej.datavisualization.Map.LegendIcons|string; + + /**icon height value for legend setting + * @Default {20} + */ + iconHeight?: number; + + /**icon Width value for legend setting + * @Default {20} + */ + iconWidth?: number; + + /**set the orientation of legend labels + * @Default {vertical} + */ + labelOrientation?: ej.datavisualization.Map.LabelOrientation|string; + + /**to get leftLabel value for legend setting + * @Default {null} + */ + leftLabel?: string; + + /**to get mode of legend setting + * @Default {default} + */ + mode?: ej.datavisualization.Map.LegendMode|string; + + /**set the position of legend settings + * @Default {topleft} + */ + position?: ej.datavisualization.Map.Position|string; + + /**x position value for legend setting + * @Default {0} + */ + positionX?: number; + + /**y position value for legend setting + * @Default {0} + */ + positionY?: number; + + /**to get rightLabel value for legend setting + * @Default {null} + */ + rightLabel?: string; + + /**Enables or Disables the showLabels + * @Default {false} + */ + showLabels?: boolean; + + /**Enables or Disables the showLegend + * @Default {false} + */ + showLegend?: boolean; + + /**to get title of legend setting + * @Default {null} + */ + title?: string; + + /**to get type of legend setting + * @Default {layers} + */ + type?: ej.datavisualization.Map.LegendType|string; + + /**width value for legend setting + * @Default {0} + */ + width?: number; +} + +export interface ShapeLayerShapeSettings { + + /**Enables or Disables the auto fill colors for shape layer in map. When this property value set to true, shapes will be filled with palette colors. + * @Default {false} + */ + autoFill?: boolean; + + /**Specifies the colorMappings of the shape layer in map + * @Default {null} + */ + colorMappings?: any; + + /**Specifies the shape color palette value of the shape layer in map. Accepted colorPalette values are palette1, palette2, palette3 and custompalette. + * @Default {palette1} + */ + colorPalette?: string; + + /**Specifies the shape color valuePath of the shape layer in map + * @Default {null} + */ + colorValuePath?: string; + + /**Enables or Disables the gradient colors for map shapes. + * @Default {false} + */ + enableGradient?: boolean; + + /**Specifies the shape fill color of the shape layer in map + * @Default {#E5E5E5} + */ + fill?: string; + + /**Specifies the mouse over width of the shape layer in map + * @Default {1} + */ + highlightBorderWidth?: number; + + /**Specifies the mouse hover color of the shape layer in map + * @Default {gray} + */ + highlightColor?: string; + + /**Specifies the mouse over stroke color of the shape layer in map + * @Default {#C1C1C1} + */ + highlightStroke?: string; + + /**Specifies the shape selection color of the shape layer in map + * @Default {gray} + */ + selectionColor?: string; + + /**Specifies the shape selection stroke color of the shape layer in map + * @Default {#C1C1C1} + */ + selectionStroke?: string; + + /**Specifies the shape selection stroke width of the shape layer in map + * @Default {1} + */ + selectionStrokeWidth?: number; + + /**Specifies the shape stroke color of the shape layer in map + * @Default {#C1C1C1} + */ + stroke?: string; + + /**Specifies the shape stroke thickness value of the shape layer in map + * @Default {0.2} + */ + strokeThickness?: number; + + /**Specifies the shape valuePath of the shape layer in map + * @Default {null} + */ + valuePath?: string; +} + +export interface ShapeLayer { + + /**to get the type of bing map. + * @Default {aerial} + */ + bingMapType?: ej.datavisualization.Map.BingMapType|string; + + /**Specifies the bubble settings for map + */ + bubbleSettings?: ShapeLayerBubbleSettings; + + /**Specifies the datasource for the shape layer + */ + dataSource?: any; + + /**Enables or disables the animation + * @Default {false} + */ + enableAnimation?: boolean; + + /**Enables or disables the shape mouse hover + * @Default {false} + */ + enableMouseHover?: boolean; + + /**Enables or disables the shape selection + * @Default {true} + */ + enableSelection?: boolean; + + /**to get the key of bing map + * @Default {null} + */ + key?: string; + + /**Options for enabling and configuring labelSettings labelPath, smartLabelSize, labelLength etc., + */ + labelSettings?: ShapeLayerLabelSettings; + + /**Specifies the map type. + * @Default {'geometry'} + */ + layerType?: ej.datavisualization.Map.LayerType|string; + + /**Options for enabling and configuring legendSettings position, height, width, mode, type etc., + */ + legendSettings?: ShapeLayerLegendSettings; + + /**Specifies the map items template for shapes. + */ + mapItemsTemplate?: string; + + /**Specify markers for shape layer. + * @Default {[]} + */ + markers?: Array; + + /**Specifies the map marker template for map layer. + * @Default {null} + */ + markerTemplate?: string; + + /**Specify selectedMapShapes for shape layer + * @Default {[]} + */ + selectedMapShapes?: Array; + + /**Specifies the selection mode of the map. Accepted selection mode values are Default and Multiple. + * @Default {default} + */ + selectionMode?: ej.datavisualization.Map.SelectionMode|string; + + /**Specifies the shape data for the shape layer + */ + shapeDataobject?: any; + + /**Specifies the shape settings of map layer + */ + shapeSettings?: ShapeLayerShapeSettings; + + /**Shows or hides the map items. + * @Default {false} + */ + showMapItems?: boolean; + + /**Shows or hides the tooltip for shapes + * @Default {false} + */ + showTooltip?: boolean; + + /**Specifies the sub shape layers + * @Default {[]} + */ + subLayers?: Array; + + /**Specifies the tooltip template for shapes. + */ + tooltipTemplate?: string; + + /**Specifies the url template for the OSM type map. + * @Default {'http://a.tile.openstreetmap.org/level/tileX/tileY.png'} + */ + urlTemplate?: string; +} +} +module Map +{ +enum Position +{ +//specifies the none position +None, +//specifies the topleft position +Topleft, +//specifies the topcenter position +Topcenter, +//specifies the topright position +Topright, +//specifies the centerleft position +Centerleft, +//specifies the center position +Center, +//specifies the centerright position +Centerright, +//specifies the bottomleft position +Bottomleft, +//specifies the bottomcenter position +Bottomcenter, +//specifies the bottomright position +Bottomright, +} +} +module Map +{ +enum Orientation +{ +//specifies the horizontal position +Horizontal, +//specifies the vertical position +Vertical, +} +} +module Map +{ +enum BingMapType +{ +//specifies the aerial type +Aerial, +//specifies the aerialwithlabel type +Aerialwithlabel, +//specifies the road type +Road, +} +} +module Map +{ +enum LabelSize +{ +//specifies the fixed size +Fixed, +//specifies the default size +Default, +} +} +module Map +{ +enum LayerType +{ +//specifies the geometry type +Geometry, +//specifies the osm type +Osm, +//specifies the bing type +Bing, +} +} +module Map +{ +enum DockPosition +{ +//specifies the top position +Top, +//specifies the bottom position +Bottom, +//specifies the bottom position +Right, +//specifies the left position +Left, +} +} +module Map +{ +enum LegendIcons +{ +//specifies the rectangle position +Rectangle, +//specifies the circle position +Circle, +} +} +module Map +{ +enum LabelOrientation +{ +//specifies the horizontal position +Horizontal, +//specifies the vertical position +Vertical, +} +} +module Map +{ +enum LegendMode +{ +//specifies the default mode +Default, +//specifies the interactive mode +Interactive, +} +} +module Map +{ +enum LegendType +{ +//specifies the layers type +Layers, +//specifies the bubbles type +Bubbles, +} +} +module Map +{ +enum SelectionMode +{ +//specifies the default position +Default, +//specifies the multiple position +Multiple, +} +} + +class TreeMap extends ej.Widget { + static fn: TreeMap; + constructor(element: JQuery, options?: TreeMap.Model); + constructor(element: Element, options?: TreeMap.Model); + model:TreeMap.Model; + defaults:TreeMap.Model; + + /** Method to reload treemap with updated values. + * @returns {void} + */ + refresh(): void; +} +export module TreeMap{ + +export interface Model { + + /**Specifies the border brush color of the treemap + * @Default {white} + */ + borderBrush?: string; + + /**Specifies the border thickness of the treemap + * @Default {1} + */ + borderThickness?: number; + + /**Specifies the colors of the paletteColorMapping + * @Default {[]} + */ + colors?: Array; + + /**Specifies the color valuepath of the treemap + * @Default {null} + */ + colorValuePath?: string; + + /**Specifies the datasource of the treemap + * @Default {null} + */ + dataSource?: any; + + /**Specifies the desaturationColorMapping settings of the treemap + */ + desaturationColorMapping?: any; + + /**Specifies the dockPosition for legend + * @Default {top} + */ + dockPosition?: ej.datavisualization.TreeMap.DockPosition|string; + + /**specifies the drillDown header color + * @Default {'null'} + */ + drillDownHeaderColor?: string; + + /**specifies the drillDown selection color + * @Default {'#000000'} + */ + drillDownSelectionColor?: string; + + /**Enable/Disable the drillDown for treemap + * @Default {false} + */ + enableDrillDown?: boolean; + + /**Specifies whether treemap need to resize when container is resized + * @Default {true} + */ + enableResize?: boolean; + + /**Specifies the from value for desaturation color mapping + * @Default {0} + */ + from?: number; + + /**Specifies the group color mapping of the treemap + * @Default {[]} + */ + groupColorMapping?: Array; + + /**Specifies the height for legend + * @Default {30} + */ + height?: number; + + /**Specifies the highlight border brush of treemap + * @Default {gray} + */ + highlightBorderBrush?: string; + + /**Specifies the border thickness when treemap items is highlighted in the treemap + * @Default {5} + */ + highlightBorderThickness?: number; + + /**Specifies the highlight border brush of treemap + * @Default {gray} + */ + highlightGroupBorderBrush?: string; + + /**Specifies the border thickness when treemap items is highlighted in the treemap + * @Default {5} + */ + highlightGroupBorderThickness?: number; + + /**Specifies whether treemap item need to highlighted on selection + * @Default {false} + */ + highlightGroupOnSelection?: boolean; + + /**Specifies whether treemap item need to highlighted on selection + * @Default {false} + */ + highlightOnSelection?: boolean; + + /**Specifies the iconHeight for legend + * @Default {15} + */ + iconHeight?: number; + + /**Specifies the iconWidth for legend + * @Default {15} + */ + iconWidth?: number; + + /**Specifies the items layout mode of the treemap. Accepted itemsLayoutMode values are Squarified, SliceAndDiceHorizontal, SliceAndDiceVertical and SliceAndDiceAuto + * @Default {Squarified} + */ + itemsLayoutMode?: ej.datavisualization.TreeMap.ItemsLayoutMode|string; + + /**Specifies the leaf settings of the treemap + */ + leafItemSettings?: LeafItemSettings; + + /**Specifies the legend settings of the treemap + */ + legendSettings?: any; + + /**Specify levels of treemap for grouped visualization of datas + * @Default {[]} + */ + levels?: Array; + + /**Specifies the paletteColorMapping of the treemap + */ + paletteColorMapping?: any; + + /**Specifies the rangeColorMapping settings of the treemap + */ + rangeColorMapping?: Array; + + /**Specifies the rangeMaximum value for desaturation color mapping + * @Default {0} + */ + rangeMaximum?: number; + + /**Specifies the rangeMinimum value for desaturation color mapping + * @Default {0} + */ + rangeMinimum?: number; + + /**Specifies the legend visibility status of the treemap + * @Default {false} + */ + showLegend?: boolean; + + /**Specifies whether treemap tooltip need to be visible + * @Default {false} + */ + showTooltip?: boolean; + + /**Specifies the template for legendSettings + * @Default {null} + */ + template?: string; + + /**Specifies the to value for desaturation color mapping + * @Default {0} + */ + to?: number; + + /**Specifies the tooltip template of the treemap + * @Default {null} + */ + tooltipTemplate?: string; + + /**Hold the treeMapItems to be displayed in treemap + * @Default {[]} + */ + treeMapItems?: Array; + + /**Hold the Level settings of TreeMap + */ + treeMapLevel?: TreeMapLevel; + + /**Specifies the uniColorMapping settings of the treemap + */ + uniColorMapping?: any; + + /**Specifies the weight valuepath of the treemap + * @Default {null} + */ + weightValuePath?: string; + + /**Specifies the width for legend + * @Default {100} + */ + width?: number; + + /**Triggers on treemap item selected.*/ + treeMapItemSelected? (e: TreeMapItemSelectedEventArgs): void; +} + +export interface TreeMapItemSelectedEventArgs { + + /**Returns selected treeMapItem object. + */ + originalEvent?: any; +} + +export interface LeafItemSettings { + + /**Specifies the border bruch color of the leaf item. + * @Default {white} + */ + borderBrush?: string; + + /**Specifies the border thickness of the leaf item. + * @Default {1} + */ + borderThickness?: number; + + /**Specifies the label template of the leaf item. + * @Default {null} + */ + itemTemplate?: string; + + /**Specifies the label path of the leaf item. + * @Default {null} + */ + labelPath?: string; + + /**Specifies the position of the leaf labels. + * @Default {center} + */ + labelPosition?: ej.datavisualization.TreeMap.Position|string; + + /**Specifies the mode of label visibility + * @Default {visible} + */ + labelVisibilityMode?: ej.datavisualization.TreeMap.VisibilityMode|string; + + /**Shows or hides the label of the leaf item. + * @Default {false} + */ + showLabels?: boolean; +} + +export interface TreeMapLevel { + + /**specifies the group background + * @Default {null} + */ + groupBackground?: string; + + /**Specifies the group border color for tree map level. + * @Default {null} + */ + groupBorderColor?: string; + + /**Specifies the group border thickness for tree map level. + * @Default {1} + */ + groupBorderThickness?: number; + + /**Specifies the group gap for tree map level. + * @Default {1} + */ + groupGap?: number; + + /**Specifies the group padding for tree map level. + * @Default {4} + */ + groupPadding?: number; + + /**Specifies the group path for tree map level. + */ + groupPath?: string; + + /**Specifies the header height for tree map level. + * @Default {0} + */ + headerHeight?: number; + + /**Specifies the header template for tree map level. + * @Default {null} + */ + headerTemplate?: string; + + /**Specifies the mode of header visibility + * @Default {visible} + */ + headerVisibilityMode?: ej.datavisualization.TreeMap.VisibilityMode|string; + + /**Specifies the position of the labels. + * @Default {center} + */ + labelPosition?: ej.datavisualization.TreeMap.Position|string; + + /**Specifies the label template for tree map level. + * @Default {null} + */ + labelTemplate?: string; + + /**Specifies the mode of label visibility + * @Default {visible} + */ + labelVisibilityMode?: ej.datavisualization.TreeMap.VisibilityMode|string; + + /**Shows or hides the header for tree map level. + * @Default {false} + */ + showHeader?: boolean; + + /**Shows or hides the labels for tree map level. + * @Default {false} + */ + showLabels?: boolean; +} +} +module TreeMap +{ +enum DockPosition +{ +//specifies the top position +Top, +//specifies the bottom position +Bottom, +//specifies the bottom position +Right, +//specifies the left position +Left, +} +} +module TreeMap +{ +enum ItemsLayoutMode +{ +//specifies the squarified as layout type position +Squarified, +//specifies the sliceanddicehorizontal as layout type position +Sliceanddicehorizontal, +//specifies the sliceanddicevertical as layout type position +Sliceanddicevertical, +//specifies the sliceanddiceauto as layout type position +Sliceanddiceauto, +} +} +module TreeMap +{ +enum Position +{ +//specifies the none position +None, +//specifies the topleft position +Topleft, +//specifies the topcenter position +Topcenter, +//specifies the topright position +Topright, +//specifies the centerleft position +Centerleft, +//specifies the center position +Center, +//specifies the centerright position +Centerright, +//specifies the bottomleft position +Bottomleft, +//specifies the bottomcenter position +Bottomcenter, +//specifies the bottomright position +Bottomright, +} +} +module TreeMap +{ +enum VisibilityMode +{ +//specifies the visible mode +Top, +//specifies the hideonexceededlength mode +Hideonexceededlength, +} +} +module TreeMap +{ +enum groupSelectionMode +{ +//specifies the default mode +Default, +//specifies the multiple mode +Multiple, +} +} + +class Diagram extends ej.Widget { + static fn: Diagram; + constructor(element: JQuery, options?: Diagram.Model); + constructor(element: Element, options?: Diagram.Model); + model:Diagram.Model; + defaults:Diagram.Model; + + /** Add nodes and connectors to diagram at runtime + * @param {any} a JSON to define a node/connector or an array of nodes and connector + * @returns {void} + */ + add(node: any): void; + + /** Add a label to a node at runtime + * @param {string} name of the node to which label will be added + * @param {any} JSON for the new label to be added + * @returns {void} + */ + addLabel(nodeName: string, newLabel: any): void; + + /** Add a phase to a swimlane at runtime + * @param {string} name of the swimlane to which the phase will be added + * @param {any} JSON object to define the phase to be added + * @returns {void} + */ + addPhase(name: string, options: any): void; + + /** Add a collection of ports to the node specified by name + * @param {string} name of the node to which the ports have to be added + * @param {Array} a collection of ports to be added to the specified node + * @returns {void} + */ + addPorts(name: string, ports: Array): void; + + /** Add the specified node to selection list + * @param {any} the node to be selected + * @param {boolean} to define whether to clear the existing selection or not + * @returns {void} + */ + addSelection(node: any, clearSelection: boolean): void; + + /** Align the selected objects based on the reference object and direction + * @param {string} to specify the direction towards which the selected objects are to be aligned("left","right",top","bottom") + * @returns {void} + */ + align(direction: string): void; + + /** Bring the specified portion of the diagram content to the diagram viewport + * @param {any} the rectangular region that is to be brought into diagram viewport + * @returns {void} + */ + bringIntoView(rect: any): void; + + /** Bring the specified portion of the diagram content to the center of the diagram viewport + * @param {any} the rectangular region that is to be brought to the center of diagram viewport + * @returns {void} + */ + bringToCenter(rect: any): void; + + /** Visually move the selected object over all other intersected objects + * @returns {void} + */ + bringToFront(): void; + + /** Remove all the elements from diagram + * @returns {void} + */ + clear(): void; + + /** Remove the current selection in diagram + * @returns {void} + */ + clearSelection(): void; + + /** Copy the selected object to internal clipboard and get the copied object + * @returns {any} + */ + copy(): any; + + /** Cut the selected object from diagram to diagram internal clipboard + * @returns {void} + */ + cut(): void; + + /** Export the diagram as downloadable files or as data + * @param {Diagram.Options} options to export the desired region of diagram to the desired formats.NameTypeDescriptionfileNamestringname of the file to be downloaded.formatstringformat of the exported file/data. See [File Formats](/js/api/global#fileformats).modestringto set whether to export diagram as a file or as raw data. See [Export Modes](/js/api/global#exportmodes).regionstringto set the region of the diagram to be exported. See [Region](/js/api/global#region).boundsobjectto export any custom region of diagram.marginobjectto set margin to the exported data. + * @returns {string} + */ + exportDiagram(options: Diagram.Options): string; + + /** Read a node/connector object by its name + * @param {string} name of the node/connector that is to be identified + * @returns {any} + */ + findNode(name: string): any; + + /** Fit the diagram content into diagram viewport + * @param {string} to set the mode of fit to command. See [Fit Mode](/js/api/global#fitmode) + * @param {string} to set whether the region to be fit will be based on diagram elements or page settings [Region](/js/api/global#region) + * @param {any} to set the required margin + * @returns {void} + */ + fitToPage(mode: string, region: string, margin: any): void; + + /** Group the selected nodes and connectors + * @returns {void} + */ + group(): void; + + /** Insert a label into a node's label collection at runtime + * @param {string} name of the node to which the label has to be inserted + * @param {any} JSON to define the new label + * @param {number} index to insert the label into the node + * @returns {void} + */ + insertLabel(name: string, label: any, index: number): void; + + /** Refresh the diagram with the specified layout + * @returns {void} + */ + layout(): void; + + /** Load the diagram + * @param {any} JSON data to load the diagram + * @returns {void} + */ + load(data: any): void; + + /** Visually move the selected object over its closest intersected object + * @returns {void} + */ + moveForward(): void; + + /** Move the selected objects by either one pixel or by the pixels specified through argument + * @param {string} specifies the direction to move the selected objects ("left","right",top","bottom") + * @param {number} specifies the number of pixels by which the selected objects have to be moved + * @returns {void} + */ + nudge(direction: string, delta: number): void; + + /** Paste the selected object from internal clipboard to diagram + * @param {any} object to be added to diagram + * @param {boolean} to define whether the specified object is to be renamed or not + * @returns {void} + */ + paste(object: any, rename: boolean): void; + + /** Print the diagram as image + * @returns {void} + */ + print(): void; + + /** Restore the last action that was reverted + * @returns {void} + */ + redo(): void; + + /** Refresh the diagram at runtime + * @returns {void} + */ + refresh(): void; + + /** Remove either the given node/connector or the selected element from diagram + * @param {any} the node/connector to be removed from diagram + * @returns {void} + */ + remove(node: any): void; + + /** Remove a particular object from selection list + * @param {any} the node/connector to be removed from selection list + * @returns {void} + */ + removeSelection(node: any): void; + + /** Scale the selected objects to the height of the first selected object + * @returns {void} + */ + sameHeight(): void; + + /** Scale the selected objects to the size of the first selected object + * @returns {void} + */ + sameSize(): void; + + /** Scale the selected objects to the width of the first selected object + * @returns {void} + */ + sameWidth(): void; + + /** Returns the diagram as serialized JSON + * @returns {any} + */ + save(): any; + + /** Bring the node into view + * @param {any} the node/connector to be brought into view + * @returns {void} + */ + scrollToNode(node: any): void; + + /** Select all nodes and connector in diagram + * @returns {void} + */ + selectAll(): void; + + /** Visually move the selected object behind its closest intersected object + * @returns {void} + */ + sendBackward(): void; + + /** Visually move the selected object behind all other intersected objects + * @returns {void} + */ + sendToBack(): void; + + /** Update the horizontal space between the selected objects as equal and within the selection boundary + * @returns {void} + */ + spaceAcross(): void; + + /** Update the vertical space between the selected objects as equal and within the selection boundary + * @returns {void} + */ + spaceDown(): void; + + /** Move the specified label to edit mode + * @param {any} node/connector that contains the label to be edited + * @param {any} to be edited + * @returns {void} + */ + startLabelEdit(node: any, label: any): void; + + /** Reverse the last action that was performed + * @returns {void} + */ + undo(): void; + + /** Ungroup the selected group + * @returns {void} + */ + ungroup(): void; + + /** Update diagram at runtime + * @param {any} JSON to specify the diagram properties that have to be modified + * @returns {void} + */ + update(options: any): void; + + /** Update Connectors at runtime + * @param {string} name of the connector to be updated + * @param {any} JSON to specify the connector properties that have to be updated + * @returns {void} + */ + updateConnector(name: string, options: any): void; + + /** Update the given label at runtime + * @param {string} the name of node/connector which contains the label to be updated + * @param {any} the label to be modified + * @param {any} JSON to specify the label properties that have to be updated + * @returns {any} + */ + updateLabel(nodeName: string, label: any, options: any): any; + + /** Update nodes at runtime + * @param {string} name of the node that is to be updated + * @param {any} JSON to specify the properties of node that have to be updated + * @returns {void} + */ + updateNode(name: string, options: any): void; + + /** Update a port with its modified properties at runtime + * @param {string} the name of node which contains the port to be updated + * @param {any} the port to be updated + * @param {any} JSON to specify the properties of the port that have to be updated + * @returns {void} + */ + updatePort(nodeName: string, port: any, options: any): void; + + /** Update the specified node as selected object + * @param {string} name of the node to be updated as selected object + * @returns {void} + */ + updateSelectedObject(name: string): void; + + /** Update the selection at runtime + * @param {boolean} to specify whether to show the user handles or not + * @returns {void} + */ + updateSelection(showUserHandles: boolean): void; + + /** Update userhandles with respect to the given node + * @param {any} node/connector with respect to which, the user handles have to be updated + * @returns {void} + */ + updateUserHandles(node: any): void; + + /** Update the diagram viewport at runtime + * @returns {void} + */ + updateViewPort(): void; + + /** Upgrade the diagram from old version + * @param {any} to be upgraded + * @returns {void} + */ + upgrade(data: any): void; + + /** Used to zoomIn/zoomOut diagram + * @param {any} options to zoom the diagram(zoom factor, zoomIn/zoomOut) + * @returns {void} + */ + zoomTo(zoom: any): void; +} +export module Diagram{ + +export interface Options { + + /**name of the file to be downloaded. + */ + fileName?: string; + + /**format of the exported file/data. See [File Formats](/js/api/global#fileformats). + */ + format?: string; + + /**to set whether to export diagram as a file or as raw data. See [Export Modes](/js/api/global#exportmodes). + */ + mode?: string; + + /**to set the region of the diagram to be exported. See [Region](/js/api/global#region). + */ + region?: string; + + /**to export any custom region of diagram. + */ + bounds?: any; + + /**to set margin to the exported data. + */ + margin?: any; +} + +export interface Model { + + /**Defines the background color of diagram elements + * @Default {transparent} + */ + backgroundColor?: string; + + /**Defines the path of the background image of diagram elements + * @Default {null} + */ + backgroundImage?: string; + + /**Sets the direction of line bridges. + * @Default {ej.datavisualization.Diagram.BridgeDirection.Top} + */ + bridgeDirection?: ej.datavisualization.Diagram.BridgeDirection|string; + + /**Defines a set of custom commands and binds them with a set of desired key gestures. + */ + commandManager?: CommandManager; + + /**A collection of JSON objects where each object represents a connector + * @Default {[]} + */ + connectors?: Array; + + /**Binds the custom JSON data with connector properties + * @Default {null} + */ + connectorTemplate?: any; + + /**Enables/Disables the default behaviors of the diagram. + * @Default {ej.datavisualization.Diagram.DiagramConstraints.All} + */ + constraints?: ej.datavisualization.Diagram.DiagramConstraints|string; + + /**An object to customize the context menu of diagram + */ + contextMenu?: ContextMenu; + + /**Configures the data source that is to be bound with diagram + */ + dataSourceSettings?: DataSourceSettings; + + /**Initializes the default values for nodes and connectors + * @Default {{}} + */ + defaultSettings?: DefaultSettings; + + /**Sets the type of Json object to be drawn through drawing tool + * @Default {{}} + */ + drawType?: any; + + /**Enables or disables auto scroll in diagram + * @Default {true} + */ + enableAutoScroll?: boolean; + + /**Enables or disables diagram context menu + * @Default {true} + */ + enableContextMenu?: boolean; + + /**Specifies the height of the diagram + * @Default {null} + */ + height?: string; + + /**Customizes the undo redo functionality + */ + historyManager?: HistoryManager; + + /**Automatically arranges the nodes and connectors in a predefined manner + */ + layout?: Layout; + + /**Defines the current culture of diagram + * @Default {en-US} + */ + locale?: string; + + /**Array of JSON objects where each object represents a node + * @Default {[]} + */ + nodes?: Array; + + /**Binds the custom JSON data with node properties + * @Default {null} + */ + nodeTemplate?: any; + + /**Defines the size and appearance of diagram page + */ + pageSettings?: PageSettings; + + /**Defines the zoom value, zoom factor, scroll status and view port size of the diagram + */ + scrollSettings?: ScrollSettings; + + /**Defines the size and position of selected items and defines the appearance of selector + */ + selectedItems?: SelectedItems; + + /**Enables or disables tooltip of diagram + * @Default {true} + */ + showTooltip?: boolean; + + /**Defines the gridlines and defines how and when the objects have to be snapped + */ + snapSettings?: SnapSettings; + + /**Enables/Disables the interactive behaviors of diagram. + * @Default {ej.datavisualization.Diagram.Tool.All} + */ + tool?: ej.datavisualization.Diagram.Tool|string; + + /**An object that defines the description, appearance and alignments of tooltips + * @Default {null} + */ + tooltip?: Tooltip; + + /**Specifies the width of the diagram + * @Default {null} + */ + width?: string; + + /**Sets the factor by which we can zoom in or zoom out + * @Default {0.2} + */ + zoomFactor?: number; + + /**Triggers When auto scroll is changed*/ + autoScrollChange? (e: AutoScrollChangeEventArgs): void; + + /**Triggers when a node, connector or diagram is clicked*/ + click? (e: ClickEventArgs): void; + + /**Triggers when the connection is changed*/ + connectionChange? (e: ConnectionChangeEventArgs): void; + + /**Triggers when the connector collection is changed*/ + connectorCollectionChange? (e: ConnectorCollectionChangeEventArgs): void; + + /**Triggers when the connectors' source point is changed*/ + connectorSourceChange? (e: ConnectorSourceChangeEventArgs): void; + + /**Triggers when the connectors' target point is changed*/ + connectorTargetChange? (e: ConnectorTargetChangeEventArgs): void; + + /**Triggers before opening the context menu*/ + contextMenuBeforeOpen? (e: ContextMenuBeforeOpenEventArgs): void; + + /**Triggers when a context menu item is clicked*/ + contextMenuClick? (e: ContextMenuClickEventArgs): void; + + /**Triggers when a node, connector or diagram model is clicked twice*/ + doubleClick? (e: DoubleClickEventArgs): void; + + /**Triggers while dragging the elements in diagram*/ + drag? (e: DragEventArgs): void; + + /**Triggers when a symbol is dragged into diagram from symbol palette*/ + dragEnter? (e: DragEnterEventArgs): void; + + /**Triggers when a symbol is dragged outside of the diagram.*/ + dragLeave? (e: DragLeaveEventArgs): void; + + /**Triggers when a symbol is dragged over diagram*/ + dragOver? (e: DragOverEventArgs): void; + + /**Triggers when a symbol is dragged and dropped from symbol palette to drawing area*/ + drop? (e: DropEventArgs): void; + + /**Triggers when a child is added to or removed from a group*/ + groupChange? (e: GroupChangeEventArgs): void; + + /**Triggers when a diagram element is clicked*/ + itemClick? (e: ItemClickEventArgs): void; + + /**Triggers when mouse enters a node/connector*/ + mouseEnter? (e: MouseEnterEventArgs): void; + + /**Triggers when mouse leaves node/connector*/ + mouseLeave? (e: MouseLeaveEventArgs): void; + + /**Triggers when mouse hovers over a node/connector*/ + mouseOver? (e: MouseOverEventArgs): void; + + /**Triggers when node collection is changed*/ + nodeCollectionChange? (e: NodeCollectionChangeEventArgs): void; + + /**Triggers when the node properties(x, y,width and height alone) are changed using nudge commands or updateNode API.*/ + propertyChange? (e: PropertyChangeEventArgs): void; + + /**Triggers when the diagram elements are rotated*/ + rotationChange? (e: RotationChangeEventArgs): void; + + /**Triggers when the diagram is zoomed or panned*/ + scrollChange? (e: ScrollChangeEventArgs): void; + + /**Triggers when a connector segment is edited*/ + segmentChange? (e: SegmentChangeEventArgs): void; + + /**Triggers when the selection is changed in diagram*/ + selectionChange? (e: SelectionChangeEventArgs): void; + + /**Triggers when a node is resized*/ + sizeChange? (e: SizeChangeEventArgs): void; + + /**Triggers when label editing is ended*/ + textChange? (e: TextChangeEventArgs): void; +} + +export interface AutoScrollChangeEventArgs { + + /**Returns the delay between subsequent auto scrolls + */ + delay?: string; +} + +export interface ClickEventArgs { + + /**parameter returns the clicked node, connector or diagram + */ + element?: any; + + /**parameter returns the object that is actually clicked + */ + actualObject?: number; + + /**parameter returns the horizontal coordinate of the mouse pointer, relative to the diagram + */ + offsetX?: number; + + /**parameter returns the vertical coordinate of the mouse pointer, relative to the diagram + */ + offsetY?: number; + + /**parameter returns the count of how many times the mouse button is pressed + */ + count?: number; + + /**parameter returns the actual click event arguments that explains which button is clicked + */ + event?: any; +} + +export interface ConnectionChangeEventArgs { + + /**parameter returns the connection that is changed between nodes, ports or points + */ + element?: any; + + /**parameter returns the new source node or target node of the connector + */ + connection?: string; + + /**parameter returns the new source port or target port of the connector + */ + port?: any; + + /**parameter defines whether to cancel the change or not + */ + cancel?: boolean; +} + +export interface ConnectorCollectionChangeEventArgs { + + /**parameter returns whether the connector is inserted or removed + */ + changeType?: string; + + /**parameter returns the connector that is to be added or deleted + */ + element?: any; + + /**parameter defines whether to cancel the collection change or not + */ + cancel?: boolean; +} + +export interface ConnectorSourceChangeEventArgs { + + /**returns the connector, the source point of which is being dragged + */ + element?: any; + + /**returns the source node of the element + */ + node?: any; + + /**returns the source point of the element + */ + point?: any; + + /**returns the source port of the element + */ + port?: any; + + /**returns the state of connection end point dragging(starting, dragging, completed) + */ + dragState?: string; + + /**parameter defines whether to cancel the change or not + */ + cancel?: boolean; +} + +export interface ConnectorTargetChangeEventArgs { + + /**parameter returns the connector, the target point of which is being dragged + */ + element?: any; + + /**returns the target node of the element + */ + node?: any; + + /**returns the target point of the element + */ + point?: any; + + /**returns the target port of the element + */ + port?: any; + + /**returns the state of connection end point dragging(starting, dragging, completed) + */ + dragState?: string; + + /**parameter defines whether to cancel the change or not + */ + cancel?: boolean; +} + +export interface ContextMenuBeforeOpenEventArgs { + + /**parameter returns the diagram object + */ + diagram?: any; + + /**parameter returns the actual arguments from context menu + */ + contextmenu?: any; + + /**parameter returns the object that was clicked + */ + target?: any; +} + +export interface ContextMenuClickEventArgs { + + /**parameter returns the id of the selected context menu item + */ + id?: string; + + /**parameter returns the text of the selected context menu item + */ + text?: string; + + /**parameter returns the parent id of the selected context menu item + */ + parentId?: string; + + /**parameter returns the parent text of the selected context menu item + */ + parentText?: string; + + /**parameter returns the object that was clicked + */ + target?: any; + + /**parameter defines whether to execute the click event or not + */ + canExecute?: boolean; +} + +export interface DoubleClickEventArgs { + + /**parameter returns the object that is actually clicked + */ + actualObject?: any; + + /**parameter returns the selected object + */ + element?: any; +} + +export interface DragEventArgs { + + /**parameter returns the node or connector that is being dragged + */ + element?: any; + + /**parameter returns the previous position of the node/connector + */ + oldValue?: any; + + /**parameter returns the new position of the node/connector + */ + newValue?: any; + + /**parameter returns the state of drag event (Starting, dragging, completed) + */ + dragState?: string; + + /**parameter returns whether or not to cancel the drag event + */ + cancel?: boolean; +} + +export interface DragEnterEventArgs { + + /**parameter returns the node or connector that is dragged into diagram + */ + element?: any; + + /**parameter returns whether to add or remove the symbol from diagram + */ + cancel?: boolean; +} + +export interface DragLeaveEventArgs { + + /**parameter returns the node or connector that is dragged outside of the diagram + */ + element?: any; +} + +export interface DragOverEventArgs { + + /**parameter returns the node or connector that is dragged over diagram + */ + element?: any; + + /**parameter defines whether the symbol can be dropped at the current mouse position + */ + allowDrop?: boolean; + + /**parameter returns the node/connector over which the symbol is dragged + */ + target?: any; + + /**parameter returns the previous position of the node/connector + */ + oldValue?: any; + + /**parameter returns the new position of the node/connector + */ + newValue?: any; + + /**parameter returns whether or not to cancel the dragOver event + */ + cancel?: boolean; +} + +export interface DropEventArgs { + + /**parameter returns node or connector that is being dropped + */ + element?: any; + + /**parameter returns whether or not to cancel the drop event + */ + cancel?: boolean; + + /**parameter returns the object from where the element is dragged + */ + source?: any; + + /**parameter returns the object over which the object will be dropped + */ + target?: any; + + /**parameter returns the enum which defines the type of the source + */ + sourceType?: string; +} + +export interface GroupChangeEventArgs { + + /**parameter returns the object that is added to/removed from a group + */ + element?: any; + + /**parameter returns the old parent group(if any) of the object + */ + oldParent?: any; + + /**parameter returns the new parent group(if any) of the object + */ + newParent?: any; + + /**parameter returns the cause of group change("group", unGroup") + */ + cause?: string; +} + +export interface ItemClickEventArgs { + + /**parameter returns the object that was actually clicked + */ + actualObject?: any; + + /**parameter returns the object that is selected + */ + selectedObject?: any; + + /**parameter returns whether or not to cancel the drop event + */ + cancel?: boolean; + + /**parameter returns the actual click event arguments that explains which button is clicked + */ + event?: any; +} + +export interface MouseEnterEventArgs { + + /**parameter returns the target node or connector + */ + element?: any; + + /**parameter returns the object from where the selected object is dragged + */ + source?: any; + + /**parameter returns the target object over which the selected object is dragged + */ + target?: any; +} + +export interface MouseLeaveEventArgs { + + /**parameter returns the target node or connector + */ + element?: any; + + /**parameter returns the object from where the selected object is dragged + */ + source?: any; + + /**parameter returns the target object over which the selected object is dragged + */ + target?: any; +} + +export interface MouseOverEventArgs { + + /**parameter returns the target node or connector + */ + element?: any; + + /**parameter returns the object from where the element is dragged + */ + source?: any; + + /**parameter returns the object over which the element is being dragged. + */ + target?: any; +} + +export interface NodeCollectionChangeEventArgs { + + /**parameter returns whether the node is to be added or removed + */ + changeType?: string; + + /**parameter returns the node which needs to be added or deleted + */ + element?: any; + + /**parameter defines whether to cancel the collection change or not + */ + cancel?: boolean; +} + +export interface PropertyChangeEventArgs { + + /**parameter returns the selected element + */ + element?: any; + + /**parameter returns the action is nudge or not + */ + cause?: string; + + /**parameter returns the new value of the node property that is being changed + */ + newValue?: any; + + /**parameter returns the old value of the property that is being changed + */ + oldValue?: any; + + /**parameter returns the name of the property that is changed + */ + propertyName?: string; +} + +export interface RotationChangeEventArgs { + + /**parameter returns the node that is rotated + */ + element?: any; + + /**parameter returns the previous rotation angle + */ + oldValue?: any; + + /**parameter returns the new rotation angle + */ + newValue?: any; + + /**parameter to specify whether or not to cancel the event + */ + cancel?: boolean; +} + +export interface ScrollChangeEventArgs { + + /**Parameter returns the new zoom value, horizontal and vertical scroll offsets. + */ + newValues?: any; + + /**parameter returns the previous zoom value, horizontal and vertical scroll offsets. + */ + oldValues?: any; +} + +export interface SegmentChangeEventArgs { + + /**Parameter returns the connector that is being edited + */ + element?: any; + + /**parameter returns the state of editing (starting, dragging, completed) + */ + dragState?: string; + + /**parameter returns the current mouse position + */ + point?: any; + + /**parameter to specify whether or not to cancel the event + */ + cancel?: boolean; +} + +export interface SelectionChangeEventArgs { + + /**parameter returns whether the item is selected or removed selection + */ + changeType?: string; + + /**parameter returns the item which is selected or to be selected + */ + element?: any; + + /**parameter returns the collection of nodes and connectors that have to be removed from selection list + */ + oldItems?: Array; + + /**parameter returns the collection of nodes and connectors that have to be added to selection list + */ + newItems?: Array; + + /**parameter returns the collection of nodes and connectors that will be selected after selection change + */ + selectedItems?: Array; + + /**parameter to specify whether or not to cancel the selection change event + */ + cancel?: boolean; +} + +export interface SizeChangeEventArgs { + + /**parameter returns node that was resized + */ + element?: any; + + /**parameter to cancel the size change + */ + cancel?: boolean; + + /**parameter returns the new width, height, offsetX and offsetY values of the element that is being resized + */ + newValue?: any; + + /**parameter returns the previous width,height,offsetX and offsetY values of the element that is being resized + */ + oldValue?: any; + + /**parameter returns the state of resizing(starting,resizing,completed) + */ + resizeState?: string; + + /**parameter returns the difference between new and old value + */ + offset?: any; +} + +export interface TextChangeEventArgs { + + /**parameter returns the node that contains the text being edited + */ + element?: any; + + /**parameter returns the new text + */ + value?: string; + + /**parameter returns the keyCode of the key entered + */ + keyCode?: string; +} + +export interface CommandManagerCommandsGesture { + + /**Sets the key value, on recognition of which the command will be executed. + * @Default {ej.datavisualization.Diagram.Keys.None} + */ + key?: ej.datavisualization.Diagram.Keys|string; + + /**Sets a combination of key modifiers, on recognition of which the command will be executed. + * @Default {ej.datavisualization.Diagram.KeyModifiers.None} + */ + keyModifiers?: ej.datavisualization.Diagram.KeyModifiers|string; +} + +export interface CommandManagerCommands { + + /**A method that defines whether the command is executable at the moment or not. + */ + canExecute?: Function; + + /**A method that defines what to be executed when the key combination is recognized. + */ + execute?: Function; + + /**Defines a combination of keys and key modifiers, on recognition of which the command will be executed + */ + gesture?: CommandManagerCommandsGesture; + + /**Defines any additional parameters that are required at runtime + * @Default {null} + */ + parameter?: any; +} + +export interface CommandManager { + + /**An object that maps a set of command names with the corresponding command objects + * @Default {{}} + */ + commands?: CommandManagerCommands; +} + +export interface ConnectorsSegments { + + /**Sets the direction of orthogonal segment + */ + direction?: string; + + /**Describes the length of orthogonal segment + * @Default {undefined} + */ + length?: number; + + /**Describes the end point of bezier/straight segment + * @Default {Diagram.Point()} + */ + point?: ej.datavisualization.Diagram.ConnectorsSourcePoint|string; + + /**Defines the first control point of the bezier segment + * @Default {null} + */ + point1?: ej.datavisualization.Diagram.ConnectorsSourcePoint|string; + + /**Defines the second control point of bezier segment + * @Default {null} + */ + point2?: ej.datavisualization.Diagram.ConnectorsSourcePoint|string; + + /**Sets the type of the segment. + * @Default {ej.datavisualization.Diagram.Segments.Straight} + */ + type?: ej.datavisualization.Diagram.Segments|string; + + /**Describes the length and angle between the first control point and the start point of bezier segment + * @Default {null} + */ + vector1?: any; + + /**Describes the length and angle between the second control point and end point of bezier segment + * @Default {null} + */ + vector2?: any; +} + +export interface ConnectorsSourceDecorator { + + /**Sets the border color of the source decorator + * @Default {black} + */ + borderColor?: string; + + /**Sets the border width of the decorator + * @Default {1} + */ + borderWidth?: number; + + /**Sets the fill color of the source decorator + * @Default {black} + */ + fillColor?: string; + + /**Sets the height of the source decorator + * @Default {8} + */ + height?: number; + + /**Defines the custom shape of the source decorator + */ + pathData?: string; + + /**Defines the shape of the source decorator. + * @Default {ej.datavisualization.Diagram.DecoratorShapes.Arrow} + */ + shape?: ej.datavisualization.Diagram.DecoratorShapes|string; + + /**Defines the width of the source decorator + * @Default {8} + */ + width?: number; +} + +export interface ConnectorsSourcePoint { + + /**Defines the x-coordinate of a position + * @Default {0} + */ + x?: number; + + /**Defines the y-coordinate of a position + * @Default {0} + */ + y?: number; +} + +export interface ConnectorsTargetDecorator { + + /**Sets the border color of the decorator + * @Default {black} + */ + borderColor?: string; + + /**Sets the color with which the decorator will be filled + * @Default {black} + */ + fillColor?: string; + + /**Defines the height of the target decorator + * @Default {8} + */ + height?: number; + + /**Defines the custom shape of the target decorator + */ + pathData?: string; + + /**Defines the shape of the target decorator. + * @Default {ej.datavisualization.Diagram.DecoratorShapes.Arrow} + */ + shape?: ej.datavisualization.Diagram.DecoratorShapes|string; + + /**Defines the width of the target decorator + * @Default {8} + */ + width?: number; +} + +export interface Connectors { + + /**To maintain additional information about connectors + * @Default {null} + */ + addInfo?: any; + + /**Defines the width of the line bridges + * @Default {10} + */ + bridgeSpace?: number; + + /**Enables or disables the behaviors of connectors. + * @Default {ej.datavisualization.Diagram.ConnectorConstraints.Default} + */ + constraints?: ej.datavisualization.Diagram.ConnectorConstraints|string; + + /**Defines the radius of the rounded corner + * @Default {0} + */ + cornerRadius?: number; + + /**Configures the styles of shapes + */ + cssClass?: string; + + /**Sets the horizontal alignment of the connector. Applicable, if the parent of the connector is a container. + * @Default {ej.datavisualization.Diagram.HorizontalAlignment.Left} + */ + horizontalAlign?: ej.datavisualization.Diagram.HorizontalAlignment|string; + + /**A collection of JSON objects where each object represents a label. For label properties, refer Labels + * @Default {[]} + */ + labels?: Array; + + /**Sets the stroke color of the connector + * @Default {black} + */ + lineColor?: string; + + /**Sets the pattern of dashes and gaps used to stroke the path of the connector + */ + lineDashArray?: string; + + /**Defines the padding value to ease the interaction with connectors + * @Default {10} + */ + lineHitPadding?: number; + + /**Sets the width of the line + * @Default {1} + */ + lineWidth?: number; + + /**Defines the minimum space to be left between the bottom of parent bounds and the connector. Applicable, if the parent is a container. + * @Default {0} + */ + marginBottom?: number; + + /**Defines the minimum space to be left between the left of parent bounds and the connector. Applicable, if the parent is a container. + * @Default {0} + */ + marginLeft?: number; + + /**Defines the minimum space to be left between the right of parent bounds and the connector. Applicable, if the parent is a container. + * @Default {0} + */ + marginRight?: number; + + /**Defines the minimum space to be left between the top of parent bounds and the connector. Applicable, if the parent is a container. + * @Default {0} + */ + marginTop?: number; + + /**Sets a unique name for the connector + */ + name?: string; + + /**Defines the transparency of the connector + * @Default {1} + */ + opacity?: number; + + /**Defines the size and preview size of the node to add that to symbol palette. To explore palette item, refer Palette Item + * @Default {null} + */ + paletteItem?: any; + + /**Sets the parent name of the connector. + */ + parent?: string; + + /**An array of JSON objects where each object represents a segment + * @Default {[ { type:straight } ]} + */ + segments?: Array; + + /**Defines the source decorator of the connector + * @Default {{ shape:arrow, width: 8, height:8, borderColor:black, fillColor:black }} + */ + sourceDecorator?: ConnectorsSourceDecorator; + + /**Sets the source node of the connector + */ + sourceNode?: string; + + /**Defines the space to be left between the source node and the source point of a connector + * @Default {0} + */ + sourcePadding?: number; + + /**Describes the start point of the connector + * @Default {ej.datavisualization.Diagram.Point()} + */ + sourcePoint?: ConnectorsSourcePoint; + + /**Sets the source port of the connector + */ + sourcePort?: string; + + /**Defines the target decorator of the connector + * @Default {{ shape:arrow, width: 8, height:8, borderColor:black, fillColor:black }} + */ + targetDecorator?: ConnectorsTargetDecorator; + + /**Sets the target node of the connector + */ + targetNode?: string; + + /**Defines the space to be left between the target node and the target point of the connector + * @Default {0} + */ + targetPadding?: number; + + /**Describes the end point of the connector + * @Default {ej.datavisualization.Diagram.Point()} + */ + targetPoint?: ej.datavisualization.Diagram.ConnectorsSourcePoint|string; + + /**Sets the targetPort of the connector + */ + targetPort?: string; + + /**Defines the tooltip that should be shown when the mouse hovers over connector. For tooltip properties, refer Tooltip + * @Default {null} + */ + tooltip?: any; + + /**To set the vertical alignment of connector (Applicable,if the parent is group). + * @Default {ej.datavisualization.Diagram.VerticalAlignment.Top} + */ + verticalAlign?: ej.datavisualization.Diagram.VerticalAlignment|string; + + /**Enables or disables the visibility of connector + * @Default {true} + */ + visible?: boolean; + + /**Sets the z-index of the connector + * @Default {0} + */ + zOrder?: number; +} + +export interface ContextMenu { + + /**Defines the collection of context menu items + * @Default {[]} + */ + items?: Array; + + /**To set whether to display the default context menu items or not + * @Default {false} + */ + showCustomMenuItemsOnly?: boolean; +} + +export interface DataSourceSettings { + + /**Defines the data source either as a collection of objects or as an instance of ej.DataManager + * @Default {null} + */ + dataSource?: any; + + /**Sets the unique id of the data source items + */ + id?: string; + + /**Defines the parent id of the data source item + * @Default {''} + */ + parent?: string; + + /**Describes query to retrieve a set of data from the specified datasource + * @Default {null} + */ + query?: string; + + /**Sets the unique id of the root data source item + */ + root?: string; + + /**Describes the name of the table on which the specified query has to be executed + * @Default {null} + */ + tableName?: string; +} + +export interface DefaultSettings { + + /**Initializes the default connector properties + * @Default {null} + */ + connector?: any; + + /**Initializes the default properties of groups + * @Default {null} + */ + group?: any; + + /**Initializes the default properties for nodes + * @Default {null} + */ + node?: any; +} + +export interface HistoryManager { + + /**A method that takes a history entry as argument and returns whether the specific entry can be popped or not + */ + canPop?: Function; + + /**A method that ends grouping the changes + */ + closeGroupAction?: Function; + + /**A method that removes the history of a recent change made in diagram + */ + pop?: Function; + + /**A method that allows to track the custom changes made in diagram + */ + push?: Function; + + /**Defines what should be happened while trying to restore a custom change + * @Default {null} + */ + redo?: Function; + + /**A method that starts to group the changes to revert/restore them in a single undo or redo + */ + startGroupAction?: Function; + + /**Defines what should be happened while trying to revert a custom change + */ + undo?: Function; +} + +export interface Layout { + + /**Defines the fixed node with reference to which, the layout will be arranged and fixed node will not be repositioned + */ + fixedNode?: string; + + /**Customizes the orientation of trees/sub trees. For orientations, see Chart Orientations. For chart types, see Chart Types + * @Default {null} + */ + getLayoutInfo?: any; + + /**Sets the space to be horizontally left between nodes + * @Default {30} + */ + horizontalSpacing?: number; + + /**Sets the margin value to be horizontally left between the layout and diagram + * @Default {0} + */ + marginX?: number; + + /**Sets the margin value to be vertically left between layout and diagram + * @Default {0} + */ + marginY?: number; + + /**Sets the orientation/direction to arrange the diagram elements. + * @Default {ej.datavisualization.Diagram.LayoutOrientations.TopToBottom} + */ + orientation?: ej.datavisualization.Diagram.LayoutOrientations|string; + + /**Sets the type of the layout based on which the elements will be arranged. + * @Default {ej.datavisualization.Diagram.LayoutTypes.None} + */ + type?: ej.datavisualization.Diagram.LayoutTypes|string; + + /**Sets the space to be vertically left between nodes + * @Default {30} + */ + verticalSpacing?: number; +} + +export interface NodesContainer { + + /**Defines the orientation of the container. Applicable, if the group is a container. + * @Default {vertical} + */ + orientation?: string; + + /**Sets the type of the container. Applicable if the group is a container. + * @Default {ej.datavisualization.Diagram.ContainerType.Canvas} + */ + type?: ej.datavisualization.Diagram.ContainerType|string; +} + +export interface NodesGradientLinearGradient { + + /**Defines the different colors and the region of color transitions + * @Default {[]} + */ + stops?: Array; + + /**Defines the left most position(relative to node) of the rectangular region that needs to be painted + * @Default {0} + */ + x1?: number; + + /**Defines the right most position(relative to node) of the rectangular region that needs to be painted + * @Default {0} + */ + x2?: number; + + /**Defines the top most position(relative to node) of the rectangular region that needs to be painted + * @Default {0} + */ + y1?: number; + + /**Defines the bottom most position(relative to node) of the rectangular region that needs to be painted + * @Default {0} + */ + y2?: number; +} + +export interface NodesGradientRadialGradient { + + /**Defines the position of the outermost circle + * @Default {0} + */ + cx?: number; + + /**Defines the outer most circle of the radial gradient + * @Default {0} + */ + cy?: number; + + /**Defines the innermost circle of the radial gradient + * @Default {0} + */ + fx?: number; + + /**Defines the innermost circle of the radial gradient + * @Default {0} + */ + fy?: number; + + /**Defines the different colors and the region of color transitions. + * @Default {[]} + */ + stops?: Array; +} + +export interface NodesGradientStop { + + /**Sets the color to be filled over the specified region + */ + color?: string; + + /**Sets the position where the previous color transition ends and a new color transition starts + * @Default {0} + */ + offset?: number; + + /**Describes the transparency level of the region + * @Default {1} + */ + opacity?: number; +} + +export interface NodesGradient { + + /**Paints the node with linear color transitions + */ + LinearGradient?: NodesGradientLinearGradient; + + /**Paints the node with radial color transitions. A focal point defines the beginning of the gradient, and a circle defines the end point of the gradient. + */ + RadialGradient?: NodesGradientRadialGradient; + + /**Defines the color and a position where the previous color transition ends and a new color transition starts + */ + Stop?: NodesGradientStop; +} + +export interface NodesLabels { + + /**Enables/disables the bold style + * @Default {false} + */ + bold?: boolean; + + /**Sets the border color of the label + * @Default {transparent} + */ + borderColor?: string; + + /**Sets the border width of the label + * @Default {0} + */ + borderWidth?: number; + + /**Sets the fill color of the text area + * @Default {transparent} + */ + fillColor?: string; + + /**Sets the font color of the text + * @Default {black} + */ + fontColor?: string; + + /**Sets the font family of the text + * @Default {Arial} + */ + fontFamily?: string; + + /**Defines the font size of the text + * @Default {12} + */ + fontSize?: number; + + /**Sets the horizontal alignment of the label. + * @Default {ej.datavisualization.Diagram.HorizontalAlignment.Center} + */ + horizontalAlignment?: ej.datavisualization.Diagram.HorizontalAlignment|string; + + /**Enables/disables the italic style + * @Default {false} + */ + italic?: boolean; + + /**To set the margin of the label + * @Default {ej.datavisualization.Diagram.Margin()} + */ + margin?: any; + + /**Gets whether the label is currently being edited or not. + * @Default {ej.datavisualization.Diagram.LabelEditMode.Edit} + */ + mode?: ej.datavisualization.Diagram.LabelEditMode|string; + + /**Sets the unique identifier of the label + */ + name?: string; + + /**Sets the fraction/ratio(relative to node) that defines the position of the label + * @Default {ej.datavisualization.Diagram.Point(0.5, 0.5)} + */ + offset?: any; + + /**Defines whether the label is editable or not + * @Default {false} + */ + readOnly?: boolean; + + /**Defines the angle to which the label needs to be rotated + * @Default {0} + */ + rotateAngle?: number; + + /**Defines the label text + */ + text?: string; + + /**Defines how to align the text inside the label. + * @Default {ej.datavisualization.Diagram.TextAlign.Center} + */ + textAlign?: ej.datavisualization.Diagram.TextAlign|string; + + /**Sets how to decorate the label text. + * @Default {ej.datavisualization.Diagram.TextDecorations.None} + */ + textDecoration?: ej.datavisualization.Diagram.TextDecorations|string; + + /**Sets the vertical alignment of the label. + * @Default {ej.datavisualization.Diagram.VerticalAlignment.Center} + */ + verticalAlignment?: ej.datavisualization.Diagram.VerticalAlignment|string; + + /**Enables or disables the visibility of the label + * @Default {true} + */ + visible?: boolean; + + /**Sets the width of the label(the maximum value of label width and the node width will be considered as label width) + * @Default {50} + */ + width?: number; + + /**Defines how the label text needs to be wrapped. + * @Default {ej.datavisualization.Diagram.TextWrapping.WrapWithOverflow} + */ + wrapping?: ej.datavisualization.Diagram.TextWrapping|string; +} + +export interface NodesLanes { + + /**Allows to maintain additional information about lane + * @Default {{}} + */ + addInfo?: any; + + /**An array of objects where each object represents a child node of the lane + * @Default {[]} + */ + children?: Array; + + /**Defines the fill color of the lane + * @Default {white} + */ + fillColor?: string; + + /**Defines the header of the lane + * @Default {{ text: Function, fontSize: 11 }} + */ + header?: any; + + /**Defines the object as a lane + * @Default {false} + */ + isLane?: boolean; + + /**Sets the unique identifier of the lane + */ + name?: string; + + /**Sets the orientation of the lane. + * @Default {vertical} + */ + orientation?: string; +} + +export interface NodesPaletteItem { + + /**Defines whether the symbol should be drawn at its actual size regardless of precedence factors or not + * @Default {true} + */ + enableScale?: boolean; + + /**Defines the height of the symbol + * @Default {0} + */ + height?: number; + + /**Defines the margin of the symbol item + * @Default {{ left: 4, right: 4, top: 4, bottom: 4 }} + */ + margin?: any; + + /**Defines the preview height of the symbol + * @Default {undefined} + */ + previewHeight?: number; + + /**Defines the preview width of the symbol + * @Default {undefined} + */ + previewWidth?: number; + + /**Defines the width of the symbol + * @Default {0} + */ + width?: number; +} + +export interface NodesPhases { + + /**Defines the header of the smaller regions + * @Default {null} + */ + label?: any; + + /**Defines the line color of the splitter that splits adjacent phases. + * @Default {#606060} + */ + lineColor?: string; + + /**Sets the dash array that used to stroke the phase splitter + * @Default {3,3} + */ + lineDashArray?: string; + + /**Sets the lineWidth of the phase + * @Default {1} + */ + lineWidth?: number; + + /**Sets the unique identifier of the phase + */ + name?: string; + + /**Sets the length of the smaller region(phase) of a swimlane + * @Default {100} + */ + offset?: number; + + /**Sets the orientation of the phase + * @Default {horizontal} + */ + orientation?: string; + + /**Sets the type of the object as phase + * @Default {phase} + */ + type?: string; +} + +export interface NodesPorts { + + /**Sets the border color of the port + * @Default {#1a1a1a} + */ + borderColor?: string; + + /**Sets the stroke width of the port + * @Default {1} + */ + borderWidth?: number; + + /**Defines the space to be left between the port bounds and its incoming and outgoing connections. + * @Default {0} + */ + connectorPadding?: number; + + /**Defines whether connections can be created with the port + * @Default {ej.datavisualization.Diagram.PortConstraints.Connect} + */ + constraints?: ej.datavisualization.Diagram.PortConstraints|string; + + /**Sets the fill color of the port + * @Default {white} + */ + fillColor?: string; + + /**Sets the unique identifier of the port + */ + name?: string; + + /**Defines the position of the port as fraction/ ratio relative to node + * @Default {ej.datavisualization.Diagram.Point(0, 0)} + */ + offset?: any; + + /**Defines the path data to draw the port. Applicable, if the port shape is path. + */ + pathData?: string; + + /**Defines the shape of the port. + * @Default {ej.datavisualization.Diagram.PortShapes.Square} + */ + shape?: ej.datavisualization.Diagram.PortShapes|string; + + /**Defines the size of the port + * @Default {8} + */ + size?: number; + + /**Defines when the port should be visible. + * @Default {ej.datavisualization.Diagram.PortVisibility.Default} + */ + visibility?: ej.datavisualization.Diagram.PortVisibility|string; +} + +export interface NodesShadow { + + /**Defines the angle of the shadow relative to node + * @Default {45} + */ + angle?: number; + + /**Sets the distance to move the shadow relative to node + * @Default {5} + */ + distance?: number; + + /**Defines the opaque of the shadow + * @Default {0.7} + */ + opacity?: number; +} + +export interface NodesSubProcess { + + /**Defines whether the bpmn sub process is without any prescribed order or not + * @Default {false} + */ + adhoc?: boolean; + + /**Sets the boundary of the BPMN process + * @Default {ej.datavisualization.Diagram.BPMNBoundary.Default} + */ + boundary?: ej.datavisualization.Diagram.BPMNBoundary|string; + + /**Sets whether the bpmn subprocess is triggered as a compensation of a specific activity + * @Default {false} + */ + compensation?: boolean; + + /**Defines the loop type of a sub process. + * @Default {ej.datavisualization.Diagram.BPMNLoops.None} + */ + loop?: ej.datavisualization.Diagram.BPMNLoops|string; +} + +export interface NodesTask { + + /**To set whether the task is a global task or not + * @Default {false} + */ + call?: boolean; + + /**Sets whether the task is triggered as a compensation of another specific activity + * @Default {false} + */ + compensation?: boolean; + + /**Sets the loop type of a bpmn task. + * @Default {ej.datavisualization.Diagram.BPMNLoops.None} + */ + loop?: ej.datavisualization.Diagram.BPMNLoops|string; + + /**Sets the type of the BPMN task. + * @Default {ej.datavisualization.Diagram.BPMNTasks.None} + */ + type?: ej.datavisualization.Diagram.BPMNTasks|string; +} + +export interface Nodes { + + /**Defines the type of BPMN Activity. Applicable, if the node is a bpmn activity. + * @Default {ej.datavisualization.Diagram.BPMNActivity.Task} + */ + activity?: ej.datavisualization.Diagram.BPMNActivity|string; + + /**To maintain additional information about nodes + * @Default {{}} + */ + addInfo?: any; + + /**Sets the border color of node + * @Default {black} + */ + borderColor?: string; + + /**Sets the pattern of dashes and gaps to stroke the border + */ + borderDashArray?: string; + + /**Sets the border width of the node + * @Default {1} + */ + borderWidth?: number; + + /**Defines whether the group can be ungrouped or not + * @Default {true} + */ + canUngroup?: boolean; + + /**Array of JSON objects where each object represents a child node/connector + * @Default {[]} + */ + children?: Array; + + /**Defines whether the BPMN data object is a collection or not + * @Default {false} + */ + collection?: boolean; + + /**Defines the distance to be left between a node and its connections(In coming and out going connections). + * @Default {0} + */ + connectorPadding?: number; + + /**Enables or disables the default behaviors of the node. + * @Default {ej.datavisualization.Diagram.NodeConstraints.Default} + */ + constraints?: ej.datavisualization.Diagram.NodeConstraints|string; + + /**Defines how the child objects need to be arranged(Either in any predefined manner or automatically). Applicable, if the node is a group. + * @Default {null} + */ + container?: NodesContainer; + + /**Defines the corner radius of rectangular shapes. + * @Default {0} + */ + cornerRadius?: number; + + /**Configures the styles of shapes + */ + cssClass?: string; + + /**Sets the type of the BPMN Events. Applicable, if the node is a bpmn event. + * @Default {ej.datavisualization.Diagram.BPMNEvents.Start} + */ + event?: ej.datavisualization.Diagram.BPMNEvents|string; + + /**Defines whether the node can be automatically arranged using layout or not + * @Default {false} + */ + excludeFromLayout?: boolean; + + /**Defines the fill color of the node + * @Default {white} + */ + fillColor?: string; + + /**Sets the type of the BPMN Gateway. Applicable, if the node is a bpmn gateway. + * @Default {ej.datavisualization.Diagram.BPMNGateways.None} + */ + gateway?: ej.datavisualization.Diagram.BPMNGateways|string; + + /**Paints the node with a smooth transition from one color to another color + */ + gradient?: NodesGradient; + + /**Defines the header of a swimlane/lane + * @Default {{ text: Title, fontSize: 11 }} + */ + header?: any; + + /**Defines the height of the node + * @Default {0} + */ + height?: number; + + /**Sets the horizontal alignment of the node. Applicable, if the parent of the node is a container. + * @Default {ej.datavisualization.Diagram.HorizontalAlignment.Left} + */ + horizontalAlign?: ej.datavisualization.Diagram.HorizontalAlignment|string; + + /**A read only collection of the incoming connectors/edges of the node + * @Default {[]} + */ + inEdges?: Array; + + /**Defines whether the sub tree of the node is expanded or collapsed + * @Default {true} + */ + isExpanded?: boolean; + + /**Sets the node as a swimlane + * @Default {false} + */ + isSwimlane?: boolean; + + /**A collection of objects where each object represents a label + * @Default {[]} + */ + labels?: Array; + + /**An array of objects where each object represents a lane. Applicable, if the node is a swimlane. + * @Default {[]} + */ + lanes?: Array; + + /**Defines the minimum space to be left between the bottom of parent bounds and the node. Applicable, if the parent is a container. + * @Default {0} + */ + marginBottom?: number; + + /**Defines the minimum space to be left between the left of parent bounds and the node. Applicable, if the parent is a container. + * @Default {0} + */ + marginLeft?: number; + + /**Defines the minimum space to be left between the right of the parent bounds and the node. Applicable, if the parent is a container. + * @Default {0} + */ + marginRight?: number; + + /**Defines the minimum space to be left between the top of parent bounds and the node. Applicable, if the parent is a container. + * @Default {0} + */ + marginTop?: number; + + /**Defines the maximum height limit of the node + * @Default {0} + */ + maxHeight?: number; + + /**Defines the maximum width limit of the node + * @Default {0} + */ + maxWidth?: number; + + /**Defines the minimum height limit of the node + * @Default {0} + */ + minHeight?: number; + + /**Defines the minimum width limit of the node + * @Default {0} + */ + minWidth?: number; + + /**Sets the unique identifier of the node + */ + name?: string; + + /**Defines the position of the node on X-Axis + * @Default {0} + */ + offsetX?: number; + + /**Defines the position of the node on Y-Axis + * @Default {0} + */ + offsetY?: number; + + /**Defines the opaque of the node + * @Default {1} + */ + opacity?: number; + + /**Defines the orientation of nodes. Applicable, if the node is a swimlane. + * @Default {vertical} + */ + orientation?: string; + + /**A read only collection of outgoing connectors/edges of the node + * @Default {[]} + */ + outEdges?: Array; + + /**Defines the minimum padding value to be left between the bottom most position of a group and its children. Applicable, if the group is a container. + * @Default {0} + */ + paddingBottom?: number; + + /**Defines the minimum padding value to be left between the left most position of a group and its children. Applicable, if the group is a container. + * @Default {0} + */ + paddingLeft?: number; + + /**Defines the minimum padding value to be left between the right most position of a group and its children. Applicable, if the group is a container. + * @Default {0} + */ + paddingRight?: number; + + /**Defines the minimum padding value to be left between the top most position of a group and its children. Applicable, if the group is a container. + * @Default {0} + */ + paddingTop?: number; + + /**Defines the size and preview size of the node to add that to symbol palette + * @Default {null} + */ + paletteItem?: NodesPaletteItem; + + /**Sets the name of the parent group + */ + parent?: string; + + /**Sets the path geometry that defines the shape of a path node + */ + pathData?: string; + + /**An array of objects, where each object represents a smaller region(phase) of a swimlane. + * @Default {[]} + */ + phases?: Array; + + /**Sets the height of the phase headers + * @Default {0} + */ + phaseSize?: number; + + /**Sets the ratio/ fractional value relative to node, based on which the node will be transformed(positioning, scaling and rotation) + * @Default {ej.datavisualization.Diagram.Points(0.5,0.5)} + */ + pivot?: any; + + /**Defines a collection of points to draw a polygon. Applicable, if the shape is a polygon. + * @Default {[]} + */ + points?: Array; + + /**An array of objects where each object represents a port + * @Default {[]} + */ + ports?: Array; + + /**Sets the angle to which the node should be rotated + * @Default {0} + */ + rotateAngle?: number; + + /**Defines the opacity and the position of shadow + * @Default {ej.datavisualization.Diagram.Shadow()} + */ + shadow?: NodesShadow; + + /**Sets the shape of the node. It depends upon the type of node. + * @Default {ej.datavisualization.Diagram.BasicShapes.Rectangle} + */ + shape?: ej.datavisualization.Diagram.BasicShapes|string; + + /**Sets the source path of the image. Applicable, if the type of the node is image. + */ + source?: string; + + /**Defines the sub process of a BPMN Activity. Applicable, if the type of the bpmn activity is sub process. + * @Default {ej.datavisualization.Diagram.BPMNSubProcess()} + */ + subProcess?: NodesSubProcess; + + /**Defines the task of the bpmn activity. Applicable, if the type of activity is set as task. + * @Default {ej.datavisualization.Diagram.BPMNTask()} + */ + task?: NodesTask; + + /**Sets the id of svg/html templates. Applicable, if the node is html or native. + */ + templateId?: string; + + /**Defines the textBlock of a text node + * @Default {null} + */ + textBlock?: any; + + /**Defines the tooltip that should be shown when the mouse hovers over node. For tooltip properties, refer Tooltip + * @Default {null} + */ + tooltip?: any; + + /**Sets the type of BPMN Event Triggers. + * @Default {ej.datavisualization.Diagram.BPMNTriggers.None} + */ + trigger?: ej.datavisualization.Diagram.BPMNTriggers|string; + + /**Defines the type of the node. + * @Default {ej.datavisualization.Diagram.Shapes.Basic} + */ + type?: ej.datavisualization.Diagram.Shapes|string; + + /**Sets the vertical alignment of a node. Applicable, if the parent of a node is a container. + * @Default {ej.datavisualization.Diagram.VerticalAlignment.Top} + */ + verticalAlign?: ej.datavisualization.Diagram.VerticalAlignment|string; + + /**Defines the visibility of the node + * @Default {true} + */ + visible?: boolean; + + /**Defines the width of the node + * @Default {0} + */ + width?: number; + + /**Defines the z-index of the node + * @Default {0} + */ + zOrder?: number; +} + +export interface PageSettings { + + /**Defines the maximum distance to be left between the object and the scroll bar to trigger auto scrolling + * @Default {{ left: 15, top: 15, right: 15, bottom: 15 }} + */ + autoScrollBorder?: any; + + /**Sets whether multiple pages can be created to fit all nodes and connectors + * @Default {false} + */ + multiplePage?: boolean; + + /**Defines the background color of diagram pages + * @Default {#ffffff} + */ + pageBackgroundColor?: string; + + /**Defines the page border color + * @Default {#565656} + */ + pageBorderColor?: string; + + /**Sets the border width of diagram pages + * @Default {0} + */ + pageBorderWidth?: number; + + /**Defines the height of a page + * @Default {null} + */ + pageHeight?: number; + + /**Defines the page margin + * @Default {24} + */ + pageMargin?: number; + + /**Sets the orientation of the page. + * @Default {ej.datavisualization.Diagram.PageOrientations.Portrait} + */ + pageOrientation?: ej.datavisualization.Diagram.PageOrientations|string; + + /**Defines the height of a diagram page + * @Default {null} + */ + pageWidth?: number; + + /**Defines the scrollable area of diagram. Applicable, if the scroll limit is "limited". + * @Default {null} + */ + scrollableArea?: any; + + /**Defines the scrollable region of diagram. + * @Default {ej.datavisualization.Diagram.ScrollLimit.Infinite} + */ + scrollLimit?: ej.datavisualization.Diagram.ScrollLimit|string; + + /**Enables or disables the page breaks + * @Default {false} + */ + showPageBreak?: boolean; +} + +export interface ScrollSettings { + + /**Allows to read the zoom value of diagram + * @Default {0} + */ + currentZoom?: number; + + /**Sets the horizontal scroll offset + * @Default {0} + */ + horizontalOffset?: number; + + /**Allows to extend the scrollable region that is based on the scroll limit + * @Default {{left: 0, right: 0, top:0, bottom: 0}} + */ + padding?: any; + + /**Sets the vertical scroll offset + * @Default {0} + */ + verticalOffset?: number; + + /**Allows to read the view port height of the diagram + * @Default {0} + */ + viewPortHeight?: number; + + /**Allows to read the view port width of the diagram + * @Default {0} + */ + viewPortWidth?: number; +} + +export interface SelectedItems { + + /**A read only collection of the selected items + * @Default {[]} + */ + children?: Array; + + /**Controls the visibility of selector. + * @Default {ej.datavisualization.Diagram.SelectorConstraints.All} + */ + constraints?: ej.datavisualization.Diagram.SelectorConstraints|string; + + /**Defines a method that dynamically enables/ disables the interaction with multiple selection. + * @Default {null} + */ + getConstraints?: any; + + /**Sets the height of the selected items + * @Default {0} + */ + height?: number; + + /**Sets the x position of the selector + * @Default {0} + */ + offsetX?: number; + + /**Sets the y position of the selector + * @Default {0} + */ + offsetY?: number; + + /**Sets the angle to rotate the selected items + * @Default {0} + */ + rotateAngle?: number; + + /**Sets the angle to rotate the selected items. For tooltip properties, refer Tooltip + * @Default {ej.datavisualization.Diagram.Tooltip()} + */ + tooltip?: any; + + /**A collection of frequently using commands that have to be added around the selector. + * @Default {[]} + */ + userHandles?: Array; + + /**Sets the width of the selected items + * @Default {0} + */ + width?: number; +} + +export interface SnapSettingsHorizontalGridLines { + + /**Defines the line color of horizontal grid lines + * @Default {lightgray} + */ + lineColor?: string; + + /**Specifies the pattern of dashes and gaps used to stroke horizontal grid lines + */ + lineDashArray?: string; + + /**A pattern of lines and gaps that defines a set of horizontal gridlines + * @Default {[1.25, 18.75, 0.25, 19.75, 0.25, 19.75, 0.25, 19.75, 0.25, 19.75]} + */ + linesInterval?: Array; + + /**Specifies a set of intervals to snap the objects + * @Default {[20]} + */ + snapInterval?: Array; +} + +export interface SnapSettingsVerticalGridLines { + + /**Defines the line color of horizontal grid lines + * @Default {lightgray} + */ + lineColor?: string; + + /**Specifies the pattern of dashes and gaps used to stroke horizontal grid lines + */ + lineDashArray?: string; + + /**A pattern of lines and gaps that defines a set of horizontal gridlines + * @Default {[1.25, 18.75, 0.25, 19.75, 0.25, 19.75, 0.25, 19.75, 0.25, 19.75]} + */ + linesInterval?: Array; + + /**Specifies a set of intervals to snap the objects + * @Default {[20]} + */ + snapInterval?: Array; +} + +export interface SnapSettings { + + /**Enables or disables snapping nodes/connectors to objects + * @Default {true} + */ + enableSnapToObject?: boolean; + + /**Defines the appearance of horizontal gridlines + */ + horizontalGridLines?: SnapSettingsHorizontalGridLines; + + /**Defines the angle by which the object needs to be snapped + * @Default {5} + */ + snapAngle?: number; + + /**Defines the minimum distance between the selected object and the nearest object + * @Default {5} + */ + snapObjectDistance?: number; + + /**Defines the appearance of horizontal gridlines + */ + verticalGridLines?: SnapSettingsVerticalGridLines; +} + +export interface TooltipAlignment { + + /**Defines the horizontal alignment of tooltip. + * @Default {ej.datavisualization.Diagram.HorizontalAlignment.Center} + */ + horizontal?: ej.datavisualization.Diagram.HorizontalAlignment|string; + + /**Defines the vertical alignment of tooltip. + * @Default {ej.datavisualization.Diagram.VerticalAlignment.Bottom} + */ + vertical?: ej.datavisualization.Diagram.VerticalAlignment|string; +} + +export interface Tooltip { + + /**Aligns the tooltip around nodes/connectors + */ + alignment?: TooltipAlignment; + + /**Sets the margin of the tooltip + * @Default {{ left: 5, right: 5, top: 5, bottom: 5 }} + */ + margin?: any; + + /**Defines whether the tooltip should be shown at the mouse position or around node. + * @Default {ej.datavisualization.Diagram.RelativeMode.Object} + */ + relativeMode?: ej.datavisualization.Diagram.RelativeMode|string; + + /**Sets the svg/html template to be bound with tooltip + */ + templateId?: string; +} +} +module Diagram +{ +enum BridgeDirection +{ +//Used to set the direction of line bridges as left +Left, +//Used to set the direction of line bridges as right +Right, +//Used to set the direction of line bridges as top +Top, +//Used to set the direction of line bridges as bottom +Bottom, +} +} +module Diagram +{ +enum Keys +{ +//No key pressed. +None, +//The A key. +A, +//The B key. +B, +//The C key. +C, +//The D Key. +D, +//The E key. +E, +//The F key. +F, +//The G key. +G, +//The H Key. +H, +//The I key. +I, +//The J key. +J, +//The K key. +K, +//The L Key. +L, +//The M key. +M, +//The N key. +N, +//The O key. +O, +//The P Key. +P, +//The Q key. +Q, +//The R key. +R, +//The S key. +S, +//The T Key. +T, +//The U key. +U, +//The V key. +V, +//The W key. +W, +//The X key. +X, +//The Y key. +Y, +//The Z key. +Z, +//The 0 key. +Number0, +//The 1 key. +Number1, +//The 2 key. +Number2, +//The 3 key. +Number3, +//The 4 key. +Number4, +//The 5 key. +Number5, +//The 6 key. +Number6, +//The 7 key. +Number7, +//The 8 key. +Number8, +//The 9 key. +Number9, +//The LEFT ARROW key. +Left, +//The UP ARROW key. +Up, +//The RIGHT ARROW key. +Right, +//The DOWN ARROW key. +Down, +//The ESC key. +Escape, +//The DEL key. +Delete, +//The TAB key. +Tab, +//The ENTER key. +Enter, +} +} +module Diagram +{ +enum KeyModifiers +{ +//No modifiers are pressed. +None, +//The ALT key. +Alt, +//The CTRL key. +Control, +//The SHIFT key. +Shift, +} +} +module Diagram +{ +enum ConnectorConstraints +{ +//Disable all connector Constraints +None, +//Enables connector to be selected +Select, +//Enables connector to be Deleted +Delete, +//Enables connector to be Dragged +Drag, +//Enables connectors source end to be selected +DragSourceEnd, +//Enables connectors target end to be selected +DragTargetEnd, +//Enables control point and end point of every segment in a connector for editing +DragSegmentThumb, +//Enables bridging to the connector +Bridging, +//Enables label of node to be Dragged +DragLabel, +//Enables bridging to the connector +InheritBridging, +//Enables all constraints +Default, +} +} +module Diagram +{ +enum HorizontalAlignment +{ +//Used to align text horizontally on left side of node/connector +Left, +//Used to align text horizontally on center of node/connector +Center, +//Used to align text horizontally on right side of node/connector +Right, +} +} +module Diagram +{ +enum Segments +{ +//Used to specify the lines as Straight +Straight, +//Used to specify the lines as Orthogonal +Orthogonal, +//Used to specify the lines as Bezier +Bezier, +} +} +module Diagram +{ +enum DecoratorShapes +{ +//Used to set decorator shape as none +None, +//Used to set decorator shape as Arrow +Arrow, +//Used to set decorator shape as Open Arrow +OpenArrow, +//Used to set decorator shape as Circle +Circle, +//Used to set decorator shape as Diamond +Diamond, +//Used to set decorator shape as path +Path, +} +} +module Diagram +{ +enum VerticalAlignment +{ +//Used to align text Vertically on left side of node/connector +Top, +//Used to align text Vertically on center of node/connector +Center, +//Used to align text Vertically on bottom of node/connector +Bottom, +} +} +module Diagram +{ +enum DiagramConstraints +{ +//Disables all DiagramConstraints +None, +//Enables/Disables PageEditing +PageEditable, +//Enables/Disables Bridging +Bridging, +//Enables/Disables Zooming +Zoomable, +//Enables/Disables panning on horizontal axis +PannableX, +//Enables/Disables panning on vertical axis +PannableY, +//Enables/Disables Panning +Pannable, +//Enables/Disables undo actions +Undoable, +//Enables all Constraints +Default, +} +} +module Diagram +{ +enum LayoutOrientations +{ +//Used to set LayoutOrientation from top to bottom +TopToBottom, +//Used to set LayoutOrientation from bottom to top +BottomToTop, +//Used to set LayoutOrientation from left to right +LeftToRight, +//Used to set LayoutOrientation from right to left +RightToLeft, +} +} +module Diagram +{ +enum LayoutTypes +{ +//Used not to set any specific layout +None, +//Used to set layout type as hierarchical layout +HierarchicalTree, +//Used to set layout type as organnizational chart +OrganizationalChart, +} +} +module Diagram +{ +enum BPMNActivity +{ +//Used to set BPMN Activity as None +None, +//Used to set BPMN Activity as Task +Task, +//Used to set BPMN Activity as SubProcess +SubProcess, +} +} +module Diagram +{ +enum NodeConstraints +{ +//Disable all node Constraints +None, +//Enables node to be selected +Select, +//Enables node to be Deleted +Delete, +//Enables node to be Dragged +Drag, +//Enables node to be Rotated +Rotate, +//Enables node to be connected +Connect, +//Enables node to be resize north east +ResizeNorthEast, +//Enables node to be resize east +ResizeEast, +//Enables node to be resize south east +ResizeSouthEast, +//Enables node to be resize south +ResizeSouth, +//Enables node to be resize south west +ResizeSouthWest, +//Enables node to be resize west +ResizeWest, +//Enables node to be resize north west +ResizeNorthWest, +//Enables node to be resize north +ResizeNorth, +//Enables node to be Resized +Resize, +//Enables shadow +Shadow, +//Enables label of node to be Dragged +DragLabel, +//Enables panning should be done while node dragging +AllowPan, +//Enables Proportional resize for node +AspectRatio, +//Enables all node constraints +Default, +} +} +module Diagram +{ +enum ContainerType +{ +//Sets the container type as Canvas +Canvas, +//Sets the container type as Stack +Stack, +} +} +module Diagram +{ +enum BPMNEvents +{ +//Used to set BPMN Event as Start +Start, +//Used to set BPMN Event as Intermediate +Intermediate, +//Used to set BPMN Event as End +End, +//Used to set BPMN Event as NonInterruptingStart +NonInterruptingStart, +//Used to set BPMN Event as NonInterruptingIntermediate +NonInterruptingIntermediate, +} +} +module Diagram +{ +enum BPMNGateways +{ +//Used to set BPMN Gateway as None +None, +//Used to set BPMN Gateway as Exclusive +Exclusive, +//Used to set BPMN Gateway as Inclusive +Inclusive, +//Used to set BPMN Gateway as Parallel +Parallel, +//Used to set BPMN Gateway as Complex +Complex, +//Used to set BPMN Gateway as EventBased +EventBased, +} +} +module Diagram +{ +enum LabelEditMode +{ +//Used to set label edit mode as edit +Edit, +//Used to set label edit mode as view +View, +} +} +module Diagram +{ +enum TextAlign +{ +//Used to align text on left side of node/connector +Left, +//Used to align text on center of node/connector +Center, +//Used to align text on Right side of node/connector +Right, +} +} +module Diagram +{ +enum TextDecorations +{ +//Used to set text decoration of the label as Underline +Underline, +//Used to set text decoration of the label as Overline +Overline, +//Used to set text decoration of the label as LineThrough +LineThrough, +//Used to set text decoration of the label as None +None, +} +} +module Diagram +{ +enum TextWrapping +{ +//Disables wrapping +NoWrap, +//Enables Line-break at normal word break points +Wrap, +//Enables Line-break at normal word break points with longer word overflows +WrapWithOverflow, +} +} +module Diagram +{ +enum PortConstraints +{ +//Disable all constraints +None, +//Enables connections with connector +Connect, +} +} +module Diagram +{ +enum PortShapes +{ +//Used to set port shape as X +X, +//Used to set port shape as Circle +Circle, +//Used to set port shape as Square +Square, +//Used to set port shape as Path +Path, +} +} +module Diagram +{ +enum PortVisibility +{ +//Set the port visibility as Visible +Visible, +//Set the port visibility as Hidden +Hidden, +//Port get visible when hover connector on node +Hover, +//Port gets visible when connect connector to node +Connect, +//Specifies the port visibility as default +Default, +} +} +module Diagram +{ +enum BasicShapes +{ +//Used to specify node Shape as Rectangle +Rectangle, +//Used to specify node Shape as Ellipse +Ellipse, +//Used to specify node Shape as Path +Path, +//Used to specify node Shape as Polygon +Polygon, +//Used to specify node Shape as Triangle +Triangle, +//Used to specify node Shape as Plus +Plus, +//Used to specify node Shape as Star +Star, +//Used to specify node Shape as Pentagon +Pentagon, +//Used to specify node Shape as Heptagon +Heptagon, +//Used to specify node Shape as Octagon +Octagon, +//Used to specify node Shape as Trapezoid +Trapezoid, +//Used to specify node Shape as Decagon +Decagon, +//Used to specify node Shape as RightTriangle +RightTriangle, +//Used to specify node Shape as Cylinder +Cylinder, +} +} +module Diagram +{ +enum BPMNBoundary +{ +//Used to set BPMN SubProcess's Boundary as Default +Default, +//Used to set BPMN SubProcess's Boundary as Call +Call, +//Used to set BPMN SubProcess's Boundary as Event +Event, +} +} +module Diagram +{ +enum BPMNLoops +{ +//Used to set BPMN Activity's Loop as None +None, +//Used to set BPMN Activity's Loop as Standard +Standard, +//Used to set BPMN Activity's Loop as ParallelMultiInstance +ParallelMultiInstance, +//Used to set BPMN Activity's Loop as SequenceMultiInstance +SequenceMultiInstance, +} +} +module Diagram +{ +enum BPMNTasks +{ +//Used to set BPMN Task Type as None +None, +//Used to set BPMN Task Type as Service +Service, +//Used to set BPMN Task Type as Receive +Receive, +//Used to set BPMN Task Type as Send +Send, +//Used to set BPMN Task Type as InstantiatingReceive +InstantiatingReceive, +//Used to set BPMN Task Type as Manual +Manual, +//Used to set BPMN Task Type as BusinessRule +BusinessRule, +//Used to set BPMN Task Type as User +User, +//Used to set BPMN Task Type as Script +Script, +//Used to set BPMN Task Type as Parallel +Parallel, +} +} +module Diagram +{ +enum BPMNTriggers +{ +//Used to set Event Trigger as None +None, +//Used to set Event Trigger as Message +Message, +//Used to set Event Trigger as Timer +Timer, +//Used to set Event Trigger as Escalation +Escalation, +//Used to set Event Trigger as Link +Link, +//Used to set Event Trigger as Error +Error, +//Used to set Event Trigger as Compensation +Compensation, +//Used to set Event Trigger as Signal +Signal, +//Used to set Event Trigger as Multiple +Multiple, +//Used to set Event Trigger as Parallel +Parallel, +} +} +module Diagram +{ +enum Shapes +{ +//Used to set decorator shape as none +None, +//Used to set decorator shape as Arrow +Arrow, +//Used to set decorator shape as Open Arrow +OpenArrow, +//Used to set decorator shape as Circle +Circle, +//Used to set decorator shape as Diamond +Diamond, +//Used to set decorator shape as path +Path, +} +} +module Diagram +{ +enum PageOrientations +{ +//Used to set orientation as Landscape +Landscape, +//Used to set orientation as portrait +Portrait, +} +} +module Diagram +{ +enum ScrollLimit +{ +//Used to set scrollLimit as Infinite +Infinite, +//Used to set scrollLimit as Diagram +Diagram, +//Used to set scrollLimit as Limited +Limited, +} +} +module Diagram +{ +enum SelectorConstraints +{ +//Hides the selector +None, +//Sets the visibility of rotation handle as visible +Rotator, +//Sets the visibility of resize handles as visible +Resizer, +//Sets the visibility of user handles as visible +UserHandles, +//Sets the visibility of all selection handles as visible +All, +} +} +module Diagram +{ +enum Tool +{ +//Disables all Tools +None, +//Enables/Disables SingleSelect tool +SingleSelect, +//Enables/Disables MultiSelect tool +MultipleSelect, +//Enables/Disables ZoomPan tool +ZoomPan, +//Enables/Disables DrawOnce tool +DrawOnce, +//Enables/Disables ContinuousDraw tool +ContinuesDraw, +} +} +module Diagram +{ +enum RelativeMode +{ +//Shows tooltip around the node +Object, +//Shows tooltip at the mouse position +Mouse, +} +} + +} + +interface JQueryXHR { +} +interface JQueryPromise { +} +interface JQueryDeferred extends JQueryPromise { +} +interface JQueryParam { +} +interface JQuery { + data(key: any): any; +} +interface JQuery { + + ejButton(): JQuery; + ejButton(options?: ej.Button.Model): JQuery; + data(key: "ejButton"): ej.Button; + + ejCaptcha(): JQuery; + ejCaptcha(options?: ej.Captcha.Model): JQuery; + data(key: "ejCaptcha"): ej.Captcha; + + ejAccordion(): JQuery; + ejAccordion(options?: ej.Accordion.Model): JQuery; + data(key: "ejAccordion"): ej.Accordion; + + ejAutocomplete(): JQuery; + ejAutocomplete(options?: ej.Autocomplete.Model): JQuery; + data(key: "ejAutocomplete"): ej.Autocomplete; + + ejDatePicker(): JQuery; + ejDatePicker(options?: ej.DatePicker.Model): JQuery; + data(key: "ejDatePicker"): ej.DatePicker; + + ejDateTimePicker(): JQuery; + ejDateTimePicker(options?: ej.DateTimePicker.Model): JQuery; + data(key: "ejDateTimePicker"): ej.DateTimePicker; + + ejDialog(): JQuery; + ejDialog(options?: ej.Dialog.Model): JQuery; + data(key: "ejDialog"): ej.Dialog; + + ejDropDownList(): JQuery; + ejDropDownList(options?: ej.DropDownList.Model): JQuery; + data(key: "ejDropDownList"): ej.DropDownList; + + ejFileExplorer(): JQuery; + ejFileExplorer(options?: ej.FileExplorer.Model): JQuery; + data(key: "ejFileExplorer"): ej.FileExplorer; + + ejListBox(): JQuery; + ejListBox(options?: ej.ListBox.Model): JQuery; + data(key: "ejListBox"): ej.ListBox; + + ejListView(): JQuery; + ejListView(options?: ej.ListView.Model): JQuery; + data(key: "ejListView"): ej.ListView; + + ejNumericTextbox(): JQuery; + ejNumericTextbox(options?: ej.Editor.Model): JQuery; + data(key: "ejNumericTextbox"): ej.NumericTextbox; + + ejCurrencyTextbox(): JQuery; + ejCurrencyTextbox(options?: ej.Editor.Model): JQuery; + data(key: "ejCurrencyTextbox"): ej.CurrencyTextbox; + + ejPercentageTextbox(): JQuery; + ejPercentageTextbox(options?: ej.Editor.Model): JQuery; + data(key: "ejPercentageTextbox"): ej.PercentageTextbox; + + ejMaskEdit(): JQuery; + ejMaskEdit(options?: ej.MaskEdit.Model): JQuery; + data(key: "ejMaskEdit"): ej.MaskEdit; + + ejMenu(): JQuery; + ejMenu(options?: ej.Menu.Model): JQuery; + data(key: "ejMenu"): ej.Menu; + + ejPager(): JQuery; + ejPager(options?: ej.Pager.Model): JQuery; + data(key: "ejPager"): ej.Pager; + + ejProgressBar(): JQuery; + ejProgressBar(options?: ej.ProgressBar.Model): JQuery; + data(key: "ejProgressBar"): ej.ProgressBar; + + ejRadioButton(): JQuery; + ejRadioButton(options?: ej.RadioButton.Model): JQuery; + data(key: "ejRadioButton"): ej.RadioButton; + + ejCheckBox(): JQuery; + ejCheckBox(options?: ej.CheckBox.Model): JQuery; + data(key: "ejCheckBox"): ej.CheckBox; + + ejRibbon(): JQuery; + ejRibbon(options?: ej.Ribbon.Model): JQuery; + data(key: "ejRibbon"): ej.Ribbon; + + ejKanban(): JQuery; + ejKanban(options?: ej.Kanban.Model): JQuery; + data(key: "ejKanban"): ej.Kanban; + + ejRating(): JQuery; + ejRating(options?: ej.Rating.Model): JQuery; + data(key: "ejRating"): ej.Rating; + + ejRotator(): JQuery; + ejRotator(options?: ej.Rotator.Model): JQuery; + data(key: "ejRotator"): ej.Rotator; + + ejRTE(): JQuery; + ejRTE(options?: ej.RTE.Model): JQuery; + data(key: "ejRTE"): ej.RTE; + + ejSlider(): JQuery; + ejSlider(options?: ej.Slider.Model): JQuery; + data(key: "ejSlider"): ej.Slider; + + ejSplitButton(): JQuery; + ejSplitButton(options?: ej.SplitButton.Model): JQuery; + data(key: "ejSplitButton"): ej.SplitButton; + + ejSplitter(): JQuery; + ejSplitter(options?: ej.Splitter.Model): JQuery; + data(key: "ejSplitter"): ej.Splitter; + + ejTab(): JQuery; + ejTab(options?: ej.Tab.Model): JQuery; + data(key: "ejTab"): ej.Tab; + + ejTagCloud(): JQuery; + ejTagCloud(options?: ej.TagCloud.Model): JQuery; + data(key: "ejTagCloud"): ej.TagCloud; + + ejTimePicker(): JQuery; + ejTimePicker(options?: ej.TimePicker.Model): JQuery; + data(key: "ejTimePicker"): ej.TimePicker; + + ejTile(): JQuery; + ejTile(options?: ej.Tile.Model): JQuery; + data(key: "ejTile"): ej.Tile; + + ejToggleButton(): JQuery; + ejToggleButton(options?: ej.ToggleButton.Model): JQuery; + data(key: "ejToggleButton"): ej.ToggleButton; + + ejToolbar(): JQuery; + ejToolbar(options?: ej.Toolbar.Model): JQuery; + data(key: "ejToolbar"): ej.Toolbar; + + ejNavigationDrawer(): JQuery; + ejNavigationDrawer(options?: ej.NavigationDrawer.Model): JQuery; + data(key: "ejNavigationDrawer"): ej.NavigationDrawer; + + ejRadialMenu(): JQuery; + ejRadialMenu(options?: ej.RadialMenu.Model): JQuery; + data(key: "ejRadialMenu"): ej.RadialMenu; + + ejTreeView(): JQuery; + ejTreeView(options?: ej.TreeView.Model): JQuery; + data(key: "ejTreeView"): ej.TreeView; + + ejUploadbox(): JQuery; + ejUploadbox(options?: ej.Uploadbox.Model): JQuery; + data(key: "ejUploadbox"): ej.Uploadbox; + + ejWaitingPopup(): JQuery; + ejWaitingPopup(options?: ej.WaitingPopup.Model): JQuery; + data(key: "ejWaitingPopup"): ej.WaitingPopup; + + ejSchedule(): JQuery; + ejSchedule(options?: ej.Schedule.Model): JQuery; + data(key: "ejSchedule"): ej.Schedule; + + ejRecurrenceEditor(): JQuery; + ejRecurrenceEditor(options?: ej.RecurrenceEditorOptions): JQuery; + data(key: "ejRecurrenceEditor"): ej.RecurrenceEditor; + + ejGrid(): JQuery; + ejGrid(options?: ej.Grid.Model): JQuery; + data(key: "ejGrid"): ej.Grid; + + /*ReportViewer*/ + ejReportViewer(): JQuery; + ejReportViewer(options?: ej.ReportViewer.Model): JQuery; + data(key: "ejReportViewer"): ej.ReportViewer; + /*ReportViewer*/ + + ejLinearGauge(): JQuery; + ejLinearGauge(options?: ej.datavisualization.LinearGauge.Model): JQuery; + data(key: "ejLinearGauge"): ej.datavisualization.LinearGauge; + + ejDigitalGauge(): JQuery; + ejDigitalGauge(options?: ej.datavisualization.DigitalGauge.Model): JQuery; + data(key: "ejDigitalGauge"): ej.datavisualization.DigitalGauge; + + ejCircularGauge(): JQuery; + ejCircularGauge(options?: ej.datavisualization.CircularGauge.Model): JQuery; + data(key: "ejCircularGauge"): ej.datavisualization.CircularGauge; + + ejChart(): JQuery; + ejChart(options?: ej.datavisualization.Chart.Model): JQuery; + data(key: "ejChart"): ej.datavisualization.Chart; + + ejRangeNavigator(): JQuery; + ejRangeNavigator(options?: ej.datavisualization.RangeNavigator.Model): JQuery; + data(key: "ejRangeNavigator"): ej.datavisualization.RangeNavigator; + + ejBulletGraph(): JQuery; + ejBulletGraph(options?: ej.datavisualization.BulletGraph.Model): JQuery; + data(key: "ejBulletGraph"): ej.datavisualization.BulletGraph; + + ejGantt(): JQuery; + ejGantt(options?: ej.Gantt.Model): JQuery; + data(key: "ejGantt"): ej.Gantt; + + ejTreeGrid(): JQuery; + ejTreeGrid(options?: ej.TreeGrid.Model): JQuery; + data(key: "ejTreeGrid"): ej.TreeGrid; + + ejMap(): JQuery; + ejMap(options?: ej.datavisualization.Map.Model): JQuery; + data(key: "ejMap"): ej.datavisualization.Map; + + ejTreeMap(): JQuery; + ejTreeMap(options?: ej.datavisualization.TreeMap.Model): JQuery; + data(key: "ejTreeMap"): ej.datavisualization.TreeMap; + + ejBarcode(): JQuery; + ejBarcode(options?: ej.datavisualization.Barcode.Model): JQuery; + data(key: "ejBarcode"): ej.datavisualization.Barcode; + + ejDiagram(): JQuery; + ejDiagram(options?: ej.datavisualization.Diagram.Model): JQuery; + data(key: "ejDiagram"): ej.datavisualization.Diagram; + + // ejSymbolPalette(): JQuery; + // ejSymbolPalette(options?: ej.datavisualization.SymbolPalette.Model): JQuery; + // data(key: "ejSymbolPalette"): ej.datavisualization.SymbolPalette; + + ejOlapChart(): JQuery; + ejOlapChart(options?: ej.olap.OlapChart.Model): JQuery; + data(key: "ejOlapChart"): ej.olap.OlapChart; + + ejPivotGrid(): JQuery; + ejPivotGrid(options?: ej.PivotGrid.Model): JQuery; + data(key: "ejPivotGrid"): ej.PivotGrid; + + ejPivotSchemaDesigner(): JQuery; + ejPivotSchemaDesigner(options?: ej.PivotSchemaDesigner.Model): JQuery; + data(key: "ejPivotSchemaDesigner"): ej.PivotSchemaDesigner; + + ejOlapClient(): JQuery; + ejOlapClient(options?: ej.olap.OlapClient.Model): JQuery; + data(key: "ejOlapClient"): ej.olap.OlapClient; + + ejOlapGauge(): JQuery; + ejOlapGauge(options?: ej.olap.OlapGauge.Model): JQuery; + data(key: "ejOlapGauge"): ej.olap.OlapGauge; + + ejPivotPager(): JQuery; + ejPivotPager(options?: ej.PivotPager.Model): JQuery; + data(key: "ejPivotPager"): ej.PivotPager; + + /* Spreadsheet */ + ejSpreadsheet(): JQuery; + ejSpreadsheet(options?: ej.Spreadsheet.Model): JQuery; + data(key: "ejSpreadsheet"): ej.Spreadsheet; + /* Spreadsheet */ + + ejScroller(): JQuery; + ejScroller(options?: ej.Scroller.Model): JQuery; + data(key: "ejScroller"): ej.Scroller; + +} +interface JQuery { + + /*Accordion*/ + ejmAccordion(): JQuery; + ejmAccordion(options?: ej.mobile.AccordionOptions): JQuery; + data(key: "ejmAccordion"): ej.mobile.Accordion; + /*Accordion*/ + + /*AutoComplete*/ + ejmAutocomplete(): JQuery; + ejmAutocomplete(options?: ej.mobile.AutocompleteOptions): JQuery; + data(key: "ejmAutocomplete"): ej.mobile.Autocomplete; + /*AutoComplete*/ + + /*Button*/ + ejmButton(): JQuery; + ejmButton(options?: ej.mobile.ButtonOptions): JQuery; + data(key: "ejmButton"): ej.mobile.Button; + + ejmActionlink(): JQuery; + ejmActionlink(options?: ej.mobile.ButtonOptions): JQuery; + data(key: "ejmActionlink"): ej.mobile.Button; + /*Button*/ + + /* DatePicker */ + ejmDatePicker(): JQuery; + ejmDatePicker(options?: ej.mobile.DatePickerOptions): JQuery; + data(key: "ejmDatePicker"): ej.mobile.DatePicker; + /* DatePicker */ + + /*Editor*/ + ejmNumeric(): JQuery; + ejmNumeric(options?: ej.mobile.EditorOptions): JQuery; + data(key: "ejmNumeric"): ej.mobile.Numeric; + /*Editor*/ + + /* Grid Start */ + ejmGrid(): JQuery; + ejmGrid(options?: ej.mobile.GridOptions): JQuery; + data(key: "ejmGrid"): ej.mobile.Grid; + /* Grid End */ + + /*Header*/ + ejmHeader(): JQuery; + ejmHeader(options?: ej.mobile.HeaderOptions): JQuery; + data(key: "ejmHeader"): ej.mobile.Header; + /*Header*/ + + /*ListView*/ + ejmListView(): JQuery; + ejmListView(options?: ej.mobile.ListViewOptions): JQuery; + data(key: "ejmListView"): ej.mobile.ListView; + /*ListView*/ + + /*Menu*/ + ejmMenu(): JQuery; + ejmMenu(options?: ej.mobile.MenuOptions): JQuery; + data(key: "ejmMenu"): ej.mobile.Menu; + /*Menu*/ + + /* ProgressBar */ + ejmProgress(): JQuery; + ejmProgress(options?: ej.mobile.ProgressOptions): JQuery; + data(key: "ejmProgress"): ej.mobile.Progress; + /* ProgressBar */ + + /*Radio Button*/ + ejmRadioButton(): JQuery; + ejmRadioButton(options?: ej.mobile.RadioButtonOptions): JQuery; + data(key: "ejmRadioButton"): ej.mobile.RadioButton; + /*Radio Button*/ + + /*Rating*/ + ejmRating(): JQuery; + ejmRating(options?: ej.mobile.RatingOptions): JQuery; + data(key: "ejmRating"): ej.mobile.Rating; + /*Rating*/ + + + /*Rotator*/ + ejmRotator(): JQuery; + ejmRotator(options?: ej.mobile.RotatorOptions): JQuery; + data(key: "ejmRotator"): ej.mobile.Rotator; + /*Rotator*/ + + /*Slider*/ + ejmSlider(): JQuery; + ejmSlider(options?: ej.mobile.SliderOptions): JQuery; + data(key: "ejmSlider"): ej.mobile.Slider; + /*Slider*/ + + /* Tab */ + ejmTab(): JQuery; + ejmTab(options?: ej.mobile.TabOptions): JQuery; + data(key: "ejmTab"): ej.mobile.Tab; + /* Tab */ + + /*Tile*/ + ejmTile(): JQuery; + ejmTile(options?: ej.mobile.TileOptions): JQuery; + data(key: "ejmTile"): ej.mobile.Tile; + /*Tile*/ + + /* TimePicker */ + ejmTimePicker(): JQuery; + ejmTimePicker(options?: ej.mobile.TimePickerOptions): JQuery; + data(key: "ejmTimePicker"): ej.mobile.TimePicker; + /* TimePicker */ + + /*ToggleButton*/ + ejmToggleButton(): JQuery; + ejmToggleButton(options?: ej.mobile.ToggleButtonOptions): JQuery; + data(key: "ejmToggleButton"): ej.mobile.ToggleButton; + /*ToggleButton*/ + + /*Toolbar*/ + ejmToolbar(): JQuery; + ejmToolbar(options?: ej.mobile.ToolbarOptions): JQuery; + data(key: "ejmToolbar"): ej.mobile.Toolbar; + /*Toolbar*/ + + /*GroupButton*/ + ejmGroupButton(): JQuery; + ejmGroupButton(options?: ej.mobile.GroupButtonOptions): JQuery; + data(key: "ejmGroupButton"): ej.mobile.GroupButton; + /*GroupButton*/ + + /* SplitPane */ + ejmSplitPane(): JQuery; + ejmSplitPane(options?: ej.mobile.SplitPaneOptions): JQuery; + data(key: "ejmSplitPane"): ej.mobile.SplitPane; + /* SplitPane */ + + /* Dialog */ + ejmDialog(): JQuery; + ejmDialog(options?: ej.mobile.DialogOptions): JQuery; + data(key: "ejmDialog"): ej.mobile.Dialog; + /* Dialog */ + + /* TextBox */ + ejmTextBox(): JQuery; + ejmTextBox(options?: ej.mobile.TextBoxOptions): JQuery; + data(key: "ejmTextBox"): ej.mobile.TextBox; + /* TextBox */ + + /* Password */ + ejmPassword(): JQuery; + ejmPassword(options?: ej.mobile.TextBoxOptions): JQuery; + data(key: "ejmPassword"): ej.mobile.TextBox; + /* Password */ + + /* MaskEdit */ + ejmMaskEdit(): JQuery; + ejmMaskEdit(options?: ej.mobile.MaskEditOptions): JQuery; + data(key: "ejmMaskEdit"): ej.mobile.MaskEdit; + /* MaskEdit */ + + /* TextArea */ + ejmTextArea(): JQuery; + ejmTextArea(options?: ej.mobile.TextBoxOptions): JQuery; + data(key: "ejmTextArea"): ej.mobile.TextBox; + /* MaskEdit */ + + /* Footer */ + ejmFooter(): JQuery; + ejmFooter(options?: ej.mobile.FooterOptions): JQuery; + data(key: "ejmFooter"): ej.mobile.Footer; + /* Footer */ + + /* CheckBox */ + ejmCheckBox(): JQuery; + ejmCheckBox(options?: ej.mobile.CheckBoxOptions): JQuery; + data(key: "ejmCheckBox"): ej.mobile.CheckBox; + /* CheckBox */ + + /* ScrollPanel */ + ejmScrollPanel(): JQuery; + ejmScrollPanel(options: ej.mobile.ScrollPanelOptions): JQuery; + data(key: "ejmScrollPanel"): ej.mobile.ScrollPanel; + /* ScrollPanel */ + + /* NavigationDrawer */ + ejmNavigationDrawer(): JQuery; + ejmNavigationDrawer(options: ej.mobile.NavigationDrawerOptions): JQuery; + data(key: "ejmNavigationDrawer"): ej.mobile.NavigationDrawer; + /* NavigationDrawer */ + + /* RadialMenu */ + ejmRadialMenu(): JQuery; + ejmRadialMenu(options?: ej.mobile.RadialMenuOptions): JQuery; + data(key: "ejmRadialMenu"): ej.mobile.RadialMenu; + /* RadialMenu */ + + ejLinearGauge(): JQuery; + ejLinearGauge(options?: ej.datavisualization.LinearGauge.Model): JQuery; + data(key: "ejLinearGauge"): ej.datavisualization.LinearGauge; + + ejDigitalGauge(): JQuery; + ejDigitalGauge(options?: ej.datavisualization.DigitalGauge.Model): JQuery; + data(key: "ejDigitalGauge"): ej.datavisualization.DigitalGauge; + + ejCircularGauge(): JQuery; + ejCircularGauge(options?: ej.datavisualization.CircularGauge.Model): JQuery; + data(key: "ejCircularGauge"): ej.datavisualization.CircularGauge; + + ejChart(): JQuery; + ejChart(options?: ej.datavisualization.Chart.Model): JQuery; + data(key: "ejChart"): ej.datavisualization.Chart; + + ejRangeNavigator(): JQuery; + ejRangeNavigator(options?: ej.datavisualization.RangeNavigator.Model): JQuery; + data(key: "ejRangeNavigator"): ej.datavisualization.RangeNavigator; + + ejBulletGraph(): JQuery; + ejBulletGraph(options?: ej.datavisualization.BulletGraph.Model): JQuery; + data(key: "ejBulletGraph"): ej.datavisualization.BulletGraph; + + ejMap(): JQuery; + ejMap(options?: ej.datavisualization.Map.Model): JQuery; + data(key: "ejMap"): ej.datavisualization.Map; + + ejTreeMap(): JQuery; + ejTreeMap(options?: ej.datavisualization.TreeMap.Model): JQuery; + data(key: "ejTreeMap"): ej.datavisualization.TreeMap; + + ejBarcode(): JQuery; + ejBarcode(options?: ej.datavisualization.Barcode.Model): JQuery; + data(key: "ejBarcode"): ej.datavisualization.Barcode; + + ejDraggable(): JQuery; + ejDraggable(options?: ej.DraggableOptions): JQuery; + data(key: "ejDraggable"): ej.Draggable; + + ejDroppable(): JQuery; + ejDroppable(options?: ej.DroppableOptions): JQuery; + data(key: "ejDroppable"): ej.Droppable; + + ejResizable(): JQuery; + ejResizable(options?: ej.ResizableOptions): JQuery; + data(key: "ejResizable"): ej.Resizable; + + ejColorPicker(): JQuery; + ejColorPicker(options?: ej.ColorPicker.Model): JQuery; + data(key: "ejColorPicker"): ej.ColorPicker; + + ejRadialSlider(): JQuery; + ejRadialSlider(options?: ej.RadialSliderOptions): JQuery; + data(key: "ejRadialSlider"): ej.RadialSlider; + +} \ No newline at end of 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/enzyme/enzyme-1.2.0-tests.tsx b/enzyme/enzyme-1.2.0-tests.tsx new file mode 100644 index 0000000000..44db5705bc --- /dev/null +++ b/enzyme/enzyme-1.2.0-tests.tsx @@ -0,0 +1,605 @@ +/// +/// + +import { shallow, mount, render, describeWithDOM, spyLifecycle } from "enzyme"; +import * as React from "react"; +import {Component, ReactElement, HTMLAttributes} from "react"; +import {ShallowWrapper, ReactWrapper, CheerioWrapper} from "enzyme"; + + +// Help classes/interfaces +interface MyComponentProps { + propsProperty: any; + numberProp?: number; +} + +interface StatelessProps { + stateless: any; +} + +interface MyComponentState { + stateProperty: any; +} + +class MyComponent extends Component { + setState(...args: any[]) { + } +} + +const MyStatelessComponent = (props: StatelessProps) => ; + +// API +namespace SpyLifecycleTest { + spyLifecycle(MyComponent); +} + +// ShallowWrapper +namespace ShallowWrapperTest { + var shallowWrapper: ShallowWrapper = + shallow(); + + var reactElement: ReactElement, + objectVal: Object, + boolVal: Boolean, + stringVal: String, + elementWrapper: ShallowWrapper + + function test_find() { + elementWrapper = shallowWrapper.find('.selector'); + shallowWrapper = shallowWrapper.find(MyComponent); + shallowWrapper.find(MyStatelessComponent).props().stateless; + shallowWrapper.find(MyStatelessComponent).shallow(); + } + + function test_findWhere() { + shallowWrapper = + shallowWrapper.findWhere((aShallowWrapper: ShallowWrapper) => true); + } + + function test_filter() { + elementWrapper = shallowWrapper.filter('.selector'); + shallowWrapper = shallowWrapper.filter(MyComponent).shallow(); + } + + function test_filterWhere() { + shallowWrapper = + shallowWrapper.filterWhere(wrapper => { + wrapper.props().propsProperty; + return true; + }); + } + + function test_contains() { + boolVal = shallowWrapper.contains(
); + } + + function test_hasClass() { + boolVal = shallowWrapper.find('.my-button').hasClass('disabled'); + } + + function test_is() { + boolVal = shallowWrapper.is('.some-class'); + } + + function test_not() { + elementWrapper = shallowWrapper.find('.foo').not('.bar'); + } + + function test_children() { + shallowWrapper = shallowWrapper.children(); + shallowWrapper.children(MyStatelessComponent).props().stateless; + } + + function test_parents() { + shallowWrapper = shallowWrapper.parents(); + } + + function test_parent() { + shallowWrapper = shallowWrapper.parent(); + } + + function test_closest() { + elementWrapper = shallowWrapper.closest('.selector'); + shallowWrapper = shallowWrapper.closest(MyComponent); + } + + function test_shallow() { + shallowWrapper = shallowWrapper.shallow(); + } + + function test_unmount() { + shallowWrapper = shallowWrapper.unmount(); + } + + function test_render() { + var cheerioWrapper: CheerioWrapper = shallowWrapper.render(); + } + + function test_text() { + stringVal = shallowWrapper.text(); + } + + + function test_html() { + stringVal = shallowWrapper.html(); + } + + function test_get() { + reactElement = shallowWrapper.get(1); + } + + function test_at() { + shallowWrapper = shallowWrapper.at(1); + } + + function test_first() { + shallowWrapper = shallowWrapper.first(); + } + + function test_last() { + shallowWrapper = shallowWrapper.last(); + } + + function test_state() { + shallowWrapper.state(); + shallowWrapper.state('key'); + } + + function test_props() { + objectVal = shallowWrapper.props(); + } + + function test_prop() { + shallowWrapper.prop('key'); + } + + + function test_simulate(...args: any[]) { + shallowWrapper.simulate('click'); + shallowWrapper.simulate('click', args); + } + + function test_setState() { + shallowWrapper = shallowWrapper.setState({stateProperty: 'state'}); + } + + function test_setProps() { + shallowWrapper = shallowWrapper.setProps({propsProperty: 'foo'}); + } + + function test_setContext() { + shallowWrapper = shallowWrapper.setContext({name: 'baz'}); + } + + function test_instance() { + var myComponent: MyComponent = shallowWrapper.instance(); + } + + function test_update() { + shallowWrapper = shallowWrapper.update(); + } + + function test_debug() { + stringVal = shallowWrapper.debug(); + } + + function test_type() { + var stringOrFunction: String|Function = shallowWrapper.type(); + } + + function test_forEach() { + shallowWrapper = + shallowWrapper.forEach(wrapper => wrapper.shallow().props().propsProperty); + } + + function test_map() { + var arrayNumbers: Array = + shallowWrapper.map(wrapper => wrapper.props().numberProp); + } + + function test_reduce() { + const total: number[] = + shallowWrapper.reduce( + (amount: number, n: ShallowWrapper) => amount + n.props().numberProp + ); + } + + function test_reduceRight() { + const total: number[] = + shallowWrapper.reduceRight( + (amount: number, n: ShallowWrapper) => amount + n.prop('amount') + ); + } + + function test_some() { + boolVal = shallowWrapper.some('.selector'); + boolVal = shallowWrapper.some(MyComponent); + } + + function test_someWhere() { + boolVal = shallowWrapper.someWhere((aShallowWrapper: ShallowWrapper) => true); + } + + function test_every() { + boolVal = shallowWrapper.every('.selector'); + boolVal = shallowWrapper.every(MyComponent); + } + + function test_everyWhere() { + boolVal = shallowWrapper.everyWhere((aShallowWrapper: ShallowWrapper) => true); + } +} + + +// ReactWrapper +namespace ReactWrapperTest { + var reactWrapper: ReactWrapper = + mount(); + + var reactElement: ReactElement, + objectVal: Object, + boolVal: Boolean, + stringVal: String, + elementWrapper: ReactWrapper + + function test_unmount() { + reactWrapper = reactWrapper.unmount(); + } + + function test_mount() { + reactWrapper = reactWrapper.mount(); + } + + function test_find() { + elementWrapper = reactWrapper.find('.selector'); + reactWrapper = reactWrapper.find(MyComponent); + reactWrapper.find(MyStatelessComponent).props().stateless; + } + + function test_findWhere() { + reactWrapper = + reactWrapper.findWhere((aReactWrapper: ReactWrapper) => true); + } + + function test_filter() { + elementWrapper = reactWrapper.filter('.selector'); + reactWrapper = reactWrapper.filter(MyComponent); + } + + function test_filterWhere() { + reactWrapper = + reactWrapper.filterWhere(wrapper => { + wrapper.props().propsProperty; + return true; + }); + } + + function test_contains() { + boolVal = reactWrapper.contains(
); + } + + function test_hasClass() { + boolVal = reactWrapper.find('.my-button').hasClass('disabled'); + } + + function test_is() { + boolVal = reactWrapper.is('.some-class'); + } + + function test_not() { + elementWrapper = reactWrapper.find('.foo').not('.bar'); + } + + function test_children() { + reactWrapper = reactWrapper.children(); + } + + function test_parents() { + reactWrapper = reactWrapper.parents(); + } + + function test_parent() { + reactWrapper = reactWrapper.parent(); + } + + function test_closest() { + elementWrapper = reactWrapper.closest('.selector'); + reactWrapper = reactWrapper.closest(MyComponent); + } + + function test_text() { + stringVal = reactWrapper.text(); + } + + function test_html() { + stringVal = reactWrapper.html(); + } + + function test_get() { + reactElement = reactWrapper.get(1); + } + + function test_at() { + reactWrapper = reactWrapper.at(1); + } + + function test_first() { + reactWrapper = reactWrapper.first(); + } + + function test_last() { + reactWrapper = reactWrapper.last(); + } + + function test_state() { + reactWrapper.state(); + reactWrapper.state('key'); + } + + function test_props() { + objectVal = reactWrapper.props(); + } + + function test_prop() { + reactWrapper.prop('key'); + } + + + function test_simulate(...args: any[]) { + reactWrapper.simulate('click'); + reactWrapper.simulate('click', args); + } + + function test_setState() { + reactWrapper = reactWrapper.setState({stateProperty: 'state'}); + } + + function test_setProps() { + reactWrapper = reactWrapper.setProps({propsProperty: 'foo'}); + } + + function test_setContext() { + reactWrapper = reactWrapper.setContext({name: 'baz'}); + } + + function test_instance() { + var myComponent: MyComponent = reactWrapper.instance(); + } + + function test_update() { + reactWrapper = reactWrapper.update(); + } + + function test_debug() { + stringVal = reactWrapper.debug(); + } + + function test_type() { + var stringOrFunction: String|Function = reactWrapper.type(); + } + + function test_forEach() { + reactWrapper = + reactWrapper.forEach(wrapper => wrapper.props().propsProperty); + } + + function test_map() { + var arrayNumbers: Array = + reactWrapper.map(wrapper => wrapper.props().numberProp); + } + + function test_reduce() { + const total: number[] = + reactWrapper.reduce( + (amount: number, n: ReactWrapper) => amount + n.prop('amount') + ); + } + + function test_reduceRight() { + const total: number[] = + reactWrapper.reduceRight( + (amount: number, n: ReactWrapper) => amount + n.prop('amount') + ); + } + + function test_some() { + boolVal = reactWrapper.some('.selector'); + boolVal = reactWrapper.some(MyComponent); + } + + function test_someWhere() { + boolVal = reactWrapper.someWhere((aReactWrapper: ReactWrapper) => true); + } + + function test_every() { + boolVal = reactWrapper.every('.selector'); + boolVal = reactWrapper.every(MyComponent); + } + + function test_everyWhere() { + boolVal = reactWrapper.everyWhere((aReactWrapper: ReactWrapper) => true); + } +} + +// CheerioWrapper +namespace CheerioWrapperTest { + var cheerioWrapper: CheerioWrapper = + render(); + + var reactElement: ReactElement, + objectVal: Object, + boolVal: Boolean, + stringVal: String, + elementWrapper: CheerioWrapper + + function test_find() { + elementWrapper = cheerioWrapper.find('.selector'); + cheerioWrapper = cheerioWrapper.find(MyComponent); + cheerioWrapper.find(MyStatelessComponent).props().stateless; + } + + function test_findWhere() { + cheerioWrapper = + cheerioWrapper.findWhere((aCheerioWrapper: CheerioWrapper) => true); + } + + function test_filter() { + elementWrapper = cheerioWrapper.filter('.selector'); + cheerioWrapper = cheerioWrapper.filter(MyComponent); + } + + function test_filterWhere() { + cheerioWrapper = + cheerioWrapper.filterWhere(wrapper => { + wrapper.props().propsProperty; + return true; + }); + } + + function test_contains() { + boolVal = cheerioWrapper.contains(
); + } + + function test_hasClass() { + boolVal = cheerioWrapper.find('.my-button').hasClass('disabled'); + } + + function test_is() { + boolVal = cheerioWrapper.is('.some-class'); + } + + function test_not() { + elementWrapper = cheerioWrapper.find('.foo').not('.bar'); + } + + function test_children() { + cheerioWrapper = cheerioWrapper.children(); + } + + function test_parents() { + cheerioWrapper = cheerioWrapper.parents(); + } + + function test_parent() { + cheerioWrapper = cheerioWrapper.parent(); + } + + function test_closest() { + elementWrapper = cheerioWrapper.closest('.selector'); + cheerioWrapper = cheerioWrapper.closest(MyComponent); + } + + function test_text() { + stringVal = cheerioWrapper.text(); + } + + function test_html() { + stringVal = cheerioWrapper.html(); + } + + function test_get() { + reactElement = cheerioWrapper.get(1); + } + + function test_at() { + cheerioWrapper = cheerioWrapper.at(1); + } + + function test_first() { + cheerioWrapper = cheerioWrapper.first(); + } + + function test_last() { + cheerioWrapper = cheerioWrapper.last(); + } + + function test_state() { + cheerioWrapper.state(); + cheerioWrapper.state('key'); + } + + function test_props() { + objectVal = cheerioWrapper.props(); + } + + function test_prop() { + cheerioWrapper.prop('key'); + } + + + function test_simulate(...args: any[]) { + cheerioWrapper.simulate('click'); + cheerioWrapper.simulate('click', args); + } + + function test_setState() { + cheerioWrapper = cheerioWrapper.setState({stateProperty: 'state'}); + } + + function test_setProps() { + cheerioWrapper = cheerioWrapper.setProps({propsProperty: 'foo'}); + } + + function test_setContext() { + cheerioWrapper = cheerioWrapper.setContext({name: 'baz'}); + } + + function test_instance() { + var myComponent: MyComponent = cheerioWrapper.instance(); + } + + function test_update() { + cheerioWrapper = cheerioWrapper.update(); + } + + function test_debug() { + stringVal = cheerioWrapper.debug(); + } + + function test_type() { + var stringOrFunction: String|Function = cheerioWrapper.type(); + } + + function test_forEach() { + cheerioWrapper = + cheerioWrapper.forEach((aCheerioWrapper: CheerioWrapper)=> { + }); + } + + function test_map() { + var arrayNumbers: Array = + cheerioWrapper.map(wrapper => wrapper.props().numberProp); + } + + function test_reduce() { + const total: number[] = + cheerioWrapper.reduce( + (amount: number, n: CheerioWrapper) => amount + n.prop('amount') + ); + } + + function test_reduceRight() { + const total: number[] = + cheerioWrapper.reduceRight( + (amount: number, n: CheerioWrapper) => amount + n.prop('amount') + ); + } + + function test_some() { + boolVal = cheerioWrapper.some('.selector'); + boolVal = cheerioWrapper.some(MyComponent); + } + + function test_someWhere() { + boolVal = cheerioWrapper.someWhere((aCheerioWrapper: CheerioWrapper) => true); + } + + function test_every() { + boolVal = cheerioWrapper.every('.selector'); + boolVal = cheerioWrapper.every(MyComponent); + } + + function test_everyWhere() { + boolVal = cheerioWrapper.everyWhere((aCheerioWrapper: CheerioWrapper) => true); + } +} diff --git a/enzyme/enzyme-1.2.0.d.ts b/enzyme/enzyme-1.2.0.d.ts new file mode 100644 index 0000000000..13c00041a5 --- /dev/null +++ b/enzyme/enzyme-1.2.0.d.ts @@ -0,0 +1,473 @@ +// Type definitions for Enzyme v1.2.0 +// Project: https://github.com/airbnb/enzyme +// Definitions by: Marian Palkus , Cap3 +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare module "enzyme" { + + import {ReactElement, Component, StatelessComponent, ComponentClass, HTMLAttributes} from "react"; + + export class ElementClass extends Component { + } + + /** + * Many methods in Enzyme's API accept a selector as an argument. Selectors in Enzyme can fall into one of the + * following three categories: + * + * 1. A Valid CSS Selector + * 2. A React Component Constructor + * 3. A React Component's displayName + */ + export type EnzymeSelector = String | typeof ElementClass; + + interface CommonWrapper { + /** + * Find every node in the render tree that matches the provided selector. + * @param selector The selector to match. + */ + find(component: ComponentClass): CommonWrapper; + find(statelessComponent: StatelessComponent): CommonWrapper; + find(selector: string): CommonWrapper; + + /** + * Finds every node in the render tree that returns true for the provided predicate function. + * @param predicate + */ + findWhere(predicate: (wrapper: CommonWrapper) => Boolean): CommonWrapper; + + /** + * Removes nodes in the current wrapper that do not match the provided selector. + * @param selector The selector to match. + */ + filter(component: ComponentClass): CommonWrapper; + filter(statelessComponent: StatelessComponent): CommonWrapper; + filter(selector: string): CommonWrapper; + + /** + * Returns a new wrapper with only the nodes of the current wrapper that, when passed into the provided predicate function, return true. + * @param predicate + */ + filterWhere(predicate: (wrapper: this) => Boolean): this; + + /** + * Returns whether or not the current wrapper has a node anywhere in it's render tree that looks like the one passed in. + * @param node + */ + contains(node: ReactElement): Boolean; + + /** + * Returns whether or not the current node has a className prop including the passed in class name. + * @param className + */ + hasClass(className: String): Boolean; + + /** + * Returns whether or not the current node matches a provided selector. + * @param selector + */ + is(selector: EnzymeSelector): Boolean; + + /** + * Returns a new wrapper with only the nodes of the current wrapper that don't match the provided selector. + * This method is effectively the negation or inverse of filter. + * @param selector + */ + not(selector: EnzymeSelector): this; + + /** + * Returns a new wrapper with all of the children of the node(s) in the current wrapper. Optionally, a selector + * can be provided and it will filter the children by this selector. + * @param [selector] + */ + children(component: ComponentClass): CommonWrapper; + children(statelessComponent: StatelessComponent): CommonWrapper; + children(selector: string): CommonWrapper; + children(): CommonWrapper; + + /** + * Returns a wrapper around all of the parents/ancestors of the wrapper. Does not include the node in the + * current wrapper. Optionally, a selector can be provided and it will filter the parents by this selector. + * + * Note: can only be called on a wrapper of a single node. + * @param [selector] + */ + parents(component: ComponentClass): CommonWrapper; + parents(statelessComponent: StatelessComponent): CommonWrapper; + parents(selector: string): CommonWrapper; + parents(): CommonWrapper; + + /** + * Returns a wrapper with the direct parent of the node in the current wrapper. + */ + parent(): CommonWrapper; + + /** + * Returns a wrapper of the first element that matches the selector by traversing up through the current node's + * ancestors in the tree, starting with itself. + * + * Note: can only be called on a wrapper of a single node. + * @param selector + */ + closest(component: ComponentClass): CommonWrapper; + closest(statelessComponent: StatelessComponent): CommonWrapper; + closest(selector: string): CommonWrapper; + + /** + * Returns a string of the rendered text of the current render tree. This function should be looked at with + * skepticism if being used to test what the actual HTML output of the component will be. If that is what you + * would like to test, use enzyme's render function instead. + * + * Note: can only be called on a wrapper of a single node. + */ + text(): String; + + /** + * Returns a string of the rendered HTML markup of the current render tree. + * + * Note: can only be called on a wrapper of a single node. + */ + html(): String; + + /** + * Returns the node at a given index of the current wrapper. + * @param index + */ + get(index: number): ReactElement; + + /** + * Returns a wrapper around the node at a given index of the current wrapper. + * @param index + */ + at(index: number): this; + + /** + * Reduce the set of matched nodes to the first in the set. + */ + first(): this; + + /** + * Reduce the set of matched nodes to the last in the set. + */ + last(): this; + + /** + * Returns the state hash for the root node of the wrapper. Optionally pass in a prop name and it will return just that value. + * @param [key] + */ + state(key?: String): any; + + /** + * Returns the props hash for the current node of the wrapper. + * + * NOTE: can only be called on a wrapper of a single node. + */ + props(): P; + + /** + * Returns the prop value for the node of the current wrapper with the provided key. + * + * NOTE: can only be called on a wrapper of a single node. + * @param key + */ + prop(key: String): any; + + /** + * Simulate events. + * Returns itself. + * @param event + * @param args? + */ + simulate(event: string, ...args: any[]): this; + + /** + * A method to invoke setState() on the root component instance similar to how you might in the definition of + * the component, and re-renders. This method is useful for testing your component in hard to achieve states, + * however should be used sparingly. If possible, you should utilize your component's external API in order to + * get it into whatever state you want to test, in order to be as accurate of a test as possible. This is not + * always practical, however. + * Returns itself. + * + * NOTE: can only be called on a wrapper instance that is also the root instance. + * @param state + */ + setState(state: S): this; + + /** + * A method that sets the props of the root component, and re-renders. Useful for when you are wanting to test + * how the component behaves over time with changing props. Calling this, for instance, will call the + * componentWillReceiveProps lifecycle method. + * + * Similar to setState, this method accepts a props object and will merge it in with the already existing props. + * Returns itself. + * + * NOTE: can only be called on a wrapper instance that is also the root instance. + * @param state + */ + setProps(props: P): this; + + /** + * A method that sets the context of the root component, and re-renders. Useful for when you are wanting to + * test how the component behaves over time with changing contexts. + * Returns itself. + * + * NOTE: can only be called on a wrapper instance that is also the root instance. + * @param state + */ + setContext(context: Object): this; + + /** + * Gets the instance of the component being rendered as the root node passed into shallow(). + * + * NOTE: can only be called on a wrapper instance that is also the root instance. + */ + instance(): Component; + + /** + * Forces a re-render. Useful to run before checking the render output if something external may be updating + * the state of the component somewhere. + * Returns itself. + * + * NOTE: can only be called on a wrapper instance that is also the root instance. + */ + update(): this; + + /** + * Returns an html-like string of the wrapper for debugging purposes. Useful to print out to the console when + * tests are not passing when you expect them to. + */ + debug(): String; + + /** + * Returns the type of the current node of this wrapper. If it's a composite component, this will be the + * component constructor. If it's native DOM node, it will be a string of the tag name. + * + * Note: can only be called on a wrapper of a single node. + */ + type(): String | Function; + + /** + * Iterates through each node of the current wrapper and executes the provided function with a wrapper around + * the corresponding node passed in as the first argument. + * + * Returns itself. + * @param fn A callback to be run for every node in the collection. Should expect a ShallowWrapper as the first + * argument, and will be run with a context of the original instance. + */ + forEach(fn: (wrapper: this) => any): this; + + /** + * Maps the current array of nodes to another array. Each node is passed in as a ShallowWrapper to the map + * function. + * Returns an array of the returned values from the mapping function.. + * @param fn A mapping function to be run for every node in the collection, the results of which will be mapped + * to the returned array. Should expect a ShallowWrapper as the first argument, and will be run + * with a context of the original instance. + */ + map(fn: (wrapper: this) => V): V[]; + + /** + * Applies the provided reducing function to every node in the wrapper to reduce to a single value. Each node + * is passed in as a ShallowWrapper, and is processed from left to right. + * @param fn + * @param initialValue + */ + reduce(fn: (prevVal: R, wrapper: this, index: number) => R, initialValue?: R): R[]; + + /** + * Applies the provided reducing function to every node in the wrapper to reduce to a single value. + * Each node is passed in as a ShallowWrapper, and is processed from right to left. + * @param fn + * @param initialValue + */ + reduceRight(fn: (prevVal: R, wrapper: this, index: number) => R, initialValue?: R): R[]; + + /** + * Returns whether or not any of the nodes in the wrapper match the provided selector. + * @param selector + */ + some(selector: EnzymeSelector): Boolean; + + /** + * Returns whether or not any of the nodes in the wrapper pass the provided predicate function. + * @param fn + */ + someWhere(fn: (wrapper: this) => Boolean): Boolean; + + /** + * Returns whether or not all of the nodes in the wrapper match the provided selector. + * @param selector + */ + every(selector: EnzymeSelector): Boolean; + + /** + * Returns whether or not any of the nodes in the wrapper pass the provided predicate function. + * @param fn + */ + everyWhere(fn: (wrapper: this) => Boolean): Boolean; + + length: number; + } + + export interface ShallowWrapper extends CommonWrapper { + shallow(): ShallowWrapper; + render(): CheerioWrapper; + unmount(): ShallowWrapper; + + /** + * Find every node in the render tree that matches the provided selector. + * @param selector The selector to match. + */ + find(component: ComponentClass): ShallowWrapper; + find(statelessComponent: (props: P2) => JSX.Element): ShallowWrapper; + find(selector: string): ShallowWrapper; + + /** + * Removes nodes in the current wrapper that do not match the provided selector. + * @param selector The selector to match. + */ + filter(component: ComponentClass): ShallowWrapper; + filter(statelessComponent: StatelessComponent): ShallowWrapper; + filter(selector: string): ShallowWrapper; + + /** + * Finds every node in the render tree that returns true for the provided predicate function. + * @param predicate + */ + findWhere(predicate: (wrapper: CommonWrapper) => Boolean): ShallowWrapper; + + /** + * Returns a new wrapper with all of the children of the node(s) in the current wrapper. Optionally, a selector + * can be provided and it will filter the children by this selector. + * @param [selector] + */ + children(component: ComponentClass): ShallowWrapper; + children(statelessComponent: StatelessComponent): ShallowWrapper; + children(selector: string): ShallowWrapper; + children(): ShallowWrapper; + + /** + * Returns a wrapper around all of the parents/ancestors of the wrapper. Does not include the node in the + * current wrapper. Optionally, a selector can be provided and it will filter the parents by this selector. + * + * Note: can only be called on a wrapper of a single node. + * @param [selector] + */ + parents(component: ComponentClass): ShallowWrapper; + parents(statelessComponent: StatelessComponent): ShallowWrapper; + parents(selector: string): ShallowWrapper; + parents(): ShallowWrapper; + + /** + * Returns a wrapper of the first element that matches the selector by traversing up through the current node's + * ancestors in the tree, starting with itself. + * + * Note: can only be called on a wrapper of a single node. + * @param selector + */ + closest(component: ComponentClass): ShallowWrapper; + closest(statelessComponent: StatelessComponent): ShallowWrapper; + closest(selector: string): ShallowWrapper; + + /** + * Returns a wrapper with the direct parent of the node in the current wrapper. + */ + parent(): ShallowWrapper; + } + + export interface ReactWrapper extends CommonWrapper { + unmount(): ReactWrapper; + mount(): ReactWrapper; + + /** + * Find every node in the render tree that matches the provided selector. + * @param selector The selector to match. + */ + find(component: ComponentClass): ReactWrapper; + find(statelessComponent: (props: P2) => JSX.Element): ReactWrapper; + find(selector: string): ReactWrapper; + + /** + * Finds every node in the render tree that returns true for the provided predicate function. + * @param predicate + */ + findWhere(predicate: (wrapper: CommonWrapper) => Boolean): ReactWrapper; + + /** + * Removes nodes in the current wrapper that do not match the provided selector. + * @param selector The selector to match. + */ + filter(component: ComponentClass): ReactWrapper; + filter(statelessComponent: StatelessComponent): ReactWrapper; + filter(selector: string): ReactWrapper; + + /** + * Returns a new wrapper with all of the children of the node(s) in the current wrapper. Optionally, a selector + * can be provided and it will filter the children by this selector. + * @param [selector] + */ + children(component: ComponentClass): ReactWrapper; + children(statelessComponent: StatelessComponent): ReactWrapper; + children(selector: string): ReactWrapper; + children(): ReactWrapper; + + /** + * Returns a wrapper around all of the parents/ancestors of the wrapper. Does not include the node in the + * current wrapper. Optionally, a selector can be provided and it will filter the parents by this selector. + * + * Note: can only be called on a wrapper of a single node. + * @param [selector] + */ + parents(component: ComponentClass): ReactWrapper; + parents(statelessComponent: StatelessComponent): ReactWrapper; + parents(selector: string): ReactWrapper; + parents(): ReactWrapper; + + /** + * Returns a wrapper of the first element that matches the selector by traversing up through the current node's + * ancestors in the tree, starting with itself. + * + * Note: can only be called on a wrapper of a single node. + * @param selector + */ + closest(component: ComponentClass): ReactWrapper; + closest(statelessComponent: StatelessComponent): ReactWrapper; + closest(selector: string): ReactWrapper; + + /** + * Returns a wrapper with the direct parent of the node in the current wrapper. + */ + parent(): ReactWrapper; + } + + export interface CheerioWrapper extends CommonWrapper { + + } + + /** + * Shallow rendering is useful to constrain yourself to testing a component as a unit, and to ensure that + * your tests aren't indirectly asserting on behavior of child components. + * @param node + * @param [options] + */ + export function shallow(node: ReactElement

, options?: any): ShallowWrapper; + + /** + * Mounts and renders a react component into the document and provides a testing wrapper around it. + * @param node + * @param [options] + */ + export function mount(node: ReactElement

, options?: any): ReactWrapper; + + /** + * Render react components to static HTML and analyze the resulting HTML structure. + * @param node + * @param [options] + */ + export function render(node: ReactElement

, options?: any): CheerioWrapper; + + export function describeWithDOM(description: String, fn: Function): void; + + export function spyLifecycle(component: typeof Component): void; +} \ No newline at end of file diff --git a/enzyme/enzyme-tests.tsx b/enzyme/enzyme-tests.tsx index 56767b4ab3..805201e53a 100644 --- a/enzyme/enzyme-tests.tsx +++ b/enzyme/enzyme-tests.tsx @@ -73,6 +73,26 @@ namespace ShallowWrapperTest { boolVal = shallowWrapper.contains(

); } + function test_containsMatchingElement() { + boolVal = shallowWrapper.contains(
); + } + + function test_containsAllMatchingElements() { + boolVal = shallowWrapper.containsAllMatchingElements([
]); + } + + function test_containsAnyMatchingElement() { + boolVal = shallowWrapper.containsAnyMatchingElements([
]); + } + + function test_equals() { + boolVal = shallowWrapper.equals(
); + } + + function test_matchesElement() { + boolVal = shallowWrapper.matchesElement(
); + } + function test_hasClass() { boolVal = shallowWrapper.find('.my-button').hasClass('disabled'); } @@ -90,6 +110,20 @@ namespace ShallowWrapperTest { shallowWrapper.children(MyStatelessComponent).props().stateless; } + function test_childAt() { + const childWrapper: ShallowWrapper = shallowWrapper.childAt(0); + + interface TmpType1 { + foo: any + } + + interface TmpType2 { + bar: any + } + + const childWrapper2: ShallowWrapper = shallowWrapper.childAt(0); + } + function test_parents() { shallowWrapper = shallowWrapper.parents(); } @@ -107,6 +141,10 @@ namespace ShallowWrapperTest { shallowWrapper = shallowWrapper.shallow(); } + function test_unmount() { + shallowWrapper = shallowWrapper.unmount(); + } + function test_render() { var cheerioWrapper: CheerioWrapper = shallowWrapper.render(); } @@ -139,6 +177,13 @@ namespace ShallowWrapperTest { function test_state() { shallowWrapper.state(); shallowWrapper.state('key'); + const tmp: String = shallowWrapper.state('key'); + } + + function test_context() { + shallowWrapper.context(); + shallowWrapper.context('key'); + const tmp: String = shallowWrapper.context('key'); } function test_props() { @@ -147,8 +192,12 @@ namespace ShallowWrapperTest { function test_prop() { shallowWrapper.prop('key'); + const tmp: String = shallowWrapper.prop('key'); } + function test_key() { + stringVal = shallowWrapper.key(); + } function test_simulate(...args: any[]) { shallowWrapper.simulate('click'); @@ -156,15 +205,15 @@ namespace ShallowWrapperTest { } function test_setState() { - shallowWrapper = shallowWrapper.setState({stateProperty: 'state'}); + shallowWrapper = shallowWrapper.setState({ stateProperty: 'state' }); } function test_setProps() { - shallowWrapper = shallowWrapper.setProps({propsProperty: 'foo'}); + shallowWrapper = shallowWrapper.setProps({ propsProperty: 'foo' }); } function test_setContext() { - shallowWrapper = shallowWrapper.setContext({name: 'baz'}); + shallowWrapper = shallowWrapper.setContext({ name: 'baz' }); } function test_instance() { @@ -180,7 +229,11 @@ namespace ShallowWrapperTest { } function test_type() { - var stringOrFunction: String|Function = shallowWrapper.type(); + var stringOrFunction: String | Function = shallowWrapper.type(); + } + + function test_name() { + var str: String = shallowWrapper.name(); } function test_forEach() { @@ -238,6 +291,32 @@ namespace ReactWrapperTest { stringVal: String, elementWrapper: ReactWrapper + function test_unmount() { + reactWrapper = reactWrapper.unmount(); + } + + function test_mount() { + reactWrapper = reactWrapper.mount(); + } + + function test_ref() { + reactWrapper = reactWrapper.ref('refName'); + + interface TmpType1 { + foo: string + } + + interface TmpType2 { + bar: string + } + + const tmp: ReactWrapper = reactWrapper.ref('refName'); + } + + function test_detach() { + reactWrapper.detach(); + } + function test_find() { elementWrapper = reactWrapper.find('.selector'); reactWrapper = reactWrapper.find(MyComponent); @@ -266,6 +345,26 @@ namespace ReactWrapperTest { boolVal = reactWrapper.contains(
); } + function test_containsMatchingElement() { + boolVal = reactWrapper.contains(
); + } + + function test_containsAllMatchingElements() { + boolVal = reactWrapper.containsAllMatchingElements([
]); + } + + function test_containsAnyMatchingElement() { + boolVal = reactWrapper.containsAnyMatchingElements([
]); + } + + function test_equals() { + boolVal = reactWrapper.equals(
); + } + + function test_matchesElement() { + boolVal = reactWrapper.matchesElement(
); + } + function test_hasClass() { boolVal = reactWrapper.find('.my-button').hasClass('disabled'); } @@ -282,6 +381,20 @@ namespace ReactWrapperTest { reactWrapper = reactWrapper.children(); } + function test_childAt() { + const childWrapper: ReactWrapper = reactWrapper.childAt(0); + + interface TmpType1 { + foo: any + } + + interface TmpType2 { + bar: any + } + + const childWrapper2: ReactWrapper = reactWrapper.childAt(0); + } + function test_parents() { reactWrapper = reactWrapper.parents(); } @@ -322,6 +435,13 @@ namespace ReactWrapperTest { function test_state() { reactWrapper.state(); reactWrapper.state('key'); + const tmp: String = reactWrapper.state('key'); + } + + function test_context() { + reactWrapper.context(); + reactWrapper.context('key'); + const tmp: String = reactWrapper.context('key'); } function test_props() { @@ -330,8 +450,12 @@ namespace ReactWrapperTest { function test_prop() { reactWrapper.prop('key'); + const tmp: String = reactWrapper.prop('key'); } + function test_key() { + stringVal = reactWrapper.key(); + } function test_simulate(...args: any[]) { reactWrapper.simulate('click'); @@ -339,15 +463,15 @@ namespace ReactWrapperTest { } function test_setState() { - reactWrapper = reactWrapper.setState({stateProperty: 'state'}); + reactWrapper = reactWrapper.setState({ stateProperty: 'state' }); } function test_setProps() { - reactWrapper = reactWrapper.setProps({propsProperty: 'foo'}); + reactWrapper = reactWrapper.setProps({ propsProperty: 'foo' }); } function test_setContext() { - reactWrapper = reactWrapper.setContext({name: 'baz'}); + reactWrapper = reactWrapper.setContext({ name: 'baz' }); } function test_instance() { @@ -363,7 +487,11 @@ namespace ReactWrapperTest { } function test_type() { - var stringOrFunction: String|Function = reactWrapper.type(); + var stringOrFunction: String | Function = reactWrapper.type(); + } + + function test_name() { + var str: String = reactWrapper.name(); } function test_forEach() { @@ -418,7 +546,7 @@ namespace CheerioWrapperTest { objectVal: Object, boolVal: Boolean, stringVal: String, - elementWrapper: ReactWrapper + elementWrapper: CheerioWrapper function test_find() { elementWrapper = cheerioWrapper.find('.selector'); @@ -448,6 +576,26 @@ namespace CheerioWrapperTest { boolVal = cheerioWrapper.contains(
); } + function test_containsMatchingElement() { + boolVal = cheerioWrapper.contains(
); + } + + function test_containsAllMatchingElements() { + boolVal = cheerioWrapper.containsAllMatchingElements([
]); + } + + function test_containsAnyMatchingElement() { + boolVal = cheerioWrapper.containsAnyMatchingElements([
]); + } + + function test_equals() { + boolVal = cheerioWrapper.equals(
); + } + + function test_matchesElement() { + boolVal = cheerioWrapper.matchesElement(
); + } + function test_hasClass() { boolVal = cheerioWrapper.find('.my-button').hasClass('disabled'); } @@ -464,6 +612,20 @@ namespace CheerioWrapperTest { cheerioWrapper = cheerioWrapper.children(); } + function test_childAt() { + const childWrapper: CheerioWrapper = cheerioWrapper.childAt(0); + + interface TmpType1 { + foo: any + } + + interface TmpType2 { + bar: any + } + + const childWrapper2: CheerioWrapper = cheerioWrapper.childAt(0); + } + function test_parents() { cheerioWrapper = cheerioWrapper.parents(); } @@ -504,6 +666,13 @@ namespace CheerioWrapperTest { function test_state() { cheerioWrapper.state(); cheerioWrapper.state('key'); + const tmp: String = cheerioWrapper.state('key'); + } + + function test_context() { + cheerioWrapper.context(); + cheerioWrapper.context('key'); + const tmp: String = cheerioWrapper.context('key'); } function test_props() { @@ -512,8 +681,12 @@ namespace CheerioWrapperTest { function test_prop() { cheerioWrapper.prop('key'); + const tmp: String = cheerioWrapper.prop('key'); } + function test_key() { + stringVal = cheerioWrapper.key(); + } function test_simulate(...args: any[]) { cheerioWrapper.simulate('click'); @@ -521,15 +694,15 @@ namespace CheerioWrapperTest { } function test_setState() { - cheerioWrapper = cheerioWrapper.setState({stateProperty: 'state'}); + cheerioWrapper = cheerioWrapper.setState({ stateProperty: 'state' }); } function test_setProps() { - cheerioWrapper = cheerioWrapper.setProps({propsProperty: 'foo'}); + cheerioWrapper = cheerioWrapper.setProps({ propsProperty: 'foo' }); } function test_setContext() { - cheerioWrapper = cheerioWrapper.setContext({name: 'baz'}); + cheerioWrapper = cheerioWrapper.setContext({ name: 'baz' }); } function test_instance() { @@ -545,12 +718,16 @@ namespace CheerioWrapperTest { } function test_type() { - var stringOrFunction: String|Function = cheerioWrapper.type(); + var stringOrFunction: String | Function = cheerioWrapper.type(); + } + + function test_name() { + var str: String = cheerioWrapper.name(); } function test_forEach() { cheerioWrapper = - cheerioWrapper.forEach((aCheerioWrapper: CheerioWrapper)=> { + cheerioWrapper.forEach((aCheerioWrapper: CheerioWrapper) => { }); } diff --git a/enzyme/enzyme.d.ts b/enzyme/enzyme.d.ts index 9047fbf728..2698fd366b 100644 --- a/enzyme/enzyme.d.ts +++ b/enzyme/enzyme.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Enzyme v1.2.0 +// Type definitions for Enzyme v2.3.0 // Project: https://github.com/airbnb/enzyme // Definitions by: Marian Palkus , Cap3 // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -57,6 +57,34 @@ declare module "enzyme" { */ contains(node: ReactElement): Boolean; + /** + * Returns whether or not a given react element exists in the shallow render tree. + * @param node + */ + containsMatchingElement(node: ReactElement): Boolean; + + /** + * Returns whether or not all the given react elements exists in the shallow render tree + * @param nodes + */ + containsAllMatchingElements(nodes: ReactElement[]): Boolean; + + /** + * Returns whether or not one of the given react elements exists in the shallow render tree. + * @param nodes + */ + containsAnyMatchingElements(nodes: ReactElement[]): Boolean; + + /** + * Returns whether or not the current render tree is equal to the given node, based on the expected value. + */ + equals(node: ReactElement): Boolean; + + /** + * Returns whether or not a given react element matches the shallow render tree. + */ + matchesElement(node: ReactElement): Boolean; + /** * Returns whether or not the current node has a className prop including the passed in class name. * @param className @@ -86,6 +114,13 @@ declare module "enzyme" { children(selector: string): CommonWrapper; children(): CommonWrapper; + /** + * Returns a new wrapper with child at the specified index. + * @param index + */ + childAt(index: Number): CommonWrapper; + childAt(index: Number): CommonWrapper; + /** * Returns a wrapper around all of the parents/ancestors of the wrapper. Does not include the node in the * current wrapper. Optionally, a selector can be provided and it will filter the parents by this selector. @@ -157,6 +192,13 @@ declare module "enzyme" { * @param [key] */ state(key?: String): any; + state(key?: String): T; + + /** + * Returns the context hash for the root node of the wrapper. Optionally pass in a prop name and it will return just that value. + */ + context(key?: String): any; + context(key?: String): T; /** * Returns the props hash for the current node of the wrapper. @@ -172,6 +214,13 @@ declare module "enzyme" { * @param key */ prop(key: String): any; + prop(key: String): T; + + /** + * Returns the key value for the node of the current wrapper. + * NOTE: can only be called on a wrapper of a single node. + */ + key(): String; /** * Simulate events. @@ -247,6 +296,11 @@ declare module "enzyme" { */ type(): String | Function; + /** + * Returns the name of the current node of the wrapper. + */ + name(): String; + /** * Iterates through each node of the current wrapper and executes the provided function with a wrapper around * the corresponding node passed in as the first argument. @@ -313,6 +367,7 @@ declare module "enzyme" { export interface ShallowWrapper extends CommonWrapper { shallow(): ShallowWrapper; render(): CheerioWrapper; + unmount(): ShallowWrapper; /** * Find every node in the render tree that matches the provided selector. @@ -346,6 +401,13 @@ declare module "enzyme" { children(selector: string): ShallowWrapper; children(): ShallowWrapper; + /** + * Returns a new wrapper with child at the specified index. + * @param index + */ + childAt(index: Number): ShallowWrapper; + childAt(index: Number): ShallowWrapper; + /** * Returns a wrapper around all of the parents/ancestors of the wrapper. Does not include the node in the * current wrapper. Optionally, a selector can be provided and it will filter the parents by this selector. @@ -376,7 +438,94 @@ declare module "enzyme" { } export interface ReactWrapper extends CommonWrapper { + unmount(): ReactWrapper; + mount(): ReactWrapper; + /** + * Returns a wrapper of the node that matches the provided reference name. + * + * NOTE: can only be called on a wrapper instance that is also the root instance. + */ + ref(refName: String): ReactWrapper; + ref(refName: String): ReactWrapper; + + /** + * Detaches the react tree from the DOM. Runs ReactDOM.unmountComponentAtNode() under the hood. + * + * This method will most commonly be used as a "cleanup" method if you decide to use the attachTo option in mount(node, options). + * + * The method is intentionally not "fluent" (in that it doesn't return this) because you should not be doing anything with this wrapper after this method is called. + * + * Using the attachTo is not generally recommended unless it is absolutely necessary to test something. It is your responsibility to clean up after yourself at the end of the test if you do decide to use it, though. + */ + detach() : void; + + /** + * Find every node in the render tree that matches the provided selector. + * @param selector The selector to match. + */ + find(component: ComponentClass): ReactWrapper; + find(statelessComponent: (props: P2) => JSX.Element): ReactWrapper; + find(selector: string): ReactWrapper; + + /** + * Finds every node in the render tree that returns true for the provided predicate function. + * @param predicate + */ + findWhere(predicate: (wrapper: CommonWrapper) => Boolean): ReactWrapper; + + /** + * Removes nodes in the current wrapper that do not match the provided selector. + * @param selector The selector to match. + */ + filter(component: ComponentClass): ReactWrapper; + filter(statelessComponent: StatelessComponent): ReactWrapper; + filter(selector: string): ReactWrapper; + + /** + * Returns a new wrapper with all of the children of the node(s) in the current wrapper. Optionally, a selector + * can be provided and it will filter the children by this selector. + * @param [selector] + */ + children(component: ComponentClass): ReactWrapper; + children(statelessComponent: StatelessComponent): ReactWrapper; + children(selector: string): ReactWrapper; + children(): ReactWrapper; + + /** + * Returns a new wrapper with child at the specified index. + * @param index + */ + childAt(index: Number): ReactWrapper; + childAt(index: Number): ReactWrapper; + + /** + * Returns a wrapper around all of the parents/ancestors of the wrapper. Does not include the node in the + * current wrapper. Optionally, a selector can be provided and it will filter the parents by this selector. + * + * Note: can only be called on a wrapper of a single node. + * @param [selector] + */ + parents(component: ComponentClass): ReactWrapper; + parents(statelessComponent: StatelessComponent): ReactWrapper; + parents(selector: string): ReactWrapper; + parents(): ReactWrapper; + + /** + * Returns a wrapper of the first element that matches the selector by traversing up through the current node's + * ancestors in the tree, starting with itself. + * + * Note: can only be called on a wrapper of a single node. + * @param selector + */ + closest(component: ComponentClass): ReactWrapper; + closest(statelessComponent: StatelessComponent): ReactWrapper; + closest(selector: string): ReactWrapper; + + /** + * Returns a wrapper with the direct parent of the node in the current wrapper. + */ + parent(): ReactWrapper; } export interface CheerioWrapper extends CommonWrapper { diff --git a/es6-promise/es6-promise-tests.ts b/es6-promise/es6-promise-tests.ts index ac4f92d3d5..ee88cbc96f 100644 --- a/es6-promise/es6-promise-tests.ts +++ b/es6-promise/es6-promise-tests.ts @@ -80,9 +80,8 @@ promiseNumber = catchWithSimpleResult; var catchWithPromiseResult = promiseString.catch(error => Promise.resolve(10)); promiseNumber = catchWithPromiseResult; -promiseString = promiseString.catch(function () { +promiseString = promiseString.catch(function (): string { throw new Error('Better error msg'); - return null; }); //examples coming from http://www.html5rocks.com/en/tutorials/es6/promises/ diff --git a/es6-promise/es6-promise.d.ts b/es6-promise/es6-promise.d.ts index ec0c222385..001330fd24 100644 --- a/es6-promise/es6-promise.d.ts +++ b/es6-promise/es6-promise.d.ts @@ -58,7 +58,16 @@ declare namespace Promise { * the array passed to all can be a mixture of promise-like objects and other objects. * The fulfillment value is an array (in order) of fulfillment values. The rejection value is the first rejection value. */ - function all(promises: (T | Thenable)[]): Promise; + function all(values: [T1 | Thenable, T2 | Thenable, T3 | Thenable, T4 | Thenable , T5 | Thenable, T6 | Thenable, T7 | Thenable, T8 | Thenable, T9 | Thenable, T10 | Thenable]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]>; + function all(values: [T1 | Thenable, T2 | Thenable, T3 | Thenable, T4 | Thenable , T5 | Thenable, T6 | Thenable, T7 | Thenable, T8 | Thenable, T9 | Thenable]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9]>; + function all(values: [T1 | Thenable, T2 | Thenable, T3 | Thenable, T4 | Thenable , T5 | Thenable, T6 | Thenable, T7 | Thenable, T8 | Thenable]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8]>; + function all(values: [T1 | Thenable, T2 | Thenable, T3 | Thenable, T4 | Thenable , T5 | Thenable, T6 | Thenable, T7 | Thenable]): Promise<[T1, T2, T3, T4, T5, T6, T7]>; + function all(values: [T1 | Thenable, T2 | Thenable, T3 | Thenable, T4 | Thenable , T5 | Thenable, T6 | Thenable]): Promise<[T1, T2, T3, T4, T5, T6]>; + function all(values: [T1 | Thenable, T2 | Thenable, T3 | Thenable, T4 | Thenable , T5 | Thenable]): Promise<[T1, T2, T3, T4, T5]>; + function all(values: [T1 | Thenable, T2 | Thenable, T3 | Thenable, T4 | Thenable ]): Promise<[T1, T2, T3, T4]>; + function all(values: [T1 | Thenable, T2 | Thenable, T3 | Thenable]): Promise<[T1, T2, T3]>; + function all(values: [T1 | Thenable, T2 | Thenable]): Promise<[T1, T2]>; + function all(values: (T | Thenable)[]): Promise; /** * Make a Promise that fulfills when any item fulfills, and rejects if any item rejects. diff --git a/escodegen/escodegen-tests.ts b/escodegen/escodegen-tests.ts new file mode 100644 index 0000000000..f6c18cf5cd --- /dev/null +++ b/escodegen/escodegen-tests.ts @@ -0,0 +1,56 @@ +/// + +import * as escodegen from 'escodegen'; + +let emptyIndentOptions: escodegen.IndentOptions = {}; +let indentOptions: escodegen.IndentOptions = { + style: ' ', + base: 0, + adjustMultilineComment: true +}; + +let emptyFormatOptions: escodegen.FormatOptions = {}; +let formatOptions: escodegen.FormatOptions = { + indent: indentOptions, + newline: '\n', + space: ' ', + json: true, + renumber: true, + hexadecimal: true, + quotes: 'single', + escapeless: true, + compact: true, + parentheses: true, + semicolons: true, + safeConcatenation: true, + preserveBlankLines: true + } + +let emptyMozillaOptions: escodegen.MozillaOptions = {}; +let mozillaOptions: escodegen.MozillaOptions = { + starlessGenerator: true, + parenthesizedComprehensionBlock: true, + comprehensionExpressionStartsWithAssignment: true +} + +let emptyGenerateOptions: escodegen.GenerateOptions = {}; +let generateOptions: escodegen.GenerateOptions = { + format: formatOptions, + moz: mozillaOptions, + parse: () => {}, + comment: true, + sourceMap: " ", + sourceMapWithCode: true, + sourceContent: " ", + sourceCode: " ", + sourceMapRoot: " ", + directive: true, + file: " ", + verbatim: " " +}; + +let precedence: escodegen.Precedence = escodegen.Precedence.Primary; + +let myCode: string = escodegen.generate({}, generateOptions); + +let ast: any = escodegen.attachComments({}, {}, {}); diff --git a/escodegen/escodegen.d.ts b/escodegen/escodegen.d.ts new file mode 100644 index 0000000000..b72cfdedc6 --- /dev/null +++ b/escodegen/escodegen.d.ts @@ -0,0 +1,178 @@ +// Type definitions for escodegen +// Project: https://github.com/estools/escodegen +// Definitions by: Simon de Lang +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare module 'escodegen' { + + export interface FormatOptions { + /** + * The indent options + */ + indent?: IndentOptions; + /** + * New line string. Default is '\n'. + */ + newline?: string; + /** + * White space string. Default is standard ' ' (\x20). + */ + space?: string; + /** + * Enforce JSON format of numeric and string literals. This option takes precedence over option.format.hexadecimal and option.format.quotes. Default is false. + */ + json?: boolean; + /** + * Try to generate shorter numeric literals than toString() (9.8.1). Default is false. + */ + renumber?: boolean; + /** + * Generate hexadecimal a numeric literal if it is shorter than its equivalents. Requires option.format.renumber. Default is false. + */ + hexadecimal?: boolean; + /** + * Delimiter to use for string literals. Accepted values are: 'single', 'double', and 'auto'. When 'auto' is specified, escodegen selects a delimiter that results in a shorter literal. Default is 'single'. + */ + quotes?: string; + /** + * Escape as few characters in string literals as necessary. Default is false. + */ + escapeless?: boolean; + /** + * Do not include superfluous whitespace characters and line terminators. Default is false. + */ + compact?: boolean; + /** + * Preserve parentheses in new expressions that have no arguments. Default is true. + */ + parentheses?: boolean; + /** + * Preserve semicolons at the end of blocks and programs. Default is true. + */ + semicolons?: boolean; + safeConcatenation?: boolean; + preserveBlankLines?: boolean; + } + + export interface IndentOptions { + /** + * Indent string. Default is 4 spaces (' '). + */ + style?: string; + /** + * Base indent level. Default is 0. + */ + base?: number; + /** + * Adjust the indentation of multiline comments to keep asterisks vertically aligned. Default is false. + */ + adjustMultilineComment?: boolean; + } + + export interface MozillaOptions { + /** + * Default: false + */ + starlessGenerator?: boolean; + /** + * Default: false + */ + parenthesizedComprehensionBlock?: boolean; + /** + * Default: false + */ + comprehensionExpressionStartsWithAssignment?: boolean; + } + + export interface GenerateOptions { + /** + * The format options + */ + format?: FormatOptions; + moz?: MozillaOptions; + /** + * Mozilla Parser API compatible parse function, e.g., the parse function exported by esprima. If it is provided, generator tries to use the 'raw' representation. See esprima raw information. Default is null. + */ + parse?: Function; + /** + * If comments are attached to AST, escodegen is going to emit comments to output code. Default is false. + */ + comment?: boolean; + /** + * sourceMap is the source maps's source filename, that's a name that will show up in the browser debugger for the generated source (if source-maps is enabled). + * If a non-empty string value is provided, generate a source map. + */ + sourceMap?: string; + /** + * . If sourceMapWithCode is true generator returns output hash, where output.map is a source-map representation, which can be serialized as output.map.toString(). output.code is a string with generated JS code (note that it's not going to have //@ sourceMappingURL comment in it). + */ + sourceMapWithCode?: boolean; + /** + * Optionally option.sourceContent string can be passed (which represents original source of the file, for example it could be a source of coffeescript from which JS is being generated), if provided generated source map will have original source embedded in it. + */ + sourceContent?: string; + sourceCode?: string; + /** + * Optionally option.sourceMapRoot can be provided, in which case option.sourceMap will be treated as relative to it. For more information about source map itself, see source map library document, V3 draft and HTML5Rocks introduction. Default is undefined + * sourceMapRoot is the source root for the source map (see the Mozilla documentation). If sourceMapWithCode is truthy, an object is returned from generate() of the form: { code: .. , map: .. }. If file is provided, it will be used as file property of generated source map. + */ + sourceMapRoot?: string; + /** + * Recognize DirectiveStatement and distinguish it from ExpressionStatement. Default: false + */ + directive?: boolean; + /** + * If file is provided, it will be used as file property of generated source map. + */ + file?: string; + /** + * Providing verbatim code generation option to Expression nodes. + * verbatim option is provided by user as string. When generating Expression code, + * looking up node[option.verbatim] value and dump it instead of normal code generation. + * + * @example + * + */ + verbatim?: string; + } + + /** + * https://github.com/estools/escodegen/commit/adf113333cd4888cf59bfc4f957df98bf7db82b6 + */ + export enum Precedence { + Sequence, + Yield, + Await, + Assignment, + Conditional, + ArrowFunction, + LogicalOR, + LogicalAND, + BitwiseOR, + BitwiseXOR, + BitwiseAND, + Equality, + Relational, + BitwiseSHIFT, + Additive, + Multiplicative, + Unary, + Postfix, + Call, + New, + TaggedTemplate, + Member, + Primary + } + + /** + * Produces given Abstract Syntax Tree as javascript code + * @param ast The Abstract Syntax Tree to generate code from + * @param options The generation options + */ + export function generate(ast: any, options?: GenerateOptions): string; + /** + * Attaching the comments is needed to keep the comments and to allow blank lines to be preserved. + */ + export function attachComments(ast: any, comments: any, tokens: any): any; +} diff --git a/estraverse/estraverse-tests.ts b/estraverse/estraverse-tests.ts new file mode 100644 index 0000000000..0650aa99e2 --- /dev/null +++ b/estraverse/estraverse-tests.ts @@ -0,0 +1,59 @@ +/// + +import * as estraverse from 'estraverse'; + +let ast: any = { + "type": "Program", + "body": [ + { + "type": "VariableDeclaration", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "answer" + }, + "init": { + "type": "BinaryExpression", + "operator": "*", + "left": { + "type": "Literal", + "value": 6, + "raw": "6" + }, + "right": { + "type": "Literal", + "value": 7, + "raw": "7" + } + } + } + ], + "kind": "var" + } + ], + "sourceType": "script" +}; + +estraverse.traverse(ast, { + enter: (node: any, parentNode: any) => { + if (node.type === 'Identifier') { + return estraverse.VisitorOption.Skip; + } + }, + leave: (node: any, parentNode: any) => {}, + fallback: 'iteration', + keys: { + TestExpression: ['argument'] + } +}); + +estraverse.replace(ast, { + enter: (node: any, parentNode: any) => { + return node; + }, + leave: (node: any, parentNode: any) => { + return node; + } +}); \ No newline at end of file diff --git a/estraverse/estraverse.d.ts b/estraverse/estraverse.d.ts new file mode 100644 index 0000000000..69b4d5d311 --- /dev/null +++ b/estraverse/estraverse.d.ts @@ -0,0 +1,22 @@ +// Type definitions for estraverse +// Project: https://github.com/estools/estraverse +// Definitions by: Sanex3339 +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare module 'estraverse' { + export interface Visitor { + enter?: (node: any, parentNode: any) => any; + leave?: (node: any, parentNode: any) => any; + + fallback?: string; + + keys?: {}; + } + + export enum VisitorOption { + Skip, Break, Remove + } + + export function traverse (ast: any, visitor: Visitor): any; + export function replace (ast: any, visitor: Visitor): any; +} \ No newline at end of file diff --git a/express-domain-middleware/express-domain-middleware-tests.ts b/express-domain-middleware/express-domain-middleware-tests.ts new file mode 100644 index 0000000000..446b732353 --- /dev/null +++ b/express-domain-middleware/express-domain-middleware-tests.ts @@ -0,0 +1,2 @@ +/// +import fn = require('express-domain-middleware'); diff --git a/express-domain-middleware/express-domain-middleware.d.ts b/express-domain-middleware/express-domain-middleware.d.ts new file mode 100644 index 0000000000..1710d548e0 --- /dev/null +++ b/express-domain-middleware/express-domain-middleware.d.ts @@ -0,0 +1,12 @@ +// Type definitions for express-domain-middleware +// Project: https://www.npmjs.com/package/express-domain-middleware +// Definitions by: Hookclaw +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare module "express-domain-middleware" { + import express = require('express'); + function e(req: express.Request, res: express.Response, next: express.NextFunction): any; + export = e; +} 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..3d0249b208 --- /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, config?: any); + } +} + +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/fixed-data-table/fixed-data-table.d.ts b/fixed-data-table/fixed-data-table.d.ts index e4bc79ff51..dcc188e5ba 100644 --- a/fixed-data-table/fixed-data-table.d.ts +++ b/fixed-data-table/fixed-data-table.d.ts @@ -398,7 +398,7 @@ declare namespace FixedDataTable { /** * Component that defines the attributes of a table column group. */ - export interface ColumnGroupProps { + export interface ColumnGroupProps extends __React.Props { /** * The horizontal alignment of the table cell content. * 'left', 'center', 'right' 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/freedom/freedom.d.ts b/freedom/freedom.d.ts index f1c7fca485..cc425dc733 100644 --- a/freedom/freedom.d.ts +++ b/freedom/freedom.d.ts @@ -1,4 +1,4 @@ -// Type definitions for freedom v0.6.26 +// Type definitions for freedom v0.6.29 // Project: https://github.com/freedomjs/freedom // Definitions by: Jonathan Pevarnek // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -423,6 +423,7 @@ declare namespace freedom.PgpProvider { clear(): Promise; exportKey(): Promise; getFingerprint(publicKey: string): Promise; + ecdhBob(curve: string, pubKey: string): Promise; signEncrypt(data: ArrayBuffer, encryptKey?: string, sign?: boolean): Promise; verifyDecrypt(data: ArrayBuffer, 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/generic-functions/generic-functions.d.ts b/generic-functions/generic-functions.d.ts new file mode 100644 index 0000000000..d25ebde7cc --- /dev/null +++ b/generic-functions/generic-functions.d.ts @@ -0,0 +1,15 @@ +// Type definitions for generic-functions +// Project: https://github.com/stpettersens/generic-functions +// Definitions by: Sam Saint-Pettersen +// Definitions: https://github.com/definitelytyped/DefinitelyTyped + +declare module "generic-functions" { + function strcmp(str1: string, str2: string): boolean; + function icstrcmp(str1: string, str2: string): boolean; + function strendswith(str: string, suffix: string): boolean; + function icstrendswith(str: string, suffix: string): boolean; + function endswithdot(str: string): string; + function println(message: string): void; + function printlns(message: string[]): void; + function objGetKeyByValue(object: Object, value: any): string; +} diff --git a/generic-functions/genetic-functions-tests.ts b/generic-functions/genetic-functions-tests.ts new file mode 100644 index 0000000000..d3dc53665a --- /dev/null +++ b/generic-functions/genetic-functions-tests.ts @@ -0,0 +1,16 @@ +/// + +import g = require('generic-functions'); + +var tvShow: Object = { + seasons: 2, + show: "Better Call Saul" +}; + +console.log(g.strcmp("foo", "foo")); // => true +console.log(g.icstrcmp("BAR", "bar")); // => true +console.log(g.strendswith("file.pdf", "pdf")); // => true +console.log(g.icstrendswith("file.PDF", "pdf")); // => true +console.log(g.endswithdot("file.pdf")); // => ".pdf" +console.log(g.objGetKeyByValue(tvShow, 2)); // => "seasons" +console.log(g.objGetKeyByValue(tvShow, "Better Call Saul")); // => "show" diff --git a/geojson/geojson.d.ts b/geojson/geojson.d.ts index d77de1fe86..4b4c2b56cf 100644 --- a/geojson/geojson.d.ts +++ b/geojson/geojson.d.ts @@ -36,6 +36,7 @@ declare namespace GeoJSON { */ export interface Point extends GeometryObject { + type: 'Point' coordinates: Position } @@ -44,6 +45,7 @@ declare namespace GeoJSON { */ export interface MultiPoint extends GeometryObject { + type: 'MultiPoint' coordinates: Position[] } @@ -52,6 +54,7 @@ declare namespace GeoJSON { */ export interface LineString extends GeometryObject { + type: 'LineString' coordinates: Position[] } @@ -60,6 +63,7 @@ declare namespace GeoJSON { */ export interface MultiLineString extends GeometryObject { + type: 'MultiLineString' coordinates: Position[][] } @@ -68,6 +72,7 @@ declare namespace GeoJSON { */ export interface Polygon extends GeometryObject { + type: 'Polygon' coordinates: Position[][] } @@ -76,6 +81,7 @@ declare namespace GeoJSON { */ export interface MultiPolygon extends GeometryObject { + type: 'MultiPolygon' coordinates: Position[][][] } @@ -84,6 +90,7 @@ declare namespace GeoJSON { */ export interface GeometryCollection extends GeoJsonObject { + type: 'GeometryCollection' geometries: GeometryObject[]; } @@ -92,6 +99,7 @@ declare namespace GeoJSON { */ export interface Feature extends GeoJsonObject { + type: 'Feature' geometry: T; properties: any; id?: string; @@ -102,6 +110,7 @@ declare namespace GeoJSON { */ export interface FeatureCollection extends GeoJsonObject { + type: 'FeatureCollection' features: Feature[]; } diff --git a/github-electron/github-electron-main-tests.ts b/github-electron/github-electron-main-tests.ts index b8b95c5c99..00798c382b 100644 --- a/github-electron/github-electron-main-tests.ts +++ b/github-electron/github-electron-main-tests.ts @@ -19,6 +19,7 @@ import { screen, shell, session, + systemPreferences, hideInternalModules } from 'electron'; @@ -44,7 +45,6 @@ var shouldQuit = app.makeSingleInstance(function(commandLine, workingDirectory) if (mainWindow.isMinimized()) mainWindow.restore(); mainWindow.focus(); } - return true; }); if (shouldQuit) { @@ -65,7 +65,7 @@ app.on('ready', () => { mainWindow.webContents.openDevTools(); mainWindow.webContents.toggleDevTools(); - mainWindow.webContents.openDevTools({detach: true}); + mainWindow.webContents.openDevTools({mode: 'detach'}); mainWindow.webContents.closeDevTools(); mainWindow.webContents.addWorkSpace('/path/to/workspace'); mainWindow.webContents.removeWorkSpace('/path/to/workspace'); @@ -260,8 +260,8 @@ app.commandLine.appendSwitch('host-rules', 'MAP * 127.0.0.1'); app.commandLine.appendSwitch('v', -1); app.commandLine.appendSwitch('vmodule', 'console=0'); -// app -// https://github.com/atom/electron/blob/master/docs/api/app.md +// systemPreferences +// https://github.com/electron/electron/blob/master/docs/api/system-preferences.md var browserOptions = { width: 1000, @@ -271,7 +271,7 @@ var browserOptions = { }; // Make the window transparent only if the platform supports it. -if (process.platform !== 'win32' || app.isAeroGlassEnabled()) { +if (process.platform !== 'win32' || systemPreferences.isAeroGlassEnabled()) { browserOptions.transparent = true; browserOptions.frame = false; } @@ -288,9 +288,12 @@ if (browserOptions.transparent) { } app.on('platform-theme-changed', () => { - console.log(app.isDarkMode()); + console.log(systemPreferences.isDarkMode()); }); +// app +// https://github.com/atom/electron/blob/master/docs/api/app.md + app.on('certificate-error', function(event, webContents, url, error, certificate, callback) { if (url == "https://github.com") { // Verification logic. @@ -337,14 +340,21 @@ win.on('closed', () => { win.loadURL('https://github.com'); win.show(); +var toolbarRect = document.getElementById('toolbar').getBoundingClientRect(); +win.setSheetOffset(toolbarRect.height); + // 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 +418,7 @@ var menuItem = new MenuItem({}); menuItem.label = 'Hello World!'; menuItem.click = (menuItem, browserWindow) => { - console.log('click', menuItem, browserWindow); + console.log('click', menuItem, browserWindow); }; // menu @@ -513,12 +523,20 @@ var template = [ { label: 'Reload', accelerator: 'Command+R', - click: () => { BrowserWindow.getFocusedWindow().webContents.reloadIgnoringCache(); } + click: (item, focusedWindow) => { + if (focusedWindow) { + focusedWindow.webContents.reloadIgnoringCache(); + } + } }, { label: 'Toggle DevTools', accelerator: 'Alt+Command+I', - click: () => { BrowserWindow.getFocusedWindow().webContents.toggleDevTools(); } + click: (item, focusedWindow) => { + if (focusedWindow) { + focusedWindow.webContents.toggleDevTools(); + } + } } ] }, @@ -644,7 +662,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); @@ -699,6 +717,18 @@ var image = clipboard.readImage(); var appIcon3 = new Tray(image); var appIcon4 = new Tray('/Users/somebody/images/icon.png'); +// process +// https://github.com/electron/electron/blob/master/docs/api/process.md + +console.log(process.type); +console.log(process.resourcesPath); +console.log(process.mas); +console.log(process.windowsStore); +process.noAsar = true; +process.crash(); +process.hang(); +process.setFdLimit(8192); + // screen // https://github.com/atom/electron/blob/master/docs/api/screen.md @@ -745,7 +775,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 +805,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 +845,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/github-electron/github-electron-renderer-tests.ts b/github-electron/github-electron-renderer-tests.ts index 37faae9dbb..42d034c5c7 100644 --- a/github-electron/github-electron-renderer-tests.ts +++ b/github-electron/github-electron-renderer-tests.ts @@ -171,6 +171,16 @@ var image = clipboard.readImage(); var appIcon3 = new Tray(image); var appIcon4 = new Tray('/Users/somebody/images/icon.png'); +// https://github.com/electron/electron/blob/master/docs/api/process.md + +// preload.js +var _setImmediate = setImmediate; +var _clearImmediate = clearImmediate; +process.once('loaded', function() { + global.setImmediate = _setImmediate; + global.clearImmediate = _clearImmediate; +}); + // screen // https://github.com/atom/electron/blob/master/docs/api/screen.md diff --git a/github-electron/github-electron.d.ts b/github-electron/github-electron.d.ts index 9ae82d6988..235e7d55fb 100644 --- a/github-electron/github-electron.d.ts +++ b/github-electron/github-electron.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Electron v0.37.4 +// Type definitions for Electron v1.0.2 // 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. @@ -96,6 +96,11 @@ declare namespace Electron { * Note: This is only implemented on OS X. */ on(event: 'activate', listener: Function): this; + /** + * Emitted during Handoff when an activity from a different device wants to be resumed. + * You should call event.preventDefault() if you want to handle this event. + */ + on(event: 'continue-activity', listener: (event: Event, type: string, userInfo: Object) => void): this; /** * Emitted when a browserWindow gets blurred. */ @@ -149,11 +154,6 @@ declare namespace Electron { * Emitted when the gpu process crashes. */ on(event: 'gpu-process-crashed', listener: Function): this; - /** - * Emitted when the system’s Dark Mode theme is toggled. - * Note: This is only implemented on OS X. - */ - on(event: 'platform-theme-changed', listener: Function): this; on(event: string, listener: Function): this; /** * Try to close all windows. The before-quit event will first be emitted. @@ -256,10 +256,15 @@ declare namespace Electron { /** * Removes the current executable as the default handler for a protocol (aka URI scheme). * - * Note: This API is only available on Windows. - * On OS X, removing the app will automatically remove the app as the default protocol handler. + * Note: This is only implemented on OS X and Windows. */ removeAsDefaultProtocolClient(protocol: string): void; + /** + * @returns Whether the current executable is the default handler for a protocol (aka URI scheme). + * + * Note: This is only implemented on OS X and Windows. + */ + isDefaultProtocolClient(protocol: string): boolean; /** * Adds tasks to the Tasks category of JumpList on Windows. * @@ -279,24 +284,35 @@ declare namespace Electron { * multiple instances of your app to run, this will ensure that only a single instance * of your app is running, and other instances signal this instance and exit. */ - makeSingleInstance(callback: (args: string[], workingDirectory: string) => boolean): boolean; + makeSingleInstance(callback: (args: string[], workingDirectory: string) => void): boolean; + /** + * Creates an NSUserActivity and sets it as the current activity. + * The activity is eligible for Handoff to another device afterward. + * + * @param type Uniquely identifies the activity. Maps to NSUserActivity.activityType. + * @param userInfo App-specific state to store for use by another device. + * + * Note: This API is only available on Mac. + */ + setUserActivity(type: string, userInfo: Object): void; + /** + * @returns The type of the currently running activity. + * + * Note: This API is only available on Mac. + */ + getCurrentActivityType(): string; /** * Changes the Application User Model ID to id. */ setAppUserModelId(id: string): void; /** - * This method returns true if DWM composition (Aero Glass) is enabled, - * and false otherwise. You can use it to determine if you should create - * a transparent window or not (transparent windows won’t work correctly when DWM composition is disabled). + * Imports the certificate in pkcs12 format into the platform certificate store. + * @param callback Called with the result of import operation, a value of 0 indicates success + * while any other value indicates failure according to chromium net_error_list. * - * Note: This is only implemented on Windows. + * Note: This API is only available on Linux. */ - isAeroGlassEnabled(): boolean; - /** - * @returns If the system is in Dark Mode. - * Note: This is only implemented on OS X. - */ - isDarkMode(): boolean; + importCertificate(options: ImportCertificateOptions, callback: (result: number) => void): void; commandLine: CommandLine; /** * Note: This API is only available on Mac. @@ -306,6 +322,17 @@ declare namespace Electron { type AppPathName = 'home'|'appData'|'userData'|'temp'|'exe'|'module'|'desktop'|'documents'|'downloads'|'music'|'pictures'|'videos'; + interface ImportCertificateOptions { + /** + * Path for the pkcs12 file. + */ + certificate: string; + /** + * Passphrase for the certificate. + */ + password: string; + } + interface CommandLine { /** * Append a switch [with optional value] to Chromium's command line. @@ -319,7 +346,7 @@ declare namespace Electron { * * Note: This will not affect process.argv. */ - appendArgument(value: any): void; + appendArgument(value: string): void; } interface Dock { @@ -341,6 +368,12 @@ declare namespace Electron { * Note: This API is only available on Mac. */ cancelBounce(id: number): void; + /** + * Bounces the Downloads stack if the filePath is inside the Downloads folder. + * + * Note: This API is only available on Mac. + */ + downloadFinished(filePath: string): void; /** * Sets the string to be displayed in the dock’s badging area. * @@ -411,7 +444,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 +481,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 +489,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. @@ -814,6 +847,11 @@ declare namespace Electron { * @returns The title of the native window. */ getTitle(): string; + /** + * Changes the attachment point for sheets on Mac OS X. + * Note: This API is available only on OS X. + */ + setSheetOffset(offset: number): void; /** * Starts or stops flashing the window to attract user's attention. */ @@ -1091,6 +1129,11 @@ declare namespace Electron { * Default: true. */ directWrite?: boolean; + /** + * Enables scroll bounce (rubber banding) effect on OS X. + * Default: false. + */ + scrollBounce?: boolean; /** * A list of feature strings separated by ",". */ @@ -1132,6 +1175,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 { @@ -1222,7 +1270,7 @@ declare namespace Electron { alwaysOnTop?: boolean; /** * Whether the window should show in fullscreen. - * When explicity set to false the fullscreen button will be hidden or disabled on OS X. + * When explicitly set to false the fullscreen button will be hidden or disabled on OS X. * Default: false. */ fullscreen?: boolean; @@ -1282,7 +1330,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 +1375,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 +1431,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 +1445,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 +1455,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 +1497,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 +1512,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 +1560,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 +1622,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 +1655,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 +1697,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. * @@ -1716,7 +1753,7 @@ declare namespace Electron { */ type?: 'none' | 'info' | 'error' | 'question' | 'warning'; /** - * Texts for buttons. + * Texts for buttons. On Windows, an empty array will result in one button labeled "OK". */ buttons?: string[]; /** @@ -1752,7 +1789,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 +1857,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 +1891,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 +1920,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 +1963,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 +2024,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: @@ -2013,6 +2054,7 @@ declare namespace Electron { * Punctuations like ~, !, @, #, $, etc. * Plus * Space + * Tab * Backspace * Delete * Insert @@ -2031,8 +2073,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 +2106,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 +2161,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 +2209,7 @@ declare namespace Electron { /** * @returns {} The size of the image. */ - getSize(): any; + getSize(): Dimension; /** * Marks the image as template image. */ @@ -2169,7 +2220,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 +2246,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 +2271,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. @@ -2237,19 +2288,19 @@ declare namespace Electron { /** * Registers a protocol of scheme that will send the file as a response. */ - registerFileProtocol(scheme: string, handler: (request: ProtocolRequest, callback: FileProtocolCallback) => void, completion?: (error: Error) => void): void; + registerFileProtocol(scheme: string, handler: FileProtocolHandler, completion?: (error: Error) => void): void; /** * Registers a protocol of scheme that will send a Buffer as a response. */ - registerBufferProtocol(scheme: string, handler: (request: ProtocolRequest, callback: BufferProtocolCallback) => void, completion?: (error: Error) => void): void; + registerBufferProtocol(scheme: string, handler: BufferProtocolHandler, completion?: (error: Error) => void): void; /** * Registers a protocol of scheme that will send a String as a response. */ - registerStringProtocol(scheme: string, handler: (request: ProtocolRequest, callback: StringProtocolCallback) => void, completion?: (error: Error) => void): void; + registerStringProtocol(scheme: string, handler: StringProtocolHandler, completion?: (error: Error) => void): void; /** * Registers a protocol of scheme that will send an HTTP request as a response. */ - registerHttpProtocol(scheme: string, handler: (request: ProtocolRequest, callback: HttpProtocolCallback) => void, completion?: (error: Error) => void): void; + registerHttpProtocol(scheme: string, handler: HttpProtocolHandler, completion?: (error: Error) => void): void; /** * Unregisters the custom protocol of scheme. */ @@ -2261,25 +2312,30 @@ declare namespace Electron { /** * Intercepts scheme protocol and uses handler as the protocol’s new handler which sends a file as a response. */ - interceptFileProtocol(scheme: string, handler: (request: ProtocolRequest, callback: FileProtocolCallback) => void, completion?: (error: Error) => void): void; - /** - * Intercepts scheme protocol and uses handler as the protocol’s new handler which sends a String as a response. - */ - interceptStringProtocol(scheme: string, handler: (request: ProtocolRequest, callback: BufferProtocolCallback) => void, completion?: (error: Error) => void): void; + interceptFileProtocol(scheme: string, handler: FileProtocolHandler, completion?: (error: Error) => void): void; /** * Intercepts scheme protocol and uses handler as the protocol’s new handler which sends a Buffer as a response. */ - interceptBufferProtocol(scheme: string, handler: (request: ProtocolRequest, callback: StringProtocolCallback) => void, completion?: (error: Error) => void): void; + interceptBufferProtocol(scheme: string, handler: BufferProtocolHandler, completion?: (error: Error) => void): void; + /** + * Intercepts scheme protocol and uses handler as the protocol’s new handler which sends a String as a response. + */ + interceptStringProtocol(scheme: string, handler: StringProtocolHandler, completion?: (error: Error) => void): void; /** * Intercepts scheme protocol and uses handler as the protocol’s new handler which sends a new HTTP request as a response. */ - interceptHttpProtocol(scheme: string, handler: (request: ProtocolRequest, callback: HttpProtocolCallback) => void, completion?: (error: Error) => void): void; + interceptHttpProtocol(scheme: string, handler: HttpProtocolHandler, completion?: (error: Error) => void): void; /** * Remove the interceptor installed for scheme and restore its original handler. */ uninterceptProtocol(scheme: string, completion?: (error: Error) => void): void; } + type FileProtocolHandler = (request: ProtocolRequest, callback: FileProtocolCallback) => void; + type BufferProtocolHandler = (request: ProtocolRequest, callback: BufferProtocolCallback) => void; + type StringProtocolHandler = (request: ProtocolRequest, callback: StringProtocolCallback) => void; + type HttpProtocolHandler = (request: ProtocolRequest, callback: HttpProtocolCallback) => void; + interface ProtocolRequest { url: string; referrer: string; @@ -2335,7 +2391,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 +2421,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. @@ -2385,7 +2441,7 @@ declare namespace Electron { */ scaleFactor: number; /** - * Can be 0, 1, 2, 3, each represents screen rotation in clock-wise degrees of 0, 90, 180, 270. + * Can be 0, 90, 180, 270, represents screen rotation in clock-wise degrees. */ rotation: number; touchSupport: 'available' | 'unavailable' | 'unknown'; @@ -2412,7 +2468,7 @@ declare namespace Electron { /** * The screen module retrieves information about screen size, displays, cursor position, etc. - * You should not use this module until the ready event of the app module is emitted. + * You can not use this module until the ready event of the app module is emitted. */ interface Screen extends NodeJS.EventEmitter { /** @@ -2450,7 +2506,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 +2560,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 +2576,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 +2593,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' | 'openExternal'; + interface ClearStorageDataOptions { /** * Should follow window.location.origin’s representation scheme://host:port. @@ -2567,10 +2632,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 +2756,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 +2975,48 @@ 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/system-preferences.md + + /** + * Get system preferences. + */ + interface SystemPreferences { + /** + * @returns If the system is in Dark Mode. + * + * Note: This is only implemented on OS X. + */ + isDarkMode(): boolean; + /** + * Subscribes to native notifications of OS X, callback will be called when the corresponding event happens. + * The id of the subscriber is returned, which can be used to unsubscribe the event. + * + * Note: This is only implemented on OS X. + */ + subscribeNotification(event: string, callback: Function): number; + /** + * Removes the subscriber with id. + * + * Note: This is only implemented on OS X. + */ + unsubscribeNotification(id: number): void; + /** + * Get the value of key in system preferences. + * + * Note: This is only implemented on OS X. + */ + getUserDefault(key: string, type: 'string' | 'boolean' | 'integer' | 'float' | 'double' | 'url'): any; + /** + * This method returns true if DWM composition (Aero Glass) is enabled, + * and false otherwise. You can use it to determine if you should create + * a transparent window or not (transparent windows won’t work correctly when DWM composition is disabled). + * + * Note: This is only implemented on Windows. + */ + isAeroGlassEnabled(): boolean; + } + + // 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 +3137,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 +3152,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 +3176,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 +3189,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. @@ -3031,6 +3316,10 @@ declare namespace Electron { * in a NativeImage, and the scale will hold scaling information for the image. */ on(event: 'cursor-changed', listener: (event: Event, type: CursorType, image?: NativeImage, scale?: number) => void): this; + /** + * Emitted when there is a new context menu that needs to be handled. + */ + on(event: 'context-menu', listener: (event: Event, params: ContextMenuParams) => void): this; on(event: string, listener: Function): this; /** * Loads the url in the window. @@ -3058,6 +3347,10 @@ declare namespace Electron { * @returns Whether web page is still loading resources. */ isLoading(): boolean; + /** + * @returns Whether the main frame (and not just iframes or frames within it) is still loading. + */ + isLoadingMainFrame(): boolean; /** * @returns Whether web page is waiting for a first-response for the main * resource of the page. @@ -3225,9 +3518,9 @@ declare namespace Electron { */ openDevTools(options?: { /** - * Opens devtools in a new window. + * Opens the devtools with specified dock state. Defaults to last used dock state. */ - detach?: boolean; + mode?: 'right' | 'bottom' | 'undocked' | 'detach' }): void; /** * Closes the developer tools. @@ -3317,6 +3610,148 @@ declare namespace Electron { debugger: Debugger; } + interface ContextMenuParams { + /** + * x coodinate + */ + x: number; + /** + * y coodinate + */ + y: number; + /** + * URL of the link that encloses the node the context menu was invoked on. + */ + linkURL: string; + /** + * Text associated with the link. May be an empty string if the contents of the link are an image. + */ + linkText: string; + /** + * URL of the top level page that the context menu was invoked on. + */ + pageURL: string; + /** + * URL of the subframe that the context menu was invoked on. + */ + frameURL: string; + /** + * Source URL for the element that the context menu was invoked on. + * Elements with source URLs are images, audio and video. + */ + srcURL: string; + /** + * Type of the node the context menu was invoked on. + */ + mediaType: 'none' | 'image' | 'audio' | 'video' | 'canvas' | 'file' | 'plugin'; + /** + * Parameters for the media element the context menu was invoked on. + */ + mediaFlags: { + /** + * Wether the media element has crashed. + */ + inError: boolean; + /** + * Wether the media element is paused. + */ + isPaused: boolean; + /** + * Wether the media element is muted. + */ + isMuted: boolean; + /** + * Wether the media element has audio. + */ + hasAudio: boolean; + /** + * Wether the media element is looping. + */ + isLooping: boolean; + /** + * Wether the media element's controls are visible. + */ + isControlsVisible: boolean; + /** + * Wether the media element's controls are toggleable. + */ + canToggleControls: boolean; + /** + * Wether the media element can be rotated. + */ + canRotate: boolean; + } + /** + * Wether the context menu was invoked on an image which has non-empty contents. + */ + hasImageContents: boolean; + /** + * Wether the context is editable. + */ + isEditable: boolean; + /** + * These flags indicate wether the renderer believes it is able to perform the corresponding action. + */ + editFlags: { + /** + * Wether the renderer believes it can undo. + */ + canUndo: boolean; + /** + * Wether the renderer believes it can redo. + */ + canRedo: boolean; + /** + * Wether the renderer believes it can cut. + */ + canCut: boolean; + /** + * Wether the renderer believes it can copy + */ + canCopy: boolean; + /** + * Wether the renderer believes it can paste. + */ + canPaste: boolean; + /** + * Wether the renderer believes it can delete. + */ + canDelete: boolean; + /** + * Wether the renderer believes it can select all. + */ + canSelectAll: boolean; + } + /** + * Text of the selection that the context menu was invoked on. + */ + selectionText: string; + /** + * Title or alt text of the selection that the context was invoked on. + */ + titleText: string; + /** + * The misspelled word under the cursor, if any. + */ + misspelledWord: string; + /** + * The character encoding of the frame on which the menu was invoked. + */ + frameCharset: string; + /** + * If the context menu was invoked on an input field, the type of that field. + */ + inputFieldType: 'none' | 'plainText' | 'password' | 'other'; + /** + * Input source that invoked the context menu. + */ + menuSourceType: 'none' | 'mouse' | 'keyboard' | 'touch' | 'touchMenu'; + } + + interface Headers { + [key: string]: string; + } + type NewWindowDisposition = 'default' | 'foreground-tab' | 'background-tab' | 'new-window' | 'other'; /** @@ -3452,7 +3887,7 @@ declare namespace Electron { /** * Coordinates of first match region. */ - selectionArea?: any; + selectionArea?: Bounds; } interface DeviceEmulationParameters { @@ -3564,7 +3999,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 +4065,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 +4369,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. */ @@ -4035,7 +4470,7 @@ declare namespace Electron { * Emitted when a page's theme color changes. This is usually due to encountering a meta tag: * */ - addEventListener(type: 'did-change-theme-color', listener: (event: WebViewElement.Event) => void, useCapture?: boolean): void; + addEventListener(type: 'did-change-theme-color', listener: (event: WebViewElement.DidChangeThemeColorEvent) => void, useCapture?: boolean): void; /** * Emitted when DevTools is opened. */ @@ -4056,27 +4491,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 +4523,7 @@ declare namespace Electron { httpResponseCode: number; requestMethod: string; referrer: string; - headers: any; + headers: Headers; } interface PageTitleUpdatedEvent extends Event { @@ -4129,6 +4566,10 @@ declare namespace Electron { name: string; version: string; } + + interface DidChangeThemeColorEvent extends Event { + themeColor: string; + } } /** @@ -4163,7 +4604,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; @@ -4185,6 +4626,7 @@ declare namespace Electron { protocol: Electron.Protocol; screen: Electron.Screen; session: typeof Electron.Session; + systemPreferences: Electron.SystemPreferences; Tray: Electron.Tray; hideInternalModules(): void; } @@ -4205,7 +4647,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 +4656,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 { /** @@ -4223,6 +4665,59 @@ interface File { path: string; } +// https://github.com/electron/electron/blob/master/docs/api/process.md + +declare namespace NodeJS { + interface Process { + /** + * Process's type + */ + type: 'browser' | 'renderer'; + /** + * Path to JavaScript source code. + */ + resourcesPath: string; + /** + * For Mac App Store build, this value is true, for other builds it is undefined. + */ + mas?: boolean; + /** + * If the app is running as a Windows Store app (appx), this value is true, for other builds it is undefined. + */ + windowsStore?: boolean; + /** + * When app is started by being passed as parameter to the default app, + * this value is true in the main process, otherwise it is undefined. + */ + defaultApp?: boolean; + /** + * Emitted when Electron has loaded its internal initialization script + * and is beginning to load the web page or the main script. + */ + on(event: 'loaded', listener: Function): this; + on(event: string, listener: Function): this; + /** + * Setting this to true can disable the support for asar archives in Node's built-in modules. + */ + noAsar?: boolean; + /** + * Causes the main thread of the current process crash; + */ + crash(): void; + /** + * Causes the main thread of the current process hang. + */ + hang(): void; + /** + * Sets the file descriptor soft limit to maxDescriptors or the OS hard limit, + * whichever is lower for the current process. + * + * Note: This API is only available on Mac and Linux. + */ + setFdLimit(maxDescriptors: number): void; + } +} + declare module 'electron' { var electron: Electron.ElectronMainAndRenderer; export = electron; diff --git a/globalize/globalize-0.1.3-tests.ts b/globalize/globalize-0.1.3-tests.ts new file mode 100644 index 0000000000..4e3e9056ed --- /dev/null +++ b/globalize/globalize-0.1.3-tests.ts @@ -0,0 +1,11 @@ +/// +module Tests { + Globalize.culture('en-US'); + Globalize.addCultureInfo('nb-NO', 'no', { messages: {Test: "Test"} }); + var cult = Globalize.findClosestCulture('nb-NO'); + var numberString = Globalize.format(1.245, 'n2'); + var testString = Globalize.localize('Test'); + var dateParsed = Globalize.parseDate('2016-02-03'); + var intParsed = Globalize.parseInt('123'); + var floatParsed = Globalize.parseFloat('12.3'); +} \ No newline at end of file diff --git a/globalize/globalize-0.1.3.d.ts b/globalize/globalize-0.1.3.d.ts new file mode 100644 index 0000000000..b31a1cc092 --- /dev/null +++ b/globalize/globalize-0.1.3.d.ts @@ -0,0 +1,25 @@ +// Type definitions for Globalize v0.1.3 (NuGet package version) +// Project: https://github.com/jquery/globalize +// Definitions by: Aram Taieb +// Definitions: https://github.com/afromogli/DefinitelyTyped + +interface GlobalizeStatic { + addCultureInfo(cultureName: string, baseCultureName: string, info: any): void; + findClosestCulture(name: string): any; + format(value: any, format: string): string; + format(value: any, format: string, cultureSelector: string): string; + localize(key: string): string; + localize(key: string, cultureSelector: string): string; + parseDate(value: any): Date; + parseDate(value: any, formats: any): Date; + parseDate(value: any, formats: any, culture: string): Date; + parseInt(value: any): number; + parseInt(value: any, radix: number): number; + parseInt(value: any, radix: number, cultureSelector: string): number; + parseFloat(value: any): number; + parseFloat(value: any, radix: number): number; + parseFloat(value: any, radix: number, cultureSelector: string): number; + culture(cultureSelector: string): any; +} + +declare var Globalize: GlobalizeStatic; 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..b558ee9516 --- /dev/null +++ b/google-closure-compiler/google-closure-compiler-tests.ts @@ -0,0 +1,37 @@ +/// + +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";', + }, +]; + +// Test the various options formats -- see +// https://github.com/ChadKillingsworth/closure-compiler-npm#specifying-options +let optionsFormats: GoogleClosureCompiler.CompileOptions = { + js: ['/file-one.js', '/file-two.js'], + compilation_level: 'ADVANCED', + js_output_file: 'out.js', + debug: true +}; 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..acfcc7cccb --- /dev/null +++ b/google-closure-compiler/google-closure-compiler.d.ts @@ -0,0 +1,43 @@ +// Type definitions for google-closure-compiler +// Project: https://github.com/chadkillingsworth/closure-compiler-npm +// Definitions by: Evan Martin +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +// Note: the types seen in the JSDoc are wrong: +// https://github.com/ChadKillingsworth/closure-compiler-npm/issues/21 +// Be careful to read the code when choosing types. + +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 CompileOption = string | boolean; + type CompileOptions = string[] | {[key: string]: (CompileOption|CompileOption[])}; + 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/gridstack/gridstack-tests.ts b/gridstack/gridstack-tests.ts index f084e4f46c..3414230a4a 100644 --- a/gridstack/gridstack-tests.ts +++ b/gridstack/gridstack-tests.ts @@ -12,9 +12,9 @@ var options = { }; var gridstack:GridStack = $(document).gridstack(options); -gridstack.add_widget("test", 1, 2, 3, 4, true); -gridstack.batch_update(); -gridstack.cell_height();; -gridstack.cell_height(2); -gridstack.cell_width(); -gridstack.get_cell_from_pixel({ left:20, top: 20 }); +gridstack.addWidget("test", 1, 2, 3, 4, true); +gridstack.batchUpdate(); +gridstack.cellHeight();; +gridstack.cellHeight(2); +gridstack.cellWidth(); +gridstack.getCellFromPixel({ left:20, top: 20 }); diff --git a/gridstack/gridstack.d.ts b/gridstack/gridstack.d.ts index c69770a1b6..399f25e04b 100644 --- a/gridstack/gridstack.d.ts +++ b/gridstack/gridstack.d.ts @@ -11,35 +11,35 @@ interface GridStack { /** * Creates new widget and returns it. * - * Widget will be always placed even if result height is more than actual grid height. You need to use will_it_fit method before calling add_widget for additional check. + * Widget will be always placed even if result height is more than actual grid height. You need to use willItFit method before calling addWidget for additional check. * * @param {string} el widget to add * @param {number} x widget position x * @param {number} y widget position y * @param {number} width widget dimension width * @param {number} height widget dimension height - * @param {boolean} auto_position if true then x, y parameters will be ignored and widget will be places on the first available position + * @param {boolean} autoPosition if true then x, y parameters will be ignored and widget will be places on the first available position */ - add_widget(el: string, x: number, y: number, width: number, height: number, auto_position: boolean): JQuery + addWidget(el: string, x: number, y: number, width: number, height: number, autoPosition: boolean): JQuery /** * Initializes batch updates. You will see no changes until commit method is called. */ - batch_update():void + batchUpdate():void /** * Gets current cell height. */ - cell_height():number + cellHeight():number /** * Update current cell height. This method rebuilds an internal CSS style sheet. Note: You can expect performance issues if call this method too often. * @param {number} val the cell height */ - cell_height(val:number):void + cellHeight(val:number):void /** * Gets current cell width. */ - cell_width():number + cellWidth():number /** - * Finishes batch updates. Updates DOM nodes. You must call it after batch_update. + * Finishes batch updates. Updates DOM nodes. You must call it after batchUpdate. */ commit():void /** @@ -58,7 +58,7 @@ interface GridStack { * Get the position of the cell under a pixel on screen. * @param {MousePosition} position the position of the pixel to resolve in absolute coordinates, as an object with top and leftproperties */ - get_cell_from_pixel(position: MousePosition): CellPosition, + getCellFromPixel(position: MousePosition): CellPosition, /* * Checks if specified area is empty. * @param {number} x the position x. @@ -66,7 +66,7 @@ interface GridStack { * @param {number} width the width of to check * @param {number} height the height of to check */ - is_area_empty(x: number, y: number, width: number, height: number): void + isAreaEmpty(x: number, y: number, width: number, height: number): void /* * Locks/unlocks widget. * @param {HTMLElement} el widget to modify. @@ -78,13 +78,13 @@ interface GridStack { * @param {HTMLElement} el widget to modify. * @param {number} val A numeric value of the number of columns */ - min_width(el: HTMLElement, val: number): void + minWidth(el: HTMLElement, val: number): void /* * Set the minHeight for a widget. * @param {HTMLElement} el widget to modify. * @param {number} val A numeric value of the number of rows */ - min_height(el: HTMLElement, val: number): void + minHeight(el: HTMLElement, val: number): void /* * Enables/Disables moving. * @param {HTMLElement} el widget to modify. @@ -102,13 +102,13 @@ interface GridStack { /** * Removes widget from the grid. * @param {HTMLElement} el widget to modify - * @param {boolean} detach_node if false DOM node won't be removed from the tree (Optional. Default true). + * @param {boolean} detachNode if false DOM node won't be removed from the tree (Optional. Default true). */ - remove_widget(el: HTMLElement, detach_node?: boolean): void + removeWidget(el: HTMLElement, detachNode?: boolean): void /** * Removes all widgets from the grid. */ - remove_all(): void + removeAll(): void /** * Changes widget size * @param {HTMLElement} el widget to modify @@ -124,9 +124,9 @@ interface GridStack { resizable(el: HTMLElement, val: boolean): void /** * Toggle the grid static state. Also toggle the grid-stack-static class. - * @param {boolean} static_value if true the grid become static. + * @param {boolean} staticValue if true the grid become static. */ - set_static(static_value: boolean): void + setStatic(staticValue: boolean): void /** * Updates widget position/size. * @param {HTMLElement} el widget to modify @@ -142,9 +142,9 @@ interface GridStack { * @param {number} y new position y. If value is null or undefined it will be ignored. * @param {number} width new dimensions width. If value is null or undefined it will be ignored. * @param {number} height new dimensions height. If value is null or undefined it will be ignored. - * @param {boolean} auto_position if true then x, y parameters will be ignored and widget will be places on the first available position + * @param {boolean} autoPosition if true then x, y parameters will be ignored and widget will be places on the first available position */ - will_it_fit(x: number, y: number, width: number, height: number, auto_position:boolean):boolean + willItFit(x: number, y: number, width: number, height: number, autoPosition:boolean):boolean } @@ -181,7 +181,7 @@ interface IGridstackOptions { /** * if true the resizing handles are shown even if the user is not hovering over the widget (default: false) */ - always_show_resize_handle: boolean; + alwaysShowResizeHandle: boolean; /** * turns animation on (default: true) */ @@ -193,7 +193,7 @@ interface IGridstackOptions { /** * one cell height (default: 60) */ - cell_height: number; + cellHeight: number; /** * allows to override jQuery UI draggable options. (default: { handle: '.grid-stack-item-content', scroll: true, appendTo: 'body' }) */ @@ -213,15 +213,15 @@ interface IGridstackOptions { /** * widget class (default: 'grid-stack-item') */ - item_class: string; + itemClass: string; /** * minimal width.If window width is less, grid will be shown in one - column mode (default: 768) */ - min_width: number; + minWidth: number; /** * class for placeholder (default: 'grid-stack-placeholder') */ - placeholder_class: string; + placeholderClass: string; /** * allows to override jQuery UI resizable options. (default: { autoHide: true, handles: 'se' }) */ @@ -229,11 +229,11 @@ interface IGridstackOptions { /** * makes grid static (default false).If true widgets are not movable/ resizable.You don't even need jQueryUI draggable/resizable. A CSS class grid-stack-static is also added to the container. */ - static_grid: boolean; + staticGrid: boolean; /** * vertical gap size (default: 20) */ - vertical_margin: number; + verticalMargin: number; /** * amount of columns (default: 12) */ 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..318038967a --- /dev/null +++ b/handsontable/handsontable-tests.ts @@ -0,0 +1,286 @@ +/// + +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, + bindRowsWithHeaders: 'foo', + cell: [], + cells: function() {}, + checkedTemplate: true, + className: [], + colHeaders: true, + collapsibleColumns: true, + columnHeaderHeight: 123, + columns: [], + columnSorting: {}, + columnSummary: {}, + 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, + dropdownMenu: [], + editor: true, + enterBeginsEditing: true, + enterMoves: {}, + fillHandle: true, + filter: true, + filteringCaseSensitive: true, + filters: false, + fixedColumnsLeft: 123, + fixedRowsBottom: 123, + fixedRowsTop: 123, + format: 'foo', + fragmentSelection: true, + ganttChart: {}, + headerTooltips: true, + height: 123, + hiddenColumns: true, + hiddenRows: {}, + 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, + nestedHeaders: [], + 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, + sortByRelevance: 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, + + // Hooks + afterAutofillApplyValues: function() {}, + afterCellMetaReset: function() {}, + afterChange: function() {}, + afterChangesObserved: function() {}, + afterColumnMove: function() {}, + afterColumnResize: function() {}, + afterColumnSort: function() {}, + afterContextMenuDefaultOptions: function() {}, + afterContextMenuHide: function() {}, + afterContextMenuShow: function() {}, + afterCopyLimit: function() {}, + afterCreateCol: function() {}, + afterCreateRow: function() {}, + afterDeselect: function() {}, + afterDestroy: function() {}, + afterDocumentKeyDown: function() {}, + afterFilter: function() {}, + afterGetCellMeta: function() {}, + afterGetColHeader: function() {}, + afterGetColumnHeaderRenderers: function() {}, + afterGetRowHeader: function() {}, + afterGetRowHeaderRenderers: function() {}, + afterInit: function() {}, + afterLoadData: function() {}, + afterMomentumScroll: function() {}, + afterOnCellCornerMouseDown: function() {}, + afterOnCellMouseDown: function() {}, + afterOnCellMouseOver: function() {}, + afterRemoveCol: function() {}, + afterRemoveRow: function() {}, + afterRender: function() {}, + afterRenderer: function() {}, + afterRowMove: function() {}, + afterRowResize: function() {}, + afterScrollHorizontally: function() {}, + afterScrollVertically: function() {}, + afterSelection: function() {}, + afterSelectionByProp: function() {}, + afterSelectionEnd: function() {}, + afterSelectionEndByProp: function() {}, + afterSetCellMeta: function() {}, + afterUpdateSettings: function() {}, + afterValidate: function() {}, + beforeAutofill: function() {}, + beforeCellAlignment: function() {}, + beforeChange: function() {}, + beforeChangeRender: function() {}, + beforeColumnMove: function() {}, + beforeColumnResize: function() {}, + beforeColumnSort: function() {}, + beforeDrawBorders: function() {}, + beforeFilter: function() {}, + beforeGetCellMeta: function() {}, + beforeInit: function() {}, + beforeInitWalkontable: function() {}, + beforeKeyDown: function() {}, + beforeOnCellMouseDown: function() {}, + beforeRemoveCol: function() {}, + beforeRemoveRow: function() {}, + beforeRender: function() {}, + beforeRenderer: function() {}, + beforeRowMove: function() {}, + beforeRowResize: function() {}, + beforeSetRangeEnd: function() {}, + beforeStretchingColumnWidth: function() {}, + beforeTouchScroll: function() {}, + beforeValidate: function() {}, + construct: function() {}, + init: function() {}, + modifyCol: function() {}, + modifyColHeader: function() {}, + modifyColWidth: function() {}, + modifyCopyableRange: function() {}, + modifyRow: function() {}, + modifyRowHeader: function() {}, + modifyRowHeight: function() {}, + persistentStateLoad: function() {}, + persistentStateReset: function() {}, + persistentStateSave: function() {}, + unmodifyCol: function() {} + }); +} + +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..790eb4b087 --- /dev/null +++ b/handsontable/handsontable.d.ts @@ -0,0 +1,292 @@ +// Type definitions for Handsontable 0.24.3 +// 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; + bindRowsWithHeaders?: boolean|string; + cell?: any[]; + cells?: Function; + checkedTemplate?: boolean|string; + className?: string|any[]; + colHeaders?: boolean|any[]|Function; + collapsibleColumns?: boolean|any[]; + columnHeaderHeight?: number|any[]; + columns?: any[]; + columnSorting?: boolean|Object; + columnSummary?: 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[]; + dropdownMenu?: boolean|Object|any[]; + editor?: string|Function|boolean; + enterBeginsEditing?: boolean; + enterMoves?: Object|Function; + fillHandle?: boolean|string|Object; + filter?: boolean; + filteringCaseSensitive?: boolean; + filters?: boolean; + fixedColumnsLeft?: number; + fixedRowsBottom?: number; + fixedRowsTop?: number; + format?: string; + fragmentSelection?: boolean|string; + ganttChart?: Object; + headerTooltips?: boolean|Object; + height?: number|Function; + hiddenColumns?: boolean|Object; + hiddenRows?: boolean|Object; + 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; + nestedHeaders?: any[]; + 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; + sortByRelevance?: 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; + + // hooks + afterAutofillApplyValues?: (startArea: any[], entireArea: any[]) => void; + afterCellMetaReset?: () => void; + afterChange?: (changes: any[], source: string) => void; + afterChangesObserved?: () => void; + afterColumnMove?: (startColumn: number, endColumn: number) => void; + afterColumnResize?: (currentColumn: number, newSize: number, isDoubleClick: boolean) => void; + afterColumnSort?: (column: number, order: boolean) => void; + afterContextMenuDefaultOptions?: (predefinedItems: any[]) => void; + afterContextMenuHide?: (context: Object) => void; + afterContextMenuShow?: (context: Object) => void; + afterCopyLimit?: (selectedRows: number, selectedColumnds: number, copyRowsLimit: number, copyColumnsLimit: number) => void; + afterCreateCol?: (index: number, amount: number) => void; + afterCreateRow?: (index: number, amount: number) => void; + afterDeselect?: () => void; + afterDestroy?: () => void; + afterDocumentKeyDown?: (event: Event) => void; + afterFilter?: (formulasStack: any[]) => void; + afterGetCellMeta?: (row: number, col: number, cellProperties: Object) => void; + afterGetColHeader?: (col: number, TH: Element) => void; + afterGetColumnHeaderRenderers?: (array: any[]) => void; + afterGetRowHeader?: (row: number, TH: Element) => void; + afterGetRowHeaderRenderers?: (array: any[]) => void; + afterInit?: () => void; + afterLoadData?: (firstTime: boolean) => void; + afterMomentumScroll?: () => void; + afterOnCellCornerMouseDown?: (event: Object) => void; + afterOnCellMouseDown?: (event: Object, coords: Object, TD: Element) => void; + afterOnCellMouseOver?: (event: Object, coords: Object, TD: Element) => void; + afterRemoveCol?: (index: number, amount: number) => void; + afterRemoveRow?: (index: number, amount: number) => void; + afterRender?: (isForced: boolean) => void; + afterRenderer?: (TD: Element, row: number, col: number, prop: string|number, value: string, cellProperties: Object) => void; + afterRowMove?: (startRow: number, endRow: number) => void; + afterRowResize?: (currentRow: number, newSize: number, isDoubleClick: boolean) => void; + afterScrollHorizontally?: () => void; + afterScrollVertically?: () => void; + afterSelection?: (r: number, c: number, r2: number, c2: number) => void; + afterSelectionByProp?: (r: number, p: string, r2: number, p2: string) => void; + afterSelectionEnd?: (r: number, c: number, r2: number, c2: number) => void; + afterSelectionEndByProp?: (r: number, p: string, r2: number, p2: string) => void; + afterSetCellMeta?: (row: number, col: number, key: string, value: any) => void; + afterUpdateSettings?: () => void; + afterValidate?: (isValid: boolean, value: any, row: number, prop: string|number, source: string) => void|boolean; + beforeAutofill?: (start: Object, end: Object, data: any[]) => void; + beforeCellAlignment?: (stateBefore: any, range: any, type: string, alignmentClass: string) => void; + beforeChange?: (changes: any[], source: string) => void; + beforeChangeRender?: (changes: any[], source: string) => void; + beforeColumnMove?: (startColumn: number, endColumn: number) => void; + beforeColumnResize?: (currentColumn: number, newSize: number, isDoubleClick: boolean) => void; + beforeColumnSort?: (column: number, order: boolean) => void; + beforeDrawBorders?: (corners: any[], borderClassName: string) => void; + beforeFilter?: (formulasStack: any[]) => void; + beforeGetCellMeta?: (row: number, col: number, cellProperties: Object) => void; + beforeInit?: () => void; + beforeInitWalkontable?: (walkontableConfig: Object) => void; + beforeKeyDown?: (event: Event) => void; + beforeOnCellMouseDown?: (event: Event, coords: Object, TD: Element) => void; + beforeRemoveCol?: (index: number, amount: number, logicalCols?: any[]) => void; + beforeRemoveRow?: (index: number, amount: number, logicalRows?: any[]) => void; + beforeRender?: (isForced: boolean) => void; + beforeRenderer?: (TD: Element, row: number, col: number, prop: string|number, value: string, cellProperties: Object) => void; + beforeRowMove?: (startRow: number, endRow: number) => void; + beforeRowResize?: (currentRow: number, newSize: number, isDoubleClick: boolean) => any; + beforeSetRangeEnd?: (coords: any[]) => void; + beforeStretchingColumnWidth?: (stretchedWidth: number, column: number) => void; + beforeTouchScroll?: () => void; + beforeValidate?: (value: any, row: number, prop: string|number, source: string) => void; + construct?: () => void; + init?: () => void; + modifyCol?: (col: number) => void; + modifyColHeader?: (column: number) => void; + modifyColWidth?: (width: number, col: number) => void; + modifyCopyableRange?: (copyableRanges: any[]) => void; + modifyRow?: (row: number) => void; + modifyRowHeader?: (row: number) => void; + modifyRowHeight?: (height: number, row: number) => void; + persistentStateLoad?: (key: string, valuePlaceholder: Object) => void; + persistentStateReset?: (key: string) => void; + persistentStateSave?: (key: string, value: any) => void; + unmodifyCol?: (col: number) => void; + } + 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..743a4ad3ee 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; } @@ -77,6 +79,7 @@ server.route({ method: 'GET', path: '/hello', handler: function (request: Hapi.Request, reply: Function) { + request.log('info', { route: '/hello' }, Date.now()); reply('hello world'); } }); @@ -91,28 +94,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 +124,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..05f4aa1047 100644 --- a/hapi/hapi.d.ts +++ b/hapi/hapi.d.ts @@ -9,897 +9,910 @@ /// 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"); + import url = require("url"); - 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: any, 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 +924,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 +1122,223 @@ 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 | url.Url): 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?: any, + /** 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/he/he.d.ts b/he/he.d.ts index e0fb9847ac..44879577e1 100644 --- a/he/he.d.ts +++ b/he/he.d.ts @@ -6,6 +6,9 @@ // he - "HTML Entities" - A high quality pair of HTML encode and decode functions. declare module "he" { + export = he; +} +declare module he { var version: string; diff --git a/hellojs/hellojs.d.ts b/hellojs/hellojs.d.ts index 6da9f9ca0b..686d5c1adf 100644 --- a/hellojs/hellojs.d.ts +++ b/hellojs/hellojs.d.ts @@ -80,3 +80,8 @@ interface HelloJSServiceDef { } declare var hello: HelloJSStatic; + +// Support AMD require +declare module 'hellojs' { + export = hello; +} diff --git a/helmet/helmet-tests.ts b/helmet/helmet-tests.ts index 98ebb77d00..5d8a7515cd 100644 --- a/helmet/helmet-tests.ts +++ b/helmet/helmet-tests.ts @@ -10,22 +10,19 @@ var app = express(); */ function helmetTest() { app.use(helmet()); + app.use(helmet({})); + app.use(helmet({ frameguard: false })); + app.use(helmet({ frameguard: true })); + app.use(helmet({ + frameguard: { + action: 'deny' + } + })); } /** - * @summary Test for {@see helmet#xssFilter} function. + * @summary Test for {@see helmet#contentSecurityPolicy} function. */ -function xssFilterTest() { - app.use(helmet.xssFilter()); - app.use(helmet.xssFilter({})); - app.use(helmet.xssFilter({ setOnOldIE: false })); - app.use(helmet.xssFilter({ setOnOldIE: true })); -} - -/** - * @summary Test for {@see helmet#csp} function. - */ - function contentSecurityPolicyTest() { const emptyArray: string[] = []; const config = { @@ -63,16 +60,15 @@ function contentSecurityPolicyTest() { }, setAllHeaders: true })); +} - app.use(helmet.csp()); - app.use(helmet.csp({})); - app.use(helmet.csp(config)); - app.use(helmet.csp({ - directives: { - defaultSrc: ["'self'"] - }, - setAllHeaders: true - })); +/** + * @summary Test for {@see helmet#dnsPrefetchControl} function. + */ +function dnsPrefetchControlTest() { + app.use(helmet.dnsPrefetchControl()); + app.use(helmet.dnsPrefetchControl({ allow: false })); + app.use(helmet.dnsPrefetchControl({ allow: true })); } /** @@ -80,7 +76,62 @@ function contentSecurityPolicyTest() { */ function frameguardTest() { app.use(helmet.frameguard()); - app.use(helmet.frameguard("sameorigin")); + app.use(helmet.frameguard({})); + app.use(helmet.frameguard({ action: 'deny' })); + app.use(helmet.frameguard({ action: 'sameorigin' })); + app.use(helmet.frameguard({ + action: 'allow-from', + domain: 'http://example.com' + })); +} + +/** + * @summary Test for {@see helmet#hidePoweredBy} function. + */ +function hidePoweredBy() { + app.use(helmet.hidePoweredBy()); + app.use(helmet.hidePoweredBy({})); + app.use(helmet.hidePoweredBy({ setTo: 'PHP 4.2.0' })); +} + +/** + * @summary Test for {@see helmet#hpkp} function. + */ +function hpkpTest() { + app.use(helmet.hpkp({ + maxAge: 7776000000, + sha256s: ['AbCdEf123=', 'ZyXwVu456='], + })); + + app.use(helmet.hpkp({ + maxAge: 7776000000, + sha256s: ['AbCdEf123=', 'ZyXwVu456='], + includeSubdomains: false + })); + + app.use(helmet.hpkp({ + maxAge: 7776000000, + sha256s: ['AbCdEf123=', 'ZyXwVu456='], + includeSubdomains: true + })); + + app.use(helmet.hpkp({ + maxAge: 7776000000, + sha256s: ['AbCdEf123=', 'ZyXwVu456='], + reportUri: 'http://example.com' + })); + + app.use(helmet.hpkp({ + maxAge: 7776000000, + sha256s: ['AbCdEf123=', 'ZyXwVu456='], + reportOnly: true + })); + + app.use(helmet.hpkp({ + maxAge: 7776000000, + sha256s: ['AbCdEf123=', 'ZyXwVu456='], + setIf: function (req, res) { return true; } + })); } /** @@ -88,7 +139,32 @@ function frameguardTest() { */ function hstsTest() { app.use(helmet.hsts()); + app.use(helmet.hsts({ maxAge: 7776000000 })); + + app.use(helmet.hsts({ + maxAge: 7776000000, + })); + + app.use(helmet.hsts({ + maxAge: 7776000000, + includeSubdomains: true + })); + + app.use(helmet.hsts({ + maxAge: 7776000000, + preload: true + })); + + app.use(helmet.hsts({ + maxAge: 7776000000, + force: true + })); + + app.use(helmet.hsts({ + maxAge: 7776000000, + setIf: function (req, res) { return true; } + })); } /** @@ -98,6 +174,15 @@ function ieNoOpenTest() { app.use(helmet.ieNoOpen()); } +/** + * @summary Test for {@see helmet#noCache} function. + */ +function noCacheTest() { + app.use(helmet.noCache()); + app.use(helmet.noCache({})); + app.use(helmet.noCache({ noEtag: true })); +} + /** * @summary Test for {@see helmet#noSniff} function. */ @@ -106,12 +191,11 @@ function noSniffTest() { } /** - * @summary Test for {@see helmet#publicKeyPins} function. + * @summary Test for {@see helmet#xssFilter} function. */ -function publicKeyPinsTest() { - app.use(helmet.publicKeyPins({ - sha256s: ["AbCdEf123=", "ZyXwVu456="], - includeSubdomains: true, - reportUri: "http://example.com" - })); +function xssFilterTest() { + app.use(helmet.xssFilter()); + app.use(helmet.xssFilter({})); + app.use(helmet.xssFilter({ setOnOldIE: false })); + app.use(helmet.xssFilter({ setOnOldIE: true })); } diff --git a/helmet/helmet.d.ts b/helmet/helmet.d.ts index 5c34378f04..6feef0bad8 100644 --- a/helmet/helmet.d.ts +++ b/helmet/helmet.d.ts @@ -1,19 +1,32 @@ // Type definitions for helmet // Project: https://github.com/helmetjs/helmet -// Definitions by: Cyril Schumacher +// Definitions by: Cyril Schumacher , Evan Hahn // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// -declare module "helmet" { - import express = require("express"); - - interface IHelmetCspDirectiveFunction { +declare module 'helmet' { + import express = require('express'); + + interface IHelmetConfiguration { + contentSecurityPolicy? : boolean | IHelmetContentSecurityPolicyConfiguration, + dnsPrefetchControl?: boolean | IHelmetDnsPrefetchControlConfiguration, + frameguard?: boolean | IHelmetFrameguardConfiguration, + hidePoweredBy?: boolean | IHelmetHidePoweredByConfiguration, + hpkp?: boolean | IHelmetHpkpConfiguration, + hsts?: boolean | IHelmetHstsConfiguration, + ieNoOpen?: boolean, + noCache?: boolean, + noSniff?: boolean, + xssFilter?: boolean | IHelmetXssFilterConfiguration + } + + interface IHelmetContentSecurityPolicyDirectiveFunction { (req: express.Request, res: express.Response): string; } - type HelmetCspDirectiveValue = string | IHelmetCspDirectiveFunction; + type HelmetCspDirectiveValue = string | IHelmetContentSecurityPolicyDirectiveFunction; - interface IHelmetCspDirectives { + interface IHelmetContentSecurityPolicyDirectives { baseUri? : HelmetCspDirectiveValue[], childSrc? : HelmetCspDirectiveValue[], connectSrc? : HelmetCspDirectiveValue[], @@ -31,13 +44,47 @@ declare module "helmet" { scriptSrc? : HelmetCspDirectiveValue[], styleSrc? : HelmetCspDirectiveValue[] } - - interface IHelmetCspConfiguration { + + interface IHelmetContentSecurityPolicyConfiguration { reportOnly? : boolean; setAllHeaders? : boolean; disableAndroid? : boolean; browserSniff?: boolean; - directives? : IHelmetCspDirectives + directives? : IHelmetContentSecurityPolicyDirectives + } + + interface IHelmetDnsPrefetchControlConfiguration { + allow? : boolean; + } + + interface IHelmetFrameguardConfiguration { + action? : string, + domain? : string + } + + interface IHelmetHidePoweredByConfiguration { + setTo? : string + } + + interface IHelmetSetIfFunction { + (req: express.Request, res: express.Response): boolean; + } + + interface IHelmetHpkpConfiguration { + maxAge : number; + sha256s : string[]; + includeSubdomains? : boolean; + reportUri? : string; + reportOnly? : boolean; + setIf?: IHelmetSetIfFunction + } + + interface IHelmetHstsConfiguration { + maxAge: number; + includeSubdomains? : boolean; + preload? : boolean; + setIf? : IHelmetSetIfFunction, + force? : boolean; } interface IHelmetXssFilterConfiguration { @@ -53,72 +100,74 @@ declare module "helmet" { * @summary Constructor. * @return {RequestHandler} The Request handler. */ - ():express.RequestHandler; + (options ?: IHelmetConfiguration): express.RequestHandler; + + /** + * @summary Set policy around third-party content via headers + * @param {IHelmetContentSecurityPolicyConfiguration} options The options + * @return {RequestHandler} The Request handler + */ + contentSecurityPolicy(options ?: IHelmetContentSecurityPolicyConfiguration): express.RequestHandler; + + /** + * @summary Stop browsers from doing DNS prefetching. + * @param {IHelmetDnsPrefetchControlConfiguration} options The options + * @return {RequestHandler} The Request handler + */ + dnsPrefetchControl(options ?: IHelmetDnsPrefetchControlConfiguration): express.RequestHandler; /** * @summary Prevent clickjacking. - * @param {string} header The header. - * @return {RequestHandler} The Request handler. + * @param {IHelmetFrameguardConfiguration} options The options + * @return {RequestHandler} The Request handler */ - frameguard(header ?: string):express.RequestHandler; + frameguard(options ?: IHelmetFrameguardConfiguration): express.RequestHandler; /** * @summary Hide "X-Powered-By" header. - * @param {Object} options The options. + * @param {IHelmetHidePoweredByConfiguration} options The options * @return {RequestHandler} The Request handler. */ - hidePoweredBy(options ?: Object):express.RequestHandler; + hidePoweredBy(options ?: IHelmetHidePoweredByConfiguration): express.RequestHandler; + + /** + * @summary Adds the "Public-Key-Pins" header. + * @param {IHelmetHpkpConfiguration} options The options + * @return {RequestHandler} The Request handler. + */ + hpkp(options ?: IHelmetHpkpConfiguration): express.RequestHandler; /** * @summary Adds the "Strict-Transport-Security" header. - * @param {Object} options The options. + * @param {IHelmetHstsConfiguration} options The options * @return {RequestHandler} The Request handler. */ - hsts(options ?: Object):express.RequestHandler; + hsts(options ?: IHelmetHstsConfiguration): express.RequestHandler; /** * @summary Add the "X-Download-Options" header. * @return {RequestHandler} The Request handler. */ - ieNoOpen():express.RequestHandler; + ieNoOpen(): express.RequestHandler; /** * @summary Add the "Cache-Control" and "Pragma" headers to stop caching. * @return {RequestHandler} The Request handler. */ - noCache(options ?: Object):express.RequestHandler; + noCache(options ?: Object): express.RequestHandler; /** * @summary Adds the "X-Content-Type-Options" header. * @return {RequestHandler} The Request handler. */ - noSniff():express.RequestHandler; - - /** - * @summary Adds the "Public-Key-Pins" header. - * @return {RequestHandler} The Request handler. - */ - publicKeyPins(options ?: Object):express.RequestHandler; + noSniff(): express.RequestHandler; /** * @summary Mitigate cross-site scripting attacks with the "X-XSS-Protection" header. + * @param {IHelmetXssFilterConfiguration} options The options * @return {RequestHandler} The Request handler. - * @param {Object} options The options. */ - xssFilter(options ?: IHelmetXssFilterConfiguration):express.RequestHandler; - - /** - * @summary Set policy around third-party content via headers - * @return {RequestHandler} The Request handler - * @param {Object} options The options - */ - csp(options ?: IHelmetCspConfiguration): express.RequestHandler; - - /** - * @see csp - */ - contentSecurityPolicy(options ?: IHelmetCspConfiguration): express.RequestHandler; - + xssFilter(options ?: IHelmetXssFilterConfiguration): express.RequestHandler; } var helmet: Helmet; diff --git a/highcharts/highcharts-tests.ts b/highcharts/highcharts-tests.ts index ad57f8bc4c..499dfc9494 100644 --- a/highcharts/highcharts-tests.ts +++ b/highcharts/highcharts-tests.ts @@ -2187,6 +2187,7 @@ function test_ChartObject() { chart.destroy(); chart.drillUp(); chart.exportChart({}, {}); + chart.exportChartLocal({}, {}); var object = chart.get('axisIdOrSeriesIdOrPointId'); var svg1 = chart.getSVG(); var svg2 = chart.getSVG({}); diff --git a/highcharts/highcharts.d.ts b/highcharts/highcharts.d.ts index 16151be327..c7584f4e0d 100644 --- a/highcharts/highcharts.d.ts +++ b/highcharts/highcharts.d.ts @@ -5681,6 +5681,30 @@ interface HighchartsChartObject { * @since 2.0 */ exportChart(options: HighchartsExportingOptions, chartOptions: HighchartsOptions): void; + /** + * Export the chart to a PNG or SVG without sending it to a server. Requires + * modules/exporting.js and modules/offline-exporting.js. + * @since 2.0 + */ + exportChartLocal(): void; + /** + * Export the chart to a PNG or SVG without sending it to a server. Requires + * modules/exporting.js and modules/offline-exporting.js. + * @param {HighchartsExportingOptions} options Exporting options. Same as + * the exportChart params. + * @since 2.0 + */ + exportChartLocal(options: HighchartsExportingOptions): void; + /** + * Export the chart to a PNG or SVG without sending it to a server. + * Requires modules/exporting.js and modules/offline-exporting.js. + * @param {HighchartsExportingOptions} options Exporting options. Same as + * the exportChart params. + * @param {HighchartsOptions} chartOptions Additional chart options for the + * exported chart. Same as the exportChart params. + * @since 2.0 + */ + exportChartLocal(options: HighchartsExportingOptions, chartOptions: HighchartsOptions): void; /** * Get an axis, series or point by its id as given in the configuration options. * @param {string} id The id of the axis, series or point to get. diff --git a/highland/highland-tests.ts b/highland/highland-tests.ts index c7e213aa17..7a67670edd 100644 --- a/highland/highland-tests.ts +++ b/highland/highland-tests.ts @@ -137,7 +137,9 @@ fooStream = _(readable); fooStream = _(emitter); fooStream = _(fooStreamThen); -fooStream = _(fooArrThen); +fooStream = _(fooThen); + +fooArrStream = _(fooArrThen); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/highland/highland.d.ts b/highland/highland.d.ts index 8becaf2762..f3617ccd14 100644 --- a/highland/highland.d.ts +++ b/highland/highland.d.ts @@ -67,7 +67,7 @@ interface HighlandStatic { // moar (promise for everything?) (xs: Highland.Thenable>): Highland.Stream; - (xs: Highland.Thenable): Highland.Stream; + (xs: Highland.Thenable): Highland.Stream; /** * The end of stream marker. This is sent along the data channel of a Stream 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..e1fcbc7a1b 100644 --- a/html2canvas/html2canvas.d.ts +++ b/html2canvas/html2canvas.d.ts @@ -1,6 +1,6 @@ -// Type definitions for html2canvas.js v0.4.1 +// Type definitions for html2canvas.js v0.5.0-bata.4 // Project: https://github.com/niklasvh/html2canvas -// Definitions by: Richard Hepburn +// Definitions by: Richard Hepburn , Pei-Tang Huang // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -37,22 +37,13 @@ declare namespace Html2Canvas { /** Whether to attempt to load cross-origin images as CORS served, before reverting back to proxy. */ useCORS?: boolean; - /** Callback providing the rendered canvas element after rendering */ - onrendered?(canvas: HTMLCanvasElement): void; + /** Use svg powered rendering where available (FF11+). */ + svgRendering?: boolean; } } interface Html2CanvasStatic { - /** - * Renders an HTML element to a canvas so that a screenshot can be generated. - * - * The screenshot is based on the DOM and as such may not be 100% accurate to the real representation as it does not make an actual screenshot, - * but builds the screenshot based on the information available on the page. - * - * @param {HTMLElement} element The HTML element which will be rendered to the canvas. Use the root element to render the entire window. - */ - (element: HTMLElement): void; /** * Renders an HTML element to a canvas so that a screenshot can be generated. * @@ -62,7 +53,25 @@ interface Html2CanvasStatic { * @param {HTMLElement} element The HTML element which will be rendered to the canvas. Use the root element to render the entire window. * @param {Html2CanvasOptions} options The options object that controls how the element will be rendered. */ - (element: HTMLElement, options: Html2Canvas.Html2CanvasOptions): void; + (element: HTMLElement, options?: Html2Canvas.Html2CanvasOptions): Html2CanvasPromise; +} + +// FIXME: +// Find out a way to dependent on real Promise interface. +// And remove following custome Promise interface. +interface Html2CanvasThenable { + then(onFulfilled?: (value: R) => U | Html2CanvasThenable, onRejected?: (error: any) => U | Html2CanvasThenable): Html2CanvasThenable; + then(onFulfilled?: (value: R) => U | Html2CanvasThenable, onRejected?: (error: any) => void): Html2CanvasThenable; +} + +interface Html2CanvasPromise extends Html2CanvasThenable { + then(onFulfilled?: (value: R) => U | Html2CanvasThenable, onRejected?: (error: any) => U | Html2CanvasThenable): Html2CanvasPromise; + then(onFulfilled?: (value: R) => U | Html2CanvasThenable, onRejected?: (error: any) => void): Html2CanvasPromise; + catch(onRejected?: (error: any) => U | Html2CanvasThenable): Html2CanvasPromise; +} + +declare module 'html2canvas' { + export = html2canvas; } declare var html2canvas: Html2CanvasStatic; 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/i18n-node/i18n-node.d.ts b/i18n-node/i18n-node.d.ts index 568228df45..d5703a825d 100644 --- a/i18n-node/i18n-node.d.ts +++ b/i18n-node/i18n-node.d.ts @@ -50,6 +50,11 @@ declare namespace i18n { * json files prefix */ prefix?: string; + + /** + * object or [obj1, obj2] to bind the i18n api and current locale to - defaults to null + */ + register?: any; } export interface TranslateOptions { phrase: string; diff --git a/i18next/i18next-tests.ts b/i18next/i18next-tests.ts index e46a9ed5bf..373b7394b4 100644 --- a/i18next/i18next-tests.ts +++ b/i18next/i18next-tests.ts @@ -62,3 +62,5 @@ i18n.t('helloWorld', { defaultValue: 'default', count: 10 }); +const currentLanguage:string = i18n.language; +const userLanguageCodes:string[] = i18n.languages; diff --git a/i18next/i18next.d.ts b/i18next/i18next.d.ts index d8627c4462..5e2f8dcd20 100644 --- a/i18next/i18next.d.ts +++ b/i18next/i18next.d.ts @@ -94,13 +94,17 @@ declare namespace I18next { loadResources(callback?:(err:any) => void):void; + language:string; + + languages:string[]; + use(module:any):I18n; changeLanguage(lng:string, callback?:(err:any, t:TranslationFunction) => void):void; getFixedT(lng?:string, ns?:string|string[]):TranslationFunction; - t(key:string, options?:TranslationOptions):string; + t(key:string, options?:TranslationOptions):string|any|Array; exists():boolean; 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/ionic/ionic-tests.ts b/ionic/ionic-tests.ts index 8491fc13f8..d8c98ae25f 100644 --- a/ionic/ionic-tests.ts +++ b/ionic/ionic-tests.ts @@ -9,6 +9,8 @@ testIonic.config(['$ionicConfigProvider', ($ionicConfigProvider: ionic.utility.I $ionicConfigProvider.views.maxCache(10); var forwardCache: boolean = $ionicConfigProvider.views.forwardCache(); $ionicConfigProvider.views.forwardCache(true); + var swipeBackEnabled: boolean = $ionicConfigProvider.views.swipeBackEnabled(); + $ionicConfigProvider.views.swipeBackEnabled(true); var jsScrolling: boolean = $ionicConfigProvider.scrolling.jsScrolling(); $ionicConfigProvider.scrolling.jsScrolling(true); @@ -387,6 +389,7 @@ class IonicTestController { ready = ionic.Platform.ready(callbackWithReturn); var setGrade: void = ionic.Platform.setGrade('iOS'); var deviceInformation: string = ionic.Platform.device(); + var isBrowser: boolean = ionic.Platform.is('browser'); var isWebView: boolean = ionic.Platform.isWebView(); var isIPad: boolean = ionic.Platform.isIPad(); var isIOS: boolean = ionic.Platform.isIOS(); diff --git a/ionic/ionic.d.ts b/ionic/ionic.d.ts index 994b7ae27e..fae9cdbf63 100644 --- a/ionic/ionic.d.ts +++ b/ionic/ionic.d.ts @@ -32,6 +32,10 @@ interface IonicStatic { * Return the current device (given by cordova). */ device(): any; + /** + * Check if the platform name provided is detected. + */ + is(platformName: string): boolean; /** * Check if we are running within a WebView (such as Cordova). */ @@ -354,6 +358,7 @@ declare namespace ionic { transition(transition?: string): string; maxCache(maxNumber?: number): number; forwardCache(value?: boolean): boolean; + swipeBackEnabled(value?: boolean): boolean; }; scrolling: { jsScrolling(value?: boolean): boolean; 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..42a498addc --- /dev/null +++ b/ioredis/ioredis.d.ts @@ -0,0 +1,703 @@ +// 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; + /** + * If you are using the hiredis parser, it's highly recommended to enable this option. Create another instance with dropBufferSupport disabled for other commands that you want to return binary instead of string: + */ + dropBufferSupport?: 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/irc/irc-tests.ts b/irc/irc-tests.ts index edda5e14fd..9e098f923c 100644 --- a/irc/irc-tests.ts +++ b/irc/irc-tests.ts @@ -3,52 +3,82 @@ import irc = require('irc'); -var bot = new irc.Client('irc.dollyfish.net.nz', 'nodebot', { - debug: true, - channels: ['#blah', '#test'] -}); +function test_bot() { + var bot = new irc.Client('irc.dollyfish.net.nz', 'nodebot', { + debug: true, + channels: ['#blah', '#test'] + }); -bot.addListener('error', ((message: irc.IMessage) => { - console.error('ERROR: %s: %s', message.command, message.args.join(' ')); -})); + bot.connect(function() { + console.log("Connected"); + }); -bot.addListener('message#blah', ((from: string, message: string) => { - console.log('<%s> %s', from, message); -})); + bot.addListener('error', ((message: irc.IMessage) => { + console.error('ERROR: %s: %s', message.command, message.args.join(' ')); + })); -bot.addListener('message', ((from: string, to: string, message: string) => { - console.log('%s => %s: %s', from, to, message); + bot.addListener('message#blah', ((from: string, message: string) => { + console.log('<%s> %s', from, message); + })); - if (to.match(/^[#&]/)) { - // channel message - if (message.match(/hello/i)) { - bot.say(to, 'Hello there ' + from); + bot.addListener('message', ((from: string, to: string, message: string) => { + console.log('%s => %s: %s', from, to, message); + + if (to.match(/^[#&]/)) { + // channel message + if (message.match(/hello/i)) { + bot.say(to, 'Hello there ' + from); + } + if (message.match(/dance/)) { + setTimeout(() => { bot.say(to, '\u0001ACTION dances: :D\\-<\u0001'); }, 1000); + setTimeout(() => { bot.say(to, '\u0001ACTION dances: :D|-<\u0001'); }, 2000); + setTimeout(() => { bot.say(to, '\u0001ACTION dances: :D/-<\u0001'); }, 3000); + setTimeout(() => { bot.say(to, '\u0001ACTION dances: :D|-<\u0001'); }, 4000); + } } - if (message.match(/dance/)) { - setTimeout(() => { bot.say(to, '\u0001ACTION dances: :D\\-<\u0001'); }, 1000); - setTimeout(() => { bot.say(to, '\u0001ACTION dances: :D|-<\u0001'); }, 2000); - setTimeout(() => { bot.say(to, '\u0001ACTION dances: :D/-<\u0001'); }, 3000); - setTimeout(() => { bot.say(to, '\u0001ACTION dances: :D|-<\u0001'); }, 4000); + else { + // private message + console.log('private message'); } - } - else { - // private message - console.log('private message'); - } -})); + })); -bot.addListener('pm', ((nick: string, message: string) => { - console.log('Got private message from %s: %s', nick, message); -})); + bot.addListener('pm', ((nick: string, message: string) => { + console.log('Got private message from %s: %s', nick, message); + })); -bot.addListener('join', ((channel: string, who: string) => { - console.log('%s has joined %s', who, channel); -})); + bot.addListener('join', ((channel: string, who: string) => { + console.log('%s has joined %s', who, channel); + })); -bot.addListener('part', ((channel: string, who: string, reason: string) => { - console.log('%s has left %s: %s', who, channel, reason); -})); + bot.addListener('part', ((channel: string, who: string, reason: string) => { + console.log('%s has left %s: %s', who, channel, reason); + })); -bot.addListener('kick', ((channel: string, who: string, by: string, reason: string) => { - console.log('%s was kicked from %s by %s: %s', who, channel, by, reason); -})); + bot.addListener('kick', ((channel: string, who: string, by: string, reason: string) => { + console.log('%s was kicked from %s by %s: %s', who, channel, by, reason); + })); +} + +function test_secure() { + var options = true; + + var bot = new irc.Client('chat.us.freenode.net', 'nodebot', { + port: 6697, + debug: true, + secure: options, + channels: ['#botwar'] + }); +} + +function test_connect() { + var bot = new irc.Client('chat.us.freenode.net', 'nodebot', { + port: 6697, + autoConnect: false + }); + + bot.connect(5); + + bot.connect(5, function() {}); + + bot.connect(function() {}); +} diff --git a/irc/irc.d.ts b/irc/irc.d.ts index 00dd3220e1..546ca7c3c0 100644 --- a/irc/irc.d.ts +++ b/irc/irc.d.ts @@ -194,7 +194,7 @@ declare module 'irc' { * @param callback */ public connect( - retryCount?: number, + retryCount?: number | handlers.IRaw, callback?: handlers.IRaw ): void; @@ -228,6 +228,12 @@ declare module 'irc' { */ userName?: string; + /** + * IRC username + * @default '' + */ + password?: string; + /** * IRC "real name" * @default 'nodeJS IRC client' diff --git a/isomorphic-fetch/isomorphic-fetch-tests.ts b/isomorphic-fetch/isomorphic-fetch-tests.ts index 3235912ac1..ddf11f84fe 100644 --- a/isomorphic-fetch/isomorphic-fetch-tests.ts +++ b/isomorphic-fetch/isomorphic-fetch-tests.ts @@ -1,6 +1,9 @@ /// -function test_isomorphicFetchTestCases() { +import fetchImportedViaCommonJS = require('isomorphic-fetch'); +import * as fetchImportedViaES6Module from 'isomorphic-fetch'; + +function test_isomorphicFetchTestCases_ambient() { expectSuccess(fetch('http://localhost:3000/good'), 'Good response'); fetch('http://localhost:3000/bad') @@ -11,7 +14,30 @@ function test_isomorphicFetchTestCases() { }); } -function test_whatwgTestCases() { +function test_isomorphicFetchTestCases_commonjs() { + expectSuccess(fetchImportedViaCommonJS('http://localhost:3000/good'), 'Good response'); + + fetchImportedViaCommonJS('http://localhost:3000/bad') + .then((response: IResponse) => { + return response.text(); + }) + .catch((err) => { + }); +} + +function test_isomorphicFetchTestCases_es6() { + expectSuccess(fetchImportedViaES6Module('http://localhost:3000/good'), 'Good response'); + + fetchImportedViaES6Module('http://localhost:3000/bad') + .then((response: IResponse) => { + return response.text(); + }) + .catch((err) => { + }); +} + + +function test_whatwgTestCases_ambient() { var headers = new Headers(); headers.append("Content-Type", "application/json"); var requestOptions: RequestInit = { @@ -43,6 +69,72 @@ function test_whatwgTestCases() { expectSuccess(fetch(request), 'Post response:'); } + +function test_whatwgTestCases_commonjs() { + var headers = new Headers(); + headers.append("Content-Type", "application/json"); + var requestOptions: RequestInit = { + method: "POST", + headers: headers, + mode: 'same-origin', + credentials: 'omit', + cache: 'default' + }; + + expectSuccess(fetchImportedViaCommonJS('http://localhost:3000/poster', requestOptions), 'Post response:'); + + var requestOptions: RequestInit = { + method: "POST", + headers: { + 'Content-Type': 'application/json' + } + }; + + expectSuccess(fetchImportedViaCommonJS('http://localhost:3000/poster', requestOptions), 'Post response:'); + + var requestOptions: RequestInit = { + method: "POST", + headers: { + 'Content-Type': 'application/json' + } + }; + var request: Request = new Request('http://localhost:3000/poster', requestOptions); + + expectSuccess(fetchImportedViaCommonJS(request), 'Post response:'); +} + +function test_whatwgTestCases_es6() { + var headers = new Headers(); + headers.append("Content-Type", "application/json"); + var requestOptions: RequestInit = { + method: "POST", + headers: headers, + mode: 'same-origin', + credentials: 'omit', + cache: 'default' + }; + + expectSuccess(fetchImportedViaES6Module('http://localhost:3000/poster', requestOptions), 'Post response:'); + + var requestOptions: RequestInit = { + method: "POST", + headers: { + 'Content-Type': 'application/json' + } + }; + + expectSuccess(fetchImportedViaES6Module('http://localhost:3000/poster', requestOptions), 'Post response:'); + + var requestOptions: RequestInit = { + method: "POST", + headers: { + 'Content-Type': 'application/json' + } + }; + var request: Request = new Request('http://localhost:3000/poster', requestOptions); + + expectSuccess(fetchImportedViaES6Module(request), 'Post response:'); +} function expectSuccess(promise: Promise, responseText: string) { promise.then((response: IResponse) => { diff --git a/isomorphic-fetch/isomorphic-fetch.d.ts b/isomorphic-fetch/isomorphic-fetch.d.ts index 824c8a8ae0..19754db0f1 100644 --- a/isomorphic-fetch/isomorphic-fetch.d.ts +++ b/isomorphic-fetch/isomorphic-fetch.d.ts @@ -4,23 +4,23 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare enum RequestContext { - "audio", "beacon", "cspreport", "download", "embed", "eventsource", - "favicon", "fetch", "font", "form", "frame", "hyperlink", "iframe", - "image", "imageset", "import", "internal", "location", "manifest", - "object", "ping", "plugin", "prefetch", "script", "serviceworker", + "audio", "beacon", "cspreport", "download", "embed", "eventsource", + "favicon", "fetch", "font", "form", "frame", "hyperlink", "iframe", + "image", "imageset", "import", "internal", "location", "manifest", + "object", "ping", "plugin", "prefetch", "script", "serviceworker", "sharedworker", "subresource", "style", "track", "video", "worker", "xmlhttprequest", "xslt" } declare enum RequestMode { "same-origin", "no-cors", "cors" } declare enum RequestCredentials { "omit", "same-origin", "include" } -declare enum RequestCache { - "default", "no-store", "reload", "no-cache", "force-cache", +declare enum RequestCache { + "default", "no-store", "reload", "no-cache", "force-cache", "only-if-cached" } declare enum ResponseType { "basic", "cors", "default", "error", "opaque" } declare type HeaderInit = Headers | Array; -declare type BodyInit = Blob | FormData | string; +declare type BodyInit = ArrayBuffer | ArrayBufferView | Blob | FormData | string; declare type RequestInfo = Request | string; interface RequestInit { @@ -112,8 +112,8 @@ interface IFetchStatic { (url: string | IRequest, init?: RequestInit): Promise; } -declare module "isomorphic-fetch" { - export default IFetchStatic; -} - declare var fetch: IFetchStatic; + +declare module "isomorphic-fetch" { + export = fetch; +} diff --git a/istanbul-middleware/istanbul-middleware-tests.ts b/istanbul-middleware/istanbul-middleware-tests.ts new file mode 100644 index 0000000000..01afa92082 --- /dev/null +++ b/istanbul-middleware/istanbul-middleware-tests.ts @@ -0,0 +1,2 @@ +/// +import i = require('istanbul-middleware'); diff --git a/istanbul-middleware/istanbul-middleware.d.ts b/istanbul-middleware/istanbul-middleware.d.ts new file mode 100644 index 0000000000..054e32931e --- /dev/null +++ b/istanbul-middleware/istanbul-middleware.d.ts @@ -0,0 +1,33 @@ +// Type definitions for istanbul-middleware +// Project: https://www.npmjs.com/package/istanbul-middleware +// Definitions by: Hookclaw +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare module "istanbul-middleware" { + import * as express from "express"; + + type Matcher = (file:string)=> boolean; + type PostLoadHookFn = (file:any)=> {}; + type PostLoadHook = (matcherfn:Matcher,transformer:any,verbose:boolean)=>PostLoadHookFn; + + export function hookLoader(matcherOrRoot:Matcher|string, opts?:{ + postLoadHook?:PostLoadHook, + verbose?:boolean + //and istanbul.Instrumenter(...opts) + }): void; + + export function createHandler(opts?:{ + resetOnGet?:boolean + }): any; + + type ClientMatcher = (req:express.Request)=> boolean; + type PathTransformer = (req:express.Request)=> string; + + export function createClientHandler(root:string,opts?:{ + matcher?:ClientMatcher, + pathTransformer?:PathTransformer, + verbose?:boolean + }): any; +} diff --git a/jasmine/jasmine-tests.ts b/jasmine/jasmine-tests.ts index 81f1a1a886..d873d2716b 100644 --- a/jasmine/jasmine-tests.ts +++ b/jasmine/jasmine-tests.ts @@ -358,6 +358,40 @@ describe("A spy, when configured to fake a return value", function () { }); }); +describe("A spy, when configured to fake a series of return values", function() { + var foo: any, bar: any; + + beforeEach(function() { + foo = { + setBar: function(value: any) { + bar = value; + }, + getBar: function() { + return bar; + } + }; + + spyOn(foo, "getBar").and.returnValues("fetched first", "fetched second"); + + foo.setBar(123); + }); + + it("tracks that the spy was called", function() { + foo.getBar(123); + expect(foo.getBar).toHaveBeenCalled(); + }); + + it("should not affect other functions", function() { + expect(bar).toEqual(123); + }); + + it("when called multiple times returns the requested values in order", function() { + expect(foo.getBar()).toEqual("fetched first"); + expect(foo.getBar()).toEqual("fetched second"); + expect(foo.getBar()).toBeUndefined(); + }); +}); + describe("A spy, when configured with an alternate implementation", function () { var foo: any, bar: any, fetchedBar: any; @@ -747,31 +781,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..9841a74fc8 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; @@ -424,6 +431,8 @@ declare namespace jasmine { callThrough(): Spy; /** By chaining the spy with and.returnValue, all calls to the function will return a specific value. */ returnValue(val: any): Spy; + /** By chaining the spy with and.returnValues, all calls to the function will return specific values in order until it reaches the end of the return values list. */ + returnValues(...values: any[]): Spy; /** By chaining the spy with and.callFake, all calls to the spy will delegate to the supplied function. */ callFake(fn: Function): Spy; /** By chaining the spy with and.throwError, all calls to the spy will throw the specified value. */ diff --git a/jest/jest.d.ts b/jest/jest.d.ts index 033dd23faa..451b9abc88 100644 --- a/jest/jest.d.ts +++ b/jest/jest.d.ts @@ -29,7 +29,7 @@ declare namespace jest { function fn(implementation?: Function): Mock; function dontMock(moduleName: string): void; function genMockFromModule(moduleName: string): Mock; - function mock(moduleName: string): void; + function mock(moduleName: string, factory?: Function): void; function runAllTicks(): void; function runAllTimers(): void; function runOnlyPendingTimers(): void; diff --git a/joi/joi-6.5.0-tests.ts b/joi/joi-6.5.0-tests.ts new file mode 100644 index 0000000000..a00543fe4e --- /dev/null +++ b/joi/joi-6.5.0-tests.ts @@ -0,0 +1,774 @@ +/// +/// + +import Joi = require('joi'); + +// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- + +var x: any = null; +var value: any = null; +var num: number = 0; +var str: string = ''; +var bool: boolean = false; +var exp: RegExp = null; +var obj: Object = null; +var date: Date = null; +var bin: NodeBuffer = null; +var err: Error = null; +var func: Function = null; + +var anyArr: any[] = []; +var numArr: number[] = []; +var strArr: string[] = []; +var boolArr: boolean[] = []; +var expArr: RegExp[] = []; +var objArr: Object[] = []; +var bufArr: NodeBuffer[] = []; +var errArr: Error[] = []; +var funcArr: Function[] = []; + +// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- + +var schema: Joi.Schema = null; + +var anySchema: Joi.AnySchema = null; +var numSchema: Joi.NumberSchema = null; +var strSchema: Joi.StringSchema = null; +var arrSchema: Joi.ArraySchema = null; +var boolSchema: Joi.BooleanSchema = null; +var binSchema: Joi.BinarySchema = null; +var dateSchema: Joi.DateSchema = null; +var funcSchema: Joi.FunctionSchema = null; +var objSchema: Joi.ObjectSchema = null; +var altSchema: Joi.AlternativesSchema = null; + +var schemaArr: Joi.Schema[] = []; + +var ref: Joi.Reference = null; + +// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- + +var validOpts: Joi.ValidationOptions = null; + +validOpts = {abortEarly: bool}; +validOpts = {convert: bool}; +validOpts = {allowUnknown: bool}; +validOpts = {skipFunctions: bool}; +validOpts = {stripUnknown: bool}; +validOpts = {language: bool}; +validOpts = {presence: str}; +validOpts = {context: obj}; + +// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- + +var renOpts: Joi.RenameOptions = null; + +renOpts = {alias: bool}; +renOpts = {multiple: bool}; +renOpts = {override: bool}; +renOpts = {ignoreUndefined: bool}; + +// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- + +var emailOpts: Joi.EmailOptions = null; + +emailOpts = {errorLevel: num}; +emailOpts = {errorLevel: bool}; +emailOpts = {tldWhitelist: strArr}; +emailOpts = {tldWhitelist: obj}; +emailOpts = {minDomainAtoms: num}; + +// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- + +var ipOpts: Joi.IpOptions = null; + +ipOpts = {version: str}; +ipOpts = {version: strArr}; +ipOpts = {cidr: str}; + +// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- + +var uriOpts: Joi.UriOptions = null; + +uriOpts = {scheme: str}; +uriOpts = {scheme: exp}; +uriOpts = {scheme: strArr}; +uriOpts = {scheme: expArr}; + +// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- + +var whenOpts: Joi.WhenOptions = null; + +whenOpts = {is: x}; +whenOpts = {is: schema, then: schema}; +whenOpts = {is: schema, otherwise: schema}; + +// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- + +var refOpts: Joi.ReferenceOptions = null; + +refOpts = {separator: str}; +refOpts = {contextPrefix: str}; + +// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- + +var validErr: Joi.ValidationError = null; +var validErrItem: Joi.ValidationErrorItem; + +validErrItem= { + message: str, + type: str, + path: str +}; + +validErrItem = { + message: str, + type: str, + path: str, + options: validOpts +}; + +// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- + +schema = anySchema; +schema = numSchema; +schema = strSchema; +schema = arrSchema; +schema = boolSchema; +schema = binSchema; +schema = dateSchema; +schema = funcSchema; +schema = objSchema; + +schema = ref; + +anySchema = anySchema; +anySchema = numSchema; +anySchema = strSchema; +anySchema = arrSchema; +anySchema = boolSchema; +anySchema = binSchema; +anySchema = dateSchema; +anySchema = funcSchema; +anySchema = objSchema; + +// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- + +var schemaMap: Joi.SchemaMap = null; + +schemaMap = { + a: numSchema, + b: strSchema +}; + +// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- + +anySchema = Joi.any(); + +namespace common { + anySchema = anySchema.allow(x); + anySchema = anySchema.allow(x, x); + anySchema = anySchema.allow([x, x, x]); + anySchema = anySchema.valid(x); + anySchema = anySchema.valid(x, x); + anySchema = anySchema.valid([x, x, x]); + anySchema = anySchema.only(x); + anySchema = anySchema.only(x, x); + anySchema = anySchema.only([x, x, x]); + anySchema = anySchema.equal(x); + anySchema = anySchema.equal(x, x); + anySchema = anySchema.equal([x, x, x]); + anySchema = anySchema.invalid(x); + anySchema = anySchema.invalid(x, x); + anySchema = anySchema.invalid([x, x, x]); + anySchema = anySchema.disallow(x); + anySchema = anySchema.disallow(x, x); + anySchema = anySchema.disallow([x, x, x]); + anySchema = anySchema.not(x); + anySchema = anySchema.not(x, x); + anySchema = anySchema.not([x, x, x]); + + anySchema = anySchema.default(); + anySchema = anySchema.default(x); + anySchema = anySchema.default(x, str); + + anySchema = anySchema.required(); + anySchema = anySchema.optional(); + anySchema = anySchema.forbidden(); + anySchema = anySchema.strip(); + + anySchema = anySchema.description(str); + anySchema = anySchema.notes(str); + anySchema = anySchema.notes(strArr); + anySchema = anySchema.tags(str); + anySchema = anySchema.tags(strArr); + + anySchema = anySchema.meta(obj); + anySchema = anySchema.example(obj); + anySchema = anySchema.unit(str); + + anySchema = anySchema.options(validOpts); + anySchema = anySchema.strict(); + anySchema = anySchema.strict(bool); + anySchema = anySchema.concat(x); + + altSchema = anySchema.when(str, whenOpts); + altSchema = anySchema.when(ref, whenOpts); + + anySchema = anySchema.label(str); + anySchema = anySchema.raw(); + anySchema = anySchema.raw(bool); + anySchema = anySchema.empty(); + anySchema = anySchema.empty(str); + anySchema = anySchema.empty(anySchema); +} + +// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- + +arrSchema = Joi.array(); + +arrSchema = arrSchema.sparse(); +arrSchema = arrSchema.sparse(bool); +arrSchema = arrSchema.single(); +arrSchema = arrSchema.single(bool); +arrSchema = arrSchema.min(num); +arrSchema = arrSchema.max(num); +arrSchema = arrSchema.length(num); +arrSchema = arrSchema.unique(); + +arrSchema = arrSchema.items(numSchema); +arrSchema = arrSchema.items(numSchema, strSchema); +arrSchema = arrSchema.items([numSchema, strSchema]); + + +// - - - - - - - - + +namespace common_copy_paste { + // use search & replace from any + arrSchema = arrSchema.allow(x); + arrSchema = arrSchema.allow(x, x); + arrSchema = arrSchema.allow([x, x, x]); + arrSchema = arrSchema.valid(x); + arrSchema = arrSchema.valid(x, x); + arrSchema = arrSchema.valid([x, x, x]); + arrSchema = arrSchema.only(x); + arrSchema = arrSchema.only(x, x); + arrSchema = arrSchema.only([x, x, x]); + arrSchema = arrSchema.equal(x); + arrSchema = arrSchema.equal(x, x); + arrSchema = arrSchema.equal([x, x, x]); + arrSchema = arrSchema.invalid(x); + arrSchema = arrSchema.invalid(x, x); + arrSchema = arrSchema.invalid([x, x, x]); + arrSchema = arrSchema.disallow(x); + arrSchema = arrSchema.disallow(x, x); + arrSchema = arrSchema.disallow([x, x, x]); + arrSchema = arrSchema.not(x); + arrSchema = arrSchema.not(x, x); + arrSchema = arrSchema.not([x, x, x]); + + arrSchema = arrSchema.default(x); + + arrSchema = arrSchema.required(); + arrSchema = arrSchema.optional(); + arrSchema = arrSchema.forbidden(); + + arrSchema = arrSchema.description(str); + arrSchema = arrSchema.notes(str); + arrSchema = arrSchema.notes(strArr); + arrSchema = arrSchema.tags(str); + arrSchema = arrSchema.tags(strArr); + + arrSchema = arrSchema.meta(obj); + arrSchema = arrSchema.example(obj); + arrSchema = arrSchema.unit(str); + + arrSchema = arrSchema.options(validOpts); + arrSchema = arrSchema.strict(); + arrSchema = arrSchema.concat(x); + + altSchema = arrSchema.when(str, whenOpts); + altSchema = arrSchema.when(ref, whenOpts); +} + +// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- + +boolSchema = Joi.bool(); +boolSchema = Joi.boolean(); + +namespace common_copy_paste { + boolSchema = boolSchema.allow(x); + boolSchema = boolSchema.allow(x, x); + boolSchema = boolSchema.allow([x, x, x]); + boolSchema = boolSchema.valid(x); + boolSchema = boolSchema.valid(x, x); + boolSchema = boolSchema.valid([x, x, x]); + boolSchema = boolSchema.only(x); + boolSchema = boolSchema.only(x, x); + boolSchema = boolSchema.only([x, x, x]); + boolSchema = boolSchema.equal(x); + boolSchema = boolSchema.equal(x, x); + boolSchema = boolSchema.equal([x, x, x]); + boolSchema = boolSchema.invalid(x); + boolSchema = boolSchema.invalid(x, x); + boolSchema = boolSchema.invalid([x, x, x]); + boolSchema = boolSchema.disallow(x); + boolSchema = boolSchema.disallow(x, x); + boolSchema = boolSchema.disallow([x, x, x]); + boolSchema = boolSchema.not(x); + boolSchema = boolSchema.not(x, x); + boolSchema = boolSchema.not([x, x, x]); + + boolSchema = boolSchema.default(x); + + boolSchema = boolSchema.required(); + boolSchema = boolSchema.optional(); + boolSchema = boolSchema.forbidden(); + + boolSchema = boolSchema.description(str); + boolSchema = boolSchema.notes(str); + boolSchema = boolSchema.notes(strArr); + boolSchema = boolSchema.tags(str); + boolSchema = boolSchema.tags(strArr); + + boolSchema = boolSchema.meta(obj); + boolSchema = boolSchema.example(obj); + boolSchema = boolSchema.unit(str); + + boolSchema = boolSchema.options(validOpts); + boolSchema = boolSchema.strict(); + boolSchema = boolSchema.concat(x); + + altSchema = boolSchema.when(str, whenOpts); + altSchema = boolSchema.when(ref, whenOpts); +} + +// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- + +binSchema = Joi.binary(); + +binSchema = binSchema.encoding(str); +binSchema = binSchema.min(num); +binSchema = binSchema.max(num); +binSchema = binSchema.length(num); + +namespace common { + binSchema = binSchema.allow(x); + binSchema = binSchema.allow(x, x); + binSchema = binSchema.allow([x, x, x]); + binSchema = binSchema.valid(x); + binSchema = binSchema.valid(x, x); + binSchema = binSchema.valid([x, x, x]); + binSchema = binSchema.only(x); + binSchema = binSchema.only(x, x); + binSchema = binSchema.only([x, x, x]); + binSchema = binSchema.equal(x); + binSchema = binSchema.equal(x, x); + binSchema = binSchema.equal([x, x, x]); + binSchema = binSchema.invalid(x); + binSchema = binSchema.invalid(x, x); + binSchema = binSchema.invalid([x, x, x]); + binSchema = binSchema.disallow(x); + binSchema = binSchema.disallow(x, x); + binSchema = binSchema.disallow([x, x, x]); + binSchema = binSchema.not(x); + binSchema = binSchema.not(x, x); + binSchema = binSchema.not([x, x, x]); + + binSchema = binSchema.default(x); + + binSchema = binSchema.required(); + binSchema = binSchema.optional(); + binSchema = binSchema.forbidden(); + + binSchema = binSchema.description(str); + binSchema = binSchema.notes(str); + binSchema = binSchema.notes(strArr); + binSchema = binSchema.tags(str); + binSchema = binSchema.tags(strArr); + + binSchema = binSchema.meta(obj); + binSchema = binSchema.example(obj); + binSchema = binSchema.unit(str); + + binSchema = binSchema.options(validOpts); + binSchema = binSchema.strict(); + binSchema = binSchema.concat(x); + + altSchema = binSchema.when(str, whenOpts); + altSchema = binSchema.when(ref, whenOpts); +} + +// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- + +dateSchema = Joi.date(); + +dateSchema = dateSchema.min(date); +dateSchema = dateSchema.max(date); + +dateSchema = dateSchema.min(str); +dateSchema = dateSchema.max(str); + +dateSchema = dateSchema.min(num); +dateSchema = dateSchema.max(num); + +dateSchema = dateSchema.min(ref); +dateSchema = dateSchema.max(ref); + +dateSchema = dateSchema.format(str); +dateSchema = dateSchema.format(strArr); + +dateSchema = dateSchema.iso(); + +namespace common { + dateSchema = dateSchema.allow(x); + dateSchema = dateSchema.allow(x, x); + dateSchema = dateSchema.allow([x, x, x]); + dateSchema = dateSchema.valid(x); + dateSchema = dateSchema.valid(x, x); + dateSchema = dateSchema.valid([x, x, x]); + dateSchema = dateSchema.only(x); + dateSchema = dateSchema.only(x, x); + dateSchema = dateSchema.only([x, x, x]); + dateSchema = dateSchema.equal(x); + dateSchema = dateSchema.equal(x, x); + dateSchema = dateSchema.equal([x, x, x]); + dateSchema = dateSchema.invalid(x); + dateSchema = dateSchema.invalid(x, x); + dateSchema = dateSchema.invalid([x, x, x]); + dateSchema = dateSchema.disallow(x); + dateSchema = dateSchema.disallow(x, x); + dateSchema = dateSchema.disallow([x, x, x]); + dateSchema = dateSchema.not(x); + dateSchema = dateSchema.not(x, x); + dateSchema = dateSchema.not([x, x, x]); + + dateSchema = dateSchema.default(x); + + dateSchema = dateSchema.required(); + dateSchema = dateSchema.optional(); + dateSchema = dateSchema.forbidden(); + + dateSchema = dateSchema.description(str); + dateSchema = dateSchema.notes(str); + dateSchema = dateSchema.notes(strArr); + dateSchema = dateSchema.tags(str); + dateSchema = dateSchema.tags(strArr); + + dateSchema = dateSchema.meta(obj); + dateSchema = dateSchema.example(obj); + dateSchema = dateSchema.unit(str); + + dateSchema = dateSchema.options(validOpts); + dateSchema = dateSchema.strict(); + dateSchema = dateSchema.concat(x); + + altSchema = dateSchema.when(str, whenOpts); + altSchema = dateSchema.when(ref, whenOpts); +} + +// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- + +funcSchema = Joi.func(); + +// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- + +numSchema = Joi.number(); + +numSchema = numSchema.min(num); +numSchema = numSchema.min(ref); +numSchema = numSchema.max(num); +numSchema = numSchema.max(ref); +numSchema = numSchema.greater(num); +numSchema = numSchema.greater(ref); +numSchema = numSchema.less(num); +numSchema = numSchema.less(ref); +numSchema = numSchema.integer(); +numSchema = numSchema.precision(num); +numSchema = numSchema.multiple(num); +numSchema = numSchema.positive(); +numSchema = numSchema.negative(); + +namespace common { + numSchema = numSchema.allow(x); + numSchema = numSchema.allow(x, x); + numSchema = numSchema.allow([x, x, x]); + numSchema = numSchema.valid(x); + numSchema = numSchema.valid(x, x); + numSchema = numSchema.valid([x, x, x]); + numSchema = numSchema.only(x); + numSchema = numSchema.only(x, x); + numSchema = numSchema.only([x, x, x]); + numSchema = numSchema.equal(x); + numSchema = numSchema.equal(x, x); + numSchema = numSchema.equal([x, x, x]); + numSchema = numSchema.invalid(x); + numSchema = numSchema.invalid(x, x); + numSchema = numSchema.invalid([x, x, x]); + numSchema = numSchema.disallow(x); + numSchema = numSchema.disallow(x, x); + numSchema = numSchema.disallow([x, x, x]); + numSchema = numSchema.not(x); + numSchema = numSchema.not(x, x); + numSchema = numSchema.not([x, x, x]); + + numSchema = numSchema.default(x); + + numSchema = numSchema.required(); + numSchema = numSchema.optional(); + numSchema = numSchema.forbidden(); + + numSchema = numSchema.description(str); + numSchema = numSchema.notes(str); + numSchema = numSchema.notes(strArr); + numSchema = numSchema.tags(str); + numSchema = numSchema.tags(strArr); + + numSchema = numSchema.meta(obj); + numSchema = numSchema.example(obj); + numSchema = numSchema.unit(str); + + numSchema = numSchema.options(validOpts); + numSchema = numSchema.strict(); + numSchema = numSchema.concat(x); + + altSchema = numSchema.when(str, whenOpts); + altSchema = numSchema.when(ref, whenOpts); +} + +// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- + +objSchema = Joi.object(); +objSchema = Joi.object(schemaMap); + +objSchema = objSchema.keys(); +objSchema = objSchema.keys(schemaMap); + +objSchema = objSchema.min(num); +objSchema = objSchema.max(num); +objSchema = objSchema.length(num); + +objSchema = objSchema.pattern(exp, schema); + +objSchema = objSchema.and(str); +objSchema = objSchema.and(str, str); +objSchema = objSchema.and(str, str, str); +objSchema = objSchema.and(strArr); + +objSchema = objSchema.nand(str); +objSchema = objSchema.nand(str, str); +objSchema = objSchema.nand(str, str, str); +objSchema = objSchema.nand(strArr); + +objSchema = objSchema.or(str); +objSchema = objSchema.or(str, str); +objSchema = objSchema.or(str, str, str); +objSchema = objSchema.or(strArr); + +objSchema = objSchema.xor(str); +objSchema = objSchema.xor(str, str); +objSchema = objSchema.xor(str, str, str); +objSchema = objSchema.xor(strArr); + +objSchema = objSchema.with(str, str); +objSchema = objSchema.with(str, strArr); + +objSchema = objSchema.without(str, str); +objSchema = objSchema.without(str, strArr); + +objSchema = objSchema.rename(str, str); +objSchema = objSchema.rename(str, str, renOpts); + +objSchema = objSchema.assert(str, schema); +objSchema = objSchema.assert(str, schema, str); +objSchema = objSchema.assert(ref, schema); +objSchema = objSchema.assert(ref, schema, str); + +objSchema = objSchema.unknown(); +objSchema = objSchema.unknown(bool); + +objSchema = objSchema.type(func); +objSchema = objSchema.type(func, str); + +objSchema = objSchema.requiredKeys(str); +objSchema = objSchema.requiredKeys(str, str); +objSchema = objSchema.requiredKeys(strArr); + +objSchema = objSchema.optionalKeys(str); +objSchema = objSchema.optionalKeys(str, str); +objSchema = objSchema.optionalKeys(strArr); + +namespace common { + objSchema = objSchema.allow(x); + objSchema = objSchema.allow(x, x); + objSchema = objSchema.allow([x, x, x]); + objSchema = objSchema.valid(x); + objSchema = objSchema.valid(x, x); + objSchema = objSchema.valid([x, x, x]); + objSchema = objSchema.only(x); + objSchema = objSchema.only(x, x); + objSchema = objSchema.only([x, x, x]); + objSchema = objSchema.equal(x); + objSchema = objSchema.equal(x, x); + objSchema = objSchema.equal([x, x, x]); + objSchema = objSchema.invalid(x); + objSchema = objSchema.invalid(x, x); + objSchema = objSchema.invalid([x, x, x]); + objSchema = objSchema.disallow(x); + objSchema = objSchema.disallow(x, x); + objSchema = objSchema.disallow([x, x, x]); + objSchema = objSchema.not(x); + objSchema = objSchema.not(x, x); + objSchema = objSchema.not([x, x, x]); + + objSchema = objSchema.default(x); + + objSchema = objSchema.required(); + objSchema = objSchema.optional(); + objSchema = objSchema.forbidden(); + + objSchema = objSchema.description(str); + objSchema = objSchema.notes(str); + objSchema = objSchema.notes(strArr); + objSchema = objSchema.tags(str); + objSchema = objSchema.tags(strArr); + + objSchema = objSchema.meta(obj); + objSchema = objSchema.example(obj); + objSchema = objSchema.unit(str); + + objSchema = objSchema.options(validOpts); + objSchema = objSchema.strict(); + objSchema = objSchema.concat(x); + + altSchema = objSchema.when(str, whenOpts); + altSchema = objSchema.when(ref, whenOpts); +} + +// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- + +strSchema = Joi.string(); + +strSchema = strSchema.insensitive(); +strSchema = strSchema.min(num); +strSchema = strSchema.min(num, str); +strSchema = strSchema.min(ref); +strSchema = strSchema.min(ref, str); +strSchema = strSchema.max(num); +strSchema = strSchema.max(num, str); +strSchema = strSchema.max(ref); +strSchema = strSchema.max(ref, str); +strSchema = strSchema.creditCard(); +strSchema = strSchema.length(num); +strSchema = strSchema.length(num, str); +strSchema = strSchema.length(ref); +strSchema = strSchema.length(ref, str); +strSchema = strSchema.regex(exp); +strSchema = strSchema.regex(exp, str); +strSchema = strSchema.replace(exp, str); +strSchema = strSchema.replace(str, str); +strSchema = strSchema.alphanum(); +strSchema = strSchema.token(); +strSchema = strSchema.email(); +strSchema = strSchema.email(emailOpts); +strSchema = strSchema.ip(); +strSchema = strSchema.ip(ipOpts); +strSchema = strSchema.uri(); +strSchema = strSchema.uri(uriOpts); +strSchema = strSchema.guid(); +strSchema = strSchema.hex(); +strSchema = strSchema.hostname(); +strSchema = strSchema.isoDate(); +strSchema = strSchema.lowercase(); +strSchema = strSchema.uppercase(); +strSchema = strSchema.trim(); + +namespace common { + strSchema = strSchema.allow(x); + strSchema = strSchema.allow(x, x); + strSchema = strSchema.allow([x, x, x]); + strSchema = strSchema.valid(x); + strSchema = strSchema.valid(x, x); + strSchema = strSchema.valid([x, x, x]); + strSchema = strSchema.only(x); + strSchema = strSchema.only(x, x); + strSchema = strSchema.only([x, x, x]); + strSchema = strSchema.equal(x); + strSchema = strSchema.equal(x, x); + strSchema = strSchema.equal([x, x, x]); + strSchema = strSchema.invalid(x); + strSchema = strSchema.invalid(x, x); + strSchema = strSchema.invalid([x, x, x]); + strSchema = strSchema.disallow(x); + strSchema = strSchema.disallow(x, x); + strSchema = strSchema.disallow([x, x, x]); + strSchema = strSchema.not(x); + strSchema = strSchema.not(x, x); + strSchema = strSchema.not([x, x, x]); + + strSchema = strSchema.default(x); + + strSchema = strSchema.required(); + strSchema = strSchema.optional(); + strSchema = strSchema.forbidden(); + + strSchema = strSchema.description(str); + strSchema = strSchema.notes(str); + strSchema = strSchema.notes(strArr); + strSchema = strSchema.tags(str); + strSchema = strSchema.tags(strArr); + + strSchema = strSchema.meta(obj); + strSchema = strSchema.example(obj); + strSchema = strSchema.unit(str); + + strSchema = strSchema.options(validOpts); + strSchema = strSchema.strict(); + strSchema = strSchema.concat(x); + + altSchema = strSchema.when(str, whenOpts); + altSchema = strSchema.when(ref, whenOpts); +} + +// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- + +schema = Joi.alternatives(schemaArr); +schema = Joi.alternatives(schema, anySchema, boolSchema); + +// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- + +Joi.validate(value, obj); +Joi.validate(value, schema); +Joi.validate(value, schema, validOpts); +Joi.validate(value, schema, validOpts, (err, value) => { + x = value; + str = err.message; + str = err.details[0].path; + str = err.details[0].message; + str = err.details[0].type; +}); +Joi.validate(value, schema, (err, value) => { + x = value; + str = err.message; + str = err.details[0].path; + str = err.details[0].message; + str = err.details[0].type; +}); +// variant +Joi.validate(num, schema, validOpts, (err, value) => { + num = value; +}); + +// plain opts +Joi.validate(value, {}); + +// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- + +schema = Joi.compile(obj); + +Joi.assert(obj, schema); +Joi.assert(obj, schema, str); +Joi.assert(obj, schema, err); + +ref = Joi.ref(str, refOpts); +ref = Joi.ref(str); diff --git a/joi/joi-6.5.0.d.ts b/joi/joi-6.5.0.d.ts new file mode 100644 index 0000000000..d9ee7c20d1 --- /dev/null +++ b/joi/joi-6.5.0.d.ts @@ -0,0 +1,778 @@ +// Type definitions for joi v6.5.0 +// Project: https://github.com/spumko/joi +// Definitions by: Bart van der Schoor , Laurence Dougal Myers , Christopher Glantschnig , David Broder-Rodgers +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +// TODO express type of Schema in a type-parameter (.default, .valid, .example etc) + +declare module 'joi' { + + export interface ValidationOptions { + /** + * when true, stops validation on the first error, otherwise returns all the errors found. Defaults to true. + */ + abortEarly?: boolean; + /** + * when true, attempts to cast values to the required types (e.g. a string to a number). Defaults to true. + */ + convert?: boolean; + /** + * when true, allows object to contain unknown keys which are ignored. Defaults to false. + */ + allowUnknown?: boolean; + /** + * when true, ignores unknown keys with a function value. Defaults to false. + */ + skipFunctions?: boolean; + /** + * when true, unknown keys are deleted (only when value is an object). Defaults to false. + */ + stripUnknown?: boolean; + /** + * overrides individual error messages. Defaults to no override ({}). + */ + language?: Object; + /** + * sets the default presence requirements. Supported modes: 'optional', 'required', and 'forbidden'. Defaults to 'optional'. + */ + presence?: string; + /** + * provides an external data set to be used in references + */ + context?: Object; + } + + export interface RenameOptions { + /** + * if true, does not delete the old key name, keeping both the new and old keys in place. Defaults to false. + */ + alias?: boolean; + /** + * if true, allows renaming multiple keys to the same destination where the last rename wins. Defaults to false. + */ + multiple?: boolean; + /** + * if true, allows renaming a key over an existing key. Defaults to false. + */ + override?: boolean; + /** + * if true, skip renaming of a key if it's undefined. Defaults to false. + */ + ignoreUndefined?: boolean; + } + + export interface EmailOptions { + /** + * Numerical threshold at which an email address is considered invalid + */ + errorLevel?: number | boolean; + /** + * Specifies a list of acceptable TLDs. + */ + tldWhitelist?: string[] | Object; + /** + * Number of atoms required for the domain. Be careful since some domains, such as io, directly allow email. + */ + minDomainAtoms?: number; + } + + export interface IpOptions { + /** + * One or more IP address versions to validate against. Valid values: ipv4, ipv6, ipvfuture + */ + version ?: string | string[]; + /** + * Used to determine if a CIDR is allowed or not. Valid values: optional, required, forbidden + */ + cidr?: string; + } + + export interface UriOptions { + /** + * Specifies one or more acceptable Schemes, should only include the scheme name. + * Can be an Array or String (strings are automatically escaped for use in a Regular Expression). + */ + scheme ?: string | RegExp | Array; + } + + export interface WhenOptions { + /** + * the required condition joi type. + */ + is: T; + /** + * the alternative schema type if the condition is true. Required if otherwise is missing. + */ + then?: Schema; + /** + * the alternative schema type if the condition is false. Required if then is missing + */ + otherwise?: Schema; + } + + export interface ReferenceOptions { + separator?: string; + contextPrefix?: string; + } + + export interface IPOptions { + version?: Array; + cidr?: string + } + + export interface ValidationError extends Error { + message: string; + details: ValidationErrorItem[]; + simple(): string; + annotated(): string; + } + + export interface ValidationErrorItem { + message: string; + type: string; + path: string; + options?: ValidationOptions; + } + + export interface ValidationResult { + error: ValidationError; + value: T; + } + + export interface SchemaMap { + [key: string]: Schema; + } + + export interface Schema extends AnySchema { + + } + + export interface Reference extends Schema { + + } + + export interface AnySchema> { + /** + * Whitelists a value + */ + allow(value: any, ...values: any[]): T; + allow(values: any[]): T; + + /** + * Adds the provided values into the allowed whitelist and marks them as the only valid values allowed. + */ + valid(value: any, ...values: any[]): T; + valid(values: any[]): T; + only(value: any, ...values : any[]): T; + only(values: any[]): T; + equal(value: any, ...values : any[]): T; + equal(values: any[]): T; + + /** + * Blacklists a value + */ + invalid(value: any, ...values: any[]): T; + invalid(values: any[]): T; + disallow(value: any, ...values : any[]): T; + disallow(values: any[]): T; + not(value: any, ...values : any[]): T; + not(values: any[]): T; + + /** + * Marks a key as required which will not allow undefined as value. All keys are optional by default. + */ + required(): T; + + /** + * Marks a key as optional which will allow undefined as values. Used to annotate the schema for readability as all keys are optional by default. + */ + optional(): T; + + /** + * Marks a key as forbidden which will not allow any value except undefined. Used to explicitly forbid keys. + */ + forbidden(): T; + + /** + * Marks a key to be removed from a resulting object or array after validation. Used to sanitize output. + */ + strip(): T; + + /** + * Annotates the key + */ + description(desc: string): T; + + /** + * Annotates the key + */ + notes(notes: string): T; + notes(notes: string[]): T; + + /** + * Annotates the key + */ + tags(notes: string): T; + tags(notes: string[]): T; + + /** + * Attaches metadata to the key. + */ + meta(meta: Object): T; + + /** + * Annotates the key with an example value, must be valid. + */ + example(value: any): T; + + /** + * Annotates the key with an unit name. + */ + unit(name: string): T; + + /** + * Overrides the global validate() options for the current key and any sub-key. + */ + options(options: ValidationOptions): T; + + /** + * Sets the options.convert options to false which prevent type casting for the current key and any child keys. + */ + strict(isStrict?: boolean): T; + + /** + * Sets a default value if the original value is undefined. + * @param value - the value. + * value supports references. + * value may also be a function which returns the default value. + * If value is specified as a function that accepts a single parameter, that parameter will be a context + * object that can be used to derive the resulting value. This clones the object however, which incurs some + * overhead so if you don't need access to the context define your method so that it does not accept any + * parameters. + * Without any value, default has no effect, except for object that will then create nested defaults + * (applying inner defaults of that object). + * + * Note that if value is an object, any changes to the object after default() is called will change the + * reference and any future assignment. + * + * Additionally, when specifying a method you must either have a description property on your method or the + * second parameter is required. + */ + default(value: any, description?: string): T; + default(): T; + + /** + * Returns a new type that is the result of adding the rules of one type to another. + */ + concat(schema: T): T; + + /** + * Converts the type into an alternatives type where the conditions are merged into the type definition where: + */ + when(ref: string, options: WhenOptions): AlternativesSchema; + when(ref: Reference, options: WhenOptions): AlternativesSchema; + + /** + * Overrides the key name in error messages. + */ + label(name: string): T; + + /** + * Outputs the original untouched value instead of the casted value. + */ + raw(isRaw?: boolean): T; + + /** + * Considers anything that matches the schema to be empty (undefined). + * @param schema - any object or joi schema to match. An undefined schema unsets that rule. + */ + empty(schema?: any) : T; + } + + export interface BooleanSchema extends AnySchema { + + } + + export interface NumberSchema extends AnySchema { + /** + * Specifies the minimum value. + * It can also be a reference to another field. + */ + min(limit: number): NumberSchema; + min(limit: Reference): NumberSchema; + + /** + * Specifies the maximum value. + * It can also be a reference to another field. + */ + max(limit: number): NumberSchema; + max(limit: Reference): NumberSchema; + + /** + * Specifies that the value must be greater than limit. + * It can also be a reference to another field. + */ + greater(limit: number): NumberSchema; + greater(limit: Reference): NumberSchema; + + /** + * Specifies that the value must be less than limit. + * It can also be a reference to another field. + */ + less(limit: number): NumberSchema; + less(limit: Reference): NumberSchema; + + /** + * Requires the number to be an integer (no floating point). + */ + integer(): NumberSchema; + + /** + * Specifies the maximum number of decimal places where: + * limit - the maximum number of decimal places allowed. + */ + precision(limit: number): NumberSchema; + + /** + * Specifies that the value must be a multiple of base. + */ + multiple(base: number): NumberSchema; + + /** + * Requires the number to be positive. + */ + positive(): NumberSchema; + + /** + * Requires the number to be negative. + */ + negative(): NumberSchema; + } + + export interface StringSchema extends AnySchema { + /** + * Allows the value to match any whitelist of blacklist item in a case insensitive comparison. + */ + insensitive(): StringSchema; + + /** + * Specifies the minimum number string characters. + * @param limit - the minimum number of string characters required. It can also be a reference to another field. + * @param encoding - if specified, the string length is calculated in bytes using the provided encoding. + */ + min(limit: number, encoding?: string): StringSchema; + min(limit: Reference, encoding?: string): StringSchema; + + /** + * Specifies the maximum number of string characters. + * @param limit - the maximum number of string characters allowed. It can also be a reference to another field. + * @param encoding - if specified, the string length is calculated in bytes using the provided encoding. + */ + max(limit: number, encoding?: string): StringSchema; + max(limit: Reference, encoding?: string): StringSchema; + + /** + * Requires the number to be a credit card number (Using Lunh Algorithm). + */ + creditCard(): StringSchema; + + /** + * Specifies the exact string length required + * @param limit - the required string length. It can also be a reference to another field. + * @param encoding - if specified, the string length is calculated in bytes using the provided encoding. + */ + length(limit: number, encoding?: string): StringSchema; + length(limit: Reference, encoding?: string): StringSchema; + + /** + * Defines a regular expression rule. + * @param pattern - a regular expression object the string value must match against. + * @param name - optional name for patterns (useful with multiple patterns). Defaults to 'required'. + */ + regex(pattern: RegExp, name?: string): StringSchema; + + /** + * Replace characters matching the given pattern with the specified replacement string where: + * @param pattern - a regular expression object to match against, or a string of which all occurrences will be replaced. + * @param replacement - the string that will replace the pattern. + */ + replace(pattern: RegExp, replacement: string): StringSchema; + replace(pattern: string, replacement: string): StringSchema; + + /** + * Requires the string value to only contain a-z, A-Z, and 0-9. + */ + alphanum(): StringSchema; + + /** + * Requires the string value to only contain a-z, A-Z, 0-9, and underscore _. + */ + token(): StringSchema; + + /** + * Requires the string value to be a valid email address. + */ + email(options?: EmailOptions): StringSchema; + + /** + * Requires the string value to be a valid ip address. + */ + ip(options?: IpOptions): StringSchema; + + /** + * Requires the string value to be a valid RFC 3986 URI. + */ + uri(options?: UriOptions): StringSchema; + + /** + * Requires the string value to be a valid GUID. + */ + guid(): StringSchema; + + /** + * Requires the string value to be a valid hexadecimal string. + */ + hex(): StringSchema; + + /** + * Requires the string value to be a valid hostname as per RFC1123. + */ + hostname(): StringSchema; + + /** + * Requires the string value to be in valid ISO 8601 date format. + */ + isoDate(): StringSchema; + + /** + * Requires the string value to be all lowercase. If the validation convert option is on (enabled by default), the string will be forced to lowercase. + */ + lowercase(): StringSchema; + + /** + * Requires the string value to be all uppercase. If the validation convert option is on (enabled by default), the string will be forced to uppercase. + */ + uppercase(): StringSchema; + + /** + * Requires the string value to contain no whitespace before or after. If the validation convert option is on (enabled by default), the string will be trimmed. + */ + trim(): StringSchema; + } + + export interface ArraySchema extends AnySchema { + /** + * Allow this array to be sparse. + * enabled can be used with a falsy value to go back to the default behavior. + */ + sparse(enabled?: any): ArraySchema; + + /** + * Allow single values to be checked against rules as if it were provided as an array. + * enabled can be used with a falsy value to go back to the default behavior. + */ + single(enabled?: any): ArraySchema; + + /** + * List the types allowed for the array values. + * type can be an array of values, or multiple values can be passed as individual arguments. + * If a given type is .required() then there must be a matching item in the array. + * If a type is .forbidden() then it cannot appear in the array. + * Required items can be added multiple times to signify that multiple items must be found. + * Errors will contain the number of items that didn't match. + * Any unmatched item having a label will be mentioned explicitly. + * + * @param type - a joi schema object to validate each array item against. + */ + items(type: Schema, ...types: Schema[]): ArraySchema; + items(types: Schema[]): ArraySchema; + + /** + * Specifies the minimum number of items in the array. + */ + min(limit: number): ArraySchema; + + /** + * Specifies the maximum number of items in the array. + */ + max(limit: number): ArraySchema; + + /** + * Specifies the exact number of items in the array. + */ + length(limit: number): ArraySchema; + + /** + * Requires the array values to be unique. + * Be aware that a deep equality is performed on elements of the array having a type of object, + * a performance penalty is to be expected for this kind of operation. + */ + unique(): ArraySchema; + } + + export interface ObjectSchema extends AnySchema { + /** + * Sets the allowed object keys. + */ + keys(schema?: SchemaMap): ObjectSchema; + + /** + * Specifies the minimum number of keys in the object. + */ + min(limit: number): ObjectSchema; + + /** + * Specifies the maximum number of keys in the object. + */ + max(limit: number): ObjectSchema; + + /** + * Specifies the exact number of keys in the object. + */ + length(limit: number): ObjectSchema; + + /** + * Specify validation rules for unknown keys matching a pattern. + */ + pattern(regex: RegExp, schema: Schema): ObjectSchema; + + /** + * Defines an all-or-nothing relationship between keys where if one of the peers is present, all of them are required as well. + * @param peers - the key names of which if one present, all are required. peers can be a single string value, + * an array of string values, or each peer provided as an argument. + */ + and(peer1: string, ...peers: string[]): ObjectSchema; + and(peers: string[]): ObjectSchema; + + /** + * Defines a relationship between keys where not all peers can be present at the same time. + * @param peers - the key names of which if one present, the others may not all be present. + * peers can be a single string value, an array of string values, or each peer provided as an argument. + */ + nand(peer1: string, ...peers: string[]): ObjectSchema; + nand(peers: string[]): ObjectSchema; + + /** + * Defines a relationship between keys where one of the peers is required (and more than one is allowed). + */ + or(peer1: string, ...peers: string[]): ObjectSchema; + or(peers: string[]): ObjectSchema; + + /** + * Defines an exclusive relationship between a set of keys. one of them is required but not at the same time where: + */ + xor(peer1: string, ...peers: string[]): ObjectSchema; + xor(peers: string[]): ObjectSchema; + + /** + * Requires the presence of other keys whenever the specified key is present. + */ + with(key: string, peers: string): ObjectSchema; + with(key: string, peers: string[]): ObjectSchema; + + /** + * Forbids the presence of other keys whenever the specified is present. + */ + without(key: string, peers: string): ObjectSchema; + without(key: string, peers: string[]): ObjectSchema; + + /** + * Renames a key to another name (deletes the renamed key). + */ + rename(from: string, to: string, options?: RenameOptions): ObjectSchema; + + /** + * Verifies an assertion where. + */ + assert(ref: string, schema: Schema, message?: string): ObjectSchema; + assert(ref: Reference, schema: Schema, message?: string): ObjectSchema; + + /** + * Overrides the handling of unknown keys for the scope of the current object only (does not apply to children). + */ + unknown(allow?: boolean): ObjectSchema; + + /** + * Requires the object to be an instance of a given constructor. + * + * @param constructor - the constructor function that the object must be an instance of. + * @param name - an alternate name to use in validation errors. This is useful when the constructor function does not have a name. + */ + type(constructor: Function, name?: string): ObjectSchema; + + /** + * Sets the specified children to required. + * + * @param children - can be a single string value, an array of string values, or each child provided as an argument. + * + * var schema = Joi.object().keys({ a: { b: Joi.number() }, c: { d: Joi.string() } }); + * var requiredSchema = schema.requiredKeys('', 'a.b', 'c', 'c.d'); + * + * Note that in this example '' means the current object, a is not required but b is, as well as c and d. + */ + requiredKeys(children: string): ObjectSchema; + requiredKeys(children: string[]): ObjectSchema; + requiredKeys(child:string, ...children: string[]): ObjectSchema; + + /** + * Sets the specified children to optional. + * + * @param children - can be a single string value, an array of string values, or each child provided as an argument. + * + * The behavior is exactly the same as requiredKeys. + */ + optionalKeys(children: string): ObjectSchema; + optionalKeys(children: string[]): ObjectSchema; + optionalKeys(child:string, ...children: string[]): ObjectSchema; + } + + export interface BinarySchema extends AnySchema { + /** + * Sets the string encoding format if a string input is converted to a buffer. + */ + encoding(encoding: string): BinarySchema; + + /** + * Specifies the minimum length of the buffer. + */ + min(limit: number): BinarySchema; + + /** + * Specifies the maximum length of the buffer. + */ + max(limit: number): BinarySchema; + + /** + * Specifies the exact length of the buffer: + */ + length(limit: number): BinarySchema; + } + + export interface DateSchema extends AnySchema { + + /** + * Specifies the oldest date allowed. + * Notes: 'now' can be passed in lieu of date so as to always compare relatively to the current date, + * allowing to explicitly ensure a date is either in the past or in the future. + * It can also be a reference to another field. + */ + min(date: Date): DateSchema; + min(date: number): DateSchema; + min(date: string): DateSchema; + min(date: Reference): DateSchema; + + /** + * Specifies the latest date allowed. + * Notes: 'now' can be passed in lieu of date so as to always compare relatively to the current date, + * allowing to explicitly ensure a date is either in the past or in the future. + * It can also be a reference to another field. + */ + max(date: Date): DateSchema; + max(date: number): DateSchema; + max(date: string): DateSchema; + max(date: Reference): DateSchema; + + /** + * Specifies the allowed date format: + * @param format - string or array of strings that follow the moment.js format. + */ + format(format: string): DateSchema; + format(format: string[]): DateSchema; + + /** + * Requires the string value to be in valid ISO 8601 date format. + */ + iso(): DateSchema; + } + + export interface FunctionSchema extends AnySchema { + + } + + export interface AlternativesSchema extends AnySchema { + try(schemas: Schema[]): AlternativesSchema; + when(ref: string, options: WhenOptions): AlternativesSchema; + when(ref: Reference, options: WhenOptions): AlternativesSchema; + } + + // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- + + /** + * Generates a schema object that matches any data type. + */ + export function any(): Schema; + + /** + * Generates a schema object that matches an array data type. + */ + export function array(): ArraySchema; + + /** + * Generates a schema object that matches a boolean data type (as well as the strings 'true', 'false', 'yes', and 'no'). Can also be called via bool(). + */ + export function bool(): BooleanSchema; + + export function boolean(): BooleanSchema; + + /** + * Generates a schema object that matches a Buffer data type (as well as the strings which will be converted to Buffers). + */ + export function binary(): BinarySchema; + + /** + * Generates a schema object that matches a date type (as well as a JavaScript date string or number of milliseconds). + */ + export function date(): DateSchema; + + /** + * Generates a schema object that matches a function type. + */ + export function func(): FunctionSchema; + + /** + * Generates a schema object that matches a number data type (as well as strings that can be converted to numbers). + */ + export function number(): NumberSchema; + + /** + * Generates a schema object that matches an object data type (as well as JSON strings that parsed into objects). + */ + export function object(schema?: SchemaMap): ObjectSchema; + + /** + * Generates a schema object that matches a string data type. Note that empty strings are not allowed by default and must be enabled with allow(''). + */ + export function string(): StringSchema; + + /** + * Generates a type that will match one of the provided alternative schemas + */ + export function alternatives(types: Schema[]): Schema; + export function alternatives(type1: Schema, type2: Schema, ...types: Schema[]): Schema; + + /** + * Validates a value using the given schema and options. + */ + export function validate(value: T, schema: Schema, callback: (err: ValidationError, value: T) => void): void; + export function validate(value: T, schema: Object, callback: (err: ValidationError, value: T) => void): void; + export function validate(value: T, schema: Object, options?: ValidationOptions, callback?: (err: ValidationError, value: T) => void): ValidationResult; + + /** + * Converts literal schema definition to joi schema object (or returns the same back if already a joi schema object). + */ + export function compile(schema: Object): Schema; + + /** + * Validates a value against a schema and throws if validation fails. + * + * @param value - the value to validate. + * @param schema - the schema object. + * @param message - optional message string prefix added in front of the error message. may also be an Error object. + */ + export function assert(value: any, schema: Schema, message?: string | Error): void; + + /** + * Generates a reference to the value of the named key. + */ + export function ref(key: string, options?: ReferenceOptions): Reference; +} diff --git a/joi/joi-tests.ts b/joi/joi-tests.ts index a00543fe4e..e5bda7874c 100644 --- a/joi/joi-tests.ts +++ b/joi/joi-tests.ts @@ -231,16 +231,18 @@ arrSchema = arrSchema.sparse(); arrSchema = arrSchema.sparse(bool); arrSchema = arrSchema.single(); arrSchema = arrSchema.single(bool); +arrSchema = arrSchema.ordered(anySchema); +arrSchema = arrSchema.ordered(anySchema, numSchema, strSchema, arrSchema, boolSchema, binSchema, dateSchema, funcSchema, objSchema); arrSchema = arrSchema.min(num); arrSchema = arrSchema.max(num); arrSchema = arrSchema.length(num); arrSchema = arrSchema.unique(); + arrSchema = arrSchema.items(numSchema); arrSchema = arrSchema.items(numSchema, strSchema); arrSchema = arrSchema.items([numSchema, strSchema]); - // - - - - - - - - namespace common_copy_paste { @@ -420,6 +422,10 @@ dateSchema = dateSchema.format(strArr); dateSchema = dateSchema.iso(); +dateSchema = dateSchema.timestamp(); +dateSchema = dateSchema.timestamp('javascript'); +dateSchema = dateSchema.timestamp('unix'); + namespace common { dateSchema = dateSchema.allow(x); dateSchema = dateSchema.allow(x, x); @@ -471,6 +477,11 @@ namespace common { funcSchema = Joi.func(); +funcSchema = funcSchema.arity(num); +funcSchema = funcSchema.minArity(num); +funcSchema = funcSchema.maxArity(num); +funcSchema = funcSchema.ref(); + // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- numSchema = Joi.number(); @@ -770,5 +781,15 @@ Joi.assert(obj, schema); Joi.assert(obj, schema, str); Joi.assert(obj, schema, err); +Joi.attempt(obj, schema); +Joi.attempt(obj, schema, str); +Joi.attempt(obj, schema, err); + ref = Joi.ref(str, refOpts); ref = Joi.ref(str); + +Joi.isRef(ref); + +schema = Joi.reach(schema, ''); + +const Joi2 = Joi.extend({ name: '', base: schema }); diff --git a/joi/joi.d.ts b/joi/joi.d.ts index d9ee7c20d1..0153009dc2 100644 --- a/joi/joi.d.ts +++ b/joi/joi.d.ts @@ -1,6 +1,6 @@ -// Type definitions for joi v6.5.0 -// Project: https://github.com/spumko/joi -// Definitions by: Bart van der Schoor , Laurence Dougal Myers , Christopher Glantschnig , David Broder-Rodgers +// Type definitions for joi v9.0.0 +// Project: https://github.com/hapijs/joi +// Definitions by: Bart van der Schoor , Laurence Dougal Myers , Christopher Glantschnig , David Broder-Rodgers , Gael Magnan de Bornier // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TODO express type of Schema in a type-parameter (.default, .valid, .example etc) @@ -487,6 +487,13 @@ declare module 'joi' { items(type: Schema, ...types: Schema[]): ArraySchema; items(types: Schema[]): ArraySchema; + /** + * Lists the types in sequence order for the array values where: + * @param type - a joi schema object to validate against each array item in sequence order. type can be an array of values, or multiple values can be passed as individual arguments. + * If a given type is .required() then there must be a matching item with the same index position in the array. Errors will contain the number of items that didn't match. Any unmatched item having a label will be mentioned explicitly. + */ + ordered(type: Schema, ...types: Schema[]): ArraySchema; + /** * Specifies the minimum number of items in the array. */ @@ -683,10 +690,41 @@ declare module 'joi' { * Requires the string value to be in valid ISO 8601 date format. */ iso(): DateSchema; + + + /** + * Requires the value to be a timestamp interval from Unix Time. + * @param type - the type of timestamp (allowed values are unix or javascript [default]) + */ + timestamp(type?: 'javascript' | 'unix'): DateSchema; } export interface FunctionSchema extends AnySchema { + /** + * Specifies the arity of the function where: + * @param n - the arity expected. + */ + arity(n: number): FunctionSchema; + + + /** + * Specifies the minimal arity of the function where: + * @param n - the minimal arity expected. + */ + minArity(n: number): FunctionSchema; + + + /** + * Specifies the minimal arity of the function where: + * @param n - the minimal arity expected. + */ + maxArity(n: number): FunctionSchema; + + /** + * Requires the function to be a Joi reference. + */ + ref(): FunctionSchema; } export interface AlternativesSchema extends AnySchema { @@ -695,6 +733,33 @@ declare module 'joi' { when(ref: Reference, options: WhenOptions): AlternativesSchema; } + export interface Terms { + value: any; + state: { + key: string, + path: string, + parent: any + }; + options: ValidationOptions; + } + + export interface Rules { + name: string; + params?: ObjectSchema | { [key: string]: Schema }; + setup?: Function; + validate?: Function; + description: string | Function; + } + + export interface Extension { + name: string; + base?: Schema; + pre?: Function; + language?: {}; + describe?: Function; + rules?: Rules[]; + } + // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- /** @@ -771,8 +836,38 @@ declare module 'joi' { */ export function assert(value: any, schema: Schema, message?: string | Error): void; + + /** + * Validates a value against a schema, returns valid object, and throws if validation fails where: + * + * @param value - the value to validate. + * @param schema - the schema object. + * @param message - optional message string prefix added in front of the error message. may also be an Error object. + */ + export function attempt(value: any, schema: Schema, message?: string | Error): void; + + /** * Generates a reference to the value of the named key. */ export function ref(key: string, options?: ReferenceOptions): Reference; + + + /** + * Checks whether or not the provided argument is a reference. It's especially useful if you want to post-process error messages. + */ + export function isRef(ref: any): boolean; + + + /** + * Get a sub-schema of an existing schema based on a path. Path separator is a dot (.). + */ + export function reach(schema: Schema, path: string): Schema; + + + /** + * Creates a new Joi instance customized with the extension(s) you provide included. + */ + export function extend(extention: Extension): any; + } diff --git a/jquery-backstretch/jquery-backstretch-tests.ts b/jquery-backstretch/jquery-backstretch-tests.ts new file mode 100644 index 0000000000..b658c6aaeb --- /dev/null +++ b/jquery-backstretch/jquery-backstretch-tests.ts @@ -0,0 +1,19 @@ +/// +/// + +var backstretch = jQuery.backstretch(['image.png'], { + centeredX: false, + centeredY: false, + duration: 'normal', + fade: 1000 +}); + +backstretch.next(); +backstretch.prev(); +backstretch.pause(); +backstretch.resize(); +backstretch.resume(); +backstretch.destroy(true); + +jQuery('body').backstretch(['image.png']).pause(); +jQuery('body').backstretch('resume'); diff --git a/jquery-backstretch/jquery-backstretch.d.ts b/jquery-backstretch/jquery-backstretch.d.ts new file mode 100644 index 0000000000..5c951beeee --- /dev/null +++ b/jquery-backstretch/jquery-backstretch.d.ts @@ -0,0 +1,92 @@ +// Type definitions for backstretch v 2.0.4 +// Project: https://github.com/srobbin/jquery-backstretch +// Definitions by: Dmytro Kulyk +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare namespace JQueryBackStretch { + + interface BackStretchOptions { + /** + * The ratio of the width/height of the image doesn't always jive with the + * width/height of the window. This parameter controls whether or not we + * center the image on the X axis to account for the discrepancy. + */ + centeredX?:boolean; + + /** + * This parameter controls whether or not we center the image on the Y axis + * to account for the aforementioned discrepancy. + */ + centeredY?:boolean; + + /** + * This is the speed at which the image will fade in. Integers in + * milliseconds are accepted, as well as standard jQuery speed strings + * (slow, normal, fast). + */ + duration?:number | string; + + /** + * The amount of time in between slides, when using Backstretch as a + * slideshow, expressed as the number of milliseconds. + */ + fade?:number; + } + + interface BackStretch { + /** + * This method is called automatically when the container (window or + * block-level element) is resized, however you can always call this + * manually if needed. + */ + resize():BackStretch; + + /** + * Jump to the slide at a given index, where n is the number of the + * image that you'd like to display. Slide number starts at 0. + * + * @param {number} newIndex + */ + show(newIndex:number):BackStretch; + + /** + * Advance to the next image in a slideshow. + */ + next():BackStretch; + + /** + * Display the previous image in a slideshow. + */ + prev():BackStretch; + + /** + * Pause the slideshow. + */ + pause():BackStretch; + + /** + * Resume a paused slideshow. + */ + resume():BackStretch; + + /** + * Destroy the Backstretch instance. Optionally, you can pass in a Boolean + * parameter, preserveBackground, to determine whether or not you'd like + * to keep the current image stretched as the background image. + * + * @param {boolean} preserveBackground + */ + destroy(preserveBackground?:boolean):void; + } +} + +interface JQueryStatic { + backstretch(images:string[], config?:JQueryBackStretch.BackStretchOptions):JQueryBackStretch.BackStretch; +} + +interface JQuery { + backstretch(images:string[], config?:JQueryBackStretch.BackStretchOptions):JQueryBackStretch.BackStretch; + backstretch(method:string):JQuery; +} \ No newline at end of file diff --git a/jquery-mousewheel/jquery-mousewheel-tests.ts b/jquery-mousewheel/jquery-mousewheel-tests.ts new file mode 100644 index 0000000000..7f8807d7bb --- /dev/null +++ b/jquery-mousewheel/jquery-mousewheel-tests.ts @@ -0,0 +1,11 @@ +/// + +$('#my_elem').on('mousewheel', (event: JQueryMousewheel.JQueryMousewheelEventObject) => { + console.log(event.deltaX, event.deltaY, event.deltaFactor, event.deltaMode, event.absDelta); +}); + +$('#my_elem').mousewheel(event => { + console.log(event.deltaX, event.deltaY, event.deltaFactor, event.deltaMode, event.absDelta); +}); + +$('#my_elem').unmousewheel(); diff --git a/jquery-mousewheel/jquery-mousewheel.d.ts b/jquery-mousewheel/jquery-mousewheel.d.ts new file mode 100644 index 0000000000..1061e49f28 --- /dev/null +++ b/jquery-mousewheel/jquery-mousewheel.d.ts @@ -0,0 +1,21 @@ +// Type definitions for jquery-mousewheel v3.1.13 +// Project: https://github.com/jquery/jquery-mousewheel +// Definitions by: Brian Surowiec +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare namespace JQueryMousewheel { + interface JQueryMousewheelEventObject extends JQueryEventObject { + deltaX: number; + deltaY: number; + deltaFactor: number; + deltaMode: number; + absDelta: number; + } +} + +interface JQuery { + mousewheel(handler: (eventObject: JQueryMousewheel.JQueryMousewheelEventObject, ...args: any[]) => any): JQuery + unmousewheel(): JQuery; +} diff --git a/jquery-steps/jquery-steps-tests.ts b/jquery-steps/jquery-steps-tests.ts new file mode 100644 index 0000000000..e0125a3c0f --- /dev/null +++ b/jquery-steps/jquery-steps-tests.ts @@ -0,0 +1,101 @@ +/// +/// + +var labels: JQuerySteps.LabelSettings = { + cancel: 'Cancel', + current: 'Current:', + pagination: 'Paging', + finish: 'Done', + next: 'Next >', + previous: '< Previous', + loading: 'Loading...' +} + +var onStepChangingFunc: JQuerySteps.FunctionOnStepChanging = (event, currentIndex, newIndex): boolean => true; + +var onStepChangedFunc: JQuerySteps.FunctionOnStepChanged = (event, currentIndex, priorIndex) => {}; + +var onCancelledFunc: JQuerySteps.FunctionOnCancelled = (event) => {}; + +var onFinishingFunc: JQuerySteps.FunctionOnFinishing= (event, currentIndex): boolean => true; + +var onFinishedFunc: JQuerySteps.FunctionOnFinished = (event, currentIndex) => {}; + +var onInitFunc: JQuerySteps.FunctionOnInit = (event, currentIndex) => {}; + +var onContentLoadedFunc: JQuerySteps.FunctionOnContentLoaded = (event, currentIndex) => {}; + +var settings: JQuerySteps.Settings = { + headerTag: 'h3', + bodyTag: 'section', + contentContainerTag: 'div', + actionContainerTag: 'div', + stepsContainerTag: 'div', + cssClass: 'wizard', + stepsOrientation: 'vertical', + titleTemplate: '#title#', + loadingTemplate: ' #text#', + autoFocus: true, + enableAllSteps: true, + enableKeyNavigation: false, + enablePagination: false, + suppressPaginationOnFocus: false, + enableContentCache: false, + enableCancelButton: true, + enableFinishButton: false, + showFinishButtonAlways: true, + forceMoveForward: true, + saveState: true, + startIndex: 1, + transitionEffect: 'slideLeft', + transitionEffectSpeed: 400, + labels: labels, + onCanceled: onCancelledFunc, + onContentLoaded: onContentLoadedFunc, + onFinished: onFinishedFunc, + onFinishing: onFinishingFunc, + onInit: onInitFunc, + onStepChanged: onStepChangedFunc, + onStepChanging: onStepChangingFunc +} + +var wizard = $('.wizard').JQuerySteps(settings); + +var newStep1: JQuerySteps.Step = { + content: '
Content
', + title: 'Step 1' +} + +var test1 = wizard.add(newStep1); + +var newStep2: JQuerySteps.Step = { + content: '
Content
', + title: 'Step 2', + contentMode: 'async', + contentUrl: 'data.xml' +} + +var test2 = wizard.insert(0, newStep2); + +var test3 = wizard.remove(1); + +var test4 = wizard.getCurrentStep(); + +var test5 = wizard.getCurrentIndex(); + +var test6 = wizard.getStep(0); + +var newStep3: JQuerySteps.Step = { + content: '
Content
', + title: 'Step 1' +} + +var test7 = wizard.insert(0, newStep3); + +var test8 = wizard.next(); + +var test9 = wizard.previous(); + +wizard.finish(); + +wizard.destroy(); diff --git a/jquery-steps/jquery-steps.d.ts b/jquery-steps/jquery-steps.d.ts new file mode 100644 index 0000000000..4b250e6708 --- /dev/null +++ b/jquery-steps/jquery-steps.d.ts @@ -0,0 +1,357 @@ +// Type definitions for jQuery Steps v1.1.0 +// Project: http://www.jquery-steps.com/ +// Definitions by: Joseph Blank +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +interface JQuery { + JQuerySteps(param?: JQuerySteps.Settings): JQuerySteps.JQuerySteps; +} + +declare module JQuerySteps { + + //#region "JQuerySteps" + + export interface JQuerySteps { + /** + * Adds a new step. (chainable) + */ + add(step: Step): JQuerySteps; + + /** + * Inserts a new step to a specific position. (chainable) + */ + insert(index: number, step: Step): JQuerySteps; + + /** + * Removes a specific step by an given index. + */ + remove(index: number): boolean; + + /** + * Gets the current step object. + */ + getCurrentStep(): Step; + + /** + * Gets the current step index. + */ + getCurrentIndex(): number; + + /** + * Gets a specific step object by index. + */ + getStep(index: number): Step; + + /** + * Routes to the previous step. + */ + next(): boolean; + + /** + * Routes to the next step. + */ + previous(): boolean; + + /** + * Triggers the onFinishing and onFinished event. + */ + finish(): void; + + /** + * Removes the control functionality completely and transforms the current state to the initial HTML structure. + */ + destroy(): void; + + /** + * Skips a certain amount of steps. Not yet implemented! + */ + skip(count: number): boolean; + } + + //#endregion "JQuerySteps" + + //#region "Settings" + export interface Settings { + //#region "Appearance" + + /** + * The header tag is used to find the step button text within the declared wizard area. Default value is h1. + */ + headerTag?: string; + + /** + * The body tag is used to find the step content within the declared wizard area. Default value is div. + */ + bodyTag?: string; + + /** + * The content container tag which will be used to wrap all step contents. Default value is div. + */ + contentContainerTag?: string; + + /** + * The action container tag which will be used to wrap the pagination navigation. Default value is div. + */ + actionContainerTag?: string; + + /** + * The steps container tag which will be used to wrap the steps navigation. Default value is div. + */ + stepsContainerTag?: string; + + /** + * The css class which will be added to the outer component wrapper. Default value is wizard. + */ + cssClass?: string; + + /** + * Determines whether the steps are vertically or horizontally oriented. Default value is horizontal or 0. + * This can be horizontal (0) or vertical (1). + */ + stepsOrientation?: string|number; + + //#endregion "Appearance" + + //#region "Templates" + + /** + * The title template which will be used to create a step button. Default value is span class="number">#index#. #title#. + */ + titleTemplate?: string; + + /** + * The loading template which will be used to create the loading animation. Default value is #text#. + */ + loadingTemplate?: string; + + //#endregion "Templates" + + //#region "Behavior" + + /** + * Sets the focus to the first wizard instance in order to enable the key navigation from the begining if true. Default value is false. + */ + autoFocus?: boolean; + + /** + * Enables all steps from the begining if true (all steps are clickable). Default value is false. + */ + enableAllSteps?: boolean; + + /** + * Enables keyboard navigation if true (arrow left and arrow right). Default value is true. + */ + enableKeyNavigation?: boolean; + + /** + * Enables pagination (next, previous and finish button) if true. Default value is true. + */ + enablePagination?: boolean; + + /** + * Suppresses pagination if a form field is focused. Default value is true. + */ + suppressPaginationOnFocus?: boolean; + + /** + * Enables cache for async loaded or iframe embedded content. Default value is true. + */ + enableContentCache?: boolean; + + /** + * Shows the cancel button if enabled. Default value is false. + */ + enableCancelButton?: boolean; + + /** + * Shows the finish button if enabled. Default value is true. + */ + enableFinishButton?: boolean; + + /** + * Shows the finish button always (on each step; right beside the next button) if true. Otherwise the next button will be replaced by the finish button if the last step becomes active. Default value is false. + */ + showFinishButtonAlways?: boolean; + + /** + * Prevents jumping to a previous step. Default value is false. + */ + forceMoveForward?: boolean; + + /** + * Saves the current state (step position) to a cookie. By coming next time the last active step becomes activated. Default value is false. + */ + saveState?: boolean; + + /** + * The position to start on (zero-based). Default value is 0. + */ + startIndex?: number; + + //#endregion "Behavior" + + //#region "Transition Effects" + + /** + * The animation effect which will be used for step transitions. Default value is none or 0. + * This can be none (0), fade (1), slide (2) or slideLeft (3). + */ + transitionEffect?: string|number; + + /** + * Animation speed for step transitions (in milliseconds). Default value is 200. + */ + transitionEffectSpeed?: number; + + //#endregion "Transition Effects" + + //#region "Events" + + /** + * Fires before the step changes and can be used to prevent step changing by returning false. + */ + onStepChanging?: FunctionOnStepChanging; + + /** + * Fires after the step has changed. + */ + onStepChanged?: FunctionOnStepChanged; + + /** + * Fires after cancellation. + */ + onCanceled?: FunctionOnCancelled; + + /** + * Fires before finishing and can be used to prevent completion by returning false. Very useful for form validation. + */ + onFinishing?: FunctionOnFinishing; + + /** + * Fires after completion. + */ + onFinished?: FunctionOnFinished; + + /** + * Fires when the wizard is initialized. + */ + onInit?: FunctionOnInit; + + /** + * Fires after async content is loaded. + */ + onContentLoaded?: FunctionOnContentLoaded; + + //#endregion "Events" + + //#region "Labels" + + labels?: LabelSettings; + + //#endregion "Labels" + } + //#endregion "Settings" + + //#region "Label Settings" + + interface LabelSettings { + + /** + * Label for the cancel button. Default value is Cancel. + */ + cancel?: string; + + /** + * This label is important for accessability reasons. Indicates which step is activated. Default value is current step:. + */ + current?: string; + + /** + * This label is important for accessability reasons and describes the kind of navigation. Default value is Pagination. + */ + pagination?: string; + + /** + * Label for the finish button. Default value is Finish. + */ + finish?: string; + + /** + * Label for the next button. Default value is Next. + */ + next?: string; + + /** + * Label for the previous button. Default value is Previous. + */ + previous?: string; + + /** + * Label for the loading animation. Default value is Loading ... . + */ + loading?: string; + + } + + //#endregion "Label Settings" + + //#region "Callback Functions" + + interface FunctionOnStepChanging { + (event: string, currentIndex: number, newIndex: number): boolean; + } + + interface FunctionOnStepChanged { + (event: string, currentIndex: number, priorIndex: number): void; + } + + interface FunctionOnCancelled { + (event: string): void; + } + + interface FunctionOnFinishing { + (event: string, currentIndex: number): boolean; + } + + interface FunctionOnFinished { + (event: string, currentIndex: number): void; + } + + interface FunctionOnInit { + (event: string, currentIndex: number): void; + } + + interface FunctionOnContentLoaded { + (event: string, currentIndex: number): void; + } + + //#endregion "Callback Functions" + + //#region "Step Object" + + interface Step { + + /** + * The step title (HTML). + */ + title?: string; + + /** + * The step content (HTML). + */ + content?: string; + + /** + * Indicates how the content will be loaded. + * This can be html (0), iframe (1), or async (2). + */ + contentMode?: string|number; + + /** + * The URI that refers to the content. + */ + contentUrl?: string; + } + + //#endregion "Step Object" +} diff --git a/jquery.pnotify/jquery.pnotify.d.ts b/jquery.pnotify/jquery.pnotify.d.ts index edb7e2468c..7f727aa1b0 100644 --- a/jquery.pnotify/jquery.pnotify.d.ts +++ b/jquery.pnotify/jquery.pnotify.d.ts @@ -1,10 +1,15 @@ -// Type definitions for jquery.pnotify 2.x +// Type definitions for jquery.pnotify 3.x // Project: https://github.com/sciactive/pnotify // Definitions by: David Sichau // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// +// could not pass the Travis Test if enabled +//type NoticeTypeOptions = "notice" | "info" | "success" | "error"; +//type StylingOptions = "brighttheme" | "jqueryui" | "bootstrap2" | "bootstrap3" | "fontawesome"; +//type StateOptions = "initializing" | "opening" | "open" | "closing" | "closed"; + interface PNotifyStack { dir1?: string; dir2?: string; @@ -24,11 +29,98 @@ interface PNotifyLabel { stick?: string; } + +interface PNotifyconfirmButton { + text?: string; + addClass?: string; + /** + * Whether to trigger this button when the user hits enter in a single line prompt. + */ + promptTrigger?: boolean; + click: (notice: PNotify, value: any) => void +} + +interface PNotifyconfirm { + /** + * Make a confirmation box. + */ + confirm?: boolean; + + /** + * Make a prompt. + */ + prompt?: boolean; + /** + * Classes to add to the input element of the prompt. + */ + prompt_class?: string + + /** + * The default value of the prompt. + */ + prompt_default?: string + + /** + * Whether the prompt should accept multiple lines of text. + */ + prompt_multi_line?: boolean; + + /** + * Where to align the buttons. (right, center, left, justify) + */ + align?: string; + + /** + * The buttons to display, and their callbacks. + */ + buttons?: PNotifyconfirmButton[]; + +} + +interface PNotifyButtons { + /** + * Provide a button for the user to manually close the notice. + */ + closer?: boolean; + /** + * Only show the closer button on hover. + */ + closer_hover?: boolean; + /** + * Provide a button for the user to manually stick the notice. + */ + sticker?: boolean; + /** + * Only show the sticker button on hover. + */ + sticker_hover?: boolean; + /** + * Show the buttons even when the nonblock module is in use. + */ + show_on_nonblock?: boolean; + /** + * The various displayed text, helps facilitating internationalization. + */ + labels?: { + close?: string; + stick?: string; + unstick?: string; + }; + /** + * The classes to use for button icons. Leave them null to use the classes from the styling you're using. + */ + classes?: { + closer?: string; + pin_up?: string; + pin_down?: string; + }; +} + interface PNotifyOptions { /** * The notice's title. Either boolean false or string */ - title?: any; + title?: string | boolean; /** * Whether to escape the content of the title. (Not allow HTML.) */ @@ -36,13 +128,13 @@ interface PNotifyOptions { /** * The notice's text. Either boolean false or string */ - text?: any; + text?: string | boolean; /** * Whether to escape the content of the text. (Not allow HTML.) */ text_escape?: boolean; /** - * What styling classes to use. (Can be either jqueryui or bootstrap.) + * What styling classes to use. (Can be either "brighttheme", "jqueryui", "bootstrap2", "bootstrap3", or "fontawesome".) */ styling?: string; /** @@ -58,7 +150,7 @@ interface PNotifyOptions { /** * Create a non-blocking notice. It lets the user click elements underneath it. */ - nonblock: boolean; + nonblock?: boolean; /** * The opacity of the notice (if it's non-blocking) when the mouse is over it. @@ -166,17 +258,38 @@ interface PNotifyOptions { } interface PNotify { - elem: JQuery; - - update(options?: PNotifyOptions): void; + + /** + * The state can be "initializing", "opening", "open", "closing", and "closed" + */ + state?: string; + + /** + * This function is for updating the notice. + */ + update(options?: PNotifyOptions): PNotify; + + /** + * Remove the notice. + */ remove(): void; + + /** + * Display the notice. + */ + open(): void; + + /** + * Get the DOM element. + */ + get(): JQuery; + } interface PNotifyConstructor { new (options?: PNotifyOptions): PNotify; - + removeAll(): void; } declare var PNotify: PNotifyConstructor; - diff --git a/jquery.tooltipster/jquery.tooltipster-tests.ts b/jquery.tooltipster/jquery.tooltipster-tests.ts index 8a8f29acae..21a5446c12 100644 --- a/jquery.tooltipster/jquery.tooltipster-tests.ts +++ b/jquery.tooltipster/jquery.tooltipster-tests.ts @@ -1,8 +1,8 @@ /// -// Type definition tests for jQuery Tooltipster 3.0.5 +// Type definition tests for jQuery Tooltipster 3.3.0 // Project: https://github.com/iamceege/tooltipster -// Definitions by: Patrick Magee +// Definitions by: Patrick Magee , Dmitry Pesterev // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // Tests taken from the getting started section of the Tooltipster website @@ -13,6 +13,10 @@ $(document).ready(function () { $('#my-tooltip').tooltipster({ content: $(' This text is in bold case !') }); + + $('#my-tooltip').tooltipster({ + content: 'string test' + }); }); @@ -191,4 +195,4 @@ $(document).ready(function () { }); }); -$('#my-special-tooltip').tooltipster('content', 'My new content'); \ No newline at end of file +$('#my-special-tooltip').tooltipster('content', 'My new content'); diff --git a/jquery.tooltipster/jquery.tooltipster.d.ts b/jquery.tooltipster/jquery.tooltipster.d.ts index a4df0a36e3..13260f15fe 100644 --- a/jquery.tooltipster/jquery.tooltipster.d.ts +++ b/jquery.tooltipster/jquery.tooltipster.d.ts @@ -1,6 +1,6 @@ -// Type definitions for jQuery Tooltipster 3.0.5 +// Type definitions for jQuery Tooltipster 3.3.0 // Project: https://github.com/iamceege/tooltipster -// Definitions by: Patrick Magee +// Definitions by: Patrick Magee , Dmitry Pesterev // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -21,14 +21,13 @@ interface JQueryTooltipsterOptions { */ arrowColor?: any; /** - * If autoClose is set to false, the tooltip will never close unless you call the 'close' method yourself. Default: true + * If autoClose is set to false, the tooltip will never close unless you call the 'hide' method yourself. Default: true */ autoClose?: boolean; /** * If set, this will override the content of the tooltip. Default: null - * @type string, jQuery object */ - content?: any; + content?: string | JQuery; /** * If the content of the tooltip is provided as a string, it is displayed as plain text by default. If this content should actually be interpreted as HTML, set this option to true. Default: false */ @@ -38,15 +37,19 @@ interface JQueryTooltipsterOptions { */ contentCloning?: boolean; /** + * Tooltipster logs notices into the console when you're doing something you ideally shouldn't be doing. Set to false to disable logging. Default: true + */ + debug?: boolean; + /** * Delay how long it takes (in milliseconds) for the tooltip to start animating in. Default: 200 */ delay?: number; /** - * Set a fixed width for the tooltip. The tooltip will always be a consistent width - no matter your content size. Default: 0 (auto width) + * Set a minimum width for the tooltip. Default: 0 (auto width) */ - fixedWidth?: number; + minWidth?: number; /** - * Set a max width for the tooltip. If the tooltip ends up being smaller than the set max width, the tooltip's width will be set automatically. Default: 0 (no max width) + * Set a maximum width for the tooltip. Default: null (no max width) */ maxWidth?: number; /** @@ -66,10 +69,13 @@ interface JQueryTooltipsterOptions { */ functionAfter?: (origin) => void; /** - * If using the iconDesktop or iconTouch options, this sets the content for your icon. Default: '(?)' - * @type string, jQuery object + * If true, the tooltip will close if its origin is clicked. This option only applies when 'trigger' is 'hover' and 'autoClose' is false. Default: false */ - icon?: any; + hideOnClick?: boolean; + /** + * If using the iconDesktop or iconTouch options, this sets the content for your icon. Default: '(?)' + */ + icon?: string | JQuery; /** * If you provide a jQuery object to the 'icon' option, this sets if it is a clone of this object that should actually be used. Default: true */ @@ -95,6 +101,10 @@ interface JQueryTooltipsterOptions { */ interactiveTolerance?: number; /** + * Allows you to put multiple tooltips on a single element. Read further instructions down this page. Default: false + */ + multiple?: boolean; + /** * Offsets the tooltip (in pixels) farther left/right from the origin. Default: 0 */ offsetX?: number; @@ -116,6 +126,15 @@ interface JQueryTooltipsterOptions { */ positionTracker?: boolean; /** + * Called after the tooltip has been repositioned by the position tracker (if enabled). Default: A function that will close the tooltip if the trigger is 'hover' and autoClose is false. + */ + positionTrackerCallback?: (origin) => void; + /** + * Specify if a TITLE attribute should be restored on the HTML element after a call to the 'destroy' method. This attribute may be omitted, or be restored with the value that existed before Tooltipster was initialized, or be restored with the stringified value of the current content. Note: in case of multiple tooltips on a single element, only the last destroyed tooltip may trigger a restoration. Default: 'current' + * 'none', 'previous' or 'current' + */ + restoration?: string; + /** * Set the speed of the animation. Default: 350 */ speed?: number; diff --git a/jquery/jquery-tests.ts b/jquery/jquery-tests.ts index ecd9266b45..a3a8e6581d 100644 --- a/jquery/jquery-tests.ts +++ b/jquery/jquery-tests.ts @@ -2528,6 +2528,18 @@ function test_jQuery() { $.post('url.xml', function (data) { var $child = $(data).find('child'); }); + $.post({ + url: "test.php", + success : () => { + console.log("successfull"); + } + }); + $.get({ + url: "test.php", + success : () => { + console.log("successfull"); + } + }); var foo = { foo: 'bar', hello: 'world' }; var $foo = $(foo); var test1 = $foo.prop('foo'); diff --git a/jquery/jquery.d.ts b/jquery/jquery.d.ts index 51a2773bf2..6478529dad 100644 --- a/jquery/jquery.d.ts +++ b/jquery/jquery.d.ts @@ -676,6 +676,12 @@ interface JQueryStatic { * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, or html). */ get(url: string, data?: Object|string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR; + /** + * Load data from the server using a HTTP GET request. + * + * @param settings The JQueryAjaxSettings to be used for the request + */ + get(settings : JQueryAjaxSettings): JQueryXHR; /** * Load JSON-encoded data from the server using a GET HTTP request. * @@ -721,7 +727,12 @@ interface JQueryStatic { * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html). */ post(url: string, data?: Object|string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR; - + /** + * Load data from the server using a HTTP POST request. + * + * @param settings The JQueryAjaxSettings to be used for the request + */ + post(settings : JQueryAjaxSettings): JQueryXHR; /** * A multi-purpose callbacks list object that provides a powerful way to manage callback lists. * diff --git a/jqueryui/jqueryui.d.ts b/jqueryui/jqueryui.d.ts index 63a1591a21..c8167956ea 100644 --- a/jqueryui/jqueryui.d.ts +++ b/jqueryui/jqueryui.d.ts @@ -1794,7 +1794,7 @@ interface JQuery { uniqueId(): JQuery; removeUniqueId(): JQuery; scrollParent(): JQuery; - zIndex(): JQuery; + zIndex(): number; zIndex(zIndex: number): JQuery; widget: JQueryUI.Widget; 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/js-quantities/js-quantities-tests.ts b/js-quantities/js-quantities-tests.ts new file mode 100644 index 0000000000..c8d00eef53 --- /dev/null +++ b/js-quantities/js-quantities-tests.ts @@ -0,0 +1,9 @@ +/// + +var Val1 = Qty('1 m') + +var Val2 = Qty(1); + +var Val3 = Qty(1, 'm'); + +var Val4 = Qty(Val1); \ No newline at end of file diff --git a/js-quantities/js-quantities.d.ts b/js-quantities/js-quantities.d.ts new file mode 100644 index 0000000000..a2e3c2d96c --- /dev/null +++ b/js-quantities/js-quantities.d.ts @@ -0,0 +1,79 @@ +// Type definitions for JS-quantities +// Project: http://gentooboontoo.github.io/js-quantities/ +// Definitions by: William Comartin +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare var Qty: QtyModule.QtyStatic; + +declare namespace QtyModule { + interface QtyStatic { + (value: string): Qty; + (value: number): Qty; + (value: number, unit: string): Qty; + (value: Qty): Qty; + } + + interface Qty { + version: string; + + scalar: number; + baseScalar: number; + + parse(value: string): Qty; + + swiftConverter(srcUnits:string, dstUnits:string): (value:number) => number; + + getkinds(): string[]; + + getUnits(kind:string): string[]; + + getAliases(unitName:string): string[]; + + formatter(scalar:number, units:string):string; + + toFloat(): number; + + isUnitless(): boolean; + + isCompatible(other:string|Qty): boolean; + + isInverse(other:string|Qty): boolean + + kind(): string; + + isBase(): boolean; + + toBase(): Qty; + + units(): string; + + eq(other:Qty): boolean; + lt(other:Qty): boolean; + lte(other:Qty): boolean; + gt(other:Qty): boolean; + gte(other:Qty): boolean; + + toPrec(precQuantity: Qty|string|number): Qty; + + toString(targetUnitsOrMaxDecimalsOrPrec?:number|string|Qty, maxDecimals?: number): string; + + format(targetUnits?:string, formatter?:(scalar:number, units:string) => string): string; + + compareTo(other:Qty|string): number; + + same(other: Qty): boolean; + + inverse(): Qty; + + isDegrees(): boolean; + + isTemperature(): boolean; + + to(other:string|Qty): Qty; + + add(other:string|Qty): Qty; + sub(other:string|Qty): Qty; + mul(other:number|string|Qty): Qty; + div(other:number|string|Qty): Qty; + } +} \ No newline at end of file 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/jsonnet/jsonnet-tests.ts b/jsonnet/jsonnet-tests.ts new file mode 100644 index 0000000000..88b3c82bed --- /dev/null +++ b/jsonnet/jsonnet-tests.ts @@ -0,0 +1,6 @@ +/// +import Jsonnet = require('jsonnet'); +var jsonnet = new Jsonnet(); +var code = '{a:1}'; +var result = jsonnet.eval(code); +console.log(result); diff --git a/jsonnet/jsonnet.d.ts b/jsonnet/jsonnet.d.ts new file mode 100644 index 0000000000..5a5aa5b619 --- /dev/null +++ b/jsonnet/jsonnet.d.ts @@ -0,0 +1,13 @@ +// Type definitions for jsonnet +// Project: https://github.com/yosuke-furukawa/node-jsonnet +// Definitions by: Hookclaw +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +declare module "jsonnet" { + class Jsonnet { + constructor(); + eval(code: string): any; + evalFile(): any; + destroy(): void; + } + export = Jsonnet; +} diff --git a/jsonwebtoken/jsonwebtoken-tests.ts b/jsonwebtoken/jsonwebtoken-tests.ts index d7ac4c8e2b..44a39dfedb 100644 --- a/jsonwebtoken/jsonwebtoken-tests.ts +++ b/jsonwebtoken/jsonwebtoken-tests.ts @@ -25,7 +25,7 @@ cert = fs.readFileSync('private.key'); // get private key token = jwt.sign({ foo: 'bar' }, cert, { algorithm: 'RS256'}); // sign asynchronously -jwt.sign({ foo: 'bar' }, cert, { algorithm: 'RS256' }, function(token: string) { +jwt.sign({ foo: 'bar' }, cert, { algorithm: 'RS256' }, function(err: Error, token: string) { console.log(token); }); diff --git a/jsonwebtoken/jsonwebtoken.d.ts b/jsonwebtoken/jsonwebtoken.d.ts index bddb01226b..da2fb3b99a 100644 --- a/jsonwebtoken/jsonwebtoken.d.ts +++ b/jsonwebtoken/jsonwebtoken.d.ts @@ -1,4 +1,4 @@ -// Type definitions for jsonwebtoken 5.7.0 +// Type definitions for jsonwebtoken 6.2.0 // Project: https://github.com/auth0/node-jsonwebtoken // Definitions by: Maxime LUCE , Daniel Heim // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -22,20 +22,15 @@ declare module "jsonwebtoken" { * - none: No digital signature or MAC value included */ algorithm?: string; - /** - *@deprecated - see expiresIn - *@member {number} - Lifetime for the token in minutes - */ - expiresInMinutes?: number; /** @member {string} - Lifetime for the token expressed in a string describing a time span [rauchg/ms](https://github.com/rauchg/ms.js). Eg: `60`, `"2 days"`, `"10h"`, `"7d"` */ - expiresIn?: string; + expiresIn?: string | number; notBefore?: string; audience?: string; subject?: string; issuer?: string; jwtid?: string; noTimestamp?: boolean; - headers?: Object; + header?: Object; } export interface VerifyOptions { @@ -62,7 +57,7 @@ declare module "jsonwebtoken" { } export interface SignCallback { - (encoded: string): void; + (err: Error, encoded: string): void; } /** 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/karma/karma-tests.ts b/karma/karma-tests.ts index 7dbd533b59..31a3948275 100644 --- a/karma/karma-tests.ts +++ b/karma/karma-tests.ts @@ -43,6 +43,14 @@ server.on('browser_register', function (browser: any) { console.log('A new browser was registered'); }); +server.on('run_complete', (browsers, results) => { + results.disconnected = false; + results.error = false; + results.exitCode = 0; + results.failed = 9; + results.success = 10; +}); + //var runner = require('karma').runner; => cannot use this syntax otherwise runner is of type any karma.runner.run({port: 9876}, function(exitCode: number) { console.log('Karma has exited with ' + exitCode); diff --git a/karma/karma.d.ts b/karma/karma.d.ts index 455d1df911..e0fcfba7b9 100644 --- a/karma/karma.d.ts +++ b/karma/karma.d.ts @@ -34,7 +34,7 @@ declare module 'karma' { interface LauncherStatic { generateId(): string; //TODO: injector should be of type `di.Injector` - new(emitter: NodeJS.EventEmitter, injector: any): Launcher; + new (emitter: NodeJS.EventEmitter, injector: any): Launcher; } interface Launcher { @@ -53,11 +53,19 @@ declare module 'karma' { } interface Runner { - run(options?: ConfigOptions|ConfigFile, callback?: ServerCallback): void; + run(options?: ConfigOptions | ConfigFile, callback?: ServerCallback): void; + } + + interface TestResults { + disconnected: boolean; + error: boolean; + exitCode: number; + failed: number; + success: number; } interface Server extends NodeJS.EventEmitter { - new(options?: ConfigOptions|ConfigFile, callback?: ServerCallback): Server; + new (options?: ConfigOptions | ConfigFile, callback?: ServerCallback): Server; /** * Start the server */ @@ -72,6 +80,13 @@ declare module 'karma' { */ refreshFiles(): Promise; + on(event: string, listener: Function): this; + + /** + * Listen to the 'run_complete' event. + */ + on(event: 'run_complete', listener: (browsers: any, results: TestResults ) => void): this; + ///** // * Backward-compatibility with karma-intellij bundled with WebStorm. // * Deprecated since version 0.13, to be removed in 0.14 @@ -191,7 +206,7 @@ declare module 'karma' { * @default [] * @description List of files/patterns to load in the browser. */ - files?: (FilePattern|string)[]; + files?: (FilePattern | string)[]; /** * @default [] * @description List of test frameworks you want to use. Typically, you will set this to ['jasmine'], ['mocha'] or ['qunit']... @@ -257,7 +272,7 @@ declare module 'karma' { * but your interactive debugging does not. * */ - preprocessors?: { [name: string]: string|string[] } + preprocessors?: { [name: string]: string | string[] } /** * @default 'http:' * Possible Values: diff --git a/kendo-ui/kendo-ui.d.ts b/kendo-ui/kendo-ui.d.ts index 62b6912b81..b283f21c14 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; } @@ -841,6 +843,7 @@ declare namespace kendo.data { axes?: any; catalogs?: any; cubes?: any; + cube?: any; data?: any; dimensions?: any; hierarchies?: any; @@ -1074,6 +1077,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; @@ -1429,14 +1457,20 @@ declare namespace kendo.mobile { } interface ApplicationOptions { + browserHistory?: boolean; hideAddressBar?: boolean; updateDocumentTitle?: boolean; initial?: string; layout?: string; loading?: string; + modelScope?: Object; platform?: string; + retina?: boolean; serverNavigation?: boolean; + skin?: string; + statusBarStyle?: string; transition?: string; + useNativeScrolling?: boolean; } interface ApplicationEvent { @@ -1655,7 +1689,7 @@ declare namespace kendo.geometry { origin: kendo.geometry.Point; size: kendo.geometry.Size; - constructor(origin: kendo.geometry.Point, size: kendo.geometry.Size); + constructor(origin: kendo.geometry.Point|any, size: kendo.geometry.Size|any); static fromPoints(pointA: kendo.geometry.Point, pointB: kendo.geometry.Point): kendo.geometry.Rect; static union(rectA: kendo.geometry.Rect, rectB: kendo.geometry.Rect): kendo.geometry.Rect; @@ -1765,6 +1799,7 @@ declare namespace kendo.drawing { clip(): kendo.drawing.Path; clip(clip: kendo.drawing.Path): void; clippedBBox(): kendo.geometry.Rect; + containsPoint(point: kendo.geometry.Point): boolean; geometry(): kendo.geometry.Arc; geometry(value: kendo.geometry.Arc): void; fill(color: string, opacity?: number): kendo.drawing.Arc; @@ -1785,6 +1820,7 @@ declare namespace kendo.drawing { fill?: kendo.drawing.FillOptions; opacity?: number; stroke?: kendo.drawing.StrokeOptions; + tooltip?: kendo.drawing.TooltipOptions; transform?: kendo.geometry.Transformation; visible?: boolean; } @@ -1808,6 +1844,7 @@ declare namespace kendo.drawing { clip(): kendo.drawing.Path; clip(clip: kendo.drawing.Path): void; clippedBBox(): kendo.geometry.Rect; + containsPoint(point: kendo.geometry.Point): boolean; geometry(): kendo.geometry.Circle; geometry(value: kendo.geometry.Circle): void; fill(color: string, opacity?: number): kendo.drawing.Circle; @@ -1828,6 +1865,7 @@ declare namespace kendo.drawing { fill?: kendo.drawing.FillOptions; opacity?: number; stroke?: kendo.drawing.StrokeOptions; + tooltip?: kendo.drawing.TooltipOptions; transform?: kendo.geometry.Transformation; visible?: boolean; } @@ -1843,6 +1881,7 @@ declare namespace kendo.drawing { options: ElementOptions; + parent: kendo.drawing.Group; constructor(options?: ElementOptions); @@ -1851,6 +1890,7 @@ declare namespace kendo.drawing { clip(): kendo.drawing.Path; clip(clip: kendo.drawing.Path): void; clippedBBox(): kendo.geometry.Rect; + containsPoint(point: kendo.geometry.Point): boolean; opacity(): number; opacity(opacity: number): void; transform(): kendo.geometry.Transformation; @@ -1955,6 +1995,7 @@ declare namespace kendo.drawing { clip(): kendo.drawing.Path; clip(clip: kendo.drawing.Path): void; clippedBBox(): kendo.geometry.Rect; + containsPoint(point: kendo.geometry.Point): boolean; insert(position: number, element: kendo.drawing.Element): void; opacity(): number; opacity(opacity: number): void; @@ -1971,6 +2012,7 @@ declare namespace kendo.drawing { cursor?: string; opacity?: number; pdf?: kendo.drawing.PDFOptions; + tooltip?: kendo.drawing.TooltipOptions; transform?: kendo.geometry.Transformation; visible?: boolean; } @@ -1994,6 +2036,7 @@ declare namespace kendo.drawing { clip(): kendo.drawing.Path; clip(clip: kendo.drawing.Path): void; clippedBBox(): kendo.geometry.Rect; + containsPoint(point: kendo.geometry.Point): boolean; opacity(): number; opacity(opacity: number): void; src(): string; @@ -2012,6 +2055,7 @@ declare namespace kendo.drawing { clip?: kendo.drawing.Path; cursor?: string; opacity?: number; + tooltip?: kendo.drawing.TooltipOptions; transform?: kendo.geometry.Transformation; visible?: boolean; } @@ -2101,6 +2145,7 @@ declare namespace kendo.drawing { clip(clip: kendo.drawing.Path): void; clippedBBox(): kendo.geometry.Rect; close(): kendo.drawing.MultiPath; + containsPoint(point: kendo.geometry.Point): boolean; curveTo(controlOut: any, controlIn: any, endPoint: any): kendo.drawing.MultiPath; curveTo(controlOut: any, controlIn: any, endPoint: kendo.geometry.Point): kendo.drawing.MultiPath; curveTo(controlOut: any, controlIn: kendo.geometry.Point, endPoint: any): kendo.drawing.MultiPath; @@ -2133,6 +2178,7 @@ declare namespace kendo.drawing { fill?: kendo.drawing.FillOptions; opacity?: number; stroke?: kendo.drawing.StrokeOptions; + tooltip?: kendo.drawing.TooltipOptions; transform?: kendo.geometry.Transformation; visible?: boolean; } @@ -2206,6 +2252,7 @@ declare namespace kendo.drawing { clip(clip: kendo.drawing.Path): void; clippedBBox(): kendo.geometry.Rect; close(): kendo.drawing.Path; + containsPoint(point: kendo.geometry.Point): boolean; curveTo(controlOut: any, controlIn: any, endPoint: any): kendo.drawing.Path; curveTo(controlOut: any, controlIn: any, endPoint: kendo.geometry.Point): kendo.drawing.Path; curveTo(controlOut: any, controlIn: kendo.geometry.Point, endPoint: any): kendo.drawing.Path; @@ -2238,6 +2285,7 @@ declare namespace kendo.drawing { fill?: kendo.drawing.FillOptions; opacity?: number; stroke?: kendo.drawing.StrokeOptions; + tooltip?: kendo.drawing.TooltipOptions; transform?: kendo.geometry.Transformation; visible?: boolean; } @@ -2294,6 +2342,7 @@ declare namespace kendo.drawing { clip(): kendo.drawing.Path; clip(clip: kendo.drawing.Path): void; clippedBBox(): kendo.geometry.Rect; + containsPoint(point: kendo.geometry.Point): boolean; geometry(): kendo.geometry.Rect; geometry(value: kendo.geometry.Rect): void; fill(color: string, opacity?: number): kendo.drawing.Rect; @@ -2314,6 +2363,7 @@ declare namespace kendo.drawing { fill?: kendo.drawing.FillOptions; opacity?: number; stroke?: kendo.drawing.StrokeOptions; + tooltip?: kendo.drawing.TooltipOptions; transform?: kendo.geometry.Transformation; visible?: boolean; } @@ -2384,18 +2434,43 @@ declare namespace kendo.drawing { clear(): void; draw(element: kendo.drawing.Element): void; eventTarget(e: any): kendo.drawing.Element; + hideTooltip(): void; resize(force?: boolean): void; + showTooltip(element: kendo.drawing.Element, options?: any): void; } + interface SurfaceTooltipAnimationClose { + effects?: string; + duration?: number; + } + + interface SurfaceTooltipAnimationOpen { + effects?: string; + duration?: number; + } + + interface SurfaceTooltipAnimation { + close?: SurfaceTooltipAnimationClose; + open?: SurfaceTooltipAnimationOpen; + } + + interface SurfaceTooltip { + animation?: boolean|SurfaceTooltipAnimation; + appendTo?: string|JQuery; + } + interface SurfaceOptions { name?: string; type?: string; height?: string; width?: string; + tooltip?: SurfaceTooltip; click?(e: SurfaceClickEvent): void; mouseenter?(e: SurfaceMouseenterEvent): void; mouseleave?(e: SurfaceMouseleaveEvent): void; + tooltipClose?(e: SurfaceTooltipCloseEvent): void; + tooltipOpen?(e: SurfaceTooltipOpenEvent): void; } interface SurfaceEvent { sender: Surface; @@ -2418,6 +2493,16 @@ declare namespace kendo.drawing { originalEvent?: any; } + interface SurfaceTooltipCloseEvent extends SurfaceEvent { + element?: kendo.drawing.Element; + target?: kendo.drawing.Element; + } + + interface SurfaceTooltipOpenEvent extends SurfaceEvent { + element?: kendo.drawing.Element; + target?: kendo.drawing.Element; + } + class Text extends kendo.drawing.Element { @@ -2432,6 +2517,7 @@ declare namespace kendo.drawing { clip(): kendo.drawing.Path; clip(clip: kendo.drawing.Path): void; clippedBBox(): kendo.geometry.Rect; + containsPoint(point: kendo.geometry.Point): boolean; content(): string; content(value: string): void; fill(color: string, opacity?: number): kendo.drawing.Text; @@ -2455,6 +2541,7 @@ declare namespace kendo.drawing { font?: string; opacity?: number; stroke?: kendo.drawing.StrokeOptions; + tooltip?: kendo.drawing.TooltipOptions; transform?: kendo.geometry.Transformation; visible?: boolean; } @@ -2465,6 +2552,28 @@ declare namespace kendo.drawing { } + interface TooltipOptions { + + + + autoHide?: boolean; + content?: string|Function; + position?: string; + height?: number|string; + hideDelay?: number; + offset?: number; + shared?: boolean; + showAfter?: number; + showOn?: string; + width?: number|string; + + + + + } + + + } declare namespace kendo.ui { class AutoComplete extends kendo.ui.Widget { @@ -2526,7 +2635,7 @@ declare namespace kendo.ui { interface AutoCompleteOptions { name?: string; - animation?: AutoCompleteAnimation; + animation?: boolean|AutoCompleteAnimation; dataSource?: any|any|kendo.data.DataSource; dataTextField?: string; delay?: number; @@ -2545,7 +2654,7 @@ declare namespace kendo.ui { headerTemplate?: string|Function; template?: string|Function; valuePrimitive?: boolean; - virtual?: AutoCompleteVirtual; + virtual?: boolean|AutoCompleteVirtual; change?(e: AutoCompleteChangeEvent): void; close?(e: AutoCompleteCloseEvent): void; dataBound?(e: AutoCompleteDataBoundEvent): void; @@ -2887,7 +2996,7 @@ declare namespace kendo.ui { text?: string; value?: string; valuePrimitive?: boolean; - virtual?: ComboBoxVirtual; + virtual?: boolean|ComboBoxVirtual; change?(e: ComboBoxChangeEvent): void; close?(e: ComboBoxCloseEvent): void; dataBound?(e: ComboBoxDataBoundEvent): void; @@ -2982,7 +3091,7 @@ declare namespace kendo.ui { interface ContextMenuOptions { name?: string; alignToAnchor?: boolean; - animation?: ContextMenuAnimation; + animation?: boolean|ContextMenuAnimation; closeOnClick?: boolean; dataSource?: any|any; direction?: string; @@ -3092,7 +3201,7 @@ declare namespace kendo.ui { interface DatePickerOptions { name?: string; - animation?: DatePickerAnimation; + animation?: boolean|DatePickerAnimation; ARIATemplate?: string; culture?: string; dates?: any; @@ -3182,7 +3291,7 @@ declare namespace kendo.ui { interface DateTimePickerOptions { name?: string; - animation?: DateTimePickerAnimation; + animation?: boolean|DateTimePickerAnimation; ARIATemplate?: string; culture?: string; dates?: any; @@ -3292,7 +3401,7 @@ declare namespace kendo.ui { interface DropDownListOptions { name?: string; - animation?: DropDownListAnimation; + animation?: boolean|DropDownListAnimation; autoBind?: boolean; cascadeFrom?: string; cascadeFromField?: string; @@ -3317,7 +3426,7 @@ declare namespace kendo.ui { text?: string; value?: string; valuePrimitive?: boolean; - virtual?: DropDownListVirtual; + virtual?: boolean|DropDownListVirtual; change?(e: DropDownListChangeEvent): void; close?(e: DropDownListCloseEvent): void; dataBound?(e: DropDownListDataBoundEvent): void; @@ -3391,6 +3500,10 @@ declare namespace kendo.ui { } + interface EditorDeserialization { + custom?: Function; + } + interface EditorFileBrowserMessages { uploadFile?: string; orderBy?: string; @@ -3619,6 +3732,18 @@ declare namespace kendo.ui { deleteColumn?: string; } + interface EditorPasteCleanup { + all?: boolean; + css?: boolean; + custom?: Function; + keepNewLines?: boolean; + msAllFormatting?: boolean; + msConvertLists?: boolean; + msTags?: boolean; + none?: boolean; + span?: boolean; + } + interface EditorPdfMargin { bottom?: number|string; left?: number|string; @@ -3651,6 +3776,7 @@ declare namespace kendo.ui { } interface EditorSerialization { + custom?: Function; entities?: boolean; scripts?: boolean; semantic?: boolean; @@ -3680,11 +3806,13 @@ declare namespace kendo.ui { interface EditorOptions { name?: string; + deserialization?: EditorDeserialization; domain?: string; encoded?: boolean; messages?: EditorMessages; + pasteCleanup?: EditorPasteCleanup; pdf?: EditorPdf; - resizable?: EditorResizable; + resizable?: boolean|EditorResizable; serialization?: EditorSerialization; stylesheets?: any; tools?: EditorTool[]; @@ -3718,6 +3846,101 @@ declare namespace kendo.ui { } + class FilterMenu extends kendo.ui.Widget { + + static fn: FilterMenu; + + options: FilterMenuOptions; + + field: string; + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): FilterMenu; + + constructor(element: Element, options?: FilterMenuOptions); + + + clear(): void; + + } + + interface FilterMenuMessages { + and?: string; + clear?: string; + filter?: string; + info?: string; + isFalse?: string; + isTrue?: string; + or?: string; + selectValue?: string; + } + + interface FilterMenuOperatorsDate { + eq?: string; + neq?: string; + isnull?: string; + isnotnull?: string; + gte?: string; + gt?: string; + lte?: string; + lt?: string; + } + + interface FilterMenuOperatorsEnums { + eq?: string; + neq?: string; + isnull?: string; + isnotnull?: string; + } + + interface FilterMenuOperatorsNumber { + eq?: string; + neq?: string; + isnull?: string; + isnotnull?: string; + gte?: string; + gt?: string; + lte?: string; + lt?: string; + } + + interface FilterMenuOperatorsString { + eq?: string; + neq?: string; + isnull?: string; + isnotnull?: string; + isempty?: string; + isnotempty?: string; + startswith?: string; + contains?: string; + doesnotcontain?: string; + endswith?: string; + } + + interface FilterMenuOperators { + string?: FilterMenuOperatorsString; + number?: FilterMenuOperatorsNumber; + date?: FilterMenuOperatorsDate; + enums?: FilterMenuOperatorsEnums; + } + + interface FilterMenuOptions { + name?: string; + dataSource?: any|any|kendo.data.DataSource; + extra?: boolean; + field?: string; + messages?: FilterMenuMessages; + operators?: FilterMenuOperators; + } + interface FilterMenuEvent { + sender: FilterMenu; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + class FlatColorPicker extends kendo.ui.Widget { static fn: FlatColorPicker; @@ -3937,10 +4160,10 @@ declare namespace kendo.ui { autoBind?: boolean; columnResizeHandleWidth?: number; columns?: GanttColumn[]; - currentTimeMarker?: GanttCurrentTimeMarker; + currentTimeMarker?: boolean|GanttCurrentTimeMarker; dataSource?: any|any|kendo.data.GanttDataSource; dependencies?: any|any|kendo.data.GanttDependencyDataSource; - editable?: GanttEditable; + editable?: boolean|GanttEditable; navigatable?: boolean; workDayStart?: Date; workDayEnd?: Date; @@ -4209,6 +4432,7 @@ declare namespace kendo.ui { dataSource?: any|any|kendo.data.DataSource; checkAll?: boolean; itemTemplate?: Function; + operators?: any; search?: boolean; ignoreCase?: boolean; ui?: string|Function; @@ -4225,7 +4449,8 @@ declare namespace kendo.ui { command?: GridColumnCommandItem[]; encoded?: boolean; field?: string; - filterable?: GridColumnFilterable; + filterable?: boolean|GridColumnFilterable; + footerAttributes?: any; footerTemplate?: string|Function; format?: string; groupable?: boolean; @@ -4237,7 +4462,7 @@ declare namespace kendo.ui { locked?: boolean; lockable?: boolean; minScreenWidth?: number; - sortable?: GridColumnSortable; + sortable?: boolean|GridColumnSortable; template?: string|Function; title?: string; width?: string|number; @@ -4273,8 +4498,10 @@ declare namespace kendo.ui { isFalse?: string; isTrue?: string; or?: string; + search?: string; selectValue?: string; cancel?: string; + selectedItemsFormat?: string; operator?: string; value?: string; checkAll?: string; @@ -4413,7 +4640,7 @@ declare namespace kendo.ui { paperSize?: string|any; template?: string; repeatHeaders?: boolean; - scale?: number|any|any; + scale?: number; proxyURL?: string; proxyTarget?: string; subject?: string; @@ -4437,31 +4664,31 @@ declare namespace kendo.ui { interface GridOptions { name?: string; - allowCopy?: GridAllowCopy; + allowCopy?: boolean|GridAllowCopy; altRowTemplate?: string|Function; autoBind?: boolean; columnResizeHandleWidth?: number; columns?: GridColumn[]; - columnMenu?: GridColumnMenu; + columnMenu?: boolean|GridColumnMenu; dataSource?: any|any|kendo.data.DataSource; detailTemplate?: string|Function; - editable?: GridEditable; + editable?: boolean|GridEditable; excel?: GridExcel; - filterable?: GridFilterable; - groupable?: GridGroupable; + filterable?: boolean|GridFilterable; + groupable?: boolean|GridGroupable; height?: number|string; messages?: GridMessages; mobile?: boolean|string; navigatable?: boolean; - noRecords?: GridNoRecords; - pageable?: GridPageable; + noRecords?: boolean|GridNoRecords; + pageable?: boolean|GridPageable; pdf?: GridPdf; reorderable?: boolean; resizable?: boolean; rowTemplate?: string|Function; - scrollable?: GridScrollable; + scrollable?: boolean|GridScrollable; selectable?: boolean|string; - sortable?: GridSortable; + sortable?: boolean|GridSortable; toolbar?: string | ((...args:any[]) => string) | GridToolbarItem[]; cancel?(e: GridCancelEvent): void; change?(e: GridChangeEvent): void; @@ -4778,7 +5005,7 @@ declare namespace kendo.ui { interface MenuOptions { name?: string; - animation?: MenuAnimation; + animation?: boolean|MenuAnimation; closeOnClick?: boolean; dataSource?: any|any; direction?: string; @@ -4885,7 +5112,7 @@ declare namespace kendo.ui { interface MultiSelectOptions { name?: string; - animation?: MultiSelectAnimation; + animation?: boolean|MultiSelectAnimation; autoBind?: boolean; autoClose?: boolean; dataSource?: any|any|kendo.data.DataSource; @@ -4909,7 +5136,7 @@ declare namespace kendo.ui { tagMode?: string; value?: any; valuePrimitive?: boolean; - virtual?: MultiSelectVirtual; + virtual?: boolean|MultiSelectVirtual; change?(e: MultiSelectChangeEvent): void; close?(e: MultiSelectCloseEvent): void; dataBound?(e: MultiSelectDataBoundEvent): void; @@ -5246,7 +5473,7 @@ declare namespace kendo.ui { interface PanelBarOptions { name?: string; - animation?: PanelBarAnimation; + animation?: boolean|PanelBarAnimation; contentUrls?: any; dataSource?: any|any; expandMode?: string; @@ -5354,7 +5581,7 @@ declare namespace kendo.ui { name?: string; dataSource?: any|kendo.data.PivotDataSource; filterable?: boolean; - sortable?: PivotConfiguratorSortable; + sortable?: boolean|PivotConfiguratorSortable; height?: number|string; messages?: PivotConfiguratorMessages; } @@ -5466,7 +5693,7 @@ declare namespace kendo.ui { excel?: PivotGridExcel; pdf?: PivotGridPdf; filterable?: boolean; - sortable?: PivotGridSortable; + sortable?: boolean|PivotGridSortable; columnWidth?: number; height?: number|string; columnHeaderTemplate?: string|Function; @@ -5554,9 +5781,11 @@ declare namespace kendo.ui { interface PopupOptions { name?: string; - animation?: PopupAnimation; + adjustSize?: any; + animation?: boolean|PopupAnimation; anchor?: string|JQuery; appendTo?: string|JQuery; + collision?: string; origin?: string; position?: string; activate?(e: PopupActivateEvent): void; @@ -5991,7 +6220,7 @@ declare namespace kendo.ui { columnWidth?: number; dateHeaderTemplate?: string|Function; dayTemplate?: string|Function; - editable?: SchedulerViewEditable; + editable?: boolean|SchedulerViewEditable; endTime?: Date; eventHeight?: number; eventTemplate?: string|Function; @@ -6025,14 +6254,14 @@ declare namespace kendo.ui { allDayEventTemplate?: string|Function; allDaySlot?: boolean; autoBind?: boolean; - currentTimeMarker?: SchedulerCurrentTimeMarker; + currentTimeMarker?: boolean|SchedulerCurrentTimeMarker; dataSource?: any|any|kendo.data.SchedulerDataSource; date?: Date; dateHeaderTemplate?: string|Function; - editable?: SchedulerEditable; + editable?: boolean|SchedulerEditable; endTime?: Date; eventTemplate?: string|Function; - footer?: SchedulerFooter; + footer?: boolean|SchedulerFooter; group?: SchedulerGroup; height?: number|string; majorTick?: number; @@ -6544,6 +6773,7 @@ declare namespace kendo.ui { format?: string; formula?: string; index?: number; + link?: string; textAlign?: string; underline?: boolean; value?: number|string|boolean|Date; @@ -6613,7 +6843,7 @@ declare namespace kendo.ui { rows?: number; sheets?: SpreadsheetSheet[]; sheetsbar?: boolean; - toolbar?: SpreadsheetToolbar; + toolbar?: boolean|SpreadsheetToolbar; change?(e: SpreadsheetChangeEvent): void; render?(e: SpreadsheetRenderEvent): void; excelExport?(e: SpreadsheetExcelExportEvent): void; @@ -6677,6 +6907,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 +6919,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; @@ -6733,7 +6969,7 @@ declare namespace kendo.ui { interface TabStripOptions { name?: string; - animation?: TabStripAnimation; + animation?: boolean|TabStripAnimation; collapsible?: boolean; contentUrls?: any; dataContentField?: string; @@ -6744,7 +6980,7 @@ declare namespace kendo.ui { dataTextField?: string; dataUrlField?: string; navigatable?: boolean; - scrollable?: TabStripScrollable; + scrollable?: boolean|TabStripScrollable; tabPosition?: string; value?: string; activate?(e: TabStripActivateEvent): void; @@ -6835,7 +7071,7 @@ declare namespace kendo.ui { interface TimePickerOptions { name?: string; - animation?: TimePickerAnimation; + animation?: boolean|TimePickerAnimation; culture?: string; dates?: any; format?: string; @@ -7042,7 +7278,7 @@ declare namespace kendo.ui { interface TooltipOptions { name?: string; autoHide?: boolean; - animation?: TooltipAnimation; + animation?: boolean|TooltipAnimation; content?: TooltipContent; callout?: boolean; filter?: string; @@ -7205,6 +7441,9 @@ declare namespace kendo.ui { addRow(parentRow: string): void; addRow(parentRow: Element): void; addRow(parentRow: JQuery): void; + autoFitColumn(column: number): void; + autoFitColumn(column: string): void; + autoFitColumn(column: any): void; cancelRow(): void; clearSelection(): void; collapse(): void; @@ -7213,7 +7452,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; @@ -7275,13 +7516,13 @@ declare namespace kendo.ui { encoded?: boolean; expandable?: boolean; field?: string; - filterable?: TreeListColumnFilterable; + filterable?: boolean|TreeListColumnFilterable; footerTemplate?: string|Function; format?: string; headerAttributes?: any; headerTemplate?: string|Function; minScreenWidth?: number; - sortable?: TreeListColumnSortable; + sortable?: boolean|TreeListColumnSortable; template?: string|Function; title?: string; width?: string|number; @@ -7382,17 +7623,17 @@ declare namespace kendo.ui { columns?: TreeListColumn[]; resizable?: boolean; reorderable?: boolean; - columnMenu?: TreeListColumnMenu; + columnMenu?: boolean|TreeListColumnMenu; dataSource?: any|any|kendo.data.TreeListDataSource; - editable?: TreeListEditable; + editable?: boolean|TreeListEditable; excel?: TreeListExcel; - filterable?: TreeListFilterable; + filterable?: boolean|TreeListFilterable; height?: number|string; messages?: TreeListMessages; pdf?: TreeListPdf; scrollable?: boolean|any; selectable?: boolean|string; - sortable?: TreeListSortable; + sortable?: boolean|TreeListSortable; toolbar?: TreeListToolbarItem[]; cancel?(e: TreeListCancelEvent): void; change?(e: TreeListChangeEvent): void; @@ -7607,8 +7848,8 @@ declare namespace kendo.ui { } interface TreeViewAnimation { - collapse?: TreeViewAnimationCollapse; - expand?: TreeViewAnimationExpand; + collapse?: boolean|TreeViewAnimationCollapse; + expand?: boolean|TreeViewAnimationExpand; } interface TreeViewCheckboxes { @@ -7625,10 +7866,10 @@ declare namespace kendo.ui { interface TreeViewOptions { name?: string; - animation?: TreeViewAnimation; + animation?: boolean|TreeViewAnimation; autoBind?: boolean; autoScroll?: boolean; - checkboxes?: TreeViewCheckboxes; + checkboxes?: boolean|TreeViewCheckboxes; dataImageUrlField?: string; dataSource?: any|any|kendo.data.HierarchicalDataSource; dataSpriteCssClassField?: string; @@ -7930,6 +8171,7 @@ declare namespace kendo.ui { interface WindowRefreshOptions { url?: string; + cache?: boolean; data?: any; type?: string; template?: string; @@ -7939,12 +8181,13 @@ declare namespace kendo.ui { interface WindowOptions { name?: string; actions?: any; - animation?: WindowAnimation; + animation?: boolean|WindowAnimation; appendTo?: any|string; autoFocus?: boolean; content?: WindowContent; draggable?: boolean; iframe?: boolean; + height?: number|string; maxHeight?: number; maxWidth?: number; minHeight?: number; @@ -7957,7 +8200,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 +8349,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; @@ -9004,7 +9414,7 @@ declare namespace kendo.dataviz.ui { size?: number; sizeField?: string; spacing?: number; - stack?: ChartSeriesItemStack; + stack?: boolean|ChartSeriesItemStack; startAngle?: number; target?: ChartSeriesItemTarget; targetField?: string; @@ -9220,7 +9630,7 @@ declare namespace kendo.dataviz.ui { scatter?: any; scatterLine?: any; spacing?: number; - stack?: ChartSeriesDefaultsStack; + stack?: boolean|ChartSeriesDefaultsStack; type?: string; tooltip?: ChartSeriesDefaultsTooltip; verticalArea?: any; @@ -9280,6 +9690,7 @@ declare namespace kendo.dataviz.ui { color?: string; font?: string; format?: string; + opacity?: number; padding?: ChartTooltipPadding; shared?: boolean; sharedTemplate?: string|Function; @@ -10149,8 +10560,8 @@ declare namespace kendo.dataviz.ui { } interface ChartZoomable { - mousewheel?: ChartZoomableMousewheel; - selection?: ChartZoomableSelection; + mousewheel?: boolean|ChartZoomableMousewheel; + selection?: boolean|ChartZoomableSelection; } interface ChartExportImageOptions { @@ -10183,13 +10594,13 @@ 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; legend?: ChartLegend; panes?: ChartPane[]; - pannable?: ChartPannable; + pannable?: boolean|ChartPannable; pdf?: ChartPdf; plotArea?: ChartPlotArea; renderAs?: string; @@ -10203,7 +10614,7 @@ declare namespace kendo.dataviz.ui { valueAxis?: ChartValueAxisItem[]; xAxis?: ChartXAxisItem[]; yAxis?: ChartYAxisItem[]; - zoomable?: ChartZoomable; + zoomable?: boolean|ChartZoomable; axisLabelClick?(e: ChartAxisLabelClickEvent): void; legendItemClick?(e: ChartLegendItemClickEvent): void; legendItemHover?(e: ChartLegendItemHoverEvent): void; @@ -10214,6 +10625,7 @@ declare namespace kendo.dataviz.ui { noteClick?(e: ChartNoteClickEvent): void; noteHover?(e: ChartNoteHoverEvent): void; plotAreaClick?(e: ChartPlotAreaClickEvent): void; + plotAreaHover?(e: ChartPlotAreaHoverEvent): void; render?(e: ChartEvent): void; select?(e: ChartSelectEvent): void; selectEnd?(e: ChartSelectEndEvent): void; @@ -10300,6 +10712,15 @@ declare namespace kendo.dataviz.ui { y?: any; } + interface ChartPlotAreaHoverEvent extends ChartEvent { + category?: any; + element?: any; + originalEvent?: any; + value?: any; + x?: any; + y?: any; + } + interface ChartSelectEvent extends ChartEvent { axis?: any; from?: any; @@ -10396,7 +10817,13 @@ declare namespace kendo.dataviz.ui { exportPDF(options?: kendo.drawing.PDFOptions): JQueryPromise; exportSVG(options: any): JQueryPromise; focus(): void; + getConnectionByModelId(id: string): kendo.dataviz.diagram.Connection; + getConnectionByModelId(id: number): kendo.dataviz.diagram.Connection; + getConnectionByModelUid(uid: string): kendo.dataviz.diagram.Connection; getShapeById(id: string): any; + getShapeByModelId(id: string): kendo.dataviz.diagram.Shape; + getShapeByModelId(id: number): kendo.dataviz.diagram.Shape; + getShapeByModelUid(uid: string): kendo.dataviz.diagram.Shape; layerToModel(point: any): any; layout(options: any): void; load(json: string): void; @@ -10432,6 +10859,11 @@ declare namespace kendo.dataviz.ui { } interface DiagramConnectionDefaultsContent { + color?: string; + fontFamily?: string; + fontSize?: number; + fontStyle?: string; + fontWeight?: string; template?: string|Function; text?: string; visual?: Function; @@ -10513,7 +10945,7 @@ declare namespace kendo.dataviz.ui { interface DiagramConnectionDefaults { content?: DiagramConnectionDefaultsContent; - editable?: DiagramConnectionDefaultsEditable; + editable?: boolean|DiagramConnectionDefaultsEditable; endCap?: DiagramConnectionDefaultsEndCap; fromConnector?: string; hover?: DiagramConnectionDefaultsHover; @@ -10526,6 +10958,11 @@ declare namespace kendo.dataviz.ui { } interface DiagramConnectionContent { + color?: string; + fontFamily?: string; + fontSize?: number; + fontStyle?: string; + fontWeight?: string; template?: string|Function; text?: string; visual?: Function; @@ -10620,7 +11057,7 @@ declare namespace kendo.dataviz.ui { interface DiagramConnection { content?: DiagramConnectionContent; - editable?: DiagramConnectionEditable; + editable?: boolean|DiagramConnectionEditable; endCap?: DiagramConnectionEndCap; from?: DiagramConnectionFrom; fromConnector?: string; @@ -10639,7 +11076,7 @@ declare namespace kendo.dataviz.ui { } interface DiagramEditableDrag { - snap?: DiagramEditableDragSnap; + snap?: boolean|DiagramEditableDragSnap; } interface DiagramEditableResizeHandlesFill { @@ -10703,10 +11140,10 @@ declare namespace kendo.dataviz.ui { interface DiagramEditable { connectionTemplate?: string|Function; - drag?: DiagramEditableDrag; + drag?: boolean|DiagramEditableDrag; remove?: boolean; - resize?: DiagramEditableResize; - rotate?: DiagramEditableRotate; + resize?: boolean|DiagramEditableResize; + rotate?: boolean|DiagramEditableRotate; shapeTemplate?: string|Function; tools?: DiagramEditableTool[]; } @@ -10776,9 +11213,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 { @@ -10786,6 +11290,8 @@ declare namespace kendo.dataviz.ui { color?: string; fontFamily?: string; fontSize?: number; + fontStyle?: string; + fontWeight?: string; template?: string|Function; text?: string; } @@ -10844,8 +11350,9 @@ declare namespace kendo.dataviz.ui { interface DiagramShapeDefaults { connectors?: DiagramShapeDefaultsConnector[]; + connectorDefaults?: DiagramShapeDefaultsConnectorDefaults; content?: DiagramShapeDefaultsContent; - editable?: DiagramShapeDefaultsEditable; + editable?: boolean|DiagramShapeDefaultsEditable; fill?: DiagramShapeDefaultsFill; height?: number; hover?: DiagramShapeDefaultsHover; @@ -10863,10 +11370,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 { @@ -10874,6 +11448,8 @@ declare namespace kendo.dataviz.ui { color?: string; fontFamily?: string; fontSize?: number; + fontStyle?: string; + fontWeight?: string; template?: string|Function; text?: string; } @@ -10930,8 +11506,9 @@ declare namespace kendo.dataviz.ui { interface DiagramShape { connectors?: DiagramShapeConnector[]; + connectorDefaults?: DiagramShapeConnectorDefaults; content?: DiagramShapeContent; - editable?: DiagramShapeEditable; + editable?: boolean|DiagramShapeEditable; fill?: DiagramShapeFill; height?: number; hover?: DiagramShapeHover; @@ -10970,11 +11547,11 @@ declare namespace kendo.dataviz.ui { connections?: DiagramConnection[]; connectionsDataSource?: any|any|kendo.data.DataSource; dataSource?: any|any|kendo.data.DataSource; - editable?: DiagramEditable; + editable?: boolean|DiagramEditable; layout?: DiagramLayout; - pannable?: DiagramPannable; + pannable?: boolean|DiagramPannable; pdf?: DiagramPdf; - selectable?: DiagramSelectable; + selectable?: boolean|DiagramSelectable; shapeDefaults?: DiagramShapeDefaults; shapes?: DiagramShape[]; template?: string|Function; @@ -10999,6 +11576,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; } @@ -11034,16 +11612,19 @@ declare namespace kendo.dataviz.ui { } interface DiagramDragEvent extends DiagramEvent { + connectionHandle?: string; connections?: any; shapes?: any; } interface DiagramDragEndEvent extends DiagramEvent { + connectionHandle?: string; connections?: any; shapes?: any; } interface DiagramDragStartEvent extends DiagramEvent { + connectionHandle?: string; connections?: any; shapes?: any; } @@ -11091,6 +11672,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; @@ -11342,9 +11930,9 @@ declare namespace kendo.dataviz.ui { } interface MapControls { - attribution?: MapControlsAttribution; - navigator?: MapControlsNavigator; - zoom?: MapControlsZoom; + attribution?: boolean|MapControlsAttribution; + navigator?: boolean|MapControlsNavigator; + zoom?: boolean|MapControlsZoom; } interface MapLayerDefaultsBing { @@ -11637,6 +12225,7 @@ declare namespace kendo.dataviz.ui { reset?(e: MapResetEvent): void; shapeClick?(e: MapShapeClickEvent): void; shapeCreated?(e: MapShapeCreatedEvent): void; + shapeFeatureCreated?(e: MapShapeFeatureCreatedEvent): void; shapeMouseEnter?(e: MapShapeMouseEnterEvent): void; shapeMouseLeave?(e: MapShapeMouseLeaveEvent): void; zoomStart?(e: MapZoomStartEvent): void; @@ -11698,6 +12287,13 @@ declare namespace kendo.dataviz.ui { originalEvent?: any; } + interface MapShapeFeatureCreatedEvent extends MapEvent { + dataItem?: any; + layer?: kendo.dataviz.map.layer.Shape; + group?: kendo.drawing.Group; + properties?: any; + } + interface MapShapeMouseEnterEvent extends MapEvent { layer?: kendo.dataviz.map.layer.Shape; shape?: kendo.drawing.Element; @@ -12415,7 +13011,7 @@ declare namespace kendo.dataviz.ui { size?: number; startAngle?: number; spacing?: number; - stack?: SparklineSeriesItemStack; + stack?: boolean|SparklineSeriesItemStack; tooltip?: SparklineSeriesItemTooltip; width?: number; target?: SparklineSeriesItemTarget; @@ -12478,7 +13074,7 @@ declare namespace kendo.dataviz.ui { overlay?: any; pie?: any; spacing?: number; - stack?: SparklineSeriesDefaultsStack; + stack?: boolean|SparklineSeriesDefaultsStack; type?: string; tooltip?: SparklineSeriesDefaultsTooltip; } @@ -13683,7 +14279,7 @@ declare namespace kendo.dataviz.ui { openField?: string; overlay?: StockChartNavigatorSeriesItemOverlay; spacing?: number; - stack?: StockChartNavigatorSeriesItemStack; + stack?: boolean|StockChartNavigatorSeriesItemStack; tooltip?: StockChartNavigatorSeriesItemTooltip; width?: number; } @@ -13953,7 +14549,7 @@ declare namespace kendo.dataviz.ui { openField?: string; overlay?: StockChartSeriesItemOverlay; spacing?: number; - stack?: StockChartSeriesItemStack; + stack?: boolean|StockChartSeriesItemStack; tooltip?: StockChartSeriesItemTooltip; visibleInLegend?: boolean; width?: number; @@ -14018,7 +14614,7 @@ declare namespace kendo.dataviz.ui { overlay?: any; pie?: any; spacing?: number; - stack?: StockChartSeriesDefaultsStack; + stack?: boolean|StockChartSeriesDefaultsStack; type?: string; tooltip?: StockChartSeriesDefaultsTooltip; } @@ -14344,6 +14940,7 @@ declare namespace kendo.dataviz.ui { noteClick?(e: StockChartNoteClickEvent): void; noteHover?(e: StockChartNoteHoverEvent): void; plotAreaClick?(e: StockChartPlotAreaClickEvent): void; + plotAreaHover?(e: StockChartPlotAreaHoverEvent): void; render?(e: StockChartEvent): void; seriesClick?(e: StockChartSeriesClickEvent): void; seriesHover?(e: StockChartSeriesHoverEvent): void; @@ -14424,6 +15021,15 @@ declare namespace kendo.dataviz.ui { y?: any; } + interface StockChartPlotAreaHoverEvent extends StockChartEvent { + category?: any; + element?: any; + originalEvent?: any; + value?: any; + x?: any; + y?: any; + } + interface StockChartSeriesClickEvent extends StockChartEvent { value?: any; category?: any; @@ -14562,7 +15168,7 @@ declare namespace kendo.dataviz.map { nw: kendo.dataviz.map.Location; se: kendo.dataviz.map.Location; - constructor(nw: kendo.dataviz.map.Location, se: kendo.dataviz.map.Location); + constructor(nw: kendo.dataviz.map.Location|any, se: kendo.dataviz.map.Location|any); static create(a: kendo.dataviz.map.Location, b?: kendo.dataviz.map.Location): kendo.dataviz.map.Extent; static create(a: kendo.dataviz.map.Location, b?: any): kendo.dataviz.map.Extent; @@ -14809,15 +15415,15 @@ declare namespace kendo.dataviz { range(): any; - slot(from: string, to?: string): kendo.geometry.Rect; - slot(from: string, to?: number): kendo.geometry.Rect; - slot(from: string, to?: Date): kendo.geometry.Rect; - slot(from: number, to?: string): kendo.geometry.Rect; - slot(from: number, to?: number): kendo.geometry.Rect; - slot(from: number, to?: Date): kendo.geometry.Rect; - slot(from: Date, to?: string): kendo.geometry.Rect; - slot(from: Date, to?: number): kendo.geometry.Rect; - slot(from: Date, to?: Date): kendo.geometry.Rect; + slot(from: string, to?: string, limit?: boolean): kendo.geometry.Rect; + slot(from: string, to?: number, limit?: boolean): kendo.geometry.Rect; + slot(from: string, to?: Date, limit?: boolean): kendo.geometry.Rect; + slot(from: number, to?: string, limit?: boolean): kendo.geometry.Rect; + slot(from: number, to?: number, limit?: boolean): kendo.geometry.Rect; + slot(from: number, to?: Date, limit?: boolean): kendo.geometry.Rect; + slot(from: Date, to?: string, limit?: boolean): kendo.geometry.Rect; + slot(from: Date, to?: number, limit?: boolean): kendo.geometry.Rect; + slot(from: Date, to?: Date, limit?: boolean): kendo.geometry.Rect; } @@ -14838,6 +15444,7 @@ declare namespace kendo.dataviz.diagram { options: CircleOptions; + drawingElement: kendo.drawing.Circle; constructor(options?: CircleOptions); @@ -14924,6 +15531,11 @@ declare namespace kendo.dataviz.diagram { } interface ConnectionContent { + color?: string; + fontFamily?: string; + fontSize?: number; + fontStyle?: string; + fontWeight?: string; template?: string|Function; text?: string; visual?: Function; @@ -15022,11 +15634,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; @@ -15040,6 +15676,7 @@ declare namespace kendo.dataviz.diagram { options: GroupOptions; + drawingElement: kendo.drawing.Group; constructor(options?: GroupOptions); @@ -15072,6 +15709,7 @@ declare namespace kendo.dataviz.diagram { options: ImageOptions; + drawingElement: kendo.drawing.Image; constructor(options?: ImageOptions); @@ -15104,6 +15742,7 @@ declare namespace kendo.dataviz.diagram { options: LayoutOptions; + drawingElement: kendo.drawing.Layout; constructor(rect: kendo.dataviz.diagram.Rect, options?: LayoutOptions); @@ -15141,6 +15780,7 @@ declare namespace kendo.dataviz.diagram { options: LineOptions; + drawingElement: kendo.drawing.Path; constructor(options?: LineOptions); @@ -15176,6 +15816,7 @@ declare namespace kendo.dataviz.diagram { options: PathOptions; + drawingElement: kendo.drawing.Path; constructor(options?: PathOptions); @@ -15295,6 +15936,7 @@ declare namespace kendo.dataviz.diagram { options: PolylineOptions; + drawingElement: kendo.drawing.Path; constructor(options?: PolylineOptions); @@ -15416,6 +16058,7 @@ declare namespace kendo.dataviz.diagram { options: RectangleOptions; + drawingElement: kendo.drawing.Path; constructor(options?: RectangleOptions); @@ -15488,9 +16131,45 @@ declare namespace kendo.dataviz.diagram { getConnector(): void; getPosition(side: string): void; redraw(options: any): void; + redrawVisual(): void; } + 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 +16177,13 @@ declare namespace kendo.dataviz.diagram { } interface ShapeContent { - text?: string; align?: string; + color?: string; + fontFamily?: string; + fontSize?: number; + fontStyle?: string; + fontWeight?: string; + text?: string; } interface ShapeEditable { @@ -15549,7 +16233,7 @@ declare namespace kendo.dataviz.diagram { interface ShapeOptions { name?: string; id?: string; - editable?: ShapeEditable; + editable?: boolean|ShapeEditable; path?: string; stroke?: ShapeStroke; type?: string; @@ -15566,6 +16250,7 @@ declare namespace kendo.dataviz.diagram { content?: ShapeContent; selectable?: boolean; visual?: Function; + connectorDefaults?: ShapeConnectorDefaults; } interface ShapeEvent { sender: Shape; @@ -15579,6 +16264,7 @@ declare namespace kendo.dataviz.diagram { options: TextBlockOptions; + drawingElement: kendo.drawing.Text; constructor(options?: TextBlockOptions); @@ -15598,6 +16284,8 @@ declare namespace kendo.dataviz.diagram { color?: string; fontFamily?: string; fontSize?: number; + fontStyle?: string; + fontWeight?: string; height?: number; text?: string; width?: number; @@ -15798,6 +16486,8 @@ declare namespace kendo.spreadsheet { isFilterable(): boolean; italic(): boolean; italic(value?: boolean): void; + link(): string; + link(url?: string): void; merge(): void; select(): void; sort(sort: number): void; @@ -15856,6 +16546,7 @@ declare namespace kendo.spreadsheet { rowHeight(): void; rowHeight(index: number, width?: number): void; selection(): kendo.spreadsheet.Range; + setDataSource(dataSource: kendo.data.DataSource, columns?: any): void; showGridLines(): boolean; showGridLines(showGridLiens?: boolean): void; toJSON(): void; @@ -16327,7 +17018,7 @@ declare namespace kendo.mobile.ui { style?: string; template?: string|Function; type?: string; - filterable?: ListViewFilterable; + filterable?: boolean|ListViewFilterable; virtualViewSize?: number; click?(e: ListViewClickEvent): void; dataBound?(e: ListViewEvent): void; @@ -16935,22 +17626,22 @@ declare namespace kendo.ooxml { interface WorkbookSheetRowCellBorderBottom { color?: string; - size?: string; + size?: number; } interface WorkbookSheetRowCellBorderLeft { color?: string; - size?: string; + size?: number; } interface WorkbookSheetRowCellBorderRight { color?: string; - size?: string; + size?: number; } interface WorkbookSheetRowCellBorderTop { color?: string; - size?: string; + size?: number; } interface WorkbookSheetRowCell { @@ -17182,7 +17873,7 @@ declare namespace kendo.dataviz.geometry { origin: kendo.geometry.Point; size: kendo.geometry.Size; - constructor(origin: kendo.geometry.Point, size: kendo.geometry.Size); + constructor(origin: kendo.geometry.Point|any, size: kendo.geometry.Size|any); static fromPoints(pointA: kendo.geometry.Point, pointB: kendo.geometry.Point): kendo.geometry.Rect; static union(rectA: kendo.geometry.Rect, rectB: kendo.geometry.Rect): kendo.geometry.Rect; @@ -17292,6 +17983,7 @@ declare namespace kendo.dataviz.drawing { clip(): kendo.drawing.Path; clip(clip: kendo.drawing.Path): void; clippedBBox(): kendo.geometry.Rect; + containsPoint(point: kendo.geometry.Point): boolean; geometry(): kendo.geometry.Arc; geometry(value: kendo.geometry.Arc): void; fill(color: string, opacity?: number): kendo.drawing.Arc; @@ -17312,6 +18004,7 @@ declare namespace kendo.dataviz.drawing { fill?: kendo.drawing.FillOptions; opacity?: number; stroke?: kendo.drawing.StrokeOptions; + tooltip?: kendo.drawing.TooltipOptions; transform?: kendo.geometry.Transformation; visible?: boolean; } @@ -17335,6 +18028,7 @@ declare namespace kendo.dataviz.drawing { clip(): kendo.drawing.Path; clip(clip: kendo.drawing.Path): void; clippedBBox(): kendo.geometry.Rect; + containsPoint(point: kendo.geometry.Point): boolean; geometry(): kendo.geometry.Circle; geometry(value: kendo.geometry.Circle): void; fill(color: string, opacity?: number): kendo.drawing.Circle; @@ -17355,6 +18049,7 @@ declare namespace kendo.dataviz.drawing { fill?: kendo.drawing.FillOptions; opacity?: number; stroke?: kendo.drawing.StrokeOptions; + tooltip?: kendo.drawing.TooltipOptions; transform?: kendo.geometry.Transformation; visible?: boolean; } @@ -17370,6 +18065,7 @@ declare namespace kendo.dataviz.drawing { options: ElementOptions; + parent: kendo.drawing.Group; constructor(options?: ElementOptions); @@ -17378,6 +18074,7 @@ declare namespace kendo.dataviz.drawing { clip(): kendo.drawing.Path; clip(clip: kendo.drawing.Path): void; clippedBBox(): kendo.geometry.Rect; + containsPoint(point: kendo.geometry.Point): boolean; opacity(): number; opacity(opacity: number): void; transform(): kendo.geometry.Transformation; @@ -17482,6 +18179,7 @@ declare namespace kendo.dataviz.drawing { clip(): kendo.drawing.Path; clip(clip: kendo.drawing.Path): void; clippedBBox(): kendo.geometry.Rect; + containsPoint(point: kendo.geometry.Point): boolean; insert(position: number, element: kendo.drawing.Element): void; opacity(): number; opacity(opacity: number): void; @@ -17498,6 +18196,7 @@ declare namespace kendo.dataviz.drawing { cursor?: string; opacity?: number; pdf?: kendo.drawing.PDFOptions; + tooltip?: kendo.drawing.TooltipOptions; transform?: kendo.geometry.Transformation; visible?: boolean; } @@ -17521,6 +18220,7 @@ declare namespace kendo.dataviz.drawing { clip(): kendo.drawing.Path; clip(clip: kendo.drawing.Path): void; clippedBBox(): kendo.geometry.Rect; + containsPoint(point: kendo.geometry.Point): boolean; opacity(): number; opacity(opacity: number): void; src(): string; @@ -17539,6 +18239,7 @@ declare namespace kendo.dataviz.drawing { clip?: kendo.drawing.Path; cursor?: string; opacity?: number; + tooltip?: kendo.drawing.TooltipOptions; transform?: kendo.geometry.Transformation; visible?: boolean; } @@ -17628,6 +18329,7 @@ declare namespace kendo.dataviz.drawing { clip(clip: kendo.drawing.Path): void; clippedBBox(): kendo.geometry.Rect; close(): kendo.drawing.MultiPath; + containsPoint(point: kendo.geometry.Point): boolean; curveTo(controlOut: any, controlIn: any, endPoint: any): kendo.drawing.MultiPath; curveTo(controlOut: any, controlIn: any, endPoint: kendo.geometry.Point): kendo.drawing.MultiPath; curveTo(controlOut: any, controlIn: kendo.geometry.Point, endPoint: any): kendo.drawing.MultiPath; @@ -17660,6 +18362,7 @@ declare namespace kendo.dataviz.drawing { fill?: kendo.drawing.FillOptions; opacity?: number; stroke?: kendo.drawing.StrokeOptions; + tooltip?: kendo.drawing.TooltipOptions; transform?: kendo.geometry.Transformation; visible?: boolean; } @@ -17733,6 +18436,7 @@ declare namespace kendo.dataviz.drawing { clip(clip: kendo.drawing.Path): void; clippedBBox(): kendo.geometry.Rect; close(): kendo.drawing.Path; + containsPoint(point: kendo.geometry.Point): boolean; curveTo(controlOut: any, controlIn: any, endPoint: any): kendo.drawing.Path; curveTo(controlOut: any, controlIn: any, endPoint: kendo.geometry.Point): kendo.drawing.Path; curveTo(controlOut: any, controlIn: kendo.geometry.Point, endPoint: any): kendo.drawing.Path; @@ -17765,6 +18469,7 @@ declare namespace kendo.dataviz.drawing { fill?: kendo.drawing.FillOptions; opacity?: number; stroke?: kendo.drawing.StrokeOptions; + tooltip?: kendo.drawing.TooltipOptions; transform?: kendo.geometry.Transformation; visible?: boolean; } @@ -17821,6 +18526,7 @@ declare namespace kendo.dataviz.drawing { clip(): kendo.drawing.Path; clip(clip: kendo.drawing.Path): void; clippedBBox(): kendo.geometry.Rect; + containsPoint(point: kendo.geometry.Point): boolean; geometry(): kendo.geometry.Rect; geometry(value: kendo.geometry.Rect): void; fill(color: string, opacity?: number): kendo.drawing.Rect; @@ -17841,6 +18547,7 @@ declare namespace kendo.dataviz.drawing { fill?: kendo.drawing.FillOptions; opacity?: number; stroke?: kendo.drawing.StrokeOptions; + tooltip?: kendo.drawing.TooltipOptions; transform?: kendo.geometry.Transformation; visible?: boolean; } @@ -17911,18 +18618,43 @@ declare namespace kendo.dataviz.drawing { clear(): void; draw(element: kendo.drawing.Element): void; eventTarget(e: any): kendo.drawing.Element; + hideTooltip(): void; resize(force?: boolean): void; + showTooltip(element: kendo.drawing.Element, options?: any): void; } + interface SurfaceTooltipAnimationClose { + effects?: string; + duration?: number; + } + + interface SurfaceTooltipAnimationOpen { + effects?: string; + duration?: number; + } + + interface SurfaceTooltipAnimation { + close?: SurfaceTooltipAnimationClose; + open?: SurfaceTooltipAnimationOpen; + } + + interface SurfaceTooltip { + animation?: boolean|SurfaceTooltipAnimation; + appendTo?: string|JQuery; + } + interface SurfaceOptions { name?: string; type?: string; height?: string; width?: string; + tooltip?: SurfaceTooltip; click?(e: SurfaceClickEvent): void; mouseenter?(e: SurfaceMouseenterEvent): void; mouseleave?(e: SurfaceMouseleaveEvent): void; + tooltipClose?(e: SurfaceTooltipCloseEvent): void; + tooltipOpen?(e: SurfaceTooltipOpenEvent): void; } interface SurfaceEvent { sender: Surface; @@ -17945,6 +18677,16 @@ declare namespace kendo.dataviz.drawing { originalEvent?: any; } + interface SurfaceTooltipCloseEvent extends SurfaceEvent { + element?: kendo.drawing.Element; + target?: kendo.drawing.Element; + } + + interface SurfaceTooltipOpenEvent extends SurfaceEvent { + element?: kendo.drawing.Element; + target?: kendo.drawing.Element; + } + class Text extends kendo.drawing.Element { @@ -17959,6 +18701,7 @@ declare namespace kendo.dataviz.drawing { clip(): kendo.drawing.Path; clip(clip: kendo.drawing.Path): void; clippedBBox(): kendo.geometry.Rect; + containsPoint(point: kendo.geometry.Point): boolean; content(): string; content(value: string): void; fill(color: string, opacity?: number): kendo.drawing.Text; @@ -17982,6 +18725,7 @@ declare namespace kendo.dataviz.drawing { font?: string; opacity?: number; stroke?: kendo.drawing.StrokeOptions; + tooltip?: kendo.drawing.TooltipOptions; transform?: kendo.geometry.Transformation; visible?: boolean; } @@ -17992,6 +18736,28 @@ declare namespace kendo.dataviz.drawing { } + interface TooltipOptions { + + + + autoHide?: boolean; + content?: string|Function; + position?: string; + height?: number|string; + hideDelay?: number; + offset?: number; + shared?: boolean; + showAfter?: number; + showOn?: string; + width?: number|string; + + + + + } + + + } interface HTMLElement { @@ -18076,6 +18842,10 @@ interface JQuery { kendoEditor(options: kendo.ui.EditorOptions): JQuery; data(key: "kendoEditor"): kendo.ui.Editor; + kendoFilterMenu(): JQuery; + kendoFilterMenu(options: kendo.ui.FilterMenuOptions): JQuery; + data(key: "kendoFilterMenu"): kendo.ui.FilterMenu; + kendoFlatColorPicker(): JQuery; kendoFlatColorPicker(options: kendo.ui.FlatColorPickerOptions): JQuery; data(key: "kendoFlatColorPicker"): kendo.ui.FlatColorPicker; 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..550aa736fa 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.4 // 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 */ @@ -5902,6 +6059,18 @@ declare namespace KiiCloud { */ getEmailAddress(): string; + /** + * Get the email of this user that has not been verified. + * When the user's email has been changed and email verification is required in you app configuration, + * New email is stored as pending email. + * After the new email has been verified, the address can be obtained by {@link KiiUser.getEmailAddress} + * + * @return User's new email address has not been verified. + * null if no pending email field is included in refresh + * response or undefined when no refresh operation has been done before. + */ + getPendingEmailAddress(): string; + /** * Get the phone number associated with this user * @@ -5909,6 +6078,18 @@ declare namespace KiiCloud { */ getPhoneNumber(): string; + /** + * Get the phone of this user that has not been verified. + * When the user's phone has been changed and phone verification is required in you app configuration, + * New phone is stored as pending phone. + * After the new phone has been verified, the address can be obtained by {@link KiiUser.getPhoneNumber} + * + * @return User's new phone number has not been verified. + * null if no pending phone field is included in refresh + * response or undefined when no refresh operation has been done before. + */ + getPendingPhoneNumber(): string; + /** * Get the country code associated with this user * @@ -5997,7 +6178,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 @@ -6969,7 +7150,12 @@ declare namespace KiiCloud { ownerOfGroups(callbacks?: { success(theUser: KiiUser, groupList: KiiGroup[]): any; failure(theUser: KiiUser, anErrorString: string): any; }): Promise<[KiiUser, KiiGroup[]]>; /** - * Updates the user's phone number on the server + * Change phone number of logged in user. + * If the phone number verification is required by your app configuration, + * User's phone number would not changed to new one until the new phone number verification has been done. + * In this case, new phone can be obtained by {@link KiiUser#getPendingPhoneNumber()}. + * This API does not refresh the KiiUser automatically. + * Please execute {@link KiiUser#refresh()} before checking the value of {@link KiiUser#getPhoneNumber()} or {@link KiiUser#getPendingPhoneNumber()}. * * @param newPhoneNumber The new phone number to change to * @param callbacks An object with callback methods defined @@ -7012,7 +7198,12 @@ declare namespace KiiCloud { changePhone(newPhoneNumber: string, callbacks?: { success(theUser: KiiUser): any; failure(theUser: KiiUser, anErrorString: string): any; }): Promise; /** - * Updates the user's email address on the server + * Change email of logged in user. + * If the email address verification is required by your app configuration, + * User's email would not changed to new one until the new email verification has been done. + * In this case, new mail address can be obtained by {@link KiiUser#getPendingEmailAddress()}. + * This API does not refresh the KiiUser automatically. + * Please execute {@link KiiUser#refresh()} before checking the value of {@link KiiUser#getEmailAddress()} or {@link KiiUser#getPendingEmailAddress()} * * @param newEmail The new email address to change to * @param callbacks An object with callback methods defined @@ -7161,7 +7352,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 +7364,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 +7621,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 +7818,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 +7828,4 @@ import KiiSocialConnect = KiiCloud.KiiSocialConnect; import KiiThing = KiiCloud.KiiThing; import KiiTopic = KiiCloud.KiiTopic; import KiiUser = KiiCloud.KiiUser; +import KiiUserBuilder = KiiCloud.KiiUserBuilder; diff --git a/kik-browser/kik-browser-tests.ts b/kik-browser/kik-browser-tests.ts new file mode 100644 index 0000000000..ebd7bed113 --- /dev/null +++ b/kik-browser/kik-browser-tests.ts @@ -0,0 +1,310 @@ +/// + +if (kik.enabled) { + // running in kik +} + +if (kik.send) { + // can send messages +} + +kik.getUser(function (user) { + if (!user) { + // user denied access to their information + } else { + typeof user.username; // "string" + typeof user.fullName; // "string" + typeof user.firstName; // "string" + typeof user.lastName; // "string" + typeof user.pic; // "string" + typeof user.thumbnail; // "string" + } +}); + +if (kik.hasPermission()) { + // your webpage has permission +} + +kik.getAnonymousUser(function (token) { + typeof token; // "string" +}); + +kik.sign("my data", function (signedData, username, host) { + if (!signedData) { + // failed to sign + // perhaps user denied permissions + } else { + // successfully signed + typeof signedData; // "string", signed data + typeof username; // "string", user who signed + typeof host; // "string", host of your webpage + // all of these fields must be passed to the + // verification service to be successful + } +}); + +kik.anonymousSign("my data", function (signedData, anonToken, host) { + if (!signedData) { + // failed to sign + } else { + // successfully signed + typeof signedData; // "string", signed data + typeof anonToken; // "string", anonymous user who signed + typeof host; // "string", host of your webpage + } +}); + +kik.send({ + title : "Message title" , + text : "Message body" , + pic : "http://mysite.com/pic" , // optional + big : true , // optional + noForward : true , // optional + data : { some : "json" } // optional +}); + +kik.send("myFriend", { + title : "Message title" , + text : "Message body" , +}); + +if (kik.message) { + // your webpage was launched from a message + // kik.message is exactly what was provided in kik.send + // in this case: { some "json" } +} + +kik.openConversation("kikteam"); + +kik.metrics.enableGoogleAnalytics("id", "mydomain.com"); +kik.metrics.enableGoogleAnalytics(); +kik.showProfile("kikteam"); + +kik.pickUsers(function (users) { + if (!users) { + // action was cancelled by user + } else { + users.forEach(function (user) { + typeof user.username; // "string" + typeof user.fullName; // "string" + typeof user.firstName; // "string" + typeof user.lastName; // "string" + typeof user.pic; // "string" + typeof user.thumbnail; // "string" + }); + } +}); + +kik.pickUsers({ + minResults : 2 , // number >= 0 + maxResults : 4 // number > 0 +}, function (users) { + // do something with data +}); + +kik.pickUsers({ + preselected : [ + { username : "foo" /*, etc */ }, + // any user object obtained from previous call to pickUsers + ] +}, function (users) { + // do something with data +}); + +kik.pickUsers({ + filterSelf: false +}, function (users) { + // do something with data +}); + +kik.photo.get(function (photos) { + if (!photos) { + // action cancelled by user + } else { + // photos is a list of data URLs + } +}); + +kik.photo.get({ + quality : 0.7 , // number between 0-1 + minResults : 2 , // number between 1-25 + maxResults : 25 , // number between 1-25 + maxHeight : 1280 , // number in pixels between 0-1280 + maxWidth : 1280 , // number in pixels between 0-1280 +}, function (photos) { + // do something with the photos +}); + +kik.photo.getFromCamera({ + onSelect : function (numPhotos) { + // called immediately after the user has selected photos + // "numPhotos" is the number of photos selected by the user + // that many "onPhoto" events will be fired after this + // "onComplete" will fire after all "onPhoto" events are done + }, + onPhoto : function (photo, index) { + // "photo" is a data URL representing a single image + // "photo" may be null if there was an error in processing + // this will be called once for each image when it is ready + // "index" is an integer relating to the order of selection + // event may not come in order so use index if you care + }, + onComplete : function (photos) { + // "photos" is list of all photos from all photo events + // this event is identical to normal callback + }, + onCancel : function () { + // the action was cancelled by the user + // no other events will be called + } +}); + +kik.photo.get({ + quality : 0.7 , // number between 0-1 + minResults : 2 , // number between 1-25 + maxResults : 25 , // number between 1-25 + maxHeight : 1280 , // number in pixels between 0-1280 + maxWidth : 1280 , // number in pixels between 0-1280 +}, function (photos) { + // do something with the photos +}); + +kik.photo.getFromCamera({ + onSelect : function (numPhotos) { + // called immediately after the user has selected photos + // 'numPhotos' is the number of photos selected by the user + // that many 'onPhoto' events will be fired after this + // 'onComplete' will fire after all 'onPhoto' events are done + }, + onPhoto : function (photo, index) { + // 'photo' is a data URL representing a single image + // 'photo' may be null if there was an error in processing + // this will be called once for each image when it is ready + // 'index' is an integer relating to the order of selection + // event may not come in order so use index if you care + }, + onComplete : function (photos) { + // 'photos' is list of all photos from all photo events + // this event is identical to normal callback + }, + onCancel : function () { + // the action was cancelled by the user + // no other events will be called + } +}); + +kik.photo.getFromGallery(function (photos) { + // do something with the photos +}); + +kik.photo.saveToGallery("url", function (status) { + if (status) { + // save succeeded + } else { + // save failed + } +}); + +kik.picker( + "http://othersite.com/", + { arbitrary : "request data" }, + function (response) { + // do something with the picked data! + } +); + +if (kik.picker.reply) { + // webpage was launched in "picker mode" + // kik.picker.url === the url of the calling webpage + // kik.picker.data === { arbitrary : "request data" } + kik.picker.reply({ arbitrary : "response data" }); +} + +kik.ready(function () { + // expensive task that should not block loading +}); + +function handleBackButton () { + // called when back button is pressed + return false; // optionally cancel default behavior +} + +kik.browser.back(handleBackButton); // handle back button +kik.browser.unbindBack(handleBackButton); // unbind from handling back button + +kik.open("http://www.google.com/"); +kik.open("https://pop.kik.com/"); +kik.open("twitter://post"); + +kik.open("http://mysite.com/", true); // opens in popup mode + +kik.open("https://thirdparty.com/auth/page/path", true); + +kik.open("http://mysite.com/#response-data"); + +kik.linkData; // "response-data" + +kik.on("linkData", function () { + kik.linkData; // "response-data" +}); + +if (kik.browser.background) { + // the webpage is in the background +} + +kik.browser.on("background", function () { + // the webpage is now in the background +}); +kik.browser.on("foreground", function () { + // the webpage has returned to the foreground +}); + +// lock the orientation in landscape mode +kik.browser.setOrientationLock("landscape"); + +// unlock the orientation +kik.browser.setOrientationLock("free"); + +kik.browser.statusBar(false); // hide status bar +kik.browser.statusBar(true); // show status bar + +kik.formHelpers.show(); // show helpers +kik.formHelpers.hide(); // hide helpers +kik.formHelpers.isEnabled(); // check if enabled + +// backlight will not turn off as long +// as your webpage is visible to the user +kik.browser.backlightTimeout(false); + +// backlight will timeout as per OS rules +kik.browser.backlightTimeout(true); + +function eventHandler () { + // do something when event occurs +} + +// bind to event +kik.on("message", eventHandler); + +// unbind from event +kik.off("message", eventHandler); + +// bind to an event once (ignoring subsequent occurrences) +kik.once("message", eventHandler); + +kik.trigger("message", { + title : "Fake message" , + // object will be passed to all event listeners +}); + +let os = kik.utils.platform.os; +typeof os.name === "string"; // "ios", "android", "osx", "windows", etc +typeof os.version === "number"; // numeric version number + +let browser = kik.utils.platform.browser; +typeof browser.name === "string"; // "chrome", "safari", "opera", etc +typeof browser.version === "number"; // numeric version number + +let version = kik.utils.platform.version; +typeof browser.name === "string"; +typeof browser.version === "number"; // numeric version number \ No newline at end of file diff --git a/kik-browser/kik-browser.d.ts b/kik-browser/kik-browser.d.ts new file mode 100644 index 0000000000..3e183b0e21 --- /dev/null +++ b/kik-browser/kik-browser.d.ts @@ -0,0 +1,135 @@ +// Type definitions for Kik Cards v2.3.6 +// Project: https://dev.kik.com +// Definitions by: Joel Day +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +interface Kik { + enabled: boolean; + message: KikMessage; + + send(user: string, message: KikMessage): void; + send(message: KikMessage): void; + ready(callback: () => void): void; + hasPermission(): boolean; + open(url: string, popupMode?: boolean): void; + on(property: string, eventHandler: () => void): void; + off(property: string, eventHandler: () => void): void; + once(property: string, eventHandler: () => void): void; + trigger(property: string, data?: any): void; + linkData: string; + getUser(callback: (user: KikUser) => void): void; + getAnonymousUser(callback: (token: string) => void): void; + sign(data: string, callback: (signedData: string, username: string, host: string) => void): void; + anonymousSign(data: string, callback: (signedData: string, anonToken: string, host: string) => void): void; + openConversation(username: string): void; + showProfile(username: string): void; + pickUsers(options: KikPickUsersOptions, callback: (users: KikUser[]) => void): void; + pickUsers(callback: (users: KikUser[]) => void): void; + + formHelpers: { + show(): void; + hide(): void; + isEnabled(): boolean; + }; + + metrics: { + enableGoogleAnalytics(): void; + enableGoogleAnalytics(trackingId: string, domain: string, oldApi?: boolean): void; + }; + + photo: { + get(options: KikGetOptions, callback: (photos: string[]) => void): void; + getFromCamera(callbacks: KikGetFromCameraCallbacks): void; + getFromCamera(options: KikGetFromCameraOptions, callbacks: KikGetFromCameraCallbacks): void; + getFromGallery(callback: (photos: string[]) => void): void; + getFromGallery(options: KikGetOptions, callback: (photos: string[]) => void): void; + saveToGallery(url: string, callback: (status: boolean) => void): void; + get(callback: (photos: string[]) => void): void; + }; + + picker: { + (url: string, data: any, callback: (response: any) => void): void; + reply: (data: any) => void; + }; + + browser: { + background: boolean; + back(callback: () => boolean | void): void; + unbindBack(callback: () => boolean | void): void; + on(property: string, callback: () => void): void; + off(property: string, callback: () => void): void; + once(property: string, callback: () => void): void; + trigger(property: string, data?: any): void; + getOrientationLock(): string; + setOrientationLock(lock: "free" | "landscape" | "portrait"): void; + setOrientationLock(lock: string): void; + statusBar(show: boolean): void; + backlightTimeout(timeout: boolean): void; + }; + + utils: { + platform: { + os: { + name: string; + version: string; + }; + browser: { + name: string; + version: string; + }; + version: { + name: string; + version: string; + }; + }; + }; +} + +interface KikUser { + username: string; + fullName: string; + firstName: string; + lastName: string; + pic: string; + thumbnail: string; +} + +interface KikMessage { + title: string; + text: string; + pic?: string; + big?: boolean; + noForward?: boolean; + data?: any; +} + +interface KikPickUsersOptions { + minResults?: number; + maxResults?: number; + preselected?: { username: string }[]; + filtered?: string[]; + filterSelf?: boolean; +} + +interface KikGetOptions { + quality?: number; + minResults?: number; + maxResults?: number; + maxHeight?: number; + maxWidth?: number; +} + +interface KikGetFromCameraOptions { + quality?: number; + maxHeight?: number; + maxWidth?: number; +} + +interface KikGetFromCameraCallbacks { + onSelect: (numPhotos: number) => void; + onPhoto: (photo: string, index: number) => void; + onComplete: (photos: string[]) => void; + onCancel: () => void; +} + +declare const kik: Kik; \ No newline at end of file diff --git a/knex/knex-tests.ts b/knex/knex-tests.ts index e983ec1084..410139f4b6 100644 --- a/knex/knex-tests.ts +++ b/knex/knex-tests.ts @@ -1,8 +1,10 @@ /// + /// -import Knex = require('knex'); -import _ = require('lodash'); -'use strict'; + +import * as Knex from 'knex'; +import * as _ from 'lodash'; + // Initializing the Library var knex = Knex({ client: 'sqlite3', @@ -594,8 +596,8 @@ knex.migrate.latest(); knex.migrate.rollback(config); knex.migrate.rollback(); -knex.migrate.currentversion(config); -knex.migrate.currentversion(); +knex.migrate.currentVersion(config); +knex.migrate.currentVersion(); knex.seed.make(name, config); knex.seed.make(name); diff --git a/knex/knex.d.ts b/knex/knex.d.ts index 52740662c8..6fadd1b450 100644 --- a/knex/knex.d.ts +++ b/knex/knex.d.ts @@ -3,16 +3,16 @@ // Definitions by: Qubo // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// +/// /// declare module "knex" { - // import Promise = require("bluebird"); + import Promise = require("bluebird"); import * as events from "events"; type Callback = Function; type Client = Function; - type Value = string|number|boolean|Date; + type Value = string|number|boolean|Date|Array|Array|Array|Array; type ColumnName = string|Knex.Raw|Knex.QueryBuilder; interface Knex extends Knex.QueryInterface { @@ -28,7 +28,7 @@ declare module "knex" { schema: Knex.SchemaBuilder; client: any; - migrate: any; + migrate: Knex.Migrator; seed: any; fn: any; } @@ -299,10 +299,10 @@ declare module "knex" { // Schema builder // - interface SchemaBuilder { - createTable(tableName: string, callback: (tableBuilder: CreateTableBuilder) => any): Promise; + interface SchemaBuilder extends Promise { + createTable(tableName: string, callback: (tableBuilder: CreateTableBuilder) => any): SchemaBuilder; renameTable(oldTableName: string, newTableName: string): Promise; - dropTable(tableName: string): Promise; + dropTable(tableName: string): SchemaBuilder; hasTable(tableName: string): Promise; hasColumn(tableName: string, columnName: string): Promise; table(tableName: string, callback: (tableBuilder: AlterTableBuilder) => any): Promise; @@ -339,6 +339,7 @@ declare module "knex" { unique(columnNames: string[], indexName?: string) : TableBuilder; foreign(column: string): ForeignConstraintBuilder; foreign(columns: string[]): MultikeyForeignConstraintBuilder; + dropForeign(columnNames: string[], foreignKeyName?: string): TableBuilder; } interface CreateTableBuilder extends TableBuilder { @@ -369,15 +370,15 @@ declare module "knex" { nullable(): ColumnBuilder; comment(value: string): ColumnBuilder; } - + interface ForeignConstraintBuilder { references(columnName: string): ReferencingColumnBuilder; } - + interface MultikeyForeignConstraintBuilder { references(columnNames: string[]): ReferencingColumnBuilder; } - + interface PostgreSqlColumnBuilder extends ColumnBuilder { index(indexName?: string, indexType?: string): ColumnBuilder; } @@ -412,7 +413,7 @@ declare module "knex" { connection?: string|ConnectionConfig|MariaSqlConnectionConfig| Sqlite3ConnectionConfig|SocketConnectionConfig; pool?: PoolConfig; - migrations?: MigrationConfig; + migrations?: MigratorConfig; } interface ConnectionConfig { @@ -486,12 +487,20 @@ declare module "knex" { log?: boolean; } - interface MigrationConfig { + interface MigratorConfig { database?: string; directory?: string; extension?: string; tableName?: string; } + + interface Migrator { + make(name:string, config?: MigratorConfig):Promise; + latest(config?: MigratorConfig):Promise; + rollback(config?: MigratorConfig):Promise; + status(config?: MigratorConfig):Promise; + currentVersion(config?: MigratorConfig):Promise; + } } export = Knex; diff --git a/knockout.deferred.updates/knockout.deferred.updates-tests.ts b/knockout.deferred.updates/knockout.deferred.updates-tests.ts deleted file mode 100644 index 060ff3984a..0000000000 --- a/knockout.deferred.updates/knockout.deferred.updates-tests.ts +++ /dev/null @@ -1,252 +0,0 @@ -/// - -// Turn *off* deferred updates for computed observables and subscriptions -ko.computed.deferUpdates = false; - -var myComputed = ko.computed(() => { /* ... */ }); -// Turn *on* deferred updates for this computed observable -myComputed.deferUpdates = true; - -var myObservable = ko.observable(); -var mySubscription = myObservable.subscribe((value) => { /* ... */ }); -// Turn *on* deferred updates for this subscription -mySubscription.deferUpdates = true; - -// Turn *off* deferred updates for this computed observable -myComputed.extend({ deferred: false }); - - -// -// Examples -// - -function nestedComputedNoPlugin() { - var vm: any = { - a: ko.observable(0), - b: ko.observable(0), - c: ko.observable(0), - d: ko.observable(0), - e: ko.observable(0), - f: ko.observable(0) - }; - - var startTime = new Date().getTime(); - var updateArray = []; - - function firstUpdate() { - var updateList = document.getElementById('updates'); - while (updateList.firstChild) updateList.removeChild(updateList.firstChild); - } - - function pushUpdate(name, value, color) { - var li = document.createElement('li'); - li.appendChild(document.createTextNode(name + ' ' + value + '; ' + (new Date().getTime() - startTime) + ' ms')); - li.style.color = color; - document.getElementById('updates').appendChild(li); - } - - function lastUpdate() { - } - - var updateCounter = 0, plusminus = 1; - - vm.doUpdate = function () { - var u = updateCounter += plusminus; - startTime = new Date().getTime(); - vm.a(u); - vm.b(u); - vm.c(u); - vm.d(u); - vm.e(u); - vm.f(u); - plusminus = !u ? 1 : (u == 9) ? -1 : plusminus; - }; - - vm.setThrottle = function (value) { - vm.A.throttleEvaluation = value; - vm._B.throttleEvaluation = value; - vm.C.throttleEvaluation = value; - vm.D.throttleEvaluation = value; - vm.E.throttleEvaluation = value; - vm.F.throttleEvaluation = value; - }; - - vm.runNormal = function () { - ko.computed.deferUpdates = false; - vm.setThrottle(undefined); - vm.doUpdate(); - }; - - vm.runThrottle = function () { - ko.computed.deferUpdates = false; - vm.setThrottle(1); - vm.doUpdate(); - }; - - vm.A = ko.computed(function () { - var result = '' + vm.a(); - firstUpdate(); - pushUpdate('A', result, 'green'); - return result; - }, null, { deferEvaluation: true }); - - vm._B = ko.computed(function () { - var result = '' + vm.A() + vm.b(); - pushUpdate('B', result, 'darkturquoise'); - return result; - }, null, { deferEvaluation: true }); - - vm.C = ko.computed(function () { - var result = '' + vm._B() + vm.c(); - pushUpdate('C', result, 'royalblue'); - return result; - }, null, { deferEvaluation: true }); - - vm.D = ko.computed(function () { - var result = '' + vm.C() + vm.d(); - pushUpdate('D', result, 'indigo'); - return result; - }, null, { deferEvaluation: true }); - - vm.E = ko.computed(function () { - var result = '' + vm.D() + vm.e(); - pushUpdate('E', result, 'firebrick'); - return result; - }, null, { deferEvaluation: true }); - - vm.F = ko.computed(function () { - var f = vm.f(), result = '' + vm.E() + f; - pushUpdate('F', result, 'orangered'); - if (result === '' + f + f + f + f + f + f) lastUpdate(); - return result; - }, null, { deferEvaluation: true }); - - vm.A(); - vm._B(); - vm.C(); - vm.D(); - vm.E(); - vm.F(); - - ko.applyBindings(vm); -}; - -function nestedComputedPlugin() { - var vm: any = { - a: ko.observable(0), - b: ko.observable(0), - c: ko.observable(0), - d: ko.observable(0), - e: ko.observable(0), - f: ko.observable(0) - }; - - var startTime = new Date().getTime(); - var updateArray = []; - - function firstUpdate() { - var updateList = document.getElementById('updates'); - while (updateList.firstChild) - updateList.removeChild(updateList.firstChild); - } - - function pushUpdate(name, value, color) { - var li = document.createElement('li'); - li.appendChild(document.createTextNode(name + ' ' + value + '; ' + (new Date().getTime() - startTime) + ' ms')); - li.style.color = color; - document.getElementById('updates').appendChild(li); - } - - function lastUpdate() { - } - - var updateCounter = 0, plusminus = 1; - - vm.doUpdate = function () { - var u = updateCounter += plusminus; - startTime = new Date().getTime(); - vm.a(u); - vm.b(u); - vm.c(u); - vm.d(u); - vm.e(u); - vm.f(u); - plusminus = !u ? 1 : (u == 9) ? -1 : plusminus; - }; - - vm.setThrottle = function (value) { - vm.A.throttleEvaluation = value; - vm._B.throttleEvaluation = value; - vm.C.throttleEvaluation = value; - vm.D.throttleEvaluation = value; - vm.E.throttleEvaluation = value; - vm.F.throttleEvaluation = value; - }; - - vm.runNormal = function () { - ko.computed.deferUpdates = false; - vm.setThrottle(undefined); - vm.doUpdate(); - }; - - vm.runThrottle = function () { - ko.computed.deferUpdates = false; - vm.setThrottle(1); - vm.doUpdate(); - }; - - vm.runDefer = function () { - ko.computed.deferUpdates = true; - vm.setThrottle(undefined); - vm.doUpdate(); - }; - - vm.runWrappedDefer = ko.tasks.makeProcessedCallback(vm.runDefer); - - vm.A = ko.computed(function () { - var result = '' + vm.a(); - firstUpdate(); - pushUpdate('A', result, 'green'); - return result; - }, null, { deferEvaluation: true }); - - vm._B = ko.computed(function () { - var result = '' + vm.A() + vm.b(); - pushUpdate('B', result, 'darkturquoise'); - return result; - }, null, { deferEvaluation: true }); - - vm.C = ko.computed(function () { - var result = '' + vm._B() + vm.c(); - pushUpdate('C', result, 'royalblue'); - return result; - }, null, { deferEvaluation: true }); - - vm.D = ko.computed(function () { - var result = '' + vm.C() + vm.d(); - pushUpdate('D', result, 'indigo'); - return result; - }, null, { deferEvaluation: true }); - - vm.E = ko.computed(function () { - var result = '' + vm.D() + vm.e(); - pushUpdate('E', result, 'firebrick'); - return result; - }, null, { deferEvaluation: true }); - - vm.F = ko.computed(function () { - var f = vm.f(), result = '' + vm.E() + f; - pushUpdate('F', result, 'orangered'); - if (result === '' + f + f + f + f + f + f) lastUpdate(); - return result; - }, null, { deferEvaluation: true }); - - vm.A(); - vm._B(); - vm.C(); - vm.D(); - vm.E(); - vm.F(); - - ko.applyBindings(vm); -} diff --git a/knockout.deferred.updates/knockout.deferred.updates-tests.ts.tscparams b/knockout.deferred.updates/knockout.deferred.updates-tests.ts.tscparams deleted file mode 100644 index 8b13789179..0000000000 --- a/knockout.deferred.updates/knockout.deferred.updates-tests.ts.tscparams +++ /dev/null @@ -1 +0,0 @@ - diff --git a/knockout.deferred.updates/knockout.deferred.updates.d.ts b/knockout.deferred.updates/knockout.deferred.updates.d.ts deleted file mode 100644 index d3c5d7b40d..0000000000 --- a/knockout.deferred.updates/knockout.deferred.updates.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -// Type definitions for Knockout Deferred Updates -// Project: https://github.com/mbest/knockout-deferred-updates -// Definitions by: Sebastián Galiano -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - -interface KnockoutDeferredTasks { - processImmediate(evaluator: Function, object?: any, args?: any[]): any; - processDelayed(evaluator: Function, distinct?: boolean, options?: any[]): boolean; - makeProcessedCallback(evaluator: Function): void; -} - -// Knockout global -interface KnockoutStatic { - tasks: KnockoutDeferredTasks; - processAllDeferredBindingUpdates(): void; - processAllDeferredUpdates(): void; - evaluateAsynchronously(evaluator: Function, timeout?: any): number; - ignoreDependencies(callback: Function, callbackTarget: any, callbackArgs?: any[]); -} - -// Observables -interface KnockoutSubscribableFunctions { - deferUpdates: boolean; -} - -// Computed -interface KnockoutComputedStatic { - deferUpdates: boolean; -} - -interface KnockoutSubscription { - deferUpdates: boolean; -} - -// Utils -interface KnockoutUtils { - objectForEach(obj: any, action: Function): void; - objectMap(source: any, mapping: Function): any; -} - -// Deferred extender -interface KnockoutExtenders { - deferred(target: any, value: boolean): any; -} \ No newline at end of file diff --git a/knockout.deferred.updates/knockout.deferred.updates.d.ts.tscparams b/knockout.deferred.updates/knockout.deferred.updates.d.ts.tscparams deleted file mode 100644 index 8b13789179..0000000000 --- a/knockout.deferred.updates/knockout.deferred.updates.d.ts.tscparams +++ /dev/null @@ -1 +0,0 @@ - diff --git a/knockout.validation/knockout.validation.d.ts b/knockout.validation/knockout.validation.d.ts index a308a60f02..df4cdade1c 100644 --- a/knockout.validation/knockout.validation.d.ts +++ b/knockout.validation/knockout.validation.d.ts @@ -6,22 +6,95 @@ /// interface KnockoutValidationGroupingOptions { + /** + * indicates whether to walk the ViewModel (or object) + * recursively, or only walk first-level properties. + */ deep?: boolean; + /** + * indicates whether the returned errors object + * is a ko.computed or a simple function + */ observable?: boolean; + /** + * indicates whether changes to observableArrays inside + * the model should cause the validator to re-run + */ + live?: boolean; +} + +interface KnockoutValidationValidateOptions { + throttle?: number; } interface KnockoutValidationConfiguration { - registerExtenders?: boolean; - messagesOnModified?: boolean; - messageTemplate?: string; - insertMessages?: boolean; - parseInputAttributes?: boolean; - writeInputAttributes?: boolean; + /** + * Allows HTML in validation messages + */ + allowHtmlMessages?: boolean; + /** + * Indicates whether css error classes are added only + * when properties are modified or at all times + * @type {[type]} + */ + decorateElementOnModified?: boolean; + /** + * Indicates whether to assign an error class to the tag + * when your property is invalid + */ decorateInputElement?: boolean; + /** + * If defined, the CSS class assigned to both and validation message elements + */ errorClass?: string; + /** + * The CSS class assigned to validation error elements, must have decorateInputElement set to true + */ errorElementClass?: string; + /** + * The CSS class assigned to validation error messages + */ errorMessageClass?: string; + /** + * Shows tooltips using input 'title' attribute. False hides them + */ + errorsAsTitle?: boolean; + /** + * Shows the error when hovering the input field (decorateElement must be true) + */ + errorsAsTitleOnModified?: boolean; grouping?: KnockoutValidationGroupingOptions; + /** + * If true validation will insert either a element or the template + * specified by messageTemplate after any element (e.g. ) + * that uses a KO value binding with a validated field + */ + insertMessages?: boolean; + /** + * Indicates whether validation messages are triggered only + * when properties are modified or at all times + */ + messagesOnModified?: boolean; + /** + * The id of the + * that you want to use for all your validation messages + */ + messageTemplate?: string; + /** + * Indicates whether to assign validation rules to your ViewModel + * using HTML5 validation attributes + */ + parseInputAttributes?: boolean; + /** + * Register custom validation rules defined via ko.validation.rules + */ + registerExtenders?: boolean; + validate?: KnockoutValidationValidateOptions; + /** + * Add HTML5 input validation attributes to form elements + * that ko observable's are bound to + */ + writeInputAttributes?: boolean; } interface KnockoutValidationUtils { @@ -106,6 +179,10 @@ interface KnockoutValidationGroup { isAnyMessageShown?: () => boolean; } +interface KnockoutValidationLocalizationDictionary { + [key: string]: string; +} + interface KnockoutValidationStatic { init(options?: KnockoutValidationConfiguration, force?: boolean): void; reset(): void; @@ -127,7 +204,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; } @@ -148,7 +227,7 @@ interface KnockoutSubscribableFunctions { } declare module "knockout.validation" { - export = validation; + export = validation; } -declare var validation: KnockoutValidationStatic +declare var validation: KnockoutValidationStatic diff --git a/knockout/knockout.d.ts b/knockout/knockout.d.ts index 962a776333..6e53ac2e25 100644 --- a/knockout/knockout.d.ts +++ b/knockout/knockout.d.ts @@ -1,6 +1,6 @@ -// Type definitions for Knockout v3.2.0 +// Type definitions for Knockout v3.4.0 // Project: http://knockoutjs.com -// Definitions by: Boris Yankov , Igor Oleinikov , Clément Bourgeois +// Definitions by: Boris Yankov , Igor Oleinikov , Clément Bourgeois , Matt Brooks // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -387,6 +387,17 @@ interface KnockoutTemplateEngine extends KnockoutNativeTemplateEngine { rewriteTemplate(template: any, rewriterCallback: Function, templateDocument: Document): void; } +////////////////////////////////// +// tasks.js +////////////////////////////////// + +interface KnockoutTasks { + scheduler: (callback: Function) => any; + schedule(task: Function): number; + cancel(handle: number): void; + runEarly(): void; +} + ///////////////////////////////// interface KnockoutStatic { @@ -544,7 +555,13 @@ interface KnockoutStatic { deferUpdates: boolean, useOnlyNativeEvents: boolean - } + }; + + ///////////////////////////////// + // tasks.js + ///////////////////////////////// + + tasks: KnockoutTasks; } interface KnockoutBindingProvider { diff --git a/knockout/tests/knockout-tests.ts b/knockout/tests/knockout-tests.ts index e9334a7534..8da6c12950 100644 --- a/knockout/tests/knockout-tests.ts +++ b/knockout/tests/knockout-tests.ts @@ -570,8 +570,8 @@ function test_misc() { $(element).datepicker("destroy"); }); - this.observableFactory = function(): KnockoutObservable{ - if (true) { + this.observableFactory = function(flag = true): KnockoutObservable{ + if (flag) { return ko.computed({ read:function(){ return 3; @@ -655,3 +655,28 @@ function testUnwrapUnion() { var num = ko.unwrap(possibleObs); } + +function test_tasks() { + // Schedule an empty task + ko.tasks.schedule(function() { + }); + + // Schedule a task with arguments and return type + let logSomethingTask = (message: string) => { + console.log("Log message"); + return true; + }; + + let taskHandle = ko.tasks.schedule(logSomethingTask); + + // Cancel a task + ko.tasks.cancel(taskHandle); + + // Process the current microtask queue on demand + ko.tasks.runEarly(); + + // Redefine or augment how Knockout schedules the event to process and flush the queue + ko.tasks.scheduler = function (callback) { + setTimeout(callback, 0); + }; +} 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/koa-mount/koa-mount-tests.ts b/koa-mount/koa-mount-tests.ts new file mode 100644 index 0000000000..560938b22f --- /dev/null +++ b/koa-mount/koa-mount-tests.ts @@ -0,0 +1,26 @@ +/// +/// + +import * as Koa from "koa"; +import mount = require("koa-mount"); + +const a = new Koa(); + +a.use((next) => { + this.body = "Hello"; +}) + +const b = new Koa(); + +b.use((next) => { + this.body = "World"; +}); + +const app = new Koa(); + +app.use(mount("/hello", a)); +app.use(mount("/world", b)); + +app.listen(3000); +console.log("listening on port 3000"); + diff --git a/koa-mount/koa-mount.d.ts b/koa-mount/koa-mount.d.ts new file mode 100644 index 0000000000..6c9c83bb73 --- /dev/null +++ b/koa-mount/koa-mount.d.ts @@ -0,0 +1,23 @@ +// Type definitions for koa-mount v2.0.0 +// Project: https://github.com/koajs/mount +// Definitions by: AmirSaber Sharifi +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare module "koa-mount" { + + import * as Koa from "koa"; + + interface Function { (ctx: Koa.Context, next?: () => any): any } + + function mount(app: Function): Function; + + function mount(app: Koa): Function; + + function mount(prefix: string, app: Function): Function; + + function mount(prefix: string, app: Koa): Function; + + export = mount; +} diff --git a/kolite/knockout.activity.d.ts b/kolite/knockout.activity.d.ts index c5d876f630..02d7e75f37 100644 --- a/kolite/knockout.activity.d.ts +++ b/kolite/knockout.activity.d.ts @@ -28,8 +28,18 @@ interface KoLiteActivity { getOpacity(options: { steps?: number; segments?: number; opacity?: number; }, i: number): number; } +interface KoLiteActivityDefaultOptions { + activityClass?: string, + container?: string, + inactiveClass?: string +} + +interface KoLiteActivityBindingHandler extends KnockoutBindingHandler { + defaultOptions: KoLiteActivityDefaultOptions +} + interface KnockoutBindingHandlers { - activity: KnockoutBindingHandler; + activity: KoLiteActivityBindingHandler; } interface JQuery { diff --git a/kolite/kolite-tests.ts b/kolite/kolite-tests.ts index a7b6d08f01..8cafcf6946 100644 --- a/kolite/kolite-tests.ts +++ b/kolite/kolite-tests.ts @@ -2,6 +2,20 @@ /// /// +function test_activityDefaults() { + ko.bindingHandlers.activity.defaultOptions = { + activityClass: 'fa fa-spinner fa-spin', + container: 'i', + inactiveClass: '' + }; + + ko.bindingHandlers.activity.defaultOptions = { + activityClass: 'some Value' + }; + + ko.bindingHandlers.activity.defaultOptions = { + }; +} function test_asyncCommand() { var saveCmd = ko.asyncCommand({ execute: function (complete) { 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/locutus/locutus-tests.ts b/locutus/locutus-tests.ts new file mode 100644 index 0000000000..a465bbd4fa --- /dev/null +++ b/locutus/locutus-tests.ts @@ -0,0 +1,353 @@ +/// +import locutus_c_math_abs = require('locutus/c/math/abs'); +import locutus_golang_strings_Contains = require('locutus/golang/strings/Contains'); +import locutus_golang_strings_Count = require('locutus/golang/strings/Count'); +import locutus_golang_strings_Index = require('locutus/golang/strings/Index'); +import locutus_golang_strings_LastIndex = require('locutus/golang/strings/LastIndex'); +import locutus_php_array_array_change_key_case = require('locutus/php/array/array_change_key_case'); +import locutus_php_array_array_chunk = require('locutus/php/array/array_chunk'); +import locutus_php_array_array_combine = require('locutus/php/array/array_combine'); +import locutus_php_array_array_count_values = require('locutus/php/array/array_count_values'); +import locutus_php_array_array_diff = require('locutus/php/array/array_diff'); +import locutus_php_array_array_diff_assoc = require('locutus/php/array/array_diff_assoc'); +import locutus_php_array_array_diff_key = require('locutus/php/array/array_diff_key'); +import locutus_php_array_array_diff_uassoc = require('locutus/php/array/array_diff_uassoc'); +import locutus_php_array_array_diff_ukey = require('locutus/php/array/array_diff_ukey'); +import locutus_php_array_array_fill = require('locutus/php/array/array_fill'); +import locutus_php_array_array_fill_keys = require('locutus/php/array/array_fill_keys'); +import locutus_php_array_array_filter = require('locutus/php/array/array_filter'); +import locutus_php_array_array_flip = require('locutus/php/array/array_flip'); +import locutus_php_array_array_intersect = require('locutus/php/array/array_intersect'); +import locutus_php_array_array_intersect_assoc = require('locutus/php/array/array_intersect_assoc'); +import locutus_php_array_array_intersect_key = require('locutus/php/array/array_intersect_key'); +import locutus_php_array_array_intersect_uassoc = require('locutus/php/array/array_intersect_uassoc'); +import locutus_php_array_array_intersect_ukey = require('locutus/php/array/array_intersect_ukey'); +import locutus_php_array_array_key_exists = require('locutus/php/array/array_key_exists'); +import locutus_php_array_array_keys = require('locutus/php/array/array_keys'); +import locutus_php_array_array_map = require('locutus/php/array/array_map'); +import locutus_php_array_array_merge = require('locutus/php/array/array_merge'); +import locutus_php_array_array_merge_recursive = require('locutus/php/array/array_merge_recursive'); +import locutus_php_array_array_multisort = require('locutus/php/array/array_multisort'); +import locutus_php_array_array_pad = require('locutus/php/array/array_pad'); +import locutus_php_array_array_pop = require('locutus/php/array/array_pop'); +import locutus_php_array_array_product = require('locutus/php/array/array_product'); +import locutus_php_array_array_push = require('locutus/php/array/array_push'); +import locutus_php_array_array_rand = require('locutus/php/array/array_rand'); +import locutus_php_array_array_reduce = require('locutus/php/array/array_reduce'); +import locutus_php_array_array_replace = require('locutus/php/array/array_replace'); +import locutus_php_array_array_replace_recursive = require('locutus/php/array/array_replace_recursive'); +import locutus_php_array_array_reverse = require('locutus/php/array/array_reverse'); +import locutus_php_array_array_search = require('locutus/php/array/array_search'); +import locutus_php_array_array_shift = require('locutus/php/array/array_shift'); +import locutus_php_array_array_slice = require('locutus/php/array/array_slice'); +import locutus_php_array_array_splice = require('locutus/php/array/array_splice'); +import locutus_php_array_array_sum = require('locutus/php/array/array_sum'); +import locutus_php_array_array_udiff = require('locutus/php/array/array_udiff'); +import locutus_php_array_array_udiff_assoc = require('locutus/php/array/array_udiff_assoc'); +import locutus_php_array_array_udiff_uassoc = require('locutus/php/array/array_udiff_uassoc'); +import locutus_php_array_array_uintersect = require('locutus/php/array/array_uintersect'); +import locutus_php_array_array_uintersect_uassoc = require('locutus/php/array/array_uintersect_uassoc'); +import locutus_php_array_array_unique = require('locutus/php/array/array_unique'); +import locutus_php_array_array_unshift = require('locutus/php/array/array_unshift'); +import locutus_php_array_array_values = require('locutus/php/array/array_values'); +import locutus_php_array_array_walk = require('locutus/php/array/array_walk'); +import locutus_php_array_arsort = require('locutus/php/array/arsort'); +import locutus_php_array_asort = require('locutus/php/array/asort'); +import locutus_php_array_count = require('locutus/php/array/count'); +import locutus_php_array_current = require('locutus/php/array/current'); +import locutus_php_array_each = require('locutus/php/array/each'); +import locutus_php_array_end = require('locutus/php/array/end'); +import locutus_php_array_in_array = require('locutus/php/array/in_array'); +import locutus_php_array_key = require('locutus/php/array/key'); +import locutus_php_array_krsort = require('locutus/php/array/krsort'); +import locutus_php_array_ksort = require('locutus/php/array/ksort'); +import locutus_php_array_natcasesort = require('locutus/php/array/natcasesort'); +import locutus_php_array_natsort = require('locutus/php/array/natsort'); +import locutus_php_array_next = require('locutus/php/array/next'); +import locutus_php_array_pos = require('locutus/php/array/pos'); +import locutus_php_array_prev = require('locutus/php/array/prev'); +import locutus_php_array_range = require('locutus/php/array/range'); +import locutus_php_array_reset = require('locutus/php/array/reset'); +import locutus_php_array_rsort = require('locutus/php/array/rsort'); +import locutus_php_array_shuffle = require('locutus/php/array/shuffle'); +import locutus_php_array_sizeof = require('locutus/php/array/sizeof'); +import locutus_php_array_sort = require('locutus/php/array/sort'); +import locutus_php_array_uasort = require('locutus/php/array/uasort'); +import locutus_php_array_uksort = require('locutus/php/array/uksort'); +import locutus_php_array_usort = require('locutus/php/array/usort'); +import locutus_php_bc_bcadd = require('locutus/php/bc/bcadd'); +import locutus_php_bc_bccomp = require('locutus/php/bc/bccomp'); +import locutus_php_bc_bcdiv = require('locutus/php/bc/bcdiv'); +import locutus_php_bc_bcmul = require('locutus/php/bc/bcmul'); +import locutus_php_bc_bcround = require('locutus/php/bc/bcround'); +import locutus_php_bc_bcscale = require('locutus/php/bc/bcscale'); +import locutus_php_bc_bcsub = require('locutus/php/bc/bcsub'); +import locutus_php_ctype_ctype_alnum = require('locutus/php/ctype/ctype_alnum'); +import locutus_php_ctype_ctype_alpha = require('locutus/php/ctype/ctype_alpha'); +import locutus_php_ctype_ctype_cntrl = require('locutus/php/ctype/ctype_cntrl'); +import locutus_php_ctype_ctype_digit = require('locutus/php/ctype/ctype_digit'); +import locutus_php_ctype_ctype_graph = require('locutus/php/ctype/ctype_graph'); +import locutus_php_ctype_ctype_lower = require('locutus/php/ctype/ctype_lower'); +import locutus_php_ctype_ctype_print = require('locutus/php/ctype/ctype_print'); +import locutus_php_ctype_ctype_punct = require('locutus/php/ctype/ctype_punct'); +import locutus_php_ctype_ctype_space = require('locutus/php/ctype/ctype_space'); +import locutus_php_ctype_ctype_upper = require('locutus/php/ctype/ctype_upper'); +import locutus_php_ctype_ctype_xdigit = require('locutus/php/ctype/ctype_xdigit'); +import locutus_php_datetime_checkdate = require('locutus/php/datetime/checkdate'); +import locutus_php_datetime_date = require('locutus/php/datetime/date'); +import locutus_php_datetime_date_parse = require('locutus/php/datetime/date_parse'); +import locutus_php_datetime_getdate = require('locutus/php/datetime/getdate'); +import locutus_php_datetime_gettimeofday = require('locutus/php/datetime/gettimeofday'); +import locutus_php_datetime_gmdate = require('locutus/php/datetime/gmdate'); +import locutus_php_datetime_gmmktime = require('locutus/php/datetime/gmmktime'); +import locutus_php_datetime_gmstrftime = require('locutus/php/datetime/gmstrftime'); +import locutus_php_datetime_idate = require('locutus/php/datetime/idate'); +import locutus_php_datetime_microtime = require('locutus/php/datetime/microtime'); +import locutus_php_datetime_mktime = require('locutus/php/datetime/mktime'); +import locutus_php_datetime_strftime = require('locutus/php/datetime/strftime'); +import locutus_php_datetime_strptime = require('locutus/php/datetime/strptime'); +import locutus_php_datetime_strtotime = require('locutus/php/datetime/strtotime'); +import locutus_php_datetime_time = require('locutus/php/datetime/time'); +import locutus_php_exec_escapeshellarg = require('locutus/php/exec/escapeshellarg'); +import locutus_php_filesystem_basename = require('locutus/php/filesystem/basename'); +import locutus_php_filesystem_dirname = require('locutus/php/filesystem/dirname'); +import locutus_php_filesystem_file_get_contents = require('locutus/php/filesystem/file_get_contents'); +import locutus_php_filesystem_pathinfo = require('locutus/php/filesystem/pathinfo'); +import locutus_php_filesystem_realpath = require('locutus/php/filesystem/realpath'); +import locutus_php_funchand_call_user_func = require('locutus/php/funchand/call_user_func'); +import locutus_php_funchand_call_user_func_array = require('locutus/php/funchand/call_user_func_array'); +import locutus_php_funchand_create_function = require('locutus/php/funchand/create_function'); +import locutus_php_funchand_function_exists = require('locutus/php/funchand/function_exists'); +import locutus_php_funchand_get_defined_functions = require('locutus/php/funchand/get_defined_functions'); +import locutus_php_i18n_i18n_loc_get_default = require('locutus/php/i18n/i18n_loc_get_default'); +import locutus_php_i18n_i18n_loc_set_default = require('locutus/php/i18n/i18n_loc_set_default'); +import locutus_php_info_assert_options = require('locutus/php/info/assert_options'); +import locutus_php_info_getenv = require('locutus/php/info/getenv'); +import locutus_php_info_ini_get = require('locutus/php/info/ini_get'); +import locutus_php_info_ini_set = require('locutus/php/info/ini_set'); +import locutus_php_info_set_time_limit = require('locutus/php/info/set_time_limit'); +import locutus_php_info_version_compare = require('locutus/php/info/version_compare'); +import locutus_php_json_json_decode = require('locutus/php/json/json_decode'); +import locutus_php_json_json_encode = require('locutus/php/json/json_encode'); +import locutus_php_json_json_last_error = require('locutus/php/json/json_last_error'); +import locutus_php_math_abs = require('locutus/php/math/abs'); +import locutus_php_math_acos = require('locutus/php/math/acos'); +import locutus_php_math_acosh = require('locutus/php/math/acosh'); +import locutus_php_math_asin = require('locutus/php/math/asin'); +import locutus_php_math_asinh = require('locutus/php/math/asinh'); +import locutus_php_math_atan = require('locutus/php/math/atan'); +import locutus_php_math_atan2 = require('locutus/php/math/atan2'); +import locutus_php_math_atanh = require('locutus/php/math/atanh'); +import locutus_php_math_base_convert = require('locutus/php/math/base_convert'); +import locutus_php_math_bindec = require('locutus/php/math/bindec'); +import locutus_php_math_ceil = require('locutus/php/math/ceil'); +import locutus_php_math_cos = require('locutus/php/math/cos'); +import locutus_php_math_cosh = require('locutus/php/math/cosh'); +import locutus_php_math_decbin = require('locutus/php/math/decbin'); +import locutus_php_math_dechex = require('locutus/php/math/dechex'); +import locutus_php_math_decoct = require('locutus/php/math/decoct'); +import locutus_php_math_deg2rad = require('locutus/php/math/deg2rad'); +import locutus_php_math_exp = require('locutus/php/math/exp'); +import locutus_php_math_expm1 = require('locutus/php/math/expm1'); +import locutus_php_math_floor = require('locutus/php/math/floor'); +import locutus_php_math_fmod = require('locutus/php/math/fmod'); +import locutus_php_math_getrandmax = require('locutus/php/math/getrandmax'); +import locutus_php_math_hexdec = require('locutus/php/math/hexdec'); +import locutus_php_math_hypot = require('locutus/php/math/hypot'); +import locutus_php_math_is_finite = require('locutus/php/math/is_finite'); +import locutus_php_math_is_infinite = require('locutus/php/math/is_infinite'); +import locutus_php_math_is_nan = require('locutus/php/math/is_nan'); +import locutus_php_math_lcg_value = require('locutus/php/math/lcg_value'); +import locutus_php_math_log = require('locutus/php/math/log'); +import locutus_php_math_log10 = require('locutus/php/math/log10'); +import locutus_php_math_log1p = require('locutus/php/math/log1p'); +import locutus_php_math_max = require('locutus/php/math/max'); +import locutus_php_math_min = require('locutus/php/math/min'); +import locutus_php_math_mt_getrandmax = require('locutus/php/math/mt_getrandmax'); +import locutus_php_math_mt_rand = require('locutus/php/math/mt_rand'); +import locutus_php_math_octdec = require('locutus/php/math/octdec'); +import locutus_php_math_pi = require('locutus/php/math/pi'); +import locutus_php_math_pow = require('locutus/php/math/pow'); +import locutus_php_math_rad2deg = require('locutus/php/math/rad2deg'); +import locutus_php_math_rand = require('locutus/php/math/rand'); +import locutus_php_math_round = require('locutus/php/math/round'); +import locutus_php_math_sin = require('locutus/php/math/sin'); +import locutus_php_math_sinh = require('locutus/php/math/sinh'); +import locutus_php_math_sqrt = require('locutus/php/math/sqrt'); +import locutus_php_math_tan = require('locutus/php/math/tan'); +import locutus_php_math_tanh = require('locutus/php/math/tanh'); +import locutus_php_misc_pack = require('locutus/php/misc/pack'); +import locutus_php_misc_uniqid = require('locutus/php/misc/uniqid'); +import locutus_php_net_gopher_gopher_parsedir = require('locutus/php/net-gopher/gopher_parsedir'); +import locutus_php_network_inet_ntop = require('locutus/php/network/inet_ntop'); +import locutus_php_network_inet_pton = require('locutus/php/network/inet_pton'); +import locutus_php_network_ip2long = require('locutus/php/network/ip2long'); +import locutus_php_network_long2ip = require('locutus/php/network/long2ip'); +import locutus_php_network_setcookie = require('locutus/php/network/setcookie'); +import locutus_php_network_setrawcookie = require('locutus/php/network/setrawcookie'); +import locutus_php_pcre_preg_quote = require('locutus/php/pcre/preg_quote'); +import locutus_php_pcre_sql_regcase = require('locutus/php/pcre/sql_regcase'); +import locutus_php_strings_addcslashes = require('locutus/php/strings/addcslashes'); +import locutus_php_strings_addslashes = require('locutus/php/strings/addslashes'); +import locutus_php_strings_bin2hex = require('locutus/php/strings/bin2hex'); +import locutus_php_strings_chop = require('locutus/php/strings/chop'); +import locutus_php_strings_chr = require('locutus/php/strings/chr'); +import locutus_php_strings_chunk_split = require('locutus/php/strings/chunk_split'); +import locutus_php_strings_convert_cyr_string = require('locutus/php/strings/convert_cyr_string'); +import locutus_php_strings_convert_uuencode = require('locutus/php/strings/convert_uuencode'); +import locutus_php_strings_count_chars = require('locutus/php/strings/count_chars'); +import locutus_php_strings_crc32 = require('locutus/php/strings/crc32'); +import locutus_php_strings_echo = require('locutus/php/strings/echo'); +import locutus_php_strings_explode = require('locutus/php/strings/explode'); +import locutus_php_strings_get_html_translation_table = require('locutus/php/strings/get_html_translation_table'); +import locutus_php_strings_hex2bin = require('locutus/php/strings/hex2bin'); +import locutus_php_strings_html_entity_decode = require('locutus/php/strings/html_entity_decode'); +import locutus_php_strings_htmlentities = require('locutus/php/strings/htmlentities'); +import locutus_php_strings_htmlspecialchars = require('locutus/php/strings/htmlspecialchars'); +import locutus_php_strings_htmlspecialchars_decode = require('locutus/php/strings/htmlspecialchars_decode'); +import locutus_php_strings_implode = require('locutus/php/strings/implode'); +import locutus_php_strings_join = require('locutus/php/strings/join'); +import locutus_php_strings_lcfirst = require('locutus/php/strings/lcfirst'); +import locutus_php_strings_levenshtein = require('locutus/php/strings/levenshtein'); +import locutus_php_strings_localeconv = require('locutus/php/strings/localeconv'); +import locutus_php_strings_ltrim = require('locutus/php/strings/ltrim'); +import locutus_php_strings_md5 = require('locutus/php/strings/md5'); +import locutus_php_strings_md5_file = require('locutus/php/strings/md5_file'); +import locutus_php_strings_metaphone = require('locutus/php/strings/metaphone'); +import locutus_php_strings_money_format = require('locutus/php/strings/money_format'); +import locutus_php_strings_nl2br = require('locutus/php/strings/nl2br'); +import locutus_php_strings_nl_langinfo = require('locutus/php/strings/nl_langinfo'); +import locutus_php_strings_number_format = require('locutus/php/strings/number_format'); +import locutus_php_strings_ord = require('locutus/php/strings/ord'); +import locutus_php_strings_parse_str = require('locutus/php/strings/parse_str'); +import locutus_php_strings_printf = require('locutus/php/strings/printf'); +import locutus_php_strings_quoted_printable_decode = require('locutus/php/strings/quoted_printable_decode'); +import locutus_php_strings_quoted_printable_encode = require('locutus/php/strings/quoted_printable_encode'); +import locutus_php_strings_quotemeta = require('locutus/php/strings/quotemeta'); +import locutus_php_strings_rtrim = require('locutus/php/strings/rtrim'); +import locutus_php_strings_setlocale = require('locutus/php/strings/setlocale'); +import locutus_php_strings_sha1 = require('locutus/php/strings/sha1'); +import locutus_php_strings_sha1_file = require('locutus/php/strings/sha1_file'); +import locutus_php_strings_similar_text = require('locutus/php/strings/similar_text'); +import locutus_php_strings_soundex = require('locutus/php/strings/soundex'); +import locutus_php_strings_split = require('locutus/php/strings/split'); +import locutus_php_strings_sprintf = require('locutus/php/strings/sprintf'); +import locutus_php_strings_sscanf = require('locutus/php/strings/sscanf'); +import locutus_php_strings_str_getcsv = require('locutus/php/strings/str_getcsv'); +import locutus_php_strings_str_ireplace = require('locutus/php/strings/str_ireplace'); +import locutus_php_strings_str_pad = require('locutus/php/strings/str_pad'); +import locutus_php_strings_str_repeat = require('locutus/php/strings/str_repeat'); +import locutus_php_strings_str_replace = require('locutus/php/strings/str_replace'); +import locutus_php_strings_str_rot13 = require('locutus/php/strings/str_rot13'); +import locutus_php_strings_str_shuffle = require('locutus/php/strings/str_shuffle'); +import locutus_php_strings_str_split = require('locutus/php/strings/str_split'); +import locutus_php_strings_str_word_count = require('locutus/php/strings/str_word_count'); +import locutus_php_strings_strcasecmp = require('locutus/php/strings/strcasecmp'); +import locutus_php_strings_strchr = require('locutus/php/strings/strchr'); +import locutus_php_strings_strcmp = require('locutus/php/strings/strcmp'); +import locutus_php_strings_strcoll = require('locutus/php/strings/strcoll'); +import locutus_php_strings_strcspn = require('locutus/php/strings/strcspn'); +import locutus_php_strings_strip_tags = require('locutus/php/strings/strip_tags'); +import locutus_php_strings_stripos = require('locutus/php/strings/stripos'); +import locutus_php_strings_stripslashes = require('locutus/php/strings/stripslashes'); +import locutus_php_strings_stristr = require('locutus/php/strings/stristr'); +import locutus_php_strings_strlen = require('locutus/php/strings/strlen'); +import locutus_php_strings_strnatcasecmp = require('locutus/php/strings/strnatcasecmp'); +import locutus_php_strings_strnatcmp = require('locutus/php/strings/strnatcmp'); +import locutus_php_strings_strncasecmp = require('locutus/php/strings/strncasecmp'); +import locutus_php_strings_strncmp = require('locutus/php/strings/strncmp'); +import locutus_php_strings_strpbrk = require('locutus/php/strings/strpbrk'); +import locutus_php_strings_strpos = require('locutus/php/strings/strpos'); +import locutus_php_strings_strrchr = require('locutus/php/strings/strrchr'); +import locutus_php_strings_strrev = require('locutus/php/strings/strrev'); +import locutus_php_strings_strripos = require('locutus/php/strings/strripos'); +import locutus_php_strings_strrpos = require('locutus/php/strings/strrpos'); +import locutus_php_strings_strspn = require('locutus/php/strings/strspn'); +import locutus_php_strings_strstr = require('locutus/php/strings/strstr'); +import locutus_php_strings_strtok = require('locutus/php/strings/strtok'); +import locutus_php_strings_strtolower = require('locutus/php/strings/strtolower'); +import locutus_php_strings_strtoupper = require('locutus/php/strings/strtoupper'); +import locutus_php_strings_strtr = require('locutus/php/strings/strtr'); +import locutus_php_strings_substr = require('locutus/php/strings/substr'); +import locutus_php_strings_substr_compare = require('locutus/php/strings/substr_compare'); +import locutus_php_strings_substr_count = require('locutus/php/strings/substr_count'); +import locutus_php_strings_substr_replace = require('locutus/php/strings/substr_replace'); +import locutus_php_strings_trim = require('locutus/php/strings/trim'); +import locutus_php_strings_ucfirst = require('locutus/php/strings/ucfirst'); +import locutus_php_strings_ucwords = require('locutus/php/strings/ucwords'); +import locutus_php_strings_vprintf = require('locutus/php/strings/vprintf'); +import locutus_php_strings_vsprintf = require('locutus/php/strings/vsprintf'); +import locutus_php_strings_wordwrap = require('locutus/php/strings/wordwrap'); +import locutus_php_url_base64_decode = require('locutus/php/url/base64_decode'); +import locutus_php_url_base64_encode = require('locutus/php/url/base64_encode'); +import locutus_php_url_http_build_query = require('locutus/php/url/http_build_query'); +import locutus_php_url_parse_url = require('locutus/php/url/parse_url'); +import locutus_php_url_rawurldecode = require('locutus/php/url/rawurldecode'); +import locutus_php_url_rawurlencode = require('locutus/php/url/rawurlencode'); +import locutus_php_url_urldecode = require('locutus/php/url/urldecode'); +import locutus_php_url_urlencode = require('locutus/php/url/urlencode'); +import locutus_php_var_doubleval = require('locutus/php/var/doubleval'); +import locutus_php_var_empty = require('locutus/php/var/empty'); +import locutus_php_var_floatval = require('locutus/php/var/floatval'); +import locutus_php_var_gettype = require('locutus/php/var/gettype'); +import locutus_php_var_intval = require('locutus/php/var/intval'); +import locutus_php_var_is_array = require('locutus/php/var/is_array'); +import locutus_php_var_is_binary = require('locutus/php/var/is_binary'); +import locutus_php_var_is_bool = require('locutus/php/var/is_bool'); +import locutus_php_var_is_buffer = require('locutus/php/var/is_buffer'); +import locutus_php_var_is_callable = require('locutus/php/var/is_callable'); +import locutus_php_var_is_double = require('locutus/php/var/is_double'); +import locutus_php_var_is_float = require('locutus/php/var/is_float'); +import locutus_php_var_is_int = require('locutus/php/var/is_int'); +import locutus_php_var_is_integer = require('locutus/php/var/is_integer'); +import locutus_php_var_is_long = require('locutus/php/var/is_long'); +import locutus_php_var_is_null = require('locutus/php/var/is_null'); +import locutus_php_var_is_numeric = require('locutus/php/var/is_numeric'); +import locutus_php_var_is_object = require('locutus/php/var/is_object'); +import locutus_php_var_is_real = require('locutus/php/var/is_real'); +import locutus_php_var_is_scalar = require('locutus/php/var/is_scalar'); +import locutus_php_var_is_string = require('locutus/php/var/is_string'); +import locutus_php_var_is_unicode = require('locutus/php/var/is_unicode'); +import locutus_php_var_isset = require('locutus/php/var/isset'); +import locutus_php_var_print_r = require('locutus/php/var/print_r'); +import locutus_php_var_serialize = require('locutus/php/var/serialize'); +import locutus_php_var_strval = require('locutus/php/var/strval'); +import locutus_php_var_unserialize = require('locutus/php/var/unserialize'); +import locutus_php_var_var_dump = require('locutus/php/var/var_dump'); +import locutus_php_var_var_export = require('locutus/php/var/var_export'); +import locutus_php_xdiff_xdiff_string_diff = require('locutus/php/xdiff/xdiff_string_diff'); +import locutus_php_xdiff_xdiff_string_patch = require('locutus/php/xdiff/xdiff_string_patch'); +import locutus_php_xml_utf8_decode = require('locutus/php/xml/utf8_decode'); +import locutus_php_xml_utf8_encode = require('locutus/php/xml/utf8_encode'); +import locutus_python_string_capwords = require('locutus/python/string/capwords'); +import locutus_ruby_Math_acos = require('locutus/ruby/Math/acos'); +import locutus_c_math = require('locutus/c/math'); +import locutus_golang_strings = require('locutus/golang/strings'); +import locutus_php_array = require('locutus/php/array'); +import locutus_php_bc = require('locutus/php/bc'); +import locutus_php_ctype = require('locutus/php/ctype'); +import locutus_php_datetime = require('locutus/php/datetime'); +import locutus_php_exec = require('locutus/php/exec'); +import locutus_php_filesystem = require('locutus/php/filesystem'); +import locutus_php_funchand = require('locutus/php/funchand'); +import locutus_php_i18n = require('locutus/php/i18n'); +import locutus_php_info = require('locutus/php/info'); +import locutus_php_json = require('locutus/php/json'); +import locutus_php_math = require('locutus/php/math'); +import locutus_php_misc = require('locutus/php/misc'); +import locutus_php_net_gopher = require('locutus/php/net-gopher'); +import locutus_php_network = require('locutus/php/network'); +import locutus_php_pcre = require('locutus/php/pcre'); +import locutus_php_strings = require('locutus/php/strings'); +import locutus_php_url = require('locutus/php/url'); +import locutus_php_var = require('locutus/php/var'); +import locutus_php_xdiff = require('locutus/php/xdiff'); +import locutus_php_xml = require('locutus/php/xml'); +import locutus_python_string = require('locutus/python/string'); +import locutus_ruby_Math = require('locutus/ruby/Math'); +import locutus_c = require('locutus/c'); +import locutus_golang = require('locutus/golang'); +import locutus_php = require('locutus/php'); +import locutus_python = require('locutus/python'); +import locutus_ruby = require('locutus/ruby'); +import locutus = require('locutus'); diff --git a/locutus/locutus.d.ts b/locutus/locutus.d.ts new file mode 100644 index 0000000000..4e1077a937 --- /dev/null +++ b/locutus/locutus.d.ts @@ -0,0 +1,1734 @@ +// Type definitions for locutus +// Project: http://locutusjs.io +// Definitions by: Hookclaw +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare module "locutus/c/math/abs" { + function abs(mixedNumber?:any):any; + export = abs; +} +declare module "locutus/golang/strings/Contains" { + function Contains(s?:any, substr?:any):any; + export = Contains; +} +declare module "locutus/golang/strings/Count" { + function Count(s?:any, sep?:any):any; + export = Count; +} +declare module "locutus/golang/strings/Index" { + function Index(s?:any, sep?:any):any; + export = Index; +} +declare module "locutus/golang/strings/LastIndex" { + function LastIndex(s?:any, sep?:any):any; + export = LastIndex; +} +declare module "locutus/php/array/array_change_key_case" { + function array_change_key_case(array?:any, cs?:any):any; + export = array_change_key_case; +} +declare module "locutus/php/array/array_chunk" { + function array_chunk(input?:any, size?:any, preserveKeys?:any):any; + export = array_chunk; +} +declare module "locutus/php/array/array_combine" { + function array_combine(keys?:any, values?:any):any; + export = array_combine; +} +declare module "locutus/php/array/array_count_values" { + function array_count_values(array?:any):any; + export = array_count_values; +} +declare module "locutus/php/array/array_diff" { + function array_diff(...args:any[]):any; + export = array_diff; +} +declare module "locutus/php/array/array_diff_assoc" { + function array_diff_assoc(...args:any[]):any; + export = array_diff_assoc; +} +declare module "locutus/php/array/array_diff_key" { + function array_diff_key(...args:any[]):any; + export = array_diff_key; +} +declare module "locutus/php/array/array_diff_uassoc" { + function array_diff_uassoc(...args:any[]):any; + export = array_diff_uassoc; +} +declare module "locutus/php/array/array_diff_ukey" { + function array_diff_ukey(...args:any[]):any; + export = array_diff_ukey; +} +declare module "locutus/php/array/array_fill" { + function array_fill(startIndex?:any, num?:any, mixedVal?:any):any; + export = array_fill; +} +declare module "locutus/php/array/array_fill_keys" { + function array_fill_keys(keys?:any, value?:any):any; + export = array_fill_keys; +} +declare module "locutus/php/array/array_filter" { + function array_filter(arr?:any, func?:any):any; + export = array_filter; +} +declare module "locutus/php/array/array_flip" { + function array_flip(trans?:any):any; + export = array_flip; +} +declare module "locutus/php/array/array_intersect" { + function array_intersect(...args:any[]):any; + export = array_intersect; +} +declare module "locutus/php/array/array_intersect_assoc" { + function array_intersect_assoc(...args:any[]):any; + export = array_intersect_assoc; +} +declare module "locutus/php/array/array_intersect_key" { + function array_intersect_key(...args:any[]):any; + export = array_intersect_key; +} +declare module "locutus/php/array/array_intersect_uassoc" { + function array_intersect_uassoc(...args:any[]):any; + export = array_intersect_uassoc; +} +declare module "locutus/php/array/array_intersect_ukey" { + function array_intersect_ukey(...args:any[]):any; + export = array_intersect_ukey; +} +declare module "locutus/php/array/array_key_exists" { + function array_key_exists(key?:any, search?:any):any; + export = array_key_exists; +} +declare module "locutus/php/array/array_keys" { + function array_keys(input?:any, searchValue?:any, argStrict?:any):any; + export = array_keys; +} +declare module "locutus/php/array/array_map" { + function array_map(...args:any[]):any; + export = array_map; +} +declare module "locutus/php/array/array_merge" { + function array_merge(...args:any[]):any; + export = array_merge; +} +declare module "locutus/php/array/array_merge_recursive" { + function array_merge_recursive(arr1?:any, arr2?:any):any; + export = array_merge_recursive; +} +declare module "locutus/php/array/array_multisort" { + function array_multisort(...args:any[]):any; + export = array_multisort; +} +declare module "locutus/php/array/array_pad" { + function array_pad(input?:any, padSize?:any, padValue?:any):any; + export = array_pad; +} +declare module "locutus/php/array/array_pop" { + function array_pop(inputArr?:any):any; + export = array_pop; +} +declare module "locutus/php/array/array_product" { + function array_product(input?:any):any; + export = array_product; +} +declare module "locutus/php/array/array_push" { + function array_push(...args:any[]):any; + export = array_push; +} +declare module "locutus/php/array/array_rand" { + function array_rand(input?:any, numReq?:any):any; + export = array_rand; +} +declare module "locutus/php/array/array_reduce" { + function array_reduce(aInput?:any, callback?:any):any; + export = array_reduce; +} +declare module "locutus/php/array/array_replace" { + function array_replace(...args:any[]):any; + export = array_replace; +} +declare module "locutus/php/array/array_replace_recursive" { + function array_replace_recursive(...args:any[]):any; + export = array_replace_recursive; +} +declare module "locutus/php/array/array_reverse" { + function array_reverse(array?:any, preserveKeys?:any):any; + export = array_reverse; +} +declare module "locutus/php/array/array_search" { + function array_search(needle?:any, haystack?:any, argStrict?:any):any; + export = array_search; +} +declare module "locutus/php/array/array_shift" { + function array_shift(inputArr?:any):any; + export = array_shift; +} +declare module "locutus/php/array/array_slice" { + function array_slice(arr?:any, offst?:any, lgth?:any, preserveKeys?:any):any; + export = array_slice; +} +declare module "locutus/php/array/array_splice" { + function array_splice(arr?:any, offst?:any, lgth?:any, replacement?:any):any; + export = array_splice; +} +declare module "locutus/php/array/array_sum" { + function array_sum(array?:any):any; + export = array_sum; +} +declare module "locutus/php/array/array_udiff" { + function array_udiff(...args:any[]):any; + export = array_udiff; +} +declare module "locutus/php/array/array_udiff_assoc" { + function array_udiff_assoc(...args:any[]):any; + export = array_udiff_assoc; +} +declare module "locutus/php/array/array_udiff_uassoc" { + function array_udiff_uassoc(...args:any[]):any; + export = array_udiff_uassoc; +} +declare module "locutus/php/array/array_uintersect" { + function array_uintersect(...args:any[]):any; + export = array_uintersect; +} +declare module "locutus/php/array/array_uintersect_uassoc" { + function array_uintersect_uassoc(...args:any[]):any; + export = array_uintersect_uassoc; +} +declare module "locutus/php/array/array_unique" { + function array_unique(inputArr?:any):any; + export = array_unique; +} +declare module "locutus/php/array/array_unshift" { + function array_unshift(...args:any[]):any; + export = array_unshift; +} +declare module "locutus/php/array/array_values" { + function array_values(input?:any):any; + export = array_values; +} +declare module "locutus/php/array/array_walk" { + function array_walk(...args:any[]):any; + export = array_walk; +} +declare module "locutus/php/array/arsort" { + function arsort(inputArr?:any, sortFlags?:any):any; + export = arsort; +} +declare module "locutus/php/array/asort" { + function asort(inputArr?:any, sortFlags?:any):any; + export = asort; +} +declare module "locutus/php/array/count" { + function count(mixedVar?:any, mode?:any):any; + export = count; +} +declare module "locutus/php/array/current" { + function current(arr?:any):any; + export = current; +} +declare module "locutus/php/array/each" { + function each(arr?:any):any; + export = each; +} +declare module "locutus/php/array/end" { + function end(arr?:any):any; + export = end; +} +declare module "locutus/php/array/in_array" { + function in_array(needle?:any, haystack?:any, argStrict?:any):any; + export = in_array; +} +declare module "locutus/php/array/key" { + function key(arr?:any):any; + export = key; +} +declare module "locutus/php/array/krsort" { + function krsort(inputArr?:any, sortFlags?:any):any; + export = krsort; +} +declare module "locutus/php/array/ksort" { + function ksort(inputArr?:any, sortFlags?:any):any; + export = ksort; +} +declare module "locutus/php/array/natcasesort" { + function natcasesort(inputArr?:any):any; + export = natcasesort; +} +declare module "locutus/php/array/natsort" { + function natsort(inputArr?:any):any; + export = natsort; +} +declare module "locutus/php/array/next" { + function next(arr?:any):any; + export = next; +} +declare module "locutus/php/array/pos" { + function pos(arr?:any):any; + export = pos; +} +declare module "locutus/php/array/prev" { + function prev(arr?:any):any; + export = prev; +} +declare module "locutus/php/array/range" { + function range(low?:any, high?:any, step?:any):any; + export = range; +} +declare module "locutus/php/array/reset" { + function reset(arr?:any):any; + export = reset; +} +declare module "locutus/php/array/rsort" { + function rsort(inputArr?:any, sortFlags?:any):any; + export = rsort; +} +declare module "locutus/php/array/shuffle" { + function shuffle(inputArr?:any):any; + export = shuffle; +} +declare module "locutus/php/array/sizeof" { + function sizeof(mixedVar?:any, mode?:any):any; + export = sizeof; +} +declare module "locutus/php/array/sort" { + function sort(inputArr?:any, sortFlags?:any):any; + export = sort; +} +declare module "locutus/php/array/uasort" { + function uasort(inputArr?:any, sorter?:any):any; + export = uasort; +} +declare module "locutus/php/array/uksort" { + function uksort(inputArr?:any, sorter?:any):any; + export = uksort; +} +declare module "locutus/php/array/usort" { + function usort(inputArr?:any, sorter?:any):any; + export = usort; +} +declare module "locutus/php/bc/bcadd" { + function bcadd(leftOperand?:any, rightOperand?:any, scale?:any):any; + export = bcadd; +} +declare module "locutus/php/bc/bccomp" { + function bccomp(leftOperand?:any, rightOperand?:any, scale?:any):any; + export = bccomp; +} +declare module "locutus/php/bc/bcdiv" { + function bcdiv(leftOperand?:any, rightOperand?:any, scale?:any):any; + export = bcdiv; +} +declare module "locutus/php/bc/bcmul" { + function bcmul(leftOperand?:any, rightOperand?:any, scale?:any):any; + export = bcmul; +} +declare module "locutus/php/bc/bcround" { + function bcround(val?:any, precision?:any):any; + export = bcround; +} +declare module "locutus/php/bc/bcscale" { + function bcscale(scale?:any):any; + export = bcscale; +} +declare module "locutus/php/bc/bcsub" { + function bcsub(leftOperand?:any, rightOperand?:any, scale?:any):any; + export = bcsub; +} +declare module "locutus/php/ctype/ctype_alnum" { + function ctype_alnum(text?:any):any; + export = ctype_alnum; +} +declare module "locutus/php/ctype/ctype_alpha" { + function ctype_alpha(text?:any):any; + export = ctype_alpha; +} +declare module "locutus/php/ctype/ctype_cntrl" { + function ctype_cntrl(text?:any):any; + export = ctype_cntrl; +} +declare module "locutus/php/ctype/ctype_digit" { + function ctype_digit(text?:any):any; + export = ctype_digit; +} +declare module "locutus/php/ctype/ctype_graph" { + function ctype_graph(text?:any):any; + export = ctype_graph; +} +declare module "locutus/php/ctype/ctype_lower" { + function ctype_lower(text?:any):any; + export = ctype_lower; +} +declare module "locutus/php/ctype/ctype_print" { + function ctype_print(text?:any):any; + export = ctype_print; +} +declare module "locutus/php/ctype/ctype_punct" { + function ctype_punct(text?:any):any; + export = ctype_punct; +} +declare module "locutus/php/ctype/ctype_space" { + function ctype_space(text?:any):any; + export = ctype_space; +} +declare module "locutus/php/ctype/ctype_upper" { + function ctype_upper(text?:any):any; + export = ctype_upper; +} +declare module "locutus/php/ctype/ctype_xdigit" { + function ctype_xdigit(text?:any):any; + export = ctype_xdigit; +} +declare module "locutus/php/datetime/checkdate" { + function checkdate(m?:any, d?:any, y?:any):any; + export = checkdate; +} +declare module "locutus/php/datetime/date" { + function date(format?:any, timestamp?:any):any; + export = date; +} +declare module "locutus/php/datetime/date_parse" { + function date_parse(date?:any):any; + export = date_parse; +} +declare module "locutus/php/datetime/getdate" { + function getdate(timestamp?:any):any; + export = getdate; +} +declare module "locutus/php/datetime/gettimeofday" { + function gettimeofday(returnFloat?:any):any; + export = gettimeofday; +} +declare module "locutus/php/datetime/gmdate" { + function gmdate(format?:any, timestamp?:any):any; + export = gmdate; +} +declare module "locutus/php/datetime/gmmktime" { + function gmmktime(...args:any[]):any; + export = gmmktime; +} +declare module "locutus/php/datetime/gmstrftime" { + function gmstrftime(format?:any, timestamp?:any):any; + export = gmstrftime; +} +declare module "locutus/php/datetime/idate" { + function idate(format?:any, timestamp?:any):any; + export = idate; +} +declare module "locutus/php/datetime/microtime" { + function microtime(getAsFloat?:any):any; + export = microtime; +} +declare module "locutus/php/datetime/mktime" { + function mktime(...args:any[]):any; + export = mktime; +} +declare module "locutus/php/datetime/strftime" { + function strftime(fmt?:any, timestamp?:any):any; + export = strftime; +} +declare module "locutus/php/datetime/strptime" { + function strptime(dateStr?:any, format?:any):any; + export = strptime; +} +declare module "locutus/php/datetime/strtotime" { + function strtotime(text?:any, now?:any):any; + export = strtotime; +} +declare module "locutus/php/datetime/time" { + function time():any; + export = time; +} +declare module "locutus/php/exec/escapeshellarg" { + function escapeshellarg(arg?:any):any; + export = escapeshellarg; +} +declare module "locutus/php/filesystem/basename" { + function basename(path?:any, suffix?:any):any; + export = basename; +} +declare module "locutus/php/filesystem/dirname" { + function dirname(path?:any):any; + export = dirname; +} +declare module "locutus/php/filesystem/file_get_contents" { + function file_get_contents(url?:any, flags?:any, context?:any, offset?:any, maxLen?:any):any; + export = file_get_contents; +} +declare module "locutus/php/filesystem/pathinfo" { + function pathinfo(...args:any[]):any; + export = pathinfo; +} +declare module "locutus/php/filesystem/realpath" { + function realpath(path?:any):any; + export = realpath; +} +declare module "locutus/php/funchand/call_user_func" { + function call_user_func(...args:any[]):any; + export = call_user_func; +} +declare module "locutus/php/funchand/call_user_func_array" { + function call_user_func_array(cb?:any, parameters?:any):any; + export = call_user_func_array; +} +declare module "locutus/php/funchand/create_function" { + function create_function(args?:any, code?:any):any; + export = create_function; +} +declare module "locutus/php/funchand/function_exists" { + function function_exists(funcName?:any):any; + export = function_exists; +} +declare module "locutus/php/funchand/get_defined_functions" { + function get_defined_functions():any; + export = get_defined_functions; +} +declare module "locutus/php/i18n/i18n_loc_get_default" { + function i18n_loc_get_default():any; + export = i18n_loc_get_default; +} +declare module "locutus/php/i18n/i18n_loc_set_default" { + function i18n_loc_set_default(name?:any):any; + export = i18n_loc_set_default; +} +declare module "locutus/php/info/assert_options" { + function assert_options(what?:any, value?:any):any; + export = assert_options; +} +declare module "locutus/php/info/getenv" { + function getenv(varname?:any):any; + export = getenv; +} +declare module "locutus/php/info/ini_get" { + function ini_get(varname?:any):any; + export = ini_get; +} +declare module "locutus/php/info/ini_set" { + function ini_set(varname?:any, newvalue?:any):any; + export = ini_set; +} +declare module "locutus/php/info/set_time_limit" { + function set_time_limit(seconds?:any):any; + export = set_time_limit; +} +declare module "locutus/php/info/version_compare" { + function version_compare(v1?:any, v2?:any, operator?:any):any; + export = version_compare; +} +declare module "locutus/php/json/json_decode" { + function json_decode(strJson?:any):any; + export = json_decode; +} +declare module "locutus/php/json/json_encode" { + function json_encode(mixedVal?:any):any; + export = json_encode; +} +declare module "locutus/php/json/json_last_error" { + function json_last_error():any; + export = json_last_error; +} +declare module "locutus/php/math/abs" { + function abs(mixedNumber?:any):any; + export = abs; +} +declare module "locutus/php/math/acos" { + function acos(arg?:any):any; + export = acos; +} +declare module "locutus/php/math/acosh" { + function acosh(arg?:any):any; + export = acosh; +} +declare module "locutus/php/math/asin" { + function asin(arg?:any):any; + export = asin; +} +declare module "locutus/php/math/asinh" { + function asinh(arg?:any):any; + export = asinh; +} +declare module "locutus/php/math/atan" { + function atan(arg?:any):any; + export = atan; +} +declare module "locutus/php/math/atan2" { + function atan2(y?:any, x?:any):any; + export = atan2; +} +declare module "locutus/php/math/atanh" { + function atanh(arg?:any):any; + export = atanh; +} +declare module "locutus/php/math/base_convert" { + function base_convert(number?:any, frombase?:any, tobase?:any):any; + export = base_convert; +} +declare module "locutus/php/math/bindec" { + function bindec(binaryString?:any):any; + export = bindec; +} +declare module "locutus/php/math/ceil" { + function ceil(value?:any):any; + export = ceil; +} +declare module "locutus/php/math/cos" { + function cos(arg?:any):any; + export = cos; +} +declare module "locutus/php/math/cosh" { + function cosh(arg?:any):any; + export = cosh; +} +declare module "locutus/php/math/decbin" { + function decbin(number?:any):any; + export = decbin; +} +declare module "locutus/php/math/dechex" { + function dechex(number?:any):any; + export = dechex; +} +declare module "locutus/php/math/decoct" { + function decoct(number?:any):any; + export = decoct; +} +declare module "locutus/php/math/deg2rad" { + function deg2rad(angle?:any):any; + export = deg2rad; +} +declare module "locutus/php/math/exp" { + function exp(arg?:any):any; + export = exp; +} +declare module "locutus/php/math/expm1" { + function expm1(x?:any):any; + export = expm1; +} +declare module "locutus/php/math/floor" { + function floor(value?:any):any; + export = floor; +} +declare module "locutus/php/math/fmod" { + function fmod(x?:any, y?:any):any; + export = fmod; +} +declare module "locutus/php/math/getrandmax" { + function getrandmax():any; + export = getrandmax; +} +declare module "locutus/php/math/hexdec" { + function hexdec(hexString?:any):any; + export = hexdec; +} +declare module "locutus/php/math/hypot" { + function hypot(x?:any, y?:any):any; + export = hypot; +} +declare module "locutus/php/math/is_finite" { + function is_finite(val?:any):any; + export = is_finite; +} +declare module "locutus/php/math/is_infinite" { + function is_infinite(val?:any):any; + export = is_infinite; +} +declare module "locutus/php/math/is_nan" { + function is_nan(val?:any):any; + export = is_nan; +} +declare module "locutus/php/math/lcg_value" { + function lcg_value():any; + export = lcg_value; +} +declare module "locutus/php/math/log" { + function log(arg?:any, base?:any):any; + export = log; +} +declare module "locutus/php/math/log10" { + function log10(arg?:any):any; + export = log10; +} +declare module "locutus/php/math/log1p" { + function log1p(x?:any):any; + export = log1p; +} +declare module "locutus/php/math/max" { + function max(...args:any[]):any; + export = max; +} +declare module "locutus/php/math/min" { + function min(...args:any[]):any; + export = min; +} +declare module "locutus/php/math/mt_getrandmax" { + function mt_getrandmax():any; + export = mt_getrandmax; +} +declare module "locutus/php/math/mt_rand" { + function mt_rand(...args:any[]):any; + export = mt_rand; +} +declare module "locutus/php/math/octdec" { + function octdec(octString?:any):any; + export = octdec; +} +declare module "locutus/php/math/pi" { + function pi():any; + export = pi; +} +declare module "locutus/php/math/pow" { + function pow(base?:any, exp?:any):any; + export = pow; +} +declare module "locutus/php/math/rad2deg" { + function rad2deg(angle?:any):any; + export = rad2deg; +} +declare module "locutus/php/math/rand" { + function rand(...args:any[]):any; + export = rand; +} +declare module "locutus/php/math/round" { + function round(...args:any[]):any; + export = round; +} +declare module "locutus/php/math/sin" { + function sin(arg?:any):any; + export = sin; +} +declare module "locutus/php/math/sinh" { + function sinh(arg?:any):any; + export = sinh; +} +declare module "locutus/php/math/sqrt" { + function sqrt(arg?:any):any; + export = sqrt; +} +declare module "locutus/php/math/tan" { + function tan(arg?:any):any; + export = tan; +} +declare module "locutus/php/math/tanh" { + function tanh(arg?:any):any; + export = tanh; +} +declare module "locutus/php/misc/pack" { + function pack(...args:any[]):any; + export = pack; +} +declare module "locutus/php/misc/uniqid" { + function uniqid(prefix?:any, moreEntropy?:any):any; + export = uniqid; +} +declare module "locutus/php/net-gopher/gopher_parsedir" { + function gopher_parsedir(dirent?:any):any; + export = gopher_parsedir; +} +declare module "locutus/php/network/inet_ntop" { + function inet_ntop(a?:any):any; + export = inet_ntop; +} +declare module "locutus/php/network/inet_pton" { + function inet_pton(a?:any):any; + export = inet_pton; +} +declare module "locutus/php/network/ip2long" { + function ip2long(argIP?:any):any; + export = ip2long; +} +declare module "locutus/php/network/long2ip" { + function long2ip(ip?:any):any; + export = long2ip; +} +declare module "locutus/php/network/setcookie" { + function setcookie(name?:any, value?:any, expires?:any, path?:any, domain?:any, secure?:any):any; + export = setcookie; +} +declare module "locutus/php/network/setrawcookie" { + function setrawcookie(name?:any, value?:any, expires?:any, path?:any, domain?:any, secure?:any):any; + export = setrawcookie; +} +declare module "locutus/php/pcre/preg_quote" { + function preg_quote(str?:any, delimiter?:any):any; + export = preg_quote; +} +declare module "locutus/php/pcre/sql_regcase" { + function sql_regcase(str?:any):any; + export = sql_regcase; +} +declare module "locutus/php/strings/addcslashes" { + function addcslashes(str?:any, charlist?:any):any; + export = addcslashes; +} +declare module "locutus/php/strings/addslashes" { + function addslashes(str?:any):any; + export = addslashes; +} +declare module "locutus/php/strings/bin2hex" { + function bin2hex(s?:any):any; + export = bin2hex; +} +declare module "locutus/php/strings/chop" { + function chop(str?:any, charlist?:any):any; + export = chop; +} +declare module "locutus/php/strings/chr" { + function chr(codePt?:any):any; + export = chr; +} +declare module "locutus/php/strings/chunk_split" { + function chunk_split(body?:any, chunklen?:any, end?:any):any; + export = chunk_split; +} +declare module "locutus/php/strings/convert_cyr_string" { + function convert_cyr_string(str?:any, from?:any, to?:any):any; + export = convert_cyr_string; +} +declare module "locutus/php/strings/convert_uuencode" { + function convert_uuencode(str?:any):any; + export = convert_uuencode; +} +declare module "locutus/php/strings/count_chars" { + function count_chars(str?:any, mode?:any):any; + export = count_chars; +} +declare module "locutus/php/strings/crc32" { + function crc32(str?:any):any; + export = crc32; +} +declare module "locutus/php/strings/echo" { + function echo(...args:any[]):any; + export = echo; +} +declare module "locutus/php/strings/explode" { + function explode(...args:any[]):any; + export = explode; +} +declare module "locutus/php/strings/get_html_translation_table" { + function get_html_translation_table(...args:any[]):any; + export = get_html_translation_table; +} +declare module "locutus/php/strings/hex2bin" { + function hex2bin(s?:any):any; + export = hex2bin; +} +declare module "locutus/php/strings/html_entity_decode" { + function html_entity_decode(string?:any, quoteStyle?:any):any; + export = html_entity_decode; +} +declare module "locutus/php/strings/htmlentities" { + function htmlentities(string?:any, quoteStyle?:any, charset?:any, doubleEncode?:any):any; + export = htmlentities; +} +declare module "locutus/php/strings/htmlspecialchars" { + function htmlspecialchars(string?:any, quoteStyle?:any, charset?:any, doubleEncode?:any):any; + export = htmlspecialchars; +} +declare module "locutus/php/strings/htmlspecialchars_decode" { + function htmlspecialchars_decode(string?:any, quoteStyle?:any):any; + export = htmlspecialchars_decode; +} +declare module "locutus/php/strings/implode" { + function implode(...args:any[]):any; + export = implode; +} +declare module "locutus/php/strings/join" { + function join(glue?:any, pieces?:any):any; + export = join; +} +declare module "locutus/php/strings/lcfirst" { + function lcfirst(str?:any):any; + export = lcfirst; +} +declare module "locutus/php/strings/levenshtein" { + function levenshtein(s1?:any, s2?:any, costIns?:any, costRep?:any, costDel?:any):any; + export = levenshtein; +} +declare module "locutus/php/strings/localeconv" { + function localeconv():any; + export = localeconv; +} +declare module "locutus/php/strings/ltrim" { + function ltrim(str?:any, charlist?:any):any; + export = ltrim; +} +declare module "locutus/php/strings/md5" { + function md5(str?:any):any; + export = md5; +} +declare module "locutus/php/strings/md5_file" { + function md5_file(str_filename?:any):any; + export = md5_file; +} +declare module "locutus/php/strings/metaphone" { + function metaphone(word?:any, maxPhonemes?:any):any; + export = metaphone; +} +declare module "locutus/php/strings/money_format" { + function money_format(format?:any, number?:any):any; + export = money_format; +} +declare module "locutus/php/strings/nl2br" { + function nl2br(str?:any, isXhtml?:any):any; + export = nl2br; +} +declare module "locutus/php/strings/nl_langinfo" { + function nl_langinfo(item?:any):any; + export = nl_langinfo; +} +declare module "locutus/php/strings/number_format" { + function number_format(number?:any, decimals?:any, decPoint?:any, thousandsSep?:any):any; + export = number_format; +} +declare module "locutus/php/strings/ord" { + function ord(string?:any):any; + export = ord; +} +declare module "locutus/php/strings/parse_str" { + function parse_str(str?:any, array?:any):any; + export = parse_str; +} +declare module "locutus/php/strings/printf" { + function printf(...args:any[]):any; + export = printf; +} +declare module "locutus/php/strings/quoted_printable_decode" { + function quoted_printable_decode(str?:any):any; + export = quoted_printable_decode; +} +declare module "locutus/php/strings/quoted_printable_encode" { + function quoted_printable_encode(str?:any):any; + export = quoted_printable_encode; +} +declare module "locutus/php/strings/quotemeta" { + function quotemeta(str?:any):any; + export = quotemeta; +} +declare module "locutus/php/strings/rtrim" { + function rtrim(str?:any, charlist?:any):any; + export = rtrim; +} +declare module "locutus/php/strings/setlocale" { + function setlocale(category?:any, locale?:any):any; + export = setlocale; +} +declare module "locutus/php/strings/sha1" { + function sha1(str?:any):any; + export = sha1; +} +declare module "locutus/php/strings/sha1_file" { + function sha1_file(str_filename?:any):any; + export = sha1_file; +} +declare module "locutus/php/strings/similar_text" { + function similar_text(first?:any, second?:any, percent?:any):any; + export = similar_text; +} +declare module "locutus/php/strings/soundex" { + function soundex(str?:any):any; + export = soundex; +} +declare module "locutus/php/strings/split" { + function split(delimiter?:any, string?:any):any; + export = split; +} +declare module "locutus/php/strings/sprintf" { + function sprintf(...args:any[]):any; + export = sprintf; +} +declare module "locutus/php/strings/sscanf" { + function sscanf(...args:any[]):any; + export = sscanf; +} +declare module "locutus/php/strings/str_getcsv" { + function str_getcsv(input?:any, delimiter?:any, enclosure?:any, escape?:any):any; + export = str_getcsv; +} +declare module "locutus/php/strings/str_ireplace" { + function str_ireplace(search?:any, replace?:any, subject?:any, countObj?:any):any; + export = str_ireplace; +} +declare module "locutus/php/strings/str_pad" { + function str_pad(input?:any, padLength?:any, padString?:any, padType?:any):any; + export = str_pad; +} +declare module "locutus/php/strings/str_repeat" { + function str_repeat(input?:any, multiplier?:any):any; + export = str_repeat; +} +declare module "locutus/php/strings/str_replace" { + function str_replace(search?:any, replace?:any, subject?:any, countObj?:any):any; + export = str_replace; +} +declare module "locutus/php/strings/str_rot13" { + function str_rot13(str?:any):any; + export = str_rot13; +} +declare module "locutus/php/strings/str_shuffle" { + function str_shuffle(...args:any[]):any; + export = str_shuffle; +} +declare module "locutus/php/strings/str_split" { + function str_split(string?:any, splitLength?:any):any; + export = str_split; +} +declare module "locutus/php/strings/str_word_count" { + function str_word_count(str?:any, format?:any, charlist?:any):any; + export = str_word_count; +} +declare module "locutus/php/strings/strcasecmp" { + function strcasecmp(fString1?:any, fString2?:any):any; + export = strcasecmp; +} +declare module "locutus/php/strings/strchr" { + function strchr(haystack?:any, needle?:any, bool?:any):any; + export = strchr; +} +declare module "locutus/php/strings/strcmp" { + function strcmp(str1?:any, str2?:any):any; + export = strcmp; +} +declare module "locutus/php/strings/strcoll" { + function strcoll(str1?:any, str2?:any):any; + export = strcoll; +} +declare module "locutus/php/strings/strcspn" { + function strcspn(str?:any, mask?:any, start?:any, length?:any):any; + export = strcspn; +} +declare module "locutus/php/strings/strip_tags" { + function strip_tags(input?:any, allowed?:any):any; + export = strip_tags; +} +declare module "locutus/php/strings/stripos" { + function stripos(fHaystack?:any, fNeedle?:any, fOffset?:any):any; + export = stripos; +} +declare module "locutus/php/strings/stripslashes" { + function stripslashes(str?:any):any; + export = stripslashes; +} +declare module "locutus/php/strings/stristr" { + function stristr(haystack?:any, needle?:any, bool?:any):any; + export = stristr; +} +declare module "locutus/php/strings/strlen" { + function strlen(string?:any):any; + export = strlen; +} +declare module "locutus/php/strings/strnatcasecmp" { + function strnatcasecmp(str1?:any, str2?:any):any; + export = strnatcasecmp; +} +declare module "locutus/php/strings/strnatcmp" { + function strnatcmp(fString1?:any, fString2?:any, fVersion?:any):any; + export = strnatcmp; +} +declare module "locutus/php/strings/strncasecmp" { + function strncasecmp(argStr1?:any, argStr2?:any, len?:any):any; + export = strncasecmp; +} +declare module "locutus/php/strings/strncmp" { + function strncmp(str1?:any, str2?:any, lgth?:any):any; + export = strncmp; +} +declare module "locutus/php/strings/strpbrk" { + function strpbrk(haystack?:any, charList?:any):any; + export = strpbrk; +} +declare module "locutus/php/strings/strpos" { + function strpos(haystack?:any, needle?:any, offset?:any):any; + export = strpos; +} +declare module "locutus/php/strings/strrchr" { + function strrchr(haystack?:any, needle?:any):any; + export = strrchr; +} +declare module "locutus/php/strings/strrev" { + function strrev(string?:any):any; + export = strrev; +} +declare module "locutus/php/strings/strripos" { + function strripos(haystack?:any, needle?:any, offset?:any):any; + export = strripos; +} +declare module "locutus/php/strings/strrpos" { + function strrpos(haystack?:any, needle?:any, offset?:any):any; + export = strrpos; +} +declare module "locutus/php/strings/strspn" { + function strspn(str1?:any, str2?:any, start?:any, lgth?:any):any; + export = strspn; +} +declare module "locutus/php/strings/strstr" { + function strstr(haystack?:any, needle?:any, bool?:any):any; + export = strstr; +} +declare module "locutus/php/strings/strtok" { + function strtok(str?:any, tokens?:any):any; + export = strtok; +} +declare module "locutus/php/strings/strtolower" { + function strtolower(str?:any):any; + export = strtolower; +} +declare module "locutus/php/strings/strtoupper" { + function strtoupper(str?:any):any; + export = strtoupper; +} +declare module "locutus/php/strings/strtr" { + function strtr(str?:any, trFrom?:any, trTo?:any):any; + export = strtr; +} +declare module "locutus/php/strings/substr" { + function substr(str?:any, start?:any, len?:any):any; + export = substr; +} +declare module "locutus/php/strings/substr_compare" { + function substr_compare(mainStr?:any, str?:any, offset?:any, length?:any, caseInsensitivity?:any):any; + export = substr_compare; +} +declare module "locutus/php/strings/substr_count" { + function substr_count(haystack?:any, needle?:any, offset?:any, length?:any):any; + export = substr_count; +} +declare module "locutus/php/strings/substr_replace" { + function substr_replace(str?:any, replace?:any, start?:any, length?:any):any; + export = substr_replace; +} +declare module "locutus/php/strings/trim" { + function trim(str?:any, charlist?:any):any; + export = trim; +} +declare module "locutus/php/strings/ucfirst" { + function ucfirst(str?:any):any; + export = ucfirst; +} +declare module "locutus/php/strings/ucwords" { + function ucwords(str?:any):any; + export = ucwords; +} +declare module "locutus/php/strings/vprintf" { + function vprintf(format?:any, args?:any):any; + export = vprintf; +} +declare module "locutus/php/strings/vsprintf" { + function vsprintf(format?:any, args?:any):any; + export = vsprintf; +} +declare module "locutus/php/strings/wordwrap" { + function wordwrap(...args:any[]):any; + export = wordwrap; +} +declare module "locutus/php/url/base64_decode" { + function base64_decode(encodedData?:any):any; + export = base64_decode; +} +declare module "locutus/php/url/base64_encode" { + function base64_encode(stringToEncode?:any):any; + export = base64_encode; +} +declare module "locutus/php/url/http_build_query" { + function http_build_query(formdata?:any, numericPrefix?:any, argSeparator?:any):any; + export = http_build_query; +} +declare module "locutus/php/url/parse_url" { + function parse_url(str?:any, component?:any):any; + export = parse_url; +} +declare module "locutus/php/url/rawurldecode" { + function rawurldecode(str?:any):any; + export = rawurldecode; +} +declare module "locutus/php/url/rawurlencode" { + function rawurlencode(str?:any):any; + export = rawurlencode; +} +declare module "locutus/php/url/urldecode" { + function urldecode(str?:any):any; + export = urldecode; +} +declare module "locutus/php/url/urlencode" { + function urlencode(str?:any):any; + export = urlencode; +} +declare module "locutus/php/var/doubleval" { + function doubleval(mixedVar?:any):any; + export = doubleval; +} +declare module "locutus/php/var/empty" { + function empty(mixedVar?:any):any; + export = empty; +} +declare module "locutus/php/var/floatval" { + function floatval(mixedVar?:any):any; + export = floatval; +} +declare module "locutus/php/var/gettype" { + function gettype(mixedVar?:any):any; + export = gettype; +} +declare module "locutus/php/var/intval" { + function intval(mixedVar?:any, base?:any):any; + export = intval; +} +declare module "locutus/php/var/is_array" { + function is_array(mixedVar?:any):any; + export = is_array; +} +declare module "locutus/php/var/is_binary" { + function is_binary(vr?:any):any; + export = is_binary; +} +declare module "locutus/php/var/is_bool" { + function is_bool(mixedVar?:any):any; + export = is_bool; +} +declare module "locutus/php/var/is_buffer" { + function is_buffer(vr?:any):any; + export = is_buffer; +} +declare module "locutus/php/var/is_callable" { + function is_callable(mixedVar?:any, syntaxOnly?:any, callableName?:any):any; + export = is_callable; +} +declare module "locutus/php/var/is_double" { + function is_double(mixedVar?:any):any; + export = is_double; +} +declare module "locutus/php/var/is_float" { + function is_float(mixedVar?:any):any; + export = is_float; +} +declare module "locutus/php/var/is_int" { + function is_int(mixedVar?:any):any; + export = is_int; +} +declare module "locutus/php/var/is_integer" { + function is_integer(mixedVar?:any):any; + export = is_integer; +} +declare module "locutus/php/var/is_long" { + function is_long(mixedVar?:any):any; + export = is_long; +} +declare module "locutus/php/var/is_null" { + function is_null(mixedVar?:any):any; + export = is_null; +} +declare module "locutus/php/var/is_numeric" { + function is_numeric(mixedVar?:any):any; + export = is_numeric; +} +declare module "locutus/php/var/is_object" { + function is_object(mixedVar?:any):any; + export = is_object; +} +declare module "locutus/php/var/is_real" { + function is_real(mixedVar?:any):any; + export = is_real; +} +declare module "locutus/php/var/is_scalar" { + function is_scalar(mixedVar?:any):any; + export = is_scalar; +} +declare module "locutus/php/var/is_string" { + function is_string(mixedVar?:any):any; + export = is_string; +} +declare module "locutus/php/var/is_unicode" { + function is_unicode(vr?:any):any; + export = is_unicode; +} +declare module "locutus/php/var/isset" { + function isset(...args:any[]):any; + export = isset; +} +declare module "locutus/php/var/print_r" { + function print_r(array?:any, returnVal?:any):any; + export = print_r; +} +declare module "locutus/php/var/serialize" { + function serialize(mixedValue?:any):any; + export = serialize; +} +declare module "locutus/php/var/strval" { + function strval(str?:any):any; + export = strval; +} +declare module "locutus/php/var/unserialize" { + function unserialize(data?:any):any; + export = unserialize; +} +declare module "locutus/php/var/var_dump" { + function var_dump(...args:any[]):any; + export = var_dump; +} +declare module "locutus/php/var/var_export" { + function var_export(...args:any[]):any; + export = var_export; +} +declare module "locutus/php/xdiff/xdiff_string_diff" { + function xdiff_string_diff(...args:any[]):any; + export = xdiff_string_diff; +} +declare module "locutus/php/xdiff/xdiff_string_patch" { + function xdiff_string_patch(...args:any[]):any; + export = xdiff_string_patch; +} +declare module "locutus/php/xml/utf8_decode" { + function utf8_decode(strData?:any):any; + export = utf8_decode; +} +declare module "locutus/php/xml/utf8_encode" { + function utf8_encode(argString?:any):any; + export = utf8_encode; +} +declare module "locutus/python/string/capwords" { + function capwords(str?:any):any; + export = capwords; +} +declare module "locutus/ruby/Math/acos" { + function acos(arg?:any):any; + export = acos; +} +declare module "locutus/c/math" { + import abs = require("locutus/c/math/abs"); + export {abs}; +} +declare module "locutus/golang/strings" { + import Contains = require("locutus/golang/strings/Contains"); + import Count = require("locutus/golang/strings/Count"); + import Index = require("locutus/golang/strings/Index"); + import LastIndex = require("locutus/golang/strings/LastIndex"); + export {Contains,Count,Index,LastIndex}; +} +declare module "locutus/php/array" { + import array_change_key_case = require("locutus/php/array/array_change_key_case"); + import array_chunk = require("locutus/php/array/array_chunk"); + import array_combine = require("locutus/php/array/array_combine"); + import array_count_values = require("locutus/php/array/array_count_values"); + import array_diff = require("locutus/php/array/array_diff"); + import array_diff_assoc = require("locutus/php/array/array_diff_assoc"); + import array_diff_key = require("locutus/php/array/array_diff_key"); + import array_diff_uassoc = require("locutus/php/array/array_diff_uassoc"); + import array_diff_ukey = require("locutus/php/array/array_diff_ukey"); + import array_fill = require("locutus/php/array/array_fill"); + import array_fill_keys = require("locutus/php/array/array_fill_keys"); + import array_filter = require("locutus/php/array/array_filter"); + import array_flip = require("locutus/php/array/array_flip"); + import array_intersect = require("locutus/php/array/array_intersect"); + import array_intersect_assoc = require("locutus/php/array/array_intersect_assoc"); + import array_intersect_key = require("locutus/php/array/array_intersect_key"); + import array_intersect_uassoc = require("locutus/php/array/array_intersect_uassoc"); + import array_intersect_ukey = require("locutus/php/array/array_intersect_ukey"); + import array_key_exists = require("locutus/php/array/array_key_exists"); + import array_keys = require("locutus/php/array/array_keys"); + import array_map = require("locutus/php/array/array_map"); + import array_merge = require("locutus/php/array/array_merge"); + import array_merge_recursive = require("locutus/php/array/array_merge_recursive"); + import array_multisort = require("locutus/php/array/array_multisort"); + import array_pad = require("locutus/php/array/array_pad"); + import array_pop = require("locutus/php/array/array_pop"); + import array_product = require("locutus/php/array/array_product"); + import array_push = require("locutus/php/array/array_push"); + import array_rand = require("locutus/php/array/array_rand"); + import array_reduce = require("locutus/php/array/array_reduce"); + import array_replace = require("locutus/php/array/array_replace"); + import array_replace_recursive = require("locutus/php/array/array_replace_recursive"); + import array_reverse = require("locutus/php/array/array_reverse"); + import array_search = require("locutus/php/array/array_search"); + import array_shift = require("locutus/php/array/array_shift"); + import array_slice = require("locutus/php/array/array_slice"); + import array_splice = require("locutus/php/array/array_splice"); + import array_sum = require("locutus/php/array/array_sum"); + import array_udiff = require("locutus/php/array/array_udiff"); + import array_udiff_assoc = require("locutus/php/array/array_udiff_assoc"); + import array_udiff_uassoc = require("locutus/php/array/array_udiff_uassoc"); + import array_uintersect = require("locutus/php/array/array_uintersect"); + import array_uintersect_uassoc = require("locutus/php/array/array_uintersect_uassoc"); + import array_unique = require("locutus/php/array/array_unique"); + import array_unshift = require("locutus/php/array/array_unshift"); + import array_values = require("locutus/php/array/array_values"); + import array_walk = require("locutus/php/array/array_walk"); + import arsort = require("locutus/php/array/arsort"); + import asort = require("locutus/php/array/asort"); + import count = require("locutus/php/array/count"); + import current = require("locutus/php/array/current"); + import each = require("locutus/php/array/each"); + import end = require("locutus/php/array/end"); + import in_array = require("locutus/php/array/in_array"); + import key = require("locutus/php/array/key"); + import krsort = require("locutus/php/array/krsort"); + import ksort = require("locutus/php/array/ksort"); + import natcasesort = require("locutus/php/array/natcasesort"); + import natsort = require("locutus/php/array/natsort"); + import next = require("locutus/php/array/next"); + import pos = require("locutus/php/array/pos"); + import prev = require("locutus/php/array/prev"); + import range = require("locutus/php/array/range"); + import reset = require("locutus/php/array/reset"); + import rsort = require("locutus/php/array/rsort"); + import shuffle = require("locutus/php/array/shuffle"); + import sizeof = require("locutus/php/array/sizeof"); + import sort = require("locutus/php/array/sort"); + import uasort = require("locutus/php/array/uasort"); + import uksort = require("locutus/php/array/uksort"); + import usort = require("locutus/php/array/usort"); + export {array_change_key_case,array_chunk,array_combine,array_count_values,array_diff,array_diff_assoc,array_diff_key,array_diff_uassoc,array_diff_ukey,array_fill,array_fill_keys,array_filter,array_flip,array_intersect,array_intersect_assoc,array_intersect_key,array_intersect_uassoc,array_intersect_ukey,array_key_exists,array_keys,array_map,array_merge,array_merge_recursive,array_multisort,array_pad,array_pop,array_product,array_push,array_rand,array_reduce,array_replace,array_replace_recursive,array_reverse,array_search,array_shift,array_slice,array_splice,array_sum,array_udiff,array_udiff_assoc,array_udiff_uassoc,array_uintersect,array_uintersect_uassoc,array_unique,array_unshift,array_values,array_walk,arsort,asort,count,current,each,end,in_array,key,krsort,ksort,natcasesort,natsort,next,pos,prev,range,reset,rsort,shuffle,sizeof,sort,uasort,uksort,usort}; +} +declare module "locutus/php/bc" { + import bcadd = require("locutus/php/bc/bcadd"); + import bccomp = require("locutus/php/bc/bccomp"); + import bcdiv = require("locutus/php/bc/bcdiv"); + import bcmul = require("locutus/php/bc/bcmul"); + import bcround = require("locutus/php/bc/bcround"); + import bcscale = require("locutus/php/bc/bcscale"); + import bcsub = require("locutus/php/bc/bcsub"); + export {bcadd,bccomp,bcdiv,bcmul,bcround,bcscale,bcsub}; +} +declare module "locutus/php/ctype" { + import ctype_alnum = require("locutus/php/ctype/ctype_alnum"); + import ctype_alpha = require("locutus/php/ctype/ctype_alpha"); + import ctype_cntrl = require("locutus/php/ctype/ctype_cntrl"); + import ctype_digit = require("locutus/php/ctype/ctype_digit"); + import ctype_graph = require("locutus/php/ctype/ctype_graph"); + import ctype_lower = require("locutus/php/ctype/ctype_lower"); + import ctype_print = require("locutus/php/ctype/ctype_print"); + import ctype_punct = require("locutus/php/ctype/ctype_punct"); + import ctype_space = require("locutus/php/ctype/ctype_space"); + import ctype_upper = require("locutus/php/ctype/ctype_upper"); + import ctype_xdigit = require("locutus/php/ctype/ctype_xdigit"); + export {ctype_alnum,ctype_alpha,ctype_cntrl,ctype_digit,ctype_graph,ctype_lower,ctype_print,ctype_punct,ctype_space,ctype_upper,ctype_xdigit}; +} +declare module "locutus/php/datetime" { + import checkdate = require("locutus/php/datetime/checkdate"); + import date = require("locutus/php/datetime/date"); + import date_parse = require("locutus/php/datetime/date_parse"); + import getdate = require("locutus/php/datetime/getdate"); + import gettimeofday = require("locutus/php/datetime/gettimeofday"); + import gmdate = require("locutus/php/datetime/gmdate"); + import gmmktime = require("locutus/php/datetime/gmmktime"); + import gmstrftime = require("locutus/php/datetime/gmstrftime"); + import idate = require("locutus/php/datetime/idate"); + import microtime = require("locutus/php/datetime/microtime"); + import mktime = require("locutus/php/datetime/mktime"); + import strftime = require("locutus/php/datetime/strftime"); + import strptime = require("locutus/php/datetime/strptime"); + import strtotime = require("locutus/php/datetime/strtotime"); + import time = require("locutus/php/datetime/time"); + export {checkdate,date,date_parse,getdate,gettimeofday,gmdate,gmmktime,gmstrftime,idate,microtime,mktime,strftime,strptime,strtotime,time}; +} +declare module "locutus/php/exec" { + import escapeshellarg = require("locutus/php/exec/escapeshellarg"); + export {escapeshellarg}; +} +declare module "locutus/php/filesystem" { + import basename = require("locutus/php/filesystem/basename"); + import dirname = require("locutus/php/filesystem/dirname"); + import file_get_contents = require("locutus/php/filesystem/file_get_contents"); + import pathinfo = require("locutus/php/filesystem/pathinfo"); + import realpath = require("locutus/php/filesystem/realpath"); + export {basename,dirname,file_get_contents,pathinfo,realpath}; +} +declare module "locutus/php/funchand" { + import call_user_func = require("locutus/php/funchand/call_user_func"); + import call_user_func_array = require("locutus/php/funchand/call_user_func_array"); + import create_function = require("locutus/php/funchand/create_function"); + import function_exists = require("locutus/php/funchand/function_exists"); + import get_defined_functions = require("locutus/php/funchand/get_defined_functions"); + export {call_user_func,call_user_func_array,create_function,function_exists,get_defined_functions}; +} +declare module "locutus/php/i18n" { + import i18n_loc_get_default = require("locutus/php/i18n/i18n_loc_get_default"); + import i18n_loc_set_default = require("locutus/php/i18n/i18n_loc_set_default"); + export {i18n_loc_get_default,i18n_loc_set_default}; +} +declare module "locutus/php/info" { + import assert_options = require("locutus/php/info/assert_options"); + import getenv = require("locutus/php/info/getenv"); + import ini_get = require("locutus/php/info/ini_get"); + import ini_set = require("locutus/php/info/ini_set"); + import set_time_limit = require("locutus/php/info/set_time_limit"); + import version_compare = require("locutus/php/info/version_compare"); + export {assert_options,getenv,ini_get,ini_set,set_time_limit,version_compare}; +} +declare module "locutus/php/json" { + import json_decode = require("locutus/php/json/json_decode"); + import json_encode = require("locutus/php/json/json_encode"); + import json_last_error = require("locutus/php/json/json_last_error"); + export {json_decode,json_encode,json_last_error}; +} +declare module "locutus/php/math" { + import abs = require("locutus/php/math/abs"); + import acos = require("locutus/php/math/acos"); + import acosh = require("locutus/php/math/acosh"); + import asin = require("locutus/php/math/asin"); + import asinh = require("locutus/php/math/asinh"); + import atan = require("locutus/php/math/atan"); + import atan2 = require("locutus/php/math/atan2"); + import atanh = require("locutus/php/math/atanh"); + import base_convert = require("locutus/php/math/base_convert"); + import bindec = require("locutus/php/math/bindec"); + import ceil = require("locutus/php/math/ceil"); + import cos = require("locutus/php/math/cos"); + import cosh = require("locutus/php/math/cosh"); + import decbin = require("locutus/php/math/decbin"); + import dechex = require("locutus/php/math/dechex"); + import decoct = require("locutus/php/math/decoct"); + import deg2rad = require("locutus/php/math/deg2rad"); + import exp = require("locutus/php/math/exp"); + import expm1 = require("locutus/php/math/expm1"); + import floor = require("locutus/php/math/floor"); + import fmod = require("locutus/php/math/fmod"); + import getrandmax = require("locutus/php/math/getrandmax"); + import hexdec = require("locutus/php/math/hexdec"); + import hypot = require("locutus/php/math/hypot"); + import is_finite = require("locutus/php/math/is_finite"); + import is_infinite = require("locutus/php/math/is_infinite"); + import is_nan = require("locutus/php/math/is_nan"); + import lcg_value = require("locutus/php/math/lcg_value"); + import log = require("locutus/php/math/log"); + import log10 = require("locutus/php/math/log10"); + import log1p = require("locutus/php/math/log1p"); + import max = require("locutus/php/math/max"); + import min = require("locutus/php/math/min"); + import mt_getrandmax = require("locutus/php/math/mt_getrandmax"); + import mt_rand = require("locutus/php/math/mt_rand"); + import octdec = require("locutus/php/math/octdec"); + import pi = require("locutus/php/math/pi"); + import pow = require("locutus/php/math/pow"); + import rad2deg = require("locutus/php/math/rad2deg"); + import rand = require("locutus/php/math/rand"); + import round = require("locutus/php/math/round"); + import sin = require("locutus/php/math/sin"); + import sinh = require("locutus/php/math/sinh"); + import sqrt = require("locutus/php/math/sqrt"); + import tan = require("locutus/php/math/tan"); + import tanh = require("locutus/php/math/tanh"); + export {abs,acos,acosh,asin,asinh,atan,atan2,atanh,base_convert,bindec,ceil,cos,cosh,decbin,dechex,decoct,deg2rad,exp,expm1,floor,fmod,getrandmax,hexdec,hypot,is_finite,is_infinite,is_nan,lcg_value,log,log10,log1p,max,min,mt_getrandmax,mt_rand,octdec,pi,pow,rad2deg,rand,round,sin,sinh,sqrt,tan,tanh}; +} +declare module "locutus/php/misc" { + import pack = require("locutus/php/misc/pack"); + import uniqid = require("locutus/php/misc/uniqid"); + export {pack,uniqid}; +} +declare module "locutus/php/net-gopher" { + import gopher_parsedir = require("locutus/php/net-gopher/gopher_parsedir"); + export {gopher_parsedir}; +} +declare module "locutus/php/network" { + import inet_ntop = require("locutus/php/network/inet_ntop"); + import inet_pton = require("locutus/php/network/inet_pton"); + import ip2long = require("locutus/php/network/ip2long"); + import long2ip = require("locutus/php/network/long2ip"); + import setcookie = require("locutus/php/network/setcookie"); + import setrawcookie = require("locutus/php/network/setrawcookie"); + export {inet_ntop,inet_pton,ip2long,long2ip,setcookie,setrawcookie}; +} +declare module "locutus/php/pcre" { + import preg_quote = require("locutus/php/pcre/preg_quote"); + import sql_regcase = require("locutus/php/pcre/sql_regcase"); + export {preg_quote,sql_regcase}; +} +declare module "locutus/php/strings" { + import addcslashes = require("locutus/php/strings/addcslashes"); + import addslashes = require("locutus/php/strings/addslashes"); + import bin2hex = require("locutus/php/strings/bin2hex"); + import chop = require("locutus/php/strings/chop"); + import chr = require("locutus/php/strings/chr"); + import chunk_split = require("locutus/php/strings/chunk_split"); + import convert_cyr_string = require("locutus/php/strings/convert_cyr_string"); + import convert_uuencode = require("locutus/php/strings/convert_uuencode"); + import count_chars = require("locutus/php/strings/count_chars"); + import crc32 = require("locutus/php/strings/crc32"); + import echo = require("locutus/php/strings/echo"); + import explode = require("locutus/php/strings/explode"); + import get_html_translation_table = require("locutus/php/strings/get_html_translation_table"); + import hex2bin = require("locutus/php/strings/hex2bin"); + import html_entity_decode = require("locutus/php/strings/html_entity_decode"); + import htmlentities = require("locutus/php/strings/htmlentities"); + import htmlspecialchars = require("locutus/php/strings/htmlspecialchars"); + import htmlspecialchars_decode = require("locutus/php/strings/htmlspecialchars_decode"); + import implode = require("locutus/php/strings/implode"); + import join = require("locutus/php/strings/join"); + import lcfirst = require("locutus/php/strings/lcfirst"); + import levenshtein = require("locutus/php/strings/levenshtein"); + import localeconv = require("locutus/php/strings/localeconv"); + import ltrim = require("locutus/php/strings/ltrim"); + import md5 = require("locutus/php/strings/md5"); + import md5_file = require("locutus/php/strings/md5_file"); + import metaphone = require("locutus/php/strings/metaphone"); + import money_format = require("locutus/php/strings/money_format"); + import nl2br = require("locutus/php/strings/nl2br"); + import nl_langinfo = require("locutus/php/strings/nl_langinfo"); + import number_format = require("locutus/php/strings/number_format"); + import ord = require("locutus/php/strings/ord"); + import parse_str = require("locutus/php/strings/parse_str"); + import printf = require("locutus/php/strings/printf"); + import quoted_printable_decode = require("locutus/php/strings/quoted_printable_decode"); + import quoted_printable_encode = require("locutus/php/strings/quoted_printable_encode"); + import quotemeta = require("locutus/php/strings/quotemeta"); + import rtrim = require("locutus/php/strings/rtrim"); + import setlocale = require("locutus/php/strings/setlocale"); + import sha1 = require("locutus/php/strings/sha1"); + import sha1_file = require("locutus/php/strings/sha1_file"); + import similar_text = require("locutus/php/strings/similar_text"); + import soundex = require("locutus/php/strings/soundex"); + import split = require("locutus/php/strings/split"); + import sprintf = require("locutus/php/strings/sprintf"); + import sscanf = require("locutus/php/strings/sscanf"); + import str_getcsv = require("locutus/php/strings/str_getcsv"); + import str_ireplace = require("locutus/php/strings/str_ireplace"); + import str_pad = require("locutus/php/strings/str_pad"); + import str_repeat = require("locutus/php/strings/str_repeat"); + import str_replace = require("locutus/php/strings/str_replace"); + import str_rot13 = require("locutus/php/strings/str_rot13"); + import str_shuffle = require("locutus/php/strings/str_shuffle"); + import str_split = require("locutus/php/strings/str_split"); + import str_word_count = require("locutus/php/strings/str_word_count"); + import strcasecmp = require("locutus/php/strings/strcasecmp"); + import strchr = require("locutus/php/strings/strchr"); + import strcmp = require("locutus/php/strings/strcmp"); + import strcoll = require("locutus/php/strings/strcoll"); + import strcspn = require("locutus/php/strings/strcspn"); + import strip_tags = require("locutus/php/strings/strip_tags"); + import stripos = require("locutus/php/strings/stripos"); + import stripslashes = require("locutus/php/strings/stripslashes"); + import stristr = require("locutus/php/strings/stristr"); + import strlen = require("locutus/php/strings/strlen"); + import strnatcasecmp = require("locutus/php/strings/strnatcasecmp"); + import strnatcmp = require("locutus/php/strings/strnatcmp"); + import strncasecmp = require("locutus/php/strings/strncasecmp"); + import strncmp = require("locutus/php/strings/strncmp"); + import strpbrk = require("locutus/php/strings/strpbrk"); + import strpos = require("locutus/php/strings/strpos"); + import strrchr = require("locutus/php/strings/strrchr"); + import strrev = require("locutus/php/strings/strrev"); + import strripos = require("locutus/php/strings/strripos"); + import strrpos = require("locutus/php/strings/strrpos"); + import strspn = require("locutus/php/strings/strspn"); + import strstr = require("locutus/php/strings/strstr"); + import strtok = require("locutus/php/strings/strtok"); + import strtolower = require("locutus/php/strings/strtolower"); + import strtoupper = require("locutus/php/strings/strtoupper"); + import strtr = require("locutus/php/strings/strtr"); + import substr = require("locutus/php/strings/substr"); + import substr_compare = require("locutus/php/strings/substr_compare"); + import substr_count = require("locutus/php/strings/substr_count"); + import substr_replace = require("locutus/php/strings/substr_replace"); + import trim = require("locutus/php/strings/trim"); + import ucfirst = require("locutus/php/strings/ucfirst"); + import ucwords = require("locutus/php/strings/ucwords"); + import vprintf = require("locutus/php/strings/vprintf"); + import vsprintf = require("locutus/php/strings/vsprintf"); + import wordwrap = require("locutus/php/strings/wordwrap"); + export {addcslashes,addslashes,bin2hex,chop,chr,chunk_split,convert_cyr_string,convert_uuencode,count_chars,crc32,echo,explode,get_html_translation_table,hex2bin,html_entity_decode,htmlentities,htmlspecialchars,htmlspecialchars_decode,implode,join,lcfirst,levenshtein,localeconv,ltrim,md5,md5_file,metaphone,money_format,nl2br,nl_langinfo,number_format,ord,parse_str,printf,quoted_printable_decode,quoted_printable_encode,quotemeta,rtrim,setlocale,sha1,sha1_file,similar_text,soundex,split,sprintf,sscanf,str_getcsv,str_ireplace,str_pad,str_repeat,str_replace,str_rot13,str_shuffle,str_split,str_word_count,strcasecmp,strchr,strcmp,strcoll,strcspn,strip_tags,stripos,stripslashes,stristr,strlen,strnatcasecmp,strnatcmp,strncasecmp,strncmp,strpbrk,strpos,strrchr,strrev,strripos,strrpos,strspn,strstr,strtok,strtolower,strtoupper,strtr,substr,substr_compare,substr_count,substr_replace,trim,ucfirst,ucwords,vprintf,vsprintf,wordwrap}; +} +declare module "locutus/php/url" { + import base64_decode = require("locutus/php/url/base64_decode"); + import base64_encode = require("locutus/php/url/base64_encode"); + import http_build_query = require("locutus/php/url/http_build_query"); + import parse_url = require("locutus/php/url/parse_url"); + import rawurldecode = require("locutus/php/url/rawurldecode"); + import rawurlencode = require("locutus/php/url/rawurlencode"); + import urldecode = require("locutus/php/url/urldecode"); + import urlencode = require("locutus/php/url/urlencode"); + export {base64_decode,base64_encode,http_build_query,parse_url,rawurldecode,rawurlencode,urldecode,urlencode}; +} +declare module "locutus/php/var" { + import doubleval = require("locutus/php/var/doubleval"); + import empty = require("locutus/php/var/empty"); + import floatval = require("locutus/php/var/floatval"); + import gettype = require("locutus/php/var/gettype"); + import intval = require("locutus/php/var/intval"); + import is_array = require("locutus/php/var/is_array"); + import is_binary = require("locutus/php/var/is_binary"); + import is_bool = require("locutus/php/var/is_bool"); + import is_buffer = require("locutus/php/var/is_buffer"); + import is_callable = require("locutus/php/var/is_callable"); + import is_double = require("locutus/php/var/is_double"); + import is_float = require("locutus/php/var/is_float"); + import is_int = require("locutus/php/var/is_int"); + import is_integer = require("locutus/php/var/is_integer"); + import is_long = require("locutus/php/var/is_long"); + import is_null = require("locutus/php/var/is_null"); + import is_numeric = require("locutus/php/var/is_numeric"); + import is_object = require("locutus/php/var/is_object"); + import is_real = require("locutus/php/var/is_real"); + import is_scalar = require("locutus/php/var/is_scalar"); + import is_string = require("locutus/php/var/is_string"); + import is_unicode = require("locutus/php/var/is_unicode"); + import isset = require("locutus/php/var/isset"); + import print_r = require("locutus/php/var/print_r"); + import serialize = require("locutus/php/var/serialize"); + import strval = require("locutus/php/var/strval"); + import unserialize = require("locutus/php/var/unserialize"); + import var_dump = require("locutus/php/var/var_dump"); + import var_export = require("locutus/php/var/var_export"); + export {doubleval,empty,floatval,gettype,intval,is_array,is_binary,is_bool,is_buffer,is_callable,is_double,is_float,is_int,is_integer,is_long,is_null,is_numeric,is_object,is_real,is_scalar,is_string,is_unicode,isset,print_r,serialize,strval,unserialize,var_dump,var_export}; +} +declare module "locutus/php/xdiff" { + import xdiff_string_diff = require("locutus/php/xdiff/xdiff_string_diff"); + import xdiff_string_patch = require("locutus/php/xdiff/xdiff_string_patch"); + export {xdiff_string_diff,xdiff_string_patch}; +} +declare module "locutus/php/xml" { + import utf8_decode = require("locutus/php/xml/utf8_decode"); + import utf8_encode = require("locutus/php/xml/utf8_encode"); + export {utf8_decode,utf8_encode}; +} +declare module "locutus/python/string" { + import capwords = require("locutus/python/string/capwords"); + export {capwords}; +} +declare module "locutus/ruby/Math" { + import acos = require("locutus/ruby/Math/acos"); + export {acos}; +} +declare module "locutus/c" { + import math = require("locutus/c/math"); + export {math}; +} +declare module "locutus/golang" { + import strings = require("locutus/golang/strings"); + export {strings}; +} +declare module "locutus/php" { + import array = require("locutus/php/array"); + import bc = require("locutus/php/bc"); + import ctype = require("locutus/php/ctype"); + import datetime = require("locutus/php/datetime"); + import exec = require("locutus/php/exec"); + import filesystem = require("locutus/php/filesystem"); + import funchand = require("locutus/php/funchand"); + import i18n = require("locutus/php/i18n"); + import info = require("locutus/php/info"); + import json = require("locutus/php/json"); + import math = require("locutus/php/math"); + import misc = require("locutus/php/misc"); + // import net_gopher = require("locutus/php/net-gopher"); + import network = require("locutus/php/network"); + import pcre = require("locutus/php/pcre"); + import strings = require("locutus/php/strings"); + import url = require("locutus/php/url"); + // import Var = require("locutus/php/var"); + import xdiff = require("locutus/php/xdiff"); + import xml = require("locutus/php/xml"); + export {array,bc,ctype,datetime,exec,filesystem,funchand,i18n,info,json,math,misc,network,pcre,strings,url,xdiff,xml /* ,"net-gopher":net_gopher */ /* ,"var":Var */}; +} +declare module "locutus/python" { + import string = require("locutus/python/string"); + export {string}; +} +declare module "locutus/ruby" { + import Math = require("locutus/ruby/Math"); + export {Math}; +} +declare module "locutus" { + import c = require("locutus/c"); + import golang = require("locutus/golang"); + import php = require("locutus/php"); + import python = require("locutus/python"); + import ruby = require("locutus/ruby"); + export {c,golang,php,python,ruby}; +} diff --git a/locutus/locutus_print.ts b/locutus/locutus_print.ts new file mode 100644 index 0000000000..fc21294639 --- /dev/null +++ b/locutus/locutus_print.ts @@ -0,0 +1,188 @@ +// Automatically generate script for locutus +// Written by: Hookclaw + +/* Usage + tsc locutus_print.ts + node locutus_print.js define + */ + +/// +/// + +var locutus = require('locutus'); + +type f = (...args:any[]) => any; +type e = {[key:string]:f}; +type d = {[key:string]:e}; +type c = {[key:string]:d}; + +let loc:c = locutus; + +let run = ():void => { + if(process.argv.length > 1) { + switch(process.argv[2]) { + case 'define': + define(); + return; + case 'test': + test(); + return; + case 'settings': + settings(); + return; + } + } + console.log('settings,list,define'); +}; + +let define = ():void => { + console.log('// Type definitions for locutus'); + console.log('// Project: http://locutusjs.io'); + console.log('// Definitions by: Hookclaw '); + console.log('// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped'); + console.log(''); + + for(let key1 in loc) { + for(let key2 in loc[key1]) { + for(let key3 in loc[key1][key2]) { + printSingle(loc,key1,key2,key3); + } + } + } + for(let key1 in loc) { + for(let key2 in loc[key1]) { + let modulename = 'locutus/' + key1 + '/' + key2; + printGroup(modulename, loc[key1][key2]); + } + } + for(let key1 in loc) { + let modulename = 'locutus/' + key1; + printGroup(modulename, loc[key1]); + } + let modulename = 'locutus'; + printGroup(modulename, loc); +} + +let printSingle = (loc:c,key1:string,key2:string,key3:string):void => { + console.log('declare module "locutus/' + key1 + '/' + key2 + '/' + key3 + '" {'); + console.log('\tfunction ' + key3 + arg(loc,key1,key2,key3) + ':any;'); + console.log('\texport = ' + key3 + ';'); + console.log('}'); +} + +let printGroup = (modulename:string,loc:{}):void => { + let s:string[] = []; + let c = ''; + console.log('declare module "' + modulename + '" {'); + for(let key in loc) { + let com = ''; + let tmp = replace(key); + if(tmp == key) { + s.push(key); + } else { + com = '// '; + // s.push('"' + key + '":' + tmp); + c += ' /* ,"' + key + '":' + tmp + ' */'; + } + console.log('\t' + com + 'import ' + tmp + ' = require("' + modulename + '/' + key + '");'); + } + console.log('\texport {' + s.join(',') + c + '};'); + console.log('}'); +} + +let replace = (name:string):string => { + if(name == 'var') { + return 'Var'; + } + // if(name == 'string') { + // return 'String'; + // } + return name.replace('-','_'); +} + +let func = (loc:c,key1:string,key2:string,key3:string):string => { + return '"' + key3 + '":' + arg(loc,key1,key2,key3) + ' => any'; +} + +const ARG1 = "(...args:any[])"; + +let arg = (loc:c,key1:string,key2:string,key3:string):string => { + let src = loc[key1][key2][key3].toString(); + let mArguments = /[^a-zA-Z0-9_]arguments[^a-zA-Z0-9_]/; + if(mArguments.test(src)) { + return ARG1; + } + let mFunction = /^function [a-zA-Z0-9_]+\(/g; + let result1 = mFunction.exec(src); + if(result1 == null) { + return ARG1; + } + let mFunction2 = /(\s*[,]?\s*[a-zA-Z0-9_]+)*\)/g; + mFunction2.lastIndex = mFunction.lastIndex; + let result12 = mFunction2.exec(src); + let mParameter = /\s*[,]?\s*[a-zA-Z0-9_]+/g; + let args:string[] = []; + let i = 0; + let result2:any; + while((result2 = mParameter.exec(result12[0])) != null) { + args.push(result2[0]+'?:any'); + i++; + } + return '('+args.join('')+')'; +} + +let test = ():void => { + console.log('/// '); + for(let key1 in loc) { + for(let key2 in loc[key1]) { + for(let key3 in loc[key1][key2]) { + let modulename = 'locutus/' + key1 + '/' + key2 + '/' + key3; + testsub(modulename); + } + } + } + for(let key1 in loc) { + for(let key2 in loc[key1]) { + let modulename = 'locutus/' + key1 + '/' + key2; + testsub(modulename); + } + } + for(let key1 in loc) { + let modulename = 'locutus/' + key1; + testsub(modulename); + } + let modulename = 'locutus'; + testsub(modulename); +} + +let testsub = (modulename:string):void => { + let varname = modulename.replace(/[-/]/g,'_'); + console.log("import " + varname + " = require('" + modulename + "');"); +} + +let settings = ():void => { + let s = ''; + for(let key1 in loc) { + if(key1 != 'php') { + continue; + } + for(let key2 in loc[key1]) { + for(let key3 in loc[key1][key2]) { + if(s != '') { + s += ',\n'; + } + let len = 21 - key3.length; + let tab = ''; + while(len > 0) { + tab += '\t'; + len -= 4; + } + //"var_dump": {"cod":"var_dump", "mod":["var_dump","locutus/php/var/var_dump"]} + s += '\t\t\t\t"' + key3 + '":' + tab + '{"cod":"' + key3 + '","mod":["' + key3 + '","locutus/' + key1 + '/' + key2 + '/' + key3 + '"]}'; + } + } + } + console.log(s); +} + +run(); diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 7931acb2b2..7c63f5be44 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -527,16 +527,12 @@ namespace TestDropRightWhile { result = _.dropRightWhile(array); result = _.dropRightWhile(array, predicateFn); - result = _.dropRightWhile(array, predicateFn, any); result = _.dropRightWhile(array, ''); - result = _.dropRightWhile(array, '', any); result = _.dropRightWhile<{a: number;}, TResult>(array, {a: 42}); result = _.dropRightWhile(list); result = _.dropRightWhile(list, predicateFn); - result = _.dropRightWhile(list, predicateFn, any); result = _.dropRightWhile(list, ''); - result = _.dropRightWhile(list, '', any); result = _.dropRightWhile<{a: number;}, TResult>(list, {a: 42}); } @@ -545,16 +541,12 @@ namespace TestDropRightWhile { result = _(array).dropRightWhile(); result = _(array).dropRightWhile(predicateFn); - result = _(array).dropRightWhile(predicateFn, any); result = _(array).dropRightWhile(''); - result = _(array).dropRightWhile('', any); result = _(array).dropRightWhile<{a: number;}>({a: 42}); result = _(list).dropRightWhile(); result = _(list).dropRightWhile(predicateFn); - result = _(list).dropRightWhile(predicateFn, any); result = _(list).dropRightWhile(''); - result = _(list).dropRightWhile('', any); result = _(list).dropRightWhile<{a: number;}, TResult>({a: 42}); } @@ -563,16 +555,12 @@ namespace TestDropRightWhile { result = _(array).chain().dropRightWhile(); result = _(array).chain().dropRightWhile(predicateFn); - result = _(array).chain().dropRightWhile(predicateFn, any); result = _(array).chain().dropRightWhile(''); - result = _(array).chain().dropRightWhile('', any); result = _(array).chain().dropRightWhile<{a: number;}>({a: 42}); result = _(list).chain().dropRightWhile(); result = _(list).chain().dropRightWhile(predicateFn); - result = _(list).chain().dropRightWhile(predicateFn, any); result = _(list).chain().dropRightWhile(''); - result = _(list).chain().dropRightWhile('', any); result = _(list).chain().dropRightWhile<{a: number;}, TResult>({a: 42}); } } @@ -588,16 +576,12 @@ namespace TestDropWhile { result = _.dropWhile(array); result = _.dropWhile(array, predicateFn); - result = _.dropWhile(array, predicateFn, any); result = _.dropWhile(array, ''); - result = _.dropWhile(array, '', any); result = _.dropWhile<{a: number;}, TResult>(array, {a: 42}); result = _.dropWhile(list); result = _.dropWhile(list, predicateFn); - result = _.dropWhile(list, predicateFn, any); result = _.dropWhile(list, ''); - result = _.dropWhile(list, '', any); result = _.dropWhile<{a: number;}, TResult>(list, {a: 42}); } @@ -606,16 +590,12 @@ namespace TestDropWhile { result = _(array).dropWhile(); result = _(array).dropWhile(predicateFn); - result = _(array).dropWhile(predicateFn, any); result = _(array).dropWhile(''); - result = _(array).dropWhile('', any); result = _(array).dropWhile<{a: number;}>({a: 42}); result = _(list).dropWhile(); result = _(list).dropWhile(predicateFn); - result = _(list).dropWhile(predicateFn, any); result = _(list).dropWhile(''); - result = _(list).dropWhile('', any); result = _(list).dropWhile<{a: number;}, TResult>({a: 42}); } @@ -624,16 +604,12 @@ namespace TestDropWhile { result = _(array).chain().dropWhile(); result = _(array).chain().dropWhile(predicateFn); - result = _(array).chain().dropWhile(predicateFn, any); result = _(array).chain().dropWhile(''); - result = _(array).chain().dropWhile('', any); result = _(array).chain().dropWhile<{a: number;}>({a: 42}); result = _(list).chain().dropWhile(); result = _(list).chain().dropWhile(predicateFn); - result = _(list).chain().dropWhile(predicateFn, any); result = _(list).chain().dropWhile(''); - result = _(list).chain().dropWhile('', any); result = _(list).chain().dropWhile<{a: number;}, TResult>({a: 42}); } } @@ -703,30 +679,22 @@ namespace TestFindIndex { result = _.findIndex(array); result = _.findIndex(array, predicateFn); - result = _.findIndex(array, predicateFn, any); result = _.findIndex(array, ''); - result = _.findIndex(array, '', any); result = _.findIndex<{a: number}, TResult>(array, {a: 42}); result = _.findIndex(list); result = _.findIndex(list, predicateFn); - result = _.findIndex(list, predicateFn, any); result = _.findIndex(list, ''); - result = _.findIndex(list, '', any); result = _.findIndex<{a: number}, TResult>(list, {a: 42}); result = _(array).findIndex(); result = _(array).findIndex(predicateFn); - result = _(array).findIndex(predicateFn, any); result = _(array).findIndex(''); - result = _(array).findIndex('', any); result = _(array).findIndex<{a: number}>({a: 42}); result = _(list).findIndex(); result = _(list).findIndex(predicateFn); - result = _(list).findIndex(predicateFn, any); result = _(list).findIndex(''); - result = _(list).findIndex('', any); result = _(list).findIndex<{a: number}>({a: 42}); } @@ -735,16 +703,12 @@ namespace TestFindIndex { result = _(array).chain().findIndex(); result = _(array).chain().findIndex(predicateFn); - result = _(array).chain().findIndex(predicateFn, any); result = _(array).chain().findIndex(''); - result = _(array).chain().findIndex('', any); result = _(array).chain().findIndex<{a: number}>({a: 42}); result = _(list).chain().findIndex(); result = _(list).chain().findIndex(predicateFn); - result = _(list).chain().findIndex(predicateFn, any); result = _(list).chain().findIndex(''); - result = _(list).chain().findIndex('', any); result = _(list).chain().findIndex<{a: number}>({a: 42}); } } @@ -761,30 +725,22 @@ namespace TestFindLastIndex { result = _.findLastIndex(array); result = _.findLastIndex(array, predicateFn); - result = _.findLastIndex(array, predicateFn, any); result = _.findLastIndex(array, ''); - result = _.findLastIndex(array, '', any); result = _.findLastIndex<{a: number}, TResult>(array, {a: 42}); result = _.findLastIndex(list); result = _.findLastIndex(list, predicateFn); - result = _.findLastIndex(list, predicateFn, any); result = _.findLastIndex(list, ''); - result = _.findLastIndex(list, '', any); result = _.findLastIndex<{a: number}, TResult>(list, {a: 42}); result = _(array).findLastIndex(); result = _(array).findLastIndex(predicateFn); - result = _(array).findLastIndex(predicateFn, any); result = _(array).findLastIndex(''); - result = _(array).findLastIndex('', any); result = _(array).findLastIndex<{a: number}>({a: 42}); result = _(list).findLastIndex(); result = _(list).findLastIndex(predicateFn); - result = _(list).findLastIndex(predicateFn, any); result = _(list).findLastIndex(''); - result = _(list).findLastIndex('', any); result = _(list).findLastIndex<{a: number}>({a: 42}); } @@ -793,16 +749,12 @@ namespace TestFindLastIndex { result = _(array).chain().findLastIndex(); result = _(array).chain().findLastIndex(predicateFn); - result = _(array).chain().findLastIndex(predicateFn, any); result = _(array).chain().findLastIndex(''); - result = _(array).chain().findLastIndex('', any); result = _(array).chain().findLastIndex<{a: number}>({a: 42}); result = _(list).chain().findLastIndex(); result = _(list).chain().findLastIndex(predicateFn); - result = _(list).chain().findLastIndex(predicateFn, any); result = _(list).chain().findLastIndex(''); - result = _(list).chain().findLastIndex('', any); result = _(list).chain().findLastIndex<{a: number}>({a: 42}); } } @@ -1019,6 +971,24 @@ namespace TestFlattenDeep { } } +// _.fromPairs +namespace TestFromPairs { + let array: string[][]; + let result: _.Dictionary; + + { + result = _.fromPairs(array); + } + + { + result = _(array).fromPairs().value(); + } + + { + result = _.chain(array).fromPairs().value(); + } +} + // _.head namespace TestHead { let array: TResult[]; @@ -1412,16 +1382,12 @@ namespace TestRemove { result = _.remove(array); result = _.remove(array, predicateFn); - result = _.remove(array, predicateFn, any); result = _.remove(array, ''); - result = _.remove(array, '', any); result = _.remove<{a: number}, TResult>(array, {a: 42}); result = _.remove(list); result = _.remove(list, predicateFn); - result = _.remove(list, predicateFn, any); result = _.remove(list, ''); - result = _.remove(list, '', any); result = _.remove<{a: number}, TResult>(list, {a: 42}); } @@ -1430,16 +1396,12 @@ namespace TestRemove { result = _(array).remove(); result = _(array).remove(predicateFn); - result = _(array).remove(predicateFn, any); result = _(array).remove(''); - result = _(array).remove('', any); result = _(array).remove<{a: number}>({a: 42}); result = _(list).remove(); result = _(list).remove(predicateFn); - result = _(list).remove(predicateFn, any); result = _(list).remove(''); - result = _(list).remove('', any); result = _(list).remove<{a: number}, TResult>({a: 42}); } @@ -1448,16 +1410,12 @@ namespace TestRemove { result = _(array).chain().remove(); result = _(array).chain().remove(predicateFn); - result = _(array).chain().remove(predicateFn, any); result = _(array).chain().remove(''); - result = _(array).chain().remove('', any); result = _(array).chain().remove<{a: number}>({a: 42}); result = _(list).chain().remove(); result = _(list).chain().remove(predicateFn); - result = _(list).chain().remove(predicateFn, any); result = _(list).chain().remove(''); - result = _(list).chain().remove('', any); result = _(list).chain().remove<{a: number}, TResult>({a: 42}); } } @@ -1834,16 +1792,12 @@ namespace TestTakeRightWhile { result = _.takeRightWhile(array); result = _.takeRightWhile(array, predicateFn); - result = _.takeRightWhile(array, predicateFn, any); result = _.takeRightWhile(array, ''); - result = _.takeRightWhile(array, '', any); result = _.takeRightWhile<{a: number;}, TResult>(array, {a: 42}); result = _.takeRightWhile(list); result = _.takeRightWhile(list, predicateFn); - result = _.takeRightWhile(list, predicateFn, any); result = _.takeRightWhile(list, ''); - result = _.takeRightWhile(list, '', any); result = _.takeRightWhile<{a: number;}, TResult>(list, {a: 42}); } @@ -1852,16 +1806,12 @@ namespace TestTakeRightWhile { result = _(array).takeRightWhile(); result = _(array).takeRightWhile(predicateFn); - result = _(array).takeRightWhile(predicateFn, any); result = _(array).takeRightWhile(''); - result = _(array).takeRightWhile('', any); result = _(array).takeRightWhile<{a: number;}>({a: 42}); result = _(list).takeRightWhile(); result = _(list).takeRightWhile(predicateFn); - result = _(list).takeRightWhile(predicateFn, any); result = _(list).takeRightWhile(''); - result = _(list).takeRightWhile('', any); result = _(list).takeRightWhile<{a: number;}, TResult>({a: 42}); } @@ -1870,16 +1820,12 @@ namespace TestTakeRightWhile { result = _(array).chain().takeRightWhile(); result = _(array).chain().takeRightWhile(predicateFn); - result = _(array).chain().takeRightWhile(predicateFn, any); result = _(array).chain().takeRightWhile(''); - result = _(array).chain().takeRightWhile('', any); result = _(array).chain().takeRightWhile<{a: number;}>({a: 42}); result = _(list).chain().takeRightWhile(); result = _(list).chain().takeRightWhile(predicateFn); - result = _(list).chain().takeRightWhile(predicateFn, any); result = _(list).chain().takeRightWhile(''); - result = _(list).chain().takeRightWhile('', any); result = _(list).chain().takeRightWhile<{a: number;}, TResult>({a: 42}); } } @@ -1895,16 +1841,12 @@ namespace TestTakeWhile { result = _.takeWhile(array); result = _.takeWhile(array, predicateFn); - result = _.takeWhile(array, predicateFn, any); result = _.takeWhile(array, ''); - result = _.takeWhile(array, '', any); result = _.takeWhile<{a: number;}, TResult>(array, {a: 42}); result = _.takeWhile(list); result = _.takeWhile(list, predicateFn); - result = _.takeWhile(list, predicateFn, any); result = _.takeWhile(list, ''); - result = _.takeWhile(list, '', any); result = _.takeWhile<{a: number;}, TResult>(list, {a: 42}); } @@ -1913,16 +1855,12 @@ namespace TestTakeWhile { result = _(array).takeWhile(); result = _(array).takeWhile(predicateFn); - result = _(array).takeWhile(predicateFn, any); result = _(array).takeWhile(''); - result = _(array).takeWhile('', any); result = _(array).takeWhile<{a: number;}>({a: 42}); result = _(list).takeWhile(); result = _(list).takeWhile(predicateFn); - result = _(list).takeWhile(predicateFn, any); result = _(list).takeWhile(''); - result = _(list).takeWhile('', any); result = _(list).takeWhile<{a: number;}, TResult>({a: 42}); } @@ -1931,16 +1869,12 @@ namespace TestTakeWhile { result = _(array).chain().takeWhile(); result = _(array).chain().takeWhile(predicateFn); - result = _(array).chain().takeWhile(predicateFn, any); result = _(array).chain().takeWhile(''); - result = _(array).chain().takeWhile('', any); result = _(array).chain().takeWhile<{a: number;}>({a: 42}); result = _(list).chain().takeWhile(); result = _(list).chain().takeWhile(predicateFn); - result = _(list).chain().takeWhile(predicateFn, any); result = _(list).chain().takeWhile(''); - result = _(list).chain().takeWhile('', any); result = _(list).chain().takeWhile<{a: number;}, TResult>({a: 42}); } } @@ -2443,14 +2377,10 @@ namespace TestUnzip { let result: TResult[]; result = _.unzipWith(testUnzipWithArray); result = _.unzipWith(testUnzipWithArray, testUnzipWithIterator); - result = _.unzipWith(testUnzipWithArray, testUnzipWithIterator, any); result = _.unzipWith(testUnzipWithList); result = _.unzipWith(testUnzipWithList, testUnzipWithIterator); - result = _.unzipWith(testUnzipWithList, testUnzipWithIterator, any); result = _(testUnzipWithArray).unzipWith(testUnzipWithIterator).value(); - result = _(testUnzipWithArray).unzipWith(testUnzipWithIterator, any).value(); result = _(testUnzipWithList).unzipWith(testUnzipWithIterator).value(); - result = _(testUnzipWithList).unzipWith(testUnzipWithIterator, any).value(); } // _.without @@ -2717,14 +2647,12 @@ interface TestZipWithFn { var testZipWithFn: TestZipWithFn; result = _.zipWith([1, 2]); result = _.zipWith([1, 2], testZipWithFn); -result = _.zipWith([1, 2], testZipWithFn, any); -result = _.zipWith([1, 2], [1, 2], testZipWithFn, any); -result = _.zipWith([1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], testZipWithFn, any); +result = _.zipWith([1, 2], [1, 2], testZipWithFn); +result = _.zipWith([1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], testZipWithFn); result = _([1, 2]).zipWith().value(); result = _([1, 2]).zipWith(testZipWithFn).value(); -result = _([1, 2]).zipWith(testZipWithFn, any).value(); -result = _([1, 2]).zipWith([1, 2], testZipWithFn, any).value(); -result = _([1, 2]).zipWith([1, 2], [1, 2], [1, 2], [1, 2], [1, 2], testZipWithFn, any).value(); +result = _([1, 2]).zipWith([1, 2], testZipWithFn).value(); +result = _([1, 2]).zipWith([1, 2], [1, 2], [1, 2], [1, 2], [1, 2], testZipWithFn).value(); /********* * Chain * @@ -2778,7 +2706,6 @@ namespace TestTap { let result: string; _.tap('', interceptor); - _.tap('', interceptor, any); } { @@ -2786,7 +2713,6 @@ namespace TestTap { let result: _.LoDashImplicitArrayWrapper; _.tap([''], interceptor); - _.tap([''], interceptor, any); } { @@ -2794,18 +2720,15 @@ namespace TestTap { let result: _.LoDashImplicitObjectWrapper<{a: string}>; _.tap({a: ''}, interceptor); - _.tap({a: ''}, interceptor, any); } { let interceptor: (value: string) => void; let result: _.LoDashImplicitWrapper; - _.chain('').tap(interceptor, any); - _.chain('').tap(interceptor, any); + _.chain('').tap(interceptor); _('').tap(interceptor); - _('').tap(interceptor, any); } { @@ -2813,10 +2736,8 @@ namespace TestTap { let result: _.LoDashImplicitArrayWrapper; _.chain(['']).tap(interceptor); - _.chain(['']).tap(interceptor, any); _(['']).tap(interceptor); - _(['']).tap(interceptor, any); } { @@ -2824,21 +2745,17 @@ namespace TestTap { let result: _.LoDashImplicitObjectWrapper<{a: string}>; _.chain({a: ''}).tap(interceptor); - _.chain({a: ''}).tap(interceptor, any); _({a: ''}).tap(interceptor); - _({a: ''}).tap(interceptor, any); } { let interceptor: (value: string) => void; let result: _.LoDashExplicitWrapper; - _.chain('').tap(interceptor, any); - _.chain('').tap(interceptor, any); + _.chain('').tap(interceptor); _('').chain().tap(interceptor); - _('').chain().tap(interceptor, any); } { @@ -2846,10 +2763,8 @@ namespace TestTap { let result: _.LoDashExplicitArrayWrapper; _.chain(['']).tap(interceptor); - _.chain(['']).tap(interceptor, any); _(['']).chain().tap(interceptor); - _(['']).chain().tap(interceptor, any); } { @@ -2857,10 +2772,8 @@ namespace TestTap { let result: _.LoDashExplicitObjectWrapper<{a: string}>; _.chain({a: ''}).tap(interceptor); - _.chain({a: ''}).tap(interceptor, any); _({a: ''}).chain().tap(interceptor); - _({a: ''}).chain().tap(interceptor, any); } } @@ -2875,7 +2788,6 @@ namespace TestThru { let result: number; result = _.thru(1, interceptor); - result = _.thru(1, interceptor, any); } { @@ -2883,7 +2795,6 @@ namespace TestThru { let result: _.LoDashImplicitWrapper; result = _(1).thru(interceptor); - result = _(1).thru(interceptor, any); } { @@ -2891,7 +2802,6 @@ namespace TestThru { let result: _.LoDashImplicitWrapper; result = _('').thru(interceptor); - result = _('').thru(interceptor, any); } { @@ -2899,7 +2809,6 @@ namespace TestThru { let result: _.LoDashImplicitWrapper; result = _(true).thru(interceptor); - result = _(true).thru(interceptor, any); } { @@ -2907,7 +2816,6 @@ namespace TestThru { let result: _.LoDashImplicitObjectWrapper<{a: string}>; result = _({a: ''}).thru<{a: string}>(interceptor); - result = _({a: ''}).thru<{a: string}>(interceptor, any); } { @@ -2915,7 +2823,6 @@ namespace TestThru { let result: _.LoDashImplicitArrayWrapper; result = _([1, 2, 3]).thru(interceptor); - result = _([1, 2, 3]).thru(interceptor, any); } { @@ -2923,7 +2830,6 @@ namespace TestThru { let result: _.LoDashExplicitWrapper; result = _(1).chain().thru(interceptor); - result = _(1).chain().thru(interceptor, any); } { @@ -2931,7 +2837,6 @@ namespace TestThru { let result: _.LoDashExplicitWrapper; result = _('').chain().thru(interceptor); - result = _('').chain().thru(interceptor, any); } { @@ -2939,7 +2844,6 @@ namespace TestThru { let result: _.LoDashExplicitWrapper; result = _(true).chain().thru(interceptor); - result = _(true).chain().thru(interceptor, any); } { @@ -2947,7 +2851,6 @@ namespace TestThru { let result: _.LoDashExplicitObjectWrapper<{a: string}>; result = _({a: ''}).chain().thru<{a: string}>(interceptor); - result = _({a: ''}).chain().thru<{a: string}>(interceptor, any); } { @@ -2955,7 +2858,6 @@ namespace TestThru { let result: _.LoDashExplicitArrayWrapper; result = _([1, 2, 3]).chain().thru(interceptor); - result = _([1, 2, 3]).chain().thru(interceptor, any); } } @@ -3134,12 +3036,12 @@ namespace TestPlant { namespace TestReverse { { let result: _.LoDashImplicitArrayWrapper; - result: _([42]).reverse(); + result = _([42]).reverse(); } { let result: _.LoDashExplicitArrayWrapper; - result: _([42]).chain().reverse(); + result = _([42]).chain().reverse(); } } @@ -3326,37 +3228,28 @@ namespace TestCountBy { result = _.countBy(''); result = _.countBy('', stringIterator); - result = _.countBy('', stringIterator, any); result = _.countBy(array); result = _.countBy(array, listIterator); - result = _.countBy(array, listIterator, any); result = _.countBy(array, ''); - result = _.countBy(array, '', any); result = _.countBy<{a: number}, TResult>(array, {a: 42}); result = _.countBy(array, {a: 42}); result = _.countBy(list); result = _.countBy(list, listIterator); - result = _.countBy(list, listIterator, any); result = _.countBy(list, ''); - result = _.countBy(list, '', any); result = _.countBy<{a: number}, TResult>(list, {a: 42}); result = _.countBy(list, {a: 42}); result = _.countBy(dictionary); result = _.countBy(dictionary, dictionaryIterator); - result = _.countBy(dictionary, dictionaryIterator, any); result = _.countBy(dictionary, ''); - result = _.countBy(dictionary, '', any); result = _.countBy<{a: number}, TResult>(dictionary, {a: 42}); result = _.countBy(dictionary, {a: 42}); result = _.countBy(numericDictionary); result = _.countBy(numericDictionary, numericDictionaryIterator); - result = _.countBy(numericDictionary, numericDictionaryIterator, any); result = _.countBy(numericDictionary, ''); - result = _.countBy(numericDictionary, '', any); result = _.countBy<{a: number}, TResult>(numericDictionary, {a: 42}); result = _.countBy(numericDictionary, {a: 42}); } @@ -3366,37 +3259,28 @@ namespace TestCountBy { result = _('').countBy(); result = _('').countBy(stringIterator); - result = _('').countBy(stringIterator, any); result = _(array).countBy(); result = _(array).countBy(listIterator); - result = _(array).countBy(listIterator, any); result = _(array).countBy(''); - result = _(array).countBy('', any); result = _(array).countBy<{a: number}>({a: 42}); result = _(array).countBy({a: 42}); result = _(list).countBy(); result = _(list).countBy(listIterator); - result = _(list).countBy(listIterator, any); result = _(list).countBy(''); - result = _(list).countBy('', any); result = _(list).countBy<{a: number}>({a: 42}); result = _(list).countBy({a: 42}); result = _(dictionary).countBy(); result = _(dictionary).countBy(dictionaryIterator); - result = _(dictionary).countBy(dictionaryIterator, any); result = _(dictionary).countBy(''); - result = _(dictionary).countBy('', any); result = _(dictionary).countBy<{a: number}>({a: 42}); result = _(dictionary).countBy({a: 42}); result = _(numericDictionary).countBy(); result = _(numericDictionary).countBy(numericDictionaryIterator); - result = _(numericDictionary).countBy(numericDictionaryIterator, any); result = _(numericDictionary).countBy(''); - result = _(numericDictionary).countBy('', any); result = _(numericDictionary).countBy<{a: number}>({a: 42}); result = _(numericDictionary).countBy({a: 42}); } @@ -3406,37 +3290,28 @@ namespace TestCountBy { result = _('').chain().countBy(); result = _('').chain().countBy(stringIterator); - result = _('').chain().countBy(stringIterator, any); result = _(array).chain().countBy(); result = _(array).chain().countBy(listIterator); - result = _(array).chain().countBy(listIterator, any); result = _(array).chain().countBy(''); - result = _(array).chain().countBy('', any); result = _(array).chain().countBy<{a: number}>({a: 42}); result = _(array).chain().countBy({a: 42}); result = _(list).chain().countBy(); result = _(list).chain().countBy(listIterator); - result = _(list).chain().countBy(listIterator, any); result = _(list).chain().countBy(''); - result = _(list).chain().countBy('', any); result = _(list).chain().countBy<{a: number}>({a: 42}); result = _(list).chain().countBy({a: 42}); result = _(dictionary).chain().countBy(); result = _(dictionary).chain().countBy(dictionaryIterator); - result = _(dictionary).chain().countBy(dictionaryIterator, any); result = _(dictionary).chain().countBy(''); - result = _(dictionary).chain().countBy('', any); result = _(dictionary).chain().countBy<{a: number}>({a: 42}); result = _(dictionary).chain().countBy({a: 42}); result = _(numericDictionary).chain().countBy(); result = _(numericDictionary).chain().countBy(numericDictionaryIterator); - result = _(numericDictionary).chain().countBy(numericDictionaryIterator, any); result = _(numericDictionary).chain().countBy(''); - result = _(numericDictionary).chain().countBy('', any); result = _(numericDictionary).chain().countBy<{a: number}>({a: 42}); result = _(numericDictionary).chain().countBy({a: 42}); } @@ -3456,84 +3331,72 @@ namespace TestEach { let result: string; _.each('', stringIterator); - _.each('', stringIterator, any); } { let result: TResult[]; _.each(array, listIterator); - _.each(array, listIterator, any); } { let result: _.List; _.each(list, listIterator); - _.each(list, listIterator, any); } { let result: _.Dictionary; _.each(dictionary, dictionaryIterator); - _.each(dictionary, dictionaryIterator, any); } { let result: _.LoDashImplicitWrapper; _('').each(stringIterator); - _('').each(stringIterator, any); } { let result: _.LoDashImplicitArrayWrapper; _(array).each(listIterator); - _(array).each(listIterator, any); } { let result: _.LoDashImplicitObjectWrapper<_.List>; _(list).each(listIterator); - _(list).each(listIterator, any); } { let result: _.LoDashImplicitObjectWrapper<_.Dictionary>; _(dictionary).each(dictionaryIterator); - _(dictionary).each(dictionaryIterator, any); } { let result: _.LoDashExplicitWrapper; _('').chain().each(stringIterator); - _('').chain().each(stringIterator, any); } { let result: _.LoDashExplicitArrayWrapper; _(array).chain().each(listIterator); - _(array).chain().each(listIterator, any); } { let result: _.LoDashExplicitObjectWrapper<_.List>; _(list).chain().each(listIterator); - _(list).chain().each(listIterator, any); } { let result: _.LoDashExplicitObjectWrapper<_.Dictionary>; _(dictionary).chain().each(dictionaryIterator); - _(dictionary).chain().each(dictionaryIterator, any); } } @@ -3551,84 +3414,72 @@ namespace TestEachRight { let result: string; _.eachRight('', stringIterator); - _.eachRight('', stringIterator, any); } { let result: TResult[]; _.eachRight(array, listIterator); - _.eachRight(array, listIterator, any); } { let result: _.List; _.eachRight(list, listIterator); - _.eachRight(list, listIterator, any); } { let result: _.Dictionary; _.eachRight(dictionary, dictionaryIterator); - _.eachRight(dictionary, dictionaryIterator, any); } { let result: _.LoDashImplicitWrapper; _('').eachRight(stringIterator); - _('').eachRight(stringIterator, any); } { let result: _.LoDashImplicitArrayWrapper; _(array).eachRight(listIterator); - _(array).eachRight(listIterator, any); } { let result: _.LoDashImplicitObjectWrapper<_.List>; _(list).eachRight(listIterator); - _(list).eachRight(listIterator, any); } { let result: _.LoDashImplicitObjectWrapper<_.Dictionary>; _(dictionary).eachRight(dictionaryIterator); - _(dictionary).eachRight(dictionaryIterator, any); } { let result: _.LoDashExplicitWrapper; _('').chain().eachRight(stringIterator); - _('').chain().eachRight(stringIterator, any); } { let result: _.LoDashExplicitArrayWrapper; _(array).chain().eachRight(listIterator); - _(array).chain().eachRight(listIterator, any); } { let result: _.LoDashExplicitObjectWrapper<_.List>; _(list).chain().eachRight(listIterator); - _(list).chain().eachRight(listIterator, any); } { let result: _.LoDashExplicitObjectWrapper<_.Dictionary>; _(dictionary).chain().eachRight(dictionaryIterator); - _(dictionary).chain().eachRight(dictionaryIterator, any); } } @@ -3740,28 +3591,21 @@ namespace TestFilter { let result: string[]; result = _.filter('', stringIterator); - result = _.filter('', stringIterator, any); } { let result: TResult[]; result = _.filter(array, listIterator); - result = _.filter(array, listIterator, any); result = _.filter(array, ''); - result = _.filter(array, '', any); result = _.filter<{a: number}, TResult>(array, {a: 42}); result = _.filter(list, listIterator); - result = _.filter(list, listIterator, any); result = _.filter(list, ''); - result = _.filter(list, '', any); result = _.filter<{a: number}, TResult>(list, {a: 42}); result = _.filter(dictionary, dictionaryIterator); - result = _.filter(dictionary, dictionaryIterator, any); result = _.filter(dictionary, ''); - result = _.filter(dictionary, '', any); result = _.filter<{a: number}, TResult>(dictionary, {a: 42}); } @@ -3769,28 +3613,21 @@ namespace TestFilter { let result: _.LoDashImplicitArrayWrapper; result = _('').filter(stringIterator); - result = _('').filter(stringIterator, any); } { let result: _.LoDashImplicitArrayWrapper; result = _(array).filter(listIterator); - result = _(array).filter(listIterator, any); result = _(array).filter(''); - result = _(array).filter('', any); result = _(array).filter<{a: number}>({a: 42}); result = _(list).filter(listIterator); - result = _(list).filter(listIterator, any); result = _(list).filter(''); - result = _(list).filter('', any); result = _(list).filter<{a: number}, TResult>({a: 42}); result = _(dictionary).filter(dictionaryIterator); - result = _(dictionary).filter(dictionaryIterator, any); result = _(dictionary).filter(''); - result = _(dictionary).filter('', any); result = _(dictionary).filter<{a: number}, TResult>({a: 42}); } @@ -3798,28 +3635,21 @@ namespace TestFilter { let result: _.LoDashExplicitArrayWrapper; result = _('').chain().filter(stringIterator); - result = _('').chain().filter(stringIterator, any); } { let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().filter(listIterator); - result = _(array).chain().filter(listIterator, any); result = _(array).chain().filter(''); - result = _(array).chain().filter('', any); result = _(array).chain().filter<{a: number}>({a: 42}); result = _(list).chain().filter(listIterator); - result = _(list).chain().filter(listIterator, any); result = _(list).chain().filter(''); - result = _(list).chain().filter('', any); result = _(list).chain().filter<{a: number}, TResult>({a: 42}); result = _(dictionary).chain().filter(dictionaryIterator); - result = _(dictionary).chain().filter(dictionaryIterator, any); result = _(dictionary).chain().filter(''); - result = _(dictionary).chain().filter('', any); result = _(dictionary).chain().filter<{a: number}, TResult>({a: 42}); } } @@ -3837,37 +3667,31 @@ namespace TestFind { result = _.find(array); result = _.find(array, listIterator); - result = _.find(array, listIterator, any); result = _.find(array, ''); result = _.find<{a: number}, TResult>(array, {a: 42}); result = _.find(list); result = _.find(list, listIterator); - result = _.find(list, listIterator, any); result = _.find(list, ''); result = _.find<{a: number}, TResult>(list, {a: 42}); result = _.find(dictionary); result = _.find(dictionary, dictionaryIterator); - result = _.find(dictionary, dictionaryIterator, any); result = _.find(dictionary, ''); result = _.find<{a: number}, TResult>(dictionary, {a: 42}); result = _(array).find(); result = _(array).find(listIterator); - result = _(array).find(listIterator, any); result = _(array).find(''); result = _(array).find<{a: number}>({a: 42}); result = _(list).find(); result = _(list).find(listIterator); - result = _(list).find(listIterator, any); result = _(list).find(''); result = _(list).find<{a: number}, TResult>({a: 42}); result = _(dictionary).find(); result = _(dictionary).find(dictionaryIterator); - result = _(dictionary).find(dictionaryIterator, any); result = _(dictionary).find(''); result = _(dictionary).find<{a: number}, TResult>({a: 42}); } @@ -4089,84 +3913,72 @@ namespace TestForEach { let result: string; _.forEach('', stringIterator); - _.forEach('', stringIterator, any); } { let result: TResult[]; _.forEach(array, listIterator); - _.forEach(array, listIterator, any); } { let result: _.List; _.forEach(list, listIterator); - _.forEach(list, listIterator, any); } { let result: _.Dictionary; _.forEach(dictionary, dictionaryIterator); - _.forEach(dictionary, dictionaryIterator, any); } { let result: _.LoDashImplicitWrapper; _('').forEach(stringIterator); - _('').forEach(stringIterator, any); } { let result: _.LoDashImplicitArrayWrapper; _(array).forEach(listIterator); - _(array).forEach(listIterator, any); } { let result: _.LoDashImplicitObjectWrapper<_.List>; _(list).forEach(listIterator); - _(list).forEach(listIterator, any); } { let result: _.LoDashImplicitObjectWrapper<_.Dictionary>; _(dictionary).forEach(dictionaryIterator); - _(dictionary).forEach(dictionaryIterator, any); } { let result: _.LoDashExplicitWrapper; _('').chain().forEach(stringIterator); - _('').chain().forEach(stringIterator, any); } { let result: _.LoDashExplicitArrayWrapper; _(array).chain().forEach(listIterator); - _(array).chain().forEach(listIterator, any); } { let result: _.LoDashExplicitObjectWrapper<_.List>; _(list).chain().forEach(listIterator); - _(list).chain().forEach(listIterator, any); } { let result: _.LoDashExplicitObjectWrapper<_.Dictionary>; _(dictionary).chain().forEach(dictionaryIterator); - _(dictionary).chain().forEach(dictionaryIterator, any); } } @@ -4184,84 +3996,72 @@ namespace TestForEachRight { let result: string; _.forEachRight('', stringIterator); - _.forEachRight('', stringIterator, any); } { let result: TResult[]; _.forEachRight(array, listIterator); - _.forEachRight(array, listIterator, any); } { let result: _.List; _.forEachRight(list, listIterator); - _.forEachRight(list, listIterator, any); } { let result: _.Dictionary; _.forEachRight(dictionary, dictionaryIterator); - _.forEachRight(dictionary, dictionaryIterator, any); } { let result: _.LoDashImplicitWrapper; _('').forEachRight(stringIterator); - _('').forEachRight(stringIterator, any); } { let result: _.LoDashImplicitArrayWrapper; _(array).forEachRight(listIterator); - _(array).forEachRight(listIterator, any); } { let result: _.LoDashImplicitObjectWrapper<_.List>; _(list).forEachRight(listIterator); - _(list).forEachRight(listIterator, any); } { let result: _.LoDashImplicitObjectWrapper<_.Dictionary>; _(dictionary).forEachRight(dictionaryIterator); - _(dictionary).forEachRight(dictionaryIterator, any); } { let result: _.LoDashExplicitWrapper; _('').chain().forEachRight(stringIterator); - _('').chain().forEachRight(stringIterator, any); } { let result: _.LoDashExplicitArrayWrapper; _(array).chain().forEachRight(listIterator); - _(array).chain().forEachRight(listIterator, any); } { let result: _.LoDashExplicitObjectWrapper<_.List>; _(list).chain().forEachRight(listIterator); - _(list).chain().forEachRight(listIterator, any); } { let result: _.LoDashExplicitObjectWrapper<_.Dictionary>; _(dictionary).chain().forEachRight(dictionaryIterator); - _(dictionary).chain().forEachRight(dictionaryIterator, any); } } @@ -4282,9 +4082,7 @@ namespace TestGroupBy { result = _.groupBy(''); result = _.groupBy('', stringIterator); - result = _.groupBy('', stringIterator, any); result = _.groupBy('', stringIterator); - result = _.groupBy('', stringIterator, any); } { @@ -4292,38 +4090,29 @@ namespace TestGroupBy { result = _.groupBy(array); result = _.groupBy(array, listIterator); - result = _.groupBy(array, listIterator, any); result = _.groupBy(array, ''); - result = _.groupBy(array, '', any); result = _.groupBy(array, {a: 42}); result = _.groupBy(array, listIterator); - result = _.groupBy(array, listIterator, any); - result = _.groupBy(array, '', true); + result = _.groupBy(array, ''); result = _.groupBy<{a: number}, SampleType>(array, {a: 42}); result = _.groupBy(list); result = _.groupBy(list, listIterator); - result = _.groupBy(list, listIterator, any); result = _.groupBy(list, ''); - result = _.groupBy(list, '', any); result = _.groupBy(list, {a: 42}); result = _.groupBy(list, listIterator); - result = _.groupBy(list, listIterator, any); - result = _.groupBy(list, '', true); + result = _.groupBy(list, ''); result = _.groupBy<{a: number}, SampleType>(list, {a: 42}); result = _.groupBy(dictionary); result = _.groupBy(dictionary, dictionaryIterator); - result = _.groupBy(dictionary, dictionaryIterator, any); result = _.groupBy(dictionary, ''); - result = _.groupBy(dictionary, '', any); result = _.groupBy(dictionary, {a: 42}); result = _.groupBy(dictionary, dictionaryIterator); - result = _.groupBy(dictionary, dictionaryIterator, any); - result = _.groupBy(dictionary, '', true); + result = _.groupBy(dictionary, ''); result = _.groupBy<{a: number}, SampleType>(dictionary, {a: 42}); } @@ -4332,7 +4121,6 @@ namespace TestGroupBy { result = _('').groupBy(); result = _('').groupBy(stringIterator); - result = _('').groupBy(stringIterator, any); } { @@ -4340,33 +4128,26 @@ namespace TestGroupBy { result = _(array).groupBy(); result = _(array).groupBy(listIterator); - result = _(array).groupBy(listIterator, any); result = _(array).groupBy(''); - result = _(array).groupBy('', true); + result = _(array).groupBy(''); result = _(array).groupBy<{a: number}>({a: 42}); result = _(list).groupBy(); result = _(list).groupBy(listIterator); - result = _(list).groupBy(listIterator, any); result = _(list).groupBy(''); - result = _(list).groupBy('', any); result = _(list).groupBy({a: 42}); result = _(list).groupBy(listIterator); - result = _(list).groupBy(listIterator, any); - result = _(list).groupBy('', true); + result = _(list).groupBy(''); result = _(list).groupBy<{a: number}, SampleType>({a: 42}); result = _(dictionary).groupBy(); result = _(dictionary).groupBy(dictionaryIterator); - result = _(dictionary).groupBy(dictionaryIterator, any); result = _(dictionary).groupBy(''); - result = _(dictionary).groupBy('', any); result = _(dictionary).groupBy({a: 42}); result = _(dictionary).groupBy(dictionaryIterator); - result = _(dictionary).groupBy(dictionaryIterator, any); - result = _(dictionary).groupBy('', true); + result = _(dictionary).groupBy(''); result = _(dictionary).groupBy<{a: number}, SampleType>({a: 42}); } @@ -4375,7 +4156,6 @@ namespace TestGroupBy { result = _('').chain().groupBy(); result = _('').chain().groupBy(stringIterator); - result = _('').chain().groupBy(stringIterator, any); } { @@ -4383,33 +4163,26 @@ namespace TestGroupBy { result = _(array).chain().groupBy(); result = _(array).chain().groupBy(listIterator); - result = _(array).chain().groupBy(listIterator, any); result = _(array).chain().groupBy(''); - result = _(array).chain().groupBy('', true); + result = _(array).chain().groupBy(''); result = _(array).chain().groupBy<{a: number}>({a: 42}); result = _(list).chain().groupBy(); result = _(list).chain().groupBy(listIterator); - result = _(list).chain().groupBy(listIterator, any); result = _(list).chain().groupBy(''); - result = _(list).chain().groupBy('', any); result = _(list).chain().groupBy({a: 42}); result = _(list).chain().groupBy(listIterator); - result = _(list).chain().groupBy(listIterator, any); - result = _(list).chain().groupBy('', true); + result = _(list).chain().groupBy(''); result = _(list).chain().groupBy<{a: number}, SampleType>({a: 42}); result = _(dictionary).chain().groupBy(); result = _(dictionary).chain().groupBy(dictionaryIterator); - result = _(dictionary).chain().groupBy(dictionaryIterator, any); result = _(dictionary).chain().groupBy(''); - result = _(dictionary).chain().groupBy('', any); result = _(dictionary).chain().groupBy({a: 42}); result = _(dictionary).chain().groupBy(dictionaryIterator); - result = _(dictionary).chain().groupBy(dictionaryIterator, any); - result = _(dictionary).chain().groupBy('', true); + result = _(dictionary).chain().groupBy(''); result = _(dictionary).chain().groupBy<{a: number}, SampleType>({a: 42}); } } @@ -4479,7 +4252,6 @@ namespace TestKeyBy { result = _.keyBy('abcd'); result = _.keyBy('abcd', stringIterator); - result = _.keyBy('abcd', stringIterator, any); } { @@ -4487,33 +4259,25 @@ namespace TestKeyBy { result = _.keyBy(array); result = _.keyBy(array, listIterator); - result = _.keyBy(array, listIterator, any); result = _.keyBy(array, 'a'); - result = _.keyBy(array, 'a', any); result = _.keyBy<{a: number}, SampleObject>(array, {a: 42}); result = _.keyBy(array, {a: 42}); result = _.keyBy(list); result = _.keyBy(list, listIterator); - result = _.keyBy(list, listIterator, any); result = _.keyBy(list, 'a'); - result = _.keyBy(list, 'a', any); result = _.keyBy<{a: number}, SampleObject>(list, {a: 42}); result = _.keyBy(list, {a: 42}); result = _.keyBy(numericDictionary); result = _.keyBy(numericDictionary, numericDictionaryIterator); - result = _.keyBy(numericDictionary, numericDictionaryIterator, any); result = _.keyBy(numericDictionary, 'a'); - result = _.keyBy(numericDictionary, 'a', any); result = _.keyBy<{a: number}, SampleObject>(numericDictionary, {a: 42}); result = _.keyBy(numericDictionary, {a: 42}); result = _.keyBy(dictionary); result = _.keyBy(dictionary, dictionaryIterator); - result = _.keyBy(dictionary, dictionaryIterator, any); result = _.keyBy(dictionary, 'a'); - result = _.keyBy(dictionary, 'a', any); result = _.keyBy<{a: number}, SampleObject>(dictionary, {a: 42}); result = _.keyBy(dictionary, {a: 42}); } @@ -4523,7 +4287,6 @@ namespace TestKeyBy { result = _('abcd').keyBy(); result = _('abcd').keyBy(stringIterator); - result = _('abcd').keyBy(stringIterator, any); } { @@ -4531,32 +4294,24 @@ namespace TestKeyBy { result = _(array).keyBy(); result = _(array).keyBy(listIterator); - result = _(array).keyBy(listIterator, any); result = _(array).keyBy('a'); - result = _(array).keyBy('a', any); result = _(array).keyBy<{a: number}>({a: 42}); result = _(list).keyBy(); result = _(list).keyBy(listIterator); - result = _(list).keyBy(listIterator, any); result = _(list).keyBy('a'); - result = _(list).keyBy('a', any); result = _(list).keyBy<{a: number}, SampleObject>({a: 42}); result = _(list).keyBy({a: 42}); result = _(numericDictionary).keyBy(); result = _(numericDictionary).keyBy(numericDictionaryIterator); - result = _(numericDictionary).keyBy(numericDictionaryIterator, any); result = _(numericDictionary).keyBy('a'); - result = _(numericDictionary).keyBy('a', any); result = _(numericDictionary).keyBy<{a: number}, SampleObject>({a: 42}); result = _(numericDictionary).keyBy({a: 42}); result = _(dictionary).keyBy(); result = _(dictionary).keyBy(dictionaryIterator); - result = _(dictionary).keyBy(dictionaryIterator, any); result = _(dictionary).keyBy('a'); - result = _(dictionary).keyBy('a', any); result = _(dictionary).keyBy<{a: number}, SampleObject>({a: 42}); result = _(dictionary).keyBy({a: 42}); } @@ -4566,7 +4321,6 @@ namespace TestKeyBy { result = _('abcd').chain().keyBy(); result = _('abcd').chain().keyBy(stringIterator); - result = _('abcd').chain().keyBy(stringIterator, any); } { @@ -4574,32 +4328,24 @@ namespace TestKeyBy { result = _(array).chain().keyBy(); result = _(array).chain().keyBy(listIterator); - result = _(array).chain().keyBy(listIterator, any); result = _(array).chain().keyBy('a'); - result = _(array).chain().keyBy('a', any); result = _(array).chain().keyBy<{a: number}>({a: 42}); result = _(list).chain().keyBy(); result = _(list).chain().keyBy(listIterator); - result = _(list).chain().keyBy(listIterator, any); result = _(list).chain().keyBy('a'); - result = _(list).chain().keyBy('a', any); result = _(list).chain().keyBy<{a: number}, SampleObject>({a: 42}); result = _(list).chain().keyBy({a: 42}); result = _(numericDictionary).chain().keyBy(); result = _(numericDictionary).chain().keyBy(numericDictionaryIterator); - result = _(numericDictionary).chain().keyBy(numericDictionaryIterator, any); result = _(numericDictionary).chain().keyBy('a'); - result = _(numericDictionary).chain().keyBy('a', any); result = _(numericDictionary).chain().keyBy<{a: number}, SampleObject>({a: 42}); result = _(numericDictionary).chain().keyBy({a: 42}); result = _(dictionary).chain().keyBy(); result = _(dictionary).chain().keyBy(dictionaryIterator); - result = _(dictionary).chain().keyBy(dictionaryIterator, any); result = _(dictionary).chain().keyBy('a'); - result = _(dictionary).chain().keyBy('a', any); result = _(dictionary).chain().keyBy<{a: number}, SampleObject>({a: 42}); result = _(dictionary).chain().keyBy({a: 42}); } @@ -4749,17 +4495,14 @@ namespace TestMap { result = _.map(array); result = _.map(array, listIterator); - result = _.map(array, listIterator, any); result = _.map(array, ''); result = _.map(list); result = _.map(list, listIterator); - result = _.map(list, listIterator, any); result = _.map(list, ''); result = _.map(dictionary); result = _.map(dictionary, dictionaryIterator); - result = _.map(dictionary, dictionaryIterator, any); result = _.map(dictionary, ''); } @@ -4776,17 +4519,14 @@ namespace TestMap { result = _(array).map(); result = _(array).map(listIterator); - result = _(array).map(listIterator, any); result = _(array).map(''); result = _(list).map(); result = _(list).map(listIterator); - result = _(list).map(listIterator, any); result = _(list).map(''); result = _(dictionary).map(); result = _(dictionary).map(dictionaryIterator); - result = _(dictionary).map(dictionaryIterator, any); result = _(dictionary).map(''); } @@ -4803,17 +4543,14 @@ namespace TestMap { result = _(array).chain().map(); result = _(array).chain().map(listIterator); - result = _(array).chain().map(listIterator, any); result = _(array).chain().map(''); result = _(list).chain().map(); result = _(list).chain().map(listIterator); - result = _(list).chain().map(listIterator, any); result = _(list).chain().map(''); result = _(dictionary).chain().map(); result = _(dictionary).chain().map(dictionaryIterator); - result = _(dictionary).chain().map(dictionaryIterator, any); result = _(dictionary).chain().map(''); } @@ -4939,7 +4676,7 @@ result = _([1, 2, 3]).reduce(function (sum: number, num: number) result = _({ 'a': 1, 'b': 2, 'c': 3 }).reduce(function (r: ABC, num: number, key: string) { r[key] = num * 3; return r; -}, {}); +}, {}); result = _.reduceRight([[0, 1], [2, 3], [4, 5]], function (a: number[], b: number[]) { return a.concat(b); }, []); @@ -4957,28 +4694,21 @@ namespace TestReject { let result: string[]; result = _.reject('', stringIterator); - result = _.reject('', stringIterator, any); } { let result: TResult[]; result = _.reject(array, listIterator); - result = _.reject(array, listIterator, any); result = _.reject(array, ''); - result = _.reject(array, '', any); result = _.reject<{a: number}, TResult>(array, {a: 42}); result = _.reject(list, listIterator); - result = _.reject(list, listIterator, any); result = _.reject(list, ''); - result = _.reject(list, '', any); result = _.reject<{a: number}, TResult>(list, {a: 42}); result = _.reject(dictionary, dictionaryIterator); - result = _.reject(dictionary, dictionaryIterator, any); result = _.reject(dictionary, ''); - result = _.reject(dictionary, '', any); result = _.reject<{a: number}, TResult>(dictionary, {a: 42}); } @@ -4986,28 +4716,21 @@ namespace TestReject { let result: _.LoDashImplicitArrayWrapper; result = _('').reject(stringIterator); - result = _('').reject(stringIterator, any); } { let result: _.LoDashImplicitArrayWrapper; result = _(array).reject(listIterator); - result = _(array).reject(listIterator, any); result = _(array).reject(''); - result = _(array).reject('', any); result = _(array).reject<{a: number}>({a: 42}); result = _(list).reject(listIterator); - result = _(list).reject(listIterator, any); result = _(list).reject(''); - result = _(list).reject('', any); result = _(list).reject<{a: number}, TResult>({a: 42}); result = _(dictionary).reject(dictionaryIterator); - result = _(dictionary).reject(dictionaryIterator, any); result = _(dictionary).reject(''); - result = _(dictionary).reject('', any); result = _(dictionary).reject<{a: number}, TResult>({a: 42}); } @@ -5015,28 +4738,21 @@ namespace TestReject { let result: _.LoDashExplicitArrayWrapper; result = _('').chain().reject(stringIterator); - result = _('').chain().reject(stringIterator, any); } { let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().reject(listIterator); - result = _(array).chain().reject(listIterator, any); result = _(array).chain().reject(''); - result = _(array).chain().reject('', any); result = _(array).chain().reject<{a: number}>({a: 42}); result = _(list).chain().reject(listIterator); - result = _(list).chain().reject(listIterator, any); result = _(list).chain().reject(''); - result = _(list).chain().reject('', any); result = _(list).chain().reject<{a: number}, TResult>({a: 42}); result = _(dictionary).chain().reject(dictionaryIterator); - result = _(dictionary).chain().reject(dictionaryIterator, any); result = _(dictionary).chain().reject(''); - result = _(dictionary).chain().reject('', any); result = _(dictionary).chain().reject<{a: number}, TResult>({a: 42}); } } @@ -8298,12 +8014,12 @@ namespace TestRandom { // _.assign namespace TestAssign { - interface Obj {a: string}; - interface S1 {a: number}; - interface S2 {b: number}; - interface S3 {c: number}; - interface S4 {d: number}; - interface S5 {e: number}; + interface Obj { a: string }; + interface S1 { a: number }; + interface S2 { b: number }; + interface S3 { c: number }; + interface S4 { d: number }; + interface S5 { e: number }; let obj: Obj; let s1: S1; @@ -8317,37 +8033,37 @@ namespace TestAssign { { let result: Obj; - result = _.assign(obj); + result = _.assign(obj); } { - let result: {a: number}; + let result: { a: number }; - result = _.assign(obj, s1); + result = _.assign(obj, s1); } { - let result: {a: number, b: number}; + let result: { a: number, b: number }; - result = _.assign(obj, s1, s2); + result = _.assign(obj, s1, s2); } { - let result: {a: number, b: number, c: number}; + let result: { a: number, b: number, c: number }; - result = _.assign(obj, s1, s2, s3); + result = _.assign(obj, s1, s2, s3); } { - let result: {a: number, b: number, c: number, d: number}; + let result: { a: number, b: number, c: number, d: number }; - result = _.assign(obj, s1, s2, s3, s4); + result = _.assign(obj, s1, s2, s3, s4); } { - let result: {a: number, b: number, c: number, d: number, e: number}; + let result: { a: number, b: number, c: number, d: number, e: number }; - result = _.assign(obj, s1, s2, s3, s4, s5); + result = _.assign<{ a: number, b: number, c: number, d: number, e: number }>(obj, s1, s2, s3, s4, s5); } { @@ -8357,33 +8073,33 @@ namespace TestAssign { } { - let result: _.LoDashImplicitObjectWrapper<{a: number}>; + let result: _.LoDashImplicitObjectWrapper<{ a: number }>; - result = _(obj).assign(s1); + result = _(obj).assign(s1); } { - let result: _.LoDashImplicitObjectWrapper<{a: number, b: number}>; + let result: _.LoDashImplicitObjectWrapper<{ a: number, b: number }>; - result = _(obj).assign(s1, s2); + result = _(obj).assign(s1, s2); } { - let result: _.LoDashImplicitObjectWrapper<{a: number, b: number, c: number}>; + let result: _.LoDashImplicitObjectWrapper<{ a: number, b: number, c: number }>; - result = _(obj).assign(s1, s2, s3); + result = _(obj).assign(s1, s2, s3); } { - let result: _.LoDashImplicitObjectWrapper<{a: number, b: number, c: number, d: number}>; + let result: _.LoDashImplicitObjectWrapper<{ a: number, b: number, c: number, d: number }>; - result = _(obj).assign(s1, s2, s3, s4); + result = _(obj).assign(s1, s2, s3, s4); } { - let result: _.LoDashImplicitObjectWrapper<{a: number, b: number, c: number, d: number, e: number}>; + let result: _.LoDashImplicitObjectWrapper<{ a: number, b: number, c: number, d: number, e: number }>; - result = _(obj).assign<{a: number, b: number, c: number, d: number, e: number}>(s1, s2, s3, s4, s5); + result = _(obj).assign<{ a: number, b: number, c: number, d: number, e: number }>(s1, s2, s3, s4, s5); } { @@ -8393,44 +8109,44 @@ namespace TestAssign { } { - let result: _.LoDashExplicitObjectWrapper<{a: number}>; + let result: _.LoDashExplicitObjectWrapper<{ a: number }>; - result = _(obj).chain().assign(s1); + result = _(obj).chain().assign(s1); } { - let result: _.LoDashExplicitObjectWrapper<{a: number, b: number}>; + let result: _.LoDashExplicitObjectWrapper<{ a: number, b: number }>; - result = _(obj).chain().assign(s1, s2); + result = _(obj).chain().assign(s1, s2); } { - let result: _.LoDashExplicitObjectWrapper<{a: number, b: number, c: number}>; + let result: _.LoDashExplicitObjectWrapper<{ a: number, b: number, c: number }>; - result = _(obj).chain().assign(s1, s2, s3); + result = _(obj).chain().assign(s1, s2, s3); } { - let result: _.LoDashExplicitObjectWrapper<{a: number, b: number, c: number, d: number}>; + let result: _.LoDashExplicitObjectWrapper<{ a: number, b: number, c: number, d: number }>; - result = _(obj).chain().assign(s1, s2, s3, s4); + result = _(obj).chain().assign(s1, s2, s3, s4); } { - let result: _.LoDashExplicitObjectWrapper<{a: number, b: number, c: number, d: number, e: number}>; + let result: _.LoDashExplicitObjectWrapper<{ a: number, b: number, c: number, d: number, e: number }>; - result = _(obj).chain().assign<{a: number, b: number, c: number, d: number, e: number}>(s1, s2, s3, s4, s5); + result = _(obj).chain().assign<{ a: number, b: number, c: number, d: number, e: number }>(s1, s2, s3, s4, s5); } } // _.assignWith namespace TestAssignWith { - interface Obj {a: string}; - interface S1 {a: number}; - interface S2 {b: number}; - interface S3 {c: number}; - interface S4 {d: number}; - interface S5 {e: number}; + interface Obj { a: string }; + interface S1 { a: number }; + interface S2 { b: number }; + interface S3 { c: number }; + interface S4 { d: number }; + interface S5 { e: number }; let obj: Obj; let s1: S1; @@ -8444,32 +8160,32 @@ namespace TestAssignWith { { let result: Obj; - result = _.assignWith(obj); + result = _.assignWith(obj); } { - let result: {a: number}; - result = _.assignWith(obj, s1, customizer); + let result: { a: number }; + result = _.assignWith(obj, s1, customizer); } { - let result: {a: number, b: number}; - result = _.assignWith(obj, s1, s2, customizer); + let result: { a: number, b: number }; + result = _.assignWith(obj, s1, s2, customizer); } { - let result: {a: number, b: number, c: number}; - result = _.assignWith(obj, s1, s2, s3, customizer); + let result: { a: number, b: number, c: number }; + result = _.assignWith(obj, s1, s2, s3, customizer); } { - let result: {a: number, b: number, c: number, d: number}; - result = _.assignWith(obj, s1, s2, s3, s4, customizer); + let result: { a: number, b: number, c: number, d: number }; + result = _.assignWith(obj, s1, s2, s3, s4, customizer); } { - let result: {a: number, b: number, c: number, d: number, e: number}; - result = _.assignWith(obj, s1, s2, s3, s4, s5, customizer); + let result: { a: number, b: number, c: number, d: number, e: number }; + result = _.assignWith<{ a: number, b: number, c: number, d: number, e: number }>(obj, s1, s2, s3, s4, s5, customizer); } { @@ -8479,28 +8195,28 @@ namespace TestAssignWith { } { - let result: _.LoDashImplicitObjectWrapper<{a: number}>; - result = _(obj).assignWith(s1, customizer); + let result: _.LoDashImplicitObjectWrapper<{ a: number }>; + result = _(obj).assignWith(s1, customizer); } { - let result: _.LoDashImplicitObjectWrapper<{a: number, b: number}>; - result = _(obj).assignWith(s1, s2, customizer); + let result: _.LoDashImplicitObjectWrapper<{ a: number, b: number }>; + result = _(obj).assignWith(s1, s2, customizer); } { - let result: _.LoDashImplicitObjectWrapper<{a: number, b: number, c: number}>; - result = _(obj).assignWith(s1, s2, s3, customizer); + let result: _.LoDashImplicitObjectWrapper<{ a: number, b: number, c: number }>; + result = _(obj).assignWith(s1, s2, s3, customizer); } { - let result: _.LoDashImplicitObjectWrapper<{a: number, b: number, c: number, d: number}>; - result = _(obj).assignWith(s1, s2, s3, s4, customizer); + let result: _.LoDashImplicitObjectWrapper<{ a: number, b: number, c: number, d: number }>; + result = _(obj).assignWith(s1, s2, s3, s4, customizer); } { - let result: _.LoDashImplicitObjectWrapper<{a: number, b: number, c: number, d: number, e: number}>; - result = _(obj).assignWith<{a: number, b: number, c: number, d: number, e: number}>(s1, s2, s3, s4, s5, customizer); + let result: _.LoDashImplicitObjectWrapper<{ a: number, b: number, c: number, d: number, e: number }>; + result = _(obj).assignWith<{ a: number, b: number, c: number, d: number, e: number }>(s1, s2, s3, s4, s5, customizer); } { @@ -8510,39 +8226,39 @@ namespace TestAssignWith { } { - let result: _.LoDashExplicitObjectWrapper<{a: number}>; - result = _(obj).chain().assignWith(s1, customizer); + let result: _.LoDashExplicitObjectWrapper<{ a: number }>; + result = _(obj).chain().assignWith(s1, customizer); } { - let result: _.LoDashExplicitObjectWrapper<{a: number, b: number}>; - result = _(obj).chain().assignWith(s1, s2, customizer); + let result: _.LoDashExplicitObjectWrapper<{ a: number, b: number }>; + result = _(obj).chain().assignWith(s1, s2, customizer); } { - let result: _.LoDashExplicitObjectWrapper<{a: number, b: number, c: number}>; - result = _(obj).chain().assignWith(s1, s2, s3, customizer); + let result: _.LoDashExplicitObjectWrapper<{ a: number, b: number, c: number }>; + result = _(obj).chain().assignWith(s1, s2, s3, customizer); } { - let result: _.LoDashExplicitObjectWrapper<{a: number, b: number, c: number, d: number}>; - result = _(obj).chain().assignWith(s1, s2, s3, s4, customizer); + let result: _.LoDashExplicitObjectWrapper<{ a: number, b: number, c: number, d: number }>; + result = _(obj).chain().assignWith(s1, s2, s3, s4, customizer); } { - let result: _.LoDashExplicitObjectWrapper<{a: number, b: number, c: number, d: number, e: number}>; - result = _(obj).chain().assignWith<{a: number, b: number, c: number, d: number, e: number}>(s1, s2, s3, s4, s5, customizer); + let result: _.LoDashExplicitObjectWrapper<{ a: number, b: number, c: number, d: number, e: number }>; + result = _(obj).chain().assignWith<{ a: number, b: number, c: number, d: number, e: number }>(s1, s2, s3, s4, s5, customizer); } } // _.assignIn namespace TestAssignIn { - interface Obj {a: string}; - interface S1 {a: number}; - interface S2 {b: number}; - interface S3 {c: number}; - interface S4 {d: number}; - interface S5 {e: number}; + interface Obj { a: string }; + interface S1 { a: number }; + interface S2 { b: number }; + interface S3 { c: number }; + interface S4 { d: number }; + interface S5 { e: number }; let obj: Obj; let s1: S1; @@ -8556,37 +8272,37 @@ namespace TestAssignIn { { let result: Obj; - result = _.assignIn(obj); + result = _.assignIn(obj); } { - let result: {a: number}; + let result: { a: number }; - result = _.assignIn(obj, s1); + result = _.assignIn(obj, s1); } { - let result: {a: number, b: number}; + let result: { a: number, b: number }; - result = _.assignIn(obj, s1, s2); + result = _.assignIn(obj, s1, s2); } { - let result: {a: number, b: number, c: number}; + let result: { a: number, b: number, c: number }; - result = _.assignIn(obj, s1, s2, s3); + result = _.assignIn(obj, s1, s2, s3); } { - let result: {a: number, b: number, c: number, d: number}; + let result: { a: number, b: number, c: number, d: number }; - result = _.assignIn(obj, s1, s2, s3, s4); + result = _.assignIn(obj, s1, s2, s3, s4); } { - let result: {a: number, b: number, c: number, d: number, e: number}; + let result: { a: number, b: number, c: number, d: number, e: number }; - result = _.assignIn(obj, s1, s2, s3, s4, s5); + result = _.assignIn<{ a: number, b: number, c: number, d: number, e: number }>(obj, s1, s2, s3, s4, s5); } { @@ -8596,33 +8312,33 @@ namespace TestAssignIn { } { - let result: _.LoDashImplicitObjectWrapper<{a: number}>; + let result: _.LoDashImplicitObjectWrapper<{ a: number }>; - result = _(obj).assignIn(s1); + result = _(obj).assignIn(s1); } { - let result: _.LoDashImplicitObjectWrapper<{a: number, b: number}>; + let result: _.LoDashImplicitObjectWrapper<{ a: number, b: number }>; - result = _(obj).assignIn(s1, s2); + result = _(obj).assignIn(s1, s2); } { - let result: _.LoDashImplicitObjectWrapper<{a: number, b: number, c: number}>; + let result: _.LoDashImplicitObjectWrapper<{ a: number, b: number, c: number }>; - result = _(obj).assignIn(s1, s2, s3); + result = _(obj).assignIn(s1, s2, s3); } { - let result: _.LoDashImplicitObjectWrapper<{a: number, b: number, c: number, d: number}>; + let result: _.LoDashImplicitObjectWrapper<{ a: number, b: number, c: number, d: number }>; - result = _(obj).assignIn(s1, s2, s3, s4); + result = _(obj).assignIn(s1, s2, s3, s4); } { - let result: _.LoDashImplicitObjectWrapper<{a: number, b: number, c: number, d: number, e: number}>; + let result: _.LoDashImplicitObjectWrapper<{ a: number, b: number, c: number, d: number, e: number }>; - result = _(obj).assignIn<{a: number, b: number, c: number, d: number, e: number}>(s1, s2, s3, s4, s5); + result = _(obj).assignIn<{ a: number, b: number, c: number, d: number, e: number }>(s1, s2, s3, s4, s5); } { @@ -8632,44 +8348,44 @@ namespace TestAssignIn { } { - let result: _.LoDashExplicitObjectWrapper<{a: number}>; + let result: _.LoDashExplicitObjectWrapper<{ a: number }>; - result = _(obj).chain().assignIn(s1); + result = _(obj).chain().assignIn(s1); } { - let result: _.LoDashExplicitObjectWrapper<{a: number, b: number}>; + let result: _.LoDashExplicitObjectWrapper<{ a: number, b: number }>; - result = _(obj).chain().assignIn(s1, s2); + result = _(obj).chain().assignIn(s1, s2); } { - let result: _.LoDashExplicitObjectWrapper<{a: number, b: number, c: number}>; + let result: _.LoDashExplicitObjectWrapper<{ a: number, b: number, c: number }>; - result = _(obj).chain().assignIn(s1, s2, s3); + result = _(obj).chain().assignIn(s1, s2, s3); } { - let result: _.LoDashExplicitObjectWrapper<{a: number, b: number, c: number, d: number}>; + let result: _.LoDashExplicitObjectWrapper<{ a: number, b: number, c: number, d: number }>; - result = _(obj).chain().assignIn(s1, s2, s3, s4); + result = _(obj).chain().assignIn(s1, s2, s3, s4); } { - let result: _.LoDashExplicitObjectWrapper<{a: number, b: number, c: number, d: number, e: number}>; + let result: _.LoDashExplicitObjectWrapper<{ a: number, b: number, c: number, d: number, e: number }>; - result = _(obj).chain().assignIn<{a: number, b: number, c: number, d: number, e: number}>(s1, s2, s3, s4, s5); + result = _(obj).chain().assignIn<{ a: number, b: number, c: number, d: number, e: number }>(s1, s2, s3, s4, s5); } } // _.assignInWith namespace TestAssignInWith { - interface Obj {a: string}; - interface S1 {a: number}; - interface S2 {b: number}; - interface S3 {c: number}; - interface S4 {d: number}; - interface S5 {e: number}; + interface Obj { a: string }; + interface S1 { a: number }; + interface S2 { b: number }; + interface S3 { c: number }; + interface S4 { d: number }; + interface S5 { e: number }; let obj: Obj; let s1: S1; @@ -8683,32 +8399,32 @@ namespace TestAssignInWith { { let result: Obj; - result = _.assignInWith(obj); + result = _.assignInWith(obj); } { - let result: {a: number}; - result = _.assignInWith(obj, s1, customizer); + let result: { a: number }; + result = _.assignInWith(obj, s1, customizer); } { - let result: {a: number, b: number}; - result = _.assignInWith(obj, s1, s2, customizer); + let result: { a: number, b: number }; + result = _.assignInWith(obj, s1, s2, customizer); } { - let result: {a: number, b: number, c: number}; - result = _.assignInWith(obj, s1, s2, s3, customizer); + let result: { a: number, b: number, c: number }; + result = _.assignInWith(obj, s1, s2, s3, customizer); } { - let result: {a: number, b: number, c: number, d: number}; - result = _.assignInWith(obj, s1, s2, s3, s4, customizer); + let result: { a: number, b: number, c: number, d: number }; + result = _.assignInWith(obj, s1, s2, s3, s4, customizer); } { - let result: {a: number, b: number, c: number, d: number, e: number}; - result = _.assignInWith(obj, s1, s2, s3, s4, s5, customizer); + let result: { a: number, b: number, c: number, d: number, e: number }; + result = _.assignInWith<{ a: number, b: number, c: number, d: number, e: number }>(obj, s1, s2, s3, s4, s5, customizer); } { @@ -8718,28 +8434,28 @@ namespace TestAssignInWith { } { - let result: _.LoDashImplicitObjectWrapper<{a: number}>; - result = _(obj).assignInWith(s1, customizer); + let result: _.LoDashImplicitObjectWrapper<{ a: number }>; + result = _(obj).assignInWith(s1, customizer); } { - let result: _.LoDashImplicitObjectWrapper<{a: number, b: number}>; - result = _(obj).assignInWith(s1, s2, customizer); + let result: _.LoDashImplicitObjectWrapper<{ a: number, b: number }>; + result = _(obj).assignInWith(s1, s2, customizer); } { - let result: _.LoDashImplicitObjectWrapper<{a: number, b: number, c: number}>; - result = _(obj).assignInWith(s1, s2, s3, customizer); + let result: _.LoDashImplicitObjectWrapper<{ a: number, b: number, c: number }>; + result = _(obj).assignInWith(s1, s2, s3, customizer); } { - let result: _.LoDashImplicitObjectWrapper<{a: number, b: number, c: number, d: number}>; - result = _(obj).assignInWith(s1, s2, s3, s4, customizer); + let result: _.LoDashImplicitObjectWrapper<{ a: number, b: number, c: number, d: number }>; + result = _(obj).assignInWith(s1, s2, s3, s4, customizer); } { - let result: _.LoDashImplicitObjectWrapper<{a: number, b: number, c: number, d: number, e: number}>; - result = _(obj).assignInWith<{a: number, b: number, c: number, d: number, e: number}>(s1, s2, s3, s4, s5, customizer); + let result: _.LoDashImplicitObjectWrapper<{ a: number, b: number, c: number, d: number, e: number }>; + result = _(obj).assignInWith<{ a: number, b: number, c: number, d: number, e: number }>(s1, s2, s3, s4, s5, customizer); } { @@ -8749,28 +8465,28 @@ namespace TestAssignInWith { } { - let result: _.LoDashExplicitObjectWrapper<{a: number}>; - result = _(obj).chain().assignInWith(s1, customizer); + let result: _.LoDashExplicitObjectWrapper<{ a: number }>; + result = _(obj).chain().assignInWith(s1, customizer); } { - let result: _.LoDashExplicitObjectWrapper<{a: number, b: number}>; - result = _(obj).chain().assignInWith(s1, s2, customizer); + let result: _.LoDashExplicitObjectWrapper<{ a: number, b: number }>; + result = _(obj).chain().assignInWith(s1, s2, customizer); } { - let result: _.LoDashExplicitObjectWrapper<{a: number, b: number, c: number}>; - result = _(obj).chain().assignInWith(s1, s2, s3, customizer); + let result: _.LoDashExplicitObjectWrapper<{ a: number, b: number, c: number }>; + result = _(obj).chain().assignInWith(s1, s2, s3, customizer); } { - let result: _.LoDashExplicitObjectWrapper<{a: number, b: number, c: number, d: number}>; - result = _(obj).chain().assignInWith(s1, s2, s3, s4, customizer); + let result: _.LoDashExplicitObjectWrapper<{ a: number, b: number, c: number, d: number }>; + result = _(obj).chain().assignInWith(s1, s2, s3, s4, customizer); } { - let result: _.LoDashExplicitObjectWrapper<{a: number, b: number, c: number, d: number, e: number}>; - result = _(obj).chain().assignInWith<{a: number, b: number, c: number, d: number, e: number}>(s1, s2, s3, s4, s5, customizer); + let result: _.LoDashExplicitObjectWrapper<{ a: number, b: number, c: number, d: number, e: number }>; + result = _(obj).chain().assignInWith<{ a: number, b: number, c: number, d: number, e: number }>(s1, s2, s3, s4, s5, customizer); } } @@ -8804,151 +8520,153 @@ namespace TestCreate { } } + // _.defaults namespace TestDefaults { - interface Obj {a: string}; - interface S1 {a: number}; - interface S2 {b: number}; - interface S3 {c: number}; - interface S4 {d: number}; - interface S5 {e: number}; + interface Obj { a: string }; + interface S1 { a: number }; + interface S2 { b: number }; + interface S3 { c: number }; + interface S4 { d: number }; + interface S5 { e: number }; - let obj: Obj; - let s1: S1; - let s2: S2; - let s3: S3; - let s4: S4; - let s5: S5; + let obj: Obj; + let s1: S1; + let s2: S2; + let s3: S3; + let s4: S4; + let s5: S5; - { - let result: Obj; + { + let result: Obj; - result = _.defaults(obj); - } + result = _.defaults(obj); + } - { - let result: {a: string}; + { + let result: { a: string }; - result = _.defaults(obj, s1); - } + result = _.defaults(obj, s1); + } - { - let result: {a: string, b: number}; + { + let result: { a: string, b: number }; - result = _.defaults(obj, s1, s2); - } + result = _.defaults(obj, s1, s2); + } - { - let result: {a: string, b: number, c: number}; + { + let result: { a: string, b: number, c: number }; - result = _.defaults(obj, s1, s2, s3); - } + result = _.defaults(obj, s1, s2, s3); + } - { - let result: {a: string, b: number, c: number, d: number}; + { + let result: { a: string, b: number, c: number, d: number }; - result = _.defaults(obj, s1, s2, s3, s4); - } + result = _.defaults(obj, s1, s2, s3, s4); + } - { - let result: {a: string, b: number, c: number, d: number, e: number}; + { + let result: { a: string, b: number, c: number, d: number, e: number }; - result = _.defaults(obj, s1, s2, s3, s4, s5); - } + result = _.defaults<{ a: string, b: number, c: number, d: number, e: number }>(obj, s1, s2, s3, s4, s5); + } - { - let result: _.LoDashImplicitObjectWrapper; + { + let result: _.LoDashImplicitObjectWrapper; - result = _(obj).defaults(); - } + result = _(obj).defaults(); + } - { - let result: _.LoDashImplicitObjectWrapper<{a: string}>; + { + let result: _.LoDashImplicitObjectWrapper<{ a: string }>; - result = _(obj).defaults(s1); - } + result = _(obj).defaults(s1); + } - { - let result: _.LoDashImplicitObjectWrapper<{a: string, b: number}>; + { + let result: _.LoDashImplicitObjectWrapper<{ a: string, b: number }>; - result = _(obj).defaults(s1, s2); - } + result = _(obj).defaults(s1, s2); + } - { - let result: _.LoDashImplicitObjectWrapper<{a: string, b: number, c: number}>; + { + let result: _.LoDashImplicitObjectWrapper<{ a: string, b: number, c: number }>; - result = _(obj).defaults(s1, s2, s3); - } + result = _(obj).defaults(s1, s2, s3); + } - { - let result: _.LoDashImplicitObjectWrapper<{a: string, b: number, c: number, d: number}>; + { + let result: _.LoDashImplicitObjectWrapper<{ a: string, b: number, c: number, d: number }>; - result = _(obj).defaults(s1, s2, s3, s4); - } + result = _(obj).defaults(s1, s2, s3, s4); + } - { - let result: _.LoDashImplicitObjectWrapper<{a: string, b: number, c: number, d: number, e: number}>; + { + let result: _.LoDashImplicitObjectWrapper<{ a: string, b: number, c: number, d: number, e: number }>; - result = _(obj).defaults<{a: string, b: number, c: number, d: number, e: number}>(s1, s2, s3, s4, s5); - } + result = _(obj).defaults<{ a: string, b: number, c: number, d: number, e: number }>(s1, s2, s3, s4, s5); + } - { - let result: _.LoDashExplicitObjectWrapper; + { + let result: _.LoDashExplicitObjectWrapper; - result = _(obj).chain().defaults(); - } + result = _(obj).chain().defaults(); + } - { - let result: _.LoDashExplicitObjectWrapper<{a: string}>; + { + let result: _.LoDashExplicitObjectWrapper<{ a: string }>; - result = _(obj).chain().defaults(s1); - } + result = _(obj).chain().defaults(s1); + } - { - let result: _.LoDashExplicitObjectWrapper<{a: string, b: number}>; + { + let result: _.LoDashExplicitObjectWrapper<{ a: string, b: number }>; - result = _(obj).chain().defaults(s1, s2); - } + result = _(obj).chain().defaults(s1, s2); + } - { - let result: _.LoDashExplicitObjectWrapper<{a: string, b: number, c: number}>; + { + let result: _.LoDashExplicitObjectWrapper<{ a: string, b: number, c: number }>; - result = _(obj).chain().defaults(s1, s2, s3); - } + result = _(obj).chain().defaults(s1, s2, s3); + } - { - let result: _.LoDashExplicitObjectWrapper<{a: string, b: number, c: number, d: number}>; + { + let result: _.LoDashExplicitObjectWrapper<{ a: string, b: number, c: number, d: number }>; - result = _(obj).chain().defaults(s1, s2, s3, s4); - } + result = _(obj).chain().defaults(s1, s2, s3, s4); + } - { - let result: _.LoDashExplicitObjectWrapper<{a: string, b: number, c: number, d: number, e: number}>; + { + let result: _.LoDashExplicitObjectWrapper<{ a: string, b: number, c: number, d: number, e: number }>; - result = _(obj).chain().defaults<{a: string, b: number, c: number, d: number, e: number}>(s1, s2, s3, s4, s5); - } + result = _(obj).chain().defaults<{ a: string, b: number, c: number, d: number, e: number }>(s1, s2, s3, s4, s5); + } } //_.defaultsDeep interface DefaultsDeepResult { - user: { - name: string; - age: number; - } + user: { + name: string; + age: number; + } } -var TestDefaultsDeepObject = {'user': {'name': 'barney'}}; -var TestDefaultsDeepSource = {'user': {'name': 'fred', 'age': 36}}; +var TestDefaultsDeepObject = { 'user': { 'name': 'barney' } }; +var TestDefaultsDeepSource = { 'user': { 'name': 'fred', 'age': 36 } }; result = _.defaultsDeep(TestDefaultsDeepObject, TestDefaultsDeepSource); result = _(TestDefaultsDeepObject).defaultsDeep(TestDefaultsDeepSource).value(); + // _.extend namespace TestExtend { - type Obj = {a: string}; - type S1 = {a: number}; - type S2 = {b: number}; - type S3 = {c: number}; - type S4 = {d: number}; - type S5 = {e: number}; + type Obj = { a: string }; + type S1 = { a: number }; + type S2 = { b: number }; + type S3 = { c: number }; + type S4 = { d: number }; + type S5 = { e: number }; let obj: Obj; let s1: S1; @@ -8962,47 +8680,37 @@ namespace TestExtend { { let result: Obj; - result = _.extend(obj); + result = _.extend(obj); } { - let result: {a: number}; + let result: { a: number }; - result = _.extend(obj, s1); - result = _.extend(obj, s1, customizer); - result = _.extend(obj, s1, customizer, any); + result = _.extend(obj, s1); } { - let result: {a: number, b: number}; + let result: { a: number, b: number }; - result = _.extend(obj, s1, s2); - result = _.extend(obj, s1, s2, customizer); - result = _.extend(obj, s1, s2, customizer, any); + result = _.extend(obj, s1, s2); } { - let result: {a: number, b: number, c: number}; + let result: { a: number, b: number, c: number }; - result = _.extend(obj, s1, s2, s3); - result = _.extend(obj, s1, s2, s3, customizer); - result = _.extend(obj, s1, s2, s3, customizer, any); + result = _.extend(obj, s1, s2, s3); } { - let result: {a: number, b: number, c: number, d: number}; + let result: { a: number, b: number, c: number, d: number }; - result = _.extend(obj, s1, s2, s3, s4); - result = _.extend(obj, s1, s2, s3, s4, customizer); - result = _.extend(obj, s1, s2, s3, s4, customizer, any); + result = _.extend(obj, s1, s2, s3, s4); } { - let result: {a: number, b: number, c: number, d: number, e: number}; + let result: { a: number, b: number, c: number, d: number, e: number }; - result = _.extend(obj, s1, s2, s3, s4, s5); - result = _.extend(obj, s1, s2, s3, s4, s5, customizer); - result = _.extend(obj, s1, s2, s3, s4, s5, customizer, any); + result = _.extend<{ a: number, b: number, c: number, d: number, e: number }>(obj, s1, s2, s3, s4, s5); } { @@ -9012,43 +8720,33 @@ namespace TestExtend { } { - let result: _.LoDashImplicitObjectWrapper<{a: number}>; + let result: _.LoDashImplicitObjectWrapper<{ a: number }>; - result = _(obj).extend(s1); - result = _(obj).extend(s1, customizer); - result = _(obj).extend(s1, customizer, any); + result = _(obj).extend(s1); } { - let result: _.LoDashImplicitObjectWrapper<{a: number, b: number}>; + let result: _.LoDashImplicitObjectWrapper<{ a: number, b: number }>; - result = _(obj).extend(s1, s2); - result = _(obj).extend(s1, s2, customizer); - result = _(obj).extend(s1, s2, customizer, any); + result = _(obj).extend(s1, s2); } { - let result: _.LoDashImplicitObjectWrapper<{a: number, b: number, c: number}>; + let result: _.LoDashImplicitObjectWrapper<{ a: number, b: number, c: number }>; - result = _(obj).extend(s1, s2, s3); - result = _(obj).extend(s1, s2, s3, customizer); - result = _(obj).extend(s1, s2, s3, customizer, any); + result = _(obj).extend(s1, s2, s3); } { - let result: _.LoDashImplicitObjectWrapper<{a: number, b: number, c: number, d: number}>; + let result: _.LoDashImplicitObjectWrapper<{ a: number, b: number, c: number, d: number }>; - result = _(obj).extend(s1, s2, s3, s4); - result = _(obj).extend(s1, s2, s3, s4, customizer); - result = _(obj).extend(s1, s2, s3, s4, customizer, any); + result = _(obj).extend(s1, s2, s3, s4); } { - let result: _.LoDashImplicitObjectWrapper<{a: number, b: number, c: number, d: number, e: number}>; + let result: _.LoDashImplicitObjectWrapper<{ a: number, b: number, c: number, d: number, e: number }>; - result = _(obj).extend(s1, s2, s3, s4, s5); - result = _(obj).extend(s1, s2, s3, s4, s5, customizer); - result = _(obj).extend(s1, s2, s3, s4, s5, customizer, any); + result = _(obj).extend<{ a: number, b: number, c: number, d: number, e: number }>(s1, s2, s3, s4, s5); } { @@ -9058,43 +8756,161 @@ namespace TestExtend { } { - let result: _.LoDashExplicitObjectWrapper<{a: number}>; + let result: _.LoDashExplicitObjectWrapper<{ a: number }>; - result = _(obj).chain().extend(s1); - result = _(obj).chain().extend(s1, customizer); - result = _(obj).chain().extend(s1, customizer, any); + result = _(obj).chain().extend(s1); } { - let result: _.LoDashExplicitObjectWrapper<{a: number, b: number}>; + let result: _.LoDashExplicitObjectWrapper<{ a: number, b: number }>; - result = _(obj).chain().extend(s1, s2); - result = _(obj).chain().extend(s1, s2, customizer); - result = _(obj).chain().extend(s1, s2, customizer, any); + result = _(obj).chain().extend(s1, s2); } { - let result: _.LoDashExplicitObjectWrapper<{a: number, b: number, c: number}>; + let result: _.LoDashExplicitObjectWrapper<{ a: number, b: number, c: number }>; - result = _(obj).chain().extend(s1, s2, s3); - result = _(obj).chain().extend(s1, s2, s3, customizer); - result = _(obj).chain().extend(s1, s2, s3, customizer, any); + result = _(obj).chain().extend(s1, s2, s3); } { - let result: _.LoDashExplicitObjectWrapper<{a: number, b: number, c: number, d: number}>; + let result: _.LoDashExplicitObjectWrapper<{ a: number, b: number, c: number, d: number }>; - result = _(obj).chain().extend(s1, s2, s3, s4); - result = _(obj).chain().extend(s1, s2, s3, s4, customizer); - result = _(obj).chain().extend(s1, s2, s3, s4, customizer, any); + result = _(obj).chain().extend(s1, s2, s3, s4); } { - let result: _.LoDashExplicitObjectWrapper<{a: number, b: number, c: number, d: number, e: number}>; + let result: _.LoDashExplicitObjectWrapper<{ a: number, b: number, c: number, d: number, e: number }>; - result = _(obj).chain().extend(s1, s2, s3, s4, s5); - result = _(obj).chain().extend(s1, s2, s3, s4, s5, customizer); - result = _(obj).chain().extend(s1, s2, s3, s4, s5, customizer, any); + result = _(obj).chain().extend<{ a: number, b: number, c: number, d: number, e: number }>(s1, s2, s3, s4, s5); + } +} + + +// _.extendWith +namespace TestExtendWith { + type Obj = { a: string }; + type S1 = { a: number }; + type S2 = { b: number }; + type S3 = { c: number }; + type S4 = { d: number }; + type S5 = { e: number }; + + let obj: Obj; + let s1: S1; + let s2: S2; + let s3: S3; + let s4: S4; + let s5: S5; + + let customizer: (objectValue: any, sourceValue: any, key?: string, object?: {}, source?: {}) => any; + + { + let result: Obj; + + result = _.extendWith(obj); + } + + { + let result: { a: number }; + + result = _.extendWith(obj, s1, customizer); + } + + { + let result: { a: number, b: number }; + + result = _.extendWith(obj, s1, s2, customizer); + } + + { + let result: { a: number, b: number, c: number }; + + result = _.extendWith(obj, s1, s2, s3, customizer); + } + + { + let result: { a: number, b: number, c: number, d: number }; + + result = _.extendWith(obj, s1, s2, s3, s4, customizer); + } + + { + let result: { a: number, b: number, c: number, d: number, e: number }; + + result = _.extendWith<{ a: number, b: number, c: number, d: number, e: number }>(obj, s1, s2, s3, s4, s5, customizer); + } + + { + let result: _.LoDashImplicitObjectWrapper; + + result = _(obj).extendWith(); + } + + { + let result: _.LoDashImplicitObjectWrapper<{ a: number }>; + + result = _(obj).extendWith(s1, customizer); + } + + { + let result: _.LoDashImplicitObjectWrapper<{ a: number, b: number }>; + + result = _(obj).extendWith(s1, s2, customizer); + } + + { + let result: _.LoDashImplicitObjectWrapper<{ a: number, b: number, c: number }>; + + result = _(obj).extendWith(s1, s2, s3, customizer); + } + + { + let result: _.LoDashImplicitObjectWrapper<{ a: number, b: number, c: number, d: number }>; + + result = _(obj).extendWith(s1, s2, s3, s4, customizer); + } + + { + let result: _.LoDashImplicitObjectWrapper<{ a: number, b: number, c: number, d: number, e: number }>; + + result = _(obj).extendWith<{ a: number, b: number, c: number, d: number, e: number }>(s1, s2, s3, s4, s5, customizer); + } + + { + let result: _.LoDashExplicitObjectWrapper; + + result = _(obj).chain().extendWith(); + } + + { + let result: _.LoDashExplicitObjectWrapper<{ a: number }>; + + result = _(obj).chain().extendWith(s1, customizer); + } + + { + let result: _.LoDashExplicitObjectWrapper<{ a: number, b: number }>; + + result = _(obj).chain().extendWith(s1, s2, customizer); + } + + { + let result: _.LoDashExplicitObjectWrapper<{ a: number, b: number, c: number }>; + + result = _(obj).chain().extendWith(s1, s2, s3, customizer); + } + + { + let result: _.LoDashExplicitObjectWrapper<{ a: number, b: number, c: number, d: number }>; + + result = _(obj).chain().extendWith(s1, s2, s3, s4, customizer); + } + + { + let result: _.LoDashExplicitObjectWrapper<{ a: number, b: number, c: number, d: number, e: number }>; + + result = _(obj).chain().extendWith<{ a: number, b: number, c: number, d: number, e: number }>(s1, s2, s3, s4, s5, customizer); } } @@ -9107,22 +8923,18 @@ namespace TestFindKey { result = _.findKey<{a: string;}>({a: ''}); result = _.findKey<{a: string;}>({a: ''}, predicateFn); - result = _.findKey<{a: string;}>({a: ''}, predicateFn, any); result = _.findKey<{a: string;}>({a: ''}, ''); - result = _.findKey<{a: string;}>({a: ''}, '', any); result = _.findKey<{a: number;}, {a: string;}>({a: ''}, {a: 42}); result = _<{a: string;}>({a: ''}).findKey(); result = _<{a: string;}>({a: ''}).findKey(predicateFn); - result = _<{a: string;}>({a: ''}).findKey(predicateFn, any); result = _<{a: string;}>({a: ''}).findKey(''); - result = _<{a: string;}>({a: ''}).findKey('', any); result = _<{a: string;}>({a: ''}).findKey<{a: number;}>({a: 42}); } @@ -9132,10 +8944,8 @@ namespace TestFindKey { let result: string; result = _.findKey({a: ''}, predicateFn); - result = _.findKey({a: ''}, predicateFn, any); result = _<{a: string;}>({a: ''}).findKey(predicateFn); - result = _<{a: string;}>({a: ''}).findKey(predicateFn, any); } { @@ -9145,11 +8955,9 @@ namespace TestFindKey { result = _<{a: string;}>({a: ''}).chain().findKey(); result = _<{a: string;}>({a: ''}).chain().findKey(predicateFn); - result = _<{a: string;}>({a: ''}).chain().findKey(predicateFn, any); result = _<{a: string;}>({a: ''}).chain().findKey(''); - result = _<{a: string;}>({a: ''}).chain().findKey('', any); result = _<{a: string;}>({a: ''}).chain().findKey<{a: number;}>({a: 42}); } @@ -9159,7 +8967,6 @@ namespace TestFindKey { let result: _.LoDashExplicitWrapper; result = _<{a: string;}>({a: ''}).chain().findKey(predicateFn); - result = _<{a: string;}>({a: ''}).chain().findKey(predicateFn, any); } } @@ -9172,22 +8979,18 @@ namespace TestFindLastKey { result = _.findLastKey<{a: string;}>({a: ''}); result = _.findLastKey<{a: string;}>({a: ''}, predicateFn); - result = _.findLastKey<{a: string;}>({a: ''}, predicateFn, any); result = _.findLastKey<{a: string;}>({a: ''}, ''); - result = _.findLastKey<{a: string;}>({a: ''}, '', any); result = _.findLastKey<{a: number;}, {a: string;}>({a: ''}, {a: 42}); result = _<{a: string;}>({a: ''}).findLastKey(); result = _<{a: string;}>({a: ''}).findLastKey(predicateFn); - result = _<{a: string;}>({a: ''}).findLastKey(predicateFn, any); result = _<{a: string;}>({a: ''}).findLastKey(''); - result = _<{a: string;}>({a: ''}).findLastKey('', any); result = _<{a: string;}>({a: ''}).findLastKey<{a: number;}>({a: 42}); } @@ -9197,10 +9000,8 @@ namespace TestFindLastKey { let result: string; result = _.findLastKey({a: ''}, predicateFn); - result = _.findLastKey({a: ''}, predicateFn, any); result = _<{a: string;}>({a: ''}).findLastKey(predicateFn); - result = _<{a: string;}>({a: ''}).findLastKey(predicateFn, any); } { @@ -9210,11 +9011,9 @@ namespace TestFindLastKey { result = _<{a: string;}>({a: ''}).chain().findLastKey(); result = _<{a: string;}>({a: ''}).chain().findLastKey(predicateFn); - result = _<{a: string;}>({a: ''}).chain().findLastKey(predicateFn, any); result = _<{a: string;}>({a: ''}).chain().findLastKey(''); - result = _<{a: string;}>({a: ''}).chain().findLastKey('', any); result = _<{a: string;}>({a: ''}).chain().findLastKey<{a: number;}>({a: 42}); } @@ -9224,7 +9023,6 @@ namespace TestFindLastKey { let result: _.LoDashExplicitWrapper; result = _<{a: string;}>({a: ''}).chain().findLastKey(predicateFn); - result = _<{a: string;}>({a: ''}).chain().findLastKey(predicateFn, any); } } @@ -9243,7 +9041,6 @@ namespace TestForIn { result = _.forIn(dictionary); result = _.forIn(dictionary, dictionaryIterator); - result = _.forIn(dictionary, dictionaryIterator, any); } { @@ -9251,7 +9048,6 @@ namespace TestForIn { result = _.forIn(object); result = _.forIn(object, objectIterator); - result = _.forIn(object, objectIterator, any); } { @@ -9259,7 +9055,6 @@ namespace TestForIn { result = _(dictionary).forIn(); result = _(dictionary).forIn(dictionaryIterator); - result = _(dictionary).forIn(dictionaryIterator, any); } { @@ -9267,7 +9062,6 @@ namespace TestForIn { result = _(dictionary).chain().forIn(); result = _(dictionary).chain().forIn(dictionaryIterator); - result = _(dictionary).chain().forIn(dictionaryIterator, any); } } @@ -9286,7 +9080,6 @@ namespace TestForInRight { result = _.forInRight(dictionary); result = _.forInRight(dictionary, dictionaryIterator); - result = _.forInRight(dictionary, dictionaryIterator, any); } { @@ -9294,7 +9087,6 @@ namespace TestForInRight { result = _.forInRight(object); result = _.forInRight(object, objectIterator); - result = _.forInRight(object, objectIterator, any); } { @@ -9302,7 +9094,6 @@ namespace TestForInRight { result = _(dictionary).forInRight(); result = _(dictionary).forInRight(dictionaryIterator); - result = _(dictionary).forInRight(dictionaryIterator, any); } { @@ -9310,7 +9101,6 @@ namespace TestForInRight { result = _(dictionary).chain().forInRight(); result = _(dictionary).chain().forInRight(dictionaryIterator); - result = _(dictionary).chain().forInRight(dictionaryIterator, any); } } @@ -9329,7 +9119,6 @@ namespace TestForOwn { result = _.forOwn(dictionary); result = _.forOwn(dictionary, dictionaryIterator); - result = _.forOwn(dictionary, dictionaryIterator, any); } { @@ -9337,7 +9126,6 @@ namespace TestForOwn { result = _.forOwn(object); result = _.forOwn(object, objectIterator); - result = _.forOwn(object, objectIterator, any); } { @@ -9345,7 +9133,6 @@ namespace TestForOwn { result = _(dictionary).forOwn(); result = _(dictionary).forOwn(dictionaryIterator); - result = _(dictionary).forOwn(dictionaryIterator, any); } { @@ -9353,7 +9140,6 @@ namespace TestForOwn { result = _(dictionary).chain().forOwn(); result = _(dictionary).chain().forOwn(dictionaryIterator); - result = _(dictionary).chain().forOwn(dictionaryIterator, any); } } @@ -9372,7 +9158,6 @@ namespace TestForOwnRight { result = _.forOwnRight(dictionary); result = _.forOwnRight(dictionary, dictionaryIterator); - result = _.forOwnRight(dictionary, dictionaryIterator, any); } { @@ -9380,7 +9165,6 @@ namespace TestForOwnRight { result = _.forOwnRight(object); result = _.forOwnRight(object, objectIterator); - result = _.forOwnRight(object, objectIterator, any); } { @@ -9388,7 +9172,6 @@ namespace TestForOwnRight { result = _(dictionary).forOwnRight(); result = _(dictionary).forOwnRight(dictionaryIterator); - result = _(dictionary).forOwnRight(dictionaryIterator, any); } { @@ -9396,7 +9179,6 @@ namespace TestForOwnRight { result = _(dictionary).chain().forOwnRight(); result = _(dictionary).chain().forOwnRight(dictionaryIterator); - result = _(dictionary).chain().forOwnRight(dictionaryIterator, any); } } @@ -9779,23 +9561,17 @@ namespace TestMapKeys { result = _.mapKeys(array); result = _.mapKeys(array, listIterator); - result = _.mapKeys(array, listIterator, any); result = _.mapKeys(array, ''); - result = _.mapKeys(array, '', any); result = _.mapKeys(array, {}); result = _.mapKeys(list); result = _.mapKeys(list, listIterator); - result = _.mapKeys(list, listIterator, any); result = _.mapKeys(list, ''); - result = _.mapKeys(list, '', any); result = _.mapKeys(list, {}); result = _.mapKeys(dictionary); result = _.mapKeys(dictionary, dictionaryIterator); - result = _.mapKeys(dictionary, dictionaryIterator, any); result = _.mapKeys(dictionary, ''); - result = _.mapKeys(dictionary, '', any); result = _.mapKeys(dictionary, {}); } @@ -9804,23 +9580,17 @@ namespace TestMapKeys { result = _(array).mapKeys(); result = _(array).mapKeys(listIterator); - result = _(array).mapKeys(listIterator, any); result = _(array).mapKeys(''); - result = _(array).mapKeys('', any); result = _(array).mapKeys<{}>({}); result = _(list).mapKeys(); result = _(list).mapKeys(listIterator); - result = _(list).mapKeys(listIterator, any); result = _(list).mapKeys(''); - result = _(list).mapKeys('', any); result = _(list).mapKeys({}); result = _(dictionary).mapKeys(); result = _(dictionary).mapKeys(dictionaryIterator); - result = _(dictionary).mapKeys(dictionaryIterator, any); result = _(dictionary).mapKeys(''); - result = _(dictionary).mapKeys('', any); result = _(dictionary).mapKeys({}); } @@ -9829,23 +9599,17 @@ namespace TestMapKeys { result = _(array).chain().mapKeys(); result = _(array).chain().mapKeys(listIterator); - result = _(array).chain().mapKeys(listIterator, any); result = _(array).chain().mapKeys(''); - result = _(array).chain().mapKeys('', any); result = _(array).chain().mapKeys<{}>({}); result = _(list).chain().mapKeys(); result = _(list).chain().mapKeys(listIterator); - result = _(list).chain().mapKeys(listIterator, any); result = _(list).chain().mapKeys(''); - result = _(list).chain().mapKeys('', any); result = _(list).chain().mapKeys({}); result = _(dictionary).chain().mapKeys(); result = _(dictionary).chain().mapKeys(dictionaryIterator); - result = _(dictionary).chain().mapKeys(dictionaryIterator, any); result = _(dictionary).chain().mapKeys(''); - result = _(dictionary).chain().mapKeys('', any); result = _(dictionary).chain().mapKeys({}); } } @@ -10388,12 +10152,10 @@ namespace TestTransform { result = _.transform(array); result = _.transform(array, iterator); result = _.transform(array, iterator, accumulator); - result = _.transform(array, iterator, accumulator, any); result = _(array).transform().value(); result = _(array).transform(iterator).value(); result = _(array).transform(iterator, accumulator).value(); - result = _(array).transform(iterator, accumulator, any).value(); } { @@ -10403,11 +10165,9 @@ namespace TestTransform { result = _.transform(array, iterator); result = _.transform(array, iterator, accumulator); - result = _.transform(array, iterator, accumulator, any); result = _(array).transform(iterator).value(); result = _(array).transform(iterator, accumulator).value(); - result = _(array).transform(iterator, accumulator, any).value(); } { @@ -10418,12 +10178,10 @@ namespace TestTransform { result = _.transform(dictionary); result = _.transform(dictionary, iterator); result = _.transform(dictionary, iterator, accumulator); - result = _.transform(dictionary, iterator, accumulator, any); result = _(dictionary).transform().value(); result = _(dictionary).transform(iterator).value(); result = _(dictionary).transform(iterator, accumulator).value(); - result = _(dictionary).transform(iterator, accumulator, any).value(); } { @@ -10433,11 +10191,9 @@ namespace TestTransform { result = _.transform(dictionary, iterator); result = _.transform(dictionary, iterator, accumulator); - result = _.transform(dictionary, iterator, accumulator, any); result = _(dictionary).transform(iterator).value(); result = _(dictionary).transform(iterator, accumulator).value(); - result = _(dictionary).transform(iterator, accumulator, any).value(); } } @@ -11207,77 +10963,77 @@ namespace TestAttempt { namespace TestConstant { { let result: () => number; - result: _.constant(42); + result = _.constant(42); } { let result: () => string; - result: _.constant('a'); + result = _.constant('a'); } { let result: () => boolean; - result: _.constant(true); + result = _.constant(true); } { let result: () => string[]; - result: _.constant(['a']); + result = _.constant(['a']); } { let result: () => {a: string}; - result: _.constant<{a: string}>({a: 'a'}); + result = _.constant<{a: string}>({a: 'a'}); } { let result: _.LoDashImplicitObjectWrapper<() => number>; - result: _(42).constant(); + result = _(42).constant(); } { let result: _.LoDashImplicitObjectWrapper<() => string>; - result: _('a').constant(); + result = _('a').constant(); } { let result: _.LoDashImplicitObjectWrapper<() => boolean>; - result: _(true).constant(); + result = _(true).constant(); } { let result: _.LoDashImplicitObjectWrapper<() => string[]>; - result: _(['a']).constant(); + result = _(['a']).constant(); } { let result: _.LoDashImplicitObjectWrapper<() => {a: string}>; - result: _({a: 'a'}).constant<{a: string}>(); + result = _({a: 'a'}).constant<{a: string}>(); } { let result: _.LoDashExplicitObjectWrapper<() => number>; - result: _(42).chain().constant(); + result = _(42).chain().constant(); } { let result: _.LoDashExplicitObjectWrapper<() => string>; - result: _('a').chain().constant(); + result = _('a').chain().constant(); } { let result: _.LoDashExplicitObjectWrapper<() => boolean>; - result: _(true).chain().constant(); + result = _(true).chain().constant(); } { let result: _.LoDashExplicitObjectWrapper<() => string[]>; - result: _(['a']).chain().constant(); + result = _(['a']).chain().constant(); } { let result: _.LoDashExplicitObjectWrapper<() => {a: string}>; - result: _({a: 'a'}).chain().constant<{a: string}>(); + result = _({a: 'a'}).chain().constant<{a: string}>(); } } @@ -11329,63 +11085,54 @@ namespace TestIteratee { let result: (...args: any[]) => TResult; result = _.iteratee(Function); - result = _.iteratee(Function, any); } { let result: (object: any) => TResult; result = _.iteratee(''); - result = _.iteratee('', any); } { let result: (object: any) => boolean; result = _.iteratee({}); - result = _.iteratee({}, any); } { let result: _.LoDashImplicitObjectWrapper<(...args: any[]) => TResult>; result = _(Function).iteratee(); - result = _(Function).iteratee(any); } { let result: _.LoDashImplicitObjectWrapper<(object: any) => TResult>; result = _('').iteratee(); - result = _('').iteratee(any); } { let result: _.LoDashImplicitObjectWrapper<(object: any) => boolean>; result = _({}).iteratee(); - result = _({}).iteratee(any); } { let result: _.LoDashExplicitObjectWrapper<(...args: any[]) => TResult>; result = _(Function).chain().iteratee(); - result = _(Function).chain().iteratee(any); } { let result: _.LoDashExplicitObjectWrapper<(object: any) => TResult>; result = _('').chain().iteratee(); - result = _('').chain().iteratee(any); } { let result: _.LoDashExplicitObjectWrapper<(object: any) => boolean>; result = _({}).chain().iteratee(); - result = _({}).chain().iteratee(any); } } @@ -11462,7 +11209,6 @@ namespace TestMethod { let result: (object: any) => {a: string}; result = _.method<{a: string}>('a.0'); - result = _.method<{a: string}>('a.0', any); result = _.method<{a: string}>('a.0', any, any); result = _.method<{a: string}>('a.0', any, any, any); @@ -11476,7 +11222,6 @@ namespace TestMethod { let result: (object: {a: string}) => {b: string}; result = _.method<{a: string}, {b: string}>('a.0'); - result = _.method<{a: string}, {b: string}>('a.0', any); result = _.method<{a: string}, {b: string}>('a.0', any, any); result = _.method<{a: string}, {b: string}>('a.0', any, any, any); diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index bd996b9638..8407681ab2 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -1,6 +1,6 @@ // Type definitions for Lo-Dash // Project: http://lodash.com/ -// Definitions by: Brian Zengel , Ilya Mochalov +// Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -1241,8 +1241,7 @@ declare module _ { */ dropRightWhile( array: List, - predicate?: ListIterator, - thisArg?: any + predicate?: ListIterator ): TValue[]; /** @@ -1250,8 +1249,7 @@ declare module _ { */ dropRightWhile( array: List, - predicate?: string, - thisArg?: any + predicate?: string ): TValue[]; /** @@ -1268,16 +1266,14 @@ declare module _ { * @see _.dropRightWhile */ dropRightWhile( - predicate?: ListIterator, - thisArg?: any + predicate?: ListIterator ): LoDashImplicitArrayWrapper; /** * @see _.dropRightWhile */ dropRightWhile( - predicate?: string, - thisArg?: any + predicate?: string ): LoDashImplicitArrayWrapper; /** @@ -1293,16 +1289,14 @@ declare module _ { * @see _.dropRightWhile */ dropRightWhile( - predicate?: ListIterator, - thisArg?: any + predicate?: ListIterator ): LoDashImplicitArrayWrapper; /** * @see _.dropRightWhile */ dropRightWhile( - predicate?: string, - thisArg?: any + predicate?: string ): LoDashImplicitArrayWrapper; /** @@ -1318,16 +1312,14 @@ declare module _ { * @see _.dropRightWhile */ dropRightWhile( - predicate?: ListIterator, - thisArg?: any + predicate?: ListIterator ): LoDashExplicitArrayWrapper; /** * @see _.dropRightWhile */ dropRightWhile( - predicate?: string, - thisArg?: any + predicate?: string ): LoDashExplicitArrayWrapper; /** @@ -1343,16 +1335,14 @@ declare module _ { * @see _.dropRightWhile */ dropRightWhile( - predicate?: ListIterator, - thisArg?: any + predicate?: ListIterator ): LoDashExplicitArrayWrapper; /** * @see _.dropRightWhile */ dropRightWhile( - predicate?: string, - thisArg?: any + predicate?: string ): LoDashExplicitArrayWrapper; /** @@ -1385,8 +1375,7 @@ declare module _ { */ dropWhile( array: List, - predicate?: ListIterator, - thisArg?: any + predicate?: ListIterator ): TValue[]; /** @@ -1394,8 +1383,7 @@ declare module _ { */ dropWhile( array: List, - predicate?: string, - thisArg?: any + predicate?: string ): TValue[]; /** @@ -1412,16 +1400,14 @@ declare module _ { * @see _.dropWhile */ dropWhile( - predicate?: ListIterator, - thisArg?: any + predicate?: ListIterator ): LoDashImplicitArrayWrapper; /** * @see _.dropWhile */ dropWhile( - predicate?: string, - thisArg?: any + predicate?: string ): LoDashImplicitArrayWrapper; /** @@ -1437,16 +1423,14 @@ declare module _ { * @see _.dropWhile */ dropWhile( - predicate?: ListIterator, - thisArg?: any + predicate?: ListIterator ): LoDashImplicitArrayWrapper; /** * @see _.dropWhile */ dropWhile( - predicate?: string, - thisArg?: any + predicate?: string ): LoDashImplicitArrayWrapper; /** @@ -1462,16 +1446,14 @@ declare module _ { * @see _.dropWhile */ dropWhile( - predicate?: ListIterator, - thisArg?: any + predicate?: ListIterator ): LoDashExplicitArrayWrapper; /** * @see _.dropWhile */ dropWhile( - predicate?: string, - thisArg?: any + predicate?: string ): LoDashExplicitArrayWrapper; /** @@ -1487,16 +1469,14 @@ declare module _ { * @see _.dropWhile */ dropWhile( - predicate?: ListIterator, - thisArg?: any + predicate?: ListIterator ): LoDashExplicitArrayWrapper; /** * @see _.dropWhile */ dropWhile( - predicate?: string, - thisArg?: any + predicate?: string ): LoDashExplicitArrayWrapper; /** @@ -1604,8 +1584,7 @@ declare module _ { */ findIndex( array: List, - predicate?: ListIterator, - thisArg?: any + predicate?: ListIterator ): number; /** @@ -1613,8 +1592,7 @@ declare module _ { */ findIndex( array: List, - predicate?: string, - thisArg?: any + predicate?: string ): number; /** @@ -1631,16 +1609,14 @@ declare module _ { * @see _.findIndex */ findIndex( - predicate?: ListIterator, - thisArg?: any + predicate?: ListIterator ): number; /** * @see _.findIndex */ findIndex( - predicate?: string, - thisArg?: any + predicate?: string ): number; /** @@ -1656,16 +1632,14 @@ declare module _ { * @see _.findIndex */ findIndex( - predicate?: ListIterator, - thisArg?: any + predicate?: ListIterator ): number; /** * @see _.findIndex */ findIndex( - predicate?: string, - thisArg?: any + predicate?: string ): number; /** @@ -1681,16 +1655,14 @@ declare module _ { * @see _.findIndex */ findIndex( - predicate?: ListIterator, - thisArg?: any + predicate?: ListIterator ): LoDashExplicitWrapper; /** * @see _.findIndex */ findIndex( - predicate?: string, - thisArg?: any + predicate?: string ): LoDashExplicitWrapper; /** @@ -1706,16 +1678,14 @@ declare module _ { * @see _.findIndex */ findIndex( - predicate?: ListIterator, - thisArg?: any + predicate?: ListIterator ): LoDashExplicitWrapper; /** * @see _.findIndex */ findIndex( - predicate?: string, - thisArg?: any + predicate?: string ): LoDashExplicitWrapper; /** @@ -1747,8 +1717,7 @@ declare module _ { */ findLastIndex( array: List, - predicate?: ListIterator, - thisArg?: any + predicate?: ListIterator ): number; /** @@ -1756,8 +1725,7 @@ declare module _ { */ findLastIndex( array: List, - predicate?: string, - thisArg?: any + predicate?: string ): number; /** @@ -1774,16 +1742,14 @@ declare module _ { * @see _.findLastIndex */ findLastIndex( - predicate?: ListIterator, - thisArg?: any + predicate?: ListIterator ): number; /** * @see _.findLastIndex */ findLastIndex( - predicate?: string, - thisArg?: any + predicate?: string ): number; /** @@ -1799,16 +1765,14 @@ declare module _ { * @see _.findLastIndex */ findLastIndex( - predicate?: ListIterator, - thisArg?: any + predicate?: ListIterator ): number; /** * @see _.findLastIndex */ findLastIndex( - predicate?: string, - thisArg?: any + predicate?: string ): number; /** @@ -1824,16 +1788,14 @@ declare module _ { * @see _.findLastIndex */ findLastIndex( - predicate?: ListIterator, - thisArg?: any + predicate?: ListIterator ): LoDashExplicitWrapper; /** * @see _.findLastIndex */ findLastIndex( - predicate?: string, - thisArg?: any + predicate?: string ): LoDashExplicitWrapper; /** @@ -1849,16 +1811,14 @@ declare module _ { * @see _.findLastIndex */ findLastIndex( - predicate?: ListIterator, - thisArg?: any + predicate?: ListIterator ): LoDashExplicitWrapper; /** * @see _.findLastIndex */ findLastIndex( - predicate?: string, - thisArg?: any + predicate?: string ): LoDashExplicitWrapper; /** @@ -2058,7 +2018,23 @@ declare module _ { */ fromPairs( array: any[]|List - ): any[]; + ): Dictionary; + } + + //_.fromPairs DUMMY + interface LoDashImplicitArrayWrapper { + /** + * @see _.fromPairs + */ + fromPairs(): LoDashImplicitObjectWrapper; + } + + //_.fromPairs DUMMY + interface LoDashExplicitArrayWrapper { + /** + * @see _.fromPairs + */ + fromPairs(): LoDashExplicitObjectWrapper; } //_.head @@ -2756,8 +2732,7 @@ declare module _ { */ remove( array: List, - predicate?: ListIterator, - thisArg?: any + predicate?: ListIterator ): T[]; /** @@ -2765,8 +2740,7 @@ declare module _ { */ remove( array: List, - predicate?: string, - thisArg?: any + predicate?: string ): T[]; /** @@ -2783,16 +2757,14 @@ declare module _ { * @see _.remove */ remove( - predicate?: ListIterator, - thisArg?: any + predicate?: ListIterator ): LoDashImplicitArrayWrapper; /** * @see _.remove */ remove( - predicate?: string, - thisArg?: any + predicate?: string ): LoDashImplicitArrayWrapper; /** @@ -2808,16 +2780,14 @@ declare module _ { * @see _.remove */ remove( - predicate?: ListIterator, - thisArg?: any + predicate?: ListIterator ): LoDashImplicitArrayWrapper; /** * @see _.remove */ remove( - predicate?: string, - thisArg?: any + predicate?: string ): LoDashImplicitArrayWrapper; /** @@ -2833,16 +2803,14 @@ declare module _ { * @see _.remove */ remove( - predicate?: ListIterator, - thisArg?: any + predicate?: ListIterator ): LoDashExplicitArrayWrapper; /** * @see _.remove */ remove( - predicate?: string, - thisArg?: any + predicate?: string ): LoDashExplicitArrayWrapper; /** @@ -2858,16 +2826,14 @@ declare module _ { * @see _.remove */ remove( - predicate?: ListIterator, - thisArg?: any + predicate?: ListIterator ): LoDashExplicitArrayWrapper; /** * @see _.remove */ remove( - predicate?: string, - thisArg?: any + predicate?: string ): LoDashExplicitArrayWrapper; /** @@ -3888,8 +3854,7 @@ declare module _ { */ takeRightWhile( array: List, - predicate?: ListIterator, - thisArg?: any + predicate?: ListIterator ): TValue[]; /** @@ -3897,8 +3862,7 @@ declare module _ { */ takeRightWhile( array: List, - predicate?: string, - thisArg?: any + predicate?: string ): TValue[]; /** @@ -3915,16 +3879,14 @@ declare module _ { * @see _.takeRightWhile */ takeRightWhile( - predicate?: ListIterator, - thisArg?: any + predicate?: ListIterator ): LoDashImplicitArrayWrapper; /** * @see _.takeRightWhile */ takeRightWhile( - predicate?: string, - thisArg?: any + predicate?: string ): LoDashImplicitArrayWrapper; /** @@ -3940,16 +3902,14 @@ declare module _ { * @see _.takeRightWhile */ takeRightWhile( - predicate?: ListIterator, - thisArg?: any + predicate?: ListIterator ): LoDashImplicitArrayWrapper; /** * @see _.takeRightWhile */ takeRightWhile( - predicate?: string, - thisArg?: any + predicate?: string ): LoDashImplicitArrayWrapper; /** @@ -3965,16 +3925,14 @@ declare module _ { * @see _.takeRightWhile */ takeRightWhile( - predicate?: ListIterator, - thisArg?: any + predicate?: ListIterator ): LoDashExplicitArrayWrapper; /** * @see _.takeRightWhile */ takeRightWhile( - predicate?: string, - thisArg?: any + predicate?: string ): LoDashExplicitArrayWrapper; /** @@ -3990,16 +3948,14 @@ declare module _ { * @see _.takeRightWhile */ takeRightWhile( - predicate?: ListIterator, - thisArg?: any + predicate?: ListIterator ): LoDashExplicitArrayWrapper; /** * @see _.takeRightWhile */ takeRightWhile( - predicate?: string, - thisArg?: any + predicate?: string ): LoDashExplicitArrayWrapper; /** @@ -4032,8 +3988,7 @@ declare module _ { */ takeWhile( array: List, - predicate?: ListIterator, - thisArg?: any + predicate?: ListIterator ): TValue[]; /** @@ -4041,8 +3996,7 @@ declare module _ { */ takeWhile( array: List, - predicate?: string, - thisArg?: any + predicate?: string ): TValue[]; /** @@ -4059,16 +4013,14 @@ declare module _ { * @see _.takeWhile */ takeWhile( - predicate?: ListIterator, - thisArg?: any + predicate?: ListIterator ): LoDashImplicitArrayWrapper; /** * @see _.takeWhile */ takeWhile( - predicate?: string, - thisArg?: any + predicate?: string ): LoDashImplicitArrayWrapper; /** @@ -4084,16 +4036,14 @@ declare module _ { * @see _.takeWhile */ takeWhile( - predicate?: ListIterator, - thisArg?: any + predicate?: ListIterator ): LoDashImplicitArrayWrapper; /** * @see _.takeWhile */ takeWhile( - predicate?: string, - thisArg?: any + predicate?: string ): LoDashImplicitArrayWrapper; /** @@ -4109,16 +4059,14 @@ declare module _ { * @see _.takeWhile */ takeWhile( - predicate?: ListIterator, - thisArg?: any + predicate?: ListIterator ): LoDashExplicitArrayWrapper; /** * @see _.takeWhile */ takeWhile( - predicate?: string, - thisArg?: any + predicate?: string ): LoDashExplicitArrayWrapper; /** @@ -4134,16 +4082,14 @@ declare module _ { * @see _.takeWhile */ takeWhile( - predicate?: ListIterator, - thisArg?: any + predicate?: ListIterator ): LoDashExplicitArrayWrapper; /** * @see _.takeWhile */ takeWhile( - predicate?: string, - thisArg?: any + predicate?: string ): LoDashExplicitArrayWrapper; /** @@ -5391,8 +5337,7 @@ declare module _ { */ unzipWith( array: List>, - iteratee?: MemoIterator, - thisArg?: any + iteratee?: MemoIterator ): TResult[]; } @@ -5401,8 +5346,7 @@ declare module _ { * @see _.unzipWith */ unzipWith( - iteratee?: MemoIterator, - thisArg?: any + iteratee?: MemoIterator ): LoDashImplicitArrayWrapper; } @@ -5411,8 +5355,7 @@ declare module _ { * @see _.unzipWith */ unzipWith( - iteratee?: MemoIterator, - thisArg?: any + iteratee?: MemoIterator ): LoDashImplicitArrayWrapper; } @@ -5801,8 +5744,7 @@ declare module _ { **/ tap( value: T, - interceptor: (value: T) => void, - thisArg?: any + interceptor: (value: T) => void ): T; } @@ -5811,8 +5753,7 @@ declare module _ { * @see _.tap */ tap( - interceptor: (value: T) => void, - thisArg?: any + interceptor: (value: T) => void ): TWrapper; } @@ -5821,8 +5762,7 @@ declare module _ { * @see _.tap */ tap( - interceptor: (value: T) => void, - thisArg?: any + interceptor: (value: T) => void ): TWrapper; } @@ -5838,8 +5778,7 @@ declare module _ { */ thru( value: T, - interceptor: (value: T) => TResult, - thisArg?: any + interceptor: (value: T) => TResult ): TResult; } @@ -5848,36 +5787,31 @@ declare module _ { * @see _.thru */ thru( - interceptor: (value: T) => TResult, - thisArg?: any): LoDashImplicitWrapper; + interceptor: (value: T) => TResult): LoDashImplicitWrapper; /** * @see _.thru */ thru( - interceptor: (value: T) => TResult, - thisArg?: any): LoDashImplicitWrapper; + interceptor: (value: T) => TResult): LoDashImplicitWrapper; /** * @see _.thru */ thru( - interceptor: (value: T) => TResult, - thisArg?: any): LoDashImplicitWrapper; + interceptor: (value: T) => TResult): LoDashImplicitWrapper; /** * @see _.thru */ thru( - interceptor: (value: T) => TResult, - thisArg?: any): LoDashImplicitObjectWrapper; + interceptor: (value: T) => TResult): LoDashImplicitObjectWrapper; /** * @see _.thru */ thru( - interceptor: (value: T) => TResult[], - thisArg?: any): LoDashImplicitArrayWrapper; + interceptor: (value: T) => TResult[]): LoDashImplicitArrayWrapper; } interface LoDashExplicitWrapperBase { @@ -5885,40 +5819,35 @@ declare module _ { * @see _.thru */ thru( - interceptor: (value: T) => TResult, - thisArg?: any + interceptor: (value: T) => TResult ): LoDashExplicitWrapper; /** * @see _.thru */ thru( - interceptor: (value: T) => TResult, - thisArg?: any + interceptor: (value: T) => TResult ): LoDashExplicitWrapper; /** * @see _.thru */ thru( - interceptor: (value: T) => TResult, - thisArg?: any + interceptor: (value: T) => TResult ): LoDashExplicitWrapper; /** * @see _.thru */ thru( - interceptor: (value: T) => TResult, - thisArg?: any + interceptor: (value: T) => TResult ): LoDashExplicitObjectWrapper; /** * @see _.thru */ thru( - interceptor: (value: T) => TResult[], - thisArg?: any + interceptor: (value: T) => TResult[] ): LoDashExplicitArrayWrapper; } @@ -6174,8 +6103,7 @@ declare module _ { */ countBy( collection: List, - iteratee?: ListIterator, - thisArg?: any + iteratee?: ListIterator ): Dictionary; /** @@ -6183,8 +6111,7 @@ declare module _ { */ countBy( collection: Dictionary, - iteratee?: DictionaryIterator, - thisArg?: any + iteratee?: DictionaryIterator ): Dictionary; /** @@ -6192,8 +6119,7 @@ declare module _ { */ countBy( collection: NumericDictionary, - iteratee?: NumericDictionaryIterator, - thisArg?: any + iteratee?: NumericDictionaryIterator ): Dictionary; /** @@ -6201,8 +6127,7 @@ declare module _ { */ countBy( collection: List|Dictionary|NumericDictionary, - iteratee?: string, - thisArg?: any + iteratee?: string ): Dictionary; /** @@ -6227,8 +6152,7 @@ declare module _ { * @see _.countBy */ countBy( - iteratee?: ListIterator, - thisArg?: any + iteratee?: ListIterator ): LoDashImplicitObjectWrapper>; } @@ -6237,16 +6161,14 @@ declare module _ { * @see _.countBy */ countBy( - iteratee?: ListIterator, - thisArg?: any + iteratee?: ListIterator ): LoDashImplicitObjectWrapper>; /** * @see _.countBy */ countBy( - iteratee?: string, - thisArg?: any + iteratee?: string ): LoDashImplicitObjectWrapper>; /** @@ -6262,16 +6184,14 @@ declare module _ { * @see _.countBy */ countBy( - iteratee?: ListIterator|DictionaryIterator|NumericDictionaryIterator, - thisArg?: any + iteratee?: ListIterator|DictionaryIterator|NumericDictionaryIterator ): LoDashImplicitObjectWrapper>; /** * @see _.countBy */ countBy( - iteratee?: string, - thisArg?: any + iteratee?: string ): LoDashImplicitObjectWrapper>; /** @@ -6287,8 +6207,7 @@ declare module _ { * @see _.countBy */ countBy( - iteratee?: ListIterator, - thisArg?: any + iteratee?: ListIterator ): LoDashExplicitObjectWrapper>; } @@ -6297,16 +6216,14 @@ declare module _ { * @see _.countBy */ countBy( - iteratee?: ListIterator, - thisArg?: any + iteratee?: ListIterator ): LoDashExplicitObjectWrapper>; /** * @see _.countBy */ countBy( - iteratee?: string, - thisArg?: any + iteratee?: string ): LoDashExplicitObjectWrapper>; /** @@ -6322,16 +6239,14 @@ declare module _ { * @see _.countBy */ countBy( - iteratee?: ListIterator|DictionaryIterator|NumericDictionaryIterator, - thisArg?: any + iteratee?: ListIterator|DictionaryIterator|NumericDictionaryIterator ): LoDashExplicitObjectWrapper>; /** * @see _.countBy */ countBy( - iteratee?: string, - thisArg?: any + iteratee?: string ): LoDashExplicitObjectWrapper>; /** @@ -6349,8 +6264,7 @@ declare module _ { */ each( collection: T[], - iteratee?: ListIterator, - thisArg?: any + iteratee?: ListIterator ): T[]; /** @@ -6358,8 +6272,7 @@ declare module _ { */ each( collection: List, - iteratee?: ListIterator, - thisArg?: any + iteratee?: ListIterator ): List; /** @@ -6367,8 +6280,7 @@ declare module _ { */ each( collection: Dictionary, - iteratee?: DictionaryIterator, - thisArg?: any + iteratee?: DictionaryIterator ): Dictionary; /** @@ -6376,8 +6288,7 @@ declare module _ { */ each( collection: T, - iteratee?: ObjectIterator, - thisArgs?: any + iteratee?: ObjectIterator ): T; /** @@ -6385,8 +6296,7 @@ declare module _ { */ each( collection: T, - iteratee?: ObjectIterator, - thisArgs?: any + iteratee?: ObjectIterator ): T; } @@ -6395,8 +6305,7 @@ declare module _ { * @see _.forEach */ each( - iteratee: ListIterator, - thisArg?: any + iteratee: ListIterator ): LoDashImplicitWrapper; } @@ -6405,8 +6314,7 @@ declare module _ { * @see _.forEach */ each( - iteratee: ListIterator, - thisArg?: any + iteratee: ListIterator ): LoDashImplicitArrayWrapper; } @@ -6415,8 +6323,7 @@ declare module _ { * @see _.forEach */ each( - iteratee?: ListIterator|DictionaryIterator, - thisArg?: any + iteratee?: ListIterator|DictionaryIterator ): LoDashImplicitObjectWrapper; } @@ -6425,8 +6332,7 @@ declare module _ { * @see _.forEach */ each( - iteratee: ListIterator, - thisArg?: any + iteratee: ListIterator ): LoDashExplicitWrapper; } @@ -6435,8 +6341,7 @@ declare module _ { * @see _.forEach */ each( - iteratee: ListIterator, - thisArg?: any + iteratee: ListIterator ): LoDashExplicitArrayWrapper; } @@ -6445,8 +6350,7 @@ declare module _ { * @see _.forEach */ each( - iteratee?: ListIterator|DictionaryIterator, - thisArg?: any + iteratee?: ListIterator|DictionaryIterator ): LoDashExplicitObjectWrapper; } @@ -6457,8 +6361,7 @@ declare module _ { */ eachRight( collection: T[], - iteratee?: ListIterator, - thisArg?: any + iteratee?: ListIterator ): T[]; /** @@ -6466,8 +6369,7 @@ declare module _ { */ eachRight( collection: List, - iteratee?: ListIterator, - thisArg?: any + iteratee?: ListIterator ): List; /** @@ -6475,8 +6377,7 @@ declare module _ { */ eachRight( collection: Dictionary, - iteratee?: DictionaryIterator, - thisArg?: any + iteratee?: DictionaryIterator ): Dictionary; /** @@ -6484,8 +6385,7 @@ declare module _ { */ eachRight( collection: T, - iteratee?: ObjectIterator, - thisArgs?: any + iteratee?: ObjectIterator ): T; /** @@ -6493,8 +6393,7 @@ declare module _ { */ eachRight( collection: T, - iteratee?: ObjectIterator, - thisArgs?: any + iteratee?: ObjectIterator ): T; } @@ -6503,8 +6402,7 @@ declare module _ { * @see _.forEachRight */ eachRight( - iteratee: ListIterator, - thisArg?: any + iteratee: ListIterator ): LoDashImplicitWrapper; } @@ -6513,8 +6411,7 @@ declare module _ { * @see _.forEachRight */ eachRight( - iteratee: ListIterator, - thisArg?: any + iteratee: ListIterator ): LoDashImplicitArrayWrapper; } @@ -6523,8 +6420,7 @@ declare module _ { * @see _.forEachRight */ eachRight( - iteratee?: ListIterator|DictionaryIterator, - thisArg?: any + iteratee?: ListIterator|DictionaryIterator ): LoDashImplicitObjectWrapper; } @@ -6533,8 +6429,7 @@ declare module _ { * @see _.forEachRight */ eachRight( - iteratee: ListIterator, - thisArg?: any + iteratee: ListIterator ): LoDashExplicitWrapper; } @@ -6543,8 +6438,7 @@ declare module _ { * @see _.forEachRight */ eachRight( - iteratee: ListIterator, - thisArg?: any + iteratee: ListIterator ): LoDashExplicitArrayWrapper; } @@ -6553,8 +6447,7 @@ declare module _ { * @see _.forEachRight */ eachRight( - iteratee?: ListIterator|DictionaryIterator, - thisArg?: any + iteratee?: ListIterator|DictionaryIterator ): LoDashExplicitObjectWrapper; } @@ -6720,8 +6613,7 @@ declare module _ { */ filter( collection: List, - predicate?: ListIterator, - thisArg?: any + predicate?: ListIterator ): T[]; /** @@ -6729,8 +6621,7 @@ declare module _ { */ filter( collection: Dictionary, - predicate?: DictionaryIterator, - thisArg?: any + predicate?: DictionaryIterator ): T[]; /** @@ -6738,8 +6629,7 @@ declare module _ { */ filter( collection: string, - predicate?: StringIterator, - thisArg?: any + predicate?: StringIterator ): string[]; /** @@ -6747,8 +6637,7 @@ declare module _ { */ filter( collection: List|Dictionary, - predicate: string, - thisArg?: any + predicate: string ): T[]; /** @@ -6765,8 +6654,7 @@ declare module _ { * @see _.filter */ filter( - predicate?: StringIterator, - thisArg?: any + predicate?: StringIterator ): LoDashImplicitArrayWrapper; } @@ -6775,16 +6663,14 @@ declare module _ { * @see _.filter */ filter( - predicate: ListIterator, - thisArg?: any + predicate: ListIterator ): LoDashImplicitArrayWrapper; /** * @see _.filter */ filter( - predicate: string, - thisArg?: any + predicate: string ): LoDashImplicitArrayWrapper; /** @@ -6798,16 +6684,14 @@ declare module _ { * @see _.filter */ filter( - predicate: ListIterator|DictionaryIterator, - thisArg?: any + predicate: ListIterator|DictionaryIterator ): LoDashImplicitArrayWrapper; /** * @see _.filter */ filter( - predicate: string, - thisArg?: any + predicate: string ): LoDashImplicitArrayWrapper; /** @@ -6821,8 +6705,7 @@ declare module _ { * @see _.filter */ filter( - predicate?: StringIterator, - thisArg?: any + predicate?: StringIterator ): LoDashExplicitArrayWrapper; } @@ -6831,16 +6714,14 @@ declare module _ { * @see _.filter */ filter( - predicate: ListIterator, - thisArg?: any + predicate: ListIterator ): LoDashExplicitArrayWrapper; /** * @see _.filter */ filter( - predicate: string, - thisArg?: any + predicate: string ): LoDashExplicitArrayWrapper; /** @@ -6854,16 +6735,14 @@ declare module _ { * @see _.filter */ filter( - predicate: ListIterator|DictionaryIterator, - thisArg?: any + predicate: ListIterator|DictionaryIterator ): LoDashExplicitArrayWrapper; /** * @see _.filter */ filter( - predicate: string, - thisArg?: any + predicate: string ): LoDashExplicitArrayWrapper; /** @@ -6894,8 +6773,7 @@ declare module _ { */ find( collection: List, - predicate?: ListIterator, - thisArg?: any + predicate?: ListIterator ): T; /** @@ -6903,8 +6781,7 @@ declare module _ { */ find( collection: Dictionary, - predicate?: DictionaryIterator, - thisArg?: any + predicate?: DictionaryIterator ): T; /** @@ -6912,8 +6789,7 @@ declare module _ { */ find( collection: List|Dictionary, - predicate?: string, - thisArg?: any + predicate?: string ): T; /** @@ -6930,16 +6806,14 @@ declare module _ { * @see _.find */ find( - predicate?: ListIterator, - thisArg?: any + predicate?: ListIterator ): T; /** * @see _.find */ find( - predicate?: string, - thisArg?: any + predicate?: string ): T; /** @@ -6955,16 +6829,14 @@ declare module _ { * @see _.find */ find( - predicate?: ListIterator|DictionaryIterator, - thisArg?: any + predicate?: ListIterator|DictionaryIterator ): TResult; /** * @see _.find */ find( - predicate?: string, - thisArg?: any + predicate?: string ): TResult; /** @@ -6987,24 +6859,21 @@ declare module _ { **/ findLast( collection: Array, - callback: ListIterator, - thisArg?: any): T; + callback: ListIterator): T; /** * @see _.find **/ findLast( collection: List, - callback: ListIterator, - thisArg?: any): T; + callback: ListIterator): T; /** * @see _.find **/ findLast( collection: Dictionary, - callback: DictionaryIterator, - thisArg?: any): T; + callback: DictionaryIterator): T; /** * @see _.find @@ -7060,8 +6929,7 @@ declare module _ { * @see _.findLast */ findLast( - callback: ListIterator, - thisArg?: any): T; + callback: ListIterator): T; /** * @see _.findLast * @param _.where style callback @@ -7361,8 +7229,7 @@ declare module _ { */ forEach( collection: T[], - iteratee?: ListIterator, - thisArg?: any + iteratee?: ListIterator ): T[]; /** @@ -7370,8 +7237,7 @@ declare module _ { */ forEach( collection: List, - iteratee?: ListIterator, - thisArg?: any + iteratee?: ListIterator ): List; /** @@ -7379,8 +7245,7 @@ declare module _ { */ forEach( collection: Dictionary, - iteratee?: DictionaryIterator, - thisArg?: any + iteratee?: DictionaryIterator ): Dictionary; /** @@ -7388,8 +7253,7 @@ declare module _ { */ forEach( collection: T, - iteratee?: ObjectIterator, - thisArgs?: any + iteratee?: ObjectIterator ): T; /** @@ -7397,8 +7261,7 @@ declare module _ { */ forEach( collection: T, - iteratee?: ObjectIterator, - thisArgs?: any + iteratee?: ObjectIterator ): T; } @@ -7407,8 +7270,7 @@ declare module _ { * @see _.forEach */ forEach( - iteratee: ListIterator, - thisArg?: any + iteratee: ListIterator ): LoDashImplicitWrapper; } @@ -7417,8 +7279,7 @@ declare module _ { * @see _.forEach */ forEach( - iteratee: ListIterator, - thisArg?: any + iteratee: ListIterator ): LoDashImplicitArrayWrapper; } @@ -7427,8 +7288,7 @@ declare module _ { * @see _.forEach */ forEach( - iteratee?: ListIterator|DictionaryIterator, - thisArg?: any + iteratee?: ListIterator|DictionaryIterator ): LoDashImplicitObjectWrapper; } @@ -7437,8 +7297,7 @@ declare module _ { * @see _.forEach */ forEach( - iteratee: ListIterator, - thisArg?: any + iteratee: ListIterator ): LoDashExplicitWrapper; } @@ -7447,8 +7306,7 @@ declare module _ { * @see _.forEach */ forEach( - iteratee: ListIterator, - thisArg?: any + iteratee: ListIterator ): LoDashExplicitArrayWrapper; } @@ -7457,8 +7315,7 @@ declare module _ { * @see _.forEach */ forEach( - iteratee?: ListIterator|DictionaryIterator, - thisArg?: any + iteratee?: ListIterator|DictionaryIterator ): LoDashExplicitObjectWrapper; } @@ -7475,8 +7332,7 @@ declare module _ { */ forEachRight( collection: T[], - iteratee?: ListIterator, - thisArg?: any + iteratee?: ListIterator ): T[]; /** @@ -7484,8 +7340,7 @@ declare module _ { */ forEachRight( collection: List, - iteratee?: ListIterator, - thisArg?: any + iteratee?: ListIterator ): List; /** @@ -7493,8 +7348,7 @@ declare module _ { */ forEachRight( collection: Dictionary, - iteratee?: DictionaryIterator, - thisArg?: any + iteratee?: DictionaryIterator ): Dictionary; /** @@ -7502,8 +7356,7 @@ declare module _ { */ forEachRight( collection: T, - iteratee?: ObjectIterator, - thisArgs?: any + iteratee?: ObjectIterator ): T; /** @@ -7511,8 +7364,7 @@ declare module _ { */ forEachRight( collection: T, - iteratee?: ObjectIterator, - thisArgs?: any + iteratee?: ObjectIterator ): T; } @@ -7521,8 +7373,7 @@ declare module _ { * @see _.forEachRight */ forEachRight( - iteratee: ListIterator, - thisArg?: any + iteratee: ListIterator ): LoDashImplicitWrapper; } @@ -7531,8 +7382,7 @@ declare module _ { * @see _.forEachRight */ forEachRight( - iteratee: ListIterator, - thisArg?: any + iteratee: ListIterator ): LoDashImplicitArrayWrapper; } @@ -7541,8 +7391,7 @@ declare module _ { * @see _.forEachRight */ forEachRight( - iteratee?: ListIterator|DictionaryIterator, - thisArg?: any + iteratee?: ListIterator|DictionaryIterator ): LoDashImplicitObjectWrapper; } @@ -7551,8 +7400,7 @@ declare module _ { * @see _.forEachRight */ forEachRight( - iteratee: ListIterator, - thisArg?: any + iteratee: ListIterator ): LoDashExplicitWrapper; } @@ -7561,8 +7409,7 @@ declare module _ { * @see _.forEachRight */ forEachRight( - iteratee: ListIterator, - thisArg?: any + iteratee: ListIterator ): LoDashExplicitArrayWrapper; } @@ -7571,8 +7418,7 @@ declare module _ { * @see _.forEachRight */ forEachRight( - iteratee?: ListIterator|DictionaryIterator, - thisArg?: any + iteratee?: ListIterator|DictionaryIterator ): LoDashExplicitObjectWrapper; } @@ -7600,8 +7446,7 @@ declare module _ { */ groupBy( collection: List, - iteratee?: ListIterator, - thisArg?: any + iteratee?: ListIterator ): Dictionary; /** @@ -7609,8 +7454,7 @@ declare module _ { */ groupBy( collection: List, - iteratee?: ListIterator, - thisArg?: any + iteratee?: ListIterator ): Dictionary; /** @@ -7618,8 +7462,7 @@ declare module _ { */ groupBy( collection: Dictionary, - iteratee?: DictionaryIterator, - thisArg?: any + iteratee?: DictionaryIterator ): Dictionary; /** @@ -7627,8 +7470,7 @@ declare module _ { */ groupBy( collection: Dictionary, - iteratee?: DictionaryIterator, - thisArg?: any + iteratee?: DictionaryIterator ): Dictionary; /** @@ -7636,8 +7478,7 @@ declare module _ { */ groupBy( collection: List|Dictionary, - iteratee?: string, - thisArg?: TValue + iteratee?: string ): Dictionary; /** @@ -7645,8 +7486,7 @@ declare module _ { */ groupBy( collection: List|Dictionary, - iteratee?: string, - thisArg?: any + iteratee?: string ): Dictionary; /** @@ -7671,8 +7511,7 @@ declare module _ { * @see _.groupBy */ groupBy( - iteratee?: ListIterator, - thisArg?: any + iteratee?: ListIterator ): LoDashImplicitObjectWrapper>; } @@ -7681,16 +7520,14 @@ declare module _ { * @see _.groupBy */ groupBy( - iteratee?: ListIterator, - thisArg?: any + iteratee?: ListIterator ): LoDashImplicitObjectWrapper>; /** * @see _.groupBy */ groupBy( - iteratee?: string, - thisArg?: TValue + iteratee?: string ): LoDashImplicitObjectWrapper>; /** @@ -7706,32 +7543,28 @@ declare module _ { * @see _.groupBy */ groupBy( - iteratee?: ListIterator|DictionaryIterator, - thisArg?: any + iteratee?: ListIterator|DictionaryIterator ): LoDashImplicitObjectWrapper>; /** * @see _.groupBy */ groupBy( - iteratee?: ListIterator|DictionaryIterator, - thisArg?: any + iteratee?: ListIterator|DictionaryIterator ): LoDashImplicitObjectWrapper>; /** * @see _.groupBy */ groupBy( - iteratee?: string, - thisArg?: TValue + iteratee?: string ): LoDashImplicitObjectWrapper>; /** * @see _.groupBy */ groupBy( - iteratee?: string, - thisArg?: any + iteratee?: string ): LoDashImplicitObjectWrapper>; /** @@ -7754,8 +7587,7 @@ declare module _ { * @see _.groupBy */ groupBy( - iteratee?: ListIterator, - thisArg?: any + iteratee?: ListIterator ): LoDashExplicitObjectWrapper>; } @@ -7764,16 +7596,14 @@ declare module _ { * @see _.groupBy */ groupBy( - iteratee?: ListIterator, - thisArg?: any + iteratee?: ListIterator ): LoDashExplicitObjectWrapper>; /** * @see _.groupBy */ groupBy( - iteratee?: string, - thisArg?: TValue + iteratee?: string ): LoDashExplicitObjectWrapper>; /** @@ -7789,32 +7619,28 @@ declare module _ { * @see _.groupBy */ groupBy( - iteratee?: ListIterator|DictionaryIterator, - thisArg?: any + iteratee?: ListIterator|DictionaryIterator ): LoDashExplicitObjectWrapper>; /** * @see _.groupBy */ groupBy( - iteratee?: ListIterator|DictionaryIterator, - thisArg?: any + iteratee?: ListIterator|DictionaryIterator ): LoDashExplicitObjectWrapper>; /** * @see _.groupBy */ groupBy( - iteratee?: string, - thisArg?: TValue + iteratee?: string ): LoDashExplicitObjectWrapper>; /** * @see _.groupBy */ groupBy( - iteratee?: string, - thisArg?: any + iteratee?: string ): LoDashExplicitObjectWrapper>; /** @@ -7943,8 +7769,7 @@ declare module _ { */ keyBy( collection: List, - iteratee?: ListIterator, - thisArg?: any + iteratee?: ListIterator ): Dictionary; /** @@ -7952,8 +7777,7 @@ declare module _ { */ keyBy( collection: NumericDictionary, - iteratee?: NumericDictionaryIterator, - thisArg?: any + iteratee?: NumericDictionaryIterator ): Dictionary; /** @@ -7961,8 +7785,7 @@ declare module _ { */ keyBy( collection: Dictionary, - iteratee?: DictionaryIterator, - thisArg?: any + iteratee?: DictionaryIterator ): Dictionary; /** @@ -7970,8 +7793,7 @@ declare module _ { */ keyBy( collection: List|NumericDictionary|Dictionary, - iteratee?: string, - thisArg?: any + iteratee?: string ): Dictionary; /** @@ -7996,8 +7818,7 @@ declare module _ { * @see _.keyBy */ keyBy( - iteratee?: ListIterator, - thisArg?: any + iteratee?: ListIterator ): LoDashImplicitObjectWrapper>; } @@ -8006,16 +7827,14 @@ declare module _ { * @see _.keyBy */ keyBy( - iteratee?: ListIterator, - thisArg?: any + iteratee?: ListIterator ): LoDashImplicitObjectWrapper>; /** * @see _.keyBy */ keyBy( - iteratee?: string, - thisArg?: any + iteratee?: string ): LoDashImplicitObjectWrapper>; /** @@ -8031,16 +7850,14 @@ declare module _ { * @see _.keyBy */ keyBy( - iteratee?: ListIterator|NumericDictionaryIterator|DictionaryIterator, - thisArg?: any + iteratee?: ListIterator|NumericDictionaryIterator|DictionaryIterator ): LoDashImplicitObjectWrapper>; /** * @see _.keyBy */ keyBy( - iteratee?: string, - thisArg?: any + iteratee?: string ): LoDashImplicitObjectWrapper>; /** @@ -8063,8 +7880,7 @@ declare module _ { * @see _.keyBy */ keyBy( - iteratee?: ListIterator, - thisArg?: any + iteratee?: ListIterator ): LoDashExplicitObjectWrapper>; } @@ -8073,16 +7889,14 @@ declare module _ { * @see _.keyBy */ keyBy( - iteratee?: ListIterator, - thisArg?: any + iteratee?: ListIterator ): LoDashExplicitObjectWrapper>; /** * @see _.keyBy */ keyBy( - iteratee?: string, - thisArg?: any + iteratee?: string ): LoDashExplicitObjectWrapper>; /** @@ -8098,16 +7912,14 @@ declare module _ { * @see _.keyBy */ keyBy( - iteratee?: ListIterator|NumericDictionaryIterator|DictionaryIterator, - thisArg?: any + iteratee?: ListIterator|NumericDictionaryIterator|DictionaryIterator ): LoDashExplicitObjectWrapper>; /** * @see _.keyBy */ keyBy( - iteratee?: string, - thisArg?: any + iteratee?: string ): LoDashExplicitObjectWrapper>; /** @@ -8358,8 +8170,7 @@ declare module _ { */ map( collection: List, - iteratee?: ListIterator, - thisArg?: any + iteratee?: ListIterator ): TResult[]; /** @@ -8367,14 +8178,12 @@ declare module _ { */ map( collection: Dictionary, - iteratee?: DictionaryIterator, - thisArg?: any + iteratee?: DictionaryIterator ): TResult[]; map( collection: NumericDictionary, - iteratee?: NumericDictionaryIterator, - thisArg?: any + iteratee?: NumericDictionaryIterator ): TResult[]; /** @@ -8399,8 +8208,7 @@ declare module _ { * @see _.map */ map( - iteratee?: ListIterator, - thisArg?: any + iteratee?: ListIterator ): LoDashImplicitArrayWrapper; /** @@ -8423,8 +8231,7 @@ declare module _ { * @see _.map */ map( - iteratee?: ListIterator|DictionaryIterator, - thisArg?: any + iteratee?: ListIterator|DictionaryIterator ): LoDashImplicitArrayWrapper; /** @@ -8447,8 +8254,7 @@ declare module _ { * @see _.map */ map( - iteratee?: ListIterator, - thisArg?: any + iteratee?: ListIterator ): LoDashExplicitArrayWrapper; /** @@ -8471,8 +8277,7 @@ declare module _ { * @see _.map */ map( - iteratee?: ListIterator|DictionaryIterator, - thisArg?: any + iteratee?: ListIterator|DictionaryIterator ): LoDashExplicitArrayWrapper; /** @@ -8513,16 +8318,14 @@ declare module _ { **/ partition( collection: List, - callback: ListIterator, - thisArg?: any): T[][]; + callback: ListIterator): T[][]; /** * @see _.partition **/ partition( collection: Dictionary, - callback: DictionaryIterator, - thisArg?: any): T[][]; + callback: DictionaryIterator): T[][]; /** * @see _.partition @@ -8574,8 +8377,7 @@ declare module _ { * @see _.partition */ partition( - callback: ListIterator, - thisArg?: any): LoDashImplicitArrayWrapper; + callback: ListIterator): LoDashImplicitArrayWrapper; } interface LoDashImplicitArrayWrapper { @@ -8583,8 +8385,7 @@ declare module _ { * @see _.partition */ partition( - callback: ListIterator, - thisArg?: any): LoDashImplicitArrayWrapper; + callback: ListIterator): LoDashImplicitArrayWrapper; /** * @see _.partition */ @@ -8608,15 +8409,13 @@ declare module _ { * @see _.partition */ partition( - callback: ListIterator, - thisArg?: any): LoDashImplicitArrayWrapper; + callback: ListIterator): LoDashImplicitArrayWrapper; /** * @see _.partition */ partition( - callback: DictionaryIterator, - thisArg?: any): LoDashImplicitArrayWrapper; + callback: DictionaryIterator): LoDashImplicitArrayWrapper; /** * @see _.partition @@ -8655,8 +8454,7 @@ declare module _ { reduce( collection: Array, callback: MemoIterator, - accumulator: TResult, - thisArg?: any): TResult; + accumulator: TResult): TResult; /** * @see _.reduce @@ -8664,8 +8462,7 @@ declare module _ { reduce( collection: List, callback: MemoIterator, - accumulator: TResult, - thisArg?: any): TResult; + accumulator: TResult): TResult; /** * @see _.reduce @@ -8673,8 +8470,7 @@ declare module _ { reduce( collection: Dictionary, callback: MemoIterator, - accumulator: TResult, - thisArg?: any): TResult; + accumulator: TResult): TResult; /** * @see _.reduce @@ -8682,40 +8478,35 @@ declare module _ { reduce( collection: NumericDictionary, callback: MemoIterator, - accumulator: TResult, - thisArg?: any): TResult; + accumulator: TResult): TResult; /** * @see _.reduce **/ reduce( collection: Array, - callback: MemoIterator, - thisArg?: any): TResult; + callback: MemoIterator): TResult; /** * @see _.reduce **/ reduce( collection: List, - callback: MemoIterator, - thisArg?: any): TResult; + callback: MemoIterator): TResult; /** * @see _.reduce **/ reduce( collection: Dictionary, - callback: MemoIterator, - thisArg?: any): TResult; + callback: MemoIterator): TResult; /** * @see _.reduce **/ reduce( collection: NumericDictionary, - callback: MemoIterator, - thisArg?: any): TResult; + callback: MemoIterator): TResult; } @@ -8725,15 +8516,13 @@ declare module _ { **/ reduce( callback: MemoIterator, - accumulator: TResult, - thisArg?: any): TResult; + accumulator: TResult): TResult; /** * @see _.reduce **/ reduce( - callback: MemoIterator, - thisArg?: any): TResult; + callback: MemoIterator): TResult; } interface LoDashImplicitObjectWrapper { @@ -8742,15 +8531,13 @@ declare module _ { **/ reduce( callback: MemoIterator, - accumulator: TResult, - thisArg?: any): TResult; + accumulator: TResult): TResult; /** * @see _.reduce **/ reduce( - callback: MemoIterator, - thisArg?: any): TResult; + callback: MemoIterator): TResult; } //_.reduceRight @@ -8767,8 +8554,7 @@ declare module _ { reduceRight( collection: Array, callback: MemoIterator, - accumulator: TResult, - thisArg?: any): TResult; + accumulator: TResult): TResult; /** * @see _.reduceRight @@ -8776,8 +8562,7 @@ declare module _ { reduceRight( collection: List, callback: MemoIterator, - accumulator: TResult, - thisArg?: any): TResult; + accumulator: TResult): TResult; /** * @see _.reduceRight @@ -8785,32 +8570,28 @@ declare module _ { reduceRight( collection: Dictionary, callback: MemoIterator, - accumulator: TResult, - thisArg?: any): TResult; + accumulator: TResult): TResult; /** * @see _.reduceRight **/ reduceRight( collection: Array, - callback: MemoIterator, - thisArg?: any): TResult; + callback: MemoIterator): TResult; /** * @see _.reduceRight **/ reduceRight( collection: List, - callback: MemoIterator, - thisArg?: any): TResult; + callback: MemoIterator): TResult; /** * @see _.reduceRight **/ reduceRight( collection: Dictionary, - callback: MemoIterator, - thisArg?: any): TResult; + callback: MemoIterator): TResult; } //_.reject @@ -8826,8 +8607,7 @@ declare module _ { */ reject( collection: List, - predicate?: ListIterator, - thisArg?: any + predicate?: ListIterator ): T[]; /** @@ -8835,8 +8615,7 @@ declare module _ { */ reject( collection: Dictionary, - predicate?: DictionaryIterator, - thisArg?: any + predicate?: DictionaryIterator ): T[]; /** @@ -8844,8 +8623,7 @@ declare module _ { */ reject( collection: string, - predicate?: StringIterator, - thisArg?: any + predicate?: StringIterator ): string[]; /** @@ -8853,8 +8631,7 @@ declare module _ { */ reject( collection: List|Dictionary, - predicate: string, - thisArg?: any + predicate: string ): T[]; /** @@ -8871,8 +8648,7 @@ declare module _ { * @see _.reject */ reject( - predicate?: StringIterator, - thisArg?: any + predicate?: StringIterator ): LoDashImplicitArrayWrapper; } @@ -8881,16 +8657,14 @@ declare module _ { * @see _.reject */ reject( - predicate: ListIterator, - thisArg?: any + predicate: ListIterator ): LoDashImplicitArrayWrapper; /** * @see _.reject */ reject( - predicate: string, - thisArg?: any + predicate: string ): LoDashImplicitArrayWrapper; /** @@ -8904,16 +8678,14 @@ declare module _ { * @see _.reject */ reject( - predicate: ListIterator|DictionaryIterator, - thisArg?: any + predicate: ListIterator|DictionaryIterator ): LoDashImplicitArrayWrapper; /** * @see _.reject */ reject( - predicate: string, - thisArg?: any + predicate: string ): LoDashImplicitArrayWrapper; /** @@ -8927,8 +8699,7 @@ declare module _ { * @see _.reject */ reject( - predicate?: StringIterator, - thisArg?: any + predicate?: StringIterator ): LoDashExplicitArrayWrapper; } @@ -8937,16 +8708,14 @@ declare module _ { * @see _.reject */ reject( - predicate: ListIterator, - thisArg?: any + predicate: ListIterator ): LoDashExplicitArrayWrapper; /** * @see _.reject */ reject( - predicate: string, - thisArg?: any + predicate: string ): LoDashExplicitArrayWrapper; /** @@ -8960,16 +8729,14 @@ declare module _ { * @see _.reject */ reject( - predicate: ListIterator|DictionaryIterator, - thisArg?: any + predicate: ListIterator|DictionaryIterator ): LoDashExplicitArrayWrapper; /** * @see _.reject */ reject( - predicate: string, - thisArg?: any + predicate: string ): LoDashExplicitArrayWrapper; /** @@ -10120,7 +9887,6 @@ declare module _ { **/ createCallback( func: string, - thisArg?: any, argCount?: number): () => any; /** @@ -10128,7 +9894,6 @@ declare module _ { **/ createCallback( func: Dictionary, - thisArg?: any, argCount?: number): () => boolean; } @@ -10137,7 +9902,6 @@ declare module _ { * @see _.createCallback **/ createCallback( - thisArg?: any, argCount?: number): LoDashImplicitObjectWrapper<() => any>; } @@ -10146,7 +9910,6 @@ declare module _ { * @see _.createCallback **/ createCallback( - thisArg?: any, argCount?: number): LoDashImplicitObjectWrapper<() => any>; } @@ -13349,16 +13112,14 @@ declare module _ { * @see _.maxBy */ maxBy( - iteratee?: ListIterator|DictionaryIterator, - thisArg?: any + iteratee?: ListIterator|DictionaryIterator ): T; /** * @see _.maxBy */ maxBy( - iteratee?: string, - thisArg?: any + iteratee?: string ): T; /** @@ -13514,16 +13275,14 @@ declare module _ { * @see _.minBy */ minBy( - iteratee?: ListIterator|DictionaryIterator, - thisArg?: any + iteratee?: ListIterator|DictionaryIterator ): T; /** * @see _.minBy */ minBy( - iteratee?: string, - thisArg?: any + iteratee?: string ): T; /** @@ -14002,53 +13761,52 @@ declare module _ { * _.assign({ 'a': 1 }, new Foo, new Bar); * // => { 'a': 1, 'c': 3, 'e': 5 } */ - assign( + assign( object: TObject, source: TSource - ): TResult; + ): TObject & TSource; /** * @see assign */ - assign( + assign( object: TObject, source1: TSource1, source2: TSource2 - ): TResult; + ): TObject & TSource1 & TSource2; /** * @see assign */ - assign( + assign( object: TObject, source1: TSource1, source2: TSource2, source3: TSource3 - ): TResult; + ): TObject & TSource1 & TSource2 & TSource3; /** * @see assign */ - assign - ( + assign( object: TObject, source1: TSource1, source2: TSource2, source3: TSource3, source4: TSource4 - ): TResult; + ): TObject & TSource1 & TSource2 & TSource3 & TSource4; /** * @see _.assign */ - assign(object: TObject): TObject; + assign(object: TObject): TObject; /** * @see _.assign */ - assign( - object: TObject, ...otherArgs: any[] + assign( + object: any, + ...otherArgs: any[] ): TResult; } @@ -14056,36 +13814,36 @@ declare module _ { /** * @see _.assign */ - assign( + assign( source: TSource - ): LoDashImplicitObjectWrapper; + ): LoDashImplicitObjectWrapper; /** * @see assign */ - assign( + assign( source1: TSource1, source2: TSource2 - ): LoDashImplicitObjectWrapper; + ): LoDashImplicitObjectWrapper; /** * @see assign */ - assign( + assign( source1: TSource1, source2: TSource2, source3: TSource3 - ): LoDashImplicitObjectWrapper; + ): LoDashImplicitObjectWrapper; /** * @see assign */ - assign( + assign( source1: TSource1, source2: TSource2, source3: TSource3, source4: TSource4 - ): LoDashImplicitObjectWrapper; + ): LoDashImplicitObjectWrapper; /** * @see _.assign @@ -14095,43 +13853,43 @@ declare module _ { /** * @see _.assign */ - assign(...otherArgs: any[]): LoDashImplicitObjectWrapper; + assign(...otherArgs: any[]): LoDashImplicitObjectWrapper; } interface LoDashExplicitObjectWrapper { /** * @see _.assign */ - assign( + assign( source: TSource - ): LoDashExplicitObjectWrapper; + ): LoDashExplicitObjectWrapper; /** * @see assign */ - assign( + assign( source1: TSource1, source2: TSource2 - ): LoDashExplicitObjectWrapper; + ): LoDashExplicitObjectWrapper; /** * @see assign */ - assign( + assign( source1: TSource1, source2: TSource2, source3: TSource3 - ): LoDashExplicitObjectWrapper; + ): LoDashExplicitObjectWrapper; /** * @see assign */ - assign( + assign( source1: TSource1, source2: TSource2, source3: TSource3, source4: TSource4 - ): LoDashExplicitObjectWrapper; + ): LoDashExplicitObjectWrapper; /** * @see _.assign @@ -14141,7 +13899,7 @@ declare module _ { /** * @see _.assign */ - assign(...otherArgs: any[]): LoDashExplicitObjectWrapper; + assign(...otherArgs: any[]): LoDashExplicitObjectWrapper; } //_.assignWith @@ -14176,57 +13934,56 @@ declare module _ { * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); * // => { 'a': 1, 'b': 2 } */ - assignWith( + assignWith( object: TObject, source: TSource, customizer: AssignCustomizer - ): TResult; + ): TObject & TSource; /** * @see assignWith */ - assignWith( + assignWith( object: TObject, source1: TSource1, source2: TSource2, customizer: AssignCustomizer - ): TResult; + ): TObject & TSource1 & TSource2; /** * @see assignWith */ - assignWith( + assignWith( object: TObject, source1: TSource1, source2: TSource2, source3: TSource3, customizer: AssignCustomizer - ): TResult; + ): TObject & TSource1 & TSource2 & TSource3; /** * @see assignWith */ - assignWith - ( + assignWith( object: TObject, source1: TSource1, source2: TSource2, source3: TSource3, source4: TSource4, customizer: AssignCustomizer - ): TResult; + ): TObject & TSource1 & TSource2 & TSource3 & TSource4; /** * @see _.assignWith */ - assignWith(object: TObject): TObject; + assignWith(object: TObject): TObject; /** * @see _.assignWith */ - assignWith( - object: TObject, ...otherArgs: any[] + assignWith( + object: any, + ...otherArgs: any[] ): TResult; } @@ -14234,40 +13991,40 @@ declare module _ { /** * @see _.assignWith */ - assignWith( + assignWith( source: TSource, customizer: AssignCustomizer - ): LoDashImplicitObjectWrapper; + ): LoDashImplicitObjectWrapper; /** * @see assignWith */ - assignWith( + assignWith( source1: TSource1, source2: TSource2, customizer: AssignCustomizer - ): LoDashImplicitObjectWrapper; + ): LoDashImplicitObjectWrapper; /** * @see assignWith */ - assignWith( + assignWith( source1: TSource1, source2: TSource2, source3: TSource3, customizer: AssignCustomizer - ): LoDashImplicitObjectWrapper; + ): LoDashImplicitObjectWrapper; /** * @see assignWith */ - assignWith( + assignWith( source1: TSource1, source2: TSource2, source3: TSource3, source4: TSource4, customizer: AssignCustomizer - ): LoDashImplicitObjectWrapper; + ): LoDashImplicitObjectWrapper; /** * @see _.assignWith @@ -14277,47 +14034,47 @@ declare module _ { /** * @see _.assignWith */ - assignWith(...otherArgs: any[]): LoDashImplicitObjectWrapper; + assignWith(...otherArgs: any[]): LoDashImplicitObjectWrapper; } interface LoDashExplicitObjectWrapper { /** * @see _.assignWith */ - assignWith( + assignWith( source: TSource, customizer: AssignCustomizer - ): LoDashExplicitObjectWrapper; + ): LoDashExplicitObjectWrapper; /** * @see assignWith */ - assignWith( + assignWith( source1: TSource1, source2: TSource2, customizer: AssignCustomizer - ): LoDashExplicitObjectWrapper; + ): LoDashExplicitObjectWrapper; /** * @see assignWith */ - assignWith( + assignWith( source1: TSource1, source2: TSource2, source3: TSource3, customizer: AssignCustomizer - ): LoDashExplicitObjectWrapper; + ): LoDashExplicitObjectWrapper; /** * @see assignWith */ - assignWith( + assignWith( source1: TSource1, source2: TSource2, source3: TSource3, source4: TSource4, customizer: AssignCustomizer - ): LoDashExplicitObjectWrapper; + ): LoDashExplicitObjectWrapper; /** * @see _.assignWith @@ -14327,7 +14084,7 @@ declare module _ { /** * @see _.assignWith */ - assignWith(...otherArgs: any[]): LoDashExplicitObjectWrapper; + assignWith(...otherArgs: any[]): LoDashExplicitObjectWrapper; } //_.assignIn @@ -14361,53 +14118,52 @@ declare module _ { * _.assignIn({ 'a': 1 }, new Foo, new Bar); * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5 } */ - assignIn( + assignIn( object: TObject, source: TSource - ): TResult; + ): TObject & TSource; /** * @see assignIn */ - assignIn( + assignIn( object: TObject, source1: TSource1, source2: TSource2 - ): TResult; + ): TObject & TSource1 & TSource2; /** * @see assignIn */ - assignIn( + assignIn( object: TObject, source1: TSource1, source2: TSource2, source3: TSource3 - ): TResult; + ): TObject & TSource1 & TSource2 & TSource3; /** * @see assignIn */ - assignIn - ( + assignIn( object: TObject, source1: TSource1, source2: TSource2, source3: TSource3, source4: TSource4 - ): TResult; + ): TObject & TSource1 & TSource2 & TSource3 & TSource4; /** * @see _.assignIn */ - assignIn(object: TObject): TObject; + assignIn(object: TObject): TObject; /** * @see _.assignIn */ - assignIn( - object: TObject, ...otherArgs: any[] + assignIn( + object: any, + ...otherArgs: any[] ): TResult; } @@ -14415,36 +14171,36 @@ declare module _ { /** * @see _.assignIn */ - assignIn( + assignIn( source: TSource - ): LoDashImplicitObjectWrapper; + ): LoDashImplicitObjectWrapper; /** * @see assignIn */ - assignIn( + assignIn( source1: TSource1, source2: TSource2 - ): LoDashImplicitObjectWrapper; + ): LoDashImplicitObjectWrapper; /** * @see assignIn */ - assignIn( + assignIn( source1: TSource1, source2: TSource2, source3: TSource3 - ): LoDashImplicitObjectWrapper; + ): LoDashImplicitObjectWrapper; /** * @see assignIn */ - assignIn( + assignIn( source1: TSource1, source2: TSource2, source3: TSource3, source4: TSource4 - ): LoDashImplicitObjectWrapper; + ): LoDashImplicitObjectWrapper; /** * @see _.assignIn @@ -14454,43 +14210,43 @@ declare module _ { /** * @see _.assignIn */ - assignIn(...otherArgs: any[]): LoDashImplicitObjectWrapper; + assignIn(...otherArgs: any[]): LoDashImplicitObjectWrapper; } interface LoDashExplicitObjectWrapper { /** * @see _.assignIn */ - assignIn( + assignIn( source: TSource - ): LoDashExplicitObjectWrapper; + ): LoDashExplicitObjectWrapper; /** * @see assignIn */ - assignIn( + assignIn( source1: TSource1, source2: TSource2 - ): LoDashExplicitObjectWrapper; + ): LoDashExplicitObjectWrapper; /** * @see assignIn */ - assignIn( + assignIn( source1: TSource1, source2: TSource2, source3: TSource3 - ): LoDashExplicitObjectWrapper; + ): LoDashExplicitObjectWrapper; /** * @see assignIn */ - assignIn( + assignIn( source1: TSource1, source2: TSource2, source3: TSource3, source4: TSource4 - ): LoDashExplicitObjectWrapper; + ): LoDashExplicitObjectWrapper; /** * @see _.assignIn @@ -14500,7 +14256,7 @@ declare module _ { /** * @see _.assignIn */ - assignIn(...otherArgs: any[]): LoDashExplicitObjectWrapper; + assignIn(...otherArgs: any[]): LoDashExplicitObjectWrapper; } //_.assignInWith @@ -14536,57 +14292,56 @@ declare module _ { * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); * // => { 'a': 1, 'b': 2 } */ - assignInWith( + assignInWith( object: TObject, source: TSource, customizer: AssignCustomizer - ): TResult; + ): TObject & TSource; /** * @see assignInWith */ - assignInWith( + assignInWith( object: TObject, source1: TSource1, source2: TSource2, customizer: AssignCustomizer - ): TResult; + ): TObject & TSource1 & TSource2; /** * @see assignInWith */ - assignInWith( + assignInWith( object: TObject, source1: TSource1, source2: TSource2, source3: TSource3, customizer: AssignCustomizer - ): TResult; + ): TObject & TSource1 & TSource2 & TSource3; /** * @see assignInWith */ - assignInWith - ( + assignInWith( object: TObject, source1: TSource1, source2: TSource2, source3: TSource3, source4: TSource4, customizer: AssignCustomizer - ): TResult; + ): TObject & TSource1 & TSource2 & TSource3 & TSource4; /** * @see _.assignInWith */ - assignInWith(object: TObject): TObject; + assignInWith(object: TObject): TObject; /** * @see _.assignInWith */ - assignInWith( - object: TObject, ...otherArgs: any[] + assignInWith( + object: any, + ...otherArgs: any[] ): TResult; } @@ -14594,40 +14349,40 @@ declare module _ { /** * @see _.assignInWith */ - assignInWith( + assignInWith( source: TSource, customizer: AssignCustomizer - ): LoDashImplicitObjectWrapper; + ): LoDashImplicitObjectWrapper; /** * @see assignInWith */ - assignInWith( + assignInWith( source1: TSource1, source2: TSource2, customizer: AssignCustomizer - ): LoDashImplicitObjectWrapper; + ): LoDashImplicitObjectWrapper; /** * @see assignInWith */ - assignInWith( + assignInWith( source1: TSource1, source2: TSource2, source3: TSource3, customizer: AssignCustomizer - ): LoDashImplicitObjectWrapper; + ): LoDashImplicitObjectWrapper; /** * @see assignInWith */ - assignInWith( + assignInWith( source1: TSource1, source2: TSource2, source3: TSource3, source4: TSource4, customizer: AssignCustomizer - ): LoDashImplicitObjectWrapper; + ): LoDashImplicitObjectWrapper; /** * @see _.assignInWith @@ -14637,47 +14392,47 @@ declare module _ { /** * @see _.assignInWith */ - assignInWith(...otherArgs: any[]): LoDashImplicitObjectWrapper; + assignInWith(...otherArgs: any[]): LoDashImplicitObjectWrapper; } interface LoDashExplicitObjectWrapper { /** * @see _.assignInWith */ - assignInWith( + assignInWith( source: TSource, customizer: AssignCustomizer - ): LoDashExplicitObjectWrapper; + ): LoDashExplicitObjectWrapper; /** * @see assignInWith */ - assignInWith( + assignInWith( source1: TSource1, source2: TSource2, customizer: AssignCustomizer - ): LoDashExplicitObjectWrapper; + ): LoDashExplicitObjectWrapper; /** * @see assignInWith */ - assignInWith( + assignInWith( source1: TSource1, source2: TSource2, source3: TSource3, customizer: AssignCustomizer - ): LoDashExplicitObjectWrapper; + ): LoDashExplicitObjectWrapper; /** * @see assignInWith */ - assignInWith( + assignInWith( source1: TSource1, source2: TSource2, source3: TSource3, source4: TSource4, customizer: AssignCustomizer - ): LoDashExplicitObjectWrapper; + ): LoDashExplicitObjectWrapper; /** * @see _.assignInWith @@ -14687,7 +14442,7 @@ declare module _ { /** * @see _.assignInWith */ - assignInWith(...otherArgs: any[]): LoDashExplicitObjectWrapper; + assignInWith(...otherArgs: any[]): LoDashExplicitObjectWrapper; } //_.create @@ -14720,6 +14475,7 @@ declare module _ { create(properties?: U): LoDashExplicitObjectWrapper; } + //_.defaults interface LoDashStatic { /** @@ -14733,59 +14489,52 @@ declare module _ { * @param sources The source objects. * @return The destination object. */ - defaults( - object: Obj, - ...sources: {}[] - ): TResult; + defaults( + object: TObject, + source: TSource + ): TSource & TObject; /** * @see _.defaults */ - defaults( - object: Obj, - source1: S1, - ...sources: {}[] - ): TResult; + defaults( + object: TObject, + source1: TSource1, + source2: TSource2 + ): TSource2 & TSource1 & TObject; /** * @see _.defaults */ - defaults( - object: Obj, - source1: S1, - source2: S2, - ...sources: {}[] - ): TResult; + defaults( + object: TObject, + source1: TSource1, + source2: TSource2, + source3: TSource3 + ): TSource3 & TSource2 & TSource1 & TObject; /** * @see _.defaults */ - defaults( - object: Obj, - source1: S1, - source2: S2, - source3: S3, - ...sources: {}[] - ): TResult; + defaults( + object: TObject, + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4 + ): TSource4 & TSource3 & TSource2 & TSource1 & TObject; /** * @see _.defaults */ - defaults( - object: Obj, - source1: S1, - source2: S2, - source3: S3, - source4: S4, - ...sources: {}[] - ): TResult; + defaults(object: TObject): TObject; /** * @see _.defaults */ - defaults( - object: {}, - ...sources: {}[] + defaults( + object: any, + ...sources: any[] ): TResult; } @@ -14793,40 +14542,36 @@ declare module _ { /** * @see _.defaults */ - defaults( - source1: S1, - ...sources: {}[] - ): LoDashImplicitObjectWrapper; + defaults( + source: TSource + ): LoDashImplicitObjectWrapper; /** * @see _.defaults */ - defaults( - source1: S1, - source2: S2, - ...sources: {}[] - ): LoDashImplicitObjectWrapper; + defaults( + source1: TSource1, + source2: TSource2 + ): LoDashImplicitObjectWrapper; /** * @see _.defaults */ - defaults( - source1: S1, - source2: S2, - source3: S3, - ...sources: {}[] - ): LoDashImplicitObjectWrapper; + defaults( + source1: TSource1, + source2: TSource2, + source3: TSource3 + ): LoDashImplicitObjectWrapper; /** * @see _.defaults */ - defaults( - source1: S1, - source2: S2, - source3: S3, - source4: S4, - ...sources: {}[] - ): LoDashImplicitObjectWrapper; + defaults( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4 + ): LoDashImplicitObjectWrapper; /** * @see _.defaults @@ -14836,47 +14581,43 @@ declare module _ { /** * @see _.defaults */ - defaults(...sources: {}[]): LoDashImplicitObjectWrapper; + defaults(...sources: any[]): LoDashImplicitObjectWrapper; } interface LoDashExplicitObjectWrapper { /** * @see _.defaults */ - defaults( - source1: S1, - ...sources: {}[] - ): LoDashExplicitObjectWrapper; + defaults( + source: TSource + ): LoDashExplicitObjectWrapper; /** * @see _.defaults */ - defaults( - source1: S1, - source2: S2, - ...sources: {}[] - ): LoDashExplicitObjectWrapper; + defaults( + source1: TSource1, + source2: TSource2 + ): LoDashExplicitObjectWrapper; /** * @see _.defaults */ - defaults( - source1: S1, - source2: S2, - source3: S3, - ...sources: {}[] - ): LoDashExplicitObjectWrapper; + defaults( + source1: TSource1, + source2: TSource2, + source3: TSource3 + ): LoDashExplicitObjectWrapper; /** * @see _.defaults */ - defaults( - source1: S1, - source2: S2, - source3: S3, - source4: S4, - ...sources: {}[] - ): LoDashExplicitObjectWrapper; + defaults( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4 + ): LoDashExplicitObjectWrapper; /** * @see _.defaults @@ -14886,7 +14627,7 @@ declare module _ { /** * @see _.defaults */ - defaults(...sources: {}[]): LoDashExplicitObjectWrapper; + defaults(...sources: any[]): LoDashExplicitObjectWrapper; } //_.defaultsDeep @@ -14909,175 +14650,307 @@ declare module _ { defaultsDeep(...sources: any[]): LoDashImplicitObjectWrapper } - //_.extend + // _.extend interface LoDashStatic { /** - * @see assign + * @see _.assignIn */ - extend( + extend( object: TObject, - source: TSource, - customizer?: AssignCustomizer, - thisArg?: any - ): TResult; + source: TSource + ): TObject & TSource; /** - * @see assign + * @see _.assignIn */ - extend( + extend( + object: TObject, + source1: TSource1, + source2: TSource2 + ): TObject & TSource1 & TSource2; + + /** + * @see _.assignIn + */ + extend( object: TObject, source1: TSource1, source2: TSource2, - customizer?: AssignCustomizer, - thisArg?: any - ): TResult; + source3: TSource3 + ): TObject & TSource1 & TSource2 & TSource3; /** - * @see assign + * @see _.assignIn */ - extend( + extend( object: TObject, source1: TSource1, source2: TSource2, source3: TSource3, - customizer?: AssignCustomizer, - thisArg?: any - ): TResult; + source4: TSource4 + ): TObject & TSource1 & TSource2 & TSource3 & TSource4; /** - * @see assign + * @see _.assignIn */ - extend - ( - object: TObject, - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4, - customizer?: AssignCustomizer, - thisArg?: any - ): TResult; + extend(object: TObject): TObject; /** - * @see _.assign + * @see _.assignIn */ - extend(object: TObject): TObject; - - /** - * @see _.assign - */ - extend( - object: TObject, ...otherArgs: any[] + extend( + object: any, + ...otherArgs: any[] ): TResult; } interface LoDashImplicitObjectWrapper { /** - * @see _.assign + * @see _.assignIn */ - extend( - source: TSource, - customizer?: AssignCustomizer, - thisArg?: any - ): LoDashImplicitObjectWrapper; + extend( + source: TSource + ): LoDashImplicitObjectWrapper; /** - * @see assign + * @see _.assignIn */ - extend( + extend( + source1: TSource1, + source2: TSource2 + ): LoDashImplicitObjectWrapper; + + /** + * @see _.assignIn + */ + extend( source1: TSource1, source2: TSource2, - customizer?: AssignCustomizer, - thisArg?: any - ): LoDashImplicitObjectWrapper; + source3: TSource3 + ): LoDashImplicitObjectWrapper; /** - * @see assign + * @see _.assignIn */ - extend( + extend( source1: TSource1, source2: TSource2, source3: TSource3, - customizer?: AssignCustomizer, - thisArg?: any - ): LoDashImplicitObjectWrapper; + source4: TSource4 + ): LoDashImplicitObjectWrapper; /** - * @see assign - */ - extend( - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4, - customizer?: AssignCustomizer, - thisArg?: any - ): LoDashImplicitObjectWrapper; - - /** - * @see _.assign + * @see _.assignIn */ extend(): LoDashImplicitObjectWrapper; /** - * @see _.assign + * @see _.assignIn */ - extend(...otherArgs: any[]): LoDashImplicitObjectWrapper; + extend(...otherArgs: any[]): LoDashImplicitObjectWrapper; } interface LoDashExplicitObjectWrapper { /** - * @see _.assign + * @see _.assignIn */ - extend( - source: TSource, - customizer?: AssignCustomizer, - thisArg?: any - ): LoDashExplicitObjectWrapper; + extend( + source: TSource + ): LoDashExplicitObjectWrapper; /** - * @see assign + * @see _.assignIn */ - extend( + extend( + source1: TSource1, + source2: TSource2 + ): LoDashExplicitObjectWrapper; + + /** + * @see _.assignIn + */ + extend( source1: TSource1, source2: TSource2, - customizer?: AssignCustomizer, - thisArg?: any - ): LoDashExplicitObjectWrapper; + source3: TSource3 + ): LoDashExplicitObjectWrapper; /** - * @see assign + * @see _.assignIn */ - extend( + extend( source1: TSource1, source2: TSource2, source3: TSource3, - customizer?: AssignCustomizer, - thisArg?: any - ): LoDashExplicitObjectWrapper; + source4: TSource4 + ): LoDashExplicitObjectWrapper; /** - * @see assign - */ - extend( - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4, - customizer?: AssignCustomizer, - thisArg?: any - ): LoDashExplicitObjectWrapper; - - /** - * @see _.assign + * @see _.assignIn */ extend(): LoDashExplicitObjectWrapper; /** - * @see _.assign + * @see _.assignIn */ - extend(...otherArgs: any[]): LoDashExplicitObjectWrapper; + extend(...otherArgs: any[]): LoDashExplicitObjectWrapper; + } + + interface LoDashStatic { + /** + * @see _.assignInWith + */ + extendWith( + object: TObject, + source: TSource, + customizer: AssignCustomizer + ): TObject & TSource; + + /** + * @see _.assignInWith + */ + extendWith( + object: TObject, + source1: TSource1, + source2: TSource2, + customizer: AssignCustomizer + ): TObject & TSource1 & TSource2; + + /** + * @see _.assignInWith + */ + extendWith( + object: TObject, + source1: TSource1, + source2: TSource2, + source3: TSource3, + customizer: AssignCustomizer + ): TObject & TSource1 & TSource2 & TSource3; + + /** + * @see _.assignInWith + */ + extendWith( + object: TObject, + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4, + customizer: AssignCustomizer + ): TObject & TSource1 & TSource2 & TSource3 & TSource4; + + /** + * @see _.assignInWith + */ + extendWith(object: TObject): TObject; + + /** + * @see _.assignInWith + */ + extendWith( + object: any, + ...otherArgs: any[] + ): TResult; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.assignInWith + */ + extendWith( + source: TSource, + customizer: AssignCustomizer + ): LoDashImplicitObjectWrapper; + + /** + * @see _.assignInWith + */ + extendWith( + source1: TSource1, + source2: TSource2, + customizer: AssignCustomizer + ): LoDashImplicitObjectWrapper; + + /** + * @see _.assignInWith + */ + extendWith( + source1: TSource1, + source2: TSource2, + source3: TSource3, + customizer: AssignCustomizer + ): LoDashImplicitObjectWrapper; + + /** + * @see _.assignInWith + */ + extendWith( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4, + customizer: AssignCustomizer + ): LoDashImplicitObjectWrapper; + + /** + * @see _.assignInWith + */ + extendWith(): LoDashImplicitObjectWrapper; + + /** + * @see _.assignInWith + */ + extendWith(...otherArgs: any[]): LoDashImplicitObjectWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.assignInWith + */ + extendWith( + source: TSource, + customizer: AssignCustomizer + ): LoDashExplicitObjectWrapper; + + /** + * @see _.assignInWith + */ + extendWith( + source1: TSource1, + source2: TSource2, + customizer: AssignCustomizer + ): LoDashExplicitObjectWrapper; + + /** + * @see _.assignInWith + */ + extendWith( + source1: TSource1, + source2: TSource2, + source3: TSource3, + customizer: AssignCustomizer + ): LoDashExplicitObjectWrapper; + + /** + * @see _.assignInWith + */ + extendWith( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4, + customizer: AssignCustomizer + ): LoDashExplicitObjectWrapper; + + /** + * @see _.assignInWith + */ + extendWith(): LoDashExplicitObjectWrapper; + + /** + * @see _.assignInWith + */ + extendWith(...otherArgs: any[]): LoDashExplicitObjectWrapper; } //_.findKey @@ -15102,8 +14975,7 @@ declare module _ { */ findKey( object: TObject, - predicate?: DictionaryIterator, - thisArg?: any + predicate?: DictionaryIterator ): string; /** @@ -15111,8 +14983,7 @@ declare module _ { */ findKey( object: TObject, - predicate?: ObjectIterator, - thisArg?: any + predicate?: ObjectIterator ): string; /** @@ -15120,8 +14991,7 @@ declare module _ { */ findKey( object: TObject, - predicate?: string, - thisArg?: any + predicate?: string ): string; /** @@ -15138,24 +15008,21 @@ declare module _ { * @see _.findKey */ findKey( - predicate?: DictionaryIterator, - thisArg?: any + predicate?: DictionaryIterator ): string; /** * @see _.findKey */ findKey( - predicate?: ObjectIterator, - thisArg?: any + predicate?: ObjectIterator ): string; /** * @see _.findKey */ findKey( - predicate?: string, - thisArg?: any + predicate?: string ): string; /** @@ -15171,24 +15038,21 @@ declare module _ { * @see _.findKey */ findKey( - predicate?: DictionaryIterator, - thisArg?: any + predicate?: DictionaryIterator ): LoDashExplicitWrapper; /** * @see _.findKey */ findKey( - predicate?: ObjectIterator, - thisArg?: any + predicate?: ObjectIterator ): LoDashExplicitWrapper; /** * @see _.findKey */ findKey( - predicate?: string, - thisArg?: any + predicate?: string ): LoDashExplicitWrapper; /** @@ -15220,8 +15084,7 @@ declare module _ { */ findLastKey( object: TObject, - predicate?: DictionaryIterator, - thisArg?: any + predicate?: DictionaryIterator ): string; /** @@ -15229,8 +15092,7 @@ declare module _ { */ findLastKey( object: TObject, - predicate?: ObjectIterator, - thisArg?: any + predicate?: ObjectIterator ): string; /** @@ -15238,8 +15100,7 @@ declare module _ { */ findLastKey( object: TObject, - predicate?: string, - thisArg?: any + predicate?: string ): string; /** @@ -15256,24 +15117,21 @@ declare module _ { * @see _.findLastKey */ findLastKey( - predicate?: DictionaryIterator, - thisArg?: any + predicate?: DictionaryIterator ): string; /** * @see _.findLastKey */ findLastKey( - predicate?: ObjectIterator, - thisArg?: any + predicate?: ObjectIterator ): string; /** * @see _.findLastKey */ findLastKey( - predicate?: string, - thisArg?: any + predicate?: string ): string; /** @@ -15289,24 +15147,21 @@ declare module _ { * @see _.findLastKey */ findLastKey( - predicate?: DictionaryIterator, - thisArg?: any + predicate?: DictionaryIterator ): LoDashExplicitWrapper; /** * @see _.findLastKey */ findLastKey( - predicate?: ObjectIterator, - thisArg?: any + predicate?: ObjectIterator ): LoDashExplicitWrapper; /** * @see _.findLastKey */ findLastKey( - predicate?: string, - thisArg?: any + predicate?: string ): LoDashExplicitWrapper; /** @@ -15331,8 +15186,7 @@ declare module _ { */ forIn( object: Dictionary, - iteratee?: DictionaryIterator, - thisArg?: any + iteratee?: DictionaryIterator ): Dictionary; /** @@ -15340,8 +15194,7 @@ declare module _ { */ forIn( object: T, - iteratee?: ObjectIterator, - thisArg?: any + iteratee?: ObjectIterator ): T; } @@ -15350,8 +15203,7 @@ declare module _ { * @see _.forIn */ forIn( - iteratee?: DictionaryIterator, - thisArg?: any + iteratee?: DictionaryIterator ): _.LoDashImplicitObjectWrapper; } @@ -15360,8 +15212,7 @@ declare module _ { * @see _.forIn */ forIn( - iteratee?: DictionaryIterator, - thisArg?: any + iteratee?: DictionaryIterator ): _.LoDashExplicitObjectWrapper; } @@ -15377,8 +15228,7 @@ declare module _ { */ forInRight( object: Dictionary, - iteratee?: DictionaryIterator, - thisArg?: any + iteratee?: DictionaryIterator ): Dictionary; /** @@ -15386,8 +15236,7 @@ declare module _ { */ forInRight( object: T, - iteratee?: ObjectIterator, - thisArg?: any + iteratee?: ObjectIterator ): T; } @@ -15396,8 +15245,7 @@ declare module _ { * @see _.forInRight */ forInRight( - iteratee?: DictionaryIterator, - thisArg?: any + iteratee?: DictionaryIterator ): _.LoDashImplicitObjectWrapper; } @@ -15406,8 +15254,7 @@ declare module _ { * @see _.forInRight */ forInRight( - iteratee?: DictionaryIterator, - thisArg?: any + iteratee?: DictionaryIterator ): _.LoDashExplicitObjectWrapper; } @@ -15425,8 +15272,7 @@ declare module _ { */ forOwn( object: Dictionary, - iteratee?: DictionaryIterator, - thisArg?: any + iteratee?: DictionaryIterator ): Dictionary; /** @@ -15434,8 +15280,7 @@ declare module _ { */ forOwn( object: T, - iteratee?: ObjectIterator, - thisArg?: any + iteratee?: ObjectIterator ): T; } @@ -15444,8 +15289,7 @@ declare module _ { * @see _.forOwn */ forOwn( - iteratee?: DictionaryIterator, - thisArg?: any + iteratee?: DictionaryIterator ): _.LoDashImplicitObjectWrapper; } @@ -15454,8 +15298,7 @@ declare module _ { * @see _.forOwn */ forOwn( - iteratee?: DictionaryIterator, - thisArg?: any + iteratee?: DictionaryIterator ): _.LoDashExplicitObjectWrapper; } @@ -15471,8 +15314,7 @@ declare module _ { */ forOwnRight( object: Dictionary, - iteratee?: DictionaryIterator, - thisArg?: any + iteratee?: DictionaryIterator ): Dictionary; /** @@ -15480,8 +15322,7 @@ declare module _ { */ forOwnRight( object: T, - iteratee?: ObjectIterator, - thisArg?: any + iteratee?: ObjectIterator ): T; } @@ -15490,8 +15331,7 @@ declare module _ { * @see _.forOwnRight */ forOwnRight( - iteratee?: DictionaryIterator, - thisArg?: any + iteratee?: DictionaryIterator ): _.LoDashImplicitObjectWrapper; } @@ -15500,8 +15340,7 @@ declare module _ { * @see _.forOwnRight */ forOwnRight( - iteratee?: DictionaryIterator, - thisArg?: any + iteratee?: DictionaryIterator ): _.LoDashExplicitObjectWrapper; } @@ -15999,8 +15838,7 @@ declare module _ { */ mapKeys( object: List, - iteratee?: ListIterator, - thisArg?: any + iteratee?: ListIterator ): Dictionary; /** @@ -16008,8 +15846,7 @@ declare module _ { */ mapKeys( object: Dictionary, - iteratee?: DictionaryIterator, - thisArg?: any + iteratee?: DictionaryIterator ): Dictionary; /** @@ -16025,8 +15862,7 @@ declare module _ { */ mapKeys( object: List|Dictionary, - iteratee?: string, - thisArg?: any + iteratee?: string ): Dictionary; } @@ -16035,8 +15871,7 @@ declare module _ { * @see _.mapKeys */ mapKeys( - iteratee?: ListIterator, - thisArg?: any + iteratee?: ListIterator ): LoDashImplicitObjectWrapper>; /** @@ -16050,8 +15885,7 @@ declare module _ { * @see _.mapKeys */ mapKeys( - iteratee?: string, - thisArg?: any + iteratee?: string ): LoDashImplicitObjectWrapper>; } @@ -16060,8 +15894,7 @@ declare module _ { * @see _.mapKeys */ mapKeys( - iteratee?: ListIterator|DictionaryIterator, - thisArg?: any + iteratee?: ListIterator|DictionaryIterator ): LoDashImplicitObjectWrapper>; /** @@ -16075,8 +15908,7 @@ declare module _ { * @see _.mapKeys */ mapKeys( - iteratee?: string, - thisArg?: any + iteratee?: string ): LoDashImplicitObjectWrapper>; } @@ -16085,8 +15917,7 @@ declare module _ { * @see _.mapKeys */ mapKeys( - iteratee?: ListIterator, - thisArg?: any + iteratee?: ListIterator ): LoDashExplicitObjectWrapper>; /** @@ -16100,8 +15931,7 @@ declare module _ { * @see _.mapKeys */ mapKeys( - iteratee?: string, - thisArg?: any + iteratee?: string ): LoDashExplicitObjectWrapper>; } @@ -16110,8 +15940,7 @@ declare module _ { * @see _.mapKeys */ mapKeys( - iteratee?: ListIterator|DictionaryIterator, - thisArg?: any + iteratee?: ListIterator|DictionaryIterator ): LoDashExplicitObjectWrapper>; /** @@ -16125,8 +15954,7 @@ declare module _ { * @see _.mapKeys */ mapKeys( - iteratee?: string, - thisArg?: any + iteratee?: string ): LoDashExplicitObjectWrapper>; } @@ -16151,10 +15979,10 @@ declare module _ { * @param {Object} [thisArg] The `this` binding of `iteratee`. * @return {Object} Returns the new mapped object. */ - mapValues(obj: Dictionary, callback: ObjectIterator, thisArg?: any): Dictionary; + mapValues(obj: Dictionary, callback: ObjectIterator): Dictionary; mapValues(obj: Dictionary, where: Dictionary): Dictionary; mapValues(obj: T, pluck: string): TMapped; - mapValues(obj: T, callback: ObjectIterator, thisArg?: any): T; + mapValues(obj: T, callback: ObjectIterator): T; } interface LoDashImplicitObjectWrapper { @@ -16163,7 +15991,7 @@ declare module _ { * TValue is the type of the property values of T. * TResult is the type output by the ObjectIterator function */ - mapValues(callback: ObjectIterator, thisArg?: any): LoDashImplicitObjectWrapper>; + mapValues(callback: ObjectIterator): LoDashImplicitObjectWrapper>; /** * @see _.mapValues @@ -16174,17 +16002,33 @@ declare module _ { /** * @see _.mapValues - * TResult is the type of the properties on the object specified by pluck. - * T should be a Dictionary>> + * TResult is the type of the properties of each object in the values of T + * T should be a Dictionary> */ - mapValues(pluck: string, where: Dictionary): LoDashImplicitArrayWrapper>; + mapValues(where: Dictionary): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.mapValues + * TValue is the type of the property values of T. + * TResult is the type output by the ObjectIterator function + */ + mapValues(callback: ObjectIterator): LoDashExplicitObjectWrapper>; + + /** + * @see _.mapValues + * TResult is the type of the property specified by pluck. + * T should be a Dictionary> + */ + mapValues(pluck: string): LoDashExplicitObjectWrapper>; /** * @see _.mapValues * TResult is the type of the properties of each object in the values of T * T should be a Dictionary> */ - mapValues(where: Dictionary): LoDashImplicitArrayWrapper; + mapValues(where: Dictionary): LoDashExplicitObjectWrapper; } //_.merge @@ -16635,7 +16479,7 @@ declare module _ { */ pickBy( object: T, - predicate: ObjectIterator + predicate?: ObjectIterator ): TResult; } @@ -16644,7 +16488,7 @@ declare module _ { * @see _.pickBy */ pickBy( - predicate: ObjectIterator + predicate?: ObjectIterator ): LoDashImplicitObjectWrapper; } @@ -16653,7 +16497,7 @@ declare module _ { * @see _.pickBy */ pickBy( - predicate: ObjectIterator + predicate?: ObjectIterator ): LoDashExplicitObjectWrapper; } @@ -16973,8 +16817,7 @@ declare module _ { transform( object: T[], iteratee?: MemoVoidArrayIterator, - accumulator?: TResult[], - thisArg?: any + accumulator?: TResult[] ): TResult[]; /** @@ -16983,8 +16826,7 @@ declare module _ { transform( object: T[], iteratee?: MemoVoidArrayIterator>, - accumulator?: Dictionary, - thisArg?: any + accumulator?: Dictionary ): Dictionary; /** @@ -16993,8 +16835,7 @@ declare module _ { transform( object: Dictionary, iteratee?: MemoVoidDictionaryIterator>, - accumulator?: Dictionary, - thisArg?: any + accumulator?: Dictionary ): Dictionary; /** @@ -17003,8 +16844,7 @@ declare module _ { transform( object: Dictionary, iteratee?: MemoVoidDictionaryIterator, - accumulator?: TResult[], - thisArg?: any + accumulator?: TResult[] ): TResult[]; } @@ -17014,8 +16854,7 @@ declare module _ { */ transform( iteratee?: MemoVoidArrayIterator, - accumulator?: TResult[], - thisArg?: any + accumulator?: TResult[] ): LoDashImplicitArrayWrapper; /** @@ -17023,8 +16862,7 @@ declare module _ { */ transform( iteratee?: MemoVoidArrayIterator>, - accumulator?: Dictionary, - thisArg?: any + accumulator?: Dictionary ): LoDashImplicitObjectWrapper>; } @@ -17034,8 +16872,7 @@ declare module _ { */ transform( iteratee?: MemoVoidDictionaryIterator>, - accumulator?: Dictionary, - thisArg?: any + accumulator?: Dictionary ): LoDashImplicitObjectWrapper>; /** @@ -17043,8 +16880,7 @@ declare module _ { */ transform( iteratee?: MemoVoidDictionaryIterator, - accumulator?: TResult[], - thisArg?: any + accumulator?: TResult[] ): LoDashImplicitArrayWrapper; } @@ -18344,24 +18180,21 @@ declare module _ { * // => [{ 'user': 'fred', 'age': 40 }] */ iteratee( - func: Function, - thisArg?: any + func: Function ): (...args: any[]) => TResult; /** * @see _.iteratee */ iteratee( - func: string, - thisArg?: any + func: string ): (object: any) => TResult; /** * @see _.iteratee */ iteratee( - func: Object, - thisArg?: any + func: Object ): (object: any) => boolean; /** @@ -18374,38 +18207,38 @@ declare module _ { /** * @see _.iteratee */ - iteratee(thisArg?: any): LoDashImplicitObjectWrapper<(object: any) => TResult>; + iteratee(): LoDashImplicitObjectWrapper<(object: any) => TResult>; } interface LoDashImplicitObjectWrapper { /** * @see _.iteratee */ - iteratee(thisArg?: any): LoDashImplicitObjectWrapper<(object: any) => boolean>; + iteratee(): LoDashImplicitObjectWrapper<(object: any) => boolean>; /** * @see _.iteratee */ - iteratee(thisArg?: any): LoDashImplicitObjectWrapper<(...args: any[]) => TResult>; + iteratee(): LoDashImplicitObjectWrapper<(...args: any[]) => TResult>; } interface LoDashExplicitWrapper { /** * @see _.iteratee */ - iteratee(thisArg?: any): LoDashExplicitObjectWrapper<(object: any) => TResult>; + iteratee(): LoDashExplicitObjectWrapper<(object: any) => TResult>; } interface LoDashExplicitObjectWrapper { /** * @see _.iteratee */ - iteratee(thisArg?: any): LoDashExplicitObjectWrapper<(object: any) => boolean>; + iteratee(): LoDashExplicitObjectWrapper<(object: any) => boolean>; /** * @see _.iteratee */ - iteratee(thisArg?: any): LoDashExplicitObjectWrapper<(...args: any[]) => TResult>; + iteratee(): LoDashExplicitObjectWrapper<(...args: any[]) => TResult>; } //_.matches @@ -19254,6 +19087,1839 @@ declare module _ { } } +// Named exports + +declare module "lodash/after" { + const after: typeof _.after; + export = after; +} + + +declare module "lodash/ary" { + const ary: typeof _.ary; + export = ary; +} + + +declare module "lodash/assign" { + const assign: typeof _.assign; + export = assign; +} + + +declare module "lodash/assignIn" { + const assignIn: typeof _.assignIn; + export = assignIn; +} + + +declare module "lodash/assignInWith" { + const assignInWith: typeof _.assignInWith; + export = assignInWith; +} + + +declare module "lodash/assignWith" { + const assignWith: typeof _.assignWith; + export = assignWith; +} + + +declare module "lodash/at" { + const at: typeof _.at; + export = at; +} + + +declare module "lodash/before" { + const before: typeof _.before; + export = before; +} + + +declare module "lodash/bind" { + const bind: typeof _.bind; + export = bind; +} + + +declare module "lodash/bindAll" { + const bindAll: typeof _.bindAll; + export = bindAll; +} + + +declare module "lodash/bindKey" { + const bindKey: typeof _.bindKey; + export = bindKey; +} + + +declare module "lodash/castArray" { + const castArray: typeof _.castArray; + export = castArray; +} + + +declare module "lodash/chain" { + const chain: typeof _.chain; + export = chain; +} + + +declare module "lodash/chunk" { + const chunk: typeof _.chunk; + export = chunk; +} + + +declare module "lodash/compact" { + const compact: typeof _.compact; + export = compact; +} + + +declare module "lodash/concat" { + const concat: typeof _.concat; + export = concat; +} + +/** +* uncoment it if definition exists +*/ +/* +declare module "lodash/cond" { + const cond: typeof _.cond; + export = cond; +} +*/ + +/** +* uncoment it if definition exists +*/ +/* +declare module "lodash/conforms" { + const conforms: typeof _.conforms; + export = conforms; +} +*/ + +declare module "lodash/constant" { + const constant: typeof _.constant; + export = constant; +} + + +declare module "lodash/countBy" { + const countBy: typeof _.countBy; + export = countBy; +} + + +declare module "lodash/create" { + const create: typeof _.create; + export = create; +} + + +declare module "lodash/curry" { + const curry: typeof _.curry; + export = curry; +} + + +declare module "lodash/curryRight" { + const curryRight: typeof _.curryRight; + export = curryRight; +} + + +declare module "lodash/debounce" { + const debounce: typeof _.debounce; + export = debounce; +} + + +declare module "lodash/defaults" { + const defaults: typeof _.defaults; + export = defaults; +} + + +declare module "lodash/defaultsDeep" { + const defaultsDeep: typeof _.defaultsDeep; + export = defaultsDeep; +} + + +declare module "lodash/defer" { + const defer: typeof _.defer; + export = defer; +} + + +declare module "lodash/delay" { + const delay: typeof _.delay; + export = delay; +} + + +declare module "lodash/difference" { + const difference: typeof _.difference; + export = difference; +} + + +declare module "lodash/differenceBy" { + const differenceBy: typeof _.differenceBy; + export = differenceBy; +} + + +declare module "lodash/differenceWith" { + const differenceWith: typeof _.differenceWith; + export = differenceWith; +} + + +declare module "lodash/drop" { + const drop: typeof _.drop; + export = drop; +} + + +declare module "lodash/dropRight" { + const dropRight: typeof _.dropRight; + export = dropRight; +} + + +declare module "lodash/dropRightWhile" { + const dropRightWhile: typeof _.dropRightWhile; + export = dropRightWhile; +} + + +declare module "lodash/dropWhile" { + const dropWhile: typeof _.dropWhile; + export = dropWhile; +} + + +declare module "lodash/fill" { + const fill: typeof _.fill; + export = fill; +} + + +declare module "lodash/filter" { + const filter: typeof _.filter; + export = filter; +} + + +declare module "lodash/flatMap" { + const flatMap: typeof _.flatMap; + export = flatMap; +} + +/** +* uncoment it if definition exists +*/ +/* +declare module "lodash/flatMapDeep" { + const flatMapDeep: typeof _.flatMapDeep; + export = flatMapDeep; +} +*/ +/** +* uncoment it if definition exists +*/ +/* +declare module "lodash/flatMapDepth" { + const flatMapDepth: typeof _.flatMapDepth; + export = flatMapDepth; +} +*/ + +declare module "lodash/flatten" { + const flatten: typeof _.flatten; + export = flatten; +} + + +declare module "lodash/flattenDeep" { + const flattenDeep: typeof _.flattenDeep; + export = flattenDeep; +} + +/** +* uncoment it if definition exists +*/ +/* +declare module "lodash/flattenDepth" { + const flattenDepth: typeof _.flattenDepth; + export = flattenDepth; +} +*/ + +declare module "lodash/flip" { + const flip: typeof _.flip; + export = flip; +} + + +declare module "lodash/flow" { + const flow: typeof _.flow; + export = flow; +} + + +declare module "lodash/flowRight" { + const flowRight: typeof _.flowRight; + export = flowRight; +} + + +declare module "lodash/fromPairs" { + const fromPairs: typeof _.fromPairs; + export = fromPairs; +} + + +declare module "lodash/functions" { + const functions: typeof _.functions; + export = functions; +} + + +declare module "lodash/functionsIn" { + const functionsIn: typeof _.functionsIn; + export = functionsIn; +} + + +declare module "lodash/groupBy" { + const groupBy: typeof _.groupBy; + export = groupBy; +} + + +declare module "lodash/initial" { + const initial: typeof _.initial; + export = initial; +} + + +declare module "lodash/intersection" { + const intersection: typeof _.intersection; + export = intersection; +} + + +declare module "lodash/intersectionBy" { + const intersectionBy: typeof _.intersectionBy; + export = intersectionBy; +} + + +declare module "lodash/intersectionWith" { + const intersectionWith: typeof _.intersectionWith; + export = intersectionWith; +} + + +declare module "lodash/invert" { + const invert: typeof _.invert; + export = invert; +} + + +declare module "lodash/invertBy" { + const invertBy: typeof _.invertBy; + export = invertBy; +} + + +declare module "lodash/invokeMap" { + const invokeMap: typeof _.invokeMap; + export = invokeMap; +} + + +declare module "lodash/iteratee" { + const iteratee: typeof _.iteratee; + export = iteratee; +} + + +declare module "lodash/keyBy" { + const keyBy: typeof _.keyBy; + export = keyBy; +} + + +declare module "lodash/keys" { + const keys: typeof _.keys; + export = keys; +} + + +declare module "lodash/keysIn" { + const keysIn: typeof _.keysIn; + export = keysIn; +} + + +declare module "lodash/map" { + const map: typeof _.map; + export = map; +} + + +declare module "lodash/mapKeys" { + const mapKeys: typeof _.mapKeys; + export = mapKeys; +} + + +declare module "lodash/mapValues" { + const mapValues: typeof _.mapValues; + export = mapValues; +} + + +declare module "lodash/matches" { + const matches: typeof _.matches; + export = matches; +} + + +declare module "lodash/matchesProperty" { + const matchesProperty: typeof _.matchesProperty; + export = matchesProperty; +} + + +declare module "lodash/memoize" { + const memoize: typeof _.memoize; + export = memoize; +} + + +declare module "lodash/merge" { + const merge: typeof _.merge; + export = merge; +} + + +declare module "lodash/mergeWith" { + const mergeWith: typeof _.mergeWith; + export = mergeWith; +} + + +declare module "lodash/method" { + const method: typeof _.method; + export = method; +} + + +declare module "lodash/methodOf" { + const methodOf: typeof _.methodOf; + export = methodOf; +} + + +declare module "lodash/mixin" { + const mixin: typeof _.mixin; + export = mixin; +} + + +declare module "lodash/negate" { + const negate: typeof _.negate; + export = negate; +} + + +declare module "lodash/nthArg" { + const nthArg: typeof _.nthArg; + export = nthArg; +} + + +declare module "lodash/omit" { + const omit: typeof _.omit; + export = omit; +} + + +declare module "lodash/omitBy" { + const omitBy: typeof _.omitBy; + export = omitBy; +} + + +declare module "lodash/once" { + const once: typeof _.once; + export = once; +} + + +declare module "lodash/orderBy" { + const orderBy: typeof _.orderBy; + export = orderBy; +} + + +declare module "lodash/over" { + const over: typeof _.over; + export = over; +} + + +declare module "lodash/overArgs" { + const overArgs: typeof _.overArgs; + export = overArgs; +} + + +declare module "lodash/overEvery" { + const overEvery: typeof _.overEvery; + export = overEvery; +} + + +declare module "lodash/overSome" { + const overSome: typeof _.overSome; + export = overSome; +} + + +declare module "lodash/partial" { + const partial: typeof _.partial; + export = partial; +} + + +declare module "lodash/partialRight" { + const partialRight: typeof _.partialRight; + export = partialRight; +} + + +declare module "lodash/partition" { + const partition: typeof _.partition; + export = partition; +} + + +declare module "lodash/pick" { + const pick: typeof _.pick; + export = pick; +} + + +declare module "lodash/pickBy" { + const pickBy: typeof _.pickBy; + export = pickBy; +} + + +declare module "lodash/property" { + const property: typeof _.property; + export = property; +} + + +declare module "lodash/propertyOf" { + const propertyOf: typeof _.propertyOf; + export = propertyOf; +} + + +declare module "lodash/pull" { + const pull: typeof _.pull; + export = pull; +} + + +declare module "lodash/pullAll" { + const pullAll: typeof _.pullAll; + export = pullAll; +} + + +declare module "lodash/pullAllBy" { + const pullAllBy: typeof _.pullAllBy; + export = pullAllBy; +} + +/** +* uncoment it if definition exists +*/ +/* +declare module "lodash/pullAllWith" { + const pullAllWith: typeof _.pullAllWith; + export = pullAllWith; +} +*/ + +declare module "lodash/pullAt" { + const pullAt: typeof _.pullAt; + export = pullAt; +} + + +declare module "lodash/range" { + const range: typeof _.range; + export = range; +} + + +declare module "lodash/rangeRight" { + const rangeRight: typeof _.rangeRight; + export = rangeRight; +} + + +declare module "lodash/rearg" { + const rearg: typeof _.rearg; + export = rearg; +} + + +declare module "lodash/reject" { + const reject: typeof _.reject; + export = reject; +} + + +declare module "lodash/remove" { + const remove: typeof _.remove; + export = remove; +} + + +declare module "lodash/rest" { + const rest: typeof _.rest; + export = rest; +} + + +declare module "lodash/reverse" { + const reverse: typeof _.reverse; + export = reverse; +} + + +declare module "lodash/sampleSize" { + const sampleSize: typeof _.sampleSize; + export = sampleSize; +} + + +declare module "lodash/set" { + const set: typeof _.set; + export = set; +} + + +declare module "lodash/setWith" { + const setWith: typeof _.setWith; + export = setWith; +} + + +declare module "lodash/shuffle" { + const shuffle: typeof _.shuffle; + export = shuffle; +} + + +declare module "lodash/slice" { + const slice: typeof _.slice; + export = slice; +} + + +declare module "lodash/sortBy" { + const sortBy: typeof _.sortBy; + export = sortBy; +} + + +declare module "lodash/sortedUniq" { + const sortedUniq: typeof _.sortedUniq; + export = sortedUniq; +} + + +declare module "lodash/sortedUniqBy" { + const sortedUniqBy: typeof _.sortedUniqBy; + export = sortedUniqBy; +} + + +declare module "lodash/split" { + const split: typeof _.split; + export = split; +} + + +declare module "lodash/spread" { + const spread: typeof _.spread; + export = spread; +} + + +declare module "lodash/tail" { + const tail: typeof _.tail; + export = tail; +} + + +declare module "lodash/take" { + const take: typeof _.take; + export = take; +} + + +declare module "lodash/takeRight" { + const takeRight: typeof _.takeRight; + export = takeRight; +} + + +declare module "lodash/takeRightWhile" { + const takeRightWhile: typeof _.takeRightWhile; + export = takeRightWhile; +} + + +declare module "lodash/takeWhile" { + const takeWhile: typeof _.takeWhile; + export = takeWhile; +} + + +declare module "lodash/tap" { + const tap: typeof _.tap; + export = tap; +} + + +declare module "lodash/throttle" { + const throttle: typeof _.throttle; + export = throttle; +} + + +declare module "lodash/thru" { + const thru: typeof _.thru; + export = thru; +} + + +declare module "lodash/toArray" { + const toArray: typeof _.toArray; + export = toArray; +} + + +declare module "lodash/toPairs" { + const toPairs: typeof _.toPairs; + export = toPairs; +} + + +declare module "lodash/toPairsIn" { + const toPairsIn: typeof _.toPairsIn; + export = toPairsIn; +} + + +declare module "lodash/toPath" { + const toPath: typeof _.toPath; + export = toPath; +} + + +declare module "lodash/toPlainObject" { + const toPlainObject: typeof _.toPlainObject; + export = toPlainObject; +} + + +declare module "lodash/transform" { + const transform: typeof _.transform; + export = transform; +} + + +declare module "lodash/unary" { + const unary: typeof _.unary; + export = unary; +} + + +declare module "lodash/union" { + const union: typeof _.union; + export = union; +} + + +declare module "lodash/unionBy" { + const unionBy: typeof _.unionBy; + export = unionBy; +} + + +declare module "lodash/unionWith" { + const unionWith: typeof _.unionWith; + export = unionWith; +} + + +declare module "lodash/uniq" { + const uniq: typeof _.uniq; + export = uniq; +} + + +declare module "lodash/uniqBy" { + const uniqBy: typeof _.uniqBy; + export = uniqBy; +} + + +declare module "lodash/uniqWith" { + const uniqWith: typeof _.uniqWith; + export = uniqWith; +} + + +declare module "lodash/unset" { + const unset: typeof _.unset; + export = unset; +} + + +declare module "lodash/unzip" { + const unzip: typeof _.unzip; + export = unzip; +} + + +declare module "lodash/unzipWith" { + const unzipWith: typeof _.unzipWith; + export = unzipWith; +} + + +declare module "lodash/update" { + const update: typeof _.update; + export = update; +} + +/** +* uncoment it if definition exists +*/ +/* +declare module "lodash/updateWith" { + const updateWith: typeof _.updateWith; + export = updateWith; +} +*/ + +declare module "lodash/values" { + const values: typeof _.values; + export = values; +} + + +declare module "lodash/valuesIn" { + const valuesIn: typeof _.valuesIn; + export = valuesIn; +} + + +declare module "lodash/without" { + const without: typeof _.without; + export = without; +} + + +declare module "lodash/words" { + const words: typeof _.words; + export = words; +} + + +declare module "lodash/wrap" { + const wrap: typeof _.wrap; + export = wrap; +} + + +declare module "lodash/xor" { + const xor: typeof _.xor; + export = xor; +} + + +declare module "lodash/xorBy" { + const xorBy: typeof _.xorBy; + export = xorBy; +} + + +declare module "lodash/xorWith" { + const xorWith: typeof _.xorWith; + export = xorWith; +} + + +declare module "lodash/zip" { + const zip: typeof _.zip; + export = zip; +} + + +declare module "lodash/zipObject" { + const zipObject: typeof _.zipObject; + export = zipObject; +} + +/** +* uncoment it if definition exists +*/ +/* +declare module "lodash/zipObjectDeep" { + const zipObjectDeep: typeof _.zipObjectDeep; + export = zipObjectDeep; +} +*/ + + +declare module "lodash/zipWith" { + const zipWith: typeof _.zipWith; + export = zipWith; +} + +/** +* uncoment it if definition exists +*/ +/* +declare module "lodash/entries" { + const entries: typeof _.entries; + export = entries; +} +*/ +/** +* uncoment it if definition exists +*/ +/* +declare module "lodash/entriesIn" { + const entriesIn: typeof _.entriesIn; + export = entriesIn; +} +*/ + + +declare module "lodash/extend" { + const extend: typeof _.extend; + export = extend; +} + + +declare module "lodash/extendWith" { + const extendWith: typeof _.extendWith; + export = extendWith; +} + + +declare module "lodash/add" { + const add: typeof _.add; + export = add; +} + + +declare module "lodash/attempt" { + const attempt: typeof _.attempt; + export = attempt; +} + + +declare module "lodash/camelCase" { + const camelCase: typeof _.camelCase; + export = camelCase; +} + + +declare module "lodash/capitalize" { + const capitalize: typeof _.capitalize; + export = capitalize; +} + + +declare module "lodash/ceil" { + const ceil: typeof _.ceil; + export = ceil; +} + + +declare module "lodash/clamp" { + const clamp: typeof _.clamp; + export = clamp; +} + + +declare module "lodash/clone" { + const clone: typeof _.clone; + export = clone; +} + + +declare module "lodash/cloneDeep" { + const cloneDeep: typeof _.cloneDeep; + export = cloneDeep; +} + + +declare module "lodash/cloneDeepWith" { + const cloneDeepWith: typeof _.cloneDeepWith; + export = cloneDeepWith; +} + + +declare module "lodash/cloneWith" { + const cloneWith: typeof _.cloneWith; + export = cloneWith; +} + + +declare module "lodash/deburr" { + const deburr: typeof _.deburr; + export = deburr; +} + +/** +* uncoment it if definition exists +*/ +/* +declare module "lodash/divide" { + const divide: typeof _.divide; + export = divide; +} +*/ + +declare module "lodash/endsWith" { + const endsWith: typeof _.endsWith; + export = endsWith; +} + + +declare module "lodash/eq" { + const eq: typeof _.eq; + export = eq; +} + + +declare module "lodash/escape" { + const escape: typeof _.escape; + export = escape; +} + + +declare module "lodash/escapeRegExp" { + const escapeRegExp: typeof _.escapeRegExp; + export = escapeRegExp; +} + + +declare module "lodash/every" { + const every: typeof _.every; + export = every; +} + + +declare module "lodash/find" { + const find: typeof _.find; + export = find; +} + + +declare module "lodash/findIndex" { + const findIndex: typeof _.findIndex; + export = findIndex; +} + + +declare module "lodash/findKey" { + const findKey: typeof _.findKey; + export = findKey; +} + + +declare module "lodash/findLast" { + const findLast: typeof _.findLast; + export = findLast; +} + + +declare module "lodash/findLastIndex" { + const findLastIndex: typeof _.findLastIndex; + export = findLastIndex; +} + + +declare module "lodash/findLastKey" { + const findLastKey: typeof _.findLastKey; + export = findLastKey; +} + + +declare module "lodash/floor" { + const floor: typeof _.floor; + export = floor; +} + + +declare module "lodash/forEach" { + const forEach: typeof _.forEach; + export = forEach; +} + + +declare module "lodash/forEachRight" { + const forEachRight: typeof _.forEachRight; + export = forEachRight; +} + + +declare module "lodash/forIn" { + const forIn: typeof _.forIn; + export = forIn; +} + + +declare module "lodash/forInRight" { + const forInRight: typeof _.forInRight; + export = forInRight; +} + + +declare module "lodash/forOwn" { + const forOwn: typeof _.forOwn; + export = forOwn; +} + + +declare module "lodash/forOwnRight" { + const forOwnRight: typeof _.forOwnRight; + export = forOwnRight; +} + + +declare module "lodash/get" { + const get: typeof _.get; + export = get; +} + + +declare module "lodash/gt" { + const gt: typeof _.gt; + export = gt; +} + + +declare module "lodash/gte" { + const gte: typeof _.gte; + export = gte; +} + + +declare module "lodash/has" { + const has: typeof _.has; + export = has; +} + + +declare module "lodash/hasIn" { + const hasIn: typeof _.hasIn; + export = hasIn; +} + + +declare module "lodash/head" { + const head: typeof _.head; + export = head; +} + + +declare module "lodash/identity" { + const identity: typeof _.identity; + export = identity; +} + + +declare module "lodash/includes" { + const includes: typeof _.includes; + export = includes; +} + + +declare module "lodash/indexOf" { + const indexOf: typeof _.indexOf; + export = indexOf; +} + + +declare module "lodash/inRange" { + const inRange: typeof _.inRange; + export = inRange; +} + + +declare module "lodash/invoke" { + const invoke: typeof _.invoke; + export = invoke; +} + + +declare module "lodash/isArguments" { + const isArguments: typeof _.isArguments; + export = isArguments; +} + + +declare module "lodash/isArray" { + const isArray: typeof _.isArray; + export = isArray; +} + + +declare module "lodash/isArrayBuffer" { + const isArrayBuffer: typeof _.isArrayBuffer; + export = isArrayBuffer; +} + + +declare module "lodash/isArrayLike" { + const isArrayLike: typeof _.isArrayLike; + export = isArrayLike; +} + + +declare module "lodash/isArrayLikeObject" { + const isArrayLikeObject: typeof _.isArrayLikeObject; + export = isArrayLikeObject; +} + + +declare module "lodash/isBoolean" { + const isBoolean: typeof _.isBoolean; + export = isBoolean; +} + + +declare module "lodash/isBuffer" { + const isBuffer: typeof _.isBuffer; + export = isBuffer; +} + + +declare module "lodash/isDate" { + const isDate: typeof _.isDate; + export = isDate; +} + + +declare module "lodash/isElement" { + const isElement: typeof _.isElement; + export = isElement; +} + + +declare module "lodash/isEmpty" { + const isEmpty: typeof _.isEmpty; + export = isEmpty; +} + + +declare module "lodash/isEqual" { + const isEqual: typeof _.isEqual; + export = isEqual; +} + + +declare module "lodash/isEqualWith" { + const isEqualWith: typeof _.isEqualWith; + export = isEqualWith; +} + + +declare module "lodash/isError" { + const isError: typeof _.isError; + export = isError; +} + + +declare module "lodash/isFinite" { + const isFinite: typeof _.isFinite; + export = isFinite; +} + + +declare module "lodash/isFunction" { + const isFunction: typeof _.isFunction; + export = isFunction; +} + + +declare module "lodash/isInteger" { + const isInteger: typeof _.isInteger; + export = isInteger; +} + + +declare module "lodash/isLength" { + const isLength: typeof _.isLength; + export = isLength; +} + + +declare module "lodash/isMap" { + const isMap: typeof _.isMap; + export = isMap; +} + + +declare module "lodash/isMatch" { + const isMatch: typeof _.isMatch; + export = isMatch; +} + + +declare module "lodash/isMatchWith" { + const isMatchWith: typeof _.isMatchWith; + export = isMatchWith; +} + + +declare module "lodash/isNaN" { + const isNaN: typeof _.isNaN; + export = isNaN; +} + + +declare module "lodash/isNative" { + const isNative: typeof _.isNative; + export = isNative; +} + + +declare module "lodash/isNil" { + const isNil: typeof _.isNil; + export = isNil; +} + + +declare module "lodash/isNull" { + const isNull: typeof _.isNull; + export = isNull; +} + + +declare module "lodash/isNumber" { + const isNumber: typeof _.isNumber; + export = isNumber; +} + + +declare module "lodash/isObject" { + const isObject: typeof _.isObject; + export = isObject; +} + + +declare module "lodash/isObjectLike" { + const isObjectLike: typeof _.isObjectLike; + export = isObjectLike; +} + + +declare module "lodash/isPlainObject" { + const isPlainObject: typeof _.isPlainObject; + export = isPlainObject; +} + + +declare module "lodash/isRegExp" { + const isRegExp: typeof _.isRegExp; + export = isRegExp; +} + + +declare module "lodash/isSafeInteger" { + const isSafeInteger: typeof _.isSafeInteger; + export = isSafeInteger; +} + + +declare module "lodash/isSet" { + const isSet: typeof _.isSet; + export = isSet; +} + + +declare module "lodash/isString" { + const isString: typeof _.isString; + export = isString; +} + + +declare module "lodash/isSymbol" { + const isSymbol: typeof _.isSymbol; + export = isSymbol; +} + + +declare module "lodash/isTypedArray" { + const isTypedArray: typeof _.isTypedArray; + export = isTypedArray; +} + + +declare module "lodash/isUndefined" { + const isUndefined: typeof _.isUndefined; + export = isUndefined; +} + + +declare module "lodash/isWeakMap" { + const isWeakMap: typeof _.isWeakMap; + export = isWeakMap; +} + + +declare module "lodash/isWeakSet" { + const isWeakSet: typeof _.isWeakSet; + export = isWeakSet; +} + + +declare module "lodash/join" { + const join: typeof _.join; + export = join; +} + + +declare module "lodash/kebabCase" { + const kebabCase: typeof _.kebabCase; + export = kebabCase; +} + + +declare module "lodash/last" { + const last: typeof _.last; + export = last; +} + + +declare module "lodash/lastIndexOf" { + const lastIndexOf: typeof _.lastIndexOf; + export = lastIndexOf; +} + + +declare module "lodash/lowerCase" { + const lowerCase: typeof _.lowerCase; + export = lowerCase; +} + + +declare module "lodash/lowerFirst" { + const lowerFirst: typeof _.lowerFirst; + export = lowerFirst; +} + + +declare module "lodash/lt" { + const lt: typeof _.lt; + export = lt; +} + + +declare module "lodash/lte" { + const lte: typeof _.lte; + export = lte; +} + + +declare module "lodash/max" { + const max: typeof _.max; + export = max; +} + + +declare module "lodash/maxBy" { + const maxBy: typeof _.maxBy; + export = maxBy; +} + + +declare module "lodash/mean" { + const mean: typeof _.mean; + export = mean; +} + +/** +* uncoment it if definition exists +*/ +/* +declare module "lodash/meanBy" { + const meanBy: typeof _.meanBy; + export = meanBy; +} +*/ + +declare module "lodash/min" { + const min: typeof _.min; + export = min; +} + + +declare module "lodash/minBy" { + const minBy: typeof _.minBy; + export = minBy; +} + +/** +* uncoment it if definition exists +*/ +/* +declare module "lodash/multiply" { + const multiply: typeof _.multiply; + export = multiply; +} +*/ + +/** +* uncoment it if definition exists +*/ +/* +declare module "lodash/nth" { + const nth: typeof _.nth; + export = nth; +} +*/ + +declare module "lodash/noConflict" { + const noConflict: typeof _.noConflict; + export = noConflict; +} + + +declare module "lodash/noop" { + const noop: typeof _.noop; + export = noop; +} + + +declare module "lodash/now" { + const now: typeof _.now; + export = now; +} + + +declare module "lodash/pad" { + const pad: typeof _.pad; + export = pad; +} + + +declare module "lodash/padEnd" { + const padEnd: typeof _.padEnd; + export = padEnd; +} + + +declare module "lodash/padStart" { + const padStart: typeof _.padStart; + export = padStart; +} + + +declare module "lodash/parseInt" { + const parseInt: typeof _.parseInt; + export = parseInt; +} + + +declare module "lodash/random" { + const random: typeof _.random; + export = random; +} + + +declare module "lodash/reduce" { + const reduce: typeof _.reduce; + export = reduce; +} + + +declare module "lodash/reduceRight" { + const reduceRight: typeof _.reduceRight; + export = reduceRight; +} + + +declare module "lodash/repeat" { + const repeat: typeof _.repeat; + export = repeat; +} + + +declare module "lodash/replace" { + const replace: typeof _.replace; + export = replace; +} + + +declare module "lodash/result" { + const result: typeof _.result; + export = result; +} + + +declare module "lodash/round" { + const round: typeof _.round; + export = round; +} + + +declare module "lodash/runInContext" { + const runInContext: typeof _.runInContext; + export = runInContext; +} + + +declare module "lodash/sample" { + const sample: typeof _.sample; + export = sample; +} + + +declare module "lodash/size" { + const size: typeof _.size; + export = size; +} + + +declare module "lodash/snakeCase" { + const snakeCase: typeof _.snakeCase; + export = snakeCase; +} + + +declare module "lodash/some" { + const some: typeof _.some; + export = some; +} + + +declare module "lodash/sortedIndex" { + const sortedIndex: typeof _.sortedIndex; + export = sortedIndex; +} + + +declare module "lodash/sortedIndexBy" { + const sortedIndexBy: typeof _.sortedIndexBy; + export = sortedIndexBy; +} + + +declare module "lodash/sortedIndexOf" { + const sortedIndexOf: typeof _.sortedIndexOf; + export = sortedIndexOf; +} + + +declare module "lodash/sortedLastIndex" { + const sortedLastIndex: typeof _.sortedLastIndex; + export = sortedLastIndex; +} + + +declare module "lodash/sortedLastIndexBy" { + const sortedLastIndexBy: typeof _.sortedLastIndexBy; + export = sortedLastIndexBy; +} + + +declare module "lodash/sortedLastIndexOf" { + const sortedLastIndexOf: typeof _.sortedLastIndexOf; + export = sortedLastIndexOf; +} + + +declare module "lodash/startCase" { + const startCase: typeof _.startCase; + export = startCase; +} + + +declare module "lodash/startsWith" { + const startsWith: typeof _.startsWith; + export = startsWith; +} + + +declare module "lodash/subtract" { + const subtract: typeof _.subtract; + export = subtract; +} + + +declare module "lodash/sum" { + const sum: typeof _.sum; + export = sum; +} + + +declare module "lodash/sumBy" { + const sumBy: typeof _.sumBy; + export = sumBy; +} + + +declare module "lodash/template" { + const template: typeof _.template; + export = template; +} + + +declare module "lodash/times" { + const times: typeof _.times; + export = times; +} + + +declare module "lodash/toInteger" { + const toInteger: typeof _.toInteger; + export = toInteger; +} + + +declare module "lodash/toLength" { + const toLength: typeof _.toLength; + export = toLength; +} + + +declare module "lodash/toLower" { + const toLower: typeof _.toLower; + export = toLower; +} + + +declare module "lodash/toNumber" { + const toNumber: typeof _.toNumber; + export = toNumber; +} + + +declare module "lodash/toSafeInteger" { + const toSafeInteger: typeof _.toSafeInteger; + export = toSafeInteger; +} + + +declare module "lodash/toString" { + const toString: typeof _.toString; + export = toString; +} + + +declare module "lodash/toUpper" { + const toUpper: typeof _.toUpper; + export = toUpper; +} + + +declare module "lodash/trim" { + const trim: typeof _.trim; + export = trim; +} + + +declare module "lodash/trimEnd" { + const trimEnd: typeof _.trimEnd; + export = trimEnd; +} + + +declare module "lodash/trimStart" { + const trimStart: typeof _.trimStart; + export = trimStart; +} + + +declare module "lodash/truncate" { + const truncate: typeof _.truncate; + export = truncate; +} + + +declare module "lodash/unescape" { + const unescape: typeof _.unescape; + export = unescape; +} + + +declare module "lodash/uniqueId" { + const uniqueId: typeof _.uniqueId; + export = uniqueId; +} + + +declare module "lodash/upperCase" { + const upperCase: typeof _.upperCase; + export = upperCase; +} + + +declare module "lodash/upperFirst" { + const upperFirst: typeof _.upperFirst; + export = upperFirst; +} + + +declare module "lodash/each" { + const each: typeof _.each; + export = each; +} + + +declare module "lodash/eachRight" { + const eachRight: typeof _.eachRight; + export = eachRight; +} + + +declare module "lodash/first" { + const first: typeof _.first; + export = first; +} + +declare module "lodash/fp" { + export = _; +} + declare module "lodash" { export = _; } diff --git a/log4javascript/log4javascript.d.ts b/log4javascript/log4javascript.d.ts index 1307053fad..d22e666e8f 100644 --- a/log4javascript/log4javascript.d.ts +++ b/log4javascript/log4javascript.d.ts @@ -1,4 +1,4 @@ -// Type definitions for log4javascript v1.4.10 +// Type definitions for log4javascript v1.4.13 // Project: http://log4javascript.org/ // Definitions by: Markus Wagner // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -126,6 +126,11 @@ declare namespace log4javascript { */ removeAllAppenders(): void; + /** + * Returns all appenders which will log a message. + */ + getEffectiveAppenders(): Appender[]; + /** * Sets the level. Log messages of a lower level than level will not be logged. Default value is DEBUG. */ @@ -274,6 +279,8 @@ declare namespace log4javascript { messages: any[]; exception: Error; + constructor(logger: Logger, timeStamp: Date, level: Level, messages: string[], exception?: Error); + getThrowableStrRep: () => string; getCombinedMessages: () => string; toString: () => string; 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/maker.js/makerjs-tests.ts b/maker.js/makerjs-tests.ts index e314f09669..ef32f885ff 100644 --- a/maker.js/makerjs-tests.ts +++ b/maker.js/makerjs-tests.ts @@ -25,11 +25,11 @@ function test() { } function testAngle() { - makerjs.angle.areEqual(12, 13); makerjs.angle.mirror(45, true, false); makerjs.angle.noRevolutions(90); makerjs.angle.ofArcEnd(paths.arc); makerjs.angle.ofArcMiddle(paths.arc); + makerjs.angle.ofArcSpan(paths.arc); makerjs.angle.ofLineInDegrees(paths.line); makerjs.angle.ofPointInDegrees([0,0], [1,1]); makerjs.angle.ofPointInRadians([0,0], [1,1]); @@ -67,7 +67,9 @@ function test() { } function testMeasure() { - makerjs.measure.arcAngle(paths.arc); + makerjs.measure.isPointEqual(p1, p2); + makerjs.measure.isPathEqual(paths.line, paths.circle, 4); + makerjs.measure.isAngleEqual(12, 13); makerjs.measure.isArcConcaveTowardsPoint(paths.arc, [0,0]); makerjs.measure.isBetween(7, 8, 9, false); makerjs.measure.isBetweenArcAngles(7, paths.arc, false); @@ -119,7 +121,6 @@ function test() { } function testPath() { - makerjs.path.areEqual(paths.line, paths.circle, 4); makerjs.path.breakAtPoint(paths.arc, [0,0]).type; makerjs.path.dogbone(paths.line, paths.line, 7); makerjs.path.fillet(paths.arc, paths.line, 4); @@ -129,7 +130,6 @@ function test() { makerjs.path.moveRelative(paths.circle, [0,0]); makerjs.path.rotate(paths.line, 5, [0,0]); makerjs.path.scale(paths.arc, 8); - makerjs.path.slopeIntersectionPoint(paths.line, paths.line); } function testPaths() { @@ -156,8 +156,6 @@ function test() { function testPoint() { makerjs.point.add(p1, p2); - makerjs.point.areEqual(p1, p2); - makerjs.point.areEqualRounded(p1, p2); makerjs.point.average(p1, p2); makerjs.point.clone(p1); makerjs.point.closest([0,0], [p1, p2]); @@ -170,7 +168,6 @@ function test() { makerjs.point.rotate(p1, 5, p2); makerjs.point.rounded(p1); makerjs.point.scale(p2, 8); - makerjs.point.serialize(p1); makerjs.point.subtract(p2, p1); makerjs.point.zero(); } diff --git a/maker.js/makerjs.d.ts b/maker.js/makerjs.d.ts index fdfade36da..28db25f854 100644 --- a/maker.js/makerjs.d.ts +++ b/maker.js/makerjs.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/Microsoft/maker.js // Definitions by: Dan Marshall // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +/// /** * Root module for Maker.js. * @@ -37,6 +38,13 @@ declare namespace MakerJs { * @param accuracy Optional exemplar of number of decimal places. */ function round(n: number, accuracy?: number): number; + /** + * Create a string representation of a route array. + * + * @param route Array of strings which are segments of a route. + * @returns String of the flattened array. + */ + function createRouteKey(route: string[]): string; /** * Clone an object. * @@ -89,6 +97,12 @@ declare namespace MakerJs { */ high: IPoint; } + /** + * A map of measurements. + */ + interface IMeasureMap { + [key: string]: IMeasure; + } /** * A line, curved line or other simple two dimensional shape. */ @@ -181,7 +195,6 @@ declare namespace MakerJs { function isPathArc(item: any): boolean; /** * A map of functions which accept a path as a parameter. - * @private */ interface IPathFunctionMap { /** @@ -191,7 +204,6 @@ declare namespace MakerJs { } /** * A map of functions which accept a path and an origin point as parameters. - * @private */ interface IPathOriginFunctionMap { /** @@ -213,10 +225,31 @@ declare namespace MakerJs { Circle: string; Arc: string; }; + /** + * Slope and y-intercept of a line. + */ + interface ISlope { + /** + * Boolean to see if line has slope or is vertical. + */ + hasSlope: boolean; + /** + * Optional value of non-vertical slope. + */ + slope?: number; + /** + * Line used to calculate this slope. + */ + line: IPathLine; + /** + * Optional value of y when x = 0. + */ + yIntercept?: number; + } /** * Options to pass to path.intersection() */ - interface IPathIntersectionOptions { + interface IPathIntersectionBaseOptions { /** * Optional boolean to only return deep intersections, i.e. not on an end point or tangent. */ @@ -226,6 +259,19 @@ declare namespace MakerJs { */ out_AreOverlapped?: boolean; } + /** + * Options to pass to path.intersection() + */ + interface IPathIntersectionOptions extends IPathIntersectionBaseOptions { + /** + * Optional boolean to only return deep intersections, i.e. not on an end point or tangent. + */ + path1Offset?: IPoint; + /** + * Optional output variable which will be set to true if the paths are overlapped. + */ + path2Offset?: IPoint; + } /** * An intersection of two paths. */ @@ -268,6 +314,14 @@ declare namespace MakerJs { * Point which is known to be outside of the model. */ farPoint?: IPoint; + /** + * Cached measurements for model A. + */ + measureA?: measure.Atlas; + /** + * Cached measurements for model B. + */ + measureB?: measure.Atlas; } /** * Options to pass to model.findLoops. @@ -278,6 +332,19 @@ declare namespace MakerJs { */ removeFromOriginal?: boolean; } + /** + * Options to pass to model.simplify() + */ + interface ISimplifyOptions { + /** + * Optional + */ + pointMatchingDistance?: number; + /** + * Optional + */ + scalarMatchingDistance?: number; + } /** * A path that may be indicated to "flow" in either direction between its endpoints. */ @@ -370,11 +437,104 @@ declare namespace MakerJs { pathId: string; } /** - * Path and its reference id within a model + * A route to either a path or a model, and the absolute offset of it. */ - interface IRefPathInModel extends IRefPathIdInModel { + interface IRouteOffset { + layer: string; + offset: IPoint; + route: string[]; + routeKey: string; + } + /** + * A path reference in a walk. + */ + interface IWalkPath extends IRefPathIdInModel, IRouteOffset { pathContext: IPath; } + /** + * Callback signature for path in model.walk(). + */ + interface IWalkPathCallback { + (context: IWalkPath): void; + } + /** + * A link in a chain, with direction of flow. + */ + interface IChainLink { + /** + * Reference to the path. + */ + walkedPath: IWalkPath; + /** + * Path flows forwards or reverse. + */ + reversed: boolean; + /** + * The endpoints of the path, in absolute coords. + */ + endPoints: IPoint[]; + } + /** + * A chain of paths which connect end to end. + */ + interface IChain { + /** + * The links in this chain. + */ + links: IChainLink[]; + /** + * Flag if this chain forms a loop end to end. + */ + endless?: boolean; + } + /** + * Callback to model.findChains() with resulting array of chains and unchained paths. + */ + interface IChainCallback { + (chains: IChain[], loose: IWalkPath[], layer: string): void; + } + /** + * Options to pass to model.findLoops. + */ + interface IFindChainsOptions extends IPointMatchOptions { + /** + * Flag to separate chains by layers. + */ + byLayers?: boolean; + } + /** + * Reference to a model within a model. + */ + interface IRefModelInModel { + parentModel: IModel; + childId: string; + childModel: IModel; + } + /** + * A model reference in a walk. + */ + interface IWalkModel extends IRefModelInModel, IRouteOffset { + } + /** + * Callback signature for model.walk(). + */ + interface IWalkModelCallback { + (context: IWalkModel): void; + } + /** + * Callback signature for model.walk(), which may return false to halt any further walking. + */ + interface IWalkModelCancellableCallback { + (context: IWalkModel): boolean; + } + /** + * Options to pass to model.walk(). + */ + interface IWalkOptions { + onPath?: IWalkPathCallback; + beforeChildWalk?: IWalkModelCancellableCallback; + afterChildWalk?: IWalkModelCallback; + } /** * Describes a parameter and its limits. */ @@ -425,14 +585,6 @@ declare namespace MakerJs { } } declare namespace MakerJs.angle { - /** - * Find out if two angles are equal. - * - * @param a First angle. - * @param b Second angle. - * @returns true if angles are the same, false if they are not - */ - function areEqual(angle1: number, angle2: number, accuracy?: number): boolean; /** * Ensures an angle is not greater than 360 * @@ -469,6 +621,13 @@ declare namespace MakerJs.angle { * @returns Middle angle of arc. */ function ofArcMiddle(arc: IPathArc, ratio?: number): number; + /** + * Total angle of an arc between its start and end angles. + * + * @param arc The arc to measure. + * @returns Angle of arc. + */ + function ofArcSpan(arc: IPathArc): number; /** * Angle of a line path. * @@ -512,23 +671,6 @@ declare namespace MakerJs.point { * @returns A new point object. */ function add(a: IPoint, b: IPoint, subtract?: boolean): IPoint; - /** - * Find out if two points are equal. - * - * @param a First point. - * @param b Second point. - * @returns true if points are the same, false if they are not - */ - function areEqual(a: IPoint, b: IPoint, withinDistance?: number): boolean; - /** - * Find out if two points are equal after rounding. - * - * @param a First point. - * @param b Second point. - * @param accuracy Optional exemplar of number of decimal places. - * @returns true if points are the same, false if they are not - */ - function areEqualRounded(a: IPoint, b: IPoint, accuracy?: number): boolean; /** * Get the average of two points. * @@ -580,7 +722,16 @@ declare namespace MakerJs.point { * @param pathContext The path object. * @returns Array with 2 elements: [0] is the point object corresponding to the origin, [1] is the point object corresponding to the end. */ - function fromPathEnds(pathContext: IPath): IPoint[]; + function fromPathEnds(pathContext: IPath, pathOffset?: IPoint): IPoint[]; + /** + * Calculates the intersection of slopes of two lines. + * + * @param lineA First line to use for slope. + * @param lineB Second line to use for slope. + * @param options Optional IPathIntersectionOptions. + * @returns point of intersection of the two slopes, or null if the slopes did not intersect. + */ + function fromSlopeIntersection(lineA: IPathLine, lineB: IPathLine, options?: IPathIntersectionBaseOptions): IPoint; /** * Get the middle point of a path. * @@ -623,14 +774,6 @@ declare namespace MakerJs.point { * @returns A new point. */ function scale(pointToScale: IPoint, scaleValue: number): IPoint; - /** - * Get a string representation of a point. - * - * @param pointContext The point to serialize. - * @param accuracy Optional exemplar of number of decimal places. - * @returns String representing the point. - */ - function serialize(pointContext: IPoint, accuracy?: number): string; /** * Subtract a point from another point, and return the result as a new point. Shortcut to Add(a, b, subtract = true). * @@ -649,13 +792,12 @@ declare namespace MakerJs.point { } declare namespace MakerJs.path { /** - * Find out if two paths are equal. + * Create a clone of a path. This is faster than cloneObject. * - * @param a First path. - * @param b Second path. - * @returns true if paths are the same, false if they are not + * @param pathToClone The path to clone. + * @returns Cloned path. */ - function areEqual(path1: IPath, path2: IPath, withinPointDistance?: number): boolean; + function clone(pathToClone: IPath): IPath; /** * Create a clone of a path, mirrored on either or both x and y axes. * @@ -679,9 +821,18 @@ declare namespace MakerJs.path { * * @param pathToMove The path to move. * @param delta The x & y adjustments as a point object. + * @param subtract Optional boolean to subtract instead of add. * @returns The original path (for chaining). */ - function moveRelative(pathToMove: IPath, delta: IPoint): IPath; + function moveRelative(pathToMove: IPath, delta: IPoint, subtract?: boolean): IPath; + /** + * Move some paths relatively during a task execution, then unmove them. + * + * @param pathsToMove The paths to move. + * @param deltas The x & y adjustments as a point object array. + * @param task The function to call while the paths are temporarily moved. + */ + function moveTemporary(pathsToMove: IPath[], deltas: IPoint[], task: Function): void; /** * Rotate a path. * @@ -715,11 +866,6 @@ declare namespace MakerJs.path { declare namespace MakerJs.paths { /** * Class for arc path. - * - * @param origin The center point of the arc. - * @param radius The radius of the arc. - * @param startAngle The start angle of the arc. - * @param endAngle The end angle of the arc. */ class Arc implements IPathArc { origin: IPoint; @@ -727,19 +873,71 @@ declare namespace MakerJs.paths { startAngle: number; endAngle: number; type: string; + /** + * Class for arc path, created from origin point, radius, start angle, and end angle. + * + * @param origin The center point of the arc. + * @param radius The radius of the arc. + * @param startAngle The start angle of the arc. + * @param endAngle The end angle of the arc. + */ constructor(origin: IPoint, radius: number, startAngle: number, endAngle: number); + /** + * Class for arc path, created from 2 points, radius, large Arc flag, and clockwise flag. + * + * @param pointA First end point of the arc. + * @param pointB Second end point of the arc. + * @param radius The radius of the arc. + * @param largeArc Boolean flag to indicate clockwise direction. + * @param clockwise Boolean flag to indicate clockwise direction. + */ + constructor(pointA: IPoint, pointB: IPoint, radius: number, largeArc: boolean, clockwise: boolean); + /** + * Class for arc path, created from 2 points and optional boolean flag indicating clockwise. + * + * @param pointA First end point of the arc. + * @param pointB Second end point of the arc. + * @param clockwise Boolean flag to indicate clockwise direction. + */ + constructor(pointA: IPoint, pointB: IPoint, clockwise?: boolean); + /** + * Class for arc path, created from 3 points. + * + * @param pointA First end point of the arc. + * @param pointB Middle point on the arc. + * @param pointC Second end point of the arc. + */ + constructor(pointA: IPoint, pointB: IPoint, pointC: IPoint); } /** * Class for circle path. - * - * @param origin The center point of the circle. - * @param radius The radius of the circle. */ class Circle implements IPathCircle { + type: string; origin: IPoint; radius: number; - type: string; + /** + * Class for circle path, created from origin point and radius. + * + * @param origin The center point of the circle. + * @param radius The radius of the circle. + */ constructor(origin: IPoint, radius: number); + /** + * Class for circle path, created from 2 points. + * + * @param pointA First point on the circle. + * @param pointB Second point on the circle. + */ + constructor(pointA: IPoint, pointB: IPoint); + /** + * Class for circle path, created from 3 points. + * + * @param pointA First point on the circle. + * @param pointB Second point on the circle. + * @param pointC Third point on the circle. + */ + constructor(pointA: IPoint, pointB: IPoint, pointC: IPoint); } /** * Class for line path. @@ -832,6 +1030,14 @@ declare namespace MakerJs.model { * @returns The original model (for chaining). */ function moveRelative(modelToMove: IModel, delta: IPoint): IModel; + /** + * Prefix the ids of paths in a model. + * + * @param modelToPrefix The model to prefix. + * @param prefix The prefix to prepend on paths ids. + * @returns The original model (for chaining). + */ + function prefixPathIds(modelToPrefix: IModel, prefix: string): IModel; /** * Rotate a model. * @@ -865,6 +1071,15 @@ declare namespace MakerJs.model { * @param callback Callback for each path. */ function walkPaths(modelContext: IModel, callback: IModelPathCallback): void; + /** + * Recursively walk through all paths for a given model. + * + * @param modelContext The model to walk. + * @param pathCallback Callback for each path. + * @param modelCallbackBeforeWalk Callback for each model prior to recursion, which can cancel the recursion if it returns false. + * @param modelCallbackAfterWalk Callback for each model after recursion. + */ + function walk(modelContext: IModel, options: IWalkOptions): void; } declare namespace MakerJs.model { /** @@ -875,7 +1090,7 @@ declare namespace MakerJs.model { * @param farPoint Optional point of reference which is outside the bounds of the modelContext. * @returns Boolean true if the path is inside of the modelContext. */ - function isPathInsideModel(pathContext: IPath, modelContext: IModel, farPoint?: IPoint): boolean; + function isPathInsideModel(pathContext: IPath, modelContext: IModel, pathOffset?: IPoint, farPoint?: IPoint, measureAtlas?: measure.Atlas): boolean; /** * Break a model's paths everywhere they intersect with another path. * @@ -884,7 +1099,7 @@ declare namespace MakerJs.model { */ function breakPathsAtIntersections(modelToBreak: IModel, modelToIntersect?: IModel): void; /** - * Combine 2 models. The models should be originated, and every path within each model should be part of a loop. + * Combine 2 models. * * @param modelA First model to combine. * @param modelB Second model to combine. @@ -896,6 +1111,106 @@ declare namespace MakerJs.model { * @param farPoint Optional point of reference which is outside the bounds of both models. */ function combine(modelA: IModel, modelB: IModel, includeAInsideB?: boolean, includeAOutsideB?: boolean, includeBInsideA?: boolean, includeBOutsideA?: boolean, options?: ICombineOptions): void; + /** + * Combine 2 models, resulting in a intersection. + * + * @param modelA First model to combine. + * @param modelB Second model to combine. + */ + function combineIntersection(modelA: IModel, modelB: IModel): void; + /** + * Combine 2 models, resulting in a subtraction of B from A. + * + * @param modelA First model to combine. + * @param modelB Second model to combine. + */ + function combineSubtraction(modelA: IModel, modelB: IModel): void; + /** + * Combine 2 models, resulting in a union. + * + * @param modelA First model to combine. + * @param modelB Second model to combine. + */ + function combineUnion(modelA: IModel, modelB: IModel): void; +} +declare namespace MakerJs { + /** + * Compare keys to see if they are equal. + */ + interface ICollectionKeyComparer { + (a: K, b: K): boolean; + } + /** + * A collection for items that share a common key. + */ + interface ICollection { + key: K; + items: T[]; + } + /** + * Collects items that share a common key. + */ + class Collector { + private comparer; + collections: ICollection[]; + constructor(comparer?: ICollectionKeyComparer); + addItemToCollection(key: K, item: T): void; + findCollection(key: K, action?: (index: number) => void): T[]; + removeCollection(key: K): boolean; + removeItemFromCollection(key: K, item: T): boolean; + getCollectionsOfMultiple(cb: (key: K, items: T[]) => void): void; + } +} +declare namespace MakerJs.model { + /** + * Simplify a model's paths by reducing redundancy: combine multiple overlapping paths into a single path. The model must be originated. + * + * @param modelContext The originated model to search for similar paths. + * @param options Optional options object. + * @returns The simplified model (for chaining). + */ + function simplify(modelToSimplify: IModel, options?: ISimplifyOptions): IModel; +} +declare namespace MakerJs.path { + /** + * Expand path by creating a model which surrounds it. + * + * @param pathToExpand Path to expand. + * @param expansion Distance to expand. + * @param isolateCaps Optional flag to put the end caps into a separate model named "caps". + * @returns Model which surrounds the path. + */ + function expand(pathToExpand: IPath, expansion: number, isolateCaps?: boolean): IModel; + /** + * Represent an arc using straight lines. + * + * @param arc Arc to straighten. + * @param bevel Optional flag to bevel the angle to prevent it from being too sharp. + * @param prefix Optional prefix to apply to path ids. + * @returns Model of straight lines with same endpoints as the arc. + */ + function straighten(arc: IPathArc, bevel?: boolean, prefix?: string): IModel; +} +declare namespace MakerJs.model { + /** + * Expand all paths in a model, then combine the resulting expansions. + * + * @param modelToExpand Model to expand. + * @param distance Distance to expand. + * @param joints Number of points at a joint between paths. Use 0 for round joints, 1 for pointed joints, 2 for beveled joints. + * @returns Model which surrounds the paths of the original model. + */ + function expandPaths(modelToExpand: IModel, distance: number, joints?: number, combineOptions?: ICombineOptions): IModel; + /** + * Outline a model by a specified distance. Useful for accommodating for kerf. + * + * @param modelToOutline Model to outline. + * @param distance Distance to outline. + * @param joints Number of points at a joint between paths. Use 0 for round joints, 1 for pointed joints, 2 for beveled joints. + * @param inside Optional boolean to draw lines inside the model instead of outside. + * @returns Model which surrounds the paths outside of the original model. + */ + function outline(modelToOutline: IModel, distance: number, joints?: number, inside?: boolean): IModel; } declare namespace MakerJs.units { /** @@ -909,12 +1224,48 @@ declare namespace MakerJs.units { } declare namespace MakerJs.measure { /** - * Total angle of an arc between its start and end angles. + * Find out if two angles are equal. * - * @param arc The arc to measure. - * @returns Angle of arc. + * @param angleA First angle. + * @param angleB Second angle. + * @returns true if angles are the same, false if they are not */ - function arcAngle(arc: IPathArc): number; + function isAngleEqual(angleA: number, angleB: number, accuracy?: number): boolean; + /** + * Find out if two paths are equal. + * + * @param pathA First path. + * @param pathB Second path. + * @returns true if paths are the same, false if they are not + */ + function isPathEqual(pathA: IPath, pathB: IPath, withinPointDistance?: number, pathAOffset?: IPoint, pathBOffset?: IPoint): boolean; + /** + * Find out if two points are equal. + * + * @param a First point. + * @param b Second point. + * @returns true if points are the same, false if they are not + */ + function isPointEqual(a: IPoint, b: IPoint, withinDistance?: number): boolean; + /** + * Check for slope equality. + * + * @param slopeA The ISlope to test. + * @param slopeB The ISlope to check for equality. + * @returns Boolean true if slopes are equal. + */ + function isSlopeEqual(slopeA: ISlope, slopeB: ISlope): boolean; +} +declare namespace MakerJs.measure { + /** + * Increase a measurement by an additional measurement. + * + * @param baseMeasure The measurement to increase. + * @param addMeasure The additional measurement. + * @param addOffset Optional offset point of the additional measurement. + * @returns The increased original measurement (for chaining). + */ + function increase(baseMeasure: IMeasure, addMeasure: IMeasure): IMeasure; /** * Check for arc being concave or convex towards a given point. * @@ -923,16 +1274,25 @@ declare namespace MakerJs.measure { * @returns Boolean true if arc is concave towards point. */ function isArcConcaveTowardsPoint(arc: IPathArc, towardsPoint: IPoint): boolean; + /** + * Check for arc overlapping another arc. + * + * @param arcA The arc to test. + * @param arcB The arc to check for overlap. + * @param excludeTangents Boolean to exclude exact endpoints and only look for deep overlaps. + * @returns Boolean true if arc1 is overlapped with arcB. + */ + function isArcOverlapping(arcA: IPathArc, arcB: IPathArc, excludeTangents: boolean): boolean; /** * Check if a given number is between two given limits. * * @param valueInQuestion The number to test. - * @param limit1 First limit. - * @param limit2 Second limit. + * @param limitA First limit. + * @param limitB Second limit. * @param exclusive Flag to exclude equaling the limits. * @returns Boolean true if value is between (or equal to) the limits. */ - function isBetween(valueInQuestion: number, limit1: number, limit2: number, exclusive: boolean): boolean; + function isBetween(valueInQuestion: number, limitA: number, limitB: number, exclusive: boolean): boolean; /** * Check if a given angle is between an arc's start and end angles. * @@ -951,6 +1311,27 @@ declare namespace MakerJs.measure { * @returns Boolean true if point is between (or equal to) the line's origin and end points. */ function isBetweenPoints(pointInQuestion: IPoint, line: IPathLine, exclusive: boolean): boolean; + /** + * Check for line overlapping another line. + * + * @param lineA The line to test. + * @param lineB The line to check for overlap. + * @param excludeTangents Boolean to exclude exact endpoints and only look for deep overlaps. + * @returns Boolean true if line1 is overlapped with lineB. + */ + function isLineOverlapping(lineA: IPathLine, lineB: IPathLine, excludeTangents: boolean): boolean; + /** + * Check for measurement overlapping another measurement. + * + * @param measureA The measurement to test. + * @param measureB The measurement to check for overlap. + * @returns Boolean true if measure1 is overlapped with measureB. + */ + function isMeasurementOverlapping(measureA: IMeasure, measureB: IMeasure): boolean; + /** + * Gets the slope of a line. + */ + function lineSlope(line: IPathLine): ISlope; /** * Calculates the distance between two points. * @@ -965,7 +1346,7 @@ declare namespace MakerJs.measure { * @param pathToMeasure The path to measure. * @returns object with low and high points. */ - function pathExtents(pathToMeasure: IPath): IMeasure; + function pathExtents(pathToMeasure: IPath, addOffset?: IPoint): IMeasure; /** * Measures the length of a path. * @@ -977,9 +1358,38 @@ declare namespace MakerJs.measure { * Measures the smallest rectangle which contains a model. * * @param modelToMeasure The model to measure. + * @param atlas Optional atlas to save measurements. * @returns object with low and high points. */ - function modelExtents(modelToMeasure: IModel): IMeasure; + function modelExtents(modelToMeasure: IModel, atlas?: measure.Atlas): IMeasure; + /** + * A list of maps of measurements. + * + * @param modelToMeasure The model to measure. + * @param atlas Optional atlas to save measurements. + * @returns object with low and high points. + */ + class Atlas { + modelContext: IModel; + /** + * Flag that models have been measured. + */ + modelsMeasured: boolean; + /** + * Map of model measurements, mapped by routeKey. + */ + modelMap: IMeasureMap; + /** + * Map of path measurements, mapped by routeKey. + */ + pathMap: IMeasureMap; + /** + * Constructor. + * @param modelContext The model to measure. + */ + constructor(modelContext: IModel); + measureModels(): void; + } } declare namespace MakerJs.exporter { /** @@ -1050,12 +1460,12 @@ declare namespace MakerJs.solvers { /** * Solves for the angle of a triangle when you know lengths of 3 sides. * - * @param length1 Length of side of triangle, opposite of the angle you are trying to find. - * @param length2 Length of any other side of the triangle. - * @param length3 Length of the remaining side of the triangle. + * @param lengthA Length of side of triangle, opposite of the angle you are trying to find. + * @param lengthB Length of any other side of the triangle. + * @param lengthC Length of the remaining side of the triangle. * @returns Angle opposite of the side represented by the first parameter. */ - function solveTriangleSSS(length1: number, length2: number, length3: number): number; + function solveTriangleSSS(lengthA: number, lengthB: number, lengthC: number): number; /** * Solves for the length of a side of a triangle when you know length of one side and 2 angles. * @@ -1076,33 +1486,24 @@ declare namespace MakerJs.path { * @returns IPathIntersection object, with points(s) of intersection (and angles, when a path is an arc or circle); or null if the paths did not intersect. */ function intersection(path1: IPath, path2: IPath, options?: IPathIntersectionOptions): IPathIntersection; - /** - * Calculates the intersection of slopes of two lines. - * - * @param line1 First line to use for slope. - * @param line2 Second line to use for slope. - * @param options Optional IPathIntersectionOptions. - * @returns point of intersection of the two slopes, or null if the slopes did not intersect. - */ - function slopeIntersectionPoint(line1: IPathLine, line2: IPathLine, options?: IPathIntersectionOptions): IPoint; } declare namespace MakerJs.path { /** * Adds a round corner to the outside angle between 2 lines. The lines must meet at one point. * - * @param line1 First line to fillet, which will be modified to fit the fillet. - * @param line2 Second line to fillet, which will be modified to fit the fillet. + * @param lineA First line to fillet, which will be modified to fit the fillet. + * @param lineB Second line to fillet, which will be modified to fit the fillet. * @returns Arc path object of the new fillet. */ - function dogbone(line1: IPathLine, line2: IPathLine, filletRadius: number, options?: IPointMatchOptions): IPathArc; + function dogbone(lineA: IPathLine, lineB: IPathLine, filletRadius: number, options?: IPointMatchOptions): IPathArc; /** * Adds a round corner to the inside angle between 2 paths. The paths must meet at one point. * - * @param path1 First path to fillet, which will be modified to fit the fillet. - * @param path2 Second path to fillet, which will be modified to fit the fillet. + * @param pathA First path to fillet, which will be modified to fit the fillet. + * @param pathB Second path to fillet, which will be modified to fit the fillet. * @returns Arc path object of the new fillet. */ - function fillet(path1: IPath, path2: IPath, filletRadius: number, options?: IPointMatchOptions): IPathArc; + function fillet(pathA: IPath, pathB: IPath, filletRadius: number, options?: IPointMatchOptions): IPathArc; } declare namespace MakerJs.kit { /** @@ -1123,22 +1524,15 @@ declare namespace MakerJs.kit { } declare namespace MakerJs.model { /** - * @private + * Find paths that have common endpoints and form chains. + * + * @param modelContext The model to search for chains. + * @param options Optional options object. + * @returns A list of chains. */ - interface IPointMappedItem { - averagePoint: IPoint; - item: T; - } - /** - * @private - */ - class PointMap { - matchingDistance: number; - list: IPointMappedItem[]; - constructor(matchingDistance?: number); - add(pointToAdd: IPoint, item: T): void; - find(pointToFind: IPoint, saveAverage: boolean): T; - } + function findChains(modelContext: IModel, callback: IChainCallback, options?: IFindChainsOptions): void; +} +declare namespace MakerJs.model { /** * Find paths that have common endpoints and form loops. * @@ -1153,7 +1547,14 @@ declare namespace MakerJs.model { * @param loopToDetach The model to search for loops. */ function detachLoop(loopToDetach: IModel): void; - function removeDeadEnds(modelContext: IModel, pointMatchingDistance?: number): void; + /** + * Remove paths from a model which have endpoints that do not connect to other paths. + * + * @param modelContext The model to search for dead ends. + * @param options Optional options object. + * @returns The input model (for chaining). + */ + function removeDeadEnds(modelContext: IModel, pointMatchingDistance?: number): IModel; } declare namespace MakerJs.exporter { /** @@ -1249,6 +1650,37 @@ declare namespace MakerJs.exporter { } } declare namespace MakerJs.exporter { + /** + * Injects drawing into a PDFKit document. + * + * @param modelToExport Model object to export. + * @param options Export options object. + * @returns String of PDF file contents. + */ + function toPDF(doc: PDFKit.PDFDocument, modelToExport: IModel, options?: IPDFRenderOptions): void; + /** + * PDF rendering options. + */ + interface IPDFRenderOptions extends IExportOptions { + /** + * Rendered reference origin. + */ + origin?: IPoint; + /** + * SVG color of the rendered paths. + */ + stroke?: string; + } +} +declare namespace MakerJs.exporter { + /** + * Convert a chain to SVG path data. + */ + function chainToSVGPathData(chain: IChain, offset: IPoint): string; + /** + * Convert a path to SVG path data. + */ + function pathToSVGPathData(pathToExport: IPath, offset: IPoint, offset2: IPoint): string; function toSVG(modelToExport: IModel, options?: ISVGRenderOptions): string; function toSVG(pathsToExport: IPath[], options?: ISVGRenderOptions): string; function toSVG(pathToExport: IPath, options?: ISVGRenderOptions): string; @@ -1273,6 +1705,10 @@ declare namespace MakerJs.exporter { * Optional attributes to add to the root svg tag. */ svgAttrs?: IXmlTagAttrs; + /** + * SVG fill color. + */ + fill?: string; /** * SVG font size and font size units. */ @@ -1314,9 +1750,11 @@ declare namespace MakerJs.models { } } declare namespace MakerJs.models { - class Polygon extends ConnectTheDots { - constructor(numberOfSides: number, radius: number, firstCornerAngleInDegrees?: number); - static getPoints(numberOfSides: number, radius: number, firstCornerAngleInDegrees?: number): IPoint[]; + class Polygon implements IModel { + paths: IPathMap; + constructor(numberOfSides: number, radius: number, firstCornerAngleInDegrees?: number, circumscribed?: boolean); + static circumscribedRadius(radius: number, angleInRadians: number): number; + static getPoints(numberOfSides: number, radius: number, firstCornerAngleInDegrees?: number, circumscribed?: boolean): IPoint[]; } } declare namespace MakerJs.models { @@ -1344,19 +1782,24 @@ declare namespace MakerJs.models { } } declare namespace MakerJs.models { - class Oval extends RoundRectangle { + class Oval implements IModel { + paths: IPathMap; constructor(width: number, height: number); } } declare namespace MakerJs.models { class OvalArc implements IModel { paths: IPathMap; - constructor(startAngle: number, endAngle: number, sweepRadius: number, slotRadius: number, selfIntersect?: boolean); + models: IModelMap; + constructor(startAngle: number, endAngle: number, sweepRadius: number, slotRadius: number, selfIntersect?: boolean, isolateCaps?: boolean); } } declare namespace MakerJs.models { - class Rectangle extends ConnectTheDots { + class Rectangle implements IModel { + paths: IPathMap; + origin: IPoint; constructor(width: number, height: number); + constructor(measurement: IMeasure); } } declare namespace MakerJs.models { @@ -1375,11 +1818,13 @@ declare namespace MakerJs.models { class Slot implements IModel { paths: IPathMap; origin: IPoint; - constructor(origin: IPoint, endPoint: IPoint, radius: number); + models: IModelMap; + constructor(origin: IPoint, endPoint: IPoint, radius: number, isolateCaps?: boolean); } } declare namespace MakerJs.models { - class Square extends Rectangle { + class Square implements IModel { + paths: IPathMap; constructor(side: number); } } diff --git a/material-design-lite/material-design-lite-tests.ts b/material-design-lite/material-design-lite-tests.ts new file mode 100644 index 0000000000..afbf5faf15 --- /dev/null +++ b/material-design-lite/material-design-lite-tests.ts @@ -0,0 +1,38 @@ +// Test file for Google Maps JavaScript API Definition file +/// + +componentHandler.upgradeDom(); +componentHandler.upgradeDom('MaterialButton'); +componentHandler.upgradeDom('MaterialButton', 'mdl-button'); + +componentHandler.upgradeElement(document.createElement('div')); +componentHandler.upgradeElement(document.getElementById('id')); +componentHandler.upgradeElement(document.getElementsByTagName('button')[0], 'MaterialButton'); + +componentHandler.upgradeElements(document.getElementsByTagName('div')); +componentHandler.upgradeElements([document.createElement('div')]); +componentHandler.upgradeElements(document.querySelectorAll('div.mdl-button')); + +componentHandler.upgradeAllRegistered(); + +componentHandler.registerUpgradedCallback('MaterialButton', function(element : HTMLElement) {}); + +componentHandler.register({ + constructor: function(element: HTMLElement) {}, + classAsString: 'MaterialCheese', + cssClass: 'mdl-cheese' +}); +componentHandler.register({ + constructor: function(element: HTMLElement) {}, + classAsString: 'MaterialFoo', + cssClass: 'mdl-foo', + widget: true +}); +componentHandler.register({ + constructor: function(element: HTMLElement) {}, + classAsString: 'MaterialFoo', + cssClass: 'mdl-foo', + widget: 'FooBar' +}); + +componentHandler.downgradeElements(document.querySelectorAll('div')); diff --git a/material-design-lite/material-design-lite.d.ts b/material-design-lite/material-design-lite.d.ts new file mode 100644 index 0000000000..11b93ea792 --- /dev/null +++ b/material-design-lite/material-design-lite.d.ts @@ -0,0 +1,128 @@ +// Type definitions for material-design-lite v1.1.3 +// Project: https://getmdl.io +// Definitions by: Brad Zacher +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare module MaterialDesignLite { + interface ComponentHandler { + /** + * Searches existing DOM for elements of our component type and upgrades them + * if they have not already been upgraded. + */ + upgradeDom() : void; + /** + * Searches existing DOM for elements of our component type and upgrades them + * if they have not already been upgraded. + * + * @param {string} jsClass the programatic name of the element class we + * need to create a new instance of. + */ + upgradeDom(jsClass : string) : void; + /** + * Searches existing DOM for elements of our component type and upgrades them + * if they have not already been upgraded. + * + * @param {string} jsClass the programatic name of the element class we + * need to create a new instance of. + * @param {string} cssClass the name of the CSS class elements of this + * type will have. + */ + upgradeDom(jsClass : string, cssClass : string) : void; + + /** + * Upgrades a specific element rather than all in the DOM. + * + * @param {!Element} element The element we wish to upgrade. + */ + upgradeElement(element : HTMLElement) : void; + /** + * Upgrades a specific element rather than all in the DOM. + * + * @param {!Element} element The element we wish to upgrade. + * @param {string} jsClass Optional name of the class we want to upgrade + * the element to. + */ + upgradeElement(element : HTMLElement, jsClass : string) : void; + + /** + * Upgrades a specific list of elements rather than all in the DOM. + * + * @param {!Element} elements + * The elements we wish to upgrade. + */ + upgradeElements(elements : HTMLElement) : void; + /** + * Upgrades a specific list of elements rather than all in the DOM. + * + * @param {!Array} elements + * The elements we wish to upgrade. + */ + upgradeElements(elements : Array) : void; + /** + * Upgrades a specific list of elements rather than all in the DOM. + * + * @param {!NodeList} elements + * The elements we wish to upgrade. + */ + upgradeElements(elements : NodeList) : void; + /** + * Upgrades a specific list of elements rather than all in the DOM. + * + * @param {!HTMLCollection} elements + * The elements we wish to upgrade. + */ + upgradeElements(elements : HTMLCollection) : void; + + /** + * Upgrades all registered components found in the current DOM. This is + * automatically called on window load. + */ + upgradeAllRegistered() : void; + + /** + * Allows user to be alerted to any upgrades that are performed for a given + * component type + * + * @param {string} jsClass The class name of the MDL component we wish + * to hook into for any upgrades performed. + * @param {function(!HTMLElement)} callback The function to call upon an + * upgrade. This function should expect 1 parameter - the HTMLElement which + * got upgraded. + */ + registerUpgradedCallback(jsClass : string, callback : (element : HTMLElement) => any) : void; + + /** + * Registers a class for future use and attempts to upgrade existing DOM. + * + * @param {componentHandler.ComponentConfigPublic} config the registration configuration + */ + register(config : ComponentConfigPublic) : void; + + /** + * Downgrade either a given node, an array of nodes, or a NodeList. + * + * @param {!Node} nodes The list of nodes. + */ + downgradeElements(nodes : Node) : void; + /** + * Downgrade either a given node, an array of nodes, or a NodeList. + * + * @param {!Array} nodes The list of nodes. + */ + downgradeElements(nodes : Array) : void; + /** + * Downgrade either a given node, an array of nodes, or a NodeList. + * + * @param {!NodeList} nodes The list of nodes. + */ + downgradeElements(nodes : NodeList) : void; + } + interface ComponentConfigPublic { + constructor(element : HTMLElement) : void; + classAsString : string; + cssClass : string; + widget? : string | boolean; + } +} + +declare var componentHandler : MaterialDesignLite.ComponentHandler; \ No newline at end of file diff --git a/material-ui/material-ui.d.ts b/material-ui/material-ui.d.ts index 36e43a6e78..970387459f 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>; @@ -1434,7 +1434,7 @@ declare namespace __MaterialUI { autoHideDuration?: number; bodyStyle?: React.CSSProperties; className?: string; - message: string; + message: string | JSX.Element; onActionTouchTap?: React.TouchEventHandler; /** @deprecated Use the open property to control the component instead */ onDismiss?: () => void; // DEPRECATED @@ -1587,18 +1587,20 @@ declare namespace __MaterialUI { export class Tabs extends React.Component { } - interface TabProps extends React.Props { + interface TabProps extends SharedEnhancedButtonProps { className?: string; icon?: React.ReactNode; label?: React.ReactNode; onActive?: (tab: Tab) => void; - onTouchTap?: (value: any, e: TouchTapEvent, tab: Tab) => void; + onTouchTap?: (value: any, e?: TouchTapEvent, tab?: Tab) => void; selected?: boolean; style?: React.CSSProperties; value?: any; width?: string; + disabled?: boolean; } - export class Tab extends React.Component { + export class Tab extends React.Component< + TabProps, {}> { } } diff --git a/mathjs/mathjs.d.ts b/mathjs/mathjs.d.ts index e9c15e1817..f21c192bb9 100644 --- a/mathjs/mathjs.d.ts +++ b/mathjs/mathjs.d.ts @@ -2208,3 +2208,8 @@ declare namespace mathjs { toString(): string; } } + +declare module 'mathjs'{ + export = math; +} + diff --git a/md5/md5-tests.ts b/md5/md5-tests.ts index 360bb4b382..16e4ad35df 100644 --- a/md5/md5-tests.ts +++ b/md5/md5-tests.ts @@ -1,9 +1,33 @@ /// +/// +import fs =require("fs"); +import md5 = require("md5"); +/** + * API + * md5(message) + * message -- String or Buffer + * returns String + * + * Usage + **************************************************** + * var md5 = require('md5'); * + * console.log(md5('message')); * + **************************************************** + * This will print the following + * 78e731027d8fd50ed642340b7c9a63b3 + * + * It supports buffers, too + **************************************************** + * var fs = require('fs'); * + * var md5 = require('md5'); * + * * + * fs.readFile('example.txt', function(err, buf) { * + * console.log(md5(buf)); * + * }); * + * ************************************************** + */ +console.log(md5('message')); // should print 78e731027d8fd50ed642340b7c9a63b3 -var hash: string; -hash = CybozuLabs.MD5.calc("abc"); -hash = CybozuLabs.MD5.calc("abc", CybozuLabs.MD5.BY_ASCII); -hash = CybozuLabs.MD5.calc("abc", CybozuLabs.MD5.BY_UTF16); - -var version: string; -version = CybozuLabs.MD5.VERSION; \ No newline at end of file +fs.readFile('md5.d.ts', function(err: Error, buf: Buffer) { + console.log(md5(buf)); +}); \ No newline at end of file diff --git a/md5/md5.d.ts b/md5/md5.d.ts index 6e1f31739d..47529718a1 100644 --- a/md5/md5.d.ts +++ b/md5/md5.d.ts @@ -1,11 +1,16 @@ -// Type definitions for CybozuLabs.MD5 -// Project: http://labs.cybozu.co.jp/blog/mitsunari/2007/07/md5js_1.html -// Definitions by: MIZUNE Pine +// Type definitions for md5 v2.1.0 +// Project: https://github.com/pvorb/node-md5 +// Definitions by: Bill Sourour // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -declare namespace CybozuLabs.MD5 { - var VERSION: string; - var BY_ASCII: number; - var BY_UTF16: number; - function calc(str: string, option?: number): string; +/// +declare module 'md5' { +/** + * js function for hashing messages with MD5 + * + * @param {(string | Buffer)} message - a string or buffer to hash + * @returns {string} the resultant MD5 hash of the given message + */ + function main(message: string | Buffer): string; + export = main; } diff --git a/meteor/meteor.d.ts b/meteor/meteor.d.ts index fc89e8b4a4..7f17984e2d 100644 --- a/meteor/meteor.d.ts +++ b/meteor/meteor.d.ts @@ -582,6 +582,7 @@ declare namespace Meteor { var isDevelopment: boolean; var isProduction: boolean; var isServer: boolean; + var isTest: boolean; function loggingIn(): boolean; function loginWith(options?: { requestPermissions?: string[]; 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/mithril/mithril-tests.ts b/mithril/mithril-tests.ts index be5832a40d..a7d065f144 100644 --- a/mithril/mithril-tests.ts +++ b/mithril/mithril-tests.ts @@ -52,4 +52,4 @@ var todo = { }; //initialize the application -m.module(document, todo); +m.mount(document, todo); diff --git a/mithril/mithril.d.ts b/mithril/mithril.d.ts index b4e9dd5a54..d1c2ba78a6 100644 --- a/mithril/mithril.d.ts +++ b/mithril/mithril.d.ts @@ -3,175 +3,860 @@ // Definitions by: Leo Horie , Chris Bowdon // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -//Mithril type definitions for Typescript +// Mithril type definitions for Typescript -declare module _mithril { - interface MithrilStatic { +/** +* This is the module containing all the types/declarations/etc. for Mithril +*/ +declare namespace Mithril { + interface ChildArray extends Array {} + type Children = Child | ChildArray; + type Child = string | VirtualElement | Component; - (selector: string, attributes: MithrilAttributes, ...children: Array>): MithrilVirtualElement; - (selector: string, ...children: Array>): MithrilVirtualElement; + interface Static { + /** + * Creates a virtual element for use with m.render, m.mount, etc. + * + * @param selector A simple CSS selector. May include SVG tags. Nested + * selectors are not supported. + * @param attributes Attributes to add. Any DOM attribute may be used + * as an attribute, although innerHTML and the like may be overwritten + * silently. + * @param children Child elements, components, and text to add. + * @return A virtual element. + * + * @see m.render + * @see m.mount + * @see m.component + */ + ( + selector: string, + ...children: Children[] + ): VirtualElement; - prop(promise: MithrilPromise) : MithrilPromiseProperty; - prop(value: T): MithrilProperty; - prop(): MithrilProperty; // might be that this should be Property + /** + * Creates a virtual element for use with m.render, m.mount, etc. + * + * @param selector A simple CSS selector. May include SVG tags. Nested + * selectors are not supported. + * @param attributes Attributes to add. Any DOM attribute may be used + * as an attribute, although innerHTML and the like may be overwritten + * silently. + * @param children Child elements, components, and text to add. + * @return A virtual element. + * + * @see m.render + * @see m.mount + * @see m.component + */ + ( + selector: string, + attributes: Attributes, + ...children: Children[] + ): VirtualElement; - withAttr(property: string, callback: (value: any) => void): (e: MithrilEvent) => any; + /** + * Initializes a component for use with m.render, m.mount, etc. + * + * @param component A component. + * @param args Arguments to optionally pass to the component. + * @return A component. + * + * @see m.render + * @see m.mount + * @see m + */ + ( + component: Component, + ...args: any[] + ): Component; - module(rootElement: Node, component: MithrilComponent): T; - module(rootElement: Node): T; - mount(rootElement: Node, component: MithrilComponent): T; - mount(rootElement: Node): T; + /** + * Creates a getter-setter function that wraps a Mithril promise. Useful + * for uniform data access, m.withAttr, etc. + * + * @param promise A thennable to initialize the property with. It may + * optionally be a Mithril promise. + * @return A getter-setter function wrapping the promise. + * + * @see m.withAttr + */ + prop(promise: Thennable) : Promise; - component(component: MithrilComponent, ...args: Array): MithrilComponent - - trust(html: string): string; + /** + * Creates a getter-setter function that wraps a simple value. Useful + * for uniform data access, m.withAttr, etc. + * + * @param value A value to initialize the property with + * @return A getter-setter function wrapping the value. + * + * @see m.withAttr + */ + prop(value: T): BasicProperty; - render(rootElement: Element|HTMLDocument): void; - render(rootElement: Element|HTMLDocument, children: MithrilVirtualElement, forceRecreation?: boolean): void; - render(rootElement: Element|HTMLDocument, children: MithrilVirtualElement[], forceRecreation?: boolean): void; + /** + * Creates a getter-setter function that wraps a simple value. Useful + * for uniform data access, m.withAttr, etc. + * + * @return A getter-setter function wrapping the value. + * + * @see m.withAttr + */ + prop(): BasicProperty; + + /** + * Returns a event handler that can be bound to an element, firing with + * the specified property. + * + * @param property The property to get from the event. + * @param callback The handler to use the value from the event. + * @return A function suitable for listening to an event. + */ + withAttr( + property: string, + callback: (value: any) => any, + callbackThis?: any + ): (e: Event) => void; + + /** + * @deprecated Use m.mount instead + */ + module( + rootElement: Node, + component: Component + ): T; + + /** + * Mounts a component to a base DOM node. + * + * @param rootElement The base node. + * @param component The component to mount. + * @return An instance of the top-level component's controller + */ + mount( + rootElement: Node, + component: Component + ): T; + + /** + * Initializes a component for use with m.render, m.mount, etc. + * + * @param selector A component. + * @param args Arguments to optionally pass to the component. + * @return A component. + * + * @see m.render + * @see m.mount + * @see m + */ + component( + component: Component, + ...args: any[] + ): Component; + + /** + * Trust this string of HTML. + * + * @param html The HTML to trust + * @return A String object instance with an added internal flag to mark + * it as trusted. + */ + trust(html: string): TrustedString; + + /** + * Render a virtual DOM tree. + * + * @param rootElement The base element/node to render the tree from. + * @param children One or more child nodes to add to the tree. + * @param forceRecreation If true, overwrite the entire tree without + * diffing against it. + */ + render( + rootElement: Element, + children: VirtualElement|VirtualElement[], + forceRecreation?: boolean + ): void; redraw: { + /** + * Force a redraw the active component. It redraws asynchronously by + * default to allow for simultaneous events to run before redrawing, + * such as the event combination keypress + input frequently used for + * input. + * + * @param force If true, redraw synchronously. + */ (force?: boolean): void; - strategy: MithrilProperty; + + /** + * Gets/sets the current redraw strategy, which returns one of the + * following: + * + * "all" - recreates the DOM tree from scratch + * "diff" - recreates the DOM tree from scratch + * "none" - leaves the DOM tree intact + * + * This is useful for event handlers, which may want to cancel + * the next redraw if the event doesn't update the UI. + * + * @return The current strategy + */ + strategy: BasicProperty<"all" | "diff" | "none">; } route: { - (rootElement: HTMLDocument, defaultRoute: string, routes: MithrilRoutes): void; - (rootElement: Element, defaultRoute: string, routes: MithrilRoutes): void; + /** + * Enable routing, mounting a controller based on the route. It + * automatically mounts the components for you, starting with the one + * specified by the default route. + * + * @param rootElement The element to mount the active controller to. + * @param defaultRoute The route to start with. + * @param routes A key-value mapping of pathname to controller. + */ + ( + rootElement: Element, + defaultRoute: string, + routes: Routes + ): void; - (element: Element, isInitialized: boolean, context: Object, vdom: Object): void; + /** + * This allows m.route to be used as the `config` attribute for a + * virtual element, particularly useful for cases like this: + * + * ```ts + * // Note that the '#' is not required in `href`, thanks to the + * `config` setting. + * m("a[href='/dashboard/alicesmith']", {config: m.route}); + * ``` + */ + ( + element: Element, + isInitialized: boolean, + context?: Context, + vdom?: VirtualElement + ): void; + + /** + * Programmatically redirect to another route. + * + * @param path The route to go to. + * @param params Parameters to pass as a query string. + * @param shouldReplaceHistory Whether to replace the current history + * instead of adding a new one. + */ (path: string, params?: any, shouldReplaceHistory?: boolean): void; + + /** + * Gets the current route. + * + * @return The current route. + */ (): string; + /** + * Gets a route parameter. + * + * @param key The key to get. + * @return The value associated with the parameter key. + */ param(key: string): string; - mode: string; - buildQueryString(data: Object): String - parseQueryString(data: String): Object + + /** + * The current routing mode. This may be changed before calling + * m.route to change the part of the URL used to perform the routing. + * + * The value can be set to one of the following, defaulting to + * "hash": + * + * "search" - Uses the query string. This allows for named anchors to + * work on the page, but changes cause IE8 and lower to refresh the + * page. + * + * "hash" - Uses the hash. This is the only routing mode that does + * not cause page refreshes on any browser, but it does not support + * named anchors. + * + * "pathname" - Uses the URL pathname. This requires server-side + * setup to support bookmarking and page refreshes. It always causes + * page refreshes on IE8 and lower. Note that this requires that the + * application to be run from the root of the URL. + */ + mode: "search" | "hash" | "pathname"; + + /** + * Serialize an object into a query string. + * + * @param data The data to serialize. + * @return The serialized string. + */ + buildQueryString(data: Object): string; + + /** + * Parse a query string into an object. + * + * @param data The data to parse. + * @return The parsed object data. + */ + parseQueryString(data: string): Object; } - request(options: MithrilXHROptions): MithrilPromise; + /** + * Send an XHR request to a server. Note that the `url` option is + * required. + * + * @param options The options to use for the request. + * @return A promise to the returned data, or void if not applicable. + * + * @see XHROptions for the available options. + */ + request(options: XHROptions): Promise + + /** + * Send a JSONP request to a server. Note that the `url` option is + * required. + * + * @param options The options to use + * @return A promise to the returned data. + * + * @see JSONPOptions for the available options. + */ + request(options: JSONPOptions): Promise; deferred: { + /** + * Create a Mithril deferred object. It behaves synchronously if + * possible, an intentional deviation from Promises/A+. Note that + * deferreds are completely separate from the redrawing system, and + * never trigger a redraw on their own. + * + * @return A new Mithril deferred instance. + * + * @see m.deferred.onerror for the error callback called for Error + * subclasses + */ + (): Deferred; + + /** + * A callback for all uncaught native Error subclasses in deferreds. + * This defaults to synchronously rethrowing all errors, a deviation + * from Promises/A+, but the behavior is configurable. To restore + * Promises/A+-compatible behavior. simply set this to a no-op. + */ onerror(e: Error): void; - (): MithrilDeferred; } - sync(promises: MithrilPromise[]): MithrilPromise; + /** + * Takes a list of promises or thennables and returns a Mithril promise + * that resolves once all in the list are resolved, or rejects if any of + * them reject. + * + * @param promises A list of promises to try to resolve. + * @return A promise that resolves to all the promises if all resolve, or + * rejects with the error contained in the first rejection. + */ + sync(promises: Thennable[]): Promise; + /** + * Use this and endComputation if your views aren't redrawing after + * calls to third-party libraries. For integrating asynchronous code, + * this should be called before any asynchronous work is done. For + * synchronous code, this should be called at the beginning of the + * problematic segment. Note that these calls must be balanced, much like + * braces and parentheses. This is mostly used internally. Prefer + * m.redraw where possible, especially when making repeated calls. + * + * @see endComputation + * @see m.render + */ startComputation(): void; + + /** + * Use startComputation and this if your views aren't redrawing after + * calls to third-party libraries. For integrating asynchronous code, + * this should be called after all asynchronous work completes. For + * synchronous code, this should be called at the end of the problematic + * segment. Note that these calls must be balanced, much like braces and + * parentheses. This is mostly used internally. Prefer m.redraw where + * possible, especially when making repeated calls. + * + * @see startComputation + * @see m.render + */ endComputation(): void; - // For test suite - deps: { - (mockWindow: Window): Window; - factory: Object; - } - + /** + * This overwrites the internal version of window used by Mithril. + * It's mostly useful for testing, and is also used internally by + * Mithril to test itself. By default Mithril uses `window` for the + * dependency. + * + * @param mockWindow The mock to use for the window. + * @return The mock that was passed in. + */ + deps(mockWindow: Window): Window; } - export interface MithrilVirtualElement { - key?: number; - tag?: string; - attrs?: MithrilAttributes; - children?: any[]; + interface TrustedString extends String { + /** @private Implementation detail. Don't depend on it. */ + $trusted: boolean; } - // Configuration function for an element - interface MithrilElementConfig { - (element: Element, isInitialized: boolean, context?: any, vdom?: MithrilVirtualElement): void; + /** + * The interface for a virtual element. It's best to consider this immutable + * for most use cases. + * + * @see m + */ + interface VirtualElement { + /** + * The tag name of this element. + */ + tag: string; + + /** + * The attributes of this element. + */ + attrs: Attributes; + + /** + * The children of this element. + */ + children: Children[]; } - // Attributes on a virtual element - interface MithrilAttributes { - title?: string; + /** + * An event passed by Mithril to unload event handlers. + */ + interface Event { + /** + * Prevent the default behavior of scrolling the page and updating the + * URL on next route change. + */ + preventDefault(): void; + } + + /** + * A context object for configuration functions. + * + * @see ElementConfig + */ + interface Context { + /** + * A function to call when the node is unloaded. Useful for cleanup. + */ + onunload?(): any; + + /** + * Set true if the backing DOM node needs to be retained between route + * changes if possible. Set false if this node needs to be recreated + * every single time, regardless of how "different" it is. + */ + retain?: boolean; + } + + /** + * This represents a callback function for a virtual element's config + * attribute. It's a low-level function useful for extra cleanup after + * removal from the tree, storing instances of third-party classes that + * need to be associated with the DOM, etc. + * + * @see Attributes + * @see Context + */ + interface ElementConfig { + /** + * A callback function for a virtual element's config attribute. + * + * @param element The associated DOM element. + * @param isInitialized Whether this is the first call for the virtual + * element or not. + * @param context The associated context for this element. + * @param vdom The associated virtual element. + */ + ( + element: Element, + isInitialized: boolean, + context: Context, + vdom: VirtualElement + ): void; + } + + /** + * This represents the attributes available for configuring virtual elements, + * beyond the applicable DOM attributes. + * + * @see m + */ + interface Attributes { + /** + * The class name(s) for this virtual element, as a space-separated list. + */ className?: string; + + /** + * The class name(s) for this virtual element, as a space-separated list. + */ class?: string; - config?: MithrilElementConfig; + + /** + * A custom, low-level configuration in case this element needs special + * cleanup after removal from the tree. + * + * @see ElementConfig + */ + config?: ElementConfig; + + /** + * A key to optionally associate with this element. + */ + key?: string | number; + + /** + * Any other virtual element properties, including attributes and event + * handlers. + */ + [property: string]: any; } - // Defines the subset of Event that Mithril needs - interface MithrilEvent { - currentTarget: Element; - } - - interface MithrilController { + /** + * The basis of a Mithril controller instance. + */ + interface Controller { + /** + * An optional handler to call when the associated virtual element is + * destroyed. + * + * @param evt An associated event. + */ onunload?(evt: Event): any; } - interface MithrilControllerFunction extends MithrilController { - (): any; + /** + * This represents a controller function. + * + * @see ControllerConstructor + */ + interface ControllerFunction { + (...args: any[]): T; } - interface MithrilView { - (ctrl: T): string|MithrilVirtualElement; + /** + * This represents a controller constructor. + * + * @see ControllerFunction + */ + interface ControllerConstructor { + new (...args: any[]): T; } - interface MithrilComponent { - controller: MithrilControllerFunction|{ new(): T }; - view: MithrilView; + /** + * This represents a Mithril component. + * + * @see m + * @see m.component + */ + interface Component { + /** + * The component's controller. + * + * @see m.component + */ + controller: ControllerFunction | ControllerConstructor; + + /** + * Creates a view out of virtual elements. + * + * @see m.component + */ + view(ctrl?: T, ...args: any[]): VirtualElement; } - interface MithrilProperty { + /** + * This is the base interface for property getter-setters + * + * @see m.prop + */ + interface Property { + /** + * Gets the contained value. + * + * @return The contained value. + */ (): T; + + /** + * Sets the contained value. + * + * @param value The new value to set. + * @return The newly set value. + */ (value: T): T; + } + + /** + * This represents a non-promise getter-setter functions. + * + * @see m.prop which returns objects that implement this interface. + */ + interface BasicProperty extends Property { + /** + * Makes this serializable to JSON. + */ toJSON(): T; } - interface MithrilPromiseProperty extends MithrilPromise { - (): T; - (value: T): T; - toJSON(): T; + /** + * This represents a key-value mapping linking routes to components. + */ + interface Routes { + /** + * The key represents the route. The value represents the corresponding + * component. + */ + [key: string]: Component; } - interface MithrilRoutes { - [key: string]: MithrilComponent; - } - - - interface MithrilDeferred { + /** + * This represents a Mithril deferred object. + */ + interface Deferred { + /** + * Resolve this deferred's promise with a value. + * + * @param value The value to resolve the promise with. + */ resolve(value?: T): void; - reject(value?: any): void; - promise: MithrilPromise; + + /** + * Reject this deferred with an error. + * + * @param value The reason for rejecting the promise. + */ + reject(reason?: any): void; + + /** + * The backing promise. + * + * @see Promise + */ + promise: Promise; } - interface MithrilSuccessCallback { - (value: T): U; - (value: T): MithrilPromise; + /** + * This represents a thennable success callback. + */ + interface SuccessCallback { + (value: T): U | Thennable; } - interface MithrilErrorCallback { - (value: Error): U; - (value: string): U; + /** + * This represents a thennable error callback. + */ + interface ErrorCallback { + (value: Error): T | Thennable; } - interface MithrilPromise { - (): T; - (value: T): T; - then(success: (value: T) => U): MithrilPromise; - then(success: (value: T) => MithrilPromise): MithrilPromise; - then(success: (value: T) => U, error: (value: Error) => V): MithrilPromise|MithrilPromise; - then(success: (value: T) => MithrilPromise, error: (value: Error) => V): MithrilPromise|MithrilPromise; + /** + * This represents a thennable. + */ + interface Thennable { + then(success: SuccessCallback): Thennable; + then(success: SuccessCallback, error: ErrorCallback): Thennable; + catch?(error: ErrorCallback): Thennable; + catch?(error: ErrorCallback): Thennable; } - interface MithrilXHROptions { - method?: string; - url: string; - user?: string; - password?: string; + + /** + * This represents a Mithril promise object. + */ + interface Promise extends Thennable, Property> { + /** + * Chain this promise with a simple success callback, propogating + * rejections. + * + * @param success The callback to call when the promise is resolved. + * @return The chained promise. + */ + then(success: SuccessCallback): Promise; + + /** + * Chain this promise with a success callback and error callback, without + * propogating rejections. + * + * @param success The callback to call when the promise is resolved. + * @param error The callback to call when the promise is rejected. + * @return The chained promise. + */ + then(success: SuccessCallback, error: ErrorCallback): Promise; + + /** + * Chain this promise with a single error callback, without propogating + * rejections. + * + * @param error The callback to call when the promise is rejected. + * @return The chained promise. + */ + catch(error: ErrorCallback): Promise; + } + + /** + * These are the common options shared across normal and JSONP requests. + * + * @see m.request + */ + interface RequestOptions { + /** + * The data to be sent. It's automatically serialized in the right format + * depending on the method (with exception of HTML5 FormData), and put in + * the appropriate section of the request. + */ data?: any; + + /** + * Whether to run it in the background, i.e. true if it doesn't affect + * template rendering. + */ background?: boolean; + + /** + * Set an initial value while the request is working, to populate the + * promise getter-setter. + */ + initialValue?: any; + + /** + * An optional preprocessor function to unwrap a successful response, in + * case the response contains metadata wrapping the data. + * + * @param data The data to unwrap. + * @return The unwrapped result. + */ unwrapSuccess?(data: any): any; + + /** + * An optional preprocessor function to unwrap an unsuccessful response, + * in case the response contains metadata wrapping the data. + * + * @param data The data to unwrap. + * @return The unwrapped result. + */ unwrapError?(data: any): any; + + /** + * An optional function to serialize the data. This defaults to + * `JSON.stringify`. + * + * @param dataToSerialize The data to serialize. + * @return The serialized form as a string. + */ serialize?(dataToSerialize: any): string; + + /** + * An optional function to deserialize the data. This defaults to + * `JSON.parse`. + * + * @param dataToSerialize The data to parse. + * @return The parsed form. + */ deserialize?(dataToDeserialize: string): any; - extract?(xhr: XMLHttpRequest, options: MithrilXHROptions): string; - type?(data: Object): void; - config?(xhr: XMLHttpRequest, options: MithrilXHROptions): XMLHttpRequest; - dataType?: string; + + /** + * An optional function to extract the data from a raw XMLHttpRequest, + * useful if the relevant data is in a response header or the status + * field. + * + * @param xhr The associated XMLHttpRequest. + * @param options The options passed to this request. + * @return string The serialized format. + */ + extract?(xhr: XMLHttpRequest, options: this): string; + + /** + * The parsed data, or its children if it's an array, will be passed to + * this class constructor if it's given, to parse it into classes. + * + * @param data The data to parse. + * @return The new instance for the list. + */ + type?: new (data: any) => any; + + /** + * The URL to send the request to. + */ + url: string; + } + + /** + * This represents the available options for configuring m.request for JSONP + * requests. + * + * @see m.request + */ + interface JSONPOptions extends RequestOptions { + /** + * For JSONP requests, this must be the string "jsonp". Otherwise, it's + * ignored. + */ + dataType: "jsonp"; + + /** + * The querystring key for the JSONP request callback. This is useful for + * APIs that don't use common conventions, such as + * `www.example.com/?jsonpCallback=doSomething`. It defaults to + * `callback`. + */ + callbackKey?: string; + + /** + * The data to send with the request. This is automatically serialized + * to a querystring. + */ + data?: Object; + } + + /** + * This represents the available options for configuring m.request for + * standard AJAX requests. + * + * @see m.request + */ + interface XHROptions extends RequestOptions { + /** + * This represents the HTTP method used, defaulting to "GET". + */ + method: "GET" | "POST" | "PUT" | "DELETE" | "HEAD" | "OPTIONS"; + + /** + * The username for HTTP authentication. + */ + user?: string; + + /** + * The password for HTTP authentication. + */ + password?: string; + + /** + * An optional function to run between `open` and `send`, useful for + * adding request headers or using XHR2 features such as the `upload` + * property. It is even possible to override the XHR altogether with a + * similar object, such as an XDomainRequest instance. + * + * @param xhr The associated XMLHttpRequest. + * @param options The options passed to this request. + * @return The new XMLHttpRequest, or nothing if the same one is kept. + */ + config?(xhr: XMLHttpRequest, options: this): any; + + /** + * The data to send with the request. + */ + data?: Object; } } -declare var Mithril: _mithril.MithrilStatic; -declare var m: _mithril.MithrilStatic; +declare const m: Mithril.Static; declare module "mithril" { export = m; diff --git a/moment/moment-node.d.ts b/moment/moment-node.d.ts index 5199a64a27..6e602b2970 100644 --- a/moment/moment-node.d.ts +++ b/moment/moment-node.d.ts @@ -307,7 +307,7 @@ declare namespace moment { isAfter(b: MomentComparable, granularity?: string): boolean; isSame(b: MomentComparable, granularity?: string): boolean; - isBetween(a: MomentComparable, b: MomentComparable, granularity?: string): boolean; + isBetween(a: MomentComparable, b: MomentComparable, granularity?: string, inclusivity?: string): boolean; /** * @since 2.10.7+ @@ -605,10 +605,10 @@ declare namespace moment { invalid(parsingFlags?: Object): Moment; isMoment(): boolean; - isMoment(m: any): boolean; - isDate(m: any): boolean; + isMoment(m: any): m is Moment; + isDate(m: any): m is Date; isDuration(): boolean; - isDuration(d: any): boolean; + isDuration(d: any): d is Duration; /** * @deprecated since version 2.8.0 @@ -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/mongodb/mongodb.d.ts b/mongodb/mongodb.d.ts index 6c9f8efe7f..f1a385a238 100644 --- a/mongodb/mongodb.d.ts +++ b/mongodb/mongodb.d.ts @@ -164,8 +164,8 @@ declare module "mongodb" { // http://mongodb.github.io/node-mongodb-native/2.1/api/Db.html#addUser addUser(username: string, password: string, callback: MongoCallback): void; - addUser(username: string, password: string, options?: { w?: number | string, wtimeout?: number, j?: boolean, customData?: Object, roles?: Object[] }): Promise; - addUser(username: string, password: string, options: { w?: number | string, wtimeout?: number, j?: boolean, customData?: Object, roles?: Object[] }, callback: MongoCallback): void; + addUser(username: string, password: string, options?: DbAddUserOptions): Promise; + addUser(username: string, password: string, options: DbAddUserOptions, callback: MongoCallback): void; //http://mongodb.github.io/node-mongodb-native/2.1/api/Db.html#admin admin(): Admin; // http://mongodb.github.io/node-mongodb-native/2.1/api/Db.html#authenticate @@ -184,7 +184,7 @@ declare module "mongodb" { collections(): Promise; collections(callback: MongoCallback): void; //http://mongodb.github.io/node-mongodb-native/2.1/api/Db.html#command - command(command: Object, callback?: MongoCallback): void; + command(command: Object, callback: MongoCallback): void; command(command: Object, options?: { readPreference: ReadPreference | string }): Promise; command(command: Object, options: { readPreference: ReadPreference | string }, callback: MongoCallback): void; //http://mongodb.github.io/node-mongodb-native/2.1/api/Db.html#createCollection @@ -199,8 +199,8 @@ declare module "mongodb" { db(dbName: string): Db; db(dbName: string, options: { noListener?: boolean, returnNonCachedInstance?: boolean }): Db; //http://mongodb.github.io/node-mongodb-native/2.1/api/Db.html#dropCollection - dropCollection(name: string): Promise; - dropCollection(name: string, callback: MongoCallback): void; + dropCollection(name: string): Promise; + dropCollection(name: string, callback: MongoCallback): void; // http://mongodb.github.io/node-mongodb-native/2.1/api/Db.html#dropDatabase dropDatabase(): Promise; dropDatabase(callback: MongoCallback): void; @@ -231,7 +231,7 @@ declare module "mongodb" { removeUser(username: string, callback: MongoCallback): void; removeUser(username: string, options?: { w?: number | string, wtimeout?: number, j?: boolean }): Promise; removeUser(username: string, options: { w?: number | string, wtimeout?: number, j?: boolean }, callback: MongoCallback): void; - //http://mongodb.github.io/node-mongodb-native/2.1/api/Db.html#renameCollection + // http://mongodb.github.io/node-mongodb-native/2.1/api/Db.html#renameCollection renameCollection(fromCollection: string, toCollection: string, callback: MongoCallback): void; renameCollection(fromCollection: string, toCollection: string, options?: { dropTarget?: boolean }): Promise; renameCollection(fromCollection: string, toCollection: string, options: { dropTarget?: boolean }, callback: MongoCallback): void; @@ -241,6 +241,8 @@ declare module "mongodb" { stats(options: { scale?: number }, callback: MongoCallback): void; } + + // Deprecated http://mongodb.github.io/node-mongodb-native/2.1/api/Server.html export class Server extends EventEmitter { constructor(host: string, port: number, options?: ServerOptions); @@ -254,13 +256,22 @@ declare module "mongodb" { connections(): Array; } - + // Deprecated http://mongodb.github.io/node-mongodb-native/2.1/api/ReplSet.html export class Mongos extends EventEmitter { constructor(servers: Array, options?: MongosOptions); connections(): Array; } + + // http://mongodb.github.io/node-mongodb-native/2.1/api/Db.html#addUser + export interface DbAddUserOptions { + w?: string | number; + wtimeout?: number; + j?: boolean; + customData?: Object; + roles?: Object[]; + } //http://mongodb.github.io/node-mongodb-native/2.1/api/Db.html#createCollection export interface CollectionCreateOptions { @@ -333,42 +344,42 @@ declare module "mongodb" { authenticate(username: string, password: string, callback: MongoCallback): void; //http://mongodb.github.io/node-mongodb-native/2.1/api/Admin.html#buildInfo buildInfo(): Promise; - buildInfo(callback: MongoCallback): void + buildInfo(callback: MongoCallback): void; //http://mongodb.github.io/node-mongodb-native/2.1/api/Admin.html#command command(command: Object, callback: MongoCallback): void; command(command: Object, options?: { readPreference?: ReadPreference | string, maxTimeMS?: number }): Promise; command(command: Object, options: { readPreference?: ReadPreference | string, maxTimeMS?: number }, callback: MongoCallback): void; //http://mongodb.github.io/node-mongodb-native/2.1/api/Admin.html#listDatabases listDatabases(): Promise; - listDatabases(callback: MongoCallback): void + listDatabases(callback: MongoCallback): void; //http://mongodb.github.io/node-mongodb-native/2.1/api/Admin.html#logout logout(): Promise; - logout(callback: MongoCallback): void + logout(callback: MongoCallback): void; //http://mongodb.github.io/node-mongodb-native/2.1/api/Admin.html#ping ping(): Promise; - ping(callback: MongoCallback): void + ping(callback: MongoCallback): void; //http://mongodb.github.io/node-mongodb-native/2.1/api/Admin.html#profilingInfo profilingInfo(): Promise; - profilingInfo(callback: MongoCallback): void + profilingInfo(callback: MongoCallback): void; //http://mongodb.github.io/node-mongodb-native/2.1/api/Admin.html#profilingLevel profilingLevel(): Promise; - profilingLevel(callback: MongoCallback): void + profilingLevel(callback: MongoCallback): void; //http://mongodb.github.io/node-mongodb-native/2.1/api/Admin.html#removeUser removeUser(username: string, callback: MongoCallback): void; removeUser(username: string, options?: FSyncOptions): Promise; removeUser(username: string, options: FSyncOptions, callback: MongoCallback): void; //http://mongodb.github.io/node-mongodb-native/2.1/api/Admin.html#replSetGetStatus replSetGetStatus(): Promise; - replSetGetStatus(callback: MongoCallback): void + replSetGetStatus(callback: MongoCallback): void; //http://mongodb.github.io/node-mongodb-native/2.1/api/Admin.html#serverInfo serverInfo(): Promise; - serverInfo(callback: MongoCallback): void + serverInfo(callback: MongoCallback): void; //http://mongodb.github.io/node-mongodb-native/2.1/api/Admin.html#serverStatus serverStatus(): Promise; - serverStatus(callback: MongoCallback): void + serverStatus(callback: MongoCallback): void; //http://mongodb.github.io/node-mongodb-native/2.1/api/Admin.html#setProfilingLevel setProfilingLevel(level: string): Promise; - setProfilingLevel(level: string, callback: MongoCallback): void + setProfilingLevel(level: string, callback: MongoCallback): void; // http://mongodb.github.io/node-mongodb-native/2.1/api/Admin.html#validateCollection validateCollection(collectionNme: string, callback: MongoCallback): void; validateCollection(collectionNme: string, options?: Object): Promise; @@ -564,12 +575,12 @@ declare module "mongodb" { // Get current index hint for collection. hint: any; //http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#aggregate - aggregate(pipeline: Object[], callback: MongoCallback): void | AggregationCursor; - aggregate(pipeline: Object[], options: CollectionAggrigationOptions, callback: MongoCallback): void | AggregationCursor; + aggregate(pipeline: Object[], callback: MongoCallback): AggregationCursor; + aggregate(pipeline: Object[], options?: CollectionAggregationOptions, callback?: MongoCallback): AggregationCursor; //http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#bulkWrite - bulkWrite(operations: Object[], callback: MongoCallback): void - bulkWrite(operations: Object[], options?: CollectionBluckWriteOptions): Promise - bulkWrite(operations: Object[], options: CollectionBluckWriteOptions, callback: MongoCallback): void + bulkWrite(operations: Object[], callback: MongoCallback): void; + bulkWrite(operations: Object[], options?: CollectionBluckWriteOptions): Promise; + bulkWrite(operations: Object[], options: CollectionBluckWriteOptions, callback: MongoCallback): void; //http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#count count(query: Object, callback: MongoCallback): void; count(query: Object, options?: MongoCountPreferences): Promise; @@ -590,9 +601,9 @@ declare module "mongodb" { deleteOne(filter: Object, options?: { w?: number | string, wtimmeout?: number, j?: boolean, bypassDocumentValidation?: boolean }): Promise; deleteOne(filter: Object, options: { w?: number | string, wtimmeout?: number, j?: boolean, bypassDocumentValidation?: boolean }, callback: MongoCallback): void; //http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#distinct - distinct(key: string, query: Object, callback: MongoCallback): void + distinct(key: string, query: Object, callback: MongoCallback): void; distinct(key: string, query: Object, options?: { readPreference?: ReadPreference | string }): Promise; - distinct(key: string, query: Object, options: { readPreference?: ReadPreference | string }, callback: MongoCallback): void + distinct(key: string, query: Object, options: { readPreference?: ReadPreference | string }, callback: MongoCallback): void; //http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#drop drop(): Promise; drop(callback: MongoCallback): void; @@ -604,7 +615,16 @@ declare module "mongodb" { dropIndexes(): Promise; dropIndexes(callback?: MongoCallback): void; //http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#find - find(query: Object): Cursor; + find(query?: Object): Cursor; + /** @deprecated */ + find(query: Object, fields?: Object, skip?: number, limit?: number, timeout?: number): Cursor; + //http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#findOne + /** @deprecated use find().limit(1).next(function(err, doc){}) */ + findOne(filter: Object, callback: MongoCallback): void; + /** @deprecated use find().limit(1).next(function(err, doc){}) */ + findOne(filter: Object, options?: FindOneOptions): Promise; + /** @deprecated use find().limit(1).next(function(err, doc){}) */ + findOne(filter: Object, options: FindOneOptions, callback: MongoCallback): void; //http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#findOneAndDelete findOneAndDelete(filter: Object, callback: MongoCallback): void; findOneAndDelete(filter: Object, options?: { projection?: Object, sort?: Object, maxTimeMS?: number }): Promise; @@ -640,17 +660,24 @@ declare module "mongodb" { indexInformation(options?: { full: boolean }): Promise; indexInformation(options: { full: boolean }, callback: MongoCallback): void; //http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#initializeOrderedBulkOp - initializeOrderedBulkOp(options: CollectionOptions): OrderedBulkOperation; + initializeOrderedBulkOp(options?: CollectionOptions): OrderedBulkOperation; //http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#initializeUnorderedBulkOp - initializeUnorderedBulkOp(options: CollectionOptions): UnorderedBulkOperation; - //http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#insertMany - insertMany(docs: Object[], callback: MongoCallback): void - insertMany(docs: Object[], options?: CollectionInsertManyOptions): Promise; - insertMany(docs: Object[], options: CollectionInsertManyOptions, callback: MongoCallback): void + initializeUnorderedBulkOp(options?: CollectionOptions): UnorderedBulkOperation; //http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#insertOne - insertOne(docs: Object, callback: MongoCallback): void + /** @deprecated Use insertOne, insertMany or bulkWrite */ + insert(docs: Object, callback: MongoCallback): void; + /** @deprecated Use insertOne, insertMany or bulkWrite */ + insert(docs: Object, options?: CollectionInsertOneOptions): Promise; + /** @deprecated Use insertOne, insertMany or bulkWrite */ + insert(docs: Object, options: CollectionInsertOneOptions, callback: MongoCallback): void; + //http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#insertMany + insertMany(docs: Object[], callback: MongoCallback): void; + insertMany(docs: Object[], options?: CollectionInsertManyOptions): Promise; + insertMany(docs: Object[], options: CollectionInsertManyOptions, callback: MongoCallback): void; + //http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#insertOne + insertOne(docs: Object, callback: MongoCallback): void; insertOne(docs: Object, options?: CollectionInsertOneOptions): Promise; - insertOne(docs: Object, options: CollectionInsertOneOptions, callback: MongoCallback): void + insertOne(docs: Object, options: CollectionInsertOneOptions, callback: MongoCallback): void; //http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#isCapped isCapped(): Promise; isCapped(callback: MongoCallback): void; @@ -678,10 +705,22 @@ declare module "mongodb" { replaceOne(filter: Object, doc: Object, callback: MongoCallback): void; replaceOne(filter: Object, doc: Object, options?: ReplaceOneOptions): Promise; replaceOne(filter: Object, doc: Object, options: ReplaceOneOptions, callback: MongoCallback): void; + //http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#save + /** @deprecated Use insertOne, insertMany, updateOne or updateMany */ + save(doc: Object, callback: MongoCallback): void; + save(doc: Object, options?: CollectionOptions): Promise; + save(doc: Object, options: CollectionOptions, callback: MongoCallback): void; //http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#stats stats(callback: MongoCallback): void; stats(options?: { scale: number }): Promise; stats(options: { scale: number }, callback: MongoCallback): void; + // http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#update + /** @deprecated use updateOne, updateMany or bulkWrite */ + update(filter: Object, update: Object, callback: MongoCallback): void; + /** @deprecated use updateOne, updateMany or bulkWrite */ + update(filter: Object, update: Object, options?: ReplaceOneOptions & { multi?: boolean }): Promise; + /** @deprecated use updateOne, updateMany or bulkWrite */ + update(filter: Object, update: Object, options: ReplaceOneOptions & { multi?: boolean }, callback: MongoCallback): void; //http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#updateMany updateMany(filter: Object, update: Object, callback: MongoCallback): void; updateMany(filter: Object, update: Object, options?: { upsert?: boolean; w?: any; wtimeout?: number; j?: boolean; }): Promise; @@ -693,6 +732,7 @@ declare module "mongodb" { } // Documentation: http://docs.mongodb.org/manual/reference/command/collStats/ + //TODO complete this export interface CollStats { // Namespace. ns: string; @@ -724,10 +764,11 @@ declare module "mongodb" { maxSize: boolean; wiredTiger: any; indexDetails: any; + ok: number; } //http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#aggregate - export interface CollectionAggrigationOptions { + export interface CollectionAggregationOptions { readPreference?: ReadPreference | string; // Return the query as cursor, on 2.6 > it returns as a real cursor // on pre 2.6 it returns as an emulated cursor. @@ -875,7 +916,7 @@ declare module "mongodb" { length: number; //http://mongodb.github.io/node-mongodb-native/2.1/api/OrderedBulkOperation.html#execute execute(callback: MongoCallback): void; - execute(options: FSyncOptions): Promise; + execute(options?: FSyncOptions): Promise; execute(options: FSyncOptions, callback: MongoCallback): void; //http://mongodb.github.io/node-mongodb-native/2.1/api/OrderedBulkOperation.html#find find(selector: Object): FindOperatorsOrdered; @@ -885,7 +926,7 @@ declare module "mongodb" { //http://mongodb.github.io/node-mongodb-native/2.1/api/BulkWriteResult.html export interface BulkWriteResult { - ok: boolean; + ok: number; nInserted: number; nUpdated: number; nUpserted: number; @@ -936,7 +977,7 @@ declare module "mongodb" { export interface UnorderedBulkOperation { //http://mongodb.github.io/node-mongodb-native/2.1/api/UnorderedBulkOperation.html#execute execute(callback: MongoCallback): void; - execute(options: FSyncOptions): Promise; + execute(options?: FSyncOptions): Promise; execute(options: FSyncOptions, callback: MongoCallback): void; //http://mongodb.github.io/node-mongodb-native/2.1/api/UnorderedBulkOperation.html#find find(selector: Object): FindOperatorsUnordered; @@ -955,6 +996,30 @@ declare module "mongodb" { upsert(): FindOperatorsUnordered; } + //http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#findOne + export interface FindOneOptions { + limit?: number, + sort?: Array | Object, + fields?: Object, + skip?: number, + hint?: Object, + explain?: boolean, + snapshot?: boolean, + timeout?: boolean, + tailable?: boolean, + batchSize?: number, + returnKey?: boolean, + maxScan?: number, + min?: number, + max?: number, + showDiskLoc?: boolean, + comment?: string, + raw?: boolean, + readPreference?: ReadPreference | string, + partial?: boolean, + maxTimeMs?: number + } + //http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#~insertWriteOpResult export interface InsertWriteOpResult { insertedCount: number; @@ -1031,7 +1096,13 @@ declare module "mongodb" { bypassDocumentValidation?: boolean } - + //http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#~WriteOpResult + export interface WriteOpResult { + ops: Array; + connection: any; + result: any; + } + //http://mongodb.github.io/node-mongodb-native/2.1/api/external-Readable.html export interface Readable { pause(): void; @@ -1177,7 +1248,7 @@ declare module "mongodb" { close(): Promise; close(callback: MongoCallback): void; //http://mongodb.github.io/node-mongodb-native/2.1/api/AggregationCursor.html#each - each(callback: MongoCallback): void + each(callback: MongoCallback): void; // http://mongodb.github.io/node-mongodb-native/2.1/api/AggregationCursor.html#explain explain(): Promise; explain(callback: MongoCallback): void; @@ -1219,8 +1290,8 @@ declare module "mongodb" { // http://mongodb.github.io/node-mongodb-native/2.1/api/AggregationCursor.html#sort sort(document: Object): AggregationCursor; // http://mongodb.github.io/node-mongodb-native/2.1/api/AggregationCursor.html#toArray - toArray(): Promise; - toArray(callback: MongoCallback): void; + toArray(): Promise; + toArray(callback: MongoCallback): void; //http://mongodb.github.io/node-mongodb-native/2.1/api/AggregationCursor.html#unpipe unpipe(destination?: Writable): void; //http://mongodb.github.io/node-mongodb-native/2.1/api/AggregationCursor.html#unshift @@ -1241,7 +1312,7 @@ declare module "mongodb" { close(): Promise; close(callback: MongoCallback): void; //http://mongodb.github.io/node-mongodb-native/2.1/api/CommandCursor.html#each - each(callback: MongoCallback): void + each(callback: MongoCallback): void; // http://mongodb.github.io/node-mongodb-native/2.1/api/CommandCursor.html#isClosed isClosed(): boolean; // http://mongodb.github.io/node-mongodb-native/2.1/api/CommandCursor.html#maxTimeMS @@ -1264,8 +1335,8 @@ declare module "mongodb" { // http://mongodb.github.io/node-mongodb-native/2.1/api/CommandCursor.html#setReadPreference setReadPreference(readPreference: string | ReadPreference): CommandCursor; // http://mongodb.github.io/node-mongodb-native/2.1/api/CommandCursor.html#toArray - toArray(): Promise; - toArray(callback: MongoCallback): void; + toArray(): Promise; + toArray(callback: MongoCallback): void; //http://mongodb.github.io/node-mongodb-native/2.1/api/CommandCursor.html#unpipe unpipe(destination?: Writable): void; //http://mongodb.github.io/node-mongodb-native/2.1/api/CommandCursor.html#unshift diff --git a/mongoose/mongoose-tests.ts b/mongoose/mongoose-tests.ts index 0df6b6216d..2f6467437c 100644 --- a/mongoose/mongoose-tests.ts +++ b/mongoose/mongoose-tests.ts @@ -382,6 +382,7 @@ var id: mongoose.Types.ObjectId = new mongoose.Types.ObjectId(); var id2: mongoose.Types.ObjectId = new mongoose.Types.ObjectId(123); var id2: mongoose.Types.ObjectId = mongoose.Types.ObjectId.createFromTime(123); var id2: mongoose.Types.ObjectId = mongoose.Types.ObjectId.createFromHexString('foo'); +var isValid:boolean = mongoose.Types.ObjectId.isValid('570d350b67b1ae0600e8bee8'); var s = id.toHexString(); var valid = id.isValid(); var eq = id.equals(id2); diff --git a/mongoose/mongoose.d.ts b/mongoose/mongoose.d.ts index 7041acd282..a2aabc0128 100644 --- a/mongoose/mongoose.d.ts +++ b/mongoose/mongoose.d.ts @@ -40,6 +40,7 @@ declare module "mongoose" { mquery: any; version: string; connection: Connection; + Promise: any; } export interface Connection extends NodeJS.EventEmitter { @@ -129,6 +130,7 @@ declare module "mongoose" { isValid(): boolean; static createFromTime(time: number): ObjectId; static createFromHexString(hexString: string): ObjectId; + static isValid(id?: string|number):boolean; } } @@ -306,8 +308,8 @@ declare module "mongoose" { circle(area: Object): Query; circle(path: string, area: Object): Query; comment(val: any): Query; - count(callback?: (err: any, count: number) => void): Query; - count(criteria: Object, callback?: (err: any, count: number) => void): Query; + count(callback?: (err: any, count: number) => void): Query; + count(criteria: Object, callback?: (err: any, count: number) => void): Query; distinct(callback?: (err: any, res: T) => void): Query; distinct(field: string, callback?: (err: any, res: T) => void): Query; distinct(criteria: Object, field: string, callback?: (err: any, res: T) => void): Query; @@ -480,7 +482,7 @@ declare module "mongoose" { export class Promise { constructor(fn?: (err: any, result: T) => void); - then(onFulFill: (result: T) => void, onReject?: (err: any) => void): Promise; + then(onFulFill: (result: T) => void | U | Promise, onReject?: (err: any) => void | U | Promise): Promise; end(): void; fulfill(result: T): Promise; diff --git a/morgan/morgan-tests.ts b/morgan/morgan-tests.ts index 4a0df99024..f26784c848 100644 --- a/morgan/morgan-tests.ts +++ b/morgan/morgan-tests.ts @@ -4,6 +4,7 @@ */ import morgan = require('morgan'); +import express = require('express'); // a pre-defined name morgan('combined') @@ -15,8 +16,8 @@ morgan('tiny') morgan(':remote-addr :method :url') // a custom function -morgan(function (req, res) { - return req.method + ' ' + req.url +morgan(function (tokens, req, res) { + return req.method + ' ' + req.url + ' ' + tokens['date'](req, res, 'iso'); // use predefined :date[iso] token with format argument }) morgan('combined', { @@ -29,3 +30,55 @@ morgan('combined', { } } }); + + +// test interface definition for morgan +var morgan2 : morgan.Morgan = morgan; + +// a named custom format defined as string (example: extend 'tiny' format with user-agent token) +morgan.format('tiny-extended', ':method :url :status :res[content-length] - :response-time ms :user-agent'); + + +// a named custom format defined using the Function signature (example: extend 'dev' format with user-agent token) + +// extend morgan.FormatFn interface with memoizer property to avoid unnecessary re-compiling +// of status-code range driven colorized format functions +interface IFormatFnIndexer { + [memoizerName: string]: morgan.FormatFn; +} + +interface IExtendedFormatFn extends morgan.FormatFn { + memoizer?: IFormatFnIndexer; +} + + +var developmentExtendedFormatLine : IExtendedFormatFn = function(tokens, req, res):string { + + // get the status code if response written + var status = res.statusCode + ? res.statusCode + : undefined; + + // get status color + var color = status >= 500 ? 31 // red + : status >= 400 ? 33 // yellow + : status >= 300 ? 36 // cyan + : status >= 200 ? 32 // green + : 0; // no color + + // get colored format function, if previously memoized, otherwise undefined + var fn: morgan.FormatFn = developmentExtendedFormatLine.memoizer[color]; + + if (!fn) { + // compile + fn = developmentExtendedFormatLine.memoizer[color] = morgan.compile('\x1b[0m:method :url \x1b[' + + color + 'm:status \x1b[0m:response-time ms - :res[content-length]\x1b[0m :user-agent'); + } + + return fn(tokens, req, res); +}; + +developmentExtendedFormatLine.memoizer = {}; + + +morgan.format('dev-extended', developmentExtendedFormatLine); diff --git a/morgan/morgan.d.ts b/morgan/morgan.d.ts index bf1e840956..8a985b5a1c 100644 --- a/morgan/morgan.d.ts +++ b/morgan/morgan.d.ts @@ -1,4 +1,4 @@ -// Type definitions for morgan 1.2.2 +// Type definitions for morgan 1.7.0 // Project: https://github.com/expressjs/morgan // Definitions by: James Roland Cabresos // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -10,7 +10,114 @@ declare module "morgan" { namespace morgan { - export function token(name: string, callback: (req: express.Request, res: express.Response) => T): express.RequestHandler; + export interface FormatFn extends Function { + (tokens: TokenIndexer, req: express.Request, res: express.Response): string; + } + + export interface TokenCallbackFn extends Function { + (req: express.Request, res: express.Response, arg?: string | number | boolean): string; + } + + export interface TokenIndexer { + [tokenName: string]: TokenCallbackFn; + } + + /** + * Public interface of morgan logger + */ + export interface Morgan { + /*** + * Create a new morgan logger middleware function using the given format and options. The format argument may be a string of a predefined name (see below for the names), + * or a string of a format string containing defined tokens. + * @param format + * @param options + */ + (format: string, options?: Options): express.RequestHandler; + /*** + * Standard Apache combined log output. + * :remote-addr - :remote-user [:date] ":method :url HTTP/:http-version" :status :res[content-length] ":referrer" ":user-agent" + * @param format + * @param options + */ + (format: 'combined', options?: Options): express.RequestHandler; + /*** + * Standard Apache common log output. + * :remote-addr - :remote-user [:date] ":method :url HTTP/:http-version" :status :res[content-length] + * @param format + * @param options + */ + (format: 'common', options?: Options): express.RequestHandler; + /** + * Concise output colored by response status for development use. The :status token will be colored red for server error codes, yellow for client error codes, cyan for redirection codes, and uncolored for all other codes. + * :method :url :status :response-time ms - :res[content-length] + * @param format + * @param options + */ + (format: 'dev', options?: Options): express.RequestHandler; + + /*** + * Shorter than default, also including response time. + * :remote-addr :remote-user :method :url HTTP/:http-version :status :res[content-length] - :response-time ms + * @param format + * @param options + */ + (format: 'short', options?: Options): express.RequestHandler; + + /*** + * The minimal output. + * :method :url :status :res[content-length] - :response-time ms + * @param format + * @param options + */ + (format: 'tiny', options?: Options): express.RequestHandler; + + /*** + * Create a new morgan logger middleware function using the given format and options. The format argument may be a + * custom format function which adheres to the signature. + * @param format + * @param options + */ + (format: FormatFn, options?: Options): express.RequestHandler; + + /** + * Define a custom token which can be used in custom morgan logging formats. + */ + token(name: string, callback: TokenCallbackFn): Morgan; + /** + * Define a named custom format by specifying a format string in token notation + */ + format(name: string, fmt: string): Morgan; + + /** + * Define a named custom format by specifying a format function + */ + format(name: string, fmt: FormatFn): Morgan; + + /** + * Compile a format string in token notation into a format function + */ + compile(format: string): FormatFn; + } + + /** + * Define a custom token which can be used in custom morgan logging formats. + */ + export function token(name: string, callback: TokenCallbackFn): Morgan; + + /** + * Define a named custom format by specifying a format string in token notation + */ + export function format(name: string, fmt: string): Morgan; + + /** + * Define a named custom format by specifying a format function + */ + export function format(name: string, fmt: FormatFn): Morgan; + + /** + * Compile a format string in token notation into a format function + */ + export function compile(format: string): FormatFn; export interface StreamOptions { /** @@ -48,7 +155,8 @@ declare module "morgan" { } /*** - * Create a new morgan logger middleware function using the given format and options. The format argument may be a string of a predefined name (see below for the names), a string of a format string, or a function that will produce a log entry. + * Create a new morgan logger middleware function using the given format and options. The format argument may be a string of a predefined name (see below for the names), + * or a string of a format string containing defined tokens. * @param format * @param options */ @@ -94,7 +202,13 @@ declare module "morgan" { */ function morgan(format: 'tiny', options?: morgan.Options): express.RequestHandler; - function morgan(custom: (req: express.Request, res: express.Response) => string): express.RequestHandler + /*** + * Create a new morgan logger middleware function using the given format and options. The format argument may be a + * custom format function which adheres to the signature. + * @param format + * @param options + */ + function morgan(format: morgan.FormatFn, options?: morgan.Options): express.RequestHandler export = morgan; } diff --git a/morris.js/morris.js-tests.ts b/morris.js/morris.js-tests.ts new file mode 100644 index 0000000000..93f3ab95c5 --- /dev/null +++ b/morris.js/morris.js-tests.ts @@ -0,0 +1,79 @@ +/// + +let data = [{ + label: "2010-5-1", + value: 15 +}]; + +let donutChart = Morris.Donut({ + element: "donutChartId", + data: data, + colors: ["chartreuse"], + resize: false +}); + +let barChart = Morris.Bar({ + element: "barChartId", + data: data, + xkey: "label", + ykeys: ["value"], + labels: ["labels"], + hideHover: "auto", + axes: false, + grid: true, + gridTextColor: "bisque", + gridTextSize: 42, + gridTextFamily: "comic sans", + gridTextWeight: "bold", + barColors: ["aquamarine"], + stacked: false, + hoverCallback: (index, options, content, row) => index + " " + content +}); + +let lineChart = Morris.Line({ + element: "lineChartId", + data: data, + xkey: "label", + ykeys: ["value"], + labels: ["labels"], + lineColors: ["bisque"], + lineWidth: 42, + pointSize: 42, + pointFillColors: ["bisque"], + pointStrokeColors: ["bisque"], + ymax: "auto 15", + ymin: "auto 10", + smooth: false, + hoverCallback: (index, options, content, row) => index + " " + content, + parseTime: false, + postUnits: "%", + preUnits: "£", + dateFormat: (timestamp) => timestamp.toString(), + xLabels: "30min", + xLabelFormat: (date) => date.toString(), + xLabelAngle: 42, + yLabelFormat: (val) => val.toString(), + goals: [42], + goalStrokeWidth: 42, + goalLineColors: ["bisque"], + events: ["bisque"], + eventStrokeWidth: 42, + eventLineColors: ["bisque"], + continuousLine: false, + axes: false, + grid: false, + gridTextColor: "bisque", + gridTextSize: 42, + gridTextFamily: "comic sans", + gridTextWeight: "bold", + fillOpacity: 42 +}); + +let areaChart = Morris.Area({ + element: "areaChartId", + data: data, + xkey: "label", + ykeys: ["value"], + labels: ["labels"], + behaveLikeLine: false +}); diff --git a/morris.js/morris.js.d.ts b/morris.js/morris.js.d.ts new file mode 100644 index 0000000000..79598ee5c3 --- /dev/null +++ b/morris.js/morris.js.d.ts @@ -0,0 +1,146 @@ +// Type definitions for morris.js 0.5.1 +// Project: http://morrisjs.github.io/morris.js/ +// Definitions by: Matthieu Mourisson +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare namespace morris { + type AutoAlways = "auto" | "always"; + + type Interval = "decade" | "year" | "month" | "week" | "day" | "hour" | "30min" | "15min" | "10min" | "5min" | "minute" | "30sec" | "15sec" | "10sec" | "5sec" | "second"; + + interface IChartOptions { + /** The ID of (or a reference to) the element into which to insert the graph. */ + element: any; + /** Set to true to enable automatic resizing when the containing element resizes. (default: false). */ + resize?: boolean; + } + + interface IGridChartOptions extends IChartOptions { + /** The data to plot. This is an array of objects, containing x and y attributes as described by the xkey and ykeys options. */ + data: any[]; + /** A string containing the name of the attribute that contains X labels. */ + xkey: string; + /** A list of strings containing names of attributes that contain Y values (one for each series of data to be plotted). */ + ykeys: string[]; + /** A list of strings containing labels for the data series to be plotted (corresponding to the values in the ykeys option). */ + labels: string[]; + /** Set the visibility of the hover legend (see documentation). */ + hideHover?: boolean | AutoAlways; + /** Set to false to disable drawing the x and y axes. */ + axes?: boolean; + /** Set to false to disable drawing the horizontal grid lines. */ + grid?: boolean; + /** Set the color of the axis labels (default: #888). */ + gridTextColor?: string; + /** Set the point size of the axis labels (default: 12). */ + gridTextSize?: number; + /** Set the font family of the axis labels (default: sans-serif). */ + gridTextFamily?: string; + /** Set the font weight of the axis labels (default: normal). */ + gridTextWeight?: string; + } + + interface ILineOptions extends IGridChartOptions { + /** Array containing colors for the series lines/points. */ + lineColors?: string[]; + /** Width of the series lines, in pixels. */ + lineWidth?: number; + /** Diameter of the series points, in pixels. */ + pointSize?: number; + /** Colors for the series points. By default uses the same values as lineColors */ + pointFillColors?: string[]; + /** Colors for the outlines of the series points. (#ffffff by default). */ + pointStrokeColors?: string[]; + /** Max. bound for Y-values. Alternatively, set this to 'auto' to compute automatically, or 'auto [num]' to automatically compute and ensure that the max y-value is at least [num]. */ + ymax?: number | string; + /** Min. bound for Y-values. Alternatively, set this to 'auto' to compute automatically, or 'auto [num]' to automatically compute and ensure that the min y-value is at most [num]. */ + ymin?: number | string; + /** Set to false to disable line smoothing. */ + smooth?: boolean; + /** Provide a function on this option to generate custom hover legends. */ + hoverCallback?: (index: number, options: ILineOptions, content: string, row: any) => string; + /** Set to false to skip time/date parsing for X values, instead treating them as an equally-spaced series. */ + parseTime?: boolean; + /** Set to a string value (eg: '%') to add a label suffix all y-labels. */ + postUnits?: string; + /** Set to a string value (eg: '$') to add a label prefix all y-labels. */ + preUnits?: string; + /** A function that accepts millisecond timestamps and formats them for display as chart labels. */ + dateFormat?: (timestamp: number) => string; + /** Sets the x axis labelling interval. By default the interval will be automatically computed. */ + xLabels?: Interval; + /** A function that accepts Date objects and formats them for display as x-axis labels. Overrides the default formatter chosen by the automatic labeller or the xLabels option. */ + xLabelFormat?: (date: Date) => string; + /** The angle in degrees from horizontal to draw x-axis labels. */ + xLabelAngle?: number; + /** A function that accepts y-values and formats them for display as y-axis labels. */ + yLabelFormat?: (val: any) => string; + /** A list of y-values to draw as horizontal 'goal' lines on the chart. */ + goals?: number[]; + /** Width, in pixels, of the goal lines. */ + goalStrokeWidth?: number; + /** Array of color values to use for the goal line colors. If you list fewer colors here than you have lines in goals, then the values will be cycled. */ + goalLineColors?: string[]; + /** A list of x-values to draw as vertical 'event' lines on the chart. */ + events?: string[]; + /** Width, in pixels, of the event lines. */ + eventStrokeWidth?: number; + /** Array of color values to use for the event line colors. If you list fewer colors here than you have lines in events, then the values will be cycled. */ + eventLineColors?: string[]; + /** Define how null and undefined values are handled (see documentation). */ + continuousLine?: boolean; + /** Change the opacity of the area fill colour. Accepts values between 0.0 (for completely transparent) and 1.0 (for completely opaque). */ + fillOpacity?: number; + } + + interface IAreaOptions extends ILineOptions { + /** Set to true to overlay the areas on top of each other instead of stacking them. */ + behaveLikeLine?: boolean; + } + + interface IBarOptions extends IGridChartOptions { + /** Array containing colors for the series bars. */ + barColors?: string[]; + /** Set to true to draw bars stacked vertically. */ + stacked?: boolean; + /** Provide a function on this option to generate custom hover legends. */ + hoverCallback?: (index: number, options: IBarOptions, content: string, row: any) => string; + } + + interface IDonutData { + /** Label of the segment of the donut chart.*/ + label: string; + /** Size of the segment of the donut chart.*/ + value: number; + } + + interface IDonutOptions extends IChartOptions { + /** The data to plot. */ + data: IDonutData[]; + /** An array of strings containing HTML-style hex colors for each of the donut segments. */ + colors?: string[]; + /** A function that will translate a y-value into a label for the centre of the donut. */ + formatter?: (y: number, data: IDonutData) => string; + } + + class GridChart { + setData(data: any[], redraw?: boolean): void; + } + + class DonutChart { + setData(data: IDonutData[], redraw?: boolean): void; + } + + class MorrisStatic { + /** Create a line chart. */ + Line: (options: ILineOptions) => GridChart; + /** Create an area chart. */ + Area: (options: IAreaOptions) => GridChart; + /** Create a bar chart. */ + Bar: (options: IBarOptions) => GridChart; + /** Create a Donut chart. */ + Donut: (options: IDonutOptions) => DonutChart; + } +} + +declare var Morris: morris.MorrisStatic; diff --git a/mousetrap/mousetrap-global-bind-tests.ts b/mousetrap/mousetrap-global-bind-tests.ts index 889df1a264..d6a7826a2a 100644 --- a/mousetrap/mousetrap-global-bind-tests.ts +++ b/mousetrap/mousetrap-global-bind-tests.ts @@ -25,6 +25,11 @@ Mousetrap.bindGlobal('up up down down left right left right b a enter', function console.log('konami code'); }); +// Test that union types are accepted. +const unionTypeKeys: string | string[] = ['a', 'b', 'c']; +Mousetrap.bindGlobal(unionTypeKeys, function() { console.log('Union type test') }); + + Mousetrap.bindGlobal(['ctrl+s', 'meta+s'], (e, combo) => { if (e.preventDefault) { e.preventDefault(); diff --git a/mousetrap/mousetrap-global-bind.d.ts b/mousetrap/mousetrap-global-bind.d.ts index c27a1f58f7..36c757d18e 100644 --- a/mousetrap/mousetrap-global-bind.d.ts +++ b/mousetrap/mousetrap-global-bind.d.ts @@ -6,6 +6,5 @@ /// interface MousetrapStatic { - bindGlobal(keys: string, callback: (e: ExtendedKeyboardEvent, combo: string) => any, action?: string): void; - bindGlobal(keyArray: string[], callback: (e: ExtendedKeyboardEvent, combo: string) => any, action?: string): void; + bindGlobal(keyArray: string|string[], callback: (e: ExtendedKeyboardEvent, combo: string) => any, action?: string): void; } diff --git a/mousetrap/mousetrap-tests.ts b/mousetrap/mousetrap-tests.ts index ab8b858d34..19fe27dd26 100644 --- a/mousetrap/mousetrap-tests.ts +++ b/mousetrap/mousetrap-tests.ts @@ -51,6 +51,10 @@ instance.bind('mod+s', function(){ console.log('Instance Saved'); }); // Test that the factory method works as well. Mousetrap(element).bind('mod+s', function(){ console.log('Factory Saved'); }); +// Test that union types are accepted. +const unionTypeKeys: string | string[] = ['a', 'b', 'c']; +Mousetrap(element).bind(unionTypeKeys, function() { console.log('Union type test') }); + // Test that Mousetrap can be loaded as an external module. // Assume that if the externally-loaded module can be assigned to a variable with the type of global Mousetrap, // then everything is working correctly. diff --git a/mousetrap/mousetrap.d.ts b/mousetrap/mousetrap.d.ts index 829def2939..04c8c7d403 100644 --- a/mousetrap/mousetrap.d.ts +++ b/mousetrap/mousetrap.d.ts @@ -11,20 +11,16 @@ interface MousetrapStatic { (el: Element): MousetrapInstance; new (el: Element): MousetrapInstance; stopCallback: (e: ExtendedKeyboardEvent, element: Element, combo: string) => boolean; - bind(keys: string, callback: (e: ExtendedKeyboardEvent, combo: string) => any, action?: string): void; - bind(keyArray: string[], callback: (e: ExtendedKeyboardEvent, combo: string) => any, action?: string): void; - unbind(keys: string, action?: string): void; - unbind(keyArray: string[], action?: string): void; + bind(keys: string|string[], callback: (e: ExtendedKeyboardEvent, combo: string) => any, action?: string): void; + unbind(keys: string|string[], action?: string): void; trigger(keys: string, action?: string): void; reset(): void; } interface MousetrapInstance { stopCallback: (e: ExtendedKeyboardEvent, element: Element, combo: string) => boolean; - bind(keys: string, callback: (e: ExtendedKeyboardEvent, combo: string) => any, action?: string): void; - bind(keyArray: string[], callback: (e: ExtendedKeyboardEvent, combo: string) => any, action?: string): void; - unbind(keys: string, action?: string): void; - unbind(keyArray: string[], action?: string): void; + bind(keys: string|string[], callback: (e: ExtendedKeyboardEvent, combo: string) => any, action?: string): void; + unbind(keys: string|string[], action?: string): void; trigger(keys: string, action?: string): void; reset(): void; } 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/nedb/nedb-tests.ts b/nedb/nedb-tests.ts index fd60057196..5b05636294 100644 --- a/nedb/nedb-tests.ts +++ b/nedb/nedb-tests.ts @@ -6,6 +6,8 @@ /// /// +import * as es6styleimport from 'nedb'; + import Q = require('q'); import nedb = require('nedb'); @@ -135,7 +137,16 @@ class BaseCollection { var deferred = Q.defer(); - this.dataStore.update(query, updateQuery, {upsert: true}, function (err:Error, numberOfUpdated:number, upsert:boolean) { + this.dataStore.update(query, updateQuery, {upsert: true}, function (err:Error, numberOfUpdated:number, upsert: boolean) { + if (err) { + deferred.reject(err); + } + else { + //deferred.resolve(newDoc); + } + }); + + this.dataStore.update(query, updateQuery, {upsert: true}, function (err:Error, numberOfUpdated:number, affectedDocs:any, upsert: boolean) { if (err) { deferred.reject(err); } @@ -550,4 +561,4 @@ db.insert({somefield: 'nedb'}, function (err:Error) { // Remove index on field somefield db.removeIndex('somefield', function (err:Error) { -}); \ No newline at end of file +}); diff --git a/nedb/nedb.d.ts b/nedb/nedb.d.ts index 8ae1f99d1b..b71e0be0fb 100644 --- a/nedb/nedb.d.ts +++ b/nedb/nedb.d.ts @@ -122,18 +122,36 @@ declare module "nedb" { findOne(query:any, callback:(err:Error, document:T)=>void):void; /** - * Update all docs matching query + * Update all docs matching query v1.7.4 and prior signature. * For now, very naive implementation (recalculating the whole database) * @param {any} query * @param {any} updateQuery * @param {Object} options Optional options * options.multi If true, can update multiple documents (defaults to false) * options.upsert If true, document is inserted if the query doesn't match anything - * @param {Function} cb Optional callback, signature: err, numReplaced, upsert (set to true if the update was in fact an upsert) + * @param {Function} cb Optional callback, signature: err, + * numReplaced, + * upsert (set to true if the update was in fact an upsert) * * @api private Use Datastore.update which has the same signature */ update(query:any, updateQuery:any, options?:NeDB.UpdateOptions, cb?:(err:Error, numberOfUpdated:number, upsert:boolean)=>void):void; + /** + * Update all docs matching query v1.8 signature. + * For now, very naive implementation (recalculating the whole database) + * @param {any} query + * @param {any} updateQuery + * @param {Object} options Optional options + * options.multi If true, can update multiple documents (defaults to false) + * options.upsert If true, document is inserted if the query doesn't match anything + * @param {Function} cb Optional callback, signature: err, + * numAffected, + * affectedDocuments (when returnUpdatedDocs is set to true), obj or array + * upsert (set to true if the update was in fact an upsert) + * + * @api private Use Datastore.update which has the same signature + */ + update(query:any, updateQuery:any, options?:NeDB.UpdateOptions, cb?:(err:Error, numberOfUpdated:number, affectedDocuments:any, upsert:boolean)=>void):void; /** * Remove all docs matching the query @@ -149,6 +167,7 @@ declare module "nedb" { remove(query:any, cb?:(err:Error, n:number)=>void):void; } + namespace NeDBDataStore {} export = NeDBDataStore; } @@ -184,6 +203,7 @@ declare namespace NeDB { interface UpdateOptions { multi?: boolean; upsert?: boolean; + returnUpdatedDocs?: boolean } /** diff --git a/ng-dialog/ng-dialog.d.ts b/ng-dialog/ng-dialog.d.ts index 63510520ad..42d7821d4a 100644 --- a/ng-dialog/ng-dialog.d.ts +++ b/ng-dialog/ng-dialog.d.ts @@ -5,6 +5,18 @@ /// +declare module "ng-dialog" { + export type IDialogService = angular.dialog.IDialogService; + export type IDialogOpenResult = angular.dialog.IDialogOpenResult; + export type IDialogClosePromise = angular.dialog.IDialogClosePromise; + export type IDialogProvider = angular.dialog.IDialogProvider; + export type IDialogScope = angular.dialog.IDialogScope; + export type IDialogConfirmScope = angular.dialog.IDialogConfirmScope; + export type IDialogOptions = angular.dialog.IDialogOptions; + export type IDialogOpenOptions = angular.dialog.IDialogOpenOptions; + export type IDialogOpenConfirmOptions = angular.dialog.IDialogOpenConfirmOptions; +} + declare namespace angular.dialog { interface IDialogService { diff --git a/ngstorage/ngstorage-tests.ts b/ngstorage/ngstorage-tests.ts index 2a25697b51..e3a427b9b1 100644 --- a/ngstorage/ngstorage-tests.ts +++ b/ngstorage/ngstorage-tests.ts @@ -3,11 +3,7 @@ var app: any; -app.controller('MainCtrl', function ($localStorage: angular.storage.ILocalStorageService) { - - $localStorage.set('MyKey', 'value'); - - $localStorage.get('MyKey'); +app.controller('LocalCtrl', function ($localStorage: angular.storage.IStorageService) { $localStorage.$default({ counter: 1 @@ -16,12 +12,33 @@ app.controller('MainCtrl', function ($localStorage: angular.storage.ILocalStorag $localStorage.$reset({ counter: 1 }); + + $localStorage.$reset(); $localStorage.$apply(); + + $localStorage.$sync(); }); -app.config(['$localStorageProvider', - function ($localStorageProvider: angular.storage.ILocalStorageProvider) { +app.controller('SessionCtrl', function ($sessionStorage: angular.storage.IStorageService) { + + $sessionStorage.$default({ + counter: 1 + }); + + $sessionStorage.$reset({ + counter: 1 + }); + + $sessionStorage.$reset(); + + $sessionStorage.$apply(); + + $sessionStorage.$sync(); +}); + +app.config(['$localStorageProvider', function ($localStorageProvider: angular.storage.IStorageProvider) { + $localStorageProvider.setKeyPrefix('NewPrefix'); $localStorageProvider.get('MyKey'); @@ -39,4 +56,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..d6abea24bf 100644 --- a/ngstorage/ngstorage.d.ts +++ b/ngstorage/ngstorage.d.ts @@ -7,22 +7,20 @@ declare namespace angular.storage { - export interface ILocalStorageService { - $default(items: any):ILocalStorageService; - $reset(items: any):ILocalStorageService; - $apply():void; - - get(key: string): T; - set(key: string, value: T): T; + export interface IStorageService { + $default(items: {}): IStorageService; + $reset(items?: {}): IStorageService; + $apply(): void; + $sync(): void; } - 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/nock/nock.d.ts b/nock/nock.d.ts index 208aac9b31..3319456a5e 100644 --- a/nock/nock.d.ts +++ b/nock/nock.d.ts @@ -22,28 +22,45 @@ declare module "nock" { export interface Scope { get(path: string, data?: string): Scope; + get(path: RegExp, data?: string): Scope; post(path: string, data?: string): Scope; post(path: string, data?: Object): Scope; post(path: string, regex?: RegExp): Scope; + post(path: RegExp, data?: string): Scope; + post(path: RegExp, data?: Object): Scope; + post(path: RegExp, regex?: RegExp): Scope; patch(path: string, data?: string): Scope; patch(path: string, data?: Object): Scope; patch(path: string, regex?: RegExp): Scope; + patch(path: RegExp, data?: string): Scope; + patch(path: RegExp, data?: Object): Scope; + patch(path: RegExp, regex?: RegExp): Scope; put(path: string, data?: string): Scope; put(path: string, data?: Object): Scope; put(path: string, regex?: RegExp): Scope; + put(path: RegExp, data?: string): Scope; + put(path: RegExp, data?: Object): Scope; + put(path: RegExp, regex?: RegExp): Scope; head(path: string): Scope; + head(path: RegExp): Scope; delete(path: string, data?: string): Scope; delete(path: string, data?: Object): Scope; delete(path: string, regex?: RegExp): Scope; + delete(path: RegExp, data?: string): Scope; + delete(path: RegExp, data?: Object): Scope; + delete(path: RegExp, regex?: RegExp): Scope; merge(path: string, data?: string): Scope; merge(path: string, data?: Object): Scope; merge(path: string, regex?: RegExp): Scope; + merge(path: RegExp, data?: string): Scope; + merge(path: RegExp, data?: Object): Scope; + merge(path: RegExp, regex?: RegExp): Scope; query(params: any): Scope; query(acceptAnyParams: boolean): Scope; @@ -51,6 +68,9 @@ declare module "nock" { intercept(path: string, verb: string, body?: string, options?: any): Scope; intercept(path: string, verb: string, body?: Object, options?: any): Scope; intercept(path: string, verb: string, body?: RegExp, options?: any): Scope; + intercept(path: RegExp, verb: string, body?: string, options?: any): Scope; + intercept(path: RegExp, verb: string, body?: Object, options?: any): Scope; + intercept(path: RegExp, verb: string, body?: RegExp, options?: any): Scope; reply(responseCode: number, body?: string, headers?: Object): Scope; reply(responseCode: number, body?: Object, headers?: Object): Scope; diff --git a/node-schedule/node-schedule-tests.ts b/node-schedule/node-schedule-tests.ts index bc4dbbd743..bc8626767d 100644 --- a/node-schedule/node-schedule-tests.ts +++ b/node-schedule/node-schedule-tests.ts @@ -6,12 +6,85 @@ import nodeSchedule = require("node-schedule"); * Test for {@link Job} class. */ function testJob() { - var name: string = ''; - var job: Function = null; + var name:string = ''; + var jc:nodeSchedule.JobCallback = null; var callback: Function = null; - new nodeSchedule.Job(job, callback); - new nodeSchedule.Job(name, job, callback); + var jobSpec:nodeSchedule.Job = new nodeSchedule.Job(jc); + var job:nodeSchedule.Job = new nodeSchedule.Job(jc, callback); + var job:nodeSchedule.Job = new nodeSchedule.Job(name, jc, callback); + + var jobName:string = job.name; +} + +function testTrackInvocation() { + var job:nodeSchedule.Job = new nodeSchedule.Job(() => {}); + var success:boolean = job.trackInvocation( + new nodeSchedule.Invocation(job, new Date(), new nodeSchedule.RecurrenceRule(0, 0, 0, 0, 0, 0, 0)) + ); +} + +function testStopTrackingInvocation() { + var job:nodeSchedule.Job = new nodeSchedule.Job(() => {}); + var success = job.stopTrackingInvocation( + new nodeSchedule.Invocation(job, new Date(), new nodeSchedule.RecurrenceRule(0, 0, 0, 0, 0, 0, 0)) + ); +} + +function testTriggeredJobs() { + var job:nodeSchedule.Job = new nodeSchedule.Job(() => {}); + var triggeredJobs:number = job.triggeredJobs(); +} + +function testSetTriggeredJobs() { + var job:nodeSchedule.Job = new nodeSchedule.Job(() => {}); + job.setTriggeredJobs(19); +} + +function testCancel() { + var job:nodeSchedule.Job = new nodeSchedule.Job(() => {}); + var success:boolean = job.cancel(); + var success:boolean = job.cancel(true); +} + +function testCancelNext() { + var job:nodeSchedule.Job = new nodeSchedule.Job(() => {}); + var success:boolean = job.cancelNext(); + var success:boolean = job.cancelNext(true); +} + +function testReschedule() { + var job:nodeSchedule.Job = new nodeSchedule.Job(() => {}); + var success:boolean = job.reschedule(''); + var success:boolean = job.reschedule(1234); + var success:boolean = job.reschedule(new nodeSchedule.RecurrenceRule(0, 0, 0, 0, 0, 0, 0)); +} + +function testNextInvocation() { + var job:nodeSchedule.Job = new nodeSchedule.Job(() => {}); + var nextInvocation:Date = job.nextInvocation(); +} + +function testPendingInvocations() { + var job:nodeSchedule.Job = new nodeSchedule.Job(() => {}); + var pendingInvocations:nodeSchedule.Invocation[] = job.pendingInvocations(); +} + +function testInvoke() { + var job:nodeSchedule.Job = new nodeSchedule.Job(() => {}); + job.invoke(); +} + +function testRunOnDate() { + var job:nodeSchedule.Job = new nodeSchedule.Job(() => {}); + job.runOnDate(new Date()); +} + +function testSchedule() { + var job:nodeSchedule.Job = new nodeSchedule.Job(() => {}); + var success:boolean = job.schedule(new Date()); + success = job.schedule(''); + success = job.schedule(1234); } /** @@ -19,10 +92,10 @@ function testJob() { */ function testRange() { var range = new nodeSchedule.Range(0); - var twoParametersRange = new nodeSchedule.Range(0, 0); - var threeParametersRange = new nodeSchedule.Range(0, 0, 0); + var twoParametersRange:nodeSchedule.Range = new nodeSchedule.Range(0, 0); + var threeParametersRange:nodeSchedule.Range = new nodeSchedule.Range(0, 0, 0); - var contained: boolean = range.contains(0); + var contained:boolean = range.contains(0); } /** @@ -30,50 +103,51 @@ function testRange() { */ function testRecurrenceRule() { var range = new nodeSchedule.Range(0, 0, 0); - var rule: nodeSchedule.RecurrenceRule = { - date: 0, - dayOfWeek: [0, range], - hour: 0, - minute: 0, - month: 0, - second: 0, - year: 0 - } + var rule:nodeSchedule.RecurrenceRule = new nodeSchedule.RecurrenceRule(0, 0, 0, [0, range], 0, 0, 0); + var rule:nodeSchedule.RecurrenceRule = new nodeSchedule.RecurrenceRule(0, 0, 0, 0, 0, 0, 0); + + var nextInvocation:Date = rule.nextInvocationDate(new Date()); } /** * Test for {@link Invocation} class. */ function testInvocation() { - var job = new nodeSchedule.Job(); + var job = new nodeSchedule.Job(() => {}); var fireDate = new Date(); - var rule: nodeSchedule.RecurrenceRule = {}; + var rule: nodeSchedule.RecurrenceRule = new nodeSchedule.RecurrenceRule(0, 0, 0, 0, 0, 0, 0); var invocation = new nodeSchedule.Invocation(job, fireDate, rule); invocation.timerID = 0; } /** - * Test for {@link ScheduleJob} class. + * Test for {@link scheduleJob} class. */ function testScheduleJob() { - var callback: Function = null; - nodeSchedule.scheduleJob('', callback); + var callback: nodeSchedule.JobCallback = null; + var job:nodeSchedule.Job = nodeSchedule.scheduleJob('', callback); - var rule: nodeSchedule.RecurrenceRule = {}; - nodeSchedule.scheduleJob(rule, callback); + var rule: nodeSchedule.RecurrenceRule = new nodeSchedule.RecurrenceRule(0, 0, 0, 0, 0, 0, 0); + var job:nodeSchedule.Job = nodeSchedule.scheduleJob(rule, callback); var date: Date = new Date(); - nodeSchedule.scheduleJob(date, callback); + var job:nodeSchedule.Job = nodeSchedule.scheduleJob(date, callback); +} - var date: Date = new Date(); - nodeSchedule.scheduleJob(date, callback); +function testRescheduleJob() { + var job:nodeSchedule.Job = nodeSchedule.rescheduleJob(new nodeSchedule.Job(() => {}), new Date()); + job = nodeSchedule.rescheduleJob(new nodeSchedule.Job(() => {}), new nodeSchedule.RecurrenceRule(0, 0, 0, 0, 0, 0, 0)); + job = nodeSchedule.rescheduleJob(new nodeSchedule.Job(() => {}), ''); + job = nodeSchedule.rescheduleJob('', ''); } /** * Test for {@link cancelJob} function. */ function testCancelJob() { - var job = new nodeSchedule.Job(); - nodeSchedule.cancelJob(job); + var job = new nodeSchedule.Job(() => {}); + var success:boolean = nodeSchedule.cancelJob(job); + + success = nodeSchedule.cancelJob('jobName'); } diff --git a/node-schedule/node-schedule.d.ts b/node-schedule/node-schedule.d.ts index 17dbb8402a..5127eafb40 100644 --- a/node-schedule/node-schedule.d.ts +++ b/node-schedule/node-schedule.d.ts @@ -1,70 +1,120 @@ -// Type definitions for node-schedule +// Type definitions for node-schedule 1.1.0 // Project: https://github.com/tejasmanohar/node-schedule/ -// Definitions by: Cyril Schumacher +// Definitions by: Cyril Schumacher , Florian Plattner // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -declare module "node-schedule" { +/// + +declare module 'node-schedule' { import nodeSchedule = require('node-schedule'); + import {EventEmitter} from 'events'; /** - * Recurrence rules. + * The callback executed by a Job */ - export interface RecurrenceRule { + export interface JobCallback { + ():void; + } + + /** + * Scheduler jobs. + * + * @class + */ + export class Job extends EventEmitter { /** - * Day of the month. - * - * @public - * @type {number} + * This Job's name. read-only. */ - date?: number; + name:string; /** - * Day of the week. + * Use the function scheduleJob() to create new Job objects. * - * @public - * @type {number|Array} + * @constructor + * @internal + * @param {string|JobCallback} name either an optional name for this Job or this Job's callback + * @param {JobCallback|Function} job either this Job's callback or an optional callback function + * @param {Function} callback optional callback that is executed right before the JobCallback */ - dayOfWeek?: number|Array; + constructor(name: string|JobCallback, job?: JobCallback|Function, callback?: Function); /** - * Hour. - * - * @public - * @type {number} + * Adds an Invocation to this job. For internal use. + * @internal + * @param {Invocation} invokation + * @return {boolean} whether the invocation could be added */ - hour?: number; + trackInvocation(invokation:Invocation):boolean; /** - * Minute. - * - * @public - * @type {number} + * removes an Invocation from this Job's tracking list. For internal use. + * @internal + * @param invocation {Invocation} + * @return boolean whether the invocation was successful. Removing an Invocation that doesn't exist, returns false. */ - minute?: number; + stopTrackingInvocation(invocation:Invocation):boolean; /** - * Month. - * - * @public - * @type {number} + * @internal + * @return {number} the number of currently running instances of this Job. */ - month?: number; + triggeredJobs():number; /** - * Second. - * - * @public - * @type {number} + * set the number of currently running Jobs. + * @internal + * @param triggeredJobs */ - second?: number; + setTriggeredJobs(triggeredJobs:number):void; /** - * Year. - * - * @public - * @type {number} + * cancel all pending Invocations of this Job. + * @param reschedule {boolean} whether to reschedule the canceled Invocations. */ - year?: number; + cancel(reschedule?:boolean):boolean; + + /** + * cancel the next Invocation of this Job. + * @param reschedule {boolean} whether to reschedule the canceled Invocation. + * @return {boolean} whether cancelation was successful + */ + cancelNext(reschedule?:boolean):boolean; + + /** + * Changes the scheduling information for this Job. + * @param spec {RecurrenceRule|string|number} the + * @return {boolean} whether the reschedule was successful + */ + reschedule(spec:RecurrenceRule|string|number):boolean; + + /** + * Returns the Date on which this Job will be run next. + * @return {Date} + */ + nextInvocation():Date; + + /** + * @return Invocation[] a list of all pending Invocations + */ + pendingInvocations():Invocation[]; + + /** + * run this Job immediately. + */ + invoke():void; + + /** + * schedule this Job to be run on the specified date. + * @param date {Date} + */ + runOnDate(date:Date): void; + + /** + * set scheduling information + * @param {Date|string|number} date + * @public + */ + schedule(date: Date|string|number): boolean; } /** @@ -93,43 +143,74 @@ declare module "node-schedule" { } /** - * Scheduler jobs. - * - * @class + * Recurrence rules. */ - export class Job { + export class RecurrenceRule { /** - * Constructor. - * - * @constructor - * @param {RecurrenceRule} rule The rule. - * @param {callback} callback The callback. - */ - constructor(name?: string, job?: Function, callback?: Function); - - /** - * Constructor. - * - * @constructor - * @param {RecurrenceRule} rule The rule. - * @param - */ - constructor(job?: Function, callback?: Function); - - /** - * Attach an event handler function. + * Day of the month. * * @public - * @param {string} eventName The event name. - * @param {Function} handler The function to execute when the event is triggered. + * @type {number} */ - on(eventName: string, handler: Function): void; + date: number; /** + * Day of the week. * * @public + * @type {number|Array} */ - schedule(date: Date): void; + dayOfWeek: number|Array; + + /** + * Hour. + * + * @public + * @type {number} + */ + hour: number; + + /** + * Minute. + * + * @public + * @type {number} + */ + minute: number; + + /** + * Month. + * + * @public + * @type {number} + */ + month: number; + + /** + * Second. + * + * @public + * @type {number} + */ + second: number; + + /** + * Year. + * + * @public + * @type {number} + */ + year: number; + + constructor(year:number, + month:number, + date:number, + dayOfWeek:number|Array, + hour:number, + minute:number, + second:number); + + nextInvocationDate(base:Date):Date; } /** @@ -181,19 +262,34 @@ declare module "node-schedule" { constructor(job: Job, fireDate: Date, recurrenceRule: RecurrenceRule); } + /** + * Create a schedule job. + * + * @param {string|RecurrenceRule|Date} name either an optional name for the new Job or scheduling information + * @param {RecurrenceRule|Date|string} rule either the scheduling info or the JobCallback + * @param {JobCallback} callback The callback to be executed on each invocation. + */ + export function scheduleJob(name:string|RecurrenceRule|Date, rule: RecurrenceRule|Date|string|JobCallback, callback?: JobCallback): Job; + + /** + * Changes the timing of a Job, canceling all pending invocations. + * + * @param job {Job} + * @param spec {JobCallback} the new timing for this Job + * @return {Job} if the job could be rescheduled, {null} otherwise. + */ + export function rescheduleJob(job:Job|string, spec:RecurrenceRule|Date|string):Job; + + /** + * Dictionary of all Jobs, accessible by name. + */ + export let scheduledJobs:{[jobName:string]:Job}; + /** * Cancels the job. * * @param {Job} job The job. * @returns {boolean} {true} if the job has been cancelled with success, otherwise, {false}. */ - export function cancelJob(job: Job): boolean; - - /** - * Create a schedule job. - * - * @param {RecurrenceRule} rule The rule. - * @param {Function} callback The callback. - */ - export function scheduleJob(rule: RecurrenceRule|Date|string, callback: Function): void; + export function cancelJob(job: Job|string): boolean; } diff --git a/node/node-0.11-tests.ts b/node/node-0.11-tests.ts index 8609639a8c..66c0c9ec7c 100644 --- a/node/node-0.11-tests.ts +++ b/node/node-0.11-tests.ts @@ -24,7 +24,8 @@ assert.notStrictEqual(2, "2", "uses === comparator"); assert.throws(() => { throw "a hammer at your face"; }, undefined, "DODGED IT"); assert.doesNotThrow(() => { - if (false) { throw "a hammer at your face"; } + const b = false; + if (b) { throw "a hammer at your face"; } }, undefined, "What the...*crunch*"); //////////////////////////////////////////////////// diff --git a/node/node-0.12-tests.ts b/node/node-0.12-tests.ts index 2560181896..989b69dab0 100644 --- a/node/node-0.12-tests.ts +++ b/node/node-0.12-tests.ts @@ -26,7 +26,8 @@ assert.notStrictEqual(2, "2", "uses === comparator"); assert.throws(() => { throw "a hammer at your face"; }, undefined, "DODGED IT"); assert.doesNotThrow(() => { - if (false) { throw "a hammer at your face"; } + const b = false; + if (b) { throw "a hammer at your face"; } }, undefined, "What the...*crunch*"); //////////////////////////////////////////////////// diff --git a/node/node-4-tests.ts b/node/node-4-tests.ts new file mode 100644 index 0000000000..8ead0224a2 --- /dev/null +++ b/node/node-4-tests.ts @@ -0,0 +1,814 @@ +/// +import * as assert from "assert"; +import * as fs from "fs"; +import * as events from "events"; +import * as zlib from "zlib"; +import * as url from "url"; +import * as util from "util"; +import * as crypto from "crypto"; +import * as tls from "tls"; +import * as http from "http"; +import * as https from "https"; +import * as net from "net"; +import * as tty from "tty"; +import * as dgram from "dgram"; +import * as querystring from "querystring"; +import * as path from "path"; +import * as readline from "readline"; +import * as childProcess from "child_process"; +import * as cluster from "cluster"; +import * as os from "os"; +import * as vm from "vm"; +// Specifically test buffer module regression. +import {Buffer as ImportedBuffer, SlowBuffer as ImportedSlowBuffer} from "buffer"; + +assert(1 + 1 - 2 === 0, "The universe isn't how it should."); + +assert.deepEqual({ x: { y: 3 } }, { x: { y: 3 } }, "DEEP WENT DERP"); + +assert.equal(3, "3", "uses == comparator"); + +assert.notStrictEqual(2, "2", "uses === comparator"); + +assert.notDeepStrictEqual({ x: { y: "3" } }, { x: { y: 3 } }, "uses === comparator"); + +assert.throws(() => { throw "a hammer at your face"; }, undefined, "DODGED IT"); + +assert.doesNotThrow(() => { + const b = false; + if (b) { throw "a hammer at your face"; } +}, undefined, "What the...*crunch*"); + +//////////////////////////////////////////////////// +/// Events tests : http://nodejs.org/api/events.html +//////////////////////////////////////////////////// + +namespace events_tests { + let emitter: events.EventEmitter; + let event: string; + let listener: Function; + let any: any; + + { + let result: events.EventEmitter; + + result = emitter.addListener(event, listener); + result = emitter.on(event, listener); + result = emitter.once(event, listener); + result = emitter.removeListener(event, listener); + result = emitter.removeAllListeners(); + result = emitter.removeAllListeners(event); + result = emitter.setMaxListeners(42); + } + + { + let result: number; + + result = events.EventEmitter.defaultMaxListeners; + result = events.EventEmitter.listenerCount(emitter, event); // deprecated + + result = emitter.getMaxListeners(); + result = emitter.listenerCount(event); + } + + { + let result: Function[]; + + result = emitter.listeners(event); + } + + { + let result: boolean; + + result = emitter.emit(event); + result = emitter.emit(event, any); + result = emitter.emit(event, any, any); + result = emitter.emit(event, any, any, any); + } +} + +//////////////////////////////////////////////////// +/// File system tests : http://nodejs.org/api/fs.html +//////////////////////////////////////////////////// +fs.writeFile("thebible.txt", + "Do unto others as you would have them do unto you.", + assert.ifError); + +fs.write(1234, "test"); + +fs.writeFile("Harry Potter", + "\"You be wizzing, Harry,\" jived Dumbledore.", + { + encoding: "ascii" + }, + assert.ifError); + +var content: string, + buffer: Buffer; + +content = fs.readFileSync('testfile', 'utf8'); +content = fs.readFileSync('testfile', {encoding : 'utf8'}); +buffer = fs.readFileSync('testfile'); +buffer = fs.readFileSync('testfile', {flag : 'r'}); +fs.readFile('testfile', 'utf8', (err, data) => content = data); +fs.readFile('testfile', {encoding : 'utf8'}, (err, data) => content = data); +fs.readFile('testfile', (err, data) => buffer = data); +fs.readFile('testfile', {flag : 'r'}, (err, data) => buffer = data); + +class Networker extends events.EventEmitter { + constructor() { + super(); + + this.emit("mingling"); + } +} + +var errno: number; +fs.readFile('testfile', (err, data) => { + if (err && err.errno) { + errno = err.errno; + } +}); + +fs.mkdtemp('/tmp/foo-', (err, folder) => { + console.log(folder); + // Prints: /tmp/foo-itXde2 +}); + +var tempDir: string; +tempDir = fs.mkdtempSync('/tmp/foo-'); + +/////////////////////////////////////////////////////// +/// Buffer tests : https://nodejs.org/api/buffer.html +/////////////////////////////////////////////////////// + +function bufferTests() { + var utf8Buffer = new Buffer('test'); + 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')); + console.log(Buffer.byteLength('xyz123')); + console.log(Buffer.byteLength('xyz123', 'ascii')); + var result1 = Buffer.concat([utf8Buffer, base64Buffer]); + var result2 = Buffer.concat([utf8Buffer, base64Buffer], 9999999); + + // Class Method: Buffer.from(array) + { + const buf: Buffer = Buffer.from([0x62,0x75,0x66,0x66,0x65,0x72]); + } + + // Class Method: Buffer.from(arrayBuffer[, byteOffset[, length]]) + { + const arr: Uint16Array = new Uint16Array(2); + arr[0] = 5000; + arr[1] = 4000; + + let buf: Buffer; + buf = Buffer.from(arr.buffer); + buf = Buffer.from(arr.buffer, 1); + buf = Buffer.from(arr.buffer, 0, 1); + } + + // Class Method: Buffer.from(buffer) + { + const buf1: Buffer = Buffer.from('buffer'); + const buf2: Buffer = Buffer.from(buf1); + } + + // Class Method: Buffer.from(str[, encoding]) + { + const buf1: Buffer = Buffer.from('this is a tést'); + const buf2: Buffer = Buffer.from('7468697320697320612074c3a97374', 'hex'); + } + + // Test that TS 1.6 works with the 'as Buffer' annotation + // on isBuffer. + var a: Buffer | number; + a = new Buffer(10); + if (Buffer.isBuffer(a)) { + a.writeUInt8(3, 4); + } + + // write* methods return offsets. + var b = new Buffer(16); + var result: number = b.writeUInt32LE(0, 0); + result = b.writeUInt16LE(0, 4); + result = b.writeUInt8(0, 6); + result = b.writeInt8(0, 7); + result = b.writeDoubleLE(0, 8); + + // fill returns the input buffer. + b.fill('a').fill('b'); + + { + let buffer = new Buffer('123'); + let index: number; + index = buffer.indexOf("23"); + index = buffer.indexOf("23", 1); + index = buffer.indexOf(23); + index = buffer.indexOf(buffer); + } + + // Imported Buffer from buffer module works properly + { + let b = new ImportedBuffer('123'); + b.writeUInt8(0, 6); + 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); + } +} + + +//////////////////////////////////////////////////// +/// Url tests : http://nodejs.org/api/url.html +//////////////////////////////////////////////////// + +url.format(url.parse('http://www.example.com/xyz')); + +// https://google.com/search?q=you're%20a%20lizard%2C%20gary +url.format({ + protocol: 'https', + host: "google.com", + pathname: 'search', + query: { q: "you're a lizard, gary" } +}); + +var helloUrl = url.parse('http://example.com/?hello=world', true) +assert.equal(helloUrl.query.hello, 'world'); + + +// Old and new util.inspect APIs +util.inspect(["This is nice"], false, 5); +util.inspect(["This is nice"], { colors: true, depth: 5, customInspect: false }); + +//////////////////////////////////////////////////// +/// Stream tests : http://nodejs.org/api/stream.html +//////////////////////////////////////////////////// + +// http://nodejs.org/api/stream.html#stream_readable_pipe_destination_options +function stream_readable_pipe_test() { + var r = fs.createReadStream('file.txt'); + var z = zlib.createGzip(); + var w = fs.createWriteStream('file.txt.gz'); + r.pipe(z).pipe(w); + r.close(); +} + +//////////////////////////////////////////////////// +/// Crypto tests : http://nodejs.org/api/crypto.html +//////////////////////////////////////////////////// + +var hmacResult: string = crypto.createHmac('md5', 'hello').update('world').digest('hex'); + +{ + let hmac: crypto.Hmac; + (hmac = crypto.createHmac('md5', 'hello')).end('world', 'utf8', () => { + let hash: Buffer|string = hmac.read(); + }); +} + +function crypto_cipher_decipher_string_test() { + var key:Buffer = new Buffer([1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7]); + var clearText:string = "This is the clear text."; + var cipher:crypto.Cipher = crypto.createCipher("aes-128-ecb", key); + var cipherText:string = cipher.update(clearText, "utf8", "hex"); + cipherText += cipher.final("hex"); + + var decipher:crypto.Decipher = crypto.createDecipher("aes-128-ecb", key); + var clearText2:string = decipher.update(cipherText, "hex", "utf8"); + clearText2 += decipher.final("utf8"); + + assert.equal(clearText2, clearText); +} + +function crypto_cipher_decipher_buffer_test() { + var key:Buffer = new Buffer([1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7]); + var clearText:Buffer = new Buffer([1, 2, 3, 4, 5, 6, 7, 8, 9, 8, 7, 6, 5, 4]); + var cipher:crypto.Cipher = crypto.createCipher("aes-128-ecb", key); + var cipherBuffers:Buffer[] = []; + cipherBuffers.push(cipher.update(clearText)); + cipherBuffers.push(cipher.final()); + + var cipherText:Buffer = Buffer.concat(cipherBuffers); + + var decipher:crypto.Decipher = crypto.createDecipher("aes-128-ecb", key); + var decipherBuffers:Buffer[] = []; + decipherBuffers.push(decipher.update(cipherText)); + decipherBuffers.push(decipher.final()); + + var clearText2:Buffer = Buffer.concat(decipherBuffers); + + assert.deepEqual(clearText2, clearText); +} + +//////////////////////////////////////////////////// +/// TLS tests : http://nodejs.org/api/tls.html +//////////////////////////////////////////////////// + +var ctx: tls.SecureContext = tls.createSecureContext({ + key: "NOT REALLY A KEY", + cert: "SOME CERTIFICATE", +}); +var blah = ctx.context; + +var tlsOpts: tls.TlsOptions = { + host: "127.0.0.1", + port: 55 +}; +var tlsSocket = tls.connect(tlsOpts); + + +//////////////////////////////////////////////////// + +// Make sure .listen() and .close() retuern a Server instance +http.createServer().listen(0).close().address(); +net.createServer().listen(0).close().address(); + +var request = http.request('http://0.0.0.0'); +request.once('error', function () {}); +request.setNoDelay(true); +request.abort(); + +//////////////////////////////////////////////////// +/// Http tests : http://nodejs.org/api/http.html +//////////////////////////////////////////////////// +namespace http_tests { + // Status codes + var code = 100; + var codeMessage = http.STATUS_CODES['400']; + var codeMessage = http.STATUS_CODES[400]; + + var agent: http.Agent = new http.Agent({ + keepAlive: true, + keepAliveMsecs: 10000, + maxSockets: Infinity, + maxFreeSockets: 256 + }); + + var agent: http.Agent = http.globalAgent; + + http.request({ + agent: false + }); + http.request({ + agent: agent + }); + http.request({ + agent: undefined + }); +} + +//////////////////////////////////////////////////// +/// Https tests : http://nodejs.org/api/https.html +//////////////////////////////////////////////////// +namespace https_tests { + var agent: https.Agent = new https.Agent({ + keepAlive: true, + keepAliveMsecs: 10000, + maxSockets: Infinity, + maxFreeSockets: 256, + maxCachedSessions: 100 + }); + + var agent: https.Agent = https.globalAgent; + + https.request({ + agent: false + }); + https.request({ + agent: agent + }); + https.request({ + agent: undefined + }); +} + +//////////////////////////////////////////////////// +/// TTY tests : http://nodejs.org/api/tty.html +//////////////////////////////////////////////////// + +namespace tty_tests { + let rs: tty.ReadStream; + let ws: tty.WriteStream; + + let rsIsRaw: boolean = rs.isRaw; + rs.setRawMode(true); + + let wsColumns: number = ws.columns; + let wsRows: number = ws.rows; + + let isTTY: boolean = tty.isatty(1); +} + +//////////////////////////////////////////////////// +/// Dgram tests : http://nodejs.org/api/dgram.html +//////////////////////////////////////////////////// + +var ds: dgram.Socket = dgram.createSocket("udp4", (msg: Buffer, rinfo: dgram.RemoteInfo): void => { +}); +var ai: dgram.AddressInfo = ds.address(); +ds.send(new Buffer("hello"), 0, 5, 5000, "127.0.0.1", (error: Error, bytes: number): void => { +}); + +//////////////////////////////////////////////////// +///Querystring tests : https://nodejs.org/api/querystring.html +//////////////////////////////////////////////////// + +namespace querystring_tests { + type SampleObject = {a: string; b: number;} + + { + let obj: SampleObject; + let sep: string; + let eq: string; + let options: querystring.StringifyOptions; + let result: string; + + result = querystring.stringify(obj); + result = querystring.stringify(obj, sep); + result = querystring.stringify(obj, sep, eq); + result = querystring.stringify(obj, sep, eq); + result = querystring.stringify(obj, sep, eq, options); + } + + { + let str: string; + let sep: string; + let eq: string; + let options: querystring.ParseOptions; + let result: SampleObject; + + result = querystring.parse(str); + result = querystring.parse(str, sep); + result = querystring.parse(str, sep, eq); + result = querystring.parse(str, sep, eq, options); + } + + { + let str: string; + let result: string; + + result = querystring.escape(str); + result = querystring.unescape(str); + } +} + +//////////////////////////////////////////////////// +/// path tests : http://nodejs.org/api/path.html +//////////////////////////////////////////////////// + +namespace path_tests { + + path.normalize('/foo/bar//baz/asdf/quux/..'); + + path.join('/foo', 'bar', 'baz/asdf', 'quux', '..'); + // returns + //'/foo/bar/baz/asdf' + + try { + path.join('foo', {}, 'bar'); + } + catch(error) { + + } + + path.resolve('foo/bar', '/tmp/file/', '..', 'a/../subfile'); + //Is similar to: + // + //cd foo/bar + //cd /tmp/file/ + //cd .. + // cd a/../subfile + //pwd + + path.resolve('/foo/bar', './baz') + // returns + // '/foo/bar/baz' + + path.resolve('/foo/bar', '/tmp/file/') + // returns + // '/tmp/file' + + path.resolve('wwwroot', 'static_files/png/', '../gif/image.gif') + // if currently in /home/myself/node, it returns + // '/home/myself/node/wwwroot/static_files/gif/image.gif' + + path.isAbsolute('/foo/bar') // true + path.isAbsolute('/baz/..') // true + path.isAbsolute('qux/') // false + path.isAbsolute('.') // false + + path.isAbsolute('//server') // true + path.isAbsolute('C:/foo/..') // true + path.isAbsolute('bar\\baz') // false + path.isAbsolute('.') // false + + path.relative('C:\\orandea\\test\\aaa', 'C:\\orandea\\impl\\bbb') +// returns +// '..\\..\\impl\\bbb' + + path.relative('/data/orandea/test/aaa', '/data/orandea/impl/bbb') +// returns +// '../../impl/bbb' + + path.dirname('/foo/bar/baz/asdf/quux') +// returns +// '/foo/bar/baz/asdf' + + path.basename('/foo/bar/baz/asdf/quux.html') +// returns +// 'quux.html' + + path.basename('/foo/bar/baz/asdf/quux.html', '.html') +// returns +// 'quux' + + path.extname('index.html') +// returns +// '.html' + + path.extname('index.coffee.md') +// returns +// '.md' + + path.extname('index.') +// returns +// '.' + + path.extname('index') +// returns +// '' + + 'foo/bar/baz'.split(path.sep) +// returns +// ['foo', 'bar', 'baz'] + + 'foo\\bar\\baz'.split(path.sep) +// returns +// ['foo', 'bar', 'baz'] + + console.log(process.env.PATH) +// '/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin' + + process.env.PATH.split(path.delimiter) +// returns +// ['/usr/bin', '/bin', '/usr/sbin', '/sbin', '/usr/local/bin'] + + console.log(process.env.PATH) +// 'C:\Windows\system32;C:\Windows;C:\Program Files\nodejs\' + + process.env.PATH.split(path.delimiter) +// returns +// ['C:\Windows\system32', 'C:\Windows', 'C:\Program Files\nodejs\'] + + path.parse('/home/user/dir/file.txt') +// returns +// { +// root : "/", +// dir : "/home/user/dir", +// base : "file.txt", +// ext : ".txt", +// name : "file" +// } + + path.parse('C:\\path\\dir\\index.html') +// returns +// { +// root : "C:\", +// dir : "C:\path\dir", +// base : "index.html", +// ext : ".html", +// name : "index" +// } + + path.format({ + root : "/", + dir : "/home/user/dir", + base : "file.txt", + ext : ".txt", + name : "file" + }); +// returns +// '/home/user/dir/file.txt' +} + +//////////////////////////////////////////////////// +/// readline tests : https://nodejs.org/api/readline.html +//////////////////////////////////////////////////// + +namespace readline_tests { + let rl: readline.ReadLine; + + { + let options: readline.ReadLineOptions; + let input: NodeJS.ReadableStream; + let output: NodeJS.WritableStream; + let completer: readline.Completer; + let terminal: boolean; + + let result: readline.ReadLine; + + result = readline.createInterface(options); + result = readline.createInterface(input); + result = readline.createInterface(input, output); + result = readline.createInterface(input, output, completer); + result = readline.createInterface(input, output, completer, terminal); + } + + { + let prompt: string; + + rl.setPrompt(prompt); + } + + { + let preserveCursor: boolean; + + rl.prompt(); + rl.prompt(preserveCursor); + } + + { + let query: string; + let callback: (answer: string) => void; + + rl.question(query, callback); + } + + { + let result: readline.ReadLine; + + result = rl.pause(); + } + + { + let result: readline.ReadLine; + + result = rl.resume(); + } + + { + rl.close(); + } + + { + let data: string|Buffer; + let key: readline.Key; + + rl.write(data); + rl.write(null, key); + } + + { + let stream: NodeJS.WritableStream; + let x: number; + let y: number; + + readline.cursorTo(stream, x, y); + } + + { + let stream: NodeJS.WritableStream; + let dx: number|string; + let dy: number|string; + + readline.moveCursor(stream, dx, dy); + } + + { + let stream: NodeJS.WritableStream; + let dir: number; + + readline.clearLine(stream, dir); + } + + { + let stream: NodeJS.WritableStream; + + readline.clearScreenDown(stream); + } +} + +////////////////////////////////////////////////////////////////////// +/// Child Process tests: https://nodejs.org/api/child_process.html /// +////////////////////////////////////////////////////////////////////// + +childProcess.exec("echo test"); +childProcess.spawnSync("echo test"); + +////////////////////////////////////////////////////////////////////// +/// cluster tests: https://nodejs.org/api/cluster.html /// +////////////////////////////////////////////////////////////////////// + +cluster.fork(); +Object.keys(cluster.workers).forEach(key => { + const worker = cluster.workers[key]; + if (worker.isDead()) { + console.log('worker %d is dead', worker.process.pid); + } +}); + +//////////////////////////////////////////////////// +/// os tests : https://nodejs.org/api/os.html +//////////////////////////////////////////////////// + +namespace os_tests { + { + let result: string; + + result = os.tmpdir(); + result = os.homedir(); + result = os.endianness(); + result = os.hostname(); + result = os.type(); + result = os.platform(); + result = os.arch(); + result = os.release(); + result = os.EOL; + } + + { + let result: number; + + result = os.uptime(); + result = os.totalmem(); + result = os.freemem(); + } + + { + let result: number[]; + + result = os.loadavg(); + } + + { + let result: os.CpuInfo[]; + + result = os.cpus(); + } + + { + let result: {[index: string]: os.NetworkInterfaceInfo[]}; + + result = os.networkInterfaces(); + } +} + +//////////////////////////////////////////////////// +/// vm tests : https://nodejs.org/api/vm.html +//////////////////////////////////////////////////// + +namespace vm_tests { + { + const sandbox = { + animal: 'cat', + count: 2 + }; + + const context = vm.createContext(sandbox); + console.log(vm.isContext(context)); + const script = new vm.Script('count += 1; name = "kitty"'); + + for (let i = 0; i < 10; ++i) { + script.runInContext(context); + } + + console.log(util.inspect(sandbox)); + + vm.runInNewContext('count += 1; name = "kitty"', sandbox); + console.log(util.inspect(sandbox)); + } + + { + const sandboxes = [{}, {}, {}]; + + const script = new vm.Script('globalVar = "set"'); + + sandboxes.forEach((sandbox) => { + script.runInNewContext(sandbox); + script.runInThisContext(); + }); + + console.log(util.inspect(sandboxes)); + + var localVar = 'initial value'; + vm.runInThisContext('localVar = "vm";'); + + console.log(localVar); + } + + { + const Debug = vm.runInDebugContext('Debug'); + Debug.scripts().forEach(function(script: any) { console.log(script.name); }); + } +} diff --git a/node/node-4.d.ts b/node/node-4.d.ts new file mode 100644 index 0000000000..0cd3c54a17 --- /dev/null +++ b/node/node-4.d.ts @@ -0,0 +1,2390 @@ +// Type definitions for Node.js v4.x +// Project: http://nodejs.org/ +// Definitions by: Microsoft TypeScript , DefinitelyTyped +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/************************************************ +* * +* Node.js v4.x API * +* * +************************************************/ + +interface Error { + stack?: string; +} + + +// compat for TypeScript 1.8 +// if you use with --target es3 or --target es5 and use below definitions, +// use the lib.es6.d.ts that is bundled with TypeScript 1.8. +interface MapConstructor {} +interface WeakMapConstructor {} +interface SetConstructor {} +interface WeakSetConstructor {} + +/************************************************ +* * +* GLOBAL * +* * +************************************************/ +declare var process: NodeJS.Process; +declare var global: NodeJS.Global; + +declare var __filename: string; +declare var __dirname: string; + +declare function setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timer; +declare function clearTimeout(timeoutId: NodeJS.Timer): void; +declare function setInterval(callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timer; +declare function clearInterval(intervalId: NodeJS.Timer): void; +declare function setImmediate(callback: (...args: any[]) => void, ...args: any[]): any; +declare function clearImmediate(immediateId: any): void; + +interface NodeRequireFunction { + (id: string): any; +} + +interface NodeRequire extends NodeRequireFunction { + resolve(id:string): string; + cache: any; + extensions: any; + main: any; +} + +declare var require: NodeRequire; + +interface NodeModule { + exports: any; + require: NodeRequireFunction; + id: string; + filename: string; + loaded: boolean; + parent: any; + children: any[]; +} + +declare var module: NodeModule; + +// Same as module.exports +declare var exports: any; +declare var SlowBuffer: { + new (str: string, encoding?: string): Buffer; + new (size: number): Buffer; + new (size: Uint8Array): Buffer; + new (array: any[]): Buffer; + prototype: Buffer; + isBuffer(obj: any): boolean; + byteLength(string: string, encoding?: string): number; + concat(list: Buffer[], totalLength?: number): Buffer; +}; + + +// Buffer class +type BufferEncoding = "ascii" | "utf8" | "utf16le" | "ucs2" | "binary" | "hex"; +interface Buffer extends NodeBuffer {} + +/** + * Raw data is stored in instances of the Buffer class. + * A Buffer is similar to an array of integers but corresponds to a raw memory allocation outside the V8 heap. A Buffer cannot be resized. + * Valid string encodings: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'binary'(deprecated)|'hex' + */ +declare var Buffer: { + /** + * Allocates a new buffer containing the given {str}. + * + * @param str String to store in buffer. + * @param encoding encoding to use, optional. Default is 'utf8' + */ + new (str: string, encoding?: string): Buffer; + /** + * Allocates a new buffer of {size} octets. + * + * @param size count of octets to allocate. + */ + new (size: number): Buffer; + /** + * Allocates a new buffer containing the given {array} of octets. + * + * @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. + * + * @param array The octets to store. + */ + new (array: any[]): Buffer; + /** + * Copies the passed {buffer} data onto a new {Buffer} instance. + * + * @param buffer The buffer to copy. + */ + new (buffer: Buffer): Buffer; + prototype: Buffer; + /** + * Allocates a new Buffer using an {array} of octets. + * + * @param array + */ + from(array: any[]): Buffer; + /** + * When passed a reference to the .buffer property of a TypedArray instance, + * the newly created Buffer will share the same allocated memory as the TypedArray. + * The optional {byteOffset} and {length} arguments specify a memory range + * within the {arrayBuffer} that will be shared by the Buffer. + * + * @param arrayBuffer The .buffer property of a TypedArray or a new ArrayBuffer() + * @param byteOffset + * @param length + */ + from(arrayBuffer: ArrayBuffer, byteOffset?: number, length?:number): Buffer; + /** + * Copies the passed {buffer} data onto a new Buffer instance. + * + * @param buffer + */ + from(buffer: Buffer): Buffer; + /** + * Creates a new Buffer containing the given JavaScript string {str}. + * If provided, the {encoding} parameter identifies the character encoding. + * If not provided, {encoding} defaults to 'utf8'. + * + * @param str + */ + from(str: string, encoding?: string): Buffer; + /** + * Returns true if {obj} is a Buffer + * + * @param obj object to test. + */ + isBuffer(obj: any): obj is Buffer; + /** + * Returns true if {encoding} is a valid encoding argument. + * Valid string encodings in Node 0.12: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'binary'(deprecated)|'hex' + * + * @param encoding string to test. + */ + isEncoding(encoding: string): boolean; + /** + * Gives the actual byte length of a string. encoding defaults to 'utf8'. + * This is not the same as String.prototype.length since that returns the number of characters in a string. + * + * @param string string to test. + * @param encoding encoding used to evaluate (defaults to 'utf8') + */ + byteLength(string: string, encoding?: string): number; + /** + * Returns a buffer which is the result of concatenating all the buffers in the list together. + * + * If the list has no items, or if the totalLength is 0, then it returns a zero-length buffer. + * If the list has exactly one item, then the first item of the list is returned. + * If the list has more than one item, then a new Buffer is created. + * + * @param list An array of Buffer objects to concatenate + * @param totalLength Total length of the buffers when concatenated. + * If totalLength is not provided, it is read from the buffers in the list. However, this adds an additional loop to the function, so it is faster to provide the length explicitly. + */ + concat(list: Buffer[], totalLength?: number): Buffer; + /** + * The same as buf1.compare(buf2). + */ + compare(buf1: Buffer, buf2: Buffer): number; +}; + +/************************************************ +* * +* GLOBAL INTERFACES * +* * +************************************************/ +declare namespace NodeJS { + export interface ErrnoException extends Error { + errno?: number; + code?: string; + path?: string; + syscall?: string; + stack?: string; + } + + export interface EventEmitter { + addListener(event: string, listener: Function): this; + on(event: string, listener: Function): this; + once(event: string, listener: Function): this; + removeListener(event: string, listener: Function): this; + removeAllListeners(event?: string): this; + setMaxListeners(n: number): this; + getMaxListeners(): number; + listeners(event: string): Function[]; + emit(event: string, ...args: any[]): boolean; + listenerCount(type: string): number; + } + + export interface ReadableStream extends EventEmitter { + readable: boolean; + read(size?: number): string|Buffer; + setEncoding(encoding: string): void; + pause(): void; + resume(): void; + pipe(destination: T, options?: { end?: boolean; }): T; + unpipe(destination?: T): void; + unshift(chunk: string): void; + unshift(chunk: Buffer): void; + wrap(oldStream: ReadableStream): ReadableStream; + } + + export interface WritableStream extends EventEmitter { + writable: boolean; + 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; + } + + export interface ReadWriteStream extends ReadableStream, WritableStream {} + + export interface Events extends EventEmitter { } + + export interface Domain extends Events { + run(fn: Function): void; + add(emitter: Events): void; + remove(emitter: Events): void; + bind(cb: (err: Error, data: any) => any): any; + intercept(cb: (data: any) => any): any; + dispose(): void; + + addListener(event: string, listener: Function): this; + on(event: string, listener: Function): this; + once(event: string, listener: Function): this; + removeListener(event: string, listener: Function): this; + removeAllListeners(event?: string): this; + } + + export interface MemoryUsage { + rss: number; + heapTotal: number; + heapUsed: number; + } + + export interface Process extends EventEmitter { + stdout: WritableStream; + stderr: WritableStream; + stdin: ReadableStream; + argv: string[]; + execArgv: string[]; + execPath: string; + abort(): void; + chdir(directory: string): void; + cwd(): string; + env: any; + exit(code?: number): void; + getgid(): number; + setgid(id: number): void; + setgid(id: string): void; + getuid(): number; + setuid(id: number): void; + setuid(id: string): void; + version: string; + versions: { + http_parser: string; + node: string; + v8: string; + ares: string; + uv: string; + zlib: string; + openssl: string; + }; + config: { + target_defaults: { + cflags: any[]; + default_configuration: string; + defines: string[]; + include_dirs: string[]; + libraries: string[]; + }; + variables: { + clang: number; + host_arch: string; + node_install_npm: boolean; + node_install_waf: boolean; + node_prefix: string; + node_shared_openssl: boolean; + node_shared_v8: boolean; + node_shared_zlib: boolean; + node_use_dtrace: boolean; + node_use_etw: boolean; + node_use_openssl: boolean; + target_arch: string; + v8_no_strict_aliasing: number; + v8_use_snapshot: boolean; + visibility: string; + }; + }; + kill(pid:number, signal?: string|number): void; + pid: number; + title: string; + arch: string; + platform: string; + memoryUsage(): MemoryUsage; + nextTick(callback: Function): void; + umask(mask?: number): number; + uptime(): number; + hrtime(time?:number[]): number[]; + domain: Domain; + + // Worker + send?(message: any, sendHandle?: any): void; + disconnect(): void; + connected: boolean; + } + + export interface Global { + Array: typeof Array; + ArrayBuffer: typeof ArrayBuffer; + Boolean: typeof Boolean; + Buffer: typeof Buffer; + DataView: typeof DataView; + Date: typeof Date; + Error: typeof Error; + EvalError: typeof EvalError; + Float32Array: typeof Float32Array; + Float64Array: typeof Float64Array; + Function: typeof Function; + GLOBAL: Global; + Infinity: typeof Infinity; + Int16Array: typeof Int16Array; + Int32Array: typeof Int32Array; + Int8Array: typeof Int8Array; + Intl: typeof Intl; + JSON: typeof JSON; + Map: MapConstructor; + Math: typeof Math; + NaN: typeof NaN; + Number: typeof Number; + Object: typeof Object; + Promise: Function; + RangeError: typeof RangeError; + ReferenceError: typeof ReferenceError; + RegExp: typeof RegExp; + Set: SetConstructor; + String: typeof String; + Symbol: Function; + SyntaxError: typeof SyntaxError; + TypeError: typeof TypeError; + URIError: typeof URIError; + Uint16Array: typeof Uint16Array; + Uint32Array: typeof Uint32Array; + Uint8Array: typeof Uint8Array; + Uint8ClampedArray: Function; + WeakMap: WeakMapConstructor; + WeakSet: WeakSetConstructor; + clearImmediate: (immediateId: any) => void; + clearInterval: (intervalId: NodeJS.Timer) => void; + clearTimeout: (timeoutId: NodeJS.Timer) => void; + console: typeof console; + decodeURI: typeof decodeURI; + decodeURIComponent: typeof decodeURIComponent; + encodeURI: typeof encodeURI; + encodeURIComponent: typeof encodeURIComponent; + escape: (str: string) => string; + eval: typeof eval; + global: Global; + isFinite: typeof isFinite; + isNaN: typeof isNaN; + parseFloat: typeof parseFloat; + parseInt: typeof parseInt; + process: Process; + root: Global; + setImmediate: (callback: (...args: any[]) => void, ...args: any[]) => any; + setInterval: (callback: (...args: any[]) => void, ms: number, ...args: any[]) => NodeJS.Timer; + setTimeout: (callback: (...args: any[]) => void, ms: number, ...args: any[]) => NodeJS.Timer; + undefined: typeof undefined; + unescape: (str: string) => string; + gc: () => void; + v8debug?: any; + } + + export interface Timer { + ref() : void; + unref() : void; + } +} + +/** + * @deprecated + */ +interface NodeBuffer extends Uint8Array { + write(string: string, offset?: number, length?: number, encoding?: string): number; + toString(encoding?: string, start?: number, end?: number): string; + toJSON(): any; + equals(otherBuffer: Buffer): boolean; + compare(otherBuffer: Buffer): number; + copy(targetBuffer: Buffer, targetStart?: number, sourceStart?: number, sourceEnd?: number): number; + slice(start?: number, end?: number): Buffer; + writeUIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + writeUIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + writeIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + writeIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + readUIntLE(offset: number, byteLength: number, noAssert?: boolean): number; + readUIntBE(offset: number, byteLength: number, noAssert?: boolean): number; + readIntLE(offset: number, byteLength: number, noAssert?: boolean): number; + readIntBE(offset: number, byteLength: number, noAssert?: boolean): number; + readUInt8(offset: number, noAssert?: boolean): number; + readUInt16LE(offset: number, noAssert?: boolean): number; + readUInt16BE(offset: number, noAssert?: boolean): number; + readUInt32LE(offset: number, noAssert?: boolean): number; + readUInt32BE(offset: number, noAssert?: boolean): number; + readInt8(offset: number, noAssert?: boolean): number; + readInt16LE(offset: number, noAssert?: boolean): number; + readInt16BE(offset: number, noAssert?: boolean): number; + readInt32LE(offset: number, noAssert?: boolean): number; + readInt32BE(offset: number, noAssert?: boolean): number; + readFloatLE(offset: number, noAssert?: boolean): number; + readFloatBE(offset: number, noAssert?: boolean): number; + readDoubleLE(offset: number, noAssert?: boolean): number; + readDoubleBE(offset: number, noAssert?: boolean): number; + writeUInt8(value: number, offset: number, noAssert?: boolean): number; + writeUInt16LE(value: number, offset: number, noAssert?: boolean): number; + writeUInt16BE(value: number, offset: number, noAssert?: boolean): number; + writeUInt32LE(value: number, offset: number, noAssert?: boolean): number; + writeUInt32BE(value: number, offset: number, noAssert?: boolean): number; + writeInt8(value: number, offset: number, noAssert?: boolean): number; + writeInt16LE(value: number, offset: number, noAssert?: boolean): number; + writeInt16BE(value: number, offset: number, noAssert?: boolean): number; + writeInt32LE(value: number, offset: number, noAssert?: boolean): number; + writeInt32BE(value: number, offset: number, noAssert?: boolean): number; + writeFloatLE(value: number, offset: number, noAssert?: boolean): number; + writeFloatBE(value: number, offset: number, noAssert?: boolean): number; + writeDoubleLE(value: number, offset: number, noAssert?: boolean): number; + writeDoubleBE(value: number, offset: number, noAssert?: boolean): number; + fill(value: any, offset?: number, end?: number): this; + // TODO: encoding param + indexOf(value: string | number | Buffer, byteOffset?: number): number; + // TODO: entries + // TODO: includes + // TODO: keys + // TODO: values +} + +/************************************************ +* * +* MODULES * +* * +************************************************/ +declare module "buffer" { + export var INSPECT_MAX_BYTES: number; + var BuffType: typeof Buffer; + var SlowBuffType: typeof SlowBuffer; + export { BuffType as Buffer, SlowBuffType as SlowBuffer }; +} + +declare module "querystring" { + export interface StringifyOptions { + encodeURIComponent?: Function; + } + + export interface ParseOptions { + maxKeys?: number; + decodeURIComponent?: Function; + } + + export function stringify(obj: T, sep?: string, eq?: string, options?: StringifyOptions): string; + export function parse(str: string, sep?: string, eq?: string, options?: ParseOptions): any; + export function parse(str: string, sep?: string, eq?: string, options?: ParseOptions): T; + export function escape(str: string): string; + export function unescape(str: string): string; +} + +declare module "events" { + export class EventEmitter implements NodeJS.EventEmitter { + static EventEmitter: EventEmitter; + static listenerCount(emitter: EventEmitter, event: string): number; // deprecated + static defaultMaxListeners: number; + + addListener(event: string, listener: Function): this; + on(event: string, listener: Function): this; + once(event: string, listener: Function): this; + removeListener(event: string, listener: Function): this; + removeAllListeners(event?: string): this; + setMaxListeners(n: number): this; + getMaxListeners(): number; + listeners(event: string): Function[]; + emit(event: string, ...args: any[]): boolean; + listenerCount(type: string): number; + } +} + +declare module "http" { + import * as events from "events"; + import * as net from "net"; + import * as stream from "stream"; + + export interface RequestOptions { + protocol?: string; + host?: string; + hostname?: string; + family?: number; + port?: number; + localAddress?: string; + socketPath?: string; + method?: string; + path?: string; + headers?: { [key: string]: any }; + auth?: string; + agent?: Agent|boolean; + } + + export interface Server extends events.EventEmitter, net.Server { + setTimeout(msecs: number, callback: Function): void; + maxHeadersCount: number; + timeout: number; + } + /** + * @deprecated Use IncomingMessage + */ + export interface ServerRequest extends IncomingMessage { + connection: net.Socket; + } + export interface ServerResponse extends events.EventEmitter, stream.Writable { + // Extended base methods + write(buffer: Buffer): boolean; + write(buffer: Buffer, cb?: Function): boolean; + write(str: string, cb?: Function): boolean; + write(str: string, encoding?: string, cb?: Function): boolean; + write(str: string, encoding?: string, fd?: string): boolean; + + writeContinue(): void; + writeHead(statusCode: number, reasonPhrase?: string, headers?: any): void; + writeHead(statusCode: number, headers?: any): void; + statusCode: number; + statusMessage: string; + headersSent: boolean; + setHeader(name: string, value: string | string[]): void; + sendDate: boolean; + getHeader(name: string): string; + removeHeader(name: string): void; + write(chunk: any, encoding?: string): any; + addTrailers(headers: any): void; + + // Extended base methods + end(): void; + end(buffer: Buffer, cb?: Function): void; + end(str: string, cb?: Function): void; + end(str: string, encoding?: string, cb?: Function): void; + end(data?: any, encoding?: string): void; + } + export interface ClientRequest extends events.EventEmitter, stream.Writable { + // Extended base methods + write(buffer: Buffer): boolean; + write(buffer: Buffer, cb?: Function): boolean; + write(str: string, cb?: Function): boolean; + write(str: string, encoding?: string, cb?: Function): boolean; + write(str: string, encoding?: string, fd?: string): boolean; + + write(chunk: any, encoding?: string): void; + abort(): void; + setTimeout(timeout: number, callback?: Function): void; + setNoDelay(noDelay?: boolean): void; + setSocketKeepAlive(enable?: boolean, initialDelay?: number): void; + + setHeader(name: string, value: string | string[]): void; + getHeader(name: string): string; + removeHeader(name: string): void; + addTrailers(headers: any): void; + + // Extended base methods + end(): void; + end(buffer: Buffer, cb?: Function): void; + end(str: string, cb?: Function): void; + end(str: string, encoding?: string, cb?: Function): void; + end(data?: any, encoding?: string): void; + } + export interface IncomingMessage extends events.EventEmitter, stream.Readable { + httpVersion: string; + headers: any; + rawHeaders: string[]; + trailers: any; + rawTrailers: any; + setTimeout(msecs: number, callback: Function): NodeJS.Timer; + /** + * Only valid for request obtained from http.Server. + */ + method?: string; + /** + * Only valid for request obtained from http.Server. + */ + url?: string; + /** + * Only valid for response obtained from http.ClientRequest. + */ + statusCode?: number; + /** + * Only valid for response obtained from http.ClientRequest. + */ + statusMessage?: string; + socket: net.Socket; + } + /** + * @deprecated Use IncomingMessage + */ + export interface ClientResponse extends IncomingMessage { } + + export interface AgentOptions { + /** + * Keep sockets around in a pool to be used by other requests in the future. Default = false + */ + keepAlive?: boolean; + /** + * When using HTTP KeepAlive, how often to send TCP KeepAlive packets over sockets being kept alive. Default = 1000. + * Only relevant if keepAlive is set to true. + */ + keepAliveMsecs?: number; + /** + * Maximum number of sockets to allow per host. Default for Node 0.10 is 5, default for Node 0.12 is Infinity + */ + maxSockets?: number; + /** + * Maximum number of sockets to leave open in a free state. Only relevant if keepAlive is set to true. Default = 256. + */ + maxFreeSockets?: number; + } + + export class Agent { + maxSockets: number; + sockets: any; + requests: any; + + constructor(opts?: AgentOptions); + + /** + * Destroy any sockets that are currently in use by the agent. + * It is usually not necessary to do this. However, if you are using an agent with KeepAlive enabled, + * then it is best to explicitly shut down the agent when you know that it will no longer be used. Otherwise, + * sockets may hang open for quite a long time before the server terminates them. + */ + destroy(): void; + } + + export var METHODS: string[]; + + export var STATUS_CODES: { + [errorCode: number]: string; + [errorCode: string]: string; + }; + export function createServer(requestListener?: (request: IncomingMessage, response: ServerResponse) =>void ): Server; + export function createClient(port?: number, host?: string): any; + export function request(options: RequestOptions, callback?: (res: IncomingMessage) => void): ClientRequest; + export function get(options: any, callback?: (res: IncomingMessage) => void): ClientRequest; + export var globalAgent: Agent; +} + +declare module "cluster" { + import * as child from "child_process"; + import * as events from "events"; + + export interface ClusterSettings { + exec?: string; + args?: string[]; + silent?: boolean; + } + + export interface Address { + address: string; + port: number; + addressType: string; + } + + export class Worker extends events.EventEmitter { + id: string; + process: child.ChildProcess; + suicide: boolean; + send(message: any, sendHandle?: any): void; + kill(signal?: string): void; + destroy(signal?: string): void; + disconnect(): void; + isConnected(): boolean; + isDead(): boolean; + } + + export var settings: ClusterSettings; + export var isMaster: boolean; + export var isWorker: boolean; + export function setupMaster(settings?: ClusterSettings): void; + export function fork(env?: any): Worker; + export function disconnect(callback?: Function): void; + export var worker: Worker; + export var workers: { + [index: string]: Worker + }; + + // Event emitter + export function addListener(event: string, listener: Function): void; + export function on(event: "disconnect", listener: (worker: Worker) => void): void; + export function on(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): void; + export function on(event: "fork", listener: (worker: Worker) => void): void; + export function on(event: "listening", listener: (worker: Worker, address: any) => void): void; + export function on(event: "message", listener: (worker: Worker, message: any) => void): void; + export function on(event: "online", listener: (worker: Worker) => void): void; + export function on(event: "setup", listener: (settings: any) => void): void; + export function on(event: string, listener: Function): any; + export function once(event: string, listener: Function): void; + export function removeListener(event: string, listener: Function): void; + export function removeAllListeners(event?: string): void; + export function setMaxListeners(n: number): void; + export function listeners(event: string): Function[]; + export function emit(event: string, ...args: any[]): boolean; +} + +declare module "zlib" { + import * as stream from "stream"; + export interface ZlibOptions { chunkSize?: number; windowBits?: number; level?: number; memLevel?: number; strategy?: number; dictionary?: any; } + + export interface Gzip extends stream.Transform { } + export interface Gunzip extends stream.Transform { } + export interface Deflate extends stream.Transform { } + export interface Inflate extends stream.Transform { } + export interface DeflateRaw extends stream.Transform { } + export interface InflateRaw extends stream.Transform { } + export interface Unzip extends stream.Transform { } + + export function createGzip(options?: ZlibOptions): Gzip; + export function createGunzip(options?: ZlibOptions): Gunzip; + export function createDeflate(options?: ZlibOptions): Deflate; + export function createInflate(options?: ZlibOptions): Inflate; + export function createDeflateRaw(options?: ZlibOptions): DeflateRaw; + export function createInflateRaw(options?: ZlibOptions): InflateRaw; + export function createUnzip(options?: ZlibOptions): Unzip; + + export function deflate(buf: Buffer, callback: (error: Error, result: any) =>void ): void; + export function deflateSync(buf: Buffer, options?: ZlibOptions): any; + export function deflateRaw(buf: Buffer, callback: (error: Error, result: any) =>void ): void; + export function deflateRawSync(buf: Buffer, options?: ZlibOptions): any; + export function gzip(buf: Buffer, callback: (error: Error, result: any) =>void ): void; + export function gzipSync(buf: Buffer, options?: ZlibOptions): any; + export function gunzip(buf: Buffer, callback: (error: Error, result: any) =>void ): void; + export function gunzipSync(buf: Buffer, options?: ZlibOptions): any; + export function inflate(buf: Buffer, callback: (error: Error, result: any) =>void ): void; + export function inflateSync(buf: Buffer, options?: ZlibOptions): any; + export function inflateRaw(buf: Buffer, callback: (error: Error, result: any) =>void ): void; + export function inflateRawSync(buf: Buffer, options?: ZlibOptions): any; + export function unzip(buf: Buffer, callback: (error: Error, result: any) =>void ): void; + export function unzipSync(buf: Buffer, options?: ZlibOptions): any; + + // Constants + export var Z_NO_FLUSH: number; + export var Z_PARTIAL_FLUSH: number; + export var Z_SYNC_FLUSH: number; + export var Z_FULL_FLUSH: number; + export var Z_FINISH: number; + export var Z_BLOCK: number; + export var Z_TREES: number; + export var Z_OK: number; + export var Z_STREAM_END: number; + export var Z_NEED_DICT: number; + export var Z_ERRNO: number; + export var Z_STREAM_ERROR: number; + export var Z_DATA_ERROR: number; + export var Z_MEM_ERROR: number; + export var Z_BUF_ERROR: number; + export var Z_VERSION_ERROR: number; + export var Z_NO_COMPRESSION: number; + export var Z_BEST_SPEED: number; + export var Z_BEST_COMPRESSION: number; + export var Z_DEFAULT_COMPRESSION: number; + export var Z_FILTERED: number; + export var Z_HUFFMAN_ONLY: number; + export var Z_RLE: number; + export var Z_FIXED: number; + export var Z_DEFAULT_STRATEGY: number; + export var Z_BINARY: number; + export var Z_TEXT: number; + export var Z_ASCII: number; + export var Z_UNKNOWN: number; + export var Z_DEFLATED: number; + export var Z_NULL: number; +} + +declare module "os" { + export interface CpuInfo { + model: string; + speed: number; + times: { + user: number; + nice: number; + sys: number; + idle: number; + irq: number; + }; + } + + export interface NetworkInterfaceInfo { + address: string; + netmask: string; + family: string; + mac: string; + internal: boolean; + } + + export function tmpdir(): string; + export function homedir(): string; + export function endianness(): string; + export function hostname(): string; + export function type(): string; + export function platform(): string; + export function arch(): string; + export function release(): string; + export function uptime(): number; + export function loadavg(): number[]; + export function totalmem(): number; + export function freemem(): number; + export function cpus(): CpuInfo[]; + export function networkInterfaces(): {[index: string]: NetworkInterfaceInfo[]}; + export var EOL: string; +} + +declare module "https" { + import * as tls from "tls"; + import * as events from "events"; + import * as http from "http"; + + export interface ServerOptions { + pfx?: any; + key?: any; + passphrase?: string; + cert?: any; + ca?: any; + crl?: any; + ciphers?: string; + honorCipherOrder?: boolean; + requestCert?: boolean; + rejectUnauthorized?: boolean; + NPNProtocols?: any; + SNICallback?: (servername: string) => any; + } + + export interface RequestOptions extends http.RequestOptions { + pfx?: any; + key?: any; + passphrase?: string; + cert?: any; + ca?: any; + ciphers?: string; + rejectUnauthorized?: boolean; + secureProtocol?: string; + } + + export interface Agent extends http.Agent { } + + export interface AgentOptions extends http.AgentOptions { + maxCachedSessions?: number; + } + + export var Agent: { + new (options?: AgentOptions): Agent; + }; + export interface Server extends tls.Server { } + export function createServer(options: ServerOptions, requestListener?: Function): Server; + export function request(options: RequestOptions, callback?: (res: http.IncomingMessage) =>void ): http.ClientRequest; + export function get(options: RequestOptions, callback?: (res: http.IncomingMessage) =>void ): http.ClientRequest; + export var globalAgent: Agent; +} + +declare module "punycode" { + export function decode(string: string): string; + export function encode(string: string): string; + export function toUnicode(domain: string): string; + export function toASCII(domain: string): string; + export var ucs2: ucs2; + interface ucs2 { + decode(string: string): number[]; + encode(codePoints: number[]): string; + } + export var version: any; +} + +declare module "repl" { + import * as stream from "stream"; + import * as events from "events"; + + export interface ReplOptions { + prompt?: string; + input?: NodeJS.ReadableStream; + output?: NodeJS.WritableStream; + terminal?: boolean; + eval?: Function; + useColors?: boolean; + useGlobal?: boolean; + ignoreUndefined?: boolean; + writer?: Function; + } + export function start(options: ReplOptions): events.EventEmitter; +} + +declare module "readline" { + import * as events from "events"; + import * as stream from "stream"; + + export interface Key { + sequence?: string; + name?: string; + ctrl?: boolean; + meta?: boolean; + shift?: boolean; + } + + export interface ReadLine extends events.EventEmitter { + setPrompt(prompt: string): void; + prompt(preserveCursor?: boolean): void; + question(query: string, callback: (answer: string) => void): void; + pause(): ReadLine; + resume(): ReadLine; + close(): void; + write(data: string|Buffer, key?: Key): void; + } + + export interface Completer { + (line: string): CompleterResult; + (line: string, callback: (err: any, result: CompleterResult) => void): any; + } + + export interface CompleterResult { + completions: string[]; + line: string; + } + + export interface ReadLineOptions { + input: NodeJS.ReadableStream; + output?: NodeJS.WritableStream; + completer?: Completer; + terminal?: boolean; + historySize?: number; + } + + export function createInterface(input: NodeJS.ReadableStream, output?: NodeJS.WritableStream, completer?: Completer, terminal?: boolean): ReadLine; + export function createInterface(options: ReadLineOptions): ReadLine; + + export function cursorTo(stream: NodeJS.WritableStream, x: number, y: number): void; + export function moveCursor(stream: NodeJS.WritableStream, dx: number|string, dy: number|string): void; + export function clearLine(stream: NodeJS.WritableStream, dir: number): void; + export function clearScreenDown(stream: NodeJS.WritableStream): void; +} + +declare module "vm" { + export interface Context { } + export interface ScriptOptions { + filename?: string; + lineOffset?: number; + columnOffset?: number; + displayErrors?: boolean; + timeout?: number; + cachedData?: Buffer; + produceCachedData?: boolean; + } + export interface RunningScriptOptions { + filename?: string; + lineOffset?: number; + columnOffset?: number; + displayErrors?: boolean; + timeout?: number; + } + export class Script { + constructor(code: string, options?: ScriptOptions); + runInContext(contextifiedSandbox: Context, options?: RunningScriptOptions): any; + runInNewContext(sandbox?: Context, options?: RunningScriptOptions): any; + runInThisContext(options?: RunningScriptOptions): any; + } + export function createContext(sandbox?: Context): Context; + export function isContext(sandbox: Context): boolean; + export function runInContext(code: string, contextifiedSandbox: Context, options?: RunningScriptOptions): any; + export function runInDebugContext(code: string): any; + export function runInNewContext(code: string, sandbox?: Context, options?: RunningScriptOptions): any; + export function runInThisContext(code: string, options?: RunningScriptOptions): any; +} + +declare module "child_process" { + import * as events from "events"; + import * as stream from "stream"; + + export interface ChildProcess extends events.EventEmitter { + stdin: stream.Writable; + stdout: stream.Readable; + stderr: stream.Readable; + stdio: [stream.Writable, stream.Readable, stream.Readable]; + pid: number; + kill(signal?: string): void; + send(message: any, sendHandle?: any): void; + disconnect(): void; + unref(): void; + } + + export interface SpawnOptions { + cwd?: string; + env?: any; + stdio?: any; + detached?: boolean; + uid?: number; + gid?: number; + shell?: boolean | string; + } + export function spawn(command: string, args?: string[], options?: SpawnOptions): ChildProcess; + + export interface ExecOptions { + cwd?: string; + env?: any; + shell?: string; + timeout?: number; + maxBuffer?: number; + killSignal?: string; + uid?: number; + gid?: number; + } + export interface ExecOptionsWithStringEncoding extends ExecOptions { + encoding: BufferEncoding; + } + export interface ExecOptionsWithBufferEncoding extends ExecOptions { + encoding: string; // specify `null`. + } + export function exec(command: string, callback?: (error: Error, stdout: string, stderr: string) =>void ): ChildProcess; + export function exec(command: string, options: ExecOptionsWithStringEncoding, callback?: (error: Error, stdout: string, stderr: string) =>void ): ChildProcess; + // usage. child_process.exec("tsc", {encoding: null as string}, (err, stdout, stderr) => {}); + export function exec(command: string, options: ExecOptionsWithBufferEncoding, callback?: (error: Error, stdout: Buffer, stderr: Buffer) =>void ): ChildProcess; + export function exec(command: string, options: ExecOptions, callback?: (error: Error, stdout: string, stderr: string) =>void ): ChildProcess; + + export interface ExecFileOptions { + cwd?: string; + env?: any; + timeout?: number; + maxBuffer?: number; + killSignal?: string; + uid?: number; + gid?: number; + } + export interface ExecFileOptionsWithStringEncoding extends ExecFileOptions { + encoding: BufferEncoding; + } + export interface ExecFileOptionsWithBufferEncoding extends ExecFileOptions { + encoding: string; // specify `null`. + } + export function execFile(file: string, callback?: (error: Error, stdout: string, stderr: string) =>void ): ChildProcess; + export function execFile(file: string, options?: ExecFileOptionsWithStringEncoding, callback?: (error: Error, stdout: string, stderr: string) =>void ): ChildProcess; + // usage. child_process.execFile("file.sh", {encoding: null as string}, (err, stdout, stderr) => {}); + export function execFile(file: string, options?: ExecFileOptionsWithBufferEncoding, callback?: (error: Error, stdout: Buffer, stderr: Buffer) =>void ): ChildProcess; + export function execFile(file: string, options?: ExecFileOptions, callback?: (error: Error, stdout: string, stderr: string) =>void ): ChildProcess; + export function execFile(file: string, args?: string[], callback?: (error: Error, stdout: string, stderr: string) =>void ): ChildProcess; + export function execFile(file: string, args?: string[], options?: ExecFileOptionsWithStringEncoding, callback?: (error: Error, stdout: string, stderr: string) =>void ): ChildProcess; + // usage. child_process.execFile("file.sh", ["foo"], {encoding: null as string}, (err, stdout, stderr) => {}); + export function execFile(file: string, args?: string[], options?: ExecFileOptionsWithBufferEncoding, callback?: (error: Error, stdout: Buffer, stderr: Buffer) =>void ): ChildProcess; + export function execFile(file: string, args?: string[], options?: ExecFileOptions, callback?: (error: Error, stdout: string, stderr: string) =>void ): ChildProcess; + + export interface ForkOptions { + cwd?: string; + env?: any; + execPath?: string; + execArgv?: string[]; + silent?: boolean; + uid?: number; + gid?: number; + } + export function fork(modulePath: string, args?: string[], options?: ForkOptions): ChildProcess; + + export interface SpawnSyncOptions { + cwd?: string; + input?: string | Buffer; + stdio?: any; + env?: any; + uid?: number; + gid?: number; + timeout?: number; + killSignal?: string; + maxBuffer?: number; + encoding?: string; + shell?: boolean | string; + } + export interface SpawnSyncOptionsWithStringEncoding extends SpawnSyncOptions { + encoding: BufferEncoding; + } + export interface SpawnSyncOptionsWithBufferEncoding extends SpawnSyncOptions { + encoding: string; // specify `null`. + } + export interface SpawnSyncReturns { + pid: number; + output: string[]; + stdout: T; + stderr: T; + status: number; + signal: string; + error: Error; + } + export function spawnSync(command: string): SpawnSyncReturns; + export function spawnSync(command: string, options?: SpawnSyncOptionsWithStringEncoding): SpawnSyncReturns; + export function spawnSync(command: string, options?: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns; + export function spawnSync(command: string, options?: SpawnSyncOptions): SpawnSyncReturns; + export function spawnSync(command: string, args?: string[], options?: SpawnSyncOptionsWithStringEncoding): SpawnSyncReturns; + export function spawnSync(command: string, args?: string[], options?: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns; + export function spawnSync(command: string, args?: string[], options?: SpawnSyncOptions): SpawnSyncReturns; + + export interface ExecSyncOptions { + cwd?: string; + input?: string | Buffer; + stdio?: any; + env?: any; + shell?: string; + uid?: number; + gid?: number; + timeout?: number; + killSignal?: string; + maxBuffer?: number; + encoding?: string; + } + export interface ExecSyncOptionsWithStringEncoding extends ExecSyncOptions { + encoding: BufferEncoding; + } + export interface ExecSyncOptionsWithBufferEncoding extends ExecSyncOptions { + encoding: string; // specify `null`. + } + export function execSync(command: string): Buffer; + export function execSync(command: string, options?: ExecSyncOptionsWithStringEncoding): string; + export function execSync(command: string, options?: ExecSyncOptionsWithBufferEncoding): Buffer; + export function execSync(command: string, options?: ExecSyncOptions): Buffer; + + export interface ExecFileSyncOptions { + cwd?: string; + input?: string | Buffer; + stdio?: any; + env?: any; + uid?: number; + gid?: number; + timeout?: number; + killSignal?: string; + maxBuffer?: number; + encoding?: string; + } + export interface ExecFileSyncOptionsWithStringEncoding extends ExecFileSyncOptions { + encoding: BufferEncoding; + } + export interface ExecFileSyncOptionsWithBufferEncoding extends ExecFileSyncOptions { + encoding: string; // specify `null`. + } + export function execFileSync(command: string): Buffer; + export function execFileSync(command: string, options?: ExecFileSyncOptionsWithStringEncoding): string; + export function execFileSync(command: string, options?: ExecFileSyncOptionsWithBufferEncoding): Buffer; + export function execFileSync(command: string, options?: ExecFileSyncOptions): Buffer; + export function execFileSync(command: string, args?: string[], options?: ExecFileSyncOptionsWithStringEncoding): string; + export function execFileSync(command: string, args?: string[], options?: ExecFileSyncOptionsWithBufferEncoding): Buffer; + export function execFileSync(command: string, args?: string[], options?: ExecFileSyncOptions): Buffer; +} + +declare module "url" { + export interface Url { + href?: string; + protocol?: string; + auth?: string; + hostname?: string; + port?: string; + host?: string; + pathname?: string; + search?: string; + query?: string | any; + slashes?: boolean; + hash?: string; + path?: string; + } + + export function parse(urlStr: string, parseQueryString?: boolean , slashesDenoteHost?: boolean ): Url; + export function format(url: Url): string; + export function resolve(from: string, to: string): string; +} + +declare module "dns" { + export function lookup(domain: string, family: number, callback: (err: Error, address: string, family: number) =>void ): string; + export function lookup(domain: string, callback: (err: Error, address: string, family: number) =>void ): string; + export function resolve(domain: string, rrtype: string, callback: (err: Error, addresses: string[]) =>void ): string[]; + export function resolve(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[]; + export function resolve4(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[]; + export function resolve6(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[]; + export function resolveMx(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[]; + export function resolveTxt(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[]; + export function resolveSrv(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[]; + export function resolveNs(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[]; + export function resolveCname(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[]; + export function reverse(ip: string, callback: (err: Error, domains: string[]) =>void ): string[]; +} + +declare module "net" { + import * as stream from "stream"; + + export interface Socket extends stream.Duplex { + // Extended base methods + write(buffer: Buffer): boolean; + write(buffer: Buffer, cb?: Function): boolean; + write(str: string, cb?: Function): boolean; + write(str: string, encoding?: string, cb?: Function): boolean; + write(str: string, encoding?: string, fd?: string): boolean; + + connect(port: number, host?: string, connectionListener?: Function): void; + connect(path: string, connectionListener?: Function): void; + bufferSize: number; + setEncoding(encoding?: string): void; + write(data: any, encoding?: string, callback?: Function): void; + destroy(): void; + pause(): void; + resume(): void; + setTimeout(timeout: number, callback?: Function): void; + setNoDelay(noDelay?: boolean): void; + setKeepAlive(enable?: boolean, initialDelay?: number): void; + address(): { port: number; family: string; address: string; }; + unref(): void; + ref(): void; + + remoteAddress: string; + remoteFamily: string; + remotePort: number; + localAddress: string; + localPort: number; + bytesRead: number; + bytesWritten: number; + + // Extended base methods + end(): void; + end(buffer: Buffer, cb?: Function): void; + end(str: string, cb?: Function): void; + end(str: string, encoding?: string, cb?: Function): void; + end(data?: any, encoding?: string): void; + } + + export var Socket: { + new (options?: { fd?: string; type?: string; allowHalfOpen?: boolean; }): Socket; + }; + + export interface ListenOptions { + port?: number; + host?: string; + backlog?: number; + path?: string; + exclusive?: boolean; + } + + export interface Server extends Socket { + listen(port: number, hostname?: string, backlog?: number, listeningListener?: Function): Server; + listen(port: number, hostname?: string, listeningListener?: Function): Server; + listen(port: number, backlog?: number, listeningListener?: Function): Server; + listen(port: number, listeningListener?: Function): Server; + listen(path: string, backlog?: number, listeningListener?: Function): Server; + listen(path: string, listeningListener?: Function): Server; + listen(handle: any, backlog?: number, listeningListener?: Function): Server; + listen(handle: any, listeningListener?: Function): Server; + listen(options: ListenOptions, listeningListener?: Function): Server; + close(callback?: Function): Server; + address(): { port: number; family: string; address: string; }; + getConnections(cb: (error: Error, count: number) => void): void; + ref(): Server; + unref(): Server; + maxConnections: number; + connections: number; + } + export function createServer(connectionListener?: (socket: Socket) =>void ): Server; + export function createServer(options?: { allowHalfOpen?: boolean; }, connectionListener?: (socket: Socket) =>void ): Server; + export function connect(options: { port: number, host?: string, localAddress? : string, localPort? : string, family? : number, allowHalfOpen?: boolean; }, connectionListener?: Function): Socket; + export function connect(port: number, host?: string, connectionListener?: Function): Socket; + export function connect(path: string, connectionListener?: Function): Socket; + export function createConnection(options: { port: number, host?: string, localAddress? : string, localPort? : string, family? : number, allowHalfOpen?: boolean; }, connectionListener?: Function): Socket; + export function createConnection(port: number, host?: string, connectionListener?: Function): Socket; + export function createConnection(path: string, connectionListener?: Function): Socket; + export function isIP(input: string): number; + export function isIPv4(input: string): boolean; + export function isIPv6(input: string): boolean; +} + +declare module "dgram" { + import * as events from "events"; + + interface RemoteInfo { + address: string; + port: number; + size: number; + } + + interface AddressInfo { + address: string; + family: string; + port: number; + } + + export function createSocket(type: string, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket; + + interface Socket extends events.EventEmitter { + send(buf: Buffer, offset: number, length: number, port: number, address: string, callback?: (error: Error, bytes: number) => void): void; + bind(port: number, address?: string, callback?: () => void): void; + close(): void; + address(): AddressInfo; + setBroadcast(flag: boolean): void; + setMulticastTTL(ttl: number): void; + setMulticastLoopback(flag: boolean): void; + addMembership(multicastAddress: string, multicastInterface?: string): void; + dropMembership(multicastAddress: string, multicastInterface?: string): void; + } +} + +declare module "fs" { + import * as stream from "stream"; + import * as events from "events"; + + interface Stats { + isFile(): boolean; + isDirectory(): boolean; + isBlockDevice(): boolean; + isCharacterDevice(): boolean; + isSymbolicLink(): boolean; + isFIFO(): boolean; + isSocket(): boolean; + dev: number; + ino: number; + mode: number; + nlink: number; + uid: number; + gid: number; + rdev: number; + size: number; + blksize: number; + blocks: number; + atime: Date; + mtime: Date; + ctime: Date; + birthtime: Date; + } + + interface FSWatcher extends events.EventEmitter { + close(): void; + } + + export interface ReadStream extends stream.Readable { + close(): void; + } + export interface WriteStream extends stream.Writable { + close(): void; + bytesWritten: number; + } + + /** + * Asynchronous rename. + * @param oldPath + * @param newPath + * @param callback No arguments other than a possible exception are given to the completion callback. + */ + export function rename(oldPath: string, newPath: string, callback?: (err?: NodeJS.ErrnoException) => void): void; + /** + * Synchronous rename + * @param oldPath + * @param newPath + */ + export function renameSync(oldPath: string, newPath: string): void; + export function truncate(path: string, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function truncate(path: string, len: number, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function truncateSync(path: string, len?: number): void; + export function ftruncate(fd: number, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function ftruncate(fd: number, len: number, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function ftruncateSync(fd: number, len?: number): void; + export function chown(path: string, uid: number, gid: number, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function chownSync(path: string, uid: number, gid: number): void; + export function fchown(fd: number, uid: number, gid: number, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function fchownSync(fd: number, uid: number, gid: number): void; + export function lchown(path: string, uid: number, gid: number, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function lchownSync(path: string, uid: number, gid: number): void; + export function chmod(path: string, mode: number, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function chmod(path: string, mode: string, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function chmodSync(path: string, mode: number): void; + export function chmodSync(path: string, mode: string): void; + export function fchmod(fd: number, mode: number, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function fchmod(fd: number, mode: string, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function fchmodSync(fd: number, mode: number): void; + export function fchmodSync(fd: number, mode: string): void; + export function lchmod(path: string, mode: number, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function lchmod(path: string, mode: string, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function lchmodSync(path: string, mode: number): void; + export function lchmodSync(path: string, mode: string): void; + export function stat(path: string, callback?: (err: NodeJS.ErrnoException, stats: Stats) => any): void; + export function lstat(path: string, callback?: (err: NodeJS.ErrnoException, stats: Stats) => any): void; + export function fstat(fd: number, callback?: (err: NodeJS.ErrnoException, stats: Stats) => any): void; + export function statSync(path: string): Stats; + export function lstatSync(path: string): Stats; + export function fstatSync(fd: number): Stats; + export function link(srcpath: string, dstpath: string, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function linkSync(srcpath: string, dstpath: string): void; + export function symlink(srcpath: string, dstpath: string, type?: string, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function symlinkSync(srcpath: string, dstpath: string, type?: string): void; + export function readlink(path: string, callback?: (err: NodeJS.ErrnoException, linkString: string) => any): void; + export function readlinkSync(path: string): string; + export function realpath(path: string, callback?: (err: NodeJS.ErrnoException, resolvedPath: string) => any): void; + export function realpath(path: string, cache: {[path: string]: string}, callback: (err: NodeJS.ErrnoException, resolvedPath: string) =>any): void; + export function realpathSync(path: string, cache?: { [path: string]: string }): string; + /* + * Asynchronous unlink - deletes the file specified in {path} + * + * @param path + * @param callback No arguments other than a possible exception are given to the completion callback. + */ + export function unlink(path: string, callback?: (err?: NodeJS.ErrnoException) => void): void; + /* + * Synchronous unlink - deletes the file specified in {path} + * + * @param path + */ + export function unlinkSync(path: string): void; + /* + * Asynchronous rmdir - removes the directory specified in {path} + * + * @param path + * @param callback No arguments other than a possible exception are given to the completion callback. + */ + export function rmdir(path: string, callback?: (err?: NodeJS.ErrnoException) => void): void; + /* + * Synchronous rmdir - removes the directory specified in {path} + * + * @param path + */ + export function rmdirSync(path: string): void; + /* + * Asynchronous mkdir - creates the directory specified in {path}. Parameter {mode} defaults to 0777. + * + * @param path + * @param callback No arguments other than a possible exception are given to the completion callback. + */ + export function mkdir(path: string, callback?: (err?: NodeJS.ErrnoException) => void): void; + /* + * Asynchronous mkdir - creates the directory specified in {path}. Parameter {mode} defaults to 0777. + * + * @param path + * @param mode + * @param callback No arguments other than a possible exception are given to the completion callback. + */ + export function mkdir(path: string, mode: number, callback?: (err?: NodeJS.ErrnoException) => void): void; + /* + * Asynchronous mkdir - creates the directory specified in {path}. Parameter {mode} defaults to 0777. + * + * @param path + * @param mode + * @param callback No arguments other than a possible exception are given to the completion callback. + */ + export function mkdir(path: string, mode: string, callback?: (err?: NodeJS.ErrnoException) => void): void; + /* + * Synchronous mkdir - creates the directory specified in {path}. Parameter {mode} defaults to 0777. + * + * @param path + * @param mode + * @param callback No arguments other than a possible exception are given to the completion callback. + */ + export function mkdirSync(path: string, mode?: number): void; + /* + * Synchronous mkdir - creates the directory specified in {path}. Parameter {mode} defaults to 0777. + * + * @param path + * @param mode + * @param callback No arguments other than a possible exception are given to the completion callback. + */ + export function mkdirSync(path: string, mode?: string): void; + /* + * Asynchronous mkdtemp - Creates a unique temporary directory. Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + * + * @param prefix + * @param callback The created folder path is passed as a string to the callback's second parameter. + */ + export function mkdtemp(prefix: string, callback?: (err: NodeJS.ErrnoException, folder: string) => void): void; + /* + * Synchronous mkdtemp - Creates a unique temporary directory. Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + * + * @param prefix + * @returns Returns the created folder path. + */ + export function mkdtempSync(prefix: string): string; + export function readdir(path: string, callback?: (err: NodeJS.ErrnoException, files: string[]) => void): void; + export function readdirSync(path: string): string[]; + export function close(fd: number, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function closeSync(fd: number): void; + export function open(path: string, flags: string, callback?: (err: NodeJS.ErrnoException, fd: number) => any): void; + export function open(path: string, flags: string, mode: number, callback?: (err: NodeJS.ErrnoException, fd: number) => any): void; + export function open(path: string, flags: string, mode: string, callback?: (err: NodeJS.ErrnoException, fd: number) => any): void; + export function openSync(path: string, flags: string, mode?: number): number; + export function openSync(path: string, flags: string, mode?: string): number; + export function utimes(path: string, atime: number, mtime: number, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function utimes(path: string, atime: Date, mtime: Date, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function utimesSync(path: string, atime: number, mtime: number): void; + export function utimesSync(path: string, atime: Date, mtime: Date): void; + export function futimes(fd: number, atime: number, mtime: number, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function futimes(fd: number, atime: Date, mtime: Date, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function futimesSync(fd: number, atime: number, mtime: number): void; + export function futimesSync(fd: number, atime: Date, mtime: Date): void; + export function fsync(fd: number, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function fsyncSync(fd: number): void; + export function write(fd: number, buffer: Buffer, offset: number, length: number, position: number, callback?: (err: NodeJS.ErrnoException, written: number, buffer: Buffer) => void): void; + export function write(fd: number, buffer: Buffer, offset: number, length: number, callback?: (err: NodeJS.ErrnoException, written: number, buffer: Buffer) => void): void; + export function write(fd: number, data: any, callback?: (err: NodeJS.ErrnoException, written: number, str: string) => void): void; + export function write(fd: number, data: any, offset: number, callback?: (err: NodeJS.ErrnoException, written: number, str: string) => void): void; + export function write(fd: number, data: any, offset: number, encoding: string, callback?: (err: NodeJS.ErrnoException, written: number, str: string) => void): void; + export function writeSync(fd: number, buffer: Buffer, offset: number, length: number, position?: number): number; + export function writeSync(fd: number, data: any, position?: number, enconding?: string): number; + export function read(fd: number, buffer: Buffer, offset: number, length: number, position: number, callback?: (err: NodeJS.ErrnoException, bytesRead: number, buffer: Buffer) => void): void; + export function readSync(fd: number, buffer: Buffer, offset: number, length: number, position: number): number; + /* + * Asynchronous readFile - Asynchronously reads the entire contents of a file. + * + * @param fileName + * @param encoding + * @param callback - The callback is passed two arguments (err, data), where data is the contents of the file. + */ + export function readFile(filename: string, encoding: string, callback: (err: NodeJS.ErrnoException, data: string) => void): void; + /* + * Asynchronous readFile - Asynchronously reads the entire contents of a file. + * + * @param fileName + * @param options An object with optional {encoding} and {flag} properties. If {encoding} is specified, readFile returns a string; otherwise it returns a Buffer. + * @param callback - The callback is passed two arguments (err, data), where data is the contents of the file. + */ + export function readFile(filename: string, options: { encoding: string; flag?: string; }, callback: (err: NodeJS.ErrnoException, data: string) => void): void; + /* + * Asynchronous readFile - Asynchronously reads the entire contents of a file. + * + * @param fileName + * @param options An object with optional {encoding} and {flag} properties. If {encoding} is specified, readFile returns a string; otherwise it returns a Buffer. + * @param callback - The callback is passed two arguments (err, data), where data is the contents of the file. + */ + export function readFile(filename: string, options: { flag?: string; }, callback: (err: NodeJS.ErrnoException, data: Buffer) => void): void; + /* + * Asynchronous readFile - Asynchronously reads the entire contents of a file. + * + * @param fileName + * @param callback - The callback is passed two arguments (err, data), where data is the contents of the file. + */ + export function readFile(filename: string, callback: (err: NodeJS.ErrnoException, data: Buffer) => void): void; + /* + * Synchronous readFile - Synchronously reads the entire contents of a file. + * + * @param fileName + * @param encoding + */ + export function readFileSync(filename: string, encoding: string): string; + /* + * Synchronous readFile - Synchronously reads the entire contents of a file. + * + * @param fileName + * @param options An object with optional {encoding} and {flag} properties. If {encoding} is specified, readFileSync returns a string; otherwise it returns a Buffer. + */ + export function readFileSync(filename: string, options: { encoding: string; flag?: string; }): string; + /* + * Synchronous readFile - Synchronously reads the entire contents of a file. + * + * @param fileName + * @param options An object with optional {encoding} and {flag} properties. If {encoding} is specified, readFileSync returns a string; otherwise it returns a Buffer. + */ + export function readFileSync(filename: string, options?: { flag?: string; }): Buffer; + export function writeFile(filename: string, data: any, callback?: (err: NodeJS.ErrnoException) => void): void; + export function writeFile(filename: string, data: any, options: { encoding?: string; mode?: number; flag?: string; }, callback?: (err: NodeJS.ErrnoException) => void): void; + export function writeFile(filename: string, data: any, options: { encoding?: string; mode?: string; flag?: string; }, callback?: (err: NodeJS.ErrnoException) => void): void; + export function writeFileSync(filename: string, data: any, options?: { encoding?: string; mode?: number; flag?: string; }): void; + export function writeFileSync(filename: string, data: any, options?: { encoding?: string; mode?: string; flag?: string; }): void; + export function appendFile(filename: string, data: any, options: { encoding?: string; mode?: number; flag?: string; }, callback?: (err: NodeJS.ErrnoException) => void): void; + export function appendFile(filename: string, data: any, options: { encoding?: string; mode?: string; flag?: string; }, callback?: (err: NodeJS.ErrnoException) => void): void; + export function appendFile(filename: string, data: any, callback?: (err: NodeJS.ErrnoException) => void): void; + export function appendFileSync(filename: string, data: any, options?: { encoding?: string; mode?: number; flag?: string; }): void; + export function appendFileSync(filename: string, data: any, options?: { encoding?: string; mode?: string; flag?: string; }): void; + export function watchFile(filename: string, listener: (curr: Stats, prev: Stats) => void): void; + export function watchFile(filename: string, options: { persistent?: boolean; interval?: number; }, listener: (curr: Stats, prev: Stats) => void): void; + export function unwatchFile(filename: string, listener?: (curr: Stats, prev: Stats) => void): void; + export function watch(filename: string, listener?: (event: string, filename: string) => any): FSWatcher; + export function watch(filename: string, options: { persistent?: boolean; }, listener?: (event: string, filename: string) => any): FSWatcher; + export function exists(path: string, callback?: (exists: boolean) => void): void; + export function existsSync(path: string): boolean; + /** Constant for fs.access(). File is visible to the calling process. */ + export var F_OK: number; + /** Constant for fs.access(). File can be read by the calling process. */ + export var R_OK: number; + /** Constant for fs.access(). File can be written by the calling process. */ + export var W_OK: number; + /** Constant for fs.access(). File can be executed by the calling process. */ + export var X_OK: number; + /** Tests a user's permissions for the file specified by path. */ + export function access(path: string, callback: (err: NodeJS.ErrnoException) => void): void; + export function access(path: string, mode: number, callback: (err: NodeJS.ErrnoException) => void): void; + /** Synchronous version of fs.access. This throws if any accessibility checks fail, and does nothing otherwise. */ + export function accessSync(path: string, mode ?: number): void; + export function createReadStream(path: string, options?: { + flags?: string; + encoding?: string; + fd?: number; + mode?: number; + autoClose?: boolean; + }): ReadStream; + export function createWriteStream(path: string, options?: { + flags?: string; + encoding?: string; + fd?: number; + mode?: number; + }): WriteStream; +} + +declare module "path" { + + /** + * A parsed path object generated by path.parse() or consumed by path.format(). + */ + export interface ParsedPath { + /** + * The root of the path such as '/' or 'c:\' + */ + root: string; + /** + * The full directory path such as '/home/user/dir' or 'c:\path\dir' + */ + dir: string; + /** + * The file name including extension (if any) such as 'index.html' + */ + base: string; + /** + * The file extension (if any) such as '.html' + */ + ext: string; + /** + * The file name without extension (if any) such as 'index' + */ + name: string; + } + + /** + * Normalize a string path, reducing '..' and '.' parts. + * When multiple slashes are found, they're replaced by a single one; when the path contains a trailing slash, it is preserved. On Windows backslashes are used. + * + * @param p string path to normalize. + */ + export function normalize(p: string): string; + /** + * Join all arguments together and normalize the resulting path. + * Arguments must be strings. In v0.8, non-string arguments were silently ignored. In v0.10 and up, an exception is thrown. + * + * @param paths string paths to join. + */ + export function join(...paths: any[]): string; + /** + * Join all arguments together and normalize the resulting path. + * Arguments must be strings. In v0.8, non-string arguments were silently ignored. In v0.10 and up, an exception is thrown. + * + * @param paths string paths to join. + */ + export function join(...paths: string[]): string; + /** + * The right-most parameter is considered {to}. Other parameters are considered an array of {from}. + * + * Starting from leftmost {from} paramter, resolves {to} to an absolute path. + * + * If {to} isn't already absolute, {from} arguments are prepended in right to left order, until an absolute path is found. If after using all {from} paths still no absolute path is found, the current working directory is used as well. The resulting path is normalized, and trailing slashes are removed unless the path gets resolved to the root directory. + * + * @param pathSegments string paths to join. Non-string arguments are ignored. + */ + export function resolve(...pathSegments: any[]): string; + /** + * Determines whether {path} is an absolute path. An absolute path will always resolve to the same location, regardless of the working directory. + * + * @param path path to test. + */ + export function isAbsolute(path: string): boolean; + /** + * Solve the relative path from {from} to {to}. + * At times we have two absolute paths, and we need to derive the relative path from one to the other. This is actually the reverse transform of path.resolve. + * + * @param from + * @param to + */ + export function relative(from: string, to: string): string; + /** + * Return the directory name of a path. Similar to the Unix dirname command. + * + * @param p the path to evaluate. + */ + export function dirname(p: string): string; + /** + * Return the last portion of a path. Similar to the Unix basename command. + * Often used to extract the file name from a fully qualified path. + * + * @param p the path to evaluate. + * @param ext optionally, an extension to remove from the result. + */ + export function basename(p: string, ext?: string): string; + /** + * Return the extension of the path, from the last '.' to end of string in the last portion of the path. + * If there is no '.' in the last portion of the path or the first character of it is '.', then it returns an empty string + * + * @param p the path to evaluate. + */ + export function extname(p: string): string; + /** + * The platform-specific file separator. '\\' or '/'. + */ + export var sep: string; + /** + * The platform-specific file delimiter. ';' or ':'. + */ + export var delimiter: string; + /** + * Returns an object from a path string - the opposite of format(). + * + * @param pathString path to evaluate. + */ + export function parse(pathString: string): ParsedPath; + /** + * Returns a path string from an object - the opposite of parse(). + * + * @param pathString path to evaluate. + */ + export function format(pathObject: ParsedPath): string; + + export module posix { + export function normalize(p: string): string; + export function join(...paths: any[]): string; + export function resolve(...pathSegments: any[]): string; + export function isAbsolute(p: string): boolean; + export function relative(from: string, to: string): string; + export function dirname(p: string): string; + export function basename(p: string, ext?: string): string; + export function extname(p: string): string; + export var sep: string; + export var delimiter: string; + export function parse(p: string): ParsedPath; + export function format(pP: ParsedPath): string; + } + + export module win32 { + export function normalize(p: string): string; + export function join(...paths: any[]): string; + export function resolve(...pathSegments: any[]): string; + export function isAbsolute(p: string): boolean; + export function relative(from: string, to: string): string; + export function dirname(p: string): string; + export function basename(p: string, ext?: string): string; + export function extname(p: string): string; + export var sep: string; + export var delimiter: string; + export function parse(p: string): ParsedPath; + export function format(pP: ParsedPath): string; + } +} + +declare module "string_decoder" { + export interface NodeStringDecoder { + write(buffer: Buffer): string; + detectIncompleteChar(buffer: Buffer): number; + } + export var StringDecoder: { + new (encoding: string): NodeStringDecoder; + }; +} + +declare module "tls" { + import * as crypto from "crypto"; + import * as net from "net"; + import * as stream from "stream"; + + var CLIENT_RENEG_LIMIT: number; + var CLIENT_RENEG_WINDOW: number; + + export interface TlsOptions { + host?: string; + port?: number; + pfx?: any; //string or buffer + key?: any; //string or buffer + passphrase?: string; + cert?: any; + ca?: any; //string or buffer + crl?: any; //string or string array + ciphers?: string; + honorCipherOrder?: any; + requestCert?: boolean; + rejectUnauthorized?: boolean; + NPNProtocols?: any; //array or Buffer; + SNICallback?: (servername: string) => any; + } + + export interface ConnectionOptions { + host?: string; + port?: number; + socket?: net.Socket; + pfx?: string | Buffer + key?: string | Buffer + passphrase?: string; + cert?: string | Buffer + ca?: (string | Buffer)[]; + rejectUnauthorized?: boolean; + NPNProtocols?: (string | Buffer)[]; + servername?: string; + } + + export interface Server extends net.Server { + close(): Server; + address(): { port: number; family: string; address: string; }; + addContext(hostName: string, credentials: { + key: string; + cert: string; + ca: string; + }): void; + maxConnections: number; + connections: number; + } + + export interface ClearTextStream extends stream.Duplex { + authorized: boolean; + authorizationError: Error; + getPeerCertificate(): any; + getCipher: { + name: string; + version: string; + }; + address: { + port: number; + family: string; + address: string; + }; + remoteAddress: string; + remotePort: number; + } + + export interface SecurePair { + encrypted: any; + cleartext: any; + } + + export interface SecureContextOptions { + pfx?: string | Buffer; + key?: string | Buffer; + passphrase?: string; + cert?: string | Buffer; + ca?: string | Buffer; + crl?: string | string[] + ciphers?: string; + honorCipherOrder?: boolean; + } + + export interface SecureContext { + context: any; + } + + export function createServer(options: TlsOptions, secureConnectionListener?: (cleartextStream: ClearTextStream) =>void ): Server; + export function connect(options: TlsOptions, secureConnectionListener?: () =>void ): ClearTextStream; + export function connect(port: number, host?: string, options?: ConnectionOptions, secureConnectListener?: () =>void ): ClearTextStream; + export function connect(port: number, options?: ConnectionOptions, secureConnectListener?: () =>void ): ClearTextStream; + export function createSecurePair(credentials?: crypto.Credentials, isServer?: boolean, requestCert?: boolean, rejectUnauthorized?: boolean): SecurePair; + export function createSecureContext(details: SecureContextOptions): SecureContext; +} + +declare module "crypto" { + export interface CredentialDetails { + pfx: string; + key: string; + passphrase: string; + cert: string; + ca: string | string[]; + crl: string | string[]; + ciphers: string; + } + export interface Credentials { context?: any; } + export function createCredentials(details: CredentialDetails): Credentials; + export function createHash(algorithm: string): Hash; + export function createHmac(algorithm: string, key: string): Hmac; + export function createHmac(algorithm: string, key: Buffer): Hmac; + export interface Hash { + update(data: any, input_encoding?: string): Hash; + digest(encoding: 'buffer'): Buffer; + digest(encoding: string): any; + digest(): Buffer; + } + export interface Hmac extends NodeJS.ReadWriteStream { + update(data: any, input_encoding?: string): Hmac; + digest(encoding: 'buffer'): Buffer; + digest(encoding: string): any; + digest(): Buffer; + } + export function createCipher(algorithm: string, password: any): Cipher; + export function createCipheriv(algorithm: string, key: any, iv: any): Cipher; + export interface Cipher extends NodeJS.ReadWriteStream { + update(data: Buffer): Buffer; + update(data: string, input_encoding: "utf8"|"ascii"|"binary"): Buffer; + update(data: Buffer, input_encoding: any, output_encoding: "binary"|"base64"|"hex"): string; + update(data: string, input_encoding: "utf8"|"ascii"|"binary", output_encoding: "binary"|"base64"|"hex"): string; + final(): Buffer; + final(output_encoding: string): string; + setAutoPadding(auto_padding: boolean): void; + getAuthTag(): Buffer; + } + export function createDecipher(algorithm: string, password: any): Decipher; + export function createDecipheriv(algorithm: string, key: any, iv: any): Decipher; + export interface Decipher extends NodeJS.ReadWriteStream { + update(data: Buffer): Buffer; + update(data: string, input_encoding: "binary"|"base64"|"hex"): Buffer; + update(data: Buffer, input_encoding: any, output_encoding: "utf8"|"ascii"|"binary"): string; + update(data: string, input_encoding: "binary"|"base64"|"hex", output_encoding: "utf8"|"ascii"|"binary"): string; + final(): Buffer; + final(output_encoding: string): string; + setAutoPadding(auto_padding: boolean): void; + setAuthTag(tag: Buffer): void; + } + export function createSign(algorithm: string): Signer; + export interface Signer extends NodeJS.WritableStream { + update(data: any): void; + sign(private_key: string, output_format: string): string; + } + export function createVerify(algorith: string): Verify; + export interface Verify extends NodeJS.WritableStream { + update(data: any): void; + verify(object: string, signature: string, signature_format?: string): boolean; + } + export function createDiffieHellman(prime_length: number): DiffieHellman; + export function createDiffieHellman(prime: number, encoding?: string): DiffieHellman; + export interface DiffieHellman { + generateKeys(encoding?: string): string; + computeSecret(other_public_key: string, input_encoding?: string, output_encoding?: string): string; + getPrime(encoding?: string): string; + getGenerator(encoding: string): string; + getPublicKey(encoding?: string): string; + getPrivateKey(encoding?: string): string; + setPublicKey(public_key: string, encoding?: string): void; + setPrivateKey(public_key: string, encoding?: string): void; + } + export function getDiffieHellman(group_name: string): DiffieHellman; + export function pbkdf2(password: string|Buffer, salt: string|Buffer, iterations: number, keylen: number, callback: (err: Error, derivedKey: Buffer) => any): void; + export function pbkdf2(password: string|Buffer, salt: string|Buffer, iterations: number, keylen: number, digest: string, callback: (err: Error, derivedKey: Buffer) => any): void; + export function pbkdf2Sync(password: string|Buffer, salt: string|Buffer, iterations: number, keylen: number) : Buffer; + export function pbkdf2Sync(password: string|Buffer, salt: string|Buffer, iterations: number, keylen: number, digest: string) : Buffer; + export function randomBytes(size: number): Buffer; + export function randomBytes(size: number, callback: (err: Error, buf: Buffer) =>void ): void; + export function pseudoRandomBytes(size: number): Buffer; + export function pseudoRandomBytes(size: number, callback: (err: Error, buf: Buffer) =>void ): void; + export interface RsaPublicKey { + key: string; + padding?: any; + } + export interface RsaPrivateKey { + key: string; + passphrase?: string, + padding?: any; + } + export function publicEncrypt(public_key: string|RsaPublicKey, buffer: Buffer): Buffer + export function privateDecrypt(private_key: string|RsaPrivateKey, buffer: Buffer): Buffer +} + +declare module "stream" { + import * as events from "events"; + + export class Stream extends events.EventEmitter { + pipe(destination: T, options?: { end?: boolean; }): T; + } + + export interface ReadableOptions { + highWaterMark?: number; + encoding?: string; + objectMode?: boolean; + } + + export class Readable extends events.EventEmitter implements NodeJS.ReadableStream { + readable: boolean; + constructor(opts?: ReadableOptions); + _read(size: number): void; + read(size?: number): any; + setEncoding(encoding: string): void; + pause(): void; + resume(): void; + pipe(destination: T, options?: { end?: boolean; }): T; + unpipe(destination?: T): void; + unshift(chunk: any): void; + wrap(oldStream: NodeJS.ReadableStream): NodeJS.ReadableStream; + push(chunk: any, encoding?: string): boolean; + } + + export interface WritableOptions { + highWaterMark?: number; + decodeStrings?: boolean; + objectMode?: boolean; + } + + export class Writable extends events.EventEmitter implements NodeJS.WritableStream { + writable: boolean; + constructor(opts?: WritableOptions); + _write(chunk: any, encoding: string, callback: Function): void; + write(chunk: any, cb?: Function): boolean; + write(chunk: any, encoding?: string, cb?: Function): boolean; + end(): void; + end(chunk: any, cb?: Function): void; + end(chunk: any, encoding?: string, cb?: Function): void; + } + + export interface DuplexOptions extends ReadableOptions, WritableOptions { + allowHalfOpen?: boolean; + } + + // Note: Duplex extends both Readable and Writable. + export class Duplex extends Readable implements NodeJS.ReadWriteStream { + writable: boolean; + constructor(opts?: DuplexOptions); + _write(chunk: any, encoding: string, callback: Function): void; + write(chunk: any, cb?: Function): boolean; + write(chunk: any, encoding?: string, cb?: Function): boolean; + end(): void; + end(chunk: any, cb?: Function): void; + end(chunk: any, encoding?: string, cb?: Function): void; + } + + export interface TransformOptions extends ReadableOptions, WritableOptions {} + + // Note: Transform lacks the _read and _write methods of Readable/Writable. + export class Transform extends events.EventEmitter implements NodeJS.ReadWriteStream { + readable: boolean; + writable: boolean; + constructor(opts?: TransformOptions); + _transform(chunk: any, encoding: string, callback: Function): void; + _flush(callback: Function): void; + read(size?: number): any; + setEncoding(encoding: string): void; + pause(): void; + resume(): void; + pipe(destination: T, options?: { end?: boolean; }): T; + unpipe(destination?: T): void; + unshift(chunk: any): void; + wrap(oldStream: NodeJS.ReadableStream): NodeJS.ReadableStream; + push(chunk: any, encoding?: string): boolean; + write(chunk: any, cb?: Function): boolean; + write(chunk: any, encoding?: string, cb?: Function): boolean; + end(): void; + end(chunk: any, cb?: Function): void; + end(chunk: any, encoding?: string, cb?: Function): void; + } + + export class PassThrough extends Transform {} +} + +declare module "util" { + export interface InspectOptions { + showHidden?: boolean; + depth?: number; + colors?: boolean; + customInspect?: boolean; + } + + export function format(format: any, ...param: any[]): string; + export function debug(string: string): void; + export function error(...param: any[]): void; + export function puts(...param: any[]): void; + export function print(...param: any[]): void; + export function log(string: string): void; + export function inspect(object: any, showHidden?: boolean, depth?: number, color?: boolean): string; + export function inspect(object: any, options: InspectOptions): string; + export function isArray(object: any): boolean; + export function isRegExp(object: any): boolean; + export function isDate(object: any): boolean; + export function isError(object: any): boolean; + export function inherits(constructor: any, superConstructor: any): void; + export function debuglog(key:string): (msg:string,...param: any[])=>void; +} + +declare module "assert" { + function internal (value: any, message?: string): void; + namespace internal { + export class AssertionError implements Error { + name: string; + message: string; + actual: any; + expected: any; + operator: string; + generatedMessage: boolean; + + constructor(options?: {message?: string; actual?: any; expected?: any; + operator?: string; stackStartFunction?: Function}); + } + + export function fail(actual?: any, expected?: any, message?: string, operator?: string): void; + export function ok(value: any, message?: string): void; + export function equal(actual: any, expected: any, message?: string): void; + export function notEqual(actual: any, expected: any, message?: string): void; + export function deepEqual(actual: any, expected: any, message?: string): void; + export function notDeepEqual(acutal: any, expected: any, message?: string): void; + export function strictEqual(actual: any, expected: any, message?: string): void; + export function notStrictEqual(actual: any, expected: any, message?: string): void; + export function deepStrictEqual(actual: any, expected: any, message?: string): void; + export function notDeepStrictEqual(actual: any, expected: any, message?: string): void; + export var throws: { + (block: Function, message?: string): void; + (block: Function, error: Function, message?: string): void; + (block: Function, error: RegExp, message?: string): void; + (block: Function, error: (err: any) => boolean, message?: string): void; + }; + + export var doesNotThrow: { + (block: Function, message?: string): void; + (block: Function, error: Function, message?: string): void; + (block: Function, error: RegExp, message?: string): void; + (block: Function, error: (err: any) => boolean, message?: string): void; + }; + + export function ifError(value: any): void; + } + + export = internal; +} + +declare module "tty" { + import * as net from "net"; + + export function isatty(fd: number): boolean; + export interface ReadStream extends net.Socket { + isRaw: boolean; + setRawMode(mode: boolean): void; + isTTY: boolean; + } + export interface WriteStream extends net.Socket { + columns: number; + rows: number; + isTTY: boolean; + } +} + +declare module "domain" { + import * as events from "events"; + + export class Domain extends events.EventEmitter implements NodeJS.Domain { + run(fn: Function): void; + add(emitter: events.EventEmitter): void; + remove(emitter: events.EventEmitter): void; + bind(cb: (err: Error, data: any) => any): any; + intercept(cb: (data: any) => any): any; + dispose(): void; + } + + export function create(): Domain; +} + +declare module "constants" { + export var E2BIG: number; + export var EACCES: number; + export var EADDRINUSE: number; + export var EADDRNOTAVAIL: number; + export var EAFNOSUPPORT: number; + export var EAGAIN: number; + export var EALREADY: number; + export var EBADF: number; + export var EBADMSG: number; + export var EBUSY: number; + export var ECANCELED: number; + export var ECHILD: number; + export var ECONNABORTED: number; + export var ECONNREFUSED: number; + export var ECONNRESET: number; + export var EDEADLK: number; + export var EDESTADDRREQ: number; + export var EDOM: number; + export var EEXIST: number; + export var EFAULT: number; + export var EFBIG: number; + export var EHOSTUNREACH: number; + export var EIDRM: number; + export var EILSEQ: number; + export var EINPROGRESS: number; + export var EINTR: number; + export var EINVAL: number; + export var EIO: number; + export var EISCONN: number; + export var EISDIR: number; + export var ELOOP: number; + export var EMFILE: number; + export var EMLINK: number; + export var EMSGSIZE: number; + export var ENAMETOOLONG: number; + export var ENETDOWN: number; + export var ENETRESET: number; + export var ENETUNREACH: number; + export var ENFILE: number; + export var ENOBUFS: number; + export var ENODATA: number; + export var ENODEV: number; + export var ENOENT: number; + export var ENOEXEC: number; + export var ENOLCK: number; + export var ENOLINK: number; + export var ENOMEM: number; + export var ENOMSG: number; + export var ENOPROTOOPT: number; + export var ENOSPC: number; + export var ENOSR: number; + export var ENOSTR: number; + export var ENOSYS: number; + export var ENOTCONN: number; + export var ENOTDIR: number; + export var ENOTEMPTY: number; + export var ENOTSOCK: number; + export var ENOTSUP: number; + export var ENOTTY: number; + export var ENXIO: number; + export var EOPNOTSUPP: number; + export var EOVERFLOW: number; + export var EPERM: number; + export var EPIPE: number; + export var EPROTO: number; + export var EPROTONOSUPPORT: number; + export var EPROTOTYPE: number; + export var ERANGE: number; + export var EROFS: number; + export var ESPIPE: number; + export var ESRCH: number; + export var ETIME: number; + export var ETIMEDOUT: number; + export var ETXTBSY: number; + export var EWOULDBLOCK: number; + export var EXDEV: number; + export var WSAEINTR: number; + export var WSAEBADF: number; + export var WSAEACCES: number; + export var WSAEFAULT: number; + export var WSAEINVAL: number; + export var WSAEMFILE: number; + export var WSAEWOULDBLOCK: number; + export var WSAEINPROGRESS: number; + export var WSAEALREADY: number; + export var WSAENOTSOCK: number; + export var WSAEDESTADDRREQ: number; + export var WSAEMSGSIZE: number; + export var WSAEPROTOTYPE: number; + export var WSAENOPROTOOPT: number; + export var WSAEPROTONOSUPPORT: number; + export var WSAESOCKTNOSUPPORT: number; + export var WSAEOPNOTSUPP: number; + export var WSAEPFNOSUPPORT: number; + export var WSAEAFNOSUPPORT: number; + export var WSAEADDRINUSE: number; + export var WSAEADDRNOTAVAIL: number; + export var WSAENETDOWN: number; + export var WSAENETUNREACH: number; + export var WSAENETRESET: number; + export var WSAECONNABORTED: number; + export var WSAECONNRESET: number; + export var WSAENOBUFS: number; + export var WSAEISCONN: number; + export var WSAENOTCONN: number; + export var WSAESHUTDOWN: number; + export var WSAETOOMANYREFS: number; + export var WSAETIMEDOUT: number; + export var WSAECONNREFUSED: number; + export var WSAELOOP: number; + export var WSAENAMETOOLONG: number; + export var WSAEHOSTDOWN: number; + export var WSAEHOSTUNREACH: number; + export var WSAENOTEMPTY: number; + export var WSAEPROCLIM: number; + export var WSAEUSERS: number; + export var WSAEDQUOT: number; + export var WSAESTALE: number; + export var WSAEREMOTE: number; + export var WSASYSNOTREADY: number; + export var WSAVERNOTSUPPORTED: number; + export var WSANOTINITIALISED: number; + export var WSAEDISCON: number; + export var WSAENOMORE: number; + export var WSAECANCELLED: number; + export var WSAEINVALIDPROCTABLE: number; + export var WSAEINVALIDPROVIDER: number; + export var WSAEPROVIDERFAILEDINIT: number; + export var WSASYSCALLFAILURE: number; + export var WSASERVICE_NOT_FOUND: number; + export var WSATYPE_NOT_FOUND: number; + export var WSA_E_NO_MORE: number; + export var WSA_E_CANCELLED: number; + export var WSAEREFUSED: number; + export var SIGHUP: number; + export var SIGINT: number; + export var SIGILL: number; + export var SIGABRT: number; + export var SIGFPE: number; + export var SIGKILL: number; + export var SIGSEGV: number; + export var SIGTERM: number; + export var SIGBREAK: number; + export var SIGWINCH: number; + export var SSL_OP_ALL: number; + export var SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION: number; + export var SSL_OP_CIPHER_SERVER_PREFERENCE: number; + export var SSL_OP_CISCO_ANYCONNECT: number; + export var SSL_OP_COOKIE_EXCHANGE: number; + export var SSL_OP_CRYPTOPRO_TLSEXT_BUG: number; + export var SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS: number; + export var SSL_OP_EPHEMERAL_RSA: number; + export var SSL_OP_LEGACY_SERVER_CONNECT: number; + export var SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER: number; + export var SSL_OP_MICROSOFT_SESS_ID_BUG: number; + export var SSL_OP_MSIE_SSLV2_RSA_PADDING: number; + export var SSL_OP_NETSCAPE_CA_DN_BUG: number; + export var SSL_OP_NETSCAPE_CHALLENGE_BUG: number; + export var SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG: number; + export var SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG: number; + export var SSL_OP_NO_COMPRESSION: number; + export var SSL_OP_NO_QUERY_MTU: number; + export var SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION: number; + export var SSL_OP_NO_SSLv2: number; + export var SSL_OP_NO_SSLv3: number; + export var SSL_OP_NO_TICKET: number; + export var SSL_OP_NO_TLSv1: number; + export var SSL_OP_NO_TLSv1_1: number; + export var SSL_OP_NO_TLSv1_2: number; + export var SSL_OP_PKCS1_CHECK_1: number; + export var SSL_OP_PKCS1_CHECK_2: number; + export var SSL_OP_SINGLE_DH_USE: number; + export var SSL_OP_SINGLE_ECDH_USE: number; + export var SSL_OP_SSLEAY_080_CLIENT_DH_BUG: number; + export var SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG: number; + export var SSL_OP_TLS_BLOCK_PADDING_BUG: number; + export var SSL_OP_TLS_D5_BUG: number; + export var SSL_OP_TLS_ROLLBACK_BUG: number; + export var ENGINE_METHOD_DSA: number; + export var ENGINE_METHOD_DH: number; + export var ENGINE_METHOD_RAND: number; + export var ENGINE_METHOD_ECDH: number; + export var ENGINE_METHOD_ECDSA: number; + export var ENGINE_METHOD_CIPHERS: number; + export var ENGINE_METHOD_DIGESTS: number; + export var ENGINE_METHOD_STORE: number; + export var ENGINE_METHOD_PKEY_METHS: number; + export var ENGINE_METHOD_PKEY_ASN1_METHS: number; + export var ENGINE_METHOD_ALL: number; + export var ENGINE_METHOD_NONE: number; + export var DH_CHECK_P_NOT_SAFE_PRIME: number; + export var DH_CHECK_P_NOT_PRIME: number; + export var DH_UNABLE_TO_CHECK_GENERATOR: number; + export var DH_NOT_SUITABLE_GENERATOR: number; + export var NPN_ENABLED: number; + export var RSA_PKCS1_PADDING: number; + export var RSA_SSLV23_PADDING: number; + export var RSA_NO_PADDING: number; + export var RSA_PKCS1_OAEP_PADDING: number; + export var RSA_X931_PADDING: number; + export var RSA_PKCS1_PSS_PADDING: number; + export var POINT_CONVERSION_COMPRESSED: number; + export var POINT_CONVERSION_UNCOMPRESSED: number; + export var POINT_CONVERSION_HYBRID: number; + export var O_RDONLY: number; + export var O_WRONLY: number; + export var O_RDWR: number; + export var S_IFMT: number; + export var S_IFREG: number; + export var S_IFDIR: number; + export var S_IFCHR: number; + export var S_IFLNK: number; + export var O_CREAT: number; + export var O_EXCL: number; + export var O_TRUNC: number; + export var O_APPEND: number; + export var F_OK: number; + export var R_OK: number; + export var W_OK: number; + export var X_OK: number; + export var UV_UDP_REUSEADDR: number; +} diff --git a/node/node-tests.ts b/node/node-tests.ts index 66c4256caf..1361a7206f 100644 --- a/node/node-tests.ts +++ b/node/node-tests.ts @@ -8,6 +8,7 @@ import * as util from "util"; import * as crypto from "crypto"; import * as tls from "tls"; import * as http from "http"; +import * as https from "https"; import * as net from "net"; import * as tty from "tty"; import * as dgram from "dgram"; @@ -15,6 +16,7 @@ import * as querystring from "querystring"; import * as path from "path"; import * as readline from "readline"; import * as childProcess from "child_process"; +import * as cluster from "cluster"; import * as os from "os"; import * as vm from "vm"; // Specifically test buffer module regression. @@ -128,6 +130,13 @@ fs.readFile('testfile', (err, data) => { } }); +fs.mkdtemp('/tmp/foo-', (err, folder) => { + console.log(folder); + // Prints: /tmp/foo-itXde2 +}); + +var tempDir: string; +tempDir = fs.mkdtempSync('/tmp/foo-'); /////////////////////////////////////////////////////// /// Buffer tests : https://nodejs.org/api/buffer.html @@ -138,6 +147,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')); @@ -146,6 +156,35 @@ function bufferTests() { var result1 = Buffer.concat([utf8Buffer, base64Buffer]); var result2 = Buffer.concat([utf8Buffer, base64Buffer], 9999999); + // Class Method: Buffer.from(array) + { + const buf: Buffer = Buffer.from([0x62,0x75,0x66,0x66,0x65,0x72]); + } + + // Class Method: Buffer.from(arrayBuffer[, byteOffset[, length]]) + { + const arr: Uint16Array = new Uint16Array(2); + arr[0] = 5000; + arr[1] = 4000; + + let buf: Buffer; + buf = Buffer.from(arr.buffer); + buf = Buffer.from(arr.buffer, 1); + buf = Buffer.from(arr.buffer, 0, 1); + } + + // Class Method: Buffer.from(buffer) + { + const buf1: Buffer = Buffer.from('buffer'); + const buf2: Buffer = Buffer.from(buf1); + } + + // Class Method: Buffer.from(str[, encoding]) + { + const buf1: Buffer = Buffer.from('this is a tést'); + const buf2: Buffer = Buffer.from('7468697320697320612074c3a97374', 'hex'); + } + // Test that TS 1.6 works with the 'as Buffer' annotation // on isBuffer. var a: Buffer | number; @@ -181,6 +220,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); + } } @@ -323,6 +368,31 @@ namespace http_tests { }); } +//////////////////////////////////////////////////// +/// Https tests : http://nodejs.org/api/https.html +//////////////////////////////////////////////////// +namespace https_tests { + var agent: https.Agent = new https.Agent({ + keepAlive: true, + keepAliveMsecs: 10000, + maxSockets: Infinity, + maxFreeSockets: 256, + maxCachedSessions: 100 + }); + + var agent: https.Agent = https.globalAgent; + + https.request({ + agent: false + }); + https.request({ + agent: agent + }); + https.request({ + agent: undefined + }); +} + //////////////////////////////////////////////////// /// TTY tests : http://nodejs.org/api/tty.html //////////////////////////////////////////////////// @@ -636,6 +706,18 @@ namespace readline_tests { childProcess.exec("echo test"); childProcess.spawnSync("echo test"); +////////////////////////////////////////////////////////////////////// +/// cluster tests: https://nodejs.org/api/cluster.html /// +////////////////////////////////////////////////////////////////////// + +cluster.fork(); +Object.keys(cluster.workers).forEach(key => { + const worker = cluster.workers[key]; + if (worker.isDead()) { + console.log('worker %d is dead', worker.process.pid); + } +}); + //////////////////////////////////////////////////// /// os tests : https://nodejs.org/api/os.html //////////////////////////////////////////////////// diff --git a/node/node.d.ts b/node/node.d.ts index 66e9a935f7..42621d50c4 100644 --- a/node/node.d.ts +++ b/node/node.d.ts @@ -1,11 +1,11 @@ -// Type definitions for Node.js v4.x +// Type definitions for Node.js v6.x // Project: http://nodejs.org/ // Definitions by: Microsoft TypeScript , DefinitelyTyped // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /************************************************ * * -* Node.js v4.x API * +* Node.js v6.x API * * * ************************************************/ @@ -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. * @@ -121,6 +129,37 @@ declare var Buffer: { */ new (buffer: Buffer): Buffer; prototype: Buffer; + /** + * Allocates a new Buffer using an {array} of octets. + * + * @param array + */ + from(array: any[]): Buffer; + /** + * When passed a reference to the .buffer property of a TypedArray instance, + * the newly created Buffer will share the same allocated memory as the TypedArray. + * The optional {byteOffset} and {length} arguments specify a memory range + * within the {arrayBuffer} that will be shared by the Buffer. + * + * @param arrayBuffer The .buffer property of a TypedArray or a new ArrayBuffer() + * @param byteOffset + * @param length + */ + from(arrayBuffer: ArrayBuffer, byteOffset?: number, length?:number): Buffer; + /** + * Copies the passed {buffer} data onto a new Buffer instance. + * + * @param buffer + */ + from(buffer: Buffer): Buffer; + /** + * Creates a new Buffer containing the given JavaScript string {str}. + * If provided, the {encoding} parameter identifies the character encoding. + * If not provided, {encoding} defaults to 'utf8'. + * + * @param str + */ + from(str: string, encoding?: string): Buffer; /** * Returns true if {obj} is a Buffer * @@ -382,12 +421,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; @@ -428,8 +465,13 @@ interface NodeBuffer { writeFloatBE(value: number, offset: number, noAssert?: boolean): number; writeDoubleLE(value: number, offset: number, noAssert?: boolean): number; writeDoubleBE(value: number, offset: number, noAssert?: boolean): number; - fill(value: any, offset?: number, end?: number): Buffer; + fill(value: any, offset?: number, end?: number): this; + // TODO: encoding param indexOf(value: string | number | Buffer, byteOffset?: number): number; + // TODO: entries + // TODO: includes + // TODO: keys + // TODO: values } /************************************************ @@ -668,6 +710,8 @@ declare module "cluster" { kill(signal?: string): void; destroy(signal?: string): void; disconnect(): void; + isConnected(): boolean; + isDead(): boolean; } export var settings: ClusterSettings; @@ -677,7 +721,9 @@ declare module "cluster" { export function fork(env?: any): Worker; export function disconnect(callback?: Function): void; export var worker: Worker; - export var workers: Worker[]; + export var workers: { + [index: string]: Worker + }; // Event emitter export function addListener(event: string, listener: Function): void; @@ -824,7 +870,7 @@ declare module "https" { SNICallback?: (servername: string) => any; } - export interface RequestOptions extends http.RequestOptions{ + export interface RequestOptions extends http.RequestOptions { pfx?: any; key?: any; passphrase?: string; @@ -835,13 +881,14 @@ declare module "https" { secureProtocol?: string; } - export interface Agent { - maxSockets: number; - sockets: any; - requests: any; + export interface Agent extends http.Agent { } + + export interface AgentOptions extends http.AgentOptions { + maxCachedSessions?: number; } + export var Agent: { - new (options?: RequestOptions): Agent; + new (options?: AgentOptions): Agent; }; export interface Server extends tls.Server { } export function createServer(options: ServerOptions, requestListener?: Function): Server; @@ -974,6 +1021,7 @@ declare module "child_process" { pid: number; kill(signal?: string): void; send(message: any, sendHandle?: any): void; + connected: boolean; disconnect(): void; unref(): void; } @@ -1145,7 +1193,7 @@ declare module "url" { host?: string; pathname?: string; search?: string; - query?: any; // string | Object + query?: string | any; slashes?: boolean; hash?: string; path?: string; @@ -1339,78 +1387,78 @@ declare module "fs" { * @param newPath */ export function renameSync(oldPath: string, newPath: string): void; - export function truncate(path: string, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function truncate(path: string, len: number, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function truncateSync(path: string, len?: number): void; + export function truncate(path: string | Buffer, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function truncate(path: string | Buffer, len: number, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function truncateSync(path: string | Buffer, len?: number): void; export function ftruncate(fd: number, callback?: (err?: NodeJS.ErrnoException) => void): void; export function ftruncate(fd: number, len: number, callback?: (err?: NodeJS.ErrnoException) => void): void; export function ftruncateSync(fd: number, len?: number): void; - export function chown(path: string, uid: number, gid: number, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function chownSync(path: string, uid: number, gid: number): void; + export function chown(path: string | Buffer, uid: number, gid: number, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function chownSync(path: string | Buffer, uid: number, gid: number): void; export function fchown(fd: number, uid: number, gid: number, callback?: (err?: NodeJS.ErrnoException) => void): void; export function fchownSync(fd: number, uid: number, gid: number): void; - export function lchown(path: string, uid: number, gid: number, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function lchownSync(path: string, uid: number, gid: number): void; - export function chmod(path: string, mode: number, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function chmod(path: string, mode: string, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function chmodSync(path: string, mode: number): void; - export function chmodSync(path: string, mode: string): void; + export function lchown(path: string | Buffer, uid: number, gid: number, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function lchownSync(path: string | Buffer, uid: number, gid: number): void; + export function chmod(path: string | Buffer, mode: number, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function chmod(path: string | Buffer, mode: string, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function chmodSync(path: string | Buffer, mode: number): void; + export function chmodSync(path: string | Buffer, mode: string): void; export function fchmod(fd: number, mode: number, callback?: (err?: NodeJS.ErrnoException) => void): void; export function fchmod(fd: number, mode: string, callback?: (err?: NodeJS.ErrnoException) => void): void; export function fchmodSync(fd: number, mode: number): void; export function fchmodSync(fd: number, mode: string): void; - export function lchmod(path: string, mode: number, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function lchmod(path: string, mode: string, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function lchmodSync(path: string, mode: number): void; - export function lchmodSync(path: string, mode: string): void; - export function stat(path: string, callback?: (err: NodeJS.ErrnoException, stats: Stats) => any): void; - export function lstat(path: string, callback?: (err: NodeJS.ErrnoException, stats: Stats) => any): void; + export function lchmod(path: string | Buffer, mode: number, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function lchmod(path: string | Buffer, mode: string, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function lchmodSync(path: string | Buffer, mode: number): void; + export function lchmodSync(path: string | Buffer, mode: string): void; + export function stat(path: string | Buffer, callback?: (err: NodeJS.ErrnoException, stats: Stats) => any): void; + export function lstat(path: string | Buffer, callback?: (err: NodeJS.ErrnoException, stats: Stats) => any): void; export function fstat(fd: number, callback?: (err: NodeJS.ErrnoException, stats: Stats) => any): void; - export function statSync(path: string): Stats; - export function lstatSync(path: string): Stats; + export function statSync(path: string | Buffer): Stats; + export function lstatSync(path: string | Buffer): Stats; export function fstatSync(fd: number): Stats; - export function link(srcpath: string, dstpath: string, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function linkSync(srcpath: string, dstpath: string): void; - export function symlink(srcpath: string, dstpath: string, type?: string, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function symlinkSync(srcpath: string, dstpath: string, type?: string): void; - export function readlink(path: string, callback?: (err: NodeJS.ErrnoException, linkString: string) => any): void; - export function readlinkSync(path: string): string; - export function realpath(path: string, callback?: (err: NodeJS.ErrnoException, resolvedPath: string) => any): void; - export function realpath(path: string, cache: {[path: string]: string}, callback: (err: NodeJS.ErrnoException, resolvedPath: string) =>any): void; - export function realpathSync(path: string, cache?: { [path: string]: string }): string; + export function link(srcpath: string | Buffer, dstpath: string | Buffer, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function linkSync(srcpath: string | Buffer, dstpath: string | Buffer): void; + export function symlink(srcpath: string | Buffer, dstpath: string | Buffer, type?: string, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function symlinkSync(srcpath: string | Buffer, dstpath: string | Buffer, type?: string): void; + export function readlink(path: string | Buffer, callback?: (err: NodeJS.ErrnoException, linkString: string) => any): void; + export function readlinkSync(path: string | Buffer): string; + export function realpath(path: string | Buffer, callback?: (err: NodeJS.ErrnoException, resolvedPath: string) => any): void; + export function realpath(path: string | Buffer, cache: {[path: string]: string}, callback: (err: NodeJS.ErrnoException, resolvedPath: string) => any): void; + export function realpathSync(path: string | Buffer, cache?: { [path: string]: string }): string; /* * Asynchronous unlink - deletes the file specified in {path} * * @param path * @param callback No arguments other than a possible exception are given to the completion callback. */ - export function unlink(path: string, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function unlink(path: string | Buffer, callback?: (err?: NodeJS.ErrnoException) => void): void; /* * Synchronous unlink - deletes the file specified in {path} * * @param path */ - export function unlinkSync(path: string): void; + export function unlinkSync(path: string | Buffer): void; /* * Asynchronous rmdir - removes the directory specified in {path} * * @param path * @param callback No arguments other than a possible exception are given to the completion callback. */ - export function rmdir(path: string, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function rmdir(path: string | Buffer, callback?: (err?: NodeJS.ErrnoException) => void): void; /* * Synchronous rmdir - removes the directory specified in {path} * * @param path */ - export function rmdirSync(path: string): void; + export function rmdirSync(path: string | Buffer): void; /* * Asynchronous mkdir - creates the directory specified in {path}. Parameter {mode} defaults to 0777. * * @param path * @param callback No arguments other than a possible exception are given to the completion callback. */ - export function mkdir(path: string, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function mkdir(path: string | Buffer, callback?: (err?: NodeJS.ErrnoException) => void): void; /* * Asynchronous mkdir - creates the directory specified in {path}. Parameter {mode} defaults to 0777. * @@ -1418,7 +1466,7 @@ declare module "fs" { * @param mode * @param callback No arguments other than a possible exception are given to the completion callback. */ - export function mkdir(path: string, mode: number, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function mkdir(path: string | Buffer, mode: number, callback?: (err?: NodeJS.ErrnoException) => void): void; /* * Asynchronous mkdir - creates the directory specified in {path}. Parameter {mode} defaults to 0777. * @@ -1426,7 +1474,7 @@ declare module "fs" { * @param mode * @param callback No arguments other than a possible exception are given to the completion callback. */ - export function mkdir(path: string, mode: string, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function mkdir(path: string | Buffer, mode: string, callback?: (err?: NodeJS.ErrnoException) => void): void; /* * Synchronous mkdir - creates the directory specified in {path}. Parameter {mode} defaults to 0777. * @@ -1434,7 +1482,7 @@ declare module "fs" { * @param mode * @param callback No arguments other than a possible exception are given to the completion callback. */ - export function mkdirSync(path: string, mode?: number): void; + export function mkdirSync(path: string | Buffer, mode?: number): void; /* * Synchronous mkdir - creates the directory specified in {path}. Parameter {mode} defaults to 0777. * @@ -1442,20 +1490,34 @@ declare module "fs" { * @param mode * @param callback No arguments other than a possible exception are given to the completion callback. */ - export function mkdirSync(path: string, mode?: string): void; - export function readdir(path: string, callback?: (err: NodeJS.ErrnoException, files: string[]) => void): void; - export function readdirSync(path: string): string[]; + export function mkdirSync(path: string | Buffer, mode?: string): void; + /* + * Asynchronous mkdtemp - Creates a unique temporary directory. Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + * + * @param prefix + * @param callback The created folder path is passed as a string to the callback's second parameter. + */ + export function mkdtemp(prefix: string, callback?: (err: NodeJS.ErrnoException, folder: string) => void): void; + /* + * Synchronous mkdtemp - Creates a unique temporary directory. Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + * + * @param prefix + * @returns Returns the created folder path. + */ + export function mkdtempSync(prefix: string): string; + export function readdir(path: string | Buffer, callback?: (err: NodeJS.ErrnoException, files: string[]) => void): void; + export function readdirSync(path: string | Buffer): string[]; export function close(fd: number, callback?: (err?: NodeJS.ErrnoException) => void): void; export function closeSync(fd: number): void; - export function open(path: string, flags: string, callback?: (err: NodeJS.ErrnoException, fd: number) => any): void; - export function open(path: string, flags: string, mode: number, callback?: (err: NodeJS.ErrnoException, fd: number) => any): void; - export function open(path: string, flags: string, mode: string, callback?: (err: NodeJS.ErrnoException, fd: number) => any): void; - export function openSync(path: string, flags: string, mode?: number): number; - export function openSync(path: string, flags: string, mode?: string): number; - export function utimes(path: string, atime: number, mtime: number, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function utimes(path: string, atime: Date, mtime: Date, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function utimesSync(path: string, atime: number, mtime: number): void; - export function utimesSync(path: string, atime: Date, mtime: Date): void; + export function open(path: string | Buffer, flags: string, callback?: (err: NodeJS.ErrnoException, fd: number) => any): void; + export function open(path: string | Buffer, flags: string, mode: number, callback?: (err: NodeJS.ErrnoException, fd: number) => any): void; + export function open(path: string | Buffer, flags: string, mode: string, callback?: (err: NodeJS.ErrnoException, fd: number) => any): void; + export function openSync(path: string | Buffer, flags: string, mode?: number): number; + export function openSync(path: string | Buffer, flags: string, mode?: string): number; + export function utimes(path: string | Buffer, atime: number, mtime: number, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function utimes(path: string | Buffer, atime: Date, mtime: Date, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function utimesSync(path: string | Buffer, atime: number, mtime: number): void; + export function utimesSync(path: string | Buffer, atime: Date, mtime: Date): void; export function futimes(fd: number, atime: number, mtime: number, callback?: (err?: NodeJS.ErrnoException) => void): void; export function futimes(fd: number, atime: Date, mtime: Date, callback?: (err?: NodeJS.ErrnoException) => void): void; export function futimesSync(fd: number, atime: number, mtime: number): void; @@ -1538,8 +1600,8 @@ declare module "fs" { export function unwatchFile(filename: string, listener?: (curr: Stats, prev: Stats) => void): void; export function watch(filename: string, listener?: (event: string, filename: string) => any): FSWatcher; export function watch(filename: string, options: { persistent?: boolean; }, listener?: (event: string, filename: string) => any): FSWatcher; - export function exists(path: string, callback?: (exists: boolean) => void): void; - export function existsSync(path: string): boolean; + export function exists(path: string | Buffer, callback?: (exists: boolean) => void): void; + export function existsSync(path: string | Buffer): boolean; /** Constant for fs.access(). File is visible to the calling process. */ export var F_OK: number; /** Constant for fs.access(). File can be read by the calling process. */ @@ -1549,18 +1611,18 @@ declare module "fs" { /** Constant for fs.access(). File can be executed by the calling process. */ export var X_OK: number; /** Tests a user's permissions for the file specified by path. */ - export function access(path: string, callback: (err: NodeJS.ErrnoException) => void): void; - export function access(path: string, mode: number, callback: (err: NodeJS.ErrnoException) => void): void; + export function access(path: string | Buffer, callback: (err: NodeJS.ErrnoException) => void): void; + export function access(path: string | Buffer, mode: number, callback: (err: NodeJS.ErrnoException) => void): void; /** Synchronous version of fs.access. This throws if any accessibility checks fail, and does nothing otherwise. */ - export function accessSync(path: string, mode ?: number): void; - export function createReadStream(path: string, options?: { + export function accessSync(path: string | Buffer, mode ?: number): void; + export function createReadStream(path: string | Buffer, options?: { flags?: string; encoding?: string; fd?: number; mode?: number; autoClose?: boolean; }): ReadStream; - export function createWriteStream(path: string, options?: { + export function createWriteStream(path: string | Buffer, options?: { flags?: string; encoding?: string; fd?: number; @@ -1753,13 +1815,13 @@ declare module "tls" { host?: string; port?: number; socket?: net.Socket; - pfx?: any; //string | Buffer - key?: any; //string | Buffer + pfx?: string | Buffer + key?: string | Buffer passphrase?: string; - cert?: any; //string | Buffer - ca?: any; //Array of string | Buffer + cert?: string | Buffer + ca?: (string | Buffer)[]; rejectUnauthorized?: boolean; - NPNProtocols?: any; //Array of string | Buffer + NPNProtocols?: (string | Buffer)[]; servername?: string; } @@ -1798,12 +1860,12 @@ declare module "tls" { } export interface SecureContextOptions { - pfx?: any; //string | buffer - key?: any; //string | buffer + pfx?: string | Buffer; + key?: string | Buffer; passphrase?: string; - cert?: any; // string | buffer - ca?: any; // string | buffer - crl?: any; // string | string[] + cert?: string | Buffer; + ca?: string | Buffer; + crl?: string | string[] ciphers?: string; honorCipherOrder?: boolean; } @@ -1826,8 +1888,8 @@ declare module "crypto" { key: string; passphrase: string; cert: string; - ca: any; //string | string array - crl: any; //string | string array + ca: string | string[]; + crl: string | string[]; ciphers: string; } export interface Credentials { context?: any; } diff --git a/normalizr/normalizr-tests.ts b/normalizr/normalizr-tests.ts new file mode 100644 index 0000000000..0da5a8aa0b --- /dev/null +++ b/normalizr/normalizr-tests.ts @@ -0,0 +1,270 @@ +/// + +import { normalize, Schema, arrayOf, unionOf, valuesOf } from 'normalizr'; + +// First, define a schema for our entities: + +const article1 = new Schema('articles'); +const user1 = new Schema('users'); + +// Then we define nesting rules: + +article1.define({ + author: user1, + contributors: arrayOf(user1) +}); + +// Now we can use this schema in our API response handlers: + +const ServerActionCreators = { + // These are two different XHR endpoints with different response schemas. + // We can use the schema objects defined earlier to express both of them: + + receiveOneArticle(response: any) { + // Here, the response is an object containing data about one article. + // Passing the article schema as second parameter to normalize() lets it + // correctly traverse the response tree and gather all entities: + + // BEFORE: + // { + // id: 1, + // title: 'Some Article', + // author: { + // id: 7, + // name: 'Dan' + // }, + // contributors: [{ + // id: 10, + // name: 'Abe' + // }, { + // id: 15, + // name: 'Fred' + // }] + // } + // + // AFTER: + // { + // result: 1, // <--- Note object is referenced by ID + // entities: { + // articles: { + // 1: { + // author: 7, // <--- Same happens for references to + // contributors: [10, 15] // <--- other entities in the schema + // ...} + // }, + // users: { + // 7: { ... }, + // 10: { ... }, + // 15: { ... } + // } + // } + // } + + response = normalize(response, article1); + }, + + receiveAllArticles(response: any) { + // Here, the response is an object with the key 'articles' referencing + // an array of article objects. Passing { articles: arrayOf(article) } as + // second parameter to normalize() lets it correctly traverse the response + // tree and gather all entities: + + // BEFORE: + // { + // articles: [{ + // id: 1, + // title: 'Some Article', + // author: { + // id: 7, + // name: 'Dan' + // }, + // ... + // }, + // ... + // ] + // } + // + // AFTER: + // { + // result: { + // articles: [1, 2, ...] // <--- Note how object array turned into ID array + // }, + // entities: { + // articles: { + // 1: { author: 7, ... }, // <--- Same happens for references to other entities in the schema + // 2: { ... }, + // ... + // }, + // users: { + // 7: { ... }, + // .. + // } + // } + // } + + response = normalize(response, { + articles: arrayOf(article1) + }); + } +} + +// new Schema(key, [options]) + +const article2 = new Schema('articles'); + +// You can use a custom id attribute +const article3 = new Schema('articles', { idAttribute: 'slug' }); + +// Or you can specify a function to infer it +function generateSlug(entity: any) { /* ... */ } +const article4 = new Schema('articles', { idAttribute: generateSlug }); + +// Schema.prototype.define(nestedSchema) + +const article5 = new Schema('articles'); +const user5 = new Schema('users'); + +article5.define({ + author: user5 +}); + +// Schema.prototype.getKey() + +const article6 = new Schema('articles'); + +article6.getKey(); +// articles + +// Schema.prototype.getIdAttribute() + +const article7 = new Schema('articles'); +const slugArticle7 = new Schema('articles', { idAttribute: 'slug' }); + +article7.getIdAttribute(); +// id +slugArticle7.getIdAttribute(); +// slug + +// arrayOf(schema, [options]) + +const article8 = new Schema('articles'); +const user8 = new Schema('users'); + +article8.define({ + author: user8, + contributors: arrayOf(user8) +}); + +const article9 = new Schema('articles'); +const image9 = new Schema('images'); +const video9 = new Schema('videos'); +const asset9 = { + images: image9, + videos: video9 +}; + +// You can specify the name of the attribute that determines the schema +article9.define({ + assets: arrayOf(asset9, { schemaAttribute: 'type' }) +}); + +// Or you can specify a function to infer it +function inferSchema9(entity: any) { /* ... */ } +article9.define({ + assets: arrayOf(asset9, { schemaAttribute: inferSchema9 }) +}); + +// valuesOf(schema, [options]) + +const article10 = new Schema('articles'); +const user10 = new Schema('users'); + +article10.define({ + collaboratorsByRole: valuesOf(user10) +}); + +const article11 = new Schema('articles'); +const user11 = new Schema('users'); +const group11 = new Schema('groups'); +const collaborator11 = { + users: user11, + groups: group11 +}; + +// You can specify the name of the attribute that determines the schema +article11.define({ + collaboratorsByRole: valuesOf(collaborator11, { schemaAttribute: 'type' }) +}); + +// Or you can specify a function to infer it +function inferSchema11(entity: any) { /* ... */ } +article11.define({ + collaboratorsByRole: valuesOf(collaborator11, { schemaAttribute: inferSchema }) +}); + +// unionOf(schemaMap, [options]) + +const group12 = new Schema('groups'); +const user12 = new Schema('users'); + +// a member can be either a user or a group +const member12 = { + users: user12, + groups: group12 +}; + +// You can specify the name of the attribute that determines the schema +group12.define({ + owner: unionOf(member12, { schemaAttribute: 'type' }) +}); + +// Or you can specify a function to infer it +function inferSchema(entity: any) { /* ... */ } +group12.define({ + creator: unionOf(member12, { schemaAttribute: inferSchema }) +}); + +const group13 = new Schema('groups'); +const user13 = new Schema('users'); + +const member13 = unionOf({ + users: user13, + groups: group13 +}, { schemaAttribute: 'type' }); + +group13.define({ + owner: member13, + members: arrayOf(member13), + relationships: valuesOf(member13) +}); + +// normalize(obj, schema, [options]) + +const article14 = new Schema('articles'); +const user14 = new Schema('users'); + +article14.define({ + author: user14, + contributors: arrayOf(user14), + meta: { + likes: arrayOf({ + user: user14 + }) + } +}); + +// ... + +// Normalize one article object +const json = { id: 1, author: /*...*/{} }; +const normalized1 = normalize(json, article14); + +// Normalize an array of article objects +const arr = [{ id: 1, author: /*...*/{} }/*, ...*/] +const normalized2 = normalize(arr, arrayOf(article14)); + +// Normalize an array of article objects, referenced by an object key: +const wrappedArr = { articles: [{ id: 1, author: /*...*/{} }/*, ...*/] } +const normalized3 = normalize(wrappedArr, { + articles: arrayOf(article14) +}); diff --git a/normalizr/normalizr.d.ts b/normalizr/normalizr.d.ts new file mode 100644 index 0000000000..aff53adabb --- /dev/null +++ b/normalizr/normalizr.d.ts @@ -0,0 +1,111 @@ +// Type definitions for normalizr 2.0.1 +// Project: https://github.com/gaearon/normalizr/ +// Definitions by: Markus Peloso +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare module "normalizr" { + export = Normalizr; +} + +declare namespace Normalizr { + type AttributeSetting = string | ((entity: any) => any); + + type SchemaClass = Schema | ArraySchema | UnionSchema; + + type SchemaObject = { [property: string]: SchemaClass | SchemaObject }; + + type SchemaType = SchemaClass | SchemaObject | Object; + + export class Schema { + /** + * Schema lets you define a type of entity returned by your API. + * This should correspond to model in your server code. + * @param key The key parameter lets you specify the name of the dictionary for this kind of entity. + * @param options + */ + constructor(key: string, options?: { idAttribute: AttributeSetting; }); + + /** + * Lets you specify relationships between different entities. + * @param nestedSchema + */ + define(nestedSchema: SchemaObject): void; + + /** + * Returns the key of the schema. + */ + getKey(): string; + + /** + * Returns the idAttribute of the schema. + */ + getIdAttribute(): AttributeSetting; + } + + interface UnionSchema { + getItemSchema(): SchemaType; + getSchemaKey(item: any): string; + } + + interface ArraySchema { + getItemSchema(): SchemaType; + } + + /** + * Describes an array of the schema passed as argument. + * @param schema + * @param options + */ + export function arrayOf(schema: SchemaType, options?: { + /** + * If the array contains entities with different schemas, you can use the schemaAttribute option to specify which schema to use for each entity. + */ + schemaAttribute: AttributeSetting + }): ArraySchema; + + /** + * Describes a map whose values follow the schema passed as argument. + * @param schema + * @param options + */ + export function valuesOf(schema: SchemaType, options?: { + /** + * If the map contains entities with different schemas, you can use the schemaAttribute option to specify which schema to use for each entity. + */ + schemaAttribute: AttributeSetting + }): ArraySchema; + + /** + * Describe a schema which is a union of multiple schemas. This is useful if you need the polymorphic behavior provided by arrayOf or valuesOf but for non-collection fields. + * @param schemaMap + * @param options + */ + export function unionOf(schemaMap: SchemaType, options?: { + /** + * Use the required schemaAttribute option to specify which schema to use for each entity. + */ + schemaAttribute: AttributeSetting + }): UnionSchema; + + /** + * Normalizes object according to schema. + * Passed schema should be a nested object reflecting the structure of API response. + * @param obj + * @param schema + * @param options + */ + export function normalize(obj: any | Array, schema: SchemaType, options?: { + /** + * This is useful if your backend emits additional fields, such as separate ID fields, you'd like to delete in the normalized entity. + */ + assignEntity?: (normalized: any, key: string, entity: any) => any; + + /** + * You can use this to resolve conflicts when merging entities with the same key. + */ + mergeIntoEntity?: (stored: any, normalized: any, entityKey: string) => any; + }): { + entities: any; + result: any; + }; +} 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/nunjucks/nunjucks.d.ts b/nunjucks/nunjucks.d.ts index f6c059128f..6a6d384d87 100644 --- a/nunjucks/nunjucks.d.ts +++ b/nunjucks/nunjucks.d.ts @@ -3,131 +3,131 @@ // Definitions by: Ruben Slabbert // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +declare namespace nunjucks { + export function render(name: string, context?: Object): string; + export function render(name: string, context?: Object, callback?: (err: any, res: string) => any): void; + + export function renderString(src: string, context: Object): string; + export function renderString(src: string, context: Object, callback?: (err: any, res: string) => any): void; + + export function compile(src: string, env?: Environment): Template; + export function compile(src: string, env?: Environment, callback?: (err: any, res: Template) => any): Template; + + export function precompile(path: string, opts?: PrecompileOptions): string; + export function precompileString(src: string, opts?: PrecompileOptions): string; + + export interface PrecompileOptions { + name?: string; + asFunction?: boolean; + force?: boolean; + env?: Environment; + include?: string[]; + exclude?: string[]; + wrapper?(templates: { name: string, template: string }, opts: PrecompileOptions): string; + } + + export class Template { + constructor(src: string, env?: Environment, eagerCompile?: boolean); + render(context?: Object): string; + render(context?: Object, callback?: (err: any, res: string) => any): void; + } + + export function configure(options: ConfigureOptions): Environment; + export function configure(path: string, options?: ConfigureOptions): Environment; + + export interface ConfigureOptions { + autoescape?: boolean; + throwOnUndefined?: boolean; + trimBlocks?: boolean; + lstripBlocks?: boolean; + watch?: boolean; + noCache?: boolean; + web?: { + useCache?: boolean, + async?: boolean + }; + express?: Object; + tags?: { + blockStart?: string, + blockEnd?: string, + variableStart?: string, + variableEnd?: string, + commentStart?: string, + commentEnd?: string + }; + } + + export class Environment { + options: { + autoescape: boolean; + }; + + constructor(loader: ILoader, opts?: ConfigureOptions); + constructor(loaders: ILoader[], opts?: ConfigureOptions); + + render(name: string, context?: Object): string; + render(name: string, context?: Object, callback?: (err: any, res: string) => any): void; + + renderString(name: string, context: Object): string; + renderString(name: string, context: Object, callback?: (err: any, res: string) => any): void; + + addFilter(name: string, func: (...args: any[]) => any, async?: boolean): void; + getFilter(name: string): void; + + addExtension(name: string, ext: Extension): void; + removeExtension(name: string): void; + getExtension(name: string): Extension; + hasExtension(name: string): void; + + addGlobal(name: string, value: any): void; + + getTemplate(name: string, eagerCompile?: boolean): Template; + getTemplate(name: string, eagerCompile?: boolean, callback?: (err: any, templ: Template) => Template): void; + + express(app: Object): void; + } + + export interface Extension { + tags: string[]; + // Parser API is undocumented it is suggested to check the source: https://github.com/mozilla/nunjucks/blob/master/src/parser.js + parse(parser: any, nodes: any, lexer: any): any; + } + + export function installJinjaCompat(): void; + + export interface ILoader { + async?: boolean; + getSource(name: string): LoaderSource; + extend?(extender: ILoader): ILoader; + } + + // Needs both Loader and ILoader since nunjucks uses a custom object system + // Object system is also responsible for the extend methods + export class Loader { + on(name: string, func: (...args: any[]) => any): void; + emit(name: string, ...args: any[]): void; + resolve(from: string, to: string): string; + isRelative(filename: string): boolean; + extend(toExtend: ILoader): ILoader; + } + + export interface LoaderSource { + src: string; + path: string; + noCache: boolean; + } + + export class FileSystemLoader extends Loader implements ILoader { + init(searchPaths: string[], opts: any): void; + getSource(name: string): LoaderSource; + } + + export class PrecompiledLoader extends Loader implements ILoader { + init(searchPaths: string[], opts: any): void; + getSource(name: string): LoaderSource; + } +} + declare module "nunjucks" { - namespace Nunjucks { - function render(name: string, context?: Object): string; - function render(name: string, context?: Object, callback?: (err: any, res: string) => any): void; - - function renderString(src: string, context: Object): string; - function renderString(src: string, context: Object, callback?: (err: any, res: string) => any): void; - - function compile(src: string, env?: Environment): Template; - function compile(src: string, env?: Environment, callback?: (err: any, res: Template) => any): Template; - - function precompile(path: string, opts?: PrecompileOptions): string; - function precompileString(src: string, opts?: PrecompileOptions): string; - - interface PrecompileOptions { - name?: string; - asFunction?: boolean; - force?: boolean; - env?: Environment; - include?: string[]; - exclude?: string[]; - wrapper?(templates: { name: string, template: string }, opts: PrecompileOptions): string; - } - - class Template { - constructor(src: string, env?: Environment, eagerCompile?: boolean); - render(context?: Object): string; - render(context?: Object, callback?: (err: any, res: string) => any): void; - } - - function configure(options: ConfigureOptions): Environment; - function configure(path: string, options?: ConfigureOptions): Environment; - - interface ConfigureOptions { - autoescape?: boolean; - throwOnUndefined?: boolean; - trimBlocks?: boolean; - lstripBlocks?: boolean; - watch?: boolean; - noCache?: boolean; - web?: { - useCache?: boolean, - async?: boolean - }; - express?: Object; - tags?: { - blockStart?: string, - blockEnd?: string, - variableStart?: string, - variableEnd?: string, - commentStart?: string, - commentEnd?: string - }; - } - - class Environment { - options: { - autoescape: boolean; - }; - - constructor(loader: ILoader, opts?: ConfigureOptions); - constructor(loaders: ILoader[], opts?: ConfigureOptions); - - render(name: string, context?: Object): string; - render(name: string, context?: Object, callback?: (err: any, res: string) => any): void; - - renderString(name: string, context: Object): string; - renderString(name: string, context: Object, callback?: (err: any, res: string) => any): void; - - addFilter(name: string, func: (...args: any[]) => any, async?: boolean): void; - getFilter(name: string): void; - - addExtension(name: string, ext: Extension): void; - removeExtension(name: string): void; - getExtension(name: string): Extension; - hasExtension(name: string): void; - - addGlobal(name: string, value: any): void; - - getTemplate(name: string, eagerCompile?: boolean): Template; - getTemplate(name: string, eagerCompile?: boolean, callback?: (err: any, templ: Template) => Template): void; - - express(app: Object): void; - } - - interface Extension { - tags: string[]; - // Parser API is undocumented it is suggested to check the source: https://github.com/mozilla/nunjucks/blob/master/src/parser.js - parse(parser: any, nodes: any, lexer: any): any; - } - - function installJinjaCompat(): void; - - interface ILoader { - async?: boolean; - getSource(name: string): LoaderSource; - extend?(extender: ILoader): ILoader; - } - - // Needs both Loader and ILoader since nunjucks uses a custom object system - // Object system is also responsible for the extend methods - class Loader { - on(name: string, func: (...args: any[]) => any): void; - emit(name: string, ...args: any[]): void; - resolve(from: string, to: string): string; - isRelative(filename: string): boolean; - extend(toExtend: ILoader): ILoader; - } - - interface LoaderSource { - src: string; - path: string; - noCache: boolean; - } - - class FileSystemLoader extends Loader implements ILoader { - init(searchPaths: string[], opts: any): void; - getSource(name: string): LoaderSource; - } - - class PrecompiledLoader extends Loader implements ILoader { - init(searchPaths: string[], opts: any): void; - getSource(name: string): LoaderSource; - } - } - - export = Nunjucks; -} \ No newline at end of file + export = nunjucks; +} diff --git a/office-js/office-js.d.ts b/office-js/office-js.d.ts index ff4065fa17..e1f44f26bb 100644 --- a/office-js/office-js.d.ts +++ b/office-js/office-js.d.ts @@ -1743,20 +1743,17 @@ declare namespace Excel { * Protect a worksheet. It throws if the worksheet has been protected. * * @param options sheet protection options. - * @param password sheet protection password. * * [Api set: ExcelApi 1.2] */ - protect(options?: Excel.WorksheetProtectionOptions, password?: string): void; + protect(options?: Excel.WorksheetProtectionOptions): void; /** * * Unprotect a worksheet * - * @param password sheet protection password. - * * [Api set: ExcelApi 1.2] */ - unprotect(password?: string): void; + unprotect(): void; /** * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. */ @@ -2142,7 +2139,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 +2153,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 +2470,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 +2519,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 +2832,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 +3218,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; /** @@ -8566,7 +8563,6 @@ declare namespace Excel { } namespace ErrorCodes { var accessDenied: string; - var badPassword: string; var generalException: string; var insertDeleteConflict: string; var invalidArgument: string; diff --git a/oidc-token-manager/oidc-token-manager.d.ts b/oidc-token-manager/oidc-token-manager.d.ts index 0b982db33d..dd5fd679dd 100644 --- a/oidc-token-manager/oidc-token-manager.d.ts +++ b/oidc-token-manager/oidc-token-manager.d.ts @@ -50,8 +50,9 @@ declare namespace Oidc { } interface OidcTokenManagerSettings { + load_user_profile?: boolean; persist?: boolean; - store?: any; + store?: Storage; persistKey?: string; client_id?: string; redirect_uri?: string; @@ -62,6 +63,14 @@ declare namespace Oidc { popup_redirect_uri?: string; silent_redirect_uri?: string; silent_renew?: boolean; + request_state_store?: Storage; + request_state_key?: string; + metadata?: any; + authorization_endpoint?: string; + jwks_uri?: string; + jwks?: any; + userinfo_endpoint?: string; + end_session_endpoint?: string; } interface PopupSettings { @@ -106,8 +115,8 @@ declare namespace Oidc { addOnTokenExpired(cb: () => void): void; addOnSilentTokenRenewFailed(cb: () => void): void; removeToken(): void; - redirectForToken(): void; - redirectForLogout(): void; + redirectForToken(): DefaultPromise; + redirectForLogout(): DefaultPromise; processTokenCallbackAsync(queryString?: string): DefaultPromise; renewTokenSilentAsync(): DefaultPromise; processTokenCallbackSilent(hash?: string): void; diff --git a/openlayers/openlayers-tests.ts b/openlayers/openlayers-tests.ts index 3858720e23..a2152b11ad 100644 --- a/openlayers/openlayers-tests.ts +++ b/openlayers/openlayers-tests.ts @@ -136,6 +136,7 @@ coordinate = geometryResult.getClosestPoint(coordinate); geometryResult.getClosestPoint(coordinate, coordinate); extent = geometryResult.getExtent(); geometryResult.getExtent(extent); +geometryResult.transform(projection, projection); // // @@ -337,6 +338,7 @@ var tileLayer: ol.layer.Tile = new ol.layer.Tile({ projection = new ol.proj.Projection({ code:stringValue, }); +projection.setExtent(projection.getExtent()); // // ol.Map diff --git a/openlayers/openlayers.d.ts b/openlayers/openlayers.d.ts index 244a8f83c9..d1ec613314 100644 --- a/openlayers/openlayers.d.ts +++ b/openlayers/openlayers.d.ts @@ -2936,7 +2936,7 @@ declare namespace ol { * @param destination The desired projection. Can be a string identifier or a ol.proj.Projection object. * @return This geometry. Note that original geometry is modified in place. */ - transform(source: ol.proj.ProjectionLike, destination: ol.proj.ProjectionLike): ol.geom.Geometry; + transform(source: ol.proj.ProjectionLike | ol.proj.Projection, destination: ol.proj.ProjectionLike | ol.proj.Projection): ol.geom.Geometry; } /** @@ -4054,6 +4054,12 @@ declare namespace ol { constructor(options: olx.Projection); getExtent(): Extent; + + /** + * Set the validity extent for this projection. + * @param extent The new extent of the projection. + */ + setExtent(extent: Extent): void; } } diff --git a/p2/p2.d.ts b/p2/p2.d.ts index a6f3cf256e..bdbac86b0e 100644 --- a/p2/p2.d.ts +++ b/p2/p2.d.ts @@ -118,7 +118,6 @@ declare namespace p2 { constructor(bodyA: Body, bodyB: Body, type: number, options?: { collideConnected?: boolean; - wakeUpBodies?: boolean; }); type: number; @@ -135,9 +134,7 @@ declare namespace p2 { export class DistanceConstraint extends Constraint { - constructor(bodyA: Body, bodyB: Body, type: number, options?: { - collideConnected?: boolean; - wakeUpBodies?: boolean; + constructor(bodyA: Body, bodyB: Body, options?: { distance?: number; localAnchorA?: number[]; localAnchorB?: number[]; @@ -161,9 +158,7 @@ declare namespace p2 { export class GearConstraint extends Constraint { - constructor(bodyA: Body, bodyB: Body, type: number, options?: { - collideConnected?: boolean; - wakeUpBodies?: boolean; + constructor(bodyA: Body, bodyB: Body, options?: { angle?: number; ratio?: number; maxTorque?: number; @@ -179,9 +174,7 @@ declare namespace p2 { export class LockConstraint extends Constraint { - constructor(bodyA: Body, bodyB: Body, type: number, options?: { - collideConnected?: boolean; - wakeUpBodies?: boolean; + constructor(bodyA: Body, bodyB: Body, options?: { localOffsetB?: number[]; localAngleB?: number; maxForce?: number; @@ -194,9 +187,7 @@ declare namespace p2 { export class PrismaticConstraint extends Constraint { - constructor(bodyA: Body, bodyB: Body, type: number, options?: { - collideConnected?: boolean; - wakeUpBodies?: boolean; + constructor(bodyA: Body, bodyB: Body, options?: { maxForce?: number; localAnchorA?: number[]; localAnchorB?: number[]; @@ -229,9 +220,7 @@ declare namespace p2 { export class RevoluteConstraint extends Constraint { - constructor(bodyA: Body, bodyB: Body, type: number, options?: { - collideConnected?: boolean; - wakeUpBodies?: boolean; + constructor(bodyA: Body, bodyB: Body, options?: { worldPivot?: number[]; localPivotA?: number[]; localPivotB?: number[]; 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/pdf/pdf-tests.ts b/pdf/pdf-tests.ts index 6157307808..07b49644cf 100644 --- a/pdf/pdf-tests.ts +++ b/pdf/pdf-tests.ts @@ -43,3 +43,10 @@ function goNext() { renderPage(pageNum); } } + +// +// Test PDFPromise allows return value mutation +// +var promise: PDFPromise = PDFJS.getDocument('helloworld.pdf').then(pdf => { + return "arbitrary string"; +}); \ No newline at end of file diff --git a/pdf/pdf.d.ts b/pdf/pdf.d.ts index cf74bb658c..9fca2d1af5 100644 --- a/pdf/pdf.d.ts +++ b/pdf/pdf.d.ts @@ -32,7 +32,7 @@ interface PDFPromise { isRejected(): boolean; resolve(value: T): void; reject(reason: string): void; - then(onResolve: (promise: T) => void, onReject?: (reason: string) => void): PDFPromise; + then(onResolve: (promise: T) => U, onReject?: (reason: string) => void): PDFPromise; } interface PDFTreeNode { 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/pg/pg-tests.ts b/pg/pg-tests.ts index 99d1fac9ba..559c6183fc 100644 --- a/pg/pg-tests.ts +++ b/pg/pg-tests.ts @@ -35,6 +35,7 @@ client.connect((err) => { if (err) { return console.error("Error running query", err); } + console.log(result.rowCount); console.log(result.rows[0]["theTime"]); client.end(); return null; diff --git a/pg/pg.d.ts b/pg/pg.d.ts index 64a92d96b9..592d782610 100644 --- a/pg/pg.d.ts +++ b/pg/pg.d.ts @@ -40,13 +40,13 @@ declare module "pg" { } export interface QueryResult { + command: string; + rowCount: number; + oid: number; rows: any[]; } export interface ResultBuilder extends QueryResult { - command: string; - rowCount: number; - oid: number; addRow(row: any): void; } diff --git a/phonegap-nfc/phonegap-nfc-tests.ts b/phonegap-nfc/phonegap-nfc-tests.ts index ddaabebce7..08700fa919 100644 --- a/phonegap-nfc/phonegap-nfc-tests.ts +++ b/phonegap-nfc/phonegap-nfc-tests.ts @@ -3,6 +3,8 @@ import nfc = require('nfc'); import ndef = require('ndef'); import NdefRecord = PhoneGapNfc.NdefRecord; +import NdefTag = PhoneGapNfc.NdefTag; +import NdefTagEvent = PhoneGapNfc.NdefTagEvent; nfc.addTagDiscoveredListener(() => {}); nfc.addTagDiscoveredListener(() => {},() => {}, () => {}); @@ -39,7 +41,7 @@ nfc.erase(); nfc.erase(() => {}, () => {}); nfc.enabled(); -nfc.enabled(() => {}, () => {}); +nfc.enabled((status: String) => {}, (status: String) => {}); nfc.removeTagDiscoveredListener(() => {}); nfc.removeTagDiscoveredListener(() => {},() => {},() => {}); @@ -78,3 +80,45 @@ let obj:any = ndef.decodeTnf(bytes[0]); let tnfByte:number = ndef.encodeTnf(bytes[0],bytes[1],bytes[2],bytes[3],bytes[4],bytes[5]); let tnfString:string = ndef.tnfToString(tnfByte); + +let ndefTag: NdefTag = { + id: [4, 12, 109, 98, 8, 41, -127], + techTypes: ["android.nfc.tech.MifareUltralight", "android.nfc.tech.NfcA", "android.nfc.tech.Ndef"], + type: "NFC Forum Type 2", + date: "1394448136236", + + canMakeReadOnly: true, + isWritable: true, + maxSize: 137, + ndefMessage: records +}; + +let eventTarget: EventTarget = { + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean) { return; }, + dispatchEvent(evt: Event) { return true; }, + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean) { return; } +} + +let ndefTagEvent: NdefTagEvent = { + bubbles: false, + cancelBubble: false, + cancelable: false, + currentTarget: eventTarget, + defaultPrevented: false, + eventPhase: 2, + isTrusted: true, + returnValue: true, + srcElement: new Element(), + target: eventTarget, + timeStamp: 1394448136236, + type: "ndef", + initEvent(eventTypeArg: string, canBubbleArg: boolean, cancelableArg: boolean) { return; }, + preventDefault() { return; }, + stopImmediatePropagation() { return; }, + stopPropagation() { return; }, + AT_TARGET: 0, + BUBBLING_PHASE: 0, + CAPTURING_PHASE: 0, + + tag: ndefTag +}; diff --git a/phonegap-nfc/phonegap-nfc.d.ts b/phonegap-nfc/phonegap-nfc.d.ts index 849e2527cc..ff980eea33 100644 --- a/phonegap-nfc/phonegap-nfc.d.ts +++ b/phonegap-nfc/phonegap-nfc.d.ts @@ -49,7 +49,7 @@ declare namespace PhoneGapNfc { canMakeReadOnly:boolean; isWritable:boolean; maxSize:number; - records:Array; + ndefMessage:Array; } interface TagEvent extends Event { @@ -406,7 +406,7 @@ declare namespace PhoneGapNfc { * @param win The callback that is called when NFC is enabled. * @param fail The callback that is called when NFC is disabled or missing. */ - enabled(win?:() => void, fail?:() => void):void; + enabled(win?:(status:String) => void, fail?:(status:String) => void):void; /** * Removes the previously registered event listener added via nfc.addTagDiscoveredListener diff --git a/phonegap-plugin-push/phonegap-plugin-push-tests.ts b/phonegap-plugin-push/phonegap-plugin-push-tests.ts index 339c7e8e14..8b885e54e0 100644 --- a/phonegap-plugin-push/phonegap-plugin-push-tests.ts +++ b/phonegap-plugin-push/phonegap-plugin-push-tests.ts @@ -9,13 +9,38 @@ function test() { sound: true, vibrate: true, clearNotifications: false, - forceShow: true + forceShow: true, + topics: ['foo', 'bar'] }, ios: { badge: true, sound: true, alert: true, - clearBadge: true + clearBadge: true, + senderID: '123456789', + gcmSandbox: true, + categories: { + "invite": { + yes: { + callback: "app.accept", title: "Accept", foreground: true, destructive: false + }, + no: { + callback: "app.reject", title: "Reject", foreground: true, destructive: false + }, + maybe: { + callback: "app.maybe", title: "Maybe", foreground: true, destructive: false + } + }, + "delete": { + yes: { + callback: "app.doDelete", title: "Delete", foreground: true, destructive: true + }, + no: { + callback: "app.cancel", title: "Cancel", foreground: true, destructive: false + } + } + }, + topics: ['foo', 'bar'] }, windows: {} }; @@ -39,7 +64,7 @@ function test() { console.log('did unregister'); }, () => { console.log('did not unregister'); - }); + }, ['foo','bar']); /*from init*/ push = PushNotification.init(options); @@ -59,12 +84,13 @@ function test() { /*the rest of the additional fields are not 'canon'*/ console.log(data.additionalData); console.log(data.additionalData.foreground); + console.log(data.additionalData.coldstart); push.finish(() => { console.log('did finish'); }, () => { console.log('did not finish'); - }); + }, 'push-1'); }; let errorHandler = (e: Error) => { diff --git a/phonegap-plugin-push/phonegap-plugin-push.d.ts b/phonegap-plugin-push/phonegap-plugin-push.d.ts index dec4f075cf..f72c8f769f 100644 --- a/phonegap-plugin-push/phonegap-plugin-push.d.ts +++ b/phonegap-plugin-push/phonegap-plugin-push.d.ts @@ -52,8 +52,9 @@ declare namespace PhonegapPluginPush { * so you will need to re-register them if you want them to function again without an application reload. * @param successHandler * @param errorHandler + * @param topics */ - unregister(successHandler: () => any, errorHandler?: () => any): void + unregister(successHandler: () => any, errorHandler?: () => any, topics?: string[]): void /*TODO according to js source code, "errorHandler" is optional, but is "count" also optional? I can't read objetive-C code (can anyone at all? I wonder...)*/ /** @@ -81,8 +82,9 @@ declare namespace PhonegapPluginPush { * successHandler gets called when background push processing is successfully completed. * @param successHandler * @param errorHandler + * @param id */ - finish(successHandler: () => any, errorHandler: () => any): void + finish(successHandler?: () => any, errorHandler?: () => any, id?: string): void } /** @@ -122,6 +124,10 @@ declare namespace PhonegapPluginPush { * If true will always show a notification, even when the app is on the foreground. Default is false. */ forceShow?: boolean + /** + * If the array contains one or more strings each string will be used to subscribe to a GcmPubSub topic. + */ + topics?: string[] } /** @@ -156,6 +162,23 @@ declare namespace PhonegapPluginPush { * If true|"true" the badge will be cleared on app startup. Default is false|"false". */ clearBadge?: boolean | string + /** + * The data required in order to enable Action Buttons for iOS. + * Action Buttons on iOS - https://github.com/phonegap/phonegap-plugin-push/blob/master/docs/PAYLOAD.md#action-buttons-1 + */ + categories?: CategoryArray + /** + * Maps to the project number in the Google Developer Console. Setting this uses GCM for notifications instead of native + */ + senderID?: string + /** + * Whether to use prod or sandbox GCM setting. Defaults to false. + */ + gcmSandbox?: boolean + /** + * If the array contains one or more strings each string will be used to subscribe to a GcmPubSub topic. Note: only usable in conjunction with senderID + */ + topics?: string[] } /** @@ -166,6 +189,23 @@ declare namespace PhonegapPluginPush { } } + interface CategoryArray { + [name: string]: CategoryAction + } + + interface CategoryAction { + yes?: CategoryActionData + no?: CategoryActionData + maybe?: CategoryActionData + } + + interface CategoryActionData { + callback: string + title: string + foreground: boolean + destructive: boolean + } + interface RegistrationEventResponse { /** * The registration ID provided by the 3rd party remote push service. @@ -216,6 +256,10 @@ declare namespace PhonegapPluginPush { * Whether the notification was received while the app was in the foreground */ foreground?: boolean + /** + * Will be true if the application is started by clicking on the push notification, false if the app is already started. (Android/iOS only) + */ + coldstart?: boolean collapse_key?: string from?: string notId?: string diff --git a/physijs/physijs.d.ts b/physijs/physijs.d.ts index 035f1da389..d70eadad2b 100644 --- a/physijs/physijs.d.ts +++ b/physijs/physijs.d.ts @@ -147,7 +147,7 @@ declare namespace Physijs { add(object:THREE.Object3D):void; remove(object:THREE.Object3D):void; setFixedTimeStep(fixedTimeStep:number):void; - setGravity(gravity:number):void; + setGravity(gravity:THREE.Vector3):void; simulate(timeStep?:number, maxSubSteps?:number):boolean; diff --git a/pikaday/pikaday-tests.ts b/pikaday/pikaday-tests.ts index f98d4afcee..48cd8d3226 100644 --- a/pikaday/pikaday-tests.ts +++ b/pikaday/pikaday-tests.ts @@ -71,3 +71,14 @@ new Pikaday({field: $('#datepicker')[0]}); yearRange: [2000, 2020] }); })(); + +(() => { + new Pikaday( + { + field: document.getElementById('datepicker'), + firstDay: 1, + minDate: new Date('2000-01-01'), + maxDate: new Date('2020-12-31'), + showDaysInNextAndPreviousMonths: true + }); +})(); diff --git a/pikaday/pikaday.d.ts b/pikaday/pikaday.d.ts index 0025561f54..3e4f80df9a 100644 --- a/pikaday/pikaday.d.ts +++ b/pikaday/pikaday.d.ts @@ -241,6 +241,11 @@ declare namespace Pikaday { * Render the month after the year in the title. Default: false. */ showMonthAfterYear?: boolean; + + /** + * Render days of the calendar grid that fall in the next or previous months to the current month instead of rendering an empty table cell. Default: false. + */ + showDaysInNextAndPreviousMonths?: boolean; /** * Number of visible calendars. diff --git a/popper.js/popper-tests.ts b/popper.js/popper-tests.ts new file mode 100644 index 0000000000..2dc98bbda3 --- /dev/null +++ b/popper.js/popper-tests.ts @@ -0,0 +1,39 @@ +/// + +import * as Popper from 'popper.js'; + +var reference = document.querySelector('.my-button'); +var thePopper = new Popper( + reference, { + content: 'My awesome popper!' + } +); +thePopper.update(); +thePopper.destroy(); + +var options = { + placement: 'bottom', + offset: 0, + arrowElement: document.querySelector('.arrow'), + modifiersIgnored: ['applyStyle'], + } as Popper.PopperOptions; + +var thePopperWithOptions = new Popper( + reference, { + content: 'My awesome popper!', + }, options); + +var popper = document.querySelector('.my-popper'); +var anotherPopper = new Popper( + reference, + popper +); + +var reference = document.querySelector('.my-button'); +var popper = document.querySelector('.my-popper'); +var anotherPopper = new Popper(reference, popper).onCreate(function(instance) { + console.log(instance.offsets); +}).onUpdate(function(data) { + var p = data.offsets.popper; + console.log(`top: ${p.top}, left: ${p.left}`); +}); diff --git a/popper.js/popper.d.ts b/popper.js/popper.d.ts new file mode 100644 index 0000000000..71713a2ae1 --- /dev/null +++ b/popper.js/popper.d.ts @@ -0,0 +1,58 @@ +// Type definitions for popper.js v0.4.0 +// Project: https://github.com/FezVrasta/popper.js/ +// Definitions by: rhysd +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare namespace Popper { + export interface PopperOptions { + placement?: string; + gpuAcceleration?: boolean; + offset?: number; + boundariesElement?: string | Element; + boundariesPadding?: number; + preventOverflowOrder?: ("left" | "right" | "top" | "bottom")[]; + flipBehavior?: string | string[]; + modifiers?: string[]; + modifiersIgnored?: string[]; + removeOnDestroy?: boolean; + arrowElement?: string | Element; + } + export class Modifiers { + applyStyle(data: Object): Object; + shift(data: Object): Object; + preventOverflow(data: Object): Object; + keepTogether(data: Object): Object; + flip(data: Object): Object; + offset(data: Object): Object; + arrow(data: Object): Object; + } + export interface Data { + placement: string; + offsets: { + popper: { + position: string; + top: number; + left: number; + }; + }; + } +} + +declare class Popper { + public modifiers: Popper.Modifiers; + public placement: string; + + constructor(reference: Element, popper: Element | Object, options?: Popper.PopperOptions); + + destroy(): void; + update(): void; + onCreate(cb: (data: Popper.Data) => void): this; + onUpdate(cb: (data: Popper.Data) => void): this; + parse(config: Object): Element; + runModifiers(data: Object, modifiers: string[], ends: Function): void; + isModifierRequired(): boolean; +} + +declare module "popper.js" { + export = Popper; +} diff --git a/postal/postal.d.ts b/postal/postal.d.ts index d476c3710a..62caad6c1d 100644 --- a/postal/postal.d.ts +++ b/postal/postal.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Postal v1.0.6 +// Type definitions for Postal v1.0.8 // Project: https://github.com/postaljs/postal.js // Definitions by: Lokesh Peta , Paul Jolly // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -61,19 +61,9 @@ interface IChannelDefinition { channel: string; } -interface ISourceArg { - topic: string; - channel?: string; -} - -interface IDestinationArg { - topic: string | ((topic: string) => string); - channel?: string; -} - interface IPostal { subscriptions: {}; - wiretaps: ICallback[]; + wireTaps: ICallback[]; addWireTap(callback: ICallback): () => void; @@ -83,8 +73,6 @@ interface IPostal { getSubscribersFor(options: {channel?: string, topic?: string, context?: any}): ISubscriptionDefinition[]; getSubscribersFor(predicateFn: (sub: ISubscriptionDefinition) => boolean): ISubscriptionDefinition[]; - linkChannels(source: ISourceArg | ISourceArg[], destination: IDestinationArg | IDestinationArg[]): void; - publish(envelope: IEnvelope): void; reset(): void; diff --git a/pouchDB/pouch.d.ts b/pouchDB/pouch.d.ts index d3097a4099..0360e02b65 100644 --- a/pouchDB/pouch.d.ts +++ b/pouchDB/pouch.d.ts @@ -207,11 +207,13 @@ interface PouchApi { interface PouchOptions { name?: string; adapter?: string; + skip_setup?: boolean; } interface PouchDB extends PouchApi { new (name: string, opts: PouchOptions, callback: (err: PouchError, res: PouchDB) => void): PouchDB; new (name: string, callback: (err: PouchError, res: PouchDB) => void): PouchDB; + new (name: string, opts: PouchOptions): PouchDB; new (name: string): PouchDB; destroy(name: string, callback: (err: PouchError) => void): void; } 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/protractor-http-mock/protractor-http-mock-tests.ts b/protractor-http-mock/protractor-http-mock-tests.ts index e6620d015f..a72a9bce0d 100644 --- a/protractor-http-mock/protractor-http-mock-tests.ts +++ b/protractor-http-mock/protractor-http-mock-tests.ts @@ -8,15 +8,10 @@ function TestConfig() { } function TestCtorOverloads() { - let noParam: mock.ProtractorHttpMock = mock(); - let emptyArray: mock.ProtractorHttpMock = mock([]); - let mockFiles: mock.ProtractorHttpMock = mock(["mock1", "mock2"]); - let skipDefaults: mock.ProtractorHttpMock = mock([], true); - let del: mock.requests.Delete = { request: { - path: "path", - method: "DELETE" + path: 'path', + method: 'DELETE' }, response: { status: 400, @@ -25,15 +20,36 @@ function TestCtorOverloads() { }; let put: mock.requests.Put = { request: { - path: "path", - method: "PUT" + path: 'path', + method: 'PUT' }, response: { status: 400, data: 1 } }; + let plugin: mock.Plugin = { + match: (mockRequest: mock.requests.Delete, requestConfig: mock.requests.AllRequests) => { + if (requestConfig.request.method && mockRequest.request.method) { + return true; + } + + return false; + } + }; + + let noParam: mock.ProtractorHttpMock = mock(); + let emptyArray: mock.ProtractorHttpMock = mock([]); + let mockFiles: mock.ProtractorHttpMock = mock(['mock1', 'mock2']); let mocks: mock.ProtractorHttpMock = mock([del, put]); + + let mockFilesNpmPlugins: mock.ProtractorHttpMock = mock(['mock1'], ['plugin']); + let mocksWithNpmPlugins: mock.ProtractorHttpMock = mock([del, put], ['plugin']); + + let pluginMocks: mock.ProtractorHttpMock = mock([del, put], [plugin]); + + let mockFilesNpmPluginsSkipDefaults: mock.ProtractorHttpMock = mock(['mock1'], ['plugin'], true); + let skipDefaults: mock.ProtractorHttpMock = mock([del, put], [plugin], true); } function TestTeardown() { @@ -85,8 +101,9 @@ function TestDyanmicRemove() { function TestGetRequestDefinitions() { let getMinium: mock.requests.Get = { request: { - path: "path", - method: "GET" + path: 'path', + method: 'GET', + regex: true }, response: { data: 1, @@ -96,10 +113,11 @@ function TestGetRequestDefinitions() { let getParams: mock.requests.Get = { request: { - path: "path", - method: "GET", + path: 'path', + method: 'GET', + regex: true, params: { - param1: "param1", + param1: 'param1', param2: 2 } }, @@ -111,8 +129,9 @@ function TestGetRequestDefinitions() { let post: mock.requests.Post = { request: { - path: "path", - method: "POST" + path: 'path', + method: 'POST', + regex: true }, response: { data: 1, @@ -122,10 +141,11 @@ function TestGetRequestDefinitions() { let getQueryString: mock.requests.Get = { request: { - path: "path", - method: "GET", + path: 'path', + method: 'GET', + regex: true, queryString: { - query1: "query1", + query1: 'query1', query2: 2 } }, @@ -137,11 +157,12 @@ function TestGetRequestDefinitions() { let getHeaders: mock.requests.Get = { request: { - path: "path", - method: "GET", + path: 'path', + method: 'GET', + regex: true, headers: { - head1: "head1", - head2: "head2" + head1: 'head1', + head2: 'head2' } }, response: { @@ -154,8 +175,9 @@ function TestGetRequestDefinitions() { function TestPostRequestDefinitions() { let post: mock.requests.Post = { request: { - path: "path", - method: "POST" + path: 'path', + method: 'POST', + regex: true }, response: { data: 1, @@ -165,9 +187,10 @@ function TestPostRequestDefinitions() { let postData: mock.requests.PostData = { request: { - path: "path", - method: "POST", - data: "data" + path: 'path', + method: 'POST', + data: 'data', + regex: true }, response: { data: 1, @@ -179,8 +202,9 @@ function TestPostRequestDefinitions() { function TestHeadRequestDefinitions() { let head: mock.requests.Head = { request: { - path: "path", - method: "HEAD" + path: 'path', + method: 'HEAD', + regex: true }, response: { status: 500, @@ -192,8 +216,9 @@ function TestHeadRequestDefinitions() { function TestDeleteRequestDefinitions() { let del: mock.requests.Delete = { request: { - path: "path", - method: "DELETE" + path: 'path', + method: 'DELETE', + regex: true }, response: { status: 500, @@ -205,8 +230,9 @@ function TestDeleteRequestDefinitions() { function TestPutRequestDefinitions() { let put: mock.requests.Put = { request: { - path: "path", - method: "PUT" + path: 'path', + method: 'PUT', + regex: true }, response: { status: 500, @@ -218,8 +244,9 @@ function TestPutRequestDefinitions() { function TestPatchRequestDefinitions() { let patch: mock.requests.Patch = { request: { - path: "path", - method: "PATCH" + path: 'path', + method: 'PATCH', + regex: true }, response: { status: 500, @@ -231,8 +258,9 @@ function TestPatchRequestDefinitions() { function TestJsonpRequestDefinitions() { let jsonp: mock.requests.Jsonp = { request: { - path: "path", - method: "JSONP" + path: 'path', + method: 'JSONP', + regex: true }, response: { status: 500, @@ -240,3 +268,35 @@ function TestJsonpRequestDefinitions() { } }; } + +function TestRuntimeMocks() { + mock.add([{ + request: { + path: '/users', + method: 'GET', + params: { + name: 'Charlie' + } + }, + response: { + data: { + name: 'Override' + } + } + }]); + + mock.remove([{ + request: { + path: '/users', + method: 'GET', + params: { + name: 'Charlie' + } + }, + response: { + data: { + name: 'Override' + } + } + }]); +} diff --git a/protractor-http-mock/protractor-http-mock.d.ts b/protractor-http-mock/protractor-http-mock.d.ts index b953d8eb22..29d6dfb276 100644 --- a/protractor-http-mock/protractor-http-mock.d.ts +++ b/protractor-http-mock/protractor-http-mock.d.ts @@ -11,16 +11,37 @@ declare namespace mock { * Instantiate mock module. This must be done before the browser connects. * * @param mocks An array of mock modules to load into the application. + * @param plugins An array of Plugin objects. * @param skipDefaults Set true to skip loading of default mocks. */ - (mocks?: Array>, skipDefaults?: boolean): ProtractorHttpMock; + (mocks?: Array>, plugins?: Array, skipDefaults?: boolean): ProtractorHttpMock; + + /** + * Instantiate mock module. This must be done before the browser connects. + * + * @param mocks An array of mock modules to load into the application. + * @param plugins An array of NPM modules as strings. + * @param skipDefaults Set true to skip loading of default mocks. + */ + (mocks?: Array>, plugins?: Array, skipDefaults?: boolean): ProtractorHttpMock; /** * Instantiate mock modules from files. This must be done before the browser connects. * * @param mocks An array of mock module names relative to the rootDirectory configuration. + * @param plugins An array of Plugin objects. + * @param skipDefaults Set true to skip loading of default mocks. */ - (mocks: Array): ProtractorHttpMock; + (mocks: Array, plugins?: Array, skipDefaults?: boolean): ProtractorHttpMock; + + /** + * Instantiate mock modules from files. This must be done before the browser connects. + * + * @param mocks An array of mock module names relative to the rootDirectory configuration. + * @param plugins An array of NPM modules as strings. + * @param skipDefaults Set true to skip loading of default mocks. + */ + (mocks: Array, plugins?: Array, skipDefaults?: boolean): ProtractorHttpMock; /** * Clean up. @@ -59,22 +80,22 @@ declare namespace mock { }; /** - * Add mock dynamically. + * Add mocks during test execution. * Returns a promise that will be resolved with a true boolean - * when mocks have been added. + * when mocks are added. * * @param mocks An array of mock modules to load into the application. */ - add(mocks: Array>): webdriver.promise.Promise; + add(mocks: Array>): webdriver.promise.Promise; /** - * Remove mock dynamically. + * Remove mocks during test execution. * Returns a promise that will be resolved with a true boolean - * when mocks have been removed. + * when the supplied mocks are removed. * * @param mocks An array of mock modules to remove from the application. */ - remove(mocks: Array>): webdriver.promise.Promise; + remove(mocks: Array>): webdriver.promise.Promise; } /** @@ -82,7 +103,35 @@ declare namespace mock { */ interface ReceivedRequest { url: string; - method: string; + method: requests.Method; + } + + /** + * Plugin for custom matching logic. + */ + interface Plugin { + /** + * Match function. + * Return a truthy value to indicate successfull match. + * + * @param mockRequest The mock to compare request with. + * @param requestConfig The request object to compare mock with. + */ + match(mockRequest: requests.AllRequests, requestConfig: requests.AllRequests): boolean; + } + + /** + * Plugin for custom matching logic. + */ + interface Plugin { + /** + * Match function. + * Return a truthy value to indicate successfull match. + * + * @param mockRequest The mock to compare request with. + * @param requestConfig The request object to compare mock with. + */ + match(mockRequest: requests.AllRequests, requestConfig: requests.AllRequests): boolean; } namespace requests { @@ -92,26 +141,25 @@ declare namespace mock { type Method = "GET" | "POST" | "DELETE" | "PUT" | "HEAD" | "PATCH" | "JSONP"; /** - * Base request mock used for all mocks. + * All available request types. */ - interface BaseRequest { - request: { - method: Method; - path: string; - }; - response: { - status: number; - data: TResponse; - }; - } + type AllRequests = Get | + PostData | + Post | + Head | + Delete | + Put | + Patch | + Jsonp; /** * GET request mock. */ - interface Get extends BaseRequest { + interface Get { request: { method: Method; path: string; + regex?: boolean; params?: Object; queryString?: Object; headers?: Object; @@ -119,7 +167,7 @@ declare namespace mock { interceptedAnonymousRequest?: boolean; }; response: { - status: number; + status?: number; data: TResponse; }; } @@ -127,14 +175,15 @@ declare namespace mock { /** * POST request mock with payload. */ - interface PostData extends BaseRequest { + interface PostData { request: { - path: string; method: Method; + path: string; + regex?: boolean; data: TPayload; }; response: { - status: number; + status?: number; data: TResponse; }; } @@ -142,13 +191,14 @@ declare namespace mock { /** * POST request mock. */ - interface Post extends BaseRequest { + interface Post { request: { - path: string; method: Method; + path: string; + regex?: boolean; }; response: { - status: number; + status?: number; data: TResponse; }; } @@ -156,13 +206,14 @@ declare namespace mock { /** * HEAD request mock. */ - interface Head extends BaseRequest { + interface Head { request: { - path: string; method: Method; + path: string; + regex?: boolean; }; response: { - status: number; + status?: number; data: TResponse; }; } @@ -170,13 +221,14 @@ declare namespace mock { /** * HTTP Delete request mock. */ - interface Delete extends BaseRequest { + interface Delete { request: { - path: string; method: Method; + path: string; + regex?: boolean; }; response: { - status: number; + status?: number; data: TResponse; }; } @@ -184,13 +236,14 @@ declare namespace mock { /** * PUT request mock. */ - interface Put extends BaseRequest { + interface Put { request: { - path: string; method: Method; + path: string; + regex?: boolean; }; response: { - status: number; + status?: number; data: TResponse; }; } @@ -198,13 +251,14 @@ declare namespace mock { /** * PATCH request mock. */ - interface Patch extends BaseRequest { + interface Patch { request: { - path: string; method: Method; + path: string; + regex?: boolean; }; response: { - status: number; + status?: number; data: TResponse; }; } @@ -212,13 +266,14 @@ declare namespace mock { /** * JSONP request mock. */ - interface Jsonp extends BaseRequest { + interface Jsonp { request: { - path: string; method: Method; + path: string; + regex?: boolean; }; response: { - status: number; + status?: number; data: TResponse; }; } 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/qunit/qunit-tests.ts b/qunit/qunit-tests.ts index 20285e8022..5c56a428b9 100644 --- a/qunit/qunit-tests.ts +++ b/qunit/qunit-tests.ts @@ -1636,4 +1636,35 @@ function testAfterDone() { ok(i); } }); -} \ No newline at end of file +} + +// Example QUnit.extend call taken from: http://api.qunitjs.com/QUnit.extend/ +QUnit.test( "QUnit.extend", function( assert ) { + var base = { + a: 1, + b: 2, + z: 3 + }; + QUnit.extend( base, { + b: 2.5, + c: 3, + z: undefined + } ); + + // Change from documentation example to satisfy tsc: + var newBase = base; + + assert.equal( newBase.a, 1, "Unspecified values are not modified" ); + assert.equal( newBase.b, 2.5, "Existing values are updated" ); + assert.equal( newBase.c, 3, "New values are defined" ); + assert.ok( !( "z" in newBase ), "Values specified as `undefined` are removed" ); +}); + +// Example QUnit.extend usage taken from: http://stackoverflow.com/a/33439774/419956 +QUnit.extend(QUnit.assert, { + matches: function (actual, regex, message) { + var success = !!regex && !!actual && (new RegExp(regex)).test(actual); + var expected = "String matching /" + regex.toString() + "/"; + this.push(success, actual, expected, message); + } +}); \ No newline at end of file diff --git a/qunit/qunit.d.ts b/qunit/qunit.d.ts index a176712d75..a2a87e2860 100644 --- a/qunit/qunit.d.ts +++ b/qunit/qunit.d.ts @@ -469,6 +469,18 @@ interface QUnitStatic extends QUnitAssert { * @depricated since version 1.16 */ expect(amount: number): any; + + /** + * Copy the properties defined by the mixin object into the target object. + * + * This method will modify the target object to contain the "own" properties defined + * by the mixin. If the mixin object specifies the value of any attribute as undefined, + * this property will instead be removed from the target object. + * + * @param target An object whose properties are to be modified + * @param mixin An object describing which properties should be modified + */ + extend(target: any, mixin: any): any; /** * Group related tests under a single label. 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/randomstring/randomstring-tests.ts b/randomstring/randomstring-tests.ts new file mode 100644 index 0000000000..d612b15daf --- /dev/null +++ b/randomstring/randomstring-tests.ts @@ -0,0 +1,18 @@ +/// + +import * as randomstring from "randomstring"; + +randomstring.generate(); + +randomstring.generate(24); + +randomstring.generate({ + length: 12, + readable: true, + capitalization: "", + charset: "alphabetic" +}); + +randomstring.generate({ + charset: "abc" +}); diff --git a/randomstring/randomstring.d.ts b/randomstring/randomstring.d.ts new file mode 100644 index 0000000000..e683cef6b7 --- /dev/null +++ b/randomstring/randomstring.d.ts @@ -0,0 +1,19 @@ +// Type definitions for randomstring 1.1.4 +// Project: https://github.com/klughammer/node-randomstring +// Definitions by: Isman Usoh +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare namespace Randomstring { + interface GenerateOptions { + length?: number; + readable?: boolean; + charset?: string; + capitalization?: string; + } + + function generate(options?: GenerateOptions): string; +} + +declare module "randomstring" { + export = Randomstring; +} diff --git a/rc-tooltip/rc-tooltip-tests.tsx b/rc-tooltip/rc-tooltip-tests.tsx new file mode 100644 index 0000000000..33816d7949 --- /dev/null +++ b/rc-tooltip/rc-tooltip-tests.tsx @@ -0,0 +1,37 @@ +/// +/// + +import * as React from 'react'; +import * as ReactDOM from 'react-dom'; +import * as Tooltip from 'rc-tooltip'; + +ReactDOM.render( + tooltip}> + hover + , + document.querySelector('.app') +); + +ReactDOM.render( + tooltip} + overlayClassName="overlay" + mouseEnterDelay={0} + mouseLeaveDelay={0.1} + overlayStyle={{color: 'red'}} + prefixCls="my-" + transitionName="cool-transition" + onVisibleChange={() => console.log('visible changed')} + visible + defaultVisible + onPopupAlign={(popup, align) => console.log('aligned:', popup, align)} + arrowContent={
    } + getTooltipContainer={() => document.querySelector('.foo')} + destroyTooltipOnHide + > + hover + , + document.querySelector('.another-app') +); diff --git a/rc-tooltip/rc-tooltip.d.ts b/rc-tooltip/rc-tooltip.d.ts new file mode 100644 index 0000000000..317b8d1fc4 --- /dev/null +++ b/rc-tooltip/rc-tooltip.d.ts @@ -0,0 +1,41 @@ +// Type definitions for rc-tooltip v3.3.2 +// Project: https://github.com/react-component/tooltip +// Definitions by: rhysd +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare namespace Tooltip { + import React = __React; + + export type Trigger = "hover" | "click" | "focus"; + export type Placement = + "left" | "right" | "top" | "bottom" | + "topLeft" | "topRight" | "bottomLeft" | "bottomRight"; + + export interface Props extends React.Props { + overlayClassName?: string; + trigger?: Trigger[]; + mouseEnterDelay?: number; + mouseLeaveDelay?: number; + overlayStyle?: React.CSSProperties; + prefixCls?: string; + transitionName?: string; + onVisibleChange?: () => void; + visible?: boolean; + defaultVisible?: boolean; + placement?: Placement | Object; + align?: Object; + onPopupAlign?: (popupDomNode: Element, align: Object) => void; + overlay: React.ReactElement; + arrowContent?: React.ReactNode; + getTooltipContainer?: () => Element; + destroyTooltipOnHide?: boolean; + } +} + +declare class Tooltip extends __React.Component {} + +declare module "rc-tooltip" { + export = Tooltip +} diff --git a/react-autosuggest/react-autosuggest-tests.tsx b/react-autosuggest/react-autosuggest-tests.tsx new file mode 100644 index 0000000000..7a16a56914 --- /dev/null +++ b/react-autosuggest/react-autosuggest-tests.tsx @@ -0,0 +1,346 @@ +// React-Autosuggest Test +// ================================================================================ +/// +/// +/// + +//region Imports +import React = require('react'); +import ReactDOM = require('react-dom'); +import Autosuggest = require('react-autosuggest'); +//endregion + +interface Language { + name: string; + year: number; +} + +// https://developer.mozilla.org/en/docs/Web/JavaScript/Guide/Regular_Expressions#Using_Special_Characters +function escapeRegexCharacters(str: string): string { + return str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); +} + +export class ReactAutosuggestBasicTest extends React.Component { + //region Fields + public static languages: Language[] = [ + {name: 'C', year: 1972}, + {name: 'C#', year: 2000}, + {name: 'C++', year: 1983}, + {name: 'Clojure', year: 2007}, + {name: 'Elm', year: 2012}, + {name: 'Go', year: 2009}, + {name: 'Haskell', year: 1990}, + {name: 'Java', year: 1995}, + {name: 'Javascript', year: 1995}, + {name: 'Perl', year: 1987}, + {name: 'PHP', year: 1995}, + {name: 'Python', year: 1991}, + {name: 'Ruby', year: 1995}, + {name: 'Scala', year: 2003} + ]; + //endregion + + + //region Constructor + constructor(props: any) { + super(props); + + this.state = { + value: '', + suggestions: this.getSuggestions('') + }; + } + //endregion + + //region Rendering methods + public render(): JSX.Element { + const {value, suggestions} = this.state; + const inputProps = { + placeholder: `Type 'c'`, + value, + onChange: this.onChange.bind(this) + }; + + return ; + } + + protected renderSuggestion(suggestion: Language): JSX.Element { + return {suggestion.name}; + } + //endregion + + //region Event handlers + protected onChange(event: React.FormEvent, {newValue, method}): void { + this.setState({ + value: newValue + }); + } + + protected onSuggestionsUpdateRequested({ value }): void { + this.setState({ + suggestions: this.getSuggestions(value) + }); + } + //endregion + + //region Helper methods + protected getSuggestions(value: string): Language[] { + const escapedValue = escapeRegexCharacters(value.trim()); + + if (escapedValue === '') { + return []; + } + + const regex = new RegExp('^' + escapedValue, 'i'); + + return ReactAutosuggestBasicTest.languages.filter(language => regex.test(language.name)); + } + + protected getSuggestionValue(suggestion: Language): string { + return suggestion.name; + } + //endregion +} + +ReactDOM.render(, document.getElementById('app')); + +interface LanguageGroup { + title: string; + languages: Language[]; +} + +export class ReactAutosuggestMultipleTest extends React.Component { + //region Fields + public static languages: LanguageGroup[] = [ + { + title: '1970s', + languages: [ + {name: 'C', year: 1972} + ] + }, + { + title: '1980s', + languages: [ + {name: 'C++', year: 1983}, + {name: 'Perl', year: 1987} + ] + }, + { + title: '1990s', + languages: [ + {name: 'Haskell', year: 1990}, + {name: 'Python', year: 1991}, + {name: 'Java', year: 1995}, + {name: 'Javascript', year: 1995}, + {name: 'PHP', year: 1995}, + {name: 'Ruby', year: 1995} + ] + }, + { + title: '2000s', + languages: [ + {name: 'C#', year: 2000}, + {name: 'Scala', year: 2003}, + {name: 'Clojure', year: 2007}, + {name: 'Go', year: 2009} + ] + }, + { + title: '2010s', + languages: [ + {name: 'Elm', year: 2012} + ] + } + ]; + //endregion + + //region Constructor + constructor(props: any) { + super(props); + + this.state = { + value: '', + suggestions: this.getSuggestions('') + }; + } + //endregion + + //region Rendering methods + public render(): JSX.Element { + const { value, suggestions } = this.state; + const inputProps = { + placeholder: `Type 'c'`, + value, + onChange: this.onChange.bind(this) + }; + + return ; + } + + protected renderSuggestion(suggestion: Language): JSX.Element { + return {suggestion.name}; + } + + protected renderSectionTitle(section: LanguageGroup): JSX.Element { + return {section.title}; + } + //endregion + + //region Event handlers + protected onChange(event: React.FormEvent, { newValue, method }): void { + this.setState({ + value: newValue + }); + } + + protected onSuggestionsUpdateRequested({ value }): void { + this.setState({ + suggestions: this.getSuggestions(value) + }); + } + //endregion + + //region Helper methods + protected getSuggestions(value: string): LanguageGroup[] { + const escapedValue = escapeRegexCharacters(value.trim()); + + if (escapedValue === '') { + return []; + } + + const regex = new RegExp('^' + escapedValue, 'i'); + + return ReactAutosuggestMultipleTest.languages + .map(section => { + return { + title: section.title, + languages: section.languages.filter(language => regex.test(language.name)) + }; + }) + .filter(section => section.languages.length > 0); + } + + protected getSuggestionValue(suggestion: Language) { + return suggestion.name; + } + + protected getSectionSuggestions(section: LanguageGroup) { + return section.languages; + } + //endregion +} + +ReactDOM.render(, document.getElementById('app')); + +interface IPerson { + first: string; + last: string; + twitter: string; +} + +export class ReactAutosuggestCustomTest extends React.Component { + //region Fields + public static people: IPerson[] = [ + {first: 'Charlie', last: 'Brown', twitter: 'dancounsell'}, + {first: 'Charlotte', last: 'White', twitter: 'mtnmissy'}, + {first: 'Chloe', last: 'Jones', twitter: 'ladylexy'}, + {first: 'Cooper', last: 'King', twitter: 'steveodom'} + ]; + //endregion + + //region Constructor + constructor(props: any) { + super(props); + + this.state = { + value: '', + suggestions: this.getSuggestions('') + }; + } + //endregion + + //region Rendering methods + public render(): JSX.Element { + const { value, suggestions } = this.state; + const inputProps = { + placeholder: "Type 'c'", + value, + onChange: this.onChange.bind(this) + }; + + return ; + } + + protected renderSuggestion(suggestion: IPerson, { value, valueBeforeUpDown }): JSX.Element { + const suggestionText = `${suggestion.first} ${suggestion.last}`; + const query = (valueBeforeUpDown || value).trim(); + const parts = suggestionText.split(' ').map((part: string) => { + return { + highlight: (Math.ceil(Math.random() * 10)) % 2, + text: part + } + }); + + return + + { + parts.map((part, index) => { + const className = part.highlight ? 'highlight' : null; + + return {part.text}; + }) + } + + ; + } + //endregion + + //region Event handlers + protected onChange(event: React.FormEvent, {newValue, method}): void { + this.setState({ + value: newValue + }); + } + + protected onSuggestionsUpdateRequested({ value }): void { + this.setState({ + suggestions: this.getSuggestions(value) + }); + } + //endregion + + //region Helper methods + protected getSuggestions(value: string): IPerson[] { + const escapedValue = escapeRegexCharacters(value.trim()); + + if (escapedValue === '') { + return []; + } + + const regex = new RegExp('\\b' + escapedValue, 'i'); + + return ReactAutosuggestCustomTest.people.filter(person => regex.test(this.getSuggestionValue(person))); + } + + protected getSuggestionValue(suggestion: IPerson): string { + return `${suggestion.first} ${suggestion.last}`; + } + //endregion +} + +ReactDOM.render(, document.getElementById('app')); diff --git a/react-autosuggest/react-autosuggest.d.ts b/react-autosuggest/react-autosuggest.d.ts new file mode 100644 index 0000000000..f53238b882 --- /dev/null +++ b/react-autosuggest/react-autosuggest.d.ts @@ -0,0 +1,67 @@ +// Type definitions for react-autosuggest v3.7.3 +// Project: http://react-autosuggest.js.org/ +// Definitions by: Nicolas Schmitt +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare namespace ReactAutosuggest { + import React = __React; + + interface SuggestionUpdateRequest { + value: string; + reason: string; + } + + interface InputValues { + value: string; + valueBeforeUpDown?: string; + } + + interface InputProps extends React.HTMLAttributes { + value: string; + onChange: (event: React.FormEvent, params?: {newValue: string, method: string}) => void; + } + + interface SuggestionSelectedEventData { + method: string; + sectionIndex: number; + suggestion: any; + suggestionValue: string; + } + + interface Theme { + container: string; + containerOpen: string; + input: string; + sectionContainer: string; + sectionSuggestionsContainer: string; + sectionTitle: string; + suggestion: string; + suggestionFocused: string; + suggestionsContainer: string; + } + + interface AutosuggestProps extends React.Props { + suggestions: any[]; + onSuggestionsUpdateRequested?: (request: SuggestionUpdateRequest) => void; + getSuggestionValue: (suggestion: any) => string; + renderSuggestion: (suggestion: any, inputValues: InputValues) => JSX.Element; + inputProps: InputProps; + shouldRenderSuggestions?: (value: string) => boolean; + multiSection?: boolean; + renderSectionTitle?: (section: any, inputValues: InputValues) => JSX.Element; + getSectionSuggestions?: (section: any) => any[]; + onSuggestionSelected?: (event: React.FormEvent, data: SuggestionSelectedEventData) => void; + focusInputOnSuggestionClick?: boolean; + theme?: Theme; + id?: string; + } + + class Autosuggest extends React.Component {} +} + +declare module 'react-autosuggest' { + import Autosuggest = ReactAutosuggest.Autosuggest; + export = Autosuggest; +} diff --git a/react-bootstrap/react-bootstrap-tests.tsx b/react-bootstrap/react-bootstrap-tests.tsx index 4198e62320..36d5c1ab23 100644 --- a/react-bootstrap/react-bootstrap-tests.tsx +++ b/react-bootstrap/react-bootstrap-tests.tsx @@ -7,7 +7,7 @@ // -------------------------------------------------------------------------------- import * as React from 'react'; import { Component, CSSProperties } from 'react'; -import { Button, ButtonToolbar, Modal, Well, ButtonGroup, DropdownButton, MenuItem, Panel, ListGroup, ListGroupItem, Accordion, Tooltip, OverlayTrigger, Popover, ProgressBar, Nav, NavItem, Navbar, NavDropdown, Tabs, Tab, Pager, PageItem, Pagination, Alert, Carousel, CarouselItem, Grid, Row, Col, Thumbnail, Label, Badge, Jumbotron, PageHeader, Glyphicon, Table, Input, ButtonInput, FormControls } from 'react-bootstrap'; +import { Button, ButtonToolbar, Modal, Well, ButtonGroup, DropdownButton, MenuItem, Panel, ListGroup, ListGroupItem, Accordion, Tooltip, OverlayTrigger, Popover, ProgressBar, Nav, NavItem, Navbar, NavDropdown, Tabs, Tab, Pager, PageItem, Pagination, Alert, Carousel, CarouselItem, Grid, Row, Col, Thumbnail, Label, Badge, Jumbotron, PageHeader, Glyphicon, Table, Input, ButtonInput, FormControls, Form, FormGroup, ControlLabel, FormControl, HelpBlock, Radio, Checkbox } from 'react-bootstrap'; export class ReactBootstrapTest extends Component { @@ -281,7 +281,7 @@ export class ReactBootstrapTest extends Component {
    - + Modal title @@ -911,6 +911,37 @@ export class ReactBootstrapTest extends Component {
    + +
    +
    + + Control Label + + + Help block message. + + + + 1 + {' '} + 2 + {' '} + 3 + + + 1 + {' '} + 2 + {' '} + 3 + +
    +
    ); } diff --git a/react-bootstrap/react-bootstrap.d.ts b/react-bootstrap/react-bootstrap.d.ts index e64f831de5..366eeef7b5 100644 --- a/react-bootstrap/react-bootstrap.d.ts +++ b/react-bootstrap/react-bootstrap.d.ts @@ -1,6 +1,6 @@ // Type definitions for react-bootstrap // Project: https://github.com/react-bootstrap/react-bootstrap -// Definitions by: Walker Burgin , Vincent Siao +// Definitions by: Walker Burgin , Vincent Siao , Danilo Barros // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -21,7 +21,7 @@ declare module "react-bootstrap" { bsSize?: string; navItem?: boolean; navDropdown?: boolean; - componentClass?: string; + componentClass?: React.ReactType; } type Button = React.ClassicComponent; var Button: React.ClassicComponentClass; @@ -190,6 +190,12 @@ declare module "react-bootstrap" { dialogComponent?: any; // TODO: Add more specific type enforceFocus?: boolean; keyboard?: boolean; + onEnter?: (node: HTMLElement) => any; + onEntered?: (node: HTMLElement) => any; + onEntering?: (node: HTMLElement) => any; + onExit?: (node: HTMLElement) => any; + onExited?: (node: HTMLElement) => any; + onExiting?: (node: HTMLElement) => any; show?: boolean; } interface ModalClass extends React.ClassicComponentClass { @@ -329,7 +335,7 @@ declare module "react-bootstrap" { brand?: any; // TODO: Add more specific type bsSize?: string; bsStyle?: string; - componentClass?: any; // TODO: Add more specific type + componentClass?: React.ReactType; defaultNavExpanded?: boolean; eventKey?: any; fixedBottom?: boolean; @@ -380,7 +386,7 @@ declare module "react-bootstrap" { brand?: any; // TODO: Add more specific type bsSize?: string; bsStyle?: string; - componentClass?: any; // TODO: Add more specific type + componentClass?: React.ReactType; defaultNavExpanded?: boolean; fixedBottom?: boolean; fixedTop?: boolean; @@ -455,7 +461,7 @@ declare module "react-bootstrap" { activePage?: number; bsSize?: string; bsStyle?: string; - buttonComponentClass?: any; // TODO: Add more specific type + buttonComponentClass?: React.ReactType; ellipsis?: boolean; first?: boolean; items?: number; @@ -516,7 +522,7 @@ declare module "react-bootstrap" { // // ---------------------------------------- interface GridProps extends React.HTMLAttributes { - componentClass?: any; // TODO: Add more specific type + componentClass?: React.ReactType; fluid?: boolean; } type Grid = React.ClassicComponent; @@ -525,7 +531,7 @@ declare module "react-bootstrap" { // // ---------------------------------------- interface RowProps extends React.HTMLAttributes { - componentClass?: any; // TODO: Add more specific type + componentClass?: React.ReactType; } type Row = React.ClassicComponent; var Row: React.ClassicComponentClass; @@ -533,7 +539,7 @@ declare module "react-bootstrap" { // // ---------------------------------------- interface ColProps extends React.HTMLAttributes { - componentClass?: any; // TODO: Add more specific type + componentClass?: React.ReactType; lg?: number; lgHidden?: boolean; lgOffset?: number; @@ -609,7 +615,7 @@ declare module "react-bootstrap" { // // ---------------------------------------- interface JumbotronProps extends React.HTMLAttributes { - componentClass?: any; // TODO: Add more specific type + componentClass?: React.ReactType; } type Jumbotron = React.ClassicComponent; var Jumbotron: React.ClassicComponentClass; @@ -704,6 +710,82 @@ declare module "react-bootstrap" { } var FormControls: FormControlsClass; + //
    + // ---------------------------------------- + interface FormProps extends React.HTMLAttributes { + bsClass?: string; + componentClass?: React.ReactType; + horizontal?: boolean; + inline?: boolean; + } + class Form extends React.Component {} + + // + // ---------------------------------------- + interface FormGroupProps extends React.HTMLAttributes { + bsClass?: string; + bsSize?: "sm" | "small" | "lg" | "large"; + controlId?: string; + validationState?: "success" | "warning" | "error"; + } + class FormGroup extends React.Component {} + + // + // ---------------------------------------- + interface ControlLabelProps extends React.HTMLAttributes { + bsClass?: string; + htmlFor?: string; + srOnly?: boolean; + } + class ControlLabel extends React.Component {} + + // + // ---------------------------------------- + interface FormControlFeedbackProps extends React.HTMLAttributes { + } + class FormControlFeedback extends React.Component { + } + + // + // ---------------------------------------- + interface FormControlProps extends React.HTMLAttributes { + bsClass?: string; + componentClass?: React.ReactType; + id?: string; + type?: string; + } + interface FormControlClass extends React.ClassicComponentClass { + Feedback: typeof FormControlFeedback; + } + type FormControl = React.Component; + var FormControl: FormControlClass; + + // + // ---------------------------------------- + interface HelpBlockProps extends React.HTMLAttributes { + bsClass?: string; + } + class HelpBlock extends React.Component {} + + // + // ---------------------------------------- + interface CheckboxProps extends React.HTMLAttributes { + bsClass?: string; + disabled?: boolean; + inline?: boolean; + validationState?: "success" | "warning" | "error"; + } + class Checkbox extends React.Component {} + + // + // ---------------------------------------- + interface RadioProps extends React.HTMLAttributes { + bsClass?: string; + disabled?: boolean; + inline?: boolean; + validationState?: "success" | "warning" | "error"; + } + class Radio extends React.Component {} // // ---------------------------------------- diff --git a/react-calendar-timeline/react-calendar-timeline-tests.tsx b/react-calendar-timeline/react-calendar-timeline-tests.tsx new file mode 100644 index 0000000000..7ce99f1ddf --- /dev/null +++ b/react-calendar-timeline/react-calendar-timeline-tests.tsx @@ -0,0 +1,33 @@ +/// +/// +/// + +import * as React from "react"; +import * as moment from 'moment'; +import ReactCalendarTimeline from 'react-calendar-timeline'; + +const groups = [ + {id: 1, title: 'group 1'}, + {id: 2, title: 'group 2'} +] + +const items = [ + {id: 1, group: 1, title: 'item 1', start_time: moment(), end_time: moment().add(1, 'hour')}, + {id: 2, group: 2, title: 'item 2', start_time: moment().add(-0.5, 'hour'), end_time: moment().add(0.5, 'hour')}, + {id: 3, group: 1, title: 'item 3', start_time: moment().add(2, 'hour'), end_time: moment().add(3, 'hour')} +] + +class ExampleOfUsingReactCalendarTimeline extends React.Component<{}, {}> { + render(){ + return( +
    + Rendered by react! + +
    + ); + } +}; \ No newline at end of file diff --git a/react-calendar-timeline/react-calendar-timeline.d.ts b/react-calendar-timeline/react-calendar-timeline.d.ts new file mode 100644 index 0000000000..f377d29610 --- /dev/null +++ b/react-calendar-timeline/react-calendar-timeline.d.ts @@ -0,0 +1,70 @@ +// Type definitions for react-calendar-timeline v0.8.1 +// Project: https://github.com/namespace-ee/react-calendar-timeline +// Definitions by: Rajab Shakirov +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare module "react-calendar-timeline" { + interface ReactCalendarTimeline { + groups: { + id: number; + title: any; // string | Element (__React.ClassicComponentClass); + }[]; + items:{ + id: number; + group: number; + title?: any; // string | Element (__React.ClassicComponentClass); + start_time: any; + end_time: any; + canMove?: boolean; + canResize?: boolean; + canChangeGroup?: boolean; + className?: string; + }[]; + keys?:{ + groupIdKey: string; + groupTitleKey: string; + itemIdKey: string; + itemTitleKey: string; + itemGroupKey: string; + itemTimeStartKey: string; + itemTimeEndKey: string; + }; + sidebarWidth?: number; + dragSnap?: number; + minResizeWidth?: number; + fixedHeader?: "fixed" | "none"; + zIndexStart?: number; + lineHeight?: number; + headerLabelGroupHeight?: number; + headerLabelHeight?: number; + itemHeightRatio?: number; + minZoom?: number; + maxZoom?: number; + canMove?: boolean; + canChangeGroup?: boolean; + canResize?: boolean; + useResizeHandle?: boolean; + stackItems?: boolean; + traditionalZoom?: boolean; + itemTouchSendsClick?: boolean; + onItemMove?(itemId:any, dragTime:any, newGroupOrder:any): any; + onItemResize?(itemId:any, newResizeEnd:any): any; + onItemSelect?(itemId:any): any; + onItemClick?(itemId:any): any; + onCanvasClick?(groupId:any, time:any, e:any): any; + onItemDoubleClick?(itemId:any): any; + moveResizeValidator?(action:any, itemId:any, time:any): any; + defaultTimeStart?: any; + defaultTimeEnd?: any; + visibleTimeStart?: number; + visibleTimeEnd?: number; + onTimeChange?(visibleTimeStart:any, visibleTimeEnd:any): any; + onTimeInit?(visibleTimeStart:any, visibleTimeEnd:any): any; + onBoundsChange?(canvasTimeStart:any, canvasTimeEnd:any): any; + children?: any; + } + let ReactCalendarTimeline : __React.ClassicComponentClass; + export default ReactCalendarTimeline; +} diff --git a/react-datepicker/react-datepicker-tests.tsx b/react-datepicker/react-datepicker-tests.tsx new file mode 100644 index 0000000000..6858e04335 --- /dev/null +++ b/react-datepicker/react-datepicker-tests.tsx @@ -0,0 +1,34 @@ +/// +/// +/// + +import * as React from "react"; +import * as moment from 'moment'; +import * as DatePicker from 'react-datepicker'; + +class ReactDatePicker extends React.Component<{}, {startDate:any,displayName:string}> { + constructor(props:any) { + super(); + this.state = { + startDate: moment(), + displayName: 'Example' + } + this.handleChange = this.handleChange.bind(this); + } + + handleChange = function(date?:any) { + this.setState({ + startDate: date + }); + } + + render(){ + return ( +
    + +
    + ); + } +}; \ No newline at end of file diff --git a/react-datepicker/react-datepicker.d.ts b/react-datepicker/react-datepicker.d.ts new file mode 100644 index 0000000000..d987d26f1b --- /dev/null +++ b/react-datepicker/react-datepicker.d.ts @@ -0,0 +1,45 @@ +// Type definitions for react-datepicker v0.27.0 +// Project: https://github.com/Hacker0x01/react-datepicker +// Definitions by: Rajab Shakirov , Andrey Balokha +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare module "react-datepicker" { + interface ReactDatePicker { + className?: string; + dateFormat?: string; + dateFormatCalendar?: string; + disabled?: boolean; + endDate?: {}; + excludeDates?: any[]; + filterDate?():any; + id?: string; + includeDates?: any[]; + isClearable?: boolean; + locale?: string; + maxDate?: {}; + minDate?: {}; + name?: string; + onBlur?():any; + onChange():any; + onChange(date?:any):any; + onFocus?():any; + placeholderText?: string; + popoverAttachment?: string; + popoverTargetAttachment?: string; + popoverTargetOffset?: string; + readOnly?: boolean; + renderCalendarTo?: any; + required?: boolean; + selected?: {}; + showYearDropdown?: boolean; + startDate?: {}; + tabIndex?: number; + tetherConstraints?: any[]; + title?: string; + todayButton?: string; + } + let ReactDatePicker: __React.ClassicComponentClass; + export = ReactDatePicker; +} \ No newline at end of file diff --git a/react-ga/react-ga-tests.tsx b/react-ga/react-ga-tests.tsx new file mode 100644 index 0000000000..2248665dd9 --- /dev/null +++ b/react-ga/react-ga-tests.tsx @@ -0,0 +1,53 @@ +/// +/// + +describe("Testing react-ga initialize object", () => { + it("Able to initialize react-ga object", () => { + let ga = __reactGA; + ga.initialize("UA-65432-1"); + }); + it("Able to initailize react-ga object", () => { + let ga = __reactGA; + + let options: __reactGA.InitializeOptions = { + debug: true, + } + + ga.initialize("UA-65432-1", options); + }); +}); + +describe("Testing react-ga pageview calls", () => { + it("Able to make pageview calls", () => { + let ga = __reactGA; + ga.initialize("UA-65432-1"); + + ga.pageview("http://telshin.com"); + }); +}); + +describe("Testing react-ga modal calls", () => { + it("Able to make modal calls", () => { + let ga = __reactGA; + ga.initialize("UA-65432-1"); + + ga.modalview("Test modal"); + }); +}); + +describe("Testing react-ga event calls", () => { + it("Able to make event calls", () => { + let ga = __reactGA; + ga.initialize("UA-65432-1"); + + let options: __reactGA.EventArgs = { + category: "Test", + action: "CI", + label: "Running Jasmine tests for react-ga typscript library", + value: 4, + nonInteraction: true, + } + + ga.event(options); + }); +}); \ No newline at end of file diff --git a/react-ga/react-ga.d.ts b/react-ga/react-ga.d.ts new file mode 100644 index 0000000000..3a80651dc1 --- /dev/null +++ b/react-ga/react-ga.d.ts @@ -0,0 +1,27 @@ +// Type definitions for react-fa v1.4.1 +// Project: https://github.com/react-ga/react-ga +// Definitions by: Tim Aldridge +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare namespace __reactGA { + export interface EventArgs { + category: string; + action: string; + label?: string; + value?: number; + nonInteraction?: boolean; + } + + export interface InitializeOptions { + debug?: boolean; + } + + export function initialize(trackingCode: string, options?: InitializeOptions): void; + export function pageview(path: string): void; + export function modalview(name: string): void; + export function event(args: EventArgs): void; +} + +declare module 'react-ga' { + export = __reactGA; +} diff --git a/react-helmet/react-helmet-tests.tsx b/react-helmet/react-helmet-tests.tsx index c50bdf2e17..a9f89d74c9 100644 --- a/react-helmet/react-helmet-tests.tsx +++ b/react-helmet/react-helmet-tests.tsx @@ -2,7 +2,7 @@ /// import * as React from 'react'; -import Helmet from 'react-helmet'; +import * as Helmet from 'react-helmet'; diff --git a/react-helmet/react-helmet.d.ts b/react-helmet/react-helmet.d.ts index 8cae272f98..b5b69411ee 100644 --- a/react-helmet/react-helmet.d.ts +++ b/react-helmet/react-helmet.d.ts @@ -1,13 +1,13 @@ // Type definitions for react-helmet // Project: https://github.com/nfl/react-helmet -// Definitions by: Evan Bremer +// Definitions by: Evan Bremer , Isman Usoh // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// -declare module 'react-helmet' { - import { Component } from 'react'; - +declare namespace ReactHelmet { + import React = __React; + interface HelmetProps { title?: string; titleTemplate?: string; @@ -25,15 +25,20 @@ declare module 'react-helmet' { meta: HelmetDatum; script: HelmetDatum; } - + interface HelmetDatum { toString(): string; - toComponent(): Component; + toComponent(): React.Component; } - class Helmet extends Component { - static rewind(): HelmetData + class HelmetComponent extends React.Component {} +} + +declare module "react-helmet" { + var Helmet: { + (): ReactHelmet.HelmetComponent + rewind(): ReactHelmet.HelmetData } - - export default Helmet; + + export = Helmet; } diff --git a/react-imageloader/react-imageloader-tests.tsx b/react-imageloader/react-imageloader-tests.tsx new file mode 100644 index 0000000000..9a1ddf0204 --- /dev/null +++ b/react-imageloader/react-imageloader-tests.tsx @@ -0,0 +1,7 @@ +/// +/// + +import ImageLoader = require('react-imageloader'); +import * as React from 'react'; + +let imageLoader = ; diff --git a/react-imageloader/react-imageloader.d.ts b/react-imageloader/react-imageloader.d.ts new file mode 100644 index 0000000000..1ba1ba38d0 --- /dev/null +++ b/react-imageloader/react-imageloader.d.ts @@ -0,0 +1,38 @@ +// Type definitions for react-imageloader 2.1.0 +// Project: https://github.com/hzdg/react-imageloader +// Definitions by: Stephen Jelfs +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare module "react-imageloader" { + interface ImageLoaderProps extends __React.Props { + /** An optional class name for the wrapper component. */ + className?: string; + + /** An optional object containing props for the underlying img component. */ + imgProps?: any; + + /** An optional handler for the error event. */ + onError?: (event: any) => void; + + /** An optional handler for the load event. */ + onLoad?: (event: any) => void; + + /** An optional function that returns a React element to be shown while the image loads. */ + preloader?: (params: any) => __React.ReactElement; + + /** The URL of the image to be loaded. */ + src: string; + + /** An optional object containing styles for the wrapper component. */ + style?: __React.CSSProperties; + + /** A function that takes a props argument and returns a React element to be used as the wrapper component. Defaults to React.DOM.span. */ + wrapper?: (props: any) => __React.ReactElement; + } + + class ImageLoader extends __React.Component {} + + export = ImageLoader; +} diff --git a/react-input-calendar/react-input-calendar.d.ts b/react-input-calendar/react-input-calendar.d.ts index 5dac6aff5d..c511a557d9 100644 --- a/react-input-calendar/react-input-calendar.d.ts +++ b/react-input-calendar/react-input-calendar.d.ts @@ -50,6 +50,10 @@ declare namespace reactInputCalendar { */ onBlur?: (event: __React.SyntheticEvent, computableDate: string) => void; /** + * Set a function that will be triggered when the input field is focused. + */ + onFocus?: (event: __React.SyntheticEvent) => void; + /** * Define state when date picker would close once the user has clicked on a date. */ closeOnSelect?: boolean; 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-mdl/react-mdl-tests.tsx b/react-mdl/react-mdl-tests.tsx new file mode 100644 index 0000000000..1e7fd19b0c --- /dev/null +++ b/react-mdl/react-mdl-tests.tsx @@ -0,0 +1,1044 @@ +// Test file for react-mdl Definition file +/// + +import * as React from 'react'; +import {Badge, + FABButton, Button, IconButton, + Card, CardActions, CardTitle, CardText, CardMenu, CardMedia, + Checkbox, + DataTable, TableHeader, Table, + Dialog, DialogTitle, DialogContent, DialogActions, + Grid, Cell, + Icon, IconToggle, + Layout, Header, Navigation, Drawer, Content, HeaderRow, HeaderTabs, Footer, FooterDropDownSection, FooterLinkList, FooterSection, + List, ListItem, ListItemContent, ListItemAction, + Menu, MenuItem, + ProgressBar, + RadioGroup, Radio, + Slider, + Snackbar, + Spinner, + Switch, + Tabs, Tab, + Textfield, + Tooltip} from 'react-mdl'; + +// all tests are from the examples provided here: https://tleunen.github.io/react-mdl/ + +// Badge tests +React.createClass({ + render: function() { + return ( +
    + {/* Number badge on icon */} + + + + + {/* Icon badge on icon */} + + + + + {/* Number badge on text */} + Inbox + + {/* Icon badge without background on text */} + Mood +
    + ); + } +}); + +// Button tests +React.createClass({ + render: function() { + return ( +
    + {/* Colored FAB button */} + + + + + {/* Colored FAB button with ripple */} + + + + + {/* FAB button */} + + + + + {/* FAB button with ripple */} + + + + + {/* Disabled FAB button */} + + + + + {/* Mini FAB button */} + + + + + {/* Colored Mini FAB button */} + + + + + {/* Raised button */} + + + {/* Raised button with ripple */} + + + {/* Disabled Raised button */} + + + {/* Colored Raised button */} + + + {/* Accent-colored button without ripple */} + + + {/* Accent-colored button with ripple */} + + + {/* Flat button */} + + + {/* Flat button with ripple */} + + + {/* Disabled flat button */} + + + {/* Primary colored flat button */} + + + {/* Accent-colored flat button */} + + + {/* Icon button */} + + + {/* Colored Icon button */} + +
    + ); + } +}) + +// Card tests +React.createClass({ + render: function() { + return ( +
    + + Welcome + + Lorem ipsum dolor sit amet, consectetur adipiscing elit. + Mauris sagittis pellentesque lacus eleifend lacinia... + + + + + + + + + + + Update + + Lorem ipsum dolor sit amet, consectetur adipiscing elit. + Aenan convallis. + + + + + + + + + + + Image.jpg + + + + + + +

    + Featured event:
    + May 24, 2016
    + 7-11pm +

    +
    + + +
    + +
    +
    +
    + ); + } +}); + +// Checkbox tests +React.createClass({ + render: function() { + return ( +
    + + + +
    + ); + } +}); + +// DataTable tests +React.createClass({ + render: function() { + return ( +
    + + Material + Quantity + `\$${price.toFixed(2)}`} tooltip="Price pet unit">Price + + + + Material + Quantity + `\$${price.toFixed(2)}`} tooltip="Price pet unit">Price + + + + (isAsc ? a : b).match(/\((.*)\)/)[1].localeCompare((isAsc ? b : a).match(/\((.*)\)/)[1])} + tooltip="The amazing material name" + > + Material + + + Quantity + + `\$${price.toFixed(2)}`} + tooltip="Price pet unit" + > + Price + +
    +
    + ); + } +}); + +// Dialog tests +React.createClass({ + render: function() { + return ( +
    +
    + + + Allow data collection? + +

    Allowing us to collect data will let us get you the information you want faster.

    +
    + + + + +
    +
    + +
    + + + Allow this site to collect usage data to improve your experience? + +

    Allowing us to collect data will let us get you the information you want faster.

    +
    + + + + +
    +
    + +
    + + + Allow data collection? + +

    Allowing us to collect data will let us get you the information you want faster.

    +
    + + + + +
    +
    +
    + ); + } +}); + +// Grid tests +React.createClass({ + render: function() { + return ( +
    +
    + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + + + 4 + 4 + 4 + + + 6 + 4 + 2 + + + 6 (8 tablet) + 4 (6 tablet) + 2 (4 phone) + +
    +
    + ); + } +}); + +// IconToggle tests +React.createClass({ + render: function() { + return ( +
    + + + +
    + ); + } +}); + +// Layout tests +React.createClass({ + render: function() { + return ( +
    + {/* Uses a transparent header that draws on top of the layout's background */} +
    + +
    + + Link + Link + Link + Link + +
    + + + Link + Link + Link + Link + + + +
    +
    + + {/* No header, and the drawer stays open on larger screens (fixed drawer). */} +
    + + + + Link + Link + Link + Link + + + + +
    + + {/* Always shows a header, even in smaller screens. */} +
    + +
    Area / The Title}> + + Link + Link + Link + Link + +
    + + + Link + Link + Link + Link + + + +
    +
    + + {/* The drawer is always open in large screens. The header is always shown, even in small screens. */} +
    + +
    + {}} + label="Search" + expandable + expandableIcon="search" + /> +
    + + + Link + Link + Link + Link + + + +
    +
    + + {/* Uses a header that scrolls with the text, rather than staying locked at the top */} +
    + +
    + + Link + Link + Link + Link + +
    + + + Link + Link + Link + Link + + + +
    + + +
    + + {/* Uses a header that contracts as the page scrolls down. */} +
    + +
    + + {}} + label="Search" + expandable + expandableIcon="search" + /> + + + + Link + Link + Link + Link + + +
    + + + Link + Link + Link + Link + + + +
    + + +
    + + {/* Hide the top part of the header when scrolling down */} +
    + +
    + + {}} + label="Search" + expandable + expandableIcon="search" + /> + + + + Link + Link + Link + Link + + +
    + + + Link + Link + Link + Link + + + +
    + + +
    + +
    + +
    + + this.setState({ activeTab: tabId })}> + Tab1 + Tab2 + Tab3 + Tab4 + Tab5 + Tab6 + +
    + + +
    Content for the tab: {this.state.activeTab}
    +
    +
    +
    + + {/* Simple header with fixed tabs. */} +
    + +
    + + {}}> + Tab1 + Tab2 + Tab3 + +
    + + +
    You can add logic to update the content of this container based on the "activeTab" receive in the `onChange` callback.
    +
    +
    +
    + + + + +
    + ); + } +}); + +// List tests +React.createClass({ + render: function() { + return ( +
    + + Bryan Cranston + Aaron Paul + Bob Odenkirk + + + + + Bryan Cranston + + + Aaron Paul + + + Bob Odenkirk + + + + + + Bryan Cranston + + + + + + Aaron Paul + + + + + + Bob Odenkirk + + + + + + + + + Bryan Cranston + + + + + + Aaron Paul + + + + + + Bob Odenkirk + + + + + + + + + Bryan Cranston + + + + + + Aaron Paul + + + + + + Bob Odenkirk + + + + + + + + + Bryan Cranston + + + + + + Aaron Paul + + + + + + Bob Odenkirk + + + + + +
    + ); + } +}); + +// Menu tests +React.createClass({ + render: function() { + return ( +
    + {/* Lower left */} +
    + + + Some Action + Another Action + Disabled Action + Yet Another Action + +
    + + {/* Lower right */} +
    + + + Some Action + Another Action + Disabled Action + Yet Another Action + +
    + + {/* Top left */} +
    + + + Some Action + Another Action + Disabled Action + Yet Another Action + +
    + + {/* Top right */} +
    + + + Some Action + Another Action + Disabled Action + Yet Another Action + +
    +
    + ); + } +}); + +// ProgressBar tests +React.createClass({ + render: function() { + return ( +
    + {/* Simple Progress Bar */} + + + {/* Progress Bar with Indeterminate Progress */} + + + {/* Progress Bar with Buffering */} + +
    + ); + } +}); + +// Radio tests +React.createClass({ + render: function() { + return ( +
    + + Ripple option + Other option + + + + Ripple option + Other option + +
    + ); + } +}); + +// Slider tests +React.createClass({ + render: function() { + return ( +
    + {/* Default slider */} + + + {/* Slider with initial value */} + +
    + ); + } +}); + +// Snackbar tests +React.createClass({ + render: function() { + return ( +
    +
    + + Button color changed. +
    + +
    + + + Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce varius luctus quam. Fusce quis blandit libero. Donec accumsan nunc lectus, vel blandit diam bibendum ac. Integer faucibus, lorem et convallis fermentum, diam dolor imperdiet mi, nec iaculis risus mauris id elit. Vivamus vel eros dapibus, molestie ante ut, vestibulum sem. + +
    +
    + ); + } +}); + +// Spinner tests +React.createClass({ + render: function() { + return ( +
    + {/* Simple spinner */} + + + {/* Single color spinner */} + +
    + ); + } +}); + +// Switch tests +React.createClass({ + render: function() { + return ( +
    + Ripple switch + + Switch +
    + ); + } +}); + +// Tab tests +React.createClass({ + render: function() { + return ( +
    +
    + this.setState({ activeTab: tabId })} ripple> + Starks + Lannisters + Targaryens + +
    +
    Content for the tab: {this.state.activeTab}
    +
    +
    +
    + ); + } +}); + +// Textfield tests +React.createClass({ + render: function() { + return ( +
    + {/* Simple textfield */} + {}} + label="Text..." + style={{width: '200px'}} + /> + + {/* Numeric textfield */} + {}} + pattern="-?[0-9]*(\.[0-9]+)?" + error="Input is not a number!" + label="Number..." + style={{width: '200px'}} + /> + + {/* Textfield with floating label */} + {}} + label="Text..." + floatingLabel + style={{width: '200px'}} + /> + + {/* Numeric Textfield with floating label */} + {}} + pattern="-?[0-9]*(\.[0-9]+)?" + error="Input is not a number!" + label="Number..." + floatingLabel + /> +
    + ); + } +}); + +// Tooltip tests +React.createClass({ + render: function() { + return ( +
    + {/* Simple tooltip */} + + + + + {/* Large Tooltip */} + + + + + {/* Rich Tooltip */} + Upload file.zip}> + + + + {/* Multiline Tooltip */} + Share your content
    via social media}> + +
    + + {/* Right Tooltip */} + + + + + {/* Left Tooltip */} + + + + + {/* Top Tooltip */} + + + + + {/* Bottom Tooltip */} + + + +
    + ); + } +}); diff --git a/react-mdl/react-mdl.d.ts b/react-mdl/react-mdl.d.ts new file mode 100644 index 0000000000..56d688c7f4 --- /dev/null +++ b/react-mdl/react-mdl.d.ts @@ -0,0 +1,606 @@ +// Type definitions for react-mdl 1.5.3 +// Project: https://github.com/tleunen/react-mdl +// Definitions by: Brad Zacher +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare namespace __ReactMDL { + import React = __React; + + type __MDLClassProps = React.ClassAttributes; + type __MDLOtherProps = React.HTMLProps; + class __MDLComponent

    extends React.Component {} + class __MDLBasicComponent extends __MDLComponent<__MDLOtherProps> {} + + interface ShadowedComponent { + shadow ?: number; + } + interface RippleComponent { + ripple ?: boolean; + } + interface CustomRenderedComponent { + component ?: string | JSX.Element | Function; + } + + + // HTMLAttributes (minus the 'data', 'icon', 'label', 'name', 'rows', 'size', 'title', 'value' attributes) + interface MDLHTMLAttributes { + // React-specific Attributes + defaultChecked?: boolean; + defaultValue?: string | string[]; + + // Standard HTML Attributes + accept?: string; + acceptCharset?: string; + accessKey?: string; + action?: string; + allowFullScreen?: boolean; + allowTransparency?: boolean; + alt?: string; + async?: boolean; + autoComplete?: string; + autoFocus?: boolean; + autoPlay?: boolean; + capture?: boolean; + cellPadding?: number | string; + cellSpacing?: number | string; + charSet?: string; + challenge?: string; + checked?: boolean; + classID?: string; + className?: string; + cols?: number; + colSpan?: number; + content?: string; + contentEditable?: boolean; + contextMenu?: string; + controls?: boolean; + coords?: string; + crossOrigin?: string; + dateTime?: string; + default?: boolean; + defer?: boolean; + dir?: string; + disabled?: boolean; + download?: any; + draggable?: boolean; + encType?: string; + form?: string; + formAction?: string; + formEncType?: string; + formMethod?: string; + formNoValidate?: boolean; + formTarget?: string; + frameBorder?: number | string; + headers?: string; + height?: number | string; + hidden?: boolean; + high?: number; + href?: string; + hrefLang?: string; + htmlFor?: string; + httpEquiv?: string; + id?: string; + inputMode?: string; + integrity?: string; + is?: string; + keyParams?: string; + keyType?: string; + kind?: string; + lang?: string; + list?: string; + loop?: boolean; + low?: number; + manifest?: string; + marginHeight?: number; + marginWidth?: number; + max?: number | string; + maxLength?: number; + media?: string; + mediaGroup?: string; + method?: string; + min?: number | string; + minLength?: number; + multiple?: boolean; + muted?: boolean; + nonce?: string; + noValidate?: boolean; + open?: boolean; + optimum?: number; + pattern?: string; + placeholder?: string; + poster?: string; + preload?: string; + radioGroup?: string; + readOnly?: boolean; + rel?: string; + required?: boolean; + reversed?: boolean; + role?: string; + rowSpan?: number; + sandbox?: string; + scope?: string; + scoped?: boolean; + scrolling?: string; + seamless?: boolean; + selected?: boolean; + shape?: string; + sizes?: string; + span?: number; + spellCheck?: boolean; + src?: string; + srcDoc?: string; + srcLang?: string; + srcSet?: string; + start?: number; + step?: number | string; + style?: React.CSSProperties; + summary?: string; + tabIndex?: number; + target?: string; + type?: string; + useMap?: string; + width?: number | string; + wmode?: string; + wrap?: string; + + // RDFa Attributes + about?: string; + datatype?: string; + inlist?: any; + prefix?: string; + property?: string; + resource?: string; + typeof?: string; + vocab?: string; + + // Non-standard Attributes + autoCapitalize?: string; + autoCorrect?: string; + autoSave?: string; + color?: string; + itemProp?: string; + itemScope?: boolean; + itemType?: string; + itemID?: string; + itemRef?: string; + results?: number; + security?: string; + unselectable?: boolean; + + // Allows aria- and data- Attributes + [key: string]: any; + } + // DOMAttributes (minus 'onClick', 'onChange') + interface MDLDOMAttributes { + // DOMAttributes (minus onClick) + children?: React.ReactNode; + dangerouslySetInnerHTML?: { + __html: string; + }; + + // Clipboard Events + onCopy?: React.ClipboardEventHandler; + onCut?: React.ClipboardEventHandler; + onPaste?: React.ClipboardEventHandler; + + // Composition Events + onCompositionEnd?: React.CompositionEventHandler; + onCompositionStart?: React.CompositionEventHandler; + onCompositionUpdate?: React.CompositionEventHandler; + + // Focus Events + onFocus?: React.FocusEventHandler; + onBlur?: React.FocusEventHandler; + + // Form Events + onInput?: React.FormEventHandler; + onSubmit?: React.FormEventHandler; + + // Image Events + onLoad?: React.ReactEventHandler; + onError?: React.ReactEventHandler; // also a Media Event + + // Keyboard Events + onKeyDown?: React.KeyboardEventHandler; + onKeyPress?: React.KeyboardEventHandler; + onKeyUp?: React.KeyboardEventHandler; + + // Media Events + onAbort?: React.ReactEventHandler; + onCanPlay?: React.ReactEventHandler; + onCanPlayThrough?: React.ReactEventHandler; + onDurationChange?: React.ReactEventHandler; + onEmptied?: React.ReactEventHandler; + onEncrypted?: React.ReactEventHandler; + onEnded?: React.ReactEventHandler; + onLoadedData?: React.ReactEventHandler; + onLoadedMetadata?: React.ReactEventHandler; + onLoadStart?: React.ReactEventHandler; + onPause?: React.ReactEventHandler; + onPlay?: React.ReactEventHandler; + onPlaying?: React.ReactEventHandler; + onProgress?: React.ReactEventHandler; + onRateChange?: React.ReactEventHandler; + onSeeked?: React.ReactEventHandler; + onSeeking?: React.ReactEventHandler; + onStalled?: React.ReactEventHandler; + onSuspend?: React.ReactEventHandler; + onTimeUpdate?: React.ReactEventHandler; + onVolumeChange?: React.ReactEventHandler; + onWaiting?: React.ReactEventHandler; + + // MouseEvents + onContextMenu?: React.MouseEventHandler; + onDoubleClick?: React.MouseEventHandler; + onDrag?: React.DragEventHandler; + onDragEnd?: React.DragEventHandler; + onDragEnter?: React.DragEventHandler; + onDragExit?: React.DragEventHandler; + onDragLeave?: React.DragEventHandler; + onDragOver?: React.DragEventHandler; + onDragStart?: React.DragEventHandler; + onDrop?: React.DragEventHandler; + onMouseDown?: React.MouseEventHandler; + onMouseEnter?: React.MouseEventHandler; + onMouseLeave?: React.MouseEventHandler; + onMouseMove?: React.MouseEventHandler; + onMouseOut?: React.MouseEventHandler; + onMouseOver?: React.MouseEventHandler; + onMouseUp?: React.MouseEventHandler; + + // Selection Events + onSelect?: React.ReactEventHandler; + + // Touch Events + onTouchCancel?: React.TouchEventHandler; + onTouchEnd?: React.TouchEventHandler; + onTouchMove?: React.TouchEventHandler; + onTouchStart?: React.TouchEventHandler; + + // UI Events + onScroll?: React.UIEventHandler; + + // Wheel Events + onWheel?: React.WheelEventHandler; + } + + + + interface BadgeProps extends __MDLClassProps { + text: string | number; + className ?: string; + noBackground ?: boolean; + overlap ?: boolean; + } + class Badge extends __MDLComponent {} + + + interface ButtonProps extends __MDLOtherProps, RippleComponent, CustomRenderedComponent { + accent ?: boolean; + colored ?: boolean; + primary ?: boolean; + } + interface StandardButtonProps extends ButtonProps { + raised ?: boolean; + } + interface FABButtonProps extends ButtonProps { + mini ?: boolean; + } + interface IconButtonProps extends ButtonProps { + name ?: string; + raised ?: boolean; + } + class Button extends __MDLComponent {} + class FABButton extends __MDLComponent {} + class IconButton extends __MDLComponent {} + + + interface CardProps extends __MDLOtherProps, ShadowedComponent {} + interface CardActionProps extends __MDLOtherProps { + border ?: boolean; + } + interface CardTitleProps extends __MDLOtherProps { + expand ?: boolean; + } + class Card extends __MDLComponent {} + class CardActions extends __MDLComponent {} + class CardTitle extends __MDLComponent {} + class CardText extends __MDLBasicComponent {} + class CardMenu extends __MDLBasicComponent {} + class CardMedia extends __MDLBasicComponent {} + + + interface CheckboxProps extends __MDLOtherProps, RippleComponent { + checked ?: boolean; + disabled ?: boolean; + label ?: string; + } + class Checkbox extends __MDLComponent {} + + interface UndecoratedTableProps extends __MDLClassProps, MDLHTMLAttributes, React.DOMAttributes, ShadowedComponent { + rows: Array; + rowKeyColumn ?: string; + + name ?: string; + title ?: string; + } + interface TableProps extends UndecoratedTableProps { + sortable ?: boolean; + selectable ?: boolean; + onSelectionChanged ?: (row : any) => any; + } + interface TableHeaderProps extends __MDLClassProps, MDLHTMLAttributes, MDLDOMAttributes { + name : string; + title ?: string; + cellFormatter ?: (value : any, row : any, index : number) => React.ReactNode; + numeric ?: boolean; + nosort ?: boolean; + onClick ?: (e : React.MouseEvent, name : string) => any; + sortFn ?: (a : any, b : any, isAsc : boolean) => number; + tooltip ?: React.ReactNode; + } + class Table extends __MDLComponent {} + class TableHeader extends __MDLComponent {} + class UndecoratedTable extends __MDLComponent {} + class DataTable extends Table {} + + + interface DialogProps extends __MDLOtherProps { + open ?: boolean; + } + interface DialogActionsProps extends __MDLOtherProps { + fullWidth ?: boolean; + } + interface DialogTitleProps extends __MDLOtherProps, CustomRenderedComponent {} + class Dialog extends __MDLComponent {} + class DialogActions extends __MDLComponent {} + class DialogTitle extends __MDLComponent {} + class DialogContent extends __MDLBasicComponent {} + + + interface GridProps extends __MDLOtherProps, CustomRenderedComponent, ShadowedComponent { + noSpacing ?: boolean; + } + interface CellProps extends __MDLOtherProps, CustomRenderedComponent, ShadowedComponent { + col : number; + align ?: string; + phone ?: number; + tablet ?: number; + hideDesktop ?: boolean; + hidePhone ?: boolean; + hideTablet ?: boolean; + } + class Grid extends __MDLComponent {} + class Cell extends __MDLComponent {} + + + interface IconProps extends __MDLOtherProps { + name : string; + } + class Icon extends __MDLComponent {} + + + interface IconToggleProps extends __MDLOtherProps, RippleComponent { + name : string; + checked ?: boolean; + disabled ?: boolean; + } + class IconToggle extends __MDLComponent {} + + + interface ContentProps extends __MDLOtherProps, CustomRenderedComponent {} + interface DrawerProps extends __MDLOtherProps { + title ?: string; + } + interface HeaderProps extends __MDLOtherProps { + title ?: string; + scroll ?: boolean; + seamed ?: boolean; + transparent ?: boolean; + waterfall ?: boolean; + hideTop ?: boolean; + } + interface HeaderRowProps extends __MDLOtherProps { + title ?: string; + } + interface HeaderTabsProps extends __MDLOtherProps, RippleComponent { + activeTab ?: number; + onChange ?: React.FormEventHandler; + } + interface LayoutProps extends __MDLOtherProps { + fixedDrawer ?: boolean; + fixedHeader ?: boolean; + fixedTabse ?: boolean; + } + interface NavigationProps extends __MDLOtherProps {} + class Content extends __MDLComponent {} + class Drawer extends __MDLComponent {} + class Header extends __MDLComponent {} + class HeaderRow extends __MDLComponent {} + class HeaderTabs extends __MDLComponent {} + class Layout extends __MDLComponent {} + class Navigation extends __MDLComponent {} + class Spacer extends __MDLBasicComponent {} + + interface FooterProps extends MDLHTMLAttributes, React.DOMAttributes { + size ?: string; + + title ?: string; + } + interface FooterDropDownSectionProps extends MDLHTMLAttributes, React.DOMAttributes { + size ?: string; + title : React.ReactNode; + } + interface FooterLinkListProps extends MDLHTMLAttributes, React.DOMAttributes { + size ?: string; + + title ?: string; + } + interface FooterSectionProps extends MDLHTMLAttributes, React.DOMAttributes { + size ?: string; + type ?: string; + logo ?: React.ReactNode; + + title ?: string; + } + class Footer extends __MDLComponent {} + class FooterDropDownSection extends __MDLComponent {} + class FooterLinkList extends __MDLComponent {} + class FooterSection extends __MDLComponent {} + + interface ListItemProps extends __MDLOtherProps { + twoLine ?: boolean; + threeLine ?: boolean; + } + interface ListItemActionProps extends __MDLOtherProps { + info ?: string; + } + interface ListItemContentProps extends MDLHTMLAttributes, React.DOMAttributes { + avatar ?: string | JSX.Element; + icon ?: string | JSX.Element; + subtitle ?: React.ReactNode; + useBodyClass ?: boolean; + } + class List extends __MDLBasicComponent {} + class ListItem extends __MDLComponent {} + class ListItemAction extends __MDLComponent {} + class ListItemContent extends __MDLComponent {} + + + interface MenuProps extends __MDLOtherProps, RippleComponent { + target : string; + align ?: string; + valign ?: string; + } + class Menu extends __MDLComponent {} + class MenuItem extends __MDLBasicComponent {} + + + interface ProgressBarProps extends __MDLOtherProps { + buffer ?: number; + indeterminate ?: boolean; + progress ?: number; + } + class ProgressBar extends __MDLComponent {} + + + interface RadioProps extends MDLHTMLAttributes, React.DOMAttributes, RippleComponent { + value : string | number; + checked ?: boolean; + disabled ?: boolean; + name ?: string; + onChange ?: React.FormEventHandler; + label ?: string; + } + interface RadioGroupProps extends MDLHTMLAttributes, React.DOMAttributes { + name : string; + value : string | number; + childContainer ?: string; + container ?: string; + onChange ?: React.FormEventHandler; + label ?: string; + } + class Radio extends __MDLComponent {} + class RadioGroup extends __MDLComponent {} + + + interface SliderProps extends MDLHTMLAttributes, React.DOMAttributes { + max : number; + min : number; + onChange ?: React.FormEventHandler; + value ?: number; + } + class Slider extends __MDLComponent {} + + + interface SnackbarProps extends __MDLOtherProps { + active : boolean; + onTimeout : () => any; + action ?: string; + onActionClick ?: React.MouseEventHandler; + timeout ?: number; + } + class Snackbar extends __MDLComponent {} + + + interface SpinnerProps extends __MDLOtherProps { + singleColor ?: boolean; + } + class Spinner extends __MDLComponent {} + + + interface SwitchProps extends __MDLOtherProps, RippleComponent { + checked ?: boolean; + disabled ?: boolean; + onChange ?: React.FormEventHandler; + } + class Switch extends __MDLComponent {} + + + interface TabProps extends __MDLOtherProps, CustomRenderedComponent { + active ?: boolean; + cssPrefix ?: string; + onTabClick ?: (tabId : number) => any; + tabId ?: number; + } + interface TabBarProps extends MDLHTMLAttributes, MDLDOMAttributes { + cssPrefix : string; + activeTab ?: number; + onChange ?: (tabId : number) => any; + + name ?: string; + title ?: string; + onClick ?: React.MouseEventHandler; + } + interface TabsProps extends MDLHTMLAttributes, MDLDOMAttributes { + activeTab ?: number; + onChange ?: (tabId : number) => any; + tabBarProps ?: TabBarProps; + + name ?: string; + title ?: string; + onClick ?: React.MouseEventHandler; + } + class Tab extends __MDLComponent {} + class TabBar extends __MDLComponent {} + class Tabs extends __MDLComponent {} + + + interface TextfieldProps extends MDLHTMLAttributes, React.DOMAttributes { + label : string; + disabled ?: boolean; + error ?: React.ReactNode; + expandable ?: boolean; + expandableIcon ?: string; + floatingLabel ?: boolean; + id ?: string; + inputClassName ?: string; + maxRows ?: number; + onChange ?: React.FormEventHandler; + pattern ?: string; + required ?: boolean; + rows ?: number; + value ?: string | number; + + name ?: string; + title ?: string; + } + class Textfield extends __MDLComponent {} + + + interface TooltipProps extends MDLHTMLAttributes, React.DOMAttributes { + label : React.ReactNode; + large ?: boolean; + position ?: string; + + name ?: string; + title ?: string; + } + class Tooltip extends __MDLComponent {} +} + +declare module 'react-mdl' { + export = __ReactMDL; +} \ No newline at end of file diff --git a/react-native/react-native-animated-tests.tsx b/react-native/react-native-animated-tests.tsx new file mode 100644 index 0000000000..6fafd9f32f --- /dev/null +++ b/react-native/react-native-animated-tests.tsx @@ -0,0 +1,95 @@ +/// + +import * as React from 'react-native' + +import { + Animated, + View, +} from 'react-native'; + +function TestAnimatedAPI() { + // Value + const v1 = new Animated.Value(0); + const v2 = new Animated.Value(0); + + v1.setValue(0.1); + + v1.addListener(e => { + let n: number = e.value; + }); + + const v200 = v1.interpolate({ + inputRange: [0, 1], + outputRange: [0, 200], + }); + + // ValueXY + const position = new Animated.ValueXY({ x: 0, y: 0 }); + + // Animation functions + const spring1 = Animated.spring(v1, { + toValue: 0.5, + tension: 10, + }); + + const springXY = Animated.spring(position, { + toValue: { + x: 1, + y: 2, + } + }); + + spring1.start(); + spring1.stop(); + + Animated.parallel([ + Animated.spring(v1, { toValue: 1 }), + Animated.spring(v2, { toValue: 1 }), + ], { + stopTogether: true, + }); + + Animated.decay(v1, { + velocity: 2, + }); + + Animated.timing(v1, { + toValue: 1, + duration: 100, + delay: 100, + easing: v => v, + }); + + Animated.add(v1, v2); + Animated.multiply(v1, v2); + Animated.modulo(v1, 2); + + Animated.delay(100); + + Animated.sequence([ + spring1, + springXY, + ]); + + Animated.stagger(100, [ + spring1, + springXY, + ]); + + return ( + + + + + + + + ); +} \ No newline at end of file diff --git a/react-native/react-native-tests.tsx b/react-native/react-native-tests.tsx index ffb127b6cc..6079637ce6 100644 --- a/react-native/react-native-tests.tsx +++ b/react-native/react-native-tests.tsx @@ -27,9 +27,30 @@ import { View, AppState, AppStateIOS, - ViewPagerAndroid + ViewPagerAndroid, + Dimensions, + BackAndroid, } from 'react-native'; +function testDimensions() { + var { + width, + height, + scale, + fontScale, + } = Dimensions.get("window"); + + var { + width, + height, + scale, + fontScale, + } = Dimensions.get("screen"); +} + +BackAndroid.addEventListener("hardwareBackPress", () => { +}); + var styles = StyleSheet.create( { container: { @@ -54,11 +75,19 @@ var styles = StyleSheet.create( class Welcome extends React.Component { + testNativeMethods() { + this.setNativeProps({}); + + const { rootView } = this.refs; + + rootView.measure((x, y, width, height) => { + }); + } render() { return ( - + Welcome to React Native diff --git a/react-native/react-native.d.ts b/react-native/react-native.d.ts index b7f19c4489..e866c58c40 100644 --- a/react-native/react-native.d.ts +++ b/react-native/react-native.d.ts @@ -22,7 +22,7 @@ import React = __React; //react-native "extends" react -declare namespace __React { +declare module "react-native" { /** @@ -121,6 +121,109 @@ declare namespace __React { // @see lib.es6.d.ts export var Promise: PromiseConstructor; + module NativeMethodsMixin { + type MeasureOnSuccessCallback = ( + x: number, + y: number, + width: number, + height: number, + pageX: number, + pageY: number + ) => void + + type MeasureInWindowOnSuccessCallback = ( + x: number, + y: number, + width: number, + height: number + ) => void + + type MeasureLayoutOnSuccessCallback = ( + left: number, + top: number, + width: number, + height: number + ) => void + } + + /** + * @see https://github.com/facebook/react-native/blob/master/Libraries/ReactIOS/NativeMethodsMixin.js + */ + export class Component extends React.Component { + /** + * Determines the location on screen, width, and height of the given view and + * returns the values via an async callback. If successful, the callback will + * be called with the following arguments: + * + * - x + * - y + * - width + * - height + * - pageX + * - pageY + * + * Note that these measurements are not available until after the rendering + * has been completed in native. If you need the measurements as soon as + * possible, consider using the [`onLayout` + * prop](docs/view.html#onlayout) instead. + */ + measure(callback: NativeMethodsMixin.MeasureOnSuccessCallback): void; + + /** + * Determines the location of the given view in the window and returns the + * values via an async callback. If the React root view is embedded in + * another native view, this will give you the absolute coordinates. If + * successful, the callback will be called with the following + * arguments: + * + * - x + * - y + * - width + * - height + * + * Note that these measurements are not available until after the rendering + * has been completed in native. + */ + measureInWindow(callback: NativeMethodsMixin.MeasureInWindowOnSuccessCallback): void; + + /** + * Like [`measure()`](#measure), but measures the view relative an ancestor, + * specified as `relativeToNativeNode`. This means that the returned x, y + * are relative to the origin x, y of the ancestor view. + * + * As always, to obtain a native node handle for a component, you can use + * `React.findNodeHandle(component)`. + */ + measureLayout( + relativeToNativeNode: number, + onSuccess: NativeMethodsMixin.MeasureLayoutOnSuccessCallback, + onFail: () => void /* currently unused */ + ): void; + + /** + * This function sends props straight to native. They will not participate in + * future diff process - this means that if you do not include them in the + * next render, they will remain active (see [Direct + * Manipulation](docs/direct-manipulation.html)). + */ + setNativeProps(nativeProps: Object): void; + + /** + * Requests focus for the given input or view. The exact behavior triggered + * will depend on the platform and type of view. + */ + focus(): void; + + /** + * Removes focus from an input or view. This is the opposite of `focus()`. + */ + blur(): void; + + refs: { + [key: string]: Component + }; + } + //TODO: BGR: Replace with ComponentClass ? // node_modules/react-tools/src/classic/class/ReactClass.js export interface ReactClass { @@ -219,7 +322,6 @@ declare namespace __React { * //FIXME: need to find documentation on which compoenent is a native (i.e. non composite component) */ export interface NativeComponent { - setNativeProps: ( props: Object ) => void } /** @@ -2080,7 +2182,7 @@ declare namespace __React { } export interface Route { - component?: ComponentClass + component?: React.ComponentClass id?: string title?: string passProps?: Object; @@ -2499,8 +2601,28 @@ declare namespace __React { width: number; height: number; scale: number; + fontScale: number; } + /** + * Initial dimensions are set before `runApplication` is called so they should + * be available before any other require's are run, but may be updated later. + * + * Note: Although dimensions are available immediately, they may change (e.g + * due to device rotation) so any rendering logic or styles that depend on + * these constants should try to call this function on every render, rather + * than caching the value (for example, using inline styles rather than + * setting a value in a `StyleSheet`). + * + * Example: `var {height, width} = Dimensions.get('window');` + * + * @param {string} dim Name of dimension as defined when calling `set`. + * @returns {Object?} Value for the dimension. + * @see https://facebook.github.io/react-native/docs/dimensions.html#content + */ + export interface Dimensions { + get( what: "window" | "screen" ): ScaledSize; + } export interface InteractionManagerStatic { runAfterInteractions( fn: () => void ): void; @@ -3331,6 +3453,312 @@ declare namespace __React { vibrate(): void } + export module Animated { + // Most (all?) functions where AnimatedValue is used any subclass of Animated can be used as well. + type AnimatedValue = Animated; + type AnimatedValueXY = ValueXY; + + type Base = Animated; + + class Animated { + // Internal class, no public API. + } + + class AnimatedWithChildren extends Animated { + // Internal class, no public API. + } + + class AnimatedInterpolation extends AnimatedWithChildren { + interpolate(config: InterpolationConfigType): AnimatedInterpolation; + } + + type ExtrapolateType = 'extend' | 'identity' | 'clamp'; + + type InterpolationConfigType = { + inputRange: number[]; + outputRange: (number[] | string[]); + easing?: ((input: number) => number); + extrapolate?: ExtrapolateType; + extrapolateLeft?: ExtrapolateType; + extrapolateRight?: ExtrapolateType; + }; + + type ValueListenerCallback = (state: {value: number}) => void; + + /** + * Standard value for driving animations. One `Animated.Value` can drive + * multiple properties in a synchronized fashion, but can only be driven by one + * mechanism at a time. Using a new mechanism (e.g. starting a new animation, + * or calling `setValue`) will stop any previous ones. + */ + export class Value extends AnimatedWithChildren { + constructor(value: number); + + setValue(value: number): void; + + /** + * Sets an offset that is applied on top of whatever value is set, whether via + * `setValue`, an animation, or `Animated.event`. Useful for compensating + * things like the start of a pan gesture. + */ + setOffset(offset: number): void; + + /** + * Merges the offset value into the base value and resets the offset to zero. + * The final output of the value is unchanged. + */ + flattenOffset(): void; + + /** + * Adds an asynchronous listener to the value so you can observe updates from + * animations. This is useful because there is no way to + * synchronously read the value because it might be driven natively. + */ + addListener(callback: ValueListenerCallback): string; + + removeListener(id: string): void; + + removeAllListeners(): void; + + /** + * Stops any running animation or tracking. `callback` is invoked with the + * final value after stopping the animation, which is useful for updating + * state to match the animation position with layout. + */ + stopAnimation(callback?: (value: number) => void): void; + + /** + * Interpolates the value before updating the property, e.g. mapping 0-1 to + * 0-10. + */ + interpolate(config: InterpolationConfigType): AnimatedInterpolation; + } + + type ValueXYListenerCallback = (value: {x: number; y: number}) => void; + + /** + * 2D Value for driving 2D animations, such as pan gestures. Almost identical + * API to normal `Animated.Value`, but multiplexed. Contains two regular + * `Animated.Value`s under the hood. + */ + export class ValueXY extends AnimatedWithChildren { + x: AnimatedValue; + y: AnimatedValue; + + constructor(valueIn?: {x: number | AnimatedValue; y: number | AnimatedValue}); + + setValue(value: {x: number; y: number}): void; + + setOffset(offset: {x: number; y: number}): void; + + flattenOffset(): void + + stopAnimation(callback?: () => number): void; + + addListener(callback: ValueXYListenerCallback): string; + + removeListener(id: string): void; + + /** + * Converts `{x, y}` into `{left, top}` for use in style, e.g. + * + *```javascript + * style={this.state.anim.getLayout()} + *``` + */ + getLayout(): { left: AnimatedValue, top: AnimatedValue }; + + /** + * Converts `{x, y}` into a useable translation transform, e.g. + * + *```javascript + * style={{ + * transform: this.state.anim.getTranslateTransform() + * }} + *``` + */ + getTranslateTransform(): {[key: string]: AnimatedValue}[]; + + } + + type EndResult = {finished: boolean}; + type EndCallback = (result: EndResult) => void; + + interface CompositeAnimation { + start: (callback?: EndCallback) => void; + stop: () => void; + } + + interface AnimationConfig { + isInteraction?: boolean; + useNativeDriver?: boolean; + } + + /** + * Animates a value from an initial velocity to zero based on a decay + * coefficient. + */ + export function decay( + value: AnimatedValue | AnimatedValueXY, + config: DecayAnimationConfig + ): CompositeAnimation; + + interface DecayAnimationConfig extends AnimationConfig { + velocity: number | {x: number, y: number}; + deceleration?: number; + } + + /** + * Animates a value along a timed easing curve. The `Easing` module has tons + * of pre-defined curves, or you can use your own function. + */ + export var timing: ( + value: AnimatedValue | AnimatedValueXY, + config: TimingAnimationConfig + ) => CompositeAnimation; + + interface TimingAnimationConfig extends AnimationConfig { + toValue: number | AnimatedValue | {x: number, y: number} | AnimatedValueXY; + easing?: (value: number) => number; + duration?: number; + delay?: number; + } + + interface SpringAnimationConfig extends AnimationConfig { + toValue: number | AnimatedValue | {x: number, y: number} | AnimatedValueXY; + overshootClamping?: boolean; + restDisplacementThreshold?: number; + restSpeedThreshold?: number; + velocity?: number | {x: number, y: number}; + bounciness?: number; + speed?: number; + tension?: number; + friction?: number; + } + + /** + * Creates a new Animated value composed from two Animated values added + * together. + */ + export function add( + a: Animated, + b: Animated + ): AnimatedAddition; + + class AnimatedAddition extends AnimatedInterpolation {} + + /** + * Creates a new Animated value composed from two Animated values multiplied + * together. + */ + export function multiply( + a: Animated, + b: Animated + ): AnimatedMultiplication; + + class AnimatedMultiplication extends AnimatedInterpolation {} + + /** + * Creates a new Animated value that is the (non-negative) modulo of the + * provided Animated value + */ + export function modulo( + a: Animated, + modulus: number + ): AnimatedModulo; + + class AnimatedModulo extends AnimatedInterpolation {} + + /** + * Starts an animation after the given delay. + */ + export function delay(time: number): CompositeAnimation; + + /** + * Starts an array of animations in order, waiting for each to complete + * before starting the next. If the current running animation is stopped, no + * following animations will be started. + */ + export function sequence( + animations: Array + ): CompositeAnimation; + + /** + * Array of animations may run in parallel (overlap), but are started in + * sequence with successive delays. Nice for doing trailing effects. + */ + + export function stagger( + time: number, + animations: Array + ): CompositeAnimation + + /** + * Spring animation based on Rebound and Origami. Tracks velocity state to + * create fluid motions as the `toValue` updates, and can be chained together. + */ + export var spring: ( + value: AnimatedValue | AnimatedValueXY, + config: SpringAnimationConfig + ) => CompositeAnimation; + + type ParallelConfig = { + stopTogether?: boolean; // If one is stopped, stop all. default: true + } + + /** + * Starts an array of animations all at the same time. By default, if one + * of the animations is stopped, they will all be stopped. You can override + * this with the `stopTogether` flag. + */ + var parallel: ( + animations: Array, + config?: ParallelConfig + ) => CompositeAnimation; + + type Mapping = {[key: string]: Mapping} | AnimatedValue; + interface EventConfig { + listener?: Function + } + + /** + * Takes an array of mappings and extracts values from each arg accordingly, + * then calls `setValue` on the mapped outputs. e.g. + * + *```javascript + * onScroll={Animated.event( + * [{nativeEvent: {contentOffset: {x: this._scrollX}}}] + * {listener}, // Optional async listener + * ) + * ... + * onPanResponderMove: Animated.event([ + * null, // raw event arg ignored + * {dx: this._panX}, // gestureState arg + * ]), + *``` + */ + var event: ( + argMapping: Mapping[], + config?: EventConfig + ) => (...args: any[]) => void; + + /** + * Animated variants of the basic native views. Accepts Animated.Value for + * props and style. + */ + export var View: any; + export var Image: any; + export var Text: any; + } + + export namespace BackAndroid { + type EVENT_NAME = "hardwareBackPress"; + + export function exitApp(): void; + export function addEventListener(event: EVENT_NAME, fn: Function): void; + export function removeEventListener(event: EVENT_NAME, fn: Function): void; + } + ////////////////////////////////////////////////////////////////////////// // // R E - E X P O R T S @@ -3447,6 +3875,7 @@ declare namespace __React { export var VibrationIOS: VibrationIOSStatic export type VibrationIOS = VibrationIOSStatic + export var Dimensions: Dimensions; // // /TODO: BGR: These are leftovers of the initial port that must be revisited @@ -3468,19 +3897,6 @@ declare namespace __React { export function __spread( target: any, ...sources: any[] ): any; - - export interface GlobalStatic { - - /** - * Accepts a function as its only argument and calls that function before the next repaint. - * It is an essential building block for animations that underlies all of the JavaScript-based animation APIs. - * In general, you shouldn't need to call this yourself - the animation API's will manage frame updates for you. - * @see https://facebook.github.io/react-native/docs/animations.html#requestanimationframe - */ - requestAnimationFrame( fn: () => void ) : void; - - } - // // Add-Ons // @@ -3497,29 +3913,19 @@ declare namespace __React { export var TestModule: TestModuleStatic export type TestModule = TestModuleStatic } - - } -declare module "react-native" { - - import ReactNative = __React - export = ReactNative +declare interface ReactNativeGlobalStatic { + /** + * Accepts a function as its only argument and calls that function before the next repaint. + * It is an essential building block for animations that underlies all of the JavaScript-based animation APIs. + * In general, you shouldn't need to call this yourself - the animation API's will manage frame updates for you. + * @see https://facebook.github.io/react-native/docs/animations.html#requestanimationframe + */ + requestAnimationFrame( fn: () => void ) : void; } -declare var global: __React.GlobalStatic -declare function require( name: string ): any +declare var global: ReactNativeGlobalStatic; - -//TODO: BGR: this is a left-over from the initial port. Not sure it makes any sense -declare module "Dimensions" { - import * as React from 'react-native'; - - interface Dimensions { - get( what: string ): React.ScaledSize; - } - - var ExportDimensions: Dimensions; - export = ExportDimensions; -} +declare function require( name: string ): any; \ No newline at end of file diff --git a/react-redux/react-redux.d.ts b/react-redux/react-redux.d.ts index 2e3e69dc68..6f05a17b6e 100644 --- a/react-redux/react-redux.d.ts +++ b/react-redux/react-redux.d.ts @@ -80,7 +80,12 @@ declare module "react-redux" { * Defaults to true. * @default true */ - pure: boolean; + pure?: boolean; + /** + * If true, stores a ref to the wrapped component instance and makes it available via + * getWrappedInstance() method. Defaults to false. + */ + withRef?: boolean; } export interface ProviderProps { diff --git a/react-router/react-router-tests.tsx b/react-router/react-router-tests.tsx index 703ce4a9f6..b31924908f 100644 --- a/react-router/react-router-tests.tsx +++ b/react-router/react-router-tests.tsx @@ -8,7 +8,7 @@ import * as React from "react" import * as ReactDOM from "react-dom" -import { browserHistory, hashHistory, Router, Route, IndexRoute, Link } from "react-router" +import { browserHistory, hashHistory, createMemoryHistory, Router, Route, IndexRoute, Link } from "react-router" interface MasterContext { router: ReactRouter.RouterOnContext; diff --git a/react-router/react-router.d.ts b/react-router/react-router.d.ts index 357490e603..80d2e4ee6d 100644 --- a/react-router/react-router.d.ts +++ b/react-router/react-router.d.ts @@ -86,6 +86,8 @@ declare namespace ReactRouter { const browserHistory: History; const hashHistory: History; + function createMemoryHistory(options?: H.HistoryOptions): H.History + /* components */ interface RouterProps extends React.Props { @@ -245,9 +247,10 @@ declare namespace ReactRouter { interface MatchArgs { routes?: RouteConfig history?: H.History - location?: H.Location + location?: H.Location | string parseQueryString?: ParseQueryString stringifyQuery?: StringifyQuery + basename?: string } interface MatchState extends RouterState { history: History @@ -412,6 +415,9 @@ declare module "react-router/lib/useRouterHistory" { export default function useRouterHistory(createHistory: HistoryModule.CreateHistory): CreateRouterHistory; } +declare module "react-router/lib/createMemoryHistory" { + export default ReactRouter.createMemoryHistory; +} declare module "react-router" { @@ -453,6 +459,8 @@ declare module "react-router" { import useRouterHistory from "react-router/lib/useRouterHistory"; + import createMemoryHistory from "react-router/lib/createMemoryHistory"; + // PlainRoute is defined in the API documented at: // https://github.com/rackt/react-router/blob/master/docs/API.md // but not included in any of the .../lib modules above. @@ -492,7 +500,8 @@ declare module "react-router" { RouterContext, PropTypes, match, - useRouterHistory + useRouterHistory, + createMemoryHistory } export default Router diff --git a/react-scrollbar/react-scrollbar-tests.tsx b/react-scrollbar/react-scrollbar-tests.tsx new file mode 100644 index 0000000000..784a44d899 --- /dev/null +++ b/react-scrollbar/react-scrollbar-tests.tsx @@ -0,0 +1,14 @@ +/// +/// + +import ScrollArea = require('react-scrollbar'); +import * as React from 'react'; + +let scrollArea = +

    Some long content.
    + ; diff --git a/react-scrollbar/react-scrollbar.d.ts b/react-scrollbar/react-scrollbar.d.ts new file mode 100644 index 0000000000..8df2435678 --- /dev/null +++ b/react-scrollbar/react-scrollbar.d.ts @@ -0,0 +1,32 @@ +// Type definitions for react-scrollbar 0.4.1 +// Project: https://github.com/souhe/reactScrollbar +// Definitions by: Stephen Jelfs +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare module "react-scrollbar" { + interface ScrollAreaProps extends __React.Props { + className?: string, + style?: __React.CSSProperties, + speed?: number, + contentClassName?: string, + contentStyle?: __React.CSSProperties, + vertical?: boolean, + verticalContainerStyle?: __React.CSSProperties, + verticalScrollbarStyle?: __React.CSSProperties, + horizontal?: boolean, + horizontalContainerStyle?: __React.CSSProperties, + horizontalScrollbarStyle?: __React.CSSProperties, + onScroll?: (value: {leftPosition: number, topPosition: number, containerHeight: number, containerWidth: number, realHeight: number, realWidth: number}) => void, + contentWindow?: any, + ownerDocument?: any, + smoothScrolling?: boolean + minScrollSize?: number, + swapWheelAxes?: boolean + } + + class ScrollArea extends __React.Component {} + + export = ScrollArea; +} diff --git a/react-select/react-select-tests.tsx b/react-select/react-select-tests.tsx index 444551a675..d3298e55f8 100644 --- a/react-select/react-select-tests.tsx +++ b/react-select/react-select-tests.tsx @@ -1,30 +1,104 @@ - /// /// /// -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 { Option, MenuRendererProps } from "react-select-props"; +import Select = require("react-select"); class SelectTest extends React.Component, {}> { render() { - const options: ReactSelect.Option[] = [{ label: "Foo", value: "bar" }] - return
    - {}} + onValueClick={onChange} + onOpen={onOpen} + onClose={onClose} + openAfterFocus={false} + optionComponent={
    } + required={false} + resetValue={"resetValue"} + scrollMenuIntoView={false} + valueKey="github" + labelKey="name" + onChange={onChange} + simpleValue + value={options} + valueComponent={} + /> +
    ; + } } class SelectAsyncTest extends React.Component, {}> { render() { + const getOptions = (input: string, callback: Function) => { + setTimeout(function() { + callback(null, options); + }, 500); + }; + const options: 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..dc3ca16bc8 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; @@ -18,17 +19,45 @@ declare namespace ReactSelect { clearableValue?: boolean; } + interface MenuRendererProps { + /** + * The currently focused option; should be visible in the menu by default. + * default {} + */ + focusedOption: Option; + + /** + * Callback to focus a new option; receives the option as a parameter. + */ + focusOption: (option: Option) => void; + + /** + * Option labels are accessible with this string key. + */ + labelKey: string; + + /** + * Ordered array of options to render. + */ + options: Option[]; + + /** + * Callback to select a new option; receives the option as a parameter. + */ + selectValue: (option: Option) => void; + + /** + * Array of currently selected options. + */ + valueArray: Option[]; + } + interface ReactSelectProps extends __React.Props { /** * text to display when `allowCreate` is true. * @default 'Add "{label}"?' */ addLabelText?: string; - /** - * blurs the input element after a selection has been made. Handy for lowering the keyboard on mobile devices. - * @default false - */ - autoBlur?: boolean; /** * allow new options to be created in multi mode (displays an "Add