diff --git a/.gitignore b/.gitignore index 2ea470b9e..2a52c95e0 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,7 @@ *.map *.swp .DS_Store +npm-debug.log _Resharper.DefinitelyTyped bin diff --git a/.travis.yml b/.travis.yml index f99663162..48704282a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ language: node_js node_js: - - "iojs-v2" + - 4 sudo: false diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 306bea98e..e9d91ae10 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -8,6 +8,7 @@ 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:](add2home/add2home.d.ts) [add2home](http://cubiq.org/add-to-home-screen) by [James Wilkins](http://www.codeplex.com/site/users/view/jamesnw) * [:link:](adm-zip/adm-zip.d.ts) [adm-zip](https://github.com/cthackers/adm-zip) by [John Vilk](https://github.com/jvilk) +* [:link:](ag-grid/ag-grid.d.ts) [ag-grid](http://www.ag-grid.com) by [Niall Crosby](https://github.com/ceolter) * [:link:](alertify/alertify.d.ts) [alertify](http://fabien-d.github.io/alertify.js) by [John Jeffery](http://github.com/jjeffery) * [:link:](alt/alt.d.ts) [Alt](https://github.com/goatslacker/alt) by [Michael Shearer](https://github.com/Shearerbeard) * [:link:](amazon-product-api/amazon-product-api.d.ts) [amazon-product-api](https://github.com/t3chnoboy/amazon-product-api) by [Matti Lehtinen](https://github.com/MattiLehtinen) @@ -15,10 +16,12 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](amplifyjs/amplifyjs.d.ts) [AmplifyJs](http://amplifyjs.com) by [Jonas Eriksson](https://github.com/joeriks) * [:link:](amplify-deferred/amplify-deferred.d.ts) [AmplifyJs 1.1.0 using JQuery Deferred](http://amplifyjs.com) by [Jonas Eriksson](https://github.com/joeriks), [Laurentiu Stamate](https://github.com/laurentiustamate94) * [:link:](amqp-rpc/amqp-rpc.d.ts) [amqp-rpc](https://github.com/demchenkoe/node-amqp-rpc) by [Wonshik Kim](https://github.com/wokim) -* [:link:](amqplib/amqplib.d.ts) [amqplib 0.3.x](https://github.com/squaremo/amqp.node) by [Michael Nahkies](https://github.com/mnahkies) +* [:link:](amqplib/amqplib.d.ts) [amqplib 0.3.x](https://github.com/squaremo/amqp.node) by [Michael Nahkies](https://github.com/mnahkies), [Ab Reitsma](https://github.com/abreits) +* [:link:](angular2/angular2.d.ts) [Angular 2](http://angular.io) by [angular team](https://github.com/angular) +* [:link:](angular-dialog-service/angular-dialog-service.d.ts) [Angular Dialog Service](https://github.com/m-e-conroy/angular-dialog-service) by [William Comartin](https://github.com/wcomartin) * [:link:](ng-file-upload/ng-file-upload.d.ts) [Angular File Upload](https://github.com/danialfarid/ng-file-upload) by [John Reilly](https://github.com/johnnyreilly) * [:link:](angular-file-upload/angular-file-upload.d.ts) [Angular File Upload](https://github.com/danialfarid/ng-file-upload) by [John Reilly](https://github.com/johnnyreilly) -* [:link:](angular-growl-v2/angular-growl-v2.d.ts) [Angular Growl 2 v.0.7.3](http://janstevens.github.io/angular-growl-2) by [Tadeusz Hucal](https://github.com/mkp05) +* [:link:](angular-growl-v2/angular-growl-v2.d.ts) [Angular Growl 2 v.0.7.5](http://janstevens.github.io/angular-growl-2) by [Tadeusz Hucal](https://github.com/mkp05) * [:link:](angularjs/angular.d.ts) [Angular JS](http://angularjs.org) by [Diego Vilar](http://github.com/diegovilar) * [:link:](angularjs/angular-animate.d.ts) [Angular JS (ngAnimate module)](http://angularjs.org) by [Michel Salib](https://github.com/michelsalib), [Adi Dahiya](https://github.com/adidahiya), [Raphael Schweizer](https://github.com/rasch), [Cody Schaaf](https://github.com/codyschaaf) * [:link:](angularjs/angular-cookies.d.ts) [Angular JS (ngCookies module)](http://angularjs.org) by [Diego Vilar](http://github.com/diegovilar), [Anthony Ciccarello](http://github.com/aciccarello) @@ -35,20 +38,20 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](angular-toasty/angular-toasty.d.ts) [Angular Toasty](https://github.com/invertase/angular-toasty) by [Dominik Muench](https://github.com/muenchdo) * [:link:](angular-translate/angular-translate.d.ts) [Angular Translate (pascalprecht.translate module)](https://github.com/PascalPrecht/angular-translate) by [Michel Salib](https://github.com/michelsalib) * [:link:](angular-ui-bootstrap/angular-ui-bootstrap.d.ts) [Angular UI Bootstrap](https://github.com/angular-ui/bootstrap) by [Brian Surowiec](https://github.com/xt0rted) -* [:link:](angular2/router.d.ts) [Angular v2.0.0-39](http://angular.io) by [angular team](https://github.com/angular) -* [:link:](angular2/angular2.d.ts) [Angular v2.0.0-39](http://angular.io) by [angular team](https://github.com/angular) -* [:link:](angular2/http.d.ts) [Angular v2.0.0-local_sha.7d5c3eb](http://angular.io) by [angular team](https://github.com/angular) -* [:link:](angular2/test_lib.d.ts) [Angular v2.0.0-local_sha.7d5c3eb](http://angular.io) by [angular team](https://github.com/angular) * [:link:](angular-wizard/angular-wizard.d.ts) [Angular Wizard](https://github.com/mgonto/angular-wizard) by [Marko Jurisic](https://github.com/mjurisic) * [:link:](angular-bootstrap-lightbox/angular-bootstrap-lightbox.d.ts) [angular-bootstrap-lightbox](https://github.com/compact/angular-bootstrap-lightbox) by [Roland Zwaga](https://github.com/rolandzwaga) * [:link:](angular-dynamic-locale/angular-dynamic-locale.d.ts) [angular-dynamic-locale](https://github.com/lgalfaso/angular-dynamic-locale) by [Stephen Lautier](https://github.com/stephenlautier) * [: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.d.ts) [angular-google-analytics](https://github.com/revolunet/angular-google-analytics) by [Cyril Schumacher](https://github.com/cyrilschumacher) * [: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) * [:link:](angular-jwt/angular-jwt.d.ts) [angular-jwt](https://github.com/auth0/angular-jwt) by [Reto Rezzonico](https://github.com/rerezz) +* [:link:](angular-loading-bar/angular-loading-bar.d.ts) [angular-loading-bar](https://github.com/chieffancypants/angular-loading-bar) by [Stephen Lautier](https://github.com/stephenlautier) * [:link:](angular-local-storage/angular-local-storage.d.ts) [angular-local-storage](https://github.com/grevory/angular-local-storage) by [Ken Fukuyama](https://github.com/kenfdev) * [:link:](angular-localForage/angular-localForage.d.ts) [angular-localForage](https://github.com/ocombe/angular-localForage) by [Stefan Steinhart](https://github.com/reppners) +* [: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-scroll/angular-scroll.d.ts) [angular-scroll](https://github.com/oblador/angular-scroll) by [Sam Herrmann](https://github.com/samherrmann) @@ -69,6 +72,8 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](ansicolors/ansicolors.d.ts) [ansicolors](https://github.com/thlorenz/ansicolors) by [rogierschouten](https://github.com/rogierschouten) * [: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/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) @@ -79,11 +84,13 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](arcgis-js-api/arcgis-js-api.d.ts) [ArcGIS API for JavaScript](http://js.arcgis.com) by [Esri](http://www.esri.com) * [:link:](archiver/archiver.d.ts) [archiver](https://github.com/archiverjs/node-archiver) by [Esri](https://github.com/archiverjs/node-archiver) * [:link:](archy/archy.d.ts) [archy](https://github.com/substack/node-archy) by [vvakame](https://github.com/vvakame) +* [:link:](argparse/argparse.d.ts) [argparse](https://github.com/nodeca/argparse) by [Andrew Schurman](http://github.com/arcticwaters) * [:link:](asciify/asciify.d.ts) [asciify](https://www.npmjs.org/package/asciify) by [Alan Norbauer](http://alan.norbauer.com) * [:link:](aspnet-identity-pw/aspnet-identity-pw.d.ts) [aspnet-identity-pw](https://github.com/Syncbak-Git/aspnet-identity-pw) by [jt000](https://github.com/jt000) * [:link:](assert/assert.d.ts) [assert and power-assert](https://github.com/Jxck/assert) by [vvakame](https://github.com/vvakame) * [:link:](assertion-error/assertion-error.d.ts) [assertion-error](https://github.com/chaijs/assertion-error) by [Bart van der Schoor](https://github.com/Bartvds) -* [:link:](async/async.d.ts) [Async](https://github.com/caolan/async) by [Boris Yankov](https://github.com/borisyankov), [Arseniy Maximov](https://github.com/kern0) +* [:link:](assertsharp/assertsharp.d.ts) [assertsharp](https://www.npmjs.com/package/assertsharp) by [Bruno Leonardo Michels](https://github.com/brunolm) +* [:link:](async/async.d.ts) [Async](https://github.com/caolan/async) by [Boris Yankov](https://github.com/borisyankov), [Arseniy Maximov](https://github.com/kern0), [Joe Herman](https://github.com/Penryn) * [:link:](asyncblock/asyncblock.d.ts) [asyncblock](https://github.com/scriby/asyncblock) by [Hiroki Horiuchi](https://github.com/horiuchi) * [:link:](atmosphere/atmosphere.d.ts) [Atmosphere](https://github.com/Atmosphere/atmosphere-javascript) by [Kai Toedter](https://github.com/toedter) * [:link:](atom/atom.d.ts) [Atom](https://atom.io) by [vvakame](https://github.com/vvakame) @@ -91,14 +98,15 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](atom-keymap/atom-keymap.d.ts) [atom-keymap](https://github.com/atom/atom-keymap) by [Vadim Macagon](https://github.com/enlight) * [:link:](atpl/atpl.d.ts) [atpl](https://github.com/soywiz/atpl.js) by [Carlos Ballesteros Velasco](https://github.com/soywiz) * [:link:](auth0/auth0.d.ts) [Auth0.js](http://auth0.com) by [Robert McLaws](https://github.com/advancedrei) -* [:link:](auth0.lock/auth0.lock.d.ts) [Auth0Widget.js](http://auth0.com) by [Robert McLaws](https://github.com/advancedrei) * [:link:](auth0.widget/auth0.widget.d.ts) [Auth0Widget.js](http://auth0.com) by [Robert McLaws](https://github.com/advancedrei) +* [:link:](auth0.lock/auth0.lock.d.ts) [Auth0Widget.js](http://auth0.com) by [Robert McLaws](https://github.com/advancedrei) * [:link:](auto-launch/auto-launch.d.ts) [auto-launch](https://github.com/Teamwork/node-auto-launch) by [rhysd](https://github.com/rhysd) * [:link:](autobahn/autobahn.d.ts) [AutobahnJS](http://autobahn.ws/js) by [Elad Zelingher](https://github.com/darkl), [Andy Hawkins](https://github.com/a904guy/,http://a904guy.com/,http://www.bmbsqd.com) * [:link:](autoprefixer-core/autoprefixer-core.d.ts) [Autoprefixer Core](https://github.com/postcss/autoprefixer-core) by [Asana](https://asana.com) * [:link:](aws-sdk/aws-sdk.d.ts) [aws-sdk](https://github.com/aws/aws-sdk-js) by [midknight41](https://github.com/midknight41) * [:link:](axios/axios.d.ts) [axios](https://github.com/mzabriskie/axios) by [Marcel Buesing](https://github.com/marcelbuesing) * [:link:](node-azure/azure.d.ts) [Azure SDK for Node](https://github.com/WindowsAzure/azure-sdk-for-node) by [Andrew Gaspar](https://github.com/AndrewGaspar), [Anti Veeranna](https://github.com/antiveeranna), [Maxime LUCE](https://github.com/SomaticIT) +* [:link:](backbone/backbone-global.d.ts) [Backbone](http://backbonejs.org) by [Boris Yankov](https://github.com/borisyankov), [Natan Vivo](https://github.com/nvivo) * [:link:](backbone/backbone.d.ts) [Backbone](http://backbonejs.org) by [Boris Yankov](https://github.com/borisyankov), [Natan Vivo](https://github.com/nvivo) * [:link:](backbone-associations/backbone-associations.d.ts) [Backbone-associations](https://github.com/dhruvaray/backbone-associations) by [Craig Brett](https://github.com/craigbrett17) * [:link:](backbone-relational/backbone-relational.d.ts) [Backbone-relational](http://backbonerelational.org) by [Eirik Hoem](https://github.com/eirikhm) @@ -107,15 +115,18 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](backbone.radio/backbone.radio.d.ts) [Backbone.Radio](https://github.com/marionettejs/backbone.radio) by [Peter Palotas](https://github.com/alphaleonis) * [:link:](backgrid/backgrid.d.ts) [Backgrid](http://backgridjs.com) by [Jeremy Lujan](https://github.com/jlujan) * [:link:](baconjs/baconjs.d.ts) [Bacon.js](https://baconjs.github.io) by [Alexander Matsievsky](https://github.com/alexander-matsievsky) +* [:link:](barcode/barcode.d.ts) [barcode](https://github.com/samt/barcode) by [Pascal Vomhoff](https://github.com/pvomhoff) * [:link:](bardjs/bardjs.d.ts) [bardjs](https://github.com/wardbell/bardjs) by [Andrew Archibald](https://github.com/TepigMC) * [:link:](basic-auth/basic-auth.d.ts) [basic-auth](https://github.com/jshttp/basic-auth) by [Clément Bourgeois](https://github.com/moonpyk) * [:link:](batch-stream/batch-stream.d.ts) [batch-stream](https://github.com/segmentio/batch-stream) by [Nicholas Penree](http://github.com/drudge) * [:link:](bcrypt/bcrypt.d.ts) [bcrypt](https://www.npmjs.org/package/bcrypt) by [Peter Harris](https://github.com/codeanimal) +* [:link:](benchmark/benchmark.d.ts) [Benchmark](http://benchmarkjs.com) by [Asana](https://asana.com) * [:link:](better-curry/better-curry.d.ts) [better-curry](https://github.com/pocesar/js-bettercurry) by [Paulo Cesar](https://github.com/pocesar) * [:link:](bgiframe/typescript.bgiframe.d.ts) [bgiframe](https://github.com/sumegizoltan/BgiFrame) by [Zoltan Sumegi](https://github.com/sumegizoltan) * [:link:](big.js/big.js.d.ts) [big.js](https://github.com/MikeMcl/big.js) by [Steve Ognibene](https://github.com/nycdotnet) * [:link:](bigint/bigint.d.ts) [BigInt](https://github.com/Evgenus/BigInt) by [Eugene Chernyshov](https://github.com/Evgenus) * [:link:](big-integer/big-integer.d.ts) [BigInteger.js](https://github.com/peterolson/BigInteger.js) by [Ingo Bürk](https://github.com/Airblader), [Roel van Uden](https://github.com/Deathspike) +* [:link:](bignum/bignum.d.ts) [BigNum](https://github.com/justmoon/node-BigNum) by [Pat Smuk](https://github.com/Patman64) * [:link:](bigscreen/bigscreen.d.ts) [BigScreen](http://brad.is/coding/BigScreen) by [Douglas Eichelberger](https://github.com/dduugg) * [:link:](bitwise-xor/bitwise-xor.d.ts) [bitwise-xor](https://github.com/czzarr/node-bitwise-xor) by [Rogier Schouten](https://github.com/rogierschouten) * [:link:](blob-stream/blob-stream.d.ts) [blob-stream](https://github.com/devongovett/blob-stream) by [Eric Hillah](https://github.com/erichillah) @@ -123,21 +134,26 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](bluebird-retry/bluebird-retry.d.ts) [bluebird-retry](https://github.com/jut-io/bluebird-retry) by [Pascal Vomhoff](https://github.com/pvomhoff) * [:link:](blueimp-md5/blueimp-md5.d.ts) [blueimp-md5](https://github.com/blueimp/JavaScript-MD5) by [Ray Martone](https://github.com/rmartone) * [:link:](body-parser/body-parser.d.ts) [body-parser](http://expressjs.com) by [Santi Albo](https://github.com/santialbo), [VILIC VANE](https://vilic.info), [Jonathan Häberle](https://github.com/dreampulse) +* [:link:](bookshelf/bookshelf.d.ts) [bookshelfjs](http://bookshelfjs.org) by [Andrew Schurman](http://github.com/arcticwaters) +* [:link:](boolify-string/boolify-string.d.ts) [boolify-string](https://github.com/sanemat/node-boolify-string) by [Tobias Henöckl](http://www.sisyphus.de) * [:link:](boom/boom.d.ts) [boom](http://github.com/hapijs/boom) by [Igor Rogatty](http://github.com/rogatty) * [:link:](bootbox/bootbox.d.ts) [Bootbox](https://github.com/makeusabrew/bootbox) by [Vincent Bortone](https://github.com/vbortone), [Kon Pik](https://github.com/konpikwastaken), [Anup Kattel](https://github.com/kanup), [Dominik Schroeter](https://github.com/icereed) * [:link:](bootstrap/bootstrap.d.ts) [Bootstrap](http://twitter.github.com/bootstrap) by [Boris Yankov](https://github.com/borisyankov) * [:link:](bootstrap.v3.datetimepicker/bootstrap.v3.datetimepicker.d.ts) [Bootstrap datetimepicker v3](http://eonasdan.github.io/bootstrap-datetimepicker) by [Jesica N. Fera](https://github.com/bayitajesi) +* [:link:](bootstrap-switch/bootstrap-switch.d.ts) [Bootstrap Switch](http://www.bootstrap-switch.org) by [John M. Baughman](https://github.com/johnmbaughman) * [:link:](bootstrap-touchspin/bootstrap-touchspin.d.ts) [Bootstrap TouchSpin](http://www.virtuosoft.eu/code/bootstrap-touchspin) by [Albin Sunnanbo](https://github.com/albinsunnanbo) +* [:link:](bootstrap-maxlength/bootstrap-maxlength.d.ts) [bootstrap-maxlength](https://github.com/mimo84/bootstrap-maxlength) by [Dan Manastireanu](https://github.com/danmana) * [:link:](bootstrap-notify/bootstrap-notify.d.ts) [bootstrap-notify](http://bootstrap-notify.remabledesigns.com) by [Blake Niemyjski](https://github.com/niemyjski), [Robert McIntosh](https://github.com/mouse0270), [Robert Voica](https://github.com/robert-voica) * [:link:](bootstrap-slider/bootstrap-slider.d.ts) [bootstrap-slider.js](https://github.com/seiyria/bootstrap-slider) by [Daniel Beckwith](https://github.com/dbeckwith) * [:link:](bootstrap.datepicker/bootstrap.datepicker.d.ts) [bootstrap.datepicker](https://github.com/eternicode/bootstrap-datepicker) by [Boris Yankov](https://github.com/borisyankov) * [:link:](bootstrap.paginator/bootstrap.paginator.d.ts) [bootstrap.paginator](https://github.com/lyonlai/bootstrap-paginator) by [derikwhittaker](https://github.com/derikwhittaker) -* [:link:](box2d/box2dweb.d.ts) [bootstrap.timepicker](http://code.google.com/p/box2dweb) by [jbaldwin](https://github.com/jbaldwin) * [:link:](bootstrap.timepicker/bootstrap.timepicker.d.ts) [bootstrap.timepicker](https://github.com/jdewit/bootstrap-timepicker) by [derikwhittaker](https://github.com/derikwhittaker) +* [:link:](box2d/box2dweb.d.ts) [bootstrap.timepicker](http://code.google.com/p/box2dweb) by [jbaldwin](https://github.com/jbaldwin) +* [:link:](bounce/bounce.d.ts) [Bounce.js](http://github.com/tictail/bounce.js) by [Cherry](http://github.com/cherrry) * [:link:](bowser/bowser.d.ts) [Bowser 1.x](https://github.com/ded/bowser) by [Paulo Cesar](https://github.com/pocesar) * [:link:](breeze/breeze.d.ts) [Breeze 1.5.x](http://www.breezejs.com) by [Boris Yankov](https://github.com/borisyankov), [IdeaBlade](https://github.com/IdeaBlade/Breeze) * [:link:](browser-harness/browser-harness.d.ts) [Browser Harness](https://github.com/scriby/browser-harness) by [Chris Scribner](https://github.com/scriby) -* [:link:](browser-sync/browser-sync.d.ts) [browser-sync](http://www.browsersync.io) by [Asana](https://asana.com) +* [:link:](browser-sync/browser-sync.d.ts) [browser-sync](http://www.browsersync.io) by [Asana](https://asana.com), [Joe Skeen](http://github.com/joeskeen) * [:link:](browserify/browserify.d.ts) [Browserify](http://browserify.org) by [Andrew Gaspar](https://github.com/AndrewGaspar) * [:link:](bucks/bucks.d.ts) [bucks.js](https://github.com/CyberAgent/bucks.js) by [Shunsuke Ohtani](https://github.com/zaneli) * [:link:](buffer-equal/buffer-equal.d.ts) [buffer-equal](https://github.com/substack/node-buffer-equal) by [Bart van der Schoor](https://github.com/Bartvds) @@ -148,6 +164,8 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](business-rules-engine/business-rules-engine.d.ts) [business-rules-engine](https://github.com/rsamec/form) by [Roman Samec](https://github.com/rsamec) * [:link:](dw-bxslider-4/dw-bxslider-4.d.ts) [bxSlider](https://github.com/stevenwanderski/bxslider-4) by [Piotr Sałkowski](https://github.com/namerci) * [:link:](byline/byline.d.ts) [byline](https://github.com/jahewson/node-byline) by [Stefan Steinhart](https://github.com/reppners) +* [:link:](bytes/bytes.d.ts) [bytes](https://github.com/visionmedia/bytes.js) by [Zhiyuan Wang](https://github.com/danny8002) +* [:link:](c3/c3.d.ts) [C3js](http://c3js.org) by [Marc Climent](https://github.com/mcliment) * [:link:](calq/calq.d.ts) [calq](https://calq.io/docs/client/javascript/reference) by [Eirik Hoem](https://github.com/eirikhm) * [:link:](camel-case/camel-case.d.ts) [camel-case](https://github.com/blakeembrey/camel-case) by [Sam Saint-Pettersen](https://github.com/stpettersens) * [:link:](camljs/camljs.d.ts) [camljs](http://camljs.codeplex.com) by [Andrey Markeev](http://markeev.com) @@ -172,7 +190,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](chosen/chosen.jquery.d.ts) [Chosen.JQuery](http://harvesthq.github.com/chosen) by [Boris Yankov](https://github.com/borisyankov) * [:link:](chroma-js/chroma-js.d.ts) [Chroma.js](https://github.com/gka/chroma.js) by [Sebastian Brückner](https://github.com/invliD) * [:link:](chrome/chrome-cast.d.ts) [Chrome Cast application development](https://developers.google.com/cast) by [Thomas Stig Jacobsen](https://github.com/eXeDK) -* [:link:](chrome/chrome.d.ts) [Chrome extension development](http://developer.chrome.com/extensions) by [Matthew Kimber](https://github.com/matthewkimber), [otiai10](https://github.com/otiai10) +* [:link:](chrome/chrome.d.ts) [Chrome extension development](http://developer.chrome.com/extensions) by [Matthew Kimber](https://github.com/matthewkimber), [otiai10](https://github.com/otiai10), [couven92](https://gitbus.com/couven92) * [:link:](chrome/chrome-app.d.ts) [Chrome packaged application development](http://developer.chrome.com/apps) by [Adam Lay](https://github.com/AdamLay), [MIZUNE Pine](https://github.com/pine613), [MIZUSHIMA Junki](https://github.com/mzsm) * [:link:](chui/chui.d.ts) [chui](https://github.com/chocolatechipui/chocolatechip-ui) by [Robert Biggs](http://chocolatechip-ui.com) * [:link:](circular-json/circular-json.d.ts) [circular-json](https://github.com/WebReflection/circular-json) by [Jonathan Pevarnek](https://github.com/jpevarnek) @@ -180,8 +198,9 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [: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:](cli-color/cli-color.d.ts) [cli-color](https://github.com/medikoo/cli-color) by [Joel Spadin](https://github.com/ChaosinaCan) * [:link:](clone/clone.d.ts) [clone](https://github.com/pvorb/node-clone) by [Kieran Simpson](https://github.com/kierans/DefinitelyTyped) -* [:link:](codemirror/codemirror-matchbrackets.d.ts) [CodeMirror](https://github.com/marijnh/CodeMirror) by [Sixin Li](https://github.com/sixinli) +* [: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.d.ts) [CodeMirror](https://github.com/marijnh/CodeMirror) by [mihailik](https://github.com/mihailik) * [:link:](codemirror/searchcursor.d.ts) [CodeMirror](https://github.com/marijnh/CodeMirror) by [jacqt](https://github.com/jacqt) * [:link:](coffeeify/coffeeify.d.ts) [coffeeify](https://github.com/jnordberg/coffeeify) by [Qubo](https://github.com/tkQubo) @@ -192,7 +211,9 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](compare-version/compare-version.d.ts) [compare-version](https://www.npmjs.com/package/compare-version) by [Jonathan Pevarnek](https://github.com/jpevarnek) * [:link:](compression/compression.d.ts) [compression](https://github.com/expressjs/compression) by [Santi Albo](https://github.com/santialbo) * [:link:](configstore/configstore.d.ts) [configstore](https://github.com/yeoman/configstore) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](connect/connect.d.ts) [connect](https://github.com/senchalabs/connect) by [Maxime LUCE](https://github.com/SomaticIT) * [:link:](connect-flash/connect-flash.d.ts) [connect-flash](https://github.com/jaredhanson/connect-flash) by [Andreas Gassmann](https://github.com/AndreasGassmann) +* [:link:](connect-livereload/connect-livereload.d.ts) [connect-livereload](https://github.com/intesso/connect-livereload) by [Maxime LUCE](https://github.com/SomaticIT) * [:link:](connect-modrewrite/connect-modrewrite.d.ts) [connect-modrewrite](https://github.com/tinganho/connect-modrewrite) by [Tingan Ho](https://github.com/tinganho) * [:link:](connect-mongo/connect-mongo.d.ts) [connect-mongo](https://github.com/kcbanner/connect-mongo) by [Mizuki Yamamoto](https://github.com/Syati) * [:link:](connect-slashes/connect-slashes.d.ts) [connect-slashes](https://github.com/avinoamr/connect-slashes) by [Sam Herrmann](https://github.com/samherrmann) @@ -214,12 +235,14 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](cors/cors.d.ts) [cors](https://github.com/troygoode/node-cors) by [Mihhail Lapushkin](https://github.com/mihhail-lapushkin) * [:link:](couchbase/couchbase.d.ts) [Couchbase Couchnode](https://github.com/couchbase/couchnode) by [Basarat Ali Syed](https://github.com/basarat) * [: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:](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) * [:link:](crypto-js/crypto-js.d.ts) [crypto-js](https://github.com/evanvosberg/crypto-js) by [Michael Zabka](https://github.com/misak113) * [:link:](cryptojs/cryptojs.d.ts) [CryptoJS](https://code.google.com/p/crypto-js) by [Gia Bảo @ Sân Đình](https://github.com/giabao) * [:link:](cson/cson.d.ts) [CSON](https://github.com/bevry/cson) by [Sam Saint-Pettersen](https://github.com/stpettersens) +* [:link:](css/css.d.ts) [css](https://github.com/reworkcss/css) by [Ilya Verbitskiy](https://github.com/ilich) * [:link:](googlemaps.infobubble/google.maps.infobubble.d.ts) [CSS3 InfoBubble with tabs for Google Maps API V3](http://google-maps-utility-library-v3.googlecode.com/svn/trunk/infobubble/src) by [Johan Nilsson](https://github.com/Dashue) * [:link:](csurf/csurf.d.ts) [csurf](https://www.npmjs.org/package/csurf) by [Hiroki Horiuchi](https://github.com/horiuchi) * [:link:](csv-stringify/csv-stringify.d.ts) [csv-stringify](https://github.com/wdavidw/node-csv-stringify) by [Rogier Schouten](https://github.com/rogierschouten) @@ -238,12 +261,15 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](dcjs/dc.d.ts) [DCJS](https://github.com/dc-js/dc.js) by [hans windhoff](https://github.com/hansrwindhoff), [matt traynham](https://github.com/mtraynham) * [:link:](debug/debug.d.ts) [debug](https://github.com/visionmedia/debug) by [Seon-Wook Park](https://github.com/swook) * [:link:](decimal.js/decimal.js.d.ts) [decimal.js](http://mikemcl.github.io/decimal.js) by [Joseph Rossi](http://github.com/musicist288) +* [:link:](decorum/decorum.d.ts) [Decorum JS](https://github.com/dflor003/decorum) by [Danil Flores](https://github.com/dflor003) * [:link:](deep-diff/deep-diff.d.ts) [deep-diff](https://github.com/flitbit/diff) by [ZauberNerd](https://github.com/ZauberNerd) * [:link:](deep-freeze/deep-freeze.d.ts) [deep-freeze](https://github.com/substack/deep-freeze) by [Bart van der Schoor](https://github.com/Bartvds) * [:link:](del/del.d.ts) [del](https://github.com/sindresorhus/del) by [Asana](https://asana.com) +* [:link:](denodeify/denodeify.d.ts) [denodeify](https://github.com/matthew-andrews/denodeify) by [joaomoreno](https://github.com/joaomoreno) +* [:link:](depd/depd.d.ts) [depd](https://github.com/dougwilson/nodejs-depd) by [Zhiyuan Wang](https://github.com/danny8002) * [:link:](deployJava/deployJava.d.ts) [deployJava.js](https://www.java.com/js/deployJava.txt) by [Cyril Schumacher](https://github.com/cyrilschumacher) * [:link:](detect-indent/detect-indent.d.ts) [detect-indent](https://github.com/sindresorhus/detect-indent) by [Bart van der Schoor](https://github.com/Bartvds) -* [:link:](devextreme/dx.devextreme.d.ts) [DevExtreme](http://js.devexpress.com) by [DevExpress Inc.](http://devexpress.com) +* [:link:](devextreme/devextreme.d.ts) [DevExtreme](http://js.devexpress.com) by [DevExpress Inc.](http://devexpress.com) * [:link:](dexie/dexie.d.ts) [Dexie](https://github.com/dfahlander/Dexie.js) by [David Fahlander](http://github.com/dfahlander) * [:link:](dhtmlxgantt/dhtmlxgantt.d.ts) [dhtmlxGantt](http://dhtmlx.com/docs/products/dhtmlxGantt) by [Maksim Kozhukh](http://github.com/mkozhukh) * [:link:](dhtmlxscheduler/dhtmlxscheduler.d.ts) [dhtmlxScheduler](http://dhtmlx.com/docs/products/dhtmlxScheduler) by [Maksim Kozhukh](http://github.com/mkozhukh) @@ -252,11 +278,13 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](diff-match-patch/diff-match-patch.d.ts) [diff-match-patch](https://www.npmjs.com/package/diff-match-patch) by [Asana](https://asana.com) * [:link:](docCookies/docCookies.d.ts) [docCookies](https://developer.mozilla.org/en-US/docs/Web/API/document.cookie) by [Jon Egerton](https://github.com/jonegerton) * [:link:](dock-spawn/dock-spawn.d.ts) [Dock Spawn](http://dockspawn.com) by [Drew Noakes](https://drewnoakes.com) +* [:link:](docopt/docopt.d.ts) [Docopt](http://docopt.org) by [Giovanni Bassi](https://github.com/giggio) * [:link:](documentdb/documentdb.d.ts) [DocumentDB](https://github.com/Azure/azure-documentdb-node) by [Noel Abrahams](https://github.com/NoelAbrahams), [Brett Gutstein](https://github.com/brettferdosi) * [:link:](documentdb-server/documentdb-server.d.ts) [DocumentDB server side JavaScript SDK](http://dl.windowsazure.com/documentDB/jsserverdocs) by [François Nguyen](https://github.com/lith-light-g) * [:link:](dojo/dojo.d.ts) [Dojo](http://dojotoolkit.org) by [Michael Van Sickle](https://github.com/vansimke) * [:link:](dompurify/dompurify.d.ts) [DOM Purify](https://github.com/cure53/DOMPurify) by [Dave Taylor](http://davetayls.me), [Samira Bazuzi](https://github.com/bazuzi) * [:link:](domo/domo.d.ts) [Domo](http://domo-js.com) by [Steve Fenton](https://github.com/Steve-Fenton) +* [:link:](requirejs-domready/domready.d.ts) [domReady](https://github.com/requirejs/domReady) by [Nobuhiro Nakamura](https://github.com/lefb766) * [:link:](domready/domready.d.ts) [domready](https://github.com/ded/domready) by [Christian Holm Nielsen](https://github.com/dotnetnerd) * [:link:](donna/donna.d.ts) [donna](https://github.com/atom/donna) by [vvakame](https://github.com/vvakame) * [:link:](dot/dot.d.ts) [doT](https://github.com/olado/doT) by [ZombieHunter](https://github.com/ZombieHunter) @@ -276,7 +304,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](easy-api-request/easy-api-request.d.ts) [easy-api-request](https://github.com/DeadAlready/easy-api-request) by [Karl Düüna](https://github.com/DeadAlready) * [:link:](easy-jsend/easy-jsend.d.ts) [easy-jsend](https://github.com/DeadAlready/easy-jsend) by [Karl Düüna](https://github.com/DeadAlready) * [:link:](easy-session/easy-session.d.ts) [easy-session](https://github.com/DeadAlready/node-easy-session) by [Karl Düüna](https://github.com/DeadAlready) -* [:link:](easy-table/easy-table.d.ts) [easy-table](https://github.com/eldargab/easy-table) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](easy-table/easy-table.d.ts) [easy-table](https://github.com/eldargab/easy-table) by [Niklas Mollenhauer](https://github.com/nikeee) * [:link:](easy-xapi-supertest/easy-xapi-supertest.d.ts) [easy-x-headers](https://github.com/DeadAlready/easy-x-headers) by [Karl Düüna](https://github.com/DeadAlready) * [:link:](easy-x-headers/easy-x-headers.d.ts) [easy-x-headers](https://github.com/DeadAlready/easy-x-headers) by [Karl Düüna](https://github.com/DeadAlready) * [:link:](easy-xapi/easy-xapi.d.ts) [easy-xapi](https://github.com/DeadAlready/easy-xapi) by [Karl Düüna](https://github.com/DeadAlready) @@ -287,6 +315,8 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [: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 (shared between main and rederer processes)](http://electron.atom.io) by [jedmao](https://github.com/jedmao) +* [: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-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:](element-resize-event/element-resize-event.d.ts) [element-resize-event](https://github.com/KyleAMathews/element-resize-event) by [Rogier Schouten](https://github.com/rogierschouten) * [:link:](elm/elm.d.ts) [Elm](http://elm-lang.org) by [Dénes Harmath](https://github.com/thSoft) @@ -315,6 +345,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [: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-debug/express-debug.d.ts) [express-debug](https://github.com/devoidfury/express-debug) by [Federico Bond](https://github.com/federicobond) +* [:link:](express-handlebars/express-handlebars.d.ts) [express-handlebars](https://github.com/ericf/express-handlebars) by [Sam Saint-Pettersen](https://github.com/stpettersens) * [:link:](express-jwt/express-jwt.d.ts) [express-jwt](https://www.npmjs.org/package/express-jwt) by [Wonshik Kim](https://github.com/wokim) * [:link:](express-less/express-less.d.ts) [express-less](https://www.npmjs.com/package/express-less) by [xyb](https://github.com/xieyubo) * [:link:](express-myconnection/express-myconnection.d.ts) [express-myconnection](https://www.npmjs.org/package/express-myconnection) by [Michael Ferris](https://github.com/Cellule) @@ -337,26 +368,31 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](favico.js/favico.js.d.ts) [favico.js](http://lab.ejci.net/favico.js) by [Yu Matsushita](https://github.com/drowse314-dev-ymat) * [:link:](featherlight/featherlight.d.ts) [Featherlight](https://noelboss.github.io/featherlight) by [Kaur Kuut](https://github.com/xStrom) * [:link:](whatwg-fetch/whatwg-fetch.d.ts) [fetch API](https://github.com/github/fetch) by [Ryan Graham](https://github.com/ryan-codingintrigue) -* [:link:](fhir/fhir.d.ts) [FHIR DSTU2](http://www.hl7.org/fhir/2015May/index.html) by [Artifact Health](www.artifacthealth.com) +* [:link:](fhir/fhir.d.ts) [FHIR DSTU2](http://www.hl7.org/fhir/2015Sep/index.html) by [Artifact Health](http://www.artifacthealth.com) * [:link:](fibers/fibers.d.ts) [fibers](https://github.com/laverdet/node-fibers) by [Carlos Ballesteros Velasco](https://github.com/soywiz) * [:link:](filewriter/filewriter.d.ts) [File API: Writer](http://www.w3.org/TR/file-writer-api) by [Kon](http://phyzkit.net) * [: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:](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) * [:link:](fingerprintjs/fingerprint.d.ts) [fingerprintjs](https://github.com/Valve/fingerprintjs) by [Shunsuke Ohtani](https://github.com/zaneli) * [:link:](state-machine/state-machine.d.ts) [Finite State Machine](https://github.com/jakesgordon/javascript-state-machine) by [Boris Yankov](https://github.com/borisyankov), [Maarten Docter](https://github.com/mdocter), [William Sears](https://github.com/MrBigDog2U) -* [:link:](firebase/firebase.d.ts) [Firebase API](https://www.firebase.com/docs/javascript/firebase) by [Vincent Botone](https://github.com/vbortone), [Shin1 Kashimura](https://github.com/in-async) +* [:link:](firebase/firebase.d.ts) [Firebase API](https://www.firebase.com/docs/javascript/firebase) by [Vincent Botone](https://github.com/vbortone), [Shin1 Kashimura](https://github.com/in-async), [Sebastien Dubois](https://github.com/dsebastien) * [:link:](firebase-client/firebase-client.d.ts) [Firebase Client](https://www.github.com/jpstevens/firebase-client) by [Andrew Breen](https://github.com/fpsscarecrow) * [:link:](firebase/firebase-simplelogin.d.ts) [Firebase Simple Login](https://www.firebase.com/docs/security/simple-login-overview.html) by [Wilker Lucio](http://github.com/wilkerlucio) * [:link:](first-mate/first-mate.d.ts) [first-mate](https://github.com/atom/first-mate) by [Vadim Macagon](https://github.com/enlight) +* [:link:](fixed-data-table/fixed-data-table.d.ts) [fixed-data-table](https://github.com/facebook/fixed-data-table) by [Petar Paar](https://github.com/pepaar) * [:link:](flake-idgen/flake-idgen.d.ts) [flakge-idgen](https://github.com/T-PWK/flake-idgen) by [Yuce Tekol](http://yuce.me) +* [:link:](flat/flat.d.ts) [flat](https://github.com/hughsk/flat) by [Ilya Mochalov](https://github.com/chrootsu) * [:link:](flexSlider/flexSlider.d.ts) [FlexSlider 2 jquery plugin](https://github.com/woothemes/FlexSlider) by [Diullei Gomes](https://github.com/diullei) * [:link:](flight/flight.d.ts) [Flight](http://flightjs.github.com/flight) by [Jonathan Hedrén](https://github.com/jonathanhedren) * [:link:](flipsnap/flipsnap.d.ts) [flipsnap.js](http://pxgrid.github.io/js-flipsnap) by [kubosho](https://github.com/kubosho), [gsino](https://github.com/gsino), [Mayuki Sawatari](https://github.com/mayuki) * [:link:](flot/jquery.flot.d.ts) [Flot](http://www.flotcharts.org) by [Matt Burland](https://github.com/burlandm) * [:link:](flowjs/flowjs.d.ts) [flowjs](https://github.com/flowjs/flow.js) by [Ryan McNamara](https://github.com/ryan10132) * [:link:](flux/flux.d.ts) [Flux](http://facebook.github.io/flux) by [Steve Baker](https://github.com/stkb) +* [:link:](flux-standard-action/flux-standard-action.d.ts) [flux-standard-action](https://github.com/acdlite/flux-standard-action) by [Qubo](https://github.com/tkqubo) * [:link:](fluxxor/fluxxor.d.ts) [Fluxxor](https://github.com/BinaryMuse/fluxxor) by [Yuichi Murata](https://github.com/mrk21) * [:link:](fontoxml/fontoxml.d.ts) [FontoXML](http://www.fontoxml.com) by [Roland Zwaga](https://github.com/rolandzwaga) * [:link:](ion.rangeSlider/ion.rangeSlider.d.ts) [for Ion.RangeSlider](https://github.com/IonDen/ion.rangeSlider) by [Sixin Li](https://github.com/sixinli) @@ -391,12 +427,40 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](gldatepicker/gldatepicker.d.ts) [glDatePicker](http://glad.github.com/glDatePicker) by [Dániel Tar](https://github.com/qcz) * [:link:](glidejs/glidejs.d.ts) [Glide.js](http://glide.jedrzejchalubek.com) by [Milan Jaros](https://github.com/milanjaros) * [:link:](glob/glob.d.ts) [Glob](https://github.com/isaacs/node-glob) by [vvakame](https://github.com/vvakame) +* [:link:](glob-expand/glob-expand.d.ts) [glob-expand](https://github.com/anodynos/node-glob-expand) by [vvakame](https://github.com/vvakame) * [:link:](glob-stream/glob-stream.d.ts) [glob-stream](http://github.com/wearefractal/glob-stream) by [Bart van der Schoor](https://github.com/Bartvds) * [:link:](globalize/globalize.d.ts) [Globalize](https://github.com/jquery/globalize) by [Aram Taieb](https://github.com/afromogli) * [:link:](gm/gm.d.ts) [gm](https://github.com/aheckmann/gm) by [Joel Spadin](https://github.com/ChaosinaCan) * [: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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.contacts.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) @@ -410,15 +474,16 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](google.visualization/google.visualization.d.ts) [Google Visualisation Apis](https://developers.google.com/chart) by [Dan Ludwig](https://github.com/danludwig) * [: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) -* [:link:](graphviz/graphviz.d.ts) [Graphviz](git://github.com/glejeune/node-graphviz.git) by [Matt Frantz](https://github.com/mhfrantz) +* [:link:](graham_scan/graham_scan.d.ts) [graham_scan](https://github.com/brian3kb/graham_scan_js) by [Harm Berntsen](https://github.com/hberntsen) +* [:link:](graphviz/graphviz.d.ts) [Graphviz](https://github.com/glejeune/node-graphviz) by [Matt Frantz](https://github.com/mhfrantz) * [: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/TweenLite.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/Ease.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) * [:link:](gulp-cached/gulp-cached.d.ts) [gulp-cached](https://github.com/wearefractal/gulp-cached) by [Thomas Corbière](https://github.com/tomc974) @@ -428,7 +493,6 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](gulp-coffeelint/gulp-coffeelint.d.ts) [gulp-coffeelint](https://github.com/janraasch/gulp-coffeelint) by [Qubo](https://github.com/tkQubo) * [:link:](gulp-concat/gulp-concat.d.ts) [gulp-concat](http://github.com/wearefractal/gulp-concat) by [Keita Kagurazaka](https://github.com/k-kagurazaka) * [:link:](gulp-csso/gulp-csso.d.ts) [gulp-csso](https://github.com/ben-eb/gulp-csso) by [Tanguy Krotoff](https://github.com/tkrotoff) -* [:link:](gulp-rev/gulp-rev.d.ts) [gulp-csso](https://github.com/sindresorhus/gulp-rev) by [Tanguy Krotoff](https://github.com/tkrotoff) * [:link:](gulp-debug/gulp-debug.d.ts) [gulp-debug](https://github.com/sindresorhus/gulp-debug) by [Tanguy Krotoff](https://github.com/tkrotoff) * [:link:](gulp-dtsm/gulp-dtsm.d.ts) [gulp-dtsm](https://github.com/9joneg/gulp-dtsm) by [Aya Morisawa](https://github.com/AyaMorisawa) * [:link:](gulp-espower/gulp-espower.d.ts) [gulp-espower](https://github.com/power-assert-js/gulp-espower) by [Qubo](https://github.com/tkQubo) @@ -453,6 +517,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](gulp-remember/gulp-remember.d.ts) [gulp-remember](https://github.com/ahaurw01/gulp-remember) by [Thomas Corbière](https://github.com/tomc974) * [:link:](gulp-rename/gulp-rename.d.ts) [gulp-rename](https://github.com/hparra/gulp-rename) by [Asana](https://asana.com) * [:link:](gulp-replace/gulp-replace.d.ts) [gulp-replace](https://github.com/lazd/gulp-replace) by [Asana](https://asana.com) +* [:link:](gulp-rev/gulp-rev.d.ts) [gulp-rev](https://github.com/sindresorhus/gulp-rev) by [Tanguy Krotoff](https://github.com/tkrotoff) * [:link:](gulp-rev-replace/gulp-rev-replace.d.ts) [gulp-rev-replace](https://github.com/jamesknelson/gulp-rev-replace) by [Tanguy Krotoff](https://github.com/tkrotoff) * [:link:](gulp-ruby-sass/gulp-ruby-sass.d.ts) [gulp-ruby-sass](https://github.com/sindresorhus/gulp-ruby-sass) by [Agnislav Onufrijchuk](https://github.com/agnislav) * [:link:](gulp-sass/gulp-sass.d.ts) [gulp-sass](https://github.com/dlmanning/gulp-sass) by [Asana](https://asana.com) @@ -481,7 +546,8 @@ 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:](highcharts/highcharts.d.ts) [Highcharts](http://www.highcharts.com) by [Damiano Gambarotto](http://github.com/damianog) +* [:link:](helmet/helmet.d.ts) [helmet](https://github.com/helmetjs/helmet) by [Cyril Schumacher](https://github.com/cyrilschumacher) +* [: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) * [:link:](highlightjs/highlightjs.d.ts) [highlight.js](https://github.com/isagalaev/highlight.js) by [Niklas Mollenhauer](https://github.com/nikeee), [Jeremy Hull](https://github.com/sourrust) @@ -489,11 +555,11 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](history/history.d.ts) [History.js](https://github.com/browserstate/history.js) by [Boris Yankov](https://github.com/borisyankov), [Gidon Junge](https://github.com/gjunge) * [: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-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:](htmlparser2/htmlparser2.d.ts) [htmlparser2 v3.7.x](https://github.com/fb55/htmlparser2) by [James Roland Cabresos](https://github.com/staticfunction) * [:link:](htmltojsx/htmltojsx.d.ts) [htmltojsx](https://www.npmjs.com/package/htmltojsx) by [Basarat Ali Syed](https://github.com/basarat) * [:link:](http-errors/http-errors.d.ts) [http-errors](https://github.com/jshttp/http-errors) by [Tanguy Krotoff](https://github.com/tkrotoff) -* [:link:](statuses/statuses.d.ts) [http-errors](https://github.com/jshttp/statuses) by [Tanguy Krotoff](https://github.com/tkrotoff) * [:link:](http-status/http-status.d.ts) [http-status](https://github.com/wdavidw/node-http-status) by [Michael Zabka](https://github.com/misak113) * [:link:](http-string-parser/http-string-parser.d.ts) [http-string-parser](https://github.com/apiaryio/http-string-parser) by [MIZUNE Pine](https://github.com/pine613) * [:link:](httperr/httperr.d.ts) [httperr](https://github.com/pluma/httperr) by [Troy Gerwien](https://github.com/yortus) @@ -513,10 +579,13 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](incremental-dom/incremental-dom.d.ts) [Incremetal DOM](https://github.com/google/incremental-dom) by [Basarat Ali Syed](https://github.com/basarat) * [:link:](inflection/inflection.d.ts) [inflection](https://github.com/dreamerslab/node.inflection) by [Shogo Iwano](https://github.com/shiwano) * [:link:](ini/ini.d.ts) [ini](https://github.com/isaacs/ini) by [Marcin Porębski](https://github.com/marcinporebski) +* [:link:](iniparser/iniparser.d.ts) [iniparser](https://github.com/shockie/node-iniparser) by [Ilya Mochalov](https://github.com/chrootsu) +* [:link:](inline-css/inline-css.d.ts) [inline-css](https://github.com/jonkemp/inline-css) by [Philip Spain](https://github.com/philipisapain) * [:link:](inquirer/inquirer.d.ts) [Inquirer.js](https://github.com/SBoudrias/Inquirer.js) by [Qubo](https://github.com/tkQubo) * [:link:](insight/insight.d.ts) [insight](https://github.com/yeoman/insight) by [vvakame](http://github.com/vvakame) * [:link:](interactjs/interact.d.ts) [Interacting for interact.js](https://github.com/taye/interact.js) by [Douglas Eichelberger](https://github.com/dduugg), [Adi Dahiya](https://github.com/adidahiya), [Tom Hasner](https://github.com/thasner) * [:link:](intercomjs/intercom.d.ts) [intercom.js](https://github.com/diy/intercom.js) by [spencerwi](http://github.com/spencerwi) +* [:link:](intro.js/intro.js.d.ts) [intro.js](https://github.com/usablica/intro.js) by [Maxime Fabre](https://github.com/anahkiasen) * [: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) @@ -607,7 +676,9 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](jquery.fancytree/jquery.fancytree.d.ts) [jquery.fancytree](https://github.com/mar10/fancytree) by [Peter Palotas](https://github.com/alphaleonis) * [:link:](jquery.finger/jquery.finger.d.ts) [jquery.finger.js](http://ngryman.sh/jquery.finger) by [Max Ackley](https://github.com/maxackley) * [:link:](jquery.form/jquery.form.d.ts) [jQuery.form.js 3.26.0](http://malsup.com/jquery/form) by [François Guillot](http://fguillot.developpez.com) +* [:link:](jquery.fullscreen/jquery.fullscreen.d.ts) [jquery.fullscreen](https://github.com/private-face/jquery.fullscreen) by [Piraveen Kamalathas](https://github.com/piraveen) * [:link:](jquery.gridster/gridster.d.ts) [jQuery.gridster](https://github.com/jbaldwin/gridster) by [Josh Baldwin](https://github.com/jbaldwin) +* [:link:](jquery.highlight-bartaz/jquery.highlight-bartaz.d.ts) [jquery.highlight.js](https://github.com/bartaz/sandbox.js/blob/master/jquery.highlight.js) by [Stefan Profanter](https://github.com/Pro) * [:link:](jquery.jnotify/jquery.jnotify.d.ts) [jQuery.jNotify](http://jnotify.codeplex.com) by [James Curran](https://github.com/jamescurran) * [:link:](jquery.jsignature/jquery.jsignature.d.ts) [jQuery.jsignature v2](https://github.com/willowsystems/jSignature) by [Patrick Magee](https://github.com/pjmagee) * [:link:](jquery-jsonrpcclient/jquery-jsonrpcclient.d.ts) [jquery.jsonrpc](https://github.com/Textalk/jquery.jsonrpcclient.js) by [Maksim Karelov](https://github.com/Ty3uK) @@ -616,7 +687,9 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](jquery.pjax.falsandtru/jquery.pjax.d.ts) [jquery.pjax.ts by falsandtru](https://github.com/falsandtru/jquery.pjax.js) by [新ゝ月 NewNotMoon](http://new.not-moon.net) * [:link:](jquery.placeholder/jquery.placeholder.d.ts) [jquery.placeholder.js](https://github.com/mathiasbynens/jquery-placeholder) by [Peter Gill](https://github.com/majorsilence), [Neil Culver](https://github.com/EnableSoftware) * [:link:](jquery.pnotify/jquery.pnotify.d.ts) [jquery.pnotify 2.x](https://github.com/sciactive/pnotify) by [David Sichau](https://github.com/DavidSichau) +* [:link:](jquery.qrcode/jquery.qrcode.d.ts) [jQuery.qrcode](https://github.com/lrsjng/jquery-qrcode) by [Dan Manastireanu](https://github.com/danmana) * [:link:](jquery.scrollTo/jquery.scrollTo.d.ts) [jQuery.scrollTo.js](https://github.com/flesler/jquery.scrollTo) by [Neil Stalker](https://github.com/nestalk) +* [:link:](form-serializer/form-serializer.d.ts) [jquery.serialize-object](https://github.com/macek/jquery-serialize-object) by [Florian Wagner](https://github.com/flqw) * [:link:](jquery.simulate/jquery.simulate.d.ts) [jquery.simulate.js](https://github.com/jquery/jquery-simulate) by [Derek Cicerone](https://github.com/derekcicerone) * [:link:](jquery.slimScroll/jquery.slimScroll.d.ts) [jQuery.slimScroll](https://github.com/rochal/jQuery-slimScroll) by [Chintan Shah](https://github.com/Promact) * [:link:](jquery.soap/jquery.soap.d.ts) [jQuery.SOAP](https://github.com/doedje/jquery.soap) by [Roland Greim](https://github.com/tigerxy) @@ -631,8 +704,8 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](jquery.total-storage/jquery.total-storage.d.ts) [jQueryTotalStorage](https://github.com/Upstatement/jquery-total-storage) by [Jeremy Brooks](https://github.com/JeremyCBrooks) * [:link:](jqueryui/jqueryui.d.ts) [jQueryUI](http://jqueryui.com) by [Boris Yankov](https://github.com/borisyankov), [John Reilly](https://github.com/johnnyreilly) * [:link:](js-beautify/js-beautify.d.ts) [js_beautify](https://github.com/beautify-web/js-beautify) by [Josh Goldberg](https://github.com/JoshuaKGoldberg) -* [:link:](ua-parser-js/ua-parser-js.d.ts) [js-cookie](https://github.com/faisalman/ua-parser-js) by [Viktor Miroshnikov](https://github.com/superduper) * [:link:](js-cookie/js-cookie.d.ts) [js-cookie](https://github.com/js-cookie/js-cookie) by [Theodore Brown](https://github.com/theodorejb) +* [:link:](ua-parser-js/ua-parser-js.d.ts) [js-cookie](https://github.com/faisalman/ua-parser-js) by [Viktor Miroshnikov](https://github.com/superduper) * [:link:](js-fixtures/fixtures.d.ts) [js-fixtures](https://github.com/badunk/js-fixtures) by [Kazi Manzur Rashid](https://github.com/kazimanzurrashid) * [:link:](js-git/js-git.d.ts) [js-git](https://github.com/creationix/js-git) by [Bart van der Schoor](https://github.com/Bartvds) * [:link:](js-md5/md5.d.ts) [js-md5](https://github.com/emn178/js-md5) by [Roland Greim](https://github.com/tigerxy) @@ -651,6 +724,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](jshamcrest/jshamcrest.d.ts) [JsHamcrest](https://github.com/danielfm/jshamcrest) by [David Harkness](https://github.com/dharkness) * [:link:](hashset/hashset.d.ts) [jshashset](http://www.timdown.co.uk/jshashtable/jshashset.html) by [Sergey Gerasimov](https://github.com/gerich-home) * [:link:](hashtable/hashtable.d.ts) [jshashtable](http://www.timdown.co.uk/jshashtable) by [Sergey Gerasimov](https://github.com/gerich-home) +* [:link:](jsnlog/jsnlog.d.ts) [JSNLog](https://github.com/mperdeck/jsnlog.js) by [Mattijs Perdeck](https://github.com/mperdeck) * [: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) @@ -665,7 +739,8 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](jssha/jssha.d.ts) [jsSHA](https://github.com/Caligatio/jsSHA) by [David Li](https://github.com/randombk) * [:link:](jstorage/jstorage.d.ts) [jStorage](http://www.jstorage.info) by [Danil Flores](https://github.com/dflor003) * [:link:](jstree/jstree.d.ts) [jsTree](http://www.jstree.com) by [Adam Pluciński](https://github.com/adaskothebeast) -* [:link:](jsuri/jsuri.d.ts) [jsUri](https://github.com/derek-watson/jsUri) by [Chris Charabaruk](http://github.com/coldacid) +* [: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:](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) @@ -679,6 +754,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](keyboardjs/keyboardjs.d.ts) [KeyboardJS](https://github.com/RobertWHurst/KeyboardJS) by [Vincent Bortone](https://github.com/vbortone) * [:link:](keymaster/keymaster.d.ts) [keymaster](https://github.com/madrobby/keymaster) by [Martin W. Kirst](https://github.com/nitram509) * [:link:](keypress/keypress.d.ts) [Keypress](https://github.com/dmauro/Keypress) by [Roger Chen](https://github.com/rcchen) +* [:link:](kii-cloud-sdk/kii-cloud-sdk.d.ts) [Kii Cloud SDK](http://en.kii.com) by [Kii Consortium](http://jp.kii.com/consortium) * [:link:](kineticjs/kineticjs.d.ts) [KineticJS](http://kineticjs.com) by [Basarat Ali Syed](http://www.github.com/basarat), [Ralph de Ruijter](http://www.superdopey.nl/techblog) * [:link:](knex/knex.d.ts) [Knex.js](https://github.com/tgriesser/knex) by [Qubo](https://github.com/tkQubo) * [:link:](knockback/knockback.d.ts) [Knockback.js](http://kmalakoff.github.io/knockback) by [Boris Yankov](https://github.com/borisyankov) @@ -709,6 +785,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](later/later.d.ts) [LaterJS](http://bunkat.github.io/later) by [Jason D Dryhurst-Smith](http://jasonds.co.uk) * [: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-editable/leaflet-editable.d.ts) [Leaflet.Editable](https://github.com/yohanboniface/Leaflet.Editable) by [Dominic Alie](https://github.com/dalie) * [:link:](leaflet/leaflet.d.ts) [Leaflet.js](https://github.com/Leaflet/Leaflet) by [Vladimir Zotov](https://github.com/rgripper) * [:link:](leaflet-label/leaflet-label.d.ts) [Leaflet.label](https://github.com/Leaflet/Leaflet.label) by [Wim Looman](https://github.com/Nemo157) * [:link:](jquery.leanModal/jquery.leanModal.d.ts) [leanModal.js](http://leanmodal.finelysliced.com.au) by [FinelySliced](https://github.com/FinelySliced) @@ -718,9 +795,11 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](level-sublevel/level-sublevel.d.ts) [level-sublevel](https://github.com/dominictarr/level-sublevel) by [Bas Pennings](https://github.com/basp) * [:link:](levelup/levelup.d.ts) [LevelUp](https://github.com/rvagg/node-levelup) by [Bret Little](https://github.com/blittle) * [:link:](libxmljs/libxmljs.d.ts) [Libxmljs](https://github.com/polotek/libxmljs) by [François de Campredon](https://github.com/fdecampredon) +* [:link:](line-reader/line-reader.d.ts) [line-reader](https://github.com/nickewing/line-reader) by [Sam Saint-Pettersen](https://github.com/stpettersens) * [:link:](dustjs-linkedin/dustjs-linkedin.d.ts) [linkedin dustjs](https://github.com/linkedin/dustjs) by [Marcelo Dezem](http://github.com/mdezem) * [:link:](linq/linq.jquery.d.ts) [linq.jquery (from linq.js)](http://linqjs.codeplex.com) by [neuecc](http://www.codeplex.com/site/users/view/neuecc) * [:link:](linq/linq.d.ts) [linq.js](http://linqjs.codeplex.com) by [Marcin Najder](https://github.com/marcinnajder), [Sebastiaan Dammann](https://github.com/Sebazzz) +* [:link:](linqsharp/linqsharp.d.ts) [linqsharp](https://www.npmjs.com/package/linqsharp) by [Bruno Leonardo Michels](https://github.com/brunolm) * [:link:](jquery.livestampjs/jquery.livestampjs.d.ts) [Livestamp.js](http://mattbradley.github.com/livestampjs) by [Vincent Bortone](https://github.com/vbortone) * [:link:](lodash/lodash.d.ts) [Lo-Dash](http://lodash.com) by [Brian Zengel](https://github.com/bczengel), [Ilya Mochalov](https://github.com/chrootsu) * [:link:](lockfile/lockfile.d.ts) [lockfile](https://github.com/isaacs/lockfile) by [Bart van der Schoor](https://github.com/Bartvds) @@ -729,7 +808,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) +* [: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:](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) @@ -760,12 +839,14 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](markerclustererplus/markerclustererplus.d.ts) [MarkerClustererPlus for Google Maps V3](http://github.com/mahnunchik/markerclustererplus) by [Mathias Rodriguez](http://github.com/enanox) * [:link:](markitup/markitup.d.ts) [markitup 1.x](https://github.com/markitup/1.x) by [drillbits](https://github.com/drillbits) * [:link:](maskedinput/maskedinput.d.ts) [Masked Input plugin for jQuery](http://digitalbush.com/projects/masked-input-plugin) by [Lokesh Peta](https://github.com/lokeshpeta) -* [:link:](material-ui/material-ui.d.ts) [material-ui](https://github.com/callemall/material-ui) by [Nathan Brown](https://github.com/ngbrown) +* [:link:](material-ui/material-ui.d.ts) [material-ui](https://github.com/callemall/material-ui) by [Nathan Brown](https://github.com/ngbrown), [Oliver Herrmann](https://github.com/herrmanno) * [:link:](mathjax/mathjax.d.ts) [MathJax](https://github.com/mathjax/MathJax) by [Roland Zwaga](https://github.com/rolandzwaga) +* [:link:](mathjs/mathjs.d.ts) [mathjs](http://mathjs.org) by [Ilya Shestakov](https://github.com/siavol) * [:link:](matter-js/matter-js.d.ts) [Matter.js](https://github.com/liabru/matter-js) by [Ivane Gegia](https://twitter.com/ivanegegia) * [:link:](mCustomScrollbar/mCustomScrollbar.d.ts) [mCustomScrollbar](https://github.com/malihu/malihu-custom-scrollbar-plugin) by [Sarah Williams](https://github.com/flurg) * [:link:](memory-cache/memory-cache.d.ts) [memory-cache](http://github.com/ptarjan/node-cache) by [Jeff Goddard](https://github.com/jedigo) * [:link:](mendixmodelsdk/mendixmodelsdk.d.ts) [mendixmodelsdk](http://www.mendix.com) by [Mendix](https://github.com/mendix) +* [:link:](merge-descriptors/merge-descriptors.d.ts) [merge-descriptors](https://github.com/component/merge-descriptors) by [Zhiyuan Wang](https://github.com/danny8002) * [:link:](merge-stream/merge-stream.d.ts) [merge-stream](https://github.com/grncdr/merge-stream) by [Keita Kagurazaka](https://github.com/k-kagurazaka) * [:link:](merge2/merge2.d.ts) [merge2](https://github.com/teambition/merge2) by [Tanguy Krotoff](https://github.com/tkrotoff) * [:link:](meshblu/meshblu.d.ts) [meshblu.js](https://github.com/octoblu/meshblu-npm) by [Felipe Nipo](https://github.com/fnipo) @@ -790,6 +871,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](bingmaps/Microsoft.Maps.Traffic.d.ts) [Microsoft.Maps.Traffic](http://msdn.microsoft.com/en-us/library/hh312840.aspx) by [Eric Todd](https://github.com/ericrtodd) * [:link:](bingmaps/Microsoft.Maps.VenueMaps.d.ts) [Microsoft.Maps.VenueMaps](http://msdn.microsoft.com/en-us/library/hh312797.aspx) by [Eric Todd](https://github.com/ericrtodd) * [:link:](milkcocoa/milkcocoa.d.ts) [Milkcocoa](https://mlkcca.com) by [odangosan](https://github.com/odangosan) +* [:link:](milliseconds/milliseconds.d.ts) [milliseconds](http://npmjs.com/milliseconds) by [Elmar Burke](github.com/elmarburke) * [:link:](mime/mime.d.ts) [mime](https://github.com/broofa/node-mime) by [Jeff Goddard](https://github.com/jedigo) * [:link:](minilog/minilog.d.ts) [minilog v2](https://github.com/mixu/minilog) by [Guido](http://guido.io) * [:link:](minimatch/minimatch.d.ts) [Minimatch](https://github.com/isaacs/minimatch) by [vvakame](https://github.com/vvakame) @@ -800,8 +882,8 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](mkdirp/mkdirp.d.ts) [mkdirp](http://github.com/substack/node-mkdirp) by [Bart van der Schoor](https://github.com/Bartvds) * [:link:](mkpath/mkpath.d.ts) [mkpath](https://www.npmjs.com/package/mkpath) by [Jared Klopper](https://github.com/optical) * [: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/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:](mobservable/mobservable.d.ts) [mobservable](https://mweststrate.github.io/mobservable) by [Michel Weststrate](https://github.com/mweststrate) * [: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/mocha-node.d.ts) [mocha](http://mochajs.org) by [Vadim Macagon](https://github.com/enlight), [vvakame](https://github.com/vvakame) * [:link:](mocha-phantomjs/mocha-phantomjs.d.ts) [mocha-phantomjs](http://metaskills.net/mocha-phantomjs) by [Erik Schierboom](https://github.com/ErikSchierboom) @@ -809,8 +891,8 @@ 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) * [:link:](moment-timezone/moment-timezone.d.ts) [moment-timezone.js](http://momentjs.com/timezone) by [Michel Salib](https://github.com/michelsalib) -* [: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) * [: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) * [: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) by [Boris Yankov](https://github.com/borisyankov) * [:link:](mongoose/mongoose.d.ts) [Mongoose](http://mongoosejs.com) by [horiuchi](https://github.com/horiuchi) @@ -822,6 +904,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](firefox/firefox.d.ts) [Mozilla Web API](https://developer.mozilla.org/en-US/docs/Web/API) by [vvakame](https://github.com/vvakame) * [:link:](localForage/localForage.d.ts) [Mozilla's localForage](https://github.com/mozilla/localforage) by [yuichi david pichsenmeister](https://github.com/3x14159265) * [:link:](mpromise/mpromise.d.ts) [mpromise](https://github.com/aheckmann/mpromise) by [Seulgi Kim](https://github.com/sgkim126) +* [:link:](ms/ms.d.ts) [ms](https://github.com/guille/ms.js) by [Zhiyuan Wang](https://github.com/danny8002) * [: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) @@ -842,6 +925,19 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [: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) +* [:link:](ngbootbox/ngbootbox.d.ts) [ngbootbox](https://github.com/eriktufvesson/ngBootbox) by [Sam Saint-Pettersen](https://github.com/stpettersens) +* [:link:](ng-cordova/appAvailability.d.ts) [ngCordova AppAvailability plugin](https://github.com/driftyco/ng-cordova) by [Kapil Sachdeva](https://github.com/ksachdeva) +* [:link:](ng-cordova/datepicker.d.ts) [ngCordova datepicker plugin](https://github.com/VitaliiBlagodir/cordova-plugin-datepicker) by [Jacques Kang](https://www.linkedin.com/in/jacqueskang) +* [:link:](ng-cordova/app-version.d.ts) [ngCordova datepicker plugin](https://github.com/driftyco/ng-cordova) by [Jacques Kang](https://www.linkedin.com/in/jacqueskang) +* [:link:](ng-cordova/deviceMotion.d.ts) [ngCordova device motion plugin](https://github.com/driftyco/ng-cordova) by [Michel Vidailhet](https://github.com/mvidailhet), [Kapil Sachdeva](https://github.com/ksachdeva) +* [:link:](ng-cordova/deviceOrientation.d.ts) [ngCordova device orientation plugin](https://github.com/driftyco/ng-cordova) by [Michel Vidailhet](https://github.com/mvidailhet), [Kapil Sachdeva](https://github.com/ksachdeva) +* [:link:](ng-cordova/device.d.ts) [ngCordova device plugin](https://github.com/driftyco/ng-cordova) by [Kapil Sachdeva](https://github.com/ksachdeva) +* [:link:](ng-cordova/dialogs.d.ts) [ngCordova dialogs plugin](https://github.com/driftyco/ng-cordova) by [Michel Vidailhet](https://github.com/mvidailhet), [Kapil Sachdeva](https://github.com/ksachdeva) +* [:link:](ng-cordova/emailComposer.d.ts) [ngCordova emailComposer plugin](https://github.com/driftyco/ng-cordova) by [Kapil Sachdeva](https://github.com/ksachdeva) +* [:link:](ng-cordova/geolocation.d.ts) [ngCordova geolocation plugin](https://github.com/driftyco/ng-cordova) by [Kapil Sachdeva](https://github.com/ksachdeva) +* [:link:](ng-cordova/network.d.ts) [ngCordova network plugin](https://github.com/driftyco/ng-cordova) by [Kapil Sachdeva](https://github.com/ksachdeva) +* [:link:](ng-cordova/tsd.d.ts) [ngCordova plugins](https://github.com/driftyco/ng-cordova) by [Kapil Sachdeva](https://github.com/ksachdeva) +* [:link:](ng-cordova/toast.d.ts) [ngCordova toast plugin](https://github.com/driftyco/ng-cordova) by [Kapil Sachdeva](https://github.com/ksachdeva) * [:link:](ng-dialog/ng-dialog.d.ts) [ngDialog](https://github.com/likeastore/ngDialog) by [Stephen Lautier](https://github.com/stephenlautier) * [:link:](ngkookies/ngkookies.d.ts) [ngKookes](https://github.com/voronianski/ngKookies) by [Martin McWhorter](https://github.com/martinmcwhorter) * [:link:](ngprogress/ngprogress.d.ts) [ngProgress](http://victorbjelkholm.github.io/ngProgress) by [Martin McWhorter](https://github.com/martinmcwhorter) @@ -855,6 +951,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](mdns/mdns.d.ts) [node_mdns](https://github.com/agnat/node_mdns) by [Stefan Steinhart](https://github.com/reppners) * [:link:](node_redis/node_redis.d.ts) [node_redis](https://github.com/mranney/node_redis) by [Boris Yankov](https://github.com/borisyankov) * [:link:](apn/apn.d.ts) [node-apn](https://github.com/argon/node-apn) by [Zenorbi](https://github.com/zenorbi) +* [:link:](node-array-ext/node-array-ext.d.ts) [node-array-ext](https://github.com/Beng89/node-array-ext) by [Ben Goltz](https://github.com/Beng89) * [:link:](bunyan/bunyan.d.ts) [node-bunyan](https://github.com/trentm/node-bunyan) by [Alex Mikhalev](https://github.com/amikhalev) * [:link:](bunyan-logentries/bunyan-logentries.d.ts) [node-bunyan-logentries](https://github.com/nemtsov/node-bunyan-logentries) by [Aymeric Beaumet](http://aymericbeaumet.me) * [:link:](node-cache/node-cache.d.ts) [node-cache](https://github.com/tcs-de/nodecache) by [Ilya Mochalov](https://github.com/chrootsu) @@ -881,17 +978,18 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](radius/radius.d.ts) [node-radius](https://github.com/retailnext/node-radius) by [Peter Harris](https://github.com/codeanimal) * [: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:](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-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-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) -* [:link:](node/node.d.ts) [Node.js](http://nodejs.org) by [Microsoft TypeScript](http://typescriptlang.org), [DefinitelyTyped](https://github.com/borisyankov/DefinitelyTyped) * [:link:](_debugger/_debugger.d.ts) [Node.js debugger API](http://nodejs.org) by [Basarat Ali Syed](https://github.com/basarat) * [:link:](restify/restify.d.ts) [node.js REST framework](https://github.com/mcavage/node-restify) by [Bret Little](https://github.com/blittle) +* [:link:](node/node.d.ts) [Node.js v4.x](http://nodejs.org) by [Microsoft TypeScript](http://typescriptlang.org), [DefinitelyTyped](https://github.com/borisyankov/DefinitelyTyped) * [:link:](each/each.d.ts) [NodeEach](http://www.adaltas.com/projects/node-each) by [Michael Zabka](https://github.com/misak113) * [:link:](nodemailer/nodemailer.d.ts) [Nodemailer](https://github.com/andris9/Nodemailer) by [Rogier Schouten](https://github.com/rogierschouten) * [:link:](nodemailer/nodemailer-types.d.ts) [Nodemailer](https://github.com/andris9/Nodemailer) by [Rogier Schouten](https://github.com/rogierschouten) @@ -920,10 +1018,12 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](observe-js/observe-js.d.ts) [observe-js](https://github.com/Polymer/observe-js) by [Oliver Herrmann](https://github.com/herrmanno) * [:link:](oclazyload/oclazyload.d.ts) [oc.LazyLoad](https://github.com/ocombe/ocLazyLoad) by [Roland Zwaga](https://github.com/rolandzwaga) * [:link:](angular-odata-resources/angular-odata-resources.d.ts) [OData Angular Resources](https://github.com/devnixs/ODataAngularResources) by [Raphael ATALLAH](http://raphael.atallah.me) +* [:link:](office-js/office-js.d.ts) [Office.js](http://dev.office.com) by [OfficeDev](https://github.com/OfficeDev) * [:link:](offline-js/offline-js.d.ts) [Offline](https://github.com/HubSpot/offline) by [Chris Wrench](https://github.com/cgwrench) * [:link:](on-finished/on-finished.d.ts) [on-finished](https://github.com/jshttp/on-finished) by [Honza Dvorsky](http://github.com/czechboy0) * [:link:](onsenui/onsenui.d.ts) [Onsen UI](http://onsen.io) by [Fran Dios](https://github.com/frankdiox) * [:link:](open/open.d.ts) [open](https://github.com/jjrdn/node-open) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](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) * [:link:](opn/opn.d.ts) [opn](https://github.com/sindresorhus/opn) by [Shinnosuke Watanabe](https://github.com/shinnn) @@ -941,9 +1041,9 @@ 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-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-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-local/passport-local.d.ts) [passport-local](https://github.com/jaredhanson/passport-local) by [Maxime LUCE](https://github.com/SomaticIT) * [:link:](path-case/path-case.d.ts) [path-case](https://github.com/blakeembrey/path-case) by [Sam Saint-Pettersen](https://github.com/stpettersens) @@ -970,15 +1070,17 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](physijs/physijs.d.ts) [Physijs](http://chandlerprall.github.io/Physijs) by [Satoru Kimura](https://github.com/gyohk) * [:link:](pickadate/pickadate.d.ts) [pickadate.js](https://github.com/amsul/pickadate.js) by [Theodore Brown](https://github.com/theodorejb) * [:link:](pikaday/pikaday.d.ts) [pikaday](https://github.com/dbushell/Pikaday) by [Rudolph Gottesheim](http://midnight-design.at) +* [:link:](pinkyswear/pinkyswear.d.ts) [PinkySwear](https://github.com/timjansen/PinkySwear.js) by [Chance Snow](https://github.com/chances) * [:link:](piwik-tracker/piwik-tracker.d.ts) [PiwikTracker](https://www.npmjs.com/package/piwik-tracker) by [Guilherme Bernal](https://github.com/lbguilherme) * [:link:](pixi-spine/pixi-spine.d.ts) [pixi-spine](https://github.com/pixijs/pixi-spine) by [martijncroezen](https://github.com/pixijs/pixi-typescript) -* [:link:](pixi.js/pixi.js.d.ts) [Pixi.js](https://github.com/GoodBoyDigital/pixi.js) by [clark-stevenson](https://github.com/pixijs/pixi-typescript) +* [:link:](pixi.js/pixi.js.d.ts) [Pixi.js 3.0.9 dev](https://github.com/GoodBoyDigital/pixi.js) by [clark-stevenson](https://github.com/pixijs/pixi-typescript) * [:link:](platform/platform.d.ts) [Platform](https://github.com/bestiejs/platform.js) by [Jake Hickman](https://github.com/JakeH) * [:link:](playerframework/playerFramework.d.ts) [Player Framework (MMPPF)](https://playerframework.codeplex.com) by [Ricardo Sabino](https://github.com/ricardosabino) * [:link:](pleasejs/please.d.ts) [PleaseJS](http://www.checkman.io/please) by [Toshiya Nakakura](https://github.com/nakakura) * [:link:](plottable/plottable.d.ts) [Plottable](http://plottablejs.org) by [Plottable Team](https://github.com/palantir/plottable) * [:link:](pluralize/pluralize.d.ts) [pluralize](https://www.npmjs.com/package/pluralize) by [Syu Kato](https://github.com/ukyo) * [:link:](png-async/png-async.d.ts) [png-async](https://github.com/kanreisa/node-png-async) by [Yuki KAN](https://github.com/kanreisa) +* [:link:](pngjs2/pngjs2.d.ts) [pngjs2](https://www.npmjs.com/package/pngjs2) by [Elisée Maurer](https://sparklinlabs.com) * [:link:](podcast/podcast.d.ts) [podcast](http://github.com/maxnowack/node-podcast) by [Niklas Mollenhauer](https://github.com/nikeee) * [:link:](poly2tri/poly2tri.d.ts) [poly2tri](http://github.com/r3mi/poly2tri.js) by [Elemar Junior](https://github.com/elemarjr) * [:link:](polyline/polyline.d.ts) [Polyline](https://github.com/mapbox/polyline) by [Arseniy Maximov](https://github.com/Kern0) @@ -1021,14 +1123,30 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](raygun4js/raygun4js.d.ts) [raygun4js](https://github.com/MindscapeHQ/raygun4js) by [Brian Surowiec](https://github.com/xt0rted) * [:link:](react/react.d.ts) [React](http://facebook.github.io/react) by [Asana](https://asana.com), [AssureSign](http://www.assuresign.com), [Microsoft](https://microsoft.com) * [:link:](react/react-global.d.ts) [React (namespace)](http://facebook.github.io/react) by [Asana](https://asana.com), [AssureSign](http://www.assuresign.com), [Microsoft](https://microsoft.com) +* [:link:](react/react-addons-create-fragment.d.ts) [React (react-addons-create-fragment)](http://facebook.github.io/react) by [Asana](https://asana.com), [AssureSign](http://www.assuresign.com), [Microsoft](https://microsoft.com) +* [:link:](react/react-addons-shallow-compare.d.ts) [React (react-addons-css-transition-group)](http://facebook.github.io/react) by [Asana](https://asana.com), [AssureSign](http://www.assuresign.com), [Microsoft](https://microsoft.com) +* [:link:](react/react-addons-css-transition-group.d.ts) [React (react-addons-css-transition-group)](http://facebook.github.io/react) by [Asana](https://asana.com), [AssureSign](http://www.assuresign.com), [Microsoft](https://microsoft.com) +* [:link:](react/react-addons-linked-state-mixin.d.ts) [React (react-addons-linked-state-mixin)](http://facebook.github.io/react) by [Asana](https://asana.com), [AssureSign](http://www.assuresign.com), [Microsoft](https://microsoft.com) +* [:link:](react/react-addons-perf.d.ts) [React (react-addons-perf)](http://facebook.github.io/react) by [Asana](https://asana.com), [AssureSign](http://www.assuresign.com), [Microsoft](https://microsoft.com) +* [:link:](react/react-addons-pure-render-mixin.d.ts) [React (react-addons-pure-render-mixin)](http://facebook.github.io/react) by [Asana](https://asana.com), [AssureSign](http://www.assuresign.com), [Microsoft](https://microsoft.com) +* [:link:](react/react-addons-test-utils.d.ts) [React (react-addons-test-utils)](http://facebook.github.io/react) by [Asana](https://asana.com), [AssureSign](http://www.assuresign.com), [Microsoft](https://microsoft.com) +* [:link:](react/react-addons-transition-group.d.ts) [React (react-addons-transition-group)](http://facebook.github.io/react) by [Asana](https://asana.com), [AssureSign](http://www.assuresign.com), [Microsoft](https://microsoft.com) +* [:link:](react/react-addons-update.d.ts) [React (react-addons-update)](http://facebook.github.io/react) by [Asana](https://asana.com), [AssureSign](http://www.assuresign.com), [Microsoft](https://microsoft.com) +* [:link:](react/react-dom.d.ts) [React (react-dom)](http://facebook.github.io/react) by [Asana](https://asana.com), [AssureSign](http://www.assuresign.com), [Microsoft](https://microsoft.com) * [:link:](react-dnd/react-dnd.d.ts) [React DnD](https://github.com/gaearon/react-dnd) by [Asana](https://asana.com) * [:link:](react-router/react-router.d.ts) [React Router](https://github.com/rackt/react-router) by [Yuichi Murata](https://github.com/mrk21), [Václav Ostrožlík](https://github.com/vasek17) * [:link:](react-bootstrap/react-bootstrap.d.ts) [react-bootstrap](https://github.com/react-bootstrap/react-bootstrap) by [Walker Burgin](https://github.com/walkerburgin) +* [: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) +* [: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-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-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:](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:](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) @@ -1043,9 +1161,10 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](ref-array/ref-array.d.ts) [ref-array](https://github.com/TooTallNate/ref-array) by [Paul Loyd](https://github.com/loyd) * [:link:](ref-struct/ref-struct.d.ts) [ref-struct](https://github.com/TooTallNate/ref-struct) by [Paul Loyd](https://github.com/loyd) * [:link:](ref-union/ref-union.d.ts) [ref-union](https://github.com/TooTallNate/ref-union) by [Paul Loyd](https://github.com/loyd) -* [:link:](request/request.d.ts) [request](https://github.com/mikeal/request) by [Carlos Ballesteros Velasco](https://github.com/soywiz), [bonnici](https://github.com/bonnici), [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](reflux/reflux.d.ts) [RefluxJS](https://github.com/reflux/refluxjs) by [Maurice de Beijer](https://github.com/mauricedb) +* [:link:](request/request.d.ts) [request](https://github.com/mikeal/request) by [Carlos Ballesteros Velasco](https://github.com/soywiz), [bonnici](https://github.com/bonnici), [Bart van der Schoor](https://github.com/Bartvds), [Joe Skeen](http://github.com/joeskeen) * [:link:](request-ip/request-ip.d.ts) [request-ip](https://github.com/pbojinov/request-ip) by [Adam Babcock](https://github.com/mrhen) -* [:link:](request-promise/request-promise.d.ts) [request-promise](https://www.npmjs.com/package/request-promise) by [Christopher Glantschnig](https://github.com/cglantschnig) +* [:link:](request-promise/request-promise.d.ts) [request-promise](https://www.npmjs.com/package/request-promise) by [Christopher Glantschnig](https://github.com/cglantschnig), [Joe Skeen](http://github.com/joeskeen) * [:link:](requirejs/require.d.ts) [RequireJS](http://requirejs.org) by [Josh Baldwin](https://github.com/jbaldwin) * [:link:](resemblejs/resemblejs.d.ts) [Resemble.js](http://huddle.github.io/Resemble.js) by [Tim Perry](https://github.com/pimterry) * [:link:](response-time/response-time.d.ts) [response-time](https://github.com/expressjs/response-time) by [Uros Smolnik](https://github.com/urossmolnik) @@ -1057,10 +1176,12 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](reveal/reveal.d.ts) [Reveal](https://github.com/hakimel/reveal.js) by [grapswiz](https://github.com/grapswiz) * [:link:](rickshaw/rickshaw.d.ts) [Rickshaw](http://code.shutterstock.com/rickshaw) by [Blake Niemyjski](https://github.com/niemyjski) * [:link:](rimraf/rimraf.d.ts) [rimraf](https://github.com/isaacs/rimraf) by [Carlos Ballesteros Velasco](https://github.com/soywiz) +* [:link:](riot-games-api/riot-games-api.d.ts) [Riot Games API](https://developer.riotgames.com) by [Xavier Stouder](https://github.com/xstoudi) * [:link:](riotjs/riotjs.d.ts) [riot.js](https://github.com/moot/riotjs) by [vvakame](https://github.com/vvakame) * [:link:](riotcontrol/riotcontrol.d.ts) [RiotControl](https://github.com/jimsparkman/RiotControl) by [Ilya Mochalov](https://github.com/chrootsu) * [:link:](rivets/rivets.d.ts) [rivets](http://rivetsjs.com) by [Trevor Baron](https://github.com/TrevorDev) * [:link:](rosie/rosie.d.ts) [rosie](https://github.com/rosiejs/rosie) by [Abner Oliveira](https://github.com/abner) +* [:link:](roslib/roslib.d.ts) [roslib.js](http://wiki.ros.org/roslibjs) by [Stefan Profanter](https://github.com/Pro) * [:link:](route-recognizer/route-recognizer.d.ts) [route-recognizer](https://github.com/tildeio/route-recognizer) by [Dave Keen](http://www.keendevelopment.ch) * [:link:](routie/routie.d.ts) [routie](https://github.com/jgallen23/routie) by [Adilson](https://github.com/Adilson) * [:link:](rsmq/rsmq.d.ts) [rsmq](http://smrchy.github.io/rsmq) by [Qubo](https://github.com/MugeSo) @@ -1088,6 +1209,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](sanitizer/sanitizer.d.ts) [Sanitizer](https://github.com/theSmaw/Caja-HTML-Sanitizer) by [Dave Taylor](http://davetayls.me) * [:link:](satnav/satnav.d.ts) [satnav](https://github.com/f5io/satnav-js) by [Christian Holm Diget](https://github.com/DotNetNerd) * [:link:](sax/sax.d.ts) [sax js](https://github.com/isaacs/sax-js) by [Asana](https://asana.com) +* [:link:](scalike/scalike.d.ts) [scalike API](https://github.com/ryoppy/scalike-typescript) by [ryoppy](https://github.com/ryoppy) * [:link:](screenfull/screenfull.d.ts) [screenfull.js](https://github.com/sindresorhus/screenfull.js) by [Ilia Choly](http://github.com/icholy) * [:link:](scrolltofixed/scrolltofixed.d.ts) [ScrollToFixed](https://github.com/bigspotteddog/ScrollToFixed) by [Ben Dixon](https://github.com/bmdixon) * [:link:](seedrandom/seedrandom.d.ts) [seedrandom](https://github.com/davidbau/seedrandom) by [Kern Handa](https://github.com/kernhanda) @@ -1102,11 +1224,11 @@ 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:](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:](on-headers/on-headers.d.ts) [serve-favicon](https://github.com/jshttp/on-headers) by [John Jeffery](https://github.com/jjeffery) * [:link:](serve-static/serve-static.d.ts) [serve-static](https://github.com/expressjs/serve-static) by [Uros Smolnik](https://github.com/urossmolnik) * [:link:](sharedworker/SharedWorker.d.ts) [SharedWorker](http://www.w3.org/TR/workers) by [Toshiya Nakakura](https://github.com/nakakura) -* [:link:](sharepoint/SharePoint.d.ts) [SharePoint 2010 and 2013](http://sptypescript.codeplex.com) by [Stanislav Vyshchepan](http://blog.gandjustas.ru), [Andrey Markeev](http://markeev.com) +* [:link:](sharepoint/SharePoint.d.ts) [SharePoint 2010 and 2013](https://github.com/gandjustas/sptypescript) by [Stanislav Vyshchepan](http://blog.gandjustas.ru), [Andrey Markeev](http://markeev.com) * [:link:](shelljs/shelljs.d.ts) [ShellJS](http://shelljs.org) by [Niklas Mollenhauer](https://github.com/nikeee) * [:link:](shortid/shortid.d.ts) [shortid](https://github.com/dylang/shortid) by [Sam Saint-Pettersen](https://github.com/stpettersens) * [:link:](should-promised/should-promised.d.ts) [should-promised](https://github.com/shouldjs/promised) by [Yaroslav Admin](https://github.com/devoto13) @@ -1119,7 +1241,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](simple-cw-node/simple-cw-node.d.ts) [simple-cw-node](https://github.com/astronaughts/simple-cw-node) by [vvakame](https://github.com/vvakame) * [:link:](simplebar/simplebar.d.ts) [simplebar.js](https://github.com/Grsmto/simplebar) by [Gregor Woiwode](https://github.com/gregonnet) * [:link:](jquery.simplemodal/jquery.simplemodal.d.ts) [SimpleModal](http://www.ericmmartin.com/projects/simplemodal) by [Friedrich von Never](https://github.com/ForNeVeR) -* [:link:](simpleStorage/simplestorage.js.d.ts) [simpleStorage](https://github.com/andris9/simpleStorage) by [Áxel Costas Pena](https://github.com/axelcostaspena) +* [:link:](simplestorage.js/simplestorage.js.d.ts) [simpleStorage](https://github.com/andris9/simpleStorage) by [Áxel Costas Pena](https://github.com/axelcostaspena) * [:link:](sinon/sinon.d.ts) [Sinon](http://sinonjs.org) by [William Sears](https://github.com/mrbigdog2u) * [:link:](sinon-chai/sinon-chai.d.ts) [sinon-chai](https://github.com/domenic/sinon-chai) by [Kazi Manzur Rashid](https://github.com/kazimanzurrashid), [Jed Mao](https://github.com/jedmao) * [:link:](sinon-chrome/sinon-chrome.d.ts) [Sinon-Chrome](https://github.com/vitalets/sinon-chrome) by [Tim Perry](https://github.com/pimterry) @@ -1140,6 +1262,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](sockjs/sockjs.d.ts) [SockJS 0.3.x](https://github.com/sockjs/sockjs-client) by [Emil Ivanov](https://github.com/vladev) * [:link:](sockjs-client/sockjs-client.d.ts) [sockjs-client](https://github.com/sockjs/sockjs-client) by [Emil Ivanov](https://github.com/vladev), [Alexander Rusakov](https://github.com/arusakov) * [:link:](sockjs-node/sockjs-node.d.ts) [sockjs-node 0.3.x](https://github.com/sockjs/sockjs-node) by [Phil McCloghry-Laing](https://github.com/pmccloghrylaing) +* [:link:](sortablejs/sortablejs.d.ts) [Sortable.js](https://github.com/RubaXa/Sortable) by [Maw-Fox](http://github.com/Maw-Fox) * [:link:](soundjs/soundjs.d.ts) [SoundJS](http://www.createjs.com/#!/SoundJS) by [Pedro Ferreira](https://bitbucket.org/drk4) * [:link:](source-map/source-map.d.ts) [source-map](https://github.com/mozilla/source-map) by [Morten Houston Ludvigsen](https://github.com/MortenHoustonLudvigsen) * [:link:](source-map-support/source-map-support.d.ts) [source-map-support](https://github.com/evanw/source-map-support) by [Bart van der Schoor](https://github.com/Bartvds) @@ -1160,6 +1283,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](stats/stats.d.ts) [Stats.js r12](http://github.com/mrdoob/stats.js) by [Gregory Dalton](https://github.com/gregolai) * [:link:](statsd-client/statsd-client.d.ts) [statsd-client](https://github.com/msiebuhr/node-statsd-client) by [Peter Kooijmans](https://github.com/peterkooijmans) * [:link:](status-bar/status-bar.d.ts) [status-bar](https://github.com/atom/status-bar) by [vvakame](https://github.com/vvakame) +* [:link:](statuses/statuses.d.ts) [statuses](https://github.com/jshttp/statuses) by [Tanguy Krotoff](https://github.com/tkrotoff) * [:link:](steam/steam.d.ts) [steam](https://github.com/seishun/node-steam) by [Andrey Kurdyumov](https://github.com/kant2002) * [:link:](storejs/storejs.d.ts) [store.js](https://github.com/marcuswestin/store.js) by [Vincent Bortone](https://github.com/vbortone) * [:link:](stream-series/stream-series.d.ts) [stream-series](https://github.com/rschmukler/stream-series) by [Keita Kagurazaka](https://github.com/k-kagurazaka) @@ -1175,6 +1299,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](sugar/sugar.d.ts) [Sugar](http://sugarjs.com) by [Josh Baldwin](https://github.com/jbaldwin) * [:link:](superagent/superagent.d.ts) [SuperAgent](https://github.com/visionmedia/superagent) by [Alex Varju](https://github.com/varju) * [:link:](supertest/supertest.d.ts) [SuperTest](https://github.com/visionmedia/supertest) by [Alex Varju](https://github.com/varju) +* [:link:](svg-injector/svg-injector.d.ts) [SVG Injector](https://github.com/iconic/SVGInjector) by [Patrick Westerhoff](https://github.com/poke) * [:link:](svg-pan-zoom/svg-pan-zoom.d.ts) [svg-pan-zoom](https://github.com/ariutta/svg-pan-zoom) by [Chintan Shah](https://github.com/Promact) * [:link:](svg-sprite/svg-sprite.d.ts) [svg-sprite](https://github.com/jkphl/svg-sprite) by [Qubo](https://github.com/tkqubo) * [:link:](svgjs/svgjs.d.ts) [svg.js](http://www.svgjs.com) by [Sean Hess](https://seanhess.github.io) @@ -1202,16 +1327,19 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](tedious/tedious.d.ts) [tedious](https://pekim.github.io/tedious) by [Rogier Schouten](https://github.com/rogierschouten) * [:link:](tedious-connection-pool/tedious-connection-pool.d.ts) [tedious-connection-pool](https://github.com/pekim/tedious-connection-pool) by [Cyprien Autexier](https://github.com/sandorfr) * [:link:](teechart/teechart.d.ts) [TeeChart](http://www.steema.com) by [Steema Software](https://steema.com) +* [:link:](temp-fs/temp-fs.d.ts) [temp-fs](https://github.com/jakwings/node-temp-fs) by [MEDIA CHECK s.r.o.](http://www.mediacheck.cz) * [:link:](tether/tether.d.ts) [Tether](http://github.hubspot.com/tether) by [Adi Dahiya](https://github.com/adidahiya) * [:link:](tether-shepherd/tether-shepherd.d.ts) [Tether-Shepherd](http://github.hubspot.com/shepherd) by [Matt Gibbs](https://github.com/mtgibbs) * [: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:](github-electron/github-electron-main.d.ts) [the Electron 0.25.2 main process](http://electron.atom.io) by [jedmao](https://github.com/jedmao) * [:link:](github-electron/github-electron-renderer.d.ts) [the Electron 0.25.2 renderer process (web page)](http://electron.atom.io) by [jedmao](https://github.com/jedmao) +* [: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) * [:link:](threejs/three-copyshader.d.ts) [three.js (CopyShader.js)](https://github.com/mrdoob/three.js/blob/r68/examples/js/shaders/CopyShader.js) by [Satoru Kimura](https://github.com/gyohk) * [:link:](threejs/three-css3drenderer.d.ts) [three.js (CSS3DRenderer.js)](https://github.com/mrdoob/three.js/blob/master/examples/js/renderers/CSS3DRenderer.js) by [Satoru Kimura](https://github.com/gyohk) * [:link:](threejs/detector.d.ts) [three.js (Detector.js)](https://github.com/mrdoob/three.js/blob/master/examples/js/Detector.js) by [Satoru Kimura](https://github.com/gyohk) +* [:link:](threejs/three-editorcontrols.d.ts) [three.js (EditorControls.js)](https://github.com/mrdoob/three.js/blob/master/examples/js/controls/EditorControls.js) by [Qinsi ZHU](https://github.com/qszhusightp) * [:link:](threejs/three-effectcomposer.d.ts) [three.js (EffectComposer.js)](https://github.com/mrdoob/three.js/blob/r68/examples/js/postprocessing/EffectComposer.js) by [Satoru Kimura](https://github.com/gyohk) * [:link:](threejs/three-maskpass.d.ts) [three.js (MaskPass.js)](https://github.com/mrdoob/three.js/blob/r68/examples/js/postprocessing/MaskPass.js) by [Satoru Kimura](https://github.com/gyohk) * [:link:](threejs/three-orbitcontrols.d.ts) [three.js (OrbitControls.js)](https://github.com/mrdoob/three.js/blob/master/examples/js/controls/OrbitControls.js) by [Satoru Kimura](https://github.com/gyohk) @@ -1222,7 +1350,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 r71](http://mrdoob.github.com/three.js) by [Kon](http://phyzkit.net), [Satoru Kimura](https://github.com/gyohk) +* [: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:](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) @@ -1254,14 +1382,15 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [: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-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:](typescript-services/typescriptServices.d.ts) [TypeScript-Services](https://www.npmjs.org/package/typescript-services) by [Basarat Ali Syed](http://github.com/basarat) -* [:link:](unity-webapi/unity-webapi.d.ts) [Ubuntu Unity Web API](https://launchpad.net/libunity-webapps) by [John Vrbanac](jhttps://github.com/jmvrbanac) +* [:link:](unity-webapi/unity-webapi.d.ts) [Ubuntu Unity Web API](https://launchpad.net/libunity-webapps) by [John Vrbanac](https://github.com/jmvrbanac) * [:link:](ui-grid/ui-grid.d.ts) [ui-grid](http://www.ui-grid.info) by [Ben Tesser](https://github.com/btesser), [Joe Skeen](http://github.com/joeskeen) * [: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:](umbraco/umbraco-resources.d.ts) [Umbraco](https://github.com/umbraco) by [DeCareSystemsIreland](https://github.com/DeCareSystemsIreland) +* [:link:](uikit/uikit.d.ts) [uikit](http://getuikit.org) by [Giovanni Silva](https://github.com/giovannicandido) * [:link:](umbraco/umbraco.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:](underscore/underscore.d.ts) [Underscore](http://underscorejs.org) by [Boris Yankov](https://github.com/borisyankov), [Josh Baldwin](https://github.com/jbaldwin) * [:link:](underscore-ko/underscore-ko.d.ts) [Underscore-ko 1.2.2 with underscore](https://github.com/kamranayub/UnderscoreKO) by [Maurits Elbers](https://github.com/MagicMau) @@ -1282,6 +1411,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](urlrouter/urlrouter.d.ts) [urlrouter](https://github.com/fengmk2/urlrouter) by [soywiz](https://github.com/soywiz) * [:link:](urlsafe-base64/urlsafe-base64.d.ts) [urlsafe-base64](https://github.com/RGBboy/urlsafe-base64) by [Tanguy Krotoff](https://github.com/tkrotoff) * [:link:](usage/usage.d.ts) [usage](https://github.com/arunoda/node-usage) by [Pascal Vomhoff](https://github.com/pvomhoff) +* [:link:](utils-merge/utils-merge.d.ts) [utils-merge](https://github.com/jaredhanson/utils-merge) by [Ilya Mochalov](https://github.com/chrootsu) * [:link:](UUID/UUID.d.ts) [UUID.js core](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) @@ -1299,6 +1429,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](vinyl-source-stream/vinyl-source-stream.d.ts) [vinyl-source-stream](https://github.com/hughsk/vinyl-source-stream) by [Asana](https://asana.com) * [:link:](virtual-dom/virtual-dom.d.ts) [virtual-dom](https://github.com/Matt-Esch/virtual-dom) by [Christopher Brown](https://github.com/chbrown) * [:link:](vortex-web-client/vortex-web-client.d.ts) [Vortex Web 1.2.0p1](http://www.prismtech.com/vortex/vortex-web) by [Stefan Profanter](https://github.com/Pro) +* [:link:](voximplant-websdk/voximplant-websdk.d.ts) [VoxImplant Web SDK 3.0.x](http://voximplant.com) by [Alexey Aylarov](https://github.com/aylarov) * [:link:](vso-node-api/vso-node-api.d.ts) [vso-node-api](https://github.com/Microsoft/vso-node-api) by [Teddy Ward](https://github.com/teddyward) * [:link:](vue/vue.d.ts) [vuejs](https://github.com/yyx990803/vue) by [odangosan](https://github.com/odangosan) * [:link:](watch/watch.d.ts) [watch](https://github.com/mikeal/watch) by [Carlos Ballesteros Velasco](https://github.com/soywiz) @@ -1307,7 +1438,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](webmidi/webmidi.d.ts) [Web MIDI API](http://www.w3.org/TR/webmidi) by [Toshiya Nakakura](https://github.com/nakakura) * [:link:](webspeechapi/webspeechapi.d.ts) [Web Speech API](https://dvcs.w3.org/hg/speech-api/raw-file/tip/speechapi.html) by [SaschaNaz](https://github.com/saschanaz) * [:link:](webcl/webcl.d.ts) [WebCL](https://www.khronos.org/registry/webcl/specs/1.0.0) by [Ralph Brown](https://github.com/NCARalph) -* [:link:](webcola/webcola.d.ts) [webcola](https://github.com/tgdwyer/WebCola) by [Qinfeng Chen](https://github.com/qinfchen) +* [:link:](webcola/webcola.d.ts) [webcola](https://github.com/tgdwyer/WebCola) by [Qinfeng Chen](https://github.com/qinfchen), [Tim Dwyer](https://github.com/tgdwyer), [Noah Chen](https://github.com/nchen63) * [:link:](webcomponents.js/webcomponents.js.d.ts) [webcomponents.js](https://github.com/webcomponents/webcomponentsjs) by [Adi Dahiya](https://github.com/adidahiya) * [:link:](webcrypto/WebCrypto.d.ts) [WebCrypto](http://www.w3.org/TR/WebCryptoAPI) by [Lucas Dixon](https://github.com/iislucas) * [:link:](webgl-ext/webgl-ext.d.ts) [WebGL Extensions](http://webgl.org) by [Arthur Langereis](https://github.com/zenmumbler) @@ -1336,7 +1467,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](xml-parser/xml-parser.d.ts) [xml-parser](https://github.com/segmentio/xml-parser) by [Matt Frantz](https://github.com/mhfrantz) * [:link:](xmlbuilder/xmlbuilder.d.ts) [xmlbuilder](https://github.com/oozcitak/xmlbuilder-js) by [Wallymathieu](http://github.com/wallymathieu) * [:link:](xpath/xpath.d.ts) [xpath](https://github.com/goto100/xpath) by [Andrew Bradley](https://github.com/cspotcode) -* [:link:](xregexp/xregexp.d.ts) [XRegExp](http://xregexp.com) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](xregexp/xregexp.d.ts) [XRegExp](http://xregexp.com) by [Bart van der Schoor](https://github.com/Bartvds), [Johannes Fahrenkrug](https://github.com/jfahrenkrug) * [:link:](xsockets/XSockets.d.ts) [XSockets.NET](http://xsockets.net) by [Jeffery Grajkowski](https://github.com/pushplay) * [:link:](xss-filters/xss-filters.d.ts) [Yahoo XSS Filters](https://github.com/yahoo/xss-filters) by [Dave Taylor](http://davetayls.me) * [:link:](yamljs/yamljs.d.ts) [yamljs](https://github.com/jeremyfa/yaml.js) by [Tim Jonischkat](http://www.tim-jonischkat.de) @@ -1348,10 +1479,12 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](gapi.youtubeAnalytics/gapi.youtubeAnalytics.d.ts) [YouTube Analytics API](https://developers.google.com/youtube/analytics) by [Frank M](https://github.com/sgtfrankieboy) * [:link:](gapi.youtube/gapi.youtube.d.ts) [YouTube Data API v3](https://developers.google.com/youtube/v3) by [Frank M](https://github.com/sgtfrankieboy) * [:link:](yui/yui.d.ts) [yui](https://github.com/yui/yui3) by [Gia Bảo @ Sân Đình](https://github.com/giabao) +* [:link:](z-schema/z-schema.d.ts) [z-schema](https://github.com/zaggino/z-schema) by [Adam Meadows](https://github.com/job13er) * [:link:](zepto/zepto.d.ts) [Zepto](http://zeptojs.com) by [Josh Baldwin](https://github.com/jbaldwin) * [:link:](zeroclipboard/zeroclipboard.d.ts) [ZeroClipboard](https://github.com/jonrohan/ZeroClipboard) by [Eric J. Smith](https://github.com/ejsmith), [Blake Niemyjski](https://github.com/niemyjski), [György Balássy](https://github.com/balassy) * [:link:](node_zeromq/zmq.d.ts) [ZeroMQ Node](https://github.com/JustinTulloss/zeromq.node) by [Dave McKeown](http://github.com/davemckeown) * [:link:](zip.js/zip.js.d.ts) [zip.js 2.x](https://github.com/gildas-lormeau/zip.js) by [Louis Grignon](https://github.com/lgrignon) +* [:link:](zone.js/zone.js.d.ts) [Zone.js](https://github.com/angular/zone.js) by [angular team](https://github.com/angular) * [:link:](scroller/easyscroller.d.ts) [Zynga EasyScroller](https://github.com/zynga/scroller) by [Boris Yankov](https://github.com/borisyankov) * [:link:](scroller/scroller.d.ts) [Zynga Scroller](https://github.com/zynga/scroller) by [Boris Yankov](https://github.com/borisyankov) * [:link:](zynga-scroller/zynga-scroller.d.ts) [Zynga Scroller](http://zynga.github.com/scroller) by [Marcelo Haskell Camargo](https://github.com/haskellcamargo) diff --git a/abs/abs-tests.ts b/abs/abs-tests.ts new file mode 100644 index 000000000..80f52f8ff --- /dev/null +++ b/abs/abs-tests.ts @@ -0,0 +1,5 @@ +/// + +import Abs from 'abs'; + +const x: string = Abs('/foo'); diff --git a/abs/abs.d.ts b/abs/abs.d.ts new file mode 100644 index 000000000..58a533528 --- /dev/null +++ b/abs/abs.d.ts @@ -0,0 +1,14 @@ +// Type definitions for abs 1.1.0 +// Project: https://github.com/IonicaBizau/node-abs +// Definitions by: Aya Morisawa +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare module "abs" { + /** + * Compute the absolute path of an input. + * @param input The input path. + */ + function Abs(input: string): string; + + export default Abs; +} diff --git a/absolute/absolute-tests.ts b/absolute/absolute-tests.ts new file mode 100644 index 000000000..5c2514450 --- /dev/null +++ b/absolute/absolute-tests.ts @@ -0,0 +1,5 @@ +/// + +import absolute from 'absolute'; + +const x: boolean = absolute('/home/foo'); diff --git a/absolute/absolute.d.ts b/absolute/absolute.d.ts new file mode 100644 index 000000000..c0e8e9bd6 --- /dev/null +++ b/absolute/absolute.d.ts @@ -0,0 +1,13 @@ +// Type definitions for absolute 0.0.1 +// Project: https://github.com/bahamas10/node-absolute +// Definitions by: Aya Morisawa +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare module "absolute" { + /** + * Test if a path is absolute + */ + function absolute(path: string): boolean; + + export default absolute; +} diff --git a/ace/ace.d.ts b/ace/ace.d.ts index bedcfee54..8fed295f2 100644 --- a/ace/ace.d.ts +++ b/ace/ace.d.ts @@ -25,17 +25,17 @@ declare module AceAjax { export interface CommandManager { - byName; + byName: any; - commands; + commands: any; platform: string; - addCommands(commands:EditorCommand[]); + addCommands(commands:EditorCommand[]): void; - addCommand(command:EditorCommand); + addCommand(command:EditorCommand): void; - exec(name: string, editor: Editor, args: any); + exec(name: string, editor: Editor, args: any): void; } export interface Annotation { @@ -63,19 +63,19 @@ declare module AceAjax { export interface KeyBinding { - setDefaultHandler(kb); + setDefaultHandler(kb: any): void; - setKeyboardHandler(kb); + setKeyboardHandler(kb: any): void; - addKeyboardHandler(kb, pos); + addKeyboardHandler(kb: any, pos: any): void; - removeKeyboardHandler(kb): boolean; + removeKeyboardHandler(kb: any): boolean; getKeyboardHandler(): any; - onCommandKey(e, hashId, keyCode); + onCommandKey(e: any, hashId: any, keyCode: any): void; - onTextInput(text); + onTextInput(text: any): void; } var KeyBinding: { new(editor: Editor): KeyBinding; @@ -85,19 +85,19 @@ declare module AceAjax { getTokenizer(): any; - toggleCommentLines(state, doc, startRow, endRow); + toggleCommentLines(state: any, doc: any, startRow: any, endRow: any): void; - getNextLineIndent (state, line, tab): string; + getNextLineIndent (state: any, line: any, tab: any): string; - checkOutdent(state, line, input): boolean; + checkOutdent(state: any, line: any, input: any): boolean; - autoOutdent(state, doc, row); + autoOutdent(state: any, doc: any, row: any): void; - createWorker(session): any; + createWorker(session: any): any; - createModeDelegates (mapping); + createModeDelegates (mapping: any): void; - transformAction(state, action, editor, session, param): any; + transformAction(state: any, action: any, editor: any, session: any, param: any): any; } //////////////// @@ -151,7 +151,7 @@ declare module AceAjax { **/ export interface Anchor { - on(event: string, fn: (e) => any); + on(event: string, fn: (e: any) => any): void; /** * Returns an object identifying the `row` and `column` position of the current anchor. @@ -171,7 +171,7 @@ declare module AceAjax { * - `old`: An object describing the old Anchor position * - `value`: An object describing the new Anchor position **/ - onChange(e: any); + onChange(e: any): void; /** * Sets the anchor position to the specified row and column. If `noClip` is `true`, the position is not clipped. @@ -179,12 +179,12 @@ declare module AceAjax { * @param column The column index to move the anchor to * @param noClip Identifies if you want the position to be clipped **/ - setPosition(row: number, column: number, noClip: boolean); + setPosition(row: number, column: number, noClip: boolean): void; /** * When called, the `'change'` event listener is removed. **/ - detach(); + detach(): void; } var Anchor: { /** @@ -212,31 +212,31 @@ declare module AceAjax { * Sets a new tokenizer for this object. * @param tokenizer The new tokenizer to use **/ - setTokenizer(tokenizer: Tokenizer); + setTokenizer(tokenizer: Tokenizer): void; /** * Sets a new document to associate with this object. * @param doc The new document to associate with **/ - setDocument(doc: Document); + setDocument(doc: Document): void; /** * Emits the `'update'` event. `firstRow` and `lastRow` are used to define the boundaries of the region to be updated. * @param firstRow The starting row region * @param lastRow The final row region **/ - fireUpdateEvent(firstRow: number, lastRow: number); + fireUpdateEvent(firstRow: number, lastRow: number): void; /** * Starts tokenizing at the row indicated. * @param startRow The row to start at **/ - start(startRow: number); + start(startRow: number): void; /** * Stops tokenizing. **/ - stop(); + stop(): void; /** * Gives list of tokens of the row. (tokens are cached) @@ -269,13 +269,13 @@ declare module AceAjax { **/ export interface Document { - on(event: string, fn: (e) => any); + on(event: string, fn: (e: any) => any): void; /** * Replaces all the lines in the current `Document` with the value of `text`. * @param text The text to use **/ - setValue(text: string); + setValue(text: string): void; /** * Returns all the lines in the document as a single string, split by the new line character. @@ -287,7 +287,7 @@ declare module AceAjax { * @param row The row number to use * @param column The column number to use **/ - createAnchor(row: number, column: number); + createAnchor(row: number, column: number): void; /** * Returns the newline character that's being used, depending on the value of `newLineMode`. @@ -298,7 +298,7 @@ declare module AceAjax { * [Sets the new line mode.]{: #Document.setNewLineMode.desc} * @param newLineMode [The newline mode to use; can be either `windows`, `unix`, or `auto`]{: #Document.setNewLineMode.param} **/ - setNewLineMode(newLineMode: string); + setNewLineMode(newLineMode: string): void; /** * [Returns the type of newlines being used; either `windows`, `unix`, or `auto`]{: #Document.getNewLineMode} @@ -392,7 +392,7 @@ declare module AceAjax { * Removes the new line between `row` and the row immediately following it. This method also triggers the `'change'` event. * @param row The row to check **/ - removeNewLine(row: number); + removeNewLine(row: number): void; /** * Replaces a range in the document with the new `text`. @@ -404,12 +404,12 @@ declare module AceAjax { /** * Applies all the changes previously accumulated. These can be either `'includeText'`, `'insertLines'`, `'removeText'`, and `'removeLines'`. **/ - applyDeltas(deltas: Delta[]); + applyDeltas(deltas: Delta[]): void; /** * Reverts any changes previously applied. These can be either `'includeText'`, `'insertLines'`, `'removeText'`, and `'removeLines'`. **/ - revertDeltas(deltas: Delta[]); + revertDeltas(deltas: Delta[]): void; /** * Converts an index position in a document to a `{row, column}` object. @@ -466,33 +466,33 @@ declare module AceAjax { doc: Document; - on(event: string, fn: (e) => any); + on(event: string, fn: (e: any) => any): void; - findMatchingBracket(position: Position); + findMatchingBracket(position: Position): void; - addFold(text: string, range: Range); + addFold(text: string, range: Range): void; getFoldAt(row: number, column: number): any; - removeFold(arg: any); + removeFold(arg: any): void; - expandFold(arg: any); + expandFold(arg: any): void; - unfold(arg1: any, arg2: boolean); + unfold(arg1: any, arg2: boolean): void; - screenToDocumentColumn(row: number, column: number); + screenToDocumentColumn(row: number, column: number): void; getFoldDisplayLine(foldLine: any, docRow: number, docColumn: number): any; getFoldsInRange(range: Range): any; - highlight(text: string); + highlight(text: string): void; /** * Sets the `EditSession` to point to a new `Document`. If a `BackgroundTokenizer` exists, it also points to `doc`. * @param doc The new `Document` to use **/ - setDocument(doc: Document); + setDocument(doc: Document): void; /** * Returns the `Document` associated with this session. @@ -503,15 +503,15 @@ declare module AceAjax { * undefined * @param row The row to work with **/ - $resetRowCache(row: number); + $resetRowCache(row: number): void; /** * Sets the session text. * @param text The new text to place **/ - setValue(text: string); + setValue(text: string): void; - setMode(mode: string); + setMode(mode: string): void; /** * Returns the current [[Document `Document`]] as a string. @@ -546,7 +546,7 @@ declare module AceAjax { * Sets the undo manager. * @param undoManager The new undo manager **/ - setUndoManager(undoManager: UndoManager); + setUndoManager(undoManager: UndoManager): void; /** * Returns the current undo manager. @@ -554,7 +554,7 @@ declare module AceAjax { getUndoManager(): UndoManager; /** - * Returns the current value for tabs. If the user is using soft tabs, this will be a series of spaces (defined by [[EditSession.getTabSize `getTabSize()`]]); otherwise it's simply `'\t'`. + * Returns the current value for tabs. If the user is using soft tabs, this will be a series of spaces (defined by [[EditSession.getTabSize `getTabSize()`]]): void; otherwise it's simply `'\t'`. **/ getTabString(): string; @@ -562,7 +562,7 @@ declare module AceAjax { * Pass `true` to enable the use of soft tabs. Soft tabs means you're using spaces instead of the tab character (`'\t'`). * @param useSoftTabs Value indicating whether or not to use soft tabs **/ - setUseSoftTabs(useSoftTabs: boolean); + setUseSoftTabs(useSoftTabs: boolean): void; /** * Returns `true` if soft tabs are being used, `false` otherwise. @@ -573,7 +573,7 @@ declare module AceAjax { * Set the number of spaces that define a soft tab; for example, passing in `4` transforms the soft tabs to be equivalent to four spaces. This function also emits the `changeTabSize` event. * @param tabSize The new tab size **/ - setTabSize(tabSize: number); + setTabSize(tabSize: number): void; /** * Returns the current tab size. @@ -591,7 +591,7 @@ declare module AceAjax { * If overwrites is enabled, any text you enter will type over any text after it. If the value of `overwrite` changes, this function also emites the `changeOverwrite` event. * @param overwrite Defines wheter or not to set overwrites **/ - setOverwrite(overwrite: boolean); + setOverwrite(overwrite: boolean): void; /** * Returns `true` if overwrites are enabled; `false` otherwise. @@ -601,21 +601,21 @@ declare module AceAjax { /** * Sets the value of overwrite to the opposite of whatever it currently is. **/ - toggleOverwrite(); + toggleOverwrite(): void; /** * Adds `className` to the `row`, to be used for CSS stylings and whatnot. * @param row The row number * @param className The class to add **/ - addGutterDecoration(row: number, className: string); + addGutterDecoration(row: number, className: string): void; /** * Removes `className` from the `row`. * @param row The row number * @param className The class to add **/ - removeGutterDecoration(row: number, className: string); + removeGutterDecoration(row: number, className: string): void; /** * Returns an array of numbers, indicating which rows have breakpoints. @@ -626,25 +626,25 @@ declare module AceAjax { * Sets a breakpoint on every row number given by `rows`. This function also emites the `'changeBreakpoint'` event. * @param rows An array of row indices **/ - setBreakpoints(rows: any[]); + setBreakpoints(rows: any[]): void; /** * Removes all breakpoints on the rows. This function also emites the `'changeBreakpoint'` event. **/ - clearBreakpoints(); + clearBreakpoints(): void; /** * Sets a breakpoint on the row number given by `rows`. This function also emites the `'changeBreakpoint'` event. * @param row A row index * @param className Class of the breakpoint **/ - setBreakpoint(row: number, className: string); + setBreakpoint(row: number, className: string): void; /** * Removes a breakpoint on the row number given by `rows`. This function also emites the `'changeBreakpoint'` event. * @param row A row index **/ - clearBreakpoint(row: number); + clearBreakpoint(row: number): void; /** * Adds a new marker to the given `Range`. If `inFront` is `true`, a front marker is defined, and the `'changeFrontMarker'` event fires; otherwise, the `'changeBackMarker'` event fires. @@ -653,7 +653,7 @@ declare module AceAjax { * @param type Identify the type of the marker * @param inFront Set to `true` to establish a front marker **/ - addMarker(range: Range, clazz: string, type: Function, inFront: boolean); + addMarker(range: Range, clazz: string, type: Function, inFront: boolean): void; /** * Adds a new marker to the given `Range`. If `inFront` is `true`, a front marker is defined, and the `'changeFrontMarker'` event fires; otherwise, the `'changeBackMarker'` event fires. @@ -662,20 +662,20 @@ declare module AceAjax { * @param type Identify the type of the marker * @param inFront Set to `true` to establish a front marker **/ - addMarker(range: Range, clazz: string, type: string, inFront: boolean); + addMarker(range: Range, clazz: string, type: string, inFront: boolean): void; /** * Adds a dynamic marker to the session. * @param marker object with update method * @param inFront Set to `true` to establish a front marker **/ - addDynamicMarker(marker: any, inFront: boolean); + addDynamicMarker(marker: any, inFront: boolean): void; /** * Removes the marker with the specified ID. If this marker was in front, the `'changeFrontMarker'` event is emitted. If the marker was in the back, the `'changeBackMarker'` event is emitted. * @param markerId A number representing a marker **/ - removeMarker(markerId: number); + removeMarker(markerId: number): void; /** * Returns an array containing the IDs of all the markers, either front or back. @@ -687,7 +687,7 @@ declare module AceAjax { * Sets annotations for the `EditSession`. This functions emits the `'changeAnnotation'` event. * @param annotations A list of annotations **/ - setAnnotations(annotations: Annotation[]); + setAnnotations(annotations: Annotation[]): void; /** * Returns the annotations for the `EditSession`. @@ -697,13 +697,13 @@ declare module AceAjax { /** * Clears all the annotations for this session. This function also triggers the `'changeAnnotation'` event. **/ - clearAnnotations(); + clearAnnotations(): void; /** * If `text` contains either the newline (`\n`) or carriage-return ('\r') characters, `$autoNewLine` stores that value. * @param text A block of text **/ - $detectNewLine(text: string); + $detectNewLine(text: string): void; /** * Given a starting row and column, this method returns the `Range` of the first word boundary it finds. @@ -723,7 +723,7 @@ declare module AceAjax { * {:Document.setNewLineMode.desc} * @param newLineMode {:Document.setNewLineMode.param} **/ - setNewLineMode(newLineMode: string); + setNewLineMode(newLineMode: string): void; /** * Returns the current new line mode. @@ -734,7 +734,7 @@ declare module AceAjax { * Identifies if you want to use a worker for the `EditSession`. * @param useWorker Set to `true` to use a worker **/ - setUseWorker(useWorker: boolean); + setUseWorker(useWorker: boolean): void; /** * Returns `true` if workers are being used. @@ -744,13 +744,13 @@ declare module AceAjax { /** * Reloads all the tokens on the current session. This function calls [[BackgroundTokenizer.start `BackgroundTokenizer.start ()`]] to all the rows; it also emits the `'tokenizerUpdate'` event. **/ - onReloadTokenizer(); + onReloadTokenizer(): void; /** * Sets a new text mode for the `EditSession`. This method also emits the `'changeMode'` event. If a [[BackgroundTokenizer `BackgroundTokenizer`]] is set, the `'tokenizerUpdate'` event is also emitted. * @param mode Set a new text mode **/ - $mode(mode: TextMode); + $mode(mode: TextMode): void; /** * Returns the current text mode. @@ -761,7 +761,7 @@ declare module AceAjax { * This function sets the scroll top value. It also emits the `'changeScrollTop'` event. * @param scrollTop The new scroll top value **/ - setScrollTop(scrollTop: number); + setScrollTop(scrollTop: number): void; /** * [Returns the value of the distance between the top of the editor and the topmost part of the visible content.]{: #EditSession.getScrollTop} @@ -771,7 +771,7 @@ declare module AceAjax { /** * [Sets the value of the distance between the left of the editor and the leftmost part of the visible content.]{: #EditSession.setScrollLeft} **/ - setScrollLeft(); + setScrollLeft(): void; /** * [Returns the value of the distance between the left of the editor and the leftmost part of the visible content.]{: #EditSession.getScrollLeft} @@ -838,7 +838,7 @@ declare module AceAjax { * Enables or disables highlighting of the range where an undo occured. * @param enable If `true`, selects the range of the reinserted change **/ - setUndoSelect(enable: boolean); + setUndoSelect(enable: boolean): void; /** * Replaces a range in the document with the new `text`. @@ -864,13 +864,13 @@ declare module AceAjax { * @param endRow Ending row * @param indentString The indent token **/ - indentRows(startRow: number, endRow: number, indentString: string); + indentRows(startRow: number, endRow: number, indentString: string): void; /** * Outdents all the rows defined by the `start` and `end` properties of `range`. * @param range A range of rows **/ - outdentRows(range: Range); + outdentRows(range: Range): void; /** * Shifts all the lines in the document up one, starting from `firstRow` and ending at `lastRow`. @@ -897,7 +897,7 @@ declare module AceAjax { * Sets whether or not line wrapping is enabled. If `useWrapMode` is different than the current value, the `'changeWrapMode'` event is emitted. * @param useWrapMode Enable (or disable) wrap mode **/ - setUseWrapMode(useWrapMode: boolean); + setUseWrapMode(useWrapMode: boolean): void; /** * Returns `true` if wrap mode is being used; `false` otherwise. @@ -909,7 +909,7 @@ declare module AceAjax { * @param min The minimum wrap value (the left side wrap) * @param max The maximum wrap value (the right side wrap) **/ - setWrapLimitRange(min: number, max: number); + setWrapLimitRange(min: number, max: number): void; /** * This should generally only be called by the renderer when a resize is detected. @@ -933,7 +933,7 @@ declare module AceAjax { * @param str The string to check * @param offset The value to start at **/ - $getDisplayTokens(str: string, offset: number); + $getDisplayTokens(str: string, offset: number): void; /** * Calculates the width of the string `str` on the screen while assuming that the string starts at the first column on the screen. @@ -1006,7 +1006,7 @@ declare module AceAjax { * @param docRow * @param docColumn **/ - documentToScreenRow(docRow: number, docColumn: number); + documentToScreenRow(docRow: number, docColumn: number): void; /** * Returns the length of the screen. @@ -1036,17 +1036,17 @@ declare module AceAjax { * Event sessions dealing with the mouse and keyboard are bubbled up from `Document` to the `Editor`, which decides what to do with them. **/ export interface Editor { - - addEventListener(ev: 'change', callback: (ev: EditorChangeEvent) => any); - addEventListener(ev: string, callback: Function); + + addEventListener(ev: 'change', callback: (ev: EditorChangeEvent) => any): void; + addEventListener(ev: string, callback: Function): void; inMultiSelectMode: boolean; - selectMoreLines(n: number); + selectMoreLines(n: number): void; - onTextInput(text: string); + onTextInput(text: string): void; - onCommandKey(e, hashId, keyCode); + onCommandKey(e: any, hashId: any, keyCode: any): void; commands: CommandManager; @@ -1060,32 +1060,32 @@ declare module AceAjax { container: HTMLElement; - onSelectionChange(e); + onSelectionChange(e: any): void; - onChangeMode(e?); + onChangeMode(e?: any): void; + + execCommand(command:string, args?: any): void; - execCommand(command:string, args?: any); - /** * Sets a Configuration Option **/ - setOption(optionName: any, optionValue: any); - + setOption(optionName: any, optionValue: any): void; + /** * Sets Configuration Options **/ - setOptions(keyValueTuples: any); - + setOptions(keyValueTuples: any): void; + /** * Get a Configuration Option **/ getOption(name: any):any; - + /** * Get Configuration Options **/ getOptions():any; - + /** * Get rid of console warning by setting this to Infinity **/ @@ -1095,7 +1095,7 @@ declare module AceAjax { * Sets a new key handler, such as "vim" or "windows". * @param keyboardHandler The new key handler **/ - setKeyboardHandler(keyboardHandler: string); + setKeyboardHandler(keyboardHandler: string): void; /** * Returns the keyboard handler, such as "vim" or "windows". @@ -1106,7 +1106,7 @@ declare module AceAjax { * Sets a new editsession to use. This method also emits the `'changeSession'` event. * @param session The new session to use **/ - setSession(session: IEditSession); + setSession(session: IEditSession): void; /** * Returns the current session being used. @@ -1134,13 +1134,13 @@ declare module AceAjax { * {:VirtualRenderer.onResize} * @param force If `true`, recomputes the size, even if the height and width haven't changed **/ - resize(force?: boolean); + resize(force?: boolean): void; /** * {:VirtualRenderer.setTheme} * @param theme The path to a theme **/ - setTheme(theme: string); + setTheme(theme: string): void; /** * {:VirtualRenderer.getTheme} @@ -1151,54 +1151,54 @@ declare module AceAjax { * {:VirtualRenderer.setStyle} * @param style A class name **/ - setStyle(style: string); + setStyle(style: string): void; /** * {:VirtualRenderer.unsetStyle} **/ - unsetStyle(); + unsetStyle(): void; /** * Set a new font size (in pixels) for the editor text. * @param size A font size ( _e.g._ "12px") **/ - setFontSize(size: string); + setFontSize(size: string): void; /** * Brings the current `textInput` into focus. **/ - focus(); + focus(): void; /** * Returns `true` if the current `textInput` is in focus. **/ - isFocused(); + isFocused(): void; /** * Blurs the current `textInput`. **/ - blur(); + blur(): void; /** * Emitted once the editor comes into focus. **/ - onFocus(); + onFocus(): void; /** * Emitted once the editor has been blurred. **/ - onBlur(); + onBlur(): void; /** * Emitted whenever the document is changed. * @param e Contains a single property, `data`, which has the delta of changes **/ - onDocumentChange(e: any); + onDocumentChange(e: any): void; /** * Emitted when the selection changes. **/ - onCursorChange(); + onCursorChange(): void; /** * Returns the string of text currently highlighted. @@ -1208,30 +1208,30 @@ declare module AceAjax { /** * Called whenever a text "copy" happens. **/ - onCopy(); + onCopy(): void; /** * Called whenever a text "cut" happens. **/ - onCut(); + onCut(): void; /** * Called whenever a text "paste" happens. * @param text The pasted text **/ - onPaste(text: string); + onPaste(text: string): void; /** * Inserts `text` into wherever the cursor is pointing. * @param text The new text to add **/ - insert(text: string); + insert(text: string): void; /** * Pass in `true` to enable overwrites in your session, or `false` to disable. If overwrites is enabled, any text you enter will type over any text after it. If the value of `overwrite` changes, this function also emites the `changeOverwrite` event. * @param overwrite Defines wheter or not to set overwrites **/ - setOverwrite(overwrite: boolean); + setOverwrite(overwrite: boolean): void; /** * Returns `true` if overwrites are enabled; `false` otherwise. @@ -1241,13 +1241,13 @@ declare module AceAjax { /** * Sets the value of overwrite to the opposite of whatever it currently is. **/ - toggleOverwrite(); + toggleOverwrite(): void; /** * Sets how fast the mouse scrolling should do. * @param speed A value indicating the new speed (in milliseconds) **/ - setScrollSpeed(speed: number); + setScrollSpeed(speed: number): void; /** * Returns the value indicating how fast the mouse scroll speed is (in milliseconds). @@ -1258,7 +1258,7 @@ declare module AceAjax { * Sets the delay (in milliseconds) of the mouse drag. * @param dragDelay A value indicating the new delay **/ - setDragDelay(dragDelay: number); + setDragDelay(dragDelay: number): void; /** * Returns the current mouse drag delay. @@ -1272,7 +1272,7 @@ declare module AceAjax { * This function also emits the `'changeSelectionStyle'` event. * @param style The new selection style **/ - setSelectionStyle(style: string); + setSelectionStyle(style: string): void; /** * Returns the current selection style. @@ -1283,18 +1283,18 @@ declare module AceAjax { * Determines whether or not the current line should be highlighted. * @param shouldHighlight Set to `true` to highlight the current line **/ - setHighlightActiveLine(shouldHighlight: boolean); + setHighlightActiveLine(shouldHighlight: boolean): void; /** * Returns `true` if current lines are always highlighted. **/ - getHighlightActiveLine(); + getHighlightActiveLine(): void; /** * Determines if the currently selected word should be highlighted. * @param shouldHighlight Set to `true` to highlight the currently selected word **/ - setHighlightSelectedWord(shouldHighlight: boolean); + setHighlightSelectedWord(shouldHighlight: boolean): void; /** * Returns `true` if currently highlighted words are to be highlighted. @@ -1305,7 +1305,7 @@ declare module AceAjax { * If `showInvisibiles` is set to `true`, invisible characters—like spaces or new lines—are show in the editor. * @param showInvisibles Specifies whether or not to show invisible characters **/ - setShowInvisibles(showInvisibles: boolean); + setShowInvisibles(showInvisibles: boolean): void; /** * Returns `true` if invisible characters are being shown. @@ -1316,7 +1316,7 @@ declare module AceAjax { * If `showPrintMargin` is set to `true`, the print margin is shown in the editor. * @param showPrintMargin Specifies whether or not to show the print margin **/ - setShowPrintMargin(showPrintMargin: boolean); + setShowPrintMargin(showPrintMargin: boolean): void; /** * Returns `true` if the print margin is being shown. @@ -1327,7 +1327,7 @@ declare module AceAjax { * Sets the column defining where the print margin should be. * @param showPrintMargin Specifies the new print margin **/ - setPrintMarginColumn(showPrintMargin: number); + setPrintMarginColumn(showPrintMargin: number): void; /** * Returns the column number of where the print margin is. @@ -1338,7 +1338,7 @@ declare module AceAjax { * If `readOnly` is true, then the editor is set to read-only mode, and none of the content can change. * @param readOnly Specifies whether the editor can be modified or not **/ - setReadOnly(readOnly: boolean); + setReadOnly(readOnly: boolean): void; /** * Returns `true` if the editor is set to read-only mode. @@ -1349,7 +1349,7 @@ declare module AceAjax { * Specifies whether to use behaviors or not. ["Behaviors" in this case is the auto-pairing of special characters, like quotation marks, parenthesis, or brackets.]{: #BehaviorsDef} * @param enabled Enables or disables behaviors **/ - setBehavioursEnabled(enabled: boolean); + setBehavioursEnabled(enabled: boolean): void; /** * Returns `true` if the behaviors are currently enabled. {:BehaviorsDef} @@ -1361,89 +1361,89 @@ declare module AceAjax { * when such a character is typed in. * @param enabled Enables or disables wrapping behaviors **/ - setWrapBehavioursEnabled(enabled: boolean); + setWrapBehavioursEnabled(enabled: boolean): void; /** * Returns `true` if the wrapping behaviors are currently enabled. **/ - getWrapBehavioursEnabled(); + getWrapBehavioursEnabled(): void; /** * Indicates whether the fold widgets are shown or not. * @param show Specifies whether the fold widgets are shown **/ - setShowFoldWidgets(show: boolean); + setShowFoldWidgets(show: boolean): void; /** * Returns `true` if the fold widgets are shown. **/ - getShowFoldWidgets(); + getShowFoldWidgets(): void; /** * Removes words of text from the editor. A "word" is defined as a string of characters bookended by whitespace. * @param dir The direction of the deletion to occur, either "left" or "right" **/ - remove(dir: string); + remove(dir: string): void; /** * Removes the word directly to the right of the current selection. **/ - removeWordRight(); + removeWordRight(): void; /** * Removes the word directly to the left of the current selection. **/ - removeWordLeft(); + removeWordLeft(): void; /** * Removes all the words to the left of the current selection, until the start of the line. **/ - removeToLineStart(); + removeToLineStart(): void; /** * Removes all the words to the right of the current selection, until the end of the line. **/ - removeToLineEnd(); + removeToLineEnd(): void; /** * Splits the line at the current selection (by inserting an `'\n'`). **/ - splitLine(); + splitLine(): void; /** * Transposes current line. **/ - transposeLetters(); + transposeLetters(): void; /** * Converts the current selection entirely into lowercase. **/ - toLowerCase(); + toLowerCase(): void; /** * Converts the current selection entirely into uppercase. **/ - toUpperCase(); + toUpperCase(): void; /** * Inserts an indentation into the current cursor position or indents the selected lines. **/ - indent(); + indent(): void; /** * Indents the current line. **/ - blockIndent(); + blockIndent(): void; /** * Outdents the current line. **/ - blockOutdent(arg?: string); + blockOutdent(arg?: string): void; /** * Given the currently selected range, this function either comments all the lines, or uncomments all of them. **/ - toggleCommentLines(); + toggleCommentLines(): void; /** * Works like [[EditSession.getTokenAt]], except it returns a number. @@ -1454,12 +1454,12 @@ declare module AceAjax { * If the character before the cursor is a number, this functions changes its value by `amount`. * @param amount The value to change the numeral by (can be negative to decrease value) **/ - modifyNumber(amount: number); + modifyNumber(amount: number): void; /** * Removes all the lines in the current selection **/ - removeLines(); + removeLines(): void; /** * Shifts all the selected lines down one row. @@ -1516,37 +1516,37 @@ declare module AceAjax { /** * Selects the text from the current position of the document until where a "page down" finishes. **/ - selectPageDown(); + selectPageDown(): void; /** * Selects the text from the current position of the document until where a "page up" finishes. **/ - selectPageUp(); + selectPageUp(): void; /** * Shifts the document to wherever "page down" is, as well as moving the cursor position. **/ - gotoPageDown(); + gotoPageDown(): void; /** * Shifts the document to wherever "page up" is, as well as moving the cursor position. **/ - gotoPageUp(); + gotoPageUp(): void; /** * Scrolls the document to wherever "page down" is, without changing the cursor position. **/ - scrollPageDown(); + scrollPageDown(): void; /** * Scrolls the document to wherever "page up" is, without changing the cursor position. **/ - scrollPageUp(); + scrollPageUp(): void; /** * Moves the editor to the specified row. **/ - scrollToRow(); + scrollToRow(): void; /** * Scrolls to a line. If `center` is `true`, it puts the line in middle of screen (or attempts to). @@ -1555,12 +1555,12 @@ declare module AceAjax { * @param animate If `true` animates scrolling * @param callback Function to be called when the animation has finished **/ - scrollToLine(line: number, center: boolean, animate: boolean, callback: Function); + scrollToLine(line: number, center: boolean, animate: boolean, callback: Function): void; /** * Attempts to center the current selection on the screen. **/ - centerSelection(); + centerSelection(): void; /** * Gets the current position of the cursor. @@ -1580,30 +1580,30 @@ declare module AceAjax { /** * Selects all the text in editor. **/ - selectAll(); + selectAll(): void; /** * {:Selection.clearSelection} **/ - clearSelection(); + clearSelection(): void; /** * Moves the cursor to the specified row and column. Note that this does not de-select the current selection. * @param row The new row number * @param column The new column number **/ - moveCursorTo(row: number, column?: number, animate?:boolean); + moveCursorTo(row: number, column?: number, animate?:boolean): void; /** * Moves the cursor to the position indicated by `pos.row` and `pos.column`. * @param position An object with two properties, row and column **/ - moveCursorToPosition(position: Position); + moveCursorToPosition(position: Position): void; /** * Moves the cursor's row and column to the next matching bracket. **/ - jumpToMatching(); + jumpToMatching(): void; /** * Moves the cursor to the specified line number, and also into the indiciated column. @@ -1611,82 +1611,82 @@ declare module AceAjax { * @param column A column number to go to * @param animate If `true` animates scolling **/ - gotoLine(lineNumber: number, column?: number, animate?: boolean); + gotoLine(lineNumber: number, column?: number, animate?: boolean): void; /** * Moves the cursor to the specified row and column. Note that this does de-select the current selection. * @param row The new row number * @param column The new column number **/ - navigateTo(row: number, column: number); + navigateTo(row: number, column: number): void; /** * Moves the cursor up in the document the specified number of times. Note that this does de-select the current selection. * @param times The number of times to change navigation **/ - navigateUp(times?: number); + navigateUp(times?: number): void; /** * Moves the cursor down in the document the specified number of times. Note that this does de-select the current selection. * @param times The number of times to change navigation **/ - navigateDown(times?: number); + navigateDown(times?: number): void; /** * Moves the cursor left in the document the specified number of times. Note that this does de-select the current selection. * @param times The number of times to change navigation **/ - navigateLeft(times?: number); + navigateLeft(times?: number): void; /** * Moves the cursor right in the document the specified number of times. Note that this does de-select the current selection. * @param times The number of times to change navigation **/ - navigateRight(times: number); + navigateRight(times: number): void; /** * Moves the cursor to the start of the current line. Note that this does de-select the current selection. **/ - navigateLineStart(); + navigateLineStart(): void; /** * Moves the cursor to the end of the current line. Note that this does de-select the current selection. **/ - navigateLineEnd(); + navigateLineEnd(): void; /** * Moves the cursor to the end of the current file. Note that this does de-select the current selection. **/ - navigateFileEnd(); + navigateFileEnd(): void; /** * Moves the cursor to the start of the current file. Note that this does de-select the current selection. **/ - navigateFileStart(); + navigateFileStart(): void; /** * Moves the cursor to the word immediately to the right of the current position. Note that this does de-select the current selection. **/ - navigateWordRight(); + navigateWordRight(): void; /** * Moves the cursor to the word immediately to the left of the current position. Note that this does de-select the current selection. **/ - navigateWordLeft(); + navigateWordLeft(): void; /** * Replaces the first occurance of `options.needle` with the value in `replacement`. * @param replacement The text to replace with * @param options The [[Search `Search`]] options to use **/ - replace(replacement: string, options?: any); + replace(replacement: string, options?: any): void; /** * Replaces all occurances of `options.needle` with the value in `replacement`. * @param replacement The text to replace with * @param options The [[Search `Search`]] options to use **/ - replaceAll(replacement: string, options?: any); + replaceAll(replacement: string, options?: any): void; /** * {:Search.getOptions} For more information on `options`, see [[Search `Search`]]. @@ -1699,36 +1699,36 @@ declare module AceAjax { * @param options An object defining various search properties * @param animate If `true` animate scrolling **/ - find(needle: string, options?: any, animate?: boolean); + find(needle: string, options?: any, animate?: boolean): void; /** * Performs another search for `needle` in the document. For more information on `options`, see [[Search `Search`]]. * @param options search options * @param animate If `true` animate scrolling **/ - findNext(options?: any, animate?: boolean); + findNext(options?: any, animate?: boolean): void; /** * Performs a search for `needle` backwards. For more information on `options`, see [[Search `Search`]]. * @param options search options * @param animate If `true` animate scrolling **/ - findPrevious(options?: any, animate?: boolean); + findPrevious(options?: any, animate?: boolean): void; /** * {:UndoManager.undo} **/ - undo(); + undo(): void; /** * {:UndoManager.redo} **/ - redo(); + redo(): void; /** * Cleans up the entire editor. **/ - destroy(); + destroy(): void; } @@ -1740,7 +1740,7 @@ declare module AceAjax { **/ new(renderer: VirtualRenderer, session?: IEditSession): Editor; } - + interface EditorChangeEvent { start: Position; end: Position; @@ -1754,49 +1754,49 @@ declare module AceAjax { export interface PlaceHolder { - on(event: string, fn: (e) => any); + on(event: string, fn: (e: any) => any): void; /** * PlaceHolder.setup() * TODO **/ - setup(); + setup(): void; /** * PlaceHolder.showOtherMarkers() * TODO **/ - showOtherMarkers(); + showOtherMarkers(): void; /** * PlaceHolder.hideOtherMarkers() * Hides all over markers in the [[EditSession `EditSession`]] that are not the currently selected one. **/ - hideOtherMarkers(); + hideOtherMarkers(): void; /** * PlaceHolder@onUpdate(e) * Emitted when the place holder updates. **/ - onUpdate(); + onUpdate(): void; /** * PlaceHolder@onCursorChange(e) * Emitted when the cursor changes. **/ - onCursorChange(); + onCursorChange(): void; /** * PlaceHolder.detach() * TODO **/ - detach(); + detach(): void; /** * PlaceHolder.cancel() * TODO **/ - cancel(); + cancel(): void; } var PlaceHolder: { /** @@ -1819,15 +1819,15 @@ declare module AceAjax { export interface IRangeList { ranges: Range[]; - pointIndex(pos: Position, startIndex?: number); + pointIndex(pos: Position, startIndex?: number): void; - addList(ranges: Range[]); + addList(ranges: Range[]): void; - add(ranges: Range); + add(ranges: Range): void; merge(): Range[]; - substractPoint(pos: Position); + substractPoint(pos: Position): void; } export var RangeList: { new (): IRangeList; @@ -1860,7 +1860,7 @@ declare module AceAjax { * Returns `true` if and only if the starting row and column, and ending row and column, are equivalent to those given by `range`. * @param range A range to check against **/ - isEqual(range: Range); + isEqual(range: Range): void; /** * Returns a string containing the range's row and column information, given like this: @@ -1868,7 +1868,7 @@ declare module AceAjax { * [start.row/start.column] -> [end.row/end.column] * ``` **/ - toString(); + toString(): void; /** * Returns `true` if the `row` and `column` provided are within the given range. This can better be expressed as returning `true` if: @@ -1924,14 +1924,14 @@ declare module AceAjax { * @param row A row point to set * @param column A column point to set **/ - setStart(row: number, column: number); + setStart(row: number, column: number): void; /** * Sets the starting row and column for the range. * @param row A row point to set * @param column A column point to set **/ - setEnd(row: number, column: number); + setEnd(row: number, column: number): void; /** * Returns `true` if the `row` and `column` are within the given range. @@ -2059,7 +2059,7 @@ declare module AceAjax { * Emitted when the scroll bar, well, scrolls. * @param e Contains one property, `"data"`, which indicates the current scroll top position **/ - onScroll(e: any); + onScroll(e: any): void; /** * Returns the width of the scroll bar. @@ -2070,19 +2070,19 @@ declare module AceAjax { * Sets the height of the scroll bar, in pixels. * @param height The new height **/ - setHeight(height: number); + setHeight(height: number): void; /** * Sets the inner height of the scroll bar, in pixels. * @param height The new inner height **/ - setInnerHeight(height: number); + setInnerHeight(height: number): void; /** * Sets the scroll top of the scroll bar. * @param scrollTop The new scroll top **/ - setScrollTop(scrollTop: number); + setScrollTop(scrollTop: number): void; } var ScrollBar: { /** @@ -2116,7 +2116,7 @@ declare module AceAjax { * Sets the search options via the `options` parameter. * @param An object containing all the search propertie **/ - setOptions(An: any); + setOptions(An: any): void; /** * Searches for `options.needle`. If found, this method returns the [[Range `Range`]] where the text first occurs. If `options.backwards` is `true`, the search goes backwards in the session. @@ -2165,21 +2165,21 @@ declare module AceAjax { **/ export interface Selection { - addEventListener(ev: string, callback: Function); + addEventListener(ev: string, callback: Function): void; - moveCursorWordLeft(); + moveCursorWordLeft(): void; - moveCursorWordRight(); + moveCursorWordRight(): void; - fromOrientedRange(range: Range); + fromOrientedRange(range: Range): void; - setSelectionRange(match); + setSelectionRange(match: any): void; getAllRanges(): Range[]; - on(event: string, fn: (e) => any); + on(event: string, fn: (e: any) => any): void; - addRange(range: Range); + addRange(range: Range): void; /** * Returns `true` if the selection is empty. @@ -2201,7 +2201,7 @@ declare module AceAjax { * @param row The new row * @param column The new column **/ - setSelectionAnchor(row: number, column: number); + setSelectionAnchor(row: number, column: number): void; /** * Returns an object containing the `row` and `column` of the calling selection anchor. @@ -2217,7 +2217,7 @@ declare module AceAjax { * Shifts the selection up (or down, if [[Selection.isBackwards `isBackwards()`]] is true) the given number of columns. * @param columns The number of columns to shift by **/ - shiftSelection(columns: number); + shiftSelection(columns: number): void; /** * Returns `true` if the selection is going backwards in the document. @@ -2232,165 +2232,165 @@ declare module AceAjax { /** * [Empties the selection (by de-selecting it). This function also emits the `'changeSelection'` event.]{: #Selection.clearSelection} **/ - clearSelection(); + clearSelection(): void; /** * Selects all the text in the document. **/ - selectAll(); + selectAll(): void; /** * Sets the selection to the provided range. * @param range The range of text to select * @param reverse Indicates if the range should go backwards (`true`) or not **/ - setRange(range: Range, reverse: boolean); + setRange(range: Range, reverse: boolean): void; /** * Moves the selection cursor to the indicated row and column. * @param row The row to select to * @param column The column to select to **/ - selectTo(row: number, column: number); + selectTo(row: number, column: number): void; /** * Moves the selection cursor to the row and column indicated by `pos`. * @param pos An object containing the row and column **/ - selectToPosition(pos: any); + selectToPosition(pos: any): void; /** * Moves the selection up one row. **/ - selectUp(); + selectUp(): void; /** * Moves the selection down one row. **/ - selectDown(); + selectDown(): void; /** * Moves the selection right one column. **/ - selectRight(); + selectRight(): void; /** * Moves the selection left one column. **/ - selectLeft(); + selectLeft(): void; /** * Moves the selection to the beginning of the current line. **/ - selectLineStart(); + selectLineStart(): void; /** * Moves the selection to the end of the current line. **/ - selectLineEnd(); + selectLineEnd(): void; /** * Moves the selection to the end of the file. **/ - selectFileEnd(); + selectFileEnd(): void; /** * Moves the selection to the start of the file. **/ - selectFileStart(); + selectFileStart(): void; /** * Moves the selection to the first word on the right. **/ - selectWordRight(); + selectWordRight(): void; /** * Moves the selection to the first word on the left. **/ - selectWordLeft(); + selectWordLeft(): void; /** * Moves the selection to highlight the entire word. **/ - getWordRange(); + getWordRange(): void; /** * Selects an entire word boundary. **/ - selectWord(); + selectWord(): void; /** * Selects a word, including its right whitespace. **/ - selectAWord(); + selectAWord(): void; /** * Selects the entire line. **/ - selectLine(); + selectLine(): void; /** * Moves the cursor up one row. **/ - moveCursorUp(); + moveCursorUp(): void; /** * Moves the cursor down one row. **/ - moveCursorDown(); + moveCursorDown(): void; /** * Moves the cursor left one column. **/ - moveCursorLeft(); + moveCursorLeft(): void; /** * Moves the cursor right one column. **/ - moveCursorRight(); + moveCursorRight(): void; /** * Moves the cursor to the start of the line. **/ - moveCursorLineStart(); + moveCursorLineStart(): void; /** * Moves the cursor to the end of the line. **/ - moveCursorLineEnd(); + moveCursorLineEnd(): void; /** * Moves the cursor to the end of the file. **/ - moveCursorFileEnd(); + moveCursorFileEnd(): void; /** * Moves the cursor to the start of the file. **/ - moveCursorFileStart(); + moveCursorFileStart(): void; /** * Moves the cursor to the word on the right. **/ - moveCursorLongWordRight(); + moveCursorLongWordRight(): void; /** * Moves the cursor to the word on the left. **/ - moveCursorLongWordLeft(); + moveCursorLongWordLeft(): void; /** * Moves the cursor to position indicated by the parameters. Negative numbers move the cursor backwards in the document. * @param rows The number of rows to move by * @param chars The number of characters to move by **/ - moveCursorBy(rows: number, chars: number); + moveCursorBy(rows: number, chars: number): void; /** * Moves the selection to the position indicated by its `row` and `column`. * @param position The position to move to **/ - moveCursorToPosition(position: any); + moveCursorToPosition(position: any): void; /** * Moves the cursor to the row and column provided. [If `preventUpdateDesiredColumn` is `true`, then the cursor stays in the same column position as its original point.]{: #preventUpdateBoolDesc} @@ -2398,7 +2398,7 @@ declare module AceAjax { * @param column The column to move to * @param keepDesiredColumn [If `true`, the cursor move does not respect the previous column]{: #preventUpdateBool} **/ - moveCursorTo(row: number, column: number, keepDesiredColumn?: boolean); + moveCursorTo(row: number, column: number, keepDesiredColumn?: boolean): void; /** * Moves the cursor to the screen position indicated by row and column. {:preventUpdateBoolDesc} @@ -2406,7 +2406,7 @@ declare module AceAjax { * @param column The column to move to * @param keepDesiredColumn {:preventUpdateBool} **/ - moveCursorToScreen(row: number, column: number, keepDesiredColumn: boolean); + moveCursorToScreen(row: number, column: number, keepDesiredColumn: boolean): void; } var Selection: { /** @@ -2431,7 +2431,7 @@ declare module AceAjax { * Returns the editor identified by the index `idx`. * @param idx The index of the editor you want **/ - getEditor(idx: number); + getEditor(idx: number): void; /** * Returns the current editor. @@ -2441,44 +2441,44 @@ declare module AceAjax { /** * Focuses the current editor. **/ - focus(); + focus(): void; /** * Blurs the current editor. **/ - blur(); + blur(): void; /** * Sets a theme for each of the available editors. * @param theme The name of the theme to set **/ - setTheme(theme: string); + setTheme(theme: string): void; /** * Sets the keyboard handler for the editor. * @param keybinding **/ - setKeyboardHandler(keybinding: string); + setKeyboardHandler(keybinding: string): void; /** * Executes `callback` on all of the available editors. * @param callback A callback function to execute * @param scope The default scope for the callback **/ - forEach(callback: Function, scope: string); + forEach(callback: Function, scope: string): void; /** * Sets the font size, in pixels, for all the available editors. * @param size The new font size **/ - setFontSize(size: number); + setFontSize(size: number): void; /** * Sets a new [[EditSession `EditSession`]] for the indicated editor. * @param session The new edit session * @param idx The editor's index you're interested in **/ - setSession(session: IEditSession, idx: number); + setSession(session: IEditSession, idx: number): void; /** * Returns the orientation. @@ -2489,12 +2489,12 @@ declare module AceAjax { * Sets the orientation. * @param orientation The new orientation value **/ - setOrientation(orientation: number); + setOrientation(orientation: number): void; /** * Resizes the editor. **/ - resize(); + resize(): void; } var Split: { new(): Split; @@ -2583,7 +2583,7 @@ declare module AceAjax { * - `args[1]` is the document to associate with * @param options Contains additional properties **/ - execute(options: any); + execute(options: any): void; /** * [Perform an undo operation on the document, reverting the last change.]{: #UndoManager.undo} @@ -2595,12 +2595,12 @@ declare module AceAjax { * [Perform a redo operation on the document, reimplementing the last change.]{: #UndoManager.redo} * @param dontSelect {:dontSelect} **/ - redo(dontSelect: boolean); + redo(dontSelect: boolean): void; /** * Destroys the stack of undo and redo redo operations. **/ - reset(); + reset(): void; /** * Returns `true` if there are undo operations left to perform. @@ -2611,12 +2611,12 @@ declare module AceAjax { * Returns `true` if there are redo operations left to perform. **/ hasRedo(): boolean; - + /** * Returns `true` if the dirty counter is 0 **/ isClean(): boolean; - + /** * Sets dirty counter to 0 **/ @@ -2645,35 +2645,35 @@ declare module AceAjax { lineHeight: number; - screenToTextCoordinates(left: number, top: number); + screenToTextCoordinates(left: number, top: number): void; /** * Associates the renderer with an [[EditSession `EditSession`]]. **/ - setSession(session: IEditSession); + setSession(session: IEditSession): void; /** * Triggers a partial update of the text, from the range given by the two parameters. * @param firstRow The first row to update * @param lastRow The last row to update **/ - updateLines(firstRow: number, lastRow: number); + updateLines(firstRow: number, lastRow: number): void; /** * Triggers a full update of the text, for all the rows. **/ - updateText(); + updateText(): void; /** * Triggers a full update of all the layers, for all the rows. * @param force If `true`, forces the changes through **/ - updateFull(force: boolean); + updateFull(force: boolean): void; /** * Updates the font size. **/ - updateFontSize(); + updateFontSize(): void; /** * [Triggers a resize of the editor.]{: #VirtualRenderer.onResize} @@ -2682,18 +2682,18 @@ declare module AceAjax { * @param width The width of the editor in pixels * @param height The hiehgt of the editor, in pixels **/ - onResize(force: boolean, gutterWidth: number, width: number, height: number); + onResize(force: boolean, gutterWidth: number, width: number, height: number): void; /** * Adjusts the wrap limit, which is the number of characters that can fit within the width of the edit area on screen. **/ - adjustWrapLimit(); + adjustWrapLimit(): void; /** * Identifies whether you want to have an animated scroll or not. * @param shouldAnimate Set to `true` to show animated scrolls **/ - setAnimatedScroll(shouldAnimate: boolean); + setAnimatedScroll(shouldAnimate: boolean): void; /** * Returns whether an animated scroll happens or not. @@ -2704,7 +2704,7 @@ declare module AceAjax { * Identifies whether you want to show invisible characters or not. * @param showInvisibles Set to `true` to show invisibles **/ - setShowInvisibles(showInvisibles: boolean); + setShowInvisibles(showInvisibles: boolean): void; /** * Returns whether invisible characters are being shown or not. @@ -2715,7 +2715,7 @@ declare module AceAjax { * Identifies whether you want to show the print margin or not. * @param showPrintMargin Set to `true` to show the print margin **/ - setShowPrintMargin(showPrintMargin: boolean); + setShowPrintMargin(showPrintMargin: boolean): void; /** * Returns whether the print margin is being shown or not. @@ -2726,7 +2726,7 @@ declare module AceAjax { * Identifies whether you want to show the print margin column or not. * @param showPrintMargin Set to `true` to show the print margin column **/ - setPrintMarginColumn(showPrintMargin: boolean); + setPrintMarginColumn(showPrintMargin: boolean): void; /** * Returns whether the print margin column is being shown or not. @@ -2742,7 +2742,7 @@ declare module AceAjax { * Identifies whether you want to show the gutter or not. * @param show Set to `true` to show the gutter **/ - setShowGutter(show: boolean); + setShowGutter(show: boolean): void; /** * Returns the root element containing this renderer. @@ -2783,7 +2783,7 @@ declare module AceAjax { * Sets the padding for all the layers. * @param padding A new padding value (in pixels) **/ - setPadding(padding: number); + setPadding(padding: number): void; /** * Returns whether the horizontal scrollbar is set to be always visible. @@ -2794,58 +2794,58 @@ declare module AceAjax { * Identifies whether you want to show the horizontal scrollbar or not. * @param alwaysVisible Set to `true` to make the horizontal scroll bar visible **/ - setHScrollBarAlwaysVisible(alwaysVisible: boolean); + setHScrollBarAlwaysVisible(alwaysVisible: boolean): void; /** * Schedules an update to all the front markers in the document. **/ - updateFrontMarkers(); + updateFrontMarkers(): void; /** * Schedules an update to all the back markers in the document. **/ - updateBackMarkers(); + updateBackMarkers(): void; /** * Deprecated; (moved to [[EditSession]]) **/ - addGutterDecoration(); + addGutterDecoration(): void; /** * Deprecated; (moved to [[EditSession]]) **/ - removeGutterDecoration(); + removeGutterDecoration(): void; /** * Redraw breakpoints. **/ - updateBreakpoints(); + updateBreakpoints(): void; /** * Sets annotations for the gutter. * @param annotations An array containing annotations **/ - setAnnotations(annotations: any[]); + setAnnotations(annotations: any[]): void; /** * Updates the cursor icon. **/ - updateCursor(); + updateCursor(): void; /** * Hides the cursor icon. **/ - hideCursor(); + hideCursor(): void; /** * Shows the cursor icon. **/ - showCursor(); + showCursor(): void; /** * Scrolls the cursor into the first visibile area of the editor **/ - scrollCursorIntoView(); + scrollCursorIntoView(): void; /** * {:EditSession.getScrollTop} @@ -2871,7 +2871,7 @@ declare module AceAjax { * Gracefully scrolls from the top of the editor to the row indicated. * @param row A row id **/ - scrollToRow(row: number); + scrollToRow(row: number): void; /** * Gracefully scrolls the editor to the row indicated. @@ -2880,7 +2880,7 @@ declare module AceAjax { * @param animate If `true` animates scrolling * @param callback Function to be called after the animation has finished **/ - scrollToLine(line: number, center: boolean, animate: boolean, callback: Function); + scrollToLine(line: number, center: boolean, animate: boolean, callback: Function): void; /** * Scrolls the editor to the y pixel indicated. @@ -2899,7 +2899,7 @@ declare module AceAjax { * @param deltaX The x value to scroll by * @param deltaY The y value to scroll by **/ - scrollBy(deltaX: number, deltaY: number); + scrollBy(deltaX: number, deltaY: number): void; /** * Returns `true` if you can still scroll by either parameter; in other words, you haven't reached the end of the file or line. @@ -2918,35 +2918,35 @@ declare module AceAjax { /** * Focuses the current container. **/ - visualizeFocus(); + visualizeFocus(): void; /** * Blurs the current container. **/ - visualizeBlur(); + visualizeBlur(): void; /** * undefined * @param position **/ - showComposition(position: number); + showComposition(position: number): void; /** * Sets the inner text of the current composition to `text`. * @param text A string of text to use **/ - setCompositionText(text: string); + setCompositionText(text: string): void; /** * Hides the current composition. **/ - hideComposition(); + hideComposition(): void; /** * [Sets a new theme for the editor. `theme` should exist, and be a directory path, like `ace/theme/textmate`.]{: #VirtualRenderer.setTheme} * @param theme The path to a theme **/ - setTheme(theme: string); + setTheme(theme: string): void; /** * [Returns the path of the current theme.]{: #VirtualRenderer.getTheme} @@ -2957,18 +2957,18 @@ declare module AceAjax { * [Adds a new class, `style`, to the editor.]{: #VirtualRenderer.setStyle} * @param style A class name **/ - setStyle(style: string); + setStyle(style: string): void; /** * [Removes the class `style` from the editor.]{: #VirtualRenderer.unsetStyle} * @param style A class name **/ - unsetStyle(style: string); + unsetStyle(style: string): void; /** * Destroys the text and cursor layers for this renderer. **/ - destroy(); + destroy(): void; } var VirtualRenderer: { diff --git a/adm-zip/adm-zip-tests.ts b/adm-zip/adm-zip-tests.ts index f8583ae61..93f8f2f2d 100644 --- a/adm-zip/adm-zip-tests.ts +++ b/adm-zip/adm-zip-tests.ts @@ -1,10 +1,9 @@ /// import AdmZip = require("adm-zip"); - // reading archives var zip = new AdmZip("./my_file.zip"); -var zipEntries = zip.getEntries(); // an array of ZipEntry records +var zipEntries: AdmZip.IZipEntry[] = zip.getEntries(); // an array of ZipEntry records zipEntries.forEach(function (zipEntry) { console.log(zipEntry.toString()); // outputs zip entries information @@ -31,3 +30,32 @@ zip.addLocalFile("/home/me/some_picture.png"); var willSendthis = zip.toBuffer(); // or write everything to disk zip.writeZip(/*target file name*/"/home/me/files.zip"); + +function processZipEntry(zipEntry: AdmZip.IZipEntry) { + console.log('comment', zipEntry.comment); +} + +//tests taken from examples at https://github.com/cthackers/adm-zip/wiki/ADM-ZIP +import Zip = require("adm-zip"); +// loads and parses existing zip file local_file.zip +var zip = new Zip("local_file.zip"); +// creates new in memory zip +zip = new Zip(); +// loads and parses existing zip file local_file.zip +zip = new Zip("local_file.zip"); +// get all entries and iterate them +zip.getEntries().forEach((entry) => { + var entryName = entry.entryName; + var decompressedData = zip.readFile(entry); // decompressed buffer of the entry + console.log(zip.readAsText(entry)); // outputs the decompressed content of the entry +}); + +// will extract the file myfile.txt from the archive to /home/user/folder/subfolder/myfile.txt +zip.extractEntryTo("folder/subfolder/myfile.txt", "/home/user/", true, true); + +// will extract the file myfile.txt from the archive to /home/user/myfile.txt +zip.extractEntryTo("folder/subfolder/myfile.txt", "/home/user/", false, true); + +function isAdmZipEntry(obj: any): obj is AdmZip.IZipEntry { + return obj !== null && typeof obj === "object" && typeof obj['entryName'] === 'string'; +} \ No newline at end of file diff --git a/adm-zip/adm-zip.d.ts b/adm-zip/adm-zip.d.ts index 9f2eb7dfd..208c13b27 100644 --- a/adm-zip/adm-zip.d.ts +++ b/adm-zip/adm-zip.d.ts @@ -5,8 +5,8 @@ /// -declare module AdmZip { - class ZipFile { +declare module "adm-zip" { + class AdmZip { /** * Create a new, empty archive. */ @@ -28,7 +28,7 @@ declare module AdmZip { * @param entry ZipEntry object * @return Buffer or Null in case of error */ - readFile(entry: IZipEntry): Buffer; + readFile(entry: AdmZip.IZipEntry): Buffer; /** * Asynchronous readFile * @param entry String with the full path of the entry @@ -41,7 +41,7 @@ declare module AdmZip { * @param callback Called with a Buffer or Null in case of error * @return Buffer or Null in case of error */ - readFileAsync(entry: IZipEntry, callback: (data: Buffer, err: string) => any): void; + readFileAsync(entry: AdmZip.IZipEntry, callback: (data: Buffer, err: string) => any): void; /** * Extracts the given entry from the archive and returns the content as * plain text in the given encoding @@ -57,7 +57,7 @@ declare module AdmZip { * @param encoding Optional. If no encoding is specified utf8 is used * @return String */ - readAsText(fileName: IZipEntry, encoding?: string): string; + readAsText(fileName: AdmZip.IZipEntry, encoding?: string): string; /** * Asynchronous readAsText * @param entry String with the full path of the entry @@ -71,7 +71,7 @@ declare module AdmZip { * @param callback Called with the resulting string. * @param encoding Optional. If no encoding is specified utf8 is used */ - readAsTextAsync(fileName: IZipEntry, callback: (data: string) => any, encoding?: string): void; + readAsTextAsync(fileName: AdmZip.IZipEntry, callback: (data: string) => any, encoding?: string): void; /** * Remove the entry from the file or the entry and all its nested directories * and files if the given entry is a directory @@ -83,7 +83,7 @@ declare module AdmZip { * and files if the given entry is a directory * @param entry A ZipEntry object. */ - deleteFile(entry: IZipEntry): void; + deleteFile(entry: AdmZip.IZipEntry): void; /** * Adds a comment to the zip. The zip must be rewritten after * adding the comment. @@ -110,7 +110,7 @@ declare module AdmZip { * @param entry ZipEntry object. * @param comment The comment to add to the entry. */ - addZipEntryComment(entry: IZipEntry, comment: string): void; + addZipEntryComment(entry: AdmZip.IZipEntry, comment: string): void; /** * Returns the comment of the specified entry. * @param entry String with the full path of the entry. @@ -122,7 +122,7 @@ declare module AdmZip { * @param entry ZipEntry object. * @return String The comment of the specified entry. */ - getZipEntryComment(entry: IZipEntry): string; + getZipEntryComment(entry: AdmZip.IZipEntry): string; /** * Updates the content of an existing entry inside the archive. The zip * must be rewritten after updating the content @@ -136,7 +136,7 @@ declare module AdmZip { * @param entry ZipEntry object. * @param content The entry's new contents. */ - updateFile(entry: IZipEntry, content: Buffer): void; + updateFile(entry: AdmZip.IZipEntry, content: Buffer): void; /** * Adds a file from the disk to the archive. * @param localPath Path to a file on disk. @@ -167,14 +167,14 @@ declare module AdmZip { * Returns an array of ZipEntry objects representing the files and folders * inside the archive */ - getEntries(): IZipEntry[]; + getEntries(): AdmZip.IZipEntry[]; /** * Returns a ZipEntry object representing the file or folder specified by * ``name``. * @param name Name of the file or folder to retrieve. * @return ZipEntry The entry corresponding to the name. */ - getEntry(name: string): IZipEntry; + getEntry(name: string): AdmZip.IZipEntry; /** * Extracts the given entry to the given targetPath. * If the entry is a directory inside the archive, the entire directory and @@ -203,7 +203,7 @@ declare module AdmZip { * will be overwriten if this is true. Default is FALSE * @return Boolean */ - extractEntryTo(entryPath: IZipEntry, targetPath: string, maintainEntryPath?: boolean, overwrite?: boolean): boolean; + extractEntryTo(entryPath: AdmZip.IZipEntry, targetPath: string, maintainEntryPath?: boolean, overwrite?: boolean): boolean; /** * Extracts the entire archive to the given location * @param targetPath Target location @@ -225,76 +225,75 @@ declare module AdmZip { toBuffer(): Buffer; } - /** - * The ZipEntry is more than a structure representing the entry inside the - * zip file. Beside the normal attributes and headers a entry can have, the - * class contains a reference to the part of the file where the compressed - * data resides and decompresses it when requested. It also compresses the - * data and creates the headers required to write in the zip file. - */ - interface IZipEntry { + module AdmZip { /** - * Represents the full name and path of the file + * The ZipEntry is more than a structure representing the entry inside the + * zip file. Beside the normal attributes and headers a entry can have, the + * class contains a reference to the part of the file where the compressed + * data resides and decompresses it when requested. It also compresses the + * data and creates the headers required to write in the zip file. */ - entryName: string; - rawEntryName: Buffer; - /** - * Extra data associated with this entry. - */ - extra: Buffer; - /** - * Entry comment. - */ - comment: string; - name: string; - /** - * Read-Only property that indicates the type of the entry. - */ - isDirectory: boolean; - /** - * Get the header associated with this ZipEntry. - */ - header: Buffer; - /** - * Retrieve the compressed data for this entry. Note that this may trigger - * compression if any properties were modified. - */ - getCompressedData(): Buffer; - /** - * Asynchronously retrieve the compressed data for this entry. Note that - * this may trigger compression if any properties were modified. - */ - getCompressedDataAsync(callback: (data: Buffer) => void): void; - /** - * Set the (uncompressed) data to be associated with this entry. - */ - setData(value: string): void; - /** - * Set the (uncompressed) data to be associated with this entry. - */ - setData(value: Buffer): void; - /** - * Get the decompressed data associated with this entry. - */ - getData(): Buffer; - /** - * Asynchronously get the decompressed data associated with this entry. - */ - getDataAsync(callback: (data: Buffer) => void): void; - /** - * Returns the CEN Entry Header to be written to the output zip file, plus - * the extra data and the entry comment. - */ - packHeader(): Buffer; - /** - * Returns a nicely formatted string with the most important properties of - * the ZipEntry. - */ - toString(): string; + interface IZipEntry { + /** + * Represents the full name and path of the file + */ + entryName: string; + rawEntryName: Buffer; + /** + * Extra data associated with this entry. + */ + extra: Buffer; + /** + * Entry comment. + */ + comment: string; + name: string; + /** + * Read-Only property that indicates the type of the entry. + */ + isDirectory: boolean; + /** + * Get the header associated with this ZipEntry. + */ + header: Buffer; + /** + * Retrieve the compressed data for this entry. Note that this may trigger + * compression if any properties were modified. + */ + getCompressedData(): Buffer; + /** + * Asynchronously retrieve the compressed data for this entry. Note that + * this may trigger compression if any properties were modified. + */ + getCompressedDataAsync(callback: (data: Buffer) => void): void; + /** + * Set the (uncompressed) data to be associated with this entry. + */ + setData(value: string): void; + /** + * Set the (uncompressed) data to be associated with this entry. + */ + setData(value: Buffer): void; + /** + * Get the decompressed data associated with this entry. + */ + getData(): Buffer; + /** + * Asynchronously get the decompressed data associated with this entry. + */ + getDataAsync(callback: (data: Buffer) => void): void; + /** + * Returns the CEN Entry Header to be written to the output zip file, plus + * the extra data and the entry comment. + */ + packHeader(): Buffer; + /** + * Returns a nicely formatted string with the most important properties of + * the ZipEntry. + */ + toString(): string; + } } -} -declare module "adm-zip" { - import zipFile = AdmZip.ZipFile; - export = zipFile; + export = AdmZip; } diff --git a/angular-formly/angular-formly.d.ts b/angular-formly/angular-formly.d.ts index 9917d217f..2bf75af7d 100644 --- a/angular-formly/angular-formly.d.ts +++ b/angular-formly/angular-formly.d.ts @@ -9,6 +9,11 @@ declare module 'AngularFormly' { export = AngularFormly; } +declare module 'angular-formly' { + var angularFormlyDefaultExport: string; + export = angularFormlyDefaultExport; +} + declare module AngularFormly { @@ -301,6 +306,17 @@ declare module AngularFormly { }; + /** + * This allows you to place attributes with string values on the ng-model element. + * Easy to use alternative to ngModelAttrs option. + * + * see http://docs.angular-formly.com/docs/field-configuration-object#ngmodelelattrs-object + */ + ngModelElAttrs?: { + [key: string]: string; + }; + + /** * Used to tell angular-formly to not attempt to add the formControl property to your object. This is useful * for things like validation, but not necessary if your "field" doesn't use ng-model (if it's just a horizontal @@ -572,4 +588,4 @@ declare module AngularFormly { messages: { [key: string]: ($viewValue: any, $modelValue: any, scope: ITemplateScope) => string }; } -} \ No newline at end of file +} diff --git a/angular-google-analytics/angular-google-analytics-tests.ts b/angular-google-analytics/angular-google-analytics-tests.ts new file mode 100644 index 000000000..9da39ba3c --- /dev/null +++ b/angular-google-analytics/angular-google-analytics-tests.ts @@ -0,0 +1,56 @@ +/// + +function ConfigurationMethodChaining(AnalyticsProvider: angular.google.analytics.AnalyticsProvider) { + AnalyticsProvider + .logAllCalls(true) + .startOffline(true) + .useECommerce(true, true); +} + +function EnableECommerce(AnalyticsProvider: angular.google.analytics.AnalyticsProvider) { + AnalyticsProvider.useECommerce(true, false); + AnalyticsProvider.useECommerce(true, true); + AnalyticsProvider.setCurrency("CDN"); +} + +function SetGoogleAnalyticsAccounts(AnalyticsProvider: angular.google.analytics.AnalyticsProvider) { + AnalyticsProvider.setAccount("UA-XXXXX-xx"); + AnalyticsProvider.setAccount([ + { tracker: "UA-12345-12", name: "tracker1" }, + { tracker: "UA-12345-34", name: "tracker2" } + ]); +} + +function UseClassicAnalytics(AnalyticsProvider: angular.google.analytics.AnalyticsProvider) { + AnalyticsProvider.useAnalytics(false); +} + +function UseDisplayFeatures(AnalyticsProvider: angular.google.analytics.AnalyticsProvider) { + AnalyticsProvider.useDisplayFeatures(true); +} + +function UseEnhancedLinkAttribution(AnalyticsProvider: angular.google.analytics.AnalyticsProvider) { + AnalyticsProvider.useEnhancedLinkAttribution(true); +} + +function UseCrossDomainLinking(AnalyticsProvider: angular.google.analytics.AnalyticsProvider) { + AnalyticsProvider.useCrossDomainLinker(true); + AnalyticsProvider.setCrossLinkDomains(["domain-1.com", "domain-2.com"]); +} + +function SetCookieConfiguration(AnalyticsProvider: angular.google.analytics.AnalyticsProvider) { + AnalyticsProvider.setCookieConfig({ + cookieDomain: "foo.example.com", + cookieName: "myNewName", + cookieExpires: 20000 + }); +} + +function SetRouteTrackingBehaviors(AnalyticsProvider: angular.google.analytics.AnalyticsProvider) { + AnalyticsProvider.trackPages(true); + AnalyticsProvider.trackUrlParams(true); + AnalyticsProvider.ignoreFirstPageLoad(true); + AnalyticsProvider.trackPrefix("my-application"); + AnalyticsProvider.setPageEvent("$stateChangeSuccess"); + AnalyticsProvider.setRemoveRegExp(/\/\d+?$/); +} diff --git a/angular-google-analytics/angular-google-analytics.d.ts b/angular-google-analytics/angular-google-analytics.d.ts new file mode 100644 index 000000000..e3aa5551e --- /dev/null +++ b/angular-google-analytics/angular-google-analytics.d.ts @@ -0,0 +1,173 @@ +// Type definitions for angular-google-analytics v1.1.0 +// Project: https://github.com/revolunet/angular-google-analytics +// Definitions by: Cyril Schumacher +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module angular.google.analytics { + /** + * @summary Interface for {@link AnalysticsProvider}. + * @interface + */ + interface AnalyticsProvider { + /** + * @summary Use Delay Script Tag Insertion. + * @param {boolean} val If true, the delay script tag is inserted. + * @return {angular.google.analytics.IAnalyticsProvider} The object instance. + */ + delayScriptTag(val: boolean): AnalyticsProvider; + + /** + * @summary Activates the test mode. + */ + enterTestMode(): void; + + /** + * @summary Gets the global cookie configuration. + * @return {Object} The global cookie configuration. + */ + getCookieConfig(): Object; + + /** + * @summary Ignore first page view. + * @param {boolean} val If true, the first page view is ignored. + * @return {angular.google.analytics.IAnalyticsProvider} The object instance. + */ + ignoreFirstPageLoad(val: boolean): AnalyticsProvider; + + /** + * @summary Enable Service Logging. + * @param {boolean} val If true, log all outbound calls to an in-memory array accessible. + * @return {angular.google.analytics.IAnalyticsProvider} The object instance. + */ + logAllCalls(val: boolean): AnalyticsProvider; + + /** + * @summary Set Google Analytics Accounts. + * @param {Object} tracker The account identifier(s). + * @return {angular.google.analytics.IAnalyticsProvider} The object instance. + */ + setAccount(tracker: string|Object|Array): AnalyticsProvider; + + /** + * @summary Set Cookie Configuration. + * @param {Object} config The custom cookie parameters. + * @return {angular.google.analytics.IAnalyticsProvider} The object instance. + * @deprecated + */ + setCookieConfig(config: Object): AnalyticsProvider; + + /** + * @summary Set cross-linked domains. + * @param {Array} domains The domains. + * @return {angular.google.analytics.IAnalyticsProvider} The object instance. + */ + setCrossLinkDomains(domains: Array): AnalyticsProvider; + + /** + * @summary Set currency. + * @param {string} currencyCode The currency code. + * @return {angular.google.analytics.IAnalyticsProvider} The object instance. + */ + setCurrency(currencyCode: string): AnalyticsProvider; + + /** + * @summary Set Domain Name. + * @param {string} domain The domain name. + * @return {angular.google.analytics.IAnalyticsProvider} The object instance. + */ + setDomainName(domain: string): AnalyticsProvider; + + /** + * @summary Enable Experiment (universal analytics only). + * @param {string} id The experiment identifier. + * @return {angular.google.analytics.IAnalyticsProvider} The object instance. + */ + setExperimentId(id: string): AnalyticsProvider; + + /** + * @summary Support Hybrid Mobile Applications. + * @param {boolean} val If true, each account object will disable protocol checking and all injected scripts will use the HTTPS protocol. + */ + setHybridMobileSupport(val: boolean): AnalyticsProvider; + + /** + * @summary Set the default page event name. + * @param {string} name The default page event name. + * @return {angular.google.analytics.IAnalyticsProvider} The object instance. + */ + setPageEvent(name: string): AnalyticsProvider; + + /** + * @summary Sets the regex to scrub location before sending to analytics. + * @return {angular.google.analytics.IAnalyticsProvider} The object instance. + * @param {RegExp} regex The regex. + */ + setRemoveRegExp(regex: RegExp): AnalyticsProvider; + + /** + * @summary Starts the offline mode. + * @param {boolean} val If true, the offline mode is started. + * @return {angular.google.analytics.IAnalyticsProvider} The object instance. + */ + startOffline(val: boolean): AnalyticsProvider; + + /** + * @summary Track all routes. + * @param {boolean} val If true, all routes are tracked. + * @return {angular.google.analytics.IAnalyticsProvider} The object instance. + */ + trackPages(doTrack: boolean): AnalyticsProvider; + + /** + * @summary Sets the URL prefix. + * @param {string} prefix The URL prefix. + * @return {angular.google.analytics.IAnalyticsProvider} The object instance. + */ + trackPrefix(prefix: string): AnalyticsProvider; + + /** + * @summary Track all URL query parameters. + * @param {boolean} val If true, all URL query parameters are tracked. + * @return {angular.google.analytics.IAnalyticsProvider} The object instance. + */ + trackUrlParams(val: boolean): AnalyticsProvider; + + /** + * @summary Use Classic Analytics. + * @param {boolean} val If true, use classic analytics. + * @return {angular.google.analytics.IAnalyticsProvider} The object instance. + */ + useAnalytics(val: boolean): AnalyticsProvider; + + /** + * @summary Use Cross Domain Linking. + * @param {boolean} val If true, the cross-linked domains are registered with Google Analytics. + * @return {angular.google.analytics.IAnalyticsProvider} The object instance. + */ + useCrossDomainLinker(val: boolean): AnalyticsProvider; + + /** + * @summary Use Display Features. + * @param {boolean} val If true, the display features module is loaded with Google Analytics. + * @return {angular.google.analytics.IAnalyticsProvider} The object instance. + */ + useDisplayFeatures(val: boolean): AnalyticsProvider; + + /** + * @summary Enable enhanced e-commerce module. + * @param {boolean} val If true, the enhanced e-commerce module is enabled. + * @param {boolean} enhanced If true, the "ec.js" file is used, otherwises, the "ecommerce.js" is used. + * @return {angular.google.analytics.IAnalyticsProvider} The object instance. + */ + useECommerce(val: boolean, enhanced: boolean): AnalyticsProvider; + + /** + * @summary Use Enhanced Link Attribution. + * @param {boolean} val If true, the enhanced link attribution module is loaded with Google Analytics. + * @return {angular.google.analytics.IAnalyticsProvider} The object instance. + */ + useEnhancedLinkAttribution(val: boolean): AnalyticsProvider; + } +} diff --git a/angular-growl-v2/angular-growl-v2-tests.ts b/angular-growl-v2/angular-growl-v2-tests.ts index c9297932e..fdb661161 100644 --- a/angular-growl-v2/angular-growl-v2-tests.ts +++ b/angular-growl-v2/angular-growl-v2-tests.ts @@ -8,25 +8,27 @@ app.config((growlProvider:angular.growl.IGrowlProvider, $httpProvider:angular.IH error: 4000 }; - growlProvider.globalTimeToLive(ttl); - growlProvider.globalTimeToLive(5000); - growlProvider.globalDisableCloseButton(true); - growlProvider.globalDisableIcons(true); - growlProvider.globalReversedOrder(false); - growlProvider.globalDisableCountDown(true); - growlProvider.messageVariableKey("someKey"); - growlProvider.globalInlineMessages(false); - growlProvider.globalPosition("top-center"); - growlProvider.messagesKey("someKey"); - growlProvider.messageTextKey("someKey"); - growlProvider.messageTitleKey("someKey"); - growlProvider.messageSeverityKey("someKey"); - growlProvider.onlyUniqueMessages(false); + growlProvider.globalTimeToLive(ttl) + .globalTimeToLive(5000) + .globalDisableCloseButton(true) + .globalDisableIcons(true) + .globalReversedOrder(false) + .globalDisableCountDown(true) + .messageVariableKey("someKey") + .globalInlineMessages(false) + .globalPosition("top-center") + .messagesKey("someKey") + .messageTextKey("someKey") + .messageTitleKey("someKey") + .messageSeverityKey("someKey") + .onlyUniqueMessages(false); $httpProvider.interceptors.push(growlProvider.serverMessagesInterceptor); }); -app.controller("Ctrl", ($scope:angular.IScope, growl:angular.growl.IGrowlService) => { +app.controller("Ctrl", ($scope:angular.IScope, + growl:angular.growl.IGrowlService, + growlMessages:angular.growl.IGrowlMessagesService) => { var config:angular.growl.IGrowlMessageConfig = { ttl: 5000, disableCountDown: true, @@ -50,4 +52,10 @@ app.controller("Ctrl", ($scope:angular.IScope, growl:angular.growl.IGrowlService growl.reverseOrder(); growl.inlineMessages(); growl.position(); + + growlMessages.initDirective(1, 10); + var messages:angular.growl.IGrowlMessage[] = growlMessages.getAllMessages(2); + growlMessages.destroyAllMessages(0); + growlMessages.addMessage(messages[0]); + growlMessages.deleteMessage(messages[1]); }); diff --git a/angular-growl-v2/angular-growl-v2.d.ts b/angular-growl-v2/angular-growl-v2.d.ts index 039490e3d..a8e262071 100644 --- a/angular-growl-v2/angular-growl-v2.d.ts +++ b/angular-growl-v2/angular-growl-v2.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Angular Growl 2 v.0.7.3 +// Type definitions for Angular Growl 2 v.0.7.5 // Project: http://janstevens.github.io/angular-growl-2 // Definitions by: Tadeusz Hucal // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -54,73 +54,73 @@ declare module angular.growl { * Set default TTL settings. * @param ttl configuration of TTL for different type of message */ - globalTimeToLive(ttl: IGrowlTTLConfig): void; + globalTimeToLive(ttl: IGrowlTTLConfig): IGrowlProvider; /** * Set default TTL settings. * @param ttl ttl in milliseconds */ - globalTimeToLive(ttl: number): void; + globalTimeToLive(ttl: number): IGrowlProvider; /** * Set default setting for disabling close button. * @param disableCloseButton */ - globalDisableCloseButton(disableCloseButton: boolean): void; + globalDisableCloseButton(disableCloseButton: boolean): IGrowlProvider; /** * Set default setting for disabling icons. * @param disableIcons */ - globalDisableIcons(disableIcons: boolean): void; + globalDisableIcons(disableIcons: boolean): IGrowlProvider; /** * Set reversing order of displaying new messages. * @param reverseOrder */ - globalReversedOrder(reverseOrder: boolean): void + globalReversedOrder(reverseOrder: boolean): IGrowlProvider; /** * Set default setting for displaying message disappear countdown. * @param disableCountDown */ - globalDisableCountDown(disableCountDown: boolean): void; + globalDisableCountDown(disableCountDown: boolean): IGrowlProvider; /** * Set default allowance for inline messages. * @param inline */ - globalInlineMessages(inline: boolean): void; + globalInlineMessages(inline: boolean): IGrowlProvider; /** * Set default message position. * @param position */ - globalPosition(position: string): void; + globalPosition(position: string): IGrowlProvider; /** * Enable/disable displaying only unique messages. * @param onlyUniqueMessages */ - onlyUniqueMessages(onlyUniqueMessages: boolean): void; + onlyUniqueMessages(onlyUniqueMessages: boolean): IGrowlProvider; /** * Set key where messages are stored (for http interceptor). * @param messageVariableKey */ - messagesKey(messageKey: string): void; + messagesKey(messageKey: string): IGrowlProvider; /** * Set key where message text is stored (for http interceptor). * @param messageVariableKey */ - messageTextKey(messageTextKey: string): void; + messageTextKey(messageTextKey: string): IGrowlProvider; /** * Set key where title of message is stored (for http interceptor). * @param messageVariableKey */ - messageTitleKey(messageTitleKey: string): void; + messageTitleKey(messageTitleKey: string): IGrowlProvider; /** * Set key where severity of message is stored (for http interceptor). * @param messageVariableKey */ - messageSeverityKey(messageSeverityKey: string): void; + messageSeverityKey(messageSeverityKey: string): IGrowlProvider; /** * Set key where variables for message are stored (for http interceptor). * @param messageVariableKey */ - messageVariableKey(messageVariableKey: string): void; + messageVariableKey(messageVariableKey: string): IGrowlProvider; } /** @@ -211,4 +211,39 @@ declare module angular.growl { */ position(): string; } + + /** + * GrowlMessages service. + */ + interface IGrowlMessagesService { + /** + * Initialize a directive + * We look at the preloaded directive and use this else we + * create a new blank object + * @param referenceId + * @param limitMessages + */ + initDirective(referenceId: number, limitMessages: number): ng.IDirective; + + /** + * Get current messages + */ + getAllMessages(referenceId?: number): IGrowlMessage[]; + + /** + * Destroy all messages + */ + destroyAllMessages(referenceId?: number): void; + + /** + * Add a message + */ + addMessage(message: IGrowlMessage): IGrowlMessage; + + /** + * Delete a message + */ + deleteMessage(message: IGrowlMessage): void; + + } } diff --git a/angular-httpi/httpi-tests.ts b/angular-httpi/angular-httpi-tests.ts similarity index 97% rename from angular-httpi/httpi-tests.ts rename to angular-httpi/angular-httpi-tests.ts index 2d8ffa84f..47ac25228 100644 --- a/angular-httpi/httpi-tests.ts +++ b/angular-httpi/angular-httpi-tests.ts @@ -1,4 +1,4 @@ -/// +/// (function() { 'use strict'; diff --git a/angular-httpi/httpi.d.ts b/angular-httpi/angular-httpi.d.ts similarity index 100% rename from angular-httpi/httpi.d.ts rename to angular-httpi/angular-httpi.d.ts diff --git a/angular-jwt/angular-jwt.d.ts b/angular-jwt/angular-jwt.d.ts index 55bb3e4f6..620fcc8e4 100644 --- a/angular-jwt/angular-jwt.d.ts +++ b/angular-jwt/angular-jwt.d.ts @@ -25,6 +25,6 @@ declare module angular.jwt { } interface IJwtInterceptor { - tokenGetter(): string; + tokenGetter(...params : any[]): string; } } diff --git a/angular-material/angular-material-tests.ts b/angular-material/angular-material-tests.ts index 238d906db..3c70dd27e 100644 --- a/angular-material/angular-material-tests.ts +++ b/angular-material/angular-material-tests.ts @@ -44,10 +44,16 @@ myApp.controller('DialogController', ($scope: ng.IScope, $mdDialog: ng.material. }); }; $scope['alertDialog'] = () => { - $mdDialog.show($mdDialog.alert().content('Alert!')); + $mdDialog.show($mdDialog.alert().textContent('Alert!')); + }; + $scope['alertDialog'] = () => { + $mdDialog.show($mdDialog.alert().htmlContent('Alert!')); }; $scope['confirmDialog'] = () => { - $mdDialog.show($mdDialog.confirm().content('Confirm!')); + $mdDialog.show($mdDialog.confirm().textContent('Confirm!')); + }; + $scope['confirmDialog'] = () => { + $mdDialog.show($mdDialog.confirm().htmlContent('Confirm!')); }; $scope['hideDialog'] = $mdDialog.hide.bind($mdDialog, 'hide'); $scope['cancelDialog'] = $mdDialog.cancel.bind($mdDialog, 'cancel'); @@ -90,5 +96,5 @@ myApp.controller('SidenavController', ($scope: ng.IScope, $mdSidenav: ng.materia }); myApp.controller('ToastController', ($scope: ng.IScope, $mdToast: ng.material.IToastService) => { - $scope['openToast'] = () => $mdToast.show($mdToast.simple().content('Hello!')); -}); \ No newline at end of file + $scope['openToast'] = () => $mdToast.show($mdToast.simple().textContent('Hello!')); +}); diff --git a/angular-material/angular-material.d.ts b/angular-material/angular-material.d.ts index 3b9a896c9..43e0b9f53 100644 --- a/angular-material/angular-material.d.ts +++ b/angular-material/angular-material.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Angular Material 0.10.1-rc1+ (angular.material module) +// Type definitions for Angular Material 1.0.0-rc5+ (angular.material module) // Project: https://github.com/angular/material // Definitions by: Matt Traynham // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -28,7 +28,8 @@ declare module angular.material { interface IPresetDialog { title(title: string): T; - content(content: string): T; + textContent(textContent: string): T; + htmlContent(htmlContent: string): T; ok(ok: string): T; theme(theme: string): T; templateUrl(templateUrl?: string): T; @@ -115,7 +116,7 @@ declare module angular.material { } interface IToastPreset { - content(content: string): T; + textContent(content: string): T; action(action: string): T; highlightAction(highlightAction: boolean): T; capsule(capsule: boolean): T; diff --git a/angular-modal/angular-modal-tests.ts b/angular-modal/angular-modal-tests.ts new file mode 100644 index 000000000..cbb090cee --- /dev/null +++ b/angular-modal/angular-modal-tests.ts @@ -0,0 +1,104 @@ +/// +/// +/// + +var btfModal: angularModal.AngularModalFactory; + +// Using template URL +function withTemplateUrl() { + btfModal({ + controller: 'SomeController', + controllerAs: 'vm', + templateUrl: 'some-template.html' + }); +} + +// Using template +function withTemplate() { + btfModal({ + controller: 'SomeController', + controllerAs: 'vm', + template: '
' + }); +} + +// Using controller function +function withControllerAsFunction() { + btfModal({ + controller: function () {}, + template: '
' + }) +} + +// Using constructor function +function withControllerClass() { + class TestController { + constructor(dependency1:any, dependency2:any) {} + } + btfModal({ + controller: TestController, + template: '
' + }); +} + +// With container as selector +function withContainerAsString() { + btfModal({ + template: '
', + container: '.container' + }); +} + +// With container as jQuery element +function withContainerAsJquery() { + var container: JQuery = $('body'); + btfModal({ + template: '
', + container: container + }); +} + +// With container as DOM Element +function withContainerAsDom() { + var container: Element = document.getElementById('container'); + btfModal({ + template: '
', + container: container + }); +} + +// With container as DOM Element Array +function withContainerAsDomArray() { + var container: Element[] = [document.getElementById('container'), document.getElementById('container2')]; + btfModal({ + template: '
', + container: container + }); +} + +// With container as function +function withContainerAsFunction() { + btfModal({ + template: '
', + container: function() {} + }); +} + +// With container as array +function withContainerAsArray() { + btfModal({ + template: '
', + container: ['1', 2] + }); +} + +// Calling return values +function callingValues() { + var modal: angularModal.AngularModal = btfModal({ + template: '
' + }); + modal.activate().then(() => {}, () => {}); + modal.deactivate().then(() => {}, () => {}); + var isActive: boolean = modal.active(); +} + diff --git a/angular-modal/angular-modal.d.ts b/angular-modal/angular-modal.d.ts new file mode 100644 index 000000000..0effea95c --- /dev/null +++ b/angular-modal/angular-modal.d.ts @@ -0,0 +1,38 @@ +// Type definitions for angular-modal 0.5.0 +// Project: https://github.com/btford/angular-modal +// Definitions by: Paul Lessing +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// +/// + +declare module angularModal { + + type AngularModalControllerDefinition = (new (...args: any[]) => any) | Function | string; // Possible arguments to IControllerService + + type AngularModalJQuerySelector = string | Element | Element[] | JQuery | Function | any[] | {}; // Possible arguments to IAugmentedJQueryStatic + + interface AngularModalSettings { + controller?: AngularModalControllerDefinition; + controllerAs?: string; + container?: AngularModalJQuerySelector; + } + + export interface AngularModalSettingsWithTemplate extends AngularModalSettings { + template: any; + } + + export interface AngularModalSettingsWithTemplateUrl extends AngularModalSettings { + templateUrl: string; + } + + export interface AngularModal { + activate(): angular.IPromise; + deactivate(): angular.IPromise; + active(): boolean; + } + + export interface AngularModalFactory { + (settings: AngularModalSettingsWithTemplate | AngularModalSettingsWithTemplateUrl): AngularModal; + } +} diff --git a/angular-notify/angular-notify.d.ts b/angular-notify/angular-notify.d.ts index 7e55dc654..f97c94e7a 100644 --- a/angular-notify/angular-notify.d.ts +++ b/angular-notify/angular-notify.d.ts @@ -1,4 +1,4 @@ -// Type definitions for angular-notify 2.0.2 +// Type definitions for angular-notify 2.5.0 // Project: https://github.com/cgross/angular-notify // Definitions by: Suwato // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -51,6 +51,11 @@ declare module angular.cgNotify { * Optional. Currently center and right are the only acceptable values. */ position? : string; + + /** + * Optional. The duration (in milliseconds) of the message. A duration of 0 will prevent the message from closing automatically. + */ + duration? : number; /** * Optional. Element that contains each notification. Defaults to document.body. @@ -94,6 +99,11 @@ declare module angular.cgNotify { * The default element that contains each notification. Defaults to document.body. */ container? : any; + + /** + * The maximum number of total notifications that can be visible at one time. Older notifications will be closed when the maximum is reached. + */ + maximumOpen? : number; }):void; /** diff --git a/angularjs/README.md b/angularjs/README.md index 510f304f5..e1256e905 100644 --- a/angularjs/README.md +++ b/angularjs/README.md @@ -42,7 +42,7 @@ To avoid cluttering the list of suggestions as you type in your IDE, all interfa **ngMockE2E** does not define a new namespace, but rather modifies some of **ng**'s interfaces. -Bellow is an example of how to use the interfaces: +Below is an example of how to use the interfaces: ```ts function MainController($scope: ng.IScope, $http: ng.IHttpService) { // code assistance will now be available for $scope and $http diff --git a/angularjs/angular.d.ts b/angularjs/angular.d.ts index 040622b51..a489141d5 100644 --- a/angularjs/angular.d.ts +++ b/angularjs/angular.d.ts @@ -165,6 +165,12 @@ declare module angular { dot: number; codeName: string; }; + + /** + * If window.name contains prefix NG_DEFER_BOOTSTRAP! when angular.bootstrap is called, the bootstrap process will be paused until angular.resumeBootstrap() is called. + * @param extraModules An optional array of modules that should be added to the original list of modules that the app was about to be bootstrapped with. + */ + resumeBootstrap?(extraModules?: string[]): ng.auto.IInjectorService; } /////////////////////////////////////////////////////////////////////////// @@ -615,7 +621,7 @@ declare module angular { // see http://docs.angularjs.org/api/ng.$interval /////////////////////////////////////////////////////////////////////////// interface IIntervalService { - (func: Function, delay: number, count?: number, invokeApply?: boolean): IPromise; + (func: Function, delay: number, count?: number, invokeApply?: boolean, ...args: any[]): IPromise; cancel(promise: IPromise): boolean; } @@ -774,7 +780,7 @@ declare module angular { * @param reverse Reverse the order of the array. * @return Reverse the order of the array. */ - (array: T[], expression: string|string[]|((value: T) => any)|((value: T) => any)[], reverse?: boolean): T[]; + (array: T[], expression: string|((value: T) => any)|(((value: T) => any)|string)[], reverse?: boolean): T[]; } /** @@ -1660,6 +1666,7 @@ declare module angular { restrict?: string; scope?: any; template?: any; + templateNamespace?: string; templateUrl?: any; terminal?: boolean; transclude?: any; diff --git a/anydb-sql-migrations/anydb-sql-migrations-tests.ts b/anydb-sql-migrations/anydb-sql-migrations-tests.ts new file mode 100644 index 000000000..f9c3da03a --- /dev/null +++ b/anydb-sql-migrations/anydb-sql-migrations-tests.ts @@ -0,0 +1,17 @@ +/// +/// +import anydbsql = require('anydb-sql'); +import { Table, Column } from 'anydb-sql' +import migrator = require('anydb-sql-migrations'); + +function do_not_run() { + + var db = anydbsql({ + url: 'postgres://user:pass@host:port/database', + connections: { min: 2, max: 20 } + }); + + migrator + .create(db, '/path/to/migrations/dir') + .run(); +} diff --git a/anydb-sql-migrations/anydb-sql-migrations.d.ts b/anydb-sql-migrations/anydb-sql-migrations.d.ts new file mode 100644 index 000000000..9ab421c3a --- /dev/null +++ b/anydb-sql-migrations/anydb-sql-migrations.d.ts @@ -0,0 +1,34 @@ +// Type definitions for anydb-sql-migrations +// Project: https://github.com/spion/anydb-sql-migrations +// Definitions by: Gorgi Kosev +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// +/// + +declare module "anydb-sql-migrations" { + import Promise = require('bluebird'); + import { Column, Table, Transaction, AnydbSql } from 'anydb-sql'; + export interface Migration { + version: string; + } + export interface MigrationsTable extends Table { + version: Column; + } + export interface MigFn { + (tx: Transaction): Promise; + } + export interface MigrationTask { + up: MigFn; + down: MigFn; + name: string; + } + export function create(db: AnydbSql, tasks: any): { + run: () => Promise; + migrateTo: (target?: string) => Promise; + check: (f: (m: { + type: string; + items: MigrationTask[]; + }) => any) => Promise; + }; +} \ No newline at end of file diff --git a/anydb-sql/anydb-sql-tests.ts b/anydb-sql/anydb-sql-tests.ts new file mode 100644 index 000000000..9e0264f7b --- /dev/null +++ b/anydb-sql/anydb-sql-tests.ts @@ -0,0 +1,70 @@ +/// +import anydbsql = require('anydb-sql'); +import { Table, Column } from 'anydb-sql' + +function do_not_run() { + + var db = anydbsql({ + url: 'postgres://user:pass@host:port/database', + connections: { min: 2, max: 20 } + }); + + // Table Post + + interface Post { + content: string; + userId: string; + date: string; + } + + interface PostTable extends Table { + content: Column; + userId: Column; + date: Column; + } + + var post = db.define({ + name: 'posts', + columns: { + content: {}, + userId: {}, + date: {} + } + }); + + // Table User + + interface User { + id: string; + email: string; + password: string; + name: string; + } + + interface UserTable extends Table { + id: Column; + email: Column; + password: Column; + name: Column; + } + + var user = db.define({ + name: 'users', + columns: { + id: { primaryKey: true }, + email: {}, + password: {}, + name: {}, + date: {} + }, + has: { + posts: { from: 'posts', many: true }, + group: { from: 'groups'} + } + }); + + user.select(user.name, post.content) + .from(user.join(post).on(user.id.equals(post.userId))) + .where(post.date.gt('123')) + .all() +} \ No newline at end of file diff --git a/anydb-sql/anydb-sql.d.ts b/anydb-sql/anydb-sql.d.ts new file mode 100644 index 000000000..d8bce402b --- /dev/null +++ b/anydb-sql/anydb-sql.d.ts @@ -0,0 +1,194 @@ +// Type definitions for anydb-sql +// Project: https://github.com/doxout/anydb-sql +// Definitions by: Gorgi Kosev +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare module "anydb-sql" { + import Promise = require('bluebird'); + + interface AnyDBPool extends anydbSQL.DatabaseConnection { + query:(text:string, values:any[], callback:(err:Error, result:any)=>void)=>void + begin:()=>anydbSQL.Transaction + close:(err:Error)=>void + } + + interface Dictionary { [key:string]:T; } + + module anydbSQL { + export interface OrderByValueNode {} + export interface ColumnDefinition { + primaryKey?:boolean; + dataType?:string; + references?: {table:string; column: string} + notNull?:boolean + } + + export interface TableDefinition { + name:string + columns:Dictionary + has?:Dictionary<{from:string; many?:boolean}> + } + + + export interface QueryLike { + query:string; + values: any[] + text:string + } + export interface DatabaseConnection { + queryAsync(query:string, ...params:any[]):Promise<{rowCount:number;rows:T[]}> + queryAsync(query:QueryLike):Promise<{rowCount:number;rows:T[]}> + } + + export interface Transaction extends DatabaseConnection { + rollback():void + commitAsync():Promise + } + + export interface SubQuery { + select(node:Column):SubQuery + where(...nodes:any[]):SubQuery + from(table:TableNode):SubQuery + group(...nodes:any[]):SubQuery + order(criteria:OrderByValueNode):SubQuery + notExists(subQuery:SubQuery):SubQuery + } + + interface Executable { + get():Promise + getWithin(tx:DatabaseConnection):Promise + exec():Promise + all():Promise + execWithin(tx:DatabaseConnection):Promise + allWithin(tx:DatabaseConnection):Promise + toQuery():QueryLike; + } + + interface Queryable { + where(...nodes:any[]):Query + delete():ModifyingQuery + select(...nodes:any[]):Query + selectDeep(table: Table): Query + selectDeep(...nodesOrTables:any[]):Query + } + + export interface Query extends Executable, Queryable { + from(table:TableNode):Query + update(o:Dictionary):ModifyingQuery + update(o:{}):ModifyingQuery + group(...nodes:any[]):Query + order(...criteria:OrderByValueNode[]):Query + limit(l:number):Query + offset(o:number):Query + } + + export interface ModifyingQuery extends Executable { + returning(...nodes:any[]):Query + where(...nodes:any[]):ModifyingQuery + } + + export interface TableNode { + join(table:TableNode):JoinTableNode + leftJoin(table:TableNode):JoinTableNode + } + + export interface JoinTableNode extends TableNode { + on(filter:BinaryNode):TableNode + on(filter:string):TableNode + } + + interface CreateQuery extends Executable { + ifNotExists():Executable + } + interface DropQuery extends Executable { + ifExists():Executable + } + export interface Table extends TableNode, Queryable { + create():CreateQuery + drop():DropQuery + as(name:string):Table + update(o:any):ModifyingQuery + insert(row:T):ModifyingQuery + insert(rows:T[]):ModifyingQuery + select():Query + select(...nodes:any[]):Query + from(table:TableNode):Query + star():Column + subQuery():SubQuery + eventEmitter:{emit:(type:string, ...args:any[])=>void + on:(eventName:string, handler:Function)=>void} + columns:Column[] + sql: SQL; + alter():AlterQuery + } + export interface AlterQuery extends Executable { + addColumn(column:Column): AlterQuery; + addColumn(name: string, options:string): AlterQuery; + dropColumn(column: Column): AlterQuery; + renameColumn(column: Column, newColumn: Column):AlterQuery; + renameColumn(column: Column, newName: string):AlterQuery; + renameColumn(name: string, newName: string):AlterQuery; + rename(newName: string): AlterQuery + } + + export interface SQL { + functions: { + LOWER(c:Column):Column + } + } + + export interface BinaryNode { + and(node:BinaryNode):BinaryNode + or(node:BinaryNode):BinaryNode + } + + export interface Column { + in(arr:T[]):BinaryNode + in(subQuery:SubQuery):BinaryNode + notIn(arr:T[]):BinaryNode + equals(node:any):BinaryNode + notEquals(node:any):BinaryNode + gte(node:any):BinaryNode + lte(node:any):BinaryNode + gt(node:any):BinaryNode + lt(node:any):BinaryNode + like(str:string):BinaryNode + multiply:{ + (node:Column):Column + (n:number):Column + } + isNull():BinaryNode + isNotNull():BinaryNode + sum():Column + count():Column + count(name:string):Column + distinct():Column + as(name:string):Column + ascending:OrderByValueNode + descending:OrderByValueNode + asc:OrderByValueNode + desc:OrderByValueNode + } + + export interface AnydbSql extends DatabaseConnection { + define(map:TableDefinition):Table; + transaction(fn:(tx:Transaction)=>Promise):Promise + allOf(...tables:Table[]):any + models:Dictionary> + functions:{LOWER:(name:Column)=>Column + RTRIM:(name:Column)=>Column} + makeFunction(name:string):Function + begin():Transaction + open():void; + close():void; + getPool():AnyDBPool; + dialect():string; + } + } + + function anydbSQL(config:Object):anydbSQL.AnydbSql; + + export = anydbSQL; +} \ No newline at end of file diff --git a/applicationinsights/applicationinsights-tests.ts b/applicationinsights/applicationinsights-tests.ts index 871a029e8..8d4d83e9d 100644 --- a/applicationinsights/applicationinsights-tests.ts +++ b/applicationinsights/applicationinsights-tests.ts @@ -18,6 +18,7 @@ appInsights.client.trackEvent("custom event", {customProperty: "custom property appInsights.client.trackException(new Error("handled exceptions can be logged with this method")); appInsights.client.trackMetric("custom metric", 3); appInsights.client.trackTrace("trace message"); +appInsights.client.trackDependency("dependency name", "commandName", 500, true); // assign common properties to all telemetry appInsights.client.commonProperties = { diff --git a/applicationinsights/applicationinsights.d.ts b/applicationinsights/applicationinsights.d.ts index 12dffdd81..9fc6f494d 100644 --- a/applicationinsights/applicationinsights.d.ts +++ b/applicationinsights/applicationinsights.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Application Insights v0.15.1 +// Type definitions for Application Insights v0.15.7 // Project: https://github.com/Microsoft/ApplicationInsights-node.js // Definitions by: Scott Southwood // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -342,6 +342,19 @@ interface Client { trackRequest(request: any /* http.ServerRequest */, response: any /* http.ServerResponse */, properties?: { [key: string]: string; }): void; + /** + * Log information about a dependency of your app. Typically used to track the time database calls or outgoing http requests take from your server. + * @param name The name of the dependency (i.e. "myDatabse") + * @param commandname The name of the command executed on the dependency + * @param elapsedTimeMs The amount of time in ms that the dependency took to return the result + * @param success True if the dependency succeeded, false otherwise + * @param dependencyTypeName The type of the dependency (i.e. "SQL" "HTTP"). Defaults to empty. + * @param properties map[string, string] - additional data used to filter events and metrics in the portal. Defaults to empty. + * @param dependencyKind ContractsModule.DependencyKind of this dependency. Defaults to Other. + * @param async True if the dependency was executed asynchronously, false otherwise. Defaults to false + * @param dependencySource ContractsModule.DependencySourceType of this dependency. Defaults to Undefined. + */ + trackDependency(name: string, commandName: string, elapsedTimeMs: number, success: boolean, dependencyTypeName?: string, properties?: {}, dependencyKind?: any, async?: boolean, dependencySource?: number): void; /** * Immediately send all queued telemetry. */ diff --git a/archiver/archiver.d.ts b/archiver/archiver.d.ts index 570e1424a..e595083d6 100644 --- a/archiver/archiver.d.ts +++ b/archiver/archiver.d.ts @@ -16,12 +16,13 @@ /// declare module "archiver" { import * as FS from 'fs'; + import * as STREAM from 'stream'; interface nameInterface { name?: string; } - interface Archiver { + interface Archiver extends STREAM.Transform { pipe(writeStream: FS.WriteStream): void; append(readStream: FS.ReadStream, name: nameInterface): void; finalize(): void; @@ -38,4 +39,4 @@ declare module "archiver" { } export = archiver; -} \ No newline at end of file +} diff --git a/argparse/argparse-tests.ts b/argparse/argparse-tests.ts new file mode 100644 index 000000000..bf565c5f5 --- /dev/null +++ b/argparse/argparse-tests.ts @@ -0,0 +1,306 @@ +/// +// near copy of each of the tests from https://github.com/nodeca/argparse/tree/master/examples + +import {ArgumentParser, RawDescriptionHelpFormatter} from 'argparse'; +var args: any; + +var simpleExample = new ArgumentParser({ + version: '0.0.1', + addHelp: true, + description: 'Argparse example', +}); +simpleExample.addArgument( + ['-f', '--foo'], + { + help: 'foo bar', + } +); +simpleExample.addArgument( + ['-b', '--bar'], + { + help: 'bar foo', + } +); + +simpleExample.printHelp(); +console.log('-----------'); + +args = simpleExample.parseArgs('-f 1 -b2'.split(' ')); +console.dir(args); +console.log('-----------'); +args = simpleExample.parseArgs('-f=3 --bar=4'.split(' ')); +console.dir(args); +console.log('-----------'); +args = simpleExample.parseArgs('--foo 5 --bar 6'.split(' ')); +console.dir(args); +console.log('-----------'); + + + + +var choicesExample = new ArgumentParser({ + version: '0.0.1', + addHelp: true, + description: 'Argparse examples: choice' +}); + +choicesExample.addArgument(['foo'], { choices: 'abc' }); + +choicesExample.printHelp(); +console.log('-----------'); + +args = choicesExample.parseArgs(['c']); +console.dir(args); +console.log('-----------'); +// choicesExample.parseArgs(['X']); +// console.dir(args); + + + + +var constantExample = new ArgumentParser({ + version: '0.0.1', + addHelp: true, + description: 'Argparse examples: constant' +}); + +constantExample.addArgument( + ['-a'], + { + action: 'storeConst', + dest: 'answer', + help: 'store constant', + constant: 42 + } +); +constantExample.addArgument( + ['--str'], + { + action: 'appendConst', + dest: 'types', + help: 'append constant "str" to types', + constant: 'str' + } +); +constantExample.addArgument( + ['--int'], + { + action: 'appendConst', + dest: 'types', + help: 'append constant "int" to types', + constant: 'int' + } +); + +constantExample.addArgument( + ['--true'], + { + action: 'storeTrue', + help: 'store true constant' + } +); +constantExample.addArgument( + ['--false'], + { + action: 'storeFalse', + help: 'store false constant' + } +); + +constantExample.printHelp(); +console.log('-----------'); + +args = constantExample.parseArgs('-a --str --int --true'.split(' ')); +console.dir(args); + + + + +var nargsExample = new ArgumentParser({ + version: '0.0.1', + addHelp: true, + description: 'Argparse examples: nargs' +}); +nargsExample.addArgument( + ['-f', '--foo'], + { + help: 'foo bar', + nargs: 1 + } +); +nargsExample.addArgument( + ['-b', '--bar'], + { + help: 'bar foo', + nargs: '*' + } +); + +nargsExample.printHelp(); +console.log('-----------'); + +args = nargsExample.parseArgs('--foo a --bar c d'.split(' ')); +console.dir(args); +console.log('-----------'); +args = nargsExample.parseArgs('--bar b c f --foo a'.split(' ')); +console.dir(args); + + + + +var parent_parser = new ArgumentParser({ addHelp: false }); +// note addHelp:false to prevent duplication of the -h option +parent_parser.addArgument( + ['--parent'], + { type: 'int', help: 'parent' } +); + +var foo_parser = new ArgumentParser({ + parents: [parent_parser], + description: 'child1' +}); +foo_parser.addArgument(['foo']); +args = foo_parser.parseArgs(['--parent', '2', 'XXX']); +console.log(args); + +var bar_parser = new ArgumentParser({ + parents: [parent_parser], + description: 'child2' +}); +bar_parser.addArgument(['--bar']); +args = bar_parser.parseArgs(['--bar', 'YYY']); +console.log(args); + + + + +var prefixCharsExample = new ArgumentParser({ + version: '0.0.1', + addHelp: true, + description: 'Argparse examples: prefix_chars', + prefixChars: '-+' +}); +prefixCharsExample.addArgument(['+f', '++foo']); +prefixCharsExample.addArgument(['++bar'], { action: 'storeTrue' }); + +prefixCharsExample.printHelp(); +console.log('-----------'); + +args = prefixCharsExample.parseArgs(['+f', '1']); +console.dir(args); +args = prefixCharsExample.parseArgs(['++bar']); +console.dir(args); +args = prefixCharsExample.parseArgs(['++foo', '2', '++bar']); +console.dir(args); + + + + +var subparserExample = new ArgumentParser({ + version: '0.0.1', + addHelp: true, + description: 'Argparse examples: sub-commands' +}); + +var subparsers = subparserExample.addSubparsers({ + title: 'subcommands', + dest: "subcommand_name" +}); + +var bar = subparsers.addParser('c1', { addHelp: true, help: 'c1 help' }); +bar.addArgument( + ['-f', '--foo'], + { + action: 'store', + help: 'foo3 bar3' + } +); +var bar = subparsers.addParser( + 'c2', + { aliases: ['co'], addHelp: true, help: 'c2 help' } +); +bar.addArgument( + ['-b', '--bar'], + { + action: 'store', + type: 'int', + help: 'foo3 bar3' + } +); +subparserExample.printHelp(); +console.log('-----------'); + +args = subparserExample.parseArgs('c1 -f 2'.split(' ')); +console.dir(args); +console.log('-----------'); +args = subparserExample.parseArgs('c2 -b 1'.split(' ')); +console.dir(args); +console.log('-----------'); +args = subparserExample.parseArgs('co -b 1'.split(' ')); +console.dir(args); +console.log('-----------'); +subparserExample.parseArgs(['c1', '-h']); + + + + +var functionExample = new ArgumentParser({ description: 'Process some integers.' }); +function sum(arr: number[]) { + return arr.reduce(function(a, b) { + return a + b; + }, 0); +} +function max(arr: number[]) { + return Math.max.apply(Math, arr); +} + + +functionExample.addArgument(['integers'], { + metavar: 'N', + type: 'int', + nargs: '+', + help: 'an integer for the accumulator' +}); +functionExample.addArgument(['--sum'], { + dest: 'accumulate', + action: 'storeConst', + constant: sum, + defaultValue: max, + help: 'sum the integers (default: find the max)' +}); + +args = functionExample.parseArgs('--sum 1 2 -1'.split(' ')); +console.log(args.accumulate(args.integers)); + + + + +var formatterExample = new ArgumentParser({ + prog: 'PROG', + formatterClass: RawDescriptionHelpFormatter, + description: 'Keep the formatting\n' + + ' exactly as it is written\n' + + '\n' + + 'here\n' +}); + +formatterExample.addArgument(['--foo'], { + help: ' foo help should not\n' + + ' retain this odd formatting' +}); + +formatterExample.addArgument(['spam'], { + 'help': 'spam help' +}); + +var group = formatterExample.addArgumentGroup({ + title: 'title', + description: ' This text\n' + + ' should be indented\n' + + ' exactly like it is here\n' +}); + +group.addArgument(['--bar'], { + help: 'bar help' +}); +formatterExample.printHelp(); diff --git a/argparse/argparse.d.ts b/argparse/argparse.d.ts new file mode 100644 index 000000000..7585015a2 --- /dev/null +++ b/argparse/argparse.d.ts @@ -0,0 +1,90 @@ +// Type definitions for argparse v1.0.3 +// Project: https://github.com/nodeca/argparse +// Definitions by: Andrew Schurman +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module "argparse" { + export class ArgumentParser extends ArgumentGroup { + constructor(options? : ArgumentParserOptions); + + addSubparsers(options? : SubparserOptions) : SubParser; + parseArgs(args? : string[], ns? : Namespace|Object) : any; + printUsage() : void; + printHelp() : void; + formatUsage() : string; + formatHelp() : string; + parseKnownArgs(args? : string[], ns? : Namespace|Object) : any[]; + convertArgLineToArg(argLine : string) : string[]; + exit(status : number, message : string) : void; + error(err : string|Error) : void; + } + + interface Namespace {} + + class SubParser { + addParser(name : string, options? : SubArgumentParserOptions) : ArgumentParser; + } + + class ArgumentGroup { + addArgument(args : string[], options? : ArgumentOptions) : void; + addArgumentGroup(options? : ArgumentGroupOptions) : ArgumentGroup; + addMutuallyExclusiveGroup(options? : {required : boolean}) : ArgumentGroup; + setDefaults(options? : {}) : void; + getDefault(dest : string) : any; + } + + interface SubparserOptions { + title? : string; + description? : string; + prog? : string; + parserClass? : {new() : any}; + action? : string; + dest? : string; + help? : string; + metavar? : string; + } + + interface SubArgumentParserOptions extends ArgumentParserOptions { + aliases? : string[]; + help? : string; + } + + interface ArgumentParserOptions { + description? : string; + epilog? : string; + addHelp? : boolean; + argumentDefault? : any; + parents? : ArgumentParser[]; + prefixChars? : string; + formatterClass? : {new() : HelpFormatter|ArgumentDefaultsHelpFormatter|RawDescriptionHelpFormatter|RawTextHelpFormatter}; + prog? : string; + usage? : string; + version? : string; + } + + interface ArgumentGroupOptions { + prefixChars? : string; + argumentDefault? : any; + title? : string; + description? : string; + } + + export class HelpFormatter {} + export class ArgumentDefaultsHelpFormatter {} + export class RawDescriptionHelpFormatter {} + export class RawTextHelpFormatter {} + + interface ArgumentOptions { + action? : string; + optionStrings? : string[]; + dest? : string; + nargs? : string|number; + constant? : any; + defaultValue? : any; + type? : string|Function; + choices? : string|string[]; + required? : boolean; + help? : string; + metavar? : string; + } +} diff --git a/async-writer/async-writer-tests.ts b/async-writer/async-writer-tests.ts new file mode 100644 index 000000000..c26e31495 --- /dev/null +++ b/async-writer/async-writer-tests.ts @@ -0,0 +1,66 @@ +/// + +import asyncWriter = require('async-writer'); +import stream = require('stream'); + +class TestStream extends stream.Writable { + constructor(public output: string) { + super(); + } + _write(data: string, encoding: string, callback: Function) { + this.output += data; + callback(); + } +} + +// Simple usage +function simpleUsage(callback: () => void) { + var output = ''; + let testStream = new TestStream(output); + let out = asyncWriter.create(testStream) + .on('error', (err: Error) => { + console.error(err); + }) + .on('finish', () => { + console.log(testStream.output); + callback(); + }) + + out.write('A'); + out.write('B'); + out.write('C'); + out.end(); +} + + +// Asynchronous, out-of-order writing +function asyncUsage(callback: () => void) { + var output = ''; + let testStream = new TestStream(output); + let out = asyncWriter.create(testStream) + .on('error', (err: Error) => { + console.error(err); + }) + .on('finish', () => { + console.log(testStream.output); + callback(); + }) + + out.write('A'); + + let asyncOut = out.beginAsync(); + setTimeout(() => { + asyncOut.write('B'); + asyncOut.end(); + }, 1000); + + out.write('C'); + out.end(); +} + +// run test +simpleUsage(() => { + asyncUsage(() => { + console.log('DONE'); + }); +}); diff --git a/async-writer/async-writer.d.ts b/async-writer/async-writer.d.ts new file mode 100644 index 000000000..42f82d35c --- /dev/null +++ b/async-writer/async-writer.d.ts @@ -0,0 +1,78 @@ +// Type definitions for async-writer 1.4.1 +// Project: https://github.com/marko-js/async-writer +// Definitions by: Yuce Tekol +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module 'async-writer' { + import stream = require('stream'); + import events = require('events'); + + module async_writer { + interface EventFunction { + (event: string, callback: Function): void; + } + + class StringWriter { + constructor(events: events.EventEmitter); + end(): void; + write(what: string): StringWriter; + toString(): string; + } + + class BufferedWriter { + constructor(wrappedStream: stream.Stream); + flush(): void; + on(event: string, callback: Function): BufferedWriter; + once(event: string, callback: Function): BufferedWriter; + clear(): void; + end(): void; + write(what: string): BufferedWriter; + } + + interface BeginAsyncOptions { + last?: boolean; + timeout?: number; + name?: string; + } + + class AsyncWriter { + static enableAsyncStackTrace():void; + + constructor(writer?: any, global?: {[s: string]: any}, async?: boolean, buffer?: boolean); + isAsyncWriter: AsyncWriter; + sync(): void; + getAttributes(): {[s: string]: any}; + getAttribute(): any; + write(str: string): AsyncWriter; + getOutput(): string; + captureString(func: Function, thisObj: Object): string; + swapWriter(newWriter: StringWriter | BufferedWriter, func: Function, thisObj: Object): void; + createNestedWriter(writer: StringWriter | BufferedWriter): AsyncWriter; + beginAsync(options?: number | BeginAsyncOptions): AsyncWriter; + handleBeginAsync(options: number | BeginAsyncOptions, parent: AsyncWriter): void; + on(event: string, callback: Function): AsyncWriter; + once(event: string, callback: Function): AsyncWriter; + onLast(callback: Function): AsyncWriter; + emit(arg: any): AsyncWriter; + removeListener(): AsyncWriter; + pipe(stream: stream.Stream): AsyncWriter; + error(e: Error): void; + end(data?: any): AsyncWriter; + handleEnd(isAsync: boolean): void; + _finish(): void; + flush(): void; + } + + interface AsyncWriterOptions { + global?: {[s: string]: any}; + buffer?: boolean; + } + + function create(writer?: any, options?: AsyncWriterOptions): AsyncWriter; + function enableAsyncStackTrace(): void; + } + + export = async_writer; +} diff --git a/aws-sdk/aws-sdk-tests.ts b/aws-sdk/aws-sdk-tests.ts index 8a3464a6d..7411beb93 100644 --- a/aws-sdk/aws-sdk-tests.ts +++ b/aws-sdk/aws-sdk-tests.ts @@ -1,13 +1,256 @@ /// -import awsSdk = require('aws-sdk'); +import AWS = require('aws-sdk'); var str: string; -var creds: awsSdk.Credentials; +var creds: AWS.Credentials; -creds = new awsSdk.Credentials(str, str); -creds = new awsSdk.Credentials(str, str, str); +creds = new AWS.Credentials(str, str); +creds = new AWS.Credentials(str, str, str); str = creds.accessKeyId; -// more + +/* + * SQS + */ +var sqs:AWS.SQS + +//Default constructor +sqs = new AWS.SQS(); + +//Locking the API Version +sqs = new AWS.SQS({apiVersion: '2012-11-05'}); + +// Locking the API Version Globally +AWS.config.apiVersions = { + sqs: '2012-11-05', + // other service API versions +}; + +sqs.addPermission({ + AWSAccountIds: [ /* required */ + 'STRING_VALUE', + /* more items */ + ], + Actions: [ /* required */ + 'STRING_VALUE', + /* more items */ + ], + Label: 'STRING_VALUE', /* required */ + QueueUrl: 'STRING_VALUE' /* required */ + }, + function(err, data) { + if (err) console.log(err, err.stack); // an error occurred + else console.log(data); // successful response + }); + +sqs.changeMessageVisibility({ + QueueUrl: 'STRING_VALUE', /* required */ + ReceiptHandle: 'STRING_VALUE', /* required */ + VisibilityTimeout: 0 /* required */ + }, + function(err, data) { + if (err) console.log(err, err.stack); // an error occurred + else console.log(data); // successful response + }); + +sqs.changeMessageVisibilityBatch({ + Entries: [ /* required */ + { + Id: 'STRING_VALUE', /* required */ + ReceiptHandle: 'STRING_VALUE', /* required */ + VisibilityTimeout: 0 + }, + /* more items */ + ], + QueueUrl: 'STRING_VALUE' /* required */ + }, + function(err, data) { + if (err) console.log(err, err.stack); // an error occurred + else console.log(data); // successful response + }); + +sqs.createQueue({ + QueueName: 'STRING_VALUE', /* required */ + Attributes: { + someKey: 'STRING_VALUE', + /* anotherKey: ... */ + } + }, + function(err, data) { + if (err) console.log(err, err.stack); // an error occurred + else console.log(data); // successful response + }); + +sqs.deleteMessage({ + QueueUrl: 'STRING_VALUE', /* required */ + ReceiptHandle: 'STRING_VALUE' /* required */ + }, + function(err, data) { + if (err) console.log(err, err.stack); // an error occurred + else console.log(data); // successful response + }); + +sqs.deleteMessageBatch({ + Entries: [ /* required */ + { + Id: 'STRING_VALUE', /* required */ + ReceiptHandle: 'STRING_VALUE' /* required */ + }, + /* more items */ + ], + QueueUrl: 'STRING_VALUE' /* required */ + }, + function(err, data) { + if (err) console.log(err, err.stack); // an error occurred + else console.log(data); // successful response + }); + +sqs.deleteQueue({ + QueueUrl: 'STRING_VALUE' /* required */ + }, + function(err, data) { + if (err) console.log(err, err.stack); // an error occurred + else console.log(data); // successful response + }); + +sqs.getQueueAttributes({ + QueueUrl: 'STRING_VALUE', /* required */ + AttributeNames: [ + 'Policy | VisibilityTimeout | MaximumMessageSize | MessageRetentionPeriod | ApproximateNumberOfMessages | ApproximateNumberOfMessagesNotVisible | CreatedTimestamp | LastModifiedTimestamp | QueueArn | ApproximateNumberOfMessagesDelayed | DelaySeconds | ReceiveMessageWaitTimeSeconds | RedrivePolicy', + /* more items */ + ] + }, + function(err, data) { + if (err) console.log(err, err.stack); // an error occurred + else console.log(data); // successful response + }); + +sqs.getQueueUrl({ + QueueName: 'STRING_VALUE', /* required */ + QueueOwnerAWSAccountId: 'STRING_VALUE' + }, + function(err, data) { + if (err) console.log(err, err.stack); // an error occurred + else console.log(data); // successful response + }); + +sqs.listDeadLetterSourceQueues({ + QueueUrl: 'STRING_VALUE' /* required */ + }, function(err, data) { + if (err) console.log(err, err.stack); // an error occurred + else console.log(data); // successful response + }); + +sqs.listQueues({ + QueueNamePrefix: 'STRING_VALUE' + }, + function(err, data) { + if (err) console.log(err, err.stack); // an error occurred + else console.log(data); // successful response + }); + +sqs.purgeQueue({ + QueueUrl: 'STRING_VALUE' /* required */ + }, function(err, data) { + if (err) console.log(err, err.stack); // an error occurred + else console.log(data); // successful response + }); + +sqs.receiveMessage({ + QueueUrl: 'STRING_VALUE', /* required */ + AttributeNames: [ + 'Policy | VisibilityTimeout | MaximumMessageSize | MessageRetentionPeriod | ApproximateNumberOfMessages | ApproximateNumberOfMessagesNotVisible | CreatedTimestamp | LastModifiedTimestamp | QueueArn | ApproximateNumberOfMessagesDelayed | DelaySeconds | ReceiveMessageWaitTimeSeconds | RedrivePolicy', + /* more items */ + ], + MaxNumberOfMessages: 0, + MessageAttributeNames: [ + 'STRING_VALUE', + /* more items */ + ], + VisibilityTimeout: 0, + WaitTimeSeconds: 0 + }, function(err, data) { + if (err) console.log(err, err.stack); // an error occurred + else console.log(data); // successful response + }); + +sqs.removePermission({ + Label: 'STRING_VALUE', /* required */ + QueueUrl: 'STRING_VALUE' /* required */ + }, function(err, data) { + if (err) console.log(err, err.stack); // an error occurred + else console.log(data); // successful response + }); + +sqs.sendMessage({ + MessageBody: 'STRING_VALUE', /* required */ + QueueUrl: 'STRING_VALUE', /* required */ + DelaySeconds: 0, + MessageAttributes: { + someKey: { + DataType: 'STRING_VALUE', /* required */ + BinaryListValues: [ + new Buffer('...') || 'STRING_VALUE', + /* more items */ + ], + BinaryValue: new Buffer('...') || 'STRING_VALUE', + StringListValues: [ + 'STRING_VALUE', + /* more items */ + ], + StringValue: 'STRING_VALUE' + }, + /* anotherKey: ... */ + } + }, + function(err, data) { + if (err) console.log(err, err.stack); // an error occurred + else console.log(data); // successful response + }); + +sqs.sendMessageBatch({ + Entries: [ /* required */ + { + Id: 'STRING_VALUE', /* required */ + MessageBody: 'STRING_VALUE', /* required */ + DelaySeconds: 0, + MessageAttributes: { + someKey: { + DataType: 'STRING_VALUE', /* required */ + BinaryListValues: [ + new Buffer('...') , + /* more items */ + ], + BinaryValue: new Buffer('...'), + StringListValues: [ + 'STRING_VALUE', + /* more items */ + ], + StringValue: 'STRING_VALUE' + }, + /* anotherKey: ... */ + } + }, + /* more items */ + ], + QueueUrl: 'STRING_VALUE' /* required */ + }, + function(err, data) { + if (err) console.log(err, err.stack); // an error occurred + else console.log(data); // successful response + }); + +sqs.setQueueAttributes({ + Attributes: { /* required */ + someKey: 'STRING_VALUE', + /* anotherKey: ... */ + }, + QueueUrl: 'STRING_VALUE' /* required */ + }, function(err, data) { + if (err) console.log(err, err.stack); // an error occurred + else console.log(data); // successful response + }); + + \ No newline at end of file diff --git a/aws-sdk/aws-sdk-tests.ts.tscparams b/aws-sdk/aws-sdk-tests.ts.tscparams new file mode 100644 index 000000000..70401a77e --- /dev/null +++ b/aws-sdk/aws-sdk-tests.ts.tscparams @@ -0,0 +1 @@ +--noImplicitAny --module commonjs --target es5 \ No newline at end of file diff --git a/aws-sdk/aws-sdk.d.ts b/aws-sdk/aws-sdk.d.ts index 3a500bbbb..128341729 100644 --- a/aws-sdk/aws-sdk.d.ts +++ b/aws-sdk/aws-sdk.d.ts @@ -30,6 +30,16 @@ declare module "aws-sdk" { xhrAsync?: boolean; xhrWithCredentials?: boolean; } + + export class Endpoint { + constructor(endpoint:string); + + host:string; + hostname:string; + href:string; + port:number; + protocol:string; + } export interface Services { autoscaling?: any; @@ -99,7 +109,25 @@ declare module "aws-sdk" { export class SQS { constructor(options?: any); - public client: Sqs.Client; + endpoint:Endpoint; + + addPermission(params: SQS.AddPermissionParams, callback: (err:Error, data:any) => void): void; + changeMessageVisibility(params: SQS.ChangeMessageVisibilityParams, callback: (err:Error, data:any) => void): void; + changeMessageVisibilityBatch(params: SQS.ChangeMessageVisibilityBatchParams, callback: (err:Error, data:SQS.ChangeMessageVisibilityBatchResponse) => void): void; + createQueue(params: SQS.CreateQueueParams, callback: (err: Error, data: SQS.CreateQueueResult) => void): void; + deleteMessage(params: SQS.DeleteMessageParams, callback: (err: Error, data: any) => void): void; + deleteMessageBatch(params: SQS.DeleteMessageBatchParams, callback: (err: Error, data: SQS.DeleteMessageBatchResult) => void): void; + deleteQueue(params: { QueueUrl: string; }, callback: (err: Error, data: any) => void): void; + getQueueAttributes(params: SQS.GetQueueAttributesParams, callback: (err: Error, data: SQS.GetQueueAttributesResult) => void): void; + getQueueUrl(params: SQS.GetQueueUrlParams, callback: (err: Error, data: { QueueUrl: string; }) => void): void; + listDeadLetterSourceQueues(params: {QueueUrl:string}, callback: (err: Error, data: {queueUrls: string[]}) => void): void; + listQueues(params: {QueueNamePrefix?:string}, callback: (err: Error, data: {QueueUrls: string[]}) => void): void; + purgeQueue(params: {QueueUrl: string}, callback: (err: Error, data: any) => void): void; + receiveMessage(params: SQS.ReceiveMessageParams, callback: (err: Error, data: SQS.ReceiveMessageResult) => void): void; + removePermission(params: {QueueUrl: string, Label: string}, callback: (err: Error, data: any) => void): void; + sendMessage(params: SQS.SendMessageParams, callback: (err: Error, data: SQS.SendMessageResult) => void): void; + sendMessageBatch(params: SQS.SendMessageBatchParams, callback: (err: Error, data: SQS.SendMessageBatchResult) => void): void; + setQueueAttributes(params: SQS.SetQueueAttributesParams, callback: (err: Error, data: any) => void): void; } export class SES { @@ -126,36 +154,77 @@ declare module "aws-sdk" { constructor(options?: any); } - export module Sqs { - - export interface Client { - config: ClientConfig; - - sendMessage(params: SendMessageRequest, callback: (err: any, data: SendMessageResult) => void): void; - sendMessageBatch(params: SendMessageBatchRequest, callback: (err: any, data: SendMessageBatchResult) => void): void; - receiveMessage(params: ReceiveMessageRequest, callback: (err: any, data: ReceiveMessageResult) => void): void; - deleteMessage(params: DeleteMessageRequest, callback: (err: any, data: any) => void): void; - deleteMessageBatch(params: DeleteMessageBatchRequest, callback: (err: any, data: DeleteMessageBatchResult) => void): void; - createQueue(params: CreateQueueRequest, callback: (err: any, data: CreateQueueResult) => void): void; - deleteQueue(params: DeleteQueueRequest, callback: (err: any, data: any) => void): void; + export module SQS { + + export interface SqsOptions { + params?: any; + endpoint?: string; + accessKeyId?: string; + secretAccessKey?: string; + sessionToken?: Credentials; + credentials?: Credentials; + credentialProvider?: any; + region?: string; + maxRetries?: number; + maxRedirects?: number; + sslEnabled?: boolean; + paramValidation?: boolean; + computeChecksums?: boolean; + convertResponseTypes?: boolean; + correctClockSkew?: boolean; + s3ForcePathStyle?: boolean; + s3BucketEndpoint?: boolean; + httpOptions?: HttpOptions; + apiVersion?: string; + apiVersions?: { [serviceName:string]: string}; + logger?: Logger; + systemClockOffset?: number; + signatureVersion?: string; + signatureCache?: boolean; + } + + export interface AddPermissionParams { + QueueUrl: string; + Label: string; + AWSAccountIds:string[]; + Actions:string[]; + } + + export interface ChangeMessageVisibilityParams { + QueueUrl: string, + ReceiptHandle: string, + VisibilityTimeout: number + } + + export interface ChangeMessageVisibilityBatchParams { + QueueUrl: string, + Entries: { Id: string; ReceiptHandle: string; VisibilityTimeout?: number; }[] + } + + export interface ChangeMessageVisibilityBatchResponse { + Successful: { Id:string }[]; + Failed: BatchResultErrorEntry[]; } - export interface SendMessageRequest { - QueueUrl?: string; - MessageBody?: string; + export interface SendMessageParams { + QueueUrl: string; + MessageBody: string; DelaySeconds?: number; + MessageAttributes?: { [name:string]: MessageAttribute; } } - export interface ReceiveMessageRequest { - QueueUrl?: string; + export interface ReceiveMessageParams { + QueueUrl: string; MaxNumberOfMessages?: number; VisibilityTimeout?: number; AttributeNames?: string[]; + MessageAttributeNames?: string[]; + WaitTimeSeconds?:number; } - export interface DeleteMessageBatchRequest { - QueueUrl?: string; - Entries?: DeleteMessageBatchRequestEntry[]; + export interface DeleteMessageBatchParams { + QueueUrl: string; + Entries: DeleteMessageBatchRequestEntry[]; } export interface DeleteMessageBatchRequestEntry { @@ -163,85 +232,117 @@ declare module "aws-sdk" { ReceiptHandle: string; } - export interface DeleteMessageRequest { - QueueUrl?: string; - ReceiptHandle?: string; + export interface DeleteMessageParams { + QueueUrl: string; + ReceiptHandle: string; } - export class Attribute { - Name: string; - Value: string; + export interface SendMessageBatchParams { + QueueUrl: string; + Entries: SendMessageBatchRequestEntry[]; } - export interface SendMessageBatchRequest { - QueueUrl?: string; - Entries?: SendMessageBatchRequestEntry[]; - } - - export class SendMessageBatchRequestEntry { + export interface SendMessageBatchRequestEntry { Id: string; MessageBody: string; - DelaySeconds: number; - } - - export interface CreateQueueRequest { - QueueName?: string; - DefaultVisibilityTimeout?: number; DelaySeconds?: number; - Attributes?: Attribute[]; + MessageAttributes?: { [name:string]: MessageAttribute; } } - export interface DeleteQueueRequest { - QueueUrl?: string; + export interface CreateQueueParams { + QueueName: string; + Attributes: QueueAttributes; } - - export class SendMessageResult { + + export interface QueueAttributes { + [name:string]: any; + DelaySeconds?: number; + MaximumMessageSize?: number; + MessageRetentionPeriod?: number; + Policy?: any; + ReceiveMessageWaitTimeSeconds?: number; + VisibilityTimeout?: number; + RedrivePolicy?: any; + } + + export interface GetQueueAttributesParams { + QueueUrl: string; + AttributeNames: string[]; + } + + export interface GetQueueAttributesResult { + Attributes: {[name:string]: string}; + } + + export interface GetQueueUrlParams { + QueueName: string; + QueueOwnerAWSAccountId?: string; + } + + export interface SendMessageResult { MessageId: string; MD5OfMessageBody: string; + MD5OfMessageAttributes: string; } - export class ReceiveMessageResult { + export interface ReceiveMessageResult { Messages: Message[]; } - export class Message { + export interface Message { MessageId: string; ReceiptHandle: string; MD5OfBody: string; Body: string; - Attributes: Attribute[]; + Attributes: { [name:string]:any }; + MD5OfMessageAttributes:string; + MessageAttributes: { [name:string]: MessageAttribute; } } - export class DeleteMessageBatchResult { + export interface MessageAttribute { + StringValue?: string; + BinaryValue?: any; //(Buffer, Typed Array, Blob, String) + StringListValues?: string[]; + BinaryListValues?: any[]; + DataType: string; + } + + export interface DeleteMessageBatchResult { Successful: DeleteMessageBatchResultEntry[]; Failed: BatchResultErrorEntry[]; } - export class DeleteMessageBatchResultEntry { + export interface DeleteMessageBatchResultEntry { Id: string; } - export class BatchResultErrorEntry { + export interface BatchResultErrorEntry { Id: string; Code: string; - Message: string; - SenderFault: string; + Message?: string; + SenderFault: boolean; } - export class SendMessageBatchResult { + export interface SendMessageBatchResult { Successful: SendMessageBatchResultEntry[]; Failed: BatchResultErrorEntry[]; } - export class SendMessageBatchResultEntry { + export interface SendMessageBatchResultEntry { Id: string; MessageId: string; MD5OfMessageBody: string; + MD5OfMessageAttributes:string; } - export class CreateQueueResult { + export interface CreateQueueResult { QueueUrl: string; } + + export interface SetQueueAttributesParams { + QueueUrl: string; + Attributes: QueueAttributes; + } } diff --git a/bignum/bignum-tests.ts b/bignum/bignum-tests.ts new file mode 100644 index 000000000..363fad886 --- /dev/null +++ b/bignum/bignum-tests.ts @@ -0,0 +1,248 @@ +/// + +var bignum = require('bignum'); + +// Test constructors. +var instance = bignum(16); +bignum('16'); +bignum(instance); + +// Test `toNumber` function. +instance.toNumber(); + +bignum.toNumber(4); +bignum.toNumber('4'); +bignum.toNumber(bignum(4)); + +// Test `toBuffer` function. +instance.toBuffer(); + +bignum.toBuffer(4); +bignum.toBuffer('4'); +bignum.toBuffer(bignum(4)); + +// Test `add` function. +instance.add(4); +instance.add('4'); +instance.add(bignum(4)); + +bignum.add(instance, 4); +bignum.add(instance, '4'); +bignum.add(instance, bignum(4)); + +// Test `sub` function. +instance.sub(4); +instance.sub('4'); +instance.sub(bignum(4)); + +bignum.sub(instance, 4); +bignum.sub(instance, '4'); +bignum.sub(instance, bignum(4)); + +// Test `mul` function. +instance.mul(4); +instance.mul('4'); +instance.mul(bignum(4)); + +bignum.mul(instance, 4); +bignum.mul(instance, '4'); +bignum.mul(instance, bignum(4)); + +// Test `div` function. +instance.div(4); +instance.div('4'); +instance.div(bignum(4)); + +bignum.div(instance, 4); +bignum.div(instance, '4'); +bignum.div(instance, bignum(4)); + +// Test `abs` function. +instance.abs(); +bignum.abs(instance); + +// Test `neg` function. +instance.neg(); +bignum.neg(instance); + +// Test `cmp` function. +instance.cmp(4); +instance.cmp('4'); +instance.cmp(bignum(4)); + +bignum.cmp(instance, 4); +bignum.cmp(instance, '4'); +bignum.cmp(instance, bignum(4)); + +// Test `gt` function. +instance.gt(4); +instance.gt('4'); +instance.gt(bignum(4)); + +bignum.gt(instance, 4); +bignum.gt(instance, '4'); +bignum.gt(instance, bignum(4)); + +// Test `ge` function. +instance.ge(4); +instance.ge('4'); +instance.ge(bignum(4)); + +bignum.ge(instance, 4); +bignum.ge(instance, '4'); +bignum.ge(instance, bignum(4)); + +// Test `eq` function. +instance.eq(4); +instance.eq('4'); +instance.eq(bignum(4)); + +bignum.eq(instance, 4); +bignum.eq(instance, '4'); +bignum.eq(instance, bignum(4)); + +// Test `lt` function. +instance.lt(4); +instance.lt('4'); +instance.lt(bignum(4)); + +bignum.lt(instance, 4); +bignum.lt(instance, '4'); +bignum.lt(instance, bignum(4)); + +// Test `le` function. +instance.le(4); +instance.le('4'); +instance.le(bignum(4)); + +bignum.le(instance, 4); +bignum.le(instance, '4'); +bignum.le(instance, bignum(4)); + +// Test `and` function. +instance.and(4); +instance.and('4'); +instance.and(bignum(4)); + +bignum.and(instance, 4); +bignum.and(instance, '4'); +bignum.and(instance, bignum(4)); + +// Test `or` function. +instance.or(4); +instance.or('4'); +instance.or(bignum(4)); + +bignum.or(instance, 4); +bignum.or(instance, '4'); +bignum.or(instance, bignum(4)); + +// Test `xor` function. +instance.xor(4); +instance.xor('4'); +instance.xor(bignum(4)); + +bignum.xor(instance, 4); +bignum.xor(instance, '4'); +bignum.xor(instance, bignum(4)); + +// Test `mod` function. +instance.mod(4); +instance.mod('4'); +instance.mod(bignum(4)); + +bignum.mod(instance, 4); +bignum.mod(instance, '4'); +bignum.mod(instance, bignum(4)); + +// Test `pow` function. +instance.pow(4); +instance.pow('4'); +instance.pow(bignum(4)); + +bignum.pow(instance, 4); +bignum.pow(instance, '4'); +bignum.pow(instance, bignum(4)); + +// Test `powm` function. +instance.powm(4, 4); +instance.powm('4', 4); +instance.powm(bignum(4), 4); + +bignum.powm(instance, 4, 4); +bignum.powm(instance, '4', 4); +bignum.powm(instance, bignum(4), 4); + +instance.powm(4, '4'); +instance.powm('4', '4'); +instance.powm(bignum(4), '4'); + +bignum.powm(instance, 4, '4'); +bignum.powm(instance, '4', '4'); +bignum.powm(instance, bignum(4), '4'); + +instance.powm(4, bignum(4)); +instance.powm('4', bignum(4)); +instance.powm(bignum(4), bignum(4)); + +bignum.powm(instance, 4, bignum(4)); +bignum.powm(instance, '4', bignum(4)); +bignum.powm(instance, bignum(4), bignum(4)); + +// Test `invertm` function. +instance.invertm(4); +instance.invertm('4'); +instance.invertm(bignum(4)); + +bignum.invertm(instance, 4); +bignum.invertm(instance, '4'); +bignum.invertm(instance, bignum(4)); + +// Test `rand` function. +instance.rand(); +instance.rand(20); +instance.rand('20'); +instance.rand(bignum(20)); + +bignum.rand(instance); +bignum.rand(instance, 20); +bignum.rand(instance, '20'); +bignum.rand(instance, bignum(20)); + +// Test `probPrime` function. +instance.probPrime(); + +bignum.probPrime(instance); + +// Test `shiftLeft` function. +instance.shiftLeft(4); +instance.shiftLeft('4'); +instance.shiftLeft(bignum(4)); + +bignum.shiftLeft(instance, 4); +bignum.shiftLeft(instance, '4'); +bignum.shiftLeft(instance, bignum(4)); + +// Test `shiftRight` function. +instance.shiftRight(4); +instance.shiftRight('4'); +instance.shiftRight(bignum(4)); + +bignum.shiftRight(instance, 4); +bignum.shiftRight(instance, '4'); +bignum.shiftRight(instance, bignum(4)); + +// Test `gcd` function. +instance.gcd(bignum(4)); + +bignum.gcd(instance, bignum(4)); + +// Test `jacobi` function. +instance.jacobi(bignum(17)); + +bignum.jacobi(instance, bignum(17)); + +// Test `bitLength` function. +instance.bitLength(); + +bignum.bitLength(instance); diff --git a/bignum/bignum.d.ts b/bignum/bignum.d.ts new file mode 100644 index 000000000..b9e653e18 --- /dev/null +++ b/bignum/bignum.d.ts @@ -0,0 +1,269 @@ +// Type definitions for BigNum +// Project: https://github.com/justmoon/node-BigNum +// Definitions by: Pat Smuk +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare class BigNum { + /** Create a new BigNum from n. */ + constructor(n: number|BigNum); + + /** Create a new BigNum from n and a base. */ + constructor(n: string, base?: number); + + /** + * Create a new BigNum from a Buffer. + * + * The default options are: {endian: 'big', size: 1}. + */ + static fromBuffer(buffer: Buffer, options?: BigNum.BufferOptions): BigNum; + + /** + * Generate a probable prime of length bits. + * + * If safe is true, it will be a "safe" prime of the form p=2p'+1 where p' is also prime. + */ + static prime(bits: number, safe?: boolean): BigNum; + + /** Return true if num is identified as a BigNum instance. Otherwise, return false. */ + static isBigNum(num: any): boolean; + + /** Print out the BigNum instance in the requested base as a string. Default: base 10 */ + toString(base?: number): string; + + /** + * Turn a BigNum into a Number. + * + * If the BigNum is too big you'll lose precision or you'll get ±Infinity. + */ + toNumber(): number; + + /** + * Return a new Buffer with the data from the BigNum. + * + * The default options are: {endian: 'big', size: 1}. + */ + toBuffer(options?: BigNum.BufferOptions): Buffer; + + /** Return a new BigNum containing the instance value plus n. */ + add(n: BigNum.BigNumCompatible): BigNum; + + /** Return a new BigNum containing the instance value minus n. */ + sub(n: BigNum.BigNumCompatible): BigNum; + + /** Return a new BigNum containing the instance value multiplied by n. */ + mul(n: BigNum.BigNumCompatible): BigNum; + + /** Return a new BigNum containing the instance value integrally divided by n. */ + div(n: BigNum.BigNumCompatible): BigNum; + + /** Return a new BigNum with the absolute value of the instance. */ + abs(): BigNum; + + /** Return a new BigNum with the negative of the instance value. */ + neg(): BigNum; + + /** + * Compare the instance value to n. + * + * Return a positive integer if > n, a negative integer if < n, and 0 if == n. + */ + cmp(n: BigNum.BigNumCompatible): number; + + /** Return a boolean: whether the instance value is greater than n (> n). */ + gt(n: BigNum.BigNumCompatible): boolean; + + /** Return a boolean: whether the instance value is greater than or equal to n (>= n). */ + ge(n: BigNum.BigNumCompatible): boolean; + + /** Return a boolean: whether the instance value is equal to n (== n). */ + eq(n: BigNum.BigNumCompatible): boolean; + + /** Return a boolean: whether the instance value is less than n (< n). */ + lt(n: BigNum.BigNumCompatible): boolean; + + /** Return a boolean: whether the instance value is less than or equal to n (<= n). */ + le(n: BigNum.BigNumCompatible): boolean; + + /** Return a new BigNum with the instance value bitwise AND (&)-ed with n. */ + and(n: BigNum.BigNumCompatible): BigNum; + + /** Return a new BigNum with the instance value bitwise inclusive-OR (|)-ed with n. */ + or(n: BigNum.BigNumCompatible): BigNum; + + /** Return a new BigNum with the instance value bitwise exclusive-OR (^)-ed with n. */ + xor(n: BigNum.BigNumCompatible): BigNum; + + /** Return a new BigNum with the instance value modulo n. */ + mod(n: BigNum.BigNumCompatible): BigNum; + + /** Return a new BigNum with the instance value raised to the nth power. */ + pow(n: BigNum.BigNumCompatible): BigNum; + + /** Return a new BigNum with the instance value raised to the nth power modulo m. */ + powm(n: BigNum.BigNumCompatible, m: BigNum.BigNumCompatible): BigNum; + + /** Compute the multiplicative inverse modulo m. */ + invertm(m: BigNum.BigNumCompatible): BigNum; + + /** + * If upperBound is supplied, return a random BigNum between the instance value and upperBound - 1, inclusive. + * Otherwise, return a random BigNum between 0 and the instance value - 1, inclusive. + */ + rand(upperBound?: BigNum.BigNumCompatible): BigNum; + + /** + * Return whether the BigNum is: + * - certainly prime (true) + * - probably prime ('maybe') + * - certainly composite (false) + */ + probPrime(): boolean | string; + + /** Return a new BigNum that is the 2^n multiple. Equivalent of the << operator. */ + shiftLeft(n: BigNum.BigNumCompatible): BigNum; + + /** Return a new BigNum of the value integer divided by 2^n. Equivalent of the >> operator. */ + shiftRight(n: BigNum.BigNumCompatible): BigNum; + + /** Return the greatest common divisor of the current BigNum with n as a new BigNum. */ + gcd(n: BigNum): BigNum; + + /** + * Return the Jacobi symbol (or Legendre symbol if n is prime) of the current BigNum (= a) over n. + * Note that n must be odd and >= 3. 0 <= a < n. + * + * Returns -1 or 1 as an int (NOT a BigNum). Throws an error on failure. + */ + jacobi(n: BigNum): number; + + /** Return the number of bits used to represent the current BigNum. */ + bitLength(): number; +} + +declare namespace BigNum { + /** Anything that can be converted to BigNum. */ + type BigNumCompatible = BigNum | number | string; + + export interface BufferOptions { + /** Can be either 'big' or 'little'. Also accepts 1 for big and -1 for little. Doesn't matter when size = 1. */ + endian: string | number; + + /** Number of bytes per word, or 'auto' to flip entire Buffer. */ + size: number | string; + } + + /** + * Turn a BigNum into a Number. + * + * If the BigNum is too big you'll lose precision or you'll get ±Infinity. + */ + export function toNumber(n: BigNumCompatible): number; + + /** + * Return a new Buffer with the data from the BigNum. + * + * The default options are: {endian: 'big', size: 1}. + */ + export function toBuffer(n: BigNumCompatible, options?: BufferOptions): Buffer; + + /** Return a new BigNum containing the instance value plus n. */ + export function add(left: BigNumCompatible, right: BigNumCompatible): BigNum; + + /** Return a new BigNum containing the instance value minus n. */ + export function sub(left: BigNumCompatible, right: BigNumCompatible): BigNum; + + /** Return a new BigNum containing the instance value multiplied by n. */ + export function mul(left: BigNumCompatible, right: BigNumCompatible): BigNum; + + /** Return a new BigNum containing the instance value integrally divided by n. */ + export function div(dividend: BigNumCompatible, divisor: BigNumCompatible): BigNum; + + /** Return a new BigNum with the absolute value of the instance. */ + export function abs(n: BigNumCompatible): BigNum; + + /** Return a new BigNum with the negative of the instance value. */ + export function neg(n: BigNumCompatible): BigNum; + + /** + * Compare the instance value to n. + * + * Return a positive integer if > n, a negative integer if < n, and 0 if == n. + */ + export function cmp(left: BigNumCompatible, right: BigNumCompatible): number; + + /** Return a boolean: whether the instance value is greater than n (> n). */ + export function gt(left: BigNumCompatible, right: BigNumCompatible): boolean; + + /** Return a boolean: whether the instance value is greater than or equal to n (>= n). */ + export function ge(left: BigNumCompatible, right: BigNumCompatible): boolean; + + /** Return a boolean: whether the instance value is equal to n (== n). */ + export function eq(left: BigNumCompatible, right: BigNumCompatible): boolean; + + /** Return a boolean: whether the instance value is less than n (< n). */ + export function lt(left: BigNumCompatible, right: BigNumCompatible): boolean; + + /** Return a boolean: whether the instance value is less than or equal to n (<= n). */ + export function le(left: BigNumCompatible, right: BigNumCompatible): boolean; + + /** Return a new BigNum with the instance value bitwise AND (&)-ed with n. */ + export function and(left: BigNumCompatible, right: BigNumCompatible): BigNum; + + /** Return a new BigNum with the instance value bitwise inclusive-OR (|)-ed with n. */ + export function or(left: BigNumCompatible, right: BigNumCompatible): BigNum; + + /** Return a new BigNum with the instance value bitwise exclusive-OR (^)-ed with n. */ + export function xor(left: BigNumCompatible, right: BigNumCompatible): BigNum; + + /** Return a new BigNum with the instance value modulo n. */ + export function mod(left: BigNumCompatible, right: BigNumCompatible): BigNum; + + /** Return a new BigNum with the instance value raised to the nth power. */ + export function pow(base: BigNumCompatible, exponent: BigNumCompatible): BigNum; + + /** Return a new BigNum with the instance value raised to the nth power modulo m. */ + export function powm(base: BigNumCompatible, exponent: BigNumCompatible, m: BigNumCompatible): BigNum; + + /** Compute the multiplicative inverse modulo m. */ + export function invertm(n: BigNumCompatible, m: BigNumCompatible): BigNum; + + /** + * If upperBound is supplied, return a random BigNum between the instance value and upperBound - 1, inclusive. + * Otherwise, return a random BigNum between 0 and the instance value - 1, inclusive. + */ + export function rand(n: BigNumCompatible, upperBound?: BigNumCompatible): BigNum; + + /** + * Return whether the BigNum is: + * - certainly prime (true) + * - probably prime ('maybe') + * - certainly composite (false) + */ + export function probPrime(n: BigNumCompatible): boolean | string; + + /** Return a new BigNum that is the 2^bits multiple. Equivalent of the << operator. */ + export function shiftLeft(n: BigNumCompatible, bits: BigNumCompatible): BigNum; + + /** Return a new BigNum of the value integer divided by 2^bits. Equivalent of the >> operator. */ + export function shiftRight(n: BigNumCompatible, bits: BigNumCompatible): BigNum; + + /** Return the greatest common divisor of the current BigNum with n as a new BigNum. */ + export function gcd(left: BigNumCompatible, right: BigNum): BigNum; + + /** + * Return the Jacobi symbol (or Legendre symbol if n is prime) of the current BigNum (= a) over n. + * Note that n must be odd and >= 3. 0 <= a < n. + * + * Returns -1 or 1 as an int (NOT a BigNum). Throws an error on failure. + */ + export function jacobi(a: BigNumCompatible, n: BigNum): number; + + /** Return the number of bits used to represent the current BigNum. */ + export function bitLength(n: BigNumCompatible): number; +} + +declare module "bignum" { + export = BigNum; +} diff --git a/bluebird/bluebird-1.0.d.ts b/bluebird/bluebird-1.0.d.ts index 69a4f9152..db9dd0dd2 100644 --- a/bluebird/bluebird-1.0.d.ts +++ b/bluebird/bluebird-1.0.d.ts @@ -131,7 +131,7 @@ declare class Promise implements Promise.Thenable { * Promises are by default not cancellable. Use `.cancellable()` to mark a promise as cancellable. */ // TODO what to do with this? - cancel(): Promise; + cancel(reason?: any): Promise; /** * Like `.then()`, but cancellation of the the returned promise or any of its descendant will not propagate cancellation to this promise or this promise's ancestors. diff --git a/bluebird/bluebird-tests.ts b/bluebird/bluebird-tests.ts index ade461074..bd4f46fc4 100644 --- a/bluebird/bluebird-tests.ts +++ b/bluebird/bluebird-tests.ts @@ -80,6 +80,7 @@ var voidProm: Promise; var fooProm: Promise; var barProm: Promise; +var fooOrBarProm: Promise; var bazProm: Promise; // - - - - - - - - - - - - - - - - - @@ -150,6 +151,7 @@ var BlueBird: typeof Promise; // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - var nodeCallbackFunc = (callback: (err: any, result: string) => void) => {} +var nodeCallbackFuncErrorOnly = (callback: (err: any) => void) => {} // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -225,6 +227,21 @@ barProm = fooProm.then((value: Foo) => { }, (reason: any) => { return bar; }); +barProm = fooProm.then((value: Foo) => { + return bar; +}, (reason: any) => { + return barProm; +}); +barProm = fooProm.then((value: Foo) => { + return bar; +}, (reason: any) => { + return; +}); +barProm = fooProm.then((value: Foo) => { + return bar; +}, (reason: any) => { + return voidProm; +}); barProm = fooProm.then((value: Foo) => { return bar; }); @@ -236,36 +253,96 @@ barProm = barProm.then((value: Bar) => { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -barProm = fooProm.catch((reason: any) => { +fooProm = fooProm.catch((reason: any) => { + return; +}); + +fooProm = fooProm.caught((reason: any) => { + return; +}); +fooProm = fooProm.catch((error: any) => { + return true; +}, (reason: any) => { + return; +}); +fooProm = fooProm.caught((error: any) => { + return true; +}, (reason: any) => { + return; +}); + +fooProm = fooProm.catch((reason: any) => { + return voidProm; +}); + +fooProm = fooProm.caught((reason: any) => { + return voidProm; +}); +fooProm = fooProm.catch((error: any) => { + return true; +}, (reason: any) => { + return voidProm; +}); +fooProm = fooProm.caught((error: any) => { + return true; +}, (reason: any) => { + return voidProm; +}); + +fooProm = fooProm.catch((reason: any) => { + //handle multiple valid return types simultaneously + if (true) { + return; + } else if (false) { + return voidProm; + } else if (foo) { + return foo; + } +}); + +fooOrBarProm = fooProm.catch((reason: any) => { return bar; }); -barProm = fooProm.caught((reason: any) => { +fooOrBarProm = fooProm.caught((reason: any) => { return bar; }); -barProm = fooProm.catch((reason: any) => { - return bar; +fooOrBarProm = fooProm.catch((error: any) => { + return true; }, (reason: any) => { return bar; }); -barProm = fooProm.caught((reason: any) => { - return bar; +fooOrBarProm = fooProm.caught((error: any) => { + return true; }, (reason: any) => { return bar; }); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -barProm = fooProm.catch(Error, (reason: any) => { +fooProm = fooProm.catch(Error, (reason: any) => { + return; +}); +fooProm = fooProm.catch(Promise.CancellationError, (reason: any) => { + return; +}); +fooProm = fooProm.caught(Error, (reason: any) => { + return; +}); +fooProm = fooProm.caught(Promise.CancellationError, (reason: any) => { + return; +}); + +fooOrBarProm = fooProm.catch(Error, (reason: any) => { return bar; }); -barProm = fooProm.catch(Promise.CancellationError, (reason: any) => { +fooOrBarProm = fooProm.catch(Promise.CancellationError, (reason: any) => { return bar; }); -barProm = fooProm.caught(Error, (reason: any) => { +fooOrBarProm = fooProm.caught(Error, (reason: any) => { return bar; }); -barProm = fooProm.caught(Promise.CancellationError, (reason: any) => { +fooOrBarProm = fooProm.caught(Promise.CancellationError, (reason: any) => { return bar; }); @@ -678,6 +755,7 @@ func = Promise.promisify(f, obj); obj = Promise.promisifyAll(obj); anyProm = Promise.fromNode(callback => nodeCallbackFunc(callback)); +anyProm = Promise.fromNode(callback => nodeCallbackFuncErrorOnly(callback)); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/bluebird/bluebird.d.ts b/bluebird/bluebird.d.ts index 878e1051e..9b55578ef 100644 --- a/bluebird/bluebird.d.ts +++ b/bluebird/bluebird.d.ts @@ -20,24 +20,24 @@ declare class Promise implements Promise.Thenable, Promise.Inspection { /** * Create a new promise. The passed in function will receive functions `resolve` and `reject` as its arguments which can be called to seal the fate of the created promise. */ - constructor(callback: (resolve: (thenableOrResult: R | Promise.Thenable) => void, reject: (error: any) => void) => void); + constructor(callback: (resolve: (thenableOrResult?: R | Promise.Thenable) => void, reject: (error: any) => void) => void); /** * Promises/A+ `.then()` with progress handler. Returns a new promise chained from this promise. The new promise will be rejected or resolved dedefer on the passed `fulfilledHandler`, `rejectedHandler` and the state of this promise. */ - then(onFulfill: (value: R) => U|Promise.Thenable, onReject: (error: any) => Promise.Thenable, onProgress?: (note: any) => any): Promise; - then(onFulfill: (value: R) => U|Promise.Thenable, onReject?: (error: any) => U, onProgress?: (note: any) => any): Promise; + then(onFulfill: (value: R) => U|Promise.Thenable, onReject?: (error: any) => U|Promise.Thenable, onProgress?: (note: any) => any): Promise; + then(onFulfill: (value: R) => U|Promise.Thenable, onReject?: (error: any) => void|Promise.Thenable, onProgress?: (note: any) => any): Promise; /** * This is a catch-all exception handler, shortcut for calling `.then(null, handler)` on this promise. Any exception happening in a `.then`-chain will propagate to nearest `.catch` handler. * * Alias `.caught();` for compatibility with earlier ECMAScript version. */ - catch(onReject?: (error: any) => Promise.Thenable): Promise; - caught(onReject?: (error: any) => Promise.Thenable): Promise; + catch(onReject?: (error: any) => R|Promise.Thenable|void|Promise.Thenable): Promise; + caught(onReject?: (error: any) => R|Promise.Thenable|void|Promise.Thenable): Promise; - catch(onReject?: (error: any) => U): Promise; - caught(onReject?: (error: any) => U): Promise; + catch(onReject?: (error: any) => U|Promise.Thenable): Promise; + caught(onReject?: (error: any) => U|Promise.Thenable): Promise; /** * This extends `.catch` to work more like catch-clauses in languages like Java or C#. Instead of manually checking `instanceof` or `.name === "SomeError"`, you may specify a number of error constructors which are eligible for this catch handler. The catch handler that is first met that has eligible constructors specified, is the one that will be called. @@ -46,17 +46,18 @@ declare class Promise implements Promise.Thenable, Promise.Inspection { * * Alias `.caught();` for compatibility with earlier ECMAScript version. */ - catch(predicate: (error: any) => boolean, onReject: (error: any) => Promise.Thenable): Promise; - caught(predicate: (error: any) => boolean, onReject: (error: any) => Promise.Thenable): Promise; + catch(predicate: (error: any) => boolean, onReject: (error: any) => R|Promise.Thenable|void|Promise.Thenable): Promise; + caught(predicate: (error: any) => boolean, onReject: (error: any) => R|Promise.Thenable|void|Promise.Thenable): Promise; - catch(predicate: (error: any) => boolean, onReject: (error: any) => U): Promise; - caught(predicate: (error: any) => boolean, onReject: (error: any) => U): Promise; + catch(predicate: (error: any) => boolean, onReject: (error: any) => U|Promise.Thenable): Promise; + caught(predicate: (error: any) => boolean, onReject: (error: any) => U|Promise.Thenable): Promise; - catch(ErrorClass: Function, onReject: (error: any) => Promise.Thenable): Promise; - caught(ErrorClass: Function, onReject: (error: any) => Promise.Thenable): Promise; + catch(ErrorClass: Function, onReject: (error: any) => R|Promise.Thenable|void|Promise.Thenable): Promise; + caught(ErrorClass: Function, onReject: (error: any) => R|Promise.Thenable|void|Promise.Thenable): Promise; + + catch(ErrorClass: Function, onReject: (error: any) => U|Promise.Thenable): Promise; + caught(ErrorClass: Function, onReject: (error: any) => U|Promise.Thenable): Promise; - catch(ErrorClass: Function, onReject: (error: any) => U): Promise; - caught(ErrorClass: Function, onReject: (error: any) => U): Promise; /** * Like `.catch` but instead of catching all types of exceptions, it only catches those that don't originate from thrown errors but rather from explicit rejections. @@ -133,7 +134,7 @@ declare class Promise implements Promise.Thenable, Promise.Inspection { * Promises are by default not cancellable. Use `.cancellable()` to mark a promise as cancellable. */ // TODO what to do with this? - cancel(): Promise; + cancel(reason?: any): Promise; /** * Like `.then()`, but cancellation of the the returned promise or any of its descendant will not propagate cancellation to this promise or this promise's ancestors. @@ -426,7 +427,7 @@ declare class Promise implements Promise.Thenable, Promise.Inspection { /** * Returns a promise that is resolved by a node style callback function. */ - static fromNode(resolver: (callback: (err: any, result: any) => void) => void): Promise; + static fromNode(resolver: (callback: (err: any, result?: any) => void) => void): Promise; /** * Returns a function that can use `yield` to run asynchronous code synchronously. This feature requires the support of generators which are drafted in the next version of the language. Node version greater than `0.11.2` is required and needs to be executed with the `--harmony-generators` (or `--harmony`) command-line switch. @@ -671,8 +672,8 @@ declare module Promise { export function OperationalError(): OperationalError; export interface Thenable { - then(onFulfilled: (value: R) => U|Thenable, onRejected: (error: any) => Thenable): Thenable; - then(onFulfilled: (value: R) => U|Thenable, onRejected?: (error: any) => U): Thenable; + then(onFulfilled: (value: R) => U|Thenable, onRejected?: (error: any) => U|Thenable): Thenable; + then(onFulfilled: (value: R) => U|Thenable, onRejected?: (error: any) => void|Thenable): Thenable; } export interface Resolver { diff --git a/bookshelf/bookshelf-tests.ts b/bookshelf/bookshelf-tests.ts new file mode 100644 index 000000000..67580dae5 --- /dev/null +++ b/bookshelf/bookshelf-tests.ts @@ -0,0 +1,100 @@ +/// +/// + +import * as Knex from 'knex'; +import * as Bookshelf from 'bookshelf'; + +var knex = Knex({ + client: 'sqlite3', + connection: { + filename: ':memory:', + }, +}); + +// Examples + +var bookshelf = Bookshelf(knex); + +class User extends bookshelf.Model { + get tableName() { return 'users'; } + messages() : Bookshelf.Collection { + return this.hasMany(Posts); + } +} + +class Posts extends bookshelf.Model { + get tableName() { return 'messages'; } + tags() : Bookshelf.Collection { + return this.belongsToMany(Tag); + } +} + +class Tag extends bookshelf.Model { + get tableName() { return 'tags'; } +} + +new User({}).where('id', 1).fetch({withRelated: ['posts.tags']}) +.then(user => { + console.log(user.related('posts').toJSON()); +}).catch(err => { + console.error(err); +}); + + +// Associations + +class Book extends bookshelf.Model { + get tableName() { return 'books'; } + summary() { + return this.hasOne(Summary); + } + pages() { + return this.hasMany(Pages); + } + authors() { + return this.belongsToMany(Author); + } +} + +class Summary extends bookshelf.Model { + get tableName() { return 'summaries'; } + book() : Book { + return this.belongsTo(Book); + } +} + +class Pages extends bookshelf.Model { + get tableName() { return 'pages'; } + book() { + return this.belongsTo(Book); + } +} + +class Author extends bookshelf.Model { + get tableName() { return 'author'; } + books() { + return this.belongsToMany(Book); + } +} + +class Site extends bookshelf.Model { + get tableName() { return 'sites'; } + photo() { + return this.morphOne(Photo, 'imageable'); + } +} + +class Post extends bookshelf.Model { + get tableName() { return 'posts'; } + photos() { + return this.morphMany(Photo, 'imageable'); + } +} + +class Photo extends bookshelf.Model { + get tableName() { return 'photos'; } + imageable() { + return this.morphTo('imageable', Site, Post); + } +} + diff --git a/bookshelf/bookshelf-tests.ts.tscparams b/bookshelf/bookshelf-tests.ts.tscparams new file mode 100644 index 000000000..5f84b9777 --- /dev/null +++ b/bookshelf/bookshelf-tests.ts.tscparams @@ -0,0 +1 @@ +--noImplicitAny --module commonjs --target es5 diff --git a/bookshelf/bookshelf.d.ts b/bookshelf/bookshelf.d.ts new file mode 100644 index 000000000..0da1ce2d6 --- /dev/null +++ b/bookshelf/bookshelf.d.ts @@ -0,0 +1,313 @@ +// Type definitions for bookshelfjs v0.8.2 +// Project: http://bookshelfjs.org/ +// Definitions by: Andrew Schurman +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// +/// +/// + +declare module 'bookshelf' { + import knex = require('knex'); + import Promise = require('bluebird'); + import Lodash = require('lodash'); + + interface Bookshelf extends Bookshelf.Events { + VERSION : string; + knex : knex; + Model : typeof Bookshelf.Model; + Collection : typeof Bookshelf.Collection; + + transaction(callback : (transaction : knex.Transaction) => T) : Promise; + } + + function Bookshelf(knex : knex) : Bookshelf; + + namespace Bookshelf { + abstract class Events { + on(event? : string, callback? : EventFunction, context? : any) : void; + off(event? : string) : void; + trigger(event? : string, ...args : any[]) : void; + triggerThen(name : string, ...args : any[]) : Promise; + once(event : string, callback : EventFunction, context? : any) : void; + } + + interface IModelBase { + /** Should be declared as a getter instead of a plain property. */ + hasTimestamps? : boolean|string[]; + /** Should be declared as a getter instead of a plain property. Should be required, but cannot have abstract properties yet. */ + tableName? : string; + } + + abstract class ModelBase> extends Events> implements IModelBase { + /** If overriding, must use a getter instead of a plain property. */ + idAttribute : string; + + constructor(attributes? : any, options? : ModelOptions); + + clear() : T; + clone() : T; + escape(attribute : string) : string; + format(attributes : any) : any; + get(attribute : string) : any; + has(attribute : string) : boolean; + hasChanged(attribute? : string) : boolean; + isNew() : boolean; + parse(response : any) : any; + previousAttributes() : any; + previous(attribute : string) : any; + related>(relation : string) : R | Collection; + serialize(options? : SerializeOptions) : any; + set(attribute?: {[key : string] : any}, options? : SetOptions) : T; + set(attribute : string, value? : any, options? : SetOptions) : T; + timestamp(options? : TimestampOptions) : any; + toJSON(options? : SerializeOptions) : any; + unset(attribute : string) : T; + + // lodash methods + invert() : R; + keys() : string[]; + omit(predicate? : Lodash.ObjectIterator, thisArg? : any) : R; + omit(...attributes : string[]) : R; + pairs() : any[][]; + pick(predicate? : Lodash.ObjectIterator, thisArg? : any) : R; + pick(...attributes : string[]) : R; + values() : any[]; + } + + class Model> extends ModelBase { + static collection>(models? : T[], options? : CollectionOptions) : Collection; + static count(column? : string, options? : SyncOptions) : Promise; + /** @deprecated use Typescript classes */ + static extend>(prototypeProperties? : any, classProperties? : any) : Function; // should return a type + static fetchAll>() : Promise>; + /** @deprecated should use `new` objects instead. */ + static forge(attributes? : any, options? : ModelOptions) : T; + + 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) : void; + fetch(options? : FetchOptions) : Promise; + fetchAll(options? : FetchAllOptions) : Promise>; + hasMany>(target : {new(...args : any[]) : R}, foreignKey? : string) : Collection; + hasOne>(target : {new(...args : any[]) : R}, foreignKey? : string) : R; + load(relations : string|string[], options? : LoadOptions) : Promise; + morphMany>(target : {new(...args : any[]) : R}, name? : string, columnNames? : string[], morphValue? : string) : Collection; + 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; + 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(attrs? : {[key : string] : any}, options? : SaveOptions) : Promise; + through>(interim : typeof Model, throughForeignKey? : string, otherKey? : string) : R | Collection; + where(properties : {[key : string] : any}) : T; + where(key : string, operatorOrValue : string|number|boolean, valueIfOperator? : string|number|boolean) : T; + } + + abstract class CollectionBase> extends Events { + add(models : T[]|{[key : string] : any}[], options? : CollectionAddOptions) : Collection; + at(index : number) : T; + clone() : Collection; + fetch(options? : CollectionFetchOptions) : Promise>; + findWhere(match : {[key : string] : any}) : T; + get(id : any) : T; + invokeThen(name : string, ...args : any[]) : Promise; + parse(response : any) : any; + pluck(attribute : string) : any[]; + pop() : void; + push(model : any) : Collection; + reduceThen(iterator : (prev : R, cur : T, idx : number, array : T[]) => R, initialValue : R, context : any) : Promise; + remove(model : T, options? : EventOptions) : T; + remove(model : T[], options? : EventOptions) : T[]; + reset(model : any[], options? : CollectionAddOptions) : T[]; + 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; + unshift(model : any, options? : CollectionAddOptions) : void; + where(match : {[key : string] : any}, firstOnly : boolean) : T|Collection; + + // lodash methods + all(predicate? : Lodash.ListIterator|Lodash.DictionaryIterator|string, thisArg? : any) : boolean; + all(predicate? : R) : boolean; + any(predicate? : Lodash.ListIterator|Lodash.DictionaryIterator|string, thisArg? : any) : boolean; + any(predicate? : R) : boolean; + chain() : Lodash.LoDashExplicitObjectWrapper; + collect(predicate? : Lodash.ListIterator|Lodash.DictionaryIterator|string, thisArg? : any) : T[]; + collect(predicate? : R) : T[]; + contains(value : any, fromIndex? : number) : boolean; + countBy(predicate? : Lodash.ListIterator|Lodash.DictionaryIterator|string, thisArg? : any) : Lodash.Dictionary; + countBy(predicate? : R) : Lodash.Dictionary; + detect(predicate? : Lodash.ListIterator|Lodash.DictionaryIterator|string, thisArg? : any) : T; + detect(predicate? : R) : T; + difference(...values : T[]) : T[]; + drop(n? : number) : T[]; + each(callback? : Lodash.ListIterator, thisArg? : any) : Lodash.List; + each(callback? : Lodash.DictionaryIterator, thisArg? : any) : Lodash.Dictionary; + each(callback? : Lodash.ObjectIterator, thisArg? : any) : T; + every(predicate? : Lodash.ListIterator|Lodash.DictionaryIterator|string, thisArg? : any) : boolean; + every(predicate? : R) : boolean; + filter(predicate? : Lodash.ListIterator|Lodash.DictionaryIterator|string, thisArg? : any) : T[]; + filter(predicate? : R) : T[]; + find(predicate? : Lodash.ListIterator|Lodash.DictionaryIterator|string, thisArg? : any) : T; + find(predicate? : R) : T; + first() : T; + foldl(callback? : Lodash.MemoIterator, accumulator? : R, thisArg? : any) : R; + foldr(callback? : Lodash.MemoIterator, accumulator? : R, thisArg? : any) : R; + forEach(callback? : Lodash.ListIterator, thisArg? : any) : Lodash.List; + forEach(callback? : Lodash.DictionaryIterator, thisArg? : any) : Lodash.Dictionary; + forEach(callback? : Lodash.ObjectIterator, thisArg? : any) : T; + groupBy(predicate? : Lodash.ListIterator|Lodash.DictionaryIterator|string, thisArg? : any) : Lodash.Dictionary; + groupBy(predicate? : R) : Lodash.Dictionary; + head() : T; + include(value : any, fromIndex? : number) : boolean; + indexOf(value : any, fromIndex? : number) : number; + initial() : T[]; + inject(callback? : Lodash.MemoIterator, accumulator? : R, thisArg? : any) : R; + invoke(methodName : string|Function, ...args : any[]) : any; + isEmpty() : boolean; + keys() : string[]; + last() : T; + lastIndexOf(value : any, fromIndex? : number) : number; + map(predicate? : Lodash.ListIterator|Lodash.DictionaryIterator|string, thisArg? : any) : T[]; + map(predicate? : R) : T[]; + max(predicate? : Lodash.ListIterator|string, thisArg? : any) : T; + max(predicate? : R) : T; + min(predicate? : Lodash.ListIterator|string, thisArg? : any) : T; + min(predicate? : R) : T; + reduce(callback? : Lodash.MemoIterator, accumulator? : R, thisArg? : any) : R; + reduceRight(callback? : Lodash.MemoIterator, accumulator? : R, thisArg? : any) : R; + reject(predicate? : Lodash.ListIterator|Lodash.DictionaryIterator|string, thisArg? : any) : T[]; + reject(predicate? : R) : T[]; + rest() : T[]; + select(predicate? : Lodash.ListIterator|Lodash.DictionaryIterator|string, thisArg? : any) : T[]; + select(predicate? : R) : T[]; + shuffle() : T[]; + size() : number; + some(predicate? : Lodash.ListIterator|Lodash.DictionaryIterator|string, thisArg? : any) : boolean; + some(predicate? : R) : boolean; + sortBy(predicate? : Lodash.ListIterator|Lodash.DictionaryIterator|string, thisArg? : any) : T[]; + sortBy(predicate? : R) : T[]; + tail() : T[]; + take(n? : number) : T[]; + toArray() : T[]; + without(...values : any[]) : T[]; + } + + class Collection> extends CollectionBase { + /** @deprecated use Typescript classes */ + static extend(prototypeProperties? : any, classProperties? : any) : Function; + /** @deprecated should use `new` objects instead. */ + static forge(attributes? : any, options? : ModelOptions) : T; + + attach(ids : any[], options? : SyncOptions) : Promise>; + count(column? : string, options? : SyncOptions) : Promise; + create(model : {[key : string] : any}, options? : CollectionCreateOptions) : Promise; + detach(ids : any[], options? : SyncOptions) : Promise; + fetchOne(options? : CollectionFetchOneOptions) : Promise; + load(relations : string|string[], options? : SyncOptions) : Promise>; + 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; + updatePivot(attributes : any, options? : PivotOptions) : Promise; + withPivot(columns : string[]) : Collection; + } + + interface ModelOptions { + tableName? : string; + hasTimestamps? : boolean; + parse? : boolean; + } + + interface LoadOptions extends SyncOptions { + withRelated: string|any|any[]; + } + + interface FetchOptions extends SyncOptions { + require? : boolean; + columns? : string|string[]; + withRelated? : string|any|any[]; + } + + interface FetchAllOptions extends SyncOptions { + require? : boolean; + } + + interface SaveOptions extends SyncOptions { + method? : string; + defaults? : string; + patch? : boolean; + require? : boolean; + } + + interface SerializeOptions { + shallow? : boolean; + omitPivot? : boolean; + } + + interface SetOptions { + unset? : boolean; + } + + interface TimestampOptions { + method? : string; + } + + interface SyncOptions { + transacting? : knex.Transaction; + debug? : boolean; + } + + interface CollectionOptions { + comparator? : boolean|string|((a : T, b : T) => number); + } + + interface CollectionAddOptions extends EventOptions { + at? : number; + merge? : boolean; + } + + interface CollectionFetchOptions { + require? : boolean; + withRelated? : string|string[]; + } + + interface CollectionFetchOneOptions { + require? : boolean; + columns? : string|string[]; + } + + interface CollectionSetOptions extends EventOptions { + add? : boolean; + remove? : boolean; + merge?: boolean; + } + + interface PivotOptions { + query? : Function|any; + require? : boolean; + } + + interface EventOptions { + silent? : boolean; + } + + interface EventFunction { + (model: T, attrs: any, options: any) : Promise|void; + } + + interface CollectionCreateOptions extends ModelOptions, SyncOptions, CollectionAddOptions, SaveOptions {} + } + + export = Bookshelf; +} diff --git a/boolify-string/boolify-string-tests.ts b/boolify-string/boolify-string-tests.ts new file mode 100644 index 000000000..1436a1aea --- /dev/null +++ b/boolify-string/boolify-string-tests.ts @@ -0,0 +1,61 @@ +/// + +import boolifyString = require('boolify-string'); + +console.log(boolifyString('true')); // #=> true +console.log(boolifyString('TRUE')); // #=> true +console.log(boolifyString('True')); // #=> true +console.log(boolifyString('false')); // #=> false + +console.log(boolifyString('{}')); // #=> true +console.log(boolifyString('foo')); // #=> true +console.log(boolifyString('')); // #=> false +console.log(boolifyString('1')); // #=> true +console.log(boolifyString('-1')); // #=> true +console.log(boolifyString('0')); // #=> false +console.log(boolifyString('[]')); // #=> true +console.log(boolifyString('undefined')); // #=> false +console.log(boolifyString('null')); // #=> false + +// primitive values as is +console.log(boolifyString(true)); // #=> true +console.log(boolifyString(false)); // #=> false +console.log(boolifyString({})); // #=> true +console.log(boolifyString(1)); // #=> true +console.log(boolifyString(-1)); // #=> true +console.log(boolifyString(0)); // #=> false +console.log(boolifyString([])); // #=> true +console.log(boolifyString(undefined)); // #=> false +console.log(boolifyString(null)); // #=> false + +// string constructor +console.log(boolifyString(new String('true'))); // #=> true +console.log(boolifyString(new String('false'))); // #=> false + +// YAML's specification +// http://yaml.org/type/bool.html +// y|Y|yes|Yes|YES|n|N|no|No|NO +// |true|True|TRUE|false|False|FALSE +// |on|On|ON|off|Off|OFF +console.log(boolifyString('y')); // #=> true +console.log(boolifyString('Y')); // #=> true +console.log(boolifyString('yes')); // #=> true +console.log(boolifyString('Yes')); // #=> true +console.log(boolifyString('YES')); // #=> true +console.log(boolifyString('n')); // #=> false +console.log(boolifyString('N')); // #=> false +console.log(boolifyString('no')); // #=> false +console.log(boolifyString('No')); // #=> false +console.log(boolifyString('NO')); // #=> false +console.log(boolifyString('true')); // #=> true +console.log(boolifyString('True')); // #=> true +console.log(boolifyString('TRUE')); // #=> true +console.log(boolifyString('false')); // #=> false +console.log(boolifyString('False')); // #=> false +console.log(boolifyString('FALSE')); // #=> false +console.log(boolifyString('on')); // #=> true +console.log(boolifyString('On')); // #=> true +console.log(boolifyString('ON')); // #=> true +console.log(boolifyString('off')); // #=> false +console.log(boolifyString('Off')); // #=> false +console.log(boolifyString('OFF')); // #=> false diff --git a/boolify-string/boolify-string.d.ts b/boolify-string/boolify-string.d.ts new file mode 100644 index 000000000..d4ab286a5 --- /dev/null +++ b/boolify-string/boolify-string.d.ts @@ -0,0 +1,8 @@ +// Type definitions for boolify-string +// Project: https://github.com/sanemat/node-boolify-string +// Definitions by: Tobias Henöckl +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +declare module "boolify-string" { + function boolifyString(obj: any): boolean; + export = boolifyString; +} diff --git a/bootstrap.v3.datetimepicker/bootstrap.v3.datetimepicker-tests.ts b/bootstrap.v3.datetimepicker/bootstrap.v3.datetimepicker-tests.ts index 6abf38f94..e17b7b10c 100644 --- a/bootstrap.v3.datetimepicker/bootstrap.v3.datetimepicker-tests.ts +++ b/bootstrap.v3.datetimepicker/bootstrap.v3.datetimepicker-tests.ts @@ -6,17 +6,17 @@ function test_cases() { $('#datetimepicker').datetimepicker({ pickDate: false }); - $('#datetimepicker').datetimepicker({ + $('#datetimepicker').datetimepicker({ pickTime: false }); - $('#datetimepicker').datetimepicker({ + $('#datetimepicker').datetimepicker({ minDate: '2012-12-31' }); - - $('#datetimepicker').data("DateTimePicker").setMaxDate('2012-12-31'); - - var startDate = new Date(2012, 1, 20); - var endDate = new Date(2012, 1, 25); + + $('#datetimepicker').data("DateTimePicker").maxDate('2012-12-31'); + + var startDate = moment(new Date(2012, 1, 20)); + var endDate = moment(new Date(2012, 1, 25)); $('#datetimepicker2') .datetimepicker() .on("dp.change", function (ev) { diff --git a/bootstrap.v3.datetimepicker/bootstrap.v3.datetimepicker.d.ts b/bootstrap.v3.datetimepicker/bootstrap.v3.datetimepicker.d.ts index 228b7537f..fb0b1b389 100644 --- a/bootstrap.v3.datetimepicker/bootstrap.v3.datetimepicker.d.ts +++ b/bootstrap.v3.datetimepicker/bootstrap.v3.datetimepicker.d.ts @@ -10,15 +10,15 @@ */ /// +/// declare module BootstrapV3DatetimePicker { - interface DatetimepickerChangeEventObject extends JQueryEventObject { - date: any; - oldDate: any; + interface DatetimepickerChangeEventObject extends DatetimepickerEventObject { + oldDate: moment.Moment; } interface DatetimepickerEventObject extends JQueryEventObject { - date: any; + date: moment.Moment; } interface DatetimepickerIcons { @@ -35,33 +35,37 @@ declare module BootstrapV3DatetimePicker { useSeconds?: boolean; useCurrent?: boolean; minuteStepping?: number; - minDate?: any; - maxDate?: any; + minDate?: moment.Moment | Date | string; + maxDate?: moment.Moment | Date | string; showToday?: boolean; collapse?: boolean; language?: string; - defaultDate?: string; - disabledDates?: Array; - enabledDates?: Array; + defaultDate?: moment.Moment | Date | string; + disabledDates?: Array; + enabledDates?: Array; icons?: DatetimepickerIcons; useStrict?: boolean; direction?: string; sideBySide?: boolean; - daysOfWeekDisabled?: Array; + daysOfWeekDisabled?: Array; calendarWeeks?: boolean; format?: string | boolean; locale?: string; showTodayButton?: boolean; + viewMode?: string; + inline?: boolean; } interface Datetimepicker { - setDate(date: any): void; - setMinDate(date: any): void; - setMaxDate(date: any): void; + date(date: moment.Moment | Date | string): void; + date(): moment.Moment; + minDate(date: moment.Moment | Date | string): void; + minDate(): moment.Moment | boolean; + maxDate(date: moment.Moment | Date | string): void; + maxDate(): moment.Moment | boolean; show(): void; disable(): void; enable(): void; - getDate(): void; } } diff --git a/browser-sync/browser-sync-tests.ts b/browser-sync/browser-sync-tests.ts index 50042410f..210a8cf1b 100644 --- a/browser-sync/browser-sync-tests.ts +++ b/browser-sync/browser-sync-tests.ts @@ -1,6 +1,13 @@ /// import browserSync = require("browser-sync"); +(() => { + //make sure that the interfaces are correctly exposed + var bsInstance: browserSync.BrowserSyncInstance; + var bsStatic: browserSync.BrowserSyncStatic; + var opts: browserSync.Options; +})(); + browserSync({ server: { baseDir: "./" @@ -78,8 +85,8 @@ bs.init({ }); bs.reload(); - -function browserSyncInit() { + +function browserSyncInit(): browserSync.BrowserSyncInstance { var browser = browserSync.create(); browser.init(); console.log(browser.name); diff --git a/browser-sync/browser-sync.d.ts b/browser-sync/browser-sync.d.ts index 03b751fab..2276f36e5 100644 --- a/browser-sync/browser-sync.d.ts +++ b/browser-sync/browser-sync.d.ts @@ -11,404 +11,406 @@ declare module "browser-sync" { import fs = require("fs"); import http = require("http"); - interface Options { - /** - * Browsersync includes a user-interface that is accessed via a separate port. The UI allows to controls - * all devices, push sync updates and much more. - * - * port - Default: 3001 - * weinre.port - Default: 8080 - * Note: requires at least version 2.0.0 - */ - ui?: UIOptions; - /** - * 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[]; - /** - * File watching options that get passed along to Chokidar. Check their docs for available options - * Default: undefined - * Note: requires at least version 2.6.0 - */ - watchOptions?: ChokidarOptions; - /** - * Use the built-in static server for basic HTML/JS/CSS websites. - * Default: false - */ - server?: ServerOptions; - /** - * Proxy an EXISTING vhost. Browsersync will wrap your vhost with a proxy URL to view your site. - * target - Default: undefined - * ws - Default: undefined - * middleware - Default: undefined - * reqHeaders - Default: undefined - * proxyRes - Default: undefined - */ - proxy?: string | boolean | ProxyOptions; - /** - * Use a specific port (instead of the one auto-detected by Browsersync) - * Default: 3000 - */ - port?: number; - /** - * Add additional directories from which static files should be served. - * Should only be used in proxy or snippet mode. - * Default: [] - * Note: requires at least version 2.8.0 - */ - serveStatic?: string[]; - /** - * Enable https for localhost development. - * Note - this is not needed for proxy option as it will be inferred from your target url. - * Note: requires at least version 1.3.0 - */ - https?: boolean; - /** - * Clicks, Scrolls & Form inputs on any device will be mirrored to all others. - * clicks - Default: true - * scroll - Default: true - * forms - Default: true - */ - ghostMode?: GhostOptions | boolean; - /** - * Can be either "info", "debug", "warn", or "silent" - * Default: info - */ - logLevel?: string; - /** - * Change the console logging prefix. Useful if you're creating your own project based on Browsersync - * Default: BS - * Note: requires at least version 1.5.1 - */ - logPrefix?: string; - /** - * Whether or not to log connections - * Default: false - */ - logConnections?: boolean; - /** - * Whether or not to log information about changed files - * Default: false - */ - logFileChanges?: boolean; - /** - * Log the snippet to the console when you're in snippet mode (no proxy/server) - * Default: true - * Note: requires at least version 1.5.2 - */ - logSnippet?: boolean; - /** - * You can control how the snippet is injected onto each page via a custom regex + function. - * You can also provide patterns for certain urls that should be ignored from the snippet injection. - * Note: requires at least version 2.0.0 - */ - snippetOptions?: SnippetOptions; - /** - * Add additional HTML rewriting rules. - * Default: false - * Note: requires at least version 2.4.0 - */ - rewriteRules?: boolean | RewriteRules[]; - /** - * Tunnel the Browsersync server through a random Public URL - * Default: null - */ - tunnel?: string | boolean; - /** - * Some features of Browsersync (such as xip & tunnel) require an internet connection, but if you're - * working offline, you can reduce start-up time by setting this option to false - */ - online?: boolean; - /** - * Default: true - * Decide which URL to open automatically when Browsersync starts. Defaults to "local" if none set. - * Can be true, local, external, ui, ui-external, tunnel or false - */ - open?: string | boolean; - /** - * The browser(s) to open - * Default: default - */ - browser?: string | string[]; - /** - * Requires an internet connection - useful for services such as Typekit as it allows you to configure - * domains such as *.xip.io in your kit settings - * Default: false - */ - xip?: boolean; - /** - * Reload each browser when Browsersync is restarted. - * Default: false - */ - reloadOnRestart?: boolean; - /** - * The small pop-over notifications in the browser are not always needed/wanted. - * Default: true - */ - notify?: boolean; - /** - * scrollProportionally: false // Sync viewports to TOP position - * Default: true - */ - scrollProportionally?: boolean - /** - * How often to send scroll events - * Default: 0 - */ - scrollThrottle?: number; - /** - * Decide which technique should be used to restore scroll position following a reload. - * Can be window.name or cookie - * Default: 'window.name' - */ - scrollRestoreTechnique?: string; - /** - * Sync the scroll position of any element on the page. Add any amount of CSS selectors - * Default: [] - * Note: requires at least version 2.9.0 - */ - scrollElements?: string[]; - /** - * Default: [] - * Note: requires at least version 2.9.0 - * Sync the scroll position of any element on the page - where any scrolled element will cause - * all others to match scroll position. This is helpful when a breakpoint alters which element - * is actually scrolling - */ - scrollElementMapping?: string[]; - /** - * Time, in milliseconds, to wait before instructing the browser to reload/inject following a file change event - * Default: 0 - */ - reloadDelay?: number; - /** - * Restrict the frequency in which browser:reload events can be emitted to connected clients - * Default: 0 - * Note: requires at least version 2.6.0 - */ - reloadDebounce?: number; - /** - * User provided plugins - * Default: [] - * Note: requires at least version 2.6.0 - */ - plugins?: any[]; - /** - * Whether to inject changes (rather than a page refresh) - * Default: true - */ - injectChanges?: boolean; - /** - * The initial path to load - */ - startPath?: string; - /** - * Whether to minify the client script - * Default: true - */ - minify?: boolean; - /** - * Override host detection if you know the correct IP to use - */ - host?: string; - /** - * Send file-change events to the browser - * Default: true - */ - codeSync?: boolean; - /** - * Append timestamps to injected files - * Default: true - */ - timestamps?: boolean; - /** - * Alter the script path for complete control over where the Browsersync Javascript is served - * from. Whatever you return from this function will be used as the script path. - * Note: requires at least version 1.5.0 - */ - scriptPath?: (path: string) => string; - /** - * Configure the Socket.IO path and namespace & domain to avoid collisions. - * path - Default: "/browser-sync/socket.io" - * clientPath - Default: "/browser-sync" - * namespace - Default: "/browser-sync" - * domain - Default: undefined - * port - Default: undefined - * clients.heartbeatTimeout - Default: 5000 - * Note: requires at least version 1.6.2 - */ - socket?: SocketOptions; - } - - interface Hash { - [path: string]: T; - } - - interface ChokidarOptions { - interval?: number; - debounceDelay?: number; - mode?: string; - cwd?: string; - } - - interface UIOptions { - /** set the default port */ - port?: number; - /** set the default weinre port */ - weinre?: { + namespace browserSync { + interface Options { + /** + * Browsersync includes a user-interface that is accessed via a separate port. The UI allows to controls + * all devices, push sync updates and much more. + * + * port - Default: 3001 + * weinre.port - Default: 8080 + * Note: requires at least version 2.0.0 + */ + ui?: UIOptions; + /** + * 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[]; + /** + * File watching options that get passed along to Chokidar. Check their docs for available options + * Default: undefined + * Note: requires at least version 2.6.0 + */ + watchOptions?: ChokidarOptions; + /** + * Use the built-in static server for basic HTML/JS/CSS websites. + * Default: false + */ + server?: ServerOptions; + /** + * Proxy an EXISTING vhost. Browsersync will wrap your vhost with a proxy URL to view your site. + * target - Default: undefined + * ws - Default: undefined + * middleware - Default: undefined + * reqHeaders - Default: undefined + * proxyRes - Default: undefined + */ + proxy?: string | boolean | ProxyOptions; + /** + * Use a specific port (instead of the one auto-detected by Browsersync) + * Default: 3000 + */ port?: number; - }; + /** + * Add additional directories from which static files should be served. + * Should only be used in proxy or snippet mode. + * Default: [] + * Note: requires at least version 2.8.0 + */ + serveStatic?: string[]; + /** + * Enable https for localhost development. + * Note - this is not needed for proxy option as it will be inferred from your target url. + * Note: requires at least version 1.3.0 + */ + https?: boolean; + /** + * Clicks, Scrolls & Form inputs on any device will be mirrored to all others. + * clicks - Default: true + * scroll - Default: true + * forms - Default: true + */ + ghostMode?: GhostOptions | boolean; + /** + * Can be either "info", "debug", "warn", or "silent" + * Default: info + */ + logLevel?: string; + /** + * Change the console logging prefix. Useful if you're creating your own project based on Browsersync + * Default: BS + * Note: requires at least version 1.5.1 + */ + logPrefix?: string; + /** + * Whether or not to log connections + * Default: false + */ + logConnections?: boolean; + /** + * Whether or not to log information about changed files + * Default: false + */ + logFileChanges?: boolean; + /** + * Log the snippet to the console when you're in snippet mode (no proxy/server) + * Default: true + * Note: requires at least version 1.5.2 + */ + logSnippet?: boolean; + /** + * You can control how the snippet is injected onto each page via a custom regex + function. + * You can also provide patterns for certain urls that should be ignored from the snippet injection. + * Note: requires at least version 2.0.0 + */ + snippetOptions?: SnippetOptions; + /** + * Add additional HTML rewriting rules. + * Default: false + * Note: requires at least version 2.4.0 + */ + rewriteRules?: boolean | RewriteRules[]; + /** + * Tunnel the Browsersync server through a random Public URL + * Default: null + */ + tunnel?: string | boolean; + /** + * Some features of Browsersync (such as xip & tunnel) require an internet connection, but if you're + * working offline, you can reduce start-up time by setting this option to false + */ + online?: boolean; + /** + * Default: true + * Decide which URL to open automatically when Browsersync starts. Defaults to "local" if none set. + * Can be true, local, external, ui, ui-external, tunnel or false + */ + open?: string | boolean; + /** + * The browser(s) to open + * Default: default + */ + browser?: string | string[]; + /** + * Requires an internet connection - useful for services such as Typekit as it allows you to configure + * domains such as *.xip.io in your kit settings + * Default: false + */ + xip?: boolean; + /** + * Reload each browser when Browsersync is restarted. + * Default: false + */ + reloadOnRestart?: boolean; + /** + * The small pop-over notifications in the browser are not always needed/wanted. + * Default: true + */ + notify?: boolean; + /** + * scrollProportionally: false // Sync viewports to TOP position + * Default: true + */ + scrollProportionally?: boolean + /** + * How often to send scroll events + * Default: 0 + */ + scrollThrottle?: number; + /** + * Decide which technique should be used to restore scroll position following a reload. + * Can be window.name or cookie + * Default: 'window.name' + */ + scrollRestoreTechnique?: string; + /** + * Sync the scroll position of any element on the page. Add any amount of CSS selectors + * Default: [] + * Note: requires at least version 2.9.0 + */ + scrollElements?: string[]; + /** + * Default: [] + * Note: requires at least version 2.9.0 + * Sync the scroll position of any element on the page - where any scrolled element will cause + * all others to match scroll position. This is helpful when a breakpoint alters which element + * is actually scrolling + */ + scrollElementMapping?: string[]; + /** + * Time, in milliseconds, to wait before instructing the browser to reload/inject following a file + * change event + * Default: 0 + */ + reloadDelay?: number; + /** + * Restrict the frequency in which browser:reload events can be emitted to connected clients + * Default: 0 + * Note: requires at least version 2.6.0 + */ + reloadDebounce?: number; + /** + * User provided plugins + * Default: [] + * Note: requires at least version 2.6.0 + */ + plugins?: any[]; + /** + * Whether to inject changes (rather than a page refresh) + * Default: true + */ + injectChanges?: boolean; + /** + * The initial path to load + */ + startPath?: string; + /** + * Whether to minify the client script + * Default: true + */ + minify?: boolean; + /** + * Override host detection if you know the correct IP to use + */ + host?: string; + /** + * Send file-change events to the browser + * Default: true + */ + codeSync?: boolean; + /** + * Append timestamps to injected files + * Default: true + */ + timestamps?: boolean; + /** + * Alter the script path for complete control over where the Browsersync Javascript is served + * from. Whatever you return from this function will be used as the script path. + * Note: requires at least version 1.5.0 + */ + scriptPath?: (path: string) => string; + /** + * Configure the Socket.IO path and namespace & domain to avoid collisions. + * path - Default: "/browser-sync/socket.io" + * clientPath - Default: "/browser-sync" + * namespace - Default: "/browser-sync" + * domain - Default: undefined + * port - Default: undefined + * clients.heartbeatTimeout - Default: 5000 + * Note: requires at least version 1.6.2 + */ + socket?: SocketOptions; + } + + interface Hash { + [path: string]: T; + } + + interface ChokidarOptions { + interval?: number; + debounceDelay?: number; + mode?: string; + cwd?: string; + } + + interface UIOptions { + /** set the default port */ + port?: number; + /** set the default weinre port */ + weinre?: { + port?: number; + }; + } + + interface ServerOptions { + /** set base directory */ + baseDir?: string | string[]; + /** enable directory listing */ + directory?: boolean; + /** set index filename */ + index?: string; + /** + * key-value object hash, where the key is the url to match, + * and the value is the folder to serve (relative to your working directory) + */ + routes?: Hash; + /** configure custom middleware */ + middleware?: MiddlewareHandler[]; + } + + interface ProxyOptions { + target?: string; + middleware?: MiddlewareHandler; + ws: boolean; + reqHeaders: (config: any) => Hash; + proxyRes: (res: http.ServerResponse, req: http.ServerRequest, next: Function) => any; + } + + interface MiddlewareHandler { + (req: http.ServerRequest, res: http.ServerResponse, next: Function): any; + } + + interface GhostOptions { + clicks?: boolean; + scroll?: boolean; + forms?: boolean; + } + + interface SnippetOptions { + ignorePaths?: string; + rule?: { match?: RegExp; fn?: (snippet: string, match: string) => any }; + } + + interface SocketOptions { + path?: string; + clientPath?: string; + namespace?: string; + domain?: string; + port?: number; + clients?: { heartbeatTimeout?: number; }; + } + + interface RewriteRules { + match: RegExp; + fn: (match: string) => string; + } + + interface BrowserSyncStatic extends BrowserSyncInstance { + /** + * Start the Browsersync service. This will launch a server, proxy or start the snippet mode + * depending on your use-case. + */ + (config?: Options, callback?: (err: Error, bs: Object) => any): BrowserSyncInstance; + /** + * Create a Browsersync instance + * @param name an identifier that can used for retrieval later + */ + create(name?: string): BrowserSyncInstance; + /** + * Get a single instance by name. This is useful if you have your build scripts in separate files + * @param name the identifier used for retrieval + */ + get(name: string): BrowserSyncInstance; + } + + interface BrowserSyncInstance { + /** the name of this instance of browser-sync */ + name: string; + /** + * Start the Browsersync service. This will launch a server, proxy or start the snippet mode + * depending on your use-case. + */ + init(config?: Options, callback?: (err: Error, bs: Object) => any): BrowserSyncInstance; + /** + * Reload the browser + * The reload method will inform all browsers about changed files and will either cause the browser + * to refresh, or inject the files where possible. + */ + reload(): void; + /** + * Reload a single file + * The reload method will inform all browsers about changed files and will either cause the browser + * to refresh, or inject the files where possible. + */ + reload(file: string): void; + /** + * Reload multiple files + * The reload method will inform all browsers about changed files and will either cause the browser + * to refresh, or inject the files where possible. + */ + reload(files: string[]): void; + /** + * The reload method will inform all browsers about changed files and will either cause the browser + * to refresh, or inject the files where possible. + */ + reload(options: { stream: boolean }): NodeJS.ReadWriteStream; + /** + * The stream method returns a transform stream and can act once or on many files. + * @param opts Configuration for the stream method + */ + stream(opts?: { once: boolean }): NodeJS.ReadWriteStream; + /** + * Helper method for browser notifications + * @param message Can be a simple message such as 'Connected' or HTML + * @param timeout How long the message will remain in the browser. @since 1.3.0 + */ + notify(message: string, timeout?: number): void; + /** + * This method will close any running server, stop file watching & exit the current process. + */ + exit(): void; + /** + * Stand alone file-watcher. Use this along with Browsersync to create your own, minimal build system + */ + watch(patterns: string, opts?: chokidar.WatchOptions, fn?: (event: string, file: fs.Stats) => any) + : NodeJS.EventEmitter; + /** + * Method to pause file change events + */ + pause(): void; + /** + * Method to resume paused watchers + */ + resume(): void; + /** + * The internal Event Emitter used by the running Browsersync instance (if there is one). You can use + * this to emit your own events, such as changed files, logging etc. + */ + emitter: NodeJS.EventEmitter; + /** + * A simple true/false flag that you can use to determine if there's a currently-running Browsersync instance. + */ + active: boolean; + /** + * A simple true/false flag to determine if the current instance is paused + */ + paused: boolean; + } } - interface ServerOptions { - /** set base directory */ - baseDir?: string | string[]; - /** enable directory listing */ - directory?: boolean; - /** set index filename */ - index?: string; - /** - * key-value object hash, where the key is the url to match, - * and the value is the folder to serve (relative to your working directory) - * */ - routes?: Hash; - /** configure custom middleware */ - middleware?: MiddlewareHandler[]; - } - - interface ProxyOptions { - target?: string; - middleware?: MiddlewareHandler; - ws: boolean; - reqHeaders: (config: any) => Hash; - proxyRes: (res: http.ServerResponse, req: http.ServerRequest, next: Function) => any; - } - - interface MiddlewareHandler { - (req: http.ServerRequest, res: http.ServerResponse, next: Function): any; - } - - interface GhostOptions { - clicks?: boolean; - scroll?: boolean; - forms?: boolean; - } - - interface SnippetOptions { - ignorePaths?: string; - rule?: {match?: RegExp; fn?: (snippet: string, match: string) => any}; - } - - interface SocketOptions { - path?: string; - clientPath?: string; - namespace?: string; - domain?: string; - port?: number; - clients?: { heartbeatTimeout?: number; }; - } - - interface RewriteRules { - match: RegExp; - fn: (match: string) => string; - } - - interface BrowserSyncStatic extends BrowserSyncInstance { - /** - * Start the Browsersync service. This will launch a server, proxy or start the snippet mode - * depending on your use-case. - */ - (config?: Options, callback?: (err: Error, bs: Object) => any): BrowserSyncInstance; - /** - * Create a Browsersync instance - * @param name an identifier that can used for retrieval later - */ - create(name?: string): BrowserSyncInstance; - /** - * Get a single instance by name. This is useful if you have your build scripts in separate files - * @param name the identifier used for retrieval - */ - get(name: string): BrowserSyncInstance; - } - - interface BrowserSyncInstance { - /** the name of this instance of browser-sync */ - name: string; - /** - * Start the Browsersync service. This will launch a server, proxy or start the snippet mode - * depending on your use-case. - */ - init(config?: Options, callback?: (err: Error, bs: Object) => any): BrowserSyncInstance; - /** - * Reload the browser - * The reload method will inform all browsers about changed files and will either cause the browser - * to refresh, or inject the files where possible. - */ - reload(): void; - /** - * Reload a single file - * The reload method will inform all browsers about changed files and will either cause the browser - * to refresh, or inject the files where possible. - */ - reload(file: string): void; - /** - * Reload multiple files - * The reload method will inform all browsers about changed files and will either cause the browser - * to refresh, or inject the files where possible. - */ - reload(files: string[]): void; - /** - * The reload method will inform all browsers about changed files and will either cause the browser - * to refresh, or inject the files where possible. - */ - reload(options: {stream: boolean}): NodeJS.ReadWriteStream; - /** - * The stream method returns a transform stream and can act once or on many files. - * @param opts Configuration for the stream method - */ - stream(opts: {once: boolean}): NodeJS.ReadWriteStream; - /** - * Helper method for browser notifications - * @param message Can be a simple message such as 'Connected' or HTML - * @param timeout How long the message will remain in the browser. @since 1.3.0 - */ - notify(message: string, timeout?: number): void; - /** - * This method will close any running server, stop file watching & exit the current process. - */ - exit(): void; - /** - * Stand alone file-watcher. Use this along with Browsersync to create your own, minimal build system - */ - watch(patterns: string, opts?: chokidar.WatchOptions, fn?: (event: string, file: fs.Stats) => any) - : NodeJS.EventEmitter; - /** - * Method to pause file change events - */ - pause(): void; - /** - * Method to resume paused watchers - */ - resume(): void; - /** - * The internal Event Emitter used by the running Browsersync instance (if there is one). You can use - * this to emit your own events, such as changed files, logging etc. - */ - emitter: NodeJS.EventEmitter; - /** - * A simple true/false flag that you can use to determine if there's a currently-running Browsersync instance. - */ - active: boolean; - /** - * A simple true/false flag to determine if the current instance is paused - */ - paused: boolean; - } - - const browserSync: BrowserSyncStatic; - + const browserSync: browserSync.BrowserSyncStatic; export = browserSync; } diff --git a/browserify/browserify-tests.ts b/browserify/browserify-tests.ts index 524901566..b4096a7f9 100644 --- a/browserify/browserify-tests.ts +++ b/browserify/browserify-tests.ts @@ -2,11 +2,51 @@ import browserify = require("browserify"); import fs = require("fs"); +import stream = require('stream'); -var b: BrowserifyObject = browserify(); +var bNoArg = browserify(); + +var b = browserify({ + baseDir: 'somewhere' +}); b.add('./browser/main.js'); -b.transform('deamdify'); -b.bundle().pipe(fs.createWriteStream('bundle.js')); +b.transform('deamdify') + .transform(function (file) { + return new stream.Transform(); + }).plugin((b, opts) => { return opts.l; }, {l: 3}) + .require('foo', { expose: 'bar' }) + .exclude('baz') + .ignore('bat') + .reset({ basedir: 'elsewhere' }); -var customBrowsify: Browserify = require("browserify"); +b.on('file', (file) => { + file += ""; +}); + +b.external(bNoArg); + +var b2 = new browserify(['/some/File', {file: '/some/file' }, fs.createReadStream('/somewhere')], { builtins: ['buffer']}) + .reset({ + builtins: { + 'buffer': './customBuffer' + } + }); + +var customBrowsify = require("browserify"); customBrowsify({entries: []}); + +var b = browserify('./browser/main.js', { + noParse: ['jquery'], + debug: true, + foo: 'bar' +}); +b.add('./browser/other.js'); +b.transform(function(file: string): NodeJS.ReadWriteStream { + return new stream.PassThrough(); +}); + +var record_pipeline = b.pipeline.get('record'); + +b.bundle().pipe(process.stdout); + + diff --git a/browserify/browserify.d.ts b/browserify/browserify.d.ts index c301df51e..1ce6b653d 100644 --- a/browserify/browserify.d.ts +++ b/browserify/browserify.d.ts @@ -1,41 +1,182 @@ -// Type definitions for Browserify +// Type definitions for Browserify v12.0.1 // Project: http://browserify.org/ -// Definitions by: Andrew Gaspar +// Definitions by: Andrew Gaspar , John Vilk // Definitions: https://github.com/borisyankov/DefinitelyTyped /// -interface BrowserifyObject extends NodeJS.EventEmitter { - add(file:string, opts?:any): BrowserifyObject; - require(file:string, opts?:{ - expose: string; - }): BrowserifyObject; - bundle(opts?:{ - insertGlobals?: boolean; - detectGlobals?: boolean; - debug?: boolean; - standalone?: string; - insertGlobalVars?: any; - }, cb?:(err:any, src:any) => void): NodeJS.ReadableStream; +declare module Browserify { + /** + * Options pertaining to an individual file. + */ + interface FileOptions { + // If true, this is considered an entry point to your app. + entry?: boolean; + // Expose this file under a custom dependency name. + // require('./vendor/angular/angular.js', {expose: 'angular'}) enables require('angular') + expose?: string; + // Basedir to use to resolve this file's path. + basedir?: string; + // The name/path to the file. + file?: string; + // Forward file to external() to be externalized. + external?: boolean; + // Disable transforms on file if set to false. + transform?: boolean; + // The ID to use for require() statements. + id?: string; + } - external(file:string, opts?:any): BrowserifyObject; - ignore(file:string, opts?:any): BrowserifyObject; - transform(tr:string, opts?:any): BrowserifyObject; - transform(tr:Function, opts?:any): BrowserifyObject; - plugin(plugin:string, opts?:any): BrowserifyObject; - plugin(plugin:Function, opts?:any): BrowserifyObject; -} -interface Browserify { - (): BrowserifyObject; - (files:string[]): BrowserifyObject; - (opts:{ - entries?: string[]; + // Browserify accepts a filename, an input stream for file inputs, or a FileOptions configuration + // for each file in a bundle. + type InputFile = string | NodeJS.ReadableStream | FileOptions; + + /** + * Options pertaining to a Browserify instance. + */ + interface Options { + // Custom properties can be defined on Options. + // These options are forwarded along to module-deps and browser-pack directly. + [propName: string]: any; + // String, file object, or array of those types (they may be mixed) specifying entry file(s). + entries?: InputFile | InputFile[]; + // an array which will skip all require() and global parsing for each file in the array. + // Use this for giant libs like jquery or threejs that don't have any requires or node-style globals but take forever to parse. noParse?: string[]; - }): BrowserifyObject; + // an array of optional extra extensions for the module lookup machinery to use when the extension has not been specified. + // By default Browserify considers only .js and .json files in such cases. + extensions?: string[]; + // the directory that Browserify starts bundling from for filenames that start with .. + basedir?: string; + // an array of directories that Browserify searches when looking for modules which are not referenced using relative path. + // Can be absolute or relative to basedir. Equivalent of setting NODE_PATH environmental variable when calling Browserify command. + paths?: string[]; + // sets the algorithm used to parse out the common paths. Use false to turn this off, otherwise it uses the commondir module. + commondir?: boolean; + // disables converting module ids into numerical indexes. This is useful for preserving the original paths that a bundle was generated with. + fullPaths?: boolean; + // sets the list of built-ins to use, which by default is set in lib/builtins.js in this distribution. + builtins?: string[] | {[builtinName: string]: string} | boolean; + // set if external modules should be bundled. Defaults to true. + bundleExternal?: boolean; + // When true, always insert process, global, __filename, and __dirname without analyzing the AST for faster builds but larger output bundles. Default false. + insertGlobals?: boolean; + // When true, scan all files for process, global, __filename, and __dirname, defining as necessary. + // With this option npm modules are more likely to work but bundling takes longer. Default true. + detectGlobals?: boolean; + // When true, add a source map inline to the end of the bundle. This makes debugging easier because you can see all the original files if you are in a modern enough browser. + debug?: boolean; + // When a non-empty string, a standalone module is created with that name and a umd wrapper. + // You can use namespaces in the standalone global export using a . in the string name as a separator, for example 'A.B.C'. + // The global export will be sanitized and camel cased. + standalone?: string; + // will be passed to insert-module-globals as the opts.vars parameter. + insertGlobalVars?: {[globalName: string]: (file: string, basedir: string) => any}; + // defaults to 'require' in expose mode but you can use another name. + externalRequireName?: string; + } + + interface BrowserifyConstructor { + (files: InputFile[], opts?: Options): BrowserifyObject; + (file: InputFile, opts?: Options): BrowserifyObject; + (opts: Options): BrowserifyObject; + (): BrowserifyObject + new(files: InputFile[], opts?: Options): BrowserifyObject; + new(file: InputFile, opts?: Options): BrowserifyObject; + new(opts: Options): BrowserifyObject; + new(): BrowserifyObject + } + + interface BrowserifyObject extends NodeJS.EventEmitter { + /** + * Add an entry file from file that will be executed when the bundle loads. + * If file is an array, each item in file will be added as an entry file. + */ + add(file: InputFile[], opts?: FileOptions): BrowserifyObject; + add(file: InputFile, opts?: FileOptions): BrowserifyObject; + /** + * Make file available from outside the bundle with require(file). + * The file param is anything that can be resolved by require.resolve(). + * file can also be a stream, but you should also use opts.basedir so that relative requires will be resolvable. + * If file is an array, each item in file will be required. In file array form, you can use a string or object for each item. Object items should have a file property and the rest of the parameters will be used for the opts. + * Use the expose property of opts to specify a custom dependency name. require('./vendor/angular/angular.js', {expose: 'angular'}) enables require('angular') + */ + require(file: InputFile, opts?: FileOptions): BrowserifyObject; + /** + * Bundle the files and their dependencies into a single javascript file. + * Return a readable stream with the javascript file contents or optionally specify a cb(err, buf) to get the buffered results. + */ + bundle(cb?: (err: any, src: Buffer) => any): NodeJS.ReadableStream; + /** + * Prevent file from being loaded into the current bundle, instead referencing from another bundle. + * If file is an array, each item in file will be externalized. + * If file is another bundle, that bundle's contents will be read and excluded from the current bundle as the bundle in file gets bundled. + */ + external(file: string[], opts?: { basedir?: string }): BrowserifyObject; + external(file: string, opts?: { basedir?: string }): BrowserifyObject; + external(file: BrowserifyObject): BrowserifyObject; + /** + * Prevent the module name or file at file from showing up in the output bundle. + * Instead you will get a file with module.exports = {}. + */ + ignore(file: string, opts?: { basedir?: string }): BrowserifyObject; + /** + * Prevent the module name or file at file from showing up in the output bundle. + * If your code tries to require() that file it will throw unless you've provided another mechanism for loading it. + */ + exclude(file: string, opts?: { basedir?: string }): BrowserifyObject; + /** + * Transform source code before parsing it for require() calls with the transform function or module name tr. + * If tr is a function, it will be called with tr(file) and it should return a through-stream that takes the raw file contents and produces the transformed source. + * If tr is a string, it should be a module name or file path of a transform module + */ + transform(tr: string, opts?: T): BrowserifyObject; + transform(tr: (file: string, opts: T) => NodeJS.ReadWriteStream, opts?: T): BrowserifyObject; + /** + * Register a plugin with opts. Plugins can be a string module name or a function the same as transforms. + * plugin(b, opts) is called with the Browserify instance b. + */ + plugin(plugin: string, opts?: T): BrowserifyObject; + plugin(plugin: (b: BrowserifyObject, opts: T) => any, opts?: T): BrowserifyObject; + /** + * Reset the pipeline back to a normal state. This function is called automatically when bundle() is called multiple times. + * This function triggers a 'reset' event. + */ + reset(opts?: Options): void; + + /** + * When a file is resolved for the bundle, the bundle emits a 'file' event with the full file path, the id string passed to require(), and the parent object used by browser-resolve. + * You could use the file event to implement a file watcher to regenerate bundles when files change. + */ + on(event: 'file', listener: (file: string, id: string, parent: any) => any): BrowserifyObject; + /** + * When a package.json file is read, this event fires with the contents. + * The package directory is available at pkg.__dirname. + */ + on(event: 'package', listener: (pkg: any) => any): BrowserifyObject; + /** + * When .bundle() is called, this event fires with the bundle output stream. + */ + on(event: 'bundle', listener: (bundle: NodeJS.ReadableStream) => any): BrowserifyObject; + /** + * When the .reset() method is called or implicitly called by another call to .bundle(), this event fires. + */ + on(event: 'reset', listener: () => any): BrowserifyObject; + /** + * When a transform is applied to a file, the 'transform' event fires on the bundle stream with the transform stream tr and the file that the transform is being applied to. + */ + on(event: 'transform', listener: (tr: NodeJS.ReadWriteStream, file: string) => any): BrowserifyObject; + on(event: string, listener: Function): BrowserifyObject; + + /** + * Set to any until substack/labeled-stream-splicer is defined + */ + pipeline: any; + } } declare module "browserify" { - var browserify: Browserify; + var browserify: Browserify.BrowserifyConstructor; export = browserify; } diff --git a/buffer-compare/buffer-compare-tests.ts b/buffer-compare/buffer-compare-tests.ts new file mode 100644 index 000000000..88e6dddb9 --- /dev/null +++ b/buffer-compare/buffer-compare-tests.ts @@ -0,0 +1,27 @@ +/// +/// + +import compare = require('buffer-compare'); + +let result: number; + +result = compare(new Buffer(''), new Buffer('')); +result = compare([], []); +result = compare('', ''); +result = compare(new Buffer(''), []); +result = compare([], ''); +result = compare('', new Buffer('')); + +result = compare(new Buffer(''), new Buffer('')); +result = compare([], []); +result = compare('', ''); +result = compare(new Buffer(''), []); +result = compare([], ''); +result = compare('', new Buffer('')); + +result = compare(new Buffer(''), new Buffer('')); +result = compare([], []); +result = compare('', ''); +result = compare(new Buffer(''), []); +result = compare([], ''); +result = compare('', new Buffer('')); diff --git a/buffer-compare/buffer-compare.d.ts b/buffer-compare/buffer-compare.d.ts new file mode 100644 index 000000000..58e4004dc --- /dev/null +++ b/buffer-compare/buffer-compare.d.ts @@ -0,0 +1,17 @@ +// Type definitions for buffer-compare +// Project: https://github.com/soldair/node-buffer-compare +// Definitions by: Ilya Mochalov +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module "buffer-compare" { + interface List { + [index: number]: any; + length: number + } + + function compare(cmp: List, to: List): number; + function compare(cmp: T, to: T): number; + function compare(cmp: C, to: T): number; + + export = compare; +} diff --git a/bytebuffer/bytebuffer-tests.ts b/bytebuffer/bytebuffer-tests.ts new file mode 100644 index 000000000..34db7368d --- /dev/null +++ b/bytebuffer/bytebuffer-tests.ts @@ -0,0 +1,8 @@ +/// + +import ByteBuffer = require("bytebuffer"); + +var bb = new ByteBuffer() + .writeIString("Hello world!") + .flip(); +console.log(bb.readIString()+" from bytebuffer.js"); \ No newline at end of file diff --git a/bytebuffer/bytebuffer.d.ts b/bytebuffer/bytebuffer.d.ts new file mode 100644 index 000000000..8f1a800ea --- /dev/null +++ b/bytebuffer/bytebuffer.d.ts @@ -0,0 +1,615 @@ +// Type definitions for bytebuffer.js 5.0.0 +// Project: https://github.com/dcodeIO/bytebuffer.js +// Definitions by: Denis Cappellin +// Definitions: https://github.com/borisyankov/DefinitelyTyped +// Definitions by: SINTEF-9012 + +/// + +declare class ByteBuffer +{ + /** + * Constructs a new ByteBuffer. + */ + constructor( capacity?: number, littleEndian?: boolean, noAssert?: boolean ); + + /** + * Big endian constant that can be used instead of its boolean value. Evaluates to false. + */ + static BIG_ENDIAN: boolean; + + /** + * Default initial capacity of 16. + */ + static DEFAULT_CAPACITY: number; + + /** + * Default no assertions flag of false. + */ + static DEFAULT_NOASSERT: boolean; + + /** + * Little endian constant that can be used instead of its boolean value. Evaluates to true. + */ + static LITTLE_ENDIAN: boolean; + + /** + * Maximum number of bytes required to store a 32bit base 128 variable-length integer. + */ + static MAX_VARINT32_BYTES: number; + + /** + * Maximum number of bytes required to store a 64bit base 128 variable-length integer. + */ + static MAX_VARINT64_BYTES: number; + + /** + * Metrics representing number of bytes.Evaluates to 2. + */ + static METRICS_BYTES: number; + + /** + * Metrics representing number of UTF8 characters.Evaluates to 1. + */ + static METRICS_CHARS: number; + + /** + * ByteBuffer version. + */ + static VERSION: string; + + /** + * Backing buffer. + */ + buffer: ArrayBuffer; + + /** + * Absolute limit of the contained data. Set to the backing buffer's capacity upon allocation. + */ + limit: number; + + /** + * Whether to use little endian byte order, defaults to false for big endian. + */ + littleEndian: boolean; + + /** + * Marked offset. + */ + markedOffset: number; + + /** + * Whether to skip assertions of offsets and values, defaults to false. + */ + noAssert: boolean; + + /** + * Absolute read/write offset. + */ + offset: number; + + /** + * Data view to manipulate the backing buffer. Becomes null if the backing buffer has a capacity of 0. + */ + view: DataView; + + /** + * Allocates a new ByteBuffer backed by a buffer of the specified capacity. + */ + static allocate( capacity?: number, littleEndian?: number, noAssert?: boolean ): ByteBuffer; + + /** + * Decodes a base64 encoded string to binary like window.atob does. + */ + static atob( b64: string ): string; + + /** + * Encodes a binary string to base64 like window.btoa does. + */ + static btoa( str: string ): string; + + /** + * Calculates the number of UTF8 bytes of a string. + */ + static calculateUTF8Byte( str: string ): number; + + /** + * Calculates the number of UTF8 characters of a string.JavaScript itself uses UTF- 16, so that a string's length property does not reflect its actual UTF8 size if it contains code points larger than 0xFFFF. + */ + static calculateUTF8Char( str: string ): number; + + /** + * Calculates the actual number of bytes required to store a 32bit base 128 variable-length integer. + */ + static calculateVariant32( value: number ): number; + + /** + * Calculates the actual number of bytes required to store a 64bit base 128 variable-length integer. + */ + static calculateVariant64( value: number | Long ): number; + + /** + * Concatenates multiple ByteBuffers into one. + */ + static concat( buffers: Array, encoding?: string | boolean, litteEndian?: boolean, noAssert?: boolean ): ByteBuffer; + + /** + * Decodes a base64 encoded string to a ByteBuffer. + */ + static fromBase64( str: string, littleEndian?: boolean, noAssert?: boolean ): ByteBuffer; + + /** + * Decodes a binary encoded string, that is using only characters 0x00-0xFF as bytes, to a ByteBuffer. + */ + static fromBinary( str: string, littleEndian?: boolean, noAssert?: boolean ): ByteBuffer; + + /** + * Decodes a hex encoded string with marked offsets to a ByteBuffer. + */ + static fromDebug( str: string, littleEndian?: boolean, noAssert?: boolean ): ByteBuffer; + + /** + * Decodes a hex encoded string to a ByteBuffer. + */ + static fromHex( str: string, littleEndian?: boolean, noAssert?: boolean ): ByteBuffer; + + /** + * Decodes an UTF8 encoded string to a ByteBuffer. + */ + static fromUTF8( str: string, littleEndian?: boolean, noAssert?: boolean ): ByteBuffer; + + /** + * Gets the backing buffer type. + */ + static isByteBuffer( bb: any ): boolean; + + /** + * Wraps a buffer or a string. Sets the allocated ByteBuffer's ByteBuffer#offset to 0 and its ByteBuffer#limit to the length of the wrapped data. + * @param buffer Anything that can be wrapped + * @param encoding String encoding if buffer is a string ("base64", "hex", "binary", defaults to "utf8") + * @param littleEndian Whether to use little or big endian byte order. Defaults to ByteBuffer.DEFAULT_ENDIAN. + * @param noAssert Whether to skip assertions of offsets and values. Defaults to ByteBuffer.DEFAULT_NOASSERT. + */ + static wrap( buffer: ByteBuffer | ArrayBuffer | Uint8Array | string, enc?: string | boolean, littleEndian?: boolean, noAssert?: boolean ): ByteBuffer; + + /** + * Decodes a zigzag encoded signed 32bit integer. + */ + static zigZagDecode32( n: number ): number; + + /** + * Decodes a zigzag encoded signed 64bit integer. + */ + static zigZagDecode64( n: number | Long ): Long; + + /** + * Zigzag encodes a signed 32bit integer so that it can be effectively used with varint encoding. + */ + static zigZagEncode32( n: number ): number; + + /** + * Zigzag encodes a signed 64bit integer so that it can be effectively used with varint encoding. + */ + static zigZagEncode64( n: number | Long ): Long; + + /** + * Switches (to) big endian byte order. + */ + BE( bigEndian?: boolean ): ByteBuffer; + + /** + * Switches (to) little endian byte order. + */ + LE( bigEndian?: boolean ): ByteBuffer; + + /** + * Appends some data to this ByteBuffer. This will overwrite any contents behind the specified offset up to the appended data's length. + */ + append( source: ByteBuffer | ArrayBuffer | Uint8Array | string, encoding?: string | number, offset?: number ): ByteBuffer; + + /** + * Appends this ByteBuffer's contents to another ByteBuffer. This will overwrite any contents behind the specified offset up to the length of this ByteBuffer's data. + */ + appendTo( target: ByteBuffer, offset?: number ): ByteBuffer; + + /** + * Enables or disables assertions of argument types and offsets. Assertions are enabled by default but you can opt to disable them if your code already makes sure that everything is valid. + */ + assert( assert: boolean ): ByteBuffer; + + /** + * Gets the capacity of this ByteBuffer's backing buffer. + */ + capacity(): number; + + /** + * Clears this ByteBuffer's offsets by setting ByteBuffer#offset to 0 and + * ByteBuffer#limit to the backing buffer's capacity. Discards ByteBuffer#markedOffset. + */ + clear(): ByteBuffer; + + /** + * Creates a cloned instance of this ByteBuffer, preset with this ByteBuffer's values for ByteBuffer#offset, ByteBuffer#markedOffset and ByteBuffer#limit. + */ + clone( copy?: boolean ): ByteBuffer; + + /** + * Compacts this ByteBuffer to be backed by a ByteBuffer#buffer of its contents' length. Contents are the bytes between ByteBuffer#offset and ByteBuffer#limit. Will set offset = 0 and limit = capacity and adapt ByteBuffer#markedOffset to the same relative position if set. + */ + compact( begin?: number, end?: number ): ByteBuffer; + + /** + * Creates a copy of this ByteBuffer's contents. Contents are the bytes between ByteBuffer#offset and ByteBuffer#limit. + */ + copy( begin?: number, end?: number ): ByteBuffer; + + /** + * Copies this ByteBuffer's contents to another ByteBuffer. Contents are the bytes between ByteBuffer#offset and ByteBuffer#limit. + */ + copyTo( target: ByteBuffer, targetOffset?: number, sourceOffset?: number, sourceLimit?: number ): ByteBuffer; + + /** + * Makes sure that this ByteBuffer is backed by a ByteBuffer#buffer of at least the specified capacity. If the current capacity is exceeded, it will be doubled. If double the current capacity is less than the required capacity, the required capacity will be used instead. + */ + ensureCapacity( capacity: number ): ByteBuffer; + + /** + * Overwrites this ByteBuffer's contents with the specified value. Contents are the bytes between ByteBuffer#offset and ByteBuffer#limit. + */ + fill( value: number | string, begin?: number, end?: number ): ByteBuffer; + + /** + * Makes this ByteBuffer ready for a new sequence of write or relative read operations. Sets limit = offset and offset = 0. Make sure always to flip a ByteBuffer when all relative read or write operations are complete. + */ + flip(): ByteBuffer; + + /** + * Marks an offset on this ByteBuffer to be used later. + */ + mark( offset?: number ): ByteBuffer; + + /** + * Sets the byte order. + */ + order( littleEndian: boolean ): ByteBuffer; + + /** + * Prepends some data to this ByteBuffer. This will overwrite any contents before the specified offset up to the prepended data's length. If there is not enough space available before the specified offset, the backing buffer will be resized and its contents moved accordingly. + */ + prepend( source: ByteBuffer | string | ArrayBuffer, encoding?: string | number, offset?: number ): ByteBuffer; + + /** + * Prepends this ByteBuffer to another ByteBuffer. This will overwrite any contents before the specified offset up to the prepended data's length. If there is not enough space available before the specified offset, the backing buffer will be resized and its contents moved accordingly. + */ + prependTo( target: ByteBuffer, offset?: number ): ByteBuffer; + + /** + * Prints debug information about this ByteBuffer's contents. + */ + printDebug( out?: ( text: string ) => void ): void; + + /** + * Reads an 8bit signed integer. This is an alias of ByteBuffer#readInt8. + */ + readByte( offset?: number ): number; + + /** + * Reads a NULL-terminated UTF8 encoded string. For this to work the string read must not contain any NULL characters itself. + */ + readCString( offset?: number ): string; + + /** + * Reads a 64bit float. This is an alias of ByteBuffer#readFloat64. + */ + readDouble( offset?: number ): number; + + /** + * Reads a 32bit float. This is an alias of ByteBuffer#readFloat32. + */ + readFloat( offset?: number ): number; + + /** + * Reads a 32bit float. + */ + readFloat32( offset?: number ): number; + + /** + * Reads a 64bit float. + */ + readFloat64( offset?: number ): number; + + /** + * Reads a length as uint32 prefixed UTF8 encoded string. + */ + readIString( offset?: number ): string; + + /** + * Reads a 32bit signed integer.This is an alias of ByteBuffer#readInt32. + */ + readInt( offset?: number ): number; + + /** + * Reads a 16bit signed integer. + */ + readInt16( offset?: number ): number; + + /** + * Reads a 32bit signed integer. + */ + readInt32( offset?: number ): number; + + /** + * Reads a 64bit signed integer. + */ + readInt64( offset?: number ): Long; + + /** + * Reads an 8bit signed integer. + */ + readInt8( offset?: number ): number; + + /** + * Reads a 64bit signed integer. This is an alias of ByteBuffer#readInt64. + */ + readLong( offset?: number ): Long; + + /** + * Reads a 16bit signed integer. This is an alias of ByteBuffer#readInt16. + */ + readShort( offset?: number ): number; + + /** + * Reads an UTF8 encoded string. This is an alias of ByteBuffer#readUTF8String. + */ + readString( length: number, metrics?: number, offset?: number ): string; + + /** + * Reads an UTF8 encoded string. + */ + readUTF8String( chars: number, offset?: number ): string; + + /** + * Reads a 16bit unsigned integer. + */ + readUint16( offset?: number ): number; + + /** + * Reads a 32bit unsigned integer. + */ + readUint32( offset?: number ): number; + + /** + * Reads a 64bit unsigned integer. + */ + readUint64( offset?: number ): Long; + /** + * Reads an 8bit unsigned integer. + */ + readUint8( offset?: number ): number; + + /** + * Reads a length as varint32 prefixed UTF8 encoded string. + */ + readVString( offset?: number ): string; + + /** + * Reads a 32bit base 128 variable-length integer. + */ + readVarint32( offset?: number ): number; + + /** + * Reads a zig-zag encoded 32bit base 128 variable-length integer. + */ + readVarint32ZiZag( offset?: number ): number; + + /** + * Reads a 64bit base 128 variable-length integer. Requires Long.js. + */ + readVarint64( offset?: number ): Long; + + /** + * Reads a zig-zag encoded 64bit base 128 variable-length integer. Requires Long.js. + */ + readVarint64ZigZag( offset?: number ): Long; + + /** + * Gets the number of remaining readable bytes. Contents are the bytes between ByteBuffer#offset and ByteBuffer#limit, so this returns limit - offset. + */ + remaining(): number; + + /** + * Resets this ByteBuffer's ByteBuffer#offset. If an offset has been marked through ByteBuffer#mark before, offset will be set to ByteBuffer#markedOffset, which will then be discarded. If no offset has been marked, sets offset = 0. + */ + reset(): ByteBuffer; + + /** + * Resizes this ByteBuffer to be backed by a buffer of at least the given capacity. Will do nothing if already that large or larger. + */ + resize( capacity: number ): ByteBuffer; + + /** + * Reverses this ByteBuffer's contents + */ + reverse( begin?: number, end?: number ): ByteBuffer; + + /** + * Skips the next length bytes. This will just advance + */ + skip( length: number ): ByteBuffer; + + /** + * Slices this ByteBuffer by creating a cloned instance with offset = begin and limit = end. + */ + slice( begin?: number, end?: number ): ByteBuffer; + + /** + * Returns a raw buffer compacted to contain this ByteBuffer's contents. Contents are the bytes between ByteBuffer#offset and ByteBuffer#limit. Will transparently ByteBuffer#flip this ByteBuffer if offset > limit but the actual offsets remain untouched. This is an alias of ByteBuffer#toBuffer. + */ + toArrayBuffer( forceCopy?: boolean ): ArrayBuffer; + + /** + * Encodes this ByteBuffer's contents to a base64 encoded string. + */ + toBase64( begin?: number, end?: number ): string; + + /** + * Encodes this ByteBuffer to a binary encoded string, that is using only characters 0x00-0xFF as bytes. + */ + toBinary( begin?: number, end?: number ): string; + + /** + * Returns a copy of the backing buffer that contains this ByteBuffer's contents. Contents are the bytes between ByteBuffer#offset and ByteBuffer#limit. Will transparently ByteBuffer#flip this ByteBuffer if offset > limit but the actual offsets remain untouched. + */ + toBuffer( forceCopy?: boolean ): ArrayBuffer; + + /** + *Encodes this ByteBuffer to a hex encoded string with marked offsets. Offset symbols are: + * < : offset, + * ' : markedOffset, + * > : limit, + * | : offset and limit, + * [ : offset and markedOffset, + * ] : markedOffset and limit, + * ! : offset, markedOffset and limit + */ + toDebug( columns?: boolean ): string | Array + + /** + * Encodes this ByteBuffer's contents to a hex encoded string. + */ + toHex( begin?: number, end?: number ): string; + + /** + * Converts the ByteBuffer's contents to a string. + */ + toString( encoding?: string ): string; + + /** + * Encodes this ByteBuffer's contents between ByteBuffer#offset and ByteBuffer#limit to an UTF8 encoded string. + */ + toUTF8(): string; + + /** + * Writes an 8bit signed integer. This is an alias of ByteBuffer#writeInt8. + */ + writeByte( value: number, offset?: number ): ByteBuffer; + + /** + * Writes a NULL-terminated UTF8 encoded string. For this to work the specified string must not contain any NULL characters itself. + */ + writeCString( str: string, offset?: number ): ByteBuffer; + + /** + * Writes a 64bit float. This is an alias of ByteBuffer#writeFloat64. + */ + writeDouble( value: number, offset?: number ): ByteBuffer; + + /** + * Writes a 32bit float. This is an alias of ByteBuffer#writeFloat32. + */ + writeFloat( value: number, offset?: number ): ByteBuffer; + + /** + * Writes a 32bit float. + */ + writeFloat32( value: number, offset?: number ): ByteBuffer; + + /** + * Writes a 64bit float. + */ + writeFloat64( value: number, offset?: number ): ByteBuffer; + + /** + * Writes a length as uint32 prefixed UTF8 encoded string. + */ + writeIString( str: string, offset?: number ): ByteBuffer; + + /** + * Writes a 32bit signed integer. This is an alias of ByteBuffer#writeInt32. + */ + writeInt( value: number, offset?: number ): ByteBuffer; + + /** + * Writes a 16bit signed integer. + */ + writeInt16( value: number, offset?: number ): ByteBuffer; + + /** + * Writes a 32bit signed integer. + */ + writeInt32( value: number, offset?: number ): ByteBuffer; + + /** + * Writes a 64bit signed integer. + */ + writeInt64( value: number | Long, offset?: number ): ByteBuffer; + + /** + * Writes an 8bit signed integer. + */ + writeInt8( value: number, offset?: number ): ByteBuffer; + + /** + * Writes a 16bit signed integer. This is an alias of ByteBuffer#writeInt16. + */ + writeShort( value: number, offset?: number ): ByteBuffer; + + /** + * Writes an UTF8 encoded string.This is an alias of ByteBuffer#writeUTF8String. + */ + WriteString( str: string, offset?: number ): ByteBuffer | number; + + /** + * Writes an UTF8 encoded string. + */ + writeUTF8String( str: string, offset?: number ): ByteBuffer | number; + + /** + * Writes a 16bit unsigned integer. + */ + writeUint16( value: number, offset?: number ): ByteBuffer; + + /** + * Writes a 32bit unsigned integer. + */ + writeUint32( value: number, offset?: number ): ByteBuffer; + + /** + * Writes a 64bit unsigned integer. + */ + writeUint64( value: number | Long, offset?: number ): ByteBuffer; + + /** + * Writes an 8bit unsigned integer. + */ + writeUint8( value: number, offset?: number ): ByteBuffer; + + /** + * Writes a length as varint32 prefixed UTF8 encoded string. + */ + writeVString( str: string, offset?: number ): ByteBuffer | number; + + /** + * Writes a 32bit base 128 variable-length integer. + */ + writeVarint32( value: number, offset?: number ): ByteBuffer | number; + + /** + * Writes a zig-zag encoded 32bit base 128 variable-length integer. + */ + writeVarint32ZigZag( value: number, offset?: number ): ByteBuffer | number; + + /** + * Writes a 64bit base 128 variable-length integer. + */ + writeVarint64( value: number | Long, offset?: number ): ByteBuffer; + + /** + * Writes a zig-zag encoded 64bit base 128 variable-length integer. + */ + writeVarint64ZigZag( value: number | Long, offset?: number ): ByteBuffer | number; +} + +declare module 'bytebuffer' { + export = ByteBuffer; +} diff --git a/c3/c3.d.ts b/c3/c3.d.ts index 3c7469b0a..7ff889073 100644 --- a/c3/c3.d.ts +++ b/c3/c3.d.ts @@ -177,7 +177,7 @@ declare module c3 { * Set threshold to show/hide labels. */ threshold?: number - }, + }; /** * Enable or disable expanding pie pieces. */ @@ -198,7 +198,7 @@ declare module c3 { * Set threshold to show/hide labels. */ threshold?: number - }, + }; /** * Enable or disable expanding pie pieces. */ @@ -223,7 +223,7 @@ declare module c3 { * Set formatter for the label on gauge. */ format?: (value: any, ratio: number) => string; - }, + }; /** * Enable or disable expanding gauge. */ @@ -686,7 +686,7 @@ declare module c3 { /** * Set custom position for the tooltip. This option can be used to modify the tooltip position by returning object that has top and left. */ - position?: (data: any, width: number, height: number, element: any) => { top: number, left: number }; + position?: (data: any, width: number, height: number, element: any) => { top: number; left: number }; /** * Set custom HTML for the tooltip. * Specified function receives data, defaultTitleFormat, defaultValueFormat and color of the data point to show. If tooltip.grouped is true, data includes multiple data points. @@ -909,7 +909,7 @@ declare module c3 { * Remove regions. This API removes regions. * @param args This argument should include classes. If classes is given, the regions that have one of the specified classes will be removed. If args is not given, all of regions will be removed. */ - remove(args?: { value?: number | string, class?: string }): void; + remove(args?: { value?: number | string; class?: string }): void; }; data: { @@ -995,7 +995,7 @@ declare module c3 { * Get and set axis min and max value. * @param range If range is given, specified axis' min and max value will be updated. If no argument is given, the current min and max values for each axis will be returned. */ - range(range?: { min?: number | { [key: string]: number }, max?: number | { [key: string]: number } }): { min: number | { [key: string]: number }, max: number | { [key: string]: number } } + range(range?: { min?: number | { [key: string]: number }; max?: number | { [key: string]: number } }): { min: number | { [key: string]: number }; max: number | { [key: string]: number } } }; legend: { @@ -1034,7 +1034,7 @@ declare module c3 { * Resize the chart. If no size is specified it will resize to fit. * @param size This argument should include width and height in pixels. */ - resize(size?: { width?: number, height?: number }): void; + resize(size?: { width?: number; height?: number }): void; /** * Force to redraw. @@ -1062,8 +1062,12 @@ declare module c3 { * Remove x/y grid lines. This API removes x/y grid lines. * @param args This argument should include value or class. If value is given, the x/y grid lines that have specified x/y value will be removed. If class is given, the x/y grid lines that have specified class will be removed. If args is not given, all of x/y grid lines will be removed. */ - remove(args?: { class?: string, value?: number | string }): void; + remove(args?: { class?: string; value?: number | string }): void; } export function generate(config: ChartConfiguration): ChartAPI; } + +declare module "c3" { + export = c3; +} diff --git a/cal-heatmap/cal-heatmap-tests.ts b/cal-heatmap/cal-heatmap-tests.ts new file mode 100644 index 000000000..4a7b0cb94 --- /dev/null +++ b/cal-heatmap/cal-heatmap-tests.ts @@ -0,0 +1,723 @@ +/// +/// +/// + +var cal = new CalHeatMap(); +cal.init(); +cal.init({}); + +cal.init({ itemSelector: "div" }); +cal.init({ itemSelector: "#id" }); +cal.init({ itemSelector: ".class" }); +cal.init({ itemSelector: "[title=hi]" }); +cal.init({ itemSelector: "div > span + b" }); + +cal.init({ itemSelector: document.getElementById("myId") }); +cal.init({ itemSelector: document.getElementsByClassName(".class")[0] }); +cal.init({ itemSelector: document.querySelector(".class") }); +cal.init({ itemSelector: $(".class")[0] }); +cal.init({ itemSelector: d3.select(".class")[0][0] }); + +cal.init({ + itemSelector: "#domain-a", + domain: "month", + subDomain: "day", + cellSize: 20, + subDomainTextFormat: "%d", + range: 1, + displayLegend: false +}); + +cal.init({ + itemSelector: "#domain-b", + domain: "month", + subDomain: "x_day", + cellSize: 20, subDomainTextFormat: "%d", + range: 1, + displayLegend: false +}); + +cal.init({ + itemSelector: "#cellSize-a", + domain: "day", + range: 1, + displayLegend: false +}); + +cal.init({ + itemSelector: "#cellSize-b", + domain: "day", + range: 1, + cellSize: 15, + displayLegend: false +}); + +cal.init({ + itemSelector: "#cellPadding-a", + domain: "day", + range: 1, + displayLegend: false +}); + +cal.init({ + itemSelector: "#cellPadding-b", + domain: "day", + range: 1, + cellPadding: 5, + displayLegend: false +}); + +cal.init({ + itemSelector: "#cellRadius-a", + cellSize: 15, + domain: "day", + range: 1, + displayLegend: false +}); + +cal.init({ + itemSelector: "#cellRadius-b", + cellSize: 15, + domain: "day", + range: 1, + cellRadius: 10, + displayLegend: false +}); + +cal.init({ + itemSelector: "#domainGutter-a", + domain: "day", + range: 2, + displayLegend: false +}); + +cal.init({ + itemSelector: "#domainGutter-b", + domain: "day", + range: 2, + domainGutter: 10, + displayLegend: false +}); + +cal.init({ + itemSelector: "#domainMargin-a", + domain: "day", + range: 2, + displayLegend: false +}); + +cal.init({ + itemSelector: "#domainMargin-b", + domain: "day", + range: 2, + displayLegend: false, + domainMargin: 10 +}); + +cal.init({ + itemSelector: "#domainDynamicDimension-a", + domain: "month", + range: 5, + cellSize: 8, + displayLegend: false, + nextSelector: "#domainDynamicDimension-next", + previousSelector: "#domainDynamicDimension-previous" +}); + +cal.init({ + itemSelector: "#domainDynamicDimension-b", + domain: "month", + range: 5, + cellSize: 8, + displayLegend: false, + domainDynamicDimension: false, + nextSelector: "#domainDynamicDimension-next", + previousSelector: "#domainDynamicDimension-previous", + itemNamespace: "domainDynamicDimension" +}); + +cal.init({ + itemSelector: "#verticalOrientation-a", + domain: "day", + range: 2, + displayLegend: false +}); + +cal.init({ + itemSelector: "#verticalOrientation-b", + domain: "day", + range: 2, + displayLegend: false, + verticalOrientation: true +}); + +cal.init({ + itemSelector: "#label-a", + domain: "day", + range: 2, + displayLegend: false +}); + +cal.init({ + itemSelector: "#label-b", + domain: "day", + range: 2, + displayLegend: false, + label: { + position: "top" + } +}); + +cal.init({ + itemSelector: "#label-c", + domain: "day", + range: 2, + displayLegend: false, + label: { + position: "left", + width: 46 + } +}); + +cal.init({ + itemSelector: "#label-d", + domain: "day", + range: 2, + displayLegend: false, + label: { + position: "right", + width: 46, + offset: { x: 10, y: 30 } + } +}); + +cal.init({ + itemSelector: "#label-e", + domain: "day", + range: 2, + displayLegend: false, + label: { + position: "left", + width: 46, + rotate: "left" + } +}); + +cal.init({ + itemSelector: "#label-f", + domain: "day", + range: 2, + displayLegend: false, + label: { + position: "right", + width: 150, + rotate: "left" + } +}); + +cal.init({ + itemSelector: "#label-g", + domain: "day", + range: 2, + displayLegend: false, + label: { + position: "right", + width: 46, + rotate: "left" + } +}); + +cal.init({ + itemSelector: "#label-h", + domain: "day", + range: 2, + displayLegend: false, + label: { + position: "right", + width: 46, + rotate: "right", + align: "right" + } +}); + +cal.init({ + itemSelector: "#colLimit-a", + domain: "day", + range: 1, + displayLegend: false +}); + +cal.init({ + itemSelector: "#colLimit-b", + domain: "day", + colLimit: 24, + range: 1, + displayLegend: false +}); + +cal.init({ + itemSelector: "#rowLimit-a", + domain: "month", + range: 1, + displayLegend: false +}); + +cal.init({ + itemSelector: "#rowLimit-b", + domain: "month", + rowLimit: 10, + range: 1, + displayLegend: false +}); + +cal.init({ + itemSelector: "#tooltip-a", + domain: "month", + range: 1, + displayLegend: false +}); + +cal.init({ + itemSelector: "#tooltip-b", + domain: "month", + range: 1, + displayLegend: false, + tooltip: true +}); + +cal.init({ + itemSelector: "#start-a", + domain: "day", + range: 2, + displayLegend: false +}); + +cal.init({ + itemSelector: "#start-b", + domain: "day", + range: 2, + start: new Date(2000, 0, 15), + displayLegend: false +}); + +cal.init({ + start: new Date(2000, 0), // January, 1st 2000 + range: 12, + domain: "year", + subDomain: "month", + data: "http://localhost/api?start={{d:start}}&stop={{d:end}}" +}); + +cal.init({ + data: "http://localhost/datas.csv", + dataType: "csv" +}); + +var dt = new Date(); +dt.setDate(dt.getDate() + 1); +cal.init({ + itemSelector: "#highlight-a", + domain: "day", + range: 2, + displayLegend: false, + highlight: ["now", dt] +}); + +cal.init({ + itemSelector: "#weekStartOnMonday-a", + domain: "month", + subDomain: "x_day", + cellSize: 20, + subDomainTextFormat: "%d", + range: 1, + displayLegend: false +}); + +cal.init({ + itemSelector: "#weekStartOnMonday-b", + domain: "month", + subDomain: "x_day", + cellSize: 20, + subDomainTextFormat: "%d", + range: 1, + weekStartOnMonday: false, + displayLegend: false +}); + +cal.init({ + itemSelector: "#minDate-a", + domain: "month", + start: new Date(2000, 4), + minDate: new Date(2000, 1), + maxDate: new Date(2000, 8), + subDomain: "day", + range: 4, + displayLegend: false +}); + +cal.init({ + itemSelector: "#legend-a", + domain: "day", + range: 2 +}); + +cal.init({ + itemSelector: "#legend-b", + domain: "day", + range: 2, legend: [-2.5, 0, 2.5] +}); + +cal.init({ + itemSelector: "#displayLegend-a", + domain: "day", + range: 2 +}); + +cal.init({ + itemSelector: "#displayLegend-b", + domain: "day", + range: 2, + displayLegend: false +}); + +cal.init({ + itemSelector: "#legendCellSize-a", + domain: "day", + range: 2 +}); + +cal.init({ + itemSelector: "#legendCellSize-b", + domain: "day", + range: 2, legendCellSize: 5 +}); + +cal.init({ + itemSelector: "#legendCellPadding-a", + domain: "day", + range: 3 +}); + +cal.init({ + itemSelector: "#legendCellPadding-b", + domain: "day", + range: 3, legendCellPadding: 5 +}); + +cal.init({ + itemSelector: "#legendMargin-a", + domain: "day", + range: 3 +}); + +cal.init({ + itemSelector: "#legendMargin-b", + domain: "day", + range: 3, + legendMargin: [50, 0, 0, 50] +}); + +cal.init({ + itemSelector: "#legendVerticalPosition-a", + domain: "day", + range: 2 +}); + +cal.init({ + itemSelector: "#legendVerticalPosition-b", + domain: "day", + range: 2, + legendVerticalPosition: "top", + legendMargin: [0, 0, 10, 0] +}); + +cal.init({ + itemSelector: "#legendVerticalPosition-c", + domain: "day", + range: 2, + legendVerticalPosition: "center", + legendMargin: [0, 10, 0, 0] +}); + +cal.init({ + itemSelector: "#legendVerticalPosition-d", + domain: "day", + range: 2, + legendVerticalPosition: "center", + legendHorizontalPosition: "right", + legendMargin: [0, 0, 0, 10] +}); + +cal.init({ + itemSelector: "#legendHorizontalPosition-a", + domain: "day", + range: 3 +}); + +cal.init({ + itemSelector: "#legendHorizontalPosition-b", + domain: "day", + range: 3, + legendHorizontalPosition: "right" +}); + +cal.init({ + itemSelector: "#legendOrientation-a", + domain: "day", + range: 3, + legendVerticalPosition: "center", + legendOrientation: "vertical", + legendMargin: [0, 10, 0, 0] +}); + +cal.init({ + itemSelector: "#legendOrientation-b", + domain: "month", + subDomain: "x_day", + range: 3, + verticalOrientation: true, + legendVerticalPosition: "center", + legendHorizontalPosition: "right", + legendOrientation: "vertical", + legendMargin: [0, 0, 0, 20] +}); + +cal.init({ + legendColors: { + min: "#efefef", + max: "steelblue", + empty: "white" + // Will use the CSS for the missing keys + } +}); + +cal.init({ + legendColors: ["#efefef", "steelblue"] +}); + +cal.init({ + itemName: ["cat", "cats"] +}); +cal.init({ + itemName: "cat" +}); +cal.init({ + itemName: ["cat"] +}); + +cal.init({ + subDomainDateFormat: function(date: Date): string + { + return date.toString(); + } +}); + +cal.init({ + itemSelector: "#subDomainTextFormat-a", + start: new Date(2000, 0, 1, 1), + domain: "month", + subDomain: "x_day", + cellSize: 20, + range: 1, + displayLegend: false, + subDomainTextFormat: "%d" +}); + +cal.init({ + itemSelector: "#subDomainTextFormat-b", + start: new Date(2000, 0, 1, 1), + data: "datas-years.json", + domain: "month", + subDomain: "x_day", + cellSize: 20, + range: 1, + displayLegend: false, + subDomainTextFormat: function(date: Date, value: number): number + { + return value; + } +}); + +cal.init({ + itemSelector: "#domainLabelFormat-a", + domain: "month", + subDomain: "day", + range: 1, + displayLegend: false +}); + +cal.init({ + itemSelector: "#domainLabelFormat-b", + domain: "month", + subDomain: "day", + range: 1, + displayLegend: false, + domainLabelFormat: "%m-%Y" +}); + +cal.init({ + itemSelector: "#legendTitleFormat-a", + domain: "day", + range: 3 +}); + +cal.init({ + itemSelector: "#animationDuration-a", + domain: "day", + range: 4, + previousSelector: "#animationDuration-previous", + nextSelector: "#animationDuration-next", + itemNamespace: "animationDuration-a" +}); + +cal.init({ + itemSelector: "#animationDuration-b", + domain: "day", + range: 4, animationDuration: 1500, + previousSelector: "#animationDuration-previous", + nextSelector: "#animationDuration-next", + itemNamespace: "animationDuration-b" +}); + +cal.init({ + itemSelector: "#previousSelector-a", + domain: "day", + range: 4, + previousSelector: "#previousSelector-a-previous", + nextSelector: "#previousSelector-a-next" +}); + +cal.init({ + itemSelector: "#previousSelector-b", + domain: "day", + range: 4, + previousSelector: "#example-previousSelector ul + p > em", + nextSelector: "#example-previousSelector [title=next] li" +}); + +cal.init({ + nextSelector: "#next" // Attach #next onClick event to cal.next() +}); + +cal.init({ + nextSelector: "#next", + // Attach #next.cal onClick event to cal.next() + itemNamespace: "cal" +}); + + +cal.previous(); +cal.previous(5); + +cal.next(); +cal.next(5); + +cal.jumpTo(new Date(2000, 4)); +cal.jumpTo(new Date(2000, 4), true); + +cal.rewind(); + +var randomData = {}; +cal.update(randomData); +cal.update(randomData, () => { }, cal.RESET_ALL_ON_UPDATE); +cal.update(randomData, false, cal.APPEND_ON_UPDATE); +cal.update(randomData, false, cal.RESET_SINGLE_ON_UPDATE); + +cal.highlight(new Date(2000, 0, 2)); + +// Add January 5th to already highlighted dates +cal.options.highlight.push(new Date(2000, 0, 5)); +cal.highlight(cal.options.highlight); + +var svg: string = cal.getSVG(); + + +cal.options.legendVerticalPosition = "center"; +cal.options.legendHorizontalPosition = "right"; +cal.options.legendOrientation = "vertical"; + + +cal.setLegend(); + +cal.removeLegend(); + +cal.showLegend(); + +cal = cal.destroy(); + + +cal.init({ + itemSelector: "#onClick-a", + domain: "day", + range: 5, data: "datas-years.json", + start: new Date(2000, 0), + onClick: function(date: Date, nb: number) + { + $("#onClick-placeholder").html("You just clicked
on " + + date + "
with " + + (nb === null ? "unknown" : nb) + " items" + ); + } +}); + +cal.init({ + itemSelector: "#afterLoad-a", + domain: "day", + range: 5, + afterLoad: function() { }, + onComplete: function() { } +}); + +cal.init({ + itemSelector: "#afterLoadPreviousDomain-a", + domain: "day", + range: 5, afterLoadPreviousDomain: function(date: Date) { }, + previousSelector: "#afterLoadPreviousDomain-selector" +}); + +cal.init({ + itemSelector: "#afterLoadNextDomain-a", + domain: "day", + range: 5, afterLoadNextDomain: function(date: Date) { }, + nextSelector: "#afterLoadNextDomain-selector" +}); + +cal.init({ + itemSelector: "#onComplete-a", + domain: "day", + range: 5, + onComplete: function() { } +}); + +var datas = [ + { date: 946702811, value: 15 }, + { date: 946702812, value: 25 }, + { date: 946702813, value: 10 } +] + +cal.init({ + data: datas, + afterLoadData: (data: any) => + { + var stats: CalHeatMap.DataFormat = {}; + for (var d in data) + { + stats[data[d].date] = data[d].value; + } + return stats; + } +}); + +cal.init({ + itemSelector: "#onMinDomainReached-a", + domain: "month", + range: 5, + start: new Date(2000, 4), + minDate: new Date(2000, 3), + maxDate: new Date(2000, 11), + onMinDomainReached: function(hit: boolean) { }, + onMaxDomainReached: function(hit: boolean) { }, + nextSelector: "#onMinDomainReached-next", + previousSelector: "#onMinDomainReached-previous", + displayLegend: false +}); diff --git a/cal-heatmap/cal-heatmap.d.ts b/cal-heatmap/cal-heatmap.d.ts new file mode 100644 index 000000000..b54e3a5bf --- /dev/null +++ b/cal-heatmap/cal-heatmap.d.ts @@ -0,0 +1,514 @@ +// Type definitions for cal-heatmap v3.5.4 +// Project: https://github.com/wa0x6e/cal-heatmap +// Definitions by: Chris Baker +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module CalHeatMap +{ + interface CalHeatMapStatic + { + new (): CalHeatMap; + } + + interface CalHeatMap + { + /** + * Initialise the CalHeatMap with the specified options + * @param {InitOptions} options The CalHeatMap options + */ + init(options?: InitOptions): void; + + options: RuntimeOptions; + + // Various update mode when using the update() API + /** Reset the whole calendar data before inserting the new data. */ + RESET_ALL_ON_UPDATE: number; + /** + * Update only the dates (subDomain) you pass in the data argument, replace their value by the new ones. + * All other dates are leaved untouched. + */ + RESET_SINGLE_ON_UPDATE: number; + /** + * Instead of replacing a date's value by a new one, increment it by the new value. All other dates are leaved untouched. + * That's the one you want to use of you're populating the calendar in realtime! + */ + APPEND_ON_UPDATE: number; + + /** + * Shift the calendar n domains back + * @param {number} n The number of domains to shift back. The default is 1. + */ + previous(n?: number): void; + /** + * Shift the calendar n domains forward + * @param {number} n The number of domains to shift forward. The default is 1. + */ + next(n?: number): void; + /** + * Jump the calendar to the specified date + * This method will shift the calendar backward or forward, until the domain containing the specified date is visible. + * @param {Date} date The date to jump to. + * @param {boolean} reset Whether to set the domain with the specified as the calendar's first domain. + */ + jumpTo(date: Date, reset?: boolean): void; + /** Reset the calendar back to the start date */ + rewind(): void; + /** + * Update the calendar with new data + * Use update() when you want to refresh the calendar with a new set of data. + * Particularly useful if you're filling the calendar in realtime, or if you want to display a subset of the current data. + * @param {string|Object} data Accept the same format as the data option. + * @param {} afterLoad Whether to execute the afterLoad() callback to convert your data into the json object, expected by cal-heatmap. + * It can also directly takes a function, in case your data can not be converted with the afterLoad() function you defined. + * @param {} updateMode Define how to insert the new data into the calendar. + * Accepted values are: + * Instance.RESET_ALL_ON_UPDATE (default) Reset the whole calendar data before inserting the new data. + * Instance.RESET_SINGLE_ON_UPDATE Update only the dates (subDomain) you pass in the data argument, + * replace their value by the new ones. All other dates are leaved untouched. + * Instance.APPEND_ON_UPDATE Instead of replacing a date's value by a new one, increment it by the new value. + * All other dates are leaved untouched. That's the one you want to use of you're + * populating the calendar in realtime! + */ + update(data: string | Object, afterLoad?: boolean | Function, updateMode?: number): void; + /** + * Change the highlighted dates. + * Takes an array of Date object. Can also accepts the now string, equivalent to Date.now(). + * @param {string|Date|Date[]} dates The date or dates to highlight. + */ + highlight(dates: string | Date | Date[]): void; + /** + * Return the SVG source code with the appropriate CSS + * The returned string code is valid and ready to be placed in a .svg file. + * @returns SVG source code with the appropriate CSS. + */ + getSVG(): string; + /** + * Change the legend settings and/or threshold + * When called without arguments, setLegend() will just redraw the legend. + * @param {} legend Same as legend : an array of thresholds + * @param {} legendColor Same as legendColors : an object with the heatmap's colors, or an array of 2 colors + */ + setLegend(legend?: number[], legendColors?: LegendColor | string[]): void; + /** + * Remove the legend from the calendar + * Settings are kept and you can re-add the legend with the same settings using showLegend(). + */ + removeLegend(): void; + /** Display the legend, if not already shown. */ + showLegend(): void; + /** + * Remove the calendar from the DOM + * Remember to self-assign the result of destroy() to your calendar instance, or it'll lead to a memory leak. + * @param {Function} callback function that will be executed when the calendar is removed from the DOM, at the end of the animation. + * @returns always returns null. + */ + destroy(callback?: Function): CalHeatMap; + } + + interface LegendColor + { + /** Color of the smallest value on the legend */ + min: string; + /** Color of the highest value on the legend */ + max: string; + /** Color for the dates with value == 0 */ + empty?: string; + /** Base color of the date cells */ + base?: string; + /** Color for the special value */ + overflow?: string; + } + + interface InitOptions + { + // ================================================ + // Presentation + // ================================================ + + /** DOM node to insert the calendar in. Default: "#cal-heatmap" */ + itemSelector?: string | HTMLElement | Element | EventTarget; + + /** + * Type of domain. Default: "hour" + * Valid domains: {"hour", "day", "week", "month", "year"} + */ + domain?: string; + + /** + * Type of subDomain. Default: "min" + * Valid subDomains: {"min", "x_min", "hour", "x_hour", "day", "x_day", "week", "x_week", "month", "x_month"} + */ + subDomain?: string; + + /** Number of domain to display. Default: 12 */ + range?: number; + + /** Size of each subDomain cell, in pixels. Default: 10 */ + cellSize?: number; + + /** Space between each subDomain cell, in pixel. Default: 2 */ + cellPadding?: number; + + /** subDomain cell's border radius, for rounder corner, in pixel. Default: 0 */ + cellRadius?: number; + + /** Space between each domain, in pixel. Default: 2 */ + domainGutter?: number; + + /** + * Margin around each domain, in pixel. Default: [0,0,0,0] + * Ordered like in CSS (top, right, bottom, left), it also accepts CSS like values + */ + domainMargin?: number | number[]; + + /** + * Whether to enable domain dynamic width and height. Default: true + * Some domain>subdomain couple, like month>days, doesn't always have the same number of + * subDomain cells. Some months have 6 weeks, some only 4. + * With dynamic dimension enabled, the domain width and height will be adjusted to fit the + * domain content, whereas when it's disabled, all domains will have the same dimension : the biggest. + */ + domainDynamicDimension?: boolean; + + /** To display the calendar vertically, with each domain one under the other. Default: false */ + verticalOrientation?: boolean; + + /** Position and alignment of the domain label. */ + label?: Label; + + /** + * Control the number of columns to split the domain dates into. Default: null + * Each domain is split into an arbitrary number of columns (or rows depending on the + * reading direction). You can overwrite that number with colLimit, and force all dates on the + * same line, or split them into more columns. + * That setting limit the maximum number of columns, and doesn't necessary means that each rows will + * contains that number of columns. + */ + colLimit?: number; + + /** Control the number of rows to split the domain dates into. Default: null + * If rowLimit and colLimit are both used, rowLimit will be ignored. */ + rowLimit?: number; + + /** Whether to display a tooltip when hovering over a date. Default: false */ + tooltip?: boolean; + + // ================================================ + // Data + // ================================================ + + /** + * Starting date of the calendar. Default: new Date() + * It doesn't have to be precise, the calendar will not start at that date, but at the first domain containing that date. + */ + start?: Date; + /** + * Data used to fill the calendar. Default: "" + * String is interpreted as a URL to an API, which should be returning the data used to fill the calendar. + */ + + data?: string | Object; + + /** + * Engine used to parse the data. Default: json + * Valid values: + * "json" - Interpret the data as json. + * "csv" - Interpret the data as csv. + * "tsv" - Interpret the data exactly like csv, but are delimited with a tab character, instead of comma. + * "txt" - Just return the data as a string. + */ + dataType?: string; + + /** + * Highlight selected subDomain cells. Default: false + * Takes an array of Date object. Can also accepts the now string, equivalent to Date.now(). + */ + highlight?: string | string[] | Date[] | any[]; + + /** Whether to start the week on Monday, instead of Sunday. Default: true */ + weekStartOnMonday?: boolean; + + /** + * Lower limit of the domain navigation, preventing navigating beyond a certain date. Default: null + * When set, calling previous() will only work only until the leftmost domain containing minDate. + * Like with start, minDate does not have to be precise, and just have to be a date inside the domain. + * previous() will always return true, unless the domain containing minDate is reached, in which case, it'll return false. + */ + minDate?: Date; + + /** Upper limit of the domain navigation, preventing navigating beyond a certain date. Default: null */ + maxDate?: Date; + + /** + * Whether to consider missing date:value couple in the data source as equal to 0. Default: false + * By default, when the a date is not associated to a value, it's considered as null, and rendered as a no value cell. + * You should ask yourself, if the API is not returning result for a date, is it because there is really no value + * associated to this date, or because it's supposed to be equal to 0, and it's skipped in order to save bandwidth ? + */ + considerMissingDataAsZero?: boolean; + + // ================================================ + // Legend + // ================================================ + + /** Assign each range of values to a color. Default: [10, 20, 30, 40] */ + legend?: number[]; + + /** Whether to display the legend. Default: true */ + displayLegend?: boolean; + + /** Size of the legend cells, in pixels. Default: 10 */ + legendCellSize?: number; + + /** Padding between each legend cell, in pixels. Default: 2 */ + legendCellPadding?: number; + + /** Margin around the legend, in pixels. Default: [10, 0, 0, 0] */ + legendMargin?: number | number[]; + + /** + * Vertical position of the legend. Default: "bottom" + * Valid values: + * "top" - Place the legend above the calendar + * "center" - Place the legend on the calendar's side + * Use with legendHorizontalPosition, to position the legend on the left (default) or on the right. + * "bottom" - Place the legend on below the calendar + */ + legendVerticalPosition?: string; + + /** + * Horizontal position of the legend. Default: "left" + * Valid values: + * "left" - Align the legend to the left + * "center" - Center the legend + * "right" - Align the legend to the right + */ + legendHorizontalPosition?: string; + + /** + * Orientation of the legend. Default: "horizontal" + * legendOrientation is best used together with legendHorizontalPosition when the legend is positioned on the side. + * Valid values: + * "horizontal" - Legend is displayed horizontally, from left to right + * "vertical" - Legend is displayed vertically, from top to bottom + */ + legendOrientation?: string; + + /** + * Set of colors to automagically compute the heatmap colors. + * Instead of relying on the CSS for your heatmap's colors, you can also set the heatmap's colors directly with + * cal-heatmap on initialization, or even dynamically change them after. + * All legend settings can be changed dynamically after calendar initialisation, with setLegend(). + */ + legendColors?: LegendColor | string[]; + + // ================================================ + // i18n + // ================================================ + + /** + * Name of the entity you're representing on the calendar. + * Takes an array of string, with the first index as the singular form, and the second index the plural form. + * For the lazy, you can also pass a simple string, ar a single element array, and it'll automatically guess + * the plural form, as long as it's the singular form plus the "s" suffix. + */ + itemName?: string | string[]; + /** + * Format of the title displayed when hovering a subDomain. + * Some template strings are available, and enclosed in braces. + * {name} Name of the entity represented in the calendar (see itemName) + * {count} The value associated to the date. + * {date} The date of the cell. It's automatically formatted according to the type of subDomain. + * See subDomainDateFormat to further customize that date formatting. + * {connector} An English preposition placed before a datetime (on Monday, at 15:00, etc.). Each subDomain + * have their own default connector, corresponding to the default date format. + */ + subDomainTitleFormat?: SubDomainFormatTemplates; + /** + * Format of the {date} template string inside subDomainTitleFormat. + * {date} is by default formatted according to the subDomain type. + * subDomainFormat can accept any string with directive accepted by d3.time.format(), like "%Y-%m-%d". + * As d3.time.format() will only output English dates, subDomainDateFormat can also accept a function, + * with the subDomain date as the argument. + */ + subDomainDateFormat?: string | Function; + /** + * Format of the text inside a subDomain cell. + * Disabled by default, you can display a text inside each subDomain cell. + * Works exactly like subDomainDateFormat, except that the function takes the cell value as second argument. + */ + subDomainTextFormat?: string | Function; + /** + * Format of the domain label. + * Works exactly like subDomainDateFormat, and will format the domain label with any string accepted by d3.time.format(), or a function. + * To not display the domain label, set domainLabelFormat to "" (empty string). + */ + domainLabelFormat?: string | Function; + /** + * Formatting of the legend title, displayed when hovering a legend cell. + * Some template strings are available, and enclosed in braces. + * {name} Name of the entity represented in the calendar (see itemName) + * {min} The first value of the legend array. + * {max} The last value of the legend array. + * {down} The lower bound of a color + * {up} The upper bound of a color + */ + legendTitleFormat?: LegendTitleTemplates; + + // ================================================ + // Other + // ================================================ + + /** Animation duration, in milliseconds. Default value: 500 */ + animationDuration?: number; + /** + * Will attach the previous() event to the specified element, on a mouse click, shifting the calendar one domain back. Default value: false + * If you want to shift by more than one domain, see the previous() method. + */ + previousSelector?: string | HTMLElement; + /** + * Will attach the next() event to the specified element, on a mouse click, shifting the calendar one domain forward. Default value: false + * If you want to shift by more than one domain, see the next() method. + */ + nextSelector?: string | HTMLElement; + /** + * The calendar instance namespace. + * If you have more than one instance of Cal-Heatmap, you should assign each instance its own namespace, in order to isolate each instance event handler. + */ + itemNamespace?: string; + + // ================================================ + // Events + // ================================================ + + /** Called after a mouse click event on a subDomain cell. */ + onClick?: (date: Date, value: number) => void; + /** Called after drawing the empty calendar, and before filling it with data. */ + afterLoad?: () => void; + /** + * Called after shifting the calendar one domain back. + * The date argument is the start date of the domain that was added. + */ + afterLoadPreviousDomain?: (date: Date) => void; + /** + * Called after shifting the calendar one domain forward. + * The date argument is the start date of the domain that was added. + */ + afterLoadNextDomain?: (date: Date) => void; + /** + * Called after drawing and filling the calendar. + * Useful in case you're loading data via ajax, as it's loading data asynchronously. This event will wait for the ajax + * request to complete before triggering. + * This event will only trigger once, on the initial setup. See afterLoadPreviousDomain and afterLoadNextDomain for + * callback events after a domain navigation. + */ + onComplete?: () => void; + /** + * Called after getting the data from source, but before filling the calendar. + * This callback must return a json object formatted in the expected data format. + * afterLoadData() is used to do some works on the data, especially when the data source is not returning data in the expected format. + */ + afterLoadData?: (data: any) => DataFormat; + /** + * Triggered after previous(), when the incoming domain is containing minDate. + * When the leftmost domain set by minDate is loaded into the calendar, onMinDomainReached() will be triggered with true as argument. + * This event is useful if you want to disable your previous button, since there is no more previous domains to load. + * In order to reverse the action, onMinDomainReached() will be called with false as argument afer next(), only once, and only if the + * leftmost domain is not the lower limit domain anymore. + */ + onMinDomainReached?: (reached: boolean) => void; + /** + * Triggered after next(), when the incoming domain is containing maxDate. + * See onMinDomainReached(). + */ + onMaxDomainReached?: (reached: boolean) => void; + } + + interface RuntimeOptions extends InitOptions + { + /** Margin around each domain, in pixels. Ordered like in CSS (top, right, bottom, left) */ + domainMargin: number[]; + /** Margin around the legend, in pixels. Ordered like in CSS (top, right, bottom, left) */ + legendMargin: number[]; + /** List of dates to highlight */ + highlight: Date[]; + /** + * Name of the items to represent in the calendar. + * First index is singular form, and the second index, the plural form. + */ + itemName: string[]; + } + + interface LegendTitleTemplates + { + /** Formatting of the smallest (leftmost) value of the legend. Default value: "less than {min} {name}" */ + lower?: string; + /** Formatting of all the value but the first and the last. Default value: "between {down} and {up} {name}" */ + inner?: string; + /** Formatting of the biggest (rightmost) value of the legend. Default value: "more than {max} {name}" */ + upper?: string; + } + + interface SubDomainFormatTemplates + { + /** Format of the title when there is no value associated to the date. Default value: "{date}" */ + empty?: string; + /** Format of the title when it's associated to a value. Default value: "{count} {name} {connector} {date}" */ + filled?: string; + } + + interface DataFormat + { + /** timestamp are in seconds, value can be any number (integer or float) */ + [timestamp: string]: number; + } + + interface LabelOffset + { + x: number; + y: number; + } + + /** Position and alignment of the domain label. */ + interface Label + { + /** + * Position of the label, relative to the domain. Default: "bottom" + * Valid values: {"top", "right", "bottom", "left"} + */ + position?: string; + + /** + * Horizontal align of the domain. Default: "center" + * Valid values: {"left", "center", "right"} + */ + align?: string; + /** + * Rotation for a vertical label. Default: null + * Valid values: {null, "left", "right"} + */ + rotate?: string; + /** + * Only used when label is rotated, defines the width of the label. Default: 100 + * Valid values: any intger + */ + width?: number; + /** + * More control about label positioning, if the default value does not fit your need, + * especially when label is rotated, or when using a big font-size. Default: {x:0, y:0} + */ + offset?: LabelOffset; + /** + * Height of the domain label in pixels. + * By leaving it to null, the label will be set to 2 times the height of the subDomain cell. + * If you want to remove the label, set domainLabelFormat to "" (empty string), instead + * of setting the label height to 0. Default: null + * Valid values: any integer + */ + height?: number; + } +} + +declare var CalHeatMap: CalHeatMap.CalHeatMapStatic; diff --git a/chai-as-promised/chai-as-promised.d.ts b/chai-as-promised/chai-as-promised.d.ts index 51255b490..d7f1472c7 100644 --- a/chai-as-promised/chai-as-promised.d.ts +++ b/chai-as-promised/chai-as-promised.d.ts @@ -8,6 +8,7 @@ declare module 'chai-as-promised' { function chaiAsPromised(chai: any, utils: any): void; + namespace chaiAsPromised {} export = chaiAsPromised; } diff --git a/change-case/change-case-tests.ts b/change-case/change-case-tests.ts index 24276654c..2e80c8a0d 100644 --- a/change-case/change-case-tests.ts +++ b/change-case/change-case-tests.ts @@ -35,3 +35,5 @@ b = changeCase.isLower(s); b = changeCase.isLowerCase(s); s = changeCase.ucFirst(s); s = changeCase.upperCaseFirst(s); +s = changeCase.lcFirst(s); +s = changeCase.lowerCaseFirst(s); diff --git a/change-case/change-case.d.ts b/change-case/change-case.d.ts index e61d70de6..5551b4d3d 100644 --- a/change-case/change-case.d.ts +++ b/change-case/change-case.d.ts @@ -34,4 +34,6 @@ declare module "change-case" { function isLowerCase(s: string): boolean; function ucFirst(s: string): string; function upperCaseFirst(s: string): string; + function lcFirst(s: string): string; + function lowerCaseFirst(s: string): string; } diff --git a/chartjs/chart-tests.ts b/chartjs/chart-tests.ts index 4bd8820c6..452ddbf62 100644 --- a/chartjs/chart-tests.ts +++ b/chartjs/chart-tests.ts @@ -325,7 +325,7 @@ var myDoughnutChart = new Chart(ctx).Doughnut(pieData, { animateRotate: true, animateScale: false, legendTemplate: "
    -legend\"><% for (var i=0; i
  • \"><%if(segments[i].label){%><%=segments[i].label%><%}%>
  • <%}%>
" -}); +}); var myDoughnutChartLegend: string = myDoughnutChart.generateLegend(); var myDoughnutChartImage: string = myDoughnutChart.toBase64Image(); @@ -341,3 +341,32 @@ myDoughnutChart.resize(); myDoughnutChart.update(); myDoughnutChart.stop(); myDoughnutChart.destroy(); + +// Test using charts with overrides of a subset of global options +var partialOpts: ChartSettings = { + showTooltips: true, + tooltipEvents: ["mousemove", "touchstart", "touchmove"], + tooltipFillColor: "rgba(0,0,0,0.8)", + tooltipFontFamily: "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif", + tooltipFontSize: 14, + tooltipFontStyle: "normal", + tooltipFontColor: "#fff", + tooltipTitleFontFamily: "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif", + tooltipTitleFontSize: 14, + tooltipTitleFontStyle: "bold", + tooltipTitleFontColor: "#fff", + tooltipYPadding: 6, + tooltipXPadding: 6, + tooltipCaretSize: 8, + tooltipCornerRadius: 6, + tooltipXOffset: 10, + tooltipTemplate: "<%if (label){%><%=label%>: <%}%><%= value %>" +}; + +var my2ndLineChart = new Chart(ctx).Line(lineData, partialOpts); +var my2ndBarChart = new Chart(ctx).Bar(barData, partialOpts); +var my2ndRadarChart = new Chart(ctx).Radar(radarData, partialOpts); +var my2ndPolarAreaChart = new Chart(ctx).PolarArea(polarAreaData, partialOpts); +var my2ndPieChart = new Chart(ctx).Pie(pieData, partialOpts); +var my2ndDoughnutChart = new Chart(ctx).Doughnut(pieData, partialOpts); + diff --git a/chartjs/chart.d.ts b/chartjs/chart.d.ts index d337d144a..62f393b8a 100644 --- a/chartjs/chart.d.ts +++ b/chartjs/chart.d.ts @@ -33,49 +33,49 @@ interface CircularChartData { } interface ChartSettings { - animation: boolean; - animationSteps: number; - animationEasing: string; - showScale: boolean; - scaleOverride: boolean; - scaleSteps: number; - scaleStepWidth: number; - scaleStartValue: number; - scaleLineColor: string; - scaleLineWidth: number; - scaleShowLabels: boolean; - scaleLabel: string; - scaleIntegersOnly: boolean; - scaleBeginAtZero: boolean; - scaleFontFamily: string; - scaleFontSize: number; - scaleFontStyle: string; - scaleFontColor: string; - responsive: boolean; - maintainAspectRatio: boolean; - showTooltips: boolean; - tooltipEvents: string[]; - tooltipFillColor: string; - tooltipFontFamily: string; - tooltipFontSize: number; - tooltipFontStyle: string; - tooltipFontColor: string; - tooltipTitleFontFamily: string; - tooltipTitleFontSize: number; - tooltipTitleFontStyle: string; - tooltipTitleFontColor: string; - tooltipYPadding: number; - tooltipXPadding: number; - tooltipCaretSize: number; - tooltipCornerRadius: number; - tooltipXOffset: number; - tooltipTemplate: string; - multiTooltipTemplate: string; - onAnimationProgress: () => any; - onAnimationComplete: () => any; + animation?: boolean; + animationSteps?: number; + animationEasing?: string; + showScale?: boolean; + scaleOverride?: boolean; + scaleSteps?: number; + scaleStepWidth?: number; + scaleStartValue?: number; + scaleLineColor?: string; + scaleLineWidth?: number; + scaleShowLabels?: boolean; + scaleLabel?: string; + scaleIntegersOnly?: boolean; + scaleBeginAtZero?: boolean; + scaleFontFamily?: string; + scaleFontSize?: number; + scaleFontStyle?: string; + scaleFontColor?: string; + responsive?: boolean; + maintainAspectRatio?: boolean; + showTooltips?: boolean; + tooltipEvents?: string[]; + tooltipFillColor?: string; + tooltipFontFamily?: string; + tooltipFontSize?: number; + tooltipFontStyle?: string; + tooltipFontColor?: string; + tooltipTitleFontFamily?: string; + tooltipTitleFontSize?: number; + tooltipTitleFontStyle?: string; + tooltipTitleFontColor?: string; + tooltipYPadding?: number; + tooltipXPadding?: number; + tooltipCaretSize?: number; + tooltipCornerRadius?: number; + tooltipXOffset?: number; + tooltipTemplate?: string; + multiTooltipTemplate?: string; + onAnimationProgress?: () => any; + onAnimationComplete?: () => any; } -interface ChartOptions { +interface ChartOptions extends ChartSettings { scaleShowGridLines?: boolean; scaleGridLineColor?: string; scaleGridLineWidth?: number; @@ -138,7 +138,7 @@ interface BarChartOptions extends ChartOptions { barDatasetSpacing?: number; } -interface RadarChartOptions { +interface RadarChartOptions extends ChartSettings { scaleShowLine?: boolean; angleShowLineOut?: boolean; scaleShowLabels?: boolean; @@ -159,7 +159,7 @@ interface RadarChartOptions { legendTemplate?: string; } -interface PolarAreaChartOptions { +interface PolarAreaChartOptions extends ChartSettings { scaleShowLabelBackdrop?: boolean; scaleBackdropColor?: string; scaleBeginAtZero?: boolean; @@ -176,7 +176,7 @@ interface PolarAreaChartOptions { legendTemplate?: string; } -interface PieChartOptions { +interface PieChartOptions extends ChartSettings { segmentShowStroke?: boolean; segmentStrokeColor?: string; segmentStrokeWidth?: number; diff --git a/chrome/chrome.d.ts b/chrome/chrome.d.ts index 8829ab044..b27891704 100755 --- a/chrome/chrome.d.ts +++ b/chrome/chrome.d.ts @@ -5689,7 +5689,7 @@ declare module chrome.runtime { * URL to be opened after the extension is uninstalled. This URL must have an http: or https: scheme. Set an empty string to not open a new tab upon uninstallation. * @param callback Called when the uninstall URL is set. If the given URL is invalid, runtime.lastError will be set. */ - export function setUninstallUrl(url: string, callback?: () => void): void; + export function setUninstallURL(url: string, callback?: () => void): void; /** * Open your Extension's options page, if possible. * The precise behavior may depend on your manifest's options_ui or options_page key, or what Chrome happens to support at the time. For example, the page may be opened in a new tab, within chrome://extensions, within an App, or it may just focus an open options page. It will never cause the caller page to reload. diff --git a/ckeditor/ckeditor.d.ts b/ckeditor/ckeditor.d.ts index cab51f72c..b3c2f4524 100644 --- a/ckeditor/ckeditor.d.ts +++ b/ckeditor/ckeditor.d.ts @@ -74,6 +74,7 @@ declare module CKEDITOR { function appendTo(element: string, config?: config, data?: string): editor; function appendTo(element: HTMLTextAreaElement, config?: config, data?: string): editor; function domReady(): void; + function dialogCommand(dialogName: string): void; function editorConfig(config: config): void; function getCss(): string; function getTemplate(name: string): template; @@ -556,29 +557,34 @@ declare module CKEDITOR { groups?: string[]; } + // Currently very incomplete. See here for all options that should be included: + // http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-fileTools_defaultFileName interface config { + allowedContent?: string | boolean; + colorButton_enableMore?: boolean; + colorButton_colors?: string; contentsCss?: string | string[]; + contentsLangDirection?: string; + customConfig?: string; + extraPlugins?: string; + font_names?: string; + font_defaultLabel?: string; + fontSize_sizes?: string; + fontSize_defaultLabel?: string; + height?: string | number; + language?: string; + on?: any; + plugins?: string; + startupFocus?: boolean; startupMode?: string; removeButtons?: string; removePlugins?: string; toolbar?: any; toolbarGroups?: toolbarGroups[]; - skin?: string; - language?: string; - plugins?: string; - font_names?: string; - font_defaultLabel?: string; - fontSize_sizes?: string; - fontSize_defaultLabel?: string; - colorButton_enableMore?: boolean; - colorButton_colors?: string; - startupFocus?: boolean; - on?: any; - extraPlugins?: string; - height?: string | number; toolbarLocation?: string; readOnly?: boolean; - customConfig?: string; + skin?: string; + width?: string | number; } @@ -745,6 +751,7 @@ declare module CKEDITOR { beforeInit?(editor: editor): any; init?(editor: editor): any; onLoad?(): any; + icons?: string; } function add(name: string, definition?: IPluginDefinition): void; @@ -933,6 +940,8 @@ declare module CKEDITOR { interface button extends uiElement { disabled?: boolean; label?: string; + command?: string; + toolbar?: string; } @@ -1130,4 +1139,12 @@ declare module CKEDITOR { function isTabEnabled(editor: editor, dialogName: string, tabName: string): boolean; function okButton(): void; } -} + + module lang { + var languages: any; + var rtl: any; + + function load(languageCode: string, defaultLanguage: string, callback: Function): void; + function detect(defaultLanguage: string, probeLanguage: string): string; + } +} \ No newline at end of file diff --git a/complex/complex-tests.ts b/complex/complex-tests.ts new file mode 100644 index 000000000..46a5f5c69 --- /dev/null +++ b/complex/complex-tests.ts @@ -0,0 +1,44 @@ +/// + +import Complex from 'complex'; + +var z: Complex = new Complex(2, 3); +var z: Complex = Complex.from(2, 3); +var z: Complex = Complex.from(2, 4); +var z: Complex = Complex.from(5); +var z: Complex = Complex.from('2+5i'); +var z: Complex = Complex.fromPolar(3, Math.PI); +var z: Complex = Complex.i; +var z: Complex = Complex.one; +var z: Complex = z.fromRect(2, 3); +var z: Complex = z.fromPolar(3, Math.PI); +var z: Complex = z.toPrecision(3); +var z: Complex = z.toFixed(3); +var z: Complex = z.finalize(); +var x: number = z.magnitude(); +var x: number = z.abs(); +var x: number = z.angle(); +var x: number = z.arg(); +var x: number = z.phase(); +var z: Complex = z.conjugate(); +var z: Complex = z.negate(); +var z: Complex = z.multiply(z); +var z: Complex = z.mult(3); +var z: Complex = z.divide(z); +var z: Complex = z.div(3); +var z: Complex = z.add(z); +var z: Complex = z.subtract(z); +var z: Complex = z.sub(3); +var z: Complex = z.pow(z); +var z: Complex = z.sqrt(); +var z: Complex = z.log(2); +var z: Complex = z.exp(); +var z: Complex = z.sin(); +var z: Complex = z.cos(); +var z: Complex = z.tan(); +var z: Complex = z.sinh(); +var z: Complex = z.cosh(); +var z: Complex = z.tanh(); +var z: Complex = z.clone(); +var s: string = z.toString(); +var b: boolean = z.equals(z); diff --git a/complex/complex.d.ts b/complex/complex.d.ts new file mode 100644 index 000000000..b1ca7c4ac --- /dev/null +++ b/complex/complex.d.ts @@ -0,0 +1,238 @@ +// Type definitions for Complex 3.0.1 +// Project: https://github.com/arian/Complex +// Definitions by: Aya Morisawa +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare module 'complex' { + export default class Complex { + /** + * @param real The real part of the number + * @param im The imaginary part of the number + */ + constructor(real: number, im: number); + + /** + * A in line function like Number.from. + * + * Examples: + * var z = Complex.from(2, 4); + * var z = Complex.from(5); + * var z = Complex.from('2+5i'); + * + * @param real A string representation of the number, for example 1+4i + */ + static from(real: string): Complex; + + /** + * A in line function like Number.from. + * @param real The real part of the number + * @param im The imaginary part of the number + */ + static from(real: number, im?: number): Complex; + + /** + * Creates a complex instance from a polar representation + * @param r The radius/magnitude of the number + * @param phi The angle/phase of the number + */ + static fromPolar(r: number, phi: number): Complex; + + /** + * A instance of the imaginary unit + */ + static i: Complex; + + /** + * A instance for the real number + */ + static one: Complex; + + /** + * Set the real and imaginary properties a and b from a + bi. + * @param real The real part of the number + * @param im The imaginary part of the number + */ + fromRect(real: number, im: number): Complex; + + /** + * Set the a and b in a + bi from a polar representation. + * @param r The radius/magnitude of the number + * @param phi The angle/phase of the number + */ + fromPolar(r: number, phi: number): Complex; + + /** + * Set the precision of the numbers. Similar to Number.prototype.toPrecision. Useful before printing the number with the toString method. + * @param k An integer specifying the number of significant digits + */ + toPrecision(k: number): Complex; + + /** + * Format a number using fixed-point notation. Similar to Number.prototype.toFixed. Useful before printing the number with the toString method. + * @param k The number of digits to appear after the decimal point; this may be a value between 0 and 20, inclusive, and implementations may optionally support a larger range of values. If this argument is omitted, it is treated as 0. + */ + toFixed(k: number): Complex; + + /** + * Finalize the instance. The number will not change and any other method call will return a new instance. Very useful when a complex instance should stay constant. For example the Complex.i variable is a finalized instance. + */ + finalize(): Complex; + + /** + * Calculate the magnitude of the complex number + */ + magnitude(): number; + + /** + * Alias for magnitude(). Calculate the magnitude of the complex number. + */ + abs(): number; + + /** + * Calculate the angle with respect to the real axis, in radians. + */ + angle(): number; + + /** + * Alias for angle(). Calculate the angle with respect to the real axis, in radians. + */ + arg(): number; + + /** + * Alias for angle(). Calculate the angle with respect to the real axis, in radians. + */ + phase(): number; + + /** + * Calculate the conjugate of the complex number (multiplies the imaginary part with -1) + */ + conjugate(): Complex; + + /** + * Negate the number (multiplies both the real and imaginary part with -1) + */ + negate(): Complex; + + /** + * Multiply the number with a real or complex number + * @param z The number to multiply with + */ + multiply(z: number | Complex): Complex; + + /** + * Alias for multiply(). Multiply the number with a real or complex number + * @param z The number to multiply with + */ + mult(z: number | Complex): Complex; + + /** + * Divide the number by a real or complex number + * @param z The number to divide by + */ + divide(z: number | Complex): Complex; + + /** + * Alias for divide(). Divide the number by a real or complex number + * @param z The number to divide by + */ + div(z: number | Complex): Complex; + + /** + * Add a real or complex number + * @param z The number to add + */ + add(z: number | Complex): Complex; + + /** + * Subtract a real or complex number + * @param z The number to subtract + */ + subtract(z: number | Complex): Complex; + + /** + * Alias for subtract(). Subtract a real or complex number + * @param z The number to subtract + */ + sub(z: number | Complex): Complex; + + /** + * Return the base to the exponent + * @param z The exponent + */ + pow(z: number | Complex): Complex; + + /** + * Return the square root + */ + sqrt(): Complex; + + /** + * Return the natural logarithm (base E) + * @param k The actual answer has a multiplicity (ln(z) = ln|z| + arg(z)) where arg(z) can return the same for different angles (every 2*pi), with this argument you can define which answer is required + */ + log(k?: number): Complex; + + /** + * Calculate the e^z where the base is E and the exponential the complex number. + */ + exp(): Complex; + + /** + * Calculate the sine of the complex number + */ + sin(): Complex; + + /** + * Calculate the cosine of the complex number + */ + cos(): Complex; + + /** + * Calculate the tangent of the complex number + */ + tan(): Complex; + + /** + * Calculate the hyperbolic sine of the complex number + */ + sinh(): Complex + + /** + * Calculate the hyperbolic cosine of the complex number + */ + cosh(): Complex + + /** + * Calculate the hyperbolic tangent of the complex number + */ + tanh(): Complex + + /** + * Return a new Complex instance with the same real and imaginary properties + */ + clone(): Complex; + + /** + * Return a string representation of the complex number + * + * Examples: + * new Complex(1, 2).toString(); // 1+2i + * new Complex(0, 1).toString(); // i + * new Complex(4, 0).toString(); // 4 + * new Complex(1, 1).toString(); // 1+i + * 'my Complex Number is: ' + (new Complex(3, 5)); // 'my Complex Number is: 3+5i + */ + toString(): string; + + /** + * Check if the real and imaginary components are equal to the passed in compelex components. + * + * Examples: + * new Complex(1, 4).equals(new Complex(1, 4)); // true + * new Complex(1, 4).equals(new Complex(1, 3)); // false + * + * @param z The complex number to compare with + */ + equals(z: number | Complex): boolean; + } +} diff --git a/compose-function/compose-function-tests.ts b/compose-function/compose-function-tests.ts new file mode 100644 index 000000000..dd0a80fef --- /dev/null +++ b/compose-function/compose-function-tests.ts @@ -0,0 +1,21 @@ +/// + +const numberToNumber = (a: number): number => a + 2; +const numberToString = (a: number): string => "foo"; +const stringToNumber = (a: string): number => 5; + +import composeFunction = require("compose-function"); +const t1: number = composeFunction(numberToNumber, numberToNumber)(5); +const t2: string = composeFunction(numberToString, numberToNumber)(5); +const t3: string = composeFunction(numberToString, stringToNumber)("f"); +const t4: (a: string) => number = composeFunction( + (f: (a: string) => number) => ((p: string) => 5), + (f: (a: number) => string) => ((p: string) => 4) + )(numberToString); + + +const t5: number = composeFunction(stringToNumber, numberToString, numberToNumber)(5); +const t6: string = composeFunction(numberToString, stringToNumber, numberToString, numberToNumber)(5); + +const t7: string = composeFunction( + numberToString, numberToNumber, stringToNumber, numberToString, stringToNumber)("fo"); diff --git a/compose-function/compose-function.d.ts b/compose-function/compose-function.d.ts new file mode 100644 index 000000000..d4f205fd3 --- /dev/null +++ b/compose-function/compose-function.d.ts @@ -0,0 +1,31 @@ +// Type definitions for compose-function +// Project: https://github.com/stoeffel/compose-function +// Definitions by: Denis Sokolov +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare module "compose-function" { + // Hardcoded signatures for 2-4 parameters + function f( + f1: (b: B) => C, + f2: (a: A) => B + ): (a: A) => C + function f( + f1: (b: C) => D, + f2: (a: B) => C, + f3: (a: A) => B + ): (a: A) => D + function f( + f1: (b: D) => E, + f2: (a: C) => D, + f3: (a: B) => C, + f4: (a: A) => B + ): (a: A) => E + + // Minimal typing for more than 4 parameters + function f( + f1: (a: any) => Result, + ...functions: Function[] + ): (a: any) => Result + + export = f; +} diff --git a/cordova-plugin-app-version/cordova-plugin-app-version.d.ts b/cordova-plugin-app-version/cordova-plugin-app-version.d.ts index a754368e3..8f4210eb8 100644 --- a/cordova-plugin-app-version/cordova-plugin-app-version.d.ts +++ b/cordova-plugin-app-version/cordova-plugin-app-version.d.ts @@ -3,13 +3,14 @@ // Definitions by: Markus Wagner // Definitions: https://github.com/borisyankov/DefinitelyTyped +/// /// interface Cordova { - getAppVersion: { - getAppName: () => Q.IPromise; - getPackageName: () => Q.IPromise; - getVersionCode: () => Q.IPromise; - getVersionNumber: () => Q.IPromise; + getAppVersion: { + getAppName: () => Q.IPromise | JQueryPromise; + getPackageName: () => Q.IPromise | JQueryPromise; + getVersionCode: () => Q.IPromise | JQueryPromise; + getVersionNumber: () => Q.IPromise | JQueryPromise; }; } \ No newline at end of file diff --git a/cordova-plugin-spinner/cordova-plugin-spinner-tests.ts b/cordova-plugin-spinner/cordova-plugin-spinner-tests.ts new file mode 100644 index 000000000..25e6b60ad --- /dev/null +++ b/cordova-plugin-spinner/cordova-plugin-spinner-tests.ts @@ -0,0 +1,10 @@ +/// + +SpinnerPlugin.activityStart(); +SpinnerPlugin.activityStart("a"); +SpinnerPlugin.activityStart("a", () => {}); +SpinnerPlugin.activityStart("a", () => {}, () => {}); + +SpinnerPlugin.activityStop(); +SpinnerPlugin.activityStop(() => {}); +SpinnerPlugin.activityStop(() => {}, () => {}); \ No newline at end of file diff --git a/cordova-plugin-spinner/cordova-plugin-spinner.d.ts b/cordova-plugin-spinner/cordova-plugin-spinner.d.ts new file mode 100644 index 000000000..44ccdde45 --- /dev/null +++ b/cordova-plugin-spinner/cordova-plugin-spinner.d.ts @@ -0,0 +1,31 @@ +// Type definitions for cordova-plugin-spinner 1.0.0 +// Project: https://github.com/Justin-Credible/cordova-plugin-spinner +// Definitions by: Justin Unterreiner +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module SpinnerPlugin { + + interface SpinnerPluginStatic { + + /** + * Blocks user input using an indeterminate spinner. + * + * An optional label can be shown below the spinner. + * + * @param labelText The optional value to show in a label. + * @param successCallback The success callback for this asynchronous function. + * @param failureCallback The failure callback for this asynchronous function; receives an error string. + */ + activityStart(labelText?: string, successCallback?: () => void, failureCallback?: (error: string) => void): void; + + /** + * Allows user input by hiding the indeterminate spinner. + * + * @param successCallback The success callback for this asynchronous function. + * @param failureCallback The failure callback for this asynchronous function; receives an error string. + */ + activityStop(successCallback?: () => void, failureCallback?: (error: string) => void): void; + } +} + +declare var SpinnerPlugin: SpinnerPlugin.SpinnerPluginStatic; diff --git a/cordova/plugins/Device.d.ts b/cordova/plugins/Device.d.ts index a25c1aadc..1abb37596 100644 --- a/cordova/plugins/Device.d.ts +++ b/cordova/plugins/Device.d.ts @@ -26,6 +26,9 @@ interface Device { version: string; /** Get the device's manufacturer. */ manufacturer: string; -} + /** Whether the device is running on a simulator. */ + isVirtual: boolean; + /** Get the device hardware serial number. */ + serial: string;} declare var device: Device; \ No newline at end of file diff --git a/core-js/core-js.d.ts b/core-js/core-js.d.ts index 9c492e433..e976c4361 100644 --- a/core-js/core-js.d.ts +++ b/core-js/core-js.d.ts @@ -2251,782 +2251,782 @@ declare module "core-js/web/immediate" { declare module "core-js/web/timers" { export = core; } -declare module "core-js/libary" { +declare module "core-js/library" { export = core; } -declare module "core-js/libary/shim" { +declare module "core-js/library/shim" { export = core; } -declare module "core-js/libary/core" { +declare module "core-js/library/core" { export = core; } -declare module "core-js/libary/core/$for" { +declare module "core-js/library/core/$for" { import $for = core.$for; export = $for; } -declare module "core-js/libary/core/_" { +declare module "core-js/library/core/_" { var _: typeof core._; export = _; } -declare module "core-js/libary/core/array" { +declare module "core-js/library/core/array" { var Array: typeof core.Array; export = Array; } -declare module "core-js/libary/core/date" { +declare module "core-js/library/core/date" { var Date: typeof core.Date; export = Date; } -declare module "core-js/libary/core/delay" { +declare module "core-js/library/core/delay" { var delay: typeof core.delay; export = delay; } -declare module "core-js/libary/core/dict" { +declare module "core-js/library/core/dict" { var Dict: typeof core.Dict; export = Dict; } -declare module "core-js/libary/core/function" { +declare module "core-js/library/core/function" { var Function: typeof core.Function; export = Function; } -declare module "core-js/libary/core/global" { +declare module "core-js/library/core/global" { var global: typeof core.global; export = global; } -declare module "core-js/libary/core/log" { +declare module "core-js/library/core/log" { var log: typeof core.log; export = log; } -declare module "core-js/libary/core/number" { +declare module "core-js/library/core/number" { var Number: typeof core.Number; export = Number; } -declare module "core-js/libary/core/object" { +declare module "core-js/library/core/object" { var Object: typeof core.Object; export = Object; } -declare module "core-js/libary/core/string" { +declare module "core-js/library/core/string" { var String: typeof core.String; export = String; } -declare module "core-js/libary/fn/$for" { +declare module "core-js/library/fn/$for" { import $for = core.$for; export = $for; } -declare module "core-js/libary/fn/_" { +declare module "core-js/library/fn/_" { var _: typeof core._; export = _; } -declare module "core-js/libary/fn/clear-immediate" { +declare module "core-js/library/fn/clear-immediate" { var clearImmediate: typeof core.clearImmediate; export = clearImmediate; } -declare module "core-js/libary/fn/delay" { +declare module "core-js/library/fn/delay" { var delay: typeof core.delay; export = delay; } -declare module "core-js/libary/fn/dict" { +declare module "core-js/library/fn/dict" { var Dict: typeof core.Dict; export = Dict; } -declare module "core-js/libary/fn/get-iterator" { +declare module "core-js/library/fn/get-iterator" { var getIterator: typeof core.getIterator; export = getIterator; } -declare module "core-js/libary/fn/global" { +declare module "core-js/library/fn/global" { var global: typeof core.global; export = global; } -declare module "core-js/libary/fn/is-iterable" { +declare module "core-js/library/fn/is-iterable" { var isIterable: typeof core.isIterable; export = isIterable; } -declare module "core-js/libary/fn/log" { +declare module "core-js/library/fn/log" { var log: typeof core.log; export = log; } -declare module "core-js/libary/fn/map" { +declare module "core-js/library/fn/map" { var Map: typeof core.Map; export = Map; } -declare module "core-js/libary/fn/promise" { +declare module "core-js/library/fn/promise" { var Promise: typeof core.Promise; export = Promise; } -declare module "core-js/libary/fn/set" { +declare module "core-js/library/fn/set" { var Set: typeof core.Set; export = Set; } -declare module "core-js/libary/fn/set-immediate" { +declare module "core-js/library/fn/set-immediate" { var setImmediate: typeof core.setImmediate; export = setImmediate; } -declare module "core-js/libary/fn/set-interval" { +declare module "core-js/library/fn/set-interval" { var setInterval: typeof core.setInterval; export = setInterval; } -declare module "core-js/libary/fn/set-timeout" { +declare module "core-js/library/fn/set-timeout" { var setTimeout: typeof core.setTimeout; export = setTimeout; } -declare module "core-js/libary/fn/weak-map" { +declare module "core-js/library/fn/weak-map" { var WeakMap: typeof core.WeakMap; export = WeakMap; } -declare module "core-js/libary/fn/weak-set" { +declare module "core-js/library/fn/weak-set" { var WeakSet: typeof core.WeakSet; export = WeakSet; } -declare module "core-js/libary/fn/array" { +declare module "core-js/library/fn/array" { var Array: typeof core.Array; export = Array; } -declare module "core-js/libary/fn/array/concat" { +declare module "core-js/library/fn/array/concat" { var concat: typeof core.Array.concat; export = concat; } -declare module "core-js/libary/fn/array/copy-within" { +declare module "core-js/library/fn/array/copy-within" { var copyWithin: typeof core.Array.copyWithin; export = copyWithin; } -declare module "core-js/libary/fn/array/entries" { +declare module "core-js/library/fn/array/entries" { var entries: typeof core.Array.entries; export = entries; } -declare module "core-js/libary/fn/array/every" { +declare module "core-js/library/fn/array/every" { var every: typeof core.Array.every; export = every; } -declare module "core-js/libary/fn/array/fill" { +declare module "core-js/library/fn/array/fill" { var fill: typeof core.Array.fill; export = fill; } -declare module "core-js/libary/fn/array/filter" { +declare module "core-js/library/fn/array/filter" { var filter: typeof core.Array.filter; export = filter; } -declare module "core-js/libary/fn/array/find" { +declare module "core-js/library/fn/array/find" { var find: typeof core.Array.find; export = find; } -declare module "core-js/libary/fn/array/find-index" { +declare module "core-js/library/fn/array/find-index" { var findIndex: typeof core.Array.findIndex; export = findIndex; } -declare module "core-js/libary/fn/array/for-each" { +declare module "core-js/library/fn/array/for-each" { var forEach: typeof core.Array.forEach; export = forEach; } -declare module "core-js/libary/fn/array/from" { +declare module "core-js/library/fn/array/from" { var from: typeof core.Array.from; export = from; } -declare module "core-js/libary/fn/array/includes" { +declare module "core-js/library/fn/array/includes" { var includes: typeof core.Array.includes; export = includes; } -declare module "core-js/libary/fn/array/index-of" { +declare module "core-js/library/fn/array/index-of" { var indexOf: typeof core.Array.indexOf; export = indexOf; } -declare module "core-js/libary/fn/array/join" { +declare module "core-js/library/fn/array/join" { var join: typeof core.Array.join; export = join; } -declare module "core-js/libary/fn/array/keys" { +declare module "core-js/library/fn/array/keys" { var keys: typeof core.Array.keys; export = keys; } -declare module "core-js/libary/fn/array/last-index-of" { +declare module "core-js/library/fn/array/last-index-of" { var lastIndexOf: typeof core.Array.lastIndexOf; export = lastIndexOf; } -declare module "core-js/libary/fn/array/map" { +declare module "core-js/library/fn/array/map" { var map: typeof core.Array.map; export = map; } -declare module "core-js/libary/fn/array/of" { +declare module "core-js/library/fn/array/of" { var of: typeof core.Array.of; export = of; } -declare module "core-js/libary/fn/array/pop" { +declare module "core-js/library/fn/array/pop" { var pop: typeof core.Array.pop; export = pop; } -declare module "core-js/libary/fn/array/push" { +declare module "core-js/library/fn/array/push" { var push: typeof core.Array.push; export = push; } -declare module "core-js/libary/fn/array/reduce" { +declare module "core-js/library/fn/array/reduce" { var reduce: typeof core.Array.reduce; export = reduce; } -declare module "core-js/libary/fn/array/reduce-right" { +declare module "core-js/library/fn/array/reduce-right" { var reduceRight: typeof core.Array.reduceRight; export = reduceRight; } -declare module "core-js/libary/fn/array/reverse" { +declare module "core-js/library/fn/array/reverse" { var reverse: typeof core.Array.reverse; export = reverse; } -declare module "core-js/libary/fn/array/shift" { +declare module "core-js/library/fn/array/shift" { var shift: typeof core.Array.shift; export = shift; } -declare module "core-js/libary/fn/array/slice" { +declare module "core-js/library/fn/array/slice" { var slice: typeof core.Array.slice; export = slice; } -declare module "core-js/libary/fn/array/some" { +declare module "core-js/library/fn/array/some" { var some: typeof core.Array.some; export = some; } -declare module "core-js/libary/fn/array/sort" { +declare module "core-js/library/fn/array/sort" { var sort: typeof core.Array.sort; export = sort; } -declare module "core-js/libary/fn/array/splice" { +declare module "core-js/library/fn/array/splice" { var splice: typeof core.Array.splice; export = splice; } -declare module "core-js/libary/fn/array/turn" { +declare module "core-js/library/fn/array/turn" { var turn: typeof core.Array.turn; export = turn; } -declare module "core-js/libary/fn/array/unshift" { +declare module "core-js/library/fn/array/unshift" { var unshift: typeof core.Array.unshift; export = unshift; } -declare module "core-js/libary/fn/array/values" { +declare module "core-js/library/fn/array/values" { var values: typeof core.Array.values; export = values; } -declare module "core-js/libary/fn/date" { +declare module "core-js/library/fn/date" { var Date: typeof core.Date; export = Date; } -declare module "core-js/libary/fn/date/add-locale" { +declare module "core-js/library/fn/date/add-locale" { var addLocale: typeof core.addLocale; export = addLocale; } -declare module "core-js/libary/fn/date/format" { +declare module "core-js/library/fn/date/format" { var format: typeof core.Date.format; export = format; } -declare module "core-js/libary/fn/date/formatUTC" { +declare module "core-js/library/fn/date/formatUTC" { var formatUTC: typeof core.Date.formatUTC; export = formatUTC; } -declare module "core-js/libary/fn/function" { +declare module "core-js/library/fn/function" { var Function: typeof core.Function; export = Function; } -declare module "core-js/libary/fn/function/has-instance" { +declare module "core-js/library/fn/function/has-instance" { var hasInstance: (value: any) => boolean; export = hasInstance; } -declare module "core-js/libary/fn/function/name" { +declare module "core-js/library/fn/function/name" { } -declare module "core-js/libary/fn/function/part" { +declare module "core-js/library/fn/function/part" { var part: typeof core.Function.part; export = part; } -declare module "core-js/libary/fn/math" { +declare module "core-js/library/fn/math" { var Math: typeof core.Math; export = Math; } -declare module "core-js/libary/fn/math/acosh" { +declare module "core-js/library/fn/math/acosh" { var acosh: typeof core.Math.acosh; export = acosh; } -declare module "core-js/libary/fn/math/asinh" { +declare module "core-js/library/fn/math/asinh" { var asinh: typeof core.Math.asinh; export = asinh; } -declare module "core-js/libary/fn/math/atanh" { +declare module "core-js/library/fn/math/atanh" { var atanh: typeof core.Math.atanh; export = atanh; } -declare module "core-js/libary/fn/math/cbrt" { +declare module "core-js/library/fn/math/cbrt" { var cbrt: typeof core.Math.cbrt; export = cbrt; } -declare module "core-js/libary/fn/math/clz32" { +declare module "core-js/library/fn/math/clz32" { var clz32: typeof core.Math.clz32; export = clz32; } -declare module "core-js/libary/fn/math/cosh" { +declare module "core-js/library/fn/math/cosh" { var cosh: typeof core.Math.cosh; export = cosh; } -declare module "core-js/libary/fn/math/expm1" { +declare module "core-js/library/fn/math/expm1" { var expm1: typeof core.Math.expm1; export = expm1; } -declare module "core-js/libary/fn/math/fround" { +declare module "core-js/library/fn/math/fround" { var fround: typeof core.Math.fround; export = fround; } -declare module "core-js/libary/fn/math/hypot" { +declare module "core-js/library/fn/math/hypot" { var hypot: typeof core.Math.hypot; export = hypot; } -declare module "core-js/libary/fn/math/imul" { +declare module "core-js/library/fn/math/imul" { var imul: typeof core.Math.imul; export = imul; } -declare module "core-js/libary/fn/math/log10" { +declare module "core-js/library/fn/math/log10" { var log10: typeof core.Math.log10; export = log10; } -declare module "core-js/libary/fn/math/log1p" { +declare module "core-js/library/fn/math/log1p" { var log1p: typeof core.Math.log1p; export = log1p; } -declare module "core-js/libary/fn/math/log2" { +declare module "core-js/library/fn/math/log2" { var log2: typeof core.Math.log2; export = log2; } -declare module "core-js/libary/fn/math/sign" { +declare module "core-js/library/fn/math/sign" { var sign: typeof core.Math.sign; export = sign; } -declare module "core-js/libary/fn/math/sinh" { +declare module "core-js/library/fn/math/sinh" { var sinh: typeof core.Math.sinh; export = sinh; } -declare module "core-js/libary/fn/math/tanh" { +declare module "core-js/library/fn/math/tanh" { var tanh: typeof core.Math.tanh; export = tanh; } -declare module "core-js/libary/fn/math/trunc" { +declare module "core-js/library/fn/math/trunc" { var trunc: typeof core.Math.trunc; export = trunc; } -declare module "core-js/libary/fn/number" { +declare module "core-js/library/fn/number" { var Number: typeof core.Number; export = Number; } -declare module "core-js/libary/fn/number/epsilon" { +declare module "core-js/library/fn/number/epsilon" { var EPSILON: typeof core.Number.EPSILON; export = EPSILON; } -declare module "core-js/libary/fn/number/is-finite" { +declare module "core-js/library/fn/number/is-finite" { var isFinite: typeof core.Number.isFinite; export = isFinite; } -declare module "core-js/libary/fn/number/is-integer" { +declare module "core-js/library/fn/number/is-integer" { var isInteger: typeof core.Number.isInteger; export = isInteger; } -declare module "core-js/libary/fn/number/is-nan" { +declare module "core-js/library/fn/number/is-nan" { var isNaN: typeof core.Number.isNaN; export = isNaN; } -declare module "core-js/libary/fn/number/is-safe-integer" { +declare module "core-js/library/fn/number/is-safe-integer" { var isSafeInteger: typeof core.Number.isSafeInteger; export = isSafeInteger; } -declare module "core-js/libary/fn/number/max-safe-integer" { +declare module "core-js/library/fn/number/max-safe-integer" { var MAX_SAFE_INTEGER: typeof core.Number.MAX_SAFE_INTEGER; export = MAX_SAFE_INTEGER; } -declare module "core-js/libary/fn/number/min-safe-interger" { +declare module "core-js/library/fn/number/min-safe-interger" { var MIN_SAFE_INTEGER: typeof core.Number.MIN_SAFE_INTEGER; export = MIN_SAFE_INTEGER; } -declare module "core-js/libary/fn/number/parse-float" { +declare module "core-js/library/fn/number/parse-float" { var parseFloat: typeof core.Number.parseFloat; export = parseFloat; } -declare module "core-js/libary/fn/number/parse-int" { +declare module "core-js/library/fn/number/parse-int" { var parseInt: typeof core.Number.parseInt; export = parseInt; } -declare module "core-js/libary/fn/number/random" { +declare module "core-js/library/fn/number/random" { var random: typeof core.Number.random; export = random; } -declare module "core-js/libary/fn/object" { +declare module "core-js/library/fn/object" { var Object: typeof core.Object; export = Object; } -declare module "core-js/libary/fn/object/assign" { +declare module "core-js/library/fn/object/assign" { var assign: typeof core.Object.assign; export = assign; } -declare module "core-js/libary/fn/object/classof" { +declare module "core-js/library/fn/object/classof" { var classof: typeof core.Object.classof; export = classof; } -declare module "core-js/libary/fn/object/create" { +declare module "core-js/library/fn/object/create" { var create: typeof core.Object.create; export = create; } -declare module "core-js/libary/fn/object/define" { +declare module "core-js/library/fn/object/define" { var define: typeof core.Object.define; export = define; } -declare module "core-js/libary/fn/object/define-properties" { +declare module "core-js/library/fn/object/define-properties" { var defineProperties: typeof core.Object.defineProperties; export = defineProperties; } -declare module "core-js/libary/fn/object/define-property" { +declare module "core-js/library/fn/object/define-property" { var defineProperty: typeof core.Object.defineProperty; export = defineProperty; } -declare module "core-js/libary/fn/object/entries" { +declare module "core-js/library/fn/object/entries" { var entries: typeof core.Object.entries; export = entries; } -declare module "core-js/libary/fn/object/freeze" { +declare module "core-js/library/fn/object/freeze" { var freeze: typeof core.Object.freeze; export = freeze; } -declare module "core-js/libary/fn/object/get-own-property-descriptor" { +declare module "core-js/library/fn/object/get-own-property-descriptor" { var getOwnPropertyDescriptor: typeof core.Object.getOwnPropertyDescriptor; export = getOwnPropertyDescriptor; } -declare module "core-js/libary/fn/object/get-own-property-descriptors" { +declare module "core-js/library/fn/object/get-own-property-descriptors" { var getOwnPropertyDescriptors: typeof core.Object.getOwnPropertyDescriptors; export = getOwnPropertyDescriptors; } -declare module "core-js/libary/fn/object/get-own-property-names" { +declare module "core-js/library/fn/object/get-own-property-names" { var getOwnPropertyNames: typeof core.Object.getOwnPropertyNames; export = getOwnPropertyNames; } -declare module "core-js/libary/fn/object/get-own-property-symbols" { +declare module "core-js/library/fn/object/get-own-property-symbols" { var getOwnPropertySymbols: typeof core.Object.getOwnPropertySymbols; export = getOwnPropertySymbols; } -declare module "core-js/libary/fn/object/get-prototype-of" { +declare module "core-js/library/fn/object/get-prototype-of" { var getPrototypeOf: typeof core.Object.getPrototypeOf; export = getPrototypeOf; } -declare module "core-js/libary/fn/object/is" { +declare module "core-js/library/fn/object/is" { var is: typeof core.Object.is; export = is; } -declare module "core-js/libary/fn/object/is-extensible" { +declare module "core-js/library/fn/object/is-extensible" { var isExtensible: typeof core.Object.isExtensible; export = isExtensible; } -declare module "core-js/libary/fn/object/is-frozen" { +declare module "core-js/library/fn/object/is-frozen" { var isFrozen: typeof core.Object.isFrozen; export = isFrozen; } -declare module "core-js/libary/fn/object/is-object" { +declare module "core-js/library/fn/object/is-object" { var isObject: typeof core.Object.isObject; export = isObject; } -declare module "core-js/libary/fn/object/is-sealed" { +declare module "core-js/library/fn/object/is-sealed" { var isSealed: typeof core.Object.isSealed; export = isSealed; } -declare module "core-js/libary/fn/object/keys" { +declare module "core-js/library/fn/object/keys" { var keys: typeof core.Object.keys; export = keys; } -declare module "core-js/libary/fn/object/make" { +declare module "core-js/library/fn/object/make" { var make: typeof core.Object.make; export = make; } -declare module "core-js/libary/fn/object/prevent-extensions" { +declare module "core-js/library/fn/object/prevent-extensions" { var preventExtensions: typeof core.Object.preventExtensions; export = preventExtensions; } -declare module "core-js/libary/fn/object/seal" { +declare module "core-js/library/fn/object/seal" { var seal: typeof core.Object.seal; export = seal; } -declare module "core-js/libary/fn/object/set-prototype-of" { +declare module "core-js/library/fn/object/set-prototype-of" { var setPrototypeOf: typeof core.Object.setPrototypeOf; export = setPrototypeOf; } -declare module "core-js/libary/fn/object/values" { +declare module "core-js/library/fn/object/values" { var values: typeof core.Object.values; export = values; } -declare module "core-js/libary/fn/reflect" { +declare module "core-js/library/fn/reflect" { var Reflect: typeof core.Reflect; export = Reflect; } -declare module "core-js/libary/fn/reflect/apply" { +declare module "core-js/library/fn/reflect/apply" { var apply: typeof core.Reflect.apply; export = apply; } -declare module "core-js/libary/fn/reflect/construct" { +declare module "core-js/library/fn/reflect/construct" { var construct: typeof core.Reflect.construct; export = construct; } -declare module "core-js/libary/fn/reflect/define-property" { +declare module "core-js/library/fn/reflect/define-property" { var defineProperty: typeof core.Reflect.defineProperty; export = defineProperty; } -declare module "core-js/libary/fn/reflect/delete-property" { +declare module "core-js/library/fn/reflect/delete-property" { var deleteProperty: typeof core.Reflect.deleteProperty; export = deleteProperty; } -declare module "core-js/libary/fn/reflect/enumerate" { +declare module "core-js/library/fn/reflect/enumerate" { var enumerate: typeof core.Reflect.enumerate; export = enumerate; } -declare module "core-js/libary/fn/reflect/get" { +declare module "core-js/library/fn/reflect/get" { var get: typeof core.Reflect.get; export = get; } -declare module "core-js/libary/fn/reflect/get-own-property-descriptor" { +declare module "core-js/library/fn/reflect/get-own-property-descriptor" { var getOwnPropertyDescriptor: typeof core.Reflect.getOwnPropertyDescriptor; export = getOwnPropertyDescriptor; } -declare module "core-js/libary/fn/reflect/get-prototype-of" { +declare module "core-js/library/fn/reflect/get-prototype-of" { var getPrototypeOf: typeof core.Reflect.getPrototypeOf; export = getPrototypeOf; } -declare module "core-js/libary/fn/reflect/has" { +declare module "core-js/library/fn/reflect/has" { var has: typeof core.Reflect.has; export = has; } -declare module "core-js/libary/fn/reflect/is-extensible" { +declare module "core-js/library/fn/reflect/is-extensible" { var isExtensible: typeof core.Reflect.isExtensible; export = isExtensible; } -declare module "core-js/libary/fn/reflect/own-keys" { +declare module "core-js/library/fn/reflect/own-keys" { var ownKeys: typeof core.Reflect.ownKeys; export = ownKeys; } -declare module "core-js/libary/fn/reflect/prevent-extensions" { +declare module "core-js/library/fn/reflect/prevent-extensions" { var preventExtensions: typeof core.Reflect.preventExtensions; export = preventExtensions; } -declare module "core-js/libary/fn/reflect/set" { +declare module "core-js/library/fn/reflect/set" { var set: typeof core.Reflect.set; export = set; } -declare module "core-js/libary/fn/reflect/set-prototype-of" { +declare module "core-js/library/fn/reflect/set-prototype-of" { var setPrototypeOf: typeof core.Reflect.setPrototypeOf; export = setPrototypeOf; } -declare module "core-js/libary/fn/regexp" { +declare module "core-js/library/fn/regexp" { var RegExp: typeof core.RegExp; export = RegExp; } -declare module "core-js/libary/fn/regexp/escape" { +declare module "core-js/library/fn/regexp/escape" { var escape: typeof core.RegExp.escape; export = escape; } -declare module "core-js/libary/fn/string" { +declare module "core-js/library/fn/string" { var String: typeof core.String; export = String; } -declare module "core-js/libary/fn/string/at" { +declare module "core-js/library/fn/string/at" { var at: typeof core.String.at; export = at; } -declare module "core-js/libary/fn/string/code-point-at" { +declare module "core-js/library/fn/string/code-point-at" { var codePointAt: typeof core.String.codePointAt; export = codePointAt; } -declare module "core-js/libary/fn/string/ends-with" { +declare module "core-js/library/fn/string/ends-with" { var endsWith: typeof core.String.endsWith; export = endsWith; } -declare module "core-js/libary/fn/string/escape-html" { +declare module "core-js/library/fn/string/escape-html" { var escapeHTML: typeof core.String.escapeHTML; export = escapeHTML; } -declare module "core-js/libary/fn/string/from-code-point" { +declare module "core-js/library/fn/string/from-code-point" { var fromCodePoint: typeof core.String.fromCodePoint; export = fromCodePoint; } -declare module "core-js/libary/fn/string/includes" { +declare module "core-js/library/fn/string/includes" { var includes: typeof core.String.includes; export = includes; } -declare module "core-js/libary/fn/string/lpad" { +declare module "core-js/library/fn/string/lpad" { var lpad: typeof core.String.lpad; export = lpad; } -declare module "core-js/libary/fn/string/raw" { +declare module "core-js/library/fn/string/raw" { var raw: typeof core.String.raw; export = raw; } -declare module "core-js/libary/fn/string/repeat" { +declare module "core-js/library/fn/string/repeat" { var repeat: typeof core.String.repeat; export = repeat; } -declare module "core-js/libary/fn/string/rpad" { +declare module "core-js/library/fn/string/rpad" { var rpad: typeof core.String.rpad; export = rpad; } -declare module "core-js/libary/fn/string/starts-with" { +declare module "core-js/library/fn/string/starts-with" { var startsWith: typeof core.String.startsWith; export = startsWith; } -declare module "core-js/libary/fn/string/unescape-html" { +declare module "core-js/library/fn/string/unescape-html" { var unescapeHTML: typeof core.String.unescapeHTML; export = unescapeHTML; } -declare module "core-js/libary/fn/symbol" { +declare module "core-js/library/fn/symbol" { var Symbol: typeof core.Symbol; export = Symbol; } -declare module "core-js/libary/fn/symbol/for" { +declare module "core-js/library/fn/symbol/for" { var _for: typeof core.Symbol.for; export = _for; } -declare module "core-js/libary/fn/symbol/has-instance" { +declare module "core-js/library/fn/symbol/has-instance" { var hasInstance: typeof core.Symbol.hasInstance; export = hasInstance; } -declare module "core-js/libary/fn/symbol/is-concat-spreadable" { +declare module "core-js/library/fn/symbol/is-concat-spreadable" { var isConcatSpreadable: typeof core.Symbol.isConcatSpreadable; export = isConcatSpreadable; } -declare module "core-js/libary/fn/symbol/iterator" { +declare module "core-js/library/fn/symbol/iterator" { var iterator: typeof core.Symbol.iterator; export = iterator; } -declare module "core-js/libary/fn/symbol/key-for" { +declare module "core-js/library/fn/symbol/key-for" { var keyFor: typeof core.Symbol.keyFor; export = keyFor; } -declare module "core-js/libary/fn/symbol/match" { +declare module "core-js/library/fn/symbol/match" { var match: typeof core.Symbol.match; export = match; } -declare module "core-js/libary/fn/symbol/replace" { +declare module "core-js/library/fn/symbol/replace" { var replace: typeof core.Symbol.replace; export = replace; } -declare module "core-js/libary/fn/symbol/search" { +declare module "core-js/library/fn/symbol/search" { var search: typeof core.Symbol.search; export = search; } -declare module "core-js/libary/fn/symbol/species" { +declare module "core-js/library/fn/symbol/species" { var species: typeof core.Symbol.species; export = species; } -declare module "core-js/libary/fn/symbol/split" { +declare module "core-js/library/fn/symbol/split" { var split: typeof core.Symbol.split; export = split; } -declare module "core-js/libary/fn/symbol/to-primitive" { +declare module "core-js/library/fn/symbol/to-primitive" { var toPrimitive: typeof core.Symbol.toPrimitive; export = toPrimitive; } -declare module "core-js/libary/fn/symbol/to-string-tag" { +declare module "core-js/library/fn/symbol/to-string-tag" { var toStringTag: typeof core.Symbol.toStringTag; export = toStringTag; } -declare module "core-js/libary/fn/symbol/unscopables" { +declare module "core-js/library/fn/symbol/unscopables" { var unscopables: typeof core.Symbol.unscopables; export = unscopables; } -declare module "core-js/libary/es5" { +declare module "core-js/library/es5" { export = core; } -declare module "core-js/libary/es6" { +declare module "core-js/library/es6" { export = core; } -declare module "core-js/libary/es6/array" { +declare module "core-js/library/es6/array" { var Array: typeof core.Array; export = Array; } -declare module "core-js/libary/es6/function" { +declare module "core-js/library/es6/function" { var Function: typeof core.Function; export = Function; } -declare module "core-js/libary/es6/map" { +declare module "core-js/library/es6/map" { var Map: typeof core.Map; export = Map; } -declare module "core-js/libary/es6/math" { +declare module "core-js/library/es6/math" { var Math: typeof core.Math; export = Math; } -declare module "core-js/libary/es6/number" { +declare module "core-js/library/es6/number" { var Number: typeof core.Number; export = Number; } -declare module "core-js/libary/es6/object" { +declare module "core-js/library/es6/object" { var Object: typeof core.Object; export = Object; } -declare module "core-js/libary/es6/promise" { +declare module "core-js/library/es6/promise" { var Promise: typeof core.Promise; export = Promise; } -declare module "core-js/libary/es6/reflect" { +declare module "core-js/library/es6/reflect" { var Reflect: typeof core.Reflect; export = Reflect; } -declare module "core-js/libary/es6/regexp" { +declare module "core-js/library/es6/regexp" { var RegExp: typeof core.RegExp; export = RegExp; } -declare module "core-js/libary/es6/set" { +declare module "core-js/library/es6/set" { var Set: typeof core.Set; export = Set; } -declare module "core-js/libary/es6/string" { +declare module "core-js/library/es6/string" { var String: typeof core.String; export = String; } -declare module "core-js/libary/es6/symbol" { +declare module "core-js/library/es6/symbol" { var Symbol: typeof core.Symbol; export = Symbol; } -declare module "core-js/libary/es6/weak-map" { +declare module "core-js/library/es6/weak-map" { var WeakMap: typeof core.WeakMap; export = WeakMap; } -declare module "core-js/libary/es6/weak-set" { +declare module "core-js/library/es6/weak-set" { var WeakSet: typeof core.WeakSet; export = WeakSet; } -declare module "core-js/libary/es7" { +declare module "core-js/library/es7" { export = core; } -declare module "core-js/libary/es7/array" { +declare module "core-js/library/es7/array" { var Array: typeof core.Array; export = Array; } -declare module "core-js/libary/es7/map" { +declare module "core-js/library/es7/map" { var Map: typeof core.Map; export = Map; } -declare module "core-js/libary/es7/object" { +declare module "core-js/library/es7/object" { var Object: typeof core.Object; export = Object; } -declare module "core-js/libary/es7/regexp" { +declare module "core-js/library/es7/regexp" { var RegExp: typeof core.RegExp; export = RegExp; } -declare module "core-js/libary/es7/set" { +declare module "core-js/library/es7/set" { var Set: typeof core.Set; export = Set; } -declare module "core-js/libary/es7/string" { +declare module "core-js/library/es7/string" { var String: typeof core.String; export = String; } -declare module "core-js/libary/js" { +declare module "core-js/library/js" { export = core; } -declare module "core-js/libary/js/array" { +declare module "core-js/library/js/array" { var Array: typeof core.Array; export = Array; } -declare module "core-js/libary/web" { +declare module "core-js/library/web" { export = core; } -declare module "core-js/libary/web/dom" { +declare module "core-js/library/web/dom" { export = core; } -declare module "core-js/libary/web/immediate" { +declare module "core-js/library/web/immediate" { export = core; } -declare module "core-js/libary/web/timers" { +declare module "core-js/library/web/timers" { export = core; } diff --git a/credential/credential-tests.ts b/credential/credential-tests.ts new file mode 100644 index 000000000..6013436b0 --- /dev/null +++ b/credential/credential-tests.ts @@ -0,0 +1,16 @@ +/// + +import * as credential from 'credential'; + +credential.hash('password', function(err: Error, hash: string) { + if (err) console.error(err); + else console.log(hash); +}); + +const hash = '{}'; +const password = 'test'; + +credential.verify(hash, password, function(err: Error, isValid: boolean) { + if (err) console.error(err); + else console.log(isValid ? 'Password match' : 'Incorrect password'); +}); diff --git a/credential/credential.d.ts b/credential/credential.d.ts new file mode 100644 index 000000000..d8497ec14 --- /dev/null +++ b/credential/credential.d.ts @@ -0,0 +1,18 @@ +// Type definitions for credential +// Project: https://github.com/ericelliott/credential +// Definitions by: Phú +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare module 'credential' { + + type HashCallback = (err: Error, hash: string) => void; + type VerifyCallback = (err: Error, isValid: boolean) => void; + + module credential { + function hash(password: string, callback: HashCallback): void; + function verify(hash: string, password: string, callback: VerifyCallback): void; + } + + export = credential; + +} diff --git a/css/css-tests.ts b/css/css-tests.ts new file mode 100644 index 000000000..d223679e2 --- /dev/null +++ b/css/css-tests.ts @@ -0,0 +1,62 @@ +/// + +import css = require("css"); + +// Check that user can parse, modify and persist CSS content + +var parserOptions: css.ParserOptions; +parserOptions = { + silent: true, + source: "test.css" +}; + +var stylesheet = css.parse("body { font-size: 12px; }", parserOptions); + +var comment: css.Comment; +comment = { + type: "comment", + comment: "Hello World" +}; + +stylesheet.stylesheet.rules.push(comment); + +var stringifyOptions: css.StringifyOptions; +stringifyOptions = { + indent: " " +}; + +var content = css.stringify(stylesheet, stringifyOptions); + +// Create new stylesheet and save it + +var bgDeclaration: css.Declaration = { + type: "declaration", + property: "background", + value: "#eee" +}; + +var colorDeclaration: css.Declaration = { + type: "declaration", + property: "color", + value: "#888" +}; + +var ruleComment: css.Comment = { + type: "comment", + comment: "New CSS AST Tree Rule" +}; + +var bodyRule: css.Rule = { + type: "rule", + selectors: ["body"], + declarations: [ruleComment, bgDeclaration, colorDeclaration] +}; + +var newStylesheet: css.Stylesheet = { + type: "stylesheet", + stylesheet: { + rules: [bodyRule] + } +}; + +content = css.stringify(newStylesheet); \ No newline at end of file diff --git a/css/css.d.ts b/css/css.d.ts new file mode 100644 index 000000000..acea1acf0 --- /dev/null +++ b/css/css.d.ts @@ -0,0 +1,258 @@ +// Type definitions for css +// Project: https://github.com/reworkcss/css +// Definitions by: Ilya Verbitskiy +// Definitions: https://github.com/ilich/DefinitelyTyped + +/** + * CSS parser / stringifier for Node.js + */ +declare module "css" { + + /** + * css.parse options + */ + interface ParserOptions { + /** Silently fail on parse errors */ + silent?: boolean; + /** The path to the file containing css. Makes errors and source maps more helpful, by letting them know where code comes from. */ + source?: string; + } + + /** + * css.stringify options + */ + interface StringifyOptions { + /** The string used to indent the output. Defaults to two spaces. */ + indent?: string; + /** Omit comments and extraneous whitespace. */ + compress?: boolean; + /** Return a sourcemap along with the CSS output. + * Using the source option of css.parse is strongly recommended + * when creating a source map. Specify sourcemap: 'generator' + * to return the SourceMapGenerator object instead of serializing the source map. + */ + sourcemap?: string; + /** (enabled by default, specify false to disable) + * Reads any source maps referenced by the input files + * when generating the output source map. When enabled, + * file system access may be required for reading the referenced source maps. + */ + inputSourcemaps?: boolean; + } + + /** + * Error thrown during parsing. + */ + interface ParserError { + /** The full error message with the source position. */ + message?: string; + /** The error message without position. */ + reason?: string; + /** The value of options.source if passed to css.parse. Otherwise undefined. */ + filename?: string; + line?: number; + column?: number; + /** The portion of code that couldn't be parsed. */ + source?: string; + } + + // --------------------------------------------------------------------------------- + // AST Tree + // --------------------------------------------------------------------------------- + + /** + * Information about a position in the code. + * The line and column numbers are 1-based: The first line is 1 and the first column of a line is 1 (not 0). + */ + interface Position { + line?: number; + column?: number; + } + + /** + * Base AST Tree Node. + */ + interface Node { + /** The possible values are the ones listed in the Types section on https://github.com/reworkcss/css page. */ + type?: string; + /** A reference to the parent node, or null if the node has no parent. */ + parent?: Node; + /** Information about the position in the source string that corresponds to the node. */ + position?: { + start?: Position; + end?: Position; + /** The value of options.source if passed to css.parse. Otherwise undefined. */ + source?: string; + /** The full source string passed to css.parse. */ + content?: string; + }; + } + + interface Rule extends Node { + /** The list of selectors of the rule, split on commas. Each selector is trimmed from whitespace and comments. */ + selectors?: Array; + /** Array of nodes with the types declaration and comment. */ + declarations?: Array; + } + + interface Declaration extends Node { + /** The property name, trimmed from whitespace and comments. May not be empty. */ + property?: string; + /** The value of the property, trimmed from whitespace and comments. Empty values are allowed. */ + value?: string; + } + + /** + * A rule-level or declaration-level comment. Comments inside selectors, properties and values etc. are lost. + */ + interface Comment extends Node { + comment?: string; + } + + /** + * The @charset at-rule. + */ + interface Charset { + /** The part following @charset. */ + charset?: string; + } + + /** + * The @custom-media at-rule + */ + interface CustomMedia { + /** The ---prefixed name. */ + name?: string; + /** The part following the name. */ + media?: string; + } + + /** + * The @document at-rule. + */ + interface Document { + /** The part following @document. */ + document?: string; + /** The vendor prefix in @document, or undefined if there is none. */ + vendor?: string; + /** Array of nodes with the types rule, comment and any of the at-rule types. */ + rules?: Array; + } + + /** + * The @font-face at-rule. + */ + interface FontFace { + /** Array of nodes with the types declaration and comment. */ + declarations?: Array; + } + + /** + * The @host at-rule. + */ + interface Host { + /** Array of nodes with the types rule, comment and any of the at-rule types. */ + rules?: Array; + } + + /** + * The @import at-rule. + */ + interface Import { + /** The part following @import. */ + import?: string; + } + + /** + * The @keyframes at-rule. + */ + interface KeyFrames { + /** The name of the keyframes rule. */ + name?: string; + /** The vendor prefix in @keyframes, or undefined if there is none. */ + vendor?: string; + /** Array of nodes with the types keyframe and comment. */ + keyframes?: Array; + } + + interface KeyFrame { + /** The list of "selectors" of the keyframe rule, split on commas. Each “selector” is trimmed from whitespace. */ + values?: Array; + /** Array of nodes with the types declaration and comment. */ + declarations?: Array; + } + + /** + * The @media at-rule. + */ + interface Media { + /** The part following @media. */ + media?: string; + /** Array of nodes with the types rule, comment and any of the at-rule types. */ + rules?: Array; + } + + /** + * The @namespace at-rule. + */ + interface Namespace { + /** The part following @namespace. */ + namespace?: string; + } + + /** + * The @page at-rule. + */ + interface Page { + /** The list of selectors of the rule, split on commas. Each selector is trimmed from whitespace and comments. */ + selectors?: Array; + /** Array of nodes with the types declaration and comment. */ + declarations?: Array; + } + + /** + * The @supports at-rule. + */ + interface Supports { + /** The part following @supports. */ + supports?: string; + /** Array of nodes with the types rule, comment and any of the at-rule types. */ + rules?: Array; + } + + /** All at-rules. */ + type AtRule = Charset|CustomMedia|Document|FontFace|Host|Import|KeyFrames|Media|Namespace|Page|Supports; + + /** + * The root node returned by css.parse. + */ + interface Stylesheet extends Node { + stylesheet?: { + /** Array of nodes with the types rule, comment and any of the at-rule types. */ + rules?: Array; + /** Array of Errors. Errors collected during parsing when option silent is true. */ + parsingErrors?: Array + }; + } + + // --------------------------------------------------------------------------------- + + /** + * Accepts a CSS string and returns an AST object. + * + * @param {string} code - CSS code. + * @param {ParserOptions} options - CSS parser options. + * @return {Stylesheet} AST object built using provides CSS code. + */ + function parse(code: string, options?: ParserOptions): Stylesheet; + + /** + * Accepts an AST object (as css.parse produces) and returns a CSS string. + * + * @param {Stylesheet} stylesheet - AST tree. + * @param {StringifyOptions} options - AST tree to string serializaiton options. + * @return {string} CSS code. + */ + function stringify(stylesheet: Stylesheet, options?: StringifyOptions): string; + +} \ No newline at end of file diff --git a/d3/d3.d.ts b/d3/d3.d.ts index 87e6ef0e0..396d0307e 100644 --- a/d3/d3.d.ts +++ b/d3/d3.d.ts @@ -2697,24 +2697,24 @@ declare module d3 { response(): (request: XMLHttpRequest) => any; response(value: (request: XMLHttpRequest) => any): DsvXhr; - get(callback?: (err: any, data: T) => void): DsvXhr; - post(data?: any, callback?: (err: any, data: T) => void): DsvXhr; - post(callback: (err: any, data: T) => void): DsvXhr; + get(callback?: (err: XMLHttpRequest, data: T[]) => void): DsvXhr; + post(data?: any, callback?: (err: XMLHttpRequest, data: T[]) => void): DsvXhr; + post(callback: (err: XMLHttpRequest, data: T[]) => void): DsvXhr; - send(method: string, data?: any, callback?: (err: any, data: T) => void): DsvXhr; - send(method: string, callback: (err: any, data: T) => void): DsvXhr; + send(method: string, data?: any, callback?: (err: XMLHttpRequest, data: T[]) => void): DsvXhr; + send(method: string, callback: (err: XMLHttpRequest, data: T[]) => void): DsvXhr; abort(): DsvXhr; on(type: "beforesend"): (request: XMLHttpRequest) => void; on(type: "progress"): (request: XMLHttpRequest) => void; - on(type: "load"): (response: T) => void; + on(type: "load"): (response: T[]) => void; on(type: "error"): (err: any) => void; on(type: string): (...args: any[]) => void; on(type: "beforesend", listener: (request: XMLHttpRequest) => void): DsvXhr; on(type: "progress", listener: (request: XMLHttpRequest) => void): DsvXhr; - on(type: "load", listener: (response: T) => void): DsvXhr; + on(type: "load", listener: (response: T[]) => void): DsvXhr; on(type: "error", listener: (err: any) => void): DsvXhr; on(type: string, listener: (...args: any[]) => void): DsvXhr; } diff --git a/devextreme/devextreme-15.1.7.d.ts b/devextreme/devextreme-15.1.7.d.ts new file mode 100644 index 000000000..fc593db20 --- /dev/null +++ b/devextreme/devextreme-15.1.7.d.ts @@ -0,0 +1,6572 @@ +// Type definitions for DevExtreme 15.1.7 +// Project: http://js.devexpress.com/ +// Definitions by: DevExpress Inc. +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module DevExpress { + /** A mixin that provides a capability to fire and subscribe to events. */ + export interface EventsMixin { + /** Subscribes to a specified event. */ + on(eventName: string, eventHandler: Function): T; + /** Subscribes to the specified events. */ + on(events: { [eventName: string]: Function; }): T; + /** Detaches all event handlers from the specified event. */ + off(eventName: string): Object; + /** Detaches a particular event handler from the specified event. */ + off(eventName: string, eventHandler: Function): T; + } + /** An object that serves as a namespace for the methods required to perform validation. */ + export module validationEngine { + export interface IValidator { + validate(): ValidatorValidationResult; + reset(): void; + } + export interface ValidatorValidationResult { + isValid: boolean; + name?: string; + value: any; + brokenRule: any; + validationRules: any[]; + } + export interface ValidationGroupValidationResult { + isValid: boolean; + brokenRules: any[]; + validators: IValidator[]; + } + export interface GroupConfig extends EventsMixin { + group: any; + validators: IValidator[]; + validate(): ValidationGroupValidationResult; + reset(): void; + } + /** Provides access to the object that represents the specified validation group. */ + export function getGroupConfig(group: any): GroupConfig + /** Provides access to the object that represents the default validation group. */ + export function getGroupConfig(): GroupConfig + /** Validates rules of the validators that belong to the specified validation group. */ + export function validateGroup(group: any): ValidationGroupValidationResult; + /** Validates rules of the validators that belong to the default validation group. */ + export function validateGroup(): ValidationGroupValidationResult; + /** Resets the values and validation result of the editors that belong to the specified validation group. */ + export function resetGroup(group: any): void; + /** Resets the values and validation result of the editors that belong to the default validation group. */ + export function resetGroup(): void; + /** Validates the rules that are defined within the dxValidator objects that are registered for the specified ViewModel. */ + export function validateModel(model: Object): ValidationGroupValidationResult; + /** Registers all the dxValidator objects by which the fields of the specified ViewModel are extended. */ + export function registerModelForValidation(model: Object): void; + } + export var hardwareBackButton: JQueryCallback; + /** Processes the hardware back button click. */ + export function processHardwareBackButton(): void; + /** Hides the last displayed overlay widget. */ + export function hideTopOverlay(): boolean; + /** Specifies whether or not the entire application/site supports right-to-left representation. */ + export var rtlEnabled: boolean; + /** Registers a new component in the DevExpress.ui namespace as a jQuery plugin, Angular directive and Knockout binding. */ + export function registerComponent(name: string, componentClass: Object): void; + /** Registers a new component in the specified namespace as a jQuery plugin, Angular directive and Knockout binding. */ + export function registerComponent(name: string, namespace: Object, componentClass: Object): void; + /** Requests that the browser call a specified function to update animation before the next repaint. */ + export function requestAnimationFrame(callback: Function): number; + /** Cancels an animation frame request scheduled with the requestAnimationFrame method. */ + export function cancelAnimationFrame(requestID: number): void; + /** Custom Knockout binding that links an HTML element with a specific action. */ + export class Action { } + /** Used to get URLs that vary in a locally running application and the application running on production. */ + export class EndpointSelector { + constructor(options: { + [key: string]: { + local?: string; + production?: string; + } + }); + /** Returns a local or a productional URL depending on how the application is currently running. */ + urlFor(key: string): string; + } + /** An object that serves as a namespace for the methods that are used to animate UI elements. */ + export module fx { + /** Defines animation options. */ + export interface AnimationOptions { + /** A function called after animation is completed. */ + complete?: (element: JQuery, config: AnimationOptions) => void; + /** A number specifying wait time before animation execution. */ + delay?: number; + /** A number specifying the time period to wait before the animation of the next stagger item starts. */ + staggerDelay?: number; + /** A number specifying the time in milliseconds spent on animation. */ + duration?: number; + /** A string specifying the type of an easing function used for animation. */ + easing?: string; + /** Specifies the initial animation state. */ + from?: any; + /** A function called before animation is started. */ + start?: (element: JQuery, config: AnimationOptions) => void; + /** Specifies a final animation state. */ + to?: any; + /** A string value specifying the animation type. */ + type?: string; + /** Specifies the animation direction for the "slideIn" and "slideOut" animation types. */ + direction?: string; + } + /** Animates the specified element. */ + export function animate(element: HTMLElement, config: AnimationOptions): Object; + /** Returns a value indicating whether the specified element is being animated. */ + export function isAnimating(element: HTMLElement): boolean; + /** Stops the animation. */ + export function stop(element: HTMLElement, jumpToEnd: boolean): void; + } + /** The manager that performs several specified animations at a time. */ + export class TransitionExecutor { + /** Deletes all the animations registered in the Transition Executor by using the enter(elements, animation) and leave(elements, animation) methods. */ + reset(): void; + /** Registers a set of elements that should be animated as "entering" using the specified animation configuration. */ + enter(elements: JQuery, animation: any): void; + /** Registers a set of elements that should be animated as "leaving" using the specified animation configuration. */ + leave(elements: JQuery, animation: any): void; + /** Starts all the animations registered using the enter(elements, animation) and leave(elements, animation) methods beforehand. */ + start(config: Object): JQueryPromise; + } + export class AnimationPresetCollection { + /** Resets all the changes made in the animation repository. */ + resetToDefaults(): void; + /** Deletes the specified animation or clears all the animation repository, if an animation name is not passed. */ + clear(name: string): void; + /** Adds the specified animation preset to the animation repository by the specified name. */ + registerPreset(name: string, config: any): void; + /** Applies the changes made in the animation repository. */ + applyChanges(): void; + /** Returns the configuration of the animation found in the animation repository by the specified name for the current device. */ + getPreset(name: string): void; + /** Registers predefined animations in the animation repository. */ + registerDefaultPresets(): void; + } + /** A repository of animations. */ + export var animationPresets: AnimationPresetCollection; + /** The device object defines the device on which the application is running. */ + export interface Device { + /** Indicates whether or not the device platform is Android. */ + android?: boolean; + /** Specifies the type of the device on which the application is running. */ + deviceType?: string; + /** Indicates whether or not the device platform is generic, which means that the application will look and behave according to a generic "light" or "dark" theme. */ + generic?: boolean; + /** Indicates whether or not the device platform is iOS. */ + ios?: boolean; + /** Indicates whether or not the device type is 'phone'. */ + phone?: boolean; + /** Specifies the platform of the device on which the application is running. */ + platform?: string; + /** Indicates whether or not the device type is 'tablet'. */ + tablet?: boolean; + /** Specifies an array with the major and minor versions of the device platform. */ + version?: Array; + /** Indicates whether or not the device platform is Windows8. */ + win8?: boolean; + /** Specifies a performance grade of the current device. */ + grade?: string; + } + export class Devices implements EventsMixin { + constructor(options: { window: Window }); + /** Overrides actual device information to force the application to operate as if it was running on the specified device. */ + current(deviceName: any): void; + /** Returns information about the current device. */ + current(): Device; + orientationChanged: JQueryCallback; + /** Returns the current device orientation. */ + orientation(): string; + /** Returns real information about the current device regardless of the value passed to the devices.current(deviceName) method. */ + real(): Device; + on(eventName: "orientationChanged", eventHandler: (e: { orientation: string }) => void): Devices; + on(eventName: string, eventHandler: Function): Devices; + on(events: { [eventName: string]: Function; }): Devices; + off(eventName: "orientationChanged"): Devices; + off(eventName: string): Devices; + off(eventName: "orientationChanged", eventHandler: (e: { orientation: string }) => void): Devices; + off(eventName: string, eventHandler: Function): Devices; + } + /** An object that serves as a namespace for the methods and events specifying information on the current device. */ + export var devices: Devices; + /** The position object specifies the widget positioning options. */ + export interface PositionOptions { + /** The target element position that the widget is positioned against. */ + at?: string; + /** The element within which the widget is positioned. */ + boundary?: Element; + /** A string value holding horizontal and vertical offset from the window's boundaries. */ + boundaryOffset?: string; + /** Specifies how to move the widget if it overflows the screen. */ + collision?: any; + /** The position of the widget to align against the target element. */ + my?: string; + /** The target element that the widget is positioned against. */ + of?: HTMLElement; + /** A string value holding horizontal and vertical offset in pixels, separated by a space (e.g., "5 -10"). */ + offset?: string; + } + export interface ComponentOptions { + /** A handler for the initialized event. */ + onInitialized?: Function; + /** A handler for the optionChanged event. */ + onOptionChanged?: Function; + /** A handler for the disposing event. */ + onDisposing?: Function; + } + /** A base class for all components and widgets. */ + export class Component { + constructor(options?: ComponentOptions) + /** Prevents the component from refreshing until the endUpdate method is called. */ + beginUpdate(): void; + /** Enables the component to refresh after the beginUpdate method call. */ + endUpdate(): void; + /** Returns an instance of this component class. */ + instance(): Component; + /** Sets one or more options of this component. */ + option(options: Object): void; + /** Returns the configuration options of this component. */ + option(): Object; + /** Gets the value of the specified configuration option of this component. */ + option(optionName: string): any; + /** Sets a value to the specified configuration option of this component. */ + option(optionName: string, optionValue: any): void; + } + export interface DOMComponentOptions extends ComponentOptions { + /** Specifies whether or not the current component supports a right-to-left representation. */ + rtlEnabled?: boolean; + /** Specifies the height of the widget. */ + height?: any; + /** Specifies the width of the widget. */ + width?: any; + } + /** A base class for all components. */ + export class DOMComponent extends Component { + constructor(element: JQuery, options?: DOMComponentOptions); + constructor(element: HTMLElement, options?: DOMComponentOptions); + /** Returns the root HTML element of the widget. */ + element(): JQuery; + /** Specifies the device-dependent default configuration options for this component. */ + static defaultOptions(rule: { + device?: any; + options?: any; + }): void; + } + export module data { + export interface ODataError extends Error { + httpStatus?: number; + errorDetails?: any; + } + export interface StoreOptions { + inserted?: (values: Object, key: any) => void; + inserting?: (values: Object) => void; + loaded?: (result: Array) => void; + loading?: (loadOptions: LoadOptions) => void; + modified?: () => void; + modifying?: () => void; + removed?: (key: any) => void; + removing?: (key: any) => void; + updated?: (key: any, values: Object) => void; + updating?: (key: any, values: Object) => void; + /** A handler for the modified event. */ + onModified?: () => void; + /** A handler for the modifying event. */ + onModifying?: () => void; + /** A handler for the removed event. */ + onRemoved?: (key: any) => void; + /** A handler for the removing event. */ + onRemoving?: (key: any) => void; + /** A handler for the updated event. */ + onUpdated?: (key: any, values: Object) => void; + /** A handler for the updating event. */ + onUpdating?: (key: any, values: Object) => void; + /** A handler for the loaded event. */ + onLoaded?: (result: Array) => void; + /** A handler for the loading event. */ + onLoading?: (loadOptions: LoadOptions) => void; + /** A handler for the inserted event. */ + onInserted?: (values: Object, key: any) => void; + /** A handler for the inserting event. */ + onInserting?: (values: Object) => void; + /** Specifies the function called when the Store causes an error. */ + errorHandler?: (e: Error) => void; + /** Specifies the key properties within the data associated with the Store. */ + key?: any; + } + export interface LoadOptions { + filter?: Object; + sort?: Object; + select?: Object; + expand?: Object; + group?: Object; + skip?: number; + take?: number; + userData?: Object; + requireTotalCount?: boolean; + } + /** The base class for all Stores. */ + export class Store implements EventsMixin { + inserted: JQueryCallback; + inserting: JQueryCallback; + loaded: JQueryCallback; + loading: JQueryCallback; + modified: JQueryCallback; + modifying: JQueryCallback; + removed: JQueryCallback; + removing: JQueryCallback; + updated: JQueryCallback; + updating: JQueryCallback; + constructor(options?: StoreOptions); + /** Returns the data item specified by the key. */ + byKey(key: any): JQueryPromise; + /** Adds an item to the data associated with this Store. */ + insert(values: Object): JQueryPromise; + /** Returns the key expression specified via the key configuration option. */ + key(): any; + /** Returns the key of the Store item that matches the specified object. */ + keyOf(obj: Object): any; + /** Starts loading data. */ + load(obj?: LoadOptions): JQueryPromise; + /** Removes the data item specified by the key. */ + remove(key: any): JQueryPromise; + /** Obtains the total count of items that will be returned by the load() function. */ + totalCount(options?: { + filter?: Object; + group?: Object; + }): JQueryPromise; + /** Updates the data item specified by the key. */ + update(key: any, values: Object): JQueryPromise; + on(eventName: "removing", eventHandler: (key: any) => void): Store; + on(eventName: "removed", eventHandler: (key: any) => void): Store; + on(eventName: "updating", eventHandler: (key: any, values: Object) => void): Store; + on(eventName: "updated", eventHandler: (key: any, values: Object) => void): Store; + on(eventName: "inserting", eventHandler: (values: Object) => void): Store; + on(eventName: "inserted", eventHandler: (values: Object, key: any) => void): Store; + on(eventName: "modifying", eventHandler: () => void): Store; + on(eventName: "modified", eventHandler: () => void): Store; + on(eventName: "loading", eventHandler: (loadOptions: LoadOptions) => void): Store; + on(eventName: "loaded", eventHandler: (result: Array) => void): Store; + on(eventName: string, eventHandler: Function): Store; + on(events: { [eventName: string]: Function; }): Store; + off(eventName: "removing"): Store; + off(eventName: "removed"): Store; + off(eventName: "updating"): Store; + off(eventName: "updated"): Store; + off(eventName: "inserting"): Store; + off(eventName: "inserted"): Store; + off(eventName: "modifying"): Store; + off(eventName: "modified"): Store; + off(eventName: "loading"): Store; + off(eventName: "loaded"): Store; + off(eventName: string): Store; + off(eventName: "removing", eventHandler: (key: any) => void): Store; + off(eventName: "removed", eventHandler: (key: any) => void): Store; + off(eventName: "updating", eventHandler: (key: any, values: Object) => void): Store; + off(eventName: "updated", eventHandler: (key: any, values: Object) => void): Store; + off(eventName: "inserting", eventHandler: (values: Object) => void): Store; + off(eventName: "inserted", eventHandler: (values: Object, key: any) => void): Store; + off(eventName: "modifying", eventHandler: () => void): Store; + off(eventName: "modified", eventHandler: () => void): Store; + off(eventName: "loading", eventHandler: (loadOptions: LoadOptions) => void): Store; + off(eventName: "loaded", eventHandler: (result: Array) => void): Store; + off(eventName: string, eventHandler: Function): Store; + } + export interface ArrayStoreOptions extends StoreOptions { + /** Specifies the array associated with this Store. */ + data?: Array; + } + /** A Store accessing an in-memory array. */ + export class ArrayStore extends Store { + constructor(options?: ArrayStoreOptions); + /** Clears all data associated with the current ArrayStore. */ + clear(): void; + /** Creates the Query object for the underlying array. */ + createQuery(): Query; + } + interface Promise { + then(doneFn?: Function, failFn?: Function, progressFn?: Function): Promise; + } + export interface CustomStoreOptions extends StoreOptions { + /** The user implementation of the byKey(key, extraOptions) method. */ + byKey?: (key: any) => Promise; + /** The user implementation of the insert(values) method. */ + insert?: (values: Object) => Promise; + /** The user implementation of the load(options) method. */ + load?: (options?: LoadOptions) => Promise; + /** The user implementation of the remove(key) method. */ + remove?: (key: any) => Promise; + /** The user implementation of the totalCount(options) method. */ + totalCount?: (options?: { + filter?: Object; + group?: Object; + }) => Promise; + /** The user implementation of the update(key, values) method. */ + update?: (key: any, values: Object) => Promise; + } + /** A Store object that enables you to implement your own data access logic. */ + export class CustomStore extends Store { + constructor(options: CustomStoreOptions); + } + export interface DataSourceOptions { + /** Specifies data filtering conditions. */ + filter?: Object; + /** Specifies data grouping conditions. */ + group?: Object; + /** The item mapping function. */ + map?: (record: any) => any; + /** Specifies the maximum number of items the page can contain. */ + pageSize?: number; + /** Specifies whether a DataSource loads data by pages, or all items at once. */ + paginate?: boolean; + /** The data post processing function. */ + postProcess?: (data: any[]) => any[]; + /** Specifies a value by which the required items are searched. */ + searchExpr?: Object; + /** Specifies the comparison operation used to search for the required items. */ + searchOperation?: string; + /** Specifies the value to which the search expression is compared. */ + searchValue?: Object; + /** Specifies the initial select option value. */ + select?: Object; + /** An array of the strings that represent the names of the navigation properties to be loaded simultaneously with the OData store's entity. */ + expand?: Object; + /** Specifies whether or not the DataSource instance requests the total count of items available in the storage. */ + requireTotalCount?: boolean; + /** Specifies the initial sort option value. */ + sort?: Object; + /** Specifies the underlying Store instance used to access data. */ + store?: any; + /** A handler for the changed event. */ + onChanged?: () => void; + /** A handler for the loadingChanged event. */ + onLoadingChanged?: (isLoading: boolean) => void; + /** A handler for the loadError event. */ + onLoadError?: (e?: Error) => void; + } + /** An object that provides access to a data web service or local data storage for collection container widgets. */ + export class DataSource implements EventsMixin { + constructor(options?: DataSourceOptions); + changed: JQueryCallback; + loadError: JQueryCallback; + loadingChanged: JQueryCallback; + /** Disposes all resources associated with this DataSource. */ + dispose(): void; + /** Returns the current filter option value. */ + filter(): Object; + /** Sets the filter option value. */ + filter(filterExpr: Object): void; + /** Returns the current group option value. */ + group(): Object; + /** Sets the group option value. */ + group(groupExpr: Object): void; + /** Indicates whether or not the current page contains fewer items than the number of items specified by the pageSize configuration option. */ + isLastPage(): boolean; + /** Indicates whether or not at least one load() method execution has successfully finished. */ + isLoaded(): boolean; + /** Indicates whether or not the DataSource is currently being loaded. */ + isLoading(): boolean; + /** Returns the array of items currently operated by the DataSource. */ + items(): Array; + /** Returns the key expression. */ + key(): any; + /** Starts loading data. */ + load(): JQueryPromise>; + /** Returns an object that would be passed to the load() method of the underlying Store according to the current data shaping option values of the current DataSource instance. */ + loadOptions(): Object; + /** Returns the current pageSize option value. */ + pageSize(): number; + /** Sets the pageSize option value. */ + pageSize(value: number): void; + /** Specifies the index of the currently loaded page. */ + pageIndex(): number; + /** Specifies the index of the page to be loaded during the next load() method execution. */ + pageIndex(newIndex: number): void; + /** Returns the current paginate option value. */ + paginate(): boolean; + /** Sets the paginate option value. */ + paginate(value: boolean): void; + /** Returns the searchExpr option value. */ + searchExpr(): Object; + /** Sets the searchExpr option value. */ + searchExpr(expr: Object): void; + /** Returns the currently specified search operation. */ + searchOperation(): string; + /** Sets the current search operation. */ + searchOperation(op: string): void; + /** Returns the searchValue option value. */ + searchValue(): Object; + /** Sets the searchValue option value. */ + searchValue(value: Object): void; + /** Returns the current select option value. */ + select(): Object; + /** Sets the select option value. */ + select(expr: Object): void; + /** Returns the current requireTotalCount option value. */ + requireTotalCount(): boolean; + /** Sets the requireTotalCount option value. */ + requireTotalCount(value: boolean): void; + /** Returns the current sort option value. */ + sort(): Object; + /** Sets the sort option value. */ + sort(sortExpr: Object): void; + /** Returns the underlying Store instance. */ + store(): Store; + /** Returns the number of data items available in an underlying Store after the last load() operation without paging. */ + totalCount(): number; + on(eventName: "loadingChanged", eventHandler: (isLoading: boolean) => void): DataSource; + on(eventName: "loadError", eventHandler: (e?: Error) => void): DataSource; + on(eventName: "changed", eventHandler: () => void): DataSource; + on(eventName: string, eventHandler: Function): DataSource; + on(events: { [eventName: string]: Function; }): DataSource; + off(eventName: "loadingChanged"): DataSource; + off(eventName: "loadError"): DataSource; + off(eventName: "changed"): DataSource; + off(eventName: string): DataSource; + off(eventName: "loadingChanged", eventHandler: (isLoading: boolean) => void): DataSource; + off(eventName: "loadError", eventHandler: (e?: Error) => void): DataSource; + off(eventName: "changed", eventHandler: () => void): DataSource; + off(eventName: string, eventHandler: Function): DataSource; + } + /** An object used to work with primitive data types not supported by JavaScript when accessing an OData web service. */ + export class EdmLiteral { + /** Creates an EdmLiteral instance and assigns the specified value to it. */ + constructor(value: string); + /** Returns a string representation of the value associated with this EdmLiteral object. */ + valueOf(): string; + } + /** An object used to generate and hold the GUID. */ + export class Guid { + /** Creates a new Guid instance that holds the specified GUID. */ + constructor(value: string); + /** Creates a new Guid instance holding the generated GUID. */ + constructor(); + /** Returns a string representation of the Guid instance. */ + toString(): string; + /** Returns a string representation of the Guid instance. */ + valueOf(): string; + } + export interface LocalStoreOptions extends ArrayStoreOptions { + /** Specifies the time (in miliseconds) after the change operation, before the data is flushed. */ + flushInterval?: number; + /** Specifies whether the data is flushed immediatelly after each change operation, or after the delay specified via the flushInterval option. */ + immediate?: boolean; + /** The unique identifier used to distinguish the data within the HTML5 Web Storage. */ + name?: string; + } + /** A Store providing access to the HTML5 Web Storage. */ + export class LocalStore extends ArrayStore { + constructor(options?: LocalStoreOptions); + /** Removes all data associated with this Store. */ + clear(): void; + } + export interface ODataContextOptions extends ODataStoreOptions { + /** Specifies the list of entities to be accessed via the ODataContext. */ + entities?: Object; + /** Specifies the function called if the ODataContext causes an error. */ + errorHandler?: (e: Error) => void; + } + /** Provides access to the entire OData service. */ + export class ODataContext { + constructor(options?: ODataContextOptions); + /** Initiates the specified WebGet service operation that returns a value. For the information on service operations, refer to the OData documentation. */ + get(operationName: string, params: Object): JQueryPromise; + /** Initiates the specified WebGet service operation that returns nothing. For the information on service operations, refer to the OData documentation. */ + invoke(operationName: string, params: Object, httpMethod: Object): JQueryPromise; + /** Return a special proxy object to describe the entity link. */ + objectLink(entityAlias: string, key: any): Object; + } + export interface ODataStoreOptions extends StoreOptions { + /** A function used to customize a web request before it is sent. */ + beforeSend?: (request: { + url: string; + method: string; + timeout: number; + params: Object; + payload: Object; + headers: Object; + }) => void; + /** Specifies whether the ODataStore uses the JSONP approach to access non-CORS-compatible remote services. */ + jsonp?: boolean; + /** Specifies the type of the ODataStore key property. The following key types are supported out of the box: String, Int32, Int64, and Guid. */ + keyType?: any; + /** Specifies the URL of the data service being accessed via the current ODataContext. */ + url?: string; + /** Specifies the version of the OData protocol used to interact with the data service. */ + version?: number; + /** Specifies the value of the withCredentials field of the underlying jqXHR object. */ + withCredentials?: boolean; + } + /** A Store providing access to a separate OData web service entity. */ + export class ODataStore extends Store { + constructor(options?: ODataStoreOptions); + /** Creates the Query object for the OData endpoint. */ + createQuery(loadOptions: Object): Object; + /** Returns the data item specified by the key. */ + byKey(key: any, extraOptions?: { expand?: Object }): JQueryPromise; + } + /** An universal chainable data query interface object. */ + export interface Query { + /** Calculates a custom summary for the items in the current Query. */ + aggregate(step: (accumulator: any, value: any) => any): JQueryPromise; + /** Calculates a custom summary for the items in the current Query. */ + aggregate(seed: any, step: (accumulator: any, value: any) => any, finalize: (result: any) => any): JQueryPromise; + /** Calculates the average item value for the current Query. */ + avg(getter: Object): JQueryPromise; + /** Finds the item with the maximum getter value. */ + max(getter: Object): JQueryPromise; + /** Finds the item with the maximum value in the Query. */ + max(): JQueryPromise; + /** Finds the item with the minimum value in the Query. */ + min(): JQueryPromise; + /** Finds the item with the minimum getter value. */ + min(getter: Object): JQueryPromise; + /** Calculates the average item value for the current Query, if each Query item has a numeric type. */ + avg(): JQueryPromise; + /** Returns the total count of items in the current Query. */ + count(): JQueryPromise; + /** Executes the Query. */ + enumerate(): JQueryPromise; + /** Filters the current Query data. */ + filter(criteria: Array): Query; + /** Groups the current Query data. */ + groupBy(getter: Object): Query; + /** Applies the specified transformation to each item. */ + select(getter: Object): Query; + /** Limits the data item count. */ + slice(skip: number, take?: number): Query; + /** Sorts current Query data. */ + sortBy(getter: Object, desc: boolean): Query; + /** Sorts current Query data. */ + sortBy(getter: Object): Query; + /** Calculates the sum of item getter values in the current Query. */ + sum(getter: Object): JQueryPromise; + /** Calculates the sum of item values in the current Query. */ + sum(): JQueryPromise; + /** Adds one more sorting condition to the current Query. */ + thenBy(getter: Object): Query; + /** Adds one more sorting condition to the current Query. */ + thenBy(getter: Object, desc: boolean): Query; + /** Returns the array of current Query items. */ + toArray(): Array; + } + /** The global data layer error handler. */ + export var errorHandler: (e: Error) => void; + /** Encodes the specified string or array of bytes to base64 encoding. */ + export function base64_encode(input: any): string; + /** Creates a Query instance. */ + export function query(array: Array): Query; + /** Creates a Query instance for accessing the remote service specified by a URL. */ + export function query(url: string, queryOptions: Object): Query; + /** This section describes the utility objects provided by the DevExtreme data layer. */ + export var utils: { + /** Compiles a getter function from the getter expression. */ + compileGetter(expr: any): Function; + /** Compiles a setter function from the setter expression. */ + compileSetter(expr: any): Function; + odata: { + /** Holds key value converters for OData. */ + keyConverters: { + String(value: any): string; + Int32(value: any): number; + Int64(value: any): EdmLiteral; + Guid(value: any): Guid; + Boolean(value: any): boolean; + Single(value: any): EdmLiteral; + Decimal(value: any): EdmLiteral; + }; + } + } + } + /** An object that serves as a namespace for DevExtreme UI widgets as well as for methods implementing UI logic in DevExtreme sites/applications. */ + export module ui { + export interface WidgetOptions extends DOMComponentOptions { + /** A Boolean value specifying whether or not the widget changes its state when interacting with a user. */ + activeStateEnabled?: boolean; + /** A Boolean value specifying whether or not the widget can respond to user interaction. */ + disabled?: boolean; + /** A Boolean value specifying whether or not the widget changes its state when being hovered by an end user. */ + hoverStateEnabled?: boolean; + /** Specifies whether or not the widget can be focused. */ + focusStateEnabled?: boolean; + /** Specifies a shortcut key that sets focus on the widget element. */ + accessKey?: string; + /** A Boolean value specifying whether or not the widget is visible. */ + visible?: boolean; + /** Specifies the widget tab index. */ + tabIndex?: number; + /** Specifies the text of the hint displayed for the widget. */ + hint?: string; + } + /** The base class for widgets. */ + export class Widget extends DOMComponent { + constructor(options?: WidgetOptions); + /** Redraws the widget. */ + repaint(): void; + /** Sets focus on the widget. */ + focus(): void; + /** Registers a handler when a specified key is pressed. */ + registerKeyHandler(key: string, handler: Function): void; + } + export interface CollectionWidgetOptions extends WidgetOptions { + /** A data source used to fetch data to be displayed by the widget. */ + dataSource?: any; + itemClickAction?: any; + itemHoldAction?: Function; + /** The time period in milliseconds before the onItemHold event is raised. */ + itemHoldTimeout?: number; + itemRender?: any; + itemRenderedAction?: Function; + /** An array of items displayed by the widget. */ + items?: Array; + /** + * A function performed when a widget item is selected. + * @deprecated onSelectionChanged.md + */ + itemSelectAction?: Function; + /** The template to be used for rendering items. */ + itemTemplate?: any; + loopItemFocus?: boolean; + /** The text or HTML markup displayed by the widget if the item collection is empty. */ + noDataText?: string; + onContentReady?: any; + contentReadyAction?: any; + /** A handler for the itemClick event. */ + onItemClick?: any; + /** A handler for the itemContextMenu event. */ + onItemContextMenu?: Function; + /** A handler for the itemHold event. */ + onItemHold?: Function; + /** A handler for the itemRendered event. */ + onItemRendered?: Function; + /** A handler for the selectionChanged event. */ + onSelectionChanged?: Function; + /** The index of the currently selected widget item. */ + selectedIndex?: number; + /** The selected item object. */ + selectedItem?: Object; + /** An array of currently selected item objects. */ + selectedItems?: Array; + /** A handler for the itemDeleting event. */ + onItemDeleting?: Function; + /** A handler for the itemDeleted event. */ + onItemDeleted?: Function; + /** A handler for the itemReordered event. */ + onItemReordered?: Function; + } + /** The base class for widgets containing an item collection. */ + export class CollectionWidget extends Widget { + constructor(element: JQuery, options?: CollectionWidgetOptions); + constructor(element: HTMLElement, options?: CollectionWidgetOptions); + selectItem(itemElement: any): void; + unselectItem(itemElement: any): void; + deleteItem(itemElement: any): JQueryPromise; + isItemSelected(itemElement: any): boolean; + reorderItem(itemElement: any, toItemElement: any): JQueryPromise; + } + export interface DataExpressionMixinOptions { + /** A data source used to fetch data to be displayed by the widget. */ + dataSource?: any; + /** Specifies the name of the data source item field whose value is displayed by the widget. */ + displayExpr?: any; + /** Specifies the name of a data source item field whose value is held in the value configuration option. */ + valueExpr?: any; + itemRender?: any; + /** An array of items displayed by the widget. */ + items?: Array; + /** The template to be used for rendering items. */ + itemTemplate?: any; + /** The currently selected value in the widget. */ + value?: Object; + } + export interface EditorOptions extends WidgetOptions { + /** The currently specified value. */ + value?: Object; + /** A handler for the valueChanged event. */ + onValueChanged?: Function; + valueChangeAction?: Function; + /** A Boolean value specifying whether or not the widget is read-only. */ + readOnly?: boolean; + /** Holds the object that defines the error that occurred during validation. */ + validationError?: Object; + /** Specifies whether the editor's value is valid. */ + isValid?: boolean; + /** Specifies how the message about the validation rules that are not satisfied by this editor's value is displayed. */ + validationMessageMode?: string; + } + /** A base class for editors. */ + export class Editor extends Widget { + /** Resets the editor's value to undefined. */ + reset(): void; + } + /** An object that serves as a namespace for methods displaying a message in an application/site. */ + export var dialog: { + /** Creates an alert dialog message containing a single "OK" button. */ + alert(message: string, title: string): JQueryPromise; + /** Creates a confirm dialog that contains "Yes" and "No" buttons. */ + confirm(message: string, title: string): JQueryPromise; + /** Creates a custom dialog using the options specified by the passed configuration object. */ + custom(options: { title?: string; message?: string; buttons?: Array; }): { + show(): JQueryPromise; + hide(): void; + hide(value: any): void; + }; + }; + /** Creates a toast message. */ + export function notify(message: any, type: string, displayTime: number): void; + /** Creates a toast message. */ + export function notify(options: Object): void; + /** An object that serves as a namespace for the methods that work with DevExtreme CSS Themes. */ + export var themes: { + /** Returns the name of the currently applied theme. */ + current(): string; + /** Changes the current theme to the specified one. */ + current(themeName: string): void; + }; + /** Sets a specified template engine. */ + export function setTemplateEngine(name: string): void; + /** Sets a custom template engine defined via custom compile and render functions. */ + export function setTemplateEngine(options: Object): void; + } + /** An object that serves as a namespace for utility methods that can be helpful when working with the DevExtreme framework and UI widgets. */ + export var utils: { + /** Sets parameters for the viewport meta tag. */ + initMobileViewport(options: { allowZoom?: boolean; allowPan?: boolean; allowSelection?: boolean }): void; + }; + /** An object that serves as a namespace for DevExtreme Data Visualization Widgets. */ + export module viz { + /** Applies a theme for the entire page with several DevExtreme visualization widgets. */ + export function currentTheme(theme: string): void; + /** Applies a new theme (with the color scheme defined separately) for the entire page with several DevExtreme visualization widgets. */ + export function currentTheme(platform: string, colorScheme: string): void; + /** Registers a new theme based on the existing one. */ + export function registerTheme(customTheme: Object, baseTheme: string): void; + /** Applies a predefined or registered custom palette to all visualization widgets at once. */ + export function currentPalette(paletteName: string): void; + /** Obtains the color sets of a predefined or registered palette. */ + export function getPalette(paletteName: string): Object; + /** Registers a new palette. */ + export function registerPalette(paletteName: string, palette: Object): void; + } +} +declare module DevExpress.ui { + export interface dxValidatorOptions extends DOMComponentOptions { + /** An array of validation rules to be checked for the editor with which the dxValidator object is associated. */ + validationRules?: Array; + /** Specifies the editor name to be used in the validation default messages. */ + name?: string; + /** An object that specifies what and when to validate and how to apply the validation result. */ + adapter?: Object; + /** Specifies the validation group the editor will be related to. */ + validationGroup?: string; + /** A handler for the validated event. */ + onValidated?: (params: validationEngine.ValidatorValidationResult) => void; + } + /** A widget that is used to validate the associated DevExtreme editors against the defined validation rules. */ + export class dxValidator extends DOMComponent implements validationEngine.IValidator { + constructor(element: JQuery, options?: dxValidatorOptions); + constructor(element: Element, options?: dxValidatorOptions); + /** Validates the value of the editor that is controlled by the current dxValidator object against the list of the specified validation rules. */ + validate(): validationEngine.ValidatorValidationResult; + /** Resets the value and validation result of the editor associated with the current dxValidator object. */ + reset(): void; + } + /** The widget that is used in the Knockout and Angular approaches to combine the editors to be validated. */ + export class dxValidationGroup extends DOMComponent { + constructor(element: JQuery); + constructor(element: Element); + /** Validates rules of the validators that belong to the current validation group. */ + validate(): validationEngine.ValidationGroupValidationResult; + /** Resets the value and validation result of the editors that are included to the current validation group. */ + reset(): void; + } + export interface dxValidationSummaryOptions extends CollectionWidgetOptions { + /** Specifies the validation group for which summary should be generated. */ + validationGroup?: string; + } + /** A widget for displaying the result of checking validation rules for editors. */ + export class dxValidationSummary extends CollectionWidget { + constructor(element: JQuery, options?: dxValidationSummaryOptions); + constructor(element: Element, options?: dxValidationSummaryOptions); + } + export interface dxResizableOptions extends DOMComponentOptions { + /** Specifies which borders of the widget element are used as a handle. */ + handles?: string; + /** Specifies the lower width boundary for resizing. */ + minWidth?: number; + /** Specifies the upper width boundary for resizing. */ + maxWidth?: number; + /** Specifies the lower height boundary for resizing. */ + minHeight?: number; + /** Specifies the upper height boundary for resizing. */ + maxHeight?: number; + /** A handler for the resizeStart event. */ + onResizeStart?: Function; + /** A handler for the resize event. */ + onResize?: Function; + /** A handler for the resizeEnd event. */ + onResizeEnd?: Function; + } + /** A widget that displays required content in a resizable element. */ + export class dxResizable extends DOMComponent { + constructor(element: JQuery, options?: dxResizableOptions); + constructor(element: Element, options?: dxResizableOptions); + } + export interface dxTooltipOptions extends dxPopoverOptions { + } + /** A tooltip widget. */ + export class dxTooltip extends dxPopover { + constructor(element: JQuery, options?: dxTooltipOptions); + constructor(element: Element, options?: dxTooltipOptions); + } + export interface dxDropDownListOptions extends dxDropDownEditorOptions, DataExpressionMixinOptions { + /** Returns the value currently displayed by the widget. */ + displayValue?: string; + /** The minimum number of characters that must be entered into the text box to begin a search. */ + minSearchLength?: number; + /** Specifies the name of a data source item field or an expression whose value is compared to the search criterion. */ + searchExpr?: Object; + /** Specifies the binary operation used to filter data. */ + searchMode?: string; + /** Specifies the time delay, in milliseconds, after the last character has been typed in, before a search is executed. */ + searchTimeout?: number; + /** A handler for the valueChanged event. */ + onValueChanged?: Function; + /** Specifies DOM event names that update a widget's value. */ + valueChangeEvent?: string; + /** Specifies whether or not the widget supports searching. */ + searchEnabled?: boolean; + /** + * Specifies whether or not the widget displays items by pages. + * @deprecated dataSource.paginate.md + */ + pagingEnabled?: boolean; + /** The text or HTML markup displayed by the widget if the item collection is empty. */ + noDataText?: string; + /** A handler for the selectionChanged event. */ + onSelectionChanged?: Function; + /** A handler for the itemClick event. */ + onItemClick?: Function; + onContentReady?: Function; + } + /** A base class for drop-down list widgets. */ + export class dxDropDownList extends dxDropDownEditor { + constructor(element: JQuery, options?: dxDropDownListOptions); + constructor(element: Element, options?: dxDropDownListOptions); + } + export interface dxToolbarOptions extends CollectionWidgetOptions { + menuItemRender?: any; + /** The template used to render menu items. */ + menuItemTemplate?: any; + /** Informs the widget about its location in a view HTML markup. */ + renderAs?: string; + } + /** A toolbar widget. */ + export class dxToolbar extends CollectionWidget { + constructor(element: JQuery, options?: dxToolbarOptions); + constructor(element: Element, options?: dxToolbarOptions); + } + export interface dxToastOptions extends dxOverlayOptions { + animation?: fx.AnimationOptions; + /** The time span in milliseconds during which the dxToast widget is visible. */ + displayTime?: number; + height?: any; + /** The dxToast message text. */ + message?: string; + position?: PositionOptions; + shading?: boolean; + /** Specifies the dxToast widget type. */ + type?: string; + width?: any; + closeOnBackButton?: boolean; + } + /** The toast message widget. */ + export class dxToast extends dxOverlay { + constructor(element: JQuery, options?: dxToastOptions); + constructor(element: Element, options?: dxToastOptions); + } + export interface dxTextEditorOptions extends EditorOptions { + /** A handler for the change event. */ + onChange?: Function; + changeAction?: Function; + /** A handler for the copy event. */ + onCopy?: Function; + copyAction?: Function; + /** A handler for the cut event. */ + onCut?: Function; + cutAction?: Function; + /** A handler for the enterKey event. */ + onEnterKey?: Function; + enterKeyAction?: Function; + /** A handler for the focusIn event. */ + onFocusIn?: Function; + focusInAction?: Function; + /** A handler for the focusOut event. */ + onFocusOut?: Function; + focusOutAction?: Function; + /** A handler for the input event. */ + onInput?: Function; + inputAction?: Function; + /** A handler for the keyDown event. */ + onKeyDown?: Function; + keyDownAction?: Function; + /** A handler for the keyPress event. */ + onKeyPress?: Function; + keyPressAction?: Function; + /** A handler for the keyUp event. */ + onKeyUp?: Function; + keyUpAction?: Function; + /** A handler for the paste event. */ + onPaste?: Function; + pasteAction?: Function; + /** The text displayed by the widget when the widget value is empty. */ + placeholder?: string; + /** Specifies whether to display the Clear button in the widget. */ + showClearButton?: boolean; + /** Specifies the current value displayed by the widget. */ + value?: any; + /** Specifies DOM event names that update a widget's value. */ + valueChangeEvent?: string; + /** Specifies whether or not the widget checks the inner text for spelling mistakes. */ + spellcheck?: boolean; + /** Specifies HTML attributes applied to the inner input element of the widget. */ + attr?: Object; + /** The read-only option that holds the text displayed by the widget input element. */ + text?: string; + /** Specifies whether or not the widget supports the focused state and keyboard navigation. */ + focusStateEnabled?: boolean; + /** A Boolean value specifying whether or not the widget changes its state when being hovered by an end user. */ + hoverStateEnabled?: boolean; + /** The editor mask that specifies the format of the entered string. */ + mask?: string; + /** Specifies a mask placeholder character. */ + maskChar?: string; + /** Specifies custom mask rules. */ + maskRules?: Object; + /** A message displayed when the entered text does not match the specified pattern. */ + maskInvalidMessage?: string; + } + /** A base class for text editing widgets. */ + export class dxTextEditor extends Editor { + constructor(element: JQuery, options?: dxTextEditorOptions); + constructor(element: Element, options?: dxTextEditorOptions); + /** Removes focus from the input element. */ + blur(): void; + /** Sets focus to the input element representing the widget. */ + focus(): void; + } + export interface dxTextBoxOptions extends dxTextEditorOptions { + /** Specifies the maximum number of characters you can enter into the textbox. */ + maxLength?: any; + /** The "mode" attribute value of the actual HTML input element representing the text box. */ + mode?: string; + } + /** A single-line text box widget. */ + export class dxTextBox extends dxTextEditor { + constructor(element: JQuery, options?: dxTextBoxOptions); + constructor(element: Element, options?: dxTextBoxOptions); + } + export interface dxTextAreaOptions extends dxTextBoxOptions { + /** Specifies whether or not the widget checks the inner text for spelling mistakes. */ + spellcheck?: boolean; + } + /** A widget used to display and edit multi-line text. */ + export class dxTextArea extends dxTextBox { + constructor(element: JQuery, options?: dxTextAreaOptions); + constructor(element: Element, options?: dxTextAreaOptions); + } + export interface dxTabsOptions extends CollectionWidgetOptions { + /** Specifies whether the widget enables an end-user to select only a single item or multiple items. */ + selectionMode?: string; + /** Specifies whether or not an end-user can scroll tabs by swiping. */ + scrollByContent?: boolean; + /** Specifies whether or not an end-user can scroll tabs. */ + scrollingEnabled?: boolean; + /** A Boolean value that specifies the availability of navigation buttons. */ + showNavButtons?: boolean; + } + /** A tab strip used to switch between pages. */ + export class dxTabs extends CollectionWidget { + constructor(element: JQuery, options?: dxTabsOptions); + constructor(element: Element, options?: dxTabsOptions); + } + export interface dxTabPanelOptions extends dxMultiViewOptions { + /** A handler for the titleClick event. */ + onTitleClick?: any; + /** A handler for the titleHold event. */ + onTitleHold?: Function; + /** A handler for the titleRendered event. */ + onTitleRendered?: Function; + titleTemplate?: any; + /** The template to be used for rendering an item title. */ + itemTitleTemplate?: any; + } + /** A widget used to display a view and to switch between several views by clicking the appropriate tabs. */ + export class dxTabPanel extends dxMultiView { + constructor(element: JQuery, options?: dxTabPanelOptions); + constructor(element: Element, options?: dxTabPanelOptions); + } + export interface dxSelectBoxOptions extends dxDropDownListOptions { + /** The template to be used for rendering the widget text field. */ + fieldTemplate?: any; + /** The text that is provided as a hint in the select box editor. */ + placeholder?: string; + /** Specifies whether or not the widget allows an end-user to enter a custom value. */ + fieldEditEnabled?: boolean; + } + /** A widget that allows you to select an item in a dropdown list. */ + export class dxSelectBox extends dxDropDownList { + constructor(element: JQuery, options?: dxSelectBoxOptions); + constructor(element: Element, options?: dxSelectBoxOptions); + } + export interface dxTagBoxOptions extends dxSelectBoxOptions { + /** Holds the list of selected values. */ + values?: Array; + } + /** A widget that allows you to select multiple items from a dropdown list. */ + export class dxTagBox extends dxSelectBox { + constructor(element: JQuery, options?: dxTagBoxOptions); + constructor(element: Element, options?: dxTagBoxOptions); + } + export interface dxScrollViewOptions extends dxScrollableOptions { + /** A handler for the pullDown event. */ + onPullDown?: Function; + pullDownAction?: Function; + /** Specifies the text shown in the pullDown panel when pulling the content down lowers the refresh threshold. */ + pulledDownText?: string; + /** Specifies the text shown in the pullDown panel while pulling the content down to the refresh threshold. */ + pullingDownText?: string; + /** A handler for the reachBottom event. */ + onReachBottom?: Function; + reachBottomAction?: Function; + /** Specifies the text shown in the pullDown panel displayed when content is scrolled to the bottom. */ + reachBottomText?: string; + /** Specifies the text shown in the pullDown panel displayed when the content is being refreshed. */ + refreshingText?: string; + /** Returns a value indicating if the scrollView content is larger then the widget container. */ + isFull(): boolean; + /** Locks the widget until the release(preventScrollBottom) method is called and executes the function passed to the onPullDown option and the handler assigned to the pullDown event. */ + refresh(): void; + /** Notifies the scroll view that data loading is finished. */ + release(preventScrollBottom: boolean): JQueryPromise; + /** Toggles the loading state of the widget. */ + toggleLoading(showOrHide: boolean): void; + } + /** A widget used to display scrollable content. */ + export class dxScrollView extends dxScrollable { + constructor(element: JQuery, options?: dxScrollViewOptions); + constructor(element: Element, options?: dxScrollViewOptions); + } + export interface dxScrollableLocation { + top?: number; + left?: number; + } + export interface dxScrollableOptions extends DOMComponentOptions { + /** A string value specifying the available scrolling directions. */ + direction?: string; + /** A Boolean value specifying whether or not the widget can respond to user interaction. */ + disabled?: boolean; + /** A handler for the scroll event. */ + onScroll?: Function; + scrollAction?: Function; + /** Specifies when the widget shows the scrollbar. */ + showScrollbar?: string; + /** A handler for the update event. */ + onUpdated?: Function; + updateAction?: Function; + /** Indicates whether to use native or simulated scrolling. */ + useNative?: boolean; + /** A Boolean value specifying whether to enable or disable the bounce-back effect. */ + bounceEnabled?: boolean; + /** A Boolean value specifying whether or not an end-user can scroll the widget content swiping it up or down. */ + scrollByContent?: boolean; + /** A Boolean value specifying whether or not an end-user can scroll the widget content using the scrollbar. */ + scrollByThumb?: boolean; + } + /** A widget used to display scrollable content. */ + export class dxScrollable extends DOMComponent { + constructor(element: JQuery, options?: dxScrollableOptions); + constructor(element: Element, options?: dxScrollableOptions); + /** Returns the height of the scrollable widget in pixels. */ + clientHeight(): number; + /** Returns the width of the scrollable widget in pixels. */ + clientWidth(): number; + /** Returns an HTML element of the widget. */ + content(): JQuery; + /** Scrolls the widget content by the specified number of pixels. */ + scrollBy(distance: number): void; + /** Scrolls widget content by the specified number of pixels in horizontal and vertical directions. */ + scrollBy(distanceObject: dxScrollableLocation): void; + /** Returns the height of the scrollable content in pixels. */ + scrollHeight(): number; + /** Returns the current scroll position against the leftmost position. */ + scrollLeft(): number; + /** Returns how far the scrollable content is scrolled from the top and from the left. */ + scrollOffset(): dxScrollableLocation; + /** Scrolls widget content to the specified position. */ + scrollTo(targetLocation: number): void; + /** Scrolls widget content to a specified position. */ + scrollTo(targetLocation: dxScrollableLocation): void; + /** Scrolls widget content to the specified element. */ + scrollToElement(element: Element): void; + /** Returns the current scroll position against the topmost position. */ + scrollTop(): number; + /** Returns the width of the scrollable content in pixels. */ + scrollWidth(): number; + /** Updates the dimensions of the scrollable contents. */ + update(): void; + } + export interface dxRadioGroupOptions extends CollectionWidgetOptions, DataExpressionMixinOptions { + /** Specifies the radio group layout. */ + layout?: string; + } + /** A widget that enables a user to select one item within a list of items represented by radio buttons. */ + export class dxRadioGroup extends CollectionWidget { + constructor(element: JQuery, options?: dxRadioGroupOptions); + constructor(element: Element, options?: dxRadioGroupOptions); + } + export interface dxPopupOptions extends dxOverlayOptions { + animation?: fx.AnimationOptions; + /** Specifies whether or not to allow a user to drag the popup window. */ + dragEnabled?: boolean; + /** A Boolean value specifying whether or not to display the widget in full-screen mode. */ + fullScreen?: boolean; + position?: PositionOptions; + /** A Boolean value specifying whether or not to display the title in the popup window. */ + showTitle?: boolean; + /** The title in the overlay window. */ + title?: string; + /** A template to be used for rendering the widget title. */ + titleTemplate?: any; + width?: any; + /** Specifies items displayed on the top or bottom toolbar of the popup window. */ + buttons?: Array; + /** Specifies whether or not the widget displays the Close button. */ + showCloseButton?: boolean; + /** A handler for the titleRendered event. */ + onTitleRendered?: Function; + } + /** A widget that displays required content in a popup window. */ + export class dxPopup extends dxOverlay { + constructor(element: JQuery, options?: dxPopupOptions); + constructor(element: Element, options?: dxPopupOptions); + } + export interface dxPopoverOptions extends dxPopupOptions { + /** An object defining animation options of the widget. */ + animation?: fx.AnimationOptions; + /** Specifies the height of the widget. */ + height?: any; + /** An object defining widget positioning options. */ + position?: PositionOptions; + shading?: boolean; + /** A Boolean value specifying whether or not to display the title in the overlay window. */ + showTitle?: boolean; + /** The target element associated with a popover. */ + target?: any; + /** Specifies the width of the widget. */ + width?: any; + } + /** A widget that displays the required content in a popup window. */ + export class dxPopover extends dxPopup { + constructor(element: JQuery, options?: dxPopoverOptions); + constructor(element: Element, options?: dxPopoverOptions); + /** Displays the widget for the specified target element. */ + show(target?: any): JQueryPromise; + } + export interface dxOverlayOptions extends WidgetOptions { + /** An object that defines the animation options of the widget. */ + animation?: fx.AnimationOptions; + /** A Boolean value specifying whether or not the widget is closed if a user presses the Back hardware button. */ + closeOnBackButton?: boolean; + /** A Boolean value specifying whether or not the widget is closed if a user clicks outside of the overlapping window. */ + closeOnOutsideClick?: any; + /** A template to be used for rendering widget content. */ + contentTemplate?: any; + /** Specifies whether widget content is rendered when the widget is shown or when rendering the widget. */ + deferRendering?: boolean; + /** Specifies whether or not an end-user can drag the widget. */ + dragEnabled?: boolean; + /** Specifies whether or not an end user can resize the widget. */ + resizeEnabled?: boolean; + /** The height of the widget in pixels. */ + height?: any; + /** A handler for the hidden event. */ + onHidden?: Function; + hiddenAction?: Function; + /** A handler for the hiding event. */ + onHiding?: Function; + hidingAction?: Function; + /** An object defining widget positioning options. */ + position?: PositionOptions; + /** A Boolean value specifying whether or not the main screen is inactive while the widget is active. */ + shading?: boolean; + /** Specifies the shading color. */ + shadingColor?: string; + /** A handler for the showing event. */ + onShowing?: Function; + showingAction?: Function; + /** A handler for the shown event. */ + onShown?: Function; + shownAction?: Function; + /** A Boolean value specifying whether or not the widget is visible. */ + visible?: boolean; + /** The widget width in pixels. */ + width?: any; + } + /** A widget displaying the required content in an overlay window. */ + export class dxOverlay extends Widget { + constructor(element: JQuery, options?: dxOverlayOptions); + constructor(element: Element, options?: dxOverlayOptions); + /** An HTML element of the widget. */ + content(): JQuery; + /** Hides the widget. */ + hide(): JQueryPromise; + /** Recalculates the overlay's size and position. */ + repaint(): void; + /** Shows the widget. */ + show(): JQueryPromise; + /** Toggles the visibility of the widget. */ + toggle(showing: boolean): JQueryPromise; + /** A static method that specifies the base z-index for all overlay widgets. */ + static baseZIndex(zIndex: number): void; + } + export interface dxNumberBoxOptions extends dxTextEditorOptions { + /** The maximum value accepted by the number box. */ + max?: number; + /** The minimum value accepted by the number box. */ + min?: number; + /** Specifies whether or not to show spin buttons. */ + showSpinButtons?: boolean; + useTouchSpinButtons?: boolean; + /** Specifies by which value the widget value changes when a spin button is clicked. */ + step?: number; + /** The current number box value. */ + value?: number; + } + /** A textbox widget that enables a user to enter numeric values. */ + export class dxNumberBox extends dxTextEditor { + constructor(element: JQuery, options?: dxNumberBoxOptions); + constructor(element: Element, options?: dxNumberBoxOptions); + } + export interface dxNavBarOptions extends dxTabsOptions { + scrollingEnabled?: boolean; + } + /** A widget that contains items used to navigate through application views. */ + export class dxNavBar extends dxTabs { + constructor(element: JQuery, options?: dxNavBarOptions); + constructor(element: Element, options?: dxNavBarOptions); + } + export interface dxMultiViewOptions extends CollectionWidgetOptions { + /** Specifies whether or not to animate the displayed item change. */ + animationEnabled?: boolean; + /** A Boolean value specifying whether or not to scroll back to the first item after the last item is swiped. */ + loop?: boolean; + /** The index of the currently displayed item. */ + selectedIndex?: number; + /** A Boolean value specifying whether or not to allow users to change the selected index by swiping. */ + swipeEnabled?: boolean; + /** Specifies whether widget content is rendered when the widget is shown or when rendering the widget. */ + deferRendering?: boolean; + } + /** A widget used to display a view and to switch between several views. */ + export class dxMultiView extends CollectionWidget { + constructor(element: JQuery, options?: dxMultiViewOptions); + constructor(element: Element, options?: dxMultiViewOptions); + } + export interface dxMapOptions extends WidgetOptions { + /** Specifies whether or not the widget automatically adjusts center and zoom option values when adding a new marker or route. */ + autoAdjust?: boolean; + /** An object, a string, or an array specifying the location displayed at the center of the widget. */ + center?: { + /** The latitude location displayed in the center of the widget. */ + lat?: number; + /** The longitude location displayed in the center of the widget. */ + lng?: number; + }; + /** A handler for the click event. */ + onClick?: any; + clickAction?: any; + /** Specifies whether or not map widget controls are available. */ + controls?: boolean; + /** Specifies the height of the widget. */ + height?: number; + /** A key used to authenticate the application within the required map provider. */ + key?: { + /** A key used to authenticate the application within the "Bing" map provider. */ + bing?: string; + /** A key used to authenticate the application within the "Google" map provider. */ + google?: string; + /** A key used to authenticate the application within the "Google Static" map provider. */ + googleStatic?: string; + } + /** A handler for the markerAdded event. */ + onMarkerAdded?: Function; + markerAddedAction?: Function; + /** A URL pointing to the custom icon to be used for map markers. */ + markerIconSrc?: string; + /** A handler for the markerRemoved event. */ + onMarkerRemoved?: Function; + markerRemovedAction?: Function; + /** An array of markers displayed on a map. */ + markers?: Array; + /** The name of the current map data provider. */ + provider?: string; + /** A handler for the ready event. */ + onReady?: Function; + readyAction?: Function; + /** A handler for the routeAdded event. */ + onRouteAdded?: Function; + routeAddedAction?: Function; + /** A handler for the routeRemoved event. */ + onRouteRemoved?: Function; + routeRemovedAction?: Function; + /** An array of routes shown on the map. */ + routes?: Array; + /** The type of a map to display. */ + type?: string; + /** Specifies the width of the widget. */ + width?: number; + /** The zoom level of the map. */ + zoom?: number; + } + /** An interactive map widget. */ + export class dxMap extends Widget { + constructor(element: JQuery, options?: dxMapOptions); + constructor(element: Element, options?: dxMapOptions); + /** Adds a marker to the map. */ + addMarker(markerOptions: Object): JQueryPromise; + /** Adds a route to the map. */ + addRoute(options: Object): JQueryPromise; + /** Removes a marker from the map. */ + removeMarker(marker: Object): JQueryPromise; + /** Removes a route from the map. */ + removeRoute(route: any): JQueryPromise; + } + export interface dxLookupOptions extends dxDropDownListOptions { + /** An object defining widget animation options. */ + animation?: fx.AnimationOptions; + /** The text displayed on the Cancel button. */ + cancelButtonText?: string; + /** The text displayed on the Clear button. */ + clearButtonText?: string; + /** Specifies whether or not the widget cleans the search box when the popup window is displayed. */ + cleanSearchOnOpening?: boolean; + /** A Boolean value specifying whether or not the widget is closed if a user clicks outside of the overlaying window. */ + closeOnOutsideClick?: any; + /** The text displayed on the Apply button. */ + applyButtonText?: string; + /** A Boolean value specifying whether or not to display the lookup in full-screen mode. */ + fullScreen?: boolean; + focusStateEnabled?: boolean; + /** A Boolean value specifying whether or not to group widget items. */ + grouped?: boolean; + groupRender?: any; + /** The name of the template used to display a group header. */ + groupTemplate?: any; + /** The text displayed on the button used to load the next page from the data source. */ + nextButtonText?: string; + /** A handler for the pageLoading event. */ + onPageLoading?: Function; + /** Specifies whether the next page is loaded when a user scrolls the widget to the bottom or when the "next" button is clicked. */ + pageLoadMode?: string; + pageLoadingAction?: Function; + /** Specifies the text shown in the pullDown panel, which is displayed when the widget is scrolled to the bottom. */ + pageLoadingText?: string; + /** The text displayed by the widget when nothing is selected. */ + placeholder?: string; + /** The height of the widget popup element. */ + popupHeight?: any; + /** The width of the widget popup element. */ + popupWidth?: any; + /** An object defining widget positioning options. */ + position?: PositionOptions; + /** Specifies the text displayed in the pullDown panel when the widget is pulled below the refresh threshold. */ + pulledDownText?: string; + /** Specifies the text shown in the pullDown panel while the list is being pulled down to the refresh threshold. */ + pullingDownText?: string; + /** A handler for the pullRefresh event. */ + onPullRefresh?: Function; + pullRefreshAction?: Function; + /** A Boolean value specifying whether or not the widget supports the "pull down to refresh" gesture. */ + pullRefreshEnabled?: boolean; + /** Specifies the text displayed in the pullDown panel while the widget is being refreshed. */ + refreshingText?: string; + /** A handler for the scroll event. */ + onScroll?: Function; + scrollAction?: Function; + /** A Boolean value specifying whether or not the search bar is visible. */ + searchEnabled?: boolean; + /** The text that is provided as a hint in the lookup's search bar. */ + searchPlaceholder?: string; + /** A Boolean value specifying whether or not the main screen is inactive while the lookup is active. */ + shading?: boolean; + /** Specifies whether to display the Cancel button in the lookup window. */ + showCancelButton?: boolean; + /** + * A Boolean value specifying whether the widget loads the next page automatically when you reach the bottom of the list or when a button is clicked. + * @deprecated pageLoadMode.md + */ + showNextButton?: boolean; + /** The title of the lookup window. */ + title?: string; + /** A template to be used for rendering the widget title. */ + titleTemplate?: any; + /** Specifies whether or not the widget uses native scrolling. */ + useNativeScrolling?: boolean; + /** Specifies whether or not to show lookup contents in a dxPopover widget. */ + usePopover?: boolean; + /** A handler for the valueChanged event. */ + onValueChanged?: Function; + contentReadyAction?: Function; + titleRender?: any; + /** A handler for the titleRendered event. */ + onTitleRendered?: Function; + /** A Boolean value specifying whether or not to display the title in the popup window. */ + showPopupTitle?: boolean; + } + /** A widget that allows a user to select predefined values from a lookup window. */ + export class dxLookup extends dxDropDownList { + constructor(element: JQuery, options?: dxLookupOptions); + constructor(element: Element, options?: dxLookupOptions); + /** This section lists the data source fields that are used in a default template for lookup drop-down items. */ + } + export interface dxLoadPanelOptions extends dxOverlayOptions { + /** An object defining the animation options of the widget. */ + animation?: fx.AnimationOptions; + /** The delay in milliseconds after which the load panel is displayed. */ + delay?: number; + /** The height of the widget. */ + height?: number; + /** A URL pointing to an image to be used as a load indicator. */ + indicatorSrc?: string; + /** The text displayed in the load panel. */ + message?: string; + /** A Boolean value specifying whether or not to show a load indicator. */ + showIndicator?: boolean; + /** A Boolean value specifying whether or not to show the pane behind the load indicator. */ + showPane?: boolean; + /** The width of the widget. */ + width?: number; + } + /** A widget used to indicate whether or not an element is loading. */ + export class dxLoadPanel extends dxOverlay { + constructor(element: JQuery, options?: dxLoadPanelOptions); + constructor(element: Element, options?: dxLoadPanelOptions); + } + export interface dxLoadIndicatorOptions extends WidgetOptions { + /** Specifies the path to an image used as the indicator. */ + indicatorSrc?: string; + } + /** The widget used to indicate the loading process. */ + export class dxLoadIndicator extends Widget { + constructor(element: JQuery, options?: dxLoadIndicatorOptions); + constructor(element: Element, options?: dxLoadIndicatorOptions); + } + export interface dxListOptions extends CollectionWidgetOptions { + /** A Boolean value specifying whether or not to display a grouped list. */ + grouped?: boolean; + groupRender?: any; + /** The template to be used for rendering item groups. */ + groupTemplate?: any; + onItemDeleting?: Function; + /** A handler for the itemDeleted event. */ + onItemDeleted?: Function; + /** A handler for the groupRendered event. */ + onGroupRendered?: Function; + itemDeleteAction?: Function; + /** A handler for the itemReordered event. */ + onItemReordered?: Function; + itemReorderAction?: Function; + /** A handler for the itemClick event. */ + onItemClick?: any; + /** A handler for the itemSwipe event. */ + onItemSwipe?: Function; + itemSwipeAction?: Function; + /** The text displayed on the button used to load the next page from the data source. */ + nextButtonText?: string; + /** A handler for the pageLoading event. */ + onPageLoading?: Function; + pageLoadingAction?: Function; + /** Specifies the text shown in the pullDown panel, which is displayed when the list is scrolled to the bottom. */ + pageLoadingText?: string; + /** Specifies the text displayed in the pullDown panel when the list is pulled below the refresh threshold. */ + pulledDownText?: string; + /** Specifies the text shown in the pullDown panel while the list is being pulled down to the refresh threshold. */ + pullingDownText?: string; + /** A handler for the pullRefresh event. */ + onPullRefresh?: Function; + pullRefreshAction?: Function; + /** A Boolean value specifying whether or not the widget supports the "pull down to refresh" gesture. */ + pullRefreshEnabled?: boolean; + /** Specifies the text displayed in the pullDown panel while the list is being refreshed. */ + refreshingText?: string; + /** A handler for the scroll event. */ + onScroll?: Function; + scrollAction?: Function; + /** A Boolean value specifying whether to enable or disable list scrolling. */ + scrollingEnabled?: boolean; + /** Specifies when the widget shows the scrollbar. */ + showScrollbar?: string; + /** Specifies whether or not the widget uses native scrolling. */ + useNativeScrolling?: boolean; + /** A Boolean value specifying whether to enable or disable the bounce-back effect. */ + bounceEnabled?: boolean; + /** A Boolean value specifying if the list is scrolled by content. */ + scrollByContent?: boolean; + /** A Boolean value specifying if the list is scrolled using the scrollbar. */ + scrollByThumb?: boolean; + itemUnselectAction?: Function; + onItemContextMenu?: Function; + onItemHold?: Function; + /** Specifies whether or not an end-user can collapse groups. */ + collapsibleGroups?: boolean; + /** Specifies whether the next page is loaded when a user scrolls the widget to the bottom or when the "next" button is clicked. */ + pageLoadMode?: string; + /** Specifies whether or not to display controls used to select list items. */ + showSelectionControls?: boolean; + /** Specifies item selection mode. */ + selectionMode?: string; + selectAllText?: string; + /** Specifies the array of items for a context menu called for a list item. */ + menuItems?: Array; + /** Specifies whether an item context menu is shown when a user holds or swipes an item. */ + menuMode?: string; + /** Specifies whether or not an end user can delete list items. */ + allowItemDeleting?: boolean; + /** Specifies the way a user can delete items from the list. */ + itemDeleteMode?: string; + /** Specifies whether or not an end user can reorder list items. */ + allowItemReordering?: boolean; + /** Specifies whether or not to show the loading panel when the DataSource bound to the widget is loading data. */ + indicateLoading?: boolean; + activeStateEnabled?: boolean; + } + /** A list widget. */ + export class dxList extends CollectionWidget { + constructor(element: JQuery, options?: dxListOptions); + constructor(element: Element, options?: dxListOptions); + /** Returns the height of the widget in pixels. */ + clientHeight(): number; + /** Removes the specified item from the list. */ + deleteItem(itemIndex: any): JQueryPromise; + /** Removes the specified item from the list. */ + deleteItem(itemElement: Element): JQueryPromise; + /** Returns a Boolean value that indicates whether or not the specified item is selected. */ + isItemSelected(itemIndex: any): boolean; + /** Returns a Boolean value that indicates whether or not the specified item is selected. */ + isItemSelected(itemElement: Element): boolean; + /** Reloads list data. */ + reload(): void; + /** Moves the specified item to the specified position in the list. */ + reorderItem(itemElement: Element, toItemElement: Element): JQueryPromise; + /** Moves the specified item to the specified position in the list. */ + reorderItem(itemIndex: any, toItemIndex: any): JQueryPromise; + /** Scrolls the list content by the specified number of pixels. */ + scrollBy(distance: number): void; + /** Returns the height of the list content in pixels. */ + scrollHeight(): number; + /** Scrolls list content to the specified position. */ + scrollTo(location: number): void; + /** Scrolls the list to the specified item. */ + scrollToItem(itemElement: Element): void; + /** Scrolls the list to the specified item. */ + scrollToItem(itemIndex: any): void; + /** Returns how far the list content is scrolled from the top. */ + scrollTop(): number; + /** Selects the specified item from the list. */ + selectItem(itemElement: Element): void; + /** Selects the specified item from the list. */ + selectItem(itemIndex: any): void; + /** Deselects the specified item from the list. */ + unselectItem(itemElement: Element): void; + /** Unselects the specified item from the list. */ + unselectItem(itemIndex: any): void; + /** Updates the widget scrollbar according to widget content size. */ + updateDimensions(): JQueryPromise; + /** Expands the specified group. */ + expandGroup(groupIndex: number): JQueryPromise; + /** Collapses the specified group. */ + collapseGroup(groupIndex: number): JQueryPromise; + } + export interface dxGalleryOptions extends CollectionWidgetOptions { + /** The time, in milliseconds, spent on slide animation. */ + animationDuration?: number; + /** Specifies whether or not to animate the displayed item change. */ + animationEnabled?: boolean; + /** A Boolean value specifying whether or not to allow users to switch between items by clicking an indicator. */ + indicatorEnabled?: boolean; + /** A Boolean value specifying whether or not to scroll back to the first item after the last item is swiped. */ + loop?: boolean; + /** The index of the currently active gallery item. */ + selectedIndex?: number; + /** A Boolean value specifying whether or not to display an indicator that points to the selected gallery item. */ + showIndicator?: boolean; + /** A Boolean value that specifies the availability of the "Forward" and "Back" navigation buttons. */ + showNavButtons?: boolean; + /** The time interval in milliseconds, after which the gallery switches to the next item. */ + slideshowDelay?: number; + /** A Boolean value specifying whether or not to allow users to switch between items by swiping. */ + swipeEnabled?: boolean; + /** Specifies whether or not to display parts of previous and next images along the sides of the current image. */ + wrapAround?: boolean; + /** Specifies if the widget stretches images to fit the total gallery width. */ + stretchImages?: boolean; + /** Specifies the width of an area used to display a single image. */ + initialItemWidth?: number; + } + /** An image gallery widget. */ + export class dxGallery extends CollectionWidget { + constructor(element: JQuery, options?: dxGalleryOptions); + constructor(element: Element, options?: dxGalleryOptions); + /** Shows the specified gallery item. */ + goToItem(itemIndex: number, animation: boolean): JQueryPromise; + /** Shows the next gallery item. */ + nextItem(animation: boolean): JQueryPromise; + /** Shows the previous gallery item. */ + prevItem(animation: boolean): JQueryPromise; + } + export interface dxDropDownEditorOptions extends dxTextBoxOptions { + /** Specifies the current value displayed by the widget. */ + value?: Object; + /** A handler for the closed event. */ + onClosed?: Function; + /** A handler for the opened event. */ + onOpened?: Function; + /** Specifies whether or not the drop-down editor is displayed. */ + opened?: boolean; + closeAction?: Function; + openAction?: Function; + shownAction?: Function; + hiddenAction?: Function; + /** Specifies whether or not the widget allows an end-user to enter a custom value. */ + fieldEditEnabled?: boolean; + editEnabled?: boolean; + /** Specifies the way an end-user applies the selected value. */ + applyValueMode?: string; + /** Specifies whether widget content is rendered when the widget is shown or when rendering the widget. */ + deferRendering?: boolean; + } + /** A drop-down editor widget. */ + export class dxDropDownEditor extends dxTextBox { + constructor(element: JQuery, options?: dxDropDownEditorOptions); + constructor(element: Element, options?: dxDropDownEditorOptions); + /** Closes the drop-down editor. */ + close(): void; + /** Opens the drop-down editor. */ + open(): void; + /** Resets the widget's value to null. */ + reset(): void; + /** Returns an <input> element of the widget. */ + field(): JQuery; + /** Returns an HTML element of the popup window content. */ + content(): JQuery; + } + export interface dxDateBoxOptions extends dxTextEditorOptions { + /** A format used to display date/time information. */ + format?: string; + /** A Globalize format string specifying the date display format. */ + formatString?: string; + /** The last date that can be selected within the widget. */ + max?: any; + /** The minimum date that can be selected within the widget. */ + min?: any; + /** The text displayed by the widget when the widget value is not yet specified. This text is also used as a title of the date picker. */ + placeholder?: string; + /** + * Specifies whether or not a user can pick out a date using the drop-down calendar. + * @deprecated Use 'pickerType' option instead. + */ + useCalendar?: boolean; + /** An object or a value, specifying the date and time currently selected using the date box. */ + value?: any; + /** + * Specifies whether or not the widget uses the native HTML input element. + * @deprecated Use 'pickerType' option instead. + */ + useNative?: boolean; + /** Specifies the interval between neighboring values in the popup list in minutes. */ + interval?: number; + /** Specifies the maximum zoom level of a calendar, which is used to pick the date. */ + maxZoomLevel?: string; + /** Specifies the minimal zoom level of a calendar, which is used to pick the date. */ + minZoomLevel?: string; + /** Specifies the type of date/time picker. */ + pickerType?: string; + } + /** A date box widget. */ + export class dxDateBox extends dxDropDownEditor { + constructor(element: JQuery, options?: dxDateBoxOptions); + constructor(element: Element, options?: dxDateBoxOptions); + } + export interface dxCheckBoxOptions extends EditorOptions { + /** Specifies the widget state. */ + value?: boolean; + /** Specifies the text displayed by the check box. */ + text?: string; + } + /** A check box widget. */ + export class dxCheckBox extends Editor { + constructor(element: JQuery, options?: dxCheckBoxOptions); + constructor(element: Element, options?: dxCheckBoxOptions); + } + export interface dxCalendarOptions extends EditorOptions { + /** Specifies a date displayed on the current calendar page. */ + currentDate?: Date; + /** Specifies the first day of a week. */ + firstDayOfWeek?: number; + /** The latest date the widget allows to select. */ + max?: Date; + /** The earliest date the widget allows to select. */ + min?: Date; + /** Specifies whether or not the widget displays a button that selects the current date. */ + showTodayButton?: boolean; + /** Specifies the current calendar zoom level. */ + zoomLevel?: string; + /** Specifies the maximum zoom level of the calendar. */ + maxZoomLevel?: string; + /** Specifies the minimum zoom level of the calendar. */ + minZoomLevel?: string; + /** The template to be used for rendering calendar cells. */ + cellTemplate?: any; + } + /** A calendar widget. */ + export class dxCalendar extends Editor { + constructor(element: JQuery, options?: dxCalendarOptions); + constructor(element: Element, options?: dxCalendarOptions); + } + export interface dxButtonOptions extends WidgetOptions { + /** A Boolean value specifying whether or not the widget changes its state when interacting with a user. */ + activeStateEnabled?: boolean; + /** A handler for the click event. */ + onClick?: any; + clickAction?: any; + /** Specifies the icon to be displayed on the button. */ + icon?: string; + iconSrc?: string; + /** A template to be used for rendering the dxButton widget. */ + template?: any; + /** The text displayed on the button. */ + text?: string; + /** Specifies the button type. */ + type?: string; + /** Specifies the name of the validation group to be accessed in the click event handler. */ + validationGroup?: string; + } + /** A button widget. */ + export class dxButton extends Widget { + constructor(element: JQuery, options?: dxButtonOptions); + constructor(element: Element, options?: dxButtonOptions); + } + export interface dxBoxOptions extends CollectionWidget { + /** Specifies how widget items are aligned along the main direction. */ + align?: string; + /** Specifies the direction of item positioning in the widget. */ + direction?: string; + /** Specifies how widget items are aligned cross-wise. */ + crossAlign?: string; + } + /** A container widget used to arrange inner elements. */ + export class dxBox extends CollectionWidget { + constructor(element: JQuery, options?: dxBoxOptions); + constructor(element: Element, options?: dxBoxOptions); + } + export interface dxResponsiveBoxOptions extends CollectionWidgetOptions { + /** Specifies the collection of rows for the grid used to position layout elements. */ + rows?: Array; + /** Specifies the collection of columns for the grid used to position layout elements. */ + cols?: Array; + /** Specifies the function returning the screen factor depending on the screen width. */ + screenByWidth?: (width: number) => string; + /** Specifies the screen factor with which all elements are located in a single column. */ + singleColumnScreen?: string; + } + /** A widget used to build an adaptive markup that is dependent on screen resolution. */ + export class dxResponsiveBox extends CollectionWidget { + constructor(element: JQuery, options?: dxBoxOptions); + constructor(element: Element, options?: dxBoxOptions); + } + export interface dxAutocompleteOptions extends dxDropDownListOptions { + /** Specifies the current value displayed by the widget. */ + value?: string; + /** The minimum number of characters that must be entered into the text box to begin a search. */ + minSearchLength?: number; + /** Specifies the maximum count of items displayed by the widget. */ + maxItemCount?: number; + /** Gets the currently selected item. */ + selectedItem?: Object; + } + /** A textbox widget that supports autocompletion. */ + export class dxAutocomplete extends dxDropDownList { + constructor(element: JQuery, options?: dxAutocompleteOptions); + constructor(element: Element, options?: dxAutocompleteOptions); + /** Opens the drop-down editor. */ + open(): void; + /** Closes the drop-down editor. */ + close(): void; + } + export interface dxAccordionOptions extends CollectionWidgetOptions { + /** A number specifying the time in milliseconds spent on the animation of the expanding or collapsing of a panel. */ + animationDuration?: number; + /** Specifies the height of the widget. */ + height?: any; + /** Specifies whether all items can be collapsed or whether at least one item must always be expanded. */ + collapsible?: boolean; + /** Specifies whether the widget can expand several items or only a single item at once. */ + multiple?: boolean; + /** The template to be used for rendering dxAccordion items. */ + itemTemplate?: any; + /** A handler for the itemTitleClick event. */ + onItemTitleClick?: any; + /** A handler for the itemTitleHold event. */ + onItemTitleHold?: Function; + /** The template to be used for rendering an item title. */ + itemTitleTemplate?: any; + /** The index number of the currently selected item. */ + selectedIndex?: number; + /** Specifies whether widget content is rendered when the widget is shown or when rendering the widget. */ + deferRendering?: boolean; + } + /** A widget that displays data source items on collapsible panels. */ + export class dxAccordion extends CollectionWidget { + constructor(element: JQuery, options?: dxAccordionOptions); + constructor(element: Element, options?: dxAccordionOptions); + /** Collapses the specified item. */ + collapseItem(index: number): JQueryPromise; + /** Expands the specified item. */ + expandItem(index: number): JQueryPromise; + /** Updates the dimensions of the widget contents. */ + updateDimensions(): JQueryPromise; + } + export interface dxFileUploaderOptions extends EditorOptions { + /** A read-only option that holds a File instance representing the selected file. */ + value?: File; + /** Holds the File instances representing files selected in the widget. */ + values?: Array; + buttonText?: string; + /** The text displayed on the button that opens the file browser. */ + selectButtonText?: string; + /** The text displayed on the button that starts uploading. */ + uploadButtonText?: string; + /** Specifies the text displayed on the area to which an end-user can drop a file. */ + labelText?: string; + /** Specifies the value passed to the name attribute of the underlying input element. */ + name?: string; + /** Specifies whether the widget enables an end-user to select a single file or multiple files. */ + multiple?: boolean; + /** Specifies a file type or several types accepted by the widget. */ + accept?: string; + /** Specifies a target Url for the upload request. */ + uploadUrl?: string; + /** Specifies if an end user can remove a file from the selection and interrupt uploading. */ + allowCanceling?: boolean; + /** Specifies whether or not the widget displays the list of selected files. */ + showFileList?: boolean; + /** Gets the current progress in percentages. */ + progress?: number; + /** The message displayed by the widget when it is ready to upload the specified files. */ + readyToUploadMessage?: string; + /** The message displayed by the widget when uploading is finished. */ + uploadedMessage?: string; + /** The message displayed by the widget on uploading failure. */ + uploadFailedMessage?: string; + /** Specifies how the widget uploads files. */ + uploadMode?: string; + /** A handler for the uploaded event. */ + onUploaded?: Function; + /** A handler for the uploaded event. */ + onProgress?: Function; + /** A handler for the uploadError event. */ + onUploadError?: Function; + } + /** A widget used to select and upload a file or multiple files. */ + export class dxFileUploader extends Editor { + constructor(element: JQuery, options?: dxFileUploaderOptions); + constructor(element: Element, options?: dxFileUploaderOptions); + } + export interface dxTrackBarOptions extends EditorOptions { + /** The minimum value the widget can accept. */ + min?: number; + /** The maximum value the widget can accept. */ + max?: number; + /** The current widget value. */ + value?: number; + } + /** A base class for track bar widgets. */ + export class dxTrackBar extends Editor { + constructor(element: JQuery, options?: dxTrackBarOptions); + constructor(element: Element, options?: dxTrackBarOptions); + } + export interface dxProgressBarOptions extends dxTrackBarOptions { + /** Specifies a format for the progress status. */ + statusFormat?: any; + /** Specifies whether or not the widget displays a progress status. */ + showStatus?: boolean; + /** A handler for the complete event. */ + onComplete?: Function; + } + /** A widget used to indicate progress. */ + export class dxProgressBar extends dxTrackBar { + constructor(element: JQuery, options?: dxProgressBarOptions); + constructor(element: Element, options?: dxProgressBarOptions); + } + export interface dxSliderOptions extends dxTrackBarOptions { + /** The slider step size. */ + step?: number; + /** The current slider value. */ + value?: number; + /** Specifies whether or not to highlight a range selected within the widget. */ + showRange?: boolean; + /** Specifies the size of a step by which a slider handle is moved when a user uses the Page up or Page down keyboard shortcuts. */ + keyStep?: number; + /** Specifies options for the slider tooltip. */ + tooltip?: { + /** Specifies whether or not the tooltip is enabled. */ + enabled?: boolean; + /** Specifies format for the tooltip. */ + format?: any; + /** Specifies whether the tooltip is located over or under the slider. */ + position?: string; + /** Specifies whether the widget always shows a tooltip or only when a pointer is over the slider. */ + showMode?: string; + }; + /** Specifies options for labels displayed at the min and max values. */ + label?: { + /** Specifies whether or not slider labels are visible. */ + visible?: boolean; + /** Specifies whether labels are located over or under the scale. */ + position?: string; + /** Specifies a format for labels. */ + format?: any; + }; + } + /** A widget that allows a user to select a numeric value within a given range. */ + export class dxSlider extends dxTrackBar { + constructor(element: JQuery, options?: dxSliderOptions); + constructor(element: Element, options?: dxSliderOptions); + } + export interface dxRangeSliderOptions extends dxSliderOptions { + /** The left edge of the interval currently selected using the range slider. */ + start?: number; + /** The right edge of the interval currently selected using the range slider. */ + end?: number; + } + /** A widget that enables a user to select a range of numeric values. */ + export class dxRangeSlider extends dxSlider { + constructor(element: JQuery, options?: dxRangeSliderOptions); + constructor(element: Element, options?: dxRangeSliderOptions); + } +} +interface JQuery { + dxProgressBar(): JQuery; + dxProgressBar(options: "instance"): DevExpress.ui.dxProgressBar; + dxProgressBar(options: string): any; + dxProgressBar(options: string, ...params: any[]): any; + dxProgressBar(options: DevExpress.ui.dxProgressBarOptions): JQuery; + dxSlider(): JQuery; + dxSlider(options: "instance"): DevExpress.ui.dxSlider; + dxSlider(options: string): any; + dxSlider(options: string, ...params: any[]): any; + dxSlider(options: DevExpress.ui.dxSliderOptions): JQuery; + dxRangeSlider(): JQuery; + dxRangeSlider(options: "instance"): DevExpress.ui.dxRangeSlider; + dxRangeSlider(options: string): any; + dxRangeSlider(options: string, ...params: any[]): any; + dxRangeSlider(options: DevExpress.ui.dxRangeSliderOptions): JQuery; + dxFileUploader(): JQuery; + dxFileUploader(options: "instance"): DevExpress.ui.dxFileUploader; + dxFileUploader(options: string): any; + dxFileUploader(options: string, ...params: any[]): any; + dxFileUploader(options: DevExpress.ui.dxFileUploaderOptions): JQuery; + dxValidator(): JQuery; + dxValidator(options: "instance"): DevExpress.ui.dxValidator; + dxValidator(options: string): any; + dxValidator(options: string, ...params: any[]): any; + dxValidator(options: DevExpress.ui.dxValidatorOptions): JQuery; + dxValidationGroup(): JQuery; + dxValidationGroup(options: "instance"): DevExpress.ui.dxValidationGroup; + dxValidationGroup(options: string): any; + dxValidationGroup(options: string, ...params: any[]): any; + dxValidationSummary(): JQuery; + dxValidationSummary(options: "instance"): DevExpress.ui.dxValidationSummary; + dxValidationSummary(options: string): any; + dxValidationSummary(options: string, ...params: any[]): any; + dxValidationSummary(options: DevExpress.ui.dxValidationSummaryOptions): JQuery; + dxTooltip(): JQuery; + dxTooltip(options: "instance"): DevExpress.ui.dxTooltip; + dxTooltip(options: string): any; + dxTooltip(options: string, ...params: any[]): any; + dxTooltip(options: DevExpress.ui.dxTooltipOptions): JQuery; + dxResizable(): JQuery; + dxResizable(options: "instance"): DevExpress.ui.dxResizable; + dxResizable(options: string): any; + dxResizable(options: string, ...params: any[]): any; + dxResizable(options: DevExpress.ui.dxResizableOptions): JQuery; + dxDropDownList(): JQuery; + dxDropDownList(options: "instance"): DevExpress.ui.dxDropDownList; + dxDropDownList(options: string): any; + dxDropDownList(options: string, ...params: any[]): any; + dxDropDownList(options: DevExpress.ui.dxDropDownListOptions): JQuery; + dxToolbar(): JQuery; + dxToolbar(options: "instance"): DevExpress.ui.dxToolbar; + dxToolbar(options: string): any; + dxToolbar(options: string, ...params: any[]): any; + dxToolbar(options: DevExpress.ui.dxToolbarOptions): JQuery; + dxToast(): JQuery; + dxToast(options: "instance"): DevExpress.ui.dxToast; + dxToast(options: string): any; + dxToast(options: string, ...params: any[]): any; + dxToast(options: DevExpress.ui.dxToastOptions): JQuery; + dxTextEditor(): JQuery; + dxTextEditor(options: "instance"): DevExpress.ui.dxTextEditor; + dxTextEditor(options: string): any; + dxTextEditor(options: string, ...params: any[]): any; + dxTextEditor(options: DevExpress.ui.dxTextEditorOptions): JQuery; + dxTextBox(): JQuery; + dxTextBox(options: "instance"): DevExpress.ui.dxTextBox; + dxTextBox(options: string): any; + dxTextBox(options: string, ...params: any[]): any; + dxTextBox(options: DevExpress.ui.dxTextBoxOptions): JQuery; + dxTextArea(): JQuery; + dxTextArea(options: "instance"): DevExpress.ui.dxTextArea; + dxTextArea(options: string): any; + dxTextArea(options: string, ...params: any[]): any; + dxTextArea(options: DevExpress.ui.dxTextAreaOptions): JQuery; + dxTabs(): JQuery; + dxTabs(options: "instance"): DevExpress.ui.dxTabs; + dxTabs(options: string): any; + dxTabs(options: string, ...params: any[]): any; + dxTabs(options: DevExpress.ui.dxTabsOptions): JQuery; + dxTabPanel(): JQuery; + dxTabPanel(options: "instance"): DevExpress.ui.dxTabPanel; + dxTabPanel(options: string): any; + dxTabPanel(options: string, ...params: any[]): any; + dxTabPanel(options: DevExpress.ui.dxTabPanelOptions): JQuery; + dxSelectBox(): JQuery; + dxSelectBox(options: "instance"): DevExpress.ui.dxSelectBox; + dxSelectBox(options: string): any; + dxSelectBox(options: string, ...params: any[]): any; + dxSelectBox(options: DevExpress.ui.dxSelectBoxOptions): JQuery; + dxScrollView(): JQuery; + dxScrollView(options: "instance"): DevExpress.ui.dxScrollView; + dxScrollView(options: string): any; + dxScrollView(options: string, ...params: any[]): any; + dxScrollView(options: DevExpress.ui.dxScrollViewOptions): JQuery; + dxScrollable(): JQuery; + dxScrollable(options: "instance"): DevExpress.ui.dxScrollable; + dxScrollable(options: string): any; + dxScrollable(options: string, ...params: any[]): any; + dxScrollable(options: DevExpress.ui.dxScrollableOptions): JQuery; + dxRadioGroup(): JQuery; + dxRadioGroup(options: "instance"): DevExpress.ui.dxRadioGroup; + dxRadioGroup(options: string): any; + dxRadioGroup(options: string, ...params: any[]): any; + dxRadioGroup(options: DevExpress.ui.dxRadioGroupOptions): JQuery; + dxPopup(): JQuery; + dxPopup(options: "instance"): DevExpress.ui.dxPopup; + dxPopup(options: string): any; + dxPopup(options: string, ...params: any[]): any; + dxPopup(options: DevExpress.ui.dxPopupOptions): JQuery; + dxPopover(): JQuery; + dxPopover(options: "instance"): DevExpress.ui.dxPopover; + dxPopover(options: string): any; + dxPopover(options: string, ...params: any[]): any; + dxPopover(options: DevExpress.ui.dxPopoverOptions): JQuery; + dxOverlay(): JQuery; + dxOverlay(options: "instance"): DevExpress.ui.dxOverlay; + dxOverlay(options: string): any; + dxOverlay(options: string, ...params: any[]): any; + dxOverlay(options: DevExpress.ui.dxOverlayOptions): JQuery; + dxNumberBox(): JQuery; + dxNumberBox(options: "instance"): DevExpress.ui.dxNumberBox; + dxNumberBox(options: string): any; + dxNumberBox(options: string, ...params: any[]): any; + dxNumberBox(options: DevExpress.ui.dxNumberBoxOptions): JQuery; + dxNavBar(): JQuery; + dxNavBar(options: "instance"): DevExpress.ui.dxNavBar; + dxNavBar(options: string): any; + dxNavBar(options: string, ...params: any[]): any; + dxNavBar(options: DevExpress.ui.dxNavBarOptions): JQuery; + dxMultiView(): JQuery; + dxMultiView(options: "instance"): DevExpress.ui.dxMultiView; + dxMultiView(options: string): any; + dxMultiView(options: string, ...params: any[]): any; + dxMultiView(options: DevExpress.ui.dxMultiViewOptions): JQuery; + dxMap(): JQuery; + dxMap(options: "instance"): DevExpress.ui.dxMap; + dxMap(options: string): any; + dxMap(options: string, ...params: any[]): any; + dxMap(options: DevExpress.ui.dxMapOptions): JQuery; + dxLookup(): JQuery; + dxLookup(options: "instance"): DevExpress.ui.dxLookup; + dxLookup(options: string): any; + dxLookup(options: string, ...params: any[]): any; + dxLookup(options: DevExpress.ui.dxLookupOptions): JQuery; + dxLoadPanel(): JQuery; + dxLoadPanel(options: "instance"): DevExpress.ui.dxLoadPanel; + dxLoadPanel(options: string): any; + dxLoadPanel(options: string, ...params: any[]): any; + dxLoadPanel(options: DevExpress.ui.dxLoadPanelOptions): JQuery; + dxLoadIndicator(): JQuery; + dxLoadIndicator(options: "instance"): DevExpress.ui.dxLoadIndicator; + dxLoadIndicator(options: string): any; + dxLoadIndicator(options: string, ...params: any[]): any; + dxLoadIndicator(options: DevExpress.ui.dxLoadIndicatorOptions): JQuery; + dxList(): JQuery; + dxList(options: "instance"): DevExpress.ui.dxList; + dxList(options: string): any; + dxList(options: string, ...params: any[]): any; + dxList(options: DevExpress.ui.dxListOptions): JQuery; + dxGallery(): JQuery; + dxGallery(options: "instance"): DevExpress.ui.dxGallery; + dxGallery(options: string): any; + dxGallery(options: string, ...params: any[]): any; + dxGallery(options: DevExpress.ui.dxGalleryOptions): JQuery; + dxDropDownEditor(): JQuery; + dxDropDownEditor(options: "instance"): DevExpress.ui.dxDropDownEditor; + dxDropDownEditor(options: string): any; + dxDropDownEditor(options: string, ...params: any[]): any; + dxDropDownEditor(options: DevExpress.ui.dxDropDownEditorOptions): JQuery; + dxDateBox(): JQuery; + dxDateBox(options: "instance"): DevExpress.ui.dxDateBox; + dxDateBox(options: string): any; + dxDateBox(options: string, ...params: any[]): any; + dxDateBox(options: DevExpress.ui.dxDateBoxOptions): JQuery; + dxCheckBox(): JQuery; + dxCheckBox(options: "instance"): DevExpress.ui.dxCheckBox; + dxCheckBox(options: string): any; + dxCheckBox(options: string, ...params: any[]): any; + dxCheckBox(options: DevExpress.ui.dxCheckBoxOptions): JQuery; + dxBox(): JQuery; + dxBox(options: "instance"): DevExpress.ui.dxBox; + dxBox(options: string): any; + dxBox(options: string, ...params: any[]): any; + dxBox(options: DevExpress.ui.dxBoxOptions): JQuery; + dxButton(): JQuery; + dxButton(options: "instance"): DevExpress.ui.dxButton; + dxButton(options: string): any; + dxButton(options: string, ...params: any[]): any; + dxButton(options: DevExpress.ui.dxButtonOptions): JQuery; + dxCalendar(): JQuery; + dxCalendar(options: "instance"): DevExpress.ui.dxCalendar; + dxCalendar(options: string): any; + dxCalendar(options: string, ...params: any[]): any; + dxCalendar(options: DevExpress.ui.dxCalendarOptions): JQuery; + dxAccordion(): JQuery; + dxAccordion(options: "instance"): DevExpress.ui.dxAccordion; + dxAccordion(options: string): any; + dxAccordion(options: string, ...params: any[]): any; + dxAccordion(options: DevExpress.ui.dxAccordionOptions): JQuery; + dxResponsiveBox(): JQuery; + dxResponsiveBox(options: "instance"): DevExpress.ui.dxResponsiveBox; + dxResponsiveBox(options: string): any; + dxResponsiveBox(options: string, ...params: any[]): any; + dxResponsiveBox(options: DevExpress.ui.dxResponsiveBoxOptions): JQuery; + dxAutocomplete(): JQuery; + dxAutocomplete(options: "instance"): DevExpress.ui.dxAutocomplete; + dxAutocomplete(options: string): any; + dxAutocomplete(options: string, ...params: any[]): any; + dxAutocomplete(options: DevExpress.ui.dxAutocompleteOptions): JQuery; +} + +declare module DevExpress.ui { + export interface dxTileViewOptions extends CollectionWidgetOptions { + /** A Boolean value specifying whether or not the widget changes its state when interacting with a user. */ + activeStateEnabled?: boolean; + /** Specifies the height of the base tile view item. */ + baseItemHeight?: number; + /** Specifies the width of the base tile view item. */ + baseItemWidth?: number; + /** Specifies the height of the widget. */ + height?: any; + /** Specifies the distance in pixels between adjacent tiles. */ + itemMargin?: number; + /** A Boolean value specifying whether or not to display a scrollbar. */ + showScrollbar?: boolean; + } + /** A widget displaying several blocks of data as tiles. */ + export class dxTileView extends CollectionWidget { + constructor(element: JQuery, options?: dxTileViewOptions); + constructor(element: Element, options?: dxTileViewOptions); + /** Returns the current scroll position of the widget content. */ + scrollPosition(): number; + } + export interface dxSwitchOptions extends EditorOptions { + /** Text displayed when the widget is in a disabled state. */ + offText?: string; + /** Text displayed when the widget is in an enabled state. */ + onText?: string; + /** A Boolean value specifying whether the current switch state is "On" or "Off". */ + value?: boolean; + } + /** A switch widget. */ + export class dxSwitch extends Editor { + constructor(element: JQuery, options?: dxSwitchOptions); + constructor(element: Element, options?: dxSwitchOptions); + } + export interface dxSlideOutViewOptions extends WidgetOptions { + /** Specifies whether or not the menu panel is visible. */ + menuVisible?: boolean; + /** Specifies whether or not the menu is shown when a user swipes the widget content. */ + swipeEnabled?: boolean; + /** A template to be used for rendering menu panel content. */ + menuTemplate?: any; + /** A template to be used for rendering widget content. */ + contentTemplate?: any; + } + /** The widget that allows you to slide-out the current view to reveal a custom menu. */ + export class dxSlideOutView extends Widget { + constructor(element: JQuery, options?: dxSlideOutViewOptions); + constructor(element: Element, options?: dxSlideOutViewOptions); + /** Returns an HTML element of the widget menu block. */ + menuContent(): JQuery; + /** Returns an HTML element of the widget content block. */ + content(): JQuery; + /** Displays the widget's menu block. */ + showMenu(): JQueryPromise; + /** Hides the widget's menu block. */ + hideMenu(): JQueryPromise; + /** Toggles the visibility of the widget's menu block. */ + toggleMenuVisibility(): JQueryPromise; + } + export interface dxSlideOutOptions extends CollectionWidgetOptions { + /** A Boolean value specifying whether or not the widget changes its state when interacting with a user. */ + activeStateEnabled?: boolean; + /** A Boolean value specifying whether or not to display a grouped menu. */ + menuGrouped?: boolean; + menuGroupRender?: any; + /** The name of the template used to display a group header. */ + menuGroupTemplate?: any; + menuItemRender?: any; + /** The template used to render menu items. */ + menuItemTemplate?: any; + /** A handler for the menuGroupRendered event. */ + onMenuGroupRendered?: Function; + /** A handler for the menuItemRendered event. */ + onMenuItemRendered?: Function; + /** Specifies whether or not the slide-out menu is displayed. */ + menuVisible?: boolean; + /** Indicates whether the menu can be shown/hidden by swiping the widget's main panel. */ + swipeEnabled?: boolean; + /** A template to be used for rendering widget content. */ + contentTemplate?: any; + } + /** The widget that allows you to slide-out the current view to reveal an item list. */ + export class dxSlideOut extends CollectionWidget { + constructor(element: JQuery, options?: dxSlideOutOptions); + constructor(element: Element, options?: dxSlideOutOptions); + /** Hides the widget's slide-out menu. */ + hideMenu(): JQueryPromise; + /** Displays the widget's slide-out menu. */ + showMenu(): JQueryPromise; + /** Toggles the visibility of the widget's slide-out menu. */ + toggleMenuVisibility(showing: boolean): JQueryPromise; + } + export interface dxPivotOptions extends CollectionWidgetOptions { + /** The index of the currently active pivot item. */ + selectedIndex?: number; + /** A Boolean value specifying whether or not to allow users to switch between items by swiping. */ + swipeEnabled?: boolean; + /** A template to be used for rendering widget content. */ + contentTemplate?: any; + /** The template to be used for rendering an item title. */ + itemTitleTemplate?: any; + } + /** A widget that is similar to a traditional tab control, but optimized for the phone with simplified end-user interaction. */ + export class dxPivot extends CollectionWidget { + constructor(element: JQuery, options?: dxPivotOptions); + constructor(element: Element, options?: dxPivotOptions); + } + export interface dxPanoramaOptions extends CollectionWidgetOptions { + /** An object exposing options for setting a background image for the panorama. */ + backgroundImage?: { + /** Specifies the height of the panorama's background image. */ + height?: number; + /** Specifies the URL of the image that is used as the panorama's background image. */ + url?: string; + /** Specifies the width of the panorama's background image. */ + width?: number; + }; + /** The index of the currently active panorama item. */ + selectedIndex?: number; + /** Specifies the widget content title. */ + title?: string; + } + /** A widget displaying the required content in a long horizontal canvas that extends beyond the frames of the screen. */ + export class dxPanorama extends CollectionWidget { + constructor(element: JQuery, options?: dxDropDownEditorOptions); + constructor(element: Element, options?: dxDropDownEditorOptions); + } + export interface dxDropDownMenuOptions extends WidgetOptions { + /** A handler for the buttonClick event. */ + onButtonClick?: any; + buttonClickAction?: any; + /** The name of the icon to be displayed by the DropDownMenu button. */ + buttonIcon?: string; + buttonIconSrc?: string; + /** The text displayed in the DropDownMenu button. */ + buttonText?: string; + /** A data source used to fetch data to be displayed by the widget. */ + dataSource?: any; + /** A handler for the itemClick event. */ + onItemClick?: any; + itemClickAction?: any; + itemRender?: any; + /** An array of items displayed by the widget. */ + items?: Array; + /** The template to be used for rendering items. */ + itemTemplate?: any; + /** Specifies whether or not to show the drop down menu within a dxPopover widget. */ + usePopover?: boolean; + /** The width of the menu popup in pixels. */ + popupWidth?: any; + /** The height of the menu popup in pixels. */ + popupHeight?: any; + /** Specifies whether or not the drop-down menu is displayed. */ + opened?: boolean; + /** A Boolean value specifying whether or not the widget changes its state when being hovered by an end user. */ + hoverStateEnabled?: boolean; + } + /** A drop-down menu widget. */ + export class dxDropDownMenu extends Widget { + constructor(element: JQuery, options?: dxDropDownEditorOptions); + constructor(element: Element, options?: dxDropDownEditorOptions); + /** This section lists the data source fields that are used in a default template for drop-down menu items. */ + /** Opens the drop-down menu. */ + open(): void; + /** Closes the drop-down menu. */ + close(): void; + } + export interface dxActionSheetOptions extends CollectionWidgetOptions { + cancelClickAction?: any; + /** A handler for the cancelClick event. */ + onCancelClick?: any; + /** The text displayed in the button that closes the action sheet. */ + cancelText?: string; + /** Specifies whether or not to display the Cancel button in action sheet. */ + showCancelButton?: boolean; + /** A Boolean value specifying whether or not the title of the action sheet is visible. */ + showTitle?: boolean; + /** Specifies the element the action sheet popover points at. */ + target?: any; + /** The title of the action sheet. */ + title?: string; + /** Specifies whether or not to show the action sheet within a dxPopover widget. */ + usePopover?: boolean; + /** A Boolean value specifying whether or not the dxActionSheet widget is visible. */ + visible?: boolean; + } + /** A widget consisting of a set of choices related to a certain task. */ + export class dxActionSheet extends CollectionWidget { + constructor(element: JQuery, options?: dxActionSheetOptions); + constructor(element: Element, options?: dxActionSheetOptions); + /** Hides the widget. */ + hide(): JQueryPromise; + /** Shows the widget. */ + show(): JQueryPromise; + /** Shows or hides the widget depending on the Boolean value passed as the parameter. */ + toggle(showing: boolean): JQueryPromise; + } +} +interface JQuery { + dxTileView(): JQuery; + dxTileView(options: "instance"): DevExpress.ui.dxTileView; + dxTileView(options: string): any; + dxTileView(options: string, ...params: any[]): any; + dxTileView(options: DevExpress.ui.dxTileViewOptions): JQuery; + dxSwitch(): JQuery; + dxSwitch(options: "instance"): DevExpress.ui.dxSwitch; + dxSwitch(options: string): any; + dxSwitch(options: string, ...params: any[]): any; + dxSwitch(options: DevExpress.ui.dxSwitchOptions): JQuery; + dxSlideOut(): JQuery; + dxSlideOut(options: "instance"): DevExpress.ui.dxSlideOut; + dxSlideOut(options: string): any; + dxSlideOut(options: string, ...params: any[]): any; + dxSlideOut(options: DevExpress.ui.dxSlideOutOptions): JQuery; + dxPivot(): JQuery; + dxPivot(options: "instance"): DevExpress.ui.dxPivot; + dxPivot(options: string): any; + dxPivot(options: string, ...params: any[]): any; + dxPivot(options: DevExpress.ui.dxPivotOptions): JQuery; + dxPanorama(): JQuery; + dxPanorama(options: "instance"): DevExpress.ui.dxPanorama; + dxPanorama(options: string): any; + dxPanorama(options: string, ...params: any[]): any; + dxPanorama(options: DevExpress.ui.dxPanoramaOptions): JQuery; + dxActionSheet(): JQuery; + dxActionSheet(options: "instance"): DevExpress.ui.dxActionSheet; + dxActionSheet(options: string): any; + dxActionSheet(options: string, ...params: any[]): any; + dxActionSheet(options: DevExpress.ui.dxActionSheetOptions): JQuery; + dxDropDownMenu(): JQuery; + dxDropDownMenu(options: "instance"): DevExpress.ui.dxDropDownMenu; + dxDropDownMenu(options: string): any; + dxDropDownMenu(options: string, ...params: any[]): any; + dxDropDownMenu(options: DevExpress.ui.dxDropDownMenuOptions): JQuery; +} +declare module DevExpress.data { + export interface XmlaStoreOptions { + /** The HTTP address to an XMLA OLAP server. */ + url?: string; + /** The name of the database associated with the Store. */ + catalog?: string; + /** The cube name. */ + cube?: string; + beforeSend?: (request: Object) => void; + } + /** A Store that provides access to an OLAP cube using the XMLA standard. */ + export class XmlaStore { + constructor(options: XmlaStoreOptions); + } + export interface PivotGridField { + index?: number; + /** A boolean value specifying whether or not the field is visible in the pivot grid and the Field Chooser. */ + visible?: boolean; + /** Name of the data source field containing data for the pivot grid field. */ + dataField?: string; + /** A caption that will be displayed in the pivot grid's field chooser to identify the field. */ + caption?: string; + /** Specifies a type of field values. */ + dataType?: string; + /** Specifies how the values of the current field are combined into groups. Cannot be used for the XmlaStore store type. */ + groupInterval?: any; + /** Specifies how to aggregate field data. Cannot be used for th XmlaStore store type. */ + summaryType?: string; + /** Allows you to use a custom aggregate function to calculate the summary values. Cannot be used for the XmlaStore store type. */ + calculateCustomSummary?: (options: { + summaryProcess?: string; + value?: any; + totalValue?: any; + }) => void; + /** Specifies the function that determines how to split data from the data source into ranges for header items. Cannot be used for the XmlaStore store type. */ + selector?: (data: Object) => any; + /** Type of the area where the field is located. */ + area?: string; + /** Index among the other fields displayed within the same area. */ + areaIndex?: number; + /** The name of the folder in which the field is located. */ + displayFolder?: string; + /** The name of the group to which the field belongs. */ + groupName?: string; + /** The index of the field within a group. */ + groupIndex?: number; + /** Specifies the initial sort order of field values. */ + sortOrder?: string; + /** Specifies how field data should be sorted. Can be used for the XmlaStore store type only. */ + sortBy?: string; + /** Specifies the data field against which the header items of this field should be sorted. */ + sortBySummaryField?: string; + /** The array of field names that specify a path to column/row whose summary field is used for sorting of this field's header items. */ + sortBySummaryPath?: Array; + /** The filter values for the current field. */ + filterValues?: Array; + /** The filter type for the current field. */ + filterType?: string; + /** Indicates whether all header items of the field's header level are expanded. */ + expanded?: boolean; + /** Specifies whether the field should be treated as a Data Field. */ + isMeasure?: boolean; + /** Specifies a display format for field values. */ + format?: string; + /** Specifies a callback function that returns the text to be displayed in the cells of a field. */ + customizeText?: (cellInfo: { value: any; valueText: string }) => string; + /** Specifies a precision for formatted field values. */ + precision?: number; + /** Specifies how to sort the header items. */ + sortingMethod?: (a: Object, b: Object) => number; + /** Allows an end-user to change sorting options. */ + allowSorting?: boolean; + /** Allows an end-user to sort columns by summary values. */ + allowSortingBySummary?: boolean; + /** Allows an end-user to change filtering options. */ + allowFiltering?: boolean; + /** Allows an end-user to expand/collapse all header items within a header level. */ + allowExpandAll?: boolean; + /** Specifies the absolute width of the field in the pivot grid. */ + width?: number; + } + export interface PivotGridDataSourceOptions { + /** Specifies the underlying Store instance used to access data. */ + store?: any; + /** Indicates whether or not the automatic field generation from data in the Store is enabled. */ + retrieveFields?: boolean; + /** Specifies data filtering conditions. */ + filter?: Object; + /** An array of pivot grid fields. */ + fields?: Array; + /** Indicates whether or not the local sorting of the XMLA data should be performed. */ + localSorting?: boolean; + /** A handler for the changed event. */ + onChanged?: () => void; + /** A handler for the loadingChanged event. */ + onLoadingChanged?: (isLoading: boolean) => void; + /** A handler for the loadError event. */ + onLoadError?: (e?: Object) => void; + /** A handler for the fieldsPrepared event. */ + onFieldsPrepared?: (e?: Array) => void; + } + /** An object that provides access to data for the dxPivotGrid widget. */ + export class PivotGridDataSource implements EventsMixin { + constructor(options?: PivotGridDataSource); + /** Starts loading data. */ + load(): JQueryPromise; + /** Indicates whether or not the PivotGridDataSource is currently being loaded. */ + isLoading(): boolean; + /** Gets data displayed in a PivotGrid. */ + getData(): Object; + /** Gets all fields within a specified area. */ + getAreaFields(area: string, collectGroups: boolean): Array; + /** Gets all fields from the data source. */ + fields(): Array; + /** Sets the fields option. */ + fields(fields: Array): void; + /** Gets current options of a specified field. */ + field(id: any): PivotGridField; + /** Sets one or more options of a specified field. */ + field(id: any, field: PivotGridField): void; + /** Collapses a specified header item. */ + collapseHeaderItem(area: string, path: Array): void; + /** Expands a specified header item. */ + expandHeaderItem(area: string, path: Array): void; + /** Expands all header items of a field. */ + expandAll(id: any): void; + /** Collapses all header items of a field. */ + collapseAll(id: any): void; + /** Disposes of all resources associated with this PivotGridDataSource. */ + dispose(): void; + on(eventName: string, eventHandler: Function): PivotGridDataSource; + on(events: { [eventName: string]: Function; }): PivotGridDataSource; + off(eventName: string): PivotGridDataSource; + off(eventName: string, eventHandler: Function): PivotGridDataSource; + } +} +declare module DevExpress.ui { + export interface dxSchedulerOptions extends WidgetOptions { + /** Specifies a date displayed on the current scheduler view by default. */ + currentDate?: Date; + /** The earliest date the widget allows you to select. */ + min?: Date; + /** The latest date the widget allows you to select. */ + max?: Date; + /** Specifies the view used in the scheduler by default. */ + currentView?: string; + /** A data source used to fetch data to be displayed by the widget. */ + dataSource?: any; + /** Specifies the first day of a week. */ + firstDayOfWeek?: number; + /** The template to be used for rendering appointments. */ + appointmentTemplate?: any; + /** Lists the views to be available within the scheduler's View Selector. */ + views?: Array; + /** Specifies the resource kinds by which the scheduler's appointments are grouped in a timetable. */ + groups?: Array; + /** Specifies a start hour in the scheduler view's time interval. */ + startDayHour?: number; + /** Specifies an end hour in the scheduler view's time interval. */ + endDayHour?: number; + /** Specifies whether the scheduler data can be edited at runtime. */ + editing?: boolean; + /** Specifies an array of resources available in the scheduler. */ + resources?: Array<{ + /** Indicates whether or not several resources of this kind can be assigned to an appointment. */ + allowMultiple?: boolean; + /** Indicates whether or not resources of this kind have priority in the color identification of the appointments that have resources of different kinds assigned. */ + mainColor?: boolean; + /** A data source used to fetch resources to be available in the scheduler. */ + dataSource?: any; + /** Specifies the resource object field whose value is displayed by the Resource editor in the Appointment popup window. */ + displayExpr?: any; + /** Specifies the resource object field that is used as a value of the Resource editor in the Appointment popup window. */ + valueExpr?: any; + /** The name of the appointment object field that specifies a resource of this kind. */ + field?: string; + /** Specifies the label of the Appointment popup window field that allows end users to assign a resource of this kind. */ + label?: string; + }>; + /** A handler for the AppointmentAdding event. */ + onAppointmentAdding?: Function; + /** A handler for the appointmentAdded event. */ + onAppointmentAdded?: Function; + /** A handler for the AppointmentUpdating event. */ + onAppointmentUpdating?: Function; + /** A handler for the appointmentUpdated event. */ + onAppointmentUpdated?: Function; + /** A handler for the AppointmentDeleting event. */ + onAppointmentDeleting?: Function; + /** A handler for the appointmentDeleted event. */ + onAppointmentDeleted?: Function; + /** A handler for the appointmentRendered event. */ + onAppointmentRendered?: Function; + } + /** A widget that displays scheduled data using different views and provides the capability to load, add and edit appointments. */ + export class dxScheduler extends Widget { + constructor(element: JQuery, options?: dxSchedulerOptions); + constructor(element: Element, options?: dxSchedulerOptions); + /** Add the appointment defined by the object passed as a parameter to the data associated with the widget. */ + addAppointment(appointment: Object): void; + /** Updates the appointment specified by the first method parameter by the appointment object specified by the second method parameter in the the data associated with the widget. */ + updateAppointment(target: Object, appointment: Object): void; + /** Deletes the appointment defined by the parameter from the the data associated with the widget. */ + deleteAppointment(appointment: Object): void; + /** Scrolls the scheduler work space to the specified time. */ + scrollToTime(hours: number, minutes: number): void; + } + export interface dxColorBoxOptions extends dxDropDownEditorOptions { + /** Specifies the text displayed on the button that applies changes and closes the drop-down editor. */ + applyButtonText?: string; + applyValueMode?: string; + /** Specifies the text displayed on the button that cancels changes and closes the drop-down editor. */ + cancelButtonText?: string; + /** Specifies whether or not the widget value includes the alpha channel component. */ + editAlphaChannel?: boolean; + /** Specifies the size of a step by which a handle is moved using a keyboard shortcut. */ + keyStep?: number; + } + /** A widget used to specify a color value. */ + export class dxColorBox extends dxDropDownEditor { + constructor(element: JQuery, options?: dxColorBoxOptions); + constructor(element: Element, options?: dxColorBoxOptions); + } + export interface dxColorPickerOptions extends dxColorBoxOptions { } + /** + * A widget used to specify a color value. + * @deprecated Use the dxColorBox widget instead + */ + export class dxColorPicker extends dxColorBox { + constructor(element: JQuery, options?: dxColorPickerOptions); + constructor(element: Element, options?: dxColorPickerOptions); + } + export interface dxTreeViewOptions extends CollectionWidgetOptions { + /** Specifies whether or not to animate item collapsing and expanding. */ + animationEnabled?: boolean; + /** Specifies whether a nested or plain array is used as a data source. */ + dataStructure?: string; + /** Specifies whether or not a user can expand all tree view items by the "*" hot key. */ + expandAllEnabled?: boolean; + /** + * An array of currently expanded item objects. + * @deprecated Use item.expanded field instead + */ + expandedItems?: Array; + /** Specifies whether or not a check box is displayed at each tree view item. */ + showCheckBoxes?: boolean; + /** Specifies whether or not to select nodes recursively. */ + selectNodesRecursive?: boolean; + /** Specifies whether the "Select All" check box is displayed over the tree view. */ + selectAllEnabled?: boolean; + /** Specifies the text displayed at the "Select All" check box. */ + selectAllText?: string; + /** Specifies the name of the data source item field used as a key. */ + keyExpr?: any; + /** Specifies the name of the data source item field whose value is displayed by the widget. */ + displayExpr?: any; + /** Specifies the name of the data source item field whose value defines whether or not the corresponding node is selected. */ + selectedExpr?: any; + /** Specifies the name of the data source item field whose value defines whether or not the corresponding node is expanded. */ + expandedExpr?: any; + /** Specifies the name of the data source item field that contains an array of nested items. */ + itemsExpr?: any; + /** Specifies the name of the data source item field that holds the key of the parent item. */ + parentIdExpr?: any; + /** Specifies the name of the data source item field whose value defines whether or not the corresponding node is disabled. */ + disabledExpr?: any; + /** Specifies the name of the data source item field whose value defines whether or not the corresponding node includes child nodes. */ + hasItemsExpr?: any; + /** Specifies if the virtual mode is enabled. */ + virtualModeEnabled?: boolean; + /** Specifies the parent ID value of the root item. */ + rootValue?: any; + /** A string value specifying available scrolling directions. */ + scrollDirection?: string; + /** A handler for the itemSelected event. */ + onItemSelected?: Function; + /** A handler for the itemExpanded event. */ + onItemExpanded?: Function; + /** A handler for the itemCollapsed event. */ + onItemCollapsed?: Function; + onItemClick?: Function; + onItemContextMenu?: Function; + onItemRendered?: Function; + onItemHold?: Function; + hoverStateEnabled?: boolean; + focusStateEnabled?: boolean; + } + /** A widget displaying specified data items as a tree. */ + export class dxTreeView extends CollectionWidget { + constructor(element: JQuery, options?: dxTreeViewOptions); + constructor(element: Element, options?: dxTreeViewOptions); + /** Updates the tree view scrollbars according to the current size of the widget content. */ + updateDimensions(): JQueryPromise; + /** Selects the specified item. */ + selectItem(itemElement: any): void; + /** Unselects the specified item. */ + unselectItem(itemElement: any): void; + /** Expands the specified item. */ + expandItem(itemElement: any): void; + /** Collapses the specified item. */ + collapseItem(itemElement: any): void; + /** Returns all nodes of the tree view. */ + getNodes(): Array; + /** Selects all widget items. */ + selectAll(): void; + /** Unselects all widget items. */ + unselectAll(): void; + } + export interface dxMenuBaseOptions extends CollectionWidgetOptions { + /** An object that defines the animation options of the widget. */ + animation?: fx.AnimationOptions; + /** A Boolean value specifying whether or not the widget changes its state when interacting with a user. */ + activeStateEnabled?: boolean; + /** Specifies the name of the CSS class associated with the menu. */ + cssClass?: string; + /** Holds an array of menu items. */ + items?: Array; + /** Specifies whether or not an item becomes selected if an end-user clicks it. */ + selectionByClick?: boolean; + /** Specifies the selection mode supported by the menu. */ + selectionMode?: string; + /** Specifies options of submenu showing and hiding. */ + showSubmenuMode?: { + /** Specifies the mode name. */ + name?: string; + /** Specifies the delay of submenu show and hiding. */ + delay?: { + /** The time span after which the submenu is shown. */ + show?: number; + /** The time span after which the submenu is hidden. */ + hide?: number; + }; + }; + /** A Boolean value specifying whether or not the widget changes its state when being hovered by an end user. */ + hoverStateEnabled?: boolean; + } + export class dxMenuBase extends CollectionWidget { + constructor(element: JQuery, options?: dxMenuBaseOptions); + constructor(element: Element, options?: dxMenuBaseOptions); + /** Selects the specified item. */ + selectItem(itemElement: any): void; + /** Unselects the specified item. */ + unselectItem(itemElement: any): void; + } + export interface dxMenuOptions extends dxMenuBaseOptions { + /** Specifies whether or not the submenu is hidden when the mouse pointer leaves it. */ + hideSubmenuOnMouseLeave?: boolean; + /** Specifies whether the menu has horizontal or vertical orientation. */ + orientation?: string; + /** Specifies options for showing and hiding the first level submenu. */ + showFirstSubmenuMode?: { + /** Specifies the mode name. */ + name?: string; + /** Specifies the delay of submenu showing and hiding. */ + delay?: { + /** The time span after which the submenu is shown. */ + show?: number; + /** The time span after which the submenu is hidden. */ + hide?: number; + }; + }; + /** Specifies the direction at which the submenus are displayed. */ + submenuDirection?: string; + /** A handler for the submenuHidden event. */ + onSubmenuHidden?: Function; + submenuHiddenAction?: Function; + /** A handler for the submenuHiding event. */ + onSubmenuHiding?: Function; + submenuHidingAction?: Function; + /** A handler for the submenuShowing event. */ + onSubmenuShowing?: Function; + submenuShowingAction?: Function; + /** A handler for the submenuShown event. */ + onSubmenuShown?: Function; + submenuShownAction?: Function; + } + /** A menu widget. */ + export class dxMenu extends dxMenuBase { + constructor(element: JQuery, options?: dxMenuOptions); + constructor(element: Element, options?: dxMenuOptions); + } + export interface dxContextMenuOptions extends dxMenuBaseOptions { + /** Holds an object that specifies options of alternative menu invocation. */ + alternativeInvocationMode?: { + /** Specifies whether or not the standard context menu invocation (on a right mouse click or on a long tap) is disabled. */ + enabled?: Boolean; + /** Specifies the element used to invoke the context menu. */ + invokingElement?: any; + }; + /** A handler for the hidden event. */ + onHidden?: Function; + /** A handler for the hiding event. */ + onHiding?: Function; + /** A handler for the positioning event. */ + onPositioning?: Function; + /** A handler for the showing event. */ + onShowing?: Function; + /** A handler for the shown event. */ + onShown?: Function; + /** An object defining widget positioning options. */ + position?: PositionOptions; + /** Specifies the direction at which submenus are displayed. */ + submenuDirection?: string; + /** The target element associated with a popover. */ + target?: any; + /** A Boolean value specifying whether or not the widget is visible. */ + visible?: boolean; + } + /** A context menu widget. */ + export class dxContextMenu extends dxMenuBase { + constructor(element: JQuery, options?: dxContextMenuOptions); + constructor(element: Element, options?: dxContextMenuOptions); + /** Toggles the visibility of the widget. */ + toggle(showing: boolean): JQueryPromise; + /** Shows the widget. */ + show(): JQueryPromise; + /** Hides the widget. */ + hide(): JQueryPromise; + } + export interface dxRemoteOperations { + /** Specifies whether or not filtering must be performed on the server side. */ + filtering?: boolean; + /** Specifies whether or not paging must be performed on the server side. */ + paging?: boolean; + /** Specifies whether or not sorting must be performed on the server side. */ + sorting?: boolean; + } + export interface dxDataGridColumn { + /** Specifies the content alignment within column cells. */ + alignment?: string; + /** Specifies whether the values in a column can be edited at runtime. Setting this option makes sense only when editing is enabled for a grid. */ + allowEditing?: boolean; + /** Specifies whether or not a column can be used for filtering grid records. Setting this option makes sense only when the filter row and column header filtering are visible. */ + allowFiltering?: boolean; + /** Specifies whether or not the column can be anchored to a grid edge by end users. Setting this option makes sense only when the columnFixing | enabled option is set to true. */ + allowFixing?: boolean; + /** Specifies if a column can be used for searching grid records. Setting this option makes sense only when the search panel is visible. */ + allowSearch?: boolean; + /** Specifies whether a column can be used for grouping grid records at runtime. Setting this option makes sense only when the group panel is visible. */ + allowGrouping?: boolean; + /** Specifies whether or not a column can be hidden by a user. Setting this option makes sense only when the column chooser is visible. */ + allowHiding?: boolean; + /** Specifies whether or not a particular column can be used in column reordering. Setting this option makes sense only when the allowColumnReordering option is set to true. */ + allowReordering?: boolean; + /** Specifies whether or not a particular column can be resized by a user. Setting this option makes sense only when the allowColumnResizing option is true. */ + allowResizing?: boolean; + /** Specifies whether grid records can be sorted by a specific column at runtime. Setting this option makes sense only when the sorting mode differs from none. */ + allowSorting?: boolean; + /** Specifies whether groups appear expanded or not when records are grouped by a specific column. Setting this option makes sense only when grouping is allowed for this column. */ + autoExpandGroup?: boolean; + /** Specifies a callback function that returns a value to be displayed in a column cell. */ + calculateCellValue?: (rowData: Object) => string; + /** Specifies a callback function that defines filters for customary calculated grid cells. */ + calculateFilterExpression?: (filterValue: any, selectedFilterOperation: string) => Array; + /** Specifies a caption for a column. */ + caption?: string; + /** Specifies a custom template for grid column cells. */ + cellTemplate?: any; + /** Specifies a CSS class to be applied to a column. */ + cssClass?: string; + /** Specifies a field name or a function that returns a field name or a value to be used for grouping column cells. */ + calculateGroupValue?: any; + /** Specifies a field name or a function that returns a field name or a value to be used for sorting column cells. */ + calculateSortValue?: any; + /** Specifies a callback function that returns the text to be displayed in the cells of a column. */ + customizeText?: (cellInfo: { value: any; valueText: string }) => string; + /** Specifies the field of a data source that provides data for a column. */ + dataField?: string; + /** Specifies the required type of column values. */ + dataType?: string; + /** Specifies a custom template for the cell of a grid column when it is in an editing state. */ + editCellTemplate?: any; + /** Specifies whether HTML tags are displayed as plain text or applied to the values of the column. */ + encodeHtml?: boolean; + /** In a boolean column, replaces all false items with a specified text. */ + falseText?: string; + /** Specifies the set of available filter operations. */ + filterOperations?: Array; + /** Specifies a filter value for a column. */ + filterValue?: any; + /** Specifies initial filter values for the column's header filter. */ + filterValues?: Array; + /** Specifies whether to include or exclude the records with the values selected in the column's header filter. */ + filterType?: string; + /** Indicates whether the column takes part in horizontal grid scrolling or is anchored to a grid edge. */ + fixed?: boolean; + /** Specifies the grid edge to which the column is anchored. */ + fixedPosition?: string; + /** Specifies a format for the values displayed in a column. */ + format?: string; + /** Specifies a custom template for the group cell of a grid column. */ + groupCellTemplate?: any; + /** Specifies the index of a column when grid records are grouped by the values of this column. */ + groupIndex?: number; + /** Specifies a custom template for the header of a grid column. */ + headerCellTemplate?: any; + /** Specifies options of a lookup column. */ + lookup?: { + /** Specifies whether or not a user can nullify values of a lookup column. */ + allowClearing?: boolean; + /** Specifies the data source providing data for a lookup column. */ + dataSource?: any; + /** Specifies the expression defining the data source field whose values must be displayed. */ + displayExpr?: any; + /** Specifies the expression defining the data source field whose values must be replaced. */ + valueExpr?: string; + }; + /** Specifies a precision for formatted values displayed in a column. */ + precision?: number; + /** Specifies a filter operation applied to a column. */ + selectedFilterOperation?: string; + /** Specifies whether or not the column displays its values by using editors. */ + showEditorAlways?: boolean; + /** Specifies whether or not to display the column when grid records are grouped by it. */ + showWhenGrouped?: boolean; + /** Specifies the index of a column when grid records are sorted by the values of this column. */ + sortIndex?: number; + /** Specifies the initial sort order of column values. */ + sortOrder?: string; + /** In a boolean column, replaces all true items with a specified text. */ + trueText?: string; + /** Specifies whether a column is visible or not. */ + visible?: boolean; + /** Specifies the sequence number of the column in the grid. */ + visibleIndex?: number; + /** Specifies a column width in pixels or percentages. */ + width?: any; + /** Specifies an array of validation rules to be checked when updating column cell values. */ + validationRules?: Array; + /** Specifies whether or not to display the header of a hidden column in the column chooser. */ + showInColumnChooser?: boolean; + /** Specifies the identifier of the column. */ + name?: string; + // NOTE https://github.com/borisyankov/DefinitelyTyped/pull/5590 + text?: string; + value?: any; + } + export interface dxDataGridOptions extends WidgetOptions { + /** Specifies whether the outer borders of the grid are visible or not. */ + showBorders?: boolean; + /** Indicates whether to show the error row for the grid. */ + errorRowEnabled?: boolean; + /** A handler for the rowValidating event. */ + onRowValidating?: (e: Object) => void; + /** A handler for the contextMenuPreparing event. */ + onContextMenuPreparing?: (e: Object) => void; + initNewRow?: (e: { data: Object }) => void; + /** A handler for the initNewRow event. */ + onInitNewRow?: (e: { data: Object }) => void; + rowInserted?: (e: { data: Object; key: any }) => void; + /** A handler for the rowInserted event. */ + onRowInserted?: (e: { data: Object; key: any }) => void; + rowInserting?: (e: { data: Object; cancel: boolean }) => void; + /** A handler for the rowInserting event. */ + onRowInserting?: (e: { data: Object; cancel: boolean }) => void; + rowRemoved?: (e: { data: Object; key: any }) => void; + /** A handler for the rowRemoved event. */ + onRowRemoved?: (e: { data: Object; key: any }) => void; + rowRemoving?: (e: { data: Object; key: any; cancel: boolean }) => void; + /** A handler for the rowRemoving event. */ + onRowRemoving?: (e: { data: Object; key: any; cancel: boolean }) => void; + rowUpdated?: (e: { data: Object; key: any }) => void; + /** A handler for the rowUpdated event. */ + onRowUpdated?: (e: { data: Object; key: any }) => void; + rowUpdating?: (e: { oldData: Object; newData: Object; key: any; cancel: boolean }) => void; + /** A handler for the rowUpdating event. */ + onRowUpdating?: (e: { oldData: Object; newData: Object; key: any; cancel: boolean }) => void; + /** Enables a hint that appears when a user hovers the mouse pointer over a cell with truncated content. */ + cellHintEnabled?: boolean; + /** Specifies whether or not grid columns can be reordered by a user. */ + allowColumnReordering?: boolean; + /** Specifies whether or not grid columns can be resized by a user. */ + allowColumnResizing?: boolean; + cellClick?: any; + /** A handler for the cellClick event. */ + onCellClick?: any; + cellHoverChanged?: (e: Object) => void; + /** A handler for the cellHoverChanged event. */ + onCellHoverChanged?: (e: Object) => void; + cellPrepared?: (e: Object) => void; + /** A handler for the cellPrepared event. */ + onCellPrepared?: (e: Object) => void; + /** Specifies whether or not the width of grid columns depends on column content. */ + columnAutoWidth?: boolean; + /** Specifies the options of a column chooser. */ + columnChooser?: { + /** Specifies text displayed by the column chooser panel when it does not contain any columns. */ + emptyPanelText?: string; + /** Specifies whether a user can invoke the column chooser or not. */ + enabled?: boolean; + /** Specifies the height of the column chooser panel. */ + height?: number; + /** Specifies text displayed in the title of the column chooser panel. */ + title?: string; + /** Specifies the width of the column chooser panel. */ + width?: number; + }; + /** Specifies options for column fixing. */ + columnFixing?: { + /** Indicates if column fixing is enabled. */ + enabled?: boolean; + /** Contains options that specify texts for column-fixing related commands in the column header's context menu. */ + texts?: { + /** Specifies text for a context menu item that fixes the column for which the context menu is invoked. */ + fix?: string; + /** Specifies text for a context menu item that unfixes the column for which the context menu is invoked. */ + unfix?: string; + /** Specifies text for a context menu subitem that fixes a column, for which the context menu is invoked, to the left grid edge. */ + leftPosition?: string; + /** Specifies text for a context menu subitem that fixes a column, for which the context menu is invoked, to the right grid edge. */ + rightPosition?: string; + }; + }; + /** Specifies options for filtering using a column header filter. */ + headerFilter?: { + /** Indicates whether or not the column header filter button is visible. */ + visible?: boolean; + /** Specifies the height of the dropdown menu invoked when using a column header filter. */ + height?: number; + /** Specifies the width of the dropdown menu invoked when using a column header filter. */ + width?: number; + /** Contains options that specify texts for the dropdown menu invoked when you use a column header filter. */ + texts?: { + /** Specifies text for the item specifying an empty value in the column header filter's dropdown menu. */ + emptyValue?: string; + /** Specifies text for a button that closes the column header filter's dropdown menu and applies specified filtering. */ + ok?: string; + /** Specifies text for a button that closes the column header filter's dropdown menu without applying performed selection. */ + cancel?: string; + } + }; + /** An array of grid columns. */ + columns?: Array; + onContentReady?: Function; + contentReadyAction?: Function; + /** Specifies a function that customizes grid columns after they are created. */ + customizeColumns?: (columns: Array) => void; + dataErrorOccurred?: (errorObject: Error) => void; + /** Specifies a data source for the grid. */ + dataSource?: any; + editingStart?: (e: { + data: Object; + key: any; + cancel: boolean; + column: dxDataGridColumn + }) => void; + /** A handler for the editingStart event. */ + onEditingStart?: (e: { + data: Object; + key: any; + cancel: boolean; + column: dxDataGridColumn + }) => void; + editorPrepared?: (e: Object) => void; + /** A handler for the editorPrepared event. */ + onEditorPrepared?: (e: Object) => void; + editorPreparing?: (e: Object) => void; + /** A handler for the editorPreparing event. */ + onEditorPreparing?: (e: Object) => void; + /** Contains options that specify how grid content can be changed. */ + editing?: { + /** Specifies whether or not grid records can be edited at runtime. */ + editEnabled?: boolean; + /** Specifies how grid values can be edited manually. */ + editMode?: string; + /** Specifies whether or not new records can be inserted into a grid. */ + insertEnabled?: boolean; + /** Specifies whether or not records can be deleted from a grid. */ + removeEnabled?: boolean; + /** Contains options that specify texts for editing-related grid controls. */ + texts?: { + /** Specifies text for a hint that appears when a user hovers the mouse pointer over the "Save" button. Setting this option makes sense only when the editMode option is set to batch. */ + saveAllChanges?: string; + /** Specifies text for a cancel button displayed when a row is in the editing state. Setting this option makes sense only when the editEnabled option is set to true. */ + cancelRowChanges?: string; + /** Specifies text for a hint that appears when a user hovers the mouse pointer over the "Revert" button. Setting this option makes sense only when the editMode option is set to batch. */ + cancelAllChanges?: string; + /** Specifies a message to be displayed by a confirmation window. Setting this option makes sense only when the edit mode is "row". */ + confirmDeleteMessage?: string; + /** Specifies text to be displayed in the title of a confirmation window. Setting this option makes sense only when the edit mode is "row". */ + confirmDeleteTitle?: string; + /** Specifies text for a button that deletes a row from a grid. Setting this option makes sense only when the removeEnabled option is set to true. */ + deleteRow?: string; + /** Specifies text for a hint that appears when a user hovers the mouse pointer over the "Add" button. Setting this option makes sense only when the insertEnabled option is true. */ + addRow?: string; + /** Specifies text for a button that turns a row into the editing state. Setting this option makes sense only when the editEnabled option is set to true. */ + editRow?: string; + /** Specifies text for a save button displayed when a row is in the editing state. Setting this option makes sense only when the editEnabled option is set to true. */ + saveRowChanges?: string; + /** Specifies text for a button that recovers a deleted row. Setting this option makes sense only if the grid uses the batch edit mode and the removeEnabled option is set to true. */ + undeleteRow?: string; + }; + }; + /** Specifies filter row options. */ + filterRow?: { + /** Specifies when to apply a filter. */ + applyFilter?: string; + /** Specifies text for the hint that pops up when a user hovers the mouse pointer over the "Apply Filter" button. */ + applyFilterText?: string; + /** Specifies descriptions for filter operations. */ + operationDescriptions?: { + "=": string; + "<>": string; + "<": string; + "<=": string; + ">": string; + ">=": string; + "startswith": string; + "contains": string; + "notcontains": string; + "endswith": string; + }; + /** Specifies text for the reset operation in a filter list. */ + resetOperationText?: string; + /** Specifies text for the operation of clearing the applied filter when a select box is used. */ + showAllText?: string; + /** Specifies whether or not an icon that allows the user to choose a filter operation is visible. */ + showOperationChooser?: boolean; + /** Specifies whether the filter row is visible or not. */ + visible?: boolean; + }; + /** Specifies the behavior of grouped grid records. */ + grouping?: { + /** Specifies whether the user can collapse grouped records in a grid or not. */ + allowCollapsing?: boolean; + /** Specifies whether groups appear expanded or not. */ + autoExpandAll?: boolean; + /** Specifies the message displayed in a group row when the corresponding group is continued from the previous page. */ + groupContinuedMessage?: string; + /** Specifies the message displayed in a group row when the corresponding group continues on the next page. */ + groupContinuesMessage?: string; + }; + /** Specifies options that configure the group panel. */ + groupPanel?: { + /** Specifies whether columns can be dragged onto or from the group panel. */ + allowColumnDragging?: boolean; + /** Specifies text displayed by the group panel when it does not contain any columns. */ + emptyPanelText?: string; + /** Specifies whether the group panel is visible or not. */ + visible?: boolean; + }; + /** Specifies options configuring the load panel. */ + loadPanel?: { + /** Specifies whether to show the load panel or not. */ + enabled?: boolean; + /** Specifies the height of the load panel in pixels. */ + height?: number; + /** Specifies a URL pointing to an image to be used as a loading indicator. */ + indicatorSrc?: string; + /** Specifies whether or not a loading indicator must be displayed on the load panel. */ + showIndicator?: boolean; + /** Specifies whether or not the pane of the load panel must be displayed. */ + showPane?: boolean; + /** Specifies text displayed by the load panel. */ + text?: string; + /** Specifies the width of the load panel in pixels. */ + width?: number; + }; + /** Specifies text displayed when a grid does not contain any records. */ + noDataText?: string; + /** Specifies the options of a grid pager. */ + pager?: { + /** Specifies the page sizes that can be selected at runtime. */ + allowedPageSizes?: any; + /** Specifies whether to show the page size selector or not. */ + showPageSizeSelector?: boolean; + /** Specifies whether to show the pager or not. */ + visible?: any; + /** Specifies the text accompanying the page navigator. */ + infoText?: string; + /** Specifies whether or not to display the text accompanying the page navigator. This text is specified by the infoText option. */ + showInfo?: boolean; + /** Specifies whether or not to display buttons that switch the grid to the previous or next page. */ + showNavigationButtons?: boolean; + }; + /** Specifies paging options. */ + paging?: { + /** Specifies whether dxDataGrid loads data page by page or all at once. */ + enabled?: boolean; + /** Specifies the grid page that should be displayed by default. */ + pageIndex?: number; + /** Specifies the size of grid pages. */ + pageSize?: number; + }; + /** Specifies whether or not grid rows must be shaded in a different way. */ + rowAlternationEnabled?: boolean; + rowClick?: any; + /** A handler for the rowClick event. */ + onRowClick?: any; + rowPrepared?: (e: Object) => void; + /** A handler for the rowPrepared event. */ + onRowPrepared?: (e: Object) => void; + /** Specifies a custom template for grid rows. */ + rowTemplate?: any; + /** A configuration object specifying scrolling options. */ + scrolling?: { + /** Specifies the scrolling mode. */ + mode?: string; + /** Specifies whether or not a grid must preload pages adjacent to the current page when using virtual scrolling. */ + preloadEnabled?: boolean; + }; + /** Specifies options of the search panel. */ + searchPanel?: { + /** Specifies whether or not search strings in the located grid records should be highlighted. */ + highlightSearchText?: boolean; + /** Specifies text displayed by the search panel when no search string was typed. */ + placeholder?: string; + /** Specifies whether the search panel is visible or not. */ + visible?: boolean; + /** Specifies the width of the search panel in pixels. */ + width?: number; + /** Sets a search string for the search panel. */ + text?: string; + }; + /** Specifies the operations that must be performed on the server side. */ + remoteOperations?: any; + /** Allows you to sort groups according to the values of group summary items. */ + sortByGroupSummaryInfo?: Array<{ + /** Specifies the group summary item whose values must be used to sort groups. */ + summaryItem?: string; + /** Specifies the identifier of the column that must be used in grouping so that sorting by group summary item values be applied. */ + groupColumn?: string; + /** Specifies the sort order of group summary item values. */ + sortOrder?: string; + }>; + /** Allows you to build a master-detail interface in the grid. */ + masterDetail?: { + /** Enables an end-user to expand/collapse detail sections. */ + enabled?: boolean; + /** Specifies whether detail sections appear expanded or collapsed. */ + autoExpandAll?: boolean; + /** Specifies the template for detail sections. */ + template?: any; + }; + /** Specifies options for exporting grid data. */ + export?: { + /** Indicates if the export feature is enabled in the grid. */ + enabled?: boolean; + /** Specifies a default name for the file to which grid data is exported. */ + fileName?: string; + /** Specifies whether to enable Excel filtering for the exported data in the resulting XLSX file. */ + excelFilterEnabled?: boolean; + /** Specifies whether to enable word wrapping for the exported data in the resulting XLSX file. */ + excelWrapTextEnabled?: boolean; + /** Specifies the URL of the server-side proxy that streams the resulting file to the end user to enable export in IE8, IE9 and Safari browsers. */ + proxyUrl?: string; + /** Indicates whether to allow end users to export not only the data displayed in the grid, but the selected rows only. */ + allowExportSelectedData?: boolean; + /** Contains options that specify texts for the export-related commands and hints. */ + texts?: { + /** Specifies text for the Export button when this button invokes a dropdown menu so you can choose the required export format. */ + exportTo?: string; + /** Specifies text for the Export button when this button exports to the XSLX format. */ + exportToExcel?: string; + /** Specifies text for the item in the Export dropdown menu that exports grid data to Excel. */ + excelFormat?: string; + /** Specifies text for the option in the Export dropdown menu that allows you to choose whether to export all the grid data or the selected rows only. */ + selectedRows?: string; + } + }; + /** Specifies the keys of the records that must appear selected initially. */ + selectedRowKeys?: Array; + /** Specifies options of runtime selection. */ + selection?: { + /** Specifies whether the user can select all grid records at once. */ + allowSelectAll?: boolean; + /** Specifies the selection mode. */ + mode?: string; + }; + selectionChanged?: (e: { + currentSelectedRowKeys: Array; + currentDeselectedRowKeys: Array; + selectedRowKeys: Array; + selectedRowsData: Array; + }) => void; + /** A handler for the dataErrorOccured event. */ + onDataErrorOccurred?: (e: { error: Error }) => void; + /** A handler for the selectionChanged event. */ + onSelectionChanged?: (e: { + currentSelectedRowKeys: Array; + currentDeselectedRowKeys: Array; + selectedRowKeys: Array; + selectedRowsData: Array; + }) => void; + /** A handler for the exporting event. */ + onExporting?: (e: { + fileName: string; + format: string; + cancel: boolean; + }) => void; + /** A handler for the exported event. */ + onExported?: (e: Object) => void; + /** A handler for the keyDown event. */ + onKeyDown?: (e: Object) => void; + /** A handler for the rowExpanding event. */ + onRowExpanding?: (e: Object) => void; + /** A handler for the rowExpanded event. */ + onRowExpanded?: (e: Object) => void; + /** A handler for the rowCollapsing event. */ + onRowCollapsing?: (e: Object) => void; + /** A handler for the rowCollapsed event. */ + onRowCollapsed?: (e: Object) => void; + /** Specifies whether column headers are visible or not. */ + showColumnHeaders?: boolean; + /** Specifies whether or not vertical lines separating one grid column from another are visible. */ + showColumnLines?: boolean; + /** Specifies whether or not horizontal lines separating one grid row from another are visible. */ + showRowLines?: boolean; + /** Specifies options of runtime sorting. */ + sorting?: { + /** Specifies text for the context menu item that sets an ascending sort order in a column. */ + ascendingText?: string; + /** Specifies text for the context menu item that resets sorting settings for a column. */ + clearText?: string; + /** Specifies text for the context menu item that sets a descending sort order in a column. */ + descendingText?: string; + /** Specifies the runtime sorting mode. */ + mode?: string; + }; + /** Specifies options of state storing. */ + stateStoring?: { + /** Specifies a callback function that performs specific actions on state loading. */ + customLoad?: () => JQueryPromise; + /** Specifies a callback function that performs specific actions on state saving. */ + customSave?: (gridState: Object) => void; + /** Specifies whether or not a grid saves its state. */ + enabled?: boolean; + /** Specifies the delay between the last change of a grid state and the operation of saving this state in milliseconds. */ + savingTimeout?: number; + /** Specifies a unique key to be used for storing the grid state. */ + storageKey?: string; + /** Specifies the type of storage to be used for state storing. */ + type?: string; + }; + /** Specifies the options of the grid summary. */ + summary?: { + /** Contains options that specify text patterns for summary items. */ + texts?: { + /** Specifies a pattern for the 'sum' summary items when they are displayed in the parent column. */ + sum?: string; + /** Specifies a pattern for the 'sum' summary items displayed in a group row or in any other column rather than the parent one. */ + sumOtherColumn?: string; + /** Specifies a pattern for the 'min' summary items when they are displayed in the parent column. */ + min?: string; + /** Specifies a pattern for the 'min' summary items displayed in a group row or in any other column rather than the parent one. */ + minOtherColumn?: string; + /** Specifies a pattern for the 'max' summary items when they are displayed in the parent column. */ + max?: string; + /** Specifies a pattern for the 'max' summary items displayed in a group row or in any other column rather than the parent one. */ + maxOtherColumn?: string; + /** Specifies a pattern for the 'avg' summary items when they are displayed in the parent column. */ + avg?: string; + /** Specifies a pattern for the 'avg' summary items displayed in a group row or in any other column rather than the parent one. */ + avgOtherColumn?: string; + /** Specifies a pattern for the 'count' summary items. */ + count?: string; + }; + /** Specifies items of the group summary. */ + groupItems?: Array<{ + /** Specifies the identifier of a summary item. */ + name?: string; + /** Specifies the column that provides data for a group summary item. */ + column?: string; + /** Customizes the text to be displayed in the summary item. */ + customizeText?: (itemInfo: { + value: any; + valueText: string; + }) => string; + /** Specifies a pattern for the summary item text. */ + displayFormat?: string; + /** Specifies a precision for the summary item value of a numeric format. */ + precision?: number; + /** Specifies whether or not a summary item must be displayed in the group footer. */ + showInGroupFooter?: boolean; + /** Indicates whether to display group summary items in parentheses after the group row header or to align them by the corresponding columns within the group row. */ + alignByColumn?: boolean; + /** Specifies the column that must hold the summary item when this item is displayed in the group footer or aligned by a column in the group row. */ + showInColumn?: string; + /** Specifies how to aggregate data for a summary item. */ + summaryType?: string; + /** Specifies a format for the summary item value. */ + valueFormat?: string; + }>; + /** Specifies items of the total summary. */ + totalItems?: Array<{ + /** Specifies the identifier of a summary item. */ + name?: string; + /** Specifies the alignment of a summary item. */ + alignment?: string; + /** Specifies the column that provides data for a summary item. */ + column?: string; + /** Specifies a CSS class to be applied to a summary item. */ + cssClass?: string; + /** Customizes the text to be displayed in the summary item. */ + customizeText?: (itemInfo: { + value: any; + valueText: string; + }) => string; + /** Specifies a pattern for the summary item text. */ + displayFormat?: string; + /** Specifies a precision for the summary item value of a numeric format. */ + precision?: number; + /** Specifies the column that must hold the summary item. */ + showInColumn?: string; + /** Specifies how to aggregate data for a summary item. */ + summaryType?: string; + /** Specifies a format for the summary item value. */ + valueFormat?: string; + }>; + /** Allows you to use a custom aggregate function to calculate the value of a summary item. */ + calculateCustomSummary?: (options: { + component: dxDataGrid; + name?: string; + value: any; + totalValue: any; + summaryProcess: string + }) => void; + }; + /** Specifies whether text that does not fit into a column should be wrapped. */ + wordWrapEnabled?: boolean; + } + /** A data grid widget. */ + export class dxDataGrid extends Widget { + constructor(element: JQuery, options?: dxDataGridOptions); + constructor(element: Element, options?: dxDataGridOptions); + /** Ungroups grid records. */ + clearGrouping(): void; + /** Clears sorting settings of all grid columns at once. */ + clearSorting(): void; + /** Allows you to obtain a cell by its row index and the data field of its column. */ + getCellElement(rowIndex: number, dataField: string): any; + /** Allows you to obtain a cell by its row index and the visible index of its column. */ + getCellElement(rowIndex: number, visibleColumnIndex: number): any; + /** Returns the current state of the grid. */ + state(): Object; + /** Sets the grid state. */ + state(state: Object): void; + /** Allows you to obtain the row index by a data key. */ + getRowIndexByKey(key: any): number; + /** Allows you to obtain the data key by a row index. */ + getKeyByRowIndex(rowIndex: number): any; + /** Adds a new column to a grid. */ + addColumn(columnOptions: dxDataGridColumn): void; + /** Displays the load panel. */ + beginCustomLoading(messageText: string): void; + /** Discards changes made in a grid. */ + cancelEditData(): void; + /** Clears all the filters of a specific type applied to grid records. */ + clearFilter(): void; + /** Deselects all grid records. */ + clearSelection(): void; + /** Draws the cell being edited from the editing state. Use this method when the edit mode is batch. */ + closeEditCell(): void; + /** Collapses groups or master rows in a grid. */ + collapseAll(groupIndex?: number): void; + /** Returns the number of data columns in a grid. */ + columnCount(): number; + /** Returns the value of a specific column option. */ + columnOption(id: any, optionName: string): any; + /** Sets an option of a specific column. */ + columnOption(id: any, optionName: string, optionValue: any): void; + /** Returns the options of a column by an identifier. */ + columnOption(id: any): Object; + /** Sets several options of a column at once. */ + columnOption(id: any, options: Object): void; + /** Sets a specific cell into the editing state. */ + editCell(rowIndex: number, columnIndex: number): void; + /** Sets a specific row into the editing state. */ + editRow(rowIndex: number): void; + /** Hides the load panel. */ + endCustomLoading(): void; + /** Expands groups or master rows in a grid. */ + expandAll(groupIndex: number): void; + /** Allows you to find out whether a specific group or master row is expanded or collapsed. */ + isRowExpanded(key: any): boolean; + /** Allows you to expand a specific group or master row by its key. */ + expandRow(key: any): void; + /** Allows you to collapse a specific group or master row by its key. */ + collapseRow(key: any): void; + /** Applies a filter to the grid's data source. */ + filter(filterExpr?: any): void; + /** Returns a filter expression applied to the grid's data source using the filter(filterExpr) method. */ + filter(): any; + /** Returns a filter expression applied to the grid using all possible scenarious. */ + getCombinedFilter(): any; + /** Gets the keys of currently selected grid records. */ + getSelectedRowKeys(): Array; + /** Gets the data objects of currently selected grid records. */ + getSelectedRowsData(): Array; + /** Hides the column chooser panel. */ + hideColumnChooser(): void; + /** Adds a new data row to a grid. */ + insertRow(): void; + /** Returns the key corresponding to the passed data object. */ + keyOf(obj: Object): any; + /** Switches a grid to a specified page. */ + pageIndex(newIndex: number): void; + /** Gets the index of the current page. */ + pageIndex(): number; + /** Sets the page size. */ + pageSize(value: number): void; + /** Gets the current page size. */ + pageSize(): number; + /** Refreshes grid data. */ + refresh(): void; + /** Removes a specific row from a grid. */ + removeRow(rowIndex: number): void; + /** Saves changes made in a grid. */ + saveEditData(): void; + /** Searches grid records by a search string. */ + searchByText(text: string): void; + /** Selects all grid records. */ + selectAll(): void; + /** Deselects the rows that are currently selected within the applied filter. */ + deselectAll(): void; + /** Selects specific grid records. */ + selectRows(keys: Array, preserve: boolean): void; + /** Deselects specific grid records. */ + deselectRows(keys: Array): void; + /** Selects grid rows by indexes. */ + selectRowsByIndexes(indexes: Array): void; + /** Allows you to find out whether a row is selected or not. */ + isRowSelected(key: any): boolean; + /** Invokes the column chooser panel. */ + showColumnChooser(): void; + startSelectionWithCheckboxes(): boolean; + /** Returns the number of records currently held by a grid. */ + totalCount(): number; + /** Recovers a row deleted in the batch edit mode. */ + undeleteRow(rowIndex: number): void; + /** Allows you to obtain a data object by its key. */ + byKey(key: any): JQueryPromise; + /** Gets the value of a total summary item. */ + getTotalSummaryValue(summaryItemName: string): any; + /** Exports grid data to Excel. */ + exportToExcel(selectionOnly: boolean): void; + /** Updates the grid to the size of its content. */ + updateDimensions(): void; + /** Focuses the specified cell element in the grid. */ + focus(element?: JQuery): void; + } + export interface dxPivotGridOptions extends WidgetOptions { + onContentReady?: Function; + /** Specifies a data source for the pivot grid. */ + dataSource?: any; + /** Specifies whether or not the widget uses native scrolling. */ + useNativeScrolling?: any; + /** Allows an end-user to change sorting options. */ + allowSorting?: boolean; + /** Allows an end-user to sort columns by summary values. */ + allowSortingBySummary?: boolean; + /** Allows an end-user to change filtering options. */ + allowFiltering?: boolean; + /** Allows an end-user to expand/collapse all header items within a header level. */ + allowExpandAll?: boolean; + /** Specifies whether to display the Total rows. */ + showRowTotals?: boolean; + /** Specifies whether to display the Grand Total row. */ + showRowGrandTotals?: boolean; + /** Specifies whether to display the Total columns. */ + showColumnTotals?: boolean; + /** Specifies whether to display the Grand Total column. */ + showColumnGrandTotals?: boolean; + /** The Field Chooser configuration options. */ + fieldChooser?: { + /** Enables or disables the field chooser. */ + enabled?: boolean; + /** Specifies the field chooser layout. */ + layout?: number; + /** Specifies the text to display as a title of the field chooser popup window. */ + title?: string; + /** Specifies the field chooser width. */ + width?: number; + /** Specifies the field chooser height. */ + height?: number; + /** Strings that can be changed or localized in the pivot grid's integrated Field Chooser. */ + texts?: { + /** The string to display instead of Row Fields. */ + rowFields?: string; + /** The string to display instead of Column Fields. */ + columnFields?: string; + /** The string to display instead of Data Fields. */ + dataFields?: string; + /** The string to display instead of Filter Fields. */ + filterFields?: string; + /** The string to display instead of All Fields. */ + allFields?: string; + }; + } + /** Strings that can be changed or localized in the dxPivotGrid widget. */ + texts?: { + /** The string to display as a header of the Grand Total row and column. */ + grandTotal?: string; + /** The string to display as a header of the Total row and column. */ + total?: string; + /** Specifies the text displayed when a pivot grid does not contain any fields. */ + noData?: string; + /** The string to display as a Show Field Chooser context menu item. */ + showFieldChooser?: string; + /** The string to display as an Expand All context menu item. */ + expandAll?: string; + /** The string to display as a Collapse All context menu item. */ + collapseAll?: string; + /** The string to display as a Sort Column by Summary Value context menu item. */ + sortColumnBySummary?: string; + /** The string to display as a Sort Row by Summary Value context menu item. */ + sortRowBySummary?: string; + /** The string to display as a Remove All Sorting context menu item. */ + removeAllSorting?: string; + }; + /** The Load panel configuration options. */ + loadPanel?: { + /** Enables or disables the load panel. */ + enabled?: boolean; + /** Specifies the height of the load panel. */ + height?: number; + /** Specifies the URL pointing to an image that will be used as a load indicator. */ + indicatorSrc?: string; + /** Specifies whether or not to show a load indicator. */ + showIndicator?: boolean; + /** Specifies whether or not to show load panel background. */ + showPane?: boolean; + /** Specifies the text to display inside a load panel. */ + text?: string; + /** Specifies the width of the load panel. */ + width?: number; + }; + /** A handler for the cellClick event. */ + onCellClick?: (e: any) => void; + /** A handler for the cellPrepared event. */ + onCellPrepared?: (e: any) => void; + /** A handler for the contextMenuPreparing event. */ + onContextMenuPreparing?: (e: Object) => void; + } + /** A data summarization widget for multi-dimensional data analysis and data mining. */ + export class dxPivotGrid extends Widget { + constructor(element: JQuery, options?: dxPivotGridOptions); + constructor(element: Element, options?: dxPivotGridOptions); + /** Gets the PivotGridDataSource instance. */ + getDataSource(): DevExpress.data.PivotGridDataSource; + /** Updates the widget to the size of its content. */ + updateDimensions(): void; + } + export interface dxPivotGridFieldChooserOptions extends WidgetOptions { + /** Specifies the height of the widget. */ + height?: any; + /** Specifies the field chooser layout. */ + layout?: number; + /** The data source of a dxPivotGrid widget. */ + dataSource?: DevExpress.data.PivotGridDataSource; + onContentReady?: Function; + /** Strings that can be changed or localized in the dxPivotGridFieldChooser widget. */ + texts?: { + /** The string to display instead of Row Fields. */ + rowFields?: string; + /** The string to display instead of Column Fields. */ + columnFields?: string; + /** The string to display instead of Data Fields. */ + dataFields?: string; + /** The string to display instead of Filter Fields. */ + filterFields?: string; + /** The string to display instead of All Fields. */ + allFields?: string; + }; + } + /** A complementary widget for dxPivotGrid that allows you to manage data displayed in the dxPivotGrid. */ + export class dxPivotGridFieldChooser extends Widget { + constructor(element: JQuery, options?: dxPivotGridFieldChooserOptions); + constructor(element: Element, options?: dxPivotGridFieldChooserOptions); + /** Updates the widget to the size of its content. */ + updateDimensions(): void; + } +} +interface JQuery { + dxTreeView(): JQuery; + dxTreeView(options: "instance"): DevExpress.ui.dxTreeView; + dxTreeView(options: string): any; + dxTreeView(options: string, ...params: any[]): any; + dxTreeView(options: DevExpress.ui.dxTreeViewOptions): JQuery; + dxMenuBase(): JQuery; + dxMenuBase(options: "instance"): DevExpress.ui.dxMenuBase; + dxMenuBase(options: string): any; + dxMenuBase(options: string, ...params: any[]): any; + dxMenuBase(options: DevExpress.ui.dxMenuBaseOptions): JQuery; + dxMenu(): JQuery; + dxMenu(options: "instance"): DevExpress.ui.dxMenu; + dxMenu(options: string): any; + dxMenu(options: string, ...params: any[]): any; + dxMenu(options: DevExpress.ui.dxMenuOptions): JQuery; + dxContextMenu(): JQuery; + dxContextMenu(options: "instance"): DevExpress.ui.dxContextMenu; + dxContextMenu(options: string): any; + dxContextMenu(options: string, ...params: any[]): any; + dxContextMenu(options: DevExpress.ui.dxContextMenuOptions): JQuery; + dxColorBox(): JQuery; + dxColorBox(options: "instance"): DevExpress.ui.dxColorBox; + dxColorBox(options: string): any; + dxColorBox(options: string, ...params: any[]): any; + dxColorBox(options: DevExpress.ui.dxColorBoxOptions): JQuery; + dxDataGrid(): JQuery; + dxDataGrid(options: "instance"): DevExpress.ui.dxDataGrid; + dxDataGrid(options: string): any; + dxDataGrid(options: string, ...params: any[]): any; + dxDataGrid(options: DevExpress.ui.dxDataGridOptions): JQuery; + dxPivotGrid(): JQuery; + dxPivotGrid(options: "instance"): DevExpress.ui.dxPivotGrid; + dxPivotGrid(options: string): any; + dxPivotGrid(options: string, ...params: any[]): any; + dxPivotGrid(options: DevExpress.ui.dxPivotGridOptions): JQuery; + dxPivotGridFieldChooser(): JQuery; + dxPivotGridFieldChooser(options: "instance"): DevExpress.ui.dxPivotGridFieldChooser; + dxPivotGridFieldChooser(options: string): any; + dxPivotGridFieldChooser(options: string, ...params: any[]): any; + dxPivotGridFieldChooser(options: DevExpress.ui.dxPivotGridFieldChooserOptions): JQuery; + dxScheduler(): JQuery; + dxScheduler(options: "instance"): DevExpress.ui.dxScheduler; + dxScheduler(options: string): any; + dxScheduler(options: string, ...params: any[]): any; + dxScheduler(options: DevExpress.ui.dxSchedulerOptions): JQuery; +} +declare module DevExpress.framework { + /** An object used to store information on the views displayed in an application. */ + export class ViewCache { + viewRemoved: JQueryCallback; + /** Removes all the viewInfo objects from the cache. */ + clear(): void; + /** Obtains a viewInfo object from the cache by the specified key. */ + getView(key: string): Object; + /** Checks whether or not a viewInfo object is contained in the view cache under the specified key. */ + hasView(key: string): boolean; + /** Removes a viewInfo object from the cache by the specified key. */ + removeView(key: string): Object; + /** Adds the specified viewInfo object to the cache under the specified key. */ + setView(key: string, viewInfo: Object): void; + } + export interface dxCommandOptions extends DOMComponentOptions { + action?: any; + /** Specifies an action performed when the execute() method of the command is called. */ + onExecute?: any; + /** Indicates whether or not the widget that displays this command is disabled. */ + disabled?: boolean; + /** Specifies whether the current command is rendered when a view is being rendered or after a view is shown. */ + renderStage?: string; + /** Specifies the name of the icon shown inside the widget associated with this command. */ + icon?: string; + iconSrc?: string; + /** The identifier of the command. */ + id?: string; + /** Specifies the title of the widget associated with this command. */ + title?: string; + /** Specifies the type of the button, if the command is rendered as a dxButton widget. */ + type?: string; + /** A Boolean value specifying whether or not the widget associated with this command is visible. */ + visible?: boolean; + } + /** A markup component used to define markup options for a command. */ + export class dxCommand extends DOMComponent { + constructor(element: JQuery, options: dxCommandOptions); + constructor(options: dxCommandOptions); + /** Executes the action associated with this command. */ + execute(): void; + } + /** An object responsible for routing. */ + export class Router { + /** Adds a routing rule to the list of registered rules. */ + register(pattern: string, defaults?: Object, constraints?: Object): void; + /** Decodes the specified URI to an object using the registered routing rules. */ + parse(uri: string): Object; + /** Formats an object to a URI. */ + format(obj: Object): string; + } + export interface StateManagerOptions { + /** A storage to which the state manager saves the application state. */ + storage?: Object; + } + /** An object used to store the current application state. */ + export class StateManager { + constructor(options?: StateManagerOptions); + /** Adds an object that implements an interface of a state source to the state manager's collection of state sources. */ + addStateSource(stateSource: Object): void; + /** Removes a specified state source from the state manager's collection of state sources. */ + removeStateSource(stateSource: Object): void; + /** Saves the current application state. */ + saveState(): void; + /** Restores the application state that has been saved by the saveState() method to the state storage. */ + restoreState(): void; + /** Removes the application state that has been saved by the saveState() method to the state storage. */ + clearState(): void; + } + export module html { + export var layoutSets: Array; + export var animationSets: { [animationSetName: string]: AnimationSet }; + export interface AnimationSet { + [animationName: string]: any + } + export interface HtmlApplicationOptions { + /** Specifies where the commands that are defined in the application's views must be displayed. */ + commandMapping?: Object; + /** Specifies whether or not view caching is disabled. */ + disableViewCache?: boolean; + /** An array of layout controllers that should be used to show application views in the current navigation context. */ + layoutSet?: any; + /** Specifies the animation presets that are used to animate different UI elements in the current application. */ + animationSet?: AnimationSet; + /** Specifies whether the current application must behave as a mobile or web application. */ + mode?: string; + /** Specifies the object that represents a root namespace of the application. */ + namespace?: Object; + /** Specifies application behavior when the user navigates to a root view. */ + navigateToRootViewMode?: string; + /** An array of dxCommand configuration objects used to define commands available from the application's global navigation. */ + navigation?: Array; + /** A state manager to be used in the application. */ + stateManager?: StateManager; + /** Specifies the storage to be used by the application's state manager to store the application state. */ + stateStorage?: Object; + /** Indicates whether on not to use the title of the previously displayed view as text on the Back button. */ + useViewTitleAsBackText?: boolean; + /** A custom view cache to be used in the application. */ + viewCache?: Object; + /** Specifies a limit for the views that can be cached. */ + viewCacheSize?: number; + /** Specifies options for the viewport meta tag of a mobile browser. */ + viewPort?: JQuery; + /** A custom router to be used in the application. */ + router?: Router; + } + /** An object used to manage views, as well as control the application life cycle. */ + export class HtmlApplication implements EventsMixin { + constructor(options: HtmlApplicationOptions); + afterViewSetup: JQueryCallback; + beforeViewSetup: JQueryCallback; + initialized: JQueryCallback; + navigating: JQueryCallback; + navigatingBack: JQueryCallback; + resolveLayoutController: JQueryCallback; + viewDisposed: JQueryCallback; + viewDisposing: JQueryCallback; + viewHidden: JQueryCallback; + viewRendered: JQueryCallback; + viewShowing: JQueryCallback; + viewShown: JQueryCallback; + /** Provides access to the ViewCache object. */ + viewCache: ViewCache; + /** An array of dxCommand components that are created based on the application's navigation option value. */ + navigation: Array; + /** Provides access to the StateManager object. */ + stateManager: StateManager; + /** Provides access to the Router object. */ + router: Router; + /** Navigates to the URI preceding the current one in the navigation history. */ + back(): void; + /** Returns a Boolean value indicating whether or not backwards navigation is currently possible. */ + canBack(): boolean; + /** Calls the clearState() method of the application's StateManager object. */ + clearState(): void; + /** Creates global navigation commands. */ + createNavigation(navigationConfig: Array): void; + /** Returns an HTML template of the specified view. */ + getViewTemplate(viewName: string): JQuery; + /** Returns a configuration object used to create a dxView component for a specified view. */ + getViewTemplateInfo(viewName: string): Object; + /** Adds a specified HTML template to a collection of view or layout templates. */ + loadTemplates(source: any): JQueryPromise; + /** Navigates to the specified URI. */ + navigate(uri?: any, options?: Object): void; + /** Renders navigation commands to the navigation command containers that are located in the layouts used in the application. */ + renderNavigation(): void; + /** Calls the restoreState() method of the application's StateManager object. */ + restoreState(): void; + /** Calls the saveState method of the application's StateManager object. */ + saveState(): void; + /** Provides access to the object that defines the current context to be considered when choosing an appropriate template for a view. */ + templateContext(): Object; + on(eventName: "initialized", eventHandler: () => void): HtmlApplication; + on(eventName: "afterViewSetup", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + on(eventName: "beforeViewSetup", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + on(eventName: "navigating", eventHandler: (e: { + currentUri: string; + uri: string; + cancel: boolean; + options: { + root: boolean; + target: string; + direction: string; + rootInDetailPane: boolean; + modal: boolean; + }; + }) => void): HtmlApplication; + on(eventName: "navigatingBack", eventHandler: (e: { + cancel: boolean; + isHardwareButton: boolean; + }) => void): HtmlApplication; + on(eventName: "resolveLayoutController", eventHandler: (e: { + viewInfo: Object; + layoutController: Object; + availableLayoutControllers: Array; + }) => void): HtmlApplication; + on(eventName: "viewDisposed", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + on(eventName: "viewDisposing", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + on(eventName: "viewHidden", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + on(eventName: "viewRendered", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + on(eventName: "viewShowing", eventHandler: (e: { + viewInfo: Object; + direction: string; + }) => void): HtmlApplication; + on(eventName: "viewShown", eventHandler: (e: { + viewInfo: Object; + direction: string; + }) => void): HtmlApplication; + on(eventName: string, eventHandler: Function): HtmlApplication; + on(events: { [eventName: string]: Function; }): HtmlApplication; + off(eventName: "initialized"): HtmlApplication; + off(eventName: "afterViewSetup"): HtmlApplication; + off(eventName: "beforeViewSetup"): HtmlApplication; + off(eventName: "navigating"): HtmlApplication; + off(eventName: "navigatingBack"): HtmlApplication; + off(eventName: "resolveLayoutController"): HtmlApplication; + off(eventName: "viewDisposed"): HtmlApplication; + off(eventName: "viewDisposing"): HtmlApplication; + off(eventName: "viewHidden"): HtmlApplication; + off(eventName: "viewRendered"): HtmlApplication; + off(eventName: "viewShowing"): HtmlApplication; + off(eventName: "viewShown"): HtmlApplication; + off(eventName: string): HtmlApplication; + off(eventName: "initialized", eventHandler: () => void): HtmlApplication; + off(eventName: "afterViewSetup", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + off(eventName: "beforeViewSetup", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + off(eventName: "navigating", eventHandler: (e: { + currentUri: string; + uri: string; + cancel: boolean; + options: { + root: boolean; + target: string; + direction: string; + rootInDetailPane: boolean; + modal: boolean; + }; + }) => void): HtmlApplication; + off(eventName: "navigatingBack", eventHandler: (e: { + cancel: boolean; + isHardwareButton: boolean; + }) => void): HtmlApplication; + off(eventName: "resolveLayoutController", eventHandler: (e: { + viewInfo: Object; + layoutController: Object; + availableLayoutControllers: Array; + }) => void): HtmlApplication; + off(eventName: "viewDisposed", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + off(eventName: "viewDisposing", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + off(eventName: "viewHidden", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + off(eventName: "viewRendered", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + off(eventName: "viewShowing", eventHandler: (e: { + viewInfo: Object; + direction: string; + }) => void): HtmlApplication; + off(eventName: "viewShown", eventHandler: (e: { + viewInfo: Object; + direction: string; + }) => void): HtmlApplication; + off(eventName: string, eventHandler: Function): HtmlApplication; + } + } +} +declare module DevExpress.viz.core { + /** + * Applies a theme for the entire page with several DevExtreme visualization widgets. + * @deprecated Use the DevExpress.viz.currentTheme(theme) method instead. + */ + export function currentTheme(theme: string): void; + /** + * Applies a new theme (with the color scheme defined separately) for the entire page with several DevExtreme visualization widgets. + * @deprecated Use the DevExpress.viz.currentTheme(platform, colorScheme) method instead. + */ + export function currentTheme(platform: string, colorScheme: string): void; + /** + * Registers a new theme based on the existing one. + * @deprecated Use the DevExpress.viz.registerTheme(customTheme, baseTheme) method instead. + */ + export function registerTheme(customTheme: Object, baseTheme: string): void; + /** + * Applies a predefined or registered custom palette to all visualization widgets at once. + * @deprecated Use the DevExpress.viz.currentPalette(paletteName) method instead. + */ + export function currentPalette(paletteName: string): void; + /** + * Obtains the color sets of a predefined or registered palette. + * @deprecated Use the DevExpress.viz.getPalette(paletteName) method instead. + */ + export function getPalette(paletteName: string): Object; + /** + * Registers a new palette. + * @deprecated Use the DevExpress.viz.registerPalette(paletteName, palette) method instead. + */ + export function registerPalette(paletteName: string, palette: Object): void; + export interface Border { + /** Sets a border color for a selected series. */ + color?: string; + /** Sets border visibility for a selected series. */ + visible?: boolean; + /** Sets a border width for a selected series. */ + width?: number; + } + export interface DashedBorder extends Border { + /** Specifies a dash style for the border of a selected series point. */ + dashStyle?: string; + } + export interface DashedBorderWithOpacity extends DashedBorder { + /** Specifies the opacity of the tooltip's border. */ + opacity?: number; + } + export interface Font { + /** Specifies the font color for a strip label. */ + color?: string; + /** Specifies the font family for a strip label. */ + family?: string; + /** Specifies the font opacity for a strip label. */ + opacity?: number; + /** Specifies the font size for a strip label. */ + size?: any; + /** Specifies the font weight for the text displayed in strips. */ + weight?: number; + } + export interface Hatching { + direction?: string; + /** Specifies the opacity of hatching lines. */ + opacity?: number; + /** Specifies the distance between hatching lines in pixels. */ + step?: number; + /** Specifies the width of hatching lines in pixels. */ + width?: number; + } + export interface Margins { + /** Specifies the legend's bottom margin in pixels. */ + bottom?: number; + /** Specifies the legend's left margin in pixels. */ + left?: number; + /** Specifies the legend's right margin in pixels. */ + right?: number; + /** Specifies the legend's bottom margin in pixels. */ + top?: number; + } + export interface Size { + /** Specifies the width of the widget. */ + width?: number; + /** Specifies the height of the widget. */ + height?: number; + } + export interface Tooltip { + /** Specifies the length of the tooltip's arrow in pixels. */ + arrowLength?: number; + /** Specifies the appearance of the tooltip's border. */ + border?: viz.core.DashedBorderWithOpacity; + /** Specifies a color for the tooltip. */ + color?: string; + /** Specifies the z-index for tooltips. */ + zIndex?: number; + container?: any; + /** Specifies text and appearance of a set of tooltips. */ + customizeTooltip?: (arg: Object) => { color?: string; text?: string }; + /** Specifies whether or not the tooltip is enabled. */ + enabled?: boolean; + /** Specifies font options for the text displayed by the tooltip. */ + font?: Font; + /** Specifies a format for the text displayed by the tooltip. */ + format?: string; + /** Specifies the opacity of a tooltip. */ + opacity?: number; + /** Specifies a distance from the tooltip's left/right boundaries to the inner text in pixels. */ + paddingLeftRight?: number; + /** Specifies a distance from the tooltip's top/bottom boundaries to the inner text in pixels. */ + paddingTopBottom?: number; + /** Specifies a precision for formatted values displayed by the tooltip. */ + precision?: number; + /** Specifies options of the tooltip's shadow. */ + shadow?: { + /** Specifies the blur distance of the tooltip's shadow. */ + blur?: number; + /** Specifies the color of the tooltip's shadow. */ + color?: string; + /** Specifies the horizontal offset of the tooltip's shadow relative to the tooltip in pixels. */ + offsetX?: number; + /** Specifies the vertical offset of the tooltip's shadow relative to the tooltip in pixels. */ + offsetY?: number; + /** Specifies the opacity of the tooltip's shadow. */ + opacity?: number; + }; + } + export interface Animation { + /** Determines how long animation runs. */ + duration?: number; + /** Specifies the animation easing mode. */ + easing?: string; + /** Indicates whether or not animation is enabled. */ + enabled?: boolean; + } + export interface LoadingIndicator { + /** Specifies a color for the loading indicator background. */ + backgroundColor?: string; + /** Specifies font options for the loading indicator text. */ + font?: viz.core.Font; + /** Specifies whether to show the loading indicator or not. */ + show?: boolean; + /** Specifies a text to be displayed by the loading indicator. */ + text?: string; + } + export interface LegendBorder extends viz.core.DashedBorderWithOpacity { + /** Specifies a radius for the corners of the legend border. */ + cornerRadius?: number; + } + export interface BaseLegend { + /** Specifies the color of the legend's background. */ + backgroundColor?: string; + /** Specifies legend border settings. */ + border?: viz.core.LegendBorder; + /** Specifies how many columns must be taken to arrange legend items. */ + columnCount?: number; + /** Specifies the spacing between a pair of neighboring legend columns in pixels. */ + columnItemSpacing?: number; + /** Specifies font options for legend items. */ + font?: viz.core.Font; + /** Specifies the legend's position on the map. */ + horizontalAlignment?: string; + /** Specifies the alignment of legend items. */ + itemsAlignment?: string; + /** Specifies the position of text relative to the item marker. */ + itemTextPosition?: string; + /** Specifies the distance between the legend and the container borders in pixels. */ + margin?: viz.core.Margins; + /** Specifies the size of item markers in the legend in pixels. */ + markerSize?: number; + /** Specifies whether to arrange legend items horizontally or vertically. */ + orientation?: string; + /** Specifies the spacing between the legend left/right border and legend items in pixels. */ + paddingLeftRight?: number; + /** Specifies the spacing between the legend top/bottom border and legend items in pixels. */ + paddingTopBottom?: number; + /** Specifies how many rows must be taken to arrange legend items. */ + rowCount?: number; + /** Specifies the spacing between a pair of neighboring legend rows in pixels. */ + rowItemSpacing?: number; + /** Specifies the legend's position on the map. */ + verticalAlignment?: string; + /** Specifies whether or not the legend is visible on the map. */ + visible?: boolean; + } + export interface BaseWidgetOptions { + drawn?: (widget: Object) => void; + /** A handler for the drawn event. */ + onDrawn?: (e: { + component: BaseWidget; + element: Element; + }) => void; + incidentOccured?: (incidentInfo: { + id: string; + type: string; + args: any; + text: string; + widget: string; + version: string; + }) => void; + /** A handler for the incidentOccurred event. */ + onIncidentOccurred?: ( + component: BaseWidget, + element: Element, + target: { + id: string; + type: string; + args: any; + text: string; + widget: string; + version: string; + } + ) => void; + /** Notifies a widget that it is embedded into an HTML page that uses a path modifier. */ + pathModified?: boolean; + /** Specifies whether or not the widget supports right-to-left representation. */ + rtlEnabled?: boolean; + /** Sets the name of the theme to be used in the widget. */ + theme?: string; + } + /** This section describes options and methods that are common to all widgets. */ + export class BaseWidget extends DOMComponent { + /** Returns the widget's SVG markup. */ + svg(): string; + } +} +declare module DevExpress.viz.charts { + /** This section describes the fields and methods that can be used in code to manipulate the Series object. */ + export interface BaseSeries { + /** Provides information about the state of the series object. */ + fullState: number; + /** Returns the type of the series. */ + type: string; + /** Unselects all the selected points of the series. The points are displayed in an initial style. */ + clearSelection(): void; + /** Gets the color of a particular series. */ + getColor(): string; + /** + * Gets a point from the series point collection based on the specified argument. + * @deprecated getPointsByArg(pointArg).md + */ + getPointByArg(pointArg: any): Object; + /** Gets points from the series point collection based on the specified argument. */ + getPointsByArg(pointArg: any): Array; + /** Gets a point from the series point collection based on the specified point position. */ + getPointByPos(positionIndex: number): Object; + /** Selects the series. The series is displayed in a 'selected' style until another series is selected or the current series is deselected programmatically. */ + select(): void; + /** Selects the specified point. The point is displayed in a 'selected' style. */ + selectPoint(point: BasePoint): void; + /** Deselects the specified point. The point is displayed in an initial style. */ + deselectPoint(point: BasePoint): void; + /** Returns an array of all points in the series. */ + getAllPoints(): Array; + /** Returns visible series points. */ + getVisiblePoints(): Array; + } + /** This section describes the methods that can be used in code to manipulate the Point object. */ + export interface BasePoint { + /** Provides information about the state of the point object. */ + fullState: number; + /** Returns the point's argument value that was set in the data source. */ + originalArgument: any; + /** Returns the point's value that was set in the data source. */ + originalValue: any; + /** Returns the tag of the point. */ + tag: string; + /** Deselects the point. */ + clearSelection(): void; + /** Gets the color of a particular point. */ + getColor(): string; + /** Hides the tooltip of the point. */ + hideTooltip(): void; + /** Provides information about the hover state of a point. */ + isHovered(): any; + /** Provides information about the selection state of a point. */ + isSelected(): any; + /** Selects the point. The point is displayed in a 'selected' style until another point is selected or the current point is deselected programmatically. */ + select(): void; + /** Shows the tooltip of the point. */ + showTooltip(): void; + /** Allows you to obtain the label of a series point. */ + getLabel(): any; + /** Returns the series object to which the point belongs. */ + series: BaseSeries; + } + /** This section describes the fields and methods that can be used in code to manipulate the Series object. */ + export interface ChartSeries extends BaseSeries { + /** Returns the name of the series pane. */ + pane: string; + /** Returns the name of the value axis of the series. */ + axis: string; + /** Returns the name of the series. */ + name: string; + /** Returns the tag of the series. */ + tag: string; + /** Hides a series. */ + hide(): void; + /** Provides information about the hover state of a series. */ + isHovered(): any; + /** Provides information about the selection state of a series. */ + isSelected(): any; + /** Provides information about the visibility state of a series. */ + isVisible(): boolean; + /** Makes a particular series visible. */ + show(): void; + selectPoint(point: ChartPoint): void; + deselectPoint(point: ChartPoint): void; + getAllPoints(): Array; + getVisiblePoints(): Array; + } + /** This section describes the methods that can be used in code to manipulate the Point object. */ + export interface ChartPoint extends BasePoint { + /** Contains the close value of the point. This field is useful for points belonging to a series of the candle stick or stock type only. */ + originalCloseValue: any; + /** Contains the high value of the point. This field is useful for points belonging to a series of the candle stick or stock type only. */ + originalHighValue: any; + /** Contains the low value of the point. This field is useful for points belonging to a series of the candle stick or stock type only. */ + originalLowValue: any; + /** Contains the first value of the point. This field is useful for points belonging to a series of the range area or range bar type only. */ + originalMinValue: any; + /** Contains the open value of the point. This field is useful for points belonging to a series of the candle stick or stock type only. */ + originalOpenValue: any; + /** Contains the size of the bubble as it was set in the data source. This field is useful for points belonging to a series of the bubble type only. */ + size: any; + /** Gets the parameters of the point's minimum bounding rectangle (MBR). */ + getBoundingRect(): { x: number; y: number; width: number; height: number; }; + series: ChartSeries; + } + /** This section describes the methods that can be used in code to manipulate the Label object. */ + export interface Label { + /** Gets the parameters of the label's minimum bounding rectangle (MBR). */ + getBoundingRect(): { x: number; y: number; width: number; height: number; }; + /** Hides the point label. */ + hide(): void; + /** Shows the point label. */ + show(): void; + } + export interface PieSeries extends BaseSeries { + selectPoint(point: PiePoint): void; + deselectPoint(point: PiePoint): void; + getAllPoints(): Array; + getVisiblePoints(): Array; + } + /** This section describes the methods that can be used in code to manipulate the Point object. */ + export interface PiePoint extends BasePoint { + /** Gets the percentage value of the specific point. */ + percent: any; + /** Provides information about the visibility state of a point. */ + isVisible(): boolean; + /** Makes a specific point visible. */ + show(): void; + /** Hides a specific point. */ + hide(): void; + series: PieSeries; + } + /** This section describes the fields and methods that can be used in code to manipulate the Series object. */ + export interface PolarSeries extends BaseSeries { + /** Returns the name of the value axis of the series. */ + axis: string; + /** Returns the name of the series. */ + name: string; + /** Returns the tag of the series. */ + tag: string; + /** Hides a series. */ + hide(): void; + /** Provides information about the hover state of a series. */ + isHovered(): any; + /** Provides information about the selection state of a series. */ + isSelected(): any; + /** Provides information about the visibility state of a series. */ + isVisible(): boolean; + /** Makes a particular series visible. */ + show(): void; + selectPoint(point: PolarPoint): void; + deselectPoint(point: PolarPoint): void; + getAllPoints(): Array; + getVisiblePoints(): Array; + } + /** This section describes the methods that can be used in code to manipulate the Point object. */ + export interface PolarPoint extends BasePoint { + series: PolarSeries; + } + export interface Strip { + /** Specifies a color for a strip. */ + color?: string; + /** An object that defines the label configuration options of a strip. */ + label?: { + /** Specifies the text displayed in a strip. */ + text?: string; + }; + /** Specifies a start value for a strip. */ + startValue?: any; + /** Specifies an end value for a strip. */ + endValue?: any; + } + export interface BaseSeriesConfigLabel { + /** Specifies a format for arguments displayed by point labels. */ + argumentFormat?: string; + /** Specifies a precision for formatted point arguments displayed in point labels. */ + argumentPrecision?: number; + /** Specifies a background color for point labels. */ + backgroundColor?: string; + /** Specifies border options for point labels. */ + border?: viz.core.DashedBorder; + /** Specifies connector options for series point labels. */ + connector?: { + /** Specifies the color of label connectors. */ + color?: string; + /** Indicates whether or not label connectors are visible. */ + visible?: boolean; + /** Specifies the width of label connectors. */ + width?: number; + }; + /** Specifies a callback function that returns the text to be displayed by point labels. */ + customizeText?: (pointInfo: Object) => string; + /** Specifies font options for the text displayed in point labels. */ + font?: viz.core.Font; + /** Specifies a format for the text displayed by point labels. */ + format?: string; + position?: string; + /** Specifies a precision for formatted point values displayed in point labels. */ + precision?: number; + /** Specifies the angle used to rotate point labels from their initial position. */ + rotationAngle?: number; + /** Specifies the visibility of point labels. */ + visible?: boolean; + } + export interface SeriesConfigLabel extends BaseSeriesConfigLabel { + /** Specifies whether or not to show a label when the point has a zero value. */ + showForZeroValues?: boolean; + } + export interface ChartSeriesConfigLabel extends SeriesConfigLabel { + /** Specifies how to align point labels relative to the corresponding data points that they represent. */ + alignment?: string; + /** Specifies how to shift point labels horizontally from their initial positions. */ + horizontalOffset?: number; + /** Specifies how to shift point labels vertically from their initial positions. */ + verticalOffset?: number; + /** Specifies a precision for the percentage values displayed in the labels of a full-stacked-like series. */ + percentPrecision?: number; + } + export interface BaseCommonSeriesConfig { + /** Specifies the data source field that provides arguments for series points. */ + argumentField?: string; + axis?: string; + /** An object defining the label configuration options for a series in the dxChart widget. */ + label?: ChartSeriesConfigLabel; + /** Specifies border options for point labels. */ + border?: viz.core.DashedBorder; + /** Specifies a series color. */ + color?: string; + /** Specifies the dash style of the series' line. */ + dashStyle?: string; + hoverMode?: string; + hoverStyle?: { + /** An object defining the border options for a hovered series. */ + border?: viz.core.DashedBorder; + /**

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

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

Sets a color for a point when it is selected.

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

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

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

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

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

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

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

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

*/ + customizeText?: (seriesInfo: { seriesName: string; seriesIndex: number; seriesColor: string; }) => string; + /** Specifies what series elements to highlight when a corresponding item in the legend is hovered over. */ + hoverMode?: string; + } + export interface AdvancedOptions extends BaseChartOptions { + /** A handler for the argumentAxisClick event. */ + onArgumentAxisClick?: any; + /** Specifies the color of the parent page element. */ + containerBackgroundColor?: string; + /** An object providing options for managing data from a data source. */ + dataPrepareSettings?: { + /** Specifies whether or not to validate the values from a data source. */ + checkTypeForAllData?: boolean; + /** Specifies whether or not to convert the values from a data source into the data type of an axis. */ + convertToAxisDataType?: boolean; + /** Specifies how to sort the series points. */ + sortingMethod?: any; + }; + /** A handler for the legendClick event. */ + onLegendClick?: any; + /** A handler for the seriesClick event. */ + onSeriesClick?: any; + /** A handler for the seriesHoverChanged event. */ + onSeriesHoverChanged?: (e: { + component: BaseChart; + element: Element; + target: TSeries; + }) => void; + /** A handler for the seriesSelectionChanged event. */ + onSeriesSelectionChanged?: (e: { + component: BaseChart; + element: Element; + target: TSeries; + }) => void; + /** Specifies whether a single series or multiple series can be selected in the chart. */ + seriesSelectionMode?: string; + /** Specifies how the chart must behave when series point labels overlap. */ + resolveLabelOverlapping?: string; + } + export interface Legend extends AdvancedLegend { + /** Specifies whether the legend is located outside or inside the chart's plot. */ + position?: string; + } + export interface ChartTooltip extends BaseChartTooltip { + /** Specifies whether the tooltip must be located in the center of a bar or on its edge. Applies to the Bar and Bubble series. */ + location?: string; + /** Specifies the kind of information to display in a tooltip. */ + shared?: boolean; + } + export interface dxChartOptions extends AdvancedOptions { + /** Specifies a value indicating whether all bars in a series must have the same width, or may have different widths if any points in other series are missing. */ + equalBarWidth?: any; + adaptiveLayout?: { + keepLabels?: boolean; + }; + /** Indicates whether or not to synchronize value axes when they are displayed on a single pane. */ + synchronizeMultiAxes?: boolean; + /** Specifies whether or not to filter the series points depending on their quantity. */ + useAggregation?: boolean; + /** Indicates whether or not to adjust a value axis to the current minimum and maximum values of a zoomed chart. */ + adjustOnZoom?: boolean; + /** Specifies argument axis options for the dxChart widget. */ + argumentAxis?: ChartArgumentAxis; + argumentAxisClick?: any; + /** An object defining the configuration options that are common for all axes of the dxChart widget. */ + commonAxisSettings?: ChartCommonAxisSettings; + /** An object defining the configuration options that are common for all panes in the dxChart widget. */ + commonPaneSettings?: CommonPane; + /** An object defining the configuration options that are common for all series of the dxChart widget. */ + commonSeriesSettings?: CommonSeriesSettings; + /** An object that specifies the appearance options of the chart crosshair. */ + crosshair?: { + /** Specifies a color for the crosshair lines. */ + color?: string; + /** Specifies a dash style for the crosshair lines. */ + dashStyle?: string; + /** Specifies whether to enable the crosshair or not. */ + enabled?: boolean; + /** Specifies the opacity of the crosshair lines. */ + opacity?: number; + /** Specifies the width of the crosshair lines. */ + width?: number; + /** Specifies the appearance of the horizontal crosshair line. */ + horizontalLine?: CrosshaierWithLabel; + /** Specifies the appearance of the vertical crosshair line. */ + verticalLine?: CrosshaierWithLabel; + /** Specifies the options of the crosshair labels. */ + label?: { + /** Specifies a color for the background of the crosshair labels. */ + backgroundColor?: string; + /** Specifies whether the crosshair labels are visible or not. */ + visible?: boolean; + /** Specifies font options for the text of the crosshair labels. */ + font?: viz.core.Font; + } + }; + /** Specifies a default pane for the chart's series. */ + defaultPane?: string; + /** Specifies a coefficient determining the diameter of the largest bubble. */ + maxBubbleSize?: number; + /** Specifies the diameter of the smallest bubble measured in pixels. */ + minBubbleSize?: number; + /** Defines the dxChart widget's pane(s). */ + panes?: Array; + /** Swaps the axes round so that the value axis becomes horizontal and the argument axes becomes vertical. */ + rotated?: boolean; + /** Specifies the options of a chart's legend. */ + legend?: Legend; + /** Specifies options for dxChart widget series. */ + series?: Array; + legendClick?: any; + seriesClick?: any; + seriesHoverChanged?: (series: ChartSeries) => void; + seriesSelectionChanged?: (series: ChartSeries) => void; + /** Defines options for the series template. */ + seriesTemplate?: SeriesTemplate; + /** Specifies tooltip options. */ + tooltip?: ChartTooltip; + /** Specifies value axis options for the dxChart widget. */ + valueAxis?: Array; + /** Enables scrolling in your chart. */ + scrollingMode?: string; + /** Enables zooming in your chart. */ + zoomingMode?: string; + /** Specifies the settings of the scroll bar. */ + scrollBar?: { + /** Specifies whether the scroll bar is visible or not. */ + visible?: boolean; + /** Specifies the spacing between the scroll bar and the chart's plot in pixels. */ + offset?: number; + /** Specifies the color of the scroll bar. */ + color?: string; + /** Specifies the width of the scroll bar in pixels. */ + width?: number; + /** Specifies the opacity of the scroll bar. */ + opacity?: number; + /** Specifies the position of the scroll bar in the chart. */ + position?: string; + }; + } + /** A widget used to embed charts into HTML JS applications. */ + export class dxChart extends BaseChart { + constructor(element: JQuery, options?: dxChartOptions); + constructor(element: Element, options?: dxChartOptions); + /** Returns an array of all series in the chart. */ + getAllSeries(): Array; + /** Gets a series within the chart's series collection by the specified name (see the name option). */ + getSeriesByName(seriesName: string): ChartSeries; + /** Gets a series within the chart's series collection by its position number. */ + getSeriesByPos(seriesIndex: number): ChartSeries; + /** Sets the specified start and end values for the chart's argument axis. */ + zoomArgument(startValue: any, endValue: any): void; + } + interface CrosshaierWithLabel extends viz.core.DashedBorderWithOpacity { + /** Configures the label that belongs to the horizontal crosshair line. */ + label?: { + /** Specifies a color for the background of the label that belongs to the horizontal crosshair line. */ + backgroundColor?: string; + /** Specifies whether the label of the horizontal crosshair line is visible or not. */ + visible?: boolean; + /** Specifies font options for the text of the label that belongs to the horizontal crosshair line. */ + font?: viz.core.Font; + } + } + export interface PolarChartTooltip extends BaseChartTooltip { + /** Specifies the kind of information to display in a tooltip. */ + shared?: boolean; + } + export interface dxPolarChartOptions extends AdvancedOptions { + /** Specifies a value indicating whether all bars in a series must have the same angle, or may have different angles if any points in other series are missing. */ + equalBarWidth?: boolean; + /** Specifies adaptive layout options. */ + adaptiveLayout?: { + width?: number; + height?: number; + /** Specifies whether or not point labels can be hidden when the layout is adapting. */ + keepLabels?: boolean; + }; + /** Indicates whether or not to display a "spider web". */ + useSpiderWeb?: boolean; + /** Specifies argument axis options for the dxPolarChart widget. */ + argumentAxis?: PolarArgumentAxis; + /** An object defining the configuration options that are common for all axes of the dxPolarChart widget. */ + commonAxisSettings?: PolarCommonAxisSettings; + /** An object defining the configuration options that are common for all series of the dxPolarChart widget. */ + commonSeriesSettings?: CommonPolarSeriesSettings; + /** Specifies the options of a chart's legend. */ + legend?: AdvancedLegend; + /** Specifies options for dxPolarChart widget series. */ + series?: Array; + /** Defines options for the series template. */ + seriesTemplate?: PolarSeriesTemplate; + /** Specifies tooltip options. */ + tooltip?: PolarChartTooltip; + /** Specifies value axis options for the dxPolarChart widget. */ + valueAxis?: PolarValueAxis; + } + /** A chart widget displaying data in a polar coordinate system. */ + export class dxPolarChart extends BaseChart { + constructor(element: JQuery, options?: dxPolarChartOptions); + constructor(element: Element, options?: dxPolarChartOptions); + /** Returns an array of all series in the chart. */ + getAllSeries(): Array; + /** Gets a series within the chart's series collection by the specified name (see the name option). */ + getSeriesByName(seriesName: string): PolarSeries; + /** Gets a series within the chart's series collection by its position number. */ + getSeriesByPos(seriesIndex: number): PolarSeries; + } + export interface PieLegend extends core.BaseLegend { + /** Specifies what chart elements to highlight when a corresponding item in the legend is hovered over. */ + hoverMode?: string; + /** Specifies the text for a hint that appears when a user hovers the mouse pointer over a legend item. */ + customizeHint?: (pointInfo: { pointName: string; pointIndex: number; pointColor: string; }) => string; + /** Specifies a callback function that returns the text to be displayed by a legend item. */ + customizeText?: (pointInfo: { pointName: string; pointIndex: number; pointColor: string; }) => string; + } + export interface dxPieChartOptions extends BaseChartOptions { + /** Specifies adaptive layout options. */ + adaptiveLayout?: { + /** Specifies whether or not point labels can be hidden when the layout is adapting. */ + keepLabels?: boolean; + }; + /** Specifies dxPieChart legend options. */ + legend?: PieLegend; + /** Specifies options for the series of the dxPieChart widget. */ + series?: Array; + /** Specifies the diameter of the pie. */ + diameter?: number; + /** A handler for the legendClick event. */ + onLegendClick?: any; + legendClick?: any; + /** Specifies how a chart must behave when series point labels overlap. */ + resolveLabelOverlapping?: string; + } + /** A circular chart widget for HTML JS applications. */ + export class dxPieChart extends BaseChart { + constructor(element: JQuery, options?: dxPieChartOptions); + constructor(element: Element, options?: dxPieChartOptions); + /** Provides access to the dxPieChart series. */ + getSeries(): PieSeries; + } +} +interface JQuery { + dxChart(options?: DevExpress.viz.charts.dxChartOptions): JQuery; + dxChart(methodName: string, ...params: any[]): any; + dxChart(methodName: "instance"): DevExpress.viz.charts.dxChart; + dxPieChart(options?: DevExpress.viz.charts.dxPieChartOptions): JQuery; + dxPieChart(methodName: string, ...params: any[]): any; + dxPieChart(methodName: "instance"): DevExpress.viz.charts.dxPieChart; + dxPolarChart(options?: DevExpress.viz.charts.dxPolarChartOptions): JQuery; + dxPolarChart(methodName: string, ...params: any[]): any; + dxPolarChart(methodName: "instance"): DevExpress.viz.charts.dxPolarChart; +} +declare module DevExpress.viz.gauges { + export interface BaseRangeContainer { + /** Specifies a range container's background color. */ + backgroundColor?: string; + /** Specifies the offset of the range container from an invisible scale line in pixels. */ + offset?: number; + /** Sets the name of the palette or an array of colors to be used for coloring the gauge range container. */ + palette?: any; + /** An array of objects representing ranges contained in the range container. */ + ranges?: Array<{ startValue: number; endValue: number; color: string }>; + /** Specifies a color of a range. */ + color?: string; + /** Specifies an end value of a range. */ + endValue?: number; + /** Specifies a start value of a range. */ + startValue?: number; + } + export interface ScaleTick { + /** Specifies the color of the scale's minor ticks. */ + color?: string; + /** Specifies an array of custom minor ticks. */ + customTickValues?: Array; + /** Specifies the length of the scale's minor ticks. */ + length?: number; + /** Indicates whether automatically calculated minor ticks are visible or not. */ + showCalculatedTicks?: boolean; + /** Specifies an interval between minor ticks. */ + tickInterval?: number; + /** Indicates whether scale minor ticks are visible or not. */ + visible?: boolean; + /** Specifies the width of the scale's minor ticks. */ + width?: number; + } + export interface ScaleMajorTick extends ScaleTick { + /** Specifies whether or not to expand the current major tick interval if labels overlap each other. */ + useTicksAutoArrangement?: boolean; + } + export interface BaseScaleLabel { + /** Specifies whether or not scale labels should be colored similarly to their corresponding ranges in the range container. */ + useRangeColors?: boolean; + /** Specifies a callback function that returns the text to be displayed in scale labels. */ + customizeText?: (scaleValue: { value: number; valueText: string }) => string; + /** Specifies font options for the text displayed in the scale labels of the gauge. */ + font?: viz.core.Font; + /** Specifies a format for the text displayed in scale labels. */ + format?: string; + /** Specifies a precision for the formatted value displayed in the scale labels. */ + precision?: number; + /** Specifies whether or not scale labels are visible on the gauge. */ + visible?: boolean; + } + export interface BaseScale { + /** Specifies the end value for the scale of the gauge. */ + endValue?: number; + /** Specifies whether or not to hide the first scale label. */ + hideFirstLabel?: boolean; + /** Specifies whether or not to hide the first major tick on the scale. */ + hideFirstTick?: boolean; + /** Specifies whether or not to hide the last scale label. */ + hideLastLabel?: boolean; + /** Specifies whether or not to hide the last major tick on the scale. */ + hideLastTick?: boolean; + /** Specifies common options for scale labels. */ + label?: BaseScaleLabel; + /** Specifies options of the gauge's major ticks. */ + majorTick?: ScaleMajorTick; + /** Specifies options of the gauge's minor ticks. */ + minorTick?: ScaleTick; + /** Specifies the start value for the scale of the gauge. */ + startValue?: number; + } + export interface BaseValueIndicator { + /** Specifies the type of subvalue indicators. */ + type?: string; + /** Specifies the background color for the indicator of the rangeBar type. */ + backgroundColor?: string; + /** Specifies the base value for the indicator of the rangeBar type. */ + baseValue?: number; + /** Specifies a color of the indicator. */ + color?: string; + /** Specifies the range bar size for an indicator of the rangeBar type. */ + size?: number; + text?: { + /** Specifies a callback function that returns the text to be displayed in an indicator. */ + customizeText?: (indicatedValue: { value: number; valueText: string }) => string; + font?: viz.core.Font; + /** Specifies a format for the text displayed in an indicator. */ + format?: string; + /** Specifies the range bar's label indent in pixels. */ + indent?: number; + /** Specifies a precision for the formatted value displayed by an indicator. */ + precision?: number; + }; + offset?: number; + length?: number; + width?: number; + /** Specifies the length of an arrow for the indicator of the textCloud type in pixels. */ + arrowLength?: number; + /** Sets the array of colors to be used for coloring subvalue indicators. */ + palette?: Array; + /** Specifies the distance between the needle and the center of a gauge for the indicator of a needle-like type. */ + indentFromCenter?: number; + /** Specifies the second color for the indicator of the twoColorNeedle type. */ + secondColor?: string; + /** Specifies the length of a twoNeedleColor type indicator tip as a percentage. */ + secondFraction?: number; + /** Specifies the spindle's diameter in pixels for the indicator of a needle-like type. */ + spindleSize?: number; + /** Specifies the inner diameter in pixels, so that the spindle has the shape of a ring. */ + spindleGapSize?: number; + /** Specifies the orientation of the rangeBar indicator on a vertically oriented dxLinearGauge widget. */ + horizontalOrientation?: string; + /** Specifies the orientation of the rangeBar indicator on a horizontally oriented dxLinearGauge widget. */ + verticalOrientation?: string; + } + export interface SharedGaugeOptions { + /** Specifies animation options. */ + animation?: viz.core.Animation; + /** Specifies the appearance of the loading indicator. */ + loadingIndicator?: viz.core.LoadingIndicator; + /** Specifies whether to redraw the widget when the size of the parent browser window changes or a mobile device rotates. */ + redrawOnResize?: boolean; + /** Specifies the size of the widget in pixels. */ + size?: viz.core.Size; + /** Specifies a subtitle for a gauge. */ + subtitle?: { + /** Specifies font options for the subtitle. */ + font?: viz.core.Font; + /** Specifies a text for the subtitle. */ + text?: string; + }; + /** Specifies a title for a gauge. */ + title?: { + /** Specifies font options for the title. */ + font?: viz.core.Font; + /** Specifies a title's position on the gauge. */ + position?: string; + /** Specifies a text for the title. */ + text?: string; + }; + /** Specifies options for gauge tooltips. */ + tooltip?: viz.core.Tooltip; + /** A handler for the tooltipShown event. */ + onTooltipShown?: (e: { + component: dxBaseGauge; + element: Element; + target: {}; + }) => void; + /** A handler for the tooltipHidden event. */ + onTooltipHidden?: (e: { + component: dxBaseGauge; + element: Element; + target: {}; + }) => void; + } + export interface BaseGaugeOptions extends viz.core.BaseWidgetOptions, SharedGaugeOptions { + /** Specifies the color of the parent page element. */ + containerBackgroundColor?: string; + /** Specifies the blank space in pixels between the widget's extreme elements and the boundaries of the area provided for the widget (see the size option). */ + margin?: viz.core.Margins; + /** Specifies options of the gauge's range container. */ + rangeContainer?: BaseRangeContainer; + /** Specifies a gauge's scale options. */ + scale?: BaseScale; + /** Specifies the appearance options of subvalue indicators. */ + subvalueIndicator?: BaseValueIndicator; + /** Specifies a set of subvalues to be designated by the subvalue indicators. */ + subvalues?: Array; + /** Specifies the main value on a gauge. */ + value?: number; + /** Specifies the appearance options of the value indicator. */ + valueIndicator?: BaseValueIndicator; + } + /** A gauge widget. */ + export class dxBaseGauge extends viz.core.BaseWidget { + /** Displays the loading indicator. */ + showLoadingIndicator(): void; + /** Conceals the loading indicator. */ + hideLoadingIndicator(): void; + /** Redraws a widget. */ + render(): void; + /** Returns the main gauge value. */ + value(): number; + /** Updates a gauge value. */ + value(value: number): void; + /** Returns an array of gauge subvalues. */ + subvalues(): Array; + /** Updates gauge subvalues. */ + subvalues(subvalues: Array): void; + } + export interface LinearRangeContainer extends BaseRangeContainer { + /** Specifies the orientation of the range container on a vertically oriented dxLinearGauge widget. */ + horizontalOrientation?: string; + /** Specifies the orientation of a range container on a horizontally oriented dxLinearGauge widget. */ + verticalOrientation?: string; + /** Specifies the width of the range container's start and end boundaries in the dxLinearGauge widget. */ + width?: any; + /** Specifies an end width of a range container. */ + end?: number; + /** Specifies a start width of a range container. */ + start?: number; + } + export interface LinearScaleLabel extends BaseScaleLabel { + /** Specifies the spacing between scale labels and ticks. */ + indentFromTick?: number; + } + export interface LinearScale extends BaseScale { + /** Specifies the orientation of scale ticks on a vertically oriented dxLinearGauge widget. */ + horizontalOrientation?: string; + label?: LinearScaleLabel; + /** Specifies the orientation of scale ticks on a horizontally oriented dxLinearGauge widget. */ + verticalOrientation?: string; + } + export interface dxLinearGaugeOptions extends BaseGaugeOptions { + /** Specifies the options required to set the geometry of the dxLinearGauge widget. */ + geometry?: { + /** Indicates whether to display the dxLinearGauge widget vertically or horizontally. */ + orientation?: string; + }; + /** Specifies gauge range container options. */ + rangeContainer?: LinearRangeContainer; + scale?: LinearScale; + } + /** A widget that represents a gauge with a linear scale. */ + export class dxLinearGauge extends dxBaseGauge { + constructor(element: JQuery, options?: dxLinearGaugeOptions); + constructor(element: Element, options?: dxLinearGaugeOptions); + } + export interface CircularRangeContainer extends BaseRangeContainer { + /** Specifies the orientation of the range container in the dxCircularGauge widget. */ + orientation?: string; + /** Specifies the range container's width in pixels. */ + width?: number; + } + export interface CircularScaleLabel extends BaseScaleLabel { + /** Specifies the spacing between scale labels and ticks. */ + indentFromTick?: number; + } + export interface CircularScale extends BaseScale { + label?: CircularScaleLabel; + /** Specifies the orientation of scale ticks. */ + orientation?: string; + } + export interface dxCircularGaugeOptions extends BaseGaugeOptions { + /** Specifies the options required to set the geometry of the dxCircularGauge widget. */ + geometry?: { + /** Specifies the end angle of the circular gauge's arc. */ + endAngle?: number; + /** Specifies the start angle of the circular gauge's arc. */ + startAngle?: number; + }; + /** Specifies gauge range container options. */ + rangeContainer?: CircularRangeContainer; + scale?: CircularScale; + } + /** A widget that represents a gauge with a circular scale. */ + export class dxCircularGauge extends dxBaseGauge { + constructor(element: JQuery, options?: dxCircularGaugeOptions); + constructor(element: Element, options?: dxCircularGaugeOptions); + } + export interface dxBarGaugeOptions extends viz.core.BaseWidgetOptions, SharedGaugeOptions { + /** Specifies a color for the remaining segment of the bar's track. */ + backgroundColor?: string; + /** Specifies a distance between bars in pixels. */ + barSpacing?: number; + /** Specifies a base value for bars. */ + baseValue?: number; + /** Specifies an end value for the gauge's invisible scale. */ + endValue?: number; + /** Defines the shape of the gauge's arc. */ + geometry?: { + /** Specifies the end angle of the bar gauge's arc. */ + endAngle?: number; + /** Specifies the start angle of the bar gauge's arc. */ + startAngle?: number; + }; + /** Specifies the options of the labels that accompany gauge bars. */ + label?: { + /** Specifies a color for the label connector text. */ + connectorColor?: string; + /** Specifies the width of the label connector in pixels. */ + connectorWidth?: number; + /** Specifies a callback function that returns a text for labels. */ + customizeText?: (barValue: { value: number; valueText: string }) => string; + /** Specifies font options for bar labels. */ + font?: viz.core.Font; + /** Specifies a format for bar labels. */ + format?: string; + /** Specifies the distance between the upper bar and bar labels in pixels. */ + indent?: number; + /** Specifies a precision for the formatted value displayed by labels. */ + precision?: number; + /** Specifies whether bar labels appear on a gauge or not. */ + visible?: boolean; + }; + /** Sets the name of the palette or an array of colors to be used for coloring the gauge range container. */ + palette?: string; + /** Defines the radius of the bar that is closest to the center relatively to the radius of the topmost bar. */ + relativeInnerRadius?: number; + /** Specifies a start value for the gauge's invisible scale. */ + startValue?: number; + /** Specifies the array of values to be indicated on a bar gauge. */ + values?: Array; + } + /** A circular bar widget. */ + export class dxBarGauge extends viz.core.BaseWidget { + constructor(element: JQuery, options?: dxBarGaugeOptions); + constructor(element: Element, options?: dxBarGaugeOptions); + /** Displays the loading indicator. */ + showLoadingIndicator(): void; + /** Conceals the loading indicator. */ + hideLoadingIndicator(): void; + /** Redraws the widget. */ + render(): void; + /** Returns an array of gauge values. */ + values(): Array; + /** Updates the values displayed by a gauge. */ + values(values: Array): void; + } +} +interface JQuery { + dxLinearGauge(options?: DevExpress.viz.gauges.dxLinearGaugeOptions): JQuery; + dxLinearGauge(methodName: string, ...params: any[]): any; + dxLinearGauge(methodName: "instance"): DevExpress.viz.gauges.dxLinearGauge; + dxCircularGauge(options?: DevExpress.viz.gauges.dxCircularGaugeOptions): JQuery; + dxCircularGauge(methodName: string, ...params: any[]): any; + dxCircularGauge(methodName: "instance"): DevExpress.viz.gauges.dxCircularGauge; + dxBarGauge(options?: DevExpress.viz.gauges.dxBarGaugeOptions): JQuery; + dxBarGauge(methodName: string, ...params: any[]): any; + dxBarGauge(methodName: "instance"): DevExpress.viz.gauges.dxBarGauge; +} +declare module DevExpress.viz.rangeSelector { + export interface dxRangeSelectorOptions extends viz.core.BaseWidgetOptions { + /** Specifies the options for the range selector's background. */ + background?: { + /** Specifies the background color for the dxRangeSelector. */ + color?: string; + /** Specifies image options. */ + image?: { + /** Specifies a location for the image in the background of a range selector. */ + location?: string; + /** Specifies the image's URL. */ + url?: string; + }; + /** Indicates whether or not the background (background color and/or image) is visible. */ + visible?: boolean; + }; + /** Specifies the dxRangeSelector's behavior options. */ + behavior?: { + /** Indicates whether or not you can swap sliders. */ + allowSlidersSwap?: boolean; + /** Indicates whether or not animation is enabled. */ + animationEnabled?: boolean; + /** Specifies when to call the onSelectedRangeChanged function. */ + callSelectedRangeChanged?: string; + /** Indicates whether or not an end user can specify the range using a mouse, without the use of sliders. */ + manualRangeSelectionEnabled?: boolean; + /** Indicates whether or not an end user can shift the selected range to the required location on a scale by clicking. */ + moveSelectedRangeByClick?: boolean; + /** Indicates whether to snap a slider to ticks. */ + snapToTicks?: boolean; + }; + /** Specifies the options required to display a chart as the range selector's background. */ + chart?: { + /** Specifies a coefficient for determining an indent from the bottom background boundary to the lowest chart point. */ + bottomIndent?: number; + /** An object defining the common configuration options for the chart’s series. */ + commonSeriesSettings?: viz.charts.CommonSeriesSettings; + /** An object providing options for managing data from a data source. */ + dataPrepareSettings?: { + /** Specifies whether or not to validate values from a data source. */ + checkTypeForAllData?: boolean; + /** Specifies whether or not to convert the values from a data source into the data type of an axis. */ + convertToAxisDataType?: boolean; + /** Specifies how to sort series points. */ + sortingMethod?: any; + }; + /** Specifies a value indicating whether all bars in a series must have the same width, or may have different widths if any points in other series are missing. */ + equalBarWidth?: any; + /** Sets the name of the palette to be used in the range selector's chart. Alternatively, an array of colors can be set as a custom palette to be used within this chart. */ + palette?: any; + /** An object defining the chart’s series. */ + series?: Array; + /** Defines options for the series template. */ + seriesTemplate?: viz.charts.SeriesTemplate; + /** Specifies a coefficient for determining an indent from the background's top boundary to the topmost chart point. */ + topIndent?: number; + /** Specifies whether or not to filter the series points depending on their quantity. */ + useAggregation?: boolean; + /** Specifies options for the chart's value axis. */ + valueAxis?: { + /** Indicates whether or not the chart's value axis must be inverted. */ + inverted?: boolean; + /** Specifies the value to be raised to a power when generating ticks for a logarithmic value axis. */ + logarithmBase?: number; + /** Specifies the maximum value of the chart's value axis. */ + max?: number; + /** Specifies the minimum value of the chart's value axis. */ + min?: number; + /** Specifies the type of the value axis. */ + type?: string; + /** Specifies the desired type of axis values. */ + valueType?: string; + }; + }; + /** Specifies the color of the parent page element. */ + containerBackgroundColor?: string; + /** Specifies a data source for the scale values and for the chart at the background. */ + dataSource?: any; + /** Specifies the data source field that provides data for the scale. */ + dataSourceField?: string; + /** Specifies the appearance of the loading indicator. */ + loadingIndicator?: viz.core.LoadingIndicator; + /** Specifies the blank space in pixels between the dxRangeSelector widget's extreme elements and the boundaries of the area provided for the widget (see size). */ + margin?: viz.core.Margins; + /** Specifies whether to redraw the widget when the size of the parent browser window changes or a mobile device rotates. */ + redrawOnResize?: boolean; + /** Specifies options of the range selector's scale. */ + scale?: { + /** Specifies the scale's end value. */ + endValue?: any; + /** Specifies common options for scale labels. */ + label?: { + /** Specifies a callback function that returns the text to be displayed in scale labels. */ + customizeText?: (scaleValue: { value: any; valueText: string; }) => string; + /** Specifies font options for the text displayed in the range selector's scale labels. */ + font?: viz.core.Font; + /** Specifies a format for the text displayed in scale labels. */ + format?: string; + /** Specifies a precision for the formatted value displayed in the scale labels. */ + precision?: number; + /** Specifies a spacing between scale labels and the background bottom edge. */ + topIndent?: number; + /** Specifies whether or not the scale's labels are visible. */ + visible?: boolean; + }; + /** Specifies the value to be raised to a power when generating ticks for a logarithmic scale. */ + logarithmBase?: number; + /** Specifies an interval between major ticks. */ + majorTickInterval?: any; + /** Specifies options for the date-time scale's markers. */ + marker?: { + /** Defines the options that can be set for the text that is displayed by the scale markers. */ + label?: { + /** Specifies a callback function that returns the text to be displayed in scale markers. */ + customizeText?: (markerValue: { value: any; valueText: string }) => string; + /** Specifies a format for the text displayed in scale markers. */ + format?: string; + }; + /** Specifies the height of the marker's separator. */ + separatorHeight?: number; + /** Specifies the space between the marker label and the marker separator. */ + textLeftIndent?: number; + /** Specifies the space between the marker's label and the top edge of the marker's separator. */ + textTopIndent?: number; + /** Specified the indent between the marker and the scale lables. */ + topIndent?: number; + /** Indicates whether scale markers are visible. */ + visible?: boolean; + }; + /** Specifies the maximum range that can be selected. */ + maxRange?: any; + /** Specifies the number of minor ticks between neighboring major ticks. */ + minorTickCount?: number; + /** Specifies an interval between minor ticks. */ + minorTickInterval?: any; + /** Specifies the minimum range that can be selected. */ + minRange?: any; + /** Specifies the height of the space reserved for the scale in pixels. */ + placeholderHeight?: number; + /** Indicates whether or not to set ticks of a date-time scale at the beginning of each date-time interval. */ + setTicksAtUnitBeginning?: boolean; + /** Specifies whether or not to show ticks for the boundary scale values, when neither major ticks nor minor ticks are created for these values. */ + showCustomBoundaryTicks?: boolean; + /** Indicates whether or not to show minor ticks on the scale. */ + showMinorTicks?: boolean; + /** Specifies the scale's start value. */ + startValue?: any; + /** Specifies options defining the appearance of scale ticks. */ + tick?: { + /** Specifies the color of scale ticks (both major and minor ticks). */ + color?: string; + /** Specifies the opacity of scale ticks (both major and minor ticks). */ + opacity?: number; + /** Specifies the width of the scale's ticks (both major and minor ticks). */ + width?: number; + }; + /** Specifies the type of the scale. */ + type?: string; + /** Specifies whether or not to expand the current tick interval if labels overlap each other. */ + useTicksAutoArrangement?: boolean; + /** Specifies the type of values on the scale. */ + valueType?: string; + /** Specifies the order of arguments on a discrete scale. */ + categories?: Array; + }; + /** Specifies the range to be selected when displaying the dxRangeSelector. */ + selectedRange?: { + /** Specifies the start value of the range to be selected when displaying the dxRangeSelector widget on a page. */ + startValue?: any; + /** Specifies the end value of the range to be selected when displaying the dxRangeSelector widget on a page. */ + endValue?: any; + }; + /** Specifies the color of the selected range. */ + selectedRangeColor?: string; + /** Range selector's indent options. */ + indent?: { + /** Specifies range selector's left indent. */ + left?: number; + /** Specifies range selector's right indent. */ + right?: number; + }; + selectedRangeChanged?: (selectedRange: { startValue: any; endValue: any; }) => void; + /** A handler for the selectedRangeChanged event. */ + onSelectedRangeChanged?: (e: { + startValue: any; + endValue: any; + component: dxRangeSelector; + element: Element; + }) => void; + /** Specifies range selector shutter options. */ + shutter?: { + /** Specifies shutter color. */ + color?: string; + /** Specifies the opacity of the color of shutters. */ + opacity?: number; + }; + /** Specifies in pixels the size of the dxRangeSelector widget. */ + size?: viz.core.Size; + /** Specifies the appearance of the range selector's slider handles. */ + sliderHandle?: { + /** Specifies the color of the slider handles. */ + color?: string; + /** Specifies the opacity of the slider handles. */ + opacity?: number; + /** Specifies the width of the slider handles. */ + width?: number; + }; + /** Defines the options of the range selector slider markers. */ + sliderMarker?: { + /** Specifies the color of the slider markers. */ + color?: string; + /** Specifies a callback function that returns the text to be displayed by slider markers. */ + customizeText?: (scaleValue: { value: any; valueText: any; }) => string; + /** Specifies font options for the text displayed by the range selector slider markers. */ + font?: viz.core.Font; + /** Specifies a format for the text displayed in slider markers. */ + format?: string; + /** Specifies the color used for the slider marker text when the currently selected range does not match the minRange and maxRange values. */ + invalidRangeColor?: string; + /** + * Specifies the empty space between the marker's border and the marker’s text. + * @deprecated Use the 'paddingTopBottom' and 'paddingLeftRight' options instead + */ + padding?: number; + /** Specifies the empty space between the marker's top and bottom borders and the marker's text. */ + paddingTopBottom?: number; + /** Specifies the empty space between the marker's left and right borders and the marker's text. */ + paddingLeftRight?: number; + /** Specifies the placeholder height of the slider marker. */ + placeholderHeight?: number; + /** + * Specifies in pixels the height and width of the space reserved for the range selector slider markers. + * @deprecated Use the 'placeholderHeight' and 'indent' options instead + */ + placeholderSize?: { + /** Specifies the height of the placeholder for the left and right slider markers. */ + height?: number; + /** Specifies the width of the placeholder for the left and right slider markers. */ + width?: { + /** Specifies the width of the left slider marker's placeholder. */ + left?: number; + /** Specifies the width of the right slider marker's placeholder. */ + right?: number; + }; + }; + /** Specifies a precision for the formatted value displayed in slider markers. */ + precision?: number; + /** Indicates whether or not the slider markers are visible. */ + visible?: boolean; + }; + } + /** A widget that allows end users to select a range of values on a scale. */ + export class dxRangeSelector extends viz.core.BaseWidget { + constructor(element: JQuery, options?: dxRangeSelectorOptions); + constructor(element: Element, options?: dxRangeSelectorOptions); + /** Displays the loading indicator. */ + showLoadingIndicator(): void; + /** Conceals the loading indicator. */ + hideLoadingIndicator(): void; + /** Redraws a widget. */ + render(skipChartAnimation?: boolean): void; + /** Returns the currently selected range. */ + getSelectedRange(): { startValue: any; endValue: any; }; + /** Sets a specified range. */ + setSelectedRange(selectedRange: { startValue: any; endValue: any; }): void; + } +} +interface JQuery { + dxRangeSelector(options?: DevExpress.viz.rangeSelector.dxRangeSelectorOptions): JQuery; + dxRangeSelector(methodName: string, ...params: any[]): any; + dxRangeSelector(methodName: "instance"): DevExpress.viz.rangeSelector.dxRangeSelector; +} +declare module DevExpress.viz.map { + /** This section describes the fields and methods that can be used in code to manipulate the Area object. */ + export interface Area { + /** Contains the element type. */ + type: string; + /** Return the value of an attribute. */ + attribute(name: string): any; + /** Provides information about the selection state of an area. */ + selected(): boolean; + /** Sets a new selection state for an area. */ + selected(state: boolean): void; + /** Applies the area settings specified as a parameter and updates the area appearance. */ + applySettings(settings: any): void; + } + /** This section describes the fields and methods that can be used in code to manipulate the Markers object. */ + export interface Marker { + /** Contains the descriptive text accompanying the map marker. */ + text: string; + /** Contains the type of the element. */ + type: string; + /** Contains the URL of an image map marker. */ + url: string; + /** Contains the value of a bubble map marker. */ + value: number; + /** Contains the values of a pie map marker. */ + values: Array; + /** Returns the value of an attribute. */ + attribute(name: string): any; + /** Returns the coordinates of a specific marker. */ + coordinates(): Array; + /** Provides information about the selection state of a marker. */ + selected(): boolean; + /** Sets a new selection state for a marker. */ + selected(state: boolean): void; + /** Applies the marker settings specified as a parameter and updates the marker appearance. */ + applySettings(settings: any): void; + } + export interface AreaSettings { + /** Specifies the width of the area border in pixels. */ + borderWidth?: number; + /** Specifies a color for the area border. */ + borderColor?: string; + click?: any; + /** Specifies a color for an area. */ + color?: string; + /** Specifies the function that customizes each area individually. */ + customize?: (areaInfo: Area) => AreaSettings; + /** Specifies a color for the area border when the area is hovered over. */ + hoveredBorderColor?: string; + /** Specifies the pixel-measured width of the area border when the area is hovered over. */ + hoveredBorderWidth?: number; + /** Specifies a color for an area when this area is hovered over. */ + hoveredColor?: string; + /** Specifies whether or not to change the appearance of an area when it is hovered over. */ + hoverEnabled?: boolean; + /** Configures area labels. */ + label?: { + /** Specifies the data field that provides data for area labels. */ + dataField?: string; + /** Enables area labels. */ + enabled?: boolean; + /** Specifies font options for area labels. */ + font?: viz.core.Font; + }; + /** Specifies the name of the palette or a custom range of colors to be used for coloring a map. */ + palette?: any; + /** Specifies the number of colors in a palette. */ + paletteSize?: number; + /** Allows you to paint areas with similar attributes in the same color. */ + colorGroups?: Array; + /** Specifies the field that provides data to be used for coloring areas. */ + colorGroupingField?: string; + /** Specifies a color for the area border when the area is selected. */ + selectedBorderColor?: string; + /** Specifies a color for an area when this area is selected. */ + selectedColor?: string; + /** Specifies the pixel-measured width of the area border when the area is selected. */ + selectedBorderWidth?: number; + selectionChanged?: (area: Area) => void; + /** Specifies whether single or multiple areas can be selected on a vector map. */ + selectionMode?: string; + } + export interface MarkerSettings { + /** Specifies a color for the marker border. */ + borderColor?: string; + /** Specifies the width of the marker border in pixels. */ + borderWidth?: number; + click?: any; + /** Specifies a color for a marker of the dot or bubble type. */ + color?: string; + /** Specifies the function that customizes each marker individually. */ + customize?: (markerInfo: Marker) => MarkerSettings; + font?: Object; + /** Specifies the pixel-measured width of the marker border when the marker is hovered over. */ + hoveredBorderWidth?: number; + /** Specifies a color for the marker border when the marker is hovered over. */ + hoveredBorderColor?: string; + /** Specifies a color for a marker of the dot or bubble type when this marker is hovered over. */ + hoveredColor?: string; + /** Specifies whether or not to change the appearance of a marker when it is hovered over. */ + hoverEnabled?: boolean; + /** Specifies marker label options. */ + label?: { + /** Enables marker labels. */ + enabled?: boolean; + /** Specifies font options for marker labels. */ + font?: viz.core.Font; + }; + /** Specifies the pixel-measured diameter of the marker that represents the biggest value. Setting this option makes sense only if you use markers of the bubble type. */ + maxSize?: number; + /** Specifies the pixel-measured diameter of the marker that represents the smallest value. Setting this option makes sense only if you use markers of the bubble type. */ + minSize?: number; + /** Specifies the opacity of markers. Setting this option makes sense only if you use markers of the bubble type. */ + opacity?: number; + /** Specifies the pixel-measured width of the marker border when the marker is selected. */ + selectedBorderWidth?: number; + /** Specifies a color for the marker border when the marker is selected. */ + selectedBorderColor?: string; + /** Specifies a color for a marker of the dot or bubble type when this marker is selected. */ + selectedColor?: string; + selectionChanged?: (marker: Marker) => void; + /** Specifies whether a single or multiple markers can be selected on a vector map. */ + selectionMode?: string; + /** Specifies the size of markers. Setting this option makes sense for any type of marker except bubble. */ + size?: number; + /** Specifies the type of markers to be used on the map. */ + type?: string; + /** Specifies the name of a palette or a custom set of colors to be used for coloring markers of the pie type. */ + palette?: any; + /** Allows you to paint markers with similar attributes in the same color. */ + colorGroups?: Array; + /** Specifies the field that provides data to be used for coloring markers. */ + colorGroupingField?: string; + /** Allows you to display bubbles with similar attributes in the same size. */ + sizeGroups?: Array; + /** Specifies the field that provides data to be used for sizing bubble markers. */ + sizeGroupingField?: string; + } + export interface dxVectorMapOptions extends viz.core.BaseWidgetOptions { + /** An object specifying options for the map areas. */ + areaSettings?: AreaSettings; + /** Specifies the options for the map background. */ + background?: { + /** Specifies a color for the background border. */ + borderColor?: string; + /** Specifies a color for the background. */ + color?: string; + }; + /** Specifies the positioning of a map in geographical coordinates. */ + bounds?: Array; + /** Specifies the options of the control bar. */ + controlBar?: { + /** Specifies a color for the outline of the control bar elements. */ + borderColor?: string; + /** Specifies a color for the inner area of the control bar elements. */ + color?: string; + /** Specifies whether or not to display the control bar. */ + enabled?: boolean; + /** Specifies the margin of the control bar in pixels. */ + margin?: number; + /** Specifies the position of the control bar. */ + horizontalAlignment?: string; + /** Specifies the position of the control bar. */ + verticalAlignment?: string; + /** Specifies the opacity of the Control_Bar. */ + opacity?: number; + }; + /** Specifies the appearance of the loading indicator. */ + loadingIndicator?: viz.core.LoadingIndicator; + /** Specifies a data source for the map area. */ + mapData?: any; + /** Specifies a data source for the map markers. */ + markers?: any; + /** An object specifying options for the map markers. */ + markerSettings?: MarkerSettings; + /** Specifies the size of the dxVectorMap widget. */ + size?: viz.core.Size; + /** Specifies tooltip options. */ + tooltip?: viz.core.Tooltip; + /** Configures map legends. */ + legends?: Array; + /** Specifies whether or not the map should respond when a user rolls the mouse wheel. */ + wheelEnabled?: boolean; + /** Specifies whether the map should respond to touch gestures. */ + touchEnabled?: boolean; + /** Disables the zooming capability. */ + zoomingEnabled?: boolean; + /** Specifies the geographical coordinates of the center for a map. */ + center?: Array; + centerChanged?: (center: Array) => void; + /** A handler for the centerChanged event. */ + onCenterChanged?: (e: { + center: Array; + component: dxVectorMap; + element: Element; + }) => void; + /** A handler for the tooltipShown event. */ + onTooltipShown?: (e: { + component: dxVectorMap; + element: Element; + target: {}; + }) => void; + /** A handler for the tooltipHidden event. */ + onTooltipHidden?: (e: { + component: dxVectorMap; + element: Element; + target: {}; + }) => void; + /** Specifies a number that is used to zoom a map initially. */ + zoomFactor?: number; + /** Specifies a map's maximum zoom factor. */ + maxZoomFactor?: number; + zoomFactorChanged?: (zoomFactor: number) => void; + /** A handler for the zoomFactorChanged event. */ + onZoomFactorChanged?: (e: { + zoomFactor: number; + component: dxVectorMap; + element: Element; + }) => void; + click?: any; + /** A handler for the click event. */ + onClick?: any; + /** A handler for the areaClick event. */ + onAreaClick?: any; + /** A handler for the areaSelectionChanged event. */ + onAreaSelectionChanged?: (e: { + target: Area; + component: dxVectorMap; + element: Element; + }) => void; + /** A handler for the markerClick event. */ + onMarkerClick?: any; + /** A handler for the markerSelectionChanged event. */ + onMarkerSelectionChanged?: (e: { + target: Marker; + component: dxVectorMap; + element: Element; + }) => void; + /** Disables the panning capability. */ + panningEnabled?: boolean; + } + export interface Legend extends viz.core.BaseLegend { + /** Specifies text for legend items. */ + customizeText?: (itemInfo: { start: number; end: number; index: number; color: string; size: number; }) => string; + /** Specifies text for a hint that appears when a user hovers the mouse pointer over the text of a legend item. */ + customizeHint?: (itemInfo: { start: number; end: number; index: number; color: string; size: number }) => string; + /** Specifies the source of data for the legend. */ + source?: string; + } + /** A vector map widget. */ + export class dxVectorMap extends viz.core.BaseWidget { + constructor(element: JQuery, options?: dxVectorMapOptions); + constructor(element: Element, options?: dxVectorMapOptions); + /** Displays the loading indicator. */ + showLoadingIndicator(): void; + /** Conceals the loading indicator. */ + hideLoadingIndicator(): void; + /** Redraws a widget. */ + render(): void; + /** Gets the current coordinates of the map center. */ + center(): Array; + /** Sets the coordinates of the map center. */ + center(centerCoordinates: Array): void; + /** Deselects all the selected areas on a map. The areas are displayed in their initial style after. */ + clearAreaSelection(): void; + /** Deselects all the selected markers on a map. The markers are displayed in their initial style after. */ + clearMarkerSelection(): void; + /** Deselects all the selected area and markers on a map at once. The areas and markers are displayed in their initial style after. */ + clearSelection(): void; + /** Converts client area coordinates into map coordinates. */ + convertCoordinates(x: number, y: number): Array; + /** Returns an array with all the map areas. */ + getAreas(): Array; + /** Returns an array with all the map markers. */ + getMarkers(): Array; + /** Gets the current coordinates of the map viewport. */ + viewport(): Array; + /** Sets the coordinates of the map viewport. */ + viewport(viewportCoordinates: Array): void; + /** Gets the current value of the map zoom factor. */ + zoomFactor(): number; + /** Sets the value of the map zoom factor. */ + zoomFactor(zoomFactor: number): void; + } +} +interface JQuery { + dxVectorMap(options?: DevExpress.viz.map.dxVectorMapOptions): JQuery; + dxVectorMap(methodName: string, ...params: any[]): any; + dxVectorMap(methodName: "instance"): DevExpress.viz.map.dxVectorMap; +} +declare module DevExpress.viz.sparklines { + export interface SparklineTooltip extends viz.core.Tooltip { + /** + * Specifies how a tooltip is horizontally aligned relative to the graph. + * @deprecated Tooltip alignment is no more available. + */ + horizontalAlignment?: string; + /** + * Specifies how a tooltip is vertically aligned relative to the graph. + * @deprecated Tooltip alignment is no more available. + */ + verticalAlignment?: string; + } + export interface BaseSparklineOptions extends viz.core.BaseWidgetOptions { + /** Specifies the blank space between the widget's extreme elements and the boundaries of the area provided for the widget in pixels. */ + margin?: viz.core.Margins; + /** Specifies the size of the widget. */ + size?: viz.core.Size; + /** Specifies tooltip options. */ + tooltip?: SparklineTooltip; + /** A handler for the tooltipShown event. */ + onTooltipShown?: (e: { + component: BaseSparkline; + element: Element; + }) => void; + /** A handler for the tooltipHidden event. */ + onTooltipHidden?: (e: { + component: BaseSparkline; + element: Element; + }) => void; + } + /** Overridden by descriptions for particular widgets. */ + export class BaseSparkline extends viz.core.BaseWidget { + /** Redraws a widget. */ + render(): void; + } + export interface dxBulletOptions extends BaseSparkline { + /** Specifies a color for the bullet bar. */ + color?: string; + /** Specifies an end value for the invisible scale. */ + endScaleValue?: number; + /** Specifies whether or not to show the target line. */ + showTarget?: boolean; + /** Specifies whether or not to show the line indicating zero on the invisible scale. */ + showZeroLevel?: boolean; + /** Specifies a start value for the invisible scale. */ + startScaleValue?: number; + /** Specifies the value indicated by the target line. */ + target?: number; + /** Specifies a color for both the target and zero level lines. */ + targetColor?: string; + /** Specifies the width of the target line. */ + targetWidth?: number; + /** Specifies the primary value indicated by the bullet bar. */ + value?: number; + } + /** A bullet graph widget. */ + export class dxBullet extends BaseSparkline { + constructor(element: JQuery, options?: dxBulletOptions); + constructor(element: Element, options?: dxBulletOptions); + } + export interface dxSparklineOptions extends BaseSparklineOptions { + /** Specifies the data source field that provides arguments for a sparkline. */ + argumentField?: string; + /** Sets a color for the bars indicating negative values. Available for a sparkline of the bar type only. */ + barNegativeColor?: string; + /** Sets a color for the bars indicating positive values. Available for a sparkline of the bar type only. */ + barPositiveColor?: string; + /** Specifies a data source for the sparkline. */ + dataSource?: Array; + /** Sets a color for the boundary of both the first and last points on a sparkline. */ + firstLastColor?: string; + /** Specifies whether a sparkline ignores null data points or not. */ + ignoreEmptyPoints?: boolean; + /** Sets a color for a line on a sparkline. Available for the sparklines of the line- and area-like types. */ + lineColor?: string; + /** Specifies a width for a line on a sparkline. Available for the sparklines of the line- and area-like types. */ + lineWidth?: number; + /** Sets a color for the bars indicating the values that are less than the winloss threshold. Available for a sparkline of the winloss type only. */ + lossColor?: string; + /** Sets a color for the boundary of the maximum point on a sparkline. */ + maxColor?: string; + /** Sets a color for the boundary of the minimum point on a sparkline. */ + minColor?: string; + /** Sets a color for points on a sparkline. Available for the sparklines of the line- and area-like types. */ + pointColor?: string; + /** Specifies the diameter of sparkline points in pixels. Available for the sparklines of line- and area-like types. */ + pointSize?: number; + /** Specifies a symbol to use as a point marker on a sparkline. Available for the sparklines of the line- and area-like types. */ + pointSymbol?: string; + /** Specifies whether or not to indicate both the first and last values on a sparkline. */ + showFirstLast?: boolean; + /** Specifies whether or not to indicate both the minimum and maximum values on a sparkline. */ + showMinMax?: boolean; + /** Determines the type of a sparkline. */ + type?: string; + /** Specifies the data source field that provides values for a sparkline. */ + valueField?: string; + /** Sets a color for the bars indicating the values greater than a winloss threshold. Available for a sparkline of the winloss type only. */ + winColor?: string; + /** Specifies a value that serves as a threshold for the sparkline of the winloss type. */ + winlossThreshold?: number; + /** Specifies the minimum value of the sparkline value axis. */ + minValue?: number; + /** Specifies the maximum value of the sparkline's value axis. */ + maxValue?: number; + } + /** A sparkline widget. */ + export class dxSparkline extends BaseSparkline { + constructor(element: JQuery, options?: dxSparklineOptions); + constructor(element: Element, options?: dxSparklineOptions); + } +} +interface JQuery { + dxBullet(options?: DevExpress.viz.sparklines.dxBulletOptions): JQuery; + dxBullet(methodName: string, ...params: any[]): any; + dxBullet(methodName: "instance"): DevExpress.viz.sparklines.dxBullet; + dxSparkline(options?: DevExpress.viz.sparklines.dxSparklineOptions): JQuery; + dxSparkline(methodName: string, ...params: any[]): any; + dxSparkline(methodName: "instance"): DevExpress.viz.sparklines.dxSparkline; +} diff --git a/devextreme/devextreme.d.ts b/devextreme/devextreme.d.ts index fc593db20..83e69504b 100644 --- a/devextreme/devextreme.d.ts +++ b/devextreme/devextreme.d.ts @@ -1,4 +1,4 @@ -// Type definitions for DevExtreme 15.1.7 +// Type definitions for DevExtreme 15.1.8 // Project: http://js.devexpress.com/ // Definitions by: DevExpress Inc. // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -35,7 +35,7 @@ declare module DevExpress { brokenRules: any[]; validators: IValidator[]; } - export interface GroupConfig extends EventsMixin { + export interface GroupConfig extends EventsMixin { group: any; validators: IValidator[]; validate(): ValidationGroupValidationResult; @@ -56,7 +56,7 @@ declare module DevExpress { /** Validates the rules that are defined within the dxValidator objects that are registered for the specified ViewModel. */ export function validateModel(model: Object): ValidationGroupValidationResult; /** Registers all the dxValidator objects by which the fields of the specified ViewModel are extended. */ - export function registerModelForValidation(model: Object): void; + export function registerModelForValidation(model: Object) : void; } export var hardwareBackButton: JQueryCallback; /** Processes the hardware back button click. */ @@ -223,10 +223,14 @@ declare module DevExpress { endUpdate(): void; /** Returns an instance of this component class. */ instance(): Component; - /** Sets one or more options of this component. */ - option(options: Object): void; /** Returns the configuration options of this component. */ - option(): Object; + option(): { + [optionKey: string]: any; + }; + /** Sets one or more options of this component. */ + option(options: { + [optionKey: string]: any; + }): void; /** Gets the value of the specified configuration option of this component. */ option(optionName: string): any; /** Sets a value to the specified configuration option of this component. */ @@ -1384,11 +1388,11 @@ declare module DevExpress.ui { }; /** A handler for the click event. */ onClick?: any; - clickAction?: any; + clickAction?: any; /** Specifies whether or not map widget controls are available. */ controls?: boolean; /** Specifies the height of the widget. */ - height?: number; + height?: any; /** A key used to authenticate the application within the required map provider. */ key?: { /** A key used to authenticate the application within the "Bing" map provider. */ @@ -1400,31 +1404,31 @@ declare module DevExpress.ui { } /** A handler for the markerAdded event. */ onMarkerAdded?: Function; - markerAddedAction?: Function; + markerAddedAction?: Function; /** A URL pointing to the custom icon to be used for map markers. */ markerIconSrc?: string; /** A handler for the markerRemoved event. */ onMarkerRemoved?: Function; - markerRemovedAction?: Function; + markerRemovedAction?: Function; /** An array of markers displayed on a map. */ markers?: Array; /** The name of the current map data provider. */ provider?: string; /** A handler for the ready event. */ onReady?: Function; - readyAction?: Function; + readyAction?: Function; /** A handler for the routeAdded event. */ onRouteAdded?: Function; - routeAddedAction?: Function; + routeAddedAction?: Function; /** A handler for the routeRemoved event. */ onRouteRemoved?: Function; - routeRemovedAction?: Function; + routeRemovedAction?: Function; /** An array of routes shown on the map. */ routes?: Array; /** The type of a map to display. */ type?: string; /** Specifies the width of the widget. */ - width?: number; + width?: any; /** The zoom level of the map. */ zoom?: number; } @@ -1435,7 +1439,7 @@ declare module DevExpress.ui { /** Adds a marker to the map. */ addMarker(markerOptions: Object): JQueryPromise; /** Adds a route to the map. */ - addRoute(options: Object): JQueryPromise; + addRoute(routeOptions: Object): JQueryPromise; /** Removes a marker from the map. */ removeMarker(marker: Object): JQueryPromise; /** Removes a route from the map. */ @@ -1787,7 +1791,7 @@ declare module DevExpress.ui { interval?: number; /** Specifies the maximum zoom level of a calendar, which is used to pick the date. */ maxZoomLevel?: string; - /** Specifies the minimal zoom level of a calendar, which is used to pick the date. */ + /** Specifies the minimal zoom level of a calendar, which is used to pick the date. */ minZoomLevel?: string; /** Specifies the type of date/time picker. */ pickerType?: string; @@ -1825,8 +1829,8 @@ declare module DevExpress.ui { maxZoomLevel?: string; /** Specifies the minimum zoom level of the calendar. */ minZoomLevel?: string; - /** The template to be used for rendering calendar cells. */ - cellTemplate?: any; + /** The template to be used for rendering calendar cells. */ + cellTemplate?: any; } /** A calendar widget. */ export class dxCalendar extends Editor { @@ -1976,6 +1980,8 @@ declare module DevExpress.ui { onProgress?: Function; /** A handler for the uploadError event. */ onUploadError?: Function; + /** A handler for the valueChanged event. */ + onValueChanged?: Function; } /** A widget used to select and upload a file or multiple files. */ export class dxFileUploader extends Editor { @@ -2145,6 +2151,11 @@ interface JQuery { dxSelectBox(options: string): any; dxSelectBox(options: string, ...params: any[]): any; dxSelectBox(options: DevExpress.ui.dxSelectBoxOptions): JQuery; + dxTagBox(): JQuery; + dxTagBox(options: "instance"): DevExpress.ui.dxTagBox; + dxTagBox(options: string): any; + dxTagBox(options: string, ...params: any[]): any; + dxTagBox(options: DevExpress.ui.dxTagBoxOptions): JQuery; dxScrollView(): JQuery; dxScrollView(options: "instance"): DevExpress.ui.dxScrollView; dxScrollView(options: string): any; @@ -3036,9 +3047,6 @@ declare module DevExpress.ui { showInColumnChooser?: boolean; /** Specifies the identifier of the column. */ name?: string; - // NOTE https://github.com/borisyankov/DefinitelyTyped/pull/5590 - text?: string; - value?: any; } export interface dxDataGridOptions extends WidgetOptions { /** Specifies whether the outer borders of the grid are visible or not. */ @@ -4291,16 +4299,16 @@ declare module DevExpress.viz.core { }) => void; /** A handler for the incidentOccurred event. */ onIncidentOccurred?: ( - component: BaseWidget, - element: Element, - target: { - id: string; - type: string; - args: any; - text: string; - widget: string; - version: string; - } + component: BaseWidget, + element: Element, + target: { + id: string; + type: string; + args: any; + text: string; + widget: string; + version: string; + } ) => void; /** Notifies a widget that it is embedded into an HTML page that uses a path modifier. */ pathModified?: boolean; @@ -5194,9 +5202,9 @@ declare module DevExpress.viz.charts { export interface BaseChartOptions extends viz.core.BaseWidgetOptions { /** Specifies adaptive layout options. */ adaptiveLayout?: { - /** Specifies the width of the widget container that is small enough for the layout to begin adapting. */ + /** Specifies the width of the widget that is small enough for the layout to begin adapting. */ width?: number; - /** Specifies the height of the widget container that is small enough for the layout to begin adapting. */ + /** Specifies the height of the widget that is small enough for the layout to begin adapting. */ height?: number; /** Specifies whether or not point labels can be hidden when the layout is adapting. */ keepLabels?: boolean; @@ -6049,8 +6057,8 @@ declare module DevExpress.viz.rangeSelector { useTicksAutoArrangement?: boolean; /** Specifies the type of values on the scale. */ valueType?: string; - /** Specifies the order of arguments on a discrete scale. */ - categories?: Array; + /** Specifies the order of arguments on a discrete scale. */ + categories?: Array; }; /** Specifies the range to be selected when displaying the dxRangeSelector. */ selectedRange?: { @@ -6351,9 +6359,9 @@ declare module DevExpress.viz.map { centerChanged?: (center: Array) => void; /** A handler for the centerChanged event. */ onCenterChanged?: (e: { - center: Array; - component: dxVectorMap; - element: Element; + center: Array; + component: dxVectorMap; + element: Element; }) => void; /** A handler for the tooltipShown event. */ onTooltipShown?: (e: { @@ -6569,4 +6577,4 @@ interface JQuery { dxSparkline(options?: DevExpress.viz.sparklines.dxSparklineOptions): JQuery; dxSparkline(methodName: string, ...params: any[]): any; dxSparkline(methodName: "instance"): DevExpress.viz.sparklines.dxSparkline; -} +} \ No newline at end of file diff --git a/dexie/dexie.d.ts b/dexie/dexie.d.ts index d6c26283c..13b9b31e0 100644 --- a/dexie/dexie.d.ts +++ b/dexie/dexie.d.ts @@ -38,7 +38,7 @@ declare class Dexie { static deepClone(obj: Object): Object; - version(versionNumber: number): Dexie.Version + version(versionNumber: number): Dexie.Version; on: { (eventName: string, subscriber: () => any): void; @@ -48,7 +48,7 @@ declare class Dexie { populate: Dexie.DexieEvent; blocked: Dexie.DexieEvent; versionchange: Dexie.DexieVersionChangeEvent; - } + }; open(): Dexie.Promise; diff --git a/dojo/dijit.d.ts b/dojo/dijit.d.ts index 0bb2ab67d..94f64d0db 100644 --- a/dojo/dijit.d.ts +++ b/dojo/dijit.d.ts @@ -490,7 +490,7 @@ declare module dijit { * @param widget * @param insertIndex Optional */ - addChild(widget: dijit._WidgetBase, insertIndex: number): void; + addChild(widget: dijit._WidgetBase, insertIndex?: number): void; /** * */ @@ -821,7 +821,7 @@ declare module dijit { * @param alwaysUseString Don't cache the DOM tree for this template, even if it doesn't have any variables * @param doc OptionalThe target document. Defaults to document global if unspecified. */ - getCachedTemplate(templateString: String, alwaysUseString: boolean, doc: HTMLDocument): any; + getCachedTemplate(templateString: String, alwaysUseString: boolean, doc?: HTMLDocument): any; } module _TemplatedMixin { /** @@ -1260,21 +1260,21 @@ declare module dijit { * @param widget * @param insertIndex Optional */ - addChild(widget: dijit._WidgetBase, insertIndex: number): void; + addChild(widget: dijit._WidgetBase, insertIndex?: number): void; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * Construct the UI for this widget, setting this.domNode. * Most widgets will mixin dijit._TemplatedMixin, which implements this method. @@ -1433,7 +1433,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * Destroy this widget, but not its descendants. Descendants means widgets inside of * this.containerNode. Will also destroy any resources (including widgets) registered via this.own(). @@ -1491,7 +1491,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Default focus() implementation: focus the first child. * @@ -1617,7 +1617,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -1628,7 +1628,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -1639,7 +1639,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -1650,7 +1650,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -1661,7 +1661,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -1672,7 +1672,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * */ @@ -2345,7 +2345,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * Destroy this widget, but not its descendants. Descendants means widgets inside of * this.containerNode. Will also destroy any resources (including widgets) registered via this.own(). @@ -2490,7 +2490,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -2911,14 +2911,14 @@ declare module dijit { * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * Construct the UI for this widget, setting this.domNode. * Most widgets will mixin dijit._TemplatedMixin, which implements this method. @@ -3061,7 +3061,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * Destroy this widget, but not its descendants. Descendants means widgets inside of * this.containerNode. Will also destroy any resources (including widgets) registered via this.own(). @@ -3119,7 +3119,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Get a property from a widget. * Get a named property from a widget. The property may @@ -3201,7 +3201,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -3212,7 +3212,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -3223,7 +3223,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -3234,7 +3234,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -3245,7 +3245,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -3256,7 +3256,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * */ @@ -3877,7 +3877,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * Destroy this widget, but not its descendants. Descendants means widgets inside of * this.containerNode. Will also destroy any resources (including widgets) registered via this.own(). @@ -3935,7 +3935,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Get a property from a widget. * Get a named property from a widget. The property may @@ -3984,7 +3984,7 @@ declare module dijit { * @param dateObject * @param locale Optional */ - isDisabledDate(dateObject: Date, locale: String): boolean; + isDisabledDate(dateObject: Date, locale?: String): boolean; /** * Return true if this widget can currently be focused * and false if not @@ -4032,7 +4032,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -4043,7 +4043,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -4054,7 +4054,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -4065,7 +4065,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -4076,7 +4076,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -4087,7 +4087,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * Processing after the DOM fragment is created * Called after the DOM fragment has been created, but not necessarily @@ -4132,7 +4132,7 @@ declare module dijit { * @param dateObject A Date object * @param options OptionalAn object with the following properties:selector (String): "date" or "time" for partial formatting of the Date object.Both date and time will be formatted by default.zulu (Boolean): if true, UTC/GMT is used for a timezonemilliseconds (Boolean): if true, output milliseconds */ - serialize(dateObject: Date, options: Object): any; + serialize(dateObject: Date, options?: Object): any; /** * Set a property on a widget * Sets named properties on a widget which may potentially be handled by a @@ -4787,7 +4787,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * Destroy this widget, but not its descendants. Descendants means widgets inside of * this.containerNode. Will also destroy any resources (including widgets) registered via this.own(). @@ -4845,7 +4845,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Focus the calendar by focusing one of the calendar cells * @@ -4888,7 +4888,7 @@ declare module dijit { * @param dateObject * @param locale Optional */ - getClassForDate(dateObject: Date, locale: String): String; + getClassForDate(dateObject: Date, locale?: String): String; /** * Returns the parent widget of this widget. * @@ -4905,7 +4905,7 @@ declare module dijit { * @param dateObject * @param locale Optional */ - isDisabledDate(dateObject: Date, locale: String): boolean; + isDisabledDate(dateObject: Date, locale?: String): boolean; /** * Return true if this widget can currently be focused * and false if not @@ -4953,7 +4953,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -4964,7 +4964,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -4975,7 +4975,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -4986,7 +4986,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -4997,7 +4997,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -5008,7 +5008,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * */ @@ -5453,7 +5453,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * Destroy this widget, but not its descendants. Descendants means widgets inside of * this.containerNode. Will also destroy any resources (including widgets) registered via this.own(). @@ -5511,7 +5511,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Get a property from a widget. * Get a named property from a widget. The property may @@ -5594,7 +5594,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -5605,7 +5605,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -5616,7 +5616,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -5627,7 +5627,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -5638,7 +5638,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -5649,7 +5649,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * Processing after the DOM fragment is created * Called after the DOM fragment has been created, but not necessarily @@ -5978,14 +5978,14 @@ declare module dijit { * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * */ @@ -6126,7 +6126,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * Destroy this widget, but not its descendants. Descendants means widgets inside of * this.containerNode. Will also destroy any resources (including widgets) registered via this.own(). @@ -6184,7 +6184,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Get a property from a widget. * Get a named property from a widget. The property may @@ -6266,7 +6266,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -6277,7 +6277,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -6288,7 +6288,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -6299,7 +6299,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -6310,7 +6310,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -6321,7 +6321,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * */ @@ -6896,14 +6896,14 @@ declare module dijit { * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * */ @@ -7044,7 +7044,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * Destroy this widget, but not its descendants. Descendants means widgets inside of * this.containerNode. Will also destroy any resources (including widgets) registered via this.own(). @@ -7102,7 +7102,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Focus the calendar by focusing one of the calendar cells * @@ -7178,7 +7178,7 @@ declare module dijit { * @param dateObject * @param locale Optional */ - isDisabledDate(dateObject: Date, locale: String): boolean; + isDisabledDate(dateObject: Date, locale?: String): boolean; /** * Return true if this widget can currently be focused * and false if not @@ -7226,7 +7226,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -7237,7 +7237,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -7248,7 +7248,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -7259,7 +7259,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -7270,7 +7270,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -7281,7 +7281,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * */ @@ -7767,14 +7767,14 @@ declare module dijit { * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * Construct the UI for this widget, setting this.domNode. * Most widgets will mixin dijit._TemplatedMixin, which implements this method. @@ -7917,7 +7917,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * Destroy this widget, but not its descendants. Descendants means widgets inside of * this.containerNode. Will also destroy any resources (including widgets) registered via this.own(). @@ -7975,7 +7975,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Get a property from a widget. * Get a named property from a widget. The property may @@ -8057,7 +8057,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -8068,7 +8068,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -8079,7 +8079,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -8090,7 +8090,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -8101,7 +8101,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -8112,7 +8112,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * */ @@ -8770,21 +8770,21 @@ declare module dijit { * @param widget * @param insertIndex Optional */ - addChild(widget: dijit._WidgetBase, insertIndex: number): void; + addChild(widget: dijit._WidgetBase, insertIndex?: number): void; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * Construct the UI for this widget, setting this.domNode. * Most widgets will mixin dijit._TemplatedMixin, which implements this method. @@ -8940,7 +8940,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * Destroy this widget, but not its descendants. Descendants means widgets inside of * this.containerNode. Will also destroy any resources (including widgets) registered via this.own(). @@ -8998,7 +8998,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Put focus on this widget * @@ -9122,7 +9122,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -9133,7 +9133,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -9144,7 +9144,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -9155,7 +9155,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -9166,7 +9166,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -9177,7 +9177,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * */ @@ -9779,14 +9779,14 @@ declare module dijit { * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * */ @@ -9927,7 +9927,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * Destroy this widget, but not its descendants. Descendants means widgets inside of * this.containerNode. Will also destroy any resources (including widgets) registered via this.own(). @@ -9985,7 +9985,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Focus on this MenuItem * @@ -10091,7 +10091,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -10102,7 +10102,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -10113,7 +10113,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -10124,7 +10124,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -10135,7 +10135,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -10146,7 +10146,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * */ @@ -10638,14 +10638,14 @@ declare module dijit { * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * Construct the UI for this widget, setting this.domNode. * Most widgets will mixin dijit._TemplatedMixin, which implements this method. @@ -10788,7 +10788,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * */ @@ -10836,7 +10836,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Get a property from a widget. * Get a named property from a widget. The property may @@ -10923,7 +10923,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -10934,7 +10934,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -10945,7 +10945,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -10956,7 +10956,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -10967,7 +10967,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -10978,7 +10978,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * */ @@ -11780,21 +11780,21 @@ declare module dijit { * @param widget * @param insertIndex Optional */ - addChild(widget: dijit._WidgetBase, insertIndex: number): void; + addChild(widget: dijit._WidgetBase, insertIndex?: number): void; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * */ @@ -11954,7 +11954,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * */ @@ -11976,7 +11976,7 @@ declare module dijit { * * @param preserveDom OptionalIf true, this method will leave the original DOM structure aloneduring tear-down. Note: this will not work with _Templatedwidgets yet. */ - destroyRendering(preserveDom: boolean): void; + destroyRendering(preserveDom?: boolean): void; /** * Deprecated, will be removed in 2.0, use handle.remove() instead. * @@ -12003,7 +12003,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Callback when the user hits the submit button. * Override this method to handle Dialog execution. @@ -12140,7 +12140,7 @@ declare module dijit { * @param reference Widget, DOMNode, DocumentFragment, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -12151,7 +12151,7 @@ declare module dijit { * @param reference Widget, DOMNode, DocumentFragment, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -12173,7 +12173,7 @@ declare module dijit { * @param reference Widget, DOMNode, DocumentFragment, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -12184,7 +12184,7 @@ declare module dijit { * @param reference Widget, DOMNode, DocumentFragment, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -12195,7 +12195,7 @@ declare module dijit { * @param reference Widget, DOMNode, DocumentFragment, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * */ @@ -13052,21 +13052,21 @@ declare module dijit { * @param widget * @param insertIndex Optional */ - addChild(widget: dijit._WidgetBase, insertIndex: number): void; + addChild(widget: dijit._WidgetBase, insertIndex?: number): void; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * */ @@ -13226,7 +13226,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * */ @@ -13275,7 +13275,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Callback when the user hits the submit button. * Override this method to handle Dialog execution. @@ -13412,7 +13412,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -13423,7 +13423,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -13434,7 +13434,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -13445,7 +13445,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -13456,7 +13456,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -13467,7 +13467,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * */ @@ -14447,14 +14447,14 @@ declare module dijit { * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * */ @@ -14595,7 +14595,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * Destroy this widget, but not its descendants. Descendants means widgets inside of * this.containerNode. Will also destroy any resources (including widgets) registered via this.own(). @@ -14653,7 +14653,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Focus this widget. Puts focus on the most recently focused cell. * @@ -14740,7 +14740,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -14751,7 +14751,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -14762,7 +14762,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -14773,7 +14773,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -14784,7 +14784,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -14795,7 +14795,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * */ @@ -15584,21 +15584,21 @@ declare module dijit { * @param widget * @param insertIndex Optional */ - addChild(widget: dijit._WidgetBase, insertIndex: number): void; + addChild(widget: dijit._WidgetBase, insertIndex?: number): void; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * */ @@ -15750,7 +15750,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * */ @@ -15794,7 +15794,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Get a property from a widget. * Get a named property from a widget. The property may @@ -15900,7 +15900,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -15911,7 +15911,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -15922,7 +15922,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -15933,7 +15933,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -15944,7 +15944,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -15955,7 +15955,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * */ @@ -16640,21 +16640,21 @@ declare module dijit { * @param widget * @param insertIndex Optional */ - addChild(widget: dijit._WidgetBase, insertIndex: number): void; + addChild(widget: dijit._WidgetBase, insertIndex?: number): void; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * Construct the UI for this widget, setting this.domNode. * Most widgets will mixin dijit._TemplatedMixin, which implements this method. @@ -16813,7 +16813,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * Destroy this widget, but not its descendants. Descendants means widgets inside of * this.containerNode. Will also destroy any resources (including widgets) registered via this.own(). @@ -16871,7 +16871,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Default focus() implementation: focus the first child. * @@ -16997,7 +16997,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -17008,7 +17008,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -17019,7 +17019,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -17030,7 +17030,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -17041,7 +17041,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -17052,7 +17052,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * */ @@ -17756,7 +17756,7 @@ declare module dijit { * @param plugin String, args object, plugin instance, or plugin constructor * @param index OptionalUsed when creating an instance fromsomething already in this.plugins. Ensures that the newinstance is assigned to this.plugins at that index. */ - addPlugin(plugin: String, index: number): void; + addPlugin(plugin: String, index?: number): void; /** * takes a plugin name as a string or a plugin instance and * adds it to the toolbar and associates it with this editor @@ -17768,7 +17768,7 @@ declare module dijit { * @param plugin String, args object, plugin instance, or plugin constructor * @param index OptionalUsed when creating an instance fromsomething already in this.plugins. Ensures that the newinstance is assigned to this.plugins at that index. */ - addPlugin(plugin: Object, index: number): void; + addPlugin(plugin: Object, index?: number): void; /** * takes a plugin name as a string or a plugin instance and * adds it to the toolbar and associates it with this editor @@ -17780,7 +17780,7 @@ declare module dijit { * @param plugin String, args object, plugin instance, or plugin constructor * @param index OptionalUsed when creating an instance fromsomething already in this.plugins. Ensures that the newinstance is assigned to this.plugins at that index. */ - addPlugin(plugin: Function, index: number): void; + addPlugin(plugin: Function, index?: number): void; /** * add an external stylesheet for the editing area * @@ -17793,14 +17793,14 @@ declare module dijit { * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * Remove focus from this instance. * @@ -17948,7 +17948,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * */ @@ -17996,7 +17996,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Main handler for executing any commands to the editor, like paste, bold, etc. * Called by plugins, but not meant to be called by end users. @@ -18117,7 +18117,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -18128,7 +18128,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -18139,7 +18139,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -18150,7 +18150,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -18161,7 +18161,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -18172,7 +18172,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * */ @@ -18733,14 +18733,14 @@ declare module dijit { * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * Construct the UI for this widget, setting this.domNode. * Most widgets will mixin dijit._TemplatedMixin, which implements this method. @@ -18883,7 +18883,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * */ @@ -18942,7 +18942,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Get a property from a widget. * Get a named property from a widget. The property may @@ -19029,7 +19029,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -19040,7 +19040,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -19051,7 +19051,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -19062,7 +19062,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -19073,7 +19073,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -19084,7 +19084,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * */ @@ -19577,14 +19577,14 @@ declare module dijit { * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * */ @@ -19729,7 +19729,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * */ @@ -19777,7 +19777,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * User overridable function returning a Boolean to indicate * if the Save button should be enabled or not - usually due to invalid conditions @@ -19875,7 +19875,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -19886,7 +19886,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -19897,7 +19897,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -19908,7 +19908,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -19919,7 +19919,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -19930,7 +19930,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * */ @@ -20511,7 +20511,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * Destroy this widget, but not its descendants. Descendants means widgets inside of * this.containerNode. Will also destroy any resources (including widgets) registered via this.own(). @@ -20569,7 +20569,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Get a property from a widget. * Get a named property from a widget. The property may @@ -20670,7 +20670,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -20681,7 +20681,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -20692,7 +20692,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -20703,7 +20703,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -20714,7 +20714,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -20725,7 +20725,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * Processing after the DOM fragment is created * Called after the DOM fragment has been created, but not necessarily @@ -21199,21 +21199,21 @@ declare module dijit { * @param widget * @param insertIndex Optional */ - addChild(widget: dijit._WidgetBase, insertIndex: number): void; + addChild(widget: dijit._WidgetBase, insertIndex?: number): void; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * Construct the UI for this widget, setting this.domNode. * Most widgets will mixin dijit._TemplatedMixin, which implements this method. @@ -21372,7 +21372,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * Destroy this widget, but not its descendants. Descendants means widgets inside of * this.containerNode. Will also destroy any resources (including widgets) registered via this.own(). @@ -21430,7 +21430,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Default focus() implementation: focus the first child. * @@ -21554,7 +21554,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -21565,7 +21565,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -21576,7 +21576,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -21587,7 +21587,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -21598,7 +21598,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -21609,7 +21609,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * */ @@ -22291,21 +22291,21 @@ declare module dijit { * @param widget * @param insertIndex Optional */ - addChild(widget: dijit._WidgetBase, insertIndex: number): void; + addChild(widget: dijit._WidgetBase, insertIndex?: number): void; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * Attach menu to given node * @@ -22476,7 +22476,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * */ @@ -22524,7 +22524,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Default focus() implementation: focus the first child. * @@ -22657,7 +22657,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -22668,7 +22668,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -22679,7 +22679,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -22690,7 +22690,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -22701,7 +22701,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -22712,7 +22712,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * */ @@ -23310,14 +23310,14 @@ declare module dijit { * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * */ @@ -23458,7 +23458,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * Destroy this widget, but not its descendants. Descendants means widgets inside of * this.containerNode. Will also destroy any resources (including widgets) registered via this.own(). @@ -23516,7 +23516,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Focus on this MenuItem * @@ -23622,7 +23622,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -23633,7 +23633,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -23644,7 +23644,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -23655,7 +23655,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -23666,7 +23666,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -23677,7 +23677,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * */ @@ -24227,14 +24227,14 @@ declare module dijit { * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * */ @@ -24375,7 +24375,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * Destroy this widget, but not its descendants. Descendants means widgets inside of * this.containerNode. Will also destroy any resources (including widgets) registered via this.own(). @@ -24433,7 +24433,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Focus on this MenuItem * @@ -24539,7 +24539,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -24550,7 +24550,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -24561,7 +24561,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -24572,7 +24572,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -24583,7 +24583,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -24594,7 +24594,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * */ @@ -25159,14 +25159,14 @@ declare module dijit { * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * */ @@ -25307,7 +25307,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * Destroy this widget, but not its descendants. Descendants means widgets inside of * this.containerNode. Will also destroy any resources (including widgets) registered via this.own(). @@ -25363,7 +25363,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Focus on this MenuItem * @@ -25469,7 +25469,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -25480,7 +25480,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -25491,7 +25491,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -25502,7 +25502,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -25513,7 +25513,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -25524,7 +25524,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * */ @@ -26066,14 +26066,14 @@ declare module dijit { * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * */ @@ -26214,7 +26214,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * Destroy this widget, but not its descendants. Descendants means widgets inside of * this.containerNode. Will also destroy any resources (including widgets) registered via this.own(). @@ -26270,7 +26270,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Focus on this MenuItem * @@ -26376,7 +26376,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -26387,7 +26387,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -26398,7 +26398,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -26409,7 +26409,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -26420,7 +26420,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -26431,7 +26431,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * */ @@ -26956,14 +26956,14 @@ declare module dijit { * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * */ @@ -27104,7 +27104,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * Destroy this widget, but not its descendants. Descendants means widgets inside of * this.containerNode. Will also destroy any resources (including widgets) registered via this.own(). @@ -27162,7 +27162,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Get a property from a widget. * Get a named property from a widget. The property may @@ -27244,7 +27244,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -27255,7 +27255,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -27266,7 +27266,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -27277,7 +27277,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -27288,7 +27288,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -27299,7 +27299,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * */ @@ -27876,14 +27876,14 @@ declare module dijit { * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * */ @@ -28024,7 +28024,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * Destroy this widget, but not its descendants. Descendants means widgets inside of * this.containerNode. Will also destroy any resources (including widgets) registered via this.own(). @@ -28082,7 +28082,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Focus on this MenuItem * @@ -28188,7 +28188,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -28199,7 +28199,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -28210,7 +28210,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -28221,7 +28221,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -28232,7 +28232,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -28243,7 +28243,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * */ @@ -28745,21 +28745,21 @@ declare module dijit { * @param widget * @param insertIndex Optional */ - addChild(widget: dijit._WidgetBase, insertIndex: number): void; + addChild(widget: dijit._WidgetBase, insertIndex?: number): void; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * Construct the UI for this widget, setting this.domNode. * Most widgets will mixin dijit._TemplatedMixin, which implements this method. @@ -28916,7 +28916,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * Destroy this widget, but not its descendants. Descendants means widgets inside of * this.containerNode. Will also destroy any resources (including widgets) registered via this.own(). @@ -28974,7 +28974,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Default focus() implementation: focus the first child. * @@ -29100,7 +29100,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -29111,7 +29111,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -29122,7 +29122,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -29133,7 +29133,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -29144,7 +29144,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -29155,7 +29155,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * */ @@ -29696,14 +29696,14 @@ declare module dijit { * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * */ @@ -29844,7 +29844,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * */ @@ -29892,7 +29892,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Get a property from a widget. * Get a named property from a widget. The property may @@ -29986,7 +29986,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -29997,7 +29997,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -30008,7 +30008,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -30019,7 +30019,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -30030,7 +30030,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -30041,7 +30041,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * */ @@ -30515,14 +30515,14 @@ declare module dijit { * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * Construct the UI for this widget, setting this.domNode. * Most widgets will mixin dijit._TemplatedMixin, which implements this method. @@ -30665,7 +30665,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * Destroy this widget, but not its descendants. Descendants means widgets inside of * this.containerNode. Will also destroy any resources (including widgets) registered via this.own(). @@ -30723,7 +30723,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Get a property from a widget. * Get a named property from a widget. The property may @@ -30823,7 +30823,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -30834,7 +30834,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -30845,7 +30845,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -30856,7 +30856,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -30867,7 +30867,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -30878,7 +30878,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * */ @@ -31359,14 +31359,14 @@ declare module dijit { * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * */ @@ -31507,7 +31507,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * Destroy this widget, but not its descendants. Descendants means widgets inside of * this.containerNode. Will also destroy any resources (including widgets) registered via this.own(). @@ -31565,7 +31565,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Get a property from a widget. * Get a named property from a widget. The property may @@ -31646,7 +31646,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -31657,7 +31657,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -31668,7 +31668,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -31679,7 +31679,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -31690,7 +31690,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -31701,7 +31701,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * */ @@ -32377,21 +32377,21 @@ declare module dijit { * @param widget * @param insertIndex Optional */ - addChild(widget: dijit._WidgetBase, insertIndex: number): void; + addChild(widget: dijit._WidgetBase, insertIndex?: number): void; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * */ @@ -32543,7 +32543,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * */ @@ -32587,7 +32587,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Get a property from a widget. * Get a named property from a widget. The property may @@ -32693,7 +32693,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -32704,7 +32704,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -32715,7 +32715,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -32726,7 +32726,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -32737,7 +32737,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -32748,7 +32748,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * */ @@ -33478,21 +33478,21 @@ declare module dijit { * @param widget * @param insertIndex Optional */ - addChild(widget: dijit._WidgetBase, insertIndex: number): void; + addChild(widget: dijit._WidgetBase, insertIndex?: number): void; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * */ @@ -33652,7 +33652,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * */ @@ -33701,7 +33701,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Callback when the user hits the submit button. * Override this method to handle Dialog execution. @@ -33844,7 +33844,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -33855,7 +33855,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -33866,7 +33866,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -33877,7 +33877,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -33888,7 +33888,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -33899,7 +33899,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * */ @@ -34845,14 +34845,14 @@ declare module dijit { * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * Construct the UI for this widget, setting this.domNode. * Most widgets will mixin dijit._TemplatedMixin, which implements this method. @@ -35000,7 +35000,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * */ @@ -35050,7 +35050,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Expand all nodes in the tree * @@ -35274,7 +35274,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -35285,7 +35285,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -35296,7 +35296,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -35307,7 +35307,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -35318,7 +35318,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -35329,7 +35329,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * */ @@ -35886,21 +35886,21 @@ declare module dijit { * @param widget * @param insertIndex Optional */ - addChild(widget: dijit._WidgetBase, insertIndex: number): void; + addChild(widget: dijit._WidgetBase, insertIndex?: number): void; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * */ @@ -36046,7 +36046,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * Destroy this widget, but not its descendants. Descendants means widgets inside of * this.containerNode. Will also destroy any resources (including widgets) registered via this.own(). @@ -36104,7 +36104,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Show my children * @@ -36239,7 +36239,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -36250,7 +36250,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -36261,7 +36261,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -36272,7 +36272,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -36283,7 +36283,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -36294,7 +36294,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * */ @@ -37349,14 +37349,14 @@ declare module dijit { * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * Remove focus from this instance. * @@ -37504,7 +37504,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * */ @@ -37552,7 +37552,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Executes a command in the Rich Text area * @@ -37668,7 +37668,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -37679,7 +37679,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -37690,7 +37690,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -37701,7 +37701,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -37712,7 +37712,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -37723,7 +37723,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * */ @@ -38578,14 +38578,14 @@ declare module dijit { * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * Construct the UI for this widget, setting this.domNode. * Most widgets will mixin dijit._TemplatedMixin, which implements this method. @@ -38733,7 +38733,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * Destroy this widget, but not its descendants. Descendants means widgets inside of * this.containerNode. Will also destroy any resources (including widgets) registered via this.own(). @@ -38791,7 +38791,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Over-ride for focus control of this widget. Delegates focus down to the * filtering select. @@ -38879,7 +38879,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -38890,7 +38890,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -38901,7 +38901,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -38912,7 +38912,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -38923,7 +38923,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -38934,7 +38934,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * Over-ride for the default postCreate action * This establishes the filtering selects and the like. @@ -39440,14 +39440,14 @@ declare module dijit { * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * Construct the UI for this widget, setting this.domNode. * Most widgets will mixin dijit._TemplatedMixin, which implements this method. @@ -39595,7 +39595,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * Destroy this widget, but not its descendants. Descendants means widgets inside of * this.containerNode. Will also destroy any resources (including widgets) registered via this.own(). @@ -39653,7 +39653,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Over-ride for focus control of this widget. Delegates focus down to the * filtering select. @@ -39750,7 +39750,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -39761,7 +39761,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -39772,7 +39772,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -39783,7 +39783,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -39794,7 +39794,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -39805,7 +39805,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * Over-ride for the default postCreate action * This establishes the filtering selects and the like. @@ -40311,14 +40311,14 @@ declare module dijit { * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * Construct the UI for this widget, setting this.domNode. * Most widgets will mixin dijit._TemplatedMixin, which implements this method. @@ -40466,7 +40466,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * Destroy this widget, but not its descendants. Descendants means widgets inside of * this.containerNode. Will also destroy any resources (including widgets) registered via this.own(). @@ -40524,7 +40524,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Over-ride for focus control of this widget. Delegates focus down to the * filtering select. @@ -40623,7 +40623,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -40634,7 +40634,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -40645,7 +40645,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -40656,7 +40656,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -40667,7 +40667,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -40678,7 +40678,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * Over-ride for the default postCreate action * This establishes the filtering selects and the like. @@ -41184,14 +41184,14 @@ declare module dijit { * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * Construct the UI for this widget, setting this.domNode. * Most widgets will mixin dijit._TemplatedMixin, which implements this method. @@ -41339,7 +41339,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * Destroy this widget, but not its descendants. Descendants means widgets inside of * this.containerNode. Will also destroy any resources (including widgets) registered via this.own(). @@ -41397,7 +41397,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Over-ride for focus control of this widget. Delegates focus down to the * filtering select. @@ -41494,7 +41494,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -41505,7 +41505,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -41516,7 +41516,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -41527,7 +41527,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -41538,7 +41538,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -41549,7 +41549,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * */ @@ -44620,7 +44620,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * Destroy this widget, but not its descendants. Descendants means widgets inside of * this.containerNode. Will also destroy any resources (including widgets) registered via this.own(). @@ -44678,7 +44678,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Get a property from a widget. * Get a named property from a widget. The property may @@ -44782,7 +44782,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -44793,7 +44793,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -44804,7 +44804,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -44815,7 +44815,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -44826,7 +44826,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -44837,7 +44837,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * */ @@ -45701,14 +45701,14 @@ declare module dijit { * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * */ @@ -45861,7 +45861,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * Destroy this widget, but not its descendants. Descendants means widgets inside of * this.containerNode. Will also destroy any resources (including widgets) registered via this.own(). @@ -45926,7 +45926,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Auto-corrections (such as trimming) that are applied to textbox * value on blur or form submit. @@ -46110,7 +46110,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -46121,7 +46121,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -46132,7 +46132,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -46143,7 +46143,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -46154,7 +46154,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -46165,7 +46165,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * */ @@ -46985,14 +46985,14 @@ declare module dijit { * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * */ @@ -47140,7 +47140,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * Clean up our connections * @@ -47189,7 +47189,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Put focus on this widget * @@ -47287,7 +47287,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -47298,7 +47298,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -47309,7 +47309,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -47320,7 +47320,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -47331,7 +47331,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -47342,7 +47342,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * sets up our event handling that we need for functioning * as a select @@ -48057,14 +48057,14 @@ declare module dijit { * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * Construct the UI for this widget, setting this.domNode. * Most widgets will mixin dijit._TemplatedMixin, which implements this method. @@ -48218,7 +48218,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * Destroy this widget, but not its descendants. Descendants means widgets inside of * this.containerNode. Will also destroy any resources (including widgets) registered via this.own(). @@ -48276,7 +48276,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Put focus on this widget * @@ -48368,7 +48368,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -48379,7 +48379,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -48390,7 +48390,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -48401,7 +48401,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -48412,7 +48412,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -48423,7 +48423,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * */ @@ -49020,14 +49020,14 @@ declare module dijit { * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * Construct the UI for this widget, setting this.domNode. * Most widgets will mixin dijit._TemplatedMixin, which implements this method. @@ -49181,7 +49181,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * Destroy this widget, but not its descendants. Descendants means widgets inside of * this.containerNode. Will also destroy any resources (including widgets) registered via this.own(). @@ -49239,7 +49239,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Put focus on this widget * @@ -49331,7 +49331,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -49342,7 +49342,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -49353,7 +49353,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -49364,7 +49364,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -49375,7 +49375,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -49386,7 +49386,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * */ @@ -50555,14 +50555,14 @@ declare module dijit { * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * Construct the UI for this widget, setting this.domNode. * Most widgets will mixin dijit._TemplatedMixin, which implements this method. @@ -50712,7 +50712,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * Destroy this widget, but not its descendants. Descendants means widgets inside of * this.containerNode. Will also destroy any resources (including widgets) registered via this.own(). @@ -50770,7 +50770,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Put focus on this widget * @@ -50862,7 +50862,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -50873,7 +50873,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -50884,7 +50884,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -50895,7 +50895,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -50906,7 +50906,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -50917,7 +50917,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * */ @@ -51840,14 +51840,14 @@ declare module dijit { * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * */ @@ -51995,7 +51995,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * Destroy this widget, but not its descendants. Descendants means widgets inside of * this.containerNode. Will also destroy any resources (including widgets) registered via this.own(). @@ -52060,7 +52060,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Auto-corrections (such as trimming) that are applied to textbox * value on blur or form submit. @@ -52211,7 +52211,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -52222,7 +52222,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -52233,7 +52233,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -52244,7 +52244,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -52255,7 +52255,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -52266,7 +52266,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * */ @@ -52950,14 +52950,14 @@ declare module dijit { * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * Construct the UI for this widget, setting this.domNode. * Most widgets will mixin dijit._TemplatedMixin, which implements this method. @@ -53107,7 +53107,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * Destroy this widget, but not its descendants. Descendants means widgets inside of * this.containerNode. Will also destroy any resources (including widgets) registered via this.own(). @@ -53165,7 +53165,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Put focus on this widget * @@ -53257,7 +53257,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -53268,7 +53268,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -53279,7 +53279,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -53290,7 +53290,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -53301,7 +53301,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -53312,7 +53312,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * */ @@ -53991,21 +53991,21 @@ declare module dijit { * @param widget * @param insertIndex Optional */ - addChild(widget: dijit._WidgetBase, insertIndex: number): void; + addChild(widget: dijit._WidgetBase, insertIndex?: number): void; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * Construct the UI for this widget, setting this.domNode. * Most widgets will mixin dijit._TemplatedMixin, which implements this method. @@ -54161,7 +54161,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * Destroy this widget, but not its descendants. Descendants means widgets inside of * this.containerNode. Will also destroy any resources (including widgets) registered via this.own(). @@ -54219,7 +54219,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Focuses this widget to according to position, if specified, * otherwise on arrow node @@ -54345,7 +54345,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -54356,7 +54356,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -54367,7 +54367,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -54378,7 +54378,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -54389,7 +54389,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -54400,7 +54400,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * */ @@ -55388,14 +55388,14 @@ declare module dijit { * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * Construct the UI for this widget, setting this.domNode. * Most widgets will mixin dijit._TemplatedMixin, which implements this method. @@ -55551,7 +55551,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * Destroy this widget, but not its descendants. Descendants means widgets inside of * this.containerNode. Will also destroy any resources (including widgets) registered via this.own(). @@ -55631,7 +55631,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Auto-corrections (such as trimming) that are applied to textbox * value on blur or form submit. @@ -55807,7 +55807,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -55818,7 +55818,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -55829,7 +55829,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -55840,7 +55840,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -55851,7 +55851,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -55862,7 +55862,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * */ @@ -56701,14 +56701,14 @@ declare module dijit { * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * */ @@ -56856,7 +56856,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * Destroy this widget, but not its descendants. Descendants means widgets inside of * this.containerNode. Will also destroy any resources (including widgets) registered via this.own(). @@ -56921,7 +56921,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Auto-corrections (such as trimming) that are applied to textbox * value on blur or form submit. @@ -57072,7 +57072,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -57083,7 +57083,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -57094,7 +57094,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -57105,7 +57105,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -57116,7 +57116,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -57127,7 +57127,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * */ @@ -57726,14 +57726,14 @@ declare module dijit { * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * Construct the UI for this widget, setting this.domNode. * Most widgets will mixin dijit._TemplatedMixin, which implements this method. @@ -57884,7 +57884,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * Destroy this widget, but not its descendants. Descendants means widgets inside of * this.containerNode. Will also destroy any resources (including widgets) registered via this.own(). @@ -57947,7 +57947,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Deprecated: use submit() * @@ -58045,7 +58045,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -58056,7 +58056,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -58067,7 +58067,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -58078,7 +58078,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -58089,7 +58089,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -58100,7 +58100,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * */ @@ -58817,21 +58817,21 @@ declare module dijit { * @param widget * @param insertIndex Optional */ - addChild(widget: dijit._WidgetBase, insertIndex: number): void; + addChild(widget: dijit._WidgetBase, insertIndex?: number): void; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * Construct the UI for this widget, setting this.domNode. * Most widgets will mixin dijit._TemplatedMixin, which implements this method. @@ -58987,7 +58987,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * Destroy this widget, but not its descendants. Descendants means widgets inside of * this.containerNode. Will also destroy any resources (including widgets) registered via this.own(). @@ -59045,7 +59045,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Put focus on this widget * @@ -59169,7 +59169,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -59180,7 +59180,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -59191,7 +59191,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -59202,7 +59202,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -59213,7 +59213,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -59224,7 +59224,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * */ @@ -60064,14 +60064,14 @@ declare module dijit { * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * */ @@ -60224,7 +60224,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * Destroy this widget, but not its descendants. Descendants means widgets inside of * this.containerNode. Will also destroy any resources (including widgets) registered via this.own(). @@ -60289,7 +60289,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Auto-corrections (such as trimming) that are applied to textbox * value on blur or form submit. @@ -60473,7 +60473,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -60484,7 +60484,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -60495,7 +60495,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -60506,7 +60506,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -60517,7 +60517,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -60528,7 +60528,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * @@ -61073,14 +61073,14 @@ declare module dijit { * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * */ @@ -61221,7 +61221,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * Destroy this widget, but not its descendants. Descendants means widgets inside of * this.containerNode. Will also destroy any resources (including widgets) registered via this.own(). @@ -61279,7 +61279,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Get a property from a widget. * Get a named property from a widget. The property may @@ -61361,7 +61361,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -61372,7 +61372,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -61383,7 +61383,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -61394,7 +61394,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -61405,7 +61405,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -61416,7 +61416,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * */ @@ -62380,14 +62380,14 @@ declare module dijit { * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * */ @@ -62541,7 +62541,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * Destroy this widget, but not its descendants. Descendants means widgets inside of * this.containerNode. Will also destroy any resources (including widgets) registered via this.own(). @@ -62621,7 +62621,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Auto-corrections (such as trimming) that are applied to textbox * value on blur or form submit. @@ -62794,7 +62794,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -62805,7 +62805,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -62816,7 +62816,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -62827,7 +62827,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -62838,7 +62838,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -62849,7 +62849,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * */ @@ -63443,14 +63443,14 @@ declare module dijit { * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * */ @@ -63591,7 +63591,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * Destroy this widget, but not its descendants. Descendants means widgets inside of * this.containerNode. Will also destroy any resources (including widgets) registered via this.own(). @@ -63649,7 +63649,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Get a property from a widget. * Get a named property from a widget. The property may @@ -63737,7 +63737,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -63748,7 +63748,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -63759,7 +63759,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -63770,7 +63770,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -63781,7 +63781,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -63792,7 +63792,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * */ @@ -64536,14 +64536,14 @@ declare module dijit { * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * */ @@ -64691,7 +64691,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * Destroy this widget, but not its descendants. Descendants means widgets inside of * this.containerNode. Will also destroy any resources (including widgets) registered via this.own(). @@ -64756,7 +64756,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Auto-corrections (such as trimming) that are applied to textbox * value on blur or form submit. @@ -64904,7 +64904,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -64915,7 +64915,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -64926,7 +64926,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -64937,7 +64937,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -64948,7 +64948,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -64959,7 +64959,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * */ @@ -65604,14 +65604,14 @@ declare module dijit { * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * Construct the UI for this widget, setting this.domNode. * Most widgets will mixin dijit._TemplatedMixin, which implements this method. @@ -65761,7 +65761,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * Destroy this widget, but not its descendants. Descendants means widgets inside of * this.containerNode. Will also destroy any resources (including widgets) registered via this.own(). @@ -65819,7 +65819,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Put focus on this widget * @@ -65922,7 +65922,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -65933,7 +65933,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -65944,7 +65944,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -65955,7 +65955,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -65966,7 +65966,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -65977,7 +65977,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * */ @@ -66636,21 +66636,21 @@ declare module dijit { * @param widget * @param insertIndex Optional */ - addChild(widget: dijit._WidgetBase, insertIndex: number): void; + addChild(widget: dijit._WidgetBase, insertIndex?: number): void; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * */ @@ -66798,7 +66798,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * */ @@ -66846,7 +66846,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Put focus on this widget * @@ -66949,7 +66949,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -66960,7 +66960,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -66971,7 +66971,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -66982,7 +66982,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -66993,7 +66993,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -67004,7 +67004,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * */ @@ -67861,14 +67861,14 @@ declare module dijit { * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * */ @@ -68016,7 +68016,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * Destroy this widget, but not its descendants. Descendants means widgets inside of * this.containerNode. Will also destroy any resources (including widgets) registered via this.own(). @@ -68081,7 +68081,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Auto-corrections (such as trimming) that are applied to textbox * value on blur or form submit. @@ -68231,7 +68231,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -68242,7 +68242,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -68253,7 +68253,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -68264,7 +68264,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -68275,7 +68275,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -68286,7 +68286,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * */ @@ -69287,14 +69287,14 @@ declare module dijit { * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * */ @@ -69442,7 +69442,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * Destroy this widget, but not its descendants. Descendants means widgets inside of * this.containerNode. Will also destroy any resources (including widgets) registered via this.own(). @@ -69507,7 +69507,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Auto-corrections (such as trimming) that are applied to textbox * value on blur or form submit. @@ -69658,7 +69658,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -69669,7 +69669,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -69680,7 +69680,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -69691,7 +69691,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -69702,7 +69702,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -69713,7 +69713,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * */ @@ -70385,14 +70385,14 @@ declare module dijit { * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * Construct the UI for this widget, setting this.domNode. * Most widgets will mixin dijit._TemplatedMixin, which implements this method. @@ -70542,7 +70542,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * Destroy this widget, but not its descendants. Descendants means widgets inside of * this.containerNode. Will also destroy any resources (including widgets) registered via this.own(). @@ -70600,7 +70600,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Put focus on this widget * @@ -70692,7 +70692,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -70703,7 +70703,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -70714,7 +70714,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -70725,7 +70725,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -70736,7 +70736,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -70747,7 +70747,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * */ @@ -71443,14 +71443,14 @@ declare module dijit { * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * */ @@ -71598,7 +71598,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * Destroy this widget, but not its descendants. Descendants means widgets inside of * this.containerNode. Will also destroy any resources (including widgets) registered via this.own(). @@ -71656,7 +71656,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * * @param value @@ -71772,7 +71772,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -71783,7 +71783,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -71794,7 +71794,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -71805,7 +71805,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -71816,7 +71816,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -71827,7 +71827,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * */ @@ -72612,14 +72612,14 @@ declare module dijit { * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * */ @@ -72767,7 +72767,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * Destroy this widget, but not its descendants. Descendants means widgets inside of * this.containerNode. Will also destroy any resources (including widgets) registered via this.own(). @@ -72832,7 +72832,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Auto-corrections (such as trimming) that are applied to textbox * value on blur or form submit. @@ -72983,7 +72983,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -72994,7 +72994,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -73005,7 +73005,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -73016,7 +73016,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -73027,7 +73027,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -73038,7 +73038,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * */ @@ -73785,14 +73785,14 @@ declare module dijit { * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * */ @@ -73940,7 +73940,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * Destroy this widget, but not its descendants. Descendants means widgets inside of * this.containerNode. Will also destroy any resources (including widgets) registered via this.own(). @@ -73998,7 +73998,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * * @param value @@ -74114,7 +74114,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -74125,7 +74125,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -74136,7 +74136,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -74147,7 +74147,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -74158,7 +74158,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -74169,7 +74169,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * */ @@ -75010,14 +75010,14 @@ declare module dijit { * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * */ @@ -75176,7 +75176,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * * @param preserveDom @@ -75225,7 +75225,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * */ @@ -75369,7 +75369,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -75380,7 +75380,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -75391,7 +75391,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -75402,7 +75402,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -75413,7 +75413,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -75424,7 +75424,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * stop mousemove from selecting text on IE to be consistent with other browsers * @@ -76130,21 +76130,21 @@ declare module dijit { * @param widget * @param insertIndex Optional */ - addChild(widget: dijit._WidgetBase, insertIndex: number): void; + addChild(widget: dijit._WidgetBase, insertIndex?: number): void; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * */ @@ -76301,7 +76301,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * Destroy this widget, but not its descendants. Descendants means widgets inside of * this.containerNode. Will also destroy any resources (including widgets) registered via this.own(). @@ -76359,7 +76359,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Overridden so that the previously selected value will be focused instead of only the first item * @@ -76485,7 +76485,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -76496,7 +76496,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -76507,7 +76507,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -76518,7 +76518,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -76529,7 +76529,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -76540,7 +76540,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * stop mousemove from selecting text on IE to be consistent with other browsers * @@ -77238,14 +77238,14 @@ declare module dijit { * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * Construct the UI for this widget, setting this.domNode. * Most widgets will mixin dijit._TemplatedMixin, which implements this method. @@ -77395,7 +77395,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * Destroy this widget, but not its descendants. Descendants means widgets inside of * this.containerNode. Will also destroy any resources (including widgets) registered via this.own(). @@ -77453,7 +77453,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Auto-corrections (such as trimming) that are applied to textbox * value on blur or form submit. @@ -77582,7 +77582,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -77593,7 +77593,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -77604,7 +77604,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -77615,7 +77615,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -77626,7 +77626,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -77637,7 +77637,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * */ @@ -78491,14 +78491,14 @@ declare module dijit { * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * */ @@ -78651,7 +78651,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * Destroy this widget, but not its descendants. Descendants means widgets inside of * this.containerNode. Will also destroy any resources (including widgets) registered via this.own(). @@ -78716,7 +78716,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Auto-corrections (such as trimming) that are applied to textbox * value on blur or form submit. @@ -78900,7 +78900,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -78911,7 +78911,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -78922,7 +78922,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -78933,7 +78933,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -78944,7 +78944,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -78955,7 +78955,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * */ @@ -79626,14 +79626,14 @@ declare module dijit { * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * Construct the UI for this widget, setting this.domNode. * Most widgets will mixin dijit._TemplatedMixin, which implements this method. @@ -79783,7 +79783,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * Destroy this widget, but not its descendants. Descendants means widgets inside of * this.containerNode. Will also destroy any resources (including widgets) registered via this.own(). @@ -79841,7 +79841,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Put focus on this widget * @@ -79933,7 +79933,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -79944,7 +79944,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -79955,7 +79955,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -79966,7 +79966,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -79977,7 +79977,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -79988,7 +79988,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * */ @@ -80502,14 +80502,14 @@ declare module dijit { * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * */ @@ -80650,7 +80650,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * Destroy this widget, but not its descendants. Descendants means widgets inside of * this.containerNode. Will also destroy any resources (including widgets) registered via this.own(). @@ -80708,7 +80708,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Get a property from a widget. * Get a named property from a widget. The property may @@ -80790,7 +80790,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -80801,7 +80801,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -80812,7 +80812,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -80823,7 +80823,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -80834,7 +80834,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -80845,7 +80845,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * */ @@ -81374,14 +81374,14 @@ declare module dijit { * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * */ @@ -81522,7 +81522,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * Destroy this widget, but not its descendants. Descendants means widgets inside of * this.containerNode. Will also destroy any resources (including widgets) registered via this.own(). @@ -81580,7 +81580,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Get a property from a widget. * Get a named property from a widget. The property may @@ -81668,7 +81668,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -81679,7 +81679,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -81690,7 +81690,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -81701,7 +81701,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -81712,7 +81712,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -81723,7 +81723,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * */ @@ -82467,14 +82467,14 @@ declare module dijit { * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * Construct the UI for this widget, setting this.domNode. * Most widgets will mixin dijit._TemplatedMixin, which implements this method. @@ -82624,7 +82624,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * Destroy this widget, but not its descendants. Descendants means widgets inside of * this.containerNode. Will also destroy any resources (including widgets) registered via this.own(). @@ -82689,7 +82689,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Auto-corrections (such as trimming) that are applied to textbox * value on blur or form submit. @@ -82830,7 +82830,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -82841,7 +82841,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -82852,7 +82852,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -82863,7 +82863,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -82874,7 +82874,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -82885,7 +82885,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * */ @@ -83563,21 +83563,21 @@ declare module dijit { * @param widget * @param insertIndex Optional */ - addChild(widget: dijit._WidgetBase, insertIndex: number): void; + addChild(widget: dijit._WidgetBase, insertIndex?: number): void; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * */ @@ -83725,7 +83725,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * */ @@ -83773,7 +83773,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Put focus on this widget * @@ -83876,7 +83876,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -83887,7 +83887,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -83898,7 +83898,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -83909,7 +83909,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -83920,7 +83920,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -83931,7 +83931,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * */ @@ -84460,14 +84460,14 @@ declare module dijit { * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * */ @@ -84608,7 +84608,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * Destroy this widget, but not its descendants. Descendants means widgets inside of * this.containerNode. Will also destroy any resources (including widgets) registered via this.own(). @@ -84666,7 +84666,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Get a property from a widget. * Get a named property from a widget. The property may @@ -84787,7 +84787,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -84798,7 +84798,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -84809,7 +84809,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -84820,7 +84820,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -84831,7 +84831,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -84842,7 +84842,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * */ @@ -85354,14 +85354,14 @@ declare module dijit { * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * Go back to previous page. * @@ -85512,7 +85512,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * */ @@ -85558,7 +85558,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Advance to next page. * @@ -85669,7 +85669,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -85680,7 +85680,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -85691,7 +85691,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -85702,7 +85702,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -85713,7 +85713,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -85724,7 +85724,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * */ @@ -86218,14 +86218,14 @@ declare module dijit { * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * */ @@ -86366,7 +86366,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * */ @@ -86412,7 +86412,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Get a property from a widget. * Get a named property from a widget. The property may @@ -86494,7 +86494,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -86505,7 +86505,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -86516,7 +86516,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -86527,7 +86527,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -86538,7 +86538,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -86549,7 +86549,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * */ @@ -87037,14 +87037,14 @@ declare module dijit { * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * */ @@ -87185,7 +87185,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * Destroy this widget, but not its descendants. Descendants means widgets inside of * this.containerNode. Will also destroy any resources (including widgets) registered via this.own(). @@ -87243,7 +87243,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Get a property from a widget. * Get a named property from a widget. The property may @@ -87325,7 +87325,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -87336,7 +87336,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -87347,7 +87347,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -87358,7 +87358,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -87369,7 +87369,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -87380,7 +87380,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * */ @@ -87909,14 +87909,14 @@ declare module dijit { * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * Go back to previous page. * @@ -88062,7 +88062,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * * @param preserveDom @@ -88109,7 +88109,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Advance to next page. * @@ -88230,7 +88230,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -88241,7 +88241,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -88252,7 +88252,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -88263,7 +88263,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -88274,7 +88274,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -88285,7 +88285,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * */ @@ -88799,14 +88799,14 @@ declare module dijit { * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * */ @@ -88947,7 +88947,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * Destroy this widget, but not its descendants. Descendants means widgets inside of * this.containerNode. Will also destroy any resources (including widgets) registered via this.own(). @@ -89000,7 +89000,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Get a property from a widget. * Get a named property from a widget. The property may @@ -89112,7 +89112,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -89123,7 +89123,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -89134,7 +89134,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -89145,7 +89145,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -89156,7 +89156,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -89167,7 +89167,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * */ @@ -89633,14 +89633,14 @@ declare module dijit { * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * */ @@ -89781,7 +89781,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * Destroy this widget, but not its descendants. Descendants means widgets inside of * this.containerNode. Will also destroy any resources (including widgets) registered via this.own(). @@ -89839,7 +89839,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Get a property from a widget. * Get a named property from a widget. The property may @@ -89921,7 +89921,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -89932,7 +89932,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -89943,7 +89943,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -89954,7 +89954,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -89965,7 +89965,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -89976,7 +89976,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * */ @@ -90463,14 +90463,14 @@ declare module dijit { * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * */ @@ -90611,7 +90611,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * */ @@ -90659,7 +90659,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Get a property from a widget. * Get a named property from a widget. The property may @@ -90741,7 +90741,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -90752,7 +90752,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -90763,7 +90763,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -90774,7 +90774,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -90785,7 +90785,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -90796,7 +90796,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * */ @@ -91411,21 +91411,21 @@ declare module dijit { * @param widget * @param insertIndex Optional */ - addChild(widget: dijit._WidgetBase, insertIndex: number): void; + addChild(widget: dijit._WidgetBase, insertIndex?: number): void; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * */ @@ -91577,7 +91577,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * */ @@ -91621,7 +91621,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Get a property from a widget. * Get a named property from a widget. The property may @@ -91727,7 +91727,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -91738,7 +91738,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -91749,7 +91749,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -91760,7 +91760,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -91771,7 +91771,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -91782,7 +91782,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * */ @@ -92360,14 +92360,14 @@ declare module dijit { * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * */ @@ -92508,7 +92508,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * Destroy this widget, but not its descendants. Descendants means widgets inside of * this.containerNode. Will also destroy any resources (including widgets) registered via this.own(). @@ -92566,7 +92566,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Get a property from a widget. * Get a named property from a widget. The property may @@ -92682,7 +92682,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -92693,7 +92693,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -92704,7 +92704,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -92715,7 +92715,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -92726,7 +92726,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -92737,7 +92737,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * */ @@ -93387,21 +93387,21 @@ declare module dijit { * @param widget * @param insertIndex Optional */ - addChild(widget: dijit._WidgetBase, insertIndex: number): void; + addChild(widget: dijit._WidgetBase, insertIndex?: number): void; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * */ @@ -93553,7 +93553,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * */ @@ -93597,7 +93597,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Get a property from a widget. * Get a named property from a widget. The property may @@ -93703,7 +93703,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -93714,7 +93714,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -93725,7 +93725,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -93736,7 +93736,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -93747,7 +93747,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -93758,7 +93758,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * */ @@ -94466,21 +94466,21 @@ declare module dijit { * @param widget * @param insertIndex Optional */ - addChild(widget: dijit._WidgetBase, insertIndex: number): void; + addChild(widget: dijit._WidgetBase, insertIndex?: number): void; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * */ @@ -94632,7 +94632,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * */ @@ -94676,7 +94676,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Get a property from a widget. * Get a named property from a widget. The property may @@ -94782,7 +94782,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -94793,7 +94793,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -94804,7 +94804,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -94815,7 +94815,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -94826,7 +94826,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -94837,7 +94837,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * */ @@ -95466,21 +95466,21 @@ declare module dijit { * @param widget * @param insertIndex Optional */ - addChild(widget: dijit._WidgetBase, insertIndex: number): void; + addChild(widget: dijit._WidgetBase, insertIndex?: number): void; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * */ @@ -95636,7 +95636,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * * @param preserveDom @@ -95704,7 +95704,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Get a property from a widget. * Get a named property from a widget. The property may @@ -95803,7 +95803,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -95814,7 +95814,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -95825,7 +95825,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -95836,7 +95836,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -95847,7 +95847,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -95858,7 +95858,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * */ @@ -96391,14 +96391,14 @@ declare module dijit { * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * Begin dragging the splitter between child[i] and child[i+1] * @@ -96552,7 +96552,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * */ @@ -96600,7 +96600,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * */ @@ -96721,7 +96721,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -96732,7 +96732,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -96743,7 +96743,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -96754,7 +96754,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -96765,7 +96765,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -96776,7 +96776,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * */ @@ -97300,14 +97300,14 @@ declare module dijit { * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * Go back to previous page. * @@ -97453,7 +97453,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * Destroy this widget, but not its descendants. Descendants means widgets inside of * this.containerNode. Will also destroy any resources (including widgets) registered via this.own(). @@ -97509,7 +97509,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Advance to next page. * @@ -97630,7 +97630,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -97641,7 +97641,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -97652,7 +97652,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -97663,7 +97663,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -97674,7 +97674,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -97685,7 +97685,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * */ @@ -98220,21 +98220,21 @@ declare module dijit { * @param widget * @param insertIndex Optional */ - addChild(widget: dijit._WidgetBase, insertIndex: number): void; + addChild(widget: dijit._WidgetBase, insertIndex?: number): void; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * Construct the UI for this widget, setting this.domNode. * Most widgets will mixin dijit._TemplatedMixin, which implements this method. @@ -98382,7 +98382,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * * @param preserveDom @@ -98431,7 +98431,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Get a property from a widget. * Get a named property from a widget. The property may @@ -98530,7 +98530,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -98541,7 +98541,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -98552,7 +98552,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -98563,7 +98563,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -98574,7 +98574,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -98585,7 +98585,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * */ @@ -99218,14 +99218,14 @@ declare module dijit { * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * * @param evt @@ -99374,7 +99374,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * Destroy this widget, but not its descendants. Descendants means widgets inside of * this.containerNode. Will also destroy any resources (including widgets) registered via this.own(). @@ -99432,7 +99432,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Put focus on this widget * @@ -99524,7 +99524,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -99535,7 +99535,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -99546,7 +99546,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -99557,7 +99557,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -99568,7 +99568,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -99579,7 +99579,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * */ @@ -100167,14 +100167,14 @@ declare module dijit { * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * Go back to previous page. * @@ -100320,7 +100320,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * * @param preserveDom @@ -100367,7 +100367,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Advance to next page. * @@ -100488,7 +100488,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -100499,7 +100499,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -100510,7 +100510,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -100521,7 +100521,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -100532,7 +100532,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -100543,7 +100543,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * */ @@ -101051,21 +101051,21 @@ declare module dijit { * @param widget * @param insertIndex Optional */ - addChild(widget: dijit._WidgetBase, insertIndex: number): void; + addChild(widget: dijit._WidgetBase, insertIndex?: number): void; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * Construct the UI for this widget, setting this.domNode. * Most widgets will mixin dijit._TemplatedMixin, which implements this method. @@ -101213,7 +101213,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * * @param preserveDom @@ -101262,7 +101262,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Get a property from a widget. * Get a named property from a widget. The property may @@ -101361,7 +101361,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -101372,7 +101372,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -101383,7 +101383,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -101394,7 +101394,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -101405,7 +101405,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -101416,7 +101416,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * */ @@ -102034,14 +102034,14 @@ declare module dijit { * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * */ @@ -102189,7 +102189,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * Destroy this widget, but not its descendants. Descendants means widgets inside of * this.containerNode. Will also destroy any resources (including widgets) registered via this.own(). @@ -102247,7 +102247,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Put focus on this widget * @@ -102339,7 +102339,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -102350,7 +102350,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -102361,7 +102361,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -102372,7 +102372,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -102383,7 +102383,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -102394,7 +102394,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * */ @@ -105018,14 +105018,14 @@ declare module dijit { * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: String, value: Object): any; + attr(name: String, value?: Object): any; /** * This method is deprecated, use get() or set() directly. * * @param name The property to get or set. If an object is passed here and nota string, its keys are used as names of attributes to be setand the value of the object as values to set in the widget. * @param value OptionalOptional. If provided, attr() operates as a setter. If omitted,the current value of the named property is returned. */ - attr(name: Object, value: Object): any; + attr(name: Object, value?: Object): any; /** * */ @@ -105166,7 +105166,7 @@ declare module dijit { * @param fcn Function reference. * @param delay OptionalDelay, defaults to 0. */ - defer(fcn: Function, delay: number): Object; + defer(fcn: Function, delay?: number): Object; /** * Destroy this widget, but not its descendants. Descendants means widgets inside of * this.containerNode. Will also destroy any resources (including widgets) registered via this.own(). @@ -105224,7 +105224,7 @@ declare module dijit { * @param eventObj Optional * @param callbackArgs Optional */ - emit(type: String, eventObj: Object, callbackArgs: any[]): any; + emit(type: String, eventObj?: Object, callbackArgs?: any[]): any; /** * Focus the calendar by focusing one of the calendar cells * @@ -105348,7 +105348,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: String): any; + placeAt(reference: String, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -105359,7 +105359,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: String): any; + placeAt(reference: HTMLElement, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -105370,7 +105370,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: String): any; + placeAt(reference: dijit._WidgetBase, position?: String): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -105381,7 +105381,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: String, position: number): any; + placeAt(reference: String, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -105392,7 +105392,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: HTMLElement, position: number): any; + placeAt(reference: HTMLElement, position?: number): any; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. @@ -105403,7 +105403,7 @@ declare module dijit { * @param reference Widget, DOMNode, or id of widget or DOMNode * @param position OptionalIf reference is a widget (or id of widget), and that widget has an ".addChild" method,it will be called passing this widget instance into that method, supplying the optionalposition index passed. In this case position (if specified) should be an integer.If reference is a DOMNode (or id matching a DOMNode but not a widget),the position argument can be a numeric index or a string"first", "last", "before", or "after", same as dojo/dom-construct::place(). */ - placeAt(reference: dijit._WidgetBase, position: number): any; + placeAt(reference: dijit._WidgetBase, position?: number): any; /** * */ diff --git a/dojo/dojo.d.ts b/dojo/dojo.d.ts index a2c653de2..ccdeda71e 100644 --- a/dojo/dojo.d.ts +++ b/dojo/dojo.d.ts @@ -100,14 +100,14 @@ declare module dojo { * @param url URL to request * @param options OptionalOptions for the request. */ - get(url: String, options: dojo.request.iframe.__BaseOptions): dojo.request.__Promise; + get(url: String, options?: dojo.request.iframe.__BaseOptions): dojo.request.__Promise; /** * Send an HTTP POST request using an iframe element with the given URL and options. * * @param url URL to request * @param options OptionalOptions for the request. */ - post(url: String, options: dojo.request.iframe.__BaseOptions): dojo.request.__Promise; + post(url: String, options?: dojo.request.iframe.__BaseOptions): dojo.request.__Promise; /** * * @param _iframe @@ -295,28 +295,28 @@ declare module dojo { * @param url URL to request * @param options OptionalOptions for the request. */ - del(url: String, options: dojo.request.node.__BaseOptions): dojo.request.__Promise; + del(url: String, options?: dojo.request.node.__BaseOptions): dojo.request.__Promise; /** * Send an HTTP GET request using XMLHttpRequest with the given URL and options. * * @param url URL to request * @param options OptionalOptions for the request. */ - get(url: String, options: dojo.request.node.__BaseOptions): dojo.request.__Promise; + get(url: String, options?: dojo.request.node.__BaseOptions): dojo.request.__Promise; /** * Send an HTTP POST request using XMLHttpRequest with the given URL and options. * * @param url URL to request * @param options OptionalOptions for the request. */ - post(url: String, options: dojo.request.node.__BaseOptions): dojo.request.__Promise; + post(url: String, options?: dojo.request.node.__BaseOptions): dojo.request.__Promise; /** * Send an HTTP PUT request using XMLHttpRequest with the given URL and options. * * @param url URL to request * @param options OptionalOptions for the request. */ - put(url: String, options: dojo.request.node.__BaseOptions): dojo.request.__Promise; + put(url: String, options?: dojo.request.node.__BaseOptions): dojo.request.__Promise; } module node { @@ -497,7 +497,7 @@ declare module dojo { * @param url URL to request * @param options OptionalOptions for the request. */ - get(url: String, options: dojo.request.script.__BaseOptions): dojo.request.__Promise; + get(url: String, options?: dojo.request.script.__BaseOptions): dojo.request.__Promise; } module script { @@ -657,28 +657,28 @@ declare module dojo { * @param url URL to request * @param options OptionalOptions for the request. */ - del(url: String, options: dojo.request.xhr.__BaseOptions): dojo.request.__Promise; + del(url: String, options?: dojo.request.xhr.__BaseOptions): dojo.request.__Promise; /** * Send an HTTP GET request using XMLHttpRequest with the given URL and options. * * @param url URL to request * @param options OptionalOptions for the request. */ - get(url: String, options: dojo.request.xhr.__BaseOptions): dojo.request.__Promise; + get(url: String, options?: dojo.request.xhr.__BaseOptions): dojo.request.__Promise; /** * Send an HTTP POST request using XMLHttpRequest with the given URL and options. * * @param url URL to request * @param options OptionalOptions for the request. */ - post(url: String, options: dojo.request.xhr.__BaseOptions): dojo.request.__Promise; + post(url: String, options?: dojo.request.xhr.__BaseOptions): dojo.request.__Promise; /** * Send an HTTP PUT request using XMLHttpRequest with the given URL and options. * * @param url URL to request * @param options OptionalOptions for the request. */ - put(url: String, options: dojo.request.xhr.__BaseOptions): dojo.request.__Promise; + put(url: String, options?: dojo.request.xhr.__BaseOptions): dojo.request.__Promise; } module xhr { @@ -952,7 +952,7 @@ declare module dojo { * @param reason A message that may be sent to the deferred's canceler,explaining why it's being canceled. * @param strict OptionalIf strict, will throw an error if the deferred has alreadybeen fulfilled and consequently cannot be canceled. */ - cancel(reason: any, strict: boolean): any; + cancel(reason: any, strict?: boolean): any; /** * Checks whether the promise has been canceled. * @@ -1067,7 +1067,7 @@ declare module dojo { * @param type OptionalThe event to listen for. Events emitted: "start", "send","load", "error", "done", "stop". * @param listener OptionalA callback to be run when an event happens. */ - notify(type: String, listener: Function): any; + notify(type?: String, listener?: Function): any; /** * * @param url @@ -1117,7 +1117,7 @@ declare module dojo { * @param directReturn OptionalIf directReturn is true, the value passed in for wrap will bereturned instead of being called. Alternately, theAdapterRegistry can be set globally to "return not call" usingthe returnWrappers property. Either way, this behavior allowsthe registry to act as a "search" function instead of afunction interception library. * @param override OptionalIf override is given and true, the check function will be givenhighest priority. Otherwise, it will be the lowest priorityadapter. */ - register(name: String, check: Function, wrap: Function, directReturn: boolean, override: boolean): void; + register(name: String, check: Function, wrap: Function, directReturn?: boolean, override?: boolean): void; /** * Remove a named adapter from the registry * @@ -1310,7 +1310,7 @@ declare module dojo { * @param now OptionalOptional. Omit if test is not a function. Provides a way to immediatelyrun the test and cache the result. * @param force OptionalOptional. If the test already exists and force is truthy, then the existingtest will be replaced; otherwise, add does not replace an existing test (thatis, by default, the first test advice wins). */ - add(name: String, test: Function, now: boolean, force: boolean): any; + add(name: String, test: Function, now?: boolean, force?: boolean): any; /** * Register a new feature test for some named feature. * @@ -1319,7 +1319,7 @@ declare module dojo { * @param now OptionalOptional. Omit if test is not a function. Provides a way to immediatelyrun the test and cache the result. * @param force OptionalOptional. If the test already exists and force is truthy, then the existingtest will be replaced; otherwise, add does not replace an existing test (thatis, by default, the first test advice wins). */ - add(name: number, test: Function, now: boolean, force: boolean): any; + add(name: number, test: Function, now?: boolean, force?: boolean): any; /** * Deletes the contents of the element passed to test functions. * @@ -1833,7 +1833,7 @@ declare module dojo { * @param reason A message that may be sent to the deferred's canceler,explaining why it's being canceled. * @param strict OptionalIf strict, will throw an error if the deferred has alreadybeen fulfilled and consequently cannot be canceled. */ - cancel(reason: any, strict: boolean): any; + cancel(reason: any, strict?: boolean): any; /** * Checks whether the deferred has been canceled. * @@ -1863,7 +1863,7 @@ declare module dojo { * @param update The progress update. Passed to progbacks. * @param strict OptionalIf strict, will throw an error if the deferred has alreadybeen fulfilled and consequently no progress can be emitted. */ - progress(update: any, strict: boolean): dojo.promise.Promise; + progress(update: any, strict?: boolean): dojo.promise.Promise; /** * Reject the deferred. * Reject the deferred, putting it in an error state. @@ -1871,7 +1871,7 @@ declare module dojo { * @param error The error result of the deferred. Passed to errbacks. * @param strict OptionalIf strict, will throw an error if the deferred has alreadybeen fulfilled and consequently cannot be rejected. */ - reject(error: any, strict: boolean): any; + reject(error: any, strict?: boolean): any; /** * Resolve the deferred. * Resolve the deferred, putting it in a success state. @@ -1889,7 +1889,7 @@ declare module dojo { * @param errback OptionalCallback to be invoked when the promise is rejected.Receives the rejection error. * @param progback OptionalCallback to be invoked when the promise emits a progressupdate. Receives the progress update. */ - then(callback: Function, errback: Function, progback: Function): dojo.promise.Promise; + then(callback?: Function, errback?: Function, progback?: Function): dojo.promise.Promise; /** * */ @@ -1971,7 +1971,7 @@ declare module dojo { * @param content the content to be set on the parent element.This can be an html string, a node reference or a NodeList, dojo/NodeList, Array or other enumerable list of nodes * @param position Optionalcan be one of:"last"||"end" (default)"first||"start""before""after""replace" (replaces nodes in this NodeList with new content)"only" (removes other children of the nodes so new content is the only child)or an offset in the childNodes property */ - addContent(content: String, position: String): Function; + addContent(content: String, position?: String): Function; /** * add a node, NodeList or some HTML as a string to every item in the * list. Returns the original list. @@ -1983,7 +1983,7 @@ declare module dojo { * @param content the content to be set on the parent element.This can be an html string, a node reference or a NodeList, dojo/NodeList, Array or other enumerable list of nodes * @param position Optionalcan be one of:"last"||"end" (default)"first||"start""before""after""replace" (replaces nodes in this NodeList with new content)"only" (removes other children of the nodes so new content is the only child)or an offset in the childNodes property */ - addContent(content: HTMLElement, position: String): Function; + addContent(content: HTMLElement, position?: String): Function; /** * add a node, NodeList or some HTML as a string to every item in the * list. Returns the original list. @@ -1995,7 +1995,7 @@ declare module dojo { * @param content the content to be set on the parent element.This can be an html string, a node reference or a NodeList, dojo/NodeList, Array or other enumerable list of nodes * @param position Optionalcan be one of:"last"||"end" (default)"first||"start""before""after""replace" (replaces nodes in this NodeList with new content)"only" (removes other children of the nodes so new content is the only child)or an offset in the childNodes property */ - addContent(content: Object, position: String): Function; + addContent(content: Object, position?: String): Function; /** * add a node, NodeList or some HTML as a string to every item in the * list. Returns the original list. @@ -2007,7 +2007,7 @@ declare module dojo { * @param content the content to be set on the parent element.This can be an html string, a node reference or a NodeList, dojo/NodeList, Array or other enumerable list of nodes * @param position Optionalcan be one of:"last"||"end" (default)"first||"start""before""after""replace" (replaces nodes in this NodeList with new content)"only" (removes other children of the nodes so new content is the only child)or an offset in the childNodes property */ - addContent(content: dojo.NodeList, position: String): Function; + addContent(content: dojo.NodeList, position?: String): Function; /** * add a node, NodeList or some HTML as a string to every item in the * list. Returns the original list. @@ -2019,7 +2019,7 @@ declare module dojo { * @param content the content to be set on the parent element.This can be an html string, a node reference or a NodeList, dojo/NodeList, Array or other enumerable list of nodes * @param position Optionalcan be one of:"last"||"end" (default)"first||"start""before""after""replace" (replaces nodes in this NodeList with new content)"only" (removes other children of the nodes so new content is the only child)or an offset in the childNodes property */ - addContent(content: String, position: number): Function; + addContent(content: String, position?: number): Function; /** * add a node, NodeList or some HTML as a string to every item in the * list. Returns the original list. @@ -2031,7 +2031,7 @@ declare module dojo { * @param content the content to be set on the parent element.This can be an html string, a node reference or a NodeList, dojo/NodeList, Array or other enumerable list of nodes * @param position Optionalcan be one of:"last"||"end" (default)"first||"start""before""after""replace" (replaces nodes in this NodeList with new content)"only" (removes other children of the nodes so new content is the only child)or an offset in the childNodes property */ - addContent(content: HTMLElement, position: number): Function; + addContent(content: HTMLElement, position?: number): Function; /** * add a node, NodeList or some HTML as a string to every item in the * list. Returns the original list. @@ -2043,7 +2043,7 @@ declare module dojo { * @param content the content to be set on the parent element.This can be an html string, a node reference or a NodeList, dojo/NodeList, Array or other enumerable list of nodes * @param position Optionalcan be one of:"last"||"end" (default)"first||"start""before""after""replace" (replaces nodes in this NodeList with new content)"only" (removes other children of the nodes so new content is the only child)or an offset in the childNodes property */ - addContent(content: Object, position: number): Function; + addContent(content: Object, position?: number): Function; /** * add a node, NodeList or some HTML as a string to every item in the * list. Returns the original list. @@ -2055,7 +2055,7 @@ declare module dojo { * @param content the content to be set on the parent element.This can be an html string, a node reference or a NodeList, dojo/NodeList, Array or other enumerable list of nodes * @param position Optionalcan be one of:"last"||"end" (default)"first||"start""before""after""replace" (replaces nodes in this NodeList with new content)"only" (removes other children of the nodes so new content is the only child)or an offset in the childNodes property */ - addContent(content: dojo.NodeList, position: number): Function; + addContent(content: dojo.NodeList, position?: number): Function; /** * places any/all elements in queryOrListOrNode at a * position relative to the first element in this list. @@ -2064,7 +2064,7 @@ declare module dojo { * @param queryOrListOrNode a DOM node or a query string or a query result.Represents the nodes to be adopted relative to thefirst element of this NodeList. * @param position Optionalcan be one of:"last" (default)"first""before""after""only""replace"or an offset in the childNodes property */ - adopt(queryOrListOrNode: String, position: String): any; + adopt(queryOrListOrNode: String, position?: String): any; /** * places any/all elements in queryOrListOrNode at a * position relative to the first element in this list. @@ -2073,7 +2073,7 @@ declare module dojo { * @param queryOrListOrNode a DOM node or a query string or a query result.Represents the nodes to be adopted relative to thefirst element of this NodeList. * @param position Optionalcan be one of:"last" (default)"first""before""after""only""replace"or an offset in the childNodes property */ - adopt(queryOrListOrNode: any[], position: String): any; + adopt(queryOrListOrNode: any[], position?: String): any; /** * places any/all elements in queryOrListOrNode at a * position relative to the first element in this list. @@ -2082,7 +2082,7 @@ declare module dojo { * @param queryOrListOrNode a DOM node or a query string or a query result.Represents the nodes to be adopted relative to thefirst element of this NodeList. * @param position Optionalcan be one of:"last" (default)"first""before""after""only""replace"or an offset in the childNodes property */ - adopt(queryOrListOrNode: HTMLElement, position: String): any; + adopt(queryOrListOrNode: HTMLElement, position?: String): any; /** * Places the content after every node in the NodeList. * The content will be cloned if the length of NodeList @@ -2128,14 +2128,14 @@ declare module dojo { * @param onEnd OptionalA function to be called when the animation ends * @param delay Optionalhow long to delay playing the returned animation */ - anim(properties: Object, duration: number, easing: Function, onEnd: Function, delay: number): any; + anim(properties: Object, duration?: number, easing?: Function, onEnd?: Function, delay?: number): any; /** * Animate all elements of this NodeList across the properties specified. * syntax identical to dojo.animateProperty * * @param args OptionalAdditional dojo/_base/fx.Animation arguments to mix into this set with the addition ofan auto parameter. */ - animateProperty(args: Object): any; + animateProperty(args?: Object): any; /** * appends the content to every node in the NodeList. * The content will be cloned if the length of NodeList @@ -2187,7 +2187,7 @@ declare module dojo { * @param property the attribute to get/set * @param value Optionaloptional. The value to set the property to */ - attr(property: String, value: String): any; + attr(property: String, value?: String): any; /** * Places the content before every node in the NodeList. * The content will be cloned if the length of NodeList @@ -2223,7 +2223,7 @@ declare module dojo { * * @param query Optionala CSS selector. */ - children(query: String): any; + children(query?: String): any; /** * Clones all the nodes in this NodeList and returns them as a new NodeList. * Only the DOM nodes are cloned, not any attached event handlers. @@ -2239,7 +2239,7 @@ declare module dojo { * @param query a CSS selector. * @param root OptionalIf specified, query is relative to "root" rather than document body. */ - closest(query: String, root: String): any; + closest(query: String, root?: String): any; /** * Returns closest parent that matches query, including current node in this * dojo/NodeList if it matches the query. @@ -2249,7 +2249,7 @@ declare module dojo { * @param query a CSS selector. * @param root OptionalIf specified, query is relative to "root" rather than document body. */ - closest(query: String, root: HTMLElement): any; + closest(query: String, root?: HTMLElement): any; /** * Returns a new NodeList comprised of items in this NodeList * as well as items passed in as parameters @@ -2271,7 +2271,7 @@ declare module dojo { * @param objOrFunc if 2 arguments are passed (methodName, objOrFunc), objOrFunc shouldreference a function or be the name of the function in the globalnamespace to attach. If 3 arguments are provided(methodName, objOrFunc, funcName), objOrFunc must be the scope tolocate the bound function in * @param funcName Optionaloptional. A string naming the function in objOrFunc to bind to theevent. May also be a function reference. */ - connect(methodName: String, objOrFunc: Object, funcName: String): void; + connect(methodName: String, objOrFunc: Object, funcName?: String): void; /** * Attach event handlers to every item of the NodeList. Uses dojo.connect() * so event properties are normalized. @@ -2282,7 +2282,7 @@ declare module dojo { * @param objOrFunc if 2 arguments are passed (methodName, objOrFunc), objOrFunc shouldreference a function or be the name of the function in the globalnamespace to attach. If 3 arguments are provided(methodName, objOrFunc, funcName), objOrFunc must be the scope tolocate the bound function in * @param funcName Optionaloptional. A string naming the function in objOrFunc to bind to theevent. May also be a function reference. */ - connect(methodName: String, objOrFunc: Function, funcName: String): void; + connect(methodName: String, objOrFunc: Function, funcName?: String): void; /** * Attach event handlers to every item of the NodeList. Uses dojo.connect() * so event properties are normalized. @@ -2293,7 +2293,7 @@ declare module dojo { * @param objOrFunc if 2 arguments are passed (methodName, objOrFunc), objOrFunc shouldreference a function or be the name of the function in the globalnamespace to attach. If 3 arguments are provided(methodName, objOrFunc, funcName), objOrFunc must be the scope tolocate the bound function in * @param funcName Optionaloptional. A string naming the function in objOrFunc to bind to theevent. May also be a function reference. */ - connect(methodName: String, objOrFunc: String, funcName: String): void; + connect(methodName: String, objOrFunc: String, funcName?: String): void; /** * Deprecated: Use position() for border-box x/y/w/h * or marginBox() for margin-box w/h/l/t. @@ -2317,7 +2317,7 @@ declare module dojo { * @param key OptionalIf an object, act as a setter and iterate over said object setting data items as defined.If a string, and value present, set the data for defined key to valueIf a string, and value absent, act as a getter, returning the data associated with said key * @param value OptionalThe value to set for said key, provided key is a string (and not an object) */ - data(key: Object, value: any): any; + data(key?: Object, value?: any): any; /** * stash or get some arbitrary data on/from these nodes. * Stash or get some arbitrary data on/from these nodes. This private _data function is @@ -2332,7 +2332,7 @@ declare module dojo { * @param key OptionalIf an object, act as a setter and iterate over said object setting data items as defined.If a string, and value present, set the data for defined key to valueIf a string, and value absent, act as a getter, returning the data associated with said key * @param value OptionalThe value to set for said key, provided key is a string (and not an object) */ - data(key: String, value: any): any; + data(key?: String, value?: any): any; /** * Monitor nodes in this NodeList for [bubbled] events on nodes that match selector. * Calls fn(evt) for those events, where (inside of fn()), this == the node @@ -2413,19 +2413,19 @@ declare module dojo { * @param callback the callback * @param thisObject Optionalthe context */ - every(callback: Function, thisObject: Object): any; + every(callback: Function, thisObject?: Object): any; /** * fade in all elements of this NodeList via dojo.fadeIn * * @param args OptionalAdditional dojo/_base/fx.Animation arguments to mix into this set with the addition ofan auto parameter. */ - fadeIn(args: Object): any; + fadeIn(args?: Object): any; /** * fade out all elements of this NodeList via dojo.fadeOut * * @param args OptionalAdditional dojo/_base/fx.Animation arguments to mix into this set with the addition ofan auto parameter. */ - fadeOut(args: Object): any; + fadeOut(args?: Object): any; /** * "masks" the built-in javascript filter() method (supported * in Dojo via dojo.filter) to support passing a simple @@ -2477,7 +2477,7 @@ declare module dojo { * * @param value Optional */ - html(value: String): any; + html(value?: String): any; /** * allows setting the innerHTML of each node in the NodeList, * if there is a value passed in, otherwise, reads the innerHTML value of the first node. @@ -2495,7 +2495,7 @@ declare module dojo { * * @param value Optional */ - html(value: HTMLElement): any; + html(value?: HTMLElement): any; /** * allows setting the innerHTML of each node in the NodeList, * if there is a value passed in, otherwise, reads the innerHTML value of the first node. @@ -2513,7 +2513,7 @@ declare module dojo { * * @param value Optional */ - html(value: NodeList): any; + html(value?: NodeList): any; /** * see dojo/_base/array.indexOf(). The primary difference is that the acted-on * array is implicitly this NodeList @@ -2542,7 +2542,7 @@ declare module dojo { * * @param value Optional */ - innerHTML(value: String): any; + innerHTML(value?: String): any; /** * allows setting the innerHTML of each node in the NodeList, * if there is a value passed in, otherwise, reads the innerHTML value of the first node. @@ -2560,7 +2560,7 @@ declare module dojo { * * @param value Optional */ - innerHTML(value: HTMLElement): any; + innerHTML(value?: HTMLElement): any; /** * allows setting the innerHTML of each node in the NodeList, * if there is a value passed in, otherwise, reads the innerHTML value of the first node. @@ -2578,7 +2578,7 @@ declare module dojo { * * @param value Optional */ - innerHTML(value: NodeList): any; + innerHTML(value?: NodeList): any; /** * The nodes in this NodeList will be placed after the nodes * matched by the query passed to insertAfter. @@ -2607,7 +2607,7 @@ declare module dojo { * @param declaredClass * @param properties Optional */ - instantiate(declaredClass: String, properties: Object): any; + instantiate(declaredClass: String, properties?: Object): any; /** * Create a new instance of a specified class, using the * specified properties and each node in the NodeList as a @@ -2616,7 +2616,7 @@ declare module dojo { * @param declaredClass * @param properties Optional */ - instantiate(declaredClass: Object, properties: Object): any; + instantiate(declaredClass: Object, properties?: Object): any; /** * Returns the last node in this dojo/NodeList as a dojo/NodeList. * .end() can be used on the returned dojo/NodeList to get back to the @@ -2634,7 +2634,7 @@ declare module dojo { * @param value The value to search for. * @param fromIndex OptionalThe location to start searching from. Optional. Defaults to 0. */ - lastIndexOf(value: Object, fromIndex: number): any; + lastIndexOf(value: Object, fromIndex?: number): any; /** * see dojo/_base/array.map(). The primary difference is that the acted-on * array is implicitly this NodeList and the return is a @@ -2643,7 +2643,7 @@ declare module dojo { * @param func * @param obj Optional */ - map(func: Function, obj: Function): any; + map(func: Function, obj?: Function): any; /** * Returns margin-box size of nodes * @@ -2657,7 +2657,7 @@ declare module dojo { * * @param query Optionala CSS selector. */ - next(query: String): any; + next(query?: String): any; /** * Returns all sibling elements that come after the nodes in this dojo/NodeList. * Optionally takes a query to filter the sibling elements. @@ -2666,7 +2666,7 @@ declare module dojo { * * @param query Optionala CSS selector. */ - nextAll(query: String): any; + nextAll(query?: String): any; /** * Returns the odd nodes in this dojo/NodeList as a dojo/NodeList. * .end() can be used on the returned dojo/NodeList to get back to the @@ -2687,7 +2687,7 @@ declare module dojo { * * @param filter OptionalCSS selector like ".foo" or "div > span" */ - orphan(filter: String): any; + orphan(filter?: String): any; /** * Returns immediate parent elements for nodes in this dojo/NodeList. * Optionally takes a query to filter the parent elements. @@ -2696,7 +2696,7 @@ declare module dojo { * * @param query Optionala CSS selector. */ - parent(query: String): any; + parent(query?: String): any; /** * Returns all parent elements for nodes in this dojo/NodeList. * Optionally takes a query to filter the child elements. @@ -2705,7 +2705,7 @@ declare module dojo { * * @param query Optionala CSS selector. */ - parents(query: String): any; + parents(query?: String): any; /** * places elements of this node list relative to the first element matched * by queryOrNode. Returns the original NodeList. See: dojo/dom-construct.place @@ -2774,7 +2774,7 @@ declare module dojo { * * @param query Optionala CSS selector. */ - prev(query: String): any; + prev(query?: String): any; /** * Returns all sibling elements that come before the nodes in this dojo/NodeList. * Optionally takes a query to filter the sibling elements. @@ -2785,7 +2785,7 @@ declare module dojo { * * @param query Optionala CSS selector. */ - prevAll(query: String): any; + prevAll(query?: String): any; /** * Returns a new list whose members match the passed query, * assuming elements of the current NodeList as the root for @@ -2800,7 +2800,7 @@ declare module dojo { * * @param filter OptionalCSS selector like ".foo" or "div > span" */ - remove(filter: String): any; + remove(filter?: String): any; /** * Removes an attribute from each node in the list. * @@ -2812,7 +2812,7 @@ declare module dojo { * * @param className OptionalAn optional String class name to remove, or several space-separatedclass names, or an array of class names. If omitted, all class nameswill be deleted. */ - removeClass(className: String): any; + removeClass(className?: String): any; /** * removes the specified class from every node in the list * @@ -2832,7 +2832,7 @@ declare module dojo { * * @param key OptionalIf omitted, clean all data for this node.If passed, remove the data item found at key */ - removeData(key: String): void; + removeData(key?: String): void; /** * replaces nodes matched by the query passed to replaceAll with the nodes * in this NodeList. @@ -2850,7 +2850,7 @@ declare module dojo { * @param addClassStr A String class name to add, or several space-separated class names,or an array of class names. * @param removeClassStr OptionalA String class name to remove, or several space-separated class names,or an array of class names. */ - replaceClass(addClassStr: String, removeClassStr: String): void; + replaceClass(addClassStr: String, removeClassStr?: String): void; /** * Replaces one or more classes on a node if not present. * Operates more quickly than calling removeClass() and addClass() @@ -2858,7 +2858,7 @@ declare module dojo { * @param addClassStr A String class name to add, or several space-separated class names,or an array of class names. * @param removeClassStr OptionalA String class name to remove, or several space-separated class names,or an array of class names. */ - replaceClass(addClassStr: any[], removeClassStr: String): void; + replaceClass(addClassStr: any[], removeClassStr?: String): void; /** * Replaces one or more classes on a node if not present. * Operates more quickly than calling removeClass() and addClass() @@ -2866,7 +2866,7 @@ declare module dojo { * @param addClassStr A String class name to add, or several space-separated class names,or an array of class names. * @param removeClassStr OptionalA String class name to remove, or several space-separated class names,or an array of class names. */ - replaceClass(addClassStr: String, removeClassStr: any[]): void; + replaceClass(addClassStr: String, removeClassStr?: any[]): void; /** * Replaces one or more classes on a node if not present. * Operates more quickly than calling removeClass() and addClass() @@ -2874,7 +2874,7 @@ declare module dojo { * @param addClassStr A String class name to add, or several space-separated class names,or an array of class names. * @param removeClassStr OptionalA String class name to remove, or several space-separated class names,or an array of class names. */ - replaceClass(addClassStr: any[], removeClassStr: any[]): void; + replaceClass(addClassStr: any[], removeClassStr?: any[]): void; /** * Replaces each node in ths NodeList with the content passed to replaceWith. * The content will be cloned if the length of NodeList @@ -2910,7 +2910,7 @@ declare module dojo { * * @param query Optionala CSS selector. */ - siblings(query: String): any; + siblings(query?: String): any; /** * Returns a new NodeList, maintaining this one in place * This method behaves exactly like the Array.slice method @@ -2921,13 +2921,13 @@ declare module dojo { * @param begin Can be a positive or negative integer, with positiveintegers noting the offset to begin at, and negativeintegers denoting an offset from the end (i.e., to the leftof the end) * @param end OptionalOptional parameter to describe what position relative tothe NodeList's zero index to end the slice at. Like begin,can be positive or negative. */ - slice(begin: number, end: number): any; + slice(begin: number, end?: number): any; /** * slide all elements of the node list to the specified place via dojo/fx.slideTo() * * @param args OptionalAdditional dojo/_base/fx.Animation arguments to mix into this set with the addition ofan auto parameter. */ - slideTo(args: Object): any; + slideTo(args?: Object): any; /** * Takes the same structure of arguments and returns as * dojo/_base/array.some() with the caveat that the passed array is @@ -2938,7 +2938,7 @@ declare module dojo { * @param callback the callback * @param thisObject Optionalthe context */ - some(callback: Function, thisObject: Object): any; + some(callback: Function, thisObject?: Object): any; /** * Returns a new NodeList, manipulating this NodeList based on * the arguments passed, potentially splicing in new elements @@ -2954,14 +2954,14 @@ declare module dojo { * @param howmany OptionalOptional parameter to describe what position relative tothe NodeList's zero index to end the slice at. Like begin,can be positive or negative. * @param item OptionalAny number of optional parameters may be passed in to bespliced into the NodeList */ - splice(index: number, howmany: number, item: Object[]): any; + splice(index: number, howmany?: number, item?: Object[]): any; /** * gets or sets the CSS property for every element in the NodeList * * @param property the CSS property to get/set, in JavaScript notation("lineHieght" instead of "line-height") * @param value Optionaloptional. The value to set the property to */ - style(property: String, value: String): any; + style(property: String, value?: String): any; /** * allows setting the text value of each node in the NodeList, * if there is a value passed in, otherwise, returns the text value for all the @@ -2977,7 +2977,7 @@ declare module dojo { * @param className the CSS class to add * @param condition OptionalIf passed, true means to add the class, false means to remove. */ - toggleClass(className: String, condition: boolean): void; + toggleClass(className: String, condition?: boolean): void; /** * Animate the effect of adding or removing a class to all nodes in this list. * see dojox.fx.toggleClass @@ -3014,13 +3014,13 @@ declare module dojo { * * @param args OptionalAdditional dojo/_base/fx.Animation arguments to mix into this set with the addition ofan auto parameter. */ - wipeIn(args: Object): any; + wipeIn(args?: Object): any; /** * wipe out all elements of this NodeList via dojo/fx.wipeOut() * * @param args OptionalAdditional dojo/_base/fx.Animation arguments to mix into this set with the addition ofan auto parameter. */ - wipeOut(args: Object): any; + wipeOut(args?: Object): any; /** * Wrap each node in the NodeList with html passed to wrap. * html will be cloned if the NodeList has more than one @@ -3112,7 +3112,7 @@ declare module dojo { * * @param params Optional */ - postscript(params: Object): void; + postscript(params?: Object): void; /** * Set a property on a Stateful instance * Sets named properties on a stateful object and notifies any watchers of @@ -3325,7 +3325,7 @@ declare module dojo { * @param mixins Specifies a list of bases (the left-most one is the most deepestbase). * @param props OptionalAn optional object whose properties are copied to the created prototype. */ - createSubclass(mixins: Function[], props: Object): dojo._base.declare.__DeclareCreatedObject; + createSubclass(mixins: Function[], props?: Object): dojo._base.declare.__DeclareCreatedObject; /** * Adds all properties and methods of source to constructor's * prototype, making them available to all instances created with @@ -3351,7 +3351,7 @@ declare module dojo { * @param name OptionalThe optional method name. Should be the same as the caller'sname. Usually "name" is specified in complex dynamic cases, whenthe calling method was dynamically added, undecorated bydeclare(), and it cannot be determined. * @param args The caller supply this argument, which should be the original"arguments". */ - getInherited(name: String, args: Object): any; + getInherited(name?: String, args?: Object): any; /** * Calls a super method. * This method is used inside method of classes produced with @@ -3382,7 +3382,7 @@ declare module dojo { * @param args The caller supply this argument, which should be the original"arguments". * @param newArgs OptionalIf "true", the found function will be returned withoutexecuting it.If Array, it will be used to call a super method. Otherwise"args" will be used. */ - inherited(name: String, args: Object, newArgs: Object): any; + inherited(name?: String, args?: Object, newArgs?: Object): any; /** * Checks the inheritance chain to see if it is inherited from this * class. @@ -3476,7 +3476,7 @@ declare module dojo { * @param callback OptionalThe callback attached to this deferred object. * @param errback OptionalThe error callback attached to this deferred object. */ - addCallbacks(callback: Function, errback: Function): any; + addCallbacks(callback?: Function, errback?: Function): any; /** * Adds error callback for this deferred instance. * @@ -3557,7 +3557,7 @@ declare module dojo { * @param errorCallback Optional * @param progressCallback Optional */ - then(resolvedCallback: Function, errorCallback: Function, progressCallback: Function): any; + then(resolvedCallback?: Function, errorCallback?: Function, progressCallback?: Function): any; /** * Transparently applies callbacks to values and/or promises. * Accepts promises but also transparently handles non-promises. If no @@ -3574,7 +3574,7 @@ declare module dojo { * @param errback OptionalCallback to be invoked when the promise is rejected. * @param progback OptionalCallback to be invoked when the promise emits a progress update. */ - when(valueOrPromise: any, callback: Function, errback: Function, progback: Function): any; + when(valueOrPromise?: any, callback?: Function, errback?: Function, progback?: Function): any; } module Deferred { @@ -3739,7 +3739,7 @@ declare module dojo { * @param formNode * @param prettyPrint Optional */ - formToJson(formNode: HTMLElement, prettyPrint: boolean): any; + formToJson(formNode: HTMLElement, prettyPrint?: boolean): any; /** * Create a serialized JSON string from a form node or string * ID identifying the form to serialize @@ -3747,7 +3747,7 @@ declare module dojo { * @param formNode * @param prettyPrint Optional */ - formToJson(formNode: String, prettyPrint: boolean): any; + formToJson(formNode: String, prettyPrint?: boolean): any; /** * Serialize a form node to a JavaScript object. * Returns the values encoded in an HTML form as @@ -4115,7 +4115,7 @@ declare module dojo { * @param weight * @param obj Optional */ - blendColors(start: dojo._base.Color, end: dojo._base.Color, weight: number, obj: dojo._base.Color): any; + blendColors(start: dojo._base.Color, end: dojo._base.Color, weight: number, obj?: dojo._base.Color): any; /** * Builds a Color from a 3 or 4 element array, mapping each * element in sequence to the rgb(a) values of the color. @@ -4123,7 +4123,7 @@ declare module dojo { * @param a * @param obj Optional */ - fromArray(a: any[], obj: dojo._base.Color): any; + fromArray(a: any[], obj?: dojo._base.Color): any; /** * Converts a hex string with a '#' prefix to a color object. * Supports 12-bit #rgb shorthand. Optionally accepts a @@ -4132,7 +4132,7 @@ declare module dojo { * @param color * @param obj Optional */ - fromHex(color: String, obj: dojo._base.Color): any; + fromHex(color: String, obj?: dojo._base.Color): any; /** * get rgb(a) array from css-style color declarations * this function can handle all 4 CSS3 Color Module formats: rgb, @@ -4141,7 +4141,7 @@ declare module dojo { * @param color * @param obj Optional */ - fromRgb(color: String, obj: dojo._base.Color): any; + fromRgb(color: String, obj?: dojo._base.Color): any; /** * Parses str for a color value. Accepts hex, rgb, and rgba * style color values. @@ -4153,14 +4153,14 @@ declare module dojo { * @param str * @param obj Optional */ - fromString(str: String, obj: dojo._base.Color): any; + fromString(str: String, obj?: dojo._base.Color): any; /** * creates a greyscale color with an optional alpha * * @param g * @param a Optional */ - makeGrey(g: number, a: number): void; + makeGrey(g: number, a?: number): void; /** * makes sure that the object has correct attributes * @@ -4205,7 +4205,7 @@ declare module dojo { * * @param includeAlpha Optional */ - toCss(includeAlpha: boolean): String; + toCss(includeAlpha?: boolean): String; /** * Returns a CSS color string in hexadecimal representation * @@ -5051,7 +5051,7 @@ declare module dojo { * @param thisObject Optionalmay be used to scope the call to callback * @param Ctr */ - map(arr: any[], callback: Function, thisObject: Object, Ctr: any): any[]; + map(arr: any[], callback: Function, thisObject?: Object, Ctr?: any): any[]; /** * applies callback to each element of arr and returns * an Array with the results @@ -5066,7 +5066,7 @@ declare module dojo { * @param thisObject Optionalmay be used to scope the call to callback * @param Ctr */ - map(arr: String, callback: Function, thisObject: Object, Ctr: any): any[]; + map(arr: String, callback: Function, thisObject?: Object, Ctr?: any): any[]; /** * applies callback to each element of arr and returns * an Array with the results @@ -5081,7 +5081,7 @@ declare module dojo { * @param thisObject Optionalmay be used to scope the call to callback * @param Ctr */ - map(arr: any[], callback: String, thisObject: Object, Ctr: any): any[]; + map(arr: any[], callback: String, thisObject?: Object, Ctr?: any): any[]; /** * applies callback to each element of arr and returns * an Array with the results @@ -5096,7 +5096,7 @@ declare module dojo { * @param thisObject Optionalmay be used to scope the call to callback * @param Ctr */ - map(arr: String, callback: String, thisObject: Object, Ctr: any): any[]; + map(arr: String, callback: String, thisObject?: Object, Ctr?: any): any[]; /** * Determines whether or not any item in arr satisfies the * condition implemented by callback. @@ -5206,7 +5206,7 @@ declare module dojo { * @param method A function reference, or name of a function in context.The function identified by method fires after event does.method receives the same arguments as the event.See context argument comments for information on method's scope. * @param dontFix OptionalIf obj is a DOM node, set dontFix to true to prevent delegationof this connection to the DOM event manager. */ - connect(obj: Object, event: String, context: Object, method: String, dontFix: boolean): any; + connect(obj: Object, event: String, context: Object, method: String, dontFix?: boolean): any; /** * dojo.connect is a deprecated event handling and delegation method in * Dojo. It allows one function to "listen in" on the execution of @@ -5246,7 +5246,7 @@ declare module dojo { * @param method A function reference, or name of a function in context.The function identified by method fires after event does.method receives the same arguments as the event.See context argument comments for information on method's scope. * @param dontFix OptionalIf obj is a DOM node, set dontFix to true to prevent delegationof this connection to the DOM event manager. */ - connect(obj: Object, event: String, context: any, method: String, dontFix: boolean): any; + connect(obj: Object, event: String, context: any, method: String, dontFix?: boolean): any; /** * dojo.connect is a deprecated event handling and delegation method in * Dojo. It allows one function to "listen in" on the execution of @@ -5286,7 +5286,7 @@ declare module dojo { * @param method A function reference, or name of a function in context.The function identified by method fires after event does.method receives the same arguments as the event.See context argument comments for information on method's scope. * @param dontFix OptionalIf obj is a DOM node, set dontFix to true to prevent delegationof this connection to the DOM event manager. */ - connect(obj: Object, event: String, context: Object, method: Function, dontFix: boolean): any; + connect(obj: Object, event: String, context: Object, method: Function, dontFix?: boolean): any; /** * dojo.connect is a deprecated event handling and delegation method in * Dojo. It allows one function to "listen in" on the execution of @@ -5326,7 +5326,7 @@ declare module dojo { * @param method A function reference, or name of a function in context.The function identified by method fires after event does.method receives the same arguments as the event.See context argument comments for information on method's scope. * @param dontFix OptionalIf obj is a DOM node, set dontFix to true to prevent delegationof this connection to the DOM event manager. */ - connect(obj: Object, event: String, context: any, method: Function, dontFix: boolean): any; + connect(obj: Object, event: String, context: any, method: Function, dontFix?: boolean): any; /** * Ensure that every time obj.event() is called, a message is published * on the topic. Returns a handle which can be passed to @@ -5357,7 +5357,7 @@ declare module dojo { * @param topic The name of the topic to publish. * @param args OptionalAn array of arguments. The arguments will be appliedto each topic subscriber (as first class parameters, via apply). */ - publish(topic: String, args: any[]): any; + publish(topic: String, args?: any[]): any; /** * Attach a listener to a named topic. The listener function is invoked whenever the * named topic is published (see: dojo.publish). @@ -5367,7 +5367,7 @@ declare module dojo { * @param context OptionalScope in which method will be invoked, or null for default scope. * @param method The name of a function in context, or a function reference. This is the function thatis invoked when topic is published. */ - subscribe(topic: String, context: Object, method: String): any; + subscribe(topic: String, context?: Object, method?: String): any; /** * Attach a listener to a named topic. The listener function is invoked whenever the * named topic is published (see: dojo.publish). @@ -5377,7 +5377,7 @@ declare module dojo { * @param context OptionalScope in which method will be invoked, or null for default scope. * @param method The name of a function in context, or a function reference. This is the function thatis invoked when topic is published. */ - subscribe(topic: String, context: Object, method: Function): any; + subscribe(topic: String, context?: Object, method?: Function): any; /** * Remove a topic listener. * @@ -5469,7 +5469,7 @@ declare module dojo { * @param onEnd OptionalA function to be called when the animation finishesrunning. * @param delay OptionalThe number of milliseconds to delay beginning theanimation by. The default is 0. */ - anim (node: HTMLElement, properties: Object, duration: number, easing: Function, onEnd: Function, delay: number): any ; + anim (node: HTMLElement, properties: Object, duration?: number, easing?: Function, onEnd?: Function, delay?: number): any ; /** * A simpler interface to animateProperty(), also returns * an instance of Animation but begins the animation @@ -5490,7 +5490,7 @@ declare module dojo { * @param onEnd OptionalA function to be called when the animation finishesrunning. * @param delay OptionalThe number of milliseconds to delay beginning theanimation by. The default is 0. */ - anim (node: String, properties: Object, duration: number, easing: Function, onEnd: Function, delay: number): any ; + anim (node: String, properties: Object, duration?: number, easing?: Function, onEnd?: Function, delay?: number): any ; /** * Returns an animation that will transition the properties of * node defined in args depending how they are defined in @@ -5502,7 +5502,7 @@ declare module dojo { * * @param args An object with the following properties:properties (Object, optional): A hash map of style properties to Objects describing the transition,such as the properties of _Line with an additional 'units' propertynode (DOMNode|String): The node referenced in the animationduration (Integer, optional): Duration of the animation in milliseconds.easing (Function, optional): An easing function. */ - animateProperty (args: Object): any ; + animateProperty (args?: Object): any ; /** * Returns an animation that will fade node defined in 'args' from @@ -5584,7 +5584,7 @@ declare module dojo { * @param name Path to an object, in the form "A.B.C". * @param obj OptionalObject to use as root of path. Defaults to'dojo.global'. Null may be passed. */ - exists(name: String, obj: Object): boolean; + exists(name: String, obj?: Object): boolean; /** * Adds all properties and methods of props to constructor's * prototype, making them available to all instances created with @@ -5603,7 +5603,7 @@ declare module dojo { * @param create OptionalOptional. Defaults to false. If true, Objects will becreated at any point along the 'path' that is undefined. * @param context OptionalOptional. Object to use as root of path. Defaults to'dojo.global'. Null may be passed. */ - getObject(name: String, create: boolean, context: Object): any; + getObject(name: String, create?: boolean, context?: Object): any; /** * Returns a function that will only ever execute in the a given scope. * This allows for easy use of object member functions @@ -5715,7 +5715,7 @@ declare module dojo { * @param map If an object, it is used as a dictionary to look up substitutions.If a function, it is called for every substitution with following parameters:a whole match, a name, an offset, and the whole templatestring (see https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String/replacefor more details). * @param pattern OptionalOptional regular expression objects that overrides the default pattern.Must be global and match one item. The default is: /{([^}]+)}/g,which matches patterns like that: "{xxx}", where "xxx" is any sequenceof characters, which doesn't include "}". */ - replace(tmpl: String, map: Object, pattern: RegExp): String; + replace(tmpl: String, map: Object, pattern?: RegExp): String; /** * Performs parameterized substitutions on a string. Throws an * exception if any parameter is unmatched. @@ -5724,7 +5724,7 @@ declare module dojo { * @param map If an object, it is used as a dictionary to look up substitutions.If a function, it is called for every substitution with following parameters:a whole match, a name, an offset, and the whole templatestring (see https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String/replacefor more details). * @param pattern OptionalOptional regular expression objects that overrides the default pattern.Must be global and match one item. The default is: /{([^}]+)}/g,which matches patterns like that: "{xxx}", where "xxx" is any sequenceof characters, which doesn't include "}". */ - replace(tmpl: String, map: Function, pattern: RegExp): String; + replace(tmpl: String, map: Function, pattern?: RegExp): String; /** * Set a property from a dot-separated string, such as "A.B.C" * Useful for longer api chains where you have to test each object in @@ -5736,7 +5736,7 @@ declare module dojo { * @param value value or object to place at location given by name * @param context OptionalOptional. Object to use as root of path. Defaults todojo.global. */ - setObject(name: String, value: any, context: Object): any; + setObject(name: String, value: any, context?: Object): any; /** * Trims whitespace from both sides of the string * This version of trim() was selected for inclusion into the base due @@ -5779,7 +5779,7 @@ declare module dojo { * @param obj Optional * @param functionName Optional */ - addOnUnload(obj: Object, functionName: String): void; + addOnUnload(obj?: Object, functionName?: String): void; /** * registers a function to be triggered when the page unloads. * The first time that addOnUnload is called Dojo will @@ -5802,7 +5802,7 @@ declare module dojo { * @param obj Optional * @param functionName Optional */ - addOnUnload(obj: Function, functionName: String): void; + addOnUnload(obj?: Function, functionName?: String): void; /** * registers a function to be triggered when the page unloads. * The first time that addOnUnload is called Dojo will @@ -5825,7 +5825,7 @@ declare module dojo { * @param obj Optional * @param functionName Optional */ - addOnUnload(obj: Object, functionName: Function): void; + addOnUnload(obj?: Object, functionName?: Function): void; /** * registers a function to be triggered when the page unloads. * The first time that addOnUnload is called Dojo will @@ -5848,7 +5848,7 @@ declare module dojo { * @param obj Optional * @param functionName Optional */ - addOnUnload(obj: Function, functionName: Function): void; + addOnUnload(obj?: Function, functionName?: Function): void; /** * registers a function to be triggered when window.onunload * fires. @@ -5866,7 +5866,7 @@ declare module dojo { * @param obj Optional * @param functionName Optional */ - addOnWindowUnload(obj: Object, functionName: String): void; + addOnWindowUnload(obj?: Object, functionName?: String): void; /** * registers a function to be triggered when window.onunload * fires. @@ -5884,7 +5884,7 @@ declare module dojo { * @param obj Optional * @param functionName Optional */ - addOnWindowUnload(obj: Function, functionName: String): void; + addOnWindowUnload(obj?: Function, functionName?: String): void; /** * registers a function to be triggered when window.onunload * fires. @@ -5902,7 +5902,7 @@ declare module dojo { * @param obj Optional * @param functionName Optional */ - addOnWindowUnload(obj: Object, functionName: Function): void; + addOnWindowUnload(obj?: Object, functionName?: Function): void; /** * registers a function to be triggered when window.onunload * fires. @@ -5920,7 +5920,7 @@ declare module dojo { * @param obj Optional * @param functionName Optional */ - addOnWindowUnload(obj: Function, functionName: Function): void; + addOnWindowUnload(obj?: Function, functionName?: Function): void; } /** * Permalink: http://dojotoolkit.org/api/1.9/dojo/_base/window.html @@ -5946,7 +5946,7 @@ declare module dojo { * * @param doc Optional */ - body(doc: HTMLDocument): any; + body(doc?: HTMLDocument): any; /** * changes the behavior of many core Dojo functions that deal with * namespace and DOM lookup, changing them to work in a new global @@ -5970,7 +5970,7 @@ declare module dojo { * @param thisObject Optional * @param cbArguments Optional */ - withDoc(documentObject: HTMLDocument, callback: Function, thisObject: Object, cbArguments: any[]): any; + withDoc(documentObject: HTMLDocument, callback: Function, thisObject?: Object, cbArguments?: any[]): any; /** * Invoke callback with globalObject as dojo.global and * globalObject.document as dojo.doc. @@ -5985,7 +5985,7 @@ declare module dojo { * @param thisObject Optional * @param cbArguments Optional */ - withGlobal(globalObject: Object, callback: Function, thisObject: Object, cbArguments: any[]): any; + withGlobal(globalObject: Object, callback: Function, thisObject?: Object, cbArguments?: any[]): any; } module window { /** @@ -6335,7 +6335,7 @@ declare module dojo { * * @param returnWrappers Optional */ - AdapterRegistry(returnWrappers: boolean): void; + AdapterRegistry(returnWrappers?: boolean): void; /** * Adds the specified classes to the end of the class list on the * passed node. Will not re-apply duplicate classes. @@ -6379,7 +6379,7 @@ declare module dojo { * @param context The context in which to run execute callback, or a callback if not using context * @param callback OptionalThe function to execute. */ - addOnLoad(priority: number, context: any, callback: Function): void; + addOnLoad(priority: number, context: any, callback?: Function): void; /** * registers a function to be triggered when the page unloads. * The first time that addOnUnload is called Dojo will @@ -6402,7 +6402,7 @@ declare module dojo { * @param obj Optional * @param functionName Optional */ - addOnUnload(obj: Object, functionName: String): void; + addOnUnload(obj?: Object, functionName?: String): void; /** * registers a function to be triggered when the page unloads. * The first time that addOnUnload is called Dojo will @@ -6425,7 +6425,7 @@ declare module dojo { * @param obj Optional * @param functionName Optional */ - addOnUnload(obj: Function, functionName: String): void; + addOnUnload(obj?: Function, functionName?: String): void; /** * registers a function to be triggered when the page unloads. * The first time that addOnUnload is called Dojo will @@ -6448,7 +6448,7 @@ declare module dojo { * @param obj Optional * @param functionName Optional */ - addOnUnload(obj: Object, functionName: Function): void; + addOnUnload(obj?: Object, functionName?: Function): void; /** * registers a function to be triggered when the page unloads. * The first time that addOnUnload is called Dojo will @@ -6471,7 +6471,7 @@ declare module dojo { * @param obj Optional * @param functionName Optional */ - addOnUnload(obj: Function, functionName: Function): void; + addOnUnload(obj?: Function, functionName?: Function): void; /** * registers a function to be triggered when window.onunload fires. * Be careful trying to modify the DOM or access JavaScript properties @@ -6482,7 +6482,7 @@ declare module dojo { * @param obj Optional * @param functionName Optional */ - addOnWindowUnload(obj: Object, functionName: String): void; + addOnWindowUnload(obj?: Object, functionName?: String): void; /** * registers a function to be triggered when window.onunload fires. * Be careful trying to modify the DOM or access JavaScript properties @@ -6514,7 +6514,7 @@ declare module dojo { * @param onEnd OptionalA function to be called when the animation finishesrunning. * @param delay OptionalThe number of milliseconds to delay beginning theanimation by. The default is 0. */ - anim(node: HTMLElement, properties: Object, duration: number, easing: Function, onEnd: Function, delay: number): any; + anim(node: HTMLElement, properties: Object, duration?: number, easing?: Function, onEnd?: Function, delay?: number): any; /** * A simpler interface to animateProperty(), also returns * an instance of Animation but begins the animation @@ -6535,7 +6535,7 @@ declare module dojo { * @param onEnd OptionalA function to be called when the animation finishesrunning. * @param delay OptionalThe number of milliseconds to delay beginning theanimation by. The default is 0. */ - anim(node: String, properties: Object, duration: number, easing: Function, onEnd: Function, delay: number): any; + anim(node: String, properties: Object, duration?: number, easing?: Function, onEnd?: Function, delay?: number): any; /** * Returns an animation that will transition the properties of * node defined in args depending how they are defined in @@ -6584,7 +6584,7 @@ declare module dojo { * @param name the name of the attribute to get or set. * @param value OptionalThe value to set for the attribute */ - attr(node: HTMLElement, name: String, value: String): any; + attr(node: HTMLElement, name: String, value?: String): any; /** * Gets or sets an attribute on an HTML element. * Handles normalized getting and setting of attributes on DOM @@ -6608,7 +6608,7 @@ declare module dojo { * @param name the name of the attribute to get or set. * @param value OptionalThe value to set for the attribute */ - attr(node: String, name: String, value: String): any; + attr(node: String, name: String, value?: String): any; /** * Gets or sets an attribute on an HTML element. * Handles normalized getting and setting of attributes on DOM @@ -6632,7 +6632,7 @@ declare module dojo { * @param name the name of the attribute to get or set. * @param value OptionalThe value to set for the attribute */ - attr(node: HTMLElement, name: Object, value: String): any; + attr(node: HTMLElement, name: Object, value?: String): any; /** * Gets or sets an attribute on an HTML element. * Handles normalized getting and setting of attributes on DOM @@ -6656,7 +6656,7 @@ declare module dojo { * @param name the name of the attribute to get or set. * @param value OptionalThe value to set for the attribute */ - attr(node: String, name: Object, value: String): any; + attr(node: String, name: Object, value?: String): any; /** * Blend colors end and start with weight from 0 to 1, 0.5 being a 50/50 blend, * can reuse a previously allocated Color object for the result @@ -6666,13 +6666,13 @@ declare module dojo { * @param weight * @param obj Optional */ - blendColors(start: dojo._base.Color, end: dojo._base.Color, weight: number, obj: dojo._base.Color): any; + blendColors(start: dojo._base.Color, end: dojo._base.Color, weight: number, obj?: dojo._base.Color): any; /** * Return the body element of the specified document or of dojo/_base/window::doc. * * @param doc Optional */ - body(doc: HTMLDocument): any; + body(doc?: HTMLDocument): any; /** * Returns DOM node with matching id attribute or falsy value (ex: null or undefined) * if not found. If id is a DomNode, this function is a no-op. @@ -6680,7 +6680,7 @@ declare module dojo { * @param id A string to match an HTML id attribute or a reference to a DOM Node * @param doc OptionalDocument to work in. Defaults to the current value ofdojo/_base/window.doc. Can be used to retrievenode references from other documents. */ - byId(id: String, doc: HTMLDocument): any; + byId(id: String, doc?: HTMLDocument): any; /** * Returns DOM node with matching id attribute or falsy value (ex: null or undefined) * if not found. If id is a DomNode, this function is a no-op. @@ -6688,7 +6688,7 @@ declare module dojo { * @param id A string to match an HTML id attribute or a reference to a DOM Node * @param doc OptionalDocument to work in. Defaults to the current value ofdojo/_base/window.doc. Can be used to retrievenode references from other documents. */ - byId(id: HTMLElement, doc: HTMLDocument): any; + byId(id: HTMLElement, doc?: HTMLDocument): any; /** * A getter and setter for storing the string content associated with the * module and url arguments. @@ -6708,7 +6708,7 @@ declare module dojo { * @param url The rest of the path to append to the path derived from the module argument. Ifmodule is an object, then this second argument should be the "value" argument instead. * @param value OptionalIf a String, the value to use in the cache for the module/url combination.If an Object, it can have two properties: value and sanitize. The value propertyshould be the value to use in the cache, and sanitize can be set to true or false,to indicate if XML declarations should be removed from the value and if the HTMLinside a body tag in the value should be extracted as the real value. The value argumentor the value property on the value argument are usually only used by the build systemas it inlines cache content. */ - cache(module: String, url: String, value: String): any; + cache(module: String, url: String, value?: String): any; /** * A getter and setter for storing the string content associated with the * module and url arguments. @@ -6728,7 +6728,7 @@ declare module dojo { * @param url The rest of the path to append to the path derived from the module argument. Ifmodule is an object, then this second argument should be the "value" argument instead. * @param value OptionalIf a String, the value to use in the cache for the module/url combination.If an Object, it can have two properties: value and sanitize. The value propertyshould be the value to use in the cache, and sanitize can be set to true or false,to indicate if XML declarations should be removed from the value and if the HTMLinside a body tag in the value should be extracted as the real value. The value argumentor the value property on the value argument are usually only used by the build systemas it inlines cache content. */ - cache(module: Object, url: String, value: String): any; + cache(module: Object, url: String, value?: String): any; /** * A getter and setter for storing the string content associated with the * module and url arguments. @@ -6748,7 +6748,7 @@ declare module dojo { * @param url The rest of the path to append to the path derived from the module argument. Ifmodule is an object, then this second argument should be the "value" argument instead. * @param value OptionalIf a String, the value to use in the cache for the module/url combination.If an Object, it can have two properties: value and sanitize. The value propertyshould be the value to use in the cache, and sanitize can be set to true or false,to indicate if XML declarations should be removed from the value and if the HTMLinside a body tag in the value should be extracted as the real value. The value argumentor the value property on the value argument are usually only used by the build systemas it inlines cache content. */ - cache(module: String, url: String, value: Object): any; + cache(module: String, url: String, value?: Object): any; /** * A getter and setter for storing the string content associated with the * module and url arguments. @@ -6768,7 +6768,7 @@ declare module dojo { * @param url The rest of the path to append to the path derived from the module argument. Ifmodule is an object, then this second argument should be the "value" argument instead. * @param value OptionalIf a String, the value to use in the cache for the module/url combination.If an Object, it can have two properties: value and sanitize. The value propertyshould be the value to use in the cache, and sanitize can be set to true or false,to indicate if XML declarations should be removed from the value and if the HTMLinside a body tag in the value should be extracted as the real value. The value argumentor the value property on the value argument are usually only used by the build systemas it inlines cache content. */ - cache(module: Object, url: String, value: Object): any; + cache(module: Object, url: String, value?: Object): any; /** * */ @@ -6804,7 +6804,7 @@ declare module dojo { * @param a * @param obj Optional */ - colorFromArray(a: any[], obj: dojo._base.Color): any; + colorFromArray(a: any[], obj?: dojo._base.Color): any; /** * Converts a hex string with a '#' prefix to a color object. * Supports 12-bit #rgb shorthand. Optionally accepts a @@ -6813,7 +6813,7 @@ declare module dojo { * @param color * @param obj Optional */ - colorFromHex(color: String, obj: dojo._base.Color): any; + colorFromHex(color: String, obj?: dojo._base.Color): any; /** * get rgb(a) array from css-style color declarations * this function can handle all 4 CSS3 Color Module formats: rgb, @@ -6822,7 +6822,7 @@ declare module dojo { * @param color * @param obj Optional */ - colorFromRgb(color: String, obj: dojo._base.Color): any; + colorFromRgb(color: String, obj?: dojo._base.Color): any; /** * Parses str for a color value. Accepts hex, rgb, and rgba * style color values. @@ -6834,7 +6834,7 @@ declare module dojo { * @param str * @param obj Optional */ - colorFromString(str: String, obj: dojo._base.Color): any; + colorFromString(str: String, obj?: dojo._base.Color): any; /** * dojo.connect is a deprecated event handling and delegation method in * Dojo. It allows one function to "listen in" on the execution of @@ -6874,7 +6874,7 @@ declare module dojo { * @param method A function reference, or name of a function in context.The function identified by method fires after event does.method receives the same arguments as the event.See context argument comments for information on method's scope. * @param dontFix OptionalIf obj is a DOM node, set dontFix to true to prevent delegationof this connection to the DOM event manager. */ - connect(obj: Object, event: String, context: Object, method: String, dontFix: boolean): any; + connect(obj: Object, event: String, context: Object, method: String, dontFix?: boolean): any; /** * dojo.connect is a deprecated event handling and delegation method in * Dojo. It allows one function to "listen in" on the execution of @@ -6914,7 +6914,7 @@ declare module dojo { * @param method A function reference, or name of a function in context.The function identified by method fires after event does.method receives the same arguments as the event.See context argument comments for information on method's scope. * @param dontFix OptionalIf obj is a DOM node, set dontFix to true to prevent delegationof this connection to the DOM event manager. */ - connect(obj: Object, event: String, context: any, method: String, dontFix: boolean): any; + connect(obj: Object, event: String, context: any, method: String, dontFix?: boolean): any; /** * dojo.connect is a deprecated event handling and delegation method in * Dojo. It allows one function to "listen in" on the execution of @@ -6954,7 +6954,7 @@ declare module dojo { * @param method A function reference, or name of a function in context.The function identified by method fires after event does.method receives the same arguments as the event.See context argument comments for information on method's scope. * @param dontFix OptionalIf obj is a DOM node, set dontFix to true to prevent delegationof this connection to the DOM event manager. */ - connect(obj: Object, event: String, context: Object, method: Function, dontFix: boolean): any; + connect(obj: Object, event: String, context: Object, method: Function, dontFix?: boolean): any; /** * dojo.connect is a deprecated event handling and delegation method in * Dojo. It allows one function to "listen in" on the execution of @@ -6994,7 +6994,7 @@ declare module dojo { * @param method A function reference, or name of a function in context.The function identified by method fires after event does.method receives the same arguments as the event.See context argument comments for information on method's scope. * @param dontFix OptionalIf obj is a DOM node, set dontFix to true to prevent delegationof this connection to the DOM event manager. */ - connect(obj: Object, event: String, context: any, method: Function, dontFix: boolean): any; + connect(obj: Object, event: String, context: any, method: Function, dontFix?: boolean): any; /** * Getter/setter for the content-box of node. * Returns an object in the expected format of box (regardless if box is passed). @@ -7011,7 +7011,7 @@ declare module dojo { * @param node id or reference to DOM Node to get/set box for * @param box OptionalIf passed, denotes that dojo.contentBox() shouldupdate/set the content box for node. Box is an object in theabove format, but only w (width) and h (height) are supported.All properties are optional if passed. */ - contentBox(node: HTMLElement, box: Object): any; + contentBox(node: HTMLElement, box?: Object): any; /** * Getter/setter for the content-box of node. * Returns an object in the expected format of box (regardless if box is passed). @@ -7028,7 +7028,7 @@ declare module dojo { * @param node id or reference to DOM Node to get/set box for * @param box OptionalIf passed, denotes that dojo.contentBox() shouldupdate/set the content box for node. Box is an object in theabove format, but only w (width) and h (height) are supported.All properties are optional if passed. */ - contentBox(node: String, box: Object): any; + contentBox(node: String, box?: Object): any; /** * Get or set a cookie. * If one argument is passed, returns the value of the cookie @@ -7038,7 +7038,7 @@ declare module dojo { * @param value OptionalValue for the cookie * @param props OptionalProperties for the cookie */ - cookie(name: String, value: String, props: Object): any; + cookie(name: String, value?: String, props?: Object): any; /** * Deprecated: Use position() for border-box x/y/w/h * or marginBox() for margin-box w/h/l/t. @@ -7057,7 +7057,7 @@ declare module dojo { * @param node * @param includeScroll Optional */ - coords(node: HTMLElement, includeScroll: boolean): any; + coords(node: HTMLElement, includeScroll?: boolean): any; /** * Deprecated: Use position() for border-box x/y/w/h * or marginBox() for margin-box w/h/l/t. @@ -7076,7 +7076,7 @@ declare module dojo { * @param node * @param includeScroll Optional */ - coords(node: String, includeScroll: boolean): any; + coords(node: String, includeScroll?: boolean): any; /** * Create an element, allowing for optional attribute decoration * and placement. @@ -7095,7 +7095,7 @@ declare module dojo { * @param refNode OptionalOptional reference node. Used by dojo.place to place the newly creatednode somewhere in the dom relative to refNode. Can be a DomNode referenceor String ID of a node. * @param pos OptionalOptional positional reference. Defaults to "last" by way of dojo.place,though can be set to "first","after","before","last", "replace" or "only"to further control the placement of the new node relative to the refNode.'refNode' is required if a 'pos' is specified. */ - create(tag: HTMLElement, attrs: Object, refNode: HTMLElement, pos: String): any; + create(tag: HTMLElement, attrs: Object, refNode?: HTMLElement, pos?: String): any; /** * Create an element, allowing for optional attribute decoration * and placement. @@ -7114,7 +7114,7 @@ declare module dojo { * @param refNode OptionalOptional reference node. Used by dojo.place to place the newly creatednode somewhere in the dom relative to refNode. Can be a DomNode referenceor String ID of a node. * @param pos OptionalOptional positional reference. Defaults to "last" by way of dojo.place,though can be set to "first","after","before","last", "replace" or "only"to further control the placement of the new node relative to the refNode.'refNode' is required if a 'pos' is specified. */ - create(tag: String, attrs: Object, refNode: HTMLElement, pos: String): any; + create(tag: String, attrs: Object, refNode?: HTMLElement, pos?: String): any; /** * Create an element, allowing for optional attribute decoration * and placement. @@ -7133,7 +7133,7 @@ declare module dojo { * @param refNode OptionalOptional reference node. Used by dojo.place to place the newly creatednode somewhere in the dom relative to refNode. Can be a DomNode referenceor String ID of a node. * @param pos OptionalOptional positional reference. Defaults to "last" by way of dojo.place,though can be set to "first","after","before","last", "replace" or "only"to further control the placement of the new node relative to the refNode.'refNode' is required if a 'pos' is specified. */ - create(tag: HTMLElement, attrs: Object, refNode: String, pos: String): any; + create(tag: HTMLElement, attrs: Object, refNode?: String, pos?: String): any; /** * Create an element, allowing for optional attribute decoration * and placement. @@ -7152,7 +7152,7 @@ declare module dojo { * @param refNode OptionalOptional reference node. Used by dojo.place to place the newly creatednode somewhere in the dom relative to refNode. Can be a DomNode referenceor String ID of a node. * @param pos OptionalOptional positional reference. Defaults to "last" by way of dojo.place,though can be set to "first","after","before","last", "replace" or "only"to further control the placement of the new node relative to the refNode.'refNode' is required if a 'pos' is specified. */ - create(tag: String, attrs: Object, refNode: String, pos: String): any; + create(tag: String, attrs: Object, refNode?: String, pos?: String): any; /** * Create a feature-rich constructor from compact notation. * Create a constructor using a compact notation for inheritance and @@ -7364,7 +7364,7 @@ declare module dojo { * @param consumeErrors Optional * @param canceller OptionalA deferred canceller function, see dojo.Deferred */ - DeferredList(list: any[], fireOnOneCallback: boolean, fireOnOneErrback: boolean, consumeErrors: boolean, canceller: Function): void; + DeferredList(list: any[], fireOnOneCallback?: boolean, fireOnOneErrback?: boolean, consumeErrors?: boolean, canceller?: Function): void; /** * Log a debug message to indicate that a behavior has been * deprecated. @@ -7373,7 +7373,7 @@ declare module dojo { * @param extra OptionalText to append to the message. Often provides advice on anew function or facility to achieve the same goal duringthe deprecation period. * @param removal OptionalText to indicate when in the future the behavior will beremoved. Usually a version number. */ - deprecated(behaviour: String, extra: String, removal: String): void; + deprecated(behaviour: String, extra?: String, removal?: String): void; /** * * @param node @@ -7391,7 +7391,7 @@ declare module dojo { * * @param doc OptionalOptional document to query. If unspecified, use win.doc. */ - docScroll(doc: HTMLDocument): Object; + docScroll(doc?: HTMLDocument): Object; /** * * @param node @@ -7431,7 +7431,7 @@ declare module dojo { * @param callback a function is invoked with three arguments: item, index,and array and returns true if the condition is met. * @param thisObject Optionalmay be used to scope the call to callback */ - every(arr: any[], callback: Function, thisObject: Object): boolean; + every(arr: any[], callback: Function, thisObject?: Object): boolean; /** * Determines whether or not every item in arr satisfies the * condition implemented by callback. @@ -7445,7 +7445,7 @@ declare module dojo { * @param callback a function is invoked with three arguments: item, index,and array and returns true if the condition is met. * @param thisObject Optionalmay be used to scope the call to callback */ - every(arr: String, callback: Function, thisObject: Object): boolean; + every(arr: String, callback: Function, thisObject?: Object): boolean; /** * Determines whether or not every item in arr satisfies the * condition implemented by callback. @@ -7459,7 +7459,7 @@ declare module dojo { * @param callback a function is invoked with three arguments: item, index,and array and returns true if the condition is met. * @param thisObject Optionalmay be used to scope the call to callback */ - every(arr: any[], callback: String, thisObject: Object): boolean; + every(arr: any[], callback: String, thisObject?: Object): boolean; /** * Determines whether or not every item in arr satisfies the * condition implemented by callback. @@ -7473,7 +7473,7 @@ declare module dojo { * @param callback a function is invoked with three arguments: item, index,and array and returns true if the condition is met. * @param thisObject Optionalmay be used to scope the call to callback */ - every(arr: String, callback: String, thisObject: Object): boolean; + every(arr: String, callback: String, thisObject?: Object): boolean; /** * * @param exitcode @@ -7490,7 +7490,7 @@ declare module dojo { * @param moduleName The name of a module, or the name of a module file or a specificfunction * @param extra Optionalsome additional message for the user */ - experimental(moduleName: String, extra: String): void; + experimental(moduleName: String, extra?: String): void; /** * Returns an animation that will fade node defined in 'args' from * its current opacity to fully opaque. @@ -7538,7 +7538,7 @@ declare module dojo { * @param callback a function that is invoked with three arguments (item,index, array). The return of this function is expected tobe a boolean which determines whether the passed-in itemwill be included in the returned array. * @param thisObject Optionalmay be used to scope the call to callback */ - filter(arr: any[], callback: Function, thisObject: Object): any[]; + filter(arr: any[], callback: Function, thisObject?: Object): any[]; /** * Returns a new Array with those items from arr that match the * condition implemented by callback. @@ -7552,7 +7552,7 @@ declare module dojo { * @param callback a function that is invoked with three arguments (item,index, array). The return of this function is expected tobe a boolean which determines whether the passed-in itemwill be included in the returned array. * @param thisObject Optionalmay be used to scope the call to callback */ - filter(arr: any[], callback: String, thisObject: Object): any[]; + filter(arr: any[], callback: String, thisObject?: Object): any[]; /** * normalizes properties on the event object including event * bubbling methods, keystroke normalization, and x/y positions @@ -7570,7 +7570,7 @@ declare module dojo { * @param scrollLeft * @param doc OptionalOptional document to query. If unspecified, use win.doc. */ - fixIeBiDiScrollLeft(scrollLeft: number, doc: HTMLDocument): number; + fixIeBiDiScrollLeft(scrollLeft: number, doc?: HTMLDocument): number; /** * for every item in arr, callback is invoked. Return values are ignored. * If you want to break out of the loop, consider using array.every() or array.some(). @@ -7585,7 +7585,7 @@ declare module dojo { * @param callback * @param thisObject Optional */ - forEach(arr: any[], callback: Function, thisObject: Object): void; + forEach(arr: any[], callback: Function, thisObject?: Object): void; /** * for every item in arr, callback is invoked. Return values are ignored. * If you want to break out of the loop, consider using array.every() or array.some(). @@ -7600,7 +7600,7 @@ declare module dojo { * @param callback * @param thisObject Optional */ - forEach(arr: String, callback: Function, thisObject: Object): void; + forEach(arr: String, callback: Function, thisObject?: Object): void; /** * for every item in arr, callback is invoked. Return values are ignored. * If you want to break out of the loop, consider using array.every() or array.some(). @@ -7615,7 +7615,7 @@ declare module dojo { * @param callback * @param thisObject Optional */ - forEach(arr: any[], callback: String, thisObject: Object): void; + forEach(arr: any[], callback: String, thisObject?: Object): void; /** * for every item in arr, callback is invoked. Return values are ignored. * If you want to break out of the loop, consider using array.every() or array.some(). @@ -7630,7 +7630,7 @@ declare module dojo { * @param callback * @param thisObject Optional */ - forEach(arr: String, callback: String, thisObject: Object): void; + forEach(arr: String, callback: String, thisObject?: Object): void; /** * Create a serialized JSON string from a form node or string * ID identifying the form to serialize @@ -7638,7 +7638,7 @@ declare module dojo { * @param formNode * @param prettyPrint Optional */ - formToJson(formNode: HTMLElement, prettyPrint: boolean): String; + formToJson(formNode: HTMLElement, prettyPrint?: boolean): String; /** * Create a serialized JSON string from a form node or string * ID identifying the form to serialize @@ -7646,7 +7646,7 @@ declare module dojo { * @param formNode * @param prettyPrint Optional */ - formToJson(formNode: String, prettyPrint: boolean): String; + formToJson(formNode: String, prettyPrint?: boolean): String; /** * Serialize a form node to a JavaScript object. * Returns the values encoded in an HTML form as @@ -7721,7 +7721,7 @@ declare module dojo { * @param node * @param computedStyle OptionalThis parameter accepts computed styles object.If this parameter is omitted, the functions will calldojo/dom-style.getComputedStyle to get one. It is a better way, callingdojo/dom-style.getComputedStyle once, and then pass the reference to thiscomputedStyle parameter. Wherever possible, reuse the returnedobject of dojo/dom-style.getComputedStyle(). */ - getBorderExtents(node: HTMLElement, computedStyle: Object): Object; + getBorderExtents(node: HTMLElement, computedStyle?: Object): Object; /** * Returns a "computed style" object. * Gets a "computed style" object which can be used to gather @@ -7748,7 +7748,7 @@ declare module dojo { * @param node * @param computedStyle OptionalThis parameter accepts computed styles object.If this parameter is omitted, the functions will calldojo/dom-style.getComputedStyle to get one. It is a better way, callingdojo/dom-style.getComputedStyle once, and then pass the reference to thiscomputedStyle parameter. Wherever possible, reuse the returnedobject of dojo/dom-style.getComputedStyle(). */ - getContentBox(node: HTMLElement, computedStyle: Object): Object; + getContentBox(node: HTMLElement, computedStyle?: Object): Object; /** * returns the offset in x and y from the document body to the * visual edge of the page for IE @@ -7768,7 +7768,7 @@ declare module dojo { * * @param doc OptionalOptional document to query. If unspecified, use win.doc. */ - getIeDocumentElementOffset(doc: HTMLDocument): Object; + getIeDocumentElementOffset(doc?: HTMLDocument): Object; /** * * @param moduleName @@ -7783,7 +7783,7 @@ declare module dojo { * @param node * @param computedStyle OptionalThis parameter accepts computed styles object.If this parameter is omitted, the functions will calldojo/dom-style.getComputedStyle to get one. It is a better way, callingdojo/dom-style.getComputedStyle once, and then pass the reference to thiscomputedStyle parameter. Wherever possible, reuse the returnedobject of dojo/dom-style.getComputedStyle(). */ - getMarginBox(node: HTMLElement, computedStyle: Object): Object; + getMarginBox(node: HTMLElement, computedStyle?: Object): Object; /** * returns object with properties useful for box fitting with * regards to box margins (i.e., the outer-box). @@ -7798,7 +7798,7 @@ declare module dojo { * @param node * @param computedStyle OptionalThis parameter accepts computed styles object.If this parameter is omitted, the functions will calldojo/dom-style.getComputedStyle to get one. It is a better way, callingdojo/dom-style.getComputedStyle once, and then pass the reference to thiscomputedStyle parameter. Wherever possible, reuse the returnedobject of dojo/dom-style.getComputedStyle(). */ - getMarginExtents(node: HTMLElement, computedStyle: Object): Object; + getMarginExtents(node: HTMLElement, computedStyle?: Object): Object; /** * returns an object that encodes the width and height of * the node's margin box @@ -7806,7 +7806,7 @@ declare module dojo { * @param node * @param computedStyle OptionalThis parameter accepts computed styles object.If this parameter is omitted, the functions will calldojo/dom-style.getComputedStyle to get one. It is a better way, callingdojo/dom-style.getComputedStyle once, and then pass the reference to thiscomputedStyle parameter. Wherever possible, reuse the returnedobject of dojo/dom-style.getComputedStyle(). */ - getMarginSize(node: HTMLElement, computedStyle: Object): Object; + getMarginSize(node: HTMLElement, computedStyle?: Object): Object; /** * returns an object that encodes the width and height of * the node's margin box @@ -7814,7 +7814,7 @@ declare module dojo { * @param node * @param computedStyle OptionalThis parameter accepts computed styles object.If this parameter is omitted, the functions will calldojo/dom-style.getComputedStyle to get one. It is a better way, callingdojo/dom-style.getComputedStyle once, and then pass the reference to thiscomputedStyle parameter. Wherever possible, reuse the returnedobject of dojo/dom-style.getComputedStyle(). */ - getMarginSize(node: String, computedStyle: Object): Object; + getMarginSize(node: String, computedStyle?: Object): Object; /** * Returns an effective value of a property or an attribute. * @@ -7842,7 +7842,7 @@ declare module dojo { * @param node * @param computedStyle OptionalThis parameter accepts computed styles object.If this parameter is omitted, the functions will calldojo/dom-style.getComputedStyle to get one. It is a better way, callingdojo/dom-style.getComputedStyle once, and then pass the reference to thiscomputedStyle parameter. Wherever possible, reuse the returnedobject of dojo/dom-style.getComputedStyle(). */ - getPadBorderExtents(node: HTMLElement, computedStyle: Object): Object; + getPadBorderExtents(node: HTMLElement, computedStyle?: Object): Object; /** * Returns object with special values specifically useful for node * fitting. @@ -7860,7 +7860,7 @@ declare module dojo { * @param node * @param computedStyle OptionalThis parameter accepts computed styles object.If this parameter is omitted, the functions will calldojo/dom-style.getComputedStyle to get one. It is a better way, callingdojo/dom-style.getComputedStyle once, and then pass the reference to thiscomputedStyle parameter. Wherever possible, reuse the returnedobject of dojo/dom-style.getComputedStyle(). */ - getPadExtents(node: HTMLElement, computedStyle: Object): Object; + getPadExtents(node: HTMLElement, computedStyle?: Object): Object; /** * Gets a property on an HTML element. * Handles normalized getting of properties on DOM nodes. @@ -7890,7 +7890,7 @@ declare module dojo { * @param node id or reference to node to get style for * @param name Optionalthe style property to get */ - getStyle(node: HTMLElement, name: String): any; + getStyle(node: HTMLElement, name?: String): any; /** * Accesses styles on a node. * Getting the style value uses the computed style for the node, so the value @@ -7904,7 +7904,7 @@ declare module dojo { * @param node id or reference to node to get style for * @param name Optionalthe style property to get */ - getStyle(node: String, name: String): any; + getStyle(node: String, name?: String): any; /** * Returns true if the requested attribute is specified on the * given element, and false otherwise. @@ -7947,7 +7947,7 @@ declare module dojo { * @param hash Optionalthe hash is set - #string. * @param replace OptionalIf true, updates the hash value in the current historystate instead of creating a new history state. */ - hash(hash: String, replace: boolean): any; + hash(hash?: String, replace?: boolean): any; /** * locates the first index of the provided value in the * passed array. If the value is not found, -1 is returned. @@ -7964,13 +7964,13 @@ declare module dojo { * @param fromIndex Optional * @param findLast OptionalMakes indexOf() work like lastIndexOf(). Used internally; not meant for external usage. */ - indexOf(arr: any[], value: Object, fromIndex: number, findLast: boolean): number; + indexOf(arr: any[], value: Object, fromIndex?: number, findLast?: boolean): number; /** * Returns true if the current language is left-to-right, and false otherwise. * * @param doc OptionalOptional document to query. If unspecified, use win.doc. */ - isBodyLtr(doc: HTMLDocument): boolean; + isBodyLtr(doc?: HTMLDocument): boolean; /** * Returns true if node is a descendant of ancestor * @@ -8014,7 +8014,7 @@ declare module dojo { * @param value * @param fromIndex Optional */ - lastIndexOf(arr: any, value: any, fromIndex: number): number; + lastIndexOf(arr: any, value: any, fromIndex?: number): number; /** * * @param f @@ -8093,7 +8093,7 @@ declare module dojo { * @param node id or reference to DOM Node to get/set box for * @param box OptionalIf passed, denotes that dojo.marginBox() shouldupdate/set the margin box for node. Box is an object in theabove format. All properties are optional if passed. */ - marginBox(node: HTMLElement, box: Object): any; + marginBox(node: HTMLElement, box?: Object): any; /** * Getter/setter for the margin-box of node. * Getter/setter for the margin-box of node. @@ -8107,14 +8107,14 @@ declare module dojo { * @param node id or reference to DOM Node to get/set box for * @param box OptionalIf passed, denotes that dojo.marginBox() shouldupdate/set the margin box for node. Box is an object in theabove format. All properties are optional if passed. */ - marginBox(node: String, box: Object): any; + marginBox(node: String, box?: Object): any; /** * Returns a URL relative to a module. * * @param module dojo/dom-class * @param url Optional */ - moduleUrl(module: String, url: String): String; + moduleUrl(module: String, url?: String): String; /** * Array-like object which adds syntactic * sugar for chaining, common iteration operations, animation, and @@ -8145,7 +8145,7 @@ declare module dojo { * @param refNode id or node reference to use as basis for placement * @param position Optionalstring noting the position of node relative to refNode or anumber indicating the location in the childNodes collection of refNode.Accepted string values are:beforeafterreplaceonlyfirstlast"first" and "last" indicate positions as children of refNode, "replace" replaces refNode,"only" replaces all children. position defaults to "last" if not specified */ - place(node: HTMLElement, refNode: HTMLElement, position: String): HTMLElement; + place(node: HTMLElement, refNode: HTMLElement, position?: String): HTMLElement; /** * Attempt to insert node into the DOM, choosing from various positioning options. * Returns the first argument resolved to a DOM node. @@ -8154,7 +8154,7 @@ declare module dojo { * @param refNode id or node reference to use as basis for placement * @param position Optionalstring noting the position of node relative to refNode or anumber indicating the location in the childNodes collection of refNode.Accepted string values are:beforeafterreplaceonlyfirstlast"first" and "last" indicate positions as children of refNode, "replace" replaces refNode,"only" replaces all children. position defaults to "last" if not specified */ - place(node: String, refNode: HTMLElement, position: String): HTMLElement; + place(node: String, refNode: HTMLElement, position?: String): HTMLElement; /** * Attempt to insert node into the DOM, choosing from various positioning options. * Returns the first argument resolved to a DOM node. @@ -8163,7 +8163,7 @@ declare module dojo { * @param refNode id or node reference to use as basis for placement * @param position Optionalstring noting the position of node relative to refNode or anumber indicating the location in the childNodes collection of refNode.Accepted string values are:beforeafterreplaceonlyfirstlast"first" and "last" indicate positions as children of refNode, "replace" replaces refNode,"only" replaces all children. position defaults to "last" if not specified */ - place(node: HTMLElement, refNode: String, position: String): HTMLElement; + place(node: HTMLElement, refNode: String, position?: String): HTMLElement; /** * Attempt to insert node into the DOM, choosing from various positioning options. * Returns the first argument resolved to a DOM node. @@ -8172,7 +8172,7 @@ declare module dojo { * @param refNode id or node reference to use as basis for placement * @param position Optionalstring noting the position of node relative to refNode or anumber indicating the location in the childNodes collection of refNode.Accepted string values are:beforeafterreplaceonlyfirstlast"first" and "last" indicate positions as children of refNode, "replace" replaces refNode,"only" replaces all children. position defaults to "last" if not specified */ - place(node: String, refNode: String, position: String): HTMLElement; + place(node: String, refNode: String, position?: String): HTMLElement; /** * Attempt to insert node into the DOM, choosing from various positioning options. * Returns the first argument resolved to a DOM node. @@ -8181,7 +8181,7 @@ declare module dojo { * @param refNode id or node reference to use as basis for placement * @param position Optionalstring noting the position of node relative to refNode or anumber indicating the location in the childNodes collection of refNode.Accepted string values are:beforeafterreplaceonlyfirstlast"first" and "last" indicate positions as children of refNode, "replace" replaces refNode,"only" replaces all children. position defaults to "last" if not specified */ - place(node: HTMLElement, refNode: HTMLElement, position: number): HTMLElement; + place(node: HTMLElement, refNode: HTMLElement, position?: number): HTMLElement; /** * Attempt to insert node into the DOM, choosing from various positioning options. * Returns the first argument resolved to a DOM node. @@ -8190,7 +8190,7 @@ declare module dojo { * @param refNode id or node reference to use as basis for placement * @param position Optionalstring noting the position of node relative to refNode or anumber indicating the location in the childNodes collection of refNode.Accepted string values are:beforeafterreplaceonlyfirstlast"first" and "last" indicate positions as children of refNode, "replace" replaces refNode,"only" replaces all children. position defaults to "last" if not specified */ - place(node: String, refNode: HTMLElement, position: number): HTMLElement; + place(node: String, refNode: HTMLElement, position?: number): HTMLElement; /** * Attempt to insert node into the DOM, choosing from various positioning options. * Returns the first argument resolved to a DOM node. @@ -8199,7 +8199,7 @@ declare module dojo { * @param refNode id or node reference to use as basis for placement * @param position Optionalstring noting the position of node relative to refNode or anumber indicating the location in the childNodes collection of refNode.Accepted string values are:beforeafterreplaceonlyfirstlast"first" and "last" indicate positions as children of refNode, "replace" replaces refNode,"only" replaces all children. position defaults to "last" if not specified */ - place(node: HTMLElement, refNode: String, position: number): HTMLElement; + place(node: HTMLElement, refNode: String, position?: number): HTMLElement; /** * Attempt to insert node into the DOM, choosing from various positioning options. * Returns the first argument resolved to a DOM node. @@ -8208,7 +8208,7 @@ declare module dojo { * @param refNode id or node reference to use as basis for placement * @param position Optionalstring noting the position of node relative to refNode or anumber indicating the location in the childNodes collection of refNode.Accepted string values are:beforeafterreplaceonlyfirstlast"first" and "last" indicate positions as children of refNode, "replace" replaces refNode,"only" replaces all children. position defaults to "last" if not specified */ - place(node: String, refNode: String, position: number): HTMLElement; + place(node: String, refNode: String, position?: number): HTMLElement; /** * require one or more modules based on which host environment * Dojo is currently operating in @@ -8247,7 +8247,7 @@ declare module dojo { * @param node * @param includeScroll Optional */ - position(node: HTMLElement, includeScroll: boolean): Object; + position(node: HTMLElement, includeScroll?: boolean): Object; /** * Gets the position and size of the passed element relative to * the viewport (if includeScroll==false), or relative to the @@ -8263,7 +8263,7 @@ declare module dojo { * @param node * @param includeScroll Optional */ - position(node: String, includeScroll: boolean): Object; + position(node: String, includeScroll?: boolean): Object; /** * Gets or sets a property on an HTML element. * Handles normalized getting and setting of properties on DOM @@ -8287,7 +8287,7 @@ declare module dojo { * @param name the name of the property to get or set. * @param value OptionalThe value to set for the property */ - prop(node: HTMLElement, name: String, value: String): any; + prop(node: HTMLElement, name: String, value?: String): any; /** * Gets or sets a property on an HTML element. * Handles normalized getting and setting of properties on DOM @@ -8311,7 +8311,7 @@ declare module dojo { * @param name the name of the property to get or set. * @param value OptionalThe value to set for the property */ - prop(node: String, name: String, value: String): any; + prop(node: String, name: String, value?: String): any; /** * Gets or sets a property on an HTML element. * Handles normalized getting and setting of properties on DOM @@ -8335,7 +8335,7 @@ declare module dojo { * @param name the name of the property to get or set. * @param value OptionalThe value to set for the property */ - prop(node: HTMLElement, name: Object, value: String): any; + prop(node: HTMLElement, name: Object, value?: String): any; /** * Gets or sets a property on an HTML element. * Handles normalized getting and setting of properties on DOM @@ -8359,7 +8359,7 @@ declare module dojo { * @param name the name of the property to get or set. * @param value OptionalThe value to set for the property */ - prop(node: String, name: Object, value: String): any; + prop(node: String, name: Object, value?: String): any; /** * * @param mid @@ -8389,7 +8389,7 @@ declare module dojo { * @param g OptionalThe global context. If a string, the id of the frame tosearch for a context and document. * @param d OptionalThe document element to execute subsequent code with. */ - pushContext(g: Object, d: HTMLDocument): void; + pushContext(g?: Object, d?: HTMLDocument): void; /** * causes subsequent calls to Dojo methods to assume the * passed object and, optionally, document as the default @@ -8414,7 +8414,7 @@ declare module dojo { * @param g OptionalThe global context. If a string, the id of the frame tosearch for a context and document. * @param d OptionalThe document element to execute subsequent code with. */ - pushContext(g: String, d: HTMLDocument): void; + pushContext(g?: String, d?: HTMLDocument): void; /** * Create an object representing a de-serialized query section of a * URL. Query keys with multiple values are returned in an array. @@ -8447,7 +8447,7 @@ declare module dojo { * @param context The context in which to run execute callback, or a callback if not using context * @param callback OptionalThe function to execute. */ - ready(priority: number, context: any, callback: Function): void; + ready(priority: number, context: any, callback?: Function): void; /** * Maps a module name to a path * An unregistered module is given the default path of ../[module], @@ -8480,7 +8480,7 @@ declare module dojo { * @param node String ID or DomNode reference to remove the class from. * @param classStr OptionalAn optional String class name to remove, or several space-separatedclass names, or an array of class names. If omitted, all class nameswill be deleted. */ - removeClass(node: String, classStr: String): void; + removeClass(node: String, classStr?: String): void; /** * Removes the specified classes from node. No contains() * check is required. @@ -8488,7 +8488,7 @@ declare module dojo { * @param node String ID or DomNode reference to remove the class from. * @param classStr OptionalAn optional String class name to remove, or several space-separatedclass names, or an array of class names. If omitted, all class nameswill be deleted. */ - removeClass(node: HTMLElement, classStr: String): void; + removeClass(node: HTMLElement, classStr?: String): void; /** * Removes the specified classes from node. No contains() * check is required. @@ -8496,7 +8496,7 @@ declare module dojo { * @param node String ID or DomNode reference to remove the class from. * @param classStr OptionalAn optional String class name to remove, or several space-separatedclass names, or an array of class names. If omitted, all class nameswill be deleted. */ - removeClass(node: String, classStr: any[]): void; + removeClass(node: String, classStr?: any[]): void; /** * Removes the specified classes from node. No contains() * check is required. @@ -8504,7 +8504,7 @@ declare module dojo { * @param node String ID or DomNode reference to remove the class from. * @param classStr OptionalAn optional String class name to remove, or several space-separatedclass names, or an array of class names. If omitted, all class nameswill be deleted. */ - removeClass(node: HTMLElement, classStr: any[]): void; + removeClass(node: HTMLElement, classStr?: any[]): void; /** * Replaces one or more classes on a node if not present. * Operates more quickly than calling dojo.removeClass and dojo.addClass @@ -8513,7 +8513,7 @@ declare module dojo { * @param addClassStr A String class name to add, or several space-separated class names,or an array of class names. * @param removeClassStr OptionalA String class name to remove, or several space-separated class names,or an array of class names. */ - replaceClass(node: String, addClassStr: String, removeClassStr: String): void; + replaceClass(node: String, addClassStr: String, removeClassStr?: String): void; /** * Replaces one or more classes on a node if not present. * Operates more quickly than calling dojo.removeClass and dojo.addClass @@ -8522,7 +8522,7 @@ declare module dojo { * @param addClassStr A String class name to add, or several space-separated class names,or an array of class names. * @param removeClassStr OptionalA String class name to remove, or several space-separated class names,or an array of class names. */ - replaceClass(node: HTMLElement, addClassStr: String, removeClassStr: String): void; + replaceClass(node: HTMLElement, addClassStr: String, removeClassStr?: String): void; /** * Replaces one or more classes on a node if not present. * Operates more quickly than calling dojo.removeClass and dojo.addClass @@ -8531,7 +8531,7 @@ declare module dojo { * @param addClassStr A String class name to add, or several space-separated class names,or an array of class names. * @param removeClassStr OptionalA String class name to remove, or several space-separated class names,or an array of class names. */ - replaceClass(node: String, addClassStr: any[], removeClassStr: String): void; + replaceClass(node: String, addClassStr: any[], removeClassStr?: String): void; /** * Replaces one or more classes on a node if not present. * Operates more quickly than calling dojo.removeClass and dojo.addClass @@ -8540,7 +8540,7 @@ declare module dojo { * @param addClassStr A String class name to add, or several space-separated class names,or an array of class names. * @param removeClassStr OptionalA String class name to remove, or several space-separated class names,or an array of class names. */ - replaceClass(node: HTMLElement, addClassStr: any[], removeClassStr: String): void; + replaceClass(node: HTMLElement, addClassStr: any[], removeClassStr?: String): void; /** * Replaces one or more classes on a node if not present. * Operates more quickly than calling dojo.removeClass and dojo.addClass @@ -8549,7 +8549,7 @@ declare module dojo { * @param addClassStr A String class name to add, or several space-separated class names,or an array of class names. * @param removeClassStr OptionalA String class name to remove, or several space-separated class names,or an array of class names. */ - replaceClass(node: String, addClassStr: String, removeClassStr: any[]): void; + replaceClass(node: String, addClassStr: String, removeClassStr?: any[]): void; /** * Replaces one or more classes on a node if not present. * Operates more quickly than calling dojo.removeClass and dojo.addClass @@ -8558,7 +8558,7 @@ declare module dojo { * @param addClassStr A String class name to add, or several space-separated class names,or an array of class names. * @param removeClassStr OptionalA String class name to remove, or several space-separated class names,or an array of class names. */ - replaceClass(node: HTMLElement, addClassStr: String, removeClassStr: any[]): void; + replaceClass(node: HTMLElement, addClassStr: String, removeClassStr?: any[]): void; /** * Replaces one or more classes on a node if not present. * Operates more quickly than calling dojo.removeClass and dojo.addClass @@ -8567,7 +8567,7 @@ declare module dojo { * @param addClassStr A String class name to add, or several space-separated class names,or an array of class names. * @param removeClassStr OptionalA String class name to remove, or several space-separated class names,or an array of class names. */ - replaceClass(node: String, addClassStr: any[], removeClassStr: any[]): void; + replaceClass(node: String, addClassStr: any[], removeClassStr?: any[]): void; /** * Replaces one or more classes on a node if not present. * Operates more quickly than calling dojo.removeClass and dojo.addClass @@ -8576,7 +8576,7 @@ declare module dojo { * @param addClassStr A String class name to add, or several space-separated class names,or an array of class names. * @param removeClassStr OptionalA String class name to remove, or several space-separated class names,or an array of class names. */ - replaceClass(node: HTMLElement, addClassStr: any[], removeClassStr: any[]): void; + replaceClass(node: HTMLElement, addClassStr: any[], removeClassStr?: any[]): void; /** * loads a Javascript module from the appropriate URI * Modules are loaded via dojo.require by using one of two loaders: the normal loader @@ -8640,7 +8640,7 @@ declare module dojo { * @param moduleName * @param omitModuleCheck Optional */ - requireAfterIf(condition: boolean, moduleName: String, omitModuleCheck: boolean): void; + requireAfterIf(condition: boolean, moduleName: String, omitModuleCheck?: boolean): void; /** * If the condition is true then call dojo.require() for the specified * resource @@ -8649,14 +8649,14 @@ declare module dojo { * @param moduleName * @param omitModuleCheck Optional */ - requireIf(condition: boolean, moduleName: String, omitModuleCheck: boolean): void; + requireIf(condition: boolean, moduleName: String, omitModuleCheck?: boolean): void; /** * * @param moduleName * @param bundleName * @param locale Optional */ - requireLocalization(moduleName: String, bundleName: String, locale: String): void; + requireLocalization(moduleName: String, bundleName: String, locale?: String): void; /** * Mix in properties skipping a constructor and decorating functions * like it is done by declare(). @@ -8693,7 +8693,7 @@ declare module dojo { * @param name the name of the attribute to set, or a hash of key-value pairs to set. * @param value Optionalthe value to set for the attribute, if the name is a string. */ - setAttr(node: HTMLElement, name: String, value: String): any; + setAttr(node: HTMLElement, name: String, value?: String): any; /** * Sets an attribute on an HTML element. * Handles normalized setting of attributes on DOM Nodes. @@ -8712,7 +8712,7 @@ declare module dojo { * @param name the name of the attribute to set, or a hash of key-value pairs to set. * @param value Optionalthe value to set for the attribute, if the name is a string. */ - setAttr(node: String, name: String, value: String): any; + setAttr(node: String, name: String, value?: String): any; /** * Sets an attribute on an HTML element. * Handles normalized setting of attributes on DOM Nodes. @@ -8731,7 +8731,7 @@ declare module dojo { * @param name the name of the attribute to set, or a hash of key-value pairs to set. * @param value Optionalthe value to set for the attribute, if the name is a string. */ - setAttr(node: HTMLElement, name: Object, value: String): any; + setAttr(node: HTMLElement, name: Object, value?: String): any; /** * Sets an attribute on an HTML element. * Handles normalized setting of attributes on DOM Nodes. @@ -8750,7 +8750,7 @@ declare module dojo { * @param name the name of the attribute to set, or a hash of key-value pairs to set. * @param value Optionalthe value to set for the attribute, if the name is a string. */ - setAttr(node: String, name: Object, value: String): any; + setAttr(node: String, name: Object, value?: String): any; /** * Sets the size of the node's contents, irrespective of margins, * padding, or borders. @@ -8759,7 +8759,7 @@ declare module dojo { * @param box hash with optional "w", and "h" properties for "width", and "height"respectively. All specified properties should have numeric values in whole pixels. * @param computedStyle OptionalThis parameter accepts computed styles object.If this parameter is omitted, the functions will calldojo/dom-style.getComputedStyle to get one. It is a better way, callingdojo/dom-style.getComputedStyle once, and then pass the reference to thiscomputedStyle parameter. Wherever possible, reuse the returnedobject of dojo/dom-style.getComputedStyle(). */ - setContentSize(node: HTMLElement, box: Object, computedStyle: Object): void; + setContentSize(node: HTMLElement, box: Object, computedStyle?: Object): void; /** * changes the behavior of many core Dojo functions that deal with * namespace and DOM lookup, changing them to work in a new global @@ -8781,7 +8781,7 @@ declare module dojo { * @param box hash with optional "l", "t", "w", and "h" properties for "left", "right", "width", and "height"respectively. All specified properties should have numeric values in whole pixels. * @param computedStyle OptionalThis parameter accepts computed styles object.If this parameter is omitted, the functions will calldojo/dom-style.getComputedStyle to get one. It is a better way, callingdojo/dom-style.getComputedStyle once, and then pass the reference to thiscomputedStyle parameter. Wherever possible, reuse the returnedobject of dojo/dom-style.getComputedStyle(). */ - setMarginBox(node: HTMLElement, box: Object, computedStyle: Object): void; + setMarginBox(node: HTMLElement, box: Object, computedStyle?: Object): void; /** * Sets a property on an HTML element. * Handles normalized setting of properties on DOM nodes. @@ -8800,7 +8800,7 @@ declare module dojo { * @param name the name of the property to set, or a hash object to setmultiple properties at once. * @param value OptionalThe value to set for the property */ - setProp(node: HTMLElement, name: String, value: String): any; + setProp(node: HTMLElement, name: String, value?: String): any; /** * Sets a property on an HTML element. * Handles normalized setting of properties on DOM nodes. @@ -8819,7 +8819,7 @@ declare module dojo { * @param name the name of the property to set, or a hash object to setmultiple properties at once. * @param value OptionalThe value to set for the property */ - setProp(node: String, name: String, value: String): any; + setProp(node: String, name: String, value?: String): any; /** * Sets a property on an HTML element. * Handles normalized setting of properties on DOM nodes. @@ -8838,7 +8838,7 @@ declare module dojo { * @param name the name of the property to set, or a hash object to setmultiple properties at once. * @param value OptionalThe value to set for the property */ - setProp(node: HTMLElement, name: Object, value: String): any; + setProp(node: HTMLElement, name: Object, value?: String): any; /** * Sets a property on an HTML element. * Handles normalized setting of properties on DOM nodes. @@ -8857,7 +8857,7 @@ declare module dojo { * @param name the name of the property to set, or a hash object to setmultiple properties at once. * @param value OptionalThe value to set for the property */ - setProp(node: String, name: Object, value: String): any; + setProp(node: String, name: Object, value?: String): any; /** * * @param node @@ -8871,7 +8871,7 @@ declare module dojo { * @param name the style property to set in DOM-accessor format("borderWidth", not "border-width") or an object with key/valuepairs suitable for setting each property. * @param value OptionalIf passed, sets value on the node for style, handlingcross-browser concerns. When setting a pixel value,be sure to include "px" in the value. For instance, top: "200px".Otherwise, in some cases, some browsers will not apply the style. */ - setStyle(node: HTMLElement, name: String, value: String): String; + setStyle(node: HTMLElement, name: String, value?: String): String; /** * Sets styles on a node. * @@ -8879,7 +8879,7 @@ declare module dojo { * @param name the style property to set in DOM-accessor format("borderWidth", not "border-width") or an object with key/valuepairs suitable for setting each property. * @param value OptionalIf passed, sets value on the node for style, handlingcross-browser concerns. When setting a pixel value,be sure to include "px" in the value. For instance, top: "200px".Otherwise, in some cases, some browsers will not apply the style. */ - setStyle(node: String, name: String, value: String): String; + setStyle(node: String, name: String, value?: String): String; /** * Sets styles on a node. * @@ -8887,7 +8887,7 @@ declare module dojo { * @param name the style property to set in DOM-accessor format("borderWidth", not "border-width") or an object with key/valuepairs suitable for setting each property. * @param value OptionalIf passed, sets value on the node for style, handlingcross-browser concerns. When setting a pixel value,be sure to include "px" in the value. For instance, top: "200px".Otherwise, in some cases, some browsers will not apply the style. */ - setStyle(node: HTMLElement, name: Object, value: String): String; + setStyle(node: HTMLElement, name: Object, value?: String): String; /** * Sets styles on a node. * @@ -8895,7 +8895,7 @@ declare module dojo { * @param name the style property to set in DOM-accessor format("borderWidth", not "border-width") or an object with key/valuepairs suitable for setting each property. * @param value OptionalIf passed, sets value on the node for style, handlingcross-browser concerns. When setting a pixel value,be sure to include "px" in the value. For instance, top: "200px".Otherwise, in some cases, some browsers will not apply the style. */ - setStyle(node: String, name: Object, value: String): String; + setStyle(node: String, name: Object, value?: String): String; /** * Determines whether or not any item in arr satisfies the * condition implemented by callback. @@ -8909,7 +8909,7 @@ declare module dojo { * @param callback a function is invoked with three arguments: item, index,and array and returns true if the condition is met. * @param thisObject Optionalmay be used to scope the call to callback */ - some(arr: any[], callback: Function, thisObject: Object): boolean; + some(arr: any[], callback: Function, thisObject?: Object): boolean; /** * Determines whether or not any item in arr satisfies the * condition implemented by callback. @@ -8923,7 +8923,7 @@ declare module dojo { * @param callback a function is invoked with three arguments: item, index,and array and returns true if the condition is met. * @param thisObject Optionalmay be used to scope the call to callback */ - some(arr: String, callback: Function, thisObject: Object): boolean; + some(arr: String, callback: Function, thisObject?: Object): boolean; /** * Determines whether or not any item in arr satisfies the * condition implemented by callback. @@ -8937,7 +8937,7 @@ declare module dojo { * @param callback a function is invoked with three arguments: item, index,and array and returns true if the condition is met. * @param thisObject Optionalmay be used to scope the call to callback */ - some(arr: any[], callback: String, thisObject: Object): boolean; + some(arr: any[], callback: String, thisObject?: Object): boolean; /** * Determines whether or not any item in arr satisfies the * condition implemented by callback. @@ -8951,7 +8951,7 @@ declare module dojo { * @param callback a function is invoked with three arguments: item, index,and array and returns true if the condition is met. * @param thisObject Optionalmay be used to scope the call to callback */ - some(arr: String, callback: String, thisObject: Object): boolean; + some(arr: String, callback: String, thisObject?: Object): boolean; /** * */ @@ -8979,7 +8979,7 @@ declare module dojo { * @param name Optionalthe style property to set in DOM-accessor format("borderWidth", not "border-width") or an object with key/valuepairs suitable for setting each property. * @param value OptionalIf passed, sets value on the node for style, handlingcross-browser concerns. When setting a pixel value,be sure to include "px" in the value. For instance, top: "200px".Otherwise, in some cases, some browsers will not apply the style. */ - style(node: HTMLElement, name: String, value: String): any; + style(node: HTMLElement, name?: String, value?: String): any; /** * Accesses styles on a node. If 2 arguments are * passed, acts as a getter. If 3 arguments are passed, acts @@ -8996,7 +8996,7 @@ declare module dojo { * @param name Optionalthe style property to set in DOM-accessor format("borderWidth", not "border-width") or an object with key/valuepairs suitable for setting each property. * @param value OptionalIf passed, sets value on the node for style, handlingcross-browser concerns. When setting a pixel value,be sure to include "px" in the value. For instance, top: "200px".Otherwise, in some cases, some browsers will not apply the style. */ - style(node: String, name: String, value: String): any; + style(node: String, name?: String, value?: String): any; /** * Accesses styles on a node. If 2 arguments are * passed, acts as a getter. If 3 arguments are passed, acts @@ -9013,7 +9013,7 @@ declare module dojo { * @param name Optionalthe style property to set in DOM-accessor format("borderWidth", not "border-width") or an object with key/valuepairs suitable for setting each property. * @param value OptionalIf passed, sets value on the node for style, handlingcross-browser concerns. When setting a pixel value,be sure to include "px" in the value. For instance, top: "200px".Otherwise, in some cases, some browsers will not apply the style. */ - style(node: HTMLElement, name: Object, value: String): any; + style(node: HTMLElement, name?: Object, value?: String): any; /** * Accesses styles on a node. If 2 arguments are * passed, acts as a getter. If 3 arguments are passed, acts @@ -9030,14 +9030,14 @@ declare module dojo { * @param name Optionalthe style property to set in DOM-accessor format("borderWidth", not "border-width") or an object with key/valuepairs suitable for setting each property. * @param value OptionalIf passed, sets value on the node for style, handlingcross-browser concerns. When setting a pixel value,be sure to include "px" in the value. For instance, top: "200px".Otherwise, in some cases, some browsers will not apply the style. */ - style(node: String, name: Object, value: String): any; + style(node: String, name?: Object, value?: String): any; /** * instantiates an HTML fragment returning the corresponding DOM. * * @param frag the HTML fragment * @param doc Optionaloptional document to use when creating DOM nodes, defaults todojo/_base/window.doc if not specified. */ - toDom(frag: String, doc: HTMLDocument): any; + toDom(frag: String, doc?: HTMLDocument): any; /** * Adds a class to node if not present, or removes if present. * Pass a boolean condition if you want to explicitly add or remove. @@ -9089,7 +9089,7 @@ declare module dojo { * @param it an object to be serialized. Objects may define their ownserialization via a special "json" or "json" functionproperty. If a specialized serializer has been defined, it willbe used as a fallback.Note that in 1.6, toJson would serialize undefined, but this no longer supportedsince it is not supported by native JSON serializer. * @param prettyPrint Optionalif true, we indent objects and arrays to make the output prettier.The variable dojo.toJsonIndentStr is used as the indent string --to use something other than the default (tab), change that variablebefore calling dojo.toJson().Note that if native JSON support is available, it will be used for serialization,and native implementations vary on the exact spacing used in pretty printing. */ - toJson(it: Object, prettyPrint: boolean): any; + toJson(it: Object, prettyPrint?: boolean): any; /** * converts style value to pixels on IE or return a numeric value. * @@ -9119,7 +9119,7 @@ declare module dojo { * @param errback OptionalCallback to be invoked when the promise is rejected. * @param progback OptionalCallback to be invoked when the promise emits a progress update. */ - when(valueOrPromise: any, callback: Function, errback: Function, progback: Function): dojo.promise.Promise; + when(valueOrPromise: any, callback?: Function, errback?: Function, progback?: Function): dojo.promise.Promise; /** * signal fired by impending window destruction. You may use * dojo.addOnWIndowUnload() or dojo.connect() to this method to perform @@ -9139,7 +9139,7 @@ declare module dojo { * @param thisObject Optional * @param cbArguments Optional */ - withDoc(documentObject: HTMLDocument, callback: Function, thisObject: Object, cbArguments: any[]): any; + withDoc(documentObject: HTMLDocument, callback: Function, thisObject?: Object, cbArguments?: any[]): any; /** * Invoke callback with globalObject as dojo.global and * globalObject.document as dojo.doc. @@ -9154,7 +9154,7 @@ declare module dojo { * @param thisObject Optional * @param cbArguments Optional */ - withGlobal(globalObject: Object, callback: Function, thisObject: Object, cbArguments: any[]): any; + withGlobal(globalObject: Object, callback: Function, thisObject?: Object, cbArguments?: any[]): any; /** * * @param method @@ -9545,7 +9545,7 @@ declare module dojo { * * @param params Optional */ - postscript(params: Object): void; + postscript(params?: Object): void; /** * Set a property on a Stateful instance * Sets named properties on a stateful object and notifies any watchers of @@ -9787,7 +9787,7 @@ declare module dojo { * @param g * @param a Optional */ - makeGrey(g: number, a: number): void; + makeGrey(g: number, a?: number): void; } /** * Permalink: http://dojotoolkit.org/api/1.9/dojo/_base/kernel.config.html @@ -10109,7 +10109,7 @@ declare module dojo { * @param date2 OptionalDate object. If not specified, the current Date is used. * @param portion OptionalA string indicating the "date" or "time" portion of a Date object.Compares both "date" and "time" by default. One of the following:"date", "time", "datetime" */ - compare(date1: Date, date2: Date, portion: String): number; + compare(date1: Date, date2?: Date, portion?: String): number; /** * Get the difference in a specific unit of time (e.g., number of * months, weeks, days, etc.) between two dates, rounded to the @@ -10119,7 +10119,7 @@ declare module dojo { * @param date2 OptionalDate object. If not specified, the current Date is used. * @param interval OptionalA string representing the interval. One of the following:"year", "month", "day", "hour", "minute", "second","millisecond", "quarter", "week", "weekday"Defaults to "day". */ - difference(date1: Date, date2: Date, interval: String): any; + difference(date1: Date, date2?: Date, interval?: String): any; /** * Returns the number of days in the month used by dateObject * @@ -10224,7 +10224,7 @@ declare module dojo { * @param expression * @param options OptionalAn object with the following properties:type (String, optional): Should not be set. Value is assumed to be currency.currency (String, optional): an ISO4217 currency code, a three letter sequence like "USD".For use with dojo.currency only.symbol (String, optional): localized currency symbol. The default will be looked up in table of supported currencies in dojo.cldrA ISO4217 currency code will be used if not found.places (Number, optional): fixed number of decimal places to accept. The default is determined based on which currency is used.fractional (Boolean|Array, optional): Whether to include the fractional portion, where the number of decimal places are implied by the currencyor explicit 'places' parameter. The value [true,false] makes the fractional portion optional.By default for currencies, it the fractional portion is optional.pattern (String, optional): override formatting patternwith this string. Default value is based on locale. Overriding this property will defeatlocalization. Literal characters in patterns are not supported.locale (String, optional): override the locale used to determine formatting rulesstrict (Boolean, optional): strict parsing, false by default. Strict parsing requires input as produced by the format() method.Non-strict is more permissive, e.g. flexible on white space, omitting thousands separators */ - parse(expression: String, options: Object): any; + parse(expression: String, options?: Object): any; /** * * @param options OptionalAn object with the following properties:pattern (String, optional): override formatting patternwith this string. Default value is based on locale. Overriding this property will defeatlocalization.type (String, optional): choose a format type based on the locale from the following:decimal, scientific (not yet supported), percent, currency. decimal by default.locale (String, optional): override the locale used to determine formatting rulesstrict (Boolean, optional): strict parsing, false by default. Strict parsing requires input as produced by the format() method.Non-strict is more permissive, e.g. flexible on white space, omitting thousands separatorsplaces (Number|String, optional): number of decimal places to accept: Infinity, a positive number, ora range "n,m". Defined by pattern or Infinity if pattern not provided. @@ -10516,7 +10516,7 @@ declare module dojo { * @param cont the content to be set on the parent element.This can be an html string, a node reference or a NodeList, dojo/NodeList, Array or other enumerable list of nodes * @param params OptionalOptional flags/properties to configure the content-setting. See dojo/html/_ContentSetter */ - set(node: HTMLElement, cont: String, params: Object): any; + set(node: HTMLElement, cont: String, params?: Object): any; /** * inserts (replaces) the given content into the given node. dojo/dom-construct.place(cont, node, "only") * may be a better choice for simple HTML insertion. @@ -10533,7 +10533,7 @@ declare module dojo { * @param cont the content to be set on the parent element.This can be an html string, a node reference or a NodeList, dojo/NodeList, Array or other enumerable list of nodes * @param params OptionalOptional flags/properties to configure the content-setting. See dojo/html/_ContentSetter */ - set(node: HTMLElement, cont: HTMLElement, params: Object): any; + set(node: HTMLElement, cont: HTMLElement, params?: Object): any; /** * inserts (replaces) the given content into the given node. dojo/dom-construct.place(cont, node, "only") * may be a better choice for simple HTML insertion. @@ -10550,7 +10550,7 @@ declare module dojo { * @param cont the content to be set on the parent element.This can be an html string, a node reference or a NodeList, dojo/NodeList, Array or other enumerable list of nodes * @param params OptionalOptional flags/properties to configure the content-setting. See dojo/html/_ContentSetter */ - set(node: HTMLElement, cont: NodeList, params: Object): any; + set(node: HTMLElement, cont: NodeList, params?: Object): any; } /** * Permalink: http://dojotoolkit.org/api/1.9/dojo/_base/kernel.io.html @@ -11081,7 +11081,7 @@ declare module dojo { * @param re A function. Takes one parameter and converts it to a regularexpression. * @param nonCapture OptionalIf true, uses non-capturing match, otherwise matches are retainedby regular expression. Defaults to false */ - buildGroupRE(arr: Object, re: Function, nonCapture: boolean): any; + buildGroupRE(arr: Object, re: Function, nonCapture?: boolean): any; /** * Builds a regular expression that groups subexpressions * A utility function used by some of the RE generators. The @@ -11094,21 +11094,21 @@ declare module dojo { * @param re A function. Takes one parameter and converts it to a regularexpression. * @param nonCapture OptionalIf true, uses non-capturing match, otherwise matches are retainedby regular expression. Defaults to false */ - buildGroupRE(arr: any[], re: Function, nonCapture: boolean): any; + buildGroupRE(arr: any[], re: Function, nonCapture?: boolean): any; /** * Adds escape sequences for special characters in regular expressions * * @param str * @param except Optionala String with special characters to be left unescaped */ - escapeString(str: String, except: String): any; + escapeString(str: String, except?: String): any; /** * adds group match to expression * * @param expression * @param nonCapture OptionalIf true, uses non-capturing match, otherwise matches are retainedby regular expression. */ - group(expression: String, nonCapture: boolean): String; + group(expression: String, nonCapture?: boolean): String; } /** * Permalink: http://dojotoolkit.org/api/1.9/dojo/_base/kernel.number.html @@ -11128,7 +11128,7 @@ declare module dojo { * @param value the number to be formatted * @param options OptionalAn object with the following properties:pattern (String, optional): override formatting patternwith this string. Default value is based on locale. Overriding this property will defeatlocalization. Literal characters in patterns are not supported.type (String, optional): choose a format type based on the locale from the following:decimal, scientific (not yet supported), percent, currency. decimal by default.places (Number, optional): fixed number of decimal places to show. This overrides anyinformation in the provided pattern.round (Number, optional): 5 rounds to nearest .5; 0 rounds to nearest whole (default). -1means do not round.locale (String, optional): override the locale used to determine formatting rulesfractional (Boolean, optional): If false, show no decimal places, overriding places and pattern settings. */ - format(value: number, options: Object): any; + format(value: number, options?: Object): any; /** * Convert a properly formatted string to a primitive Number, using * locale-specific settings. @@ -11141,7 +11141,7 @@ declare module dojo { * @param expression A string representation of a Number * @param options OptionalAn object with the following properties:pattern (String, optional): override formatting patternwith this string. Default value is based on locale. Overriding this property will defeatlocalization. Literal characters in patterns are not supported.type (String, optional): choose a format type based on the locale from the following:decimal, scientific (not yet supported), percent, currency. decimal by default.locale (String, optional): override the locale used to determine formatting rulesstrict (Boolean, optional): strict parsing, false by default. Strict parsing requires input as produced by the format() method.Non-strict is more permissive, e.g. flexible on white space, omitting thousands separatorsfractional (Boolean|Array, optional): Whether to include the fractional portion, where the number of decimal places are implied by patternor explicit 'places' parameter. The value [true,false] makes the fractional portion optional. */ - parse(expression: String, options: Object): number; + parse(expression: String, options?: Object): number; /** * Builds the regular needed to parse a number * Returns regular expression with positive and negative match, group @@ -11161,7 +11161,7 @@ declare module dojo { * @param places OptionalThe number of decimal places where rounding takes place. Defaults to 0 for whole rounding.Must be non-negative. * @param increment OptionalRounds next place to nearest value of increment/10. 10 by default. */ - round(value: number, places: number, increment: number): number; + round(value: number, places?: number, increment?: number): number; } /** * Permalink: http://dojotoolkit.org/api/1.9/dojo/_base/kernel.scopeMap.html @@ -11511,7 +11511,7 @@ declare module dojo { * @param ch Optionalcharacter to pad, defaults to '0' * @param end Optionaladds padding at the end if true, otherwise pads at start */ - pad(text: String, size: number, ch: String, end: boolean): number; + pad(text: String, size: number, ch?: String, end?: boolean): number; /** * Efficiently replicate a string n times. * @@ -11528,7 +11528,7 @@ declare module dojo { * @param transform Optionala function to process all parameters before substitution takesplace, e.g. mylib.encodeXML * @param thisObject Optionalwhere to look for optional format function; default to the globalnamespace */ - substitute(template: String, map: Object, transform: Function, thisObject: Object): any; + substitute(template: String, map: Object, transform?: Function, thisObject?: Object): any; /** * Performs parameterized substitutions on a string. Throws an * exception if any parameter is unmatched. @@ -11538,7 +11538,7 @@ declare module dojo { * @param transform Optionala function to process all parameters before substitution takesplace, e.g. mylib.encodeXML * @param thisObject Optionalwhere to look for optional format function; default to the globalnamespace */ - substitute(template: String, map: any[], transform: Function, thisObject: Object): any; + substitute(template: String, map: any[], transform?: Function, thisObject?: Object): any; /** * Trims whitespace from both sides of the string * This version of trim() was taken from Steven Levithan's blog. @@ -11677,14 +11677,14 @@ declare module dojo { * * @param doc Optional */ - getBox(doc: HTMLDocument): Object; + getBox(doc?: HTMLDocument): Object; /** * Scroll the passed node into view using minimal movement, if it is not already. * * @param node * @param pos Optional */ - scrollIntoView(node: HTMLElement, pos: Object): void; + scrollIntoView(node: HTMLElement, pos?: Object): void; } } @@ -11725,7 +11725,7 @@ declare module dojo { * * @param locale Optional */ - getFirstDayOfWeek(locale: String): number; + getFirstDayOfWeek(locale?: String): number; /** * Returns a hash containing the start and end days of the weekend * Returns a hash containing the start and end days of the weekend according to local custom using locale, @@ -11734,7 +11734,7 @@ declare module dojo { * * @param locale Optional */ - getWeekend(locale: String): Object; + getWeekend(locale?: String): Object; } } @@ -11804,13 +11804,13 @@ declare module dojo { * * @param request Optional */ - close(request: dojo.data.api.Request ): void; + close(request?: dojo.data.api.Request ): void; /** * See dojo/data/api/Read.close() * * @param request Optional */ - close(request: Object): void; + close(request?: Object): void; /** * See dojo/data/api/Read.containsValue() * @@ -11927,7 +11927,7 @@ declare module dojo { * @param attribute * @param defaultValue Optional */ - getValue(item: dojo.data.api.Item, attribute: String, defaultValue: any): any; + getValue(item: dojo.data.api.Item, attribute: String, defaultValue?: any): any; /** * See dojo/data/api/Read.getValues() * @@ -12079,7 +12079,7 @@ declare module dojo { * @param property property to look up value for * @param defaultValue Optionalthe default value */ - getValue(item: Object, property: String, defaultValue: any): any; + getValue(item: Object, property: String, defaultValue?: any): any; /** * Gets the value of an item's 'property' and returns * it. If this value is an array it is just returned, @@ -12260,7 +12260,7 @@ declare module dojo { * * @param request Optional */ - close(request: Object): void; + close(request?: Object): void; /** * See dojo/data/api/Read.containsValue() * @@ -12383,7 +12383,7 @@ declare module dojo { * @param attribute * @param defaultValue Optional */ - getValue(item: dojo.data.api.Item, attribute: String, defaultValue: any): any; + getValue(item: dojo.data.api.Item, attribute: String, defaultValue?: any): any; /** * See dojo/data/api/Read.getValues() * @@ -12403,7 +12403,7 @@ declare module dojo { * * @param item Optional */ - isDirty(item: any): any; + isDirty(item?: any): any; /** * See dojo/data/api/Read.isItem() * @@ -12428,7 +12428,7 @@ declare module dojo { * @param keywordArgs Optional * @param parentInfo Optional */ - newItem(keywordArgs: Object, parentInfo: Object): Object; + newItem(keywordArgs?: Object, parentInfo?: Object): Object; /** * * @param type @@ -12481,7 +12481,7 @@ declare module dojo { * @param newItem * @param parentInfo Optional */ - onNew(newItem: dojo.data.api.Item, parentInfo: Object): void; + onNew(newItem: dojo.data.api.Item, parentInfo?: Object): void; /** * See dojo/data/api/Notification.onSet() * @@ -12553,7 +12553,7 @@ declare module dojo { * * @param request OptionalAn instance of a request for the store to use to identify what to close out.If no request is passed, then the store should clear all internal caches (if any)and close out all 'open' connections. It does not render the store unusable fromthere on, it merely cleans out any current data and resets the store to initialstate. */ - close(request: dojo.data.api.Request ): void; + close(request?: dojo.data.api.Request ): void; /** * The close() method is intended for instructing the store to 'close' out * any information associated with a particular request. @@ -12566,7 +12566,7 @@ declare module dojo { * * @param request OptionalAn instance of a request for the store to use to identify what to close out.If no request is passed, then the store should clear all internal caches (if any)and close out all 'open' connections. It does not render the store unusable fromthere on, it merely cleans out any current data and resets the store to initialstate. */ - close(request: Object): void; + close(request?: Object): void; /** * Returns true if the given value is one of the values that getValues() * would return. @@ -12684,7 +12684,7 @@ declare module dojo { * @param attribute The attribute to access represented as a string. * @param defaultValue OptionalOptional. A default value to use for the getValue return in the attribute does not exist or has no value. */ - getValue(item: dojo.data.api.Item, attribute: String, defaultValue: any): any; + getValue(item: dojo.data.api.Item, attribute: String, defaultValue?: any): any; /** * This getValues() method works just like the getValue() method, but getValues() * always returns an array rather than a single attribute value. The array @@ -12794,7 +12794,7 @@ declare module dojo { * * @param request OptionalAn instance of a request for the store to use to identify what to close out.If no request is passed, then the store should clear all internal caches (if any)and close out all 'open' connections. It does not render the store unusable fromthere on, it merely cleans out any current data and resets the store to initialstate. */ - close(request: dojo.data.api.Request ): void; + close(request?: dojo.data.api.Request ): void; /** * The close() method is intended for instructing the store to 'close' out * any information associated with a particular request. @@ -12807,7 +12807,7 @@ declare module dojo { * * @param request OptionalAn instance of a request for the store to use to identify what to close out.If no request is passed, then the store should clear all internal caches (if any)and close out all 'open' connections. It does not render the store unusable fromthere on, it merely cleans out any current data and resets the store to initialstate. */ - close(request: Object): void; + close(request?: Object): void; /** * Returns true if the given value is one of the values that getValues() * would return. @@ -12894,7 +12894,7 @@ declare module dojo { * @param attribute The attribute to access represented as a string. * @param defaultValue OptionalOptional. A default value to use for the getValue return in the attribute does not exist or has no value. */ - getValue(item: dojo.data.api.Item, attribute: String, defaultValue: any): any; + getValue(item: dojo.data.api.Item, attribute: String, defaultValue?: any): any; /** * This getValues() method works just like the getValue() method, but getValues() * always returns an array rather than a single attribute value. The array @@ -12961,7 +12961,7 @@ declare module dojo { * @param newItem The item created. * @param parentInfo OptionalAn optional javascript object that is passed when the item created was placed in the storehierarchy as a value f another item's attribute, instead of a root level item. Note that if thisfunction is invoked with a value for parentInfo, then onSet is not invoked stating the attribute ofthe parent item was modified. This is to avoid getting two notification events occurring when a new itemwith a parent is created. The structure passed in is as follows:{ item: someItem, //The parent item attribute: "attribute-name-string", //The attribute the new item was assigned to. oldValue: something //Whatever was the previous value for the attribute. //If it is a single-value attribute only, then this value will be a single value. //If it was a multi-valued attribute, then this will be an array of all the values minus the new one. newValue: something //The new value of the attribute. In the case of single value calls, such as setValue, this value will be //generally be an atomic value of some sort (string, int, etc, object). In the case of multi-valued attributes, //it will be an array.} */ - onNew(newItem: dojo.data.api.Item, parentInfo: Object): any; + onNew(newItem: dojo.data.api.Item, parentInfo?: Object): any; /** * This function is called any time an item is modified via setValue, setValues, unsetAttribute, etc. * This function is called any time an item is modified via setValue, setValues, unsetAttribute, etc. @@ -13038,7 +13038,7 @@ declare module dojo { * * @param request OptionalAn instance of a request for the store to use to identify what to close out.If no request is passed, then the store should clear all internal caches (if any)and close out all 'open' connections. It does not render the store unusable fromthere on, it merely cleans out any current data and resets the store to initialstate. */ - close(request: dojo.data.api.Request ): void; + close(request?: dojo.data.api.Request ): void; /** * The close() method is intended for instructing the store to 'close' out * any information associated with a particular request. @@ -13051,7 +13051,7 @@ declare module dojo { * * @param request OptionalAn instance of a request for the store to use to identify what to close out.If no request is passed, then the store should clear all internal caches (if any)and close out all 'open' connections. It does not render the store unusable fromthere on, it merely cleans out any current data and resets the store to initialstate. */ - close(request: Object): void; + close(request?: Object): void; /** * Returns true if the given value is one of the values that getValues() * would return. @@ -13146,7 +13146,7 @@ declare module dojo { * @param attribute The attribute to access represented as a string. * @param defaultValue OptionalOptional. A default value to use for the getValue return in the attribute does not exist or has no value. */ - getValue(item: dojo.data.api.Item, attribute: String, defaultValue: any): any; + getValue(item: dojo.data.api.Item, attribute: String, defaultValue?: any): any; /** * This getValues() method works just like the getValue() method, but getValues() * always returns an array rather than a single attribute value. The array @@ -13218,7 +13218,7 @@ declare module dojo { * * @param request OptionalAn instance of a request for the store to use to identify what to close out.If no request is passed, then the store should clear all internal caches (if any)and close out all 'open' connections. It does not render the store unusable fromthere on, it merely cleans out any current data and resets the store to initialstate. */ - close(request: dojo.data.api.Request ): void; + close(request?: dojo.data.api.Request ): void; /** * The close() method is intended for instructing the store to 'close' out * any information associated with a particular request. @@ -13231,7 +13231,7 @@ declare module dojo { * * @param request OptionalAn instance of a request for the store to use to identify what to close out.If no request is passed, then the store should clear all internal caches (if any)and close out all 'open' connections. It does not render the store unusable fromthere on, it merely cleans out any current data and resets the store to initialstate. */ - close(request: Object): void; + close(request?: Object): void; /** * Returns true if the given value is one of the values that getValues() * would return. @@ -13324,7 +13324,7 @@ declare module dojo { * @param attribute The attribute to access represented as a string. * @param defaultValue OptionalOptional. A default value to use for the getValue return in the attribute does not exist or has no value. */ - getValue(item: dojo.data.api.Item, attribute: String, defaultValue: any): any; + getValue(item: dojo.data.api.Item, attribute: String, defaultValue?: any): any; /** * This getValues() method works just like the getValue() method, but getValues() * always returns an array rather than a single attribute value. The array @@ -13353,7 +13353,7 @@ declare module dojo { * * @param item OptionalThe item to check. */ - isDirty(item: any): void; + isDirty(item?: any): void; /** * Returns true if something is an item and came from the store instance. * Returns false if something is a literal, an item from another store instance, @@ -13396,7 +13396,7 @@ declare module dojo { * @param keywordArgs OptionalA javascript object defining the initial content of the item as a set of JavaScript 'property name: value' pairs. * @param parentInfo OptionalAn optional javascript object defining what item is the parent of this item (in a hierarchical store. Not all stores do hierarchical items),and what attribute of that parent to assign the new item to. If this is present, and the attribute specifiedis a multi-valued attribute, it will append this item into the array of values for that attribute. The structureof the object is as follows:{ parent: someItem, attribute: "attribute-name-string"} */ - newItem(keywordArgs: Object, parentInfo: Object): void; + newItem(keywordArgs?: Object, parentInfo?: Object): void; /** * Discards any unsaved changes. * Discards any unsaved changes. @@ -13464,7 +13464,7 @@ declare module dojo { * @param pattern A simple matching pattern to convert that follows basic rules:Means match anything, so ca* means match anything starting with ca? Means match single character. So, b?b will match to bob and bab, and so on.\ is an escape character. So for example, * means do not treat as a match, but literal character .To use a \ as a character in the string, it must be escaped. So in the pattern it should berepresented by \ to be treated as an ordinary \ character instead of an escape. * @param ignoreCase OptionalAn optional flag to indicate if the pattern matching should be treated as case-sensitive or not when comparingBy default, it is assumed case sensitive. */ - patternToRegExp(pattern: String, ignoreCase: boolean): any; + patternToRegExp(pattern: String, ignoreCase?: boolean): any; } /** * Permalink: http://dojotoolkit.org/api/1.9/dojo/data/util/simpleFetch.html @@ -13970,7 +13970,7 @@ declare module dojo { * @param keyPressed the "copy" key was pressed * @param self Optionaloptional flag that means that we are about to drop on itself */ - copyState(keyPressed: boolean, self: boolean): any; + copyState(keyPressed: boolean, self?: boolean): any; /** * creator function, dummy at the moment * @@ -14005,7 +14005,7 @@ declare module dojo { * @param f * @param o Optional */ - forInItems(f: Function, o: Object): String; + forInItems(f: Function, o?: Object): String; /** * iterates over selected items; * see dojo/dnd/Container.forInItems() for details @@ -14013,7 +14013,7 @@ declare module dojo { * @param f * @param o Optional */ - forInSelectedItems(f: Function, o: Object): void; + forInSelectedItems(f: Function, o?: Object): void; /** * returns a list (an array) of all valid child nodes * @@ -14475,7 +14475,7 @@ declare module dojo { * @param f * @param o Optional */ - forInItems(f: Function, o: Object): String; + forInItems(f: Function, o?: Object): String; /** * iterates over selected items; * see dojo/dnd/Container.forInItems() for details @@ -14483,7 +14483,7 @@ declare module dojo { * @param f * @param o Optional */ - forInSelectedItems(f: Function, o: Object): void; + forInSelectedItems(f: Function, o?: Object): void; /** * returns a list (an array) of all valid child nodes * @@ -14823,7 +14823,7 @@ declare module dojo { * @param keyPressed the "copy" key was pressed * @param self Optionaloptional flag that means that we are about to drop on itself */ - copyState(keyPressed: boolean, self: boolean): any; + copyState(keyPressed: boolean, self?: boolean): any; /** * creator function, dummy at the moment * @@ -14858,7 +14858,7 @@ declare module dojo { * @param f * @param o Optional */ - forInItems(f: Function, o: Object): String; + forInItems(f: Function, o?: Object): String; /** * iterates over selected items; * see dojo/dnd/Container.forInItems() for details @@ -14866,7 +14866,7 @@ declare module dojo { * @param f * @param o Optional */ - forInSelectedItems(f: Function, o: Object): void; + forInSelectedItems(f: Function, o?: Object): void; /** * returns a list (an array) of all valid child nodes * @@ -15147,7 +15147,7 @@ declare module dojo { * @param keyPressed the "copy" key was pressed * @param self Optionaloptional flag that means that we are about to drop on itself */ - copyState(keyPressed: boolean, self: boolean): any; + copyState(keyPressed: boolean, self?: boolean): any; /** * creator function, dummy at the moment * @@ -15182,7 +15182,7 @@ declare module dojo { * @param f * @param o Optional */ - forInItems(f: Function, o: Object): String; + forInItems(f: Function, o?: Object): String; /** * iterates over selected items; * see dojo/dnd/Container.forInItems() for details @@ -15190,7 +15190,7 @@ declare module dojo { * @param f * @param o Optional */ - forInSelectedItems(f: Function, o: Object): void; + forInSelectedItems(f: Function, o?: Object): void; /** * returns a list (an array) of all valid child nodes * @@ -15417,7 +15417,7 @@ declare module dojo { * * @param doc Optional */ - getViewport(doc: HTMLDocument): Object; + getViewport(doc?: HTMLDocument): Object; } module autoscroll { /** @@ -16138,7 +16138,7 @@ declare module dojo { * @param reason A message that may be sent to the deferred's canceler,explaining why it's being canceled. * @param strict OptionalIf strict, will throw an error if the deferred has alreadybeen fulfilled and consequently cannot be canceled. */ - cancel(reason: any, strict: boolean): any; + cancel(reason: any, strict?: boolean): any; /** * Checks whether the promise has been canceled. * @@ -16164,7 +16164,7 @@ declare module dojo { * * @param errback OptionalCallback to be invoked when the promise is rejected. */ - otherwise(errback: Callback): Promise; + otherwise(errback?: Callback): Promise; /** * Add new callbacks to the promise. * Add new callbacks to the deferred. Callbacks can be added @@ -16174,7 +16174,7 @@ declare module dojo { * @param errback OptionalCallback to be invoked when the promise is rejected.Receives the rejection error. * @param progback OptionalCallback to be invoked when the promise emits a progressupdate. Receives the progress update. */ - then(callback: Callback, errback?: Callback, progback?: Callback): Promise; + then(callback?: Callback, errback?: Callback, progback?: Callback): Promise; /** * */ @@ -16633,7 +16633,7 @@ declare module dojo { * @param filter * @param root Optional */ - filter(nodeList: HTMLElement[], filter: String, root: String): void; + filter(nodeList: HTMLElement[], filter: String, root?: String): void; /** * function for filtering a NodeList based on a selector, optimized for simple selectors * @@ -16641,7 +16641,7 @@ declare module dojo { * @param filter * @param root Optional */ - filter(nodeList: HTMLElement[], filter: String, root: HTMLElement): void; + filter(nodeList: HTMLElement[], filter: String, root?: HTMLElement): void; } module acme { @@ -16721,7 +16721,7 @@ declare module dojo { * @param object The object to add to the store. * @param directives OptionalAny additional parameters needed to describe how the add should be performed. */ - add(object: Object, directives: any): number; + add(object: Object, directives?: any): number; /** * Remove the object with the given id from the underlying caching store. * @@ -16741,7 +16741,7 @@ declare module dojo { * @param parent The object to find the children of. * @param options OptionalAdditional options to apply to the retrieval of the children. */ - getChildren(parent: Object, options: dojo.store.api.Store.QueryOptions): dojo.store.api.Store.QueryResults; + getChildren(parent: Object, options?: dojo.store.api.Store.QueryOptions): dojo.store.api.Store.QueryResults; /** * Returns an object's identity * @@ -16761,21 +16761,21 @@ declare module dojo { * @param object The object to put to the store. * @param directives OptionalAny additional parameters needed to describe how the put should be performed. */ - put(object: Object, directives: dojo.store.api.Store.PutDirectives): number; + put(object: Object, directives?: dojo.store.api.Store.PutDirectives): number; /** * Query the underlying master store and cache any results. * * @param query The object or string containing query information. Dependent on the query engine used. * @param directives OptionalAn optional keyword arguments object with additional parameters describing the query. */ - query(query: Object, directives: dojo.store.api.Store.QueryOptions): dojo.store.api.Store.QueryResults; + query(query: Object, directives?: dojo.store.api.Store.QueryOptions): dojo.store.api.Store.QueryResults; /** * Query the underlying master store and cache any results. * * @param query The object or string containing query information. Dependent on the query engine used. * @param directives OptionalAn optional keyword arguments object with additional parameters describing the query. */ - query(query: String, directives: dojo.store.api.Store.QueryOptions): dojo.store.api.Store.QueryResults; + query(query: String, directives?: dojo.store.api.Store.QueryOptions): dojo.store.api.Store.QueryResults; /** * Remove the object with the specific id. * @@ -16836,7 +16836,7 @@ declare module dojo { * @param parent The object to find the children of. * @param options OptionalAdditional options to apply to the retrieval of the children. */ - getChildren(parent: Object, options: dojo.store.api.Store.QueryOptions): dojo.store.api.Store.QueryResults; + getChildren(parent: Object, options?: dojo.store.api.Store.QueryOptions): dojo.store.api.Store.QueryResults; /** * Fetch the identity for the given object. * @@ -16856,21 +16856,21 @@ declare module dojo { * @param object The object to store. * @param options OptionalAdditional metadata for storing the data. Includes a reference to an idthat the object may be stored with (i.e. { id: "foo" }). */ - put(object: Object, options: Object): void; + put(object: Object, options?: Object): void; /** * Queries the store for objects. * * @param query The query to use for retrieving objects from the store * @param options OptionalOptional options object as used by the underlying dojo.data Store. */ - query(query: Object, options: Object): any; + query(query: Object, options?: Object): any; /** * Defines the query engine to use for querying the data store * * @param query An object hash with fields that may match fields of items in the store.Values in the hash will be compared by normal == operator, but regular expressionsor any object that provides a test() method are also supported and can beused to match strings by more complex expressions(and then the regex's or object's test() method will be used to match values). * @param options OptionalAn object that contains optional information such as sort, start, and count. */ - queryEngine(query: Object, options: dojo.store.api.Store.QueryOptions): any; + queryEngine(query: Object, options?: dojo.store.api.Store.QueryOptions): any; /** * Deletes an object by its identity. * @@ -16917,7 +16917,7 @@ declare module dojo { * @param object The object to store. * @param options OptionalAdditional metadata for storing the data. Includes an "id"property if a specific id is to be used. */ - add(object: Object, options: dojo.store.api.Store.PutDirectives): any; + add(object: Object, options?: dojo.store.api.Store.PutDirectives): any; /** * Retrieves an object by its identity * @@ -16930,7 +16930,7 @@ declare module dojo { * @param parent The object to find the children of. * @param options OptionalAdditional options to apply to the retrieval of the children. */ - getChildren(parent: Object, options: dojo.store.api.Store.QueryOptions): dojo.store.api.Store.QueryResults; + getChildren(parent: Object, options?: dojo.store.api.Store.QueryOptions): dojo.store.api.Store.QueryResults; /** * Returns an object's identity * @@ -16950,21 +16950,21 @@ declare module dojo { * @param object The object to store. * @param options OptionalAdditional metadata for storing the data. Includes an "id"property if a specific id is to be used. */ - put(object: Object, options: dojo.store.api.Store.PutDirectives): any; + put(object: Object, options?: dojo.store.api.Store.PutDirectives): any; /** * Queries the store for objects. * * @param query The query to use for retrieving objects from the store. * @param options OptionalThe optional arguments to apply to the resultset. */ - query(query: Object, options: dojo.store.api.Store.QueryOptions): any; + query(query: Object, options?: dojo.store.api.Store.QueryOptions): any; /** * Defines the query engine to use for querying the data store * * @param query An object hash with fields that may match fields of items in the store.Values in the hash will be compared by normal == operator, but regular expressionsor any object that provides a test() method are also supported and can beused to match strings by more complex expressions(and then the regex's or object's test() method will be used to match values). * @param options OptionalAn object that contains optional information such as sort, start, and count. */ - queryEngine(query: Object, options: dojo.store.api.Store.QueryOptions): any; + queryEngine(query: Object, options?: dojo.store.api.Store.QueryOptions): any; /** * Deletes an object by its identity * @@ -17055,7 +17055,7 @@ declare module dojo { * @param object The object to store. * @param options OptionalAdditional metadata for storing the data. Includes an "id"property if a specific id is to be used. */ - add(object: Object, options: Object): any; + add(object: Object, options?: Object): any; /** * Retrieves an object by its identity. This will trigger a GET request to the server using * the url this.target + id. @@ -17070,7 +17070,7 @@ declare module dojo { * @param parent The object to find the children of. * @param options OptionalAdditional options to apply to the retrieval of the children. */ - getChildren(parent: Object, options: dojo.store.api.Store.QueryOptions): dojo.store.api.Store.QueryResults; + getChildren(parent: Object, options?: dojo.store.api.Store.QueryOptions): dojo.store.api.Store.QueryResults; /** * Returns an object's identity * @@ -17091,7 +17091,7 @@ declare module dojo { * @param object The object to store. * @param options OptionalAdditional metadata for storing the data. Includes an "id"property if a specific id is to be used. */ - put(object: Object, options: Object): any; + put(object: Object, options?: Object): any; /** * Queries the store for objects. This will trigger a GET request to the server, with the * query added as a query string. @@ -17099,7 +17099,7 @@ declare module dojo { * @param query The query to use for retrieving objects from the store. * @param options OptionalThe optional arguments to apply to the resultset. */ - query(query: Object, options: Object): any; + query(query: Object, options?: Object): any; /** * Deletes an object by its identity. This will trigger a DELETE request to the server. * @@ -17163,7 +17163,7 @@ declare module dojo { * @param object The object to store. * @param directives OptionalAdditional directives for creating objects. */ - add(object: Object, directives: dojo.store.api.Store.PutDirectives): any; + add(object: Object, directives?: dojo.store.api.Store.PutDirectives): any; /** * Retrieves an object by its identity * @@ -17176,7 +17176,7 @@ declare module dojo { * @param parent The object to find the children of. * @param options OptionalAdditional options to apply to the retrieval of the children. */ - getChildren(parent: Object, options: dojo.store.api.Store.QueryOptions): dojo.store.api.Store.QueryResults; + getChildren(parent: Object, options?: dojo.store.api.Store.QueryOptions): dojo.store.api.Store.QueryResults; /** * Returns an object's identity * @@ -17196,7 +17196,7 @@ declare module dojo { * @param object The object to store. * @param directives OptionalAdditional directives for storing objects. */ - put(object: Object, directives: dojo.store.api.Store.PutDirectives): any; + put(object: Object, directives?: dojo.store.api.Store.PutDirectives): any; /** * */ @@ -17208,7 +17208,7 @@ declare module dojo { * @param query The query to use for retrieving objects from the store. * @param options The optional arguments to apply to the resultset. */ - query(query: String, options: dojo.store.api.Store.QueryOptions): dojo.store.api.Store.QueryResults; + query(query: String, options?: dojo.store.api.Store.QueryOptions): dojo.store.api.Store.QueryResults; /** * Queries the store for objects. This does not alter the store, but returns a * set of data from the store. @@ -17216,7 +17216,7 @@ declare module dojo { * @param query The query to use for retrieving objects from the store. * @param options The optional arguments to apply to the resultset. */ - query(query: Object, options: dojo.store.api.Store.QueryOptions): dojo.store.api.Store.QueryResults; + query(query: Object, options?: dojo.store.api.Store.QueryOptions): dojo.store.api.Store.QueryResults; /** * Queries the store for objects. This does not alter the store, but returns a * set of data from the store. @@ -17224,7 +17224,7 @@ declare module dojo { * @param query The query to use for retrieving objects from the store. * @param options The optional arguments to apply to the resultset. */ - query(query: Function, options: dojo.store.api.Store.QueryOptions): dojo.store.api.Store.QueryResults; + query(query: Function, options?: dojo.store.api.Store.QueryOptions): dojo.store.api.Store.QueryResults; /** * */ @@ -17520,7 +17520,7 @@ declare module dojo { * @param date2 OptionalDate object. If not specified, the current Date is used. * @param portion OptionalA string indicating the "date" or "time" portion of a Date object.Compares both "date" and "time" by default. One of the following:"date", "time", "datetime" */ - compare(date1: Date, date2: Date, portion: String): number; + compare(date1: Date, date2?: Date, portion?: String): number; /** * Get the difference in a specific unit of time (e.g., number of * months, weeks, days, etc.) between two dates, rounded to the @@ -17530,7 +17530,7 @@ declare module dojo { * @param date2 OptionalDate object. If not specified, the current Date is used. * @param interval OptionalA string representing the interval. One of the following:"year", "month", "day", "hour", "minute", "second","millisecond", "quarter", "week", "weekday"Defaults to "day". */ - difference(date1: Date, date2: Date, interval: String): any; + difference(date1: Date, date2?: Date, interval?: String): any; /** * Returns the number of days in the month used by dateObject * @@ -17594,7 +17594,7 @@ declare module dojo { * @param formattedString A string such as 2005-06-30T08:05:00-07:00 or 2005-06-30 or T08:05:00 * @param defaultTime OptionalUsed for defaults for fields omitted in the formattedString.Uses 1970-01-01T00:00:00.0Z by default. */ - fromISOString(formattedString: String, defaultTime: number): any; + fromISOString(formattedString: String, defaultTime?: number): any; /** * Format a Date object as a string according a subset of the ISO-8601 standard * When options.selector is omitted, output follows RFC3339 @@ -17604,7 +17604,7 @@ declare module dojo { * @param dateObject A Date object * @param options OptionalAn object with the following properties:selector (String): "date" or "time" for partial formatting of the Date object.Both date and time will be formatted by default.zulu (Boolean): if true, UTC/GMT is used for a timezonemilliseconds (Boolean): if true, output milliseconds */ - toISOString(dateObject: Date, options: Object): any; + toISOString(dateObject: Date, options?: Object): any; } /** * Permalink: http://dojotoolkit.org/api/1.9/dojo/date/locale.html @@ -17640,7 +17640,7 @@ declare module dojo { * @param dateObject the date and/or time to be formatted. If a time only is formatted,the values in the year, month, and day fields are irrelevant. Theopposite is true when formatting only dates. * @param options OptionalAn object with the following properties:selector (String): choice of 'time','date' (default: date and time)formatLength (String): choice of long, short, medium or full (plus any custom additions). Defaults to 'short'datePattern (String): override pattern with this stringtimePattern (String): override pattern with this stringam (String): override strings for am in timespm (String): override strings for pm in timeslocale (String): override the locale used to determine formatting rulesfullYear (Boolean): (format only) use 4 digit years whenever 2 digit years are called forstrict (Boolean): (parse only) strict parsing, off by default */ - format(dateObject: Date, options: Object): any; + format(dateObject: Date, options?: Object): any; /** * Used to get localized strings from dojo.cldr for day or month names. * @@ -17649,14 +17649,14 @@ declare module dojo { * @param context Optional'standAlone' || 'format' (default) * @param locale Optionaloverride locale used to find the names */ - getNames(item: String, type: String, context: String, locale: String): any; + getNames(item: String, type: String, context?: String, locale?: String): any; /** * Determines if the date falls on a weekend, according to local custom. * * @param dateObject Optional * @param locale Optional */ - isWeekend(dateObject: Date, locale: String): boolean; + isWeekend(dateObject?: Date, locale?: String): boolean; /** * Convert a properly formatted string to a primitive Date object, * using locale-specific settings. @@ -17676,13 +17676,13 @@ declare module dojo { * @param value A string representation of a date * @param options OptionalAn object with the following properties:selector (String): choice of 'time','date' (default: date and time)formatLength (String): choice of long, short, medium or full (plus any custom additions). Defaults to 'short'datePattern (String): override pattern with this stringtimePattern (String): override pattern with this stringam (String): override strings for am in timespm (String): override strings for pm in timeslocale (String): override the locale used to determine formatting rulesfullYear (Boolean): (format only) use 4 digit years whenever 2 digit years are called forstrict (Boolean): (parse only) strict parsing, off by default */ - parse(value: String, options: Object): any; + parse(value: String, options?: Object): any; /** * Builds the regular needed to parse a localized date * * @param options OptionalAn object with the following properties:selector (String): choice of 'time','date' (default: date and time)formatLength (String): choice of long, short, medium or full (plus any custom additions). Defaults to 'short'datePattern (String): override pattern with this stringtimePattern (String): override pattern with this stringam (String): override strings for am in timespm (String): override strings for pm in timeslocale (String): override the locale used to determine formatting rulesfullYear (Boolean): (format only) use 4 digit years whenever 2 digit years are called forstrict (Boolean): (parse only) strict parsing, off by default */ - regexp(options: Object): any; + regexp(options?: Object): any; } module locale { /** @@ -17842,7 +17842,7 @@ declare module dojo { * * @param delay OptionalAmount of time to stall playing the hide animation */ - hide(delay: number): any; + hide(delay?: number): any; /** * The function that returns the dojo.Animation to hide the node * @@ -17854,7 +17854,7 @@ declare module dojo { * * @param delay OptionalAmount of time to stall playing the show animation */ - show(delay: number): any; + show(delay?: number): any; /** * The function that returns the dojo.Animation to show the node * @@ -17893,7 +17893,7 @@ declare module dojo { * * @param n Optional */ - backIn(n: number): number; + backIn(n?: number): number; /** * An easing function combining the effects of backIn and backOut * An easing function combining the effects of backIn and backOut. @@ -17902,7 +17902,7 @@ declare module dojo { * * @param n Optional */ - backInOut(n: number): number; + backInOut(n?: number): number; /** * An easing function that pops past the range briefly, and slowly comes back. * An easing function that pops past the range briefly, and slowly comes back. @@ -17912,55 +17912,55 @@ declare module dojo { * * @param n Optional */ - backOut(n: number): number; + backOut(n?: number): number; /** * An easing function that 'bounces' near the beginning of an Animation * * @param n Optional */ - bounceIn(n: number): number; + bounceIn(n?: number): number; /** * An easing function that 'bounces' at the beginning and end of the Animation * * @param n Optional */ - bounceInOut(n: number): number; + bounceInOut(n?: number): number; /** * An easing function that 'bounces' near the end of an Animation * * @param n Optional */ - bounceOut(n: number): number; + bounceOut(n?: number): number; /** * * @param n Optional */ - circIn(n: number): number; + circIn(n?: number): number; /** * * @param n Optional */ - circInOut(n: number): number; + circInOut(n?: number): number; /** * * @param n Optional */ - circOut(n: number): any; + circOut(n?: number): any; /** * * @param n Optional */ - cubicIn(n: number): any; + cubicIn(n?: number): any; /** * * @param n Optional */ - cubicInOut(n: number): number; + cubicInOut(n?: number): number; /** * * @param n Optional */ - cubicOut(n: number): number; + cubicOut(n?: number): number; /** * An easing function the elastically snaps from the start value * An easing function the elastically snaps from the start value @@ -17970,7 +17970,7 @@ declare module dojo { * * @param n Optional */ - elasticIn(n: number): number; + elasticIn(n?: number): number; /** * An easing function that elasticly snaps around the value, near * the beginning and end of the Animation. @@ -17982,7 +17982,7 @@ declare module dojo { * * @param n Optional */ - elasticInOut(n: number): number; + elasticInOut(n?: number): number; /** * An easing function that elasticly snaps around the target value, * near the end of the Animation @@ -17994,88 +17994,88 @@ declare module dojo { * * @param n Optional */ - elasticOut(n: number): number; + elasticOut(n?: number): number; /** * * @param n Optional */ - expoIn(n: number): any; + expoIn(n?: number): any; /** * * @param n Optional */ - expoInOut(n: number): number; + expoInOut(n?: number): number; /** * * @param n Optional */ - expoOut(n: number): number; + expoOut(n?: number): number; /** * A linear easing function * * @param n Optional */ - linear(n: number): number; + linear(n?: number): number; /** * * @param n Optional */ - quadIn(n: number): any; + quadIn(n?: number): any; /** * * @param n Optional */ - quadInOut(n: number): number; + quadInOut(n?: number): number; /** * * @param n Optional */ - quadOut(n: number): number; + quadOut(n?: number): number; /** * * @param n Optional */ - quartIn(n: number): any; + quartIn(n?: number): any; /** * * @param n Optional */ - quartInOut(n: number): number; + quartInOut(n?: number): number; /** * * @param n Optional */ - quartOut(n: number): number; + quartOut(n?: number): number; /** * * @param n Optional */ - quintIn(n: number): any; + quintIn(n?: number): any; /** * * @param n Optional */ - quintInOut(n: number): number; + quintInOut(n?: number): number; /** * * @param n Optional */ - quintOut(n: number): number; + quintOut(n?: number): number; /** * * @param n Optional */ - sineIn(n: number): number; + sineIn(n?: number): number; /** * * @param n Optional */ - sineInOut(n: number): number; + sineInOut(n?: number): number; /** * * @param n Optional */ - sineOut(n: number): any; + sineOut(n?: number): any; } } @@ -18242,7 +18242,7 @@ declare module dojo { * @param advice This is function to be called after the original method * @param receiveArguments OptionalIf this is set to true, the advice function receives the original arguments (from when the original mehtodwas called) rather than the return value of the original/previous method. */ - after(target: Object, methodName: String, advice: Function, receiveArguments: boolean): any; + after(target: Object, methodName: String, advice: Function, receiveArguments?: boolean): any; /** * The "around" export of the aspect module is a function that can be used to attach * "around" advice to a method. The advisor function is immediately executed when @@ -18419,18 +18419,18 @@ declare module dojo { * @param value the number to be formatted. * @param options Optional */ - format(value: number, options: dojo.currency.__FormatOptions): any; + format(value: number, options?: dojo.currency.__FormatOptions): any; /** * * @param expression * @param options OptionalAn object with the following properties:type (String, optional): Should not be set. Value is assumed to be currency.currency (String, optional): an ISO4217 currency code, a three letter sequence like "USD".For use with dojo.currency only.symbol (String, optional): localized currency symbol. The default will be looked up in table of supported currencies in dojo.cldrA ISO4217 currency code will be used if not found.places (Number, optional): fixed number of decimal places to accept. The default is determined based on which currency is used.fractional (Boolean|Array, optional): Whether to include the fractional portion, where the number of decimal places are implied by the currencyor explicit 'places' parameter. The value [true,false] makes the fractional portion optional.By default for currencies, it the fractional portion is optional.pattern (String, optional): override formatting patternwith this string. Default value is based on locale. Overriding this property will defeatlocalization. Literal characters in patterns are not supported.locale (String, optional): override the locale used to determine formatting rulesstrict (Boolean, optional): strict parsing, false by default. Strict parsing requires input as produced by the format() method.Non-strict is more permissive, e.g. flexible on white space, omitting thousands separators */ - parse(expression: String, options: Object): any; + parse(expression: String, options?: Object): any; /** * * @param options OptionalAn object with the following properties:pattern (String, optional): override formatting patternwith this string. Default value is based on locale. Overriding this property will defeatlocalization.type (String, optional): choose a format type based on the locale from the following:decimal, scientific (not yet supported), percent, currency. decimal by default.locale (String, optional): override the locale used to determine formatting rulesstrict (Boolean, optional): strict parsing, false by default. Strict parsing requires input as produced by the format() method.Non-strict is more permissive, e.g. flexible on white space, omitting thousands separatorsplaces (Number|String, optional): number of decimal places to accept: Infinity, a positive number, ora range "n,m". Defined by pattern or Infinity if pattern not provided. */ - regexp(options: Object): any; + regexp(options?: Object): any; } module currency { /** @@ -18685,7 +18685,7 @@ declare module dojo { * @param name the name of the attribute to set, or a hash of key-value pairs to set. * @param value Optionalthe value to set for the attribute, if the name is a string. */ - set(node: HTMLElement, name: String, value: String): any; + set(node: HTMLElement, name: String, value?: String): any; /** * Sets an attribute on an HTML element. * Handles normalized setting of attributes on DOM Nodes. @@ -18704,7 +18704,7 @@ declare module dojo { * @param name the name of the attribute to set, or a hash of key-value pairs to set. * @param value Optionalthe value to set for the attribute, if the name is a string. */ - set(node: String, name: String, value: String): any; + set(node: String, name: String, value?: String): any; /** * Sets an attribute on an HTML element. * Handles normalized setting of attributes on DOM Nodes. @@ -18723,7 +18723,7 @@ declare module dojo { * @param name the name of the attribute to set, or a hash of key-value pairs to set. * @param value Optionalthe value to set for the attribute, if the name is a string. */ - set(node: HTMLElement, name: Object, value: String): any; + set(node: HTMLElement, name: Object, value?: String): any; /** * Sets an attribute on an HTML element. * Handles normalized setting of attributes on DOM Nodes. @@ -18742,7 +18742,7 @@ declare module dojo { * @param name the name of the attribute to set, or a hash of key-value pairs to set. * @param value Optionalthe value to set for the attribute, if the name is a string. */ - set(node: String, name: Object, value: String): any; + set(node: String, name: Object, value?: String): any; } /** * Permalink: http://dojotoolkit.org/api/1.9/dojo/dom-class.html @@ -18806,7 +18806,7 @@ declare module dojo { * @param node String ID or DomNode reference to remove the class from. * @param classStr OptionalAn optional String class name to remove, or several space-separatedclass names, or an array of class names. If omitted, all class nameswill be deleted. */ - remove(node: String, classStr: String): void; + remove(node: String, classStr?: String): void; /** * Removes the specified classes from node. No contains() * check is required. @@ -18814,7 +18814,7 @@ declare module dojo { * @param node String ID or DomNode reference to remove the class from. * @param classStr OptionalAn optional String class name to remove, or several space-separatedclass names, or an array of class names. If omitted, all class nameswill be deleted. */ - remove(node: HTMLElement, classStr: String): void; + remove(node: HTMLElement, classStr?: String): void; /** * Removes the specified classes from node. No contains() * check is required. @@ -18822,7 +18822,7 @@ declare module dojo { * @param node String ID or DomNode reference to remove the class from. * @param classStr OptionalAn optional String class name to remove, or several space-separatedclass names, or an array of class names. If omitted, all class nameswill be deleted. */ - remove(node: String, classStr: any[]): void; + remove(node: String, classStr?: any[]): void; /** * Removes the specified classes from node. No contains() * check is required. @@ -18830,7 +18830,7 @@ declare module dojo { * @param node String ID or DomNode reference to remove the class from. * @param classStr OptionalAn optional String class name to remove, or several space-separatedclass names, or an array of class names. If omitted, all class nameswill be deleted. */ - remove(node: HTMLElement, classStr: any[]): void; + remove(node: HTMLElement, classStr?: any[]): void; /** * Replaces one or more classes on a node if not present. * Operates more quickly than calling dojo.removeClass and dojo.addClass @@ -18839,7 +18839,7 @@ declare module dojo { * @param addClassStr A String class name to add, or several space-separated class names,or an array of class names. * @param removeClassStr OptionalA String class name to remove, or several space-separated class names,or an array of class names. */ - replace(node: String, addClassStr: String, removeClassStr: String): void; + replace(node: String, addClassStr: String, removeClassStr?: String): void; /** * Replaces one or more classes on a node if not present. * Operates more quickly than calling dojo.removeClass and dojo.addClass @@ -18848,7 +18848,7 @@ declare module dojo { * @param addClassStr A String class name to add, or several space-separated class names,or an array of class names. * @param removeClassStr OptionalA String class name to remove, or several space-separated class names,or an array of class names. */ - replace(node: HTMLElement, addClassStr: String, removeClassStr: String): void; + replace(node: HTMLElement, addClassStr: String, removeClassStr?: String): void; /** * Replaces one or more classes on a node if not present. * Operates more quickly than calling dojo.removeClass and dojo.addClass @@ -18857,7 +18857,7 @@ declare module dojo { * @param addClassStr A String class name to add, or several space-separated class names,or an array of class names. * @param removeClassStr OptionalA String class name to remove, or several space-separated class names,or an array of class names. */ - replace(node: String, addClassStr: any[], removeClassStr: String): void; + replace(node: String, addClassStr: any[], removeClassStr?: String): void; /** * Replaces one or more classes on a node if not present. * Operates more quickly than calling dojo.removeClass and dojo.addClass @@ -18866,7 +18866,7 @@ declare module dojo { * @param addClassStr A String class name to add, or several space-separated class names,or an array of class names. * @param removeClassStr OptionalA String class name to remove, or several space-separated class names,or an array of class names. */ - replace(node: HTMLElement, addClassStr: any[], removeClassStr: String): void; + replace(node: HTMLElement, addClassStr: any[], removeClassStr?: String): void; /** * Replaces one or more classes on a node if not present. * Operates more quickly than calling dojo.removeClass and dojo.addClass @@ -18875,7 +18875,7 @@ declare module dojo { * @param addClassStr A String class name to add, or several space-separated class names,or an array of class names. * @param removeClassStr OptionalA String class name to remove, or several space-separated class names,or an array of class names. */ - replace(node: String, addClassStr: String, removeClassStr: any[]): void; + replace(node: String, addClassStr: String, removeClassStr?: any[]): void; /** * Replaces one or more classes on a node if not present. * Operates more quickly than calling dojo.removeClass and dojo.addClass @@ -18884,7 +18884,7 @@ declare module dojo { * @param addClassStr A String class name to add, or several space-separated class names,or an array of class names. * @param removeClassStr OptionalA String class name to remove, or several space-separated class names,or an array of class names. */ - replace(node: HTMLElement, addClassStr: String, removeClassStr: any[]): void; + replace(node: HTMLElement, addClassStr: String, removeClassStr?: any[]): void; /** * Replaces one or more classes on a node if not present. * Operates more quickly than calling dojo.removeClass and dojo.addClass @@ -18893,7 +18893,7 @@ declare module dojo { * @param addClassStr A String class name to add, or several space-separated class names,or an array of class names. * @param removeClassStr OptionalA String class name to remove, or several space-separated class names,or an array of class names. */ - replace(node: String, addClassStr: any[], removeClassStr: any[]): void; + replace(node: String, addClassStr: any[], removeClassStr?: any[]): void; /** * Replaces one or more classes on a node if not present. * Operates more quickly than calling dojo.removeClass and dojo.addClass @@ -18902,7 +18902,7 @@ declare module dojo { * @param addClassStr A String class name to add, or several space-separated class names,or an array of class names. * @param removeClassStr OptionalA String class name to remove, or several space-separated class names,or an array of class names. */ - replace(node: HTMLElement, addClassStr: any[], removeClassStr: any[]): void; + replace(node: HTMLElement, addClassStr: any[], removeClassStr?: any[]): void; /** * Adds a class to node if not present, or removes if present. * Pass a boolean condition if you want to explicitly add or remove. @@ -18912,7 +18912,7 @@ declare module dojo { * @param classStr A String class name to toggle, or several space-separated class names,or an array of class names. * @param condition OptionalIf passed, true means to add the class, false means to remove.Otherwise dojo.hasClass(node, classStr) is used to detect the class presence. */ - toggle(node: String, classStr: String, condition: boolean): boolean; + toggle(node: String, classStr: String, condition?: boolean): boolean; /** * Adds a class to node if not present, or removes if present. * Pass a boolean condition if you want to explicitly add or remove. @@ -18922,7 +18922,7 @@ declare module dojo { * @param classStr A String class name to toggle, or several space-separated class names,or an array of class names. * @param condition OptionalIf passed, true means to add the class, false means to remove.Otherwise dojo.hasClass(node, classStr) is used to detect the class presence. */ - toggle(node: HTMLElement, classStr: String, condition: boolean): boolean; + toggle(node: HTMLElement, classStr: String, condition?: boolean): boolean; /** * Adds a class to node if not present, or removes if present. * Pass a boolean condition if you want to explicitly add or remove. @@ -18932,7 +18932,7 @@ declare module dojo { * @param classStr A String class name to toggle, or several space-separated class names,or an array of class names. * @param condition OptionalIf passed, true means to add the class, false means to remove.Otherwise dojo.hasClass(node, classStr) is used to detect the class presence. */ - toggle(node: String, classStr: any[], condition: boolean): boolean; + toggle(node: String, classStr: any[], condition?: boolean): boolean; /** * Adds a class to node if not present, or removes if present. * Pass a boolean condition if you want to explicitly add or remove. @@ -18942,7 +18942,7 @@ declare module dojo { * @param classStr A String class name to toggle, or several space-separated class names,or an array of class names. * @param condition OptionalIf passed, true means to add the class, false means to remove.Otherwise dojo.hasClass(node, classStr) is used to detect the class presence. */ - toggle(node: HTMLElement, classStr: any[], condition: boolean): boolean; + toggle(node: HTMLElement, classStr: any[], condition?: boolean): boolean; } /** * Permalink: http://dojotoolkit.org/api/1.9/dojo/dom-form.html @@ -18978,7 +18978,7 @@ declare module dojo { * @param formNode * @param prettyPrint Optional */ - toJson(formNode: HTMLElement, prettyPrint: boolean): String; + toJson(formNode: HTMLElement, prettyPrint?: boolean): String; /** * Create a serialized JSON string from a form node or string * ID identifying the form to serialize @@ -18986,7 +18986,7 @@ declare module dojo { * @param formNode * @param prettyPrint Optional */ - toJson(formNode: String, prettyPrint: boolean): String; + toJson(formNode: String, prettyPrint?: boolean): String; /** * Serialize a form node to a JavaScript object. * Returns the values encoded in an HTML form as @@ -19046,7 +19046,7 @@ declare module dojo { * @param refNode OptionalOptional reference node. Used by dojo.place to place the newly creatednode somewhere in the dom relative to refNode. Can be a DomNode referenceor String ID of a node. * @param pos OptionalOptional positional reference. Defaults to "last" by way of dojo.place,though can be set to "first","after","before","last", "replace" or "only"to further control the placement of the new node relative to the refNode.'refNode' is required if a 'pos' is specified. */ - create(tag: HTMLElement, attrs: Object, refNode: HTMLElement, pos: String): any; + create(tag: HTMLElement, attrs: Object, refNode?: HTMLElement, pos?: String): any; /** * Create an element, allowing for optional attribute decoration * and placement. @@ -19065,7 +19065,7 @@ declare module dojo { * @param refNode OptionalOptional reference node. Used by dojo.place to place the newly creatednode somewhere in the dom relative to refNode. Can be a DomNode referenceor String ID of a node. * @param pos OptionalOptional positional reference. Defaults to "last" by way of dojo.place,though can be set to "first","after","before","last", "replace" or "only"to further control the placement of the new node relative to the refNode.'refNode' is required if a 'pos' is specified. */ - create(tag: String, attrs: Object, refNode: HTMLElement, pos: String): any; + create(tag: String, attrs: Object, refNode?: HTMLElement, pos?: String): any; /** * Create an element, allowing for optional attribute decoration * and placement. @@ -19084,7 +19084,7 @@ declare module dojo { * @param refNode OptionalOptional reference node. Used by dojo.place to place the newly creatednode somewhere in the dom relative to refNode. Can be a DomNode referenceor String ID of a node. * @param pos OptionalOptional positional reference. Defaults to "last" by way of dojo.place,though can be set to "first","after","before","last", "replace" or "only"to further control the placement of the new node relative to the refNode.'refNode' is required if a 'pos' is specified. */ - create(tag: HTMLElement, attrs: Object, refNode: String, pos: String): any; + create(tag: HTMLElement, attrs: Object, refNode?: String, pos?: String): any; /** * Create an element, allowing for optional attribute decoration * and placement. @@ -19103,7 +19103,7 @@ declare module dojo { * @param refNode OptionalOptional reference node. Used by dojo.place to place the newly creatednode somewhere in the dom relative to refNode. Can be a DomNode referenceor String ID of a node. * @param pos OptionalOptional positional reference. Defaults to "last" by way of dojo.place,though can be set to "first","after","before","last", "replace" or "only"to further control the placement of the new node relative to the refNode.'refNode' is required if a 'pos' is specified. */ - create(tag: String, attrs: Object, refNode: String, pos: String): any; + create(tag: String, attrs: Object, refNode?: String, pos?: String): any; /** * Removes a node from its parent, clobbering it and all of its * children. @@ -19142,7 +19142,7 @@ declare module dojo { * @param refNode id or node reference to use as basis for placement * @param position Optionalstring noting the position of node relative to refNode or anumber indicating the location in the childNodes collection of refNode.Accepted string values are:beforeafterreplaceonlyfirstlast"first" and "last" indicate positions as children of refNode, "replace" replaces refNode,"only" replaces all children. position defaults to "last" if not specified */ - place(node: HTMLElement, refNode: HTMLElement, position: String): HTMLElement; + place(node: HTMLElement, refNode: HTMLElement, position?: String): HTMLElement; /** * Attempt to insert node into the DOM, choosing from various positioning options. * Returns the first argument resolved to a DOM node. @@ -19151,7 +19151,7 @@ declare module dojo { * @param refNode id or node reference to use as basis for placement * @param position Optionalstring noting the position of node relative to refNode or anumber indicating the location in the childNodes collection of refNode.Accepted string values are:beforeafterreplaceonlyfirstlast"first" and "last" indicate positions as children of refNode, "replace" replaces refNode,"only" replaces all children. position defaults to "last" if not specified */ - place(node: String, refNode: HTMLElement, position: String): HTMLElement; + place(node: String, refNode: HTMLElement, position?: String): HTMLElement; /** * Attempt to insert node into the DOM, choosing from various positioning options. * Returns the first argument resolved to a DOM node. @@ -19160,7 +19160,7 @@ declare module dojo { * @param refNode id or node reference to use as basis for placement * @param position Optionalstring noting the position of node relative to refNode or anumber indicating the location in the childNodes collection of refNode.Accepted string values are:beforeafterreplaceonlyfirstlast"first" and "last" indicate positions as children of refNode, "replace" replaces refNode,"only" replaces all children. position defaults to "last" if not specified */ - place(node: HTMLElement, refNode: String, position: String): HTMLElement; + place(node: HTMLElement, refNode: String, position?: String): HTMLElement; /** * Attempt to insert node into the DOM, choosing from various positioning options. * Returns the first argument resolved to a DOM node. @@ -19169,7 +19169,7 @@ declare module dojo { * @param refNode id or node reference to use as basis for placement * @param position Optionalstring noting the position of node relative to refNode or anumber indicating the location in the childNodes collection of refNode.Accepted string values are:beforeafterreplaceonlyfirstlast"first" and "last" indicate positions as children of refNode, "replace" replaces refNode,"only" replaces all children. position defaults to "last" if not specified */ - place(node: String, refNode: String, position: String): HTMLElement; + place(node: String, refNode: String, position?: String): HTMLElement; /** * Attempt to insert node into the DOM, choosing from various positioning options. * Returns the first argument resolved to a DOM node. @@ -19178,7 +19178,7 @@ declare module dojo { * @param refNode id or node reference to use as basis for placement * @param position Optionalstring noting the position of node relative to refNode or anumber indicating the location in the childNodes collection of refNode.Accepted string values are:beforeafterreplaceonlyfirstlast"first" and "last" indicate positions as children of refNode, "replace" replaces refNode,"only" replaces all children. position defaults to "last" if not specified */ - place(node: HTMLElement, refNode: HTMLElement, position: number): HTMLElement; + place(node: HTMLElement, refNode: HTMLElement, position?: number): HTMLElement; /** * Attempt to insert node into the DOM, choosing from various positioning options. * Returns the first argument resolved to a DOM node. @@ -19187,7 +19187,7 @@ declare module dojo { * @param refNode id or node reference to use as basis for placement * @param position Optionalstring noting the position of node relative to refNode or anumber indicating the location in the childNodes collection of refNode.Accepted string values are:beforeafterreplaceonlyfirstlast"first" and "last" indicate positions as children of refNode, "replace" replaces refNode,"only" replaces all children. position defaults to "last" if not specified */ - place(node: String, refNode: HTMLElement, position: number): HTMLElement; + place(node: String, refNode: HTMLElement, position?: number): HTMLElement; /** * Attempt to insert node into the DOM, choosing from various positioning options. * Returns the first argument resolved to a DOM node. @@ -19196,7 +19196,7 @@ declare module dojo { * @param refNode id or node reference to use as basis for placement * @param position Optionalstring noting the position of node relative to refNode or anumber indicating the location in the childNodes collection of refNode.Accepted string values are:beforeafterreplaceonlyfirstlast"first" and "last" indicate positions as children of refNode, "replace" replaces refNode,"only" replaces all children. position defaults to "last" if not specified */ - place(node: HTMLElement, refNode: String, position: number): HTMLElement; + place(node: HTMLElement, refNode: String, position?: number): HTMLElement; /** * Attempt to insert node into the DOM, choosing from various positioning options. * Returns the first argument resolved to a DOM node. @@ -19205,14 +19205,14 @@ declare module dojo { * @param refNode id or node reference to use as basis for placement * @param position Optionalstring noting the position of node relative to refNode or anumber indicating the location in the childNodes collection of refNode.Accepted string values are:beforeafterreplaceonlyfirstlast"first" and "last" indicate positions as children of refNode, "replace" replaces refNode,"only" replaces all children. position defaults to "last" if not specified */ - place(node: String, refNode: String, position: number): HTMLElement; + place(node: String, refNode: String, position?: number): HTMLElement; /** * instantiates an HTML fragment returning the corresponding DOM. * * @param frag the HTML fragment * @param doc Optionaloptional document to use when creating DOM nodes, defaults todojo/_base/window.doc if not specified. */ - toDom(frag: String, doc: HTMLDocument): any; + toDom(frag: String, doc?: HTMLDocument): any; } /** * Permalink: http://dojotoolkit.org/api/1.9/dojo/dom-prop.html @@ -19258,7 +19258,7 @@ declare module dojo { * @param name the name of the property to set, or a hash object to setmultiple properties at once. * @param value OptionalThe value to set for the property */ - set(node: HTMLElement, name: String, value: String): any; + set(node: HTMLElement, name: String, value?: String): any; /** * Sets a property on an HTML element. * Handles normalized setting of properties on DOM nodes. @@ -19277,7 +19277,7 @@ declare module dojo { * @param name the name of the property to set, or a hash object to setmultiple properties at once. * @param value OptionalThe value to set for the property */ - set(node: String, name: String, value: String): any; + set(node: String, name: String, value?: String): any; /** * Sets a property on an HTML element. * Handles normalized setting of properties on DOM nodes. @@ -19296,7 +19296,7 @@ declare module dojo { * @param name the name of the property to set, or a hash object to setmultiple properties at once. * @param value OptionalThe value to set for the property */ - set(node: HTMLElement, name: Object, value: String): any; + set(node: HTMLElement, name: Object, value?: String): any; /** * Sets a property on an HTML element. * Handles normalized setting of properties on DOM nodes. @@ -19315,7 +19315,7 @@ declare module dojo { * @param name the name of the property to set, or a hash object to setmultiple properties at once. * @param value OptionalThe value to set for the property */ - set(node: String, name: Object, value: String): any; + set(node: String, name: Object, value?: String): any; } module dom_prop { /** @@ -19414,28 +19414,28 @@ declare module dojo { * @param name * @param value Optional */ - set(node: HTMLElement, name: String, value: String): any; + set(node: HTMLElement, name: String, value?: String): any; /** * * @param node * @param name * @param value Optional */ - set(node: String, name: String, value: String): any; + set(node: String, name: String, value?: String): any; /** * * @param node * @param name * @param value Optional */ - set(node: HTMLElement, name: Object, value: String): any; + set(node: HTMLElement, name: Object, value?: String): any; /** * * @param node * @param name * @param value Optional */ - set(node: String, name: Object, value: String): any; + set(node: String, name: Object, value?: String): any; /** * converts style value to pixels on IE or return a numeric value. * @@ -19460,7 +19460,7 @@ declare module dojo { * * @param doc OptionalOptional document to query. If unspecified, use win.doc. */ - docScroll(doc: HTMLDocument): Object; + docScroll(doc?: HTMLDocument): Object; /** * In RTL direction, scrollLeft should be a negative value, but IE * returns a positive one. All codes using documentElement.scrollLeft @@ -19470,7 +19470,7 @@ declare module dojo { * @param scrollLeft * @param doc OptionalOptional document to query. If unspecified, use win.doc. */ - fixIeBiDiScrollLeft(scrollLeft: number, doc: HTMLDocument): number; + fixIeBiDiScrollLeft(scrollLeft: number, doc?: HTMLDocument): number; /** * returns an object with properties useful for noting the border * dimensions. @@ -19484,7 +19484,7 @@ declare module dojo { * @param node * @param computedStyle OptionalThis parameter accepts computed styles object.If this parameter is omitted, the functions will calldojo/dom-style.getComputedStyle to get one. It is a better way, callingdojo/dom-style.getComputedStyle once, and then pass the reference to thiscomputedStyle parameter. Wherever possible, reuse the returnedobject of dojo/dom-style.getComputedStyle(). */ - getBorderExtents(node: HTMLElement, computedStyle: Object): Object; + getBorderExtents(node: HTMLElement, computedStyle?: Object): Object; /** * Returns an object that encodes the width, height, left and top * positions of the node's content box, irrespective of the @@ -19493,7 +19493,7 @@ declare module dojo { * @param node * @param computedStyle OptionalThis parameter accepts computed styles object.If this parameter is omitted, the functions will calldojo/dom-style.getComputedStyle to get one. It is a better way, callingdojo/dom-style.getComputedStyle once, and then pass the reference to thiscomputedStyle parameter. Wherever possible, reuse the returnedobject of dojo/dom-style.getComputedStyle(). */ - getContentBox(node: HTMLElement, computedStyle: Object): Object; + getContentBox(node: HTMLElement, computedStyle?: Object): Object; /** * returns the offset in x and y from the document body to the * visual edge of the page for IE @@ -19513,7 +19513,7 @@ declare module dojo { * * @param doc OptionalOptional document to query. If unspecified, use win.doc. */ - getIeDocumentElementOffset(doc: HTMLDocument): Object; + getIeDocumentElementOffset(doc?: HTMLDocument): Object; /** * returns an object that encodes the width, height, left and top * positions of the node's margin box. @@ -19521,7 +19521,7 @@ declare module dojo { * @param node * @param computedStyle OptionalThis parameter accepts computed styles object.If this parameter is omitted, the functions will calldojo/dom-style.getComputedStyle to get one. It is a better way, callingdojo/dom-style.getComputedStyle once, and then pass the reference to thiscomputedStyle parameter. Wherever possible, reuse the returnedobject of dojo/dom-style.getComputedStyle(). */ - getMarginBox(node: HTMLElement, computedStyle: Object): Object; + getMarginBox(node: HTMLElement, computedStyle?: Object): Object; /** * returns object with properties useful for box fitting with * regards to box margins (i.e., the outer-box). @@ -19536,7 +19536,7 @@ declare module dojo { * @param node * @param computedStyle OptionalThis parameter accepts computed styles object.If this parameter is omitted, the functions will calldojo/dom-style.getComputedStyle to get one. It is a better way, callingdojo/dom-style.getComputedStyle once, and then pass the reference to thiscomputedStyle parameter. Wherever possible, reuse the returnedobject of dojo/dom-style.getComputedStyle(). */ - getMarginExtents(node: HTMLElement, computedStyle: Object): Object; + getMarginExtents(node: HTMLElement, computedStyle?: Object): Object; /** * returns an object that encodes the width and height of * the node's margin box @@ -19544,7 +19544,7 @@ declare module dojo { * @param node * @param computedStyle OptionalThis parameter accepts computed styles object.If this parameter is omitted, the functions will calldojo/dom-style.getComputedStyle to get one. It is a better way, callingdojo/dom-style.getComputedStyle once, and then pass the reference to thiscomputedStyle parameter. Wherever possible, reuse the returnedobject of dojo/dom-style.getComputedStyle(). */ - getMarginSize(node: HTMLElement, computedStyle: Object): Object; + getMarginSize(node: HTMLElement, computedStyle?: Object): Object; /** * returns an object that encodes the width and height of * the node's margin box @@ -19552,7 +19552,7 @@ declare module dojo { * @param node * @param computedStyle OptionalThis parameter accepts computed styles object.If this parameter is omitted, the functions will calldojo/dom-style.getComputedStyle to get one. It is a better way, callingdojo/dom-style.getComputedStyle once, and then pass the reference to thiscomputedStyle parameter. Wherever possible, reuse the returnedobject of dojo/dom-style.getComputedStyle(). */ - getMarginSize(node: String, computedStyle: Object): Object; + getMarginSize(node: String, computedStyle?: Object): Object; /** * Returns object with properties useful for box fitting with * regards to padding. @@ -19566,7 +19566,7 @@ declare module dojo { * @param node * @param computedStyle OptionalThis parameter accepts computed styles object.If this parameter is omitted, the functions will calldojo/dom-style.getComputedStyle to get one. It is a better way, callingdojo/dom-style.getComputedStyle once, and then pass the reference to thiscomputedStyle parameter. Wherever possible, reuse the returnedobject of dojo/dom-style.getComputedStyle(). */ - getPadBorderExtents(node: HTMLElement, computedStyle: Object): Object; + getPadBorderExtents(node: HTMLElement, computedStyle?: Object): Object; /** * Returns object with special values specifically useful for node * fitting. @@ -19584,13 +19584,13 @@ declare module dojo { * @param node * @param computedStyle OptionalThis parameter accepts computed styles object.If this parameter is omitted, the functions will calldojo/dom-style.getComputedStyle to get one. It is a better way, callingdojo/dom-style.getComputedStyle once, and then pass the reference to thiscomputedStyle parameter. Wherever possible, reuse the returnedobject of dojo/dom-style.getComputedStyle(). */ - getPadExtents(node: HTMLElement, computedStyle: Object): Object; + getPadExtents(node: HTMLElement, computedStyle?: Object): Object; /** * Returns true if the current language is left-to-right, and false otherwise. * * @param doc OptionalOptional document to query. If unspecified, use win.doc. */ - isBodyLtr(doc: HTMLDocument): boolean; + isBodyLtr(doc?: HTMLDocument): boolean; /** * Normalizes the geometry of a DOM event, normalizing the pageX, pageY, * offsetX, offsetY, layerX, and layerX properties @@ -19638,7 +19638,7 @@ declare module dojo { * @param box hash with optional "w", and "h" properties for "width", and "height"respectively. All specified properties should have numeric values in whole pixels. * @param computedStyle OptionalThis parameter accepts computed styles object.If this parameter is omitted, the functions will calldojo/dom-style.getComputedStyle to get one. It is a better way, callingdojo/dom-style.getComputedStyle once, and then pass the reference to thiscomputedStyle parameter. Wherever possible, reuse the returnedobject of dojo/dom-style.getComputedStyle(). */ - setContentSize(node: HTMLElement, box: Object, computedStyle: Object): void; + setContentSize(node: HTMLElement, box: Object, computedStyle?: Object): void; /** * sets the size of the node's margin box and placement * (left/top), irrespective of box model. Think of it as a @@ -19649,7 +19649,7 @@ declare module dojo { * @param box hash with optional "l", "t", "w", and "h" properties for "left", "right", "width", and "height"respectively. All specified properties should have numeric values in whole pixels. * @param computedStyle OptionalThis parameter accepts computed styles object.If this parameter is omitted, the functions will calldojo/dom-style.getComputedStyle to get one. It is a better way, callingdojo/dom-style.getComputedStyle once, and then pass the reference to thiscomputedStyle parameter. Wherever possible, reuse the returnedobject of dojo/dom-style.getComputedStyle(). */ - setMarginBox(node: HTMLElement, box: Object, computedStyle: Object): void; + setMarginBox(node: HTMLElement, box: Object, computedStyle?: Object): void; } /** * Permalink: http://dojotoolkit.org/api/1.9/dojo/gears.html @@ -19698,7 +19698,7 @@ declare module dojo { * @param cont the content to be set on the parent element.This can be an html string, a node reference or a NodeList, dojo/NodeList, Array or other enumerable list of nodes * @param params OptionalOptional flags/properties to configure the content-setting. See dojo/html/_ContentSetter */ - set(node: HTMLElement, cont: String, params: Object): any; + set(node: HTMLElement, cont: String, params?: Object): any; /** * inserts (replaces) the given content into the given node. dojo/dom-construct.place(cont, node, "only") * may be a better choice for simple HTML insertion. @@ -19715,7 +19715,7 @@ declare module dojo { * @param cont the content to be set on the parent element.This can be an html string, a node reference or a NodeList, dojo/NodeList, Array or other enumerable list of nodes * @param params OptionalOptional flags/properties to configure the content-setting. See dojo/html/_ContentSetter */ - set(node: HTMLElement, cont: HTMLElement, params: Object): any; + set(node: HTMLElement, cont: HTMLElement, params?: Object): any; /** * inserts (replaces) the given content into the given node. dojo/dom-construct.place(cont, node, "only") * may be a better choice for simple HTML insertion. @@ -19732,7 +19732,7 @@ declare module dojo { * @param cont the content to be set on the parent element.This can be an html string, a node reference or a NodeList, dojo/NodeList, Array or other enumerable list of nodes * @param params OptionalOptional flags/properties to configure the content-setting. See dojo/html/_ContentSetter */ - set(node: HTMLElement, cont: NodeList, params: Object): any; + set(node: HTMLElement, cont: NodeList, params?: Object): any; } module html { /** @@ -19800,21 +19800,21 @@ declare module dojo { * @param cont OptionalAn html string, node or enumerable list of nodes for insertion into the domIf not provided, the object's content property will be used * @param params Optional */ - set(cont: String, params: Object): any; + set(cont: String, params?: Object): any; /** * front-end to the set-content sequence * * @param cont OptionalAn html string, node or enumerable list of nodes for insertion into the domIf not provided, the object's content property will be used * @param params Optional */ - set(cont: HTMLElement, params: Object): any; + set(cont: HTMLElement, params?: Object): any; /** * front-end to the set-content sequence * * @param cont OptionalAn html string, node or enumerable list of nodes for insertion into the domIf not provided, the object's content property will be used * @param params Optional */ - set(cont: NodeList, params: Object): any; + set(cont: NodeList, params?: Object): any; /** * sets the content on the node * @@ -20473,7 +20473,7 @@ declare module dojo { * @param expression A string representation of a Number * @param options OptionalAn object with the following properties:pattern (String, optional): override formatting patternwith this string. Default value is based on locale. Overriding this property will defeatlocalization. Literal characters in patterns are not supported.type (String, optional): choose a format type based on the locale from the following:decimal, scientific (not yet supported), percent, currency. decimal by default.locale (String, optional): override the locale used to determine formatting rulesstrict (Boolean, optional): strict parsing, false by default. Strict parsing requires input as produced by the format() method.Non-strict is more permissive, e.g. flexible on white space, omitting thousands separatorsfractional (Boolean|Array, optional): Whether to include the fractional portion, where the number of decimal places are implied by patternor explicit 'places' parameter. The value [true,false] makes the fractional portion optional. */ - parse(expression: String, options: Object): number; + parse(expression: String, options?: Object): number; /** * Builds the regular needed to parse a number * Returns regular expression with positive and negative match, group @@ -20493,7 +20493,7 @@ declare module dojo { * @param places OptionalThe number of decimal places where rounding takes place. Defaults to 0 for whole rounding.Must be non-negative. * @param increment OptionalRounds next place to nearest value of increment/10. 10 by default. */ - round(value: number, places: number, increment: number): number; + round(value: number, places?: number, increment?: number): number; } module number_ { /** @@ -20738,7 +20738,7 @@ declare module dojo { * @param scripts OptionalArray of + */ + export enum SandboxMode { EMULATED, IFRAME, NATIVE } + + } +} + +declare var HtmlService: GoogleAppsScript.HTML.HtmlService; \ No newline at end of file diff --git a/google-apps-script/google-apps-script.jdbc.d.ts b/google-apps-script/google-apps-script.jdbc.d.ts new file mode 100644 index 000000000..d4a90b8ba --- /dev/null +++ b/google-apps-script/google-apps-script.jdbc.d.ts @@ -0,0 +1,902 @@ +// Type definitions for Google Apps Script 2015-11-12 +// Project: https://developers.google.com/apps-script/ +// Definitions by: motemen +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// +/// + +declare module GoogleAppsScript { + export module JDBC { + /** + * The JDBC service allows scripts to connect to Google Cloud SQL, MySQL, + * Microsoft SQL Server, and Oracle databases. For more information, see the + * guide to JDBC. + */ + export interface Jdbc { + getCloudSqlConnection(url: string): JdbcConnection; + getCloudSqlConnection(url: string, info: Object): JdbcConnection; + getCloudSqlConnection(url: string, userName: string, password: string): JdbcConnection; + getConnection(url: string): JdbcConnection; + getConnection(url: string, info: Object): JdbcConnection; + getConnection(url: string, userName: string, password: string): JdbcConnection; + newDate(milliseconds: Integer): JdbcDate; + newTime(milliseconds: Integer): JdbcTime; + newTimestamp(milliseconds: Integer): JdbcTimestamp; + parseDate(date: string): JdbcDate; + parseTime(time: string): JdbcTime; + parseTimestamp(timestamp: string): JdbcTimestamp; + } + + /** + * A JDBC Array. For documentation of this class, see java.sql.Array. + */ + export interface JdbcArray { + free(): void; + getArray(): Object; + getArray(index: Integer, count: Integer): Object; + getBaseType(): Integer; + getBaseTypeName(): string; + getResultSet(): JdbcResultSet; + getResultSet(index: Integer, count: Integer): JdbcResultSet; + } + + /** + * A JDBC Blob. For documentation of this class, see java.sql.Blob. + */ + export interface JdbcBlob { + free(): void; + getAppsScriptBlob(): Base.Blob; + getAs(contentType: string): Base.Blob; + getBytes(position: Integer, length: Integer): Byte[]; + length(): Integer; + position(pattern: Byte[], start: Integer): Integer; + position(pattern: JdbcBlob, start: Integer): Integer; + setBytes(position: Integer, blobSource: Base.BlobSource): Integer; + setBytes(position: Integer, blobSource: Base.BlobSource, offset: Integer, length: Integer): Integer; + setBytes(position: Integer, bytes: Byte[]): Integer; + setBytes(position: Integer, bytes: Byte[], offset: Integer, length: Integer): Integer; + truncate(length: Integer): void; + } + + /** + * A JDBC CallableStatement. For documentation of this class, see + * java.sql.CallableStatement. + * See also + * + * CallableStatement + */ + export interface JdbcCallableStatement { + addBatch(): void; + addBatch(sql: string): void; + cancel(): void; + clearBatch(): void; + clearParameters(): void; + clearWarnings(): void; + close(): void; + execute(): boolean; + execute(sql: string): boolean; + execute(sql: string, autoGeneratedKeys: Integer, sql_: string, columnIndexes: Integer[]): boolean; + execute(sql: string, autoGeneratedKeys: Integer, sql_: string, columnIndexes: Integer[]): boolean; + execute(sql: string, columnNames: String[]): boolean; + executeBatch(): Integer[]; + executeQuery(): JdbcResultSet; + executeQuery(sql: string): JdbcResultSet; + executeUpdate(): Integer; + executeUpdate(sql: string): Integer; + executeUpdate(sql: string, autoGeneratedKeys: Integer, sql_: string, columnIndexes: Integer[]): Integer; + executeUpdate(sql: string, autoGeneratedKeys: Integer, sql_: string, columnIndexes: Integer[]): Integer; + executeUpdate(sql: string, columnNames: String[]): Integer; + getArray(parameterIndex: Integer): JdbcArray; + getArray(parameterName: string): JdbcArray; + getBigDecimal(parameterIndex: Integer): BigNumber; + getBigDecimal(parameterName: string): BigNumber; + getBlob(parameterIndex: Integer): JdbcBlob; + getBlob(parameterName: string): JdbcBlob; + getBoolean(parameterIndex: Integer): boolean; + getBoolean(parameterName: string): boolean; + getByte(parameterIndex: Integer): Byte; + getByte(parameterName: string): Byte; + getBytes(parameterIndex: Integer): Byte[]; + getBytes(parameterName: string): Byte[]; + getClob(parameterIndex: Integer): JdbcClob; + getClob(parameterName: string): JdbcClob; + getConnection(): JdbcConnection; + getDate(parameterIndex: Integer): JdbcDate; + getDate(parameterIndex: Integer, timeZone: string): JdbcDate; + getDate(parameterName: string): JdbcDate; + getDate(parameterName: string, timeZone: string): JdbcDate; + getDouble(parameterIndex: Integer): Number; + getDouble(parameterName: string): Number; + getFetchDirection(): Integer; + getFetchSize(): Integer; + getFloat(parameterIndex: Integer): Number; + getFloat(parameterName: string): Number; + getGeneratedKeys(): JdbcResultSet; + getInt(parameterIndex: Integer): Integer; + getInt(parameterName: string): Integer; + getLong(parameterIndex: Integer): Integer; + getLong(parameterName: string): Integer; + getMaxFieldSize(): Integer; + getMaxRows(): Integer; + getMetaData(): JdbcResultSetMetaData; + getMoreResults(): boolean; + getMoreResults(current: Integer): boolean; + getNClob(parameterIndex: Integer): JdbcClob; + getNClob(parameterName: string): JdbcClob; + getNString(parameterIndex: Integer): string; + getNString(parameterName: string): string; + getObject(parameterIndex: Integer): Object; + getObject(parameterName: string): Object; + getParameterMetaData(): JdbcParameterMetaData; + getQueryTimeout(): Integer; + getRef(parameterIndex: Integer): JdbcRef; + getRef(parameterName: string): JdbcRef; + getResultSet(): JdbcResultSet; + getResultSetConcurrency(): Integer; + getResultSetHoldability(): Integer; + getResultSetType(): Integer; + getRowId(parameterIndex: Integer): JdbcRowId; + getRowId(parameterName: string): JdbcRowId; + getSQLXML(parameterIndex: Integer): JdbcSQLXML; + getSQLXML(parameterName: string): JdbcSQLXML; + getShort(parameterIndex: Integer): Integer; + getShort(parameterName: string): Integer; + getString(parameterIndex: Integer): string; + getString(parameterName: string): string; + getTime(parameterIndex: Integer): JdbcTime; + getTime(parameterIndex: Integer, timeZone: string): JdbcTime; + getTime(parameterName: string): JdbcTime; + getTime(parameterName: string, timeZone: string): JdbcTime; + getTimestamp(parameterIndex: Integer): JdbcTimestamp; + getTimestamp(parameterIndex: Integer, timeZone: string): JdbcTimestamp; + getTimestamp(parameterName: string): JdbcTimestamp; + getTimestamp(parameterName: string, timeZone: string): JdbcTimestamp; + getURL(parameterIndex: Integer): string; + getURL(parameterName: string): string; + getUpdateCount(): Integer; + getWarnings(): String[]; + isClosed(): boolean; + isPoolable(): boolean; + registerOutParameter(parameterIndex: Integer, sqlType: Integer): void; + registerOutParameter(parameterIndex: Integer, sqlType: Integer, scale: Integer): void; + registerOutParameter(parameterIndex: Integer, sqlType: Integer, typeName: string): void; + registerOutParameter(parameterName: string, sqlType: Integer): void; + registerOutParameter(parameterName: string, sqlType: Integer, scale: Integer): void; + registerOutParameter(parameterName: string, sqlType: Integer, typeName: string): void; + setArray(parameterIndex: Integer, x: JdbcArray): void; + setBigDecimal(parameterIndex: Integer, x: BigNumber): void; + setBigDecimal(parameterName: string, x: BigNumber): void; + setBlob(parameterIndex: Integer, x: JdbcBlob): void; + setBlob(parameterName: string, x: JdbcBlob): void; + setBoolean(parameterIndex: Integer, x: boolean): void; + setBoolean(parameterName: string, x: boolean): void; + setByte(parameterIndex: Integer, x: Byte): void; + setByte(parameterName: string, x: Byte): void; + setBytes(parameterIndex: Integer, x: Byte[]): void; + setBytes(parameterName: string, x: Byte[]): void; + setClob(parameterIndex: Integer, x: JdbcClob): void; + setClob(parameterName: string, x: JdbcClob): void; + setCursorName(name: string): void; + setDate(parameterIndex: Integer, x: JdbcDate): void; + setDate(parameterIndex: Integer, x: JdbcDate, timeZone: string): void; + setDate(parameterName: string, x: JdbcDate): void; + setDate(parameterName: string, x: JdbcDate, timeZone: string): void; + setDouble(parameterIndex: Integer, x: Number): void; + setDouble(parameterName: string, x: Number): void; + setEscapeProcessing(enable: boolean): void; + setFetchDirection(direction: Integer): void; + setFetchSize(rows: Integer): void; + setFloat(parameterIndex: Integer, x: Number): void; + setFloat(parameterName: string, x: Number): void; + setInt(parameterIndex: Integer, x: Integer): void; + setInt(parameterName: string, x: Integer): void; + setLong(parameterIndex: Integer, x: Integer): void; + setLong(parameterName: string, x: Integer): void; + setMaxFieldSize(max: Integer): void; + setMaxRows(max: Integer): void; + setNClob(parameterIndex: Integer, x: JdbcClob): void; + setNClob(parameterName: string, value: JdbcClob): void; + setNString(parameterIndex: Integer, x: string): void; + setNString(parameterName: string, value: string): void; + setNull(parameterIndex: Integer, sqlType: Integer): void; + setNull(parameterIndex: Integer, sqlType: Integer, typeName: string): void; + setNull(parameterName: string, sqlType: Integer): void; + setNull(parameterName: string, sqlType: Integer, typeName: string): void; + setObject(index: Integer, x: Object): void; + setObject(parameterIndex: Integer, x: Object, targetSqlType: Integer): void; + setObject(parameterIndex: Integer, x: Object, targetSqlType: Integer, scaleOrLength: Integer): void; + setObject(parameterName: string, x: Object): void; + setObject(parameterName: string, x: Object, targetSqlType: Integer): void; + setObject(parameterName: string, x: Object, targetSqlType: Integer, scale: Integer): void; + setPoolable(poolable: boolean): void; + setQueryTimeout(seconds: Integer): void; + setRef(parameterIndex: Integer, x: JdbcRef): void; + setRowId(parameterIndex: Integer, x: JdbcRowId): void; + setRowId(parameterName: string, x: JdbcRowId): void; + setSQLXML(parameterIndex: Integer, x: JdbcSQLXML): void; + setSQLXML(parameterName: string, xmlObject: JdbcSQLXML): void; + setShort(parameterIndex: Integer, x: Integer): void; + setShort(parameterName: string, x: Integer): void; + setString(parameterIndex: Integer, x: string): void; + setString(parameterName: string, x: string): void; + setTime(parameterIndex: Integer, x: JdbcTime): void; + setTime(parameterIndex: Integer, x: JdbcTime, timeZone: string): void; + setTime(parameterName: string, x: JdbcTime): void; + setTime(parameterName: string, x: JdbcTime, timeZone: string): void; + setTimestamp(parameterIndex: Integer, x: JdbcTimestamp): void; + setTimestamp(parameterIndex: Integer, x: JdbcTimestamp, timeZone: string): void; + setTimestamp(parameterName: string, x: JdbcTimestamp): void; + setTimestamp(parameterName: string, x: JdbcTimestamp, timeZone: string): void; + setURL(parameterIndex: Integer, x: string): void; + setURL(parameterName: string, val: string): void; + wasNull(): boolean; + } + + /** + * A JDBC Clob. For documentation of this class, see java.sql.Clob. + */ + export interface JdbcClob { + free(): void; + getAppsScriptBlob(): Base.Blob; + getAs(contentType: string): Base.Blob; + getSubString(position: Integer, length: Integer): string; + length(): Integer; + position(search: JdbcClob, start: Integer): Integer; + position(search: string, start: Integer): Integer; + setString(position: Integer, blobSource: Base.BlobSource): Integer; + setString(position: Integer, blobSource: Base.BlobSource, offset: Integer, len: Integer): Integer; + setString(position: Integer, value: string): Integer; + setString(position: Integer, value: string, offset: Integer, len: Integer): Integer; + truncate(length: Integer): void; + } + + /** + * A JDBC Connection. For documentation of this class, see java.sql.Connection. + */ + export interface JdbcConnection { + clearWarnings(): void; + close(): void; + commit(): void; + createArrayOf(typeName: string, elements: Object[]): JdbcArray; + createBlob(): JdbcBlob; + createClob(): JdbcClob; + createNClob(): JdbcClob; + createSQLXML(): JdbcSQLXML; + createStatement(): JdbcStatement; + createStatement(resultSetType: Integer, resultSetConcurrency: Integer): JdbcStatement; + createStatement(resultSetType: Integer, resultSetConcurrency: Integer, resultSetHoldability: Integer): JdbcStatement; + createStruct(typeName: string, attributes: Object[]): JdbcStruct; + getAutoCommit(): boolean; + getCatalog(): string; + getHoldability(): Integer; + getMetaData(): JdbcDatabaseMetaData; + getTransactionIsolation(): Integer; + getWarnings(): String[]; + isClosed(): boolean; + isReadOnly(): boolean; + isValid(timeout: Integer): boolean; + nativeSQL(sql: string): string; + prepareCall(sql: string): JdbcCallableStatement; + prepareCall(sql: string, resultSetType: Integer, resultSetConcurrency: Integer): JdbcCallableStatement; + prepareCall(sql: string, resultSetType: Integer, resultSetConcurrency: Integer, resultSetHoldability: Integer): JdbcCallableStatement; + prepareStatement(sql: string): JdbcPreparedStatement; + prepareStatement(sql: string, autoGeneratedKeys: Integer): JdbcPreparedStatement; + prepareStatement(sql: string, resultSetType: Integer, resultSetConcurrency: Integer): JdbcPreparedStatement; + prepareStatement(sql: string, resultSetType: Integer, resultSetConcurrency: Integer, resultSetHoldability: Integer): JdbcPreparedStatement; + prepareStatementByIndex(sql: string, indices: Integer[]): JdbcPreparedStatement; + prepareStatementByName(sql: string, columnNames: String[]): JdbcPreparedStatement; + releaseSavepoint(savepoint: JdbcSavepoint): void; + rollback(): void; + rollback(savepoint: JdbcSavepoint): void; + setAutoCommit(autoCommit: boolean): void; + setCatalog(catalog: string): void; + setHoldability(holdability: Integer): void; + setReadOnly(readOnly: boolean): void; + setSavepoint(): JdbcSavepoint; + setSavepoint(name: string): JdbcSavepoint; + setTransactionIsolation(level: Integer): void; + } + + /** + * A JDBC DatabaseMetaData. For documentation of this class, see + * java.sql.DatabaseMetaData. + */ + export interface JdbcDatabaseMetaData { + allProceduresAreCallable(): boolean; + allTablesAreSelectable(): boolean; + autoCommitFailureClosesAllResultSets(): boolean; + dataDefinitionCausesTransactionCommit(): boolean; + dataDefinitionIgnoredInTransactions(): boolean; + deletesAreDetected(type: Integer): boolean; + doesMaxRowSizeIncludeBlobs(): boolean; + getAttributes(catalog: string, schemaPattern: string, typeNamePattern: string, attributeNamePattern: string): JdbcResultSet; + getBestRowIdentifier(catalog: string, schema: string, table: string, scope: Integer, nullable: boolean): JdbcResultSet; + getCatalogSeparator(): string; + getCatalogTerm(): string; + getCatalogs(): JdbcResultSet; + getClientInfoProperties(): JdbcResultSet; + getColumnPrivileges(catalog: string, schema: string, table: string, columnNamePattern: string): JdbcResultSet; + getColumns(catalog: string, schemaPattern: string, tableNamePattern: string, columnNamePattern: string): JdbcResultSet; + getConnection(): JdbcConnection; + getCrossReference(parentCatalog: string, parentSchema: string, parentTable: string, foreignCatalog: string, foreignSchema: string, foreignTable: string): JdbcResultSet; + getDatabaseMajorVersion(): Integer; + getDatabaseMinorVersion(): Integer; + getDatabaseProductName(): string; + getDatabaseProductVersion(): string; + getDefaultTransactionIsolation(): Integer; + getDriverMajorVersion(): Integer; + getDriverMinorVersion(): Integer; + getDriverName(): string; + getDriverVersion(): string; + getExportedKeys(catalog: string, schema: string, table: string): JdbcResultSet; + getExtraNameCharacters(): string; + getFunctionColumns(catalog: string, schemaPattern: string, functionNamePattern: string, columnNamePattern: string): JdbcResultSet; + getFunctions(catalog: string, schemaPattern: string, functionNamePattern: string): JdbcResultSet; + getIdentifierQuoteString(): string; + getImportedKeys(catalog: string, schema: string, table: string): JdbcResultSet; + getIndexInfo(catalog: string, schema: string, table: string, unique: boolean, approximate: boolean): JdbcResultSet; + getJDBCMajorVersion(): Integer; + getJDBCMinorVersion(): Integer; + getMaxBinaryLiteralLength(): Integer; + getMaxCatalogNameLength(): Integer; + getMaxCharLiteralLength(): Integer; + getMaxColumnNameLength(): Integer; + getMaxColumnsInGroupBy(): Integer; + getMaxColumnsInIndex(): Integer; + getMaxColumnsInOrderBy(): Integer; + getMaxColumnsInSelect(): Integer; + getMaxColumnsInTable(): Integer; + getMaxConnections(): Integer; + getMaxCursorNameLength(): Integer; + getMaxIndexLength(): Integer; + getMaxProcedureNameLength(): Integer; + getMaxRowSize(): Integer; + getMaxSchemaNameLength(): Integer; + getMaxStatementLength(): Integer; + getMaxStatements(): Integer; + getMaxTableNameLength(): Integer; + getMaxTablesInSelect(): Integer; + getMaxUserNameLength(): Integer; + getNumericFunctions(): string; + getPrimaryKeys(catalog: string, schema: string, table: string): JdbcResultSet; + getProcedureColumns(catalog: string, schemaPattern: string, procedureNamePattern: string, columnNamePattern: string): JdbcResultSet; + getProcedureTerm(): string; + getProcedures(catalog: string, schemaPattern: string, procedureNamePattern: string): JdbcResultSet; + getResultSetHoldability(): Integer; + getRowIdLifetime(): Integer; + getSQLKeywords(): string; + getSQLStateType(): Integer; + getSchemaTerm(): string; + getSchemas(): JdbcResultSet; + getSchemas(catalog: string, schemaPattern: string): JdbcResultSet; + getSearchStringEscape(): string; + getStringFunctions(): string; + getSuperTables(catalog: string, schemaPattern: string, tableNamePattern: string): JdbcResultSet; + getSuperTypes(catalog: string, schemaPattern: string, typeNamePattern: string): JdbcResultSet; + getSystemFunctions(): string; + getTablePrivileges(catalog: string, schemaPattern: string, tableNamePattern: string): JdbcResultSet; + getTableTypes(): JdbcResultSet; + getTables(catalog: string, schemaPattern: string, tableNamePattern: string, types: String[]): JdbcResultSet; + getTimeDateFunctions(): string; + getTypeInfo(): JdbcResultSet; + getUDTs(catalog: string, schemaPattern: string, typeNamePattern: string, types: Integer[]): JdbcResultSet; + getURL(): string; + getUserName(): string; + getVersionColumns(catalog: string, schema: string, table: string): JdbcResultSet; + insertsAreDetected(type: Integer): boolean; + isCatalogAtStart(): boolean; + isReadOnly(): boolean; + locatorsUpdateCopy(): boolean; + nullPlusNonNullIsNull(): boolean; + nullsAreSortedAtEnd(): boolean; + nullsAreSortedAtStart(): boolean; + nullsAreSortedHigh(): boolean; + nullsAreSortedLow(): boolean; + othersDeletesAreVisible(type: Integer): boolean; + othersInsertsAreVisible(type: Integer): boolean; + othersUpdatesAreVisible(type: Integer): boolean; + ownDeletesAreVisible(type: Integer): boolean; + ownInsertsAreVisible(type: Integer): boolean; + ownUpdatesAreVisible(type: Integer): boolean; + storesLowerCaseIdentifiers(): boolean; + storesLowerCaseQuotedIdentifiers(): boolean; + storesMixedCaseIdentifiers(): boolean; + storesMixedCaseQuotedIdentifiers(): boolean; + storesUpperCaseIdentifiers(): boolean; + storesUpperCaseQuotedIdentifiers(): boolean; + supportsANSI92EntryLevelSQL(): boolean; + supportsANSI92FullSQL(): boolean; + supportsANSI92IntermediateSQL(): boolean; + supportsAlterTableWithAddColumn(): boolean; + supportsAlterTableWithDropColumn(): boolean; + supportsBatchUpdates(): boolean; + supportsCatalogsInDataManipulation(): boolean; + supportsCatalogsInIndexDefinitions(): boolean; + supportsCatalogsInPrivilegeDefinitions(): boolean; + supportsCatalogsInProcedureCalls(): boolean; + supportsCatalogsInTableDefinitions(): boolean; + supportsColumnAliasing(): boolean; + supportsConvert(): boolean; + supportsConvert(fromType: Integer, toType: Integer): boolean; + supportsCoreSQLGrammar(): boolean; + supportsCorrelatedSubqueries(): boolean; + supportsDataDefinitionAndDataManipulationTransactions(): boolean; + supportsDataManipulationTransactionsOnly(): boolean; + supportsDifferentTableCorrelationNames(): boolean; + supportsExpressionsInOrderBy(): boolean; + supportsExtendedSQLGrammar(): boolean; + supportsFullOuterJoins(): boolean; + supportsGetGeneratedKeys(): boolean; + supportsGroupBy(): boolean; + supportsGroupByBeyondSelect(): boolean; + supportsGroupByUnrelated(): boolean; + supportsIntegrityEnhancementFacility(): boolean; + supportsLikeEscapeClause(): boolean; + supportsLimitedOuterJoins(): boolean; + supportsMinimumSQLGrammar(): boolean; + supportsMixedCaseIdentifiers(): boolean; + supportsMixedCaseQuotedIdentifiers(): boolean; + supportsMultipleOpenResults(): boolean; + supportsMultipleResultSets(): boolean; + supportsMultipleTransactions(): boolean; + supportsNamedParameters(): boolean; + supportsNonNullableColumns(): boolean; + supportsOpenCursorsAcrossCommit(): boolean; + supportsOpenCursorsAcrossRollback(): boolean; + supportsOpenStatementsAcrossCommit(): boolean; + supportsOpenStatementsAcrossRollback(): boolean; + supportsOrderByUnrelated(): boolean; + supportsOuterJoins(): boolean; + supportsPositionedDelete(): boolean; + supportsPositionedUpdate(): boolean; + supportsResultSetConcurrency(type: Integer, concurrency: Integer): boolean; + supportsResultSetHoldability(holdability: Integer): boolean; + supportsResultSetType(type: Integer): boolean; + supportsSavepoints(): boolean; + supportsSchemasInDataManipulation(): boolean; + supportsSchemasInIndexDefinitions(): boolean; + supportsSchemasInPrivilegeDefinitions(): boolean; + supportsSchemasInProcedureCalls(): boolean; + supportsSchemasInTableDefinitions(): boolean; + supportsSelectForUpdate(): boolean; + supportsStatementPooling(): boolean; + supportsStoredFunctionsUsingCallSyntax(): boolean; + supportsStoredProcedures(): boolean; + supportsSubqueriesInComparisons(): boolean; + supportsSubqueriesInExists(): boolean; + supportsSubqueriesInIns(): boolean; + supportsSubqueriesInQuantifieds(): boolean; + supportsTableCorrelationNames(): boolean; + supportsTransactionIsolationLevel(level: Integer): boolean; + supportsTransactions(): boolean; + supportsUnion(): boolean; + supportsUnionAll(): boolean; + updatesAreDetected(type: Integer): boolean; + usesLocalFilePerTable(): boolean; + usesLocalFiles(): boolean; + } + + /** + * A JDBC Date. For documentation of this class, see java.sql.Date. + */ + export interface JdbcDate { + after(when: JdbcDate): boolean; + before(when: JdbcDate): boolean; + getDate(): Integer; + getMonth(): Integer; + getTime(): Integer; + getYear(): Integer; + setDate(date: Integer): void; + setMonth(month: Integer): void; + setTime(milliseconds: Integer): void; + setYear(year: Integer): void; + } + + /** + * A JDBC ParameterMetaData. For documentation of this class, see + * java.sql.ParameterMetaData. + */ + export interface JdbcParameterMetaData { + getParameterClassName(param: Integer): string; + getParameterCount(): Integer; + getParameterMode(param: Integer): Integer; + getParameterType(param: Integer): Integer; + getParameterTypeName(param: Integer): string; + getPrecision(param: Integer): Integer; + getScale(param: Integer): Integer; + isNullable(param: Integer): Integer; + isSigned(param: Integer): boolean; + } + + /** + * A JDBC PreparedStatement. For documentation of this class, see + * java.sql.PreparedStatement. + */ + export interface JdbcPreparedStatement { + addBatch(): void; + addBatch(sql: string): void; + cancel(): void; + clearBatch(): void; + clearParameters(): void; + clearWarnings(): void; + close(): void; + execute(): boolean; + execute(sql: string): boolean; + execute(sql: string, autoGeneratedKeys: Integer, sql_: string, columnIndexes: Integer[]): boolean; + execute(sql: string, autoGeneratedKeys: Integer, sql_: string, columnIndexes: Integer[]): boolean; + execute(sql: string, columnNames: String[]): boolean; + executeBatch(): Integer[]; + executeQuery(): JdbcResultSet; + executeQuery(sql: string): JdbcResultSet; + executeUpdate(): Integer; + executeUpdate(sql: string): Integer; + executeUpdate(sql: string, autoGeneratedKeys: Integer, sql_: string, columnIndexes: Integer[]): Integer; + executeUpdate(sql: string, autoGeneratedKeys: Integer, sql_: string, columnIndexes: Integer[]): Integer; + executeUpdate(sql: string, columnNames: String[]): Integer; + getConnection(): JdbcConnection; + getFetchDirection(): Integer; + getFetchSize(): Integer; + getGeneratedKeys(): JdbcResultSet; + getMaxFieldSize(): Integer; + getMaxRows(): Integer; + getMetaData(): JdbcResultSetMetaData; + getMoreResults(): boolean; + getMoreResults(current: Integer): boolean; + getParameterMetaData(): JdbcParameterMetaData; + getQueryTimeout(): Integer; + getResultSet(): JdbcResultSet; + getResultSetConcurrency(): Integer; + getResultSetHoldability(): Integer; + getResultSetType(): Integer; + getUpdateCount(): Integer; + getWarnings(): String[]; + isClosed(): boolean; + isPoolable(): boolean; + setArray(parameterIndex: Integer, x: JdbcArray): void; + setBigDecimal(parameterIndex: Integer, x: BigNumber): void; + setBlob(parameterIndex: Integer, x: JdbcBlob): void; + setBoolean(parameterIndex: Integer, x: boolean): void; + setByte(parameterIndex: Integer, x: Byte): void; + setBytes(parameterIndex: Integer, x: Byte[]): void; + setClob(parameterIndex: Integer, x: JdbcClob): void; + setCursorName(name: string): void; + setDate(parameterIndex: Integer, x: JdbcDate): void; + setDate(parameterIndex: Integer, x: JdbcDate, timeZone: string): void; + setDouble(parameterIndex: Integer, x: Number): void; + setEscapeProcessing(enable: boolean): void; + setFetchDirection(direction: Integer): void; + setFetchSize(rows: Integer): void; + setFloat(parameterIndex: Integer, x: Number): void; + setInt(parameterIndex: Integer, x: Integer): void; + setLong(parameterIndex: Integer, x: Integer): void; + setMaxFieldSize(max: Integer): void; + setMaxRows(max: Integer): void; + setNClob(parameterIndex: Integer, x: JdbcClob): void; + setNString(parameterIndex: Integer, x: string): void; + setNull(parameterIndex: Integer, sqlType: Integer): void; + setNull(parameterIndex: Integer, sqlType: Integer, typeName: string): void; + setObject(index: Integer, x: Object): void; + setObject(parameterIndex: Integer, x: Object, targetSqlType: Integer): void; + setObject(parameterIndex: Integer, x: Object, targetSqlType: Integer, scaleOrLength: Integer): void; + setPoolable(poolable: boolean): void; + setQueryTimeout(seconds: Integer): void; + setRef(parameterIndex: Integer, x: JdbcRef): void; + setRowId(parameterIndex: Integer, x: JdbcRowId): void; + setSQLXML(parameterIndex: Integer, x: JdbcSQLXML): void; + setShort(parameterIndex: Integer, x: Integer): void; + setString(parameterIndex: Integer, x: string): void; + setTime(parameterIndex: Integer, x: JdbcTime): void; + setTime(parameterIndex: Integer, x: JdbcTime, timeZone: string): void; + setTimestamp(parameterIndex: Integer, x: JdbcTimestamp): void; + setTimestamp(parameterIndex: Integer, x: JdbcTimestamp, timeZone: string): void; + setURL(parameterIndex: Integer, x: string): void; + } + + /** + * A JDBC Ref. For documentation of this class, see java.sql.Ref. + */ + export interface JdbcRef { + getBaseTypeName(): string; + getObject(): Object; + setObject(object: Object): void; + } + + /** + * A JDBC ResultSet. For documentation of this class, see java.sql.ResultSet. + */ + export interface JdbcResultSet { + absolute(row: Integer): boolean; + afterLast(): void; + beforeFirst(): void; + cancelRowUpdates(): void; + clearWarnings(): void; + close(): void; + deleteRow(): void; + findColumn(columnLabel: string): Integer; + first(): boolean; + getArray(columnIndex: Integer): JdbcArray; + getArray(columnLabel: string): JdbcArray; + getBigDecimal(columnIndex: Integer): BigNumber; + getBigDecimal(columnLabel: string): BigNumber; + getBlob(columnIndex: Integer): JdbcBlob; + getBlob(columnLabel: string): JdbcBlob; + getBoolean(columnIndex: Integer): boolean; + getBoolean(columnLabel: string): boolean; + getByte(columnIndex: Integer): Byte; + getByte(columnLabel: string): Byte; + getBytes(columnIndex: Integer): Byte[]; + getBytes(columnLabel: string): Byte[]; + getClob(columnIndex: Integer): JdbcClob; + getClob(columnLabel: string): JdbcClob; + getConcurrency(): Integer; + getCursorName(): string; + getDate(columnIndex: Integer): JdbcDate; + getDate(columnIndex: Integer, timeZone: string): JdbcDate; + getDate(columnLabel: string): JdbcDate; + getDate(columnLabel: string, timeZone: string): JdbcDate; + getDouble(columnIndex: Integer): Number; + getDouble(columnLabel: string): Number; + getFetchDirection(): Integer; + getFetchSize(): Integer; + getFloat(columnIndex: Integer): Number; + getFloat(columnLabel: string): Number; + getHoldability(): Integer; + getInt(columnIndex: Integer): Integer; + getInt(columnLabel: string): Integer; + getLong(columnIndex: Integer): Integer; + getLong(columnLabel: string): Integer; + getMetaData(): JdbcResultSetMetaData; + getNClob(columnIndex: Integer): JdbcClob; + getNClob(columnLabel: string): JdbcClob; + getNString(columnIndex: Integer): string; + getNString(columnLabel: string): string; + getObject(columnIndex: Integer): Object; + getObject(columnLabel: string): Object; + getRef(columnIndex: Integer): JdbcRef; + getRef(columnLabel: string): JdbcRef; + getRow(): Integer; + getRowId(columnIndex: Integer): JdbcRowId; + getRowId(columnLabel: string): JdbcRowId; + getSQLXML(columnIndex: Integer): JdbcSQLXML; + getSQLXML(columnLabel: string): JdbcSQLXML; + getShort(columnIndex: Integer): Integer; + getShort(columnLabel: string): Integer; + getStatement(): JdbcStatement; + getString(columnIndex: Integer): string; + getString(columnLabel: string): string; + getTime(columnIndex: Integer): JdbcTime; + getTime(columnIndex: Integer, timeZone: string): JdbcTime; + getTime(columnLabel: string): JdbcTime; + getTime(columnLabel: string, timeZone: string): JdbcTime; + getTimestamp(columnIndex: Integer): JdbcTimestamp; + getTimestamp(columnIndex: Integer, timeZone: string): JdbcTimestamp; + getTimestamp(columnLabel: string): JdbcTimestamp; + getTimestamp(columnLabel: string, timeZone: string): JdbcTimestamp; + getType(): Integer; + getURL(columnIndex: Integer): string; + getURL(columnLabel: string): string; + getWarnings(): String[]; + insertRow(): void; + isAfterLast(): boolean; + isBeforeFirst(): boolean; + isClosed(): boolean; + isFirst(): boolean; + isLast(): boolean; + last(): boolean; + moveToCurrentRow(): void; + moveToInsertRow(): void; + next(): boolean; + previous(): boolean; + refreshRow(): void; + relative(rows: Integer): boolean; + rowDeleted(): boolean; + rowInserted(): boolean; + rowUpdated(): boolean; + setFetchDirection(direction: Integer): void; + setFetchSize(rows: Integer): void; + updateArray(columnIndex: Integer, x: JdbcArray): void; + updateArray(columnLabel: string, x: JdbcArray): void; + updateBigDecimal(columnIndex: Integer, x: BigNumber): void; + updateBigDecimal(columnLabel: string, x: BigNumber): void; + updateBlob(columnIndex: Integer, x: JdbcBlob): void; + updateBlob(columnLabel: string, x: JdbcBlob): void; + updateBoolean(columnIndex: Integer, x: boolean): void; + updateBoolean(columnLabel: string, x: boolean): void; + updateByte(columnIndex: Integer, x: Byte): void; + updateByte(columnLabel: string, x: Byte): void; + updateBytes(columnIndex: Integer, x: Byte[]): void; + updateBytes(columnLabel: string, x: Byte[]): void; + updateClob(columnIndex: Integer, x: JdbcClob): void; + updateClob(columnLabel: string, x: JdbcClob): void; + updateDate(columnIndex: Integer, x: JdbcDate): void; + updateDate(columnLabel: string, x: JdbcDate): void; + updateDouble(columnIndex: Integer, x: Number): void; + updateDouble(columnLabel: string, x: Number): void; + updateFloat(columnIndex: Integer, x: Number): void; + updateFloat(columnLabel: string, x: Number): void; + updateInt(columnIndex: Integer, x: Integer): void; + updateInt(columnLabel: string, x: Integer): void; + updateLong(columnIndex: Integer, x: Integer): void; + updateLong(columnLabel: string, x: Integer): void; + updateNClob(columnIndex: Integer, x: JdbcClob): void; + updateNClob(columnLabel: string, x: JdbcClob): void; + updateNString(columnIndex: Integer, x: string): void; + updateNString(columnLabel: string, x: string): void; + updateNull(columnIndex: Integer): void; + updateNull(columnLabel: string): void; + updateObject(columnIndex: Integer, x: Object): void; + updateObject(columnIndex: Integer, x: Object, scaleOrLength: Integer): void; + updateObject(columnLabel: string, x: Object): void; + updateObject(columnLabel: string, x: Object, scaleOrLength: Integer): void; + updateRef(columnIndex: Integer, x: JdbcRef): void; + updateRef(columnLabel: string, x: JdbcRef): void; + updateRow(): void; + updateRowId(columnIndex: Integer, x: JdbcRowId): void; + updateRowId(columnLabel: string, x: JdbcRowId): void; + updateSQLXML(columnIndex: Integer, x: JdbcSQLXML): void; + updateSQLXML(columnLabel: string, x: JdbcSQLXML): void; + updateShort(columnIndex: Integer, x: Integer): void; + updateShort(columnLabel: string, x: Integer): void; + updateString(columnIndex: Integer, x: string): void; + updateString(columnLabel: string, x: string): void; + updateTime(columnIndex: Integer, x: JdbcTime): void; + updateTime(columnLabel: string, x: JdbcTime): void; + updateTimestamp(columnIndex: Integer, x: JdbcTimestamp): void; + updateTimestamp(columnLabel: string, x: JdbcTimestamp): void; + wasNull(): boolean; + } + + /** + * A JDBC ResultSetMetaData. For documentation of this class, see + * java.sql.ResultSetMetaData. + */ + export interface JdbcResultSetMetaData { + getCatalogName(column: Integer): string; + getColumnClassName(column: Integer): string; + getColumnCount(): Integer; + getColumnDisplaySize(column: Integer): Integer; + getColumnLabel(column: Integer): string; + getColumnName(column: Integer): string; + getColumnType(column: Integer): Integer; + getColumnTypeName(column: Integer): string; + getPrecision(column: Integer): Integer; + getScale(column: Integer): Integer; + getSchemaName(column: Integer): string; + getTableName(column: Integer): string; + isAutoIncrement(column: Integer): boolean; + isCaseSensitive(column: Integer): boolean; + isCurrency(column: Integer): boolean; + isDefinitelyWritable(column: Integer): boolean; + isNullable(column: Integer): Integer; + isReadOnly(column: Integer): boolean; + isSearchable(column: Integer): boolean; + isSigned(column: Integer): boolean; + isWritable(column: Integer): boolean; + } + + /** + * A JDBC RowId. For documentation of this class, see java.sql.RowId. + */ + export interface JdbcRowId { + getBytes(): Byte[]; + } + + /** + * A JDBC SQLXML. For documentation of this class, see java.sql.SQLXML. + */ + export interface JdbcSQLXML { + free(): void; + getString(): string; + setString(value: string): void; + } + + /** + * A JDBC Savepoint. For documentation of this class, see java.sql.Savepoint. + * See also + * + * Savepoint + */ + export interface JdbcSavepoint { + getSavepointId(): Integer; + getSavepointName(): string; + } + + /** + * A JDBC Statement. For documentation of this class, see java.sql.Statement. + */ + export interface JdbcStatement { + addBatch(sql: string): void; + cancel(): void; + clearBatch(): void; + clearWarnings(): void; + close(): void; + execute(sql: string): boolean; + execute(sql: string, autoGeneratedKeys: Integer, sql_: string, columnIndexes: Integer[]): boolean; + execute(sql: string, autoGeneratedKeys: Integer, sql_: string, columnIndexes: Integer[]): boolean; + execute(sql: string, columnNames: String[]): boolean; + executeBatch(): Integer[]; + executeQuery(sql: string): JdbcResultSet; + executeUpdate(sql: string): Integer; + executeUpdate(sql: string, autoGeneratedKeys: Integer, sql_: string, columnIndexes: Integer[]): Integer; + executeUpdate(sql: string, autoGeneratedKeys: Integer, sql_: string, columnIndexes: Integer[]): Integer; + executeUpdate(sql: string, columnNames: String[]): Integer; + getConnection(): JdbcConnection; + getFetchDirection(): Integer; + getFetchSize(): Integer; + getGeneratedKeys(): JdbcResultSet; + getMaxFieldSize(): Integer; + getMaxRows(): Integer; + getMoreResults(): boolean; + getMoreResults(current: Integer): boolean; + getQueryTimeout(): Integer; + getResultSet(): JdbcResultSet; + getResultSetConcurrency(): Integer; + getResultSetHoldability(): Integer; + getResultSetType(): Integer; + getUpdateCount(): Integer; + getWarnings(): String[]; + isClosed(): boolean; + isPoolable(): boolean; + setCursorName(name: string): void; + setEscapeProcessing(enable: boolean): void; + setFetchDirection(direction: Integer): void; + setFetchSize(rows: Integer): void; + setMaxFieldSize(max: Integer): void; + setMaxRows(max: Integer): void; + setPoolable(poolable: boolean): void; + setQueryTimeout(seconds: Integer): void; + } + + /** + * A JDBC Struct. For documentation of this class, see java.sql.Struct. + */ + export interface JdbcStruct { + getAttributes(): Object[]; + getSQLTypeName(): string; + } + + /** + * A JDBC Time. For documentation of this class, see java.sql.Time. + */ + export interface JdbcTime { + after(when: JdbcTime): boolean; + before(when: JdbcTime): boolean; + getHours(): Integer; + getMinutes(): Integer; + getSeconds(): Integer; + getTime(): Integer; + setHours(hours: Integer): void; + setMinutes(minutes: Integer): void; + setSeconds(seconds: Integer): void; + setTime(milliseconds: Integer): void; + } + + /** + * A JDBC Timestamp. For documentation of this class, see java.sql.Timestamp. + */ + export interface JdbcTimestamp { + after(when: JdbcTimestamp): boolean; + before(when: JdbcTimestamp): boolean; + getDate(): Integer; + getHours(): Integer; + getMinutes(): Integer; + getMonth(): Integer; + getNanos(): Integer; + getSeconds(): Integer; + getTime(): Integer; + getYear(): Integer; + setDate(date: Integer): void; + setHours(hours: Integer): void; + setMinutes(minutes: Integer): void; + setMonth(month: Integer): void; + setNanos(nanoseconds: Integer): void; + setSeconds(seconds: Integer): void; + setTime(milliseconds: Integer): void; + setYear(year: Integer): void; + } + + } +} + +declare var Jdbc: GoogleAppsScript.JDBC.Jdbc; \ No newline at end of file diff --git a/google-apps-script/google-apps-script.language.d.ts b/google-apps-script/google-apps-script.language.d.ts new file mode 100644 index 000000000..2e5f19ad7 --- /dev/null +++ b/google-apps-script/google-apps-script.language.d.ts @@ -0,0 +1,25 @@ +// Type definitions for Google Apps Script 2015-11-12 +// Project: https://developers.google.com/apps-script/ +// Definitions by: motemen +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare module GoogleAppsScript { + export module Language { + /** + * The Language service provides scripts a way to compute automatic translations of text. + * + * // The code below will write "Esta es una prueba" to the log. + * var spanish = LanguageApp.translate('This is a test', 'en', 'es'); + * Logger.log(spanish); + */ + export interface LanguageApp { + translate(text: string, sourceLanguage: string, targetLanguage: string): string; + translate(text: string, sourceLanguage: string, targetLanguage: string, advancedArgs: Object): string; + } + + } +} + +declare var LanguageApp: GoogleAppsScript.Language.LanguageApp; \ No newline at end of file diff --git a/google-apps-script/google-apps-script.lock.d.ts b/google-apps-script/google-apps-script.lock.d.ts new file mode 100644 index 000000000..c0689e5df --- /dev/null +++ b/google-apps-script/google-apps-script.lock.d.ts @@ -0,0 +1,60 @@ +// Type definitions for Google Apps Script 2015-11-12 +// Project: https://developers.google.com/apps-script/ +// Definitions by: motemen +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare module GoogleAppsScript { + export module Lock { + /** + * A representation of a mutual-exclusion lock. + * + * This class allows scripts to make sure that only one instance of the script is executing a given + * section of code at a time. This is particularly useful for callbacks and triggers, where a user + * action may cause changes to a shared resource and you want to ensure that aren't collisions. + * + * The following examples shows how to use a lock in a form submit handler. + * + * // Generates a unique ticket number for every form submission. + * function onFormSubmit(e) { + * var targetCell = e.range.offset(0, e.range.getNumColumns(), 1, 1); + * + * // Get a script lock, because we're about to modify a shared resource. + * var lock = LockService.getScriptLock(); + * // Wait for up to 30 seconds for other processes to finish. + * lock.waitLock(30000); + * + * var ticketNumber = Number(ScriptProperties.getProperty('lastTicketNumber')) + 1; + * ScriptProperties.setProperty('lastTicketNumber', ticketNumber); + * + * // Release the lock so that other processes can continue. + * lock.releaseLock(); + * + * targetCell.setValue(ticketNumber); + * } + * + * lastTicketNumber + * ScriptProperties + */ + export interface Lock { + hasLock(): boolean; + releaseLock(): void; + tryLock(timeoutInMillis: Integer): boolean; + waitLock(timeoutInMillis: Integer): void; + } + + /** + * Prevents concurrent access to sections of code. This can be useful when you have multiple users + * or processes modifying a shared resource and want to prevent collisions. + */ + export interface LockService { + getDocumentLock(): Lock; + getScriptLock(): Lock; + getUserLock(): Lock; + } + + } +} + +declare var LockService: GoogleAppsScript.Lock.LockService; \ No newline at end of file diff --git a/google-apps-script/google-apps-script.mail.d.ts b/google-apps-script/google-apps-script.mail.d.ts new file mode 100644 index 000000000..473c7d17a --- /dev/null +++ b/google-apps-script/google-apps-script.mail.d.ts @@ -0,0 +1,31 @@ +// Type definitions for Google Apps Script 2015-11-12 +// Project: https://developers.google.com/apps-script/ +// Definitions by: motemen +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare module GoogleAppsScript { + export module Mail { + /** + * Sends email. + * + * This service allows users to send emails with complete control over the + * content of the email. Unlike GmailApp, MailApp's sole purpose is sending email. MailApp cannot + * access a user's Gmail inbox. + * + * Changes to scripts written using GmailApp are more likely to trigger a re-authorization + * request from a user than MailApp scripts. + */ + export interface MailApp { + getRemainingDailyQuota(): Integer; + sendEmail(message: Object): void; + sendEmail(recipient: string, subject: string, body: string): void; + sendEmail(recipient: string, subject: string, body: string, options: Object): void; + sendEmail(to: string, replyTo: string, subject: string, body: string): void; + } + + } +} + +declare var MailApp: GoogleAppsScript.Mail.MailApp; \ No newline at end of file diff --git a/google-apps-script/google-apps-script.maps.d.ts b/google-apps-script/google-apps-script.maps.d.ts new file mode 100644 index 000000000..6a5c45c8c --- /dev/null +++ b/google-apps-script/google-apps-script.maps.d.ts @@ -0,0 +1,319 @@ +// Type definitions for Google Apps Script 2015-11-12 +// Project: https://developers.google.com/apps-script/ +// Definitions by: motemen +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// +/// + +declare module GoogleAppsScript { + export module Maps { + /** + * An enum representing the types of restrictions to avoid when finding directions. + */ + export enum Avoid { TOLLS, HIGHWAYS } + + /** + * An enum representing the named colors available to use in map images. + */ + export enum Color { BLACK, BROWN, GREEN, PURPLE, YELLOW, BLUE, GRAY, ORANGE, RED, WHITE } + + /** + * Allows for the retrieval of directions between locations. + * + * The example below shows how you can use this class to get the directions from Times Square to + * Central Park, stopping first at Lincoln Center, plot the locations and path on a map, + * and send the map in an email. + * + * // Get the directions. + * var directions = Maps.newDirectionFinder() + * .setOrigin('Times Square, New York, NY') + * .addWaypoint('Lincoln Center, New York, NY') + * .setDestination('Central Park, New York, NY') + * .setMode(Maps.DirectionFinder.Mode.DRIVING) + * .getDirections(); + * var route = directions.routes[0]; + * + * // Set up marker styles. + * var markerSize = Maps.StaticMap.MarkerSize.MID; + * var markerColor = Maps.StaticMap.Color.GREEN + * var markerLetterCode = 'A'.charCodeAt(); + * + * // Add markers to the map. + * var map = Maps.newStaticMap(); + * for (var i = 0; i < route.legs.length; i++) { + * var leg = route.legs[i]; + * if (i == 0) { + * // Add a marker for the start location of the first leg only. + * map.setMarkerStyle(markerSize, markerColor, String.fromCharCode(markerLetterCode)); + * map.addMarker(leg.start_location.lat, leg.start_location.lng); + * markerLetterCode++; + * } + * map.setMarkerStyle(markerSize, markerColor, String.fromCharCode(markerLetterCode)); + * map.addMarker(leg.end_location.lat, leg.end_location.lng); + * markerLetterCode++; + * } + * + * // Add a path for the entire route. + * map.addPath(route.overview_polyline.points); + * + * // Send the map in an email. + * var toAddress = Session.getActiveUser().getEmail(); + * MailApp.sendEmail(toAddress, 'Directions', 'Please open: ' + map.getMapUrl(), { + * htmlBody: 'See below.
', + * inlineImages: { + * mapImage: Utilities.newBlob(map.getMapImage(), 'image/png') + * } + * }); + * + * See also + * + * Google Directions API + */ + export interface DirectionFinder { + addWaypoint(latitude: Number, longitude: Number): DirectionFinder; + addWaypoint(address: string): DirectionFinder; + clearWaypoints(): DirectionFinder; + getDirections(): Object; + setAlternatives(useAlternatives: boolean): DirectionFinder; + setArrive(time: Date): DirectionFinder; + setAvoid(avoid: string): DirectionFinder; + setDepart(time: Date): DirectionFinder; + setDestination(latitude: Number, longitude: Number): DirectionFinder; + setDestination(address: string): DirectionFinder; + setLanguage(language: string): DirectionFinder; + setMode(mode: string): DirectionFinder; + setOptimizeWaypoints(optimizeOrder: boolean): DirectionFinder; + setOrigin(latitude: Number, longitude: Number): DirectionFinder; + setOrigin(address: string): DirectionFinder; + setRegion(region: string): DirectionFinder; + } + + /** + * A collection of enums used by DirectionFinder. + */ + export interface DirectionFinderEnums { + Avoid: Avoid + Mode: Mode + } + + /** + * Allows for the sampling of elevations at particular locations. + * + * The example below shows how you can use this class to determine the highest point along the route + * from Denver to Grand Junction in Colorado, plot it on a map, and save the map to Google Drive. + * + * // Get directions from Denver to Grand Junction. + * var directions = Maps.newDirectionFinder() + * .setOrigin('Denver, CO') + * .setDestination('Grand Junction, CO') + * .setMode(Maps.DirectionFinder.Mode.DRIVING) + * .getDirections(); + * var route = directions.routes[0]; + * + * // Get elevation samples along the route. + * var numberOfSamples = 30; + * var response = Maps.newElevationSampler() + * .samplePath(route.overview_polyline.points, numberOfSamples) + * + * // Determine highest point. + * var maxElevation = Number.MIN_VALUE; + * var highestPoint = null; + * for (var i = 0; i < response.results.length; i++) { + * var sample = response.results[i]; + * if (sample.elevation > maxElevation) { + * maxElevation = sample.elevation; + * highestPoint = sample.location; + * } + * } + * + * // Add the path and marker to a map. + * var map = Maps.newStaticMap() + * .addPath(route.overview_polyline.points) + * .addMarker(highestPoint.lat, highestPoint.lng); + * + * // Save the map to your drive + * DocsList.createFile(Utilities.newBlob(map.getMapImage(), 'image/png', 'map.png')); + * + * See also + * + * Google Elevation API + */ + export interface ElevationSampler { + sampleLocation(latitude: Number, longitude: Number): Object; + sampleLocations(points: Number[]): Object; + sampleLocations(encodedPolyline: string): Object; + samplePath(points: Number[], numSamples: Integer): Object; + samplePath(encodedPolyline: string, numSamples: Integer): Object; + } + + /** + * An enum representing the format of the map image. + * See also + * + * Google Static Maps API + */ + export enum Format { PNG, PNG8, PNG32, GIF, JPG, JPG_BASELINE } + + /** + * Allows for the conversion between an address and geographical coordinates. + * + * The example below shows how you can use this class find the top nine matches for the location + * "Main St" in Colorado, add them to a map, and then embed it in a new Google Doc. + * + * // Find the best matches for "Main St" in Colorado. + * var response = Maps.newGeocoder() + * // The latitudes and longitudes of southwest and northeast corners of Colorado, respectively. + * .setBounds(36.998166, -109.045486, 41.001666,-102.052002) + * .geocode('Main St'); + * + * // Create a Google Doc and map. + * var doc = DocumentApp.create('My Map'); + * var map = Maps.newStaticMap(); + * + * // Add each result to the map and doc. + * for (var i = 0; i < response.results.length && i < 9; i++) { + * var result = response.results[i]; + * map.setMarkerStyle(null, null, i + 1); + * map.addMarker(result.geometry.location.lat, result.geometry.location.lng); + * doc.appendListItem(result.formatted_address); + * } + * + * // Add the finished map to the doc. + * doc.appendImage(Utilities.newBlob(map.getMapImage(), 'image/png')); + * + * See also + * + * Google Geocoding API + */ + export interface Geocoder { + geocode(address: string): Object; + reverseGeocode(latitude: Number, longitude: Number): Object; + reverseGeocode(swLatitude: Number, swLongitude: Number, neLatitude: Number, neLongitude: Number): Object; + setBounds(swLatitude: Number, swLongitude: Number, neLatitude: Number, neLongitude: Number): Geocoder; + setLanguage(language: string): Geocoder; + setRegion(region: string): Geocoder; + } + + /** + * Allows for direction finding, geocoding, elevation sampling and the creation of static map + * images. + */ + export interface Maps { + DirectionFinder: DirectionFinderEnums + StaticMap: StaticMapEnums + decodePolyline(polyline: string): Number[]; + encodePolyline(points: Number[]): string; + newDirectionFinder(): DirectionFinder; + newElevationSampler(): ElevationSampler; + newGeocoder(): Geocoder; + newStaticMap(): StaticMap; + setAuthentication(clientId: string, signingKey: string): void; + } + + /** + * An enum representing the size of a marker added to a map. + * See also + * + * Google Static Maps API + */ + export enum MarkerSize { TINY, MID, SMALL } + + /** + * An enum representing the mode of travel to use when finding directions. + */ + export enum Mode { DRIVING, WALKING, BICYCLING, TRANSIT } + + /** + * Allows for the creation and decoration of static map images. + * + * The example below shows how you can use this class to create a map of New York City's Theatre + * District, including nearby train stations, and display it in a simple web app. + * + * function doGet(event) { + * // Create a map centered on Times Square. + * var map = Maps.newStaticMap() + * .setSize(600, 600) + * .setCenter('Times Square, New York, NY'); + * + * // Add markers for the nearbye train stations. + * map.setMarkerStyle(Maps.StaticMap.MarkerSize.MID, Maps.StaticMap.Color.RED, 'T'); + * map.addMarker('Grand Central Station, New York, NY'); + * map.addMarker('Penn Station, New York, NY'); + * + * // Show the boundaries of the Theatre District. + * var corners = [ + * '8th Ave & 53rd St, New York, NY', + * '6th Ave & 53rd St, New York, NY', + * '6th Ave & 40th St, New York, NY', + * '8th Ave & 40th St, New York, NY' + * ]; + * map.setPathStyle(4, Maps.StaticMap.Color.BLACK, Maps.StaticMap.Color.BLUE); + * map.beginPath(); + * for (var i = 0; i < corners.length; i++) { + * map.addAddress(corners[i]); + * } + * + * // Create the user interface and add the map image. + * var app = UiApp.createApplication().setTitle('NYC Theatre District'); + * app.add(app.createImage(map.getMapUrl())); + * return app; + * } + * + * See also + * + * Google Static Maps API + */ + export interface StaticMap { + addAddress(address: string): StaticMap; + addMarker(latitude: Number, longitude: Number): StaticMap; + addMarker(address: string): StaticMap; + addPath(points: Number[]): StaticMap; + addPath(polyline: string): StaticMap; + addPoint(latitude: Number, longitude: Number): StaticMap; + addVisible(latitude: Number, longitude: Number): StaticMap; + addVisible(address: string): StaticMap; + beginPath(): StaticMap; + clearMarkers(): StaticMap; + clearPaths(): StaticMap; + clearVisibles(): StaticMap; + endPath(): StaticMap; + getAs(contentType: string): Base.Blob; + getBlob(): Base.Blob; + getMapImage(): Byte[]; + getMapUrl(): string; + setCenter(latitude: Number, longitude: Number): StaticMap; + setCenter(address: string): StaticMap; + setCustomMarkerStyle(imageUrl: string, useShadow: boolean): StaticMap; + setFormat(format: string): StaticMap; + setLanguage(language: string): StaticMap; + setMapType(mapType: string): StaticMap; + setMarkerStyle(size: string, color: string, label: string): StaticMap; + setMobile(useMobileTiles: boolean): StaticMap; + setPathStyle(weight: Integer, color: string, fillColor: string): StaticMap; + setSize(width: Integer, height: Integer): StaticMap; + setZoom(zoom: Integer): StaticMap; + } + + /** + * A collection of enums used by StaticMap. + */ + export interface StaticMapEnums { + Color: Color + Format: Format + MarkerSize: MarkerSize + Type: Type + } + + /** + * An enum representing the type of map to render. + * See also + * + * Google Static Maps API + */ + export enum Type { ROADMAP, SATELLITE, TERRAIN, HYBRID } + + } +} + +declare var Maps: GoogleAppsScript.Maps.Maps; \ No newline at end of file diff --git a/google-apps-script/google-apps-script.optimization.d.ts b/google-apps-script/google-apps-script.optimization.d.ts new file mode 100644 index 000000000..f4371eef1 --- /dev/null +++ b/google-apps-script/google-apps-script.optimization.d.ts @@ -0,0 +1,228 @@ +// Type definitions for Google Apps Script 2015-11-12 +// Project: https://developers.google.com/apps-script/ +// Definitions by: motemen +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare module GoogleAppsScript { + export module Optimization { + /** + * Object storing a linear constraint of the form lowerBound ≤ Sum(a(i) x(i)) ≤ upperBound + * where lowerBound and upperBound are constants, a(i) are constant + * coefficients and x(i) are variables (unknowns). + * + * The example below creates one variable x with values between 0 and 5 and + * creates the constraint 0 ≤ 2 * x ≤ 5. This is done by first creating a constraint with + * the lower bound 5 and upper bound 5. Then the coefficient for variable x + * in this constraint is set to 2. + * + * var engine = LinearOptimizationService.createEngine(); + * // Create a variable so we can add it to the constraint + * engine.addVariable('x', 0, 5); + * // Create a linear constraint with the bounds 0 and 10 + * var constraint = engine.addConstraint(0, 10); + * // Set the coefficient of the variable in the constraint. The constraint is now: + * // 0 <= 2 * x <= 5 + * constraint.setCoefficient('x', 2); + */ + export interface LinearOptimizationConstraint { + setCoefficient(variableName: string, coefficient: Number): LinearOptimizationConstraint; + } + + /** + * The engine used to model and solve a linear program. The example below solves the following + * linear program: + * + * Two variables, x and y: + * + * 0 ≤ x ≤ 10 + * + * 0 ≤ y ≤ 5 + * + * Constraints: + * + * 0 ≤ 2 * x + 5 * y ≤ 10 + * + * 0 ≤ 10 * x + 3 * y ≤ 20 + * + * Objective: + * Maximize x + y + * + * var engine = LinearOptimizationService.createEngine(); + * + * // Add variables, constraints and define the objective with addVariable(), addConstraint(), etc + * // Add two variables, 0 <= x <= 10 and 0 <= y <= 5 + * engine.addVariable('x', 0, 10); + * engine.addVariable('y', 0, 5); + * + * // Create the constraint: 0 <= 2 * x + 5 * y <= 10 + * var constraint = engine.addConstraint(0, 10); + * constraint.setCoefficient('x', 2); + * constraint.setCoefficient('y', 5); + * + * // Create the constraint: 0 <= 10 * x + 3 * y <= 20 + * var constraint = engine.addConstraint(0, 20); + * constraint.setCoefficient('x', 10); + * constraint.setCoefficient('y', 3); + * + * // Set the objective to be x + y + * engine.setObjectiveCoefficient('x', 1); + * engine.setObjectiveCoefficient('y', 1); + * + * // Engine should maximize the objective + * engine.setMaximization(); + * + * // Solve the linear program + * var solution = engine.solve(); + * if (!solution.isValid()) { + * Logger.log('No solution ' + solution.getStatus()); + * } else { + * Logger.log('Value of x: ' + solution.getVariableValue('x')); + * Logger.log('Value of y: ' + solution.getVariableValue('y')); + * } + */ + export interface LinearOptimizationEngine { + addConstraint(lowerBound: Number, upperBound: Number): LinearOptimizationConstraint; + addVariable(name: string, lowerBound: Number, upperBound: Number): LinearOptimizationEngine; + addVariable(name: string, lowerBound: Number, upperBound: Number, type: VariableType): LinearOptimizationEngine; + setMaximization(): LinearOptimizationEngine; + setMinimization(): LinearOptimizationEngine; + setObjectiveCoefficient(variableName: string, coefficient: Number): LinearOptimizationEngine; + solve(): LinearOptimizationSolution; + solve(seconds: Number): LinearOptimizationSolution; + } + + /** + * The linear optimization service, used to model and solve linear and mixed-integer linear + * programs. The example below solves the following linear program: + * + * Two variables, x and y: + * + * 0 ≤ x ≤ 10 + * + * 0 ≤ y ≤ 5 + * + * Constraints: + * + * 0 ≤ 2 * x + 5 * y ≤ 10 + * + * 0 ≤ 10 * x + 3 * y ≤ 20 + * + * Objective: + * Maximize x + y + * + * var engine = LinearOptimizationService.createEngine(); + * + * // Add variables, constraints and define the objective using addVariable(), addConstraint(), etc. + * // Add two variables, 0 <= x <= 10 and 0 <= y <= 5 + * engine.addVariable('x', 0, 10); + * engine.addVariable('y', 0, 5); + * + * // Create the constraint: 0 <= 2 * x + 5 * y <= 10 + * var constraint = engine.addConstraint(0, 10); + * constraint.setCoefficient('x', 2); + * constraint.setCoefficient('y', 5); + * + * // Create the constraint: 0 <= 10 * x + 3 * y <= 20 + * var constraint = engine.addConstraint(0, 20); + * constraint.setCoefficient('x', 10); + * constraint.setCoefficient('y', 3); + * + * // Set the objective to be x + y + * engine.setObjectiveCoefficient('x', 1); + * engine.setObjectiveCoefficient('y', 1); + * + * // Engine should maximize the objective. + * engine.setMaximization(); + * + * // Solve the linear program + * var solution = engine.solve(); + * if (!solution.isValid()) { + * Logger.log('No solution ' + solution.getStatus()); + * } else { + * Logger.log('Value of x: ' + solution.getVariableValue('x')); + * Logger.log('Value of y: ' + solution.getVariableValue('y')); + * } + */ + export interface LinearOptimizationService { + Status: Status + VariableType: VariableType + createEngine(): LinearOptimizationEngine; + } + + /** + * The solution of a linear program. The example below solves the following linear program: + * + * Two variables, x and y: + * + * 0 ≤ x ≤ 10 + * + * 0 ≤ y ≤ 5 + * + * Constraints: + * + * 0 ≤ 2 * x + 5 * y ≤ 10 + * + * 0 ≤ 10 * x + 3 * y ≤ 20 + * + * Objective: + * Maximize x + y + * + * var engine = LinearOptimizationService.createEngine(); + * + * // Add variables, constraints and define the objective with addVariable(), addConstraint(), etc. + * // Add two variables, 0 <= x <= 10 and 0 <= y <= 5 + * engine.addVariable('x', 0, 10); + * engine.addVariable('y', 0, 5); + * + * // Create the constraint: 0 <= 2 * x + 5 * y <= 10 + * var constraint = engine.addConstraint(0, 10); + * constraint.setCoefficient('x', 2); + * constraint.setCoefficient('y', 5); + * + * // Create the constraint: 0 <= 10 * x + 3 * y <= 20 + * var constraint = engine.addConstraint(0, 20); + * constraint.setCoefficient('x', 10); + * constraint.setCoefficient('y', 3); + * + * // Set the objective to be x + y + * engine.setObjectiveCoefficient('x', 1); + * engine.setObjectiveCoefficient('y', 1); + * + * // Engine should maximize the objective + * engine.setMaximization(); + * + * // Solve the linear program + * var solution = engine.solve(); + * if (!solution.isValid()) { + * Logger.log('No solution ' + solution.getStatus()); + * } else { + * Logger.log('Objective value: ' + solution.getObjectiveValue()); + * Logger.log('Value of x: ' + solution.getVariableValue('x')); + * Logger.log('Value of y: ' + solution.getVariableValue('y')); + * } + */ + export interface LinearOptimizationSolution { + getObjectiveValue(): Number; + getStatus(): Status; + getVariableValue(variableName: string): Number; + isValid(): boolean; + } + + /** + * Status of the solution. Before solving a problem the status will be NOT_SOLVED; + * afterwards it will take any of the other values depending if it successfully found a solution and + * if the solution is optimal. + */ + export enum Status { OPTIMAL, FEASIBLE, INFEASIBLE, UNBOUNDED, ABNORMAL, MODEL_INVALID, NOT_SOLVED } + + /** + * Type of variables created by the engine. + */ + export enum VariableType { INTEGER, CONTINUOUS } + + } +} + +declare var LinearOptimizationService: GoogleAppsScript.Optimization.LinearOptimizationService; \ No newline at end of file diff --git a/google-apps-script/google-apps-script.properties.d.ts b/google-apps-script/google-apps-script.properties.d.ts new file mode 100644 index 000000000..8bd5ecc28 --- /dev/null +++ b/google-apps-script/google-apps-script.properties.d.ts @@ -0,0 +1,91 @@ +// Type definitions for Google Apps Script 2015-11-12 +// Project: https://developers.google.com/apps-script/ +// Definitions by: motemen +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare module GoogleAppsScript { + export module Properties { + /** + * The properties object acts as the interface to access user, document, or script properties. + * The specific property type depends on which of the three methods of + * PropertiesService the script called: + * PropertiesService.getDocumentProperties(), + * PropertiesService.getUserProperties(), or + * PropertiesService.getScriptProperties(). Properties cannot be shared between scripts. For + * more information about property types, see the + * guide to the Properties service. + */ + export interface Properties { + deleteAllProperties(): Properties; + deleteProperty(key: string): Properties; + getKeys(): String[]; + getProperties(): Object; + getProperty(key: string): string; + setProperties(properties: Object): Properties; + setProperties(properties: Object, deleteAllOthers: boolean): Properties; + setProperty(key: string, value: string): Properties; + } + + /** + * Allows scripts to store simple data in key-value pairs scoped to one script, one user of a + * script, or one document in which an add-on is used. Properties cannot be shared between scripts. + * For more information about when to use each type of property, see the + * guide to the Properties service. + * + * // Sets three properties of different types. + * var documentProperties = PropertiesService.getDocumentProperties(); + * var scriptProperties = PropertiesService.getScriptProperties(); + * var userProperties = PropertiesService.getUserProperties(); + * + * documentProperties.setProperty('DAYS_TO_FETCH', '5'); + * scriptProperties.setProperty('SERVER_URL', 'http://www.example.com/MyWeatherService/'); + * userProperties.setProperty('DISPLAY_UNITS', 'metric'); + */ + export interface PropertiesService { + getDocumentProperties(): Properties; + getScriptProperties(): Properties; + getUserProperties(): Properties; + } + + /** + * + * Deprecated. This class is deprecated and should not be used in new scripts. + * Script Properties are key-value pairs stored by a script in a persistent store. Script Properties + * are scoped per script, regardless of which user runs the script. + */ + export interface ScriptProperties { + deleteAllProperties(): ScriptProperties; + deleteProperty(key: string): ScriptProperties; + getKeys(): String[]; + getProperties(): Object; + getProperty(key: string): string; + setProperties(properties: Object): ScriptProperties; + setProperties(properties: Object, deleteAllOthers: boolean): ScriptProperties; + setProperty(key: string, value: string): ScriptProperties; + } + + /** + * + * Deprecated. This class is deprecated and should not be used in new scripts. + * User Properties are key-value pairs unique to a user. User Properties are scoped per user; any + * script running under the identity of a user can access User Properties for that user only. + */ + export interface UserProperties { + deleteAllProperties(): UserProperties; + deleteProperty(key: string): UserProperties; + getKeys(): String[]; + getProperties(): Object; + getProperty(key: string): string; + setProperties(properties: Object): UserProperties; + setProperties(properties: Object, deleteAllOthers: boolean): UserProperties; + setProperty(key: string, value: string): UserProperties; + } + + } +} + +declare var PropertiesService: GoogleAppsScript.Properties.PropertiesService; +declare var ScriptProperties: GoogleAppsScript.Properties.ScriptProperties; +declare var UserProperties: GoogleAppsScript.Properties.UserProperties; \ No newline at end of file diff --git a/google-apps-script/google-apps-script.script.d.ts b/google-apps-script/google-apps-script.script.d.ts new file mode 100644 index 000000000..9cc52d80f --- /dev/null +++ b/google-apps-script/google-apps-script.script.d.ts @@ -0,0 +1,215 @@ +// Type definitions for Google Apps Script 2015-11-12 +// Project: https://developers.google.com/apps-script/ +// Definitions by: motemen +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// +/// +/// +/// +/// + +declare module GoogleAppsScript { + export module Script { + /** + * An enumeration that identifies which categories of authorized services Apps Script + * is able to execute through a triggered function. These values are exposed in + * triggered functions as the authMode + * property of the event parameter, e. For + * more information, see the + * guide to the authorization lifecycle for add-ons. + * + * function onOpen(e) { + * var menu = SpreadsheetApp.getUi().createAddonMenu(); + * if (e && e.authMode == ScriptApp.AuthMode.NONE) { + * // Add a normal menu item (works in all authorization modes). + * menu.addItem('Start workflow', 'startWorkflow'); + * } else { + * // Add a menu item based on properties (doesn't work in AuthMode.NONE). + * var properties = PropertiesService.getDocumentProperties(); + * var workflowStarted = properties.getProperty('workflowStarted'); + * if (workflowStarted) { + * menu.addItem('Check workflow status', 'checkWorkflow'); + * } else { + * menu.addItem('Start workflow', 'startWorkflow'); + * } + * // Record analytics. + * UrlFetchApp.fetch('http://www.example.com/analytics?event=open'); + * } + * menu.addToUi(); + * } + */ + export enum AuthMode { NONE, CUSTOM_FUNCTION, LIMITED, FULL } + + /** + * An object used to determine whether the user needs to authorize this script to use + * one or more services, and to provide the URL for an authorization dialog. If the script + * is published as an add-on that uses + * installable triggers, this information + * can be used to control access to sections of code for which the user lacks the necessary + * authorization. Alternately, the add-on can ask the user to open the URL for the + * authorization dialog to resolve the problem. + * + * This object is returned by + * ScriptApp.getAuthorizationInfo(authMode). In almost all cases, + * scripts should call + * ScriptApp.getAuthorizationInfo(ScriptApp.AuthMode.FULL), since no other + * authorization mode requires that users grant authorization. + */ + export interface AuthorizationInfo { + getAuthorizationStatus(): AuthorizationStatus; + getAuthorizationUrl(): string; + } + + /** + * An enumeration denoting the authorization status of a script. + */ + export enum AuthorizationStatus { REQUIRED, NOT_REQUIRED } + + /** + * A builder for clock triggers. + */ + export interface ClockTriggerBuilder { + after(durationMilliseconds: Integer): ClockTriggerBuilder; + at(date: Date): ClockTriggerBuilder; + atDate(year: Integer, month: Integer, day: Integer): ClockTriggerBuilder; + atHour(hour: Integer): ClockTriggerBuilder; + create(): Trigger; + everyDays(n: Integer): ClockTriggerBuilder; + everyHours(n: Integer): ClockTriggerBuilder; + everyMinutes(n: Integer): ClockTriggerBuilder; + everyWeeks(n: Integer): ClockTriggerBuilder; + inTimezone(timezone: string): ClockTriggerBuilder; + nearMinute(minute: Integer): ClockTriggerBuilder; + onMonthDay(day: Integer): ClockTriggerBuilder; + onWeekDay(day: Base.Weekday): ClockTriggerBuilder; + } + + /** + * A builder for document triggers. + */ + export interface DocumentTriggerBuilder { + create(): Trigger; + onOpen(): DocumentTriggerBuilder; + } + + /** + * An enumeration denoting the type of triggered event. + */ + export enum EventType { CLOCK, ON_OPEN, ON_EDIT, ON_FORM_SUBMIT, ON_CHANGE } + + /** + * A builder for form triggers. + */ + export interface FormTriggerBuilder { + create(): Trigger; + onFormSubmit(): FormTriggerBuilder; + onOpen(): FormTriggerBuilder; + } + + /** + * An enumeration that indicates how the script came to be installed as an add-on for the + * current user. + */ + export enum InstallationSource { APPS_MARKETPLACE_DOMAIN_ADD_ON, NONE, WEB_STORE_ADD_ON } + + /** + * Access and manipulate script publishing and triggers. This class allows users to create script + * triggers and control publishing the script as a service. + */ + export interface ScriptApp { + AuthMode: AuthMode + AuthorizationStatus: AuthorizationStatus + EventType: EventType + InstallationSource: InstallationSource + TriggerSource: TriggerSource + WeekDay: Base.Weekday + deleteTrigger(trigger: Trigger): void; + getAuthorizationInfo(authMode: AuthMode): AuthorizationInfo; + getInstallationSource(): InstallationSource; + getOAuthToken(): string; + getProjectKey(): string; + getProjectTriggers(): Trigger[]; + getService(): Service; + getUserTriggers(document: Document.Document): Trigger[]; + getUserTriggers(form: Forms.Form): Trigger[]; + getUserTriggers(spreadsheet: Spreadsheet.Spreadsheet): Trigger[]; + invalidateAuth(): void; + newStateToken(): StateTokenBuilder; + newTrigger(functionName: string): TriggerBuilder; + getScriptTriggers(): Trigger[]; + } + + /** + * + */ + export enum Service { MYSELF, DOMAIN, ALL } + + /** + * Builder for spreadsheet triggers. + */ + export interface SpreadsheetTriggerBuilder { + create(): Trigger; + onChange(): SpreadsheetTriggerBuilder; + onEdit(): SpreadsheetTriggerBuilder; + onFormSubmit(): SpreadsheetTriggerBuilder; + onOpen(): SpreadsheetTriggerBuilder; + } + + /** + * Allows scripts to create state tokens that can be used in callback APIs (like OAuth flows). + * + * // Reusable function to generate a callback URL, assuming the script has been published as a + * // web app (necessary to obtain the URL programmatically). If the script has not been published + * // as a web app, set `var url` in the first line to the URL of your script project (which + * // cannot be obtained programmatically). + * function getCallbackURL(callbackFunction){ + * var url = ScriptApp.getService().getUrl(); // Ends in /exec (for a web app) + * url = url.slice(0, -4) + 'usercallback?state='; // Change /exec to /usercallback + * var stateToken = ScriptApp.newStateToken() + * .withMethod(callbackFunction) + * .withTimeout(120) + * .createToken(); + * return url + stateToken; + * } + */ + export interface StateTokenBuilder { + createToken(): string; + withArgument(name: string, value: string): StateTokenBuilder; + withMethod(method: string): StateTokenBuilder; + withTimeout(seconds: Integer): StateTokenBuilder; + } + + /** + * A script trigger. + */ + export interface Trigger { + getEventType(): EventType; + getHandlerFunction(): string; + getTriggerSource(): TriggerSource; + getTriggerSourceId(): string; + getUniqueId(): string; + } + + /** + * A generic builder for script triggers. + */ + export interface TriggerBuilder { + forDocument(document: Document.Document): DocumentTriggerBuilder; + forDocument(key: string): DocumentTriggerBuilder; + forForm(form: Forms.Form): FormTriggerBuilder; + forForm(key: string): FormTriggerBuilder; + forSpreadsheet(sheet: Spreadsheet.Spreadsheet): SpreadsheetTriggerBuilder; + forSpreadsheet(key: string): SpreadsheetTriggerBuilder; + timeBased(): ClockTriggerBuilder; + } + + /** + * An enumeration denoting the source of the event that causes the trigger to fire. + */ + export enum TriggerSource { SPREADSHEETS, CLOCK, FORMS, DOCUMENTS } + + } +} + +declare var ScriptApp: GoogleAppsScript.Script.ScriptApp; \ No newline at end of file diff --git a/google-apps-script/google-apps-script.sites.d.ts b/google-apps-script/google-apps-script.sites.d.ts new file mode 100644 index 000000000..aa5f9444f --- /dev/null +++ b/google-apps-script/google-apps-script.sites.d.ts @@ -0,0 +1,241 @@ +// Type definitions for Google Apps Script 2015-11-12 +// Project: https://developers.google.com/apps-script/ +// Definitions by: motemen +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// +/// + +declare module GoogleAppsScript { + export module Sites { + /** + * A Sites Attachment such as a file attached to a page. + * + * Note that an Attachment is a Blob and can be used anywhere Blob input is expected. + * + * var filesPage = SitesApp.getSite('example.com', 'mysite').getChildByName("files"); + * var attachments = filesPage.getAttachments(); + * + * // DocsList.createFile accepts a blob input. Since an Attachment is just a blob, we can + * // just pass it directly to that method + * var file = DocsList.createFile(attachments[0]); + */ + export interface Attachment { + deleteAttachment(): void; + getAs(contentType: string): Base.Blob; + getAttachmentType(): AttachmentType; + getBlob(): Base.Blob; + getContentType(): string; + getDatePublished(): Date; + getDescription(): string; + getLastUpdated(): Date; + getParent(): Page; + getTitle(): string; + getUrl(): string; + setContentType(contentType: string): Attachment; + setDescription(description: string): Attachment; + setFrom(blob: Base.BlobSource): Attachment; + setParent(parent: Page): Attachment; + setTitle(title: string): Attachment; + setUrl(url: string): Attachment; + } + + /** + * A typesafe enum for sites attachment type. + */ + export enum AttachmentType { WEB, HOSTED } + + /** + * A Sites Column - a column from a Sites List page. + */ + export interface Column { + deleteColumn(): void; + getName(): string; + getParent(): Page; + setName(name: string): Column; + } + + /** + * A Comment attached to any Sites page. + */ + export interface Comment { + deleteComment(): void; + getAuthorEmail(): string; + getAuthorName(): string; + getContent(): string; + getDatePublished(): Date; + getLastUpdated(): Date; + getParent(): Page; + setContent(content: string): Comment; + setParent(parent: Page): Comment; + } + + /** + * A Sites ListItem - a list element from a Sites List page. + */ + export interface ListItem { + deleteListItem(): void; + getDatePublished(): Date; + getLastUpdated(): Date; + getParent(): Page; + getValueByIndex(index: Integer): string; + getValueByName(name: string): string; + setParent(parent: Page): ListItem; + setValueByIndex(index: Integer, value: string): ListItem; + setValueByName(name: string, value: string): ListItem; + } + + /** + * A Page on a Google Site. + */ + export interface Page { + addColumn(name: string): Column; + addHostedAttachment(blob: Base.BlobSource): Attachment; + addHostedAttachment(blob: Base.BlobSource, description: string): Attachment; + addListItem(values: String[]): ListItem; + addWebAttachment(title: string, description: string, url: string): Attachment; + createAnnouncement(title: string, html: string): Page; + createAnnouncement(title: string, html: string, asDraft: boolean): Page; + createAnnouncementsPage(title: string, name: string, html: string): Page; + createFileCabinetPage(title: string, name: string, html: string): Page; + createListPage(title: string, name: string, html: string, columnNames: String[]): Page; + createPageFromTemplate(title: string, name: string, template: Page): Page; + createWebPage(title: string, name: string, html: string): Page; + deletePage(): void; + getAllDescendants(): Page[]; + getAllDescendants(options: Object): Page[]; + getAnnouncements(): Page[]; + getAnnouncements(optOptions: Object): Page[]; + getAttachments(): Attachment[]; + getAttachments(optOptions: Object): Attachment[]; + getAuthors(): String[]; + getChildByName(name: string): Page; + getChildren(): Page[]; + getChildren(options: Object): Page[]; + getColumns(): Column[]; + getComments(): Comment[]; + getComments(optOptions: Object): Comment[]; + getDatePublished(): Date; + getHtmlContent(): string; + getIsDraft(): boolean; + getLastEdited(): Date; + getLastUpdated(): Date; + getListItems(): ListItem[]; + getListItems(optOptions: Object): ListItem[]; + getName(): string; + getPageType(): PageType; + getParent(): Page; + getTextContent(): string; + getTitle(): string; + getUrl(): string; + isDeleted(): boolean; + isTemplate(): boolean; + publishAsTemplate(name: string): Page; + search(query: string): Page[]; + search(query: string, options: Object): Page[]; + setHtmlContent(html: string): Page; + setIsDraft(draft: boolean): Page; + setName(name: string): Page; + setParent(parent: Page): Page; + setTitle(title: string): Page; + addComment(content: string): Comment; + getPageName(): string; + getSelfLink(): string; + } + + /** + * A typesafe enum for sites page type. + */ + export enum PageType { WEB_PAGE, LIST_PAGE, ANNOUNCEMENT, ANNOUNCEMENTS_PAGE, FILE_CABINET_PAGE } + + /** + * An object representing a Google Site. + */ + export interface Site { + addEditor(emailAddress: string): Site; + addEditor(user: Base.User): Site; + addEditors(emailAddresses: String[]): Site; + addOwner(email: string): Site; + addOwner(user: Base.User): Site; + addViewer(emailAddress: string): Site; + addViewer(user: Base.User): Site; + addViewers(emailAddresses: String[]): Site; + createAnnouncementsPage(title: string, name: string, html: string): Page; + createFileCabinetPage(title: string, name: string, html: string): Page; + createListPage(title: string, name: string, html: string, columnNames: String[]): Page; + createPageFromTemplate(title: string, name: string, template: Page): Page; + createWebPage(title: string, name: string, html: string): Page; + getAllDescendants(): Page[]; + getAllDescendants(options: Object): Page[]; + getChildByName(name: string): Page; + getChildren(): Page[]; + getChildren(options: Object): Page[]; + getEditors(): Base.User[]; + getName(): string; + getOwners(): Base.User[]; + getSummary(): string; + getTemplates(): Page[]; + getTheme(): string; + getTitle(): string; + getUrl(): string; + getViewers(): Base.User[]; + removeEditor(emailAddress: string): Site; + removeEditor(user: Base.User): Site; + removeOwner(email: string): Site; + removeOwner(user: Base.User): Site; + removeViewer(emailAddress: string): Site; + removeViewer(user: Base.User): Site; + search(query: string): Page[]; + search(query: string, options: Object): Page[]; + setSummary(summary: string): Site; + setTheme(theme: string): Site; + setTitle(title: string): Site; + addCollaborator(email: string): Site; + addCollaborator(user: Base.User): Site; + createAnnouncement(title: string, html: string, parent: Page): Page; + createComment(inReplyTo: string, html: string, parent: Page): Comment; + createListItem(html: string, columnNames: String[], values: String[], parent: Page): ListItem; + createWebAttachment(title: string, url: string, parent: Page): Attachment; + deleteSite(): void; + getAnnouncements(): Page[]; + getAnnouncementsPages(): Page[]; + getAttachments(): Attachment[]; + getCollaborators(): Base.User[]; + getComments(): Comment[]; + getFileCabinetPages(): Page[]; + getListItems(): ListItem[]; + getListPages(): Page[]; + getSelfLink(): string; + getSiteName(): string; + getWebAttachments(): Attachment[]; + getWebPages(): Page[]; + removeCollaborator(email: string): Site; + removeCollaborator(user: Base.User): Site; + } + + /** + * Create and access Google Sites. + */ + export interface SitesApp { + AttachmentType: AttachmentType + PageType: PageType + copySite(domain: string, name: string, title: string, summary: string, site: Site): Site; + createSite(domain: string, name: string, title: string, summary: string): Site; + getActivePage(): Page; + getActiveSite(): Site; + getAllSites(domain: string): Site[]; + getAllSites(domain: string, start: Integer, max: Integer): Site[]; + getPageByUrl(url: string): Page; + getSite(name: string): Site; + getSite(domain: string, name: string): Site; + getSiteByUrl(url: string): Site; + getSites(): Site[]; + getSites(start: Integer, max: Integer): Site[]; + getSites(domain: string): Site[]; + getSites(domain: string, start: Integer, max: Integer): Site[]; + } + + } +} + +declare var SitesApp: GoogleAppsScript.Sites.SitesApp; \ No newline at end of file diff --git a/google-apps-script/google-apps-script.spreadsheet.d.ts b/google-apps-script/google-apps-script.spreadsheet.d.ts new file mode 100644 index 000000000..aad5225d9 --- /dev/null +++ b/google-apps-script/google-apps-script.spreadsheet.d.ts @@ -0,0 +1,918 @@ +// Type definitions for Google Apps Script 2015-11-12 +// Project: https://developers.google.com/apps-script/ +// Definitions by: motemen +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// +/// +/// +/// + +declare module GoogleAppsScript { + export module Spreadsheet { + /** + * The chart's position within a sheet. Can be updated using the EmbeddedChart.modify() + * function. + * + * chart = chart.modify().setPosition(5, 5, 0, 0).build(); + * sheet.updateChart(chart); + */ + export interface ContainerInfo { + getAnchorColumn(): Integer; + getAnchorRow(): Integer; + getOffsetX(): Integer; + getOffsetY(): Integer; + } + + /** + * This class allows users to access existing data-validation rules. To create a new rule, see + * SpreadsheetApp.newDataValidation(), DataValidationBuilder, and + * Range.setDataValidation(rule). + * + * // Log information about the data-validation rule for cell A1. + * var cell = SpreadsheetApp.getActive().getRange('A1'); + * var rule = cell.getDataValidation(); + * if (rule != null) { + * var criteria = rule.getCriteriaType(); + * var args = rule.getCriteriaValues(); + * Logger.log('The data-validation rule is %s %s', criteria, args); + * } else { + * Logger.log('The cell does not have a data-validation rule.') + * } + */ + export interface DataValidation { + copy(): DataValidationBuilder; + getAllowInvalid(): boolean; + getCriteriaType(): DataValidationCriteria; + getCriteriaValues(): Object[]; + getHelpText(): string; + } + + /** + * Builder for data-validation rules. + * + * // Set the data validation for cell A1 to require a value from B1:B10. + * var cell = SpreadsheetApp.getActive().getRange('A1'); + * var range = SpreadsheetApp.getActive().getRange('B1:B10'); + * var rule = SpreadsheetApp.newDataValidation().requireValueInRange(range).build(); + * cell.setDataValidation(rule); + */ + export interface DataValidationBuilder { + build(): DataValidation; + copy(): DataValidationBuilder; + getAllowInvalid(): boolean; + getCriteriaType(): DataValidationCriteria; + getCriteriaValues(): Object[]; + getHelpText(): string; + requireDate(): DataValidationBuilder; + requireDateAfter(date: Date): DataValidationBuilder; + requireDateBefore(date: Date): DataValidationBuilder; + requireDateBetween(start: Date, end: Date): DataValidationBuilder; + requireDateEqualTo(date: Date): DataValidationBuilder; + requireDateNotBetween(start: Date, end: Date): DataValidationBuilder; + requireDateOnOrAfter(date: Date): DataValidationBuilder; + requireDateOnOrBefore(date: Date): DataValidationBuilder; + requireFormulaSatisfied(formula: string): DataValidationBuilder; + requireNumberBetween(start: Number, end: Number): DataValidationBuilder; + requireNumberEqualTo(number: Number): DataValidationBuilder; + requireNumberGreaterThan(number: Number): DataValidationBuilder; + requireNumberGreaterThanOrEqualTo(number: Number): DataValidationBuilder; + requireNumberLessThan(number: Number): DataValidationBuilder; + requireNumberLessThanOrEqualTo(number: Number): DataValidationBuilder; + requireNumberNotBetween(start: Number, end: Number): DataValidationBuilder; + requireNumberNotEqualTo(number: Number): DataValidationBuilder; + requireTextContains(text: string): DataValidationBuilder; + requireTextDoesNotContain(text: string): DataValidationBuilder; + requireTextEqualTo(text: string): DataValidationBuilder; + requireTextIsEmail(): DataValidationBuilder; + requireTextIsUrl(): DataValidationBuilder; + requireValueInList(values: String[]): DataValidationBuilder; + requireValueInList(values: String[], showDropdown: boolean): DataValidationBuilder; + requireValueInRange(range: Range): DataValidationBuilder; + requireValueInRange(range: Range, showDropdown: boolean): DataValidationBuilder; + setAllowInvalid(allowInvalidData: boolean): DataValidationBuilder; + setHelpText(helpText: string): DataValidationBuilder; + withCriteria(criteria: DataValidationCriteria, args: Object[]): DataValidationBuilder; + } + + /** + * An enumeration representing the data-validation criteria that can be set on a range. + * + * // Change existing data-validation rules that require a date in 2013 to require a date in 2014. + * var oldDates = [new Date('1/1/2013'), new Date('12/31/2013')]; + * var newDates = [new Date('1/1/2014'), new Date('12/31/2014')]; + * var sheet = SpreadsheetApp.getActiveSheet(); + * var range = sheet.getRange(1, 1, sheet.getMaxRows(), sheet.getMaxColumns()); + * var rules = range.getDataValidations(); + * + * for (var i = 0; i < rules.length; i++) { + * for (var j = 0; j < rules[i].length; j++) { + * var rule = rules[i][j]; + * + * if (rule != null) { + * var criteria = rule.getCriteriaType(); + * var args = rule.getCriteriaValues(); + * + * if (criteria == SpreadsheetApp.DataValidationCriteria.DATE_BETWEEN + * && args[0].getTime() == oldDates[0].getTime() + * && args[1].getTime() == oldDates[1].getTime()) { + * // Create a builder from the existing rule, then change the dates. + * rules[i][j] = rule.copy().withCriteria(criteria, newDates).build(); + * } + * } + * } + * } + * range.setDataValidations(rules); + */ + export enum DataValidationCriteria { DATE_AFTER, DATE_BEFORE, DATE_BETWEEN, DATE_EQUAL_TO, DATE_IS_VALID_DATE, DATE_NOT_BETWEEN, DATE_ON_OR_AFTER, DATE_ON_OR_BEFORE, NUMBER_BETWEEN, NUMBER_EQUAL_TO, NUMBER_GREATER_THAN, NUMBER_GREATER_THAN_OR_EQUAL_TO, NUMBER_LESS_THAN, NUMBER_LESS_THAN_OR_EQUAL_TO, NUMBER_NOT_BETWEEN, NUMBER_NOT_EQUAL_TO, TEXT_CONTAINS, TEXT_DOES_NOT_CONTAIN, TEXT_EQUAL_TO, TEXT_IS_VALID_EMAIL, TEXT_IS_VALID_URL, VALUE_IN_LIST, VALUE_IN_RANGE, CUSTOM_FORMULA } + + /** + * Builder for area charts. For more details, see the Gviz + * documentation. + */ + export interface EmbeddedAreaChartBuilder { + addRange(range: Range): EmbeddedChartBuilder; + asAreaChart(): EmbeddedAreaChartBuilder; + asBarChart(): EmbeddedBarChartBuilder; + asColumnChart(): EmbeddedColumnChartBuilder; + asLineChart(): EmbeddedLineChartBuilder; + asPieChart(): EmbeddedPieChartBuilder; + asScatterChart(): EmbeddedScatterChartBuilder; + asTableChart(): EmbeddedTableChartBuilder; + build(): EmbeddedChart; + getChartType(): Charts.ChartType; + getContainer(): ContainerInfo; + getRanges(): Range[]; + removeRange(range: Range): EmbeddedChartBuilder; + reverseCategories(): EmbeddedAreaChartBuilder; + setBackgroundColor(cssValue: string): EmbeddedAreaChartBuilder; + setChartType(type: Charts.ChartType): EmbeddedChartBuilder; + setColors(cssValues: String[]): EmbeddedAreaChartBuilder; + setLegendPosition(position: Charts.Position): EmbeddedAreaChartBuilder; + setLegendTextStyle(textStyle: Charts.TextStyle): EmbeddedAreaChartBuilder; + setOption(option: string, value: Object): EmbeddedChartBuilder; + setPointStyle(style: Charts.PointStyle): EmbeddedAreaChartBuilder; + setPosition(anchorRowPos: Integer, anchorColPos: Integer, offsetX: Integer, offsetY: Integer): EmbeddedChartBuilder; + setRange(start: Number, end: Number): EmbeddedAreaChartBuilder; + setStacked(): EmbeddedAreaChartBuilder; + setTitle(chartTitle: string): EmbeddedAreaChartBuilder; + setTitleTextStyle(textStyle: Charts.TextStyle): EmbeddedAreaChartBuilder; + setXAxisTextStyle(textStyle: Charts.TextStyle): EmbeddedAreaChartBuilder; + setXAxisTitle(title: string): EmbeddedAreaChartBuilder; + setXAxisTitleTextStyle(textStyle: Charts.TextStyle): EmbeddedAreaChartBuilder; + setYAxisTextStyle(textStyle: Charts.TextStyle): EmbeddedAreaChartBuilder; + setYAxisTitle(title: string): EmbeddedAreaChartBuilder; + setYAxisTitleTextStyle(textStyle: Charts.TextStyle): EmbeddedAreaChartBuilder; + useLogScale(): EmbeddedAreaChartBuilder; + } + + /** + * Builder for bar charts. For more details, see the Gviz + * documentation. + */ + export interface EmbeddedBarChartBuilder { + addRange(range: Range): EmbeddedChartBuilder; + asAreaChart(): EmbeddedAreaChartBuilder; + asBarChart(): EmbeddedBarChartBuilder; + asColumnChart(): EmbeddedColumnChartBuilder; + asLineChart(): EmbeddedLineChartBuilder; + asPieChart(): EmbeddedPieChartBuilder; + asScatterChart(): EmbeddedScatterChartBuilder; + asTableChart(): EmbeddedTableChartBuilder; + build(): EmbeddedChart; + getChartType(): Charts.ChartType; + getContainer(): ContainerInfo; + getRanges(): Range[]; + removeRange(range: Range): EmbeddedChartBuilder; + reverseCategories(): EmbeddedBarChartBuilder; + reverseDirection(): EmbeddedBarChartBuilder; + setBackgroundColor(cssValue: string): EmbeddedBarChartBuilder; + setChartType(type: Charts.ChartType): EmbeddedChartBuilder; + setColors(cssValues: String[]): EmbeddedBarChartBuilder; + setLegendPosition(position: Charts.Position): EmbeddedBarChartBuilder; + setLegendTextStyle(textStyle: Charts.TextStyle): EmbeddedBarChartBuilder; + setOption(option: string, value: Object): EmbeddedChartBuilder; + setPosition(anchorRowPos: Integer, anchorColPos: Integer, offsetX: Integer, offsetY: Integer): EmbeddedChartBuilder; + setRange(start: Number, end: Number): EmbeddedBarChartBuilder; + setStacked(): EmbeddedBarChartBuilder; + setTitle(chartTitle: string): EmbeddedBarChartBuilder; + setTitleTextStyle(textStyle: Charts.TextStyle): EmbeddedBarChartBuilder; + setXAxisTextStyle(textStyle: Charts.TextStyle): EmbeddedBarChartBuilder; + setXAxisTitle(title: string): EmbeddedBarChartBuilder; + setXAxisTitleTextStyle(textStyle: Charts.TextStyle): EmbeddedBarChartBuilder; + setYAxisTextStyle(textStyle: Charts.TextStyle): EmbeddedBarChartBuilder; + setYAxisTitle(title: string): EmbeddedBarChartBuilder; + setYAxisTitleTextStyle(textStyle: Charts.TextStyle): EmbeddedBarChartBuilder; + useLogScale(): EmbeddedBarChartBuilder; + } + + /** + * Represents a chart that has been embedded into a Spreadsheet. + * + * This example shows how to modify an existing chart: + * + * var sheet = SpreadsheetApp.getActiveSheet(); + * var range = sheet.getRange("A2:B8") + * var chart = sheet.getCharts()[0]; + * chart = chart.modify() + * .addRange(range) + * .setOption('title', 'Updated!') + * .setOption('animation.duration', 500) + * .setPosition(2,2,0,0) + * .build(); + * sheet.updateChart(chart); + * + * This example shows how to create a new chart: + * + * function newChart(range, sheet) { + * var sheet = SpreadsheetApp.getActiveSheet(); + * var chartBuilder = sheet.newChart(); + * chartBuilder.addRange(range) + * .setChartType(Charts.ChartType.LINE) + * .setOption('title', 'My Line Chart!'); + * sheet.insertChart(chartBuilder.build()); + * } + */ + export interface EmbeddedChart { + getAs(contentType: string): Base.Blob; + getBlob(): Base.Blob; + getContainerInfo(): ContainerInfo; + getId(): string; + getOptions(): Charts.ChartOptions; + getRanges(): Range[]; + getType(): string; + modify(): EmbeddedChartBuilder; + setId(id: string): Charts.Chart; + } + + /** + * This builder allows you to edit an EmbeddedChart. Make sure to call + * sheet.updateChart(builder.build()) to save your changes. + * + * var sheet = SpreadsheetApp.getActiveSheet(); + * var range = sheet.getRange("A1:B8"); + * var chart = sheet.getCharts()[0]; + * chart = chart.modify() + * .addRange(range) + * .setOption('title', 'Updated!') + * .setOption('animation.duration', 500) + * .setPosition(2,2,0,0) + * .build(); + * sheet.updateChart(chart); + */ + export interface EmbeddedChartBuilder { + addRange(range: Range): EmbeddedChartBuilder; + asAreaChart(): EmbeddedAreaChartBuilder; + asBarChart(): EmbeddedBarChartBuilder; + asColumnChart(): EmbeddedColumnChartBuilder; + asLineChart(): EmbeddedLineChartBuilder; + asPieChart(): EmbeddedPieChartBuilder; + asScatterChart(): EmbeddedScatterChartBuilder; + asTableChart(): EmbeddedTableChartBuilder; + build(): EmbeddedChart; + getChartType(): Charts.ChartType; + getContainer(): ContainerInfo; + getRanges(): Range[]; + removeRange(range: Range): EmbeddedChartBuilder; + setChartType(type: Charts.ChartType): EmbeddedChartBuilder; + setOption(option: string, value: Object): EmbeddedChartBuilder; + setPosition(anchorRowPos: Integer, anchorColPos: Integer, offsetX: Integer, offsetY: Integer): EmbeddedChartBuilder; + } + + /** + * Builder for column charts. For more details, see the Gviz + * documentation. + */ + export interface EmbeddedColumnChartBuilder { + addRange(range: Range): EmbeddedChartBuilder; + asAreaChart(): EmbeddedAreaChartBuilder; + asBarChart(): EmbeddedBarChartBuilder; + asColumnChart(): EmbeddedColumnChartBuilder; + asLineChart(): EmbeddedLineChartBuilder; + asPieChart(): EmbeddedPieChartBuilder; + asScatterChart(): EmbeddedScatterChartBuilder; + asTableChart(): EmbeddedTableChartBuilder; + build(): EmbeddedChart; + getChartType(): Charts.ChartType; + getContainer(): ContainerInfo; + getRanges(): Range[]; + removeRange(range: Range): EmbeddedChartBuilder; + reverseCategories(): EmbeddedColumnChartBuilder; + setBackgroundColor(cssValue: string): EmbeddedColumnChartBuilder; + setChartType(type: Charts.ChartType): EmbeddedChartBuilder; + setColors(cssValues: String[]): EmbeddedColumnChartBuilder; + setLegendPosition(position: Charts.Position): EmbeddedColumnChartBuilder; + setLegendTextStyle(textStyle: Charts.TextStyle): EmbeddedColumnChartBuilder; + setOption(option: string, value: Object): EmbeddedChartBuilder; + setPosition(anchorRowPos: Integer, anchorColPos: Integer, offsetX: Integer, offsetY: Integer): EmbeddedChartBuilder; + setRange(start: Number, end: Number): EmbeddedColumnChartBuilder; + setStacked(): EmbeddedColumnChartBuilder; + setTitle(chartTitle: string): EmbeddedColumnChartBuilder; + setTitleTextStyle(textStyle: Charts.TextStyle): EmbeddedColumnChartBuilder; + setXAxisTextStyle(textStyle: Charts.TextStyle): EmbeddedColumnChartBuilder; + setXAxisTitle(title: string): EmbeddedColumnChartBuilder; + setXAxisTitleTextStyle(textStyle: Charts.TextStyle): EmbeddedColumnChartBuilder; + setYAxisTextStyle(textStyle: Charts.TextStyle): EmbeddedColumnChartBuilder; + setYAxisTitle(title: string): EmbeddedColumnChartBuilder; + setYAxisTitleTextStyle(textStyle: Charts.TextStyle): EmbeddedColumnChartBuilder; + useLogScale(): EmbeddedColumnChartBuilder; + } + + /** + * Builder for line charts. For more details, see the Gviz + * documentation. + */ + export interface EmbeddedLineChartBuilder { + addRange(range: Range): EmbeddedChartBuilder; + asAreaChart(): EmbeddedAreaChartBuilder; + asBarChart(): EmbeddedBarChartBuilder; + asColumnChart(): EmbeddedColumnChartBuilder; + asLineChart(): EmbeddedLineChartBuilder; + asPieChart(): EmbeddedPieChartBuilder; + asScatterChart(): EmbeddedScatterChartBuilder; + asTableChart(): EmbeddedTableChartBuilder; + build(): EmbeddedChart; + getChartType(): Charts.ChartType; + getContainer(): ContainerInfo; + getRanges(): Range[]; + removeRange(range: Range): EmbeddedChartBuilder; + reverseCategories(): EmbeddedLineChartBuilder; + setBackgroundColor(cssValue: string): EmbeddedLineChartBuilder; + setChartType(type: Charts.ChartType): EmbeddedChartBuilder; + setColors(cssValues: String[]): EmbeddedLineChartBuilder; + setCurveStyle(style: Charts.CurveStyle): EmbeddedLineChartBuilder; + setLegendPosition(position: Charts.Position): EmbeddedLineChartBuilder; + setLegendTextStyle(textStyle: Charts.TextStyle): EmbeddedLineChartBuilder; + setOption(option: string, value: Object): EmbeddedChartBuilder; + setPointStyle(style: Charts.PointStyle): EmbeddedLineChartBuilder; + setPosition(anchorRowPos: Integer, anchorColPos: Integer, offsetX: Integer, offsetY: Integer): EmbeddedChartBuilder; + setRange(start: Number, end: Number): EmbeddedLineChartBuilder; + setTitle(chartTitle: string): EmbeddedLineChartBuilder; + setTitleTextStyle(textStyle: Charts.TextStyle): EmbeddedLineChartBuilder; + setXAxisTextStyle(textStyle: Charts.TextStyle): EmbeddedLineChartBuilder; + setXAxisTitle(title: string): EmbeddedLineChartBuilder; + setXAxisTitleTextStyle(textStyle: Charts.TextStyle): EmbeddedLineChartBuilder; + setYAxisTextStyle(textStyle: Charts.TextStyle): EmbeddedLineChartBuilder; + setYAxisTitle(title: string): EmbeddedLineChartBuilder; + setYAxisTitleTextStyle(textStyle: Charts.TextStyle): EmbeddedLineChartBuilder; + useLogScale(): EmbeddedLineChartBuilder; + } + + /** + * Builder for pie charts. For more details, see the Gviz + * documentation. + */ + export interface EmbeddedPieChartBuilder { + addRange(range: Range): EmbeddedChartBuilder; + asAreaChart(): EmbeddedAreaChartBuilder; + asBarChart(): EmbeddedBarChartBuilder; + asColumnChart(): EmbeddedColumnChartBuilder; + asLineChart(): EmbeddedLineChartBuilder; + asPieChart(): EmbeddedPieChartBuilder; + asScatterChart(): EmbeddedScatterChartBuilder; + asTableChart(): EmbeddedTableChartBuilder; + build(): EmbeddedChart; + getChartType(): Charts.ChartType; + getContainer(): ContainerInfo; + getRanges(): Range[]; + removeRange(range: Range): EmbeddedChartBuilder; + reverseCategories(): EmbeddedPieChartBuilder; + set3D(): EmbeddedPieChartBuilder; + setBackgroundColor(cssValue: string): EmbeddedPieChartBuilder; + setChartType(type: Charts.ChartType): EmbeddedChartBuilder; + setColors(cssValues: String[]): EmbeddedPieChartBuilder; + setLegendPosition(position: Charts.Position): EmbeddedPieChartBuilder; + setLegendTextStyle(textStyle: Charts.TextStyle): EmbeddedPieChartBuilder; + setOption(option: string, value: Object): EmbeddedChartBuilder; + setPosition(anchorRowPos: Integer, anchorColPos: Integer, offsetX: Integer, offsetY: Integer): EmbeddedChartBuilder; + setTitle(chartTitle: string): EmbeddedPieChartBuilder; + setTitleTextStyle(textStyle: Charts.TextStyle): EmbeddedPieChartBuilder; + } + + /** + * Builder for scatter charts. For more details, see the Gviz + * documentation. + */ + export interface EmbeddedScatterChartBuilder { + addRange(range: Range): EmbeddedChartBuilder; + asAreaChart(): EmbeddedAreaChartBuilder; + asBarChart(): EmbeddedBarChartBuilder; + asColumnChart(): EmbeddedColumnChartBuilder; + asLineChart(): EmbeddedLineChartBuilder; + asPieChart(): EmbeddedPieChartBuilder; + asScatterChart(): EmbeddedScatterChartBuilder; + asTableChart(): EmbeddedTableChartBuilder; + build(): EmbeddedChart; + getChartType(): Charts.ChartType; + getContainer(): ContainerInfo; + getRanges(): Range[]; + removeRange(range: Range): EmbeddedChartBuilder; + setBackgroundColor(cssValue: string): EmbeddedScatterChartBuilder; + setChartType(type: Charts.ChartType): EmbeddedChartBuilder; + setColors(cssValues: String[]): EmbeddedScatterChartBuilder; + setLegendPosition(position: Charts.Position): EmbeddedScatterChartBuilder; + setLegendTextStyle(textStyle: Charts.TextStyle): EmbeddedScatterChartBuilder; + setOption(option: string, value: Object): EmbeddedChartBuilder; + setPointStyle(style: Charts.PointStyle): EmbeddedScatterChartBuilder; + setPosition(anchorRowPos: Integer, anchorColPos: Integer, offsetX: Integer, offsetY: Integer): EmbeddedChartBuilder; + setTitle(chartTitle: string): EmbeddedScatterChartBuilder; + setTitleTextStyle(textStyle: Charts.TextStyle): EmbeddedScatterChartBuilder; + setXAxisLogScale(): EmbeddedScatterChartBuilder; + setXAxisRange(start: Number, end: Number): EmbeddedScatterChartBuilder; + setXAxisTextStyle(textStyle: Charts.TextStyle): EmbeddedScatterChartBuilder; + setXAxisTitle(title: string): EmbeddedScatterChartBuilder; + setXAxisTitleTextStyle(textStyle: Charts.TextStyle): EmbeddedScatterChartBuilder; + setYAxisLogScale(): EmbeddedScatterChartBuilder; + setYAxisRange(start: Number, end: Number): EmbeddedScatterChartBuilder; + setYAxisTextStyle(textStyle: Charts.TextStyle): EmbeddedScatterChartBuilder; + setYAxisTitle(title: string): EmbeddedScatterChartBuilder; + setYAxisTitleTextStyle(textStyle: Charts.TextStyle): EmbeddedScatterChartBuilder; + } + + /** + * Builder for table charts. For more details, see the Gviz + * documentation. + */ + export interface EmbeddedTableChartBuilder { + addRange(range: Range): EmbeddedChartBuilder; + asAreaChart(): EmbeddedAreaChartBuilder; + asBarChart(): EmbeddedBarChartBuilder; + asColumnChart(): EmbeddedColumnChartBuilder; + asLineChart(): EmbeddedLineChartBuilder; + asPieChart(): EmbeddedPieChartBuilder; + asScatterChart(): EmbeddedScatterChartBuilder; + asTableChart(): EmbeddedTableChartBuilder; + build(): EmbeddedChart; + enablePaging(enablePaging: boolean): EmbeddedTableChartBuilder; + enablePaging(pageSize: Integer): EmbeddedTableChartBuilder; + enablePaging(pageSize: Integer, startPage: Integer): EmbeddedTableChartBuilder; + enableRtlTable(rtlEnabled: boolean): EmbeddedTableChartBuilder; + enableSorting(enableSorting: boolean): EmbeddedTableChartBuilder; + getChartType(): Charts.ChartType; + getContainer(): ContainerInfo; + getRanges(): Range[]; + removeRange(range: Range): EmbeddedChartBuilder; + setChartType(type: Charts.ChartType): EmbeddedChartBuilder; + setFirstRowNumber(number: Integer): EmbeddedTableChartBuilder; + setInitialSortingAscending(column: Integer): EmbeddedTableChartBuilder; + setInitialSortingDescending(column: Integer): EmbeddedTableChartBuilder; + setOption(option: string, value: Object): EmbeddedChartBuilder; + setPosition(anchorRowPos: Integer, anchorColPos: Integer, offsetX: Integer, offsetY: Integer): EmbeddedChartBuilder; + showRowNumberColumn(showRowNumber: boolean): EmbeddedTableChartBuilder; + useAlternatingRowStyle(alternate: boolean): EmbeddedTableChartBuilder; + } + + /** + * + * Deprecated. For spreadsheets created in the newer version of Google Sheets, use the more powerful + * Protection class instead. Although this class is deprecated, it will remain + * available for compatibility with the older version of Sheets. + * Access and modify protected sheets in the older version of Google Sheets. + */ + export interface PageProtection { + addUser(email: string): void; + getUsers(): String[]; + isProtected(): boolean; + removeUser(user: string): void; + setProtected(protection: boolean): void; + } + + /** + * Access and modify protected ranges and sheets. A protected range can protect either a static + * range of cells or a named range. A protected sheet may include unprotected regions. For + * spreadsheets created with the older version of Google Sheets, use the PageProtection + * class instead. + * + * // Protect range A1:B10, then remove all other users from the list of editors. + * var ss = SpreadsheetApp.getActive(); + * var range = ss.getRange('A1:B10'); + * var protection = range.protect().setDescription('Sample protected range'); + * + * // Ensure the current user is an editor before removing others. Otherwise, if the user's edit + * // permission comes from a group, the script will throw an exception upon removing the group. + * var me = Session.getEffectiveUser(); + * protection.addEditor(me); + * protection.removeEditors(protection.getEditors()); + * if (protection.canDomainEdit()) { + * protection.setDomainEdit(false); + * } + * + * // Remove all range protections in the spreadsheet that the user has permission to edit. + * var ss = SpreadsheetApp.getActive(); + * var protections = ss.getProtections(SpreadsheetApp.ProtectionType.RANGE); + * for (var i = 0; i < protections.length; i++) { + * var protection = protections[i]; + * if (protection.canEdit()) { + * protection.remove(); + * } + * } + * + * // Protect the active sheet, then remove all other users from the list of editors. + * var sheet = SpreadsheetApp.getActiveSheet(); + * var protection = sheet.protect().setDescription('Sample protected sheet'); + * + * // Ensure the current user is an editor before removing others. Otherwise, if the user's edit + * // permission comes from a group, the script will throw an exception upon removing the group. + * var me = Session.getEffectiveUser(); + * protection.addEditor(me); + * protection.removeEditors(protection.getEditors()); + * if (protection.canDomainEdit()) { + * protection.setDomainEdit(false); + * } + */ + export interface Protection { + addEditor(emailAddress: string): Protection; + addEditor(user: Base.User): Protection; + addEditors(emailAddresses: String[]): Protection; + canDomainEdit(): boolean; + canEdit(): boolean; + getDescription(): string; + getEditors(): Base.User[]; + getProtectionType(): ProtectionType; + getRange(): Range; + getRangeName(): string; + getUnprotectedRanges(): Range[]; + isWarningOnly(): boolean; + remove(): void; + removeEditor(emailAddress: string): Protection; + removeEditor(user: Base.User): Protection; + removeEditors(emailAddresses: String[]): Protection; + setDescription(description: string): Protection; + setDomainEdit(editable: boolean): Protection; + setRange(range: Range): Protection; + setRangeName(rangeName: string): Protection; + setUnprotectedRanges(ranges: Range[]): Protection; + setWarningOnly(warningOnly: boolean): Protection; + } + + /** + * An enumeration representing the parts of a spreadsheet that can be protected from edits. + * + * // Remove all range protections in the spreadsheet that the user has permission to edit. + * var ss = SpreadsheetApp.getActive(); + * var protections = ss.getProtections(SpreadsheetApp.ProtectionType.RANGE); + * for (var i = 0; i < protections.length; i++) { + * var protection = protections[i]; + * if (protection.canEdit()) { + * protection.remove(); + * } + * } + * + * // Removes sheet protection from the active sheet, if the user has permission to edit it. + * var sheet = SpreadsheetApp.getActiveSheet(); + * var protection = sheet.getProtections(SpreadsheetApp.ProtectionType.SHEET)[0]; + * if (protection && protection.canEdit()) { + * protection.remove(); + * } + */ + export enum ProtectionType { RANGE, SHEET } + + /** + * Access and modify spreadsheet ranges. + * + * This class allows users to access and modify ranges in Google Sheets. A range can be + * a single cell in a sheet or a range of cells in a sheet. + */ + export interface Range { + activate(): Range; + breakApart(): Range; + canEdit(): boolean; + clear(): Range; + clear(options: Object): Range; + clearContent(): Range; + clearDataValidations(): Range; + clearFormat(): Range; + clearNote(): Range; + copyFormatToRange(gridId: Integer, column: Integer, columnEnd: Integer, row: Integer, rowEnd: Integer): void; + copyFormatToRange(sheet: Sheet, column: Integer, columnEnd: Integer, row: Integer, rowEnd: Integer): void; + copyTo(destination: Range): void; + copyTo(destination: Range, options: Object): void; + copyValuesToRange(gridId: Integer, column: Integer, columnEnd: Integer, row: Integer, rowEnd: Integer): void; + copyValuesToRange(sheet: Sheet, column: Integer, columnEnd: Integer, row: Integer, rowEnd: Integer): void; + getA1Notation(): string; + getBackground(): string; + getBackgrounds(): String[][]; + getCell(row: Integer, column: Integer): Range; + getColumn(): Integer; + getDataSourceUrl(): string; + getDataTable(): Charts.DataTable; + getDataTable(firstRowIsHeader: boolean): Charts.DataTable; + getDataValidation(): DataValidation; + getDataValidations(): DataValidation[][]; + getFontColor(): string; + getFontColors(): String[][]; + getFontFamilies(): String[][]; + getFontFamily(): string; + getFontLine(): string; + getFontLines(): String[][]; + getFontSize(): Integer; + getFontSizes(): Integer[][]; + getFontStyle(): string; + getFontStyles(): String[][]; + getFontWeight(): string; + getFontWeights(): String[][]; + getFormula(): string; + getFormulaR1C1(): string; + getFormulas(): String[][]; + getFormulasR1C1(): String[][]; + getGridId(): Integer; + getHeight(): Integer; + getHorizontalAlignment(): string; + getHorizontalAlignments(): String[][]; + getLastColumn(): Integer; + getLastRow(): Integer; + getNote(): string; + getNotes(): String[][]; + getNumColumns(): Integer; + getNumRows(): Integer; + getNumberFormat(): string; + getNumberFormats(): String[][]; + getRow(): Integer; + getRowIndex(): Integer; + getSheet(): Sheet; + getValue(): Object; + getValues(): Object[][]; + getVerticalAlignment(): string; + getVerticalAlignments(): String[][]; + getWidth(): Integer; + getWrap(): boolean; + getWraps(): Boolean[][]; + isBlank(): boolean; + isEndColumnBounded(): boolean; + isEndRowBounded(): boolean; + isStartColumnBounded(): boolean; + isStartRowBounded(): boolean; + merge(): Range; + mergeAcross(): Range; + mergeVertically(): Range; + moveTo(target: Range): void; + offset(rowOffset: Integer, columnOffset: Integer): Range; + offset(rowOffset: Integer, columnOffset: Integer, numRows: Integer): Range; + offset(rowOffset: Integer, columnOffset: Integer, numRows: Integer, numColumns: Integer): Range; + protect(): Protection; + setBackground(color: string): Range; + setBackgroundRGB(red: Integer, green: Integer, blue: Integer): Range; + setBackgrounds(color: String[][]): Range; + setBorder(top: boolean, left: boolean, bottom: boolean, right: boolean, vertical: boolean, horizontal: boolean): Range; + setDataValidation(rule: DataValidation): Range; + setDataValidations(rules: DataValidation[][]): Range; + setFontColor(color: string): Range; + setFontColors(colors: Object[][]): Range; + setFontFamilies(fontFamilies: Object[][]): Range; + setFontFamily(fontFamily: string): Range; + setFontLine(fontLine: string): Range; + setFontLines(fontLines: Object[][]): Range; + setFontSize(size: Integer): Range; + setFontSizes(sizes: Object[][]): Range; + setFontStyle(fontStyle: string): Range; + setFontStyles(fontStyles: Object[][]): Range; + setFontWeight(fontWeight: string): Range; + setFontWeights(fontWeights: Object[][]): Range; + setFormula(formula: string): Range; + setFormulaR1C1(formula: string): Range; + setFormulas(formulas: String[][]): Range; + setFormulasR1C1(formulas: String[][]): Range; + setHorizontalAlignment(alignment: string): Range; + setHorizontalAlignments(alignments: Object[][]): Range; + setNote(note: string): Range; + setNotes(notes: Object[][]): Range; + setNumberFormat(numberFormat: string): Range; + setNumberFormats(numberFormats: Object[][]): Range; + setValue(value: Object): Range; + setValues(values: Object[][]): Range; + setVerticalAlignment(alignment: string): Range; + setVerticalAlignments(alignments: Object[][]): Range; + setWrap(isWrapEnabled: boolean): Range; + setWraps(isWrapEnabled: Object[][]): Range; + sort(sortSpecObj: Object): Range; + } + + /** + * Access and modify spreadsheet sheets. Common operations + * are renaming a sheet and accessing range objects from the sheet. + */ + export interface Sheet { + activate(): Sheet; + appendRow(rowContents: Object[]): Sheet; + autoResizeColumn(columnPosition: Integer): Sheet; + clear(): Sheet; + clear(options: Object): Sheet; + clearContents(): Sheet; + clearFormats(): Sheet; + clearNotes(): Sheet; + copyTo(spreadsheet: Spreadsheet): Sheet; + deleteColumn(columnPosition: Integer): Sheet; + deleteColumns(columnPosition: Integer, howMany: Integer): void; + deleteRow(rowPosition: Integer): Sheet; + deleteRows(rowPosition: Integer, howMany: Integer): void; + getActiveCell(): Range; + getActiveRange(): Range; + getCharts(): EmbeddedChart[]; + getColumnWidth(columnPosition: Integer): Integer; + getDataRange(): Range; + getFrozenColumns(): Integer; + getFrozenRows(): Integer; + getIndex(): Integer; + getLastColumn(): Integer; + getLastRow(): Integer; + getMaxColumns(): Integer; + getMaxRows(): Integer; + getName(): string; + getParent(): Spreadsheet; + getProtections(type: ProtectionType): Protection[]; + getRange(row: Integer, column: Integer): Range; + getRange(row: Integer, column: Integer, numRows: Integer): Range; + getRange(row: Integer, column: Integer, numRows: Integer, numColumns: Integer): Range; + getRange(a1Notation: string): Range; + getRowHeight(rowPosition: Integer): Integer; + getSheetId(): Integer; + getSheetName(): string; + getSheetValues(startRow: Integer, startColumn: Integer, numRows: Integer, numColumns: Integer): Object[][]; + hideColumn(column: Range): void; + hideColumns(columnIndex: Integer): void; + hideColumns(columnIndex: Integer, numColumns: Integer): void; + hideRow(row: Range): void; + hideRows(rowIndex: Integer): void; + hideRows(rowIndex: Integer, numRows: Integer): void; + hideSheet(): Sheet; + insertChart(chart: EmbeddedChart): void; + insertColumnAfter(afterPosition: Integer): Sheet; + insertColumnBefore(beforePosition: Integer): Sheet; + insertColumns(columnIndex: Integer): void; + insertColumns(columnIndex: Integer, numColumns: Integer): void; + insertColumnsAfter(afterPosition: Integer, howMany: Integer): Sheet; + insertColumnsBefore(beforePosition: Integer, howMany: Integer): Sheet; + insertImage(blob: Base.Blob, column: Integer, row: Integer): void; + insertImage(blob: Base.Blob, column: Integer, row: Integer, offsetX: Integer, offsetY: Integer): void; + insertImage(url: string, column: Integer, row: Integer): void; + insertImage(url: string, column: Integer, row: Integer, offsetX: Integer, offsetY: Integer): void; + insertRowAfter(afterPosition: Integer): Sheet; + insertRowBefore(beforePosition: Integer): Sheet; + insertRows(rowIndex: Integer): void; + insertRows(rowIndex: Integer, numRows: Integer): void; + insertRowsAfter(afterPosition: Integer, howMany: Integer): Sheet; + insertRowsBefore(beforePosition: Integer, howMany: Integer): Sheet; + isSheetHidden(): boolean; + newChart(): EmbeddedChartBuilder; + protect(): Protection; + removeChart(chart: EmbeddedChart): void; + setActiveRange(range: Range): Range; + setActiveSelection(range: Range): Range; + setActiveSelection(a1Notation: string): Range; + setColumnWidth(columnPosition: Integer, width: Integer): Sheet; + setFrozenColumns(columns: Integer): void; + setFrozenRows(rows: Integer): void; + setName(name: string): Sheet; + setRowHeight(rowPosition: Integer, height: Integer): Sheet; + showColumns(columnIndex: Integer): void; + showColumns(columnIndex: Integer, numColumns: Integer): void; + showRows(rowIndex: Integer): void; + showRows(rowIndex: Integer, numRows: Integer): void; + showSheet(): Sheet; + sort(columnPosition: Integer): Sheet; + sort(columnPosition: Integer, ascending: boolean): Sheet; + unhideColumn(column: Range): void; + unhideRow(row: Range): void; + updateChart(chart: EmbeddedChart): void; + getSheetProtection(): PageProtection; + setSheetProtection(permissions: PageProtection): void; + } + + /** + * This class allows users to access and modify Google Sheets files. Common operations are adding + * new sheets and adding collaborators. + */ + export interface Spreadsheet { + addEditor(emailAddress: string): Spreadsheet; + addEditor(user: Base.User): Spreadsheet; + addEditors(emailAddresses: String[]): Spreadsheet; + addMenu(name: string, subMenus: Object[]): void; + addViewer(emailAddress: string): Spreadsheet; + addViewer(user: Base.User): Spreadsheet; + addViewers(emailAddresses: String[]): Spreadsheet; + appendRow(rowContents: Object[]): Sheet; + autoResizeColumn(columnPosition: Integer): Sheet; + copy(name: string): Spreadsheet; + deleteActiveSheet(): Sheet; + deleteColumn(columnPosition: Integer): Sheet; + deleteColumns(columnPosition: Integer, howMany: Integer): void; + deleteRow(rowPosition: Integer): Sheet; + deleteRows(rowPosition: Integer, howMany: Integer): void; + deleteSheet(sheet: Sheet): void; + duplicateActiveSheet(): Sheet; + getActiveCell(): Range; + getActiveRange(): Range; + getActiveSheet(): Sheet; + getAs(contentType: string): Base.Blob; + getBlob(): Base.Blob; + getColumnWidth(columnPosition: Integer): Integer; + getDataRange(): Range; + getEditors(): Base.User[]; + getFormUrl(): string; + getFrozenColumns(): Integer; + getFrozenRows(): Integer; + getId(): string; + getLastColumn(): Integer; + getLastRow(): Integer; + getName(): string; + getNumSheets(): Integer; + getOwner(): Base.User; + getProtections(type: ProtectionType): Protection[]; + getRange(a1Notation: string): Range; + getRangeByName(name: string): Range; + getRowHeight(rowPosition: Integer): Integer; + getSheetByName(name: string): Sheet; + getSheetId(): Integer; + getSheetName(): string; + getSheetValues(startRow: Integer, startColumn: Integer, numRows: Integer, numColumns: Integer): Object[][]; + getSheets(): Sheet[]; + getSpreadsheetLocale(): string; + getSpreadsheetTimeZone(): string; + getUrl(): string; + getViewers(): Base.User[]; + hideColumn(column: Range): void; + hideRow(row: Range): void; + insertColumnAfter(afterPosition: Integer): Sheet; + insertColumnBefore(beforePosition: Integer): Sheet; + insertColumnsAfter(afterPosition: Integer, howMany: Integer): Sheet; + insertColumnsBefore(beforePosition: Integer, howMany: Integer): Sheet; + insertImage(blob: Base.Blob, column: Integer, row: Integer): void; + insertImage(blob: Base.Blob, column: Integer, row: Integer, offsetX: Integer, offsetY: Integer): void; + insertImage(url: string, column: Integer, row: Integer): void; + insertImage(url: string, column: Integer, row: Integer, offsetX: Integer, offsetY: Integer): void; + insertRowAfter(afterPosition: Integer): Sheet; + insertRowBefore(beforePosition: Integer): Sheet; + insertRowsAfter(afterPosition: Integer, howMany: Integer): Sheet; + insertRowsBefore(beforePosition: Integer, howMany: Integer): Sheet; + insertSheet(): Sheet; + insertSheet(sheetIndex: Integer): Sheet; + insertSheet(sheetIndex: Integer, options: Object): Sheet; + insertSheet(options: Object): Sheet; + insertSheet(sheetName: string): Sheet; + insertSheet(sheetName: string, sheetIndex: Integer): Sheet; + insertSheet(sheetName: string, sheetIndex: Integer, options: Object): Sheet; + insertSheet(sheetName: string, options: Object): Sheet; + moveActiveSheet(pos: Integer): void; + removeEditor(emailAddress: string): Spreadsheet; + removeEditor(user: Base.User): Spreadsheet; + removeMenu(name: string): void; + removeNamedRange(name: string): void; + removeViewer(emailAddress: string): Spreadsheet; + removeViewer(user: Base.User): Spreadsheet; + rename(newName: string): void; + renameActiveSheet(newName: string): void; + setActiveRange(range: Range): Range; + setActiveSelection(range: Range): Range; + setActiveSelection(a1Notation: string): Range; + setActiveSheet(sheet: Sheet): Sheet; + setColumnWidth(columnPosition: Integer, width: Integer): Sheet; + setFrozenColumns(columns: Integer): void; + setFrozenRows(rows: Integer): void; + setNamedRange(name: string, range: Range): void; + setRowHeight(rowPosition: Integer, height: Integer): Sheet; + setSpreadsheetLocale(locale: string): void; + setSpreadsheetTimeZone(timezone: string): void; + show(userInterface: Object): void; + sort(columnPosition: Integer): Sheet; + sort(columnPosition: Integer, ascending: boolean): Sheet; + toast(msg: string): void; + toast(msg: string, title: string): void; + toast(msg: string, title: string, timeoutSeconds: Number): void; + unhideColumn(column: Range): void; + unhideRow(row: Range): void; + updateMenu(name: string, subMenus: Object[]): void; + getSheetProtection(): PageProtection; + isAnonymousView(): boolean; + isAnonymousWrite(): boolean; + setAnonymousAccess(anonymousReadAllowed: boolean, anonymousWriteAllowed: boolean): void; + setSheetProtection(permissions: PageProtection): void; + } + + /** + * This class allows users to open Google Sheets files and to create new ones. This class is + * the parent class for the Spreadsheet service. + */ + export interface SpreadsheetApp { + DataValidationCriteria: DataValidationCriteria + ProtectionType: ProtectionType + create(name: string): Spreadsheet; + create(name: string, rows: Integer, columns: Integer): Spreadsheet; + flush(): void; + getActive(): Spreadsheet; + getActiveRange(): Range; + getActiveSheet(): Sheet; + getActiveSpreadsheet(): Spreadsheet; + getUi(): Base.Ui; + newDataValidation(): DataValidationBuilder; + open(file: Drive.File): Spreadsheet; + openById(id: string): Spreadsheet; + openByUrl(url: string): Spreadsheet; + setActiveRange(range: Range): Range; + setActiveSheet(sheet: Sheet): Sheet; + setActiveSpreadsheet(newActiveSpreadsheet: Spreadsheet): void; + } + + } +} + +declare var SpreadsheetApp: GoogleAppsScript.Spreadsheet.SpreadsheetApp; \ No newline at end of file diff --git a/google-apps-script/google-apps-script.types.d.ts b/google-apps-script/google-apps-script.types.d.ts new file mode 100644 index 000000000..5204a8a2a --- /dev/null +++ b/google-apps-script/google-apps-script.types.d.ts @@ -0,0 +1,12 @@ +// Type definitions for Google Apps Script 2015-11-12 +// Project: https://developers.google.com/apps-script/ +// Definitions by: motemen +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare module GoogleAppsScript { + type BigNumber = any; + type Byte = number; + type Integer = number; + type Char = string; + type JdbcSQL_XML = any; +} diff --git a/google-apps-script/google-apps-script.ui.d.ts b/google-apps-script/google-apps-script.ui.d.ts new file mode 100644 index 000000000..00dabefd0 --- /dev/null +++ b/google-apps-script/google-apps-script.ui.d.ts @@ -0,0 +1,3628 @@ +// Type definitions for Google Apps Script 2015-11-12 +// Project: https://developers.google.com/apps-script/ +// Definitions by: motemen +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare module GoogleAppsScript { + export module UI { + /** + * + * Deprecated. The UI service was + * + * deprecated on December 11, 2014. To create user interfaces, use the + * HTML service instead. + * An absolute panel positions all of its children absolutely, allowing them to overlap. + * + * Here is an example of how to use this widget: + * + * function doGet() { + * var app = UiApp.createApplication(); + * var button = app.createButton("a button"); + * var panel = app.createAbsolutePanel(); + * // add a widget at position (10, 20) + * panel.add(button, 10, 20); + * app.add(panel); + * return app; + * } + * + * Internally, UiApp widgets are built on top of the + * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation + * directly. You can find the AbsolutePanel documentation here. + */ + export interface AbsolutePanel { + add(widget: Widget): AbsolutePanel; + add(widget: Widget, left: Integer, top: Integer): AbsolutePanel; + addStyleDependentName(styleName: string): AbsolutePanel; + addStyleName(styleName: string): AbsolutePanel; + clear(): AbsolutePanel; + getId(): string; + getTag(): string; + getType(): string; + remove(index: Integer): AbsolutePanel; + remove(widget: Widget): AbsolutePanel; + setHeight(height: string): AbsolutePanel; + setId(id: string): AbsolutePanel; + setLayoutData(layout: Object): AbsolutePanel; + setPixelSize(width: Integer, height: Integer): AbsolutePanel; + setSize(width: string, height: string): AbsolutePanel; + setStyleAttribute(attribute: string, value: string): AbsolutePanel; + setStyleAttributes(attributes: Object): AbsolutePanel; + setStyleName(styleName: string): AbsolutePanel; + setStylePrimaryName(styleName: string): AbsolutePanel; + setTag(tag: string): AbsolutePanel; + setTitle(title: string): AbsolutePanel; + setVisible(visible: boolean): AbsolutePanel; + setWidgetPosition(widget: Widget, left: Integer, top: Integer): AbsolutePanel; + setWidth(width: string): AbsolutePanel; + } + + /** + * + * Deprecated. The UI service was + * + * deprecated on December 11, 2014. To create user interfaces, use the + * HTML service instead. + * A widget that represents a simple element. That is, a hyperlink to a different page. + * + * By design, these hyperlinks always open in a new page. Links that reload the current page are + * not allowed. + * + * Here is an example of how to use this widget: + * + * function doGet() { + * var app = UiApp.createApplication(); + * // Creates a link to your favorite search engine. + * var anchor = app.createAnchor("a link", "http://www.google.com"); + * app.add(anchor); + * return app; + * } + * + * Internally, UiApp widgets are built on top of the + * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation + * directly. You can find the Anchor documentation here. + */ + export interface Anchor { + addBlurHandler(handler: Handler): Anchor; + addClickHandler(handler: Handler): Anchor; + addFocusHandler(handler: Handler): Anchor; + addKeyDownHandler(handler: Handler): Anchor; + addKeyPressHandler(handler: Handler): Anchor; + addKeyUpHandler(handler: Handler): Anchor; + addMouseDownHandler(handler: Handler): Anchor; + addMouseMoveHandler(handler: Handler): Anchor; + addMouseOutHandler(handler: Handler): Anchor; + addMouseOverHandler(handler: Handler): Anchor; + addMouseUpHandler(handler: Handler): Anchor; + addMouseWheelHandler(handler: Handler): Anchor; + addStyleDependentName(styleName: string): Anchor; + addStyleName(styleName: string): Anchor; + getId(): string; + getTag(): string; + getType(): string; + setAccessKey(accessKey: Char): Anchor; + setDirection(direction: Component): Anchor; + setEnabled(enabled: boolean): Anchor; + setFocus(focus: boolean): Anchor; + setHTML(html: string): Anchor; + setHeight(height: string): Anchor; + setHorizontalAlignment(horizontalAlignment: HorizontalAlignment): Anchor; + setHref(href: string): Anchor; + setId(id: string): Anchor; + setLayoutData(layout: Object): Anchor; + setName(name: string): Anchor; + setPixelSize(width: Integer, height: Integer): Anchor; + setSize(width: string, height: string): Anchor; + setStyleAttribute(attribute: string, value: string): Anchor; + setStyleAttributes(attributes: Object): Anchor; + setStyleName(styleName: string): Anchor; + setStylePrimaryName(styleName: string): Anchor; + setTabIndex(index: Integer): Anchor; + setTag(tag: string): Anchor; + setTarget(target: string): Anchor; + setText(text: string): Anchor; + setTitle(title: string): Anchor; + setVisible(visible: boolean): Anchor; + setWidth(width: string): Anchor; + setWordWrap(wordWrap: boolean): Anchor; + } + + /** + * + * Deprecated. The UI service was + * + * deprecated on December 11, 2014. To create user interfaces, use the + * HTML service instead. + * A standard push-button widget. + * + * Here is an example of how to use this widget: + * + * function doGet() { + * var app = UiApp.createApplication(); + * // create a button and give it a click handler + * var button = app.createButton("click me!").setId("button"); + * button.addClickHandler(app.createServerHandler("handlerFunction")); + * app.add(button); + * return app; + * } + * + * function handlerFunction(eventInfo) { + * var app = UiApp.getActiveApplication(); + * app.getElementById("button").setText("I was clicked!"); + * return app; + * } + * + * Internally, UiApp widgets are built on top of the + * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation + * directly. You can find the Button documentation here. + */ + export interface Button { + addBlurHandler(handler: Handler): Button; + addClickHandler(handler: Handler): Button; + addFocusHandler(handler: Handler): Button; + addKeyDownHandler(handler: Handler): Button; + addKeyPressHandler(handler: Handler): Button; + addKeyUpHandler(handler: Handler): Button; + addMouseDownHandler(handler: Handler): Button; + addMouseMoveHandler(handler: Handler): Button; + addMouseOutHandler(handler: Handler): Button; + addMouseOverHandler(handler: Handler): Button; + addMouseUpHandler(handler: Handler): Button; + addMouseWheelHandler(handler: Handler): Button; + addStyleDependentName(styleName: string): Button; + addStyleName(styleName: string): Button; + getId(): string; + getTag(): string; + getType(): string; + setAccessKey(accessKey: Char): Button; + setEnabled(enabled: boolean): Button; + setFocus(focus: boolean): Button; + setHTML(html: string): Button; + setHeight(height: string): Button; + setId(id: string): Button; + setLayoutData(layout: Object): Button; + setPixelSize(width: Integer, height: Integer): Button; + setSize(width: string, height: string): Button; + setStyleAttribute(attribute: string, value: string): Button; + setStyleAttributes(attributes: Object): Button; + setStyleName(styleName: string): Button; + setStylePrimaryName(styleName: string): Button; + setTabIndex(index: Integer): Button; + setTag(tag: string): Button; + setText(text: string): Button; + setTitle(title: string): Button; + setVisible(visible: boolean): Button; + setWidth(width: string): Button; + } + + /** + * + * Deprecated. The UI service was + * + * deprecated on December 11, 2014. To create user interfaces, use the + * HTML service instead. + * A panel that wraps its contents in a border with a caption that appears in the upper left + * corner of the border. This is an implementation of the fieldset HTML element. + * + * Note that this panel can contain at most one direct child widget. To add more children, make the + * child of this panel a different panel that can contain more than one child. + * + * Note also that the placement of the caption in a caption panel will vary slightly from browser to + * browser, so this widget is not a good choice when precise cross-browser layout is needed. + * + * Here is an example of how to use this widget: + * + * function doGet() { + * var app = UiApp.createApplication(); + * var panel = app.createCaptionPanel("my caption!"); + * panel.add(app.createButton("a button inside...")); + * app.add(panel); + * return app; + * } + * + * Internally, UiApp widgets are built on top of the + * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation + * directly. You can find the CaptionPanel documentation here. + */ + export interface CaptionPanel { + add(widget: Widget): CaptionPanel; + addStyleDependentName(styleName: string): CaptionPanel; + addStyleName(styleName: string): CaptionPanel; + clear(): CaptionPanel; + getId(): string; + getTag(): string; + getType(): string; + setCaptionText(text: string): CaptionPanel; + setContentWidget(widget: Widget): CaptionPanel; + setHeight(height: string): CaptionPanel; + setId(id: string): CaptionPanel; + setLayoutData(layout: Object): CaptionPanel; + setPixelSize(width: Integer, height: Integer): CaptionPanel; + setSize(width: string, height: string): CaptionPanel; + setStyleAttribute(attribute: string, value: string): CaptionPanel; + setStyleAttributes(attributes: Object): CaptionPanel; + setStyleName(styleName: string): CaptionPanel; + setStylePrimaryName(styleName: string): CaptionPanel; + setTag(tag: string): CaptionPanel; + setText(text: string): CaptionPanel; + setTitle(title: string): CaptionPanel; + setVisible(visible: boolean): CaptionPanel; + setWidget(widget: Widget): CaptionPanel; + setWidth(width: string): CaptionPanel; + } + + /** + * + * Deprecated. The UI service was + * + * deprecated on December 11, 2014. To create user interfaces, use the + * HTML service instead. + * A standard check box widget. + * + * Here is an example of how to use this widget: + * + * function doGet() { + * var app = UiApp.createApplication(); + * var handler = app.createServerHandler("change"); + * var check = app.createCheckBox("click me").addValueChangeHandler(handler); + * app.add(check); + * return app; + * } + * + * function change() { + * var app = UiApp.getActiveApplication(); + * app.add(app.createLabel("The value changed!")); + * return app; + * } + * + * Internally, UiApp widgets are built on top of the + * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation + * directly. You can find the CheckBox documentation here. + */ + export interface CheckBox { + addBlurHandler(handler: Handler): CheckBox; + addClickHandler(handler: Handler): CheckBox; + addFocusHandler(handler: Handler): CheckBox; + addKeyDownHandler(handler: Handler): CheckBox; + addKeyPressHandler(handler: Handler): CheckBox; + addKeyUpHandler(handler: Handler): CheckBox; + addMouseDownHandler(handler: Handler): CheckBox; + addMouseMoveHandler(handler: Handler): CheckBox; + addMouseOutHandler(handler: Handler): CheckBox; + addMouseOverHandler(handler: Handler): CheckBox; + addMouseUpHandler(handler: Handler): CheckBox; + addMouseWheelHandler(handler: Handler): CheckBox; + addStyleDependentName(styleName: string): CheckBox; + addStyleName(styleName: string): CheckBox; + addValueChangeHandler(handler: Handler): CheckBox; + getId(): string; + getTag(): string; + getType(): string; + setAccessKey(accessKey: Char): CheckBox; + setEnabled(enabled: boolean): CheckBox; + setFocus(focus: boolean): CheckBox; + setFormValue(formValue: string): CheckBox; + setHTML(html: string): CheckBox; + setHeight(height: string): CheckBox; + setId(id: string): CheckBox; + setLayoutData(layout: Object): CheckBox; + setName(name: string): CheckBox; + setPixelSize(width: Integer, height: Integer): CheckBox; + setSize(width: string, height: string): CheckBox; + setStyleAttribute(attribute: string, value: string): CheckBox; + setStyleAttributes(attributes: Object): CheckBox; + setStyleName(styleName: string): CheckBox; + setStylePrimaryName(styleName: string): CheckBox; + setTabIndex(index: Integer): CheckBox; + setTag(tag: string): CheckBox; + setText(text: string): CheckBox; + setTitle(title: string): CheckBox; + setValue(value: boolean): CheckBox; + setValue(value: boolean, fireEvents: boolean): CheckBox; + setVisible(visible: boolean): CheckBox; + setWidth(width: string): CheckBox; + } + + /** + * + * Deprecated. The UI service was + * + * deprecated on December 11, 2014. To create user interfaces, use the + * HTML service instead. + * An event handler that runs in the user's browser without needing a call back to the server. + * These will, in general, run much faster than ServerHandlers but they are also more + * limited in what they can do. + * + * Any method that accepts a "Handler" parameter can accept a ClientHandler. + * + * If you set validators on a ClientHandler, they will be checked before the handler performs its + * actions. The actions will only be performed if the validators succeed. + * + * If you have multiple ClientHandlers for the same event on the same widget, they will perform + * their actions in the order that they were added. + * + * An example of using client handlers: + * + * function doGet() { + * var app = UiApp.createApplication(); + * var button = app.createButton("Say Hello"); + * + * // Create a label with the "Hello World!" text and hide it for now + * var label = app.createLabel("Hello World!").setVisible(false); + * + * // Create a new handler that does not require the server. + * // We give the handler two actions to perform on different targets. + * // The first action disables the widget that invokes the handler + * // and the second displays the label. + * var handler = app.createClientHandler() + * .forEventSource().setEnabled(false) + * .forTargets(label).setVisible(true); + * + * // Add our new handler to be invoked when the button is clicked + * button.addClickHandler(handler); + * + * app.add(button); + * app.add(label); + * return app; + * } + */ + export interface ClientHandler { + forEventSource(): ClientHandler; + forTargets(...widgets: Object[]): ClientHandler; + getId(): string; + getTag(): string; + getType(): string; + setEnabled(enabled: boolean): ClientHandler; + setHTML(html: string): ClientHandler; + setId(id: string): ClientHandler; + setStyleAttribute(row: Integer, column: Integer, attribute: string, value: string): ClientHandler; + setStyleAttribute(attribute: string, value: string): ClientHandler; + setStyleAttributes(row: Integer, column: Integer, attributes: Object): ClientHandler; + setStyleAttributes(attributes: Object): ClientHandler; + setTag(tag: string): ClientHandler; + setText(text: string): ClientHandler; + setValue(value: boolean): ClientHandler; + setVisible(visible: boolean): ClientHandler; + validateEmail(widget: Widget): ClientHandler; + validateInteger(widget: Widget): ClientHandler; + validateLength(widget: Widget, min: Integer, max: Integer): ClientHandler; + validateMatches(widget: Widget, pattern: string): ClientHandler; + validateMatches(widget: Widget, pattern: string, flags: string): ClientHandler; + validateNotEmail(widget: Widget): ClientHandler; + validateNotInteger(widget: Widget): ClientHandler; + validateNotLength(widget: Widget, min: Integer, max: Integer): ClientHandler; + validateNotMatches(widget: Widget, pattern: string): ClientHandler; + validateNotMatches(widget: Widget, pattern: string, flags: string): ClientHandler; + validateNotNumber(widget: Widget): ClientHandler; + validateNotOptions(widget: Widget, options: String[]): ClientHandler; + validateNotRange(widget: Widget, min: Number, max: Number): ClientHandler; + validateNotSum(widgets: Widget[], sum: Integer): ClientHandler; + validateNumber(widget: Widget): ClientHandler; + validateOptions(widget: Widget, options: String[]): ClientHandler; + validateRange(widget: Widget, min: Number, max: Number): ClientHandler; + validateSum(widgets: Widget[], sum: Integer): ClientHandler; + } + + /** + * + * Deprecated. The UI service was + * + * deprecated on December 11, 2014. To create user interfaces, use the + * HTML service instead. + * A generic component object. + * Implementing classes + * + * NameBrief description + * + * AbsolutePanelAn absolute panel positions all of its children absolutely, allowing them to overlap. + * + * AnchorA widget that represents a simple element. + * + * ButtonA standard push-button widget. + * + * CaptionPanelA panel that wraps its contents in a border with a caption that appears in the upper left + * corner of the border. + * + * ChartA Chart object, which can be embedded into documents, UI elements, or used as a static image. + * + * CheckBoxA standard check box widget. + * + * ClientHandlerAn event handler that runs in the user's browser without needing a call back to the server. + * + * ControlA user interface control object, that drives the data displayed by a DashboardPanel. + * + * DashboardPanelA dashboard is a visual structure that enables the organization and management + * of multiple charts that share the same underlying data. + * + * DateBoxA text box that shows a DatePicker when the user focuses on it. + * + * DatePickerA date picker widget. + * + * DecoratedStackPanelA StackPanel that wraps each item in a 2x3 grid (six box), which allows users to add + * rounded corners. + * + * DecoratedTabBarA TabBar that wraps each tab in a 2x3 grid (six box), which allows users to add rounded corners. + * + * DecoratedTabPanelA TabPanel that uses a DecoratedTabBar with rounded corners. + * + * DecoratorPanelA SimplePanel that wraps its contents in stylized boxes, which can be used to add rounded + * corners to a Widget. + * + * DialogBoxA form of popup that has a caption area at the top and can be dragged by the + * user. + * + * DocsListDialogA "file-open" dialog for Google Drive. + * + * EmbeddedChartRepresents a chart that has been embedded into a Spreadsheet. + * + * FileUploadA widget that wraps the HTML element. + * + * FlexTableA flexible table that creates cells on demand. + * + * FlowPanelA panel that formats its child widgets using the default HTML layout behavior. + * + * FocusPanelA simple panel that makes its contents focusable, and adds the ability to catch mouse and + * keyboard events. + * + * FormPanelA panel that wraps its contents in an HTML
element. + * + * GridA rectangular grid that can contain text, html, or a child widget within its cells. + * + * HTMLA widget that contains arbitrary text, which is interpreted as HTML. + * + * HandlerBase interface for client and server handlers. + * + * HiddenRepresents a hidden field for storing data in the user's browser that can be passed back to a + * handler as a "callback element". + * + * HorizontalPanelA panel that lays all of its widgets out in a single horizontal column. + * + * ImageA widget that displays the image at a given URL. + * + * InlineLabelA widget that contains arbitrary text, not interpreted as HTML. + * + * LabelA widget that contains arbitrary text, not interpreted as HTML. + * + * ListBoxA widget that presents a list of choices to the user, either as a list box or + * as a drop-down list. + * + * MenuBarA standard menu bar widget. + * + * MenuItemAn entry in a MenuBar. + * + * MenuItemSeparatorA separator that can be placed in a MenuBar. + * + * PasswordTextBoxA text box that visually masks its input to prevent eavesdropping. + * + * PopupPanelA panel that can "pop up" over other widgets. + * + * PushButtonA normal push button with custom styling. + * + * RadioButtonA mutually-exclusive selection radio button widget. + * + * ResetButtonA standard push-button widget which will automatically reset its enclosing FormPanel if + * any. + * + * ScrollPanelA panel that wraps its contents in a scrollable element. + * + * ServerHandlerAn event handler that runs on the server. + * + * SimpleCheckBoxA simple checkbox widget, with no label. + * + * SimplePanelA panel that can contain only one widget. + * + * SimpleRadioButtonA simple radio button widget, with no label. + * + * SplitLayoutPanelA panel that adds user-positioned splitters between each of its child widgets. + * + * StackPanelA panel that stacks its children vertically, displaying only one at a time, + * with a header for each child which the user can click to display. + * + * SubmitButtonA standard push-button widget which will automatically submit its enclosing FormPanel if + * any. + * + * SuggestBoxA SuggestBox is a text box or text area which displays a + * pre-configured set of selections that match the user's input. + * + * TabBarA horizontal bar of folder-style tabs, most commonly used as part of a TabPanel. + * + * TabPanelA panel that represents a tabbed set of pages, each of which contains another + * widget. + * + * TextAreaA text box that allows multiple lines of text to be entered. + * + * TextBoxA standard single-line text box. + * + * ToggleButtonA ToggleButton is a stylish stateful button which allows the + * user to toggle between up and down states. + * + * TreeA standard hierarchical tree widget. + * + * TreeItemAn item that can be contained within a Tree. + * + * VerticalPanelA panel that lays all of its widgets out in a single vertical column. + * + * WidgetBase interface for UiApp widgets. + */ + export interface Component { + getId(): string; + getType(): string; + } + + /** + * + * Deprecated. The UI service was + * + * deprecated on December 11, 2014. To create user interfaces, use the + * HTML service instead. + * A text box that shows a DatePicker when the user focuses on it. + * + * Here is an example of how to use this widget: + * + * function doGet() { + * var app = UiApp.createApplication(); + * var handler = app.createServerHandler("change"); + * var dateBox = app.createDateBox().addValueChangeHandler(handler).setId("datebox"); + * app.add(dateBox); + * return app; + * } + * + * function change(eventInfo) { + * var app = UiApp.getActiveApplication(); + * app.add(app.createLabel("The value of the date box changed to " + + * eventInfo.parameter.datebox)); + * return app; + * } + * + * Internally, UiApp widgets are built on top of the + * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation + * directly. You can find the DateBox documentation here. + */ + export interface DateBox { + addStyleDependentName(styleName: string): DateBox; + addStyleName(styleName: string): DateBox; + addValueChangeHandler(handler: Handler): DateBox; + getId(): string; + getTag(): string; + getType(): string; + hideDatePicker(): DateBox; + setAccessKey(accessKey: Char): DateBox; + setEnabled(enabled: boolean): DateBox; + setFireEventsForInvalid(fireEvents: boolean): DateBox; + setFocus(focus: boolean): DateBox; + setFormat(dateTimeFormat: DateTimeFormat): DateBox; + setHeight(height: string): DateBox; + setId(id: string): DateBox; + setLayoutData(layout: Object): DateBox; + setName(name: string): DateBox; + setPixelSize(width: Integer, height: Integer): DateBox; + setSize(width: string, height: string): DateBox; + setStyleAttribute(attribute: string, value: string): DateBox; + setStyleAttributes(attributes: Object): DateBox; + setStyleName(styleName: string): DateBox; + setStylePrimaryName(styleName: string): DateBox; + setTabIndex(index: Integer): DateBox; + setTag(tag: string): DateBox; + setTitle(title: string): DateBox; + setValue(date: Date): DateBox; + setVisible(visible: boolean): DateBox; + setWidth(width: string): DateBox; + showDatePicker(): DateBox; + } + + /** + * + * Deprecated. The UI service was + * + * deprecated on December 11, 2014. To create user interfaces, use the + * HTML service instead. + * A date picker widget. + * + * Here is an example of how to use this widget: + * + * function doGet() { + * var app = UiApp.createApplication(); + * var handler = app.createServerHandler("change"); + * var picker = app.createDatePicker().addValueChangeHandler(handler).setId("picker"); + * app.add(picker); + * return app; + * } + * + * function change(eventInfo) { + * var app = UiApp.getActiveApplication(); + * app.add(app.createLabel("The value of the date picker changed to " + + * eventInfo.parameter.picker)); + * return app; + * } + * + * Internally, UiApp widgets are built on top of the + * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation + * directly. You can find the DatePicker documentation here. + */ + export interface DatePicker { + addStyleDependentName(styleName: string): DatePicker; + addStyleName(styleName: string): DatePicker; + addValueChangeHandler(handler: Handler): DatePicker; + getId(): string; + getTag(): string; + getType(): string; + setCurrentMonth(date: Date): DatePicker; + setHeight(height: string): DatePicker; + setId(id: string): DatePicker; + setLayoutData(layout: Object): DatePicker; + setName(name: string): DatePicker; + setPixelSize(width: Integer, height: Integer): DatePicker; + setSize(width: string, height: string): DatePicker; + setStyleAttribute(attribute: string, value: string): DatePicker; + setStyleAttributes(attributes: Object): DatePicker; + setStyleName(styleName: string): DatePicker; + setStylePrimaryName(styleName: string): DatePicker; + setTag(tag: string): DatePicker; + setTitle(title: string): DatePicker; + setValue(date: Date): DatePicker; + setVisible(visible: boolean): DatePicker; + setWidth(width: string): DatePicker; + } + + /** + * + * Deprecated. The UI service was + * + * deprecated on December 11, 2014. To create user interfaces, use the + * HTML service instead. + * Date and time format constants for widgets such as + * DateBox. + * + * These correspond to the predefined constants from the Google Web Toolkit. You can read + * more about these constants + * here. + */ + export enum DateTimeFormat { ISO_8601, RFC_2822, DATE_FULL, DATE_LONG, DATE_MEDIUM, DATE_SHORT, TIME_FULL, TIME_LONG, TIME_MEDIUM, TIME_SHORT, DATE_TIME_FULL, DATE_TIME_LONG, DATE_TIME_MEDIUM, DATE_TIME_SHORT, DAY, HOUR_MINUTE, HOUR_MINUTE_SECOND, HOUR24_MINUTE, HOUR24_MINUTE_SECOND, MINUTE_SECOND, MONTH, MONTH_ABBR, MONTH_ABBR_DAY, MONTH_DAY, MONTH_NUM_DAY, MONTH_WEEKDAY_DAY, YEAR, YEAR_MONTH, YEAR_MONTH_ABBR, YEAR_MONTH_ABBR_DAY, YEAR_MONTH_DAY, YEAR_MONTH_NUM, YEAR_MONTH_NUM_DAY, YEAR_MONTH_WEEKDAY_DAY, YEAR_QUARTER, YEAR_QUARTER_ABBR } + + /** + * + * Deprecated. The UI service was + * + * deprecated on December 11, 2014. To create user interfaces, use the + * HTML service instead. + * A StackPanel that wraps each item in a 2x3 grid (six box), which allows users to add + * rounded corners. + * + * Internally, UiApp widgets are built on top of the + * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation + * directly. You can find the DecoratedStackPanel documentation here. + */ + export interface DecoratedStackPanel { + add(widget: Widget): DecoratedStackPanel; + add(widget: Widget, text: string): DecoratedStackPanel; + add(widget: Widget, text: string, asHtml: boolean): DecoratedStackPanel; + addStyleDependentName(styleName: string): DecoratedStackPanel; + addStyleName(styleName: string): DecoratedStackPanel; + clear(): DecoratedStackPanel; + getId(): string; + getTag(): string; + getType(): string; + remove(index: Integer): DecoratedStackPanel; + remove(widget: Widget): DecoratedStackPanel; + setHeight(height: string): DecoratedStackPanel; + setId(id: string): DecoratedStackPanel; + setLayoutData(layout: Object): DecoratedStackPanel; + setPixelSize(width: Integer, height: Integer): DecoratedStackPanel; + setSize(width: string, height: string): DecoratedStackPanel; + setStackText(index: Integer, text: string): DecoratedStackPanel; + setStackText(index: Integer, text: string, asHtml: boolean): DecoratedStackPanel; + setStyleAttribute(attribute: string, value: string): DecoratedStackPanel; + setStyleAttributes(attributes: Object): DecoratedStackPanel; + setStyleName(styleName: string): DecoratedStackPanel; + setStylePrimaryName(styleName: string): DecoratedStackPanel; + setTag(tag: string): DecoratedStackPanel; + setTitle(title: string): DecoratedStackPanel; + setVisible(visible: boolean): DecoratedStackPanel; + setWidth(width: string): DecoratedStackPanel; + } + + /** + * + * Deprecated. The UI service was + * + * deprecated on December 11, 2014. To create user interfaces, use the + * HTML service instead. + * A TabBar that wraps each tab in a 2x3 grid (six box), which allows users to add rounded corners. + * + * Internally, UiApp widgets are built on top of the + * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation + * directly. You can find the DecoratedTabBar documentation here. + */ + export interface DecoratedTabBar { + addBeforeSelectionHandler(handler: Handler): DecoratedTabBar; + addSelectionHandler(handler: Handler): DecoratedTabBar; + addStyleDependentName(styleName: string): DecoratedTabBar; + addStyleName(styleName: string): DecoratedTabBar; + addTab(title: string): DecoratedTabBar; + addTab(title: string, asHtml: boolean): DecoratedTabBar; + addTab(widget: Widget): DecoratedTabBar; + getId(): string; + getTag(): string; + getType(): string; + selectTab(index: Integer): DecoratedTabBar; + setHeight(height: string): DecoratedTabBar; + setId(id: string): DecoratedTabBar; + setLayoutData(layout: Object): DecoratedTabBar; + setPixelSize(width: Integer, height: Integer): DecoratedTabBar; + setSize(width: string, height: string): DecoratedTabBar; + setStyleAttribute(attribute: string, value: string): DecoratedTabBar; + setStyleAttributes(attributes: Object): DecoratedTabBar; + setStyleName(styleName: string): DecoratedTabBar; + setStylePrimaryName(styleName: string): DecoratedTabBar; + setTabEnabled(index: Integer, enabled: boolean): DecoratedTabBar; + setTabText(index: Integer, text: string): DecoratedTabBar; + setTag(tag: string): DecoratedTabBar; + setTitle(title: string): DecoratedTabBar; + setVisible(visible: boolean): DecoratedTabBar; + setWidth(width: string): DecoratedTabBar; + } + + /** + * + * Deprecated. The UI service was + * + * deprecated on December 11, 2014. To create user interfaces, use the + * HTML service instead. + * A TabPanel that uses a DecoratedTabBar with rounded corners. + * + * Internally, UiApp widgets are built on top of the + * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation + * directly. You can find the DecoratedTabPanel documentation here. + */ + export interface DecoratedTabPanel { + add(widget: Widget): DecoratedTabPanel; + add(widget: Widget, text: string): DecoratedTabPanel; + add(widget: Widget, text: string, asHtml: boolean): DecoratedTabPanel; + add(widget: Widget, tabWidget: Widget): DecoratedTabPanel; + addBeforeSelectionHandler(handler: Handler): DecoratedTabPanel; + addSelectionHandler(handler: Handler): DecoratedTabPanel; + addStyleDependentName(styleName: string): DecoratedTabPanel; + addStyleName(styleName: string): DecoratedTabPanel; + getId(): string; + getTag(): string; + getType(): string; + selectTab(index: Integer): DecoratedTabPanel; + setAnimationEnabled(animationEnabled: boolean): DecoratedTabPanel; + setHeight(height: string): DecoratedTabPanel; + setId(id: string): DecoratedTabPanel; + setLayoutData(layout: Object): DecoratedTabPanel; + setPixelSize(width: Integer, height: Integer): DecoratedTabPanel; + setSize(width: string, height: string): DecoratedTabPanel; + setStyleAttribute(attribute: string, value: string): DecoratedTabPanel; + setStyleAttributes(attributes: Object): DecoratedTabPanel; + setStyleName(styleName: string): DecoratedTabPanel; + setStylePrimaryName(styleName: string): DecoratedTabPanel; + setTag(tag: string): DecoratedTabPanel; + setTitle(title: string): DecoratedTabPanel; + setVisible(visible: boolean): DecoratedTabPanel; + setWidth(width: string): DecoratedTabPanel; + } + + /** + * + * Deprecated. The UI service was + * + * deprecated on December 11, 2014. To create user interfaces, use the + * HTML service instead. + * A SimplePanel that wraps its contents in stylized boxes, which can be used to add rounded + * corners to a Widget. + * + * Note that this panel can contain at most one direct child widget. To add more children, make the + * child of this panel a different panel that can contain more than one child. + * + * Internally, UiApp widgets are built on top of the + * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation + * directly. You can find the DecoratorPanel documentation here. + */ + export interface DecoratorPanel { + add(widget: Widget): DecoratorPanel; + addStyleDependentName(styleName: string): DecoratorPanel; + addStyleName(styleName: string): DecoratorPanel; + clear(): DecoratorPanel; + getId(): string; + getTag(): string; + getType(): string; + setHeight(height: string): DecoratorPanel; + setId(id: string): DecoratorPanel; + setLayoutData(layout: Object): DecoratorPanel; + setPixelSize(width: Integer, height: Integer): DecoratorPanel; + setSize(width: string, height: string): DecoratorPanel; + setStyleAttribute(attribute: string, value: string): DecoratorPanel; + setStyleAttributes(attributes: Object): DecoratorPanel; + setStyleName(styleName: string): DecoratorPanel; + setStylePrimaryName(styleName: string): DecoratorPanel; + setTag(tag: string): DecoratorPanel; + setTitle(title: string): DecoratorPanel; + setVisible(visible: boolean): DecoratorPanel; + setWidget(widget: Widget): DecoratorPanel; + setWidth(width: string): DecoratorPanel; + } + + /** + * + * Deprecated. The UI service was + * + * deprecated on December 11, 2014. To create user interfaces, use the + * HTML service instead. + * A form of popup that has a caption area at the top and can be dragged by the + * user. Unlike a PopupPanel, calls to setWidth(width) and + * setHeight(height) will set the width and height of the dialog box + * itself, even if a widget has not been added as yet. + * + * In general it's not recommended to add this panel as a child of another widget or of the app + * as that will make it behave like any other inline panel and not act as a popup. Instead, create + * the popup and then use its show() and hide() methods to show and hide it. See + * the example below. + * + * Internally, UiApp widgets are built on top of the + * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation + * directly. You can find the DialogBox documentation here. + * + * Here is an example showing how to use the dialog box widget: + * + * function doGet() { + * var app = UiApp.createApplication(); + * // Create a dialog box. + * var dialog = app.createDialogBox(); + * // Set the position and dimensions. + * dialog.setPopupPosition(100, 100).setSize(500, 500); + * // Show the dialog. Note that it does not have to be "added" to the UiInstance. + * dialog.show(); + * return app; + * } + */ + export interface DialogBox { + add(widget: Widget): DialogBox; + addAutoHidePartner(partner: Component): DialogBox; + addCloseHandler(handler: Handler): DialogBox; + addStyleDependentName(styleName: string): DialogBox; + addStyleName(styleName: string): DialogBox; + clear(): DialogBox; + getId(): string; + getTag(): string; + getType(): string; + hide(): DialogBox; + setAnimationEnabled(animationEnabled: boolean): DialogBox; + setAutoHideEnabled(enabled: boolean): DialogBox; + setGlassEnabled(enabled: boolean): DialogBox; + setGlassStyleName(styleName: string): DialogBox; + setHTML(html: string): DialogBox; + setHeight(height: string): DialogBox; + setId(id: string): DialogBox; + setLayoutData(layout: Object): DialogBox; + setModal(modal: boolean): DialogBox; + setPixelSize(width: Integer, height: Integer): DialogBox; + setPopupPosition(left: Integer, top: Integer): DialogBox; + setPopupPositionAndShow(a: Component): DialogBox; + setPreviewingAllNativeEvents(previewing: boolean): DialogBox; + setSize(width: string, height: string): DialogBox; + setStyleAttribute(attribute: string, value: string): DialogBox; + setStyleAttributes(attributes: Object): DialogBox; + setStyleName(styleName: string): DialogBox; + setStylePrimaryName(styleName: string): DialogBox; + setTag(tag: string): DialogBox; + setText(text: string): DialogBox; + setTitle(title: string): DialogBox; + setVisible(visible: boolean): DialogBox; + setWidget(widget: Widget): DialogBox; + setWidth(width: string): DialogBox; + show(): DialogBox; + } + + /** + * + * Deprecated. The UI service was + * + * deprecated on December 11, 2014. To create user interfaces, use the + * HTML service instead. + * A "file-open" dialog for Google Drive. Unlike most UiApp objects, DocsListDialog + * should not be added to the UiInstance. The + * example below shows how to display a DocsListDialog in the + * new version of Google Sheets. + * + * Note that HTML service offers a similar but superior + * feature, Google Picker. In almost all + * cases, using Google Picker is preferable. + * + * function onOpen() { + * SpreadsheetApp.getUi() // Or DocumentApp or FormApp. + * .createMenu('Custom Menu') + * .addItem('Select file', 'showDialog') + * .addToUi(); + * } + * + * function showDialog() { + * // Dummy call to DriveApp to ensure the OAuth dialog requests Google Drive scope, so that the + * // getOAuthToken() call below returns a token with the necessary permissions. + * DriveApp.getRootFolder(); + * + * var app = UiApp.createApplication() + * .setWidth(570) + * .setHeight(352); + * + * var serverHandler = app.createServerHandler('pickerHandler'); + * + * app.createDocsListDialog() + * .addCloseHandler(serverHandler) + * .addSelectionHandler(serverHandler) + * .setOAuthToken(ScriptApp.getOAuthToken()) + * .showDocsPicker(); + * + * SpreadsheetApp.getUi() // Or DocumentApp or FormApp. + * .showModalDialog(app,' '); + * } + * + * function pickerHandler(e) { + * var action = e.parameter.eventType; + * var app = UiApp.getActiveApplication(); + * + * if (action == 'selection') { + * var doc = e.parameter.items[0]; + * var id = doc.id; + * var name = doc.name; + * var url = doc.url; + * app.add(app.createLabel('You picked ')); + * app.add(app.createAnchor(name, url)); + * app.add(app.createLabel('(ID: ' + id + ').')); + * } else if (action == 'close') { + * app.add(app.createLabel('You clicked "Cancel".')); + * } + * + * return app; + * } + */ + export interface DocsListDialog { + addCloseHandler(handler: Handler): DocsListDialog; + addSelectionHandler(handler: Handler): DocsListDialog; + addView(fileType: FileType): DocsListDialog; + getId(): string; + getType(): string; + setDialogTitle(title: string): DocsListDialog; + setHeight(height: Integer): DocsListDialog; + setInitialView(fileType: FileType): DocsListDialog; + setMultiSelectEnabled(multiSelectEnabled: boolean): DocsListDialog; + setOAuthToken(oAuthToken: string): DocsListDialog; + setWidth(width: Integer): DocsListDialog; + showDocsPicker(): DocsListDialog; + } + + /** + * + * Deprecated. The UI service was + * + * deprecated on December 11, 2014. To create user interfaces, use the + * HTML service instead. + * File type constants for the + * DocsListDialog. + */ + export enum FileType { ALL, ALL_DOCS, DRAWINGS, DOCUMENTS, SPREADSHEETS, FOLDERS, RECENTLY_PICKED, PRESENTATIONS, FORMS, PHOTOS, PHOTO_ALBUMS, PDFS } + + /** + * + * Deprecated. The UI service was + * + * deprecated on December 11, 2014. To create user interfaces, use the + * HTML service instead. + * A widget that wraps the HTML element. This widget + * must be used within a FormPanel. + * + * The result of a FileUpload is a "Blob" which can we used in various other functions. Below is an + * example of how to use FileUpload. + * + * function doGet(e) { + * + * var app = UiApp.createApplication().setTitle("Upload CSV to Sheet"); + * var formContent = app.createVerticalPanel(); + * formContent.add(app.createFileUpload().setName('thefile')); + * formContent.add(app.createSubmitButton()); + * var form = app.createFormPanel(); + * form.add(formContent); + * app.add(form); + * return app; + * } + * + * function doPost(e) { + * // data returned is a blob for FileUpload widget + * var fileBlob = e.parameter.thefile; + * var doc = DocsList.createFile(fileBlob); + * } + * + * Internally, UiApp widgets are built on top of the + * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation + * directly. You can find the FileUpload documentation here. + */ + export interface FileUpload { + addChangeHandler(handler: Handler): FileUpload; + addStyleDependentName(styleName: string): FileUpload; + addStyleName(styleName: string): FileUpload; + getId(): string; + getTag(): string; + getType(): string; + setEnabled(enabled: boolean): FileUpload; + setHeight(height: string): FileUpload; + setId(id: string): FileUpload; + setLayoutData(layout: Object): FileUpload; + setName(name: string): FileUpload; + setPixelSize(width: Integer, height: Integer): FileUpload; + setSize(width: string, height: string): FileUpload; + setStyleAttribute(attribute: string, value: string): FileUpload; + setStyleAttributes(attributes: Object): FileUpload; + setStyleName(styleName: string): FileUpload; + setStylePrimaryName(styleName: string): FileUpload; + setTag(tag: string): FileUpload; + setTitle(title: string): FileUpload; + setVisible(visible: boolean): FileUpload; + setWidth(width: string): FileUpload; + } + + /** + * + * Deprecated. The UI service was + * + * deprecated on December 11, 2014. To create user interfaces, use the + * HTML service instead. + * A flexible table that creates cells on demand. It can be jagged (that is, + * each row can contain a different number of cells) and individual cells can be + * set to span multiple rows or columns. + * + * Here is an example of how to use this widget: + * + * function doGet() { + * var app = UiApp.createApplication(); + * app.add(app.createFlexTable() + * .insertRow(0).insertRow(0).insertRow(0) + * .insertCell(0, 0) + * .insertCell(0, 1) + * .insertCell(0, 2) + * .insertCell(1, 0) + * .insertCell(1, 1) + * .insertCell(2, 0) + * .setBorderWidth(5).setCellPadding(10).setCellSpacing(10)); + * return app; + * } + * + * Internally, UiApp widgets are built on top of the + * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation + * directly. You can find the FlexTable documentation here. + */ + export interface FlexTable { + addCell(row: Integer): FlexTable; + addClickHandler(handler: Handler): FlexTable; + addStyleDependentName(styleName: string): FlexTable; + addStyleName(styleName: string): FlexTable; + clear(): FlexTable; + getId(): string; + getTag(): string; + getType(): string; + insertCell(beforeRow: Integer, beforeColumn: Integer): FlexTable; + insertRow(beforeRow: Integer): FlexTable; + removeCell(row: Integer, column: Integer): FlexTable; + removeCells(row: Integer, column: Integer, num: Integer): FlexTable; + removeRow(row: Integer): FlexTable; + setBorderWidth(width: Integer): FlexTable; + setCellPadding(padding: Integer): FlexTable; + setCellSpacing(spacing: Integer): FlexTable; + setColumnStyleAttribute(column: Integer, attribute: string, value: string): FlexTable; + setColumnStyleAttributes(column: Integer, attributes: Object): FlexTable; + setHeight(height: string): FlexTable; + setId(id: string): FlexTable; + setLayoutData(layout: Object): FlexTable; + setPixelSize(width: Integer, height: Integer): FlexTable; + setRowStyleAttribute(row: Integer, attribute: string, value: string): FlexTable; + setRowStyleAttributes(row: Integer, attributes: Object): FlexTable; + setSize(width: string, height: string): FlexTable; + setStyleAttribute(row: Integer, column: Integer, attribute: string, value: string): FlexTable; + setStyleAttribute(attribute: string, value: string): FlexTable; + setStyleAttributes(row: Integer, column: Integer, attributes: Object): FlexTable; + setStyleAttributes(attributes: Object): FlexTable; + setStyleName(styleName: string): FlexTable; + setStylePrimaryName(styleName: string): FlexTable; + setTag(tag: string): FlexTable; + setText(row: Integer, column: Integer, text: string): FlexTable; + setTitle(title: string): FlexTable; + setVisible(visible: boolean): FlexTable; + setWidget(row: Integer, column: Integer, widget: Widget): FlexTable; + setWidth(width: string): FlexTable; + } + + /** + * + * Deprecated. The UI service was + * + * deprecated on December 11, 2014. To create user interfaces, use the + * HTML service instead. + * A panel that formats its child widgets using the default HTML layout behavior. + * + * Here is an example of how to use this widget: + * + * function doGet() { + * var app = UiApp.createApplication(); + * var panel = app.createFlowPanel(); + * panel.add(app.createButton("button 1")); + * panel.add(app.createButton("button 2")); + * app.add(panel); + * return app; + * } + * + * Internally, UiApp widgets are built on top of the + * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation + * directly. You can find the FlowPanel documentation here. + */ + export interface FlowPanel { + add(widget: Widget): FlowPanel; + addStyleDependentName(styleName: string): FlowPanel; + addStyleName(styleName: string): FlowPanel; + clear(): FlowPanel; + getId(): string; + getTag(): string; + getType(): string; + insert(widget: Widget, beforeIndex: Integer): FlowPanel; + remove(index: Integer): FlowPanel; + remove(widget: Widget): FlowPanel; + setHeight(height: string): FlowPanel; + setId(id: string): FlowPanel; + setLayoutData(layout: Object): FlowPanel; + setPixelSize(width: Integer, height: Integer): FlowPanel; + setSize(width: string, height: string): FlowPanel; + setStyleAttribute(attribute: string, value: string): FlowPanel; + setStyleAttributes(attributes: Object): FlowPanel; + setStyleName(styleName: string): FlowPanel; + setStylePrimaryName(styleName: string): FlowPanel; + setTag(tag: string): FlowPanel; + setTitle(title: string): FlowPanel; + setVisible(visible: boolean): FlowPanel; + setWidth(width: string): FlowPanel; + } + + /** + * + * Deprecated. The UI service was + * + * deprecated on December 11, 2014. To create user interfaces, use the + * HTML service instead. + * A simple panel that makes its contents focusable, and adds the ability to catch mouse and + * keyboard events. + * + * Note that this panel can contain at most one direct child widget. To add more children, make the + * child of this panel a different panel that can contain more than one child. + * + * Here is an example of how to use this widget: + * + * function doGet() { + * var app = UiApp.createApplication(); + * var focus = app.createFocusPanel(); + * var flow = app.createFlowPanel(); + * flow.add(app.createButton("button 1")); + * flow.add(app.createButton("button 2")); + * focus.add(flow); + * app.add(focus); + * return app; + * } + * + * Internally, UiApp widgets are built on top of the + * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation + * directly. You can find the FocusPanel documentation here. + */ + export interface FocusPanel { + add(widget: Widget): FocusPanel; + addBlurHandler(handler: Handler): FocusPanel; + addClickHandler(handler: Handler): FocusPanel; + addFocusHandler(handler: Handler): FocusPanel; + addKeyDownHandler(handler: Handler): FocusPanel; + addKeyPressHandler(handler: Handler): FocusPanel; + addKeyUpHandler(handler: Handler): FocusPanel; + addMouseDownHandler(handler: Handler): FocusPanel; + addMouseMoveHandler(handler: Handler): FocusPanel; + addMouseOutHandler(handler: Handler): FocusPanel; + addMouseOverHandler(handler: Handler): FocusPanel; + addMouseUpHandler(handler: Handler): FocusPanel; + addMouseWheelHandler(handler: Handler): FocusPanel; + addStyleDependentName(styleName: string): FocusPanel; + addStyleName(styleName: string): FocusPanel; + clear(): FocusPanel; + getId(): string; + getTag(): string; + getType(): string; + setAccessKey(accessKey: Char): FocusPanel; + setFocus(focus: boolean): FocusPanel; + setHeight(height: string): FocusPanel; + setId(id: string): FocusPanel; + setLayoutData(layout: Object): FocusPanel; + setPixelSize(width: Integer, height: Integer): FocusPanel; + setSize(width: string, height: string): FocusPanel; + setStyleAttribute(attribute: string, value: string): FocusPanel; + setStyleAttributes(attributes: Object): FocusPanel; + setStyleName(styleName: string): FocusPanel; + setStylePrimaryName(styleName: string): FocusPanel; + setTabIndex(index: Integer): FocusPanel; + setTag(tag: string): FocusPanel; + setTitle(title: string): FocusPanel; + setVisible(visible: boolean): FocusPanel; + setWidget(widget: Widget): FocusPanel; + setWidth(width: string): FocusPanel; + } + + /** + * + * Deprecated. The UI service was + * + * deprecated on December 11, 2014. To create user interfaces, use the + * HTML service instead. + * A panel that wraps its contents in an HTML element. + * + * This panel can be used with a SubmitButton to post form values to the server. All + * children of this panel (direct, or even children of sub-panels) that have a setName function + * and have been given a name will have their values sent to the server when the form is submitted. + * The submit can be handled in the special "doPost" function, as shown in the example. + * + * Note that this panel can contain at most one direct child widget. To add more children, make the + * child of this panel a different panel that can contain more than one child. + * + * Here is an example of how to use this widget: + * + * function doGet() { + * var app = UiApp.createApplication(); + * var form = app.createFormPanel(); + * var flow = app.createFlowPanel(); + * flow.add(app.createTextBox().setName("textBox")); + * flow.add(app.createListBox().setName("listBox").addItem("option 1").addItem("option 2")); + * flow.add(app.createSubmitButton("Submit")); + * form.add(flow); + * app.add(form); + * return app; + * } + * + * function doPost(eventInfo) { + * var app = UiApp.getActiveApplication(); + * app.add(app.createLabel("Form submitted. The text box's value was '" + + * eventInfo.parameter.textBox + + * "' and the list box's value was '" + + * eventInfo.parameter.listBox + "'")); + * return app; + * } + * + * Internally, UiApp widgets are built on top of the + * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation + * directly. You can find the FormPanel documentation here. + */ + export interface FormPanel { + add(widget: Widget): FormPanel; + addStyleDependentName(styleName: string): FormPanel; + addStyleName(styleName: string): FormPanel; + addSubmitCompleteHandler(handler: Handler): FormPanel; + addSubmitHandler(handler: Handler): FormPanel; + clear(): FormPanel; + getId(): string; + getTag(): string; + getType(): string; + setAction(action: string): FormPanel; + setEncoding(encoding: string): FormPanel; + setHeight(height: string): FormPanel; + setId(id: string): FormPanel; + setLayoutData(layout: Object): FormPanel; + setMethod(method: string): FormPanel; + setPixelSize(width: Integer, height: Integer): FormPanel; + setSize(width: string, height: string): FormPanel; + setStyleAttribute(attribute: string, value: string): FormPanel; + setStyleAttributes(attributes: Object): FormPanel; + setStyleName(styleName: string): FormPanel; + setStylePrimaryName(styleName: string): FormPanel; + setTag(tag: string): FormPanel; + setTitle(title: string): FormPanel; + setVisible(visible: boolean): FormPanel; + setWidget(widget: Widget): FormPanel; + setWidth(width: string): FormPanel; + } + + /** + * + * Deprecated. The UI service was + * + * deprecated on December 11, 2014. To create user interfaces, use the + * HTML service instead. + * A rectangular grid that can contain text, html, or a child widget within its cells. It must be + * resized explicitly to the desired number of rows and columns. + * + * Here is an example of how to use this widget: + * + * function doGet() { + * var app = UiApp.createApplication(); + * app.add(app.createGrid(3, 3) + * .setBorderWidth(1) + * .setCellSpacing(10) + * .setCellPadding(10) + * .setText(0, 0, "X") + * .setText(1, 1, "X") + * .setText(2, 2, "X") + * .setText(0, 1, "O") + * .setText(0, 2, "O") + * .setStyleAttribute(0, 0, "color", "red") + * .setStyleAttribute(1, 1, "color", "red") + * .setStyleAttribute(2, 2, "color", "red") + * .setStyleAttribute(0, 1, "color", "blue") + * .setStyleAttribute(0, 2, "color", "blue")); + * return app; + * } + * + * Internally, UiApp widgets are built on top of the + * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation + * directly. You can find the Grid documentation here. + */ + export interface Grid { + addClickHandler(handler: Handler): Grid; + addStyleDependentName(styleName: string): Grid; + addStyleName(styleName: string): Grid; + clear(): Grid; + getId(): string; + getTag(): string; + getType(): string; + resize(rows: Integer, columns: Integer): Grid; + setBorderWidth(width: Integer): Grid; + setCellPadding(padding: Integer): Grid; + setCellSpacing(spacing: Integer): Grid; + setColumnStyleAttribute(column: Integer, attribute: string, value: string): Grid; + setColumnStyleAttributes(column: Integer, attributes: Object): Grid; + setHeight(height: string): Grid; + setId(id: string): Grid; + setLayoutData(layout: Object): Grid; + setPixelSize(width: Integer, height: Integer): Grid; + setRowStyleAttribute(row: Integer, attribute: string, value: string): Grid; + setRowStyleAttributes(row: Integer, attributes: Object): Grid; + setSize(width: string, height: string): Grid; + setStyleAttribute(row: Integer, column: Integer, attribute: string, value: string): Grid; + setStyleAttribute(attribute: string, value: string): Grid; + setStyleAttributes(row: Integer, column: Integer, attributes: Object): Grid; + setStyleAttributes(attributes: Object): Grid; + setStyleName(styleName: string): Grid; + setStylePrimaryName(styleName: string): Grid; + setTag(tag: string): Grid; + setText(row: Integer, column: Integer, text: string): Grid; + setTitle(title: string): Grid; + setVisible(visible: boolean): Grid; + setWidget(row: Integer, column: Integer, widget: Widget): Grid; + setWidth(width: string): Grid; + } + + /** + * + * Deprecated. The UI service was + * + * deprecated on December 11, 2014. To create user interfaces, use the + * HTML service instead. + * A widget that contains arbitrary text, which is interpreted as HTML. + * + * Only basic HTML markup such as bold, italic, etc. are allowed; in particular, scripts will be + * stripped out completely. + * + * Here is an example of how to use this widget: + * + * function doGet() { + * var app = UiApp.createApplication(); + * app.add(app.createHTML("Hello World!")); + * return app; + * } + * + * Internally, UiApp widgets are built on top of the + * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation + * directly. You can find the HTML documentation here. + */ + export interface HTML { + addClickHandler(handler: Handler): HTML; + addMouseDownHandler(handler: Handler): HTML; + addMouseMoveHandler(handler: Handler): HTML; + addMouseOutHandler(handler: Handler): HTML; + addMouseOverHandler(handler: Handler): HTML; + addMouseUpHandler(handler: Handler): HTML; + addMouseWheelHandler(handler: Handler): HTML; + addStyleDependentName(styleName: string): HTML; + addStyleName(styleName: string): HTML; + getId(): string; + getTag(): string; + getType(): string; + setDirection(direction: Component): HTML; + setHTML(html: string): HTML; + setHeight(height: string): HTML; + setHorizontalAlignment(horizontalAlignment: HorizontalAlignment): HTML; + setId(id: string): HTML; + setLayoutData(layout: Object): HTML; + setPixelSize(width: Integer, height: Integer): HTML; + setSize(width: string, height: string): HTML; + setStyleAttribute(attribute: string, value: string): HTML; + setStyleAttributes(attributes: Object): HTML; + setStyleName(styleName: string): HTML; + setStylePrimaryName(styleName: string): HTML; + setTag(tag: string): HTML; + setText(text: string): HTML; + setTitle(title: string): HTML; + setVisible(visible: boolean): HTML; + setWidth(width: string): HTML; + setWordWrap(wordWrap: boolean): HTML; + } + + /** + * + * Deprecated. The UI service was + * + * deprecated on December 11, 2014. To create user interfaces, use the + * HTML service instead. + * Base interface for client and server handlers. + * Implementing classes + * + * NameBrief description + * + * ClientHandlerAn event handler that runs in the user's browser without needing a call back to the server. + * + * ServerHandlerAn event handler that runs on the server. + */ + export interface Handler { + getId(): string; + getTag(): string; + getType(): string; + setId(id: string): Handler; + setTag(tag: string): Handler; + validateEmail(widget: Widget): Handler; + validateInteger(widget: Widget): Handler; + validateLength(widget: Widget, min: Integer, max: Integer): Handler; + validateMatches(widget: Widget, pattern: string): Handler; + validateMatches(widget: Widget, pattern: string, flags: string): Handler; + validateNotEmail(widget: Widget): Handler; + validateNotInteger(widget: Widget): Handler; + validateNotLength(widget: Widget, min: Integer, max: Integer): Handler; + validateNotMatches(widget: Widget, pattern: string): Handler; + validateNotMatches(widget: Widget, pattern: string, flags: string): Handler; + validateNotNumber(widget: Widget): Handler; + validateNotOptions(widget: Widget, options: String[]): Handler; + validateNotRange(widget: Widget, min: Number, max: Number): Handler; + validateNotSum(widgets: Widget[], sum: Integer): Handler; + validateNumber(widget: Widget): Handler; + validateOptions(widget: Widget, options: String[]): Handler; + validateRange(widget: Widget, min: Number, max: Number): Handler; + validateSum(widgets: Widget[], sum: Integer): Handler; + } + + /** + * + * Deprecated. The UI service was + * + * deprecated on December 11, 2014. To create user interfaces, use the + * HTML service instead. + * Represents a hidden field for storing data in the user's browser that can be passed back to a + * handler as a "callback element". + * + * Here is an example of how to use this widget: + * + * function doGet() { + * var app = UiApp.createApplication(); + * // Note that the name "appState" for callbacks, and the id "hidden" for + * // getting a reference to the widget, are not required to be the same. + * var hidden = app.createHidden("appState", "0").setId("hidden"); + * app.add(hidden); + * var handler = app.createServerHandler("click").addCallbackElement(hidden); + * app.add(app.createButton("click me!", handler)); + * app.add(app.createLabel("clicked 0 times").setId("label")); + * return app; + * } + * + * function click(eventInfo) { + * var app = UiApp.createApplication(); + * // We have the value of the hidden field because it was a callback element. + * var numClicks = Number(eventInfo.parameter.appState); + * numClicks++; + * // Just store the number as a string. We could actually store arbitrarily complex data + * // here using JSON.stringify() to turn a JavaScript object into a string to store, and + * // JSON.parse() to turn the string back into an object. + * app.getElementById("hidden").setValue(String(numClicks)); + * app.getElementById("label").setText("clicked " + numClicks + " times"); + * return app; + * } + * + * Internally, UiApp widgets are built on top of the + * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation + * directly. You can find the Hidden documentation here. + */ + export interface Hidden { + addStyleDependentName(styleName: string): Hidden; + addStyleName(styleName: string): Hidden; + getId(): string; + getTag(): string; + getType(): string; + setDefaultValue(value: string): Hidden; + setHeight(height: string): Hidden; + setID(id: string): Hidden; + setId(id: string): Hidden; + setLayoutData(layout: Object): Hidden; + setName(name: string): Hidden; + setPixelSize(width: Integer, height: Integer): Hidden; + setSize(width: string, height: string): Hidden; + setStyleAttribute(attribute: string, value: string): Hidden; + setStyleAttributes(attributes: Object): Hidden; + setStyleName(styleName: string): Hidden; + setStylePrimaryName(styleName: string): Hidden; + setTag(tag: string): Hidden; + setTitle(title: string): Hidden; + setValue(value: string): Hidden; + setVisible(visible: boolean): Hidden; + setWidth(width: string): Hidden; + } + + /** + * + * Deprecated. The UI service was + * + * deprecated on December 11, 2014. To create user interfaces, use the + * HTML service instead. + * Horizontal alignment constants to use with setHorizontalAlignment methods in UiApp. + */ + export enum HorizontalAlignment { LEFT, RIGHT, CENTER, DEFAULT, JUSTIFY, LOCALE_START, LOCALE_END } + + /** + * + * Deprecated. The UI service was + * + * deprecated on December 11, 2014. To create user interfaces, use the + * HTML service instead. + * A panel that lays all of its widgets out in a single horizontal column. + * + * Here is an example of how to use this widget: + * + * function doGet() { + * var app = UiApp.createApplication(); + * var panel = app.createHorizontalPanel(); + * panel.add(app.createButton("button 1")); + * panel.add(app.createButton("button 2")); + * app.add(panel); + * return app; + * } + * + * Internally, UiApp widgets are built on top of the + * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation + * directly. You can find the HorizontalPanel documentation here. + */ + export interface HorizontalPanel { + add(widget: Widget): HorizontalPanel; + addStyleDependentName(styleName: string): HorizontalPanel; + addStyleName(styleName: string): HorizontalPanel; + clear(): HorizontalPanel; + getId(): string; + getTag(): string; + getType(): string; + remove(index: Integer): HorizontalPanel; + remove(widget: Widget): HorizontalPanel; + setBorderWidth(width: Integer): HorizontalPanel; + setCellHeight(widget: Widget, height: string): HorizontalPanel; + setCellHorizontalAlignment(widget: Widget, horizontalAlignment: HorizontalAlignment): HorizontalPanel; + setCellVerticalAlignment(widget: Widget, verticalAlignment: VerticalAlignment): HorizontalPanel; + setCellWidth(widget: Widget, width: string): HorizontalPanel; + setHeight(height: string): HorizontalPanel; + setHorizontalAlignment(horizontalAlignment: HorizontalAlignment): HorizontalPanel; + setId(id: string): HorizontalPanel; + setLayoutData(layout: Object): HorizontalPanel; + setPixelSize(width: Integer, height: Integer): HorizontalPanel; + setSize(width: string, height: string): HorizontalPanel; + setSpacing(spacing: Integer): HorizontalPanel; + setStyleAttribute(attribute: string, value: string): HorizontalPanel; + setStyleAttributes(attributes: Object): HorizontalPanel; + setStyleName(styleName: string): HorizontalPanel; + setStylePrimaryName(styleName: string): HorizontalPanel; + setTag(tag: string): HorizontalPanel; + setTitle(title: string): HorizontalPanel; + setVerticalAlignment(verticalAlignment: VerticalAlignment): HorizontalPanel; + setVisible(visible: boolean): HorizontalPanel; + setWidth(width: string): HorizontalPanel; + } + + /** + * + * Deprecated. The UI service was + * + * deprecated on December 11, 2014. To create user interfaces, use the + * HTML service instead. + * A widget that displays the image at a given URL. + * + * The image can be in 'unclipped' mode (the default) or 'clipped' mode. + * In clipped mode, a viewport is overlaid on top of the image so that a subset of the image will be + * displayed. In unclipped mode, there is no viewport - the entire image will be + * visible. Whether an image is in clipped or unclipped mode depends on how the + * image is constructed, and how it is transformed after construction. Methods + * will operate differently depending on the mode that the image is in. These + * differences are detailed in the documentation for each method. + * + * Here is an example of how to use this widget: + * + * function doGet() { + * var app = UiApp.createApplication(); + * // The very first Google Doodle! + * app.add(app.createImage("http://www.google.com/logos/googleburn.jpg")); + * // Just the man in the middle + * app.add(app.createImage("http://www.google.com/logos/googleburn.jpg", 118, 0, 50, 106)); + * return app; + * } + * + * Due to browser-specific HTML constructions needed to achieve the clipping effect, certain CSS + * attributes, such as padding and background, may not work as expected when an image is in clipped + * mode. These limitations can usually be easily worked around by encapsulating the image in a + * container widget that can itself be styled. + * + * Internally, UiApp widgets are built on top of the + * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation + * directly. You can find the Image documentation here. + */ + export interface Image { + addClickHandler(handler: Handler): Image; + addErrorHandler(handler: Handler): Image; + addLoadHandler(handler: Handler): Image; + addMouseDownHandler(handler: Handler): Image; + addMouseMoveHandler(handler: Handler): Image; + addMouseOutHandler(handler: Handler): Image; + addMouseOverHandler(handler: Handler): Image; + addMouseUpHandler(handler: Handler): Image; + addMouseWheelHandler(handler: Handler): Image; + addStyleDependentName(styleName: string): Image; + addStyleName(styleName: string): Image; + getId(): string; + getTag(): string; + getType(): string; + setHeight(height: string): Image; + setId(id: string): Image; + setLayoutData(layout: Object): Image; + setPixelSize(width: Integer, height: Integer): Image; + setResource(resource: Component): Image; + setSize(width: string, height: string): Image; + setStyleAttribute(attribute: string, value: string): Image; + setStyleAttributes(attributes: Object): Image; + setStyleName(styleName: string): Image; + setStylePrimaryName(styleName: string): Image; + setTag(tag: string): Image; + setTitle(title: string): Image; + setUrl(url: string): Image; + setUrlAndVisibleRect(url: string, left: Integer, top: Integer, width: Integer, height: Integer): Image; + setVisible(visible: boolean): Image; + setVisibleRect(left: Integer, top: Integer, width: Integer, height: Integer): Image; + setWidth(width: string): Image; + } + + /** + * + * Deprecated. The UI service was + * + * deprecated on December 11, 2014. To create user interfaces, use the + * HTML service instead. + * A widget that contains arbitrary text, not interpreted as HTML. + * + * This widget uses a element, causing it to be displayed with inline layout. + * + * Internally, UiApp widgets are built on top of the + * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation + * directly. You can find the InlineLabel documentation here. + */ + export interface InlineLabel { + addClickHandler(handler: Handler): InlineLabel; + addMouseDownHandler(handler: Handler): InlineLabel; + addMouseMoveHandler(handler: Handler): InlineLabel; + addMouseOutHandler(handler: Handler): InlineLabel; + addMouseOverHandler(handler: Handler): InlineLabel; + addMouseUpHandler(handler: Handler): InlineLabel; + addMouseWheelHandler(handler: Handler): InlineLabel; + addStyleDependentName(styleName: string): InlineLabel; + addStyleName(styleName: string): InlineLabel; + getId(): string; + getTag(): string; + getType(): string; + setDirection(direction: Component): InlineLabel; + setHeight(height: string): InlineLabel; + setHorizontalAlignment(horizontalAlignment: HorizontalAlignment): InlineLabel; + setId(id: string): InlineLabel; + setLayoutData(layout: Object): InlineLabel; + setPixelSize(width: Integer, height: Integer): InlineLabel; + setSize(width: string, height: string): InlineLabel; + setStyleAttribute(attribute: string, value: string): InlineLabel; + setStyleAttributes(attributes: Object): InlineLabel; + setStyleName(styleName: string): InlineLabel; + setStylePrimaryName(styleName: string): InlineLabel; + setTag(tag: string): InlineLabel; + setText(text: string): InlineLabel; + setTitle(title: string): InlineLabel; + setVisible(visible: boolean): InlineLabel; + setWidth(width: string): InlineLabel; + setWordWrap(wordWrap: boolean): InlineLabel; + } + + /** + * + * Deprecated. The UI service was + * + * deprecated on December 11, 2014. To create user interfaces, use the + * HTML service instead. + * A widget that contains arbitrary text, not interpreted as HTML. + * + * Here is an example of how to use this widget: + * + * function doGet() { + * var app = UiApp.createApplication(); + * app.add(app.createLabel("Hello World!")); + * return app; + * } + * + * Internally, UiApp widgets are built on top of the + * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation + * directly. You can find the Label documentation here. + */ + export interface Label { + addClickHandler(handler: Handler): Label; + addMouseDownHandler(handler: Handler): Label; + addMouseMoveHandler(handler: Handler): Label; + addMouseOutHandler(handler: Handler): Label; + addMouseOverHandler(handler: Handler): Label; + addMouseUpHandler(handler: Handler): Label; + addMouseWheelHandler(handler: Handler): Label; + addStyleDependentName(styleName: string): Label; + addStyleName(styleName: string): Label; + getId(): string; + getTag(): string; + getType(): string; + setDirection(direction: Component): Label; + setHeight(height: string): Label; + setHorizontalAlignment(horizontalAlignment: HorizontalAlignment): Label; + setId(id: string): Label; + setLayoutData(layout: Object): Label; + setPixelSize(width: Integer, height: Integer): Label; + setSize(width: string, height: string): Label; + setStyleAttribute(attribute: string, value: string): Label; + setStyleAttributes(attributes: Object): Label; + setStyleName(styleName: string): Label; + setStylePrimaryName(styleName: string): Label; + setTag(tag: string): Label; + setText(text: string): Label; + setTitle(title: string): Label; + setVisible(visible: boolean): Label; + setWidth(width: string): Label; + setWordWrap(wordWrap: boolean): Label; + } + + /** + * + * Deprecated. The UI service was + * + * deprecated on December 11, 2014. To create user interfaces, use the + * HTML service instead. + * A widget that presents a list of choices to the user, either as a list box or + * as a drop-down list. + * + * Here is an example usage, which should be executed from within a spreadsheet bound script. + * + * // execute this in a spreadsheet + * function show() { + * var doc = SpreadsheetApp.getActiveSpreadsheet(); + * var app = UiApp.createApplication().setTitle('My Application'); + * var panel = app.createVerticalPanel(); + * var lb = app.createListBox(true).setId('myId').setName('myLbName'); + * + * // add items to ListBox + * lb.setVisibleItemCount(3); + * lb.addItem('first'); + * lb.addItem('second'); + * lb.addItem('third'); + * lb.addItem('fourth'); + * lb.addItem('fifth'); + * lb.addItem('sixth'); + * + * panel.add(lb); + * var button = app.createButton('press me'); + * var handler = app.createServerClickHandler('click').addCallbackElement(panel); + * button.addClickHandler(handler); + * panel.add(button); + * app.add(panel); + * doc.show(app); + * } + * + * function click(eventInfo) { + * var app = UiApp.getActiveApplication(); + * // get values of ListBox + * var value = eventInfo.parameter.myLbName; + * // multi select box returns a comma separated string + * var n = value.split(','); + * + * var doc = SpreadsheetApp.getActiveSpreadsheet(); + * doc.getRange('a1').setValue(value); + * doc.getRange('b1').setValue('there are ' + n.length + ' items selected'); + * return app; + * } + * + * Internally, UiApp widgets are built on top of the + * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation + * directly. You can find the ListBox documentation here. + */ + export interface ListBox { + addBlurHandler(handler: Handler): ListBox; + addChangeHandler(handler: Handler): ListBox; + addClickHandler(handler: Handler): ListBox; + addFocusHandler(handler: Handler): ListBox; + addItem(text: string): ListBox; + addItem(text: string, value: string): ListBox; + addKeyDownHandler(handler: Handler): ListBox; + addKeyPressHandler(handler: Handler): ListBox; + addKeyUpHandler(handler: Handler): ListBox; + addMouseDownHandler(handler: Handler): ListBox; + addMouseMoveHandler(handler: Handler): ListBox; + addMouseOutHandler(handler: Handler): ListBox; + addMouseOverHandler(handler: Handler): ListBox; + addMouseUpHandler(handler: Handler): ListBox; + addMouseWheelHandler(handler: Handler): ListBox; + addStyleDependentName(styleName: string): ListBox; + addStyleName(styleName: string): ListBox; + clear(): ListBox; + getId(): string; + getTag(): string; + getType(): string; + removeItem(index: Integer): ListBox; + setAccessKey(accessKey: Char): ListBox; + setEnabled(enabled: boolean): ListBox; + setFocus(focus: boolean): ListBox; + setHeight(height: string): ListBox; + setId(id: string): ListBox; + setItemSelected(index: Integer, selected: boolean): ListBox; + setItemText(index: Integer, text: string): ListBox; + setLayoutData(layout: Object): ListBox; + setName(name: string): ListBox; + setPixelSize(width: Integer, height: Integer): ListBox; + setSelectedIndex(index: Integer): ListBox; + setSize(width: string, height: string): ListBox; + setStyleAttribute(attribute: string, value: string): ListBox; + setStyleAttributes(attributes: Object): ListBox; + setStyleName(styleName: string): ListBox; + setStylePrimaryName(styleName: string): ListBox; + setTabIndex(index: Integer): ListBox; + setTag(tag: string): ListBox; + setTitle(title: string): ListBox; + setValue(index: Integer, value: string): ListBox; + setVisible(visible: boolean): ListBox; + setVisibleItemCount(count: Integer): ListBox; + setWidth(width: string): ListBox; + } + + /** + * + * Deprecated. The UI service was + * + * deprecated on December 11, 2014. To create user interfaces, use the + * HTML service instead. + * A standard menu bar widget. + * + * A menu bar can contain any number of menu items, + * each of which can either fire an event handler or open a cascaded menu bar. + * + * Internally, UiApp widgets are built on top of the + * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation + * directly. You can find the MenuBar documentation here. + */ + export interface MenuBar { + addCloseHandler(handler: Handler): MenuBar; + addItem(item: MenuItem): MenuBar; + addItem(text: string, asHtml: boolean, command: Handler): MenuBar; + addItem(text: string, asHtml: boolean, subMenu: MenuBar): MenuBar; + addItem(text: string, command: Handler): MenuBar; + addItem(text: string, subMenu: MenuBar): MenuBar; + addSeparator(): MenuBar; + addSeparator(separator: MenuItemSeparator): MenuBar; + addStyleDependentName(styleName: string): MenuBar; + addStyleName(styleName: string): MenuBar; + getId(): string; + getTag(): string; + getType(): string; + setAnimationEnabled(animationEnabled: boolean): MenuBar; + setAutoOpen(autoOpen: boolean): MenuBar; + setHeight(height: string): MenuBar; + setId(id: string): MenuBar; + setLayoutData(layout: Object): MenuBar; + setPixelSize(width: Integer, height: Integer): MenuBar; + setSize(width: string, height: string): MenuBar; + setStyleAttribute(attribute: string, value: string): MenuBar; + setStyleAttributes(attributes: Object): MenuBar; + setStyleName(styleName: string): MenuBar; + setStylePrimaryName(styleName: string): MenuBar; + setTag(tag: string): MenuBar; + setTitle(title: string): MenuBar; + setVisible(visible: boolean): MenuBar; + setWidth(width: string): MenuBar; + } + + /** + * + * Deprecated. The UI service was + * + * deprecated on December 11, 2014. To create user interfaces, use the + * HTML service instead. + * An entry in a MenuBar. + * + * Menu items can either fire an event handler when they are clicked, or open a cascading sub-menu. + * + * Internally, UiApp widgets are built on top of the + * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation + * directly. You can find the MenuItem documentation here. + */ + export interface MenuItem { + addStyleDependentName(styleName: string): MenuItem; + addStyleName(styleName: string): MenuItem; + getId(): string; + getTag(): string; + getType(): string; + setCommand(handler: Handler): MenuItem; + setHTML(html: string): MenuItem; + setHeight(height: string): MenuItem; + setId(id: string): MenuItem; + setPixelSize(width: Integer, height: Integer): MenuItem; + setSize(width: string, height: string): MenuItem; + setStyleAttribute(attribute: string, value: string): MenuItem; + setStyleAttributes(attributes: Object): MenuItem; + setStyleName(styleName: string): MenuItem; + setStylePrimaryName(styleName: string): MenuItem; + setSubMenu(subMenu: MenuBar): MenuItem; + setTag(tag: string): MenuItem; + setText(text: string): MenuItem; + setTitle(title: string): MenuItem; + setVisible(visible: boolean): MenuItem; + setWidth(width: string): MenuItem; + } + + /** + * + * Deprecated. The UI service was + * + * deprecated on December 11, 2014. To create user interfaces, use the + * HTML service instead. + * A separator that can be placed in a MenuBar. + * + * Internally, UiApp widgets are built on top of the + * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation + * directly. You can find the MenuItemSeparator documentation here. + */ + export interface MenuItemSeparator { + addStyleDependentName(styleName: string): MenuItemSeparator; + addStyleName(styleName: string): MenuItemSeparator; + getId(): string; + getTag(): string; + getType(): string; + setHeight(height: string): MenuItemSeparator; + setId(id: string): MenuItemSeparator; + setPixelSize(width: Integer, height: Integer): MenuItemSeparator; + setSize(width: string, height: string): MenuItemSeparator; + setStyleAttribute(attribute: string, value: string): MenuItemSeparator; + setStyleAttributes(attributes: Object): MenuItemSeparator; + setStyleName(styleName: string): MenuItemSeparator; + setStylePrimaryName(styleName: string): MenuItemSeparator; + setTag(tag: string): MenuItemSeparator; + setTitle(title: string): MenuItemSeparator; + setVisible(visible: boolean): MenuItemSeparator; + setWidth(width: string): MenuItemSeparator; + } + + /** + * + * Deprecated. The UI service was + * + * deprecated on December 11, 2014. To create user interfaces, use the + * HTML service instead. + * A text box that visually masks its input to prevent eavesdropping. + * + * Here is an example of how to use this widget: + * + * function doGet() { + * var app = UiApp.createApplication(); + * var text = app.createPasswordTextBox().setName("text"); + * var handler = app.createServerHandler("test").addCallbackElement(text); + * app.add(text); + * app.add(app.createButton("Test", handler)); + * app.add(app.createLabel("0 characters").setId("label")); + * return app; + * } + * + * function test(eventInfo) { + * var app = UiApp.createApplication(); + * // Because the text box was named "text" and added as a callback element to the + * // button's click event, we have its value available in eventInfo.parameter.text. + * var pass = eventInfo.parameter.text; + * var isStrong = + * pass.length >= 10 && /[A-Z]/.test(pass) && /[a-z]/.test(pass) && /[0-9]/.test(pass); + * var label = app.getElementById("label"); + * if (isStrong) { + * label.setText("Strong! Well, not really, but this is just an example.") + * .setStyleAttribute("color", "green"); + * } else { + * label.setText("Weak! Use at least 10 characters, with uppercase, lowercase, and digits") + * .setStyleAttribute("color", "red"); + * } + * return app; + * } + * + * Internally, UiApp widgets are built on top of the + * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation + * directly. You can find the PasswordTextBox documentation here. + */ + export interface PasswordTextBox { + addBlurHandler(handler: Handler): PasswordTextBox; + addChangeHandler(handler: Handler): PasswordTextBox; + addClickHandler(handler: Handler): PasswordTextBox; + addFocusHandler(handler: Handler): PasswordTextBox; + addKeyDownHandler(handler: Handler): PasswordTextBox; + addKeyPressHandler(handler: Handler): PasswordTextBox; + addKeyUpHandler(handler: Handler): PasswordTextBox; + addMouseDownHandler(handler: Handler): PasswordTextBox; + addMouseMoveHandler(handler: Handler): PasswordTextBox; + addMouseOutHandler(handler: Handler): PasswordTextBox; + addMouseOverHandler(handler: Handler): PasswordTextBox; + addMouseUpHandler(handler: Handler): PasswordTextBox; + addMouseWheelHandler(handler: Handler): PasswordTextBox; + addStyleDependentName(styleName: string): PasswordTextBox; + addStyleName(styleName: string): PasswordTextBox; + addValueChangeHandler(handler: Handler): PasswordTextBox; + getId(): string; + getTag(): string; + getType(): string; + setAccessKey(accessKey: Char): PasswordTextBox; + setCursorPos(position: Integer): PasswordTextBox; + setDirection(direction: Component): PasswordTextBox; + setEnabled(enabled: boolean): PasswordTextBox; + setFocus(focus: boolean): PasswordTextBox; + setHeight(height: string): PasswordTextBox; + setId(id: string): PasswordTextBox; + setLayoutData(layout: Object): PasswordTextBox; + setMaxLength(length: Integer): PasswordTextBox; + setName(name: string): PasswordTextBox; + setPixelSize(width: Integer, height: Integer): PasswordTextBox; + setReadOnly(readOnly: boolean): PasswordTextBox; + setSelectionRange(position: Integer, length: Integer): PasswordTextBox; + setSize(width: string, height: string): PasswordTextBox; + setStyleAttribute(attribute: string, value: string): PasswordTextBox; + setStyleAttributes(attributes: Object): PasswordTextBox; + setStyleName(styleName: string): PasswordTextBox; + setStylePrimaryName(styleName: string): PasswordTextBox; + setTabIndex(index: Integer): PasswordTextBox; + setTag(tag: string): PasswordTextBox; + setText(text: string): PasswordTextBox; + setTextAlignment(textAlign: Component): PasswordTextBox; + setTitle(title: string): PasswordTextBox; + setValue(value: string): PasswordTextBox; + setValue(value: string, fireEvents: boolean): PasswordTextBox; + setVisible(visible: boolean): PasswordTextBox; + setVisibleLength(length: Integer): PasswordTextBox; + setWidth(width: string): PasswordTextBox; + } + + /** + * + * Deprecated. The UI service was + * + * deprecated on December 11, 2014. To create user interfaces, use the + * HTML service instead. + * A panel that can "pop up" over other widgets. It overlays the browser's + * client area (and any previously-created popups). + * + * In general it's not recommended to add this panel as a child of another widget or of the app + * as that will make it behave like any other inline panel and not act as a popup. Instead, create + * the popup and then use its show() and hide() methods to show and hide it. See + * the example below. + * + * To make the popup stay at a fixed location rather than scrolling with the page, try setting the + * 'position', 'fixed' style on it with setStyleAttribute(attribute, value). + * + * Note that this panel can contain at most one direct child widget. To add more children, make the + * child of this panel a different panel that can contain more than one child. + * + * Internally, UiApp widgets are built on top of the + * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation + * directly. You can find the PopupPanel documentation here. + * + * Here is an example showing how to use the popup panel widget: + * + * function doGet() { + * var app = UiApp.createApplication(); + * // Create a popup panel and set it to be modal. + * var popupPanel = app.createPopupPanel(false, true); + * // Add a button to the panel and set the dimensions and position. + * popupPanel.add(app.createButton()).setWidth("100px").setHeight("100px") + * .setPopupPosition(100, 100); + * // Show the panel. Note that it does not have to be "added" to the UiInstance. + * popupPanel.show(); + * return app; + * } + */ + export interface PopupPanel { + add(widget: Widget): PopupPanel; + addAutoHidePartner(partner: Component): PopupPanel; + addCloseHandler(handler: Handler): PopupPanel; + addStyleDependentName(styleName: string): PopupPanel; + addStyleName(styleName: string): PopupPanel; + clear(): PopupPanel; + getId(): string; + getTag(): string; + getType(): string; + hide(): PopupPanel; + setAnimationEnabled(animationEnabled: boolean): PopupPanel; + setAutoHideEnabled(enabled: boolean): PopupPanel; + setGlassEnabled(enabled: boolean): PopupPanel; + setGlassStyleName(styleName: string): PopupPanel; + setHeight(height: string): PopupPanel; + setId(id: string): PopupPanel; + setLayoutData(layout: Object): PopupPanel; + setModal(modal: boolean): PopupPanel; + setPixelSize(width: Integer, height: Integer): PopupPanel; + setPopupPosition(left: Integer, top: Integer): PopupPanel; + setPopupPositionAndShow(a: Component): PopupPanel; + setPreviewingAllNativeEvents(previewing: boolean): PopupPanel; + setSize(width: string, height: string): PopupPanel; + setStyleAttribute(attribute: string, value: string): PopupPanel; + setStyleAttributes(attributes: Object): PopupPanel; + setStyleName(styleName: string): PopupPanel; + setStylePrimaryName(styleName: string): PopupPanel; + setTag(tag: string): PopupPanel; + setTitle(title: string): PopupPanel; + setVisible(visible: boolean): PopupPanel; + setWidget(widget: Widget): PopupPanel; + setWidth(width: string): PopupPanel; + show(): PopupPanel; + } + + /** + * + * Deprecated. The UI service was + * + * deprecated on December 11, 2014. To create user interfaces, use the + * HTML service instead. + * A normal push button with custom styling. + * + * Here is an example of how to use this widget: + * + * function doGet() { + * var app = UiApp.createApplication(); + * // create a button and give it a click handler + * var button = app.createPushButton().setText("click me!").setId("button"); + * button.addClickHandler(app.createServerHandler("handlerFunction")); + * app.add(button); + * return app; + * } + * + * function handlerFunction(eventInfo) { + * var app = UiApp.getActiveApplication(); + * app.add(app.createLabel("The button was clicked!")); + * return app; + * } + * + * Internally, UiApp widgets are built on top of the + * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation + * directly. You can find the PushButton documentation here. + */ + export interface PushButton { + addBlurHandler(handler: Handler): PushButton; + addClickHandler(handler: Handler): PushButton; + addFocusHandler(handler: Handler): PushButton; + addKeyDownHandler(handler: Handler): PushButton; + addKeyPressHandler(handler: Handler): PushButton; + addKeyUpHandler(handler: Handler): PushButton; + addMouseDownHandler(handler: Handler): PushButton; + addMouseMoveHandler(handler: Handler): PushButton; + addMouseOutHandler(handler: Handler): PushButton; + addMouseOverHandler(handler: Handler): PushButton; + addMouseUpHandler(handler: Handler): PushButton; + addMouseWheelHandler(handler: Handler): PushButton; + addStyleDependentName(styleName: string): PushButton; + addStyleName(styleName: string): PushButton; + getId(): string; + getTag(): string; + getType(): string; + setAccessKey(accessKey: Char): PushButton; + setEnabled(enabled: boolean): PushButton; + setFocus(focus: boolean): PushButton; + setHTML(html: string): PushButton; + setHeight(height: string): PushButton; + setId(id: string): PushButton; + setLayoutData(layout: Object): PushButton; + setPixelSize(width: Integer, height: Integer): PushButton; + setSize(width: string, height: string): PushButton; + setStyleAttribute(attribute: string, value: string): PushButton; + setStyleAttributes(attributes: Object): PushButton; + setStyleName(styleName: string): PushButton; + setStylePrimaryName(styleName: string): PushButton; + setTabIndex(index: Integer): PushButton; + setTag(tag: string): PushButton; + setText(text: string): PushButton; + setTitle(title: string): PushButton; + setVisible(visible: boolean): PushButton; + setWidth(width: string): PushButton; + } + + /** + * + * Deprecated. The UI service was + * + * deprecated on December 11, 2014. To create user interfaces, use the + * HTML service instead. + * A mutually-exclusive selection radio button widget. + * + * This widget fires + * click events when the radio button is clicked, and value change events when the + * button becomes checked. Note, however, that browser limitations prevent + * value change events from being sent when the radio button is cleared as a side + * effect of another in the group being clicked. + * + * RadioButtons are grouped according to the following rules: + * + * In the absence of a FormPanel, RadioButtons with the same name are part of the same + * group. + * + * Within a FormPanel, all unnamed RadioButtons are part of the same group. + * + * Within a FormPanel, all RadioButtons with the same name are part of the same group - but + * not part of the same group as RadioButtons with the same name outside of the + * FormPanel. + * + * Note that radio button selections within a group do not propagate to server handlers created with + * UiInstance#createServerHandler(). Instead, to capture values on the server, use + * doPost() or separate handlers for each RadioButton. + * + * Internally, UiApp widgets are built on top of the + * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation + * directly. You can find the RadioButton documentation here. + */ + export interface RadioButton { + addBlurHandler(handler: Handler): RadioButton; + addClickHandler(handler: Handler): RadioButton; + addFocusHandler(handler: Handler): RadioButton; + addKeyDownHandler(handler: Handler): RadioButton; + addKeyPressHandler(handler: Handler): RadioButton; + addKeyUpHandler(handler: Handler): RadioButton; + addMouseDownHandler(handler: Handler): RadioButton; + addMouseMoveHandler(handler: Handler): RadioButton; + addMouseOutHandler(handler: Handler): RadioButton; + addMouseOverHandler(handler: Handler): RadioButton; + addMouseUpHandler(handler: Handler): RadioButton; + addMouseWheelHandler(handler: Handler): RadioButton; + addStyleDependentName(styleName: string): RadioButton; + addStyleName(styleName: string): RadioButton; + addValueChangeHandler(handler: Handler): RadioButton; + getId(): string; + getTag(): string; + getType(): string; + setAccessKey(accessKey: Char): RadioButton; + setEnabled(enabled: boolean): RadioButton; + setFocus(focus: boolean): RadioButton; + setFormValue(formValue: string): RadioButton; + setHTML(html: string): RadioButton; + setHeight(height: string): RadioButton; + setId(id: string): RadioButton; + setLayoutData(layout: Object): RadioButton; + setName(name: string): RadioButton; + setPixelSize(width: Integer, height: Integer): RadioButton; + setSize(width: string, height: string): RadioButton; + setStyleAttribute(attribute: string, value: string): RadioButton; + setStyleAttributes(attributes: Object): RadioButton; + setStyleName(styleName: string): RadioButton; + setStylePrimaryName(styleName: string): RadioButton; + setTabIndex(index: Integer): RadioButton; + setTag(tag: string): RadioButton; + setText(text: string): RadioButton; + setTitle(title: string): RadioButton; + setValue(value: boolean): RadioButton; + setValue(value: boolean, fireEvents: boolean): RadioButton; + setVisible(visible: boolean): RadioButton; + setWidth(width: string): RadioButton; + } + + /** + * + * Deprecated. The UI service was + * + * deprecated on December 11, 2014. To create user interfaces, use the + * HTML service instead. + * A standard push-button widget which will automatically reset its enclosing FormPanel if + * any. + * + * Here is an example of how to use this widget: + * + * function doGet() { + * var app = UiApp.createApplication(); + * var panel = app.createFlowPanel(); + * panel.add(app.createTextBox().setText("some text")); + * panel.add(app.createResetButton("reset the textbox")); + * var form = app.createFormPanel(); + * form.add(panel); + * app.add(form); + * return app; + * } + * + * Internally, UiApp widgets are built on top of the + * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation + * directly. You can find the ResetButton documentation here. + */ + export interface ResetButton { + addBlurHandler(handler: Handler): ResetButton; + addClickHandler(handler: Handler): ResetButton; + addFocusHandler(handler: Handler): ResetButton; + addKeyDownHandler(handler: Handler): ResetButton; + addKeyPressHandler(handler: Handler): ResetButton; + addKeyUpHandler(handler: Handler): ResetButton; + addMouseDownHandler(handler: Handler): ResetButton; + addMouseMoveHandler(handler: Handler): ResetButton; + addMouseOutHandler(handler: Handler): ResetButton; + addMouseOverHandler(handler: Handler): ResetButton; + addMouseUpHandler(handler: Handler): ResetButton; + addMouseWheelHandler(handler: Handler): ResetButton; + addStyleDependentName(styleName: string): ResetButton; + addStyleName(styleName: string): ResetButton; + getId(): string; + getTag(): string; + getType(): string; + setAccessKey(accessKey: Char): ResetButton; + setEnabled(enabled: boolean): ResetButton; + setFocus(focus: boolean): ResetButton; + setHTML(html: string): ResetButton; + setHeight(height: string): ResetButton; + setId(id: string): ResetButton; + setLayoutData(layout: Object): ResetButton; + setPixelSize(width: Integer, height: Integer): ResetButton; + setSize(width: string, height: string): ResetButton; + setStyleAttribute(attribute: string, value: string): ResetButton; + setStyleAttributes(attributes: Object): ResetButton; + setStyleName(styleName: string): ResetButton; + setStylePrimaryName(styleName: string): ResetButton; + setTabIndex(index: Integer): ResetButton; + setTag(tag: string): ResetButton; + setText(text: string): ResetButton; + setTitle(title: string): ResetButton; + setVisible(visible: boolean): ResetButton; + setWidth(width: string): ResetButton; + } + + /** + * + * Deprecated. The UI service was + * + * deprecated on December 11, 2014. To create user interfaces, use the + * HTML service instead. + * A panel that wraps its contents in a scrollable element. + * + * Note that this panel can contain at most one direct child widget. To add more children, make the + * child of this panel a different panel that can contain more than one child. + * + * Here is an example of how to use this widget: + * + * function doGet() { + * var app = UiApp.createApplication(); + * // Create some long content. + * var vertical = app.createVerticalPanel(); + * for (var i = 0; i < 100; ++i) { + * vertical.add(app.createButton("button " + i)); + * } + * var scroll = app.createScrollPanel().setPixelSize(100, 100); + * scroll.add(vertical); + * app.add(scroll); + * return app; + * } + * + * Internally, UiApp widgets are built on top of the + * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation + * directly. You can find the ScrollPanel documentation here. + */ + export interface ScrollPanel { + add(widget: Widget): ScrollPanel; + addScrollHandler(handler: Handler): ScrollPanel; + addStyleDependentName(styleName: string): ScrollPanel; + addStyleName(styleName: string): ScrollPanel; + clear(): ScrollPanel; + getId(): string; + getTag(): string; + getType(): string; + setAlwaysShowScrollBars(alwaysShow: boolean): ScrollPanel; + setHeight(height: string): ScrollPanel; + setHorizontalScrollPosition(position: Integer): ScrollPanel; + setId(id: string): ScrollPanel; + setLayoutData(layout: Object): ScrollPanel; + setPixelSize(width: Integer, height: Integer): ScrollPanel; + setScrollPosition(position: Integer): ScrollPanel; + setSize(width: string, height: string): ScrollPanel; + setStyleAttribute(attribute: string, value: string): ScrollPanel; + setStyleAttributes(attributes: Object): ScrollPanel; + setStyleName(styleName: string): ScrollPanel; + setStylePrimaryName(styleName: string): ScrollPanel; + setTag(tag: string): ScrollPanel; + setTitle(title: string): ScrollPanel; + setVisible(visible: boolean): ScrollPanel; + setWidget(widget: Widget): ScrollPanel; + setWidth(width: string): ScrollPanel; + } + + /** + * + * Deprecated. The UI service was + * + * deprecated on December 11, 2014. To create user interfaces, use the + * HTML service instead. + * An event handler that runs on the server. These will, in general, run much slower than + * ClientHandlers but they are not limited in what they can do. + * + * Any method that accepts a "Handler" parameter can accept a ServerHandler. + * + * When a ServerHandler is invoked, the function it refers to is called on the Apps Script server in + * a "fresh" script. This means that no variable values will have survived from previous handlers or + * from the initial script that loaded the app. Global variables in the script will be re-evaluated, + * which means that it's a bad idea to do anything slow (like opening a Spreadsheet or fetching a + * Calendar) in a global variable. + * + * If you need to save state on the server, you can try using ScriptProperties or UserProperties. + * You can also add a Hidden field to your app storing the information you want to save + * and pass it back explicitly to handlers as a "callback element." + * + * If you set validators on a ServerHandler, they will be checked before the handler calls the + * server. The server will only be called if the validators succeed. + * + * If you have multiple ServerHandlers for the same event on the same widget, they will be called + * simultaneously. + */ + export interface ServerHandler { + addCallbackElement(widget: Widget): ServerHandler; + getId(): string; + getTag(): string; + getType(): string; + setCallbackFunction(functionToInvoke: string): ServerHandler; + setId(id: string): ServerHandler; + setTag(tag: string): ServerHandler; + validateEmail(widget: Widget): ServerHandler; + validateInteger(widget: Widget): ServerHandler; + validateLength(widget: Widget, min: Integer, max: Integer): ServerHandler; + validateMatches(widget: Widget, pattern: string): ServerHandler; + validateMatches(widget: Widget, pattern: string, flags: string): ServerHandler; + validateNotEmail(widget: Widget): ServerHandler; + validateNotInteger(widget: Widget): ServerHandler; + validateNotLength(widget: Widget, min: Integer, max: Integer): ServerHandler; + validateNotMatches(widget: Widget, pattern: string): ServerHandler; + validateNotMatches(widget: Widget, pattern: string, flags: string): ServerHandler; + validateNotNumber(widget: Widget): ServerHandler; + validateNotOptions(widget: Widget, options: String[]): ServerHandler; + validateNotRange(widget: Widget, min: Number, max: Number): ServerHandler; + validateNotSum(widgets: Widget[], sum: Integer): ServerHandler; + validateNumber(widget: Widget): ServerHandler; + validateOptions(widget: Widget, options: String[]): ServerHandler; + validateRange(widget: Widget, min: Number, max: Number): ServerHandler; + validateSum(widgets: Widget[], sum: Integer): ServerHandler; + } + + /** + * + * Deprecated. The UI service was + * + * deprecated on December 11, 2014. To create user interfaces, use the + * HTML service instead. + * A simple checkbox widget, with no label. + * + * Internally, UiApp widgets are built on top of the + * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation + * directly. You can find the SimpleCheckBox documentation here. + */ + export interface SimpleCheckBox { + addBlurHandler(handler: Handler): SimpleCheckBox; + addClickHandler(handler: Handler): SimpleCheckBox; + addFocusHandler(handler: Handler): SimpleCheckBox; + addKeyDownHandler(handler: Handler): SimpleCheckBox; + addKeyPressHandler(handler: Handler): SimpleCheckBox; + addKeyUpHandler(handler: Handler): SimpleCheckBox; + addMouseDownHandler(handler: Handler): SimpleCheckBox; + addMouseMoveHandler(handler: Handler): SimpleCheckBox; + addMouseOutHandler(handler: Handler): SimpleCheckBox; + addMouseOverHandler(handler: Handler): SimpleCheckBox; + addMouseUpHandler(handler: Handler): SimpleCheckBox; + addMouseWheelHandler(handler: Handler): SimpleCheckBox; + addStyleDependentName(styleName: string): SimpleCheckBox; + addStyleName(styleName: string): SimpleCheckBox; + getId(): string; + getTag(): string; + getType(): string; + setAccessKey(accessKey: Char): SimpleCheckBox; + setChecked(checked: boolean): SimpleCheckBox; + setEnabled(enabled: boolean): SimpleCheckBox; + setFocus(focus: boolean): SimpleCheckBox; + setHeight(height: string): SimpleCheckBox; + setId(id: string): SimpleCheckBox; + setLayoutData(layout: Object): SimpleCheckBox; + setName(name: string): SimpleCheckBox; + setPixelSize(width: Integer, height: Integer): SimpleCheckBox; + setSize(width: string, height: string): SimpleCheckBox; + setStyleAttribute(attribute: string, value: string): SimpleCheckBox; + setStyleAttributes(attributes: Object): SimpleCheckBox; + setStyleName(styleName: string): SimpleCheckBox; + setStylePrimaryName(styleName: string): SimpleCheckBox; + setTabIndex(index: Integer): SimpleCheckBox; + setTag(tag: string): SimpleCheckBox; + setTitle(title: string): SimpleCheckBox; + setVisible(visible: boolean): SimpleCheckBox; + setWidth(width: string): SimpleCheckBox; + } + + /** + * + * Deprecated. The UI service was + * + * deprecated on December 11, 2014. To create user interfaces, use the + * HTML service instead. + * A panel that can contain only one widget. + * + * This panel is useful for adding styling effects to the child widget. To add more children, make + * the child of this panel a different panel that can contain more than one child. + * + * Here is an example of how to use this widget: + * + * function doGet() { + * var app = UiApp.createApplication(); + * var simple = app.createSimplePanel(); + * var flow = app.createFlowPanel(); + * flow.add(app.createButton("button 1")); + * flow.add(app.createButton("button 2")); + * simple.add(flow); + * app.add(simple); + * return app; + * } + * + * Internally, UiApp widgets are built on top of the + * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation + * directly. You can find the SimplePanel documentation here. + */ + export interface SimplePanel { + add(widget: Widget): SimplePanel; + addStyleDependentName(styleName: string): SimplePanel; + addStyleName(styleName: string): SimplePanel; + clear(): SimplePanel; + getId(): string; + getTag(): string; + getType(): string; + setHeight(height: string): SimplePanel; + setId(id: string): SimplePanel; + setLayoutData(layout: Object): SimplePanel; + setPixelSize(width: Integer, height: Integer): SimplePanel; + setSize(width: string, height: string): SimplePanel; + setStyleAttribute(attribute: string, value: string): SimplePanel; + setStyleAttributes(attributes: Object): SimplePanel; + setStyleName(styleName: string): SimplePanel; + setStylePrimaryName(styleName: string): SimplePanel; + setTag(tag: string): SimplePanel; + setTitle(title: string): SimplePanel; + setVisible(visible: boolean): SimplePanel; + setWidget(widget: Widget): SimplePanel; + setWidth(width: string): SimplePanel; + } + + /** + * + * Deprecated. The UI service was + * + * deprecated on December 11, 2014. To create user interfaces, use the + * HTML service instead. + * A simple radio button widget, with no label. + * + * SimpleRadioButtons are grouped according to the same rules as RadioButtons. + * + * Internally, UiApp widgets are built on top of the + * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation + * directly. You can find the SimpleRadioButton documentation here. + */ + export interface SimpleRadioButton { + addBlurHandler(handler: Handler): SimpleRadioButton; + addClickHandler(handler: Handler): SimpleRadioButton; + addFocusHandler(handler: Handler): SimpleRadioButton; + addKeyDownHandler(handler: Handler): SimpleRadioButton; + addKeyPressHandler(handler: Handler): SimpleRadioButton; + addKeyUpHandler(handler: Handler): SimpleRadioButton; + addMouseDownHandler(handler: Handler): SimpleRadioButton; + addMouseMoveHandler(handler: Handler): SimpleRadioButton; + addMouseOutHandler(handler: Handler): SimpleRadioButton; + addMouseOverHandler(handler: Handler): SimpleRadioButton; + addMouseUpHandler(handler: Handler): SimpleRadioButton; + addMouseWheelHandler(handler: Handler): SimpleRadioButton; + addStyleDependentName(styleName: string): SimpleRadioButton; + addStyleName(styleName: string): SimpleRadioButton; + getId(): string; + getTag(): string; + getType(): string; + setAccessKey(accessKey: Char): SimpleRadioButton; + setChecked(checked: boolean): SimpleRadioButton; + setEnabled(enabled: boolean): SimpleRadioButton; + setFocus(focus: boolean): SimpleRadioButton; + setHeight(height: string): SimpleRadioButton; + setId(id: string): SimpleRadioButton; + setLayoutData(layout: Object): SimpleRadioButton; + setName(name: string): SimpleRadioButton; + setPixelSize(width: Integer, height: Integer): SimpleRadioButton; + setSize(width: string, height: string): SimpleRadioButton; + setStyleAttribute(attribute: string, value: string): SimpleRadioButton; + setStyleAttributes(attributes: Object): SimpleRadioButton; + setStyleName(styleName: string): SimpleRadioButton; + setStylePrimaryName(styleName: string): SimpleRadioButton; + setTabIndex(index: Integer): SimpleRadioButton; + setTag(tag: string): SimpleRadioButton; + setTitle(title: string): SimpleRadioButton; + setVisible(visible: boolean): SimpleRadioButton; + setWidth(width: string): SimpleRadioButton; + } + + /** + * + * Deprecated. The UI service was + * + * deprecated on December 11, 2014. To create user interfaces, use the + * HTML service instead. + * A panel that adds user-positioned splitters between each of its child widgets. + * + * This panel is similar to a DockLayoutPanel, but each pair of child widgets has a splitter + * between them that the user can drag. + * + * Internally, UiApp widgets are built on top of the + * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation + * directly. You can find the SplitLayoutPanel documentation here. + */ + export interface SplitLayoutPanel { + add(widget: Widget): SplitLayoutPanel; + addEast(widget: Widget, width: Number): SplitLayoutPanel; + addNorth(widget: Widget, height: Number): SplitLayoutPanel; + addSouth(widget: Widget, height: Number): SplitLayoutPanel; + addStyleDependentName(styleName: string): SplitLayoutPanel; + addStyleName(styleName: string): SplitLayoutPanel; + addWest(widget: Widget, width: Number): SplitLayoutPanel; + clear(): SplitLayoutPanel; + getId(): string; + getTag(): string; + getType(): string; + remove(index: Integer): SplitLayoutPanel; + remove(widget: Widget): SplitLayoutPanel; + setHeight(height: string): SplitLayoutPanel; + setId(id: string): SplitLayoutPanel; + setLayoutData(layout: Object): SplitLayoutPanel; + setPixelSize(width: Integer, height: Integer): SplitLayoutPanel; + setSize(width: string, height: string): SplitLayoutPanel; + setStyleAttribute(attribute: string, value: string): SplitLayoutPanel; + setStyleAttributes(attributes: Object): SplitLayoutPanel; + setStyleName(styleName: string): SplitLayoutPanel; + setStylePrimaryName(styleName: string): SplitLayoutPanel; + setTag(tag: string): SplitLayoutPanel; + setTitle(title: string): SplitLayoutPanel; + setVisible(visible: boolean): SplitLayoutPanel; + setWidgetMinSize(widget: Widget, minSize: Integer): SplitLayoutPanel; + setWidth(width: string): SplitLayoutPanel; + } + + /** + * + * Deprecated. The UI service was + * + * deprecated on December 11, 2014. To create user interfaces, use the + * HTML service instead. + * A panel that stacks its children vertically, displaying only one at a time, + * with a header for each child which the user can click to display. + * + * Internally, UiApp widgets are built on top of the + * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation + * directly. You can find the StackPanel documentation here. + */ + export interface StackPanel { + add(widget: Widget): StackPanel; + add(widget: Widget, text: string): StackPanel; + add(widget: Widget, text: string, asHtml: boolean): StackPanel; + addStyleDependentName(styleName: string): StackPanel; + addStyleName(styleName: string): StackPanel; + clear(): StackPanel; + getId(): string; + getTag(): string; + getType(): string; + remove(index: Integer): StackPanel; + remove(widget: Widget): StackPanel; + setHeight(height: string): StackPanel; + setId(id: string): StackPanel; + setLayoutData(layout: Object): StackPanel; + setPixelSize(width: Integer, height: Integer): StackPanel; + setSize(width: string, height: string): StackPanel; + setStackText(index: Integer, text: string): StackPanel; + setStackText(index: Integer, text: string, asHtml: boolean): StackPanel; + setStyleAttribute(attribute: string, value: string): StackPanel; + setStyleAttributes(attributes: Object): StackPanel; + setStyleName(styleName: string): StackPanel; + setStylePrimaryName(styleName: string): StackPanel; + setTag(tag: string): StackPanel; + setTitle(title: string): StackPanel; + setVisible(visible: boolean): StackPanel; + setWidth(width: string): StackPanel; + } + + /** + * + * Deprecated. The UI service was + * + * deprecated on December 11, 2014. To create user interfaces, use the + * HTML service instead. + * A standard push-button widget which will automatically submit its enclosing FormPanel if + * any. + * + * Here is an example of how to use this widget: + * + * function doGet() { + * var app = UiApp.createApplication(); + * var form = app.createFormPanel(); + * var flow = app.createFlowPanel(); + * flow.add(app.createTextBox().setName("textBox")); + * flow.add(app.createSubmitButton("Submit")); + * form.add(flow); + * app.add(form); + * return app; + * } + * + * function doPost(eventInfo) { + * var app = UiApp.getActiveApplication(); + * app.add(app.createLabel("Form submitted. The text box's value was '" + + * eventInfo.parameter.textBox + "'")); + * return app; + * } + * + * Internally, UiApp widgets are built on top of the + * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation + * directly. You can find the SubmitButton documentation here. + */ + export interface SubmitButton { + addBlurHandler(handler: Handler): SubmitButton; + addClickHandler(handler: Handler): SubmitButton; + addFocusHandler(handler: Handler): SubmitButton; + addKeyDownHandler(handler: Handler): SubmitButton; + addKeyPressHandler(handler: Handler): SubmitButton; + addKeyUpHandler(handler: Handler): SubmitButton; + addMouseDownHandler(handler: Handler): SubmitButton; + addMouseMoveHandler(handler: Handler): SubmitButton; + addMouseOutHandler(handler: Handler): SubmitButton; + addMouseOverHandler(handler: Handler): SubmitButton; + addMouseUpHandler(handler: Handler): SubmitButton; + addMouseWheelHandler(handler: Handler): SubmitButton; + addStyleDependentName(styleName: string): SubmitButton; + addStyleName(styleName: string): SubmitButton; + getId(): string; + getTag(): string; + getType(): string; + setAccessKey(accessKey: Char): SubmitButton; + setEnabled(enabled: boolean): SubmitButton; + setFocus(focus: boolean): SubmitButton; + setHTML(html: string): SubmitButton; + setHeight(height: string): SubmitButton; + setId(id: string): SubmitButton; + setLayoutData(layout: Object): SubmitButton; + setPixelSize(width: Integer, height: Integer): SubmitButton; + setSize(width: string, height: string): SubmitButton; + setStyleAttribute(attribute: string, value: string): SubmitButton; + setStyleAttributes(attributes: Object): SubmitButton; + setStyleName(styleName: string): SubmitButton; + setStylePrimaryName(styleName: string): SubmitButton; + setTabIndex(index: Integer): SubmitButton; + setTag(tag: string): SubmitButton; + setText(text: string): SubmitButton; + setTitle(title: string): SubmitButton; + setVisible(visible: boolean): SubmitButton; + setWidth(width: string): SubmitButton; + } + + /** + * + * Deprecated. This class is deprecated and should not be used in new scripts. + * A SuggestBox is a text box or text area which displays a + * pre-configured set of selections that match the user's input. + * + * This widget is not currently functional. + * + * Internally, UiApp widgets are built on top of the + * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation + * directly. You can find the SuggestBox documentation here. + */ + export interface SuggestBox { + addKeyDownHandler(handler: Handler): SuggestBox; + addKeyPressHandler(handler: Handler): SuggestBox; + addKeyUpHandler(handler: Handler): SuggestBox; + addSelectionHandler(handler: Handler): SuggestBox; + addStyleDependentName(styleName: string): SuggestBox; + addStyleName(styleName: string): SuggestBox; + addValueChangeHandler(handler: Handler): SuggestBox; + getId(): string; + getTag(): string; + getType(): string; + setAccessKey(accessKey: Char): SuggestBox; + setAnimationEnabled(animationEnabled: boolean): SuggestBox; + setAutoSelectEnabled(autoSelectEnabled: boolean): SuggestBox; + setFocus(focus: boolean): SuggestBox; + setHeight(height: string): SuggestBox; + setId(id: string): SuggestBox; + setLayoutData(layout: Object): SuggestBox; + setLimit(limit: Integer): SuggestBox; + setPixelSize(width: Integer, height: Integer): SuggestBox; + setPopupStyleName(styleName: string): SuggestBox; + setSize(width: string, height: string): SuggestBox; + setStyleAttribute(attribute: string, value: string): SuggestBox; + setStyleAttributes(attributes: Object): SuggestBox; + setStyleName(styleName: string): SuggestBox; + setStylePrimaryName(styleName: string): SuggestBox; + setTabIndex(index: Integer): SuggestBox; + setTag(tag: string): SuggestBox; + setText(text: string): SuggestBox; + setTitle(title: string): SuggestBox; + setValue(value: string): SuggestBox; + setValue(value: string, fireEvents: boolean): SuggestBox; + setVisible(visible: boolean): SuggestBox; + setWidth(width: string): SuggestBox; + } + + /** + * + * Deprecated. The UI service was + * + * deprecated on December 11, 2014. To create user interfaces, use the + * HTML service instead. + * A horizontal bar of folder-style tabs, most commonly used as part of a TabPanel. + * + * Internally, UiApp widgets are built on top of the + * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation + * directly. You can find the TabBar documentation here. + */ + export interface TabBar { + addBeforeSelectionHandler(handler: Handler): TabBar; + addSelectionHandler(handler: Handler): TabBar; + addStyleDependentName(styleName: string): TabBar; + addStyleName(styleName: string): TabBar; + addTab(title: string): TabBar; + addTab(title: string, asHtml: boolean): TabBar; + addTab(widget: Widget): TabBar; + getId(): string; + getTag(): string; + getType(): string; + selectTab(index: Integer): TabBar; + setHeight(height: string): TabBar; + setId(id: string): TabBar; + setLayoutData(layout: Object): TabBar; + setPixelSize(width: Integer, height: Integer): TabBar; + setSize(width: string, height: string): TabBar; + setStyleAttribute(attribute: string, value: string): TabBar; + setStyleAttributes(attributes: Object): TabBar; + setStyleName(styleName: string): TabBar; + setStylePrimaryName(styleName: string): TabBar; + setTabEnabled(index: Integer, enabled: boolean): TabBar; + setTabText(index: Integer, text: string): TabBar; + setTag(tag: string): TabBar; + setTitle(title: string): TabBar; + setVisible(visible: boolean): TabBar; + setWidth(width: string): TabBar; + } + + /** + * + * Deprecated. The UI service was + * + * deprecated on December 11, 2014. To create user interfaces, use the + * HTML service instead. + * A panel that represents a tabbed set of pages, each of which contains another + * widget. Its child widgets are shown as the user selects the various tabs + * associated with them. + * + * Internally, UiApp widgets are built on top of the + * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation + * directly. You can find the TabPanel documentation here. + */ + export interface TabPanel { + add(widget: Widget): TabPanel; + add(widget: Widget, text: string): TabPanel; + add(widget: Widget, text: string, asHtml: boolean): TabPanel; + add(widget: Widget, tabWidget: Widget): TabPanel; + addBeforeSelectionHandler(handler: Handler): TabPanel; + addSelectionHandler(handler: Handler): TabPanel; + addStyleDependentName(styleName: string): TabPanel; + addStyleName(styleName: string): TabPanel; + getId(): string; + getTag(): string; + getType(): string; + selectTab(index: Integer): TabPanel; + setAnimationEnabled(animationEnabled: boolean): TabPanel; + setHeight(height: string): TabPanel; + setId(id: string): TabPanel; + setLayoutData(layout: Object): TabPanel; + setPixelSize(width: Integer, height: Integer): TabPanel; + setSize(width: string, height: string): TabPanel; + setStyleAttribute(attribute: string, value: string): TabPanel; + setStyleAttributes(attributes: Object): TabPanel; + setStyleName(styleName: string): TabPanel; + setStylePrimaryName(styleName: string): TabPanel; + setTag(tag: string): TabPanel; + setTitle(title: string): TabPanel; + setVisible(visible: boolean): TabPanel; + setWidth(width: string): TabPanel; + } + + /** + * + * Deprecated. The UI service was + * + * deprecated on December 11, 2014. To create user interfaces, use the + * HTML service instead. + * A text box that allows multiple lines of text to be entered. + * + * Here is an example of how to use this widget: + * + * function doGet() { + * var app = UiApp.createApplication(); + * var text = app.createTextArea().setName("text"); + * var handler = app.createServerHandler("count").addCallbackElement(text); + * app.add(text); + * app.add(app.createButton("Count", handler)); + * app.add(app.createLabel("0 characters").setId("label")); + * return app; + * } + * + * function count(eventInfo) { + * var app = UiApp.createApplication(); + * // Because the text area was named "text" and added as a callback element to the + * // button's click event, we have its value available in eventInfo.parameter.text. + * app.getElementById("label").setText(eventInfo.parameter.text.length + " characters"); + * return app; + * } + * + * Internally, UiApp widgets are built on top of the + * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation + * directly. You can find the TextArea documentation here. + */ + export interface TextArea { + addBlurHandler(handler: Handler): TextArea; + addChangeHandler(handler: Handler): TextArea; + addClickHandler(handler: Handler): TextArea; + addFocusHandler(handler: Handler): TextArea; + addKeyDownHandler(handler: Handler): TextArea; + addKeyPressHandler(handler: Handler): TextArea; + addKeyUpHandler(handler: Handler): TextArea; + addMouseDownHandler(handler: Handler): TextArea; + addMouseMoveHandler(handler: Handler): TextArea; + addMouseOutHandler(handler: Handler): TextArea; + addMouseOverHandler(handler: Handler): TextArea; + addMouseUpHandler(handler: Handler): TextArea; + addMouseWheelHandler(handler: Handler): TextArea; + addStyleDependentName(styleName: string): TextArea; + addStyleName(styleName: string): TextArea; + addValueChangeHandler(handler: Handler): TextArea; + getId(): string; + getTag(): string; + getType(): string; + setAccessKey(accessKey: Char): TextArea; + setCharacterWidth(width: Integer): TextArea; + setCursorPos(position: Integer): TextArea; + setDirection(direction: Component): TextArea; + setEnabled(enabled: boolean): TextArea; + setFocus(focus: boolean): TextArea; + setHeight(height: string): TextArea; + setId(id: string): TextArea; + setLayoutData(layout: Object): TextArea; + setName(name: string): TextArea; + setPixelSize(width: Integer, height: Integer): TextArea; + setReadOnly(readOnly: boolean): TextArea; + setSelectionRange(position: Integer, length: Integer): TextArea; + setSize(width: string, height: string): TextArea; + setStyleAttribute(attribute: string, value: string): TextArea; + setStyleAttributes(attributes: Object): TextArea; + setStyleName(styleName: string): TextArea; + setStylePrimaryName(styleName: string): TextArea; + setTabIndex(index: Integer): TextArea; + setTag(tag: string): TextArea; + setText(text: string): TextArea; + setTextAlignment(textAlign: Component): TextArea; + setTitle(title: string): TextArea; + setValue(value: string): TextArea; + setValue(value: string, fireEvents: boolean): TextArea; + setVisible(visible: boolean): TextArea; + setVisibleLines(lines: Integer): TextArea; + setWidth(width: string): TextArea; + } + + /** + * + * Deprecated. The UI service was + * + * deprecated on December 11, 2014. To create user interfaces, use the + * HTML service instead. + * A standard single-line text box. + * + * Here is an example of how to use this widget: + * + * function doGet() { + * var app = UiApp.createApplication(); + * var text = app.createTextBox().setName("text"); + * var handler = app.createServerHandler("count").addCallbackElement(text); + * app.add(text); + * app.add(app.createButton("Count", handler)); + * app.add(app.createLabel("0 characters").setId("label")); + * return app; + * } + * + * function count(eventInfo) { + * var app = UiApp.createApplication(); + * // Because the text box was named "text" and added as a callback element to the + * // button's click event, we have its value available in eventInfo.parameter.text. + * app.getElementById("label").setText(eventInfo.parameter.text.length + " characters"); + * return app; + * } + * + * Internally, UiApp widgets are built on top of the + * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation + * directly. You can find the TextBox documentation here. + */ + export interface TextBox { + addBlurHandler(handler: Handler): TextBox; + addChangeHandler(handler: Handler): TextBox; + addClickHandler(handler: Handler): TextBox; + addFocusHandler(handler: Handler): TextBox; + addKeyDownHandler(handler: Handler): TextBox; + addKeyPressHandler(handler: Handler): TextBox; + addKeyUpHandler(handler: Handler): TextBox; + addMouseDownHandler(handler: Handler): TextBox; + addMouseMoveHandler(handler: Handler): TextBox; + addMouseOutHandler(handler: Handler): TextBox; + addMouseOverHandler(handler: Handler): TextBox; + addMouseUpHandler(handler: Handler): TextBox; + addMouseWheelHandler(handler: Handler): TextBox; + addStyleDependentName(styleName: string): TextBox; + addStyleName(styleName: string): TextBox; + addValueChangeHandler(handler: Handler): TextBox; + getId(): string; + getTag(): string; + getType(): string; + setAccessKey(accessKey: Char): TextBox; + setCursorPos(position: Integer): TextBox; + setDirection(direction: Component): TextBox; + setEnabled(enabled: boolean): TextBox; + setFocus(focus: boolean): TextBox; + setHeight(height: string): TextBox; + setId(id: string): TextBox; + setLayoutData(layout: Object): TextBox; + setMaxLength(length: Integer): TextBox; + setName(name: string): TextBox; + setPixelSize(width: Integer, height: Integer): TextBox; + setReadOnly(readOnly: boolean): TextBox; + setSelectionRange(position: Integer, length: Integer): TextBox; + setSize(width: string, height: string): TextBox; + setStyleAttribute(attribute: string, value: string): TextBox; + setStyleAttributes(attributes: Object): TextBox; + setStyleName(styleName: string): TextBox; + setStylePrimaryName(styleName: string): TextBox; + setTabIndex(index: Integer): TextBox; + setTag(tag: string): TextBox; + setText(text: string): TextBox; + setTextAlignment(textAlign: Component): TextBox; + setTitle(title: string): TextBox; + setValue(value: string): TextBox; + setValue(value: string, fireEvents: boolean): TextBox; + setVisible(visible: boolean): TextBox; + setVisibleLength(length: Integer): TextBox; + setWidth(width: string): TextBox; + } + + /** + * + * Deprecated. The UI service was + * + * deprecated on December 11, 2014. To create user interfaces, use the + * HTML service instead. + * A ToggleButton is a stylish stateful button which allows the + * user to toggle between up and down states. + * + * Internally, UiApp widgets are built on top of the + * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation + * directly. You can find the ToggleButton documentation here. + */ + export interface ToggleButton { + addBlurHandler(handler: Handler): ToggleButton; + addClickHandler(handler: Handler): ToggleButton; + addFocusHandler(handler: Handler): ToggleButton; + addKeyDownHandler(handler: Handler): ToggleButton; + addKeyPressHandler(handler: Handler): ToggleButton; + addKeyUpHandler(handler: Handler): ToggleButton; + addMouseDownHandler(handler: Handler): ToggleButton; + addMouseMoveHandler(handler: Handler): ToggleButton; + addMouseOutHandler(handler: Handler): ToggleButton; + addMouseOverHandler(handler: Handler): ToggleButton; + addMouseUpHandler(handler: Handler): ToggleButton; + addMouseWheelHandler(handler: Handler): ToggleButton; + addStyleDependentName(styleName: string): ToggleButton; + addStyleName(styleName: string): ToggleButton; + getId(): string; + getTag(): string; + getType(): string; + setAccessKey(accessKey: Char): ToggleButton; + setDown(down: boolean): ToggleButton; + setEnabled(enabled: boolean): ToggleButton; + setFocus(focus: boolean): ToggleButton; + setHTML(html: string): ToggleButton; + setHeight(height: string): ToggleButton; + setId(id: string): ToggleButton; + setLayoutData(layout: Object): ToggleButton; + setPixelSize(width: Integer, height: Integer): ToggleButton; + setSize(width: string, height: string): ToggleButton; + setStyleAttribute(attribute: string, value: string): ToggleButton; + setStyleAttributes(attributes: Object): ToggleButton; + setStyleName(styleName: string): ToggleButton; + setStylePrimaryName(styleName: string): ToggleButton; + setTabIndex(index: Integer): ToggleButton; + setTag(tag: string): ToggleButton; + setText(text: string): ToggleButton; + setTitle(title: string): ToggleButton; + setVisible(visible: boolean): ToggleButton; + setWidth(width: string): ToggleButton; + } + + /** + * + * Deprecated. The UI service was + * + * deprecated on December 11, 2014. To create user interfaces, use the + * HTML service instead. + * A standard hierarchical tree widget. The tree contains a hierarchy of + * TreeItems that the user can open, close, and select. + * + * Internally, UiApp widgets are built on top of the + * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation + * directly. You can find the Tree documentation here. + */ + export interface Tree { + add(widget: Widget): Tree; + addBlurHandler(handler: Handler): Tree; + addCloseHandler(handler: Handler): Tree; + addFocusHandler(handler: Handler): Tree; + addItem(text: string): Tree; + addItem(item: TreeItem): Tree; + addItem(widget: Widget): Tree; + addKeyDownHandler(handler: Handler): Tree; + addKeyPressHandler(handler: Handler): Tree; + addKeyUpHandler(handler: Handler): Tree; + addMouseDownHandler(handler: Handler): Tree; + addMouseMoveHandler(handler: Handler): Tree; + addMouseOutHandler(handler: Handler): Tree; + addMouseOverHandler(handler: Handler): Tree; + addMouseUpHandler(handler: Handler): Tree; + addMouseWheelHandler(handler: Handler): Tree; + addOpenHandler(handler: Handler): Tree; + addSelectionHandler(handler: Handler): Tree; + addStyleDependentName(styleName: string): Tree; + addStyleName(styleName: string): Tree; + clear(): Tree; + getId(): string; + getTag(): string; + getType(): string; + setAccessKey(accessKey: Char): Tree; + setAnimationEnabled(animationEnabled: boolean): Tree; + setFocus(focus: boolean): Tree; + setHeight(height: string): Tree; + setId(id: string): Tree; + setLayoutData(layout: Object): Tree; + setPixelSize(width: Integer, height: Integer): Tree; + setSelectedItem(item: TreeItem): Tree; + setSelectedItem(item: TreeItem, fireEvents: boolean): Tree; + setSize(width: string, height: string): Tree; + setStyleAttribute(attribute: string, value: string): Tree; + setStyleAttributes(attributes: Object): Tree; + setStyleName(styleName: string): Tree; + setStylePrimaryName(styleName: string): Tree; + setTabIndex(index: Integer): Tree; + setTag(tag: string): Tree; + setTitle(title: string): Tree; + setVisible(visible: boolean): Tree; + setWidth(width: string): Tree; + } + + /** + * + * Deprecated. The UI service was + * + * deprecated on December 11, 2014. To create user interfaces, use the + * HTML service instead. + * An item that can be contained within a Tree. + * + * Internally, UiApp widgets are built on top of the + * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation + * directly. You can find the TreeItem documentation here. + */ + export interface TreeItem { + addItem(text: string): TreeItem; + addItem(item: TreeItem): TreeItem; + addItem(widget: Widget): TreeItem; + addStyleDependentName(styleName: string): TreeItem; + addStyleName(styleName: string): TreeItem; + clear(): TreeItem; + getId(): string; + getTag(): string; + getType(): string; + setHTML(html: string): TreeItem; + setHeight(height: string): TreeItem; + setId(id: string): TreeItem; + setPixelSize(width: Integer, height: Integer): TreeItem; + setSelected(selected: boolean): TreeItem; + setSize(width: string, height: string): TreeItem; + setState(open: boolean): TreeItem; + setState(open: boolean, fireEvents: boolean): TreeItem; + setStyleAttribute(attribute: string, value: string): TreeItem; + setStyleAttributes(attributes: Object): TreeItem; + setStyleName(styleName: string): TreeItem; + setStylePrimaryName(styleName: string): TreeItem; + setTag(tag: string): TreeItem; + setText(text: string): TreeItem; + setTitle(title: string): TreeItem; + setUserObject(a: Object): TreeItem; + setVisible(visible: boolean): TreeItem; + setWidget(widget: Widget): TreeItem; + setWidth(width: string): TreeItem; + } + + /** + * + * Deprecated. The UI service was + * + * deprecated on December 11, 2014. To create user interfaces, use the + * HTML service instead. + * Create user interfaces for use inside Google Apps or as standalone services. + */ + export interface UiApp { + DateTimeFormat: DateTimeFormat + FileType: FileType + HorizontalAlignment: HorizontalAlignment + VerticalAlignment: VerticalAlignment + createApplication(): UiInstance; + getActiveApplication(): UiInstance; + getUserAgent(): string; + } + + /** + * + * Deprecated. The UI service was + * + * deprecated on December 11, 2014. To create user interfaces, use the + * HTML service instead. + * A representation of a user interface. + * + * You can use this to create a new user interface or manipulate an existing one. + */ + export interface UiInstance { + add(child: Widget): UiInstance; + close(): UiInstance; + createAbsolutePanel(): AbsolutePanel; + createAnchor(text: string, asHtml: boolean, href: string): Anchor; + createAnchor(text: string, href: string): Anchor; + createButton(): Button; + createButton(html: string): Button; + createButton(html: string, clickHandler: Handler): Button; + createCaptionPanel(): CaptionPanel; + createCaptionPanel(caption: string): CaptionPanel; + createCaptionPanel(caption: string, asHtml: boolean): CaptionPanel; + createCheckBox(): CheckBox; + createCheckBox(label: string): CheckBox; + createCheckBox(label: string, asHtml: boolean): CheckBox; + createClientHandler(): ClientHandler; + createDateBox(): DateBox; + createDatePicker(): DatePicker; + createDecoratedStackPanel(): DecoratedStackPanel; + createDecoratedTabBar(): DecoratedTabBar; + createDecoratedTabPanel(): DecoratedTabPanel; + createDecoratorPanel(): DecoratorPanel; + createDialogBox(): DialogBox; + createDialogBox(autoHide: boolean): DialogBox; + createDialogBox(autoHide: boolean, modal: boolean): DialogBox; + createDocsListDialog(): DocsListDialog; + createFileUpload(): FileUpload; + createFlexTable(): FlexTable; + createFlowPanel(): FlowPanel; + createFocusPanel(): FocusPanel; + createFocusPanel(child: Widget): FocusPanel; + createFormPanel(): FormPanel; + createGrid(): Grid; + createGrid(rows: Integer, columns: Integer): Grid; + createHTML(): HTML; + createHTML(html: string): HTML; + createHTML(html: string, wordWrap: boolean): HTML; + createHidden(): Hidden; + createHidden(name: string): Hidden; + createHidden(name: string, value: string): Hidden; + createHorizontalPanel(): HorizontalPanel; + createImage(): Image; + createImage(url: string): Image; + createImage(url: string, left: Integer, top: Integer, width: Integer, height: Integer): Image; + createInlineLabel(): InlineLabel; + createInlineLabel(text: string): InlineLabel; + createLabel(): Label; + createLabel(text: string): Label; + createLabel(text: string, wordWrap: boolean): Label; + createListBox(): ListBox; + createListBox(isMultipleSelect: boolean): ListBox; + createMenuBar(): MenuBar; + createMenuBar(vertical: boolean): MenuBar; + createMenuItem(text: string, asHtml: boolean, command: Handler): MenuItem; + createMenuItem(text: string, command: Handler): MenuItem; + createMenuItemSeparator(): MenuItemSeparator; + createPasswordTextBox(): PasswordTextBox; + createPopupPanel(): PopupPanel; + createPopupPanel(autoHide: boolean): PopupPanel; + createPopupPanel(autoHide: boolean, modal: boolean): PopupPanel; + createPushButton(): PushButton; + createPushButton(upText: string): PushButton; + createPushButton(upText: string, clickHandler: Handler): PushButton; + createPushButton(upText: string, downText: string): PushButton; + createPushButton(upText: string, downText: string, clickHandler: Handler): PushButton; + createRadioButton(name: string): RadioButton; + createRadioButton(name: string, label: string): RadioButton; + createRadioButton(name: string, label: string, asHtml: boolean): RadioButton; + createResetButton(): ResetButton; + createResetButton(html: string): ResetButton; + createResetButton(html: string, clickHandler: Handler): ResetButton; + createScrollPanel(): ScrollPanel; + createScrollPanel(child: Widget): ScrollPanel; + createServerBlurHandler(): ServerHandler; + createServerBlurHandler(functionName: string): ServerHandler; + createServerChangeHandler(): ServerHandler; + createServerChangeHandler(functionName: string): ServerHandler; + createServerClickHandler(): ServerHandler; + createServerClickHandler(functionName: string): ServerHandler; + createServerCloseHandler(): ServerHandler; + createServerCloseHandler(functionName: string): ServerHandler; + createServerCommand(): ServerHandler; + createServerCommand(functionName: string): ServerHandler; + createServerErrorHandler(): ServerHandler; + createServerErrorHandler(functionName: string): ServerHandler; + createServerFocusHandler(): ServerHandler; + createServerFocusHandler(functionName: string): ServerHandler; + createServerHandler(): ServerHandler; + createServerHandler(functionName: string): ServerHandler; + createServerInitializeHandler(): ServerHandler; + createServerInitializeHandler(functionName: string): ServerHandler; + createServerKeyHandler(): ServerHandler; + createServerKeyHandler(functionName: string): ServerHandler; + createServerLoadHandler(): ServerHandler; + createServerLoadHandler(functionName: string): ServerHandler; + createServerMouseHandler(): ServerHandler; + createServerMouseHandler(functionName: string): ServerHandler; + createServerScrollHandler(): ServerHandler; + createServerScrollHandler(functionName: string): ServerHandler; + createServerSelectionHandler(): ServerHandler; + createServerSelectionHandler(functionName: string): ServerHandler; + createServerSubmitHandler(): ServerHandler; + createServerSubmitHandler(functionName: string): ServerHandler; + createServerValueChangeHandler(): ServerHandler; + createServerValueChangeHandler(functionName: string): ServerHandler; + createSimpleCheckBox(): SimpleCheckBox; + createSimplePanel(): SimplePanel; + createSimpleRadioButton(name: string): SimpleRadioButton; + createSplitLayoutPanel(): SplitLayoutPanel; + createStackPanel(): StackPanel; + createSubmitButton(): SubmitButton; + createSubmitButton(html: string): SubmitButton; + createSuggestBox(): SuggestBox; + createTabBar(): TabBar; + createTabPanel(): TabPanel; + createTextArea(): TextArea; + createTextBox(): TextBox; + createToggleButton(): ToggleButton; + createToggleButton(upText: string): ToggleButton; + createToggleButton(upText: string, clickHandler: Handler): ToggleButton; + createToggleButton(upText: string, downText: string): ToggleButton; + createTree(): Tree; + createTreeItem(): TreeItem; + createTreeItem(text: string): TreeItem; + createTreeItem(child: Widget): TreeItem; + createVerticalPanel(): VerticalPanel; + getElementById(id: string): Component; + getId(): string; + isStandardsMode(): boolean; + loadComponent(componentName: string): Component; + loadComponent(componentName: string, optAdvancedArgs: Object): Component; + remove(index: Integer): UiInstance; + remove(widget: Widget): UiInstance; + setHeight(height: Integer): UiInstance; + setStandardsMode(standardsMode: boolean): UiInstance; + setStyleAttribute(attribute: string, value: string): UiInstance; + setTitle(title: string): UiInstance; + setWidth(width: Integer): UiInstance; + } + + /** + * + * Deprecated. The UI service was + * + * deprecated on December 11, 2014. To create user interfaces, use the + * HTML service instead. + * Vertical alignment constants to use with setVerticalAlignment methods in UiApp. + */ + export enum VerticalAlignment { TOP, MIDDLE, BOTTOM } + + /** + * + * Deprecated. The UI service was + * + * deprecated on December 11, 2014. To create user interfaces, use the + * HTML service instead. + * A panel that lays all of its widgets out in a single vertical column. + * + * Here is an example of how to use this widget: + * + * function doGet() { + * var app = UiApp.createApplication(); + * var panel = app.createVerticalPanel(); + * panel.add(app.createButton("button 1")); + * panel.add(app.createButton("button 2")); + * app.add(panel); + * return app; + * } + * + * Internally, UiApp widgets are built on top of the + * Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation + * directly. You can find the VerticalPanel documentation + * here. + */ + export interface VerticalPanel { + add(widget: Widget): VerticalPanel; + addStyleDependentName(styleName: string): VerticalPanel; + addStyleName(styleName: string): VerticalPanel; + clear(): VerticalPanel; + getId(): string; + getTag(): string; + getType(): string; + remove(index: Integer): VerticalPanel; + remove(widget: Widget): VerticalPanel; + setBorderWidth(width: Integer): VerticalPanel; + setCellHeight(widget: Widget, height: string): VerticalPanel; + setCellHorizontalAlignment(widget: Widget, horizontalAlignment: HorizontalAlignment): VerticalPanel; + setCellVerticalAlignment(widget: Widget, verticalAlignment: VerticalAlignment): VerticalPanel; + setCellWidth(widget: Widget, width: string): VerticalPanel; + setHeight(height: string): VerticalPanel; + setHorizontalAlignment(horizontalAlignment: HorizontalAlignment): VerticalPanel; + setId(id: string): VerticalPanel; + setLayoutData(layout: Object): VerticalPanel; + setPixelSize(width: Integer, height: Integer): VerticalPanel; + setSize(width: string, height: string): VerticalPanel; + setSpacing(spacing: Integer): VerticalPanel; + setStyleAttribute(attribute: string, value: string): VerticalPanel; + setStyleAttributes(attributes: Object): VerticalPanel; + setStyleName(styleName: string): VerticalPanel; + setStylePrimaryName(styleName: string): VerticalPanel; + setTag(tag: string): VerticalPanel; + setTitle(title: string): VerticalPanel; + setVerticalAlignment(verticalAlignment: VerticalAlignment): VerticalPanel; + setVisible(visible: boolean): VerticalPanel; + setWidth(width: string): VerticalPanel; + } + + /** + * + * Deprecated. The UI service was + * + * deprecated on December 11, 2014. To create user interfaces, use the + * HTML service instead. + * Base interface for UiApp widgets. + * Implementing classes + * + * NameBrief description + * + * AbsolutePanelAn absolute panel positions all of its children absolutely, allowing them to overlap. + * + * AnchorA widget that represents a simple element. + * + * ButtonA standard push-button widget. + * + * CaptionPanelA panel that wraps its contents in a border with a caption that appears in the upper left + * corner of the border. + * + * ChartA Chart object, which can be embedded into documents, UI elements, or used as a static image. + * + * CheckBoxA standard check box widget. + * + * ControlA user interface control object, that drives the data displayed by a DashboardPanel. + * + * DashboardPanelA dashboard is a visual structure that enables the organization and management + * of multiple charts that share the same underlying data. + * + * DateBoxA text box that shows a DatePicker when the user focuses on it. + * + * DatePickerA date picker widget. + * + * DecoratedStackPanelA StackPanel that wraps each item in a 2x3 grid (six box), which allows users to add + * rounded corners. + * + * DecoratedTabBarA TabBar that wraps each tab in a 2x3 grid (six box), which allows users to add rounded corners. + * + * DecoratedTabPanelA TabPanel that uses a DecoratedTabBar with rounded corners. + * + * DecoratorPanelA SimplePanel that wraps its contents in stylized boxes, which can be used to add rounded + * corners to a Widget. + * + * DialogBoxA form of popup that has a caption area at the top and can be dragged by the + * user. + * + * EmbeddedChartRepresents a chart that has been embedded into a Spreadsheet. + * + * FileUploadA widget that wraps the HTML element. + * + * FlexTableA flexible table that creates cells on demand. + * + * FlowPanelA panel that formats its child widgets using the default HTML layout behavior. + * + * FocusPanelA simple panel that makes its contents focusable, and adds the ability to catch mouse and + * keyboard events. + * + * FormPanelA panel that wraps its contents in an HTML element. + * + * GridA rectangular grid that can contain text, html, or a child widget within its cells. + * + * HTMLA widget that contains arbitrary text, which is interpreted as HTML. + * + * HiddenRepresents a hidden field for storing data in the user's browser that can be passed back to a + * handler as a "callback element". + * + * HorizontalPanelA panel that lays all of its widgets out in a single horizontal column. + * + * ImageA widget that displays the image at a given URL. + * + * InlineLabelA widget that contains arbitrary text, not interpreted as HTML. + * + * LabelA widget that contains arbitrary text, not interpreted as HTML. + * + * ListBoxA widget that presents a list of choices to the user, either as a list box or + * as a drop-down list. + * + * MenuBarA standard menu bar widget. + * + * PasswordTextBoxA text box that visually masks its input to prevent eavesdropping. + * + * PopupPanelA panel that can "pop up" over other widgets. + * + * PushButtonA normal push button with custom styling. + * + * RadioButtonA mutually-exclusive selection radio button widget. + * + * ResetButtonA standard push-button widget which will automatically reset its enclosing FormPanel if + * any. + * + * ScrollPanelA panel that wraps its contents in a scrollable element. + * + * SimpleCheckBoxA simple checkbox widget, with no label. + * + * SimplePanelA panel that can contain only one widget. + * + * SimpleRadioButtonA simple radio button widget, with no label. + * + * SplitLayoutPanelA panel that adds user-positioned splitters between each of its child widgets. + * + * StackPanelA panel that stacks its children vertically, displaying only one at a time, + * with a header for each child which the user can click to display. + * + * SubmitButtonA standard push-button widget which will automatically submit its enclosing FormPanel if + * any. + * + * SuggestBoxA SuggestBox is a text box or text area which displays a + * pre-configured set of selections that match the user's input. + * + * TabBarA horizontal bar of folder-style tabs, most commonly used as part of a TabPanel. + * + * TabPanelA panel that represents a tabbed set of pages, each of which contains another + * widget. + * + * TextAreaA text box that allows multiple lines of text to be entered. + * + * TextBoxA standard single-line text box. + * + * ToggleButtonA ToggleButton is a stylish stateful button which allows the + * user to toggle between up and down states. + * + * TreeA standard hierarchical tree widget. + * + * VerticalPanelA panel that lays all of its widgets out in a single vertical column. + */ + export interface Widget { + getId(): string; + getType(): string; + } + + } +} + +declare var UiApp: GoogleAppsScript.UI.UiApp; \ No newline at end of file diff --git a/google-apps-script/google-apps-script.url-fetch.d.ts b/google-apps-script/google-apps-script.url-fetch.d.ts new file mode 100644 index 000000000..3e30b9809 --- /dev/null +++ b/google-apps-script/google-apps-script.url-fetch.d.ts @@ -0,0 +1,77 @@ +// Type definitions for Google Apps Script 2015-11-12 +// Project: https://developers.google.com/apps-script/ +// Definitions by: motemen +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// +/// + +declare module GoogleAppsScript { + export module URL_Fetch { + /** + * This class allows users to access specific information on HTTP responses. + * See also + * + * UrlFetchApp + */ + export interface HTTPResponse { + getAllHeaders(): Object; + getAs(contentType: string): Base.Blob; + getBlob(): Base.Blob; + getContent(): Byte[]; + getContentText(): string; + getContentText(charset: string): string; + getHeaders(): Object; + getResponseCode(): Integer; + } + + /** + * + * Deprecated. This class is deprecated and should not be used in new scripts. + * Represents configuration settings for an OAuth-enabled remote service. + * See also + * + * UrlFetchApp + */ + export interface OAuthConfig { + getAccessTokenUrl(): string; + getAuthorizationUrl(): string; + getMethod(): string; + getParamLocation(): string; + getRequestTokenUrl(): string; + getServiceName(): string; + setAccessTokenUrl(url: string): void; + setAuthorizationUrl(url: string): void; + setConsumerKey(consumerKey: string): void; + setConsumerSecret(consumerSecret: string): void; + setMethod(method: string): void; + setParamLocation(location: string): void; + setRequestTokenUrl(url: string): void; + } + + /** + * Fetch resources and communicate with other hosts over the Internet. + * + * This service allows scripts to communicate with other applications or access other resources on + * the web by fetching URLs. A script can use the URL Fetch service to issue HTTP and HTTPS requests + * and receive responses. The URL Fetch service uses Google's network infrastructure for efficiency + * and scaling purposes. + * See also + * + * OAuthConfig + * + * HTTPResponse + */ + export interface UrlFetchApp { + fetch(url: string): HTTPResponse; + fetch(url: string, params: Object): HTTPResponse; + getRequest(url: string): Object; + getRequest(url: string, params: Object): Object; + addOAuthService(serviceName: string): OAuthConfig; + removeOAuthService(serviceName: string): void; + } + + } +} + +declare var UrlFetchApp: GoogleAppsScript.URL_Fetch.UrlFetchApp; \ No newline at end of file diff --git a/google-apps-script/google-apps-script.utilities.d.ts b/google-apps-script/google-apps-script.utilities.d.ts new file mode 100644 index 000000000..17d46a91c --- /dev/null +++ b/google-apps-script/google-apps-script.utilities.d.ts @@ -0,0 +1,76 @@ +// Type definitions for Google Apps Script 2015-11-12 +// Project: https://developers.google.com/apps-script/ +// Definitions by: motemen +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// +/// + +declare module GoogleAppsScript { + export module Utilities { + /** + * A typesafe enum for character sets. + */ + export enum Charset { US_ASCII, UTF_8 } + + /** + * Selector of Digest algorithm + */ + export enum DigestAlgorithm { MD2, MD5, SHA_1, SHA_256, SHA_384, SHA_512 } + + /** + * Selector of MAC algorithm + */ + export enum MacAlgorithm { HMAC_MD5, HMAC_SHA_1, HMAC_SHA_256, HMAC_SHA_384, HMAC_SHA_512 } + + /** + * This service provides utilities for string encoding/decoding, date formatting, JSON manipulation, + * and other miscellaneous tasks. + */ + export interface Utilities { + Charset: Charset + DigestAlgorithm: DigestAlgorithm + MacAlgorithm: MacAlgorithm + base64Decode(encoded: string): Byte[]; + base64Decode(encoded: string, charset: Charset): Byte[]; + base64DecodeWebSafe(encoded: string): Byte[]; + base64DecodeWebSafe(encoded: string, charset: Charset): Byte[]; + base64Encode(data: Byte[]): string; + base64Encode(data: string): string; + base64Encode(data: string, charset: Charset): string; + base64EncodeWebSafe(data: Byte[]): string; + base64EncodeWebSafe(data: string): string; + base64EncodeWebSafe(data: string, charset: Charset): string; + computeDigest(algorithm: DigestAlgorithm, value: string): Byte[]; + computeDigest(algorithm: DigestAlgorithm, value: string, charset: Charset): Byte[]; + computeHmacSha256Signature(value: string, key: string): Byte[]; + computeHmacSha256Signature(value: string, key: string, charset: Charset): Byte[]; + computeHmacSignature(algorithm: MacAlgorithm, value: string, key: string): Byte[]; + computeHmacSignature(algorithm: MacAlgorithm, value: string, key: string, charset: Charset): Byte[]; + computeRsaSha256Signature(value: string, key: string): Byte[]; + computeRsaSha256Signature(value: string, key: string, charset: Charset): Byte[]; + formatDate(date: Date, timeZone: string, format: string): string; + formatString(template: string, ...args: Object[]): string; + newBlob(data: Byte[]): Base.Blob; + newBlob(data: Byte[], contentType: string): Base.Blob; + newBlob(data: Byte[], contentType: string, name: string): Base.Blob; + newBlob(data: string): Base.Blob; + newBlob(data: string, contentType: string): Base.Blob; + newBlob(data: string, contentType: string, name: string): Base.Blob; + parseCsv(csv: string): String[][]; + parseCsv(csv: string, delimiter: Char): String[][]; + sleep(milliseconds: Integer): void; + unzip(blob: Base.BlobSource): Base.Blob[]; + zip(blobs: Base.BlobSource[]): Base.Blob; + zip(blobs: Base.BlobSource[], name: string): Base.Blob; + jsonParse(jsonString: string): Object; + jsonStringify(obj: Object): string; + } + + } +} + +declare var Charset: GoogleAppsScript.Utilities.Charset; +declare var DigestAlgorithm: GoogleAppsScript.Utilities.DigestAlgorithm; +declare var MacAlgorithm: GoogleAppsScript.Utilities.MacAlgorithm; +declare var Utilities: GoogleAppsScript.Utilities.Utilities; \ No newline at end of file diff --git a/google-apps-script/google-apps-script.xml-service.d.ts b/google-apps-script/google-apps-script.xml-service.d.ts new file mode 100644 index 000000000..075c6a47e --- /dev/null +++ b/google-apps-script/google-apps-script.xml-service.d.ts @@ -0,0 +1,347 @@ +// Type definitions for Google Apps Script 2015-11-12 +// Project: https://developers.google.com/apps-script/ +// Definitions by: motemen +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare module GoogleAppsScript { + export module XML_Service { + /** + * A representation of an XML attribute. + * + * // Reads the first and last name of each person and adds a new attribute with the full name. + * var xml = '' + * + '' + * + '' + * + ''; + * var document = XmlService.parse(xml); + * var people = document.getRootElement().getChildren('person'); + * for (var i = 0; i < people.length; i++) { + * var person = people[i]; + * var firstName = person.getAttribute('first').getValue(); + * var lastName = person.getAttribute('last').getValue(); + * person.setAttribute('full', firstName + ' ' + lastName); + * } + * xml = XmlService.getPrettyFormat().format(document); + * Logger.log(xml); + */ + export interface Attribute { + getName(): string; + getNamespace(): Namespace; + getValue(): string; + setName(name: string): Attribute; + setNamespace(namespace: Namespace): Attribute; + setValue(value: string): Attribute; + } + + /** + * A representation of an XML CDATASection node. + * + * // Create and log an XML document that shows how special characters like '<', '>', and '&' are + * // stored in a CDATASection node as compared to in a Text node. + * var illegalCharacters = 'The Amazing Adventures of Kavalier & Clay'; + * var cdata = XmlService.createCdata(illegalCharacters); + * var text = XmlService.createText(illegalCharacters); + * var root = XmlService.createElement('root').addContent(cdata).addContent(text); + * var document = XmlService.createDocument(root); + * var xml = XmlService.getPrettyFormat().format(document); + * Logger.log(xml); + */ + export interface Cdata { + append(text: string): Text; + detach(): Content; + getParentElement(): Element; + getText(): string; + getValue(): string; + setText(text: string): Text; + } + + /** + * A representation of an XML Comment node. + */ + export interface Comment { + detach(): Content; + getParentElement(): Element; + getText(): string; + getValue(): string; + setText(text: string): Comment; + } + + /** + * A representation of a generic XML node. + * Implementing classes + * + * NameBrief description + * + * CdataA representation of an XML CDATASection node. + * + * CommentA representation of an XML Comment node. + * + * DocTypeA representation of an XML DocumentType node. + * + * ElementA representation of an XML Element node. + * + * EntityRefA representation of an XML EntityReference node. + * + * ProcessingInstructionA representation of an XML ProcessingInstruction node. + * + * TextA representation of an XML Text node. + */ + export interface Content { + asCdata(): Cdata; + asComment(): Comment; + asDocType(): DocType; + asElement(): Element; + asEntityRef(): EntityRef; + asProcessingInstruction(): ProcessingInstruction; + asText(): Text; + detach(): Content; + getParentElement(): Element; + getType(): ContentType; + getValue(): string; + } + + /** + * An enumeration representing the types of XML content nodes. + */ + export enum ContentType { CDATA, COMMENT, DOCTYPE, ELEMENT, ENTITYREF, PROCESSINGINSTRUCTION, TEXT } + + /** + * A representation of an XML DocumentType node. + */ + export interface DocType { + detach(): Content; + getElementName(): string; + getInternalSubset(): string; + getParentElement(): Element; + getPublicId(): string; + getSystemId(): string; + getValue(): string; + setElementName(name: string): DocType; + setInternalSubset(data: string): DocType; + setPublicId(id: string): DocType; + setSystemId(id: string): DocType; + } + + /** + * A representation of an XML document. + */ + export interface Document { + addContent(content: Content): Document; + addContent(index: Integer, content: Content): Document; + cloneContent(): Content[]; + detachRootElement(): Element; + getAllContent(): Content[]; + getContent(index: Integer): Content; + getContentSize(): Integer; + getDescendants(): Content[]; + getDocType(): DocType; + getRootElement(): Element; + hasRootElement(): boolean; + removeContent(): Content[]; + removeContent(content: Content): boolean; + removeContent(index: Integer): Content; + setDocType(docType: DocType): Document; + setRootElement(element: Element): Document; + } + + /** + * A representation of an XML Element node. + * + * // Adds up the values listed in a sample XML document and adds a new element with the total. + * var xml = '' + * + '12' + * + '18' + * + '25' + * + ''; + * var document = XmlService.parse(xml); + * var root = document.getRootElement(); + * var items = root.getChildren(); + * var total = 0; + * for (var i = 0; i < items.length; i++) { + * total += Number(items[i].getText()); + * } + * var totalElement = XmlService.createElement('total').setText(total); + * root.addContent(totalElement); + * xml = XmlService.getPrettyFormat().format(document); + * Logger.log(xml); + */ + export interface Element { + addContent(content: Content): Element; + addContent(index: Integer, content: Content): Element; + cloneContent(): Content[]; + detach(): Content; + getAllContent(): Content[]; + getAttribute(name: string): Attribute; + getAttribute(name: string, namespace: Namespace): Attribute; + getAttributes(): Attribute[]; + getChild(name: string): Element; + getChild(name: string, namespace: Namespace): Element; + getChildText(name: string): string; + getChildText(name: string, namespace: Namespace): string; + getChildren(): Element[]; + getChildren(name: string): Element[]; + getChildren(name: string, namespace: Namespace): Element[]; + getContent(index: Integer): Content; + getContentSize(): Integer; + getDescendants(): Content[]; + getDocument(): Document; + getName(): string; + getNamespace(): Namespace; + getNamespace(prefix: string): Namespace; + getParentElement(): Element; + getQualifiedName(): string; + getText(): string; + getValue(): string; + isAncestorOf(other: Element): boolean; + isRootElement(): boolean; + removeAttribute(attribute: Attribute): boolean; + removeAttribute(attributeName: string): boolean; + removeAttribute(attributeName: string, namespace: Namespace): boolean; + removeContent(): Content[]; + removeContent(content: Content): boolean; + removeContent(index: Integer): Content; + setAttribute(attribute: Attribute): Element; + setAttribute(name: string, value: string): Element; + setAttribute(name: string, value: string, namespace: Namespace): Element; + setName(name: string): Element; + setNamespace(namespace: Namespace): Element; + setText(text: string): Element; + } + + /** + * A representation of an XML EntityReference node. + */ + export interface EntityRef { + detach(): Content; + getName(): string; + getParentElement(): Element; + getPublicId(): string; + getSystemId(): string; + getValue(): string; + setName(name: string): EntityRef; + setPublicId(id: string): EntityRef; + setSystemId(id: string): EntityRef; + } + + /** + * A formatter for outputting an XML document, with three pre-defined formats that can be further + * customized. + * + * // Log an XML document with specified formatting options. + * var xml = 'Text!More text!'; + * var document = XmlService.parse(xml); + * var output = XmlService.getCompactFormat() + * .setLineSeparator('\n') + * .setEncoding('UTF-8') + * .setIndent(' ') + * .format(document); + * Logger.log(output); + */ + export interface Format { + format(document: Document): string; + format(element: Element): string; + setEncoding(encoding: string): Format; + setIndent(indent: string): Format; + setLineSeparator(separator: string): Format; + setOmitDeclaration(omitDeclaration: boolean): Format; + setOmitEncoding(omitEncoding: boolean): Format; + } + + /** + * A representation of an XML namespace. + */ + export interface Namespace { + getPrefix(): string; + getURI(): string; + } + + /** + * A representation of an XML ProcessingInstruction node. + */ + export interface ProcessingInstruction { + detach(): Content; + getData(): string; + getParentElement(): Element; + getTarget(): string; + getValue(): string; + } + + /** + * A representation of an XML Text node. + */ + export interface Text { + append(text: string): Text; + detach(): Content; + getParentElement(): Element; + getText(): string; + getValue(): string; + setText(text: string): Text; + } + + /** + * This service allows scripts to parse, navigate, and programmatically create XML documents. + * + * // Log the title and labels for the first page of blog posts on the Google Apps Developer blog. + * function parseXml() { + * var url = 'http://googleappsdeveloper.blogspot.com/atom.xml'; + * var xml = UrlFetchApp.fetch(url).getContentText(); + * var document = XmlService.parse(xml); + * var root = document.getRootElement(); + * var atom = XmlService.getNamespace('http://www.w3.org/2005/Atom'); + * + * var entries = document.getRootElement().getChildren('entry', atom); + * for (var i = 0; i < entries.length; i++) { + * var title = entries[i].getChild('title', atom).getText(); + * var categoryElements = entries[i].getChildren('category', atom); + * var labels = []; + * for (var j = 0; j < categoryElements.length; j++) { + * labels.push(categoryElements[j].getAttribute('term').getValue()); + * } + * Logger.log('%s (%s)', title, labels.join(', ')); + * } + * } + * + * // Create and log an XML representation of the threads in your Gmail inbox. + * function createXml() { + * var root = XmlService.createElement('threads'); + * var threads = GmailApp.getInboxThreads(); + * for (var i = 0; i < threads.length; i++) { + * var child = XmlService.createElement('thread') + * .setAttribute('messageCount', threads[i].getMessageCount()) + * .setAttribute('isUnread', threads[i].isUnread()) + * .setText(threads[i].getFirstMessageSubject()); + * root.addContent(child); + * } + * var document = XmlService.createDocument(root); + * var xml = XmlService.getPrettyFormat().format(document); + * Logger.log(xml); + * } + */ + export interface XmlService { + ContentTypes: ContentType + createCdata(text: string): Cdata; + createComment(text: string): Comment; + createDocType(elementName: string): DocType; + createDocType(elementName: string, systemId: string): DocType; + createDocType(elementName: string, publicId: string, systemId: string): DocType; + createDocument(): Document; + createDocument(rootElement: Element): Document; + createElement(name: string): Element; + createElement(name: string, namespace: Namespace): Element; + createText(text: string): Text; + getCompactFormat(): Format; + getNamespace(uri: string): Namespace; + getNamespace(prefix: string, uri: string): Namespace; + getNoNamespace(): Namespace; + getPrettyFormat(): Format; + getRawFormat(): Format; + getXmlNamespace(): Namespace; + parse(xml: string): Document; + } + + } +} + +declare var XmlService: GoogleAppsScript.XML_Service.XmlService; \ No newline at end of file diff --git a/google-drive-realtime-api/google-drive-realtime-api.d.ts b/google-drive-realtime-api/google-drive-realtime-api.d.ts index 95f239a34..8d549355d 100644 --- a/google-drive-realtime-api/google-drive-realtime-api.d.ts +++ b/google-drive-realtime-api/google-drive-realtime-api.d.ts @@ -483,6 +483,36 @@ declare module gapi.drive.realtime { saveAs(fileId:string) : void; } + + // INCOMPLETE + // https://developers.google.com/google-apps/realtime/reference/gapi.drive.realtime.Error + export class Error { } + + // Complete + // Opens the debugger application on the current page. The debugger shows all realtime documents that the + // page has loaded and is able to view, edit and debug all aspects of each realtime document. + export function debug() : void; + + /* Creates a new file with fake network communications. This file will not talk to the server and will only + exist in memory for as long as the browser session persists. + https://developers.google.com/google-apps/realtime/reference/gapi.drive.realtime#.newInMemoryDocument + @Param opt_onLoaded {function(non-null gapi.drive.realtime.Document)} + A callback that will be called when the realtime document is ready. The created or opened realtime document + object will be passed to this function. + + @Param opt_initializerFn {function(non-null gapi.drive.realtime.Model)} + An optional initialization function that will be called before onLoaded only the first time that the document + is loaded. The document's gapi.drive.realtime.Model object will be passed to this function. + + @Param opt_errorFn {function(non-null gapi.drive.realtime.Error)} + An optional error handling function that will be called if an error occurs while the document is being + loaded or edited. A gapi.drive.realtime.Error object describing the error will be passed to this function. + */ + export function newInMemoryDocument( + opt_onLoaded? : (d:Document) => void, + opt_initializerFn? : (m:Model) => void, + opt_errorFn? : (e:gapi.drive.realtime.Error) => void + ) : Document; } diff --git a/googlemaps/google.maps.d.ts b/googlemaps/google.maps.d.ts index 2093f2fd9..3ac35b048 100644 --- a/googlemaps/google.maps.d.ts +++ b/googlemaps/google.maps.d.ts @@ -849,7 +849,7 @@ declare module google.maps { formatted_address: string; geometry: GeocoderGeometry; partial_match: boolean; - postcode_localities: string[] + postcode_localities: string[]; types: string[]; } @@ -1338,6 +1338,7 @@ declare module google.maps { lightness?: number; saturation?: number; visibility?: string; + weight?: number; } /***** Layers *****/ @@ -1821,7 +1822,7 @@ declare module google.maps { matched_substrings: PredictionSubstring[]; place_id: string; terms: PredictionTerm[]; - types: string[] + types: string[]; } export interface PredictionTerm { @@ -1956,6 +1957,7 @@ declare module google.maps { bounds?: LatLngBounds; input?: string; location?: LatLng; + offset?: number; radius?: number; } diff --git a/graham_scan/graham_scan-tests.ts b/graham_scan/graham_scan-tests.ts new file mode 100644 index 000000000..4317db851 --- /dev/null +++ b/graham_scan/graham_scan-tests.ts @@ -0,0 +1,12 @@ +/// + +// Based on the README.MD + +//Create a new instance. +var convexHull = new ConvexHullGrahamScan(); + +//add points (needs to be done for each point, a foreach loop on the input array can be used.) +convexHull.addPoint(1, 2); + +//getHull() returns the array of points that make up the convex hull. +var hullPoints = convexHull.getHull(); diff --git a/graham_scan/graham_scan.d.ts b/graham_scan/graham_scan.d.ts new file mode 100644 index 000000000..617df2e7e --- /dev/null +++ b/graham_scan/graham_scan.d.ts @@ -0,0 +1,8 @@ +// Type definitions for graham_scan v1.0.2 +// Project: https://github.com/brian3kb/graham_scan_js +// Definitions by: Harm Berntsen +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +declare class ConvexHullGrahamScan { + addPoint(x: number, y: number): void; + getHull(): {x: number, y: number}[]; +} diff --git a/gruntjs/gruntjs.d.ts b/gruntjs/gruntjs.d.ts index e503cb572..a3a3a67e5 100644 --- a/gruntjs/gruntjs.d.ts +++ b/gruntjs/gruntjs.d.ts @@ -1172,7 +1172,7 @@ declare module grunt { /** * The command to execute. It should be in the system path. */ - cmd: string + cmd?: string /** * If specified, the same grunt bin that is currently running will be diff --git a/gulp-babel/gulp-babel-tests.ts b/gulp-babel/gulp-babel-tests.ts new file mode 100644 index 000000000..e5daf3617 --- /dev/null +++ b/gulp-babel/gulp-babel-tests.ts @@ -0,0 +1,7 @@ +/// +/// + +import babel = require('gulp-babel'); + +var x: NodeJS.ReadWriteStream = babel(); +var x: NodeJS.ReadWriteStream = babel({}); diff --git a/gulp-babel/gulp-babel.d.ts b/gulp-babel/gulp-babel.d.ts new file mode 100644 index 000000000..98d33881c --- /dev/null +++ b/gulp-babel/gulp-babel.d.ts @@ -0,0 +1,40 @@ +// Type definitions for gulp-babel 6.1.0 +// Project: https://github.com/babel/gulp-babel +// Definitions by: Aya Morisawa +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare module 'gulp-babel' { + function babel(options?: { + filename?: string, + filenameRelative?: string, + presets?: string[], + plugins?: string[], + highlightCode?: boolean, + only?: string | string[], + ignore?: string | string[], + auxiliaryCommentBefore?: any, + auxiliaryCommentAfter?: any, + sourceMaps?: any, + inputSourceMap?: any, + sourceMapTarget?: any, + sourceFileName?: any, + sourceRoot?: any, + moduleRoot?: any, + moduleIds?: any, + moduleId?: any, + getModuleId?: any, + resolveModuleSource?: any, + keepModuleIdExtesions?: boolean, + code?: boolean, + ast?: boolean, + compact?: any, + comments?: boolean, + shouldPrintComment?: any, + env?: any, + retainLines?: boolean + }): NodeJS.ReadWriteStream; + + export = babel; +} diff --git a/gulp-rev-replace/gulp-rev-replace-tests.ts b/gulp-rev-replace/gulp-rev-replace-tests.ts index 57515c9ac..e7c5d9c18 100644 --- a/gulp-rev-replace/gulp-rev-replace-tests.ts +++ b/gulp-rev-replace/gulp-rev-replace-tests.ts @@ -9,13 +9,9 @@ import rev = require('gulp-rev'); import useref = require('gulp-useref'); gulp.task("index", () => { - var userefAssets = useref.assets(); - return gulp.src("src/index.html") - .pipe(userefAssets) // Concatenate with gulp-useref + .pipe(useref()) // Concatenate with gulp-useref .pipe(rev()) // Rename the concatenated files - .pipe(userefAssets.restore()) - .pipe(useref()) .pipe(revReplace()) // Substitute in new filenames .pipe(gulp.dest('public')); }); diff --git a/gulp-rev/gulp-rev.d.ts b/gulp-rev/gulp-rev.d.ts index 6cd432b0d..e04a765b7 100644 --- a/gulp-rev/gulp-rev.d.ts +++ b/gulp-rev/gulp-rev.d.ts @@ -1,4 +1,4 @@ -// Type definitions for gulp-csso v5.0.1 +// Type definitions for gulp-rev v5.0.1 // Project: https://github.com/sindresorhus/gulp-rev // Definitions by: Tanguy Krotoff // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/gulp-tslint/gulp-tslint-tests.ts b/gulp-tslint/gulp-tslint-tests.ts index fd4b1fe88..8658f103f 100644 --- a/gulp-tslint/gulp-tslint-tests.ts +++ b/gulp-tslint/gulp-tslint-tests.ts @@ -1,17 +1,36 @@ -/// +/// /// /// -import gulp = require("gulp"); -import tslint = require("gulp-tslint"); -import vinyl = require("vinyl"); + +import * as gulp from 'gulp'; +import * as tslint from 'gulp-tslint'; +import vinyl = require('vinyl'); + +// Taken from gulp-tslint README https://github.com/panuhorsmalahti/gulp-tslint/blob/master/README.md gulp.task('tslint', function(){ - gulp.src('source.ts') + return gulp.src('source.ts') .pipe(tslint()) .pipe(tslint.report('verbose')); }); -/* Output is in the following form: +gulp.task('invalid-noemit', function(){ + return gulp.src('input.ts') + .pipe(tslint()) + .pipe(tslint.report('prose', { + emitError: false + })); +}); + +gulp.task('invalid-noemit', function(){ + return gulp.src('input.ts') + .pipe(tslint()) + .pipe(tslint.report('prose', { + summarizeFailureOutput: true + })); +}); + +/* output is in the following form: * [{ * "name": "invalid.ts", * "failure": "missing whitespace", @@ -21,41 +40,55 @@ gulp.task('tslint', function(){ * "ruleName": "one-line" * }] */ -var testReporter = function (output: tslint.Output[], file: vinyl, options: tslint.Options) { +const testReporter: tslint.Reporter = function (output, file, options) { // file is a reference to the vinyl File object console.log("Found " + output.length + " errors in " + file.path); - // options is a reference to the reporter options, e.g. options.emitError + // options is a reference to the reporter options, e.g. including the emitError boolean }; gulp.task('invalid-custom', function(){ - gulp.src('invalid.ts') + return gulp.src('input.ts') .pipe(tslint()) .pipe(tslint.report(testReporter)); }); -gulp.task('invalid-custom', function () { - gulp.src('invalid.ts') - .pipe(tslint()) - .pipe(tslint.report(testReporter, { emitError: false })); -}); - gulp.task('tslint-json', function(){ - gulp.src('invalid.ts') + return gulp.src('input.ts') .pipe(tslint({ configuration: { - rules: { - "class-name": true - // ... - } + rules: { + "class-name": true, + // ... + } } })) .pipe(tslint.report('prose'));; }); -gulp.task("lint", () => { - return gulp.src(["gulpfile.ts", "{src,test}/**/*.ts"]) - .pipe(tslint()) - .pipe(tslint.report("verbose", { - emitError: true - })); +gulp.task('tslint', function(){ + return gulp.src(['input.ts',]) + .pipe(tslint()) + .pipe(tslint.report('prose', { + reportLimit: 2 + })); }); + + +gulp.task('tslint', function(){ + return gulp.src(['input.ts',]) + .pipe(tslint({ + tslint: require('tslint') + })); +}); + +const tslintOptions: tslint.Options = { + configuration: {}, + rulesDirectory: null, + tslint: null +}; + +const reportOptions: tslint.ReportOptions = { + emitError: true, + reportLimit: 0, + summarizeFailureOutput: false +}; diff --git a/gulp-tslint/gulp-tslint.d.ts b/gulp-tslint/gulp-tslint.d.ts index 99b990277..75c32718b 100644 --- a/gulp-tslint/gulp-tslint.d.ts +++ b/gulp-tslint/gulp-tslint.d.ts @@ -1,4 +1,4 @@ -// Type definitions for gulp-tslint +// Type definitions for gulp-tslint 3.6.0 // Project: https://github.com/panuhorsmalahti/gulp-tslint // Definitions by: Asana // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -9,13 +9,23 @@ declare module "gulp-tslint" { import vinyl = require("vinyl"); - function GulpTsLint(opts?: GulpTsLint.Options): NodeJS.ReadWriteStream; + namespace gulpTsLint { + interface GulpTsLint { + (options?: Options): NodeJS.ReadWriteStream; + report(reporter?: Reporter, options?: ReportOptions): NodeJS.ReadWriteStream; + report(options?: ReportOptions): NodeJS.ReadWriteStream; + } - module GulpTsLint { interface Options { - configuration?: {}; - rulesDirectory?: string; - emitError?: boolean; + configuration?: {}, + rulesDirectory?: string, + tslint?: GulpTsLint + } + + interface ReportOptions { + emitError?: boolean, + reportLimit?: number, + summarizeFailureOutput?: boolean } interface Position { @@ -32,12 +42,9 @@ declare module "gulp-tslint" { ruleName: string; } - type Reporter = string|((output: Output[], file: vinyl, options: Options) => any); - export function report(reporter?: Reporter, options?: Options): NodeJS.ReadWriteStream; - export function report(options?: Options): NodeJS.ReadWriteStream; - + type Reporter = string|((output: Output[], file: vinyl, options: ReportOptions) => any); } - export = GulpTsLint; + var gulpTsLint: gulpTsLint.GulpTsLint; + export = gulpTsLint; } - diff --git a/gulp-typescript/gulp-typescript-tests.ts b/gulp-typescript/gulp-typescript-tests.ts index 3dd743188..5abd5a152 100644 --- a/gulp-typescript/gulp-typescript-tests.ts +++ b/gulp-typescript/gulp-typescript-tests.ts @@ -54,3 +54,9 @@ gulp.task('scripts', function () { return gulp.src('lib/*.ts') .pipe(typescript(tsProject, undefined, typescript.reporter.fullReporter())); }); + +gulp.task('default', function () { + return gulp.src('src/**/*.ts') + .pipe(typescript()) + .pipe(gulp.dest('built/local')); +}); diff --git a/gulp-typescript/gulp-typescript.d.ts b/gulp-typescript/gulp-typescript.d.ts index 7b16d0a5a..84d4b5d9c 100644 --- a/gulp-typescript/gulp-typescript.d.ts +++ b/gulp-typescript/gulp-typescript.d.ts @@ -6,11 +6,11 @@ /// declare module "gulp-typescript" { - function GulpTypescript(params: GulpTypescript.Params, filters?: GulpTypescript.FilterSettings, reporter?: GulpTypescript.Reporter): GulpTypescript.CompilationStream; + function GulpTypescript(params?: GulpTypescript.Params, filters?: GulpTypescript.FilterSettings, reporter?: GulpTypescript.Reporter): GulpTypescript.CompilationStream; module GulpTypescript { - export function createProject(params: Params): Project; - export function createProject(file: string, params: Params): Project; + export function createProject(params?: Params): Project; + export function createProject(file: string, params?: Params): Project; export function filter(filters: FilterSettings): CompilationStream; interface Params { declarationFiles?: boolean; diff --git a/gulp-uglify/gulp-uglify.d.ts b/gulp-uglify/gulp-uglify.d.ts index 840b5110b..05eb937ed 100644 --- a/gulp-uglify/gulp-uglify.d.ts +++ b/gulp-uglify/gulp-uglify.d.ts @@ -170,6 +170,6 @@ declare module "gulp-uglify" { */ comments_before: string[]; } - + namespace GulpUglify {} export = GulpUglify; -} \ No newline at end of file +} diff --git a/gulp-useref/gulp-useref-tests.ts b/gulp-useref/gulp-useref-tests.ts index 95c35662d..6af7aaab8 100644 --- a/gulp-useref/gulp-useref-tests.ts +++ b/gulp-useref/gulp-useref-tests.ts @@ -1,15 +1,76 @@ /// /// +/// +/// +/// +/// +/// +/// +/// -import gulp = require('gulp'); -import useref = require('gulp-useref'); - -gulp.task('default', () => { - var assets = useref.assets(); +import * as gulp from 'gulp'; +import * as useref from 'gulp-useref'; +// Usage +gulp.task('default', function () { return gulp.src('app/*.html') - .pipe(assets) - .pipe(assets.restore()) .pipe(useref()) .pipe(gulp.dest('dist')); }); + +gulp.task('default', function () { + return gulp.src('app/*.html') + .pipe(useref({ searchPath: '.tmp' })) + .pipe(gulp.dest('dist')); +}); + +import * as gulpif from 'gulp-if'; +import uglify = require('gulp-uglify'); +import minifyCss = require('gulp-minify-css'); + +gulp.task('html', function () { + return gulp.src('app/*.html') + .pipe(useref()) + .pipe(gulpif('*.js', uglify())) + .pipe(gulpif('*.css', minifyCss())) + .pipe(gulp.dest('dist')); +}); + + +// Transform Streams +import * as sourcemaps from 'gulp-sourcemaps'; +import lazypipe = require('lazypipe'); + +gulp.task('default', function () { + return gulp.src('index.html') + .pipe(useref({}, lazypipe().pipe(sourcemaps.init, { loadMaps: true })())) + .pipe(sourcemaps.write('maps')) + .pipe(gulp.dest('dist')); +}); + + +// options.additionalStreams +import * as ts from 'gulp-typescript'; + +// create stream of virtual files +var tsStream = gulp.src('src/**/*.ts') + .pipe(ts()); + +gulp.task('default', function () { + // use gulp-useref normally + return gulp.src('src/index.html') + .pipe(useref({ additionalStreams: [tsStream] })) + .pipe(gulp.dest('dist')); +}); + + +// options.transformPath +gulp.task('default', function () { + return gulp.src('app/*.html') + .pipe(useref({ + transformPath: function(filePath) { + return filePath.replace('/rootpath','') + } + })) + .pipe(gulp.dest('dist')); +}); diff --git a/gulp-useref/gulp-useref.d.ts b/gulp-useref/gulp-useref.d.ts index b1628aa5f..86011015c 100644 --- a/gulp-useref/gulp-useref.d.ts +++ b/gulp-useref/gulp-useref.d.ts @@ -1,4 +1,4 @@ -// Type definitions for gulp-useref v1.2.0 +// Type definitions for gulp-useref v3.0.0 // Project: https://github.com/jonkemp/gulp-useref // Definitions by: Tanguy Krotoff // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -6,20 +6,19 @@ /// declare module 'gulp-useref' { - interface IAssetsOptions { + interface Options { searchPath?: string | string[]; + base?: string; + noAssets?: boolean; noconcat?: boolean; + additionalStreams?: Array; + transformPath?: (filePath: string) => void; } - interface IAssetsStream extends NodeJS.ReadWriteStream { - restore(): NodeJS.ReadWriteStream; + interface Useref { + (options?: Options, ...transformStreams: NodeJS.ReadWriteStream[]): NodeJS.ReadWriteStream; } - interface IUseref { - (options?: any): NodeJS.ReadWriteStream; - assets(options?: IAssetsOptions): IAssetsStream; - } - - var useref: IUseref; + var useref: Useref; export = useref; } diff --git a/hapi/hapi.d.ts b/hapi/hapi.d.ts index 7f2fab90e..b31c24b16 100644 --- a/hapi/hapi.d.ts +++ b/hapi/hapi.d.ts @@ -7,10 +7,6 @@ /// -/// - - - declare module "hapi" { import http = require("http"); @@ -21,6 +17,17 @@ declare module "hapi" { [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 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; + } + /** 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 { @@ -234,12 +241,12 @@ declare module "hapi" { 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 | Promise | T, + 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 | Promise | T): Response; + (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. */ @@ -897,22 +904,32 @@ declare module "hapi" { export interface IServerInject { - (options: { + (options: string | { /** 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; - /**- an optional string or buffer containing the request payload (object must be manually converted to a string first). 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; + 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: { + simulate?: { error: boolean; close: boolean; end: boolean; diff --git a/helmet/helmet-tests.ts b/helmet/helmet-tests.ts new file mode 100644 index 000000000..d2509a022 --- /dev/null +++ b/helmet/helmet-tests.ts @@ -0,0 +1,62 @@ +/// + +import express = require("express") +import helmet = require("helmet"); + +var app = express(); + +/** + * @summary Test for {@see helmet}. + */ +function helmetTest() { + app.use(helmet()); +} + +/** + * @summary Test for {@see helmet#xssFilter} function. + */ +function contentSecurityPolicyTest() { + app.use(helmet.xssFilter()); + app.use(helmet.xssFilter({ setOnOldIE: true })); +} + +/** + * @summary Test for {@see helmet#frameguard} function. + */ +function frameguardTest() { + app.use(helmet.frameguard()); + app.use(helmet.frameguard("sameorigin")); +} + +/** + * @summary Test for {@see helmet#hsts} function. + */ +function hstsTest() { + app.use(helmet.hsts()); + app.use(helmet.hsts({ maxAge: 7776000000 })); +} + +/** + * @summary Test for {@see helmet#ieNoOpen} function. + */ +function ieNoOpenTest() { + app.use(helmet.ieNoOpen()); +} + +/** + * @summary Test for {@see helmet#noSniff} function. + */ +function noSniffTest() { + app.use(helmet.noSniff()); +} + +/** + * @summary Test for {@see helmet#publicKeyPins} function. + */ +function publicKeyPinsTest() { + app.use(helmet.publicKeyPins({ + sha256s: ["AbCdEf123=", "ZyXwVu456="], + includeSubdomains: true, + reportUri: "http://example.com" + })); +} diff --git a/helmet/helmet.d.ts b/helmet/helmet.d.ts new file mode 100644 index 000000000..35d9bf3ae --- /dev/null +++ b/helmet/helmet.d.ts @@ -0,0 +1,77 @@ +// Type definitions for helmet +// Project: https://github.com/helmetjs/helmet +// Definitions by: Cyril Schumacher +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module "helmet" { + import express = require("express"); + + /** + * @summary Interface for helmet class. + * @interface + */ + interface Helmet { + /** + * @summary Constructor. + * @return {RequestHandler} The Request handler. + */ + ():express.RequestHandler; + + /** + * @summary Prevent clickjacking. + * @param {string} header The header. + * @return {RequestHandler} The Request handler. + */ + frameguard(header ?: string):express.RequestHandler; + + /** + * @summary Hide "X-Powered-By" header. + * @param {Object} options The options. + * @return {RequestHandler} The Request handler. + */ + hidePoweredBy(options ?: Object):express.RequestHandler; + + /** + * @summary Adds the "Strict-Transport-Security" header. + * @param {Object} options The options. + * @return {RequestHandler} The Request handler. + */ + hsts(options ?: Object):express.RequestHandler; + + /** + * @summary Add the "X-Download-Options" header. + * @return {RequestHandler} The Request handler. + */ + ieNoOpen():express.RequestHandler; + + /** + * @summary Add the "Cache-Control" and "Pragma" headers to stop caching. + * @return {RequestHandler} The Request handler. + */ + 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; + + /** + * @summary Prevent Cross-site scripting attacks. + * @return {RequestHandler} The Request handler. + * @param {Object} options The options. + */ + xssFilter(options ?: Object):express.RequestHandler; + } + + var helmet: Helmet; + export = helmet; +} diff --git a/highcharts/highcharts-tests.ts b/highcharts/highcharts-tests.ts index bfcbc9137..33c3c9e75 100644 --- a/highcharts/highcharts-tests.ts +++ b/highcharts/highcharts-tests.ts @@ -1,4 +1,4 @@ -/// +/// /// function originalTests() { diff --git a/highcharts/highcharts.d.ts b/highcharts/highcharts.d.ts index c7ce6a2d4..e86d4b86c 100644 --- a/highcharts/highcharts.d.ts +++ b/highcharts/highcharts.d.ts @@ -3,8 +3,6 @@ // Definitions by: Damiano Gambarotto , Dan Lewi Harkestad // Definitions: https://github.com/borisyankov/DefinitelyTyped -/// - interface HighchartsPosition { align?: string; verticalAlign?: string; @@ -1306,7 +1304,7 @@ interface HighchartsChartOptions3dFrame { * @default 'transparent' * @since 4.0 */ - color?: string | HighchartsGradient, + color?: string | HighchartsGradient; /** * Thickness of the panel. * @default 1 diff --git a/highcharts/highstock-tests.ts b/highcharts/highstock-tests.ts index fac6fa676..5e7013f96 100644 --- a/highcharts/highstock-tests.ts +++ b/highcharts/highstock-tests.ts @@ -1,4 +1,5 @@ -/// +/// +/// var someData = [1, 2, 3, 4, 5, 6, 7, 8, 9]; @@ -46,7 +47,7 @@ $(function () { inputBoxHeight: 18, inputStyle: { color: '#039', - fontWeight: 'bold' + fontWeight: 'bold' }, labelStyle: { color: 'silver', @@ -61,4 +62,3 @@ $(function () { }] }); }); - diff --git a/highcharts/highstock.d.ts b/highcharts/highstock.d.ts index f5133c54a..a4560099b 100644 --- a/highcharts/highstock.d.ts +++ b/highcharts/highstock.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Highstock 2.1.5 +// Type definitions for Highstock 2.1.5 // Project: http://www.highcharts.com/ // Definitions by: David Deutsch // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/html-to-text/h2t-test.html b/html-to-text/h2t-test.html new file mode 100644 index 000000000..1a3cafdf6 --- /dev/null +++ b/html-to-text/h2t-test.html @@ -0,0 +1,21 @@ + + + + + + + +

+ bold +

+

+ italic +

+ + + + diff --git a/html-to-text/html-to-text-tests.ts b/html-to-text/html-to-text-tests.ts new file mode 100644 index 000000000..e49739aa1 --- /dev/null +++ b/html-to-text/html-to-text-tests.ts @@ -0,0 +1,29 @@ +/// + +import * as htmlToText from 'html-to-text'; + +let htmlOptions: HtmlToTextOptions = { + wordwrap: null, + tables: true, + hideLinkHrefIfSameAsText: true, + ignoreImage: true +}; + + +function callback(err: string, result: string) { + console.log(`callback called with result ${result}`); +} + +console.log("Processing file with default options"); +htmlToText.fromFile("h2t-test.html", callback); + +console.log("Processing file with custom options"); +htmlToText.fromFile("h2t-test.html", htmlOptions, callback); + +let htmlString = "

bold

italic

"; +console.log("Processing string with default options"); +console.log(htmlToText.fromString(htmlString)); + +console.log("Processing string with custom options"); +console.log(htmlToText.fromString(htmlString, htmlOptions)); + diff --git a/html-to-text/html-to-text.d.ts b/html-to-text/html-to-text.d.ts new file mode 100644 index 000000000..ce02e4bfe --- /dev/null +++ b/html-to-text/html-to-text.d.ts @@ -0,0 +1,84 @@ +// Type definitions for html-to-text v1.4.0 +// Project: https://github.com/werk85/node-html-to-text +// Definitions by: Eryk Warren +// Definitions: https://github.com/DefinitelyTyped/html-to-text + +interface HtmlToTextStatic { + /** + * Convert html content of file to text + * + * @param file String with the path of the html file to convert + * @param options Hash of options + * @param callback Function with signature function(err, result) called when the conversion is completed + * + */ + fromFile(file: string, options: HtmlToTextOptions, callback: Function): void; + + /** + * Convert html content of file to text with the default options. + * + * @param file String with the path of the html file to convert + * @param callback Function with signature function(err, result) called when the conversion is completed + * + */ + fromFile(file: string, callback: Function): void; + + /** + * Convert html string to text + * + * @param file String with the path of the html file to convert + * @param options Hash of options + * + * @return String with the converted text. + */ + fromString(str: string, options?: HtmlToTextOptions): string; +} + +interface HtmlToTextOptions { + /** + * Defines after how many chars a line break should follow in p elements. + * Set to null or false to disable word-wrapping. Default: 80 + */ + wordwrap?: number; + + /** + * Allows to select certain tables by the class or id attribute from the HTML + * document. This is necessary because the majority of HTML E-Mails uses a + * table based layout. Prefix your table selectors with an . for the class + * and with a # for the id attribute. All other tables are ignored. + * You can assign true to this attribute to select all tables. Default: [] + */ + tables?: Array | boolean; + + /** + * By default links are translated the following + * text => becomes => text [link]. + * If this option is set to true and link and text are the same, + * [link] will be hidden and only text visible. + */ + hideLinkHrefIfSameAsText?: boolean; + + /** + * Allows you to specify the server host for href attributes, where the links start at the root (/). + * For example, linkHrefBaseUrl = 'http://asdf.com' and ... + * the link in the text will be http://asdf.com/dir/subdir. + * Keep in mind that linkHrefBaseUrl shouldn't end with a /. + */ + linkHrefBaseUrl?: string; + + /** + * Ignore all document links if true. + */ + ignoreHref?: boolean; + + /** + * Ignore all document images if true. + */ + ignoreImage?: boolean; +} + +declare module "html-to-text" { + export = htmlToText; +} + +declare var htmlToText: HtmlToTextStatic; diff --git a/inherits/inherits-tests.ts b/inherits/inherits-tests.ts new file mode 100644 index 000000000..7d05a7b0b --- /dev/null +++ b/inherits/inherits-tests.ts @@ -0,0 +1,7 @@ +/// + +import inherits = require('inherits'); + +let any: any; + +inherits(any, any); diff --git a/inherits/inherits.d.ts b/inherits/inherits.d.ts new file mode 100644 index 000000000..3028ddc00 --- /dev/null +++ b/inherits/inherits.d.ts @@ -0,0 +1,11 @@ +// Type definitions for inherits +// Project: https://github.com/isaacs/inherits +// Definitions by: Ilya Mochalov +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module "inherits" { + import {inherits} from "util"; + export = inherits; +} diff --git a/intro.js/intro.js-tests.ts b/intro.js/intro.js-tests.ts new file mode 100644 index 000000000..b8e8126ae --- /dev/null +++ b/intro.js/intro.js-tests.ts @@ -0,0 +1,54 @@ +/// + +var intro = introJs(); + +intro.setOption('doneLabel', 'Next page'); +intro.setOptions({ + steps: [ + { + intro: "Hello world!" + }, + { + element: document.querySelector('#step1') as HTMLElement, + intro : "This is a tooltip." + }, + { + element : document.querySelectorAll('#step2')[0] as HTMLElement, + intro : "Ok, wasn't that fun?", + position: 'right' + }, + { + element : '#step3', + intro : 'More features, more fun.', + position: 'left' + }, + { + element : '#step4', + intro : "Another step.", + position: 'bottom' + }, + { + element: '#step5', + intro : 'Get it, use it.' + } + ] +}); + +intro.start() + .nextStep() + .previousStep() + .goToStep(2) + .exit() + .refresh() + .onbeforechange(function (element) { + element.getAttribute('class'); + }) + .onafterchange(function (element) { + element.getAttribute('class'); + }) + .onchange(function () { + alert('Changed'); + }) + .oncomplete(function () { + alert('Done'); + }); diff --git a/intro.js/intro.js.d.ts b/intro.js/intro.js.d.ts new file mode 100644 index 000000000..15a73f517 --- /dev/null +++ b/intro.js/intro.js.d.ts @@ -0,0 +1,70 @@ +// Type definitions for intro.js 1.0.0 +// Project: https://github.com/usablica/intro.js +// Definitions by: Maxime Fabre +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module IntroJs { + enum Positions { + top, + left, + right, + bottom + } + + interface Step { + intro: string; + element?: string|HTMLElement; + position?: string|Positions; + } + + interface Options { + nextLabel?: string; + prevLabel?: string; + skipLabel?: string; + doneLabel?: string; + tooltipPosition?: string; + tooltipClass?: string; + highlightClass?: string; + exitOnEsc?: boolean; + exitOnOverlayClick?: boolean; + showStepNumbers?: boolean; + keyboardNavigation?: boolean; + showButtons?: boolean; + showBullets?: boolean; + showProgress?: boolean; + scrollToElement?: boolean; + overlayOpacity?: number; + positionPrecedence?: string[]; + disableInteraction?: boolean; + steps: Step[]; + } + + interface IntroJs { + start(): IntroJs; + exit(): IntroJs; + + goToStep(step: number): IntroJs; + nextStep(): IntroJs; + previousStep(): IntroJs; + + refresh(): IntroJs; + + setOption(option: string, value: string|number): IntroJs; + setOptions(options: Options): IntroJs; + + onexit(callback: Function): IntroJs; + onbeforechange(callback: (element: HTMLElement) => any): IntroJs; + onafterchange(callback: (element: HTMLElement) => any): IntroJs; + onchange(callback: Function): IntroJs; + oncomplete(callback: Function): IntroJs; + } + + interface Factory { + (element?: string): IntroJs; + } +} + +declare var introJs: IntroJs.Factory; +declare module 'intro.js' { + export = IntroJs; +} diff --git a/ionic/ionic-tests.ts b/ionic/ionic-tests.ts index 45d8c2d66..c68846715 100644 --- a/ionic/ionic-tests.ts +++ b/ionic/ionic-tests.ts @@ -84,13 +84,19 @@ class IonicTestController { private testActionSheet(): void { var closeActionSheetFn: ()=>void = this.$ionicActionSheet.show({ - buttons: [], + buttons: [{ text: 'A button' }], titleText: "titleText", cancelText: "cancelText", destructiveText: "destructiveText", cancel: ()=>{ console.log("cancel"); }, - buttonClicked: ()=>{ console.log("buttonClicked"); }, - destructiveButtonClicked: ()=>{ console.log("destructiveButtonClicked"); }, + buttonClicked: (index)=>{ + console.log("buttonClicked"); + return index === 0; + }, + destructiveButtonClicked: ()=>{ + console.log("destructiveButtonClicked"); + return false; + }, cancelOnStateChange: true, cssClass: "cssClass" }); @@ -102,7 +108,7 @@ class IonicTestController { } private testGesture(): void { var gesture: ionic.gestures.IonicGesture = this.$ionicGesture.on( - 'eventType', + 'eventType', (e)=>{ return e; }, angular.element("body"), {} @@ -226,7 +232,7 @@ class IonicTestController { cssClass: "cssClass", template: "template", templateUrl: "templateUrl", - okText: "OK", + okText: "OK", okType: "okType" }).then(() => console.log("popover shown")) this.$ionicPopup.alert({ @@ -235,7 +241,7 @@ class IonicTestController { cssClass: "cssClass", template: "template", templateUrl: "templateUrl", - okText: "OK", + okText: "OK", okType: "okType" }).close(); @@ -245,20 +251,20 @@ class IonicTestController { cssClass: "cssClass", template: "template", templateUrl: "templateUrl", - okText: "OK", + okText: "OK", okType: "okType", - cancelText: "Cancel", + cancelText: "Cancel", cancelType: "cancelType" - }).then(() => console.log("popover shown")) + }).then((result) => console.log(result === true ? "confirmed": "cancelled")) this.$ionicPopup.confirm({ title: "title", subTitle: "subTitle", cssClass: "cssClass", template: "template", templateUrl: "templateUrl", - okText: "OK", + okText: "OK", okType: "okType", - cancelText: "Cancel", + cancelText: "Cancel", cancelType: "cancelType" }).close(); @@ -268,9 +274,9 @@ class IonicTestController { cssClass: "cssClass", template: "template", templateUrl: "templateUrl", - okText: "OK", + okText: "OK", okType: "okType", - cancelText: "Cancel", + cancelText: "Cancel", cancelType: "cancelType", inputType: "text", inputPlaceholder: "Type some text..." @@ -281,9 +287,9 @@ class IonicTestController { cssClass: "cssClass", template: "template", templateUrl: "templateUrl", - okText: "OK", + okText: "OK", okType: "okType", - cancelText: "Cancel", + cancelText: "Cancel", cancelType: "cancelType", inputType: "text", inputPlaceholder: "Type some text..." @@ -359,6 +365,41 @@ class IonicTestController { var {top: number, left: number, width: number, height: number} = this.$ionicPositionService.position(angular.element("body")); var {top: number, left: number, width: number, height: number} = this.$ionicPositionService.offset(angular.element("body")); } + + /** + * ionic.version + */ + private testStaticVersion(): void { + var version: string = ionic.version; + } + + /** + * ionic.Platform + */ + private testStaticPlaform(): void { + var callbackWithoutReturn: ()=>void; + var callbackWithReturn: ()=>boolean; + var ready: void = ionic.Platform.ready(callbackWithoutReturn); + ready = ionic.Platform.ready(callbackWithReturn); + var setGrade: void = ionic.Platform.setGrade('iOS'); + var deviceInformation: string = ionic.Platform.device(); + var isWebView: boolean = ionic.Platform.isWebView(); + var isIPad: boolean = ionic.Platform.isIPad(); + var isIOS: boolean = ionic.Platform.isIOS(); + var isAndroid: boolean = ionic.Platform.isAndroid(); + var isWindowsPhone: boolean = ionic.Platform.isWindowsPhone(); + var currentPlatform: string = ionic.Platform.platform(); + var currentPlatformVersion: number = ionic.Platform.version(); + var exitApp: void = ionic.Platform.exitApp(); + var showStatusBar: void = ionic.Platform.showStatusBar(true); + var showStatusBar: void = ionic.Platform.fullScreen(); + showStatusBar = ionic.Platform.fullScreen(true); + showStatusBar = ionic.Platform.fullScreen(true, true); + var isReady: boolean = ionic.Platform.isReady; + var isFullScreen: boolean = ionic.Platform.isFullScreen; + var platforms: Array = ionic.Platform.platforms; + var grade: string = ionic.Platform.grade; + } } testIonic.controller('ionicTestController', IonicTestController); diff --git a/ionic/ionic.d.ts b/ionic/ionic.d.ts index 239f775c5..bb009df51 100644 --- a/ionic/ionic.d.ts +++ b/ionic/ionic.d.ts @@ -6,7 +6,89 @@ /// interface IonicStatic { + /** + * What Ionic package version is. + */ version: string; + Platform: { + /** + * Trigger a callback once the device is ready, or immediately + * if the device is already ready. This method can be run from + * anywhere and does not need to be wrapped by any additonal methods. + * When the app is within a WebView (Cordova), it’ll fire + * the callback once the device is ready. If the app is within + * a web browser, it’ll fire the callback after window.load. + * Please remember that Cordova features (Camera, FileSystem, etc) still + * will not work in a web browser. + */ + ready(callback: ()=>any): void; + /** + * Set the grade of the device: ‘a’, ‘b’, or ‘c’. ‘a’ is the best + * (most css features enabled), ‘c’ is the worst. By default, sets the grade + * depending on the current device. + */ + setGrade(grade: string): void; + /** + * Return the current device (given by cordova). + */ + device(): any; + /** + * Check if we are running within a WebView (such as Cordova). + */ + isWebView(): boolean; + /** + * Whether we are running on iPad. + */ + isIPad(): boolean; + /** + * Whether we are running on iOS. + */ + isIOS(): boolean; + /** + * Whether we are running on Android. + */ + isAndroid(): boolean; + /** + * Whether we are running on Windows Phone. + */ + isWindowsPhone(): boolean; + /** + * The name of the current platform. + */ + platform(): string; + /** + * The version of the current device platform. + */ + version(): number; + /** + * Exit the app. + */ + exitApp(): void; + /** + * Shows or hides the device status bar (in Cordova). Requires cordova plugin add org.apache.cordova.statusbar + */ + showStatusBar(shouldShow: boolean): void; + /** + * Sets whether the app is fullscreen or not (in Cordova). + */ + fullScreen(showFullScreen?: boolean, showStatusBar?: boolean): void; + /** + * Whether the device is ready. + */ + isReady: boolean; + /** + * Whether the device is fullscreen. + */ + isFullScreen: boolean; + /** + * An array of all platforms found. + */ + platforms: Array; + /** + * What grade the current platform is. + */ + grade: string; + }; } declare var ionic: IonicStatic; @@ -20,14 +102,17 @@ declare module ionic { interface IonicActionSheetService { show(options: IonicActionSheetOptions): ()=>void; } + interface IonicActionSheetButton { + text: string; + } interface IonicActionSheetOptions { - buttons?: Array; + buttons?: Array; titleText?: string; cancelText?: string; destructiveText?: string; cancel?: ()=>any; - buttonClicked?: (index: any)=>any; - destructiveButtonClicked?: ()=>any; + buttonClicked?: (index: number)=>boolean; + destructiveButtonClicked?: ()=>boolean; cancelOnStateChange?: boolean; cssClass?: string; } @@ -164,10 +249,13 @@ declare module ionic { interface IonicPopupService { show(options: IonicPopupFullOptions): IonicPopupPromise; alert(options: IonicPopupAlertOptions): IonicPopupPromise; - confirm(options: IonicPopupConfirmOptions): IonicPopupPromise; + confirm(options: IonicPopupConfirmOptions): IonicPopupConfirmPromise; prompt(options: IonicPopupPromptOptions): IonicPopupPromise; } + interface IonicPopupConfirmPromise extends ng.IPromise { + close(value?: boolean): void; + } interface IonicPopupPromise extends ng.IPromise { close(value?: any): any; } diff --git a/jake/jake.d.ts b/jake/jake.d.ts index 1812b818b..95614374c 100644 --- a/jake/jake.d.ts +++ b/jake/jake.d.ts @@ -40,6 +40,16 @@ declare function fail(...err:any[]): void; */ declare function file(name:string, prereqs?:string[], action?:()=>void, opts?:jake.FileTaskOptions): jake.FileTask; +/** + * Creates Jake FileTask from regex patterns + * @name name/pattern of the Task + * @param source calculated from the name pattern + * @param prereqs Prerequisites to be run before this task + * @param action The action to perform for this task + * @param opts Perform this task asynchronously. If you flag a task with this option, you must call the global `complete` method inside the task's action, for execution to proceed to the next task. + */ +declare function rule(pattern: RegExp, source: string | { (name: string): string; }, prereqs?: string[], action?: () => void, opts?: jake.TaskOptions): void; + /** * Creates a namespace which allows logical grouping of tasks, and prevents name-collisions with task-names. Namespaces can be nested inside of other namespaces. * @param name The name of the namespace @@ -185,6 +195,11 @@ declare module jake{ * @default false */ async?: boolean; + + /** + * number of parllel async tasks + */ + parallelLimit?: number; } /** diff --git a/jasmine-expect/jasmine-expect-tests.ts b/jasmine-expect/jasmine-expect-tests.ts new file mode 100644 index 000000000..ec54269f4 --- /dev/null +++ b/jasmine-expect/jasmine-expect-tests.ts @@ -0,0 +1,1994 @@ +/// +/// + +// Taken directly from the test directory of the original repo + +declare var describeWhenNotArray: (arr: string) => void; +declare var describeToBeArrayOfX: (arr: string, descriptor: {}) => void; +declare var describeToHaveArrayX: (arr: string, descriptor: () => void) => void; +declare var describeToHaveX: (arr: string, descriptor: () => void) => void; +declare var describeToHaveBooleanX: (arr: string, descriptor: () => void) => void; +declare var badReference: { someValue: any }; +var _undefined: any = undefined; + +describe('toBeAfter', function() { + describe('when invoked', function() { + describe('when value is a Date', function() { + describe('when date occurs after another', function() { + it('should confirm', function() { + expect(new Date('2013-01-01T01:00:00.000Z')).toBeAfter(new Date('2013-01-01T00:00:00.000Z')); + }); + }); + describe('when date does NOT occur after another', function() { + it('should deny', function() { + expect(new Date('2013-01-01T00:00:00.000Z')).not.toBeAfter(new Date('2013-01-01T01:00:00.000Z')); + }); + }); + }); + }); +}); + + +describe('toBeArray', function() { + describe('when invoked', function() { + describe('when subject is a true Array', function() { + it('should confirm', function() { + expect([]).toBeArray(); + expect(new Array()).toBeArray(); + }); + }); + describeWhenNotArray('toBeArray'); + }); +}); + + +describe('toBeArrayOfBooleans', function() { + describeToBeArrayOfX('toBeArrayOfBooleans', { + type: 'Boolean', + whenValid: function() { + expect([true]).toBeArrayOfBooleans(); + expect([new Boolean(true)]).toBeArrayOfBooleans(); + expect([new Boolean(false)]).toBeArrayOfBooleans(); + expect([false, true]).toBeArrayOfBooleans(); + }, + whenInvalid: function() { + expect([null]).not.toBeArrayOfBooleans(); + }, + whenMixed: function() { + expect([null, false]).not.toBeArrayOfBooleans(); + expect([null, true]).not.toBeArrayOfBooleans(); + } + }); +}); + + +describe('toBeArrayOfNumbers', function() { + describeToBeArrayOfX('toBeArrayOfNumbers', { + type: 'Number', + whenValid: function() { + expect([1]).toBeArrayOfNumbers(); + expect([new Number(1)]).toBeArrayOfNumbers(); + expect([new Number(0)]).toBeArrayOfNumbers(); + expect([0, 1]).toBeArrayOfNumbers(); + }, + whenInvalid: function() { + expect([null]).not.toBeArrayOfNumbers(); + }, + whenMixed: function() { + expect([null, 0]).not.toBeArrayOfNumbers(); + } + }); +}); + +describe('toBeArrayOfObjects', function() { + describeToBeArrayOfX('toBeArrayOfObjects', { + type: 'Object', + whenValid: function() { + expect([{}, {}]).toBeArrayOfObjects(); + }, + whenInvalid: function() { + expect([null]).not.toBeArrayOfObjects(); + expect(['Object']).not.toBeArrayOfObjects(); + expect(['[object Object]']).not.toBeArrayOfObjects(); + }, + whenMixed: function() { + expect([null, {}]).not.toBeArrayOfObjects(); + } + }); +}); + +describe('toBeArrayOfSize', function() { + describe('when invoked', function() { + describe('when subject is a true Array', function() { + describe('when subject has the expected number of members', function() { + it('should confirm', function() { + expect([]).toBeArrayOfSize(0); + expect([null]).toBeArrayOfSize(1); + expect([false, false]).toBeArrayOfSize(2); + expect([_undefined, _undefined]).toBeArrayOfSize(2); + }); + }); + describe('when subject has an unexpected number of members', function() { + it('should deny', function() { + expect([]).not.toBeArrayOfSize(1); + expect([null]).not.toBeArrayOfSize(0); + expect([true, true]).not.toBeArrayOfSize(1); + }); + }); + }); + describeWhenNotArray('toBeArrayOfSize'); + }); +}); + + +describe('toBeArrayOfStrings', function() { + describeToBeArrayOfX('toBeArrayOfStrings', { + type: 'String', + whenValid: function() { + expect(['truthy']).toBeArrayOfStrings(); + expect([new String('truthy')]).toBeArrayOfStrings(); + expect([new String('')]).toBeArrayOfStrings(); + expect(['', 'truthy']).toBeArrayOfStrings(); + }, + whenInvalid: function() { + expect([null]).not.toBeArrayOfStrings(); + }, + whenMixed: function() { + expect([null, '']).not.toBeArrayOfStrings(); + } + }); +}); + +describe('toBeBefore', function() { + describe('when invoked', function() { + describe('when value is a Date', function() { + describe('when date occurs before another', function() { + it('should confirm', function() { + expect(new Date('2013-01-01T00:00:00.000Z')).toBeBefore(new Date('2013-01-01T01:00:00.000Z')); + }); + }); + describe('when date does NOT occur before another', function() { + it('should deny', function() { + expect(new Date('2013-01-01T01:00:00.000Z')).not.toBeBefore(new Date('2013-01-01T00:00:00.000Z')); + }); + }); + }); + }); +}); + + +describe('toBeBoolean', function() { + describe('when invoked', function() { + describe('when subject not only truthy or falsy, but a boolean', function() { + it('should confirm', function() { + expect(true).toBeBoolean(); + expect(false).toBeBoolean(); + expect(new Boolean(true)).toBeBoolean(); + expect(new Boolean(false)).toBeBoolean(); + }); + }); + describe('when subject is truthy or falsy', function() { + it('should deny', function() { + expect(1).not.toBeBoolean(); + expect(0).not.toBeBoolean(); + }); + }); + }); +}); + +describe('toBeCalculable', function() { + describe('when invoked', function() { + describe('when subject CAN be coerced to be used in mathematical operations', function() { + it('should confirm', function() { + expect('1').toBeCalculable(); + expect('').toBeCalculable(); + expect(null).toBeCalculable(); + }); + }); + describe('when subject can NOT be coerced by JavaScript to be used in mathematical operations', function() { + it('should deny', function() { + expect({}).not.toBeCalculable(); + expect(NaN).not.toBeCalculable(); + }); + }); + }); +}); + +describe('toBeDate', function() { + describe('when invoked', function() { + describe('when value is an instance of Date', function() { + it('should confirm', function() { + expect(new Date()).toBeDate(); + }); + }); + describe('when value is NOT an instance of Date', function() { + it('should deny', function() { + expect(null).not.toBeDate(); + }); + }); + }); +}); + +describe('toBeEmptyArray', function() { + describe('when invoked', function() { + describe('when subject is a true Array', function() { + describe('when subject has members', function() { + it('should confirm', function() { + expect([]).toBeEmptyArray(); + }); + }); + describe('when subject has no members', function() { + it('should deny', function() { + expect([null]).not.toBeEmptyArray(); + expect(['']).not.toBeEmptyArray(); + expect([1]).not.toBeEmptyArray(); + expect([true]).not.toBeEmptyArray(); + expect([false]).not.toBeEmptyArray(); + }); + }); + }); + describeWhenNotArray('toBeEmptyArray'); + }); +}); + +describe('toBeEmptyObject', function() { + beforeEach(function() { + this.Foo = function() { }; + }); + describe('when invoked', function() { + describe('when subject IS an Object with no instance members', function() { + beforeEach(function() { + this.Foo.prototype = { + b: 2 + }; + }); + it('should confirm', function() { + expect(new this.Foo()).toBeEmptyObject(); + expect({}).toBeEmptyObject(); + }); + }); + describe('when subject is NOT an Object with no instance members', function() { + it('should deny', function() { + expect({ + a: 1 + }).not.toBeEmptyObject(); + expect(null).not.toBeNonEmptyObject(); + }); + }); + }); +}); + +describe('toBeEmptyString', function() { + describe('when invoked', function() { + describe('when subject IS a string with no characters', function() { + it('should confirm', function() { + expect('').toBeEmptyString(); + }); + }); + describe('when subject is NOT a string with no characters', function() { + it('should deny', function() { + expect(' ').not.toBeEmptyString(); + }); + }); + }); +}); + +describe('toBeEvenNumber', function() { + describe('when invoked', function() { + describe('when subject IS an even number', function() { + it('should confirm', function() { + expect(2).toBeEvenNumber(); + }); + }); + describe('when subject is NOT an even number', function() { + it('should deny', function() { + expect(1).not.toBeEvenNumber(); + expect(NaN).not.toBeEvenNumber(); + }); + }); + }); +}); + + +describe('toBeFalse', function() { + describe('when invoked', function() { + describe('when subject is not only falsy, but a boolean false', function() { + it('should confirm', function() { + expect(false).toBeFalse(); + expect(new Boolean(false)).toBeFalse(); + }); + }); + describe('when subject is falsy', function() { + it('should deny', function() { + expect(1).not.toBeFalse(); + }); + }); + }); +}); + +describe('toBeFunction', function() { + describe('when invoked', function() { + describe('when subject IS a function', function() { + it('should confirm', function() { + expect(function() { }).toBeFunction(); + }); + }); + describe('when subject is NOT a function', function() { + it('should deny', function() { + expect(/regexp/).not.toBeFunction(); + }); + }); + }); +}); + +describe('toBeHtmlString', function() { + describe('when invoked', function() { + describe('when subject IS a string of HTML markup', function() { + beforeEach(function() { + this.ngMultiLine = ''; + this.ngMultiLine += ''; + this.ngMultiLine += '\n'; + this.ngMultiLine += ' Watch with Google TV'; + this.ngMultiLine += '\n'; + this.ngMultiLine += ''; + this.ngMultiLine += '\n'; + }); + it('should confirm', function() { + expect('text').toBeHtmlString(); + expect('baz').toBeHtmlString(); + expect('
').toBeHtmlString(); + expect('
  • ').toBeHtmlString(); + expect(this.ngMultiLine).toBeHtmlString(); + }); + }); + describe('when subject is NOT a string of HTML markup', function() { + it('should deny', function() { + expect('div').not.toBeHtmlString(); + expect(null).not.toBeHtmlString(); + }); + }); + }); +}); + +describe('toBeIso8601', function() { + describe('when invoked', function() { + describe('when value is a Date String conforming to the ISO 8601 standard', function() { + describe('when specified date is valid', function() { + it('should confirm', function() { + expect('2013-07-08T07:29:15.863Z').toBeIso8601(); + expect('2013-07-08T07:29:15.863').toBeIso8601(); + expect('2013-07-08T07:29:15').toBeIso8601(); + expect('2013-07-08T07:29').toBeIso8601(); + expect('2013-07-08').toBeIso8601(); + }); + }); + describe('when specified date is NOT valid', function() { + it('should deny', function() { + expect('2013-99-12T00:00:00.000Z').not.toBeIso8601(); + expect('2013-12-99T00:00:00.000Z').not.toBeIso8601(); + expect('2013-01-01T99:00:00.000Z').not.toBeIso8601(); + expect('2013-01-01T99:99:00.000Z').not.toBeIso8601(); + expect('2013-01-01T00:00:99.000Z').not.toBeIso8601(); + }); + }); + }); + describe('when value is a String NOT conforming to the ISO 8601 standard', function() { + it('should deny', function() { + expect('2013-07-08T07:29:15.').not.toBeIso8601(); + expect('2013-07-08T07:29:').not.toBeIso8601(); + expect('2013-07-08T07:2').not.toBeIso8601(); + expect('2013-07-08T07:').not.toBeIso8601(); + expect('2013-07-08T07').not.toBeIso8601(); + expect('2013-07-08T').not.toBeIso8601(); + expect('2013-07-0').not.toBeIso8601(); + expect('2013-07-').not.toBeIso8601(); + expect('2013-07').not.toBeIso8601(); + expect('2013-0').not.toBeIso8601(); + expect('2013-').not.toBeIso8601(); + expect('2013').not.toBeIso8601(); + expect('201').not.toBeIso8601(); + expect('20').not.toBeIso8601(); + expect('2').not.toBeIso8601(); + expect('').not.toBeIso8601(); + }); + }); + }); +}); +var _undefined; + +describe('toBeJsonString', function() { + describe('when invoked', function() { + describe('when subject IS a string of parseable JSON', function() { + it('should confirm', function() { + expect('{}').toBeJsonString(); + expect('[]').toBeJsonString(); + expect('[1]').toBeJsonString(); + }); + }); + describe('when subject is NOT a string of parseable JSON', function() { + it('should deny', function() { + expect('[1,]').not.toBeJsonString(); + expect('<>').not.toBeJsonString(); + expect(null).not.toBeJsonString(); + expect('').not.toBeJsonString(); + expect(_undefined).not.toBeJsonString(); + }); + }); + }); +}); + +describe('toBeLongerThan', function() { + describe('when invoked', function() { + describe('when the subject and comparison ARE both strings', function() { + describe('when the subject IS longer than the comparision string', function() { + it('should confirm', function() { + expect('abc').toBeLongerThan('ab'); + expect('a').toBeLongerThan(''); + }); + }); + describe('when the subject is NOT longer than the comparision string', function() { + it('should deny', function() { + expect('ab').not.toBeLongerThan('abc'); + expect('').not.toBeLongerThan('a'); + }); + }); + }); + describe('when the subject and comparison are NOT both strings', function() { + it('should deny (we are asserting the relative lengths of two strings)', function() { + expect('truthy').not.toBeLongerThan(_undefined); + expect(_undefined).not.toBeLongerThan('truthy'); + expect('').not.toBeLongerThan(_undefined); + expect(_undefined).not.toBeLongerThan(''); + }); + }); + }); +}); + +describe('toBeNonEmptyArray', function() { + describe('when invoked', function() { + describe('when subject is a true Array', function() { + describe('when subject has members', function() { + it('should confirm', function() { + expect([null]).toBeNonEmptyArray(); + expect([_undefined]).toBeNonEmptyArray(); + expect(['']).toBeNonEmptyArray(); + }); + }); + describe('when subject has no members', function() { + it('should deny', function() { + expect([]).not.toBeNonEmptyArray(); + }); + }); + }); + describeWhenNotArray('toBeNonEmptyArray'); + }); +}); + +describe('toBeNonEmptyObject', function() { + beforeEach(function() { + this.Foo = function() { }; + }); + describe('when invoked', function() { + describe('when subject IS an Object with at least one instance member', function() { + it('should confirm', function() { + expect({ + a: 1 + }).toBeNonEmptyObject(); + }); + }); + describe('when subject is NOT an Object with at least one instance member', function() { + beforeEach(function() { + this.Foo.prototype = { + b: 2 + }; + }); + it('should deny', function() { + expect(new this.Foo()).not.toBeNonEmptyObject(); + expect({}).not.toBeNonEmptyObject(); + expect(null).not.toBeNonEmptyObject(); + }); + }); + }); +}); + +describe('toBeNonEmptyString', function() { + describe('when invoked', function() { + describe('when subject IS a string with at least one character', function() { + it('should confirm', function() { + expect(' ').toBeNonEmptyString(); + }); + }); + describe('when subject is NOT a string with at least one character', function() { + it('should deny', function() { + expect('').not.toBeNonEmptyString(); + expect(null).not.toBeNonEmptyString(); + }); + }); + }); +}); + +describe('toBeNumber', function() { + describe('when invoked', function() { + describe('when subject IS a number', function() { + it('should confirm', function() { + expect(1).toBeNumber(); + expect(1.11).toBeNumber(); + expect(1e3).toBeNumber(); + expect(0.11).toBeNumber(); + expect(-11).toBeNumber(); + }); + }); + describe('when subject is NOT a number', function() { + it('should deny', function() { + expect('1').not.toBeNumber(); + expect(NaN).not.toBeNumber(); + }); + }); + }); +}); + + +describe('toBeObject', function() { + beforeEach(function() { + this.Foo = function() { }; + }); + describe('when invoked', function() { + describe('when subject IS an Object', function() { + it('should confirm', function() { + expect(new Object()).toBeObject(); + expect(new this.Foo()).toBeObject(); + expect({}).toBeObject(); + }); + }); + describe('when subject is NOT an Object', function() { + it('should deny', function() { + expect(null).not.toBeObject(); + expect(123).not.toBeObject(); + expect('[object Object]').not.toBeObject(); + }); + }); + }); +}); + +describe('toBeOddNumber', function() { + describe('when invoked', function() { + describe('when subject IS an odd number', function() { + it('should confirm', function() { + expect(1).toBeOddNumber(); + }); + }); + describe('when subject is NOT an odd number', function() { + it('should deny', function() { + expect(2).not.toBeOddNumber(); + expect(NaN).not.toBeOddNumber(); + }); + }); + }); +}); +var _undefined; + +describe('toBeSameLengthAs', function() { + describe('when invoked', function() { + describe('when the subject and comparison ARE both strings', function() { + describe('when the subject IS the same length as the comparision string', function() { + it('should confirm', function() { + expect('ab').toBeSameLengthAs('ab'); + }); + }); + describe('when the subject is NOT the same length as the comparision string', function() { + it('should deny', function() { + expect('abc').not.toBeSameLengthAs('ab'); + expect('a').not.toBeSameLengthAs(''); + expect('').not.toBeSameLengthAs('a'); + }); + }); + }); + describe('when the subject and comparison are NOT both strings', function() { + it('should deny (we are asserting the relative lengths of two strings)', function() { + expect('truthy').not.toBeSameLengthAs(_undefined); + expect(_undefined).not.toBeSameLengthAs('truthy'); + expect('').not.toBeSameLengthAs(_undefined); + expect(_undefined).not.toBeSameLengthAs(''); + }); + }); + }); +}); +var _undefined; + +describe('toBeShorterThan', function() { + describe('when invoked', function() { + describe('when the subject and comparison ARE both strings', function() { + describe('when the subject IS shorter than the comparision string', function() { + it('should confirm', function() { + expect('ab').toBeShorterThan('abc'); + expect('').toBeShorterThan('a'); + }); + }); + describe('when the subject is NOT shorter than the comparision string', function() { + it('should deny', function() { + expect('abc').not.toBeShorterThan('ab'); + expect('a').not.toBeShorterThan(''); + }); + }); + }); + describe('when the subject and comparison are NOT both strings', function() { + it('should deny (we are asserting the relative lengths of two strings)', function() { + expect('truthy').not.toBeShorterThan(_undefined); + expect(_undefined).not.toBeShorterThan('truthy'); + expect('').not.toBeShorterThan(_undefined); + expect(_undefined).not.toBeShorterThan(''); + }); + }); + }); +}); + +describe('toBeString', function() { + describe('when invoked', function() { + describe('when subject IS a string of any length', function() { + it('should confirm', function() { + expect('').toBeString(); + expect(' ').toBeString(); + }); + }); + describe('when subject is NOT a string of any length', function() { + it('should deny', function() { + expect(null).not.toBeString(); + }); + }); + }); +}); + + +describe('toBeTrue', function() { + describe('when invoked', function() { + describe('when subject is not only truthy, but a boolean true', function() { + it('should confirm', function() { + expect(true).toBeTrue(); + expect(new Boolean(true)).toBeTrue(); + }); + }); + describe('when subject is truthy', function() { + it('should deny', function() { + expect(1).not.toBeTrue(); + }); + }); + }); +}); + +describe('toBeWhitespace', function() { + describe('when invoked', function() { + describe('when subject IS a string containing only tabs, spaces, returns etc', function() { + it('should confirm', function() { + expect(' ').toBeWhitespace(); + expect('').toBeWhitespace(); + }); + }); + describe('when subject is NOT a string containing only tabs, spaces, returns etc', function() { + it('should deny', function() { + expect('has-no-whitespace').not.toBeWhitespace(); + expect('has whitespace').not.toBeWhitespace(); + expect(null).not.toBeWhitespace(); + }); + }); + }); +}); + +describe('toBeWholeNumber', function() { + describe('when invoked', function() { + describe('when subject IS a number with no positive decimal places', function() { + it('should confirm', function() { + expect(1).toBeWholeNumber(); + expect(0).toBeWholeNumber(); + expect(0.0).toBeWholeNumber(); + }); + }); + describe('when subject is NOT a number with no positive decimal places', function() { + it('should deny', function() { + expect(NaN).not.toBeWholeNumber(); + expect(1.1).not.toBeWholeNumber(); + expect(0.1).not.toBeWholeNumber(); + }); + }); + }); +}); + +describe('toBeWithinRange', function() { + describe('when invoked', function() { + describe('when subject IS a number >= floor and <= ceiling', function() { + it('should confirm', function() { + expect(0).toBeWithinRange(0, 2); + expect(1).toBeWithinRange(0, 2); + expect(2).toBeWithinRange(0, 2); + }); + }); + describe('when subject is NOT a number >= floor and <= ceiling', function() { + it('should deny', function() { + expect(-3).not.toBeWithinRange(0, 2); + expect(-2).not.toBeWithinRange(0, 2); + expect(-1).not.toBeWithinRange(0, 2); + expect(3).not.toBeWithinRange(0, 2); + expect(NaN).not.toBeWithinRange(0, 2); + }); + }); + }); +}); +var _undefined; + +describe('toEndWith', function() { + describe('when invoked', function() { + describe('when subject is NOT an undefined or empty string', function() { + describe('when subject is a string whose trailing characters match the expected string', function() { + it('should confirm', function() { + expect('jamie').toEndWith('mie'); + }); + }); + describe('when subject is a string whose trailing characters DO NOT match the expected string', function() { + it('should deny', function() { + expect('jamie ').not.toEndWith('mie'); + expect('jamiE').not.toEndWith('mie'); + }); + }); + }); + describe('when subject IS an undefined or empty string', function() { + it('should deny', function() { + expect('').not.toEndWith(''); + expect(_undefined).not.toEndWith(''); + expect(_undefined).not.toEndWith('undefined'); + expect('undefined').not.toEndWith(_undefined); + }); + }); + }); +}); + +describe('toHaveArray', function() { + describeToHaveArrayX('toHaveArray', function() { + it('should confirm', function() { + expect({ + memberName: [] + }).toHaveArray('memberName'); + expect({ + memberName: [1, 2, 3] + }).toHaveArray('memberName'); + }); + }); +}); + + +describe('toHaveArrayOfBooleans', function() { + describeToHaveArrayX('toHaveArrayOfBooleans', function() { + describe('when named Array is empty', function() { + it('should confirm', function() { + expect({ + memberName: [] + }).toHaveArrayOfBooleans('memberName'); + }); + }); + describe('when named Array has items', function() { + describe('when all items are booleans', function() { + it('should confirm', function() { + expect({ + memberName: [true] + }).toHaveArrayOfBooleans('memberName'); + expect({ + memberName: [new Boolean(true)] + }).toHaveArrayOfBooleans('memberName'); + expect({ + memberName: [new Boolean(false)] + }).toHaveArrayOfBooleans('memberName'); + expect({ + memberName: [false, true] + }).toHaveArrayOfBooleans('memberName'); + }); + }); + describe('when any item is not a boolean', function() { + it('should deny', function() { + expect({ + memberName: [null] + }).not.toHaveArrayOfBooleans('memberName'); + expect({ + memberName: [null, false] + }).not.toHaveArrayOfBooleans('memberName'); + }); + }); + }); + }); +}); + + +describe('toHaveArrayOfNumbers', function() { + describeToHaveArrayX('toHaveArrayOfNumbers', function() { + describe('when named Array is empty', function() { + it('should confirm', function() { + expect({ + memberName: [] + }).toHaveArrayOfNumbers('memberName'); + }); + }); + describe('when named Array has items', function() { + describe('when all items are numbers', function() { + it('should confirm', function() { + expect({ + memberName: [1] + }).toHaveArrayOfNumbers('memberName'); + expect({ + memberName: [new Number(1)] + }).toHaveArrayOfNumbers('memberName'); + expect({ + memberName: [new Number(0)] + }).toHaveArrayOfNumbers('memberName'); + expect({ + memberName: [0, 1] + }).toHaveArrayOfNumbers('memberName'); + }); + }); + describe('when any item is not a number', function() { + it('should deny', function() { + expect({ + memberName: [null] + }).not.toHaveArrayOfNumbers('memberName'); + expect({ + memberName: [null, 0] + }).not.toHaveArrayOfNumbers('memberName'); + }); + }); + }); + }); +}); + +describe('toHaveArrayOfObjects', function() { + describeToHaveArrayX('toHaveArrayOfObjects', function() { + describe('when named Array is empty', function() { + it('should confirm', function() { + expect({ + memberName: [] + }).toHaveArrayOfObjects('memberName'); + }); + }); + describe('when named Array has items', function() { + describe('when all items are objects', function() { + it('should confirm', function() { + expect({ + memberName: [{}] + }).toHaveArrayOfObjects('memberName'); + expect({ + memberName: [{}, {}] + }).toHaveArrayOfObjects('memberName'); + }); + }); + describe('when any item is not an object', function() { + it('should deny', function() { + expect({ + memberName: [null] + }).not.toHaveArrayOfObjects('memberName'); + expect({ + memberName: [null, {}] + }).not.toHaveArrayOfObjects('memberName'); + }); + }); + }); + }); +}); + +describe('toHaveArrayOfSize', function() { + describeToHaveArrayX('toHaveArrayOfSize', function() { + describe('when number of expected items does not match', function() { + it('should deny', function() { + expect({ + memberName: '' + }).not.toHaveArrayOfSize('memberName'); + expect({ + memberName: ['bar'] + }).not.toHaveArrayOfSize('memberName', 0); + }); + }); + describe('when number of expected items does match', function() { + it('should confirm', function() { + expect({ + memberName: [] + }).toHaveArrayOfSize('memberName', 0); + expect({ + memberName: ['bar'] + }).toHaveArrayOfSize('memberName', 1); + expect({ + memberName: ['bar', 'baz'] + }).toHaveArrayOfSize('memberName', 2); + }); + }); + }); +}); + + +describe('toHaveArrayOfStrings', function() { + describeToHaveArrayX('toHaveArrayOfStrings', function() { + describe('when named Array is empty', function() { + it('should confirm', function() { + expect({ + memberName: [] + }).toHaveArrayOfStrings('memberName'); + }); + }); + describe('when named Array has items', function() { + describe('when all items are strings', function() { + it('should confirm', function() { + expect({ + memberName: ['truthy'] + }).toHaveArrayOfStrings('memberName'); + expect({ + memberName: [new String('truthy')] + }).toHaveArrayOfStrings('memberName'); + expect({ + memberName: [new String('')] + }).toHaveArrayOfStrings('memberName'); + expect({ + memberName: ['', 'truthy'] + }).toHaveArrayOfStrings('memberName'); + }); + }); + describe('when any item is not a string', function() { + it('should deny', function() { + expect({ + memberName: [null] + }).not.toHaveArrayOfStrings('memberName'); + expect({ + memberName: [null, ''] + }).not.toHaveArrayOfStrings('memberName'); + }); + }); + }); + }); +}); + + +describe('toHaveBoolean', function() { + describeToHaveBooleanX('toHaveBoolean', function() { + describe('when primitive', function() { + it('should confirm', function() { + expect({ + memberName: true + }).toHaveBoolean('memberName'); + expect({ + memberName: false + }).toHaveBoolean('memberName'); + }); + }); + describe('when Boolean object', function() { + it('should confirm', function() { + expect({ + memberName: new Boolean(true) + }).toHaveBoolean('memberName'); + expect({ + memberName: new Boolean(false) + }).toHaveBoolean('memberName'); + }); + }); + }); +}); + +describe('toHaveCalculable', function() { + describeToHaveX('toHaveCalculable', function() { + describe('when subject CAN be coerced to be used in mathematical operations', function() { + it('should confirm', function() { + expect({ + memberName: '1' + }).toHaveCalculable('memberName'); + expect({ + memberName: '' + }).toHaveCalculable('memberName'); + expect({ + memberName: null + }).toHaveCalculable('memberName'); + }); + }); + describe('when subject can NOT be coerced by JavaScript to be used in mathematical operations', function() { + it('should deny', function() { + expect({ + memberName: {} + }).not.toHaveCalculable('memberName'); + expect({ + memberName: NaN + }).not.toHaveCalculable('memberName'); + }); + }); + }); +}); + +describe('toHaveDate', function() { + var mockDate: any; + beforeEach(function() { + mockDate = { + any: new Date(), + early: new Date('2013-01-01T00:00:00.000Z'), + late: new Date('2013-01-01T01:00:00.000Z') + }; + }); + describeToHaveX('toHaveDate', function() { + describe('when member is an instance of Date', function() { + it('should confirm', function() { + expect({ + memberName: mockDate.any + }).toHaveDate('memberName'); + }); + }); + describe('when member is NOT an instance of Date', function() { + it('should deny', function() { + expect({ + memberName: null + }).not.toHaveDate('memberName'); + }); + }); + }); +}); + +describe('toHaveDateAfter', function() { + var mockDate: any; + beforeEach(function() { + mockDate = { + any: new Date(), + early: new Date('2013-01-01T00:00:00.000Z'), + late: new Date('2013-01-01T01:00:00.000Z') + }; + }); + describeToHaveX('toHaveDateAfter', function() { + describe('when member is an instance of Date', function() { + describe('when date occurs before another', function() { + it('should confirm', function() { + expect({ + memberName: mockDate.late + }).toHaveDateAfter('memberName', mockDate.early); + }); + }); + describe('when date does NOT occur before another', function() { + it('should deny', function() { + expect({ + memberName: mockDate.early + }).not.toHaveDateAfter('memberName', mockDate.late); + }); + }); + }); + describe('when member is NOT an instance of Date', function() { + it('should deny', function() { + expect({ + memberName: null + }).not.toHaveDateAfter('memberName', mockDate.any); + }); + }); + }); +}); + +describeToHaveX('toHaveDateBefore', function() { + var mockDate: any; + beforeEach(function() { + mockDate = { + any: new Date(), + early: new Date('2013-01-01T00:00:00.000Z'), + late: new Date('2013-01-01T01:00:00.000Z') + }; + }); + describe('when member is an instance of Date', function() { + describe('when date occurs before another', function() { + it('should confirm', function() { + expect({ + memberName: mockDate.early + }).toHaveDateBefore('memberName', mockDate.late); + }); + }); + describe('when date does NOT occur before another', function() { + it('should deny', function() { + expect({ + memberName: mockDate.late + }).not.toHaveDateBefore('memberName', mockDate.early); + }); + }); + }); + describe('when member is NOT an instance of Date', function() { + it('should deny', function() { + expect({ + memberName: null + }).not.toHaveDateBefore('memberName', mockDate.any); + }); + }); +}); + +describe('toHaveEmptyArray', function() { + describeToHaveArrayX('toHaveEmptyArray', function() { + describe('when named array has members', function() { + it('should deny', function() { + expect({ + memberName: [1, 2, 3] + }).not.toHaveEmptyArray('memberName'); + expect({ + memberName: '' + }).not.toHaveEmptyArray('memberName'); + }); + }); + describe('when named array has no members', function() { + it('should confirm', function() { + expect({ + memberName: [] + }).toHaveEmptyArray('memberName'); + }); + }); + }); +}); + +describe('toHaveEmptyObject', function() { + beforeEach(function() { + this.Foo = function() { }; + }); + describeToHaveX('toHaveEmptyObject', function() { + describe('when subject IS an Object with no instance members', function() { + beforeEach(function() { + this.Foo.prototype = { + b: 2 + }; + }); + it('should confirm', function() { + expect({ + memberName: new this.Foo() + }).toHaveEmptyObject('memberName'); + expect({ + memberName: {} + }).toHaveEmptyObject('memberName'); + }); + }); + describe('when subject is NOT an Object with no instance members', function() { + it('should deny', function() { + expect({ + memberName: { + a: 1 + } + }).not.toHaveEmptyObject('memberName'); + expect({ + memberName: null + }).not.toHaveNonEmptyObject('memberName'); + }); + }); + }); +}); + +describe('toHaveEmptyString', function() { + describeToHaveX('toHaveEmptyString', function() { + describe('when subject IS a string with no characters', function() { + it('should confirm', function() { + expect({ + memberName: '' + }).toHaveEmptyString('memberName'); + }); + }); + describe('when subject is NOT a string with no characters', function() { + it('should deny', function() { + expect({ + memberName: ' ' + }).not.toHaveEmptyString('memberName'); + }); + }); + }); +}); + +describe('toHaveEvenNumber', function() { + describeToHaveX('toHaveEvenNumber', function() { + describe('when subject IS an even number', function() { + it('should confirm', function() { + expect({ + memberName: 2 + }).toHaveEvenNumber('memberName'); + }); + }); + describe('when subject is NOT an even number', function() { + it('should deny', function() { + expect({ + memberName: 1 + }).not.toHaveEvenNumber('memberName'); + expect({ + memberName: NaN + }).not.toHaveEvenNumber('memberName'); + }); + }); + }); +}); + +describe('toHaveFalse', function() { + describeToHaveBooleanX('toHaveFalse', function() { + describe('when primitive', function() { + describe('when true', function() { + it('should deny', function() { + expect({ + memberName: true + }).not.toHaveFalse('memberName'); + }); + }); + describe('when false', function() { + it('should confirm', function() { + expect({ + memberName: false + }).toHaveFalse('memberName'); + }); + }); + }); + describe('when Boolean object', function() { + describe('when true', function() { + it('should deny', function() { + expect({ + memberName: new Boolean(true) + }).not.toHaveFalse('memberName'); + }); + }); + describe('when false', function() { + it('should confirm', function() { + expect({ + memberName: new Boolean(false) + }).toHaveFalse('memberName'); + }); + }); + }); + }); +}); + +describe('toHaveHtmlString', function() { + describeToHaveX('toHaveHtmlString', function() { + describe('when subject IS a string of HTML markup', function() { + beforeEach(function() { + this.ngMultiLine = ''; + this.ngMultiLine += ''; + this.ngMultiLine += '\n'; + this.ngMultiLine += ' Watch with Google TV'; + this.ngMultiLine += '\n'; + this.ngMultiLine += ''; + this.ngMultiLine += '\n'; + }); + it('should confirm', function() { + expect({ + memberName: 'text' + }).toHaveHtmlString('memberName'); + expect({ + memberName: 'baz' + }).toHaveHtmlString('memberName'); + expect({ + memberName: '
    ' + }).toHaveHtmlString('memberName'); + expect({ + memberName: '
  • ' + }).toHaveHtmlString('memberName'); + expect({ + memberName: this.ngMultiLine + }).toHaveHtmlString('memberName'); + }); + }); + describe('when subject is NOT a string of HTML markup', function() { + it('should deny', function() { + expect({ + memberName: 'div' + }).not.toHaveHtmlString('memberName'); + expect({ + memberName: null + }).not.toHaveHtmlString('memberName'); + }); + }); + }); +}); + +describe('toHaveIso8601', function() { + describeToHaveX('toHaveIso8601', function() { + describe('when member is a Date String conforming to the ISO 8601 standard', + function() { + describe('when specified date is valid', function() { + it('should confirm', function() { + expect({ + memberName: '2013-07-08T07:29:15.863Z' + }).toHaveIso8601('memberName'); + expect({ + memberName: '2013-07-08T07:29:15.863' + }).toHaveIso8601('memberName'); + expect({ + memberName: '2013-07-08T07:29:15' + }).toHaveIso8601('memberName'); + expect({ + memberName: '2013-07-08T07:29' + }).toHaveIso8601('memberName'); + expect({ + memberName: '2013-07-08' + }).toHaveIso8601('memberName'); + }); + }); + describe('when specified date is NOT valid', function() { + it('should deny', function() { + expect({ + memberName: '2013-99-12T00:00:00.000Z' + }).not.toHaveIso8601('memberName'); + expect({ + memberName: '2013-12-99T00:00:00.000Z' + }).not.toHaveIso8601('memberName'); + expect({ + memberName: '2013-01-01T99:00:00.000Z' + }).not.toHaveIso8601('memberName'); + expect({ + memberName: '2013-01-01T99:99:00.000Z' + }).not.toHaveIso8601('memberName'); + expect({ + memberName: '2013-01-01T00:00:99.000Z' + }).not.toHaveIso8601('memberName'); + }); + }); + }); + describe('when member is a String NOT conforming to the ISO 8601 standard', + function() { + it('should deny', function() { + expect({ + memberName: '2013-07-08T07:29:15.' + }).not.toHaveIso8601('memberName'); + expect({ + memberName: '2013-07-08T07:29:' + }).not.toHaveIso8601('memberName'); + expect({ + memberName: '2013-07-08T07:2' + }).not.toHaveIso8601('memberName'); + expect({ + memberName: '2013-07-08T07:' + }).not.toHaveIso8601('memberName'); + expect({ + memberName: '2013-07-08T07' + }).not.toHaveIso8601('memberName'); + expect({ + memberName: '2013-07-08T' + }).not.toHaveIso8601('memberName'); + expect({ + memberName: '2013-07-0' + }).not.toHaveIso8601('memberName'); + expect({ + memberName: '2013-07-' + }).not.toHaveIso8601('memberName'); + expect({ + memberName: '2013-07' + }).not.toHaveIso8601('memberName'); + expect({ + memberName: '2013-0' + }).not.toHaveIso8601('memberName'); + expect({ + memberName: '2013-' + }).not.toHaveIso8601('memberName'); + expect({ + memberName: '2013' + }).not.toHaveIso8601('memberName'); + expect({ + memberName: '201' + }).not.toHaveIso8601('memberName'); + expect({ + memberName: '20' + }).not.toHaveIso8601('memberName'); + expect({ + memberName: '2' + }).not.toHaveIso8601('memberName'); + expect({ + memberName: '' + }).not.toHaveIso8601('memberName'); + }); + }); + }); +}); + +describe('toHaveJsonString', function() { + describeToHaveX('toHaveJsonString', function() { + describe('when subject IS a string of parseable JSON', function() { + it('should confirm', function() { + expect({ + memberName: '{}' + }).toHaveJsonString('memberName'); + expect({ + memberName: '[]' + }).toHaveJsonString('memberName'); + expect({ + memberName: '[1]' + }).toHaveJsonString('memberName'); + }); + }); + describe('when subject is NOT a string of parseable JSON', function() { + it('should deny', function() { + expect({ + memberName: '[1,]' + }).not.toHaveJsonString('memberName'); + expect({ + memberName: '<>' + }).not.toHaveJsonString('memberName'); + expect({ + memberName: null + }).not.toHaveJsonString('memberName'); + expect({ + memberName: '' + }).not.toHaveJsonString('memberName'); + expect({ + memberName: _undefined + }).not.toHaveJsonString('memberName'); + }); + }); + }); +}); + +describe('toHaveMember', function() { + describeToHaveX('toHaveMember', function() { }); +}); + +describe('toHaveMethod', function() { + describeToHaveX('toHaveMethod', function() { + describe('when subject IS a function', function() { + it('should confirm', function() { + expect({ + memberName: function() { } + }).toHaveMethod('memberName'); + }); + }); + describe('when subject is NOT a function', function() { + it('should deny', function() { + expect({ + memberName: /regexp/ + }).not.toHaveMethod('memberName'); + }); + }); + }); +}); + +describe('toHaveNonEmptyArray', function() { + describeToHaveArrayX('toHaveNonEmptyArray', function() { + describe('when named array has no members', function() { + it('should deny', function() { + expect({ + memberName: [] + }).not.toHaveNonEmptyArray('memberName'); + }); + }); + describe('when named array has members', function() { + it('should confirm', function() { + expect({ + memberName: [1, 2, 3] + }).toHaveNonEmptyArray('memberName'); + }); + }); + }); +}); + +describe('toHaveNonEmptyObject', function() { + describeToHaveX('toHaveNonEmptyObject', function() { + beforeEach(function() { + this.Foo = function() { }; + }); + describe('when subject IS an Object with at least one instance member', function() { + it('should confirm', function() { + expect({ + memberName: { + a: 1 + } + }).toHaveNonEmptyObject('memberName'); + }); + }); + describe('when subject is NOT an Object with at least one instance member', function() { + beforeEach(function() { + this.Foo.prototype = { + b: 2 + }; + }); + it('should deny', function() { + expect({ + memberName: new this.Foo() + }).not.toHaveNonEmptyObject('memberName'); + expect({ + memberName: {} + }).not.toHaveNonEmptyObject('memberName'); + expect({ + memberName: null + }).not.toHaveNonEmptyObject('memberName'); + }); + }); + }); +}); + +describe('toHaveNonEmptyString', function() { + describeToHaveX('toHaveNonEmptyString', function() { + describe('when subject IS a string with at least one character', function() { + it('should confirm', function() { + expect({ + memberName: ' ' + }).toHaveNonEmptyString('memberName'); + }); + }); + describe('when subject is NOT a string with at least one character', function() { + it('should deny', function() { + expect({ + memberName: '' + }).not.toHaveNonEmptyString('memberName'); + expect({ + memberName: null + }).not.toHaveNonEmptyString('memberName'); + }); + }); + }); +}); + +describe('toHaveNumber', function() { + describeToHaveX('toHaveNumber', function() { + describe('when subject IS a number', function() { + it('should confirm', function() { + expect({ + memberName: 1 + }).toHaveNumber('memberName'); + expect({ + memberName: 1.11 + }).toHaveNumber('memberName'); + expect({ + memberName: 1e3 + }).toHaveNumber('memberName'); + expect({ + memberName: 0.11 + }).toHaveNumber('memberName'); + expect({ + memberName: -11 + }).toHaveNumber('memberName'); + }); + }); + describe('when subject is NOT a number', function() { + it('should deny', function() { + expect({ + memberName: '1' + }).not.toHaveNumber('memberName'); + expect({ + memberName: NaN + }).not.toHaveNumber('memberName'); + }); + }); + }); +}); + +describe('toHaveNumberWithinRange', function() { + describeToHaveX('toHaveNumberWithinRange', function() { + describe('when subject IS a number >= floor and <= ceiling', function() { + it('should confirm', function() { + expect({ + memberName: 0 + }).toHaveNumberWithinRange('memberName', 0, 2); + expect({ + memberName: 1 + }).toHaveNumberWithinRange('memberName', 0, 2); + expect({ + memberName: 2 + }).toHaveNumberWithinRange('memberName', 0, 2); + }); + }); + describe('when subject is NOT a number >= floor and <= ceiling', function() { + it('should deny', function() { + expect({ + memberName: -3 + }).not.toHaveNumberWithinRange('memberName', 0, 2); + expect({ + memberName: -2 + }).not.toHaveNumberWithinRange('memberName', 0, 2); + expect({ + memberName: -1 + }).not.toHaveNumberWithinRange('memberName', 0, 2); + expect({ + memberName: 3 + }).not.toHaveNumberWithinRange('memberName', 0, 2); + expect({ + memberName: NaN + }).not.toHaveNumberWithinRange('memberName', 0, 2); + }); + }); + }); +}); + +describe('toHaveObject', function() { + describeToHaveX('toHaveObject', function() { + beforeEach(function() { + this.Foo = function() { }; + }); + describe('when subject IS an Object', function() { + it('should confirm', function() { + expect({ + memberName: new Object() + }).toHaveObject('memberName'); + expect({ + memberName: new this.Foo() + }).toHaveObject('memberName'); + expect({ + memberName: {} + }).toHaveObject('memberName'); + }); + }); + describe('when subject is NOT an Object', function() { + it('should deny', function() { + expect({ + memberName: null + }).not.toHaveObject('memberName'); + expect({ + memberName: 123 + }).not.toHaveObject('memberName'); + expect({ + memberName: '[object Object]' + }).not.toHaveObject('memberName'); + }); + }); + }); +}); + +describe('toHaveOddNumber', function() { + describeToHaveX('toHaveOddNumber', function() { + describe('when subject IS an odd number', function() { + it('should confirm', function() { + expect({ + memberName: 1 + }).toHaveOddNumber('memberName'); + }); + }); + describe('when subject is NOT an odd number', function() { + it('should deny', function() { + expect({ + memberName: 2 + }).not.toHaveOddNumber('memberName'); + expect({ + memberName: NaN + }).not.toHaveOddNumber('memberName'); + }); + }); + }); +}); + +describe('toHaveString', function() { + describeToHaveX('toHaveString', function() { + describe('when subject IS a string of any length', function() { + it('should confirm', function() { + expect({ + memberName: '' + }).toHaveString('memberName'); + expect({ + memberName: ' ' + }).toHaveString('memberName'); + }); + }); + describe('when subject is NOT a string of any length', function() { + it('should deny', function() { + expect({ + memberName: null + }).not.toHaveString('memberName'); + }); + }); + }); +}); + +describe('toHaveStringLongerThan', function() { + describeToHaveX('toHaveStringLongerThan', function() { + describe('when the subject and comparison ARE both strings', function() { + describe('when the subject IS longer than the comparision string', function() { + it('should confirm', function() { + expect({ + memberName: 'abc' + }).toHaveStringLongerThan('memberName', 'ab'); + expect({ + memberName: 'a' + }).toHaveStringLongerThan('memberName', ''); + }); + }); + describe('when the subject is NOT longer than the comparision string', function() { + it('should deny', function() { + expect({ + memberName: 'ab' + }).not.toHaveStringLongerThan('memberName', 'abc'); + expect({ + memberName: '' + }).not.toHaveStringLongerThan('memberName', 'a'); + }); + }); + }); + describe('when the subject and comparison are NOT both strings', function() { + it('should deny (we are asserting the relative lengths of two strings)', function() { + expect({ + memberName: 'truthy' + }).not.toHaveStringLongerThan('memberName', _undefined); + expect({ + memberName: _undefined + }).not.toHaveStringLongerThan('memberName', 'truthy'); + expect({ + memberName: '' + }).not.toHaveStringLongerThan('memberName', _undefined); + expect({ + memberName: _undefined + }).not.toHaveStringLongerThan('memberName', ''); + }); + }); + }); +}); + +describe('toHaveStringSameLengthAs', function() { + describeToHaveX('toHaveStringSameLengthAs', function() { + describe('when the subject and comparison ARE both strings', function() { + describe('when the subject IS the same length as the comparision string', function() { + it('should confirm', function() { + expect({ + memberName: 'ab' + }).toHaveStringSameLengthAs('memberName', 'ab'); + }); + }); + describe('when the subject is NOT the same length as the comparision string', function() { + it('should deny', function() { + expect({ + memberName: 'abc' + }).not.toHaveStringSameLengthAs('memberName', 'ab'); + expect({ + memberName: 'a' + }).not.toHaveStringSameLengthAs('memberName', ''); + expect({ + memberName: '' + }).not.toHaveStringSameLengthAs('memberName', 'a'); + }); + }); + }); + describe('when the subject and comparison are NOT both strings', function() { + it('should deny (we are asserting the relative lengths of two strings)', function() { + expect({ + memberName: 'truthy' + }).not.toHaveStringSameLengthAs('memberName', _undefined); + expect({ + memberName: _undefined + }).not.toHaveStringSameLengthAs('memberName', 'truthy'); + expect({ + memberName: '' + }).not.toHaveStringSameLengthAs('memberName', _undefined); + expect({ + memberName: _undefined + }).not.toHaveStringSameLengthAs('memberName', ''); + }); + }); + }); +}); + +describe('toHaveStringShorterThan', function() { + describeToHaveX('toHaveStringShorterThan', function() { + describe('when the subject and comparison ARE both strings', function() { + describe('when the subject IS shorter than the comparision string', function() { + it('should confirm', function() { + expect({ + memberName: 'ab' + }).toHaveStringShorterThan('memberName', 'abc'); + expect({ + memberName: '' + }).toHaveStringShorterThan('memberName', 'a'); + }); + }); + describe('when the subject is NOT shorter than the comparision string', function() { + it('should deny', function() { + expect({ + memberName: 'abc' + }).not.toHaveStringShorterThan('memberName', 'ab'); + expect({ + memberName: 'a' + }).not.toHaveStringShorterThan('memberName', ''); + }); + }); + }); + describe('when the subject and comparison are NOT both strings', function() { + it('should deny (we are asserting the relative lengths of two strings)', function() { + expect({ + memberName: 'truthy' + }).not.toHaveStringShorterThan('memberName', _undefined); + expect({ + memberName: _undefined + }).not.toHaveStringShorterThan('memberName', 'truthy'); + expect({ + memberName: '' + }).not.toHaveStringShorterThan('memberName', _undefined); + expect({ + memberName: _undefined + }).not.toHaveStringShorterThan('memberName', ''); + }); + }); + }); +}); + + +describe('toHaveTrue', function() { + describeToHaveBooleanX('toHaveTrue', function() { + describe('when primitive', function() { + describe('when true', function() { + it('should confirm', function() { + expect({ + memberName: true + }).toHaveTrue('memberName'); + }); + }); + describe('when false', function() { + it('should deny', function() { + expect({ + memberName: false + }).not.toHaveTrue('memberName'); + }); + }); + }); + describe('when Boolean object', function() { + describe('when true', function() { + it('should confirm', function() { + expect({ + memberName: new Boolean(true) + }).toHaveTrue('memberName'); + }); + }); + describe('when false', function() { + it('should deny', function() { + expect({ + memberName: new Boolean(false) + }).not.toHaveTrue('memberName'); + }); + }); + }); + }); +}); + +describe('toHaveWhitespaceString', function() { + describeToHaveX('toHaveWhitespaceString', function() { + describe('when subject IS a string containing only tabs, spaces, returns etc', function() { + it('should confirm', function() { + expect({ + memberName: ' ' + }).toHaveWhitespaceString('memberName'); + expect({ + memberName: '' + }).toHaveWhitespaceString('memberName'); + }); + }); + describe('when subject is NOT a string containing only tabs, spaces, returns etc', function() { + it('should deny', function() { + expect({ + memberName: 'has-no-whitespace' + }).not.toHaveWhitespaceString('memberName'); + expect({ + memberName: 'has whitespace' + }).not.toHaveWhitespaceString('memberName'); + expect({ + memberName: null + }).not.toHaveWhitespaceString('memberName'); + }); + }); + }); +}); + +describe('toHaveWholeNumber', function() { + describeToHaveX('toHaveWholeNumber', function() { + describe('when subject IS a number with no positive decimal places', function() { + it('should confirm', function() { + expect({ + memberName: 1 + }).toHaveWholeNumber('memberName'); + expect({ + memberName: 0 + }).toHaveWholeNumber('memberName'); + expect({ + memberName: 0.0 + }).toHaveWholeNumber('memberName'); + }); + }); + describe('when subject is NOT a number with no positive decimal places', function() { + it('should deny', function() { + expect({ + memberName: NaN + }).not.toHaveWholeNumber('memberName'); + expect({ + memberName: 1.1 + }).not.toHaveWholeNumber('memberName'); + expect({ + memberName: 0.1 + }).not.toHaveWholeNumber('memberName'); + }); + }); + }); +}); + +describe('toImplement', function() { + describe('when invoked', function() { + describe('when subject IS an Object containing all of the supplied members', function() { + it('should confirm', function() { + expect({ + a: 1, + b: 2 + }).toImplement({ + a: 1, + b: 2 + }); + expect({ + a: 1, + b: 2 + }).toImplement({ + a: 1 + }); + }); + }); + describe('when subject is NOT an Object containing all of the supplied members', function() { + it('should deny', function() { + expect({ + a: 1 + }).not.toImplement({ + c: 3 + }); + expect(null).not.toImplement({ + a: 1 + }); + }); + }); + }); +}); + +describe('toStartWith', function() { + describe('when invoked', function() { + describe('when subject is NOT an undefined or empty string', function() { + describe('when subject is a string whose leading characters match the expected string', function() { + it('should confirm', function() { + expect('jamie').toStartWith('jam'); + }); + }); + describe('when subject is a string whose leading characters DO NOT match the expected string', function() { + it('should deny', function() { + expect(' jamie').not.toStartWith('jam'); + expect('Jamie').not.toStartWith('jam'); + }); + }); + }); + describe('when subject IS an undefined or empty string', function() { + it('should deny', function() { + expect('').not.toStartWith(''); + expect(_undefined).not.toStartWith(''); + expect(_undefined).not.toStartWith('undefined'); + expect('undefined').not.toStartWith(_undefined); + }); + }); + }); +}); + + +describe('toThrowAnyError', function() { + describe('when supplied a function', function() { + describe('when function errors when invoked', function() { + beforeEach(function() { + this.throwError = function() { + throw new Error('wut?'); + }; + this.badReference = function() { + return badReference.someValue; + }; + }); + it('should confirm', function() { + expect(this.throwError).toThrowAnyError(); + expect(this.badReference).toThrowAnyError(); + }); + }); + describe('when function does NOT error when invoked', function() { + beforeEach(function() { + this.noErrors = function() { }; + }); + it('should deny', function() { + expect(this.noErrors).not.toThrowAnyError(); + }); + }); + }); +}); + + +describe('toThrowErrorOfType', function() { + describe('when supplied a function', function() { + describe('when function errors when invoked', function() { + beforeEach(function() { + this.throwError = function() { + throw new Error('wut?'); + }; + this.badReference = function() { + return badReference.someValue; + }; + }); + describe('when the error is of the expected type', function() { + it('should confirm', function() { + expect(this.throwError).toThrowErrorOfType('Error'); + expect(this.badReference).toThrowErrorOfType('ReferenceError'); + }); + }); + describe('when the error is NOT of the expected type', function() { + it('should confirm', function() { + expect(this.throwError).not.toThrowErrorOfType('ReferenceError'); + expect(this.badReference).not.toThrowErrorOfType('Error'); + }); + }); + }); + }); +}); diff --git a/jasmine-expect/jasmine-expect.d.ts b/jasmine-expect/jasmine-expect.d.ts new file mode 100644 index 000000000..fe6238078 --- /dev/null +++ b/jasmine-expect/jasmine-expect.d.ts @@ -0,0 +1,92 @@ +// Type definitions for jasmine-expect 2.0.0-beta2 +// Project: https://github.com/JamieMason/Jasmine-Matchers +// Definitions by: UserPixel +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module jasmine { + interface Matchers { + // These functions are written in the order defined in the src directory of jasmine-matchers + // The type system is used smartly whenever it can provide value (by looking at the code of every matcher) + toBeAfter(otherDate: Date): boolean; // + toBeArray(): boolean; // + toBeArrayOfBooleans(): boolean; // + toBeArrayOfNumbers(): boolean; + toBeArrayOfObjects(): boolean; + toBeArrayOfSize(size: number): boolean; + toBeArrayOfStrings(): boolean; + toBeBefore(otherDate: Date): boolean; // + toBeBoolean(): boolean; + toBeCalculable(): boolean; + toBeDate(): boolean; + toBeEmptyArray(): boolean; + toBeEmptyObject(): boolean; + toBeEmptyString(): boolean; + toBeEvenNumber(): boolean; + toBeFalse(): boolean; + toBeFunction(): boolean; + toBeHtmlString(): boolean; + toBeIso8601(): boolean; + toBeJsonString(): boolean; + toBeLongerThan(other: string): boolean; + toBeNonEmptyArray(): boolean; + toBeNonEmptyObject(): boolean; + toBeNonEmptyString(): boolean; + toBeNumber(): boolean; + toBeObject(): boolean; + toBeOddNumber(): boolean; + toBeSameLengthAs(other: string): boolean; + toBeShorterThan(other: string): boolean; + toBeString(): boolean; + toBeTrue(): boolean; + toBeWhitespace(): boolean; + toBeWholeNumber(): boolean; + toBeWithinRange(floor: number, ceiling: number): boolean; + + toEndWith(subString: string): boolean; + + toHaveArray(key: string): boolean; + toHaveArrayOfBooleans(key: string): boolean; + toHaveArrayOfNumbers(key: string): boolean; + toHaveArrayOfObjects(key: string): boolean; + toHaveArrayOfSize(key: string, size?: number): boolean; + toHaveArrayOfStrings(key: string): boolean; + toHaveBoolean(key: string): boolean; + toHaveCalculable(key: string): boolean; + toHaveDate(key: string): boolean; + toHaveDateAfter(key: string, otherDate: Date): boolean; + toHaveDateBefore(key: string, otherDate: Date): boolean; + toHaveEmptyArray(key: string): boolean; + toHaveEmptyObject(key: string): boolean; + toHaveEmptyString(key: string): boolean; + toHaveEvenNumber(key: string): boolean; + toHaveFalse(key: string): boolean; + toHaveHtmlString(key: string): boolean; + toHaveIso8601(key: string): boolean; + toHaveJsonString(key: string): boolean; + toHaveMember(key: string): boolean; + toHaveMethod(key: string): boolean; + toHaveNonEmptyArray(key: string): boolean; + toHaveNonEmptyObject(key: string): boolean; + toHaveNonEmptyString(key: string): boolean; + toHaveNumber(key: string): boolean; + toHaveNumberWithinRange(key: string, floor: number, ceiling: number): boolean; + toHaveObject(key: string): boolean; + toHaveOddNumber(key: string): boolean; + toHaveString(key: string): boolean; + toHaveStringLongerThan(key: string, other: string): boolean; + toHaveStringSameLengthAs(key: string, other: string): boolean; + toHaveStringShorterThan(key: string, other: string): boolean; + toHaveTrue(key: string): boolean; + toHaveWhitespaceString(key: string): boolean; + toHaveWholeNumber(key: string): boolean; + + toImplement(api: {}): boolean; + + toStartWith(subString: string): boolean; + + toThrowAnyError(): boolean; + toThrowErrorOfType(type: string): boolean; + } +} diff --git a/jasmine-matchers/jasmine-matchers-tests.ts b/jasmine-matchers/jasmine-matchers-tests.ts index d1cbc0f90..f281b4a83 100644 --- a/jasmine-matchers/jasmine-matchers-tests.ts +++ b/jasmine-matchers/jasmine-matchers-tests.ts @@ -27,8 +27,8 @@ describe('toBeArray', function () { }); it('should pass for [1,"",{}]', function () { expect([ - 1, - "", + 1, + "", { } ]).toBeArray(); @@ -115,13 +115,13 @@ describe('toBeOneOf', function () { describe('matches', function () { it('should find "a" in ["a", "b"]', function () { expect('a').toBeOneOf([ - 'a', + 'a', 'b' ]); }); it('should find "uxebu" in ["company", "uxebu"]', function () { expect('uxebu').toBeOneOf([ - 'company', + 'company', 'uxebu' ]); }); @@ -129,30 +129,30 @@ describe('toBeOneOf', function () { describe('non-matches', function () { it('should not find "" in [" ", "0"]', function () { expect('').not.toBeOneOf([ - ' ', + ' ', '0' ]); }); it('should not find "a" in ["b", "c"]', function () { expect('a').not.toBeOneOf([ - 'b', + 'b', 'c' ]); }); }); }); describe('toBeCloseToOneOf', function () { - function oneDigitOff(actual, expected) { + function oneDigitOff(actual: any, expected: any) { var actualInt = parseInt(actual, 10); return actualInt - 1 <= expected && actualInt + 1 >= expected; } - function tenPercentOff(actual, expected) { + function tenPercentOff(actual: any, expected: any) { return expected * 0.9 <= actual && expected * 1.1 >= actual; } - function oneDigitOrTenPercentOff(actual, expected) { + function oneDigitOrTenPercentOff(actual: any, expected: any) { return oneDigitOff(actual, expected) || tenPercentOff(actual, expected); } - function twoDecimalsOff(actual, expected) { + function twoDecimalsOff(actual: any, expected: any) { var lower = ((expected * 100) - 2) / 100; var upper = ((expected * 100) + 2) / 100; return lower <= actual && upper >= actual; @@ -160,25 +160,25 @@ describe('toBeCloseToOneOf', function () { describe('matches', function () { it('should say 7 is close to one of [8, 9]', function () { expect(7).toBeCloseToOneOf([ - 8, + 8, 9 ], oneDigitOff); }); it('should say 2 is 10% off of one of [2.2, 1.0]', function () { expect(2).toBeCloseToOneOf([ - 2.2, + 2.2, 1.0 ], tenPercentOff); }); it('should say 7 is close to one of [8, 9]', function () { expect(7).toBeCloseToOneOf([ - 8, + 8, 9 ], oneDigitOrTenPercentOff); }); it('should say 1.345 two decimals off of [1.325, 1.365]', function () { expect(1.345).toBeCloseToOneOf([ - 1.325, + 1.325, 1.365 ], twoDecimalsOff); }); @@ -186,26 +186,26 @@ describe('toBeCloseToOneOf', function () { describe('non-matches', function () { it('should say 7 is NOT one off of [9, 10, 11]', function () { expect(7).not.toBeCloseToOneOf([ - 9, - 10, + 9, + 10, 11 ], oneDigitOff); }); it('should say 1 is close to one of [8, 9]', function () { expect(1).not.toBeCloseToOneOf([ - 8, + 8, 9 ], oneDigitOrTenPercentOff); }); it('should say 1.9 is NOT 10% off of one of [2.2, 1.0]', function () { expect(1.9).not.toBeCloseToOneOf([ - 2.2, + 2.2, 1.0 ], tenPercentOff); }); it('should say 1.345 two decimals off of [1.325, 1.365]', function () { expect(1.304).not.toBeCloseToOneOf([ - 1.325, + 1.325, 1.365 ], twoDecimalsOff); }); @@ -216,7 +216,7 @@ describe('toContainOnce', function () { describe('matches', function () { it('should work for arrays', function () { expect([ - 1, + 1, 2 ]).toContainOnce(1); }); @@ -227,7 +227,7 @@ describe('toContainOnce', function () { describe('non-matches', function () { it('should work for arrays', function () { expect([ - 1, + 1, 2 ]).not.toContainOnce(3); }); @@ -257,7 +257,7 @@ describe('toHaveLength', function () { describe('toHaveProperties', function () { describe('matches', function () { it('should work for `{x:0, y:undefined}`', function () { - var obj = { + var obj: any = { x: 0, y: undefined }; @@ -268,7 +268,7 @@ describe('toHaveProperties', function () { describe('toHavePropertiesWithValues', function () { describe('matches', function () { it('should work with a reference object', function () { - function C() { + var C: any = function C() { this.x = 0; } C.prototype.y = 'arbitrary'; @@ -283,7 +283,7 @@ describe('toHavePropertiesWithValues', function () { describe('toHaveOwnProperties', function () { describe('matches', function () { it('should work for `{x:0, y:undefined}`', function () { - var obj = { + var obj: any = { x: 0, y: undefined }; @@ -322,14 +322,14 @@ describe('toHaveBeenCalledXTimes', function () { describe('toExactlyHaveProperties', function () { describe('matches', function () { it('should work for `{x:0, y:undefined}`', function () { - var obj = { + var obj: any = { x: 0, y: undefined }; expect(obj).toExactlyHaveProperties('x', 'y'); }); it('should work in any order', function () { - var obj = { + var obj: any = { x: 0, y: undefined }; @@ -338,14 +338,14 @@ describe('toExactlyHaveProperties', function () { }); describe('non-matches', function () { it('should work for too many properties', function () { - var obj = { + var obj: any = { x: 0, y: undefined }; expect(obj).not.toExactlyHaveProperties('x'); }); it('should work for missing properties', function () { - var obj = { + var obj: any = { x: 0, y: undefined }; @@ -375,17 +375,17 @@ describe('toEndWith', function () { describe('matches', function () { it('should work for string', function () { expect([ - '1', + '1', '2' ]).toEndWith('2'); }); it('should work for array', function () { expect([ - 3, - 4, + 3, + 4, 5 ]).toEndWith([ - 4, + 4, 5 ]); }); @@ -393,17 +393,17 @@ describe('toEndWith', function () { describe('non-matches', function () { it('should work for string', function () { expect([ - '1', + '1', '2' ]).not.toEndWith('3'); }); it('should work for array', function () { expect([ - 3, - 4, + 3, + 4, 5 ]).not.toEndWith([ - 3, + 3, 4 ]); }); @@ -419,8 +419,8 @@ describe('toEachEndWith', function () { }); it('should work for array with multiple elements', function () { expect([ - 'one', - 'zwee', + 'one', + 'zwee', 'three' ]).toEachEndWith('e'); }); @@ -433,8 +433,8 @@ describe('toEachEndWith', function () { }); it('should work for array with multiple elements', function () { expect([ - 'one', - 'zwei', + 'one', + 'zwei', 'three' ]).not.toEachEndWith('e'); }); @@ -449,8 +449,8 @@ describe('toSomeEndWith', function () { }); it('should work for array with multiple elements', function () { expect([ - 'one', - 'zwee', + 'one', + 'zwee', 'three' ]).toSomeEndWith('ee'); }); @@ -463,8 +463,8 @@ describe('toSomeEndWith', function () { }); it('should work for array with multiple elements', function () { expect([ - 'one', - 'zwei', + 'one', + 'zwei', 'three' ]).not.toSomeEndWith('a'); }); @@ -491,17 +491,17 @@ describe('toStartWith', function () { describe('matches', function () { it('should work for string', function () { expect([ - '1', + '1', '2' ]).toStartWith('1'); }); it('should work for array', function () { expect([ - 3, - 4, + 3, + 4, 5 ]).toStartWith([ - 3, + 3, 4 ]); }); @@ -509,17 +509,17 @@ describe('toStartWith', function () { describe('non-matches', function () { it('should work for string', function () { expect([ - '1', + '1', '2' ]).not.toStartWith('3'); }); it('should work for array', function () { expect([ - 3, - 4, + 3, + 4, 5 ]).not.toStartWith([ - 4, + 4, 5 ]); }); @@ -535,8 +535,8 @@ describe('toEachStartWith', function () { }); it('should work for array with multiple elements', function () { expect([ - 'one', - 'onetwo', + 'one', + 'onetwo', 'onethree' ]).toEachStartWith('o'); }); @@ -549,8 +549,8 @@ describe('toEachStartWith', function () { }); it('should work for array with multiple elements', function () { expect([ - 'one', - 'two', + 'one', + 'two', 'onethree' ]).not.toEachStartWith('o'); }); @@ -565,8 +565,8 @@ describe('toSomeStartWith', function () { }); it('should work for array with multiple elements', function () { expect([ - 'one', - 'onetwo', + 'one', + 'onetwo', 'three' ]).toSomeStartWith('one'); }); @@ -579,8 +579,8 @@ describe('toSomeStartWith', function () { }); it('should work for array with multiple elements', function () { expect([ - 'one', - 'two', + 'one', + 'two', 'onethree' ]).not.toSomeStartWith('a'); }); @@ -610,19 +610,19 @@ describe('toStartWithEither', function () { describe('matches', function () { it('should work for string', function () { expect([ - '1', + '1', '2' ]).toStartWithEither('1', '2'); }); it('should work for array', function () { expect([ - 3, - 4, + 3, + 4, 5 ]).toStartWithEither([ 4 ], [ - 3, + 3, 4 ]); }); @@ -630,20 +630,20 @@ describe('toStartWithEither', function () { describe('non-matches', function () { it('should work for string', function () { expect([ - '1', + '1', '2' ]).not.toStartWithEither('3'); }); it('should work for array', function () { expect([ - 3, - 4, + 3, + 4, 5 ]).not.toStartWithEither([ - 5, + 5, 6 ], [ - 4, + 4, 5 ]); }); diff --git a/jasmine-matchers/jasmine-matchers-tests.ts.tscparams b/jasmine-matchers/jasmine-matchers-tests.ts.tscparams deleted file mode 100644 index d3f5a12fa..000000000 --- a/jasmine-matchers/jasmine-matchers-tests.ts.tscparams +++ /dev/null @@ -1 +0,0 @@ - diff --git a/jasmine/jasmine-tests.ts b/jasmine/jasmine-tests.ts index 9f57219b8..2e8e55a45 100644 --- a/jasmine/jasmine-tests.ts +++ b/jasmine/jasmine-tests.ts @@ -813,7 +813,7 @@ var customMatchers: jasmine.CustomMatcherFactories = { if (expected === undefined) { expected = ''; } - var result: jasmine.CustomMatcherResult = { pass: false, message: ''}; + var result: jasmine.CustomMatcherResult = { pass: false }; result.pass = util.equals(actual.hyuk, "gawrsh" + expected, customEqualityTesters); diff --git a/jasmine/jasmine.d.ts b/jasmine/jasmine.d.ts index 184875fa2..ed8591488 100644 --- a/jasmine/jasmine.d.ts +++ b/jasmine/jasmine.d.ts @@ -129,7 +129,7 @@ declare module jasmine { interface CustomMatcherResult { pass: boolean; - message: string; + message?: string; } interface MatchersUtil { diff --git a/jquery.colorbox/jquery.colorbox.d.ts b/jquery.colorbox/jquery.colorbox.d.ts index e13b0bbd5..cc34635a7 100644 --- a/jquery.colorbox/jquery.colorbox.d.ts +++ b/jquery.colorbox/jquery.colorbox.d.ts @@ -106,6 +106,10 @@ interface ColorboxSettings { */ close?: string; /** + * Set to false to remove the close button. + */ + closeButton?: boolean; + /** * Error message given when ajax content for a given URL cannot be loaded. */ xhrError?: string; diff --git a/jquery.gridster/gridster-tests.ts b/jquery.gridster/gridster-tests.ts index 3672c9555..99edbb9a8 100644 --- a/jquery.gridster/gridster-tests.ts +++ b/jquery.gridster/gridster-tests.ts @@ -13,10 +13,67 @@ var options: GridsterOptions = { x: wgd.row, y: wgd.col }; - } + }, + widget_base_dimensions: [100, 100] }; var gridster: Gridster = $('.gridster ul').gridster(options).data('gridster'); gridster.add_widget('
  • The HTML of the widget...
  • ', 2, 1); gridster.remove_widget($('gridster li').eq(3).get(0)); var json = gridster.serialize(); + +var coords: GridsterCoords = gridster.get_highest_occupied_cell(); +var position = coords.col + coords.row; + +options.widget_base_dimensions = [100, 200]; +gridster.resize_widget_dimensions(options); + +gridster.set_widget_min_size(0, [1, 2]); + +function noOptions() { + var grid: Gridster = $('.gridster ul').gridster().data('gridster') +} + +function widgetSelectorHTMLElements() { + var opts: GridsterOptions = { + widget_selector: $('.gridster ul li').get() + }; + + var grid: Gridster = $('.gridster ul').gridster(opts).data('gridster') +} + +function widgetSelectorString() { + var opts: GridsterOptions = { + widget_selector: '.gridster ul li' + }; + + var grid: Gridster = $('.gridster ul').gridster(opts).data('gridster') +} + +function withNamespace() { + var grid: Gridster = $('.gridster ul').gridster({ + namespace: 'custom-gridster' + }).data('gridster') +} + +function withStylesheet() { + var grid: Gridster = $('.gridster ul').gridster({ + autogenerate_stylesheet: false + }).data('gridster') +} + +function withResize() { + var grid: Gridster = $('.gridster ul').gridster({ + resize: { + enabled: true, + axes: ['both'], + handle_append_to: 'li .handle-container', + handle_class: '.handle', + max_size: [5, 5], + min_size: [1, 1], + resize: (event: Event, ui: GridsterUi, $el: JQuery) => {}, + start: (event: Event, ui: { helper: JQuery; }, $el: JQuery) => {}, + stop: (event: Event, ui: { helper: JQuery; }, $el: JQuery) => {}, + } + }).data('gridster') +} diff --git a/jquery.gridster/gridster.d.ts b/jquery.gridster/gridster.d.ts index e003f0ebc..89448b4c3 100644 --- a/jquery.gridster/gridster.d.ts +++ b/jquery.gridster/gridster.d.ts @@ -1,4 +1,4 @@ -// Type definitions for jQuery.gridster 0.1.0 +// Type definitions for jQuery.gridster 0.5.6 // Project: https://github.com/jbaldwin/gridster // Definitions by: Josh Baldwin // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -32,13 +32,26 @@ OTHER DEALINGS IN THE SOFTWARE. /// interface GridsterDraggable { - items: any; - distance: number; - limit: boolean; - offset_left: number; - drag: (event: Event, ui: GridsterUi) => void; - start: (event: Event, ui: { helper: JQuery; }) => void; - stop: (event: Event, ui: { helper: JQuery; }) => void; + items?: any; + distance?: number; + limit?: boolean; + offset_left?: number; + handle?: string; + drag?: (event: Event, ui: GridsterUi) => void; + start?: (event: Event, ui: { helper: JQuery; }) => void; + stop?: (event: Event, ui: { helper: JQuery; }) => void; +} + +interface GridsterResizable { + enabled?: boolean; + axes?: string[]; + handle_append_to?: string; + handle_class?: string; + max_size?: number[]; + min_size?: number[]; + resize?: (event: Event, ui: GridsterUi, $el: JQuery) => void; + start?: (event: Event, ui: { helper: JQuery; }, $el: JQuery) => void; + stop?: (event: Event, ui: { helper: JQuery; }, $el: JQuery) => void; } interface GridsterUi { @@ -78,7 +91,7 @@ interface GridsterOptions { * Type => HTMLElement[] * Default = 'li' **/ - widget_selector?: any; + widget_selector?: string|HTMLElement[]; /** * Margin between widgets. The first index for the horizontal margin (left, right) and the second for the vertical margin (top, bottom). @@ -154,6 +167,21 @@ interface GridsterOptions { * An object with all options for Draggable class you want to overwrite. @see GridsterDraggable or docs for more info. **/ draggable?: GridsterDraggable; + + /** + * A string to differentiate one gridster from another + **/ + namespace?: string; + + /** + * A boolean to specify if the stylesheet should be generated or not + **/ + autogenerate_stylesheet?: boolean; + + /** + * An object with all options for Resizable class you want to overwrite. @see GridsterResizable or docs for more info. + **/ + resize?: GridsterResizable; } interface JQuery { @@ -189,6 +217,12 @@ interface Gridster { **/ add_widget(html: JQuery, size_x?: number, size_y?: number, col?: number, row?: number): JQuery; + /** + * Get the highest occupied cell. + * @return Returns the farthest position {row: number, col: number} occupied in the grid. + **/ + get_highest_occupied_cell(): GridsterCoords; + /** * Change the size of a widget. * @param $widget The jQuery wrapped HTMLElement that represents the widget is going to be resized. @@ -199,6 +233,14 @@ interface Gridster { **/ resize_widget($widget: JQuery, size_x?: number, size_y?: number, callback?: (size_x: number, size_y: number) => void): JQuery; + + /** + * Resize all the widgets in the grid. + * @param options The options to use to resize the widgets. + * @return Returns the instance of the Gridster class. + **/ + resize_widget_dimensions(options: GridsterOptions): Gridster; + /** * Remove a widget from the grid. * @param el The jQuery wrapped HTMLElement you want to remove. @@ -223,6 +265,14 @@ interface Gridster { **/ remove_widget(el: JQuery, callback: (el: HTMLElement) => void): Gridster; + /** + * Resize a widget in the grid. + * @param widget The index of the widget to be resized. + * @param size An array representing the size (x, y) to set on the widget. + * @return Returns the instance of the Gridster class. + **/ + set_widget_min_size(widget: number, size: number[]): Gridster; + /** * Returns a serialized array of the widgets in the grid. * @param $widgets The collection of jQuery wrap ed HTMLElements you want to serialize. If no argument is passed a l widgets will be serialized. @@ -247,4 +297,10 @@ interface Gridster { * @return Returns the instance of the Gridster class. **/ disable(): Gridster; + + /** + * Returns the options used to initialize the grid + * @return Returns the options used to initialize the grid + **/ + options: GridsterOptions; } diff --git a/jquery/jquery-tests.ts b/jquery/jquery-tests.ts index 62cd273f4..27eea1c81 100644 --- a/jquery/jquery-tests.ts +++ b/jquery/jquery-tests.ts @@ -3128,6 +3128,7 @@ function test_val() { $("#single").val("Single2"); $("#multiple").val(["Multiple2", "Multiple3"]); $("input").val(["check1", "check2", "radio1"]); + $("input").val(1); } function test_selector() { diff --git a/jquery/jquery.d.ts b/jquery/jquery.d.ts index 8401753e3..29b7697b2 100644 --- a/jquery/jquery.d.ts +++ b/jquery/jquery.d.ts @@ -1363,9 +1363,9 @@ interface JQuery { /** * Set the value of each element in the set of matched elements. * - * @param value A string of text or an array of strings corresponding to the value of each matched element to set as selected/checked. + * @param value A string of text, an array of strings or number corresponding to the value of each matched element to set as selected/checked. */ - val(value: string|string[]): JQuery; + val(value: string|string[]|number): JQuery; /** * Set the value of each element in the set of matched elements. * diff --git a/jqueryui/jqueryui.d.ts b/jqueryui/jqueryui.d.ts index a49a779e2..d9a33ed4f 100644 --- a/jqueryui/jqueryui.d.ts +++ b/jqueryui/jqueryui.d.ts @@ -590,6 +590,7 @@ declare module JQueryUI { resize?: ResizableEvent; start?: ResizableEvent; stop?: ResizableEvent; + create?: ResizableEvents; } interface Resizable extends Widget, ResizableOptions { diff --git a/js-combinatorics/js-combinatorics-global-tests.ts b/js-combinatorics/js-combinatorics-global-tests.ts new file mode 100644 index 000000000..e8591fbc2 --- /dev/null +++ b/js-combinatorics/js-combinatorics-global-tests.ts @@ -0,0 +1,99 @@ +/// + +const p:number = Combinatorics.P(1, 2); +const c:number = Combinatorics.C(1, 2); +const factorial:number = Combinatorics.factorial(5); +const factoradic:number[] = Combinatorics.factoradic(5); + +const power = Combinatorics.power(["a", "b", "c"]); +const nextPower:string[] = power.next(); +power.forEach((i:string[]) => console.log(i)); +const powersLengths:number[] = power.map((i:string[]) => i.length); +const filteredPowers:string[][] = power.filter((i:string[]) => i.length > 0); +const allPowers:string[][] = power.toArray(); +const powersCount = power.length; +const nthPower:string[] = power.nth(3); + +const limitedCombination = Combinatorics.combination(["a", "b", "c"], 2); +const combination = Combinatorics.combination(["a", "b", "c"]); +const nextCombination:string[] = combination.next(); +combination.forEach((i:string[]) => console.log(i)); +const combinationsLengths:number[] = combination.map((i:string[]) => i.length); +const filteredCombinations:string[][] = combination.filter((i:string[]) => i.length > 0); +const allCombinations:string[][] = combination.toArray(); +const combinationsCount = combination.length; + +const limitedPermutation = Combinatorics.permutation(["a", "b", "c"], 2); +const permutation = Combinatorics.permutation(["a", "b", "c"]); +const nextPermutation:string[] = permutation.next(); +permutation.forEach((i:string[]) => console.log(i)); +const permutationsLengths:number[] = permutation.map((i:string[]) => i.length); +const filteredPermutations:string[][] = permutation.filter((i:string[]) => i.length > 0); +const allPermutations:string[][] = permutation.toArray(); +const permutationsCount = permutation.length; + +const permutationCombination = Combinatorics.permutationCombination(["a", "b", "c"]); +const nextPermutationCombinations:string[] = permutationCombination.next(); +permutationCombination.forEach((i:string[]) => console.log(i)); +const permutationCombinationsLengths:number[] = permutationCombination.map((i:string[]) => i.length); +const filteredPermutationCombinationss:string[][] = permutationCombination.filter((i:string[]) => i.length > 0); +const allPermutationCombinationss:string[][] = permutationCombination.toArray(); +const permutationCombinationsCount = permutationCombination.length; + +const limitedBaseN = Combinatorics.baseN(["a", "b", "c"], 2); +const baseN = Combinatorics.baseN(["a", "b", "c"]); +const nextbaseN:string[] = baseN.next(); +baseN.forEach((i:string[]) => console.log(i)); +const baseNsLengths:number[] = baseN.map((i:string[]) => i.length); +const filteredbaseNs:string[][] = baseN.filter((i:string[]) => i.length > 0); +const allbaseNs:string[][] = baseN.toArray(); +const baseNsCount = baseN.length; +const nthbaseN:string[] = baseN.nth(3); + +const cartesianProduct1 = Combinatorics.cartesianProduct(["a", "b", "c"]); +const nextCartesianProduct1:[string] = cartesianProduct1.next(); +const nextCartesianProduct1Char = nextCartesianProduct1[0].substr(0, 1); +cartesianProduct1.forEach((i:[string]) => console.log(i)); +const cartesianProduct1sLengths:number[] = cartesianProduct1.map((i:[string]) => i.length); +const filteredCartesianProduct1s:[string][] = cartesianProduct1.filter((i:[string]) => i.length > 0); +const allCartesianProduct1s:[string][] = cartesianProduct1.toArray(); +const cartesianProduct1sCount = cartesianProduct1.length; +const nthCartesianProduct1:[string] = cartesianProduct1.nth(3); +const cartesianProduct1ByCoords:[string] = cartesianProduct1.get(1); + +const cartesianProduct2 = Combinatorics.cartesianProduct(["a", "b", "c"], [1, 2, 3]); +const nextCartesianProduct2:[string, number] = cartesianProduct2.next(); +const nextCartesianProduct2Char = nextCartesianProduct2[0].substr(0, 1); +const nextCartesianProduct2Num = nextCartesianProduct2[1].toFixed(2); +cartesianProduct2.forEach((i:[string, number]) => console.log(i)); +const cartesianProduct2sLengths:number[] = cartesianProduct2.map((i:[string, number]) => i.length); +const filteredCartesianProduct2s:[string, number][] = cartesianProduct2.filter((i:[string, number]) => i.length > 0); +const allCartesianProduct2s:[string, number][] = cartesianProduct2.toArray(); +const cartesianProduct2sCount = cartesianProduct2.length; +const nthCartesianProduct2:[string, number] = cartesianProduct2.nth(3); +const cartesianProduct2ByCoords:[string, number] = cartesianProduct2.get(1, 1); + +const cartesianProduct3 = Combinatorics.cartesianProduct(["a", "b", "c"], [1, 2, 3], [true, false]); +const nextCartesianProduct3:[string, number, boolean] = cartesianProduct3.next(); +const nextCartesianProduct3Char = nextCartesianProduct3[0].substr(0, 1); +const nextCartesianProduct3Num = nextCartesianProduct3[1].toFixed(2); +const nextCartesianProduct4Cond = nextCartesianProduct3[2] === true; +cartesianProduct3.forEach((i:[string, number, boolean]) => console.log(i)); +const cartesianProduct3sLengths:number[] = cartesianProduct3.map((i:[string, number, boolean]) => i.length); +const filteredCartesianProduct3s:[string, number, boolean][] = cartesianProduct3.filter((i:[string, number, boolean]) => i.length > 0); +const allCartesianProduct3s:[string, number, boolean][] = cartesianProduct3.toArray(); +const cartesianProduct3sCount = cartesianProduct3.length; +const nthCartesianProduct3:[string, number, boolean] = cartesianProduct3.nth(3); +const cartesianProduct3ByCoords:[string, number, boolean] = cartesianProduct3.get(1, 1); + +const cartesianProductAny = Combinatorics.cartesianProduct(["a", 1, true], [false, 2, "b"]); +const nextCartesianProductAny:any[] = cartesianProductAny.next(); +cartesianProductAny.forEach((i:any[]) => console.log(i)); +const cartesianProductAnysLengths:number[] = cartesianProductAny.map((i:any[]) => i.length); +const filteredCartesianProductAnys:any[][] = cartesianProductAny.filter((i:any[]) => i.length > 0); +const allCartesianProductAnys:any[][] = cartesianProductAny.toArray(); +const cartesianProductAnysCount = cartesianProductAny.length; +const nthCartesianProductAny:any[] = cartesianProductAny.nth(3); +const cartesianProductAnyByCoords:any[] = cartesianProductAny.get(1, 1); + +const version:string = Combinatorics.VERSION; diff --git a/js-combinatorics/js-combinatorics-global.d.ts b/js-combinatorics/js-combinatorics-global.d.ts new file mode 100644 index 000000000..20c302981 --- /dev/null +++ b/js-combinatorics/js-combinatorics-global.d.ts @@ -0,0 +1,8 @@ +// Type definitions for js-combinatorics v0.5.0 (global) +// Project: https://github.com/dankogai/js-combinatorics +// Definitions by: Vasya Aksyonov +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +import Combinatorics = __Combinatorics; diff --git a/js-combinatorics/js-combinatorics-tests.ts b/js-combinatorics/js-combinatorics-tests.ts new file mode 100644 index 000000000..08e04c374 --- /dev/null +++ b/js-combinatorics/js-combinatorics-tests.ts @@ -0,0 +1,95 @@ +/// + +import * as Combinatorics from "js-combinatorics"; + +const p:number = Combinatorics.P(1, 2); +const c:number = Combinatorics.C(1, 2); +const factorial:number = Combinatorics.factorial(5); +const factoradic:number[] = Combinatorics.factoradic(5); + +const power = Combinatorics.power(["a", "b", "c"]); +const nextPower:string[] = power.next(); +power.forEach((i:string[]) => console.log(i)); +const powersLengths:number[] = power.map((i:string[]) => i.length); +const filteredPowers:string[][] = power.filter((i:string[]) => i.length > 0); +const allPowers:string[][] = power.toArray(); +const powersCount = power.length; +const nthPower:string[] = power.nth(3); + +const limitedCombination = Combinatorics.combination(["a", "b", "c"], 2); +const combination = Combinatorics.combination(["a", "b", "c"]); +const nextCombination:string[] = combination.next(); +combination.forEach((i:string[]) => console.log(i)); +const combinationsLengths:number[] = combination.map((i:string[]) => i.length); +const filteredCombinations:string[][] = combination.filter((i:string[]) => i.length > 0); +const allCombinations:string[][] = combination.toArray(); +const combinationsCount = combination.length; + +const limitedPermutation = Combinatorics.permutation(["a", "b", "c"], 2); +const permutation = Combinatorics.permutation(["a", "b", "c"]); +const nextPermutation:string[] = permutation.next(); +permutation.forEach((i:string[]) => console.log(i)); +const permutationsLengths:number[] = permutation.map((i:string[]) => i.length); +const filteredPermutations:string[][] = permutation.filter((i:string[]) => i.length > 0); +const allPermutations:string[][] = permutation.toArray(); +const permutationsCount = permutation.length; + +const permutationCombination = Combinatorics.permutationCombination(["a", "b", "c"]); +const nextPermutationCombinations:string[] = permutationCombination.next(); +permutationCombination.forEach((i:string[]) => console.log(i)); +const permutationCombinationsLengths:number[] = permutationCombination.map((i:string[]) => i.length); +const filteredPermutationCombinationss:string[][] = permutationCombination.filter((i:string[]) => i.length > 0); +const allPermutationCombinationss:string[][] = permutationCombination.toArray(); +const permutationCombinationsCount = permutationCombination.length; + +const limitedBaseN = Combinatorics.baseN(["a", "b", "c"], 2); +const baseN = Combinatorics.baseN(["a", "b", "c"]); +const nextbaseN:string[] = baseN.next(); +baseN.forEach((i:string[]) => console.log(i)); +const baseNsLengths:number[] = baseN.map((i:string[]) => i.length); +const filteredbaseNs:string[][] = baseN.filter((i:string[]) => i.length > 0); +const allbaseNs:string[][] = baseN.toArray(); +const baseNsCount = baseN.length; +const nthbaseN:string[] = baseN.nth(3); + +const cartesianProduct1 = Combinatorics.cartesianProduct(["a", "b", "c"]); +const nextCartesianProduct1:[string] = cartesianProduct1.next(); +cartesianProduct1.forEach((i:[string]) => console.log(i)); +const cartesianProduct1sLengths:number[] = cartesianProduct1.map((i:[string]) => i.length); +const filteredCartesianProduct1s:[string][] = cartesianProduct1.filter((i:[string]) => i.length > 0); +const allCartesianProduct1s:[string][] = cartesianProduct1.toArray(); +const cartesianProduct1sCount = cartesianProduct1.length; +const nthCartesianProduct1:[string] = cartesianProduct1.nth(3); +const cartesianProduct1ByCoords:[string] = cartesianProduct1.get(1); + +const cartesianProduct2 = Combinatorics.cartesianProduct(["a", "b", "c"], [1, 2, 3]); +const nextCartesianProduct2:[string, number] = cartesianProduct2.next(); +cartesianProduct2.forEach((i:[string, number]) => console.log(i)); +const cartesianProduct2sLengths:number[] = cartesianProduct2.map((i:[string, number]) => i.length); +const filteredCartesianProduct2s:[string, number][] = cartesianProduct2.filter((i:[string, number]) => i.length > 0); +const allCartesianProduct2s:[string, number][] = cartesianProduct2.toArray(); +const cartesianProduct2sCount = cartesianProduct2.length; +const nthCartesianProduct2:[string, number] = cartesianProduct2.nth(3); +const cartesianProduct2ByCoords:[string, number] = cartesianProduct2.get(1, 1); + +const cartesianProduct3 = Combinatorics.cartesianProduct(["a", "b", "c"], [1, 2, 3], [true, false]); +const nextCartesianProduct3:[string, number, boolean] = cartesianProduct3.next(); +cartesianProduct3.forEach((i:[string, number, boolean]) => console.log(i)); +const cartesianProduct3sLengths:number[] = cartesianProduct3.map((i:[string, number, boolean]) => i.length); +const filteredCartesianProduct3s:[string, number, boolean][] = cartesianProduct3.filter((i:[string, number, boolean]) => i.length > 0); +const allCartesianProduct3s:[string, number, boolean][] = cartesianProduct3.toArray(); +const cartesianProduct3sCount = cartesianProduct3.length; +const nthCartesianProduct3:[string, number, boolean] = cartesianProduct3.nth(3); +const cartesianProduct3ByCoords:[string, number, boolean] = cartesianProduct3.get(1, 1); + +const cartesianProductAny = Combinatorics.cartesianProduct(["a", 1, true], [false, 2, "b"]); +const nextCartesianProductAny:any[] = cartesianProductAny.next(); +cartesianProductAny.forEach((i:any[]) => console.log(i)); +const cartesianProductAnysLengths:number[] = cartesianProductAny.map((i:any[]) => i.length); +const filteredCartesianProductAnys:any[][] = cartesianProductAny.filter((i:any[]) => i.length > 0); +const allCartesianProductAnys:any[][] = cartesianProductAny.toArray(); +const cartesianProductAnysCount = cartesianProductAny.length; +const nthCartesianProductAny:any[] = cartesianProductAny.nth(3); +const cartesianProductAnyByCoords:any[] = cartesianProductAny.get(1, 1); + +const version:string = Combinatorics.VERSION; diff --git a/js-combinatorics/js-combinatorics.d.ts b/js-combinatorics/js-combinatorics.d.ts new file mode 100644 index 000000000..270e98b64 --- /dev/null +++ b/js-combinatorics/js-combinatorics.d.ts @@ -0,0 +1,135 @@ +// Type definitions for js-combinatorics v0.5.0 +// Project: https://github.com/dankogai/js-combinatorics +// Definitions by: Vasya Aksyonov +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare namespace __Combinatorics { + + interface IGenerator { + + /** + * Returns the element or undefined if no more element is available. + */ + next():T; + + /** + * Applies the callback function for each element. + */ + forEach(f:(item:T) => void):void; + + /** + * All elements at once with function applied to each element. + */ + map(f:(item:T) => TResult):TResult[]; + + /** + * Returns an array with elements that passes the filter function. + */ + filter(predicate:(item:T) => boolean):T[]; + + /** + * All elements at once. + */ + toArray():T[]; + + /** + * Returns the number of elements to be generated which equals to generator.toArray().length + * but it is precalculated without actually generating elements. + * Handy when you prepare for large iteration. + */ + length:number; + + } + + interface IPredictableGenerator extends IGenerator { + + /** + * Returns the nth element (starting 0). + */ + nth(n:number):T; + + } + + interface ICartesianProductGenerator extends IPredictableGenerator { + + /** + * Arguments are coordinates in integer. + * Arguments can be out of bounds but it returns undefined in such cases. + */ + get(...coordinates:number[]):T; + + } + + /** + * Calculates m P n + */ + function P(m:number, n:number):number; + + /** + * Calculates m C n + */ + function C(m:number, n:number):number; + + /** + * Calculates n! + */ + function factorial(n:number):number; + + /** + * Returns the factoradic representation of n in array, in least significant order. + * See http://en.wikipedia.org/wiki/Factorial_number_system + */ + function factoradic(n:number):number[]; + + /** + * Generates the power set of array. + */ + function power(a:T[]):IPredictableGenerator; + + /** + * Generates the combination of array with n elements. + * When n is ommited, the length of the array is used. + */ + function combination(a:T[], n?:number):IGenerator; + + /** + * Generates the permutation of array with n elements. + * When n is ommited, the length of the array is used. + */ + function permutation(a:T[], n?:number):IGenerator; + + /** + * Generates the permutation of the combination of n. + * Equivalent to permutation(combination(a)), but more efficient. + */ + function permutationCombination(a:T[]):IGenerator; + + /** + * Generates n-digit "numbers" where each digit is an element in array. + * Note this "number" is in the least significant order. + * When n is ommited, the length of the array is used. + */ + function baseN(a:T[], n?:number):IPredictableGenerator; + + /** + * Generates the cartesian product of the arrays. All arguments must be arrays with more than one element. + */ + function cartesianProduct(a1:T1[]):ICartesianProductGenerator<[T1]>; + function cartesianProduct(a1:T1[], a2:T2[]):ICartesianProductGenerator<[T1, T2]>; + function cartesianProduct(a1:T1[], a2:T2[], a3:T3[]):ICartesianProductGenerator<[T1, T2, T3]>; + function cartesianProduct(a1:T1[], a2:T2[], a3:T3[], a4:T4[]):ICartesianProductGenerator<[T1, T2, T3, T4]>; + function cartesianProduct(a1:T1[], a2:T2[], a3:T3[], a4:T4[], a5:T5[]):ICartesianProductGenerator<[T1, T2, T3, T4, T5]>; + function cartesianProduct(a1:T1[], a2:T2[], a3:T3[], a4:T4[], a5:T5[], a6:T6[]):ICartesianProductGenerator<[T1, T2, T3, T4, T5, T6]>; + function cartesianProduct(a1:T1[], a2:T2[], a3:T3[], a4:T4[], a5:T5[], a6:T6[], a7:T7[]):ICartesianProductGenerator<[T1, T2, T3, T4, T5, T6, T7]>; + function cartesianProduct(a1:T1[], a2:T2[], a3:T3[], a4:T4[], a5:T5[], a6:T6[], a7:T7[], a8:T8[]):ICartesianProductGenerator<[T1, T2, T3, T4, T5, T6, T7, T8]>; + function cartesianProduct(a1:T1[], a2:T2[], a3:T3[], a4:T4[], a5:T5[], a6:T6[], a7:T7[], a8:T8[], a9:T9[]):ICartesianProductGenerator<[T1, T2, T3, T4, T5, T6, T7, T8, T9]>; + function cartesianProduct(a1:T1[], a2:T2[], a3:T3[], a4:T4[], a5:T5[], a6:T6[], a7:T7[], a8:T8[], a9:T9[], a10:T10[]):ICartesianProductGenerator<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]>; + function cartesianProduct(...a:any[][]):ICartesianProductGenerator; + + const VERSION:string; + +} + +declare module "js-combinatorics" { + export = __Combinatorics; +} diff --git a/js-data-angular/js-data-angular.d.ts b/js-data-angular/js-data-angular.d.ts index 242c6d5ab..1fff95afb 100644 --- a/js-data-angular/js-data-angular.d.ts +++ b/js-data-angular/js-data-angular.d.ts @@ -13,16 +13,12 @@ declare module JSData { } interface DS { - - bindAll(resourceName:string, params:DSFilterParams, scope:ng.IScope, expr:string, cb?:(err:DSError, items:Array)=>void):Function; - - bindOne(resourceName:string, id:string | number, scope:ng.IScope, expr:string, cb?:(err:DSError, item:T)=>void):Function; + bindAll(resourceName:string, params:DSFilterParams, scope:ng.IScope, expr:string, cb?:(err:DSError, items:Array>)=>void):Function; + bindOne(resourceName:string, id:string | number, scope:ng.IScope, expr:string, cb?:(err:DSError, item:T & DSInstanceShorthands)=>void):Function; } interface DSResourceDefinition { - - bindAll(params:DSFilterParams, scope:ng.IScope, expr:string, cb?:(err:DSError, items:Array)=>void):Function; - - bindOne(id:string | number, scope:ng.IScope, expr:string, cb?:(err:DSError, item:T)=>void):Function; + bindAll(params:DSFilterParams, scope:ng.IScope, expr:string, cb?:(err:DSError, items:Array>)=>void):Function; + bindOne(id:string | number, scope:ng.IScope, expr:string, cb?:(err:DSError, item:T & DSInstanceShorthands)=>void):Function; } -} \ No newline at end of file +} diff --git a/js-data-http/js-data-http-tests.ts b/js-data-http/js-data-http-tests.ts index 00457d714..390e20aa9 100644 --- a/js-data-http/js-data-http-tests.ts +++ b/js-data-http/js-data-http-tests.ts @@ -28,7 +28,7 @@ ADocument.inject({ id: 5, author: 'John' }); ADocument.inject({ id: 6, author: 'John' }); // bypass the data store -adapter.updateAll<{ id?: number; author: string; }>(ADocument, { author: 'Johnny' }, { author: 'John' }).then(function (documents) { +adapter.updateAll(ADocument, { author: 'Johnny' }, { author: 'John' }).then(function (documents) { documents[0]; // { id: 5, author: 'Johnny' } // The updated documents have NOT been injected into the data store because we bypassed the data store @@ -37,7 +37,7 @@ adapter.updateAll<{ id?: number; author: string; }>(ADocument, { author: 'Johnny }); // Normally you would just go through the data store -ADocument.updateAll<{ id?: number; author: string; }>({ author: 'Johnny' }, { author: 'John' }).then(function (documents) { +ADocument.updateAll({ author: 'Johnny' }, { author: 'John' }).then(function (documents) { documents[0]; // { id: 5, author: 'Johnny' } // the updated documents have been injected into the data store diff --git a/js-data-http/js-data-http.d.ts b/js-data-http/js-data-http.d.ts index 295e7cc6f..5116f3972 100644 --- a/js-data-http/js-data-http.d.ts +++ b/js-data-http/js-data-http.d.ts @@ -6,7 +6,7 @@ /// declare module JSData { - + interface DSHttpAdapterOptions { serialize?: (resourceName:string, data:any)=>any; deserialize?: (resourceName:string, data:any)=>any; @@ -37,4 +37,8 @@ declare module JSData { } } -declare var DSHttpAdapter:JSData.DSHttpAdapter; \ No newline at end of file +declare var DSHttpAdapter:JSData.DSHttpAdapter; + +declare module 'js-data-http' { + export = DSHttpAdapter; +} diff --git a/js-data/js-data-node-tests.ts b/js-data/js-data-node-tests.ts index a0b39a161..e1989bb20 100644 --- a/js-data/js-data-node-tests.ts +++ b/js-data/js-data-node-tests.ts @@ -1,17 +1,15 @@ -/// +/// import JSData = require('js-data'); -//TODO -//import DSRedisAdapter = require('js-data-redis') +import DSHttpAdapter = require('js-data-http') var store = new JSData.DS(); // register and use http by default for async operations -//TODO -//store.registerAdapter('redis', new DSRedisAdapter(), {default: true}); +store.registerAdapter('redis', new DSHttpAdapter(), {default: true}); // simplest model definition var User = store.defineResource('user'); User.find(1).then(function (user: any) { user; // { id: 1, name: 'John' } -}); \ No newline at end of file +}); diff --git a/js-data/js-data-tests.ts b/js-data/js-data-tests.ts index c6fe6d13b..91bac2987 100644 --- a/js-data/js-data-tests.ts +++ b/js-data/js-data-tests.ts @@ -11,7 +11,7 @@ interface IUser { } interface IUserWithMethod extends IUser { - fullName?: () => string; + fullName:()=>string; } interface IUserWithComputedProperty extends IUser { @@ -20,10 +20,6 @@ interface IUserWithComputedProperty extends IUser { var store = new JSData.DS(); -// register and use http by default for async operations -//TODO -//store.registerAdapter('http', new DSHttpAdapter(), {default: true}); - // simplest model definition var User = store.defineResource('user'); @@ -31,12 +27,12 @@ User.find(1).then(function (user:IUser) { user; // { id: 1, name: 'John' } }); -var user:IUser = User.createInstance({name: 'John'}); +var user:IUser = User.createInstance({name: 'John'}); var store = new JSData.DS(); -var User = store.defineResource('user'); -var user:IUser = User.inject({id: 1, name: 'John'}); -var user2:IUser = User.inject({id: 1, age: 30}); +var User2 = store.defineResource('user'); +var user:IUser = User2.inject({id: 1, name: 'John'}); +var user2:IUser = User2.inject({id: 1, age: 30}); user; // User { id: 1, name: 'John', age: 30 } user2; // User { id: 1, name: 'John', age: 30 } @@ -70,7 +66,7 @@ User.create({ var store = new JSData.DS(); -var UserWithMethod = store.defineResource({ +var UserWithMethodResource = store.defineResource({ name: 'user', methods: { fullName: function () { @@ -79,7 +75,7 @@ var UserWithMethod = store.defineResource({ } }); -var userWithMethod = UserWithMethod.createInstance({first: 'John', last: 'Anderson'}); +var userWithMethod = UserWithMethodResource.createInstance({first: 'John', last: 'Anderson'}); userWithMethod.fullName(); // "John Anderson" @@ -102,7 +98,7 @@ var UserWithComputedProperty = store.defineResource({ } }); -var userWithComputedProperty:IUserWithComputedProperty = UserWithComputedProperty.inject({ +var userWithComputedProperty:IUserWithComputedProperty = UserWithComputedProperty.inject({ id: 1, first: 'John', last: 'Anderson' @@ -284,7 +280,7 @@ Post.filter({ limit: PAGE_SIZE }); -var User = store.defineResource({ +var User3 = store.defineResource({ name: 'user', relations: { hasMany: { @@ -362,7 +358,7 @@ User.find(10).then(function (user:IUser) { user.comments; // undefined user.profile; // undefined - User.loadRelations(user, ['comment', 'profile']).then(function (user:IUser) { + User.loadRelations(user.id, ['comment', 'profile']).then(function (user:IUser) { user.comments; // array user.profile; // object }); @@ -403,24 +399,24 @@ OtherOtherComment.update(1, {content: 'stuff'}, {params: {postId: false}}); // P var store = new JSData.DS({ // set the default - beforeCreate: function (resource, data, cb) { + beforeCreate: function (resource:JSData.DSResourceDefinition, data:any, cb:(err:Error, returnData:any)=>void) { // do something general cb(null, data); } }); -var User = store.defineResource({ +var User4 = store.defineResource({ name: 'user', // set just for this resource - beforeCreate: function (resource, data, cb) { + beforeCreate: function (resource:JSData.DSResourceDefinition, data:any, cb:(err:Error, returnData:any)=>void) { // do something more specific to "users" cb(null, data); } }); -User.create({name: 'John'}, { +User4.create({name: 'John'}, { // set just for this method call - beforeCreate: function (resource, data, cb) { + beforeCreate: function (resource:JSData.DSResourceDefinition, data:any, cb:(err:Error, returnData:any)=>void) { // do something specific for this method call cb(null, data); } @@ -521,4 +517,86 @@ var store = new JSData.DS(); var myResourceDefinition = store.defineResource('myResource'); -myResourceDefinition = store.definitions.myResource; \ No newline at end of file +myResourceDefinition = store.definitions.myResource; + +/** + * Custom action on datastore resource + */ + +interface Resource { + someProp:string; +} + +interface ActionsForResource { + myAction:JSData.DSActionFn; + myOtherAction:JSData.DSActionFn; +} + +var myOtherAction:JSData.DSActionConfig = { + method: 'GET', + endpoint: 'goHere' +}; + +var customActionResource = store.defineResource({ + name: 'actionResource', + actions: { + myAction: { + method: 'POST' + }, + myOtherAction: myOtherAction + } +}); + +customActionResource.myAction(3).then((result)=>{ + + var theCustomResult:number = result; +}); + +customActionResource.myOtherAction(2, {data:'blub'}).then(()=>{ + // success +}); + +customActionResource.find(1).then((result)=>{ + + var aProperty = result.someProp; +}); + +/** + * Instance shorthands + */ + +var customActionResourceInstance = customActionResource.get(1); + +customActionResourceInstance.DSCompute(); +customActionResourceInstance.DSChanges(); +customActionResourceInstance.DSChangeHistory(); +customActionResourceInstance.DSHasChanges(); +customActionResourceInstance.DSLastModified(); +customActionResourceInstance.DSLastSaved(); +customActionResourceInstance.DSPrevious(); +customActionResourceInstance.DSCreate(); +customActionResourceInstance.DSDestroy(); +customActionResourceInstance.DSLoadRelations('myRelation'); +customActionResourceInstance.DSRefresh(); +customActionResourceInstance.DSSave(); +customActionResourceInstance.DSUpdate(); + +/** + * Events + */ + +function myEvtHandler(definition:JSData.DSResourceDefinition, item:Resource) { + +} + +store.on("DS.change", myEvtHandler); +store.off("DS.change", myEvtHandler); +store.emit("DS.change", customActionResource, customActionResourceInstance); + +customActionResource.on("DS.change", myEvtHandler); +customActionResource.off("DS.change", myEvtHandler); +customActionResource.emit("DS.change", customActionResource, customActionResourceInstance); + +customActionResourceInstance.on("DS.change", myEvtHandler); +customActionResourceInstance.off("DS.change", myEvtHandler); +customActionResourceInstance.emit("DS.change", customActionResource, customActionResourceInstance); diff --git a/js-data/js-data.d.ts b/js-data/js-data.d.ts index 604b70e6c..54b3a77b6 100644 --- a/js-data/js-data.d.ts +++ b/js-data/js-data.d.ts @@ -1,4 +1,4 @@ -// Type definitions for JSData v1.5.4 +// Type definitions for JSData v2.8.0 // Project: https://github.com/js-data/js-data // Definitions by: Stefan Steinhart // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -7,135 +7,66 @@ // js-data module (js-data.js) /////////////////////////////////////////////////////////////////////////////// -// defining what exists in JSData and how it looks declare module JSData { interface JSDataPromise { + then(onFulfilled?:(value:R) => U | JSDataPromise, onRejected?:(error:any) => U | JSDataPromise): JSDataPromise; - then(onFulfilled?: (value: R) => U | JSDataPromise, onRejected?: (error: any) => U | JSDataPromise): JSDataPromise; - - catch(onRejected?: (error: any) => U | JSDataPromise): JSDataPromise; + catch(onRejected?:(error:any) => U | JSDataPromise): JSDataPromise; // enhanced with finally finally(finallyCb?:() => U):JSDataPromise; } - //TODO switch to class again when typescript supports open ended class declaration - interface DS { - - new(config?:DSConfiguration):DS; - - // rather undocumented - errors:DSErrors; - - // those are objects containing the defined resources and adapters - definitions:any; - adapters:any; - - defaults:DSConfiguration; - - // async - create(resourceName:string, attrs:Object, options?:DSConfiguration):JSDataPromise; - destroy(resourceName:string, id:string | number, options?:DSAdapterOperationConfiguration):JSDataPromise; - destroyAll(resourceName:string, params?:DSFilterParams, options?:DSAdapterOperationConfiguration):JSDataPromise; - find(resourceName:string, id:string | number, options?:DSAdapterOperationConfiguration):JSDataPromise; - findAll(resourceName:string, params?:DSFilterParams, options?:DSAdapterOperationConfiguration):JSDataPromise>; - loadRelations(resourceName:string, idOrInstance:string | number | Object, relations:string | Array, options?:DSAdapterOperationConfiguration):JSDataPromise; - update(resourceName:string, id:string | number, attrs:Object, options?:DSSaveConfiguration):JSDataPromise; - updateAll(resourceName:string, attrs:Object, params?:DSFilterParams, options?:DSAdapterOperationConfiguration):JSDataPromise>; - reap(resourceName:string, options?:DSConfiguration):JSDataPromise; - refresh(resourceName:string, id:string | number, options?:DSAdapterOperationConfiguration):JSDataPromise; - save(resourceName:string, id:string | number, options?:DSSaveConfiguration):JSDataPromise; - - // sync - changeHistory(resourceName:string, id?:string | number):Array; - changes(resourceName:string, id:string | number):Object; - compute(resourceName:string, idOrInstance:number | string | Object ):T; - createInstance(resourceName:string, attrs?:T, options?:DSAdapterOperationConfiguration):T; - defineResource(resourceNameOrDefinition:string | DSResourceDefinitionConfiguration):DSResourceDefinition; - digest():void; - eject(resourceName:string, id:string | number, options?:DSConfiguration):T; - ejectAll(resourceName:string, params:DSFilterParams, options?:DSConfiguration):Array; - filter(resourceName:string, params:DSFilterParams, options?:DSConfiguration):Array; - get(resourceName:string, id:string | number, options?:DSConfiguration):T; - getAll(resourceName:string, ids?:Array):Array; - hasChanges(resourceName:string, id:string | number):boolean; - inject(resourceName:string, attrs:T, options?:DSConfiguration):T; - inject(resourceName:string, items:Array, options?:DSConfiguration):Array; - is(resourceName:string, object:Object): boolean; - lastModified(resourceName:string, id?:string | number):number; // timestamp - lastSaved(resourceName:string, id?:string | number):number; // timestamp - link(resourceName:string, id:string | number, relations?:Array):T; - linkAll(resourceName:string, params:DSFilterParams, relations?:Array):T; - linkInverse(resourceName:string, id:string | number, relations?:Array):T; - previous(resourceName:string, id:string | number):T; - unlinkInverse(resourceName:string, id:string | number, relations?:Array):T; - - registerAdapter(adapterId:string, adapter:IDSAdapter, options?:{default: boolean}):void; - } - interface DSConfiguration extends IDSResourceLifecycleEventHandlers { actions?: Object; allowSimpleWhere?: boolean; basePath?: string; bypassCache?: boolean; cacheResponse?: boolean; + clearEmptyQueries?:boolean; + debug?:boolean; defaultAdapter?: string; - defaultFilter?: (collection:Array, resourceName:string, params:DSFilterParams, options:DSConfiguration)=>Array; + defaultFilter?: (collection:Array, resourceName:string, params:DSFilterArg, options:DSConfiguration)=>Array; + defaultValues?:Object; eagerEject?: boolean; - // TODO enable when eagerInject in DS#create is implemented - //eagerInject?: boolean; endpoint?: string; error?: boolean | ((message?:any, ...optionalParams:any[])=> void); fallbackAdapters?: Array; findAllFallbackAdapters?: Array; findAllStrategy?: string; - findBelongsTo?: boolean; findFallbackAdapters?: Array; - findHasOne?: boolean; - findHasMany?: boolean; - findInverseLinks?: boolean; findStrategy?: string + findStrictCache?:boolean; idAttribute?: string; ignoredChanges?: Array; - // TODO ignoreMissing is undocumented - //ignoreMissing: boolean; + ignoreMissing?: boolean; + instanceEvents?:boolean; keepChangeHistory?: boolean; - loadFromServer?: boolean; - log?: boolean | ((message?: any, ...optionalParams: any[])=> void); + linkRelations?:boolean; + log?: boolean | ((message?:any, ...optionalParams:any[])=> void); maxAge?: number; notify?: boolean; + omit?:Array; + onConflict?:string; // "merge"(default) or "replace" reapAction?: string; reapInterval?: number; + relationsEnumerable?:boolean; resetHistoryOnInject?: boolean; + returnMeta?:boolean; + scopes?:Object; strategy?: string; upsert?: boolean; useClass?: boolean; useFilter?: boolean; - } - - interface DSAdapterOperationConfiguration extends DSConfiguration { - adapter?: string; - bypassCache?: boolean; - cacheResponse?: boolean; - findStrategy?: string; - findFallbackAdapters?: string[]; - strategy?: string; - fallbackAdapters?: string[]; - - params: { - [paramName: string]: string | number | boolean; - }; - } - - interface DSSaveConfiguration extends DSAdapterOperationConfiguration { - changesOnly?: boolean; + watchChanges?:boolean; } interface DSResourceDefinitionConfiguration extends DSConfiguration { - name: string; computed?: any; + meta?:any; methods?: any; + name: string; relations?: { hasMany?: Object; hasOne?: Object; @@ -143,46 +74,6 @@ declare module JSData { }; } - interface DSResourceDefinition extends DSResourceDefinitionConfiguration { - - //async - create(attrs:Object, options?:DSConfiguration):JSDataPromise; - destroy(id:string | number, options?:DSAdapterOperationConfiguration):JSDataPromise; - destroyAll(params?:DSFilterParams, options?:DSAdapterOperationConfiguration):JSDataPromise; - find(id:string | number, options?:DSAdapterOperationConfiguration):JSDataPromise; - findAll(params?:DSFilterParams, options?:DSAdapterOperationConfiguration):JSDataPromise>; - loadRelations(idOrInstance:string | number | Object, relations:string | Array, options?:DSAdapterOperationConfiguration):JSDataPromise; - update(id:string | number, attrs:Object, options?:DSSaveConfiguration):JSDataPromise; - updateAll(attrs:Object, params?:DSFilterParams & T, options?:DSAdapterOperationConfiguration):JSDataPromise>; - reap(resourceNametions?:DSConfiguration):JSDataPromise; - refresh(id:string | number, options?:DSAdapterOperationConfiguration):JSDataPromise; - save(id:string | number, options?:DSSaveConfiguration):JSDataPromise; - - // sync - changeHistory(id?:string | number):Array; - changes(id:string | number):Object; - compute(idOrInstance:number | string | Object ):T; - createInstance(attrs?:T, options?:DSAdapterOperationConfiguration):T; - digest():void; - eject(id:string | number, options?:DSConfiguration):T; - ejectAll(params:DSFilterParams, options?:DSConfiguration):Array; - filter(params: DSFilterParams, options?: DSConfiguration): Array; - filter(params: DSFilterParamsForAllowSimpleWhere, options?: DSConfiguration): Array; - get(id:string | number, options?:DSConfiguration):T; - getAll(ids?:Array):Array; - hasChanges(id:string | number):boolean; - inject(attrs:T, options?:DSConfiguration):T; - inject(items:Array, options?:DSConfiguration):Array; - is(object:Object): boolean; - lastModified(id?:string | number):number; // timestamp - lastSaved(id?:string | number):number; // timestamp - link(id:string | number, relations?:Array):T; - linkAll(params:DSFilterParams, relations?:Array):T; - linkInverse(id:string | number, relations?:Array):T; - previous(id:string | number):T; - unlinkInverse(id:string | number, relations?:Array):T; - } - interface DSFilterParams { where?: Object; @@ -195,49 +86,194 @@ declare module JSData { sort?: string | Array | Array>; } - interface DSFilterParamsForAllowSimpleWhere { - [key: string]: string | number; + type DSFilterArg = DSFilterParams | Object; + + interface DSAdapterOperationConfiguration extends DSConfiguration { + adapter?: string; + params?: { + [paramName: string]: string | number | boolean; + }; } + interface DSSaveConfiguration extends DSAdapterOperationConfiguration { + changesOnly?: boolean; + } + + interface DSCollection extends Array { + fetch(params?:DSFilterArg, options?:DSConfiguration):JSDataPromise>>; + params:DSFilterArg; + resourceName:string; + } + + interface DSEvents { + on(name:string, handler:(...args:any[])=>void):void; + off(name:string, handler:(...args:any[])=>void):void; + emit(name:string, ...args:any[]):void; + } + + interface DS extends DSEvents { + new(config?:DSConfiguration):DS; + + // rather undocumented + errors:DSErrors; + + // those are objects containing the defined resources and adapters + definitions:any; + adapters:any; + + defaults:DSConfiguration; + + changeHistory(resourceName:string, id:string | number):Array; + changes(resourceName:string, id:string | number, options?:{ignoredChanges:Array}):Object; + clear():Array>; + compute(resourceName:string, idOrInstance:number | string | T):T & DSInstanceShorthands; + create(resourceName:string, attrs:Object, options?:DSConfiguration):JSDataPromise>; + createCollection(resourceName:string, array?:Array, params?:DSFilterArg, options?:DSConfiguration):DSCollection>; + createInstance(resourceName:string, attrs?:Object, options?:DSConfiguration):T & DSInstanceShorthands; + destroy(resourceName:string, id:string | number, options?:DSAdapterOperationConfiguration):JSDataPromise; + destroyAll(resourceName:string, params?:DSFilterArg, options?:DSAdapterOperationConfiguration):JSDataPromise; + digest():void; + eject(resourceName:string, id:string | number, options?:DSConfiguration):T & DSInstanceShorthands; + ejectAll(resourceName:string, params:DSFilterArg, options?:DSConfiguration):Array>; + filter(resourceName:string, params:DSFilterArg, options?:DSConfiguration):Array>; + find(resourceName:string, id:string | number, options?:DSAdapterOperationConfiguration):JSDataPromise>; + findAll(resourceName:string, params?:DSFilterArg, options?:DSAdapterOperationConfiguration):JSDataPromise>>; + get(resourceName:string, id:string | number):T & DSInstanceShorthands; + getAll(resourceName:string, ids?:Array):Array>; + hasChanges(resourceName:string, id:string | number):boolean; + inject(resourceName:string, attrs:TInject, options?:DSConfiguration):U & DSInstanceShorthands; + inject(resourceName:string, items:Array, options?:DSConfiguration):Array>; + is(resourceName:string, object:Object): boolean; + lastModified(resourceName:string, id?:string | number):number; // timestamp + lastSaved(resourceName:string, id?:string | number):number; // timestamp + loadRelations(resourceName:string, idOrInstance:string | number, relations:string | Array, options?:DSAdapterOperationConfiguration):JSDataPromise>; + previous(resourceName:string, id:string | number):T & DSInstanceShorthands; + reap(resourceName:string):JSDataPromise; + refresh(resourceName:string, id:string | number, options?:DSAdapterOperationConfiguration):JSDataPromise>; + refreshAll(resourceName:string, params?:DSFilterArg, options?:DSAdapterOperationConfiguration):JSDataPromise>>; + revert(resourceName:string, id:string | number):T & DSInstanceShorthands; + save(resourceName:string, id:string | number, options?:DSSaveConfiguration):JSDataPromise>; + update(resourceName:string, id:string | number, attrs:Object, options?:DSAdapterOperationConfiguration):JSDataPromise>; + updateAll(resourceName:string, attrs:Object, params?:DSFilterArg, options?:DSAdapterOperationConfiguration):JSDataPromise>>; + + defineResource(resourceNameOrDefinition:string | DSResourceDefinitionConfiguration):DSResourceDefinition; + defineResource(resourceNameOrDefinition:string | DSResourceDefinitionConfiguration):DSResourceDefinition & TActions; + registerAdapter(adapterId:string, adapter:IDSAdapter, options?:{default: boolean}):void; + } + + interface DSResourceDefinition extends DSResourceDefinitionConfiguration, DSEvents { + changeHistory(id:string | number):Array; + changes(id:string | number, options?:{ignoredChanges:Array}):Object; + clear():Array>; + compute(idOrInstance:number | string | T):T & DSInstanceShorthands; + create(attrs:Object, options?:DSConfiguration):JSDataPromise>; + createCollection(array?:Array, params?:DSFilterArg, options?:DSConfiguration):DSCollection>; + createInstance(attrs?:Object, options?:DSConfiguration):T & DSInstanceShorthands; + destroy(id:string | number, options?:DSAdapterOperationConfiguration):JSDataPromise; + destroyAll(params?:DSFilterArg, options?:DSAdapterOperationConfiguration):JSDataPromise; + digest():void; + eject(id:string | number, options?:DSConfiguration):T & DSInstanceShorthands; + ejectAll(params:DSFilterArg, options?:DSConfiguration):Array>; + filter(params:DSFilterArg, options?:DSConfiguration):Array>; + find(id:string | number, options?:DSAdapterOperationConfiguration):JSDataPromise>; + findAll(params?:DSFilterArg, options?:DSAdapterOperationConfiguration):JSDataPromise>>; + get(id:string | number):T & DSInstanceShorthands; + getAll(ids?:Array):Array>; + hasChanges(id:string | number):boolean; + inject(attrs:TInject, options?:DSConfiguration):T & DSInstanceShorthands; + inject(items:Array, options?:DSConfiguration):Array>; + is(object:Object): boolean; + lastModified(id?:string | number):number; // timestamp + lastSaved(id?:string | number):number; // timestamp + loadRelations(idOrInstance:string | number, relations:string | Array, options?:DSAdapterOperationConfiguration):JSDataPromise>; + previous(id:string | number):T & DSInstanceShorthands; + reap():JSDataPromise; + refresh(id:string | number, options?:DSAdapterOperationConfiguration):JSDataPromise>; + refreshAll(params?:DSFilterArg, options?:DSAdapterOperationConfiguration):JSDataPromise>>; + revert(id:string | number):T & DSInstanceShorthands; + save(id:string | number, options?:DSSaveConfiguration):JSDataPromise>; + update(id:string | number, attrs:Object, options?:DSAdapterOperationConfiguration):JSDataPromise>; + updateAll(attrs:Object, params?:DSFilterArg, options?:DSAdapterOperationConfiguration):JSDataPromise>>; + } + + // cannot specify T at interface level because the interface is used as generic constraint itself which ends up being recursive + export interface DSInstanceShorthands extends DSEvents { + DSCompute():void; + DSRefresh(options?:DSAdapterOperationConfiguration):JSDataPromise>; + DSSave(options?:DSSaveConfiguration):JSDataPromise>; + DSUpdate(options?:DSAdapterOperationConfiguration):JSDataPromise>; + DSDestroy(options?:DSAdapterOperationConfiguration):JSDataPromise; + DSCreate(options?:DSAdapterOperationConfiguration):JSDataPromise>; + DSLoadRelations(relations:string | Array, options?:DSAdapterOperationConfiguration):JSDataPromise>; + DSChangeHistory():Array; + DSChanges():Object; + DSHasChanges():boolean; + DSLastModified():number; // timestamp + DSLastSaved():number; // timestamp + DSPrevious():T & DSInstanceShorthands; + DSRevert():T & DSInstanceShorthands; + } + + type DSSyncLifecycleHookHandler = (resource:DSResourceDefinition, data:any) => void; + type DSAsyncLifecycleHookHandler = (resource:DSResourceDefinition, data:any) => JSDataPromise; + type DSAsyncLifecycleHookHandlerCb = (resource:DSResourceDefinition, data:any, cb:(err:Error, data:any)=>void) => void + interface IDSResourceLifecycleValidateEventHandlers { - beforeValidate?: (resourceName:string, data:any, cb:(err:any, data?:any)=>void)=>void; - validate?: (resourceName:string, data:any, cb:(err:any, data?:any)=>void)=>void; - afterValidate?: (resourceName:string, data:any, cb:(err:any, data?:any)=>void)=>void; + beforeValidate?: DSAsyncLifecycleHookHandler | DSAsyncLifecycleHookHandlerCb; + validate?: DSAsyncLifecycleHookHandler | DSAsyncLifecycleHookHandlerCb; + afterValidate?: DSAsyncLifecycleHookHandler | DSAsyncLifecycleHookHandlerCb; } interface IDSResourceLifecycleCreateEventHandlers { - beforeCreate?: (resourceName:string, data:any, cb:(err:any, data?:any)=>void)=>void; - afterCreate?: (resourceName:string, data:any, cb:(err:any, data?:any)=>void)=>void; - } - - interface IDSResourceLifecycleCreateInstanceEventHandlers { - beforeCreateInstance?: (resourceName:string, data:any)=>void; - afterCreateInstance?: (resourceName:string, data:any)=>void; + beforeCreate?: DSAsyncLifecycleHookHandler | DSAsyncLifecycleHookHandlerCb; + afterCreate?: DSAsyncLifecycleHookHandler | DSAsyncLifecycleHookHandlerCb; } interface IDSResourceLifecycleUpdateEventHandlers { - beforeUpdate?: (resourceName:string, data:any, cb:(err:any, data?:any)=>void)=>void; - afterUpdate?: (resourceName:string, data:any, cb:(err:any, data?:any)=>void)=>void; + beforeUpdate?: DSAsyncLifecycleHookHandler | DSAsyncLifecycleHookHandlerCb; + afterUpdate?: DSAsyncLifecycleHookHandler | DSAsyncLifecycleHookHandlerCb; } interface IDSResourceLifecycleDestroyEventHandlers { - beforeDestroy?: (resourceName:string, data:any, cb:(err:any, data?:any)=>void)=>void; - afterDestroy?: (resourceName:string, data:any, cb:(err:any, data?:any)=>void)=>void; + beforeDestroy?: DSAsyncLifecycleHookHandler | DSAsyncLifecycleHookHandlerCb; + afterDestroy?: DSAsyncLifecycleHookHandler | DSAsyncLifecycleHookHandlerCb; + } + + interface IDSResourceLifecycleCreateInstanceEventHandlers { + beforeCreateInstance?: DSSyncLifecycleHookHandler; + afterCreateInstance?: DSSyncLifecycleHookHandler; } interface IDSResourceLifecycleInjectEventHandlers { - beforeInject?: (resourceName:string, data:any)=>void; - afterInject?: (resourceName:string, data:any)=>void; + beforeInject?: DSSyncLifecycleHookHandler; + afterInject?: DSSyncLifecycleHookHandler; } interface IDSResourceLifecycleEjectEventHandlers { - beforeEject?: (resourceName:string, data:any)=>void; - afterEject?: (resourceName:string, data:any)=>void; + beforeEject?: DSSyncLifecycleHookHandler; + afterEject?: DSSyncLifecycleHookHandler; } interface IDSResourceLifecycleReapEventHandlers { - beforeReap?: (resourceName:string, data:any)=>void; - afterReap?: (resourceName:string, data:any)=>void; + beforeReap?: DSSyncLifecycleHookHandler; + afterReap?: DSSyncLifecycleHookHandler; + } + + interface IDSResourceLifecycleFindEventHandlers { + afterFind?: DSAsyncLifecycleHookHandler | DSAsyncLifecycleHookHandlerCb; + } + + interface IDSResourceLifecycleFindAllEventHandlers { + afterFindAll?: DSAsyncLifecycleHookHandler | DSAsyncLifecycleHookHandlerCb; + } + + interface IDSResourceLifecycleLoadRelationsEventHandlers { + afterLoadRelations?: DSAsyncLifecycleHookHandler | DSAsyncLifecycleHookHandlerCb; + } + + interface IDSResourceLifecycleCreateCollectionEventHandlers { + beforeCreateCollection?: DSSyncLifecycleHookHandler; + afterCreateCollection?: DSSyncLifecycleHookHandler; } interface IDSResourceLifecycleEventHandlers extends IDSResourceLifecycleCreateEventHandlers, @@ -247,8 +283,11 @@ declare module JSData { IDSResourceLifecycleDestroyEventHandlers, IDSResourceLifecycleInjectEventHandlers, IDSResourceLifecycleEjectEventHandlers, - IDSResourceLifecycleReapEventHandlers { - + IDSResourceLifecycleReapEventHandlers, + IDSResourceLifecycleFindEventHandlers, + IDSResourceLifecycleFindAllEventHandlers, + IDSResourceLifecycleLoadRelationsEventHandlers, + IDSResourceLifecycleCreateCollectionEventHandlers { } // errors @@ -271,19 +310,31 @@ declare module JSData { // DSAdapter interface interface IDSAdapter { - create(config:DSResourceDefinition, attrs:Object, options?:DSConfiguration):JSDataPromise; + create(config:DSResourceDefinition, attrs:Object, options?:DSConfiguration):JSDataPromise; - destroy(config:DSResourceDefinition, id:string | number, options?:DSConfiguration):JSDataPromise; + destroy(config:DSResourceDefinition, id:string | number, options?:DSConfiguration):JSDataPromise; + destroyAll(config:DSResourceDefinition, params:DSFilterArg, options?:DSConfiguration):JSDataPromise; - destroyAll(config:DSResourceDefinition, params:DSFilterParams, options?:DSConfiguration):JSDataPromise; + find(config:DSResourceDefinition, id:string | number, options?:DSConfiguration):JSDataPromise; + findAll(config:DSResourceDefinition, params?:DSFilterArg, options?:DSConfiguration):JSDataPromise; - find(config:DSResourceDefinition, id:string | number, options?:DSConfiguration):JSDataPromise; + update(config:DSResourceDefinition, id:string | number, attrs:Object, options?:DSConfiguration):JSDataPromise; + updateAll(config:DSResourceDefinition, attrs:Object, params?:DSFilterArg, options?:DSConfiguration):JSDataPromise; + } - findAll(config:DSResourceDefinition, params?:DSFilterParams, options?:DSConfiguration):JSDataPromise; + // Custom action config + interface DSActionConfig { + adapter?: string; + endpoint?: string; + pathname?: string; + method?: string; + } - update(config:DSResourceDefinition, id:string | number, attrs:Object, options?:DSConfiguration):JSDataPromise; - - updateAll(config:DSResourceDefinition, attrs:Object, params?:DSFilterParams & T, options?:DSConfiguration):JSDataPromise; + // Custom action method definition + // options are passed to adapter.HTTP() method-call, js-data-http adapter by default uses AXIOS but can also be $http in case of angular + // or a custom adapter implementation. The adapter can be set via the DSActionConfig. + interface DSActionFn { + (id:string | number, options?:Object):JSDataPromise } } @@ -295,6 +346,5 @@ declare var JSData:{ //Support node require declare module 'js-data' { - export = JSData; } diff --git a/js-data/legacy/js-data-1.5.4-tests.ts b/js-data/legacy/js-data-1.5.4-tests.ts new file mode 100644 index 000000000..076db194b --- /dev/null +++ b/js-data/legacy/js-data-1.5.4-tests.ts @@ -0,0 +1,585 @@ +/// + +interface IUser { + id?: number; + name?: string; + age?: number; + first?: string; + last?: string; + comments?:Array; + profile?:any; +} + +interface IUserWithMethod { + fullName:()=>string; +} + +interface IUserWithComputedProperty extends IUser { + fullName?: string; +} + +var store = new JSData.DS(); + +// simplest model definition +var User = store.defineResource('user'); + +User.find(1).then(function (user:IUser) { + user; // { id: 1, name: 'John' } +}); + +var user:IUser = User.createInstance({name: 'John'}); + +var store = new JSData.DS(); +var User2 = store.defineResource('user'); +var user:IUser = User2.inject({id: 1, name: 'John'}); +var user2:IUser = User2.inject({id: 1, age: 30}); + +user; // User { id: 1, name: 'John', age: 30 } +user2; // User { id: 1, name: 'John', age: 30 } +User.get(1); // User { id: 1, name: 'John', age: 30 } +user === user2; // true +user === User.get(1); // true +user2 === User.get(1); // true + +var store = new JSData.DS({ + // set a default lifecycle hook + afterCreate: function () { + } +}); + +var User = store.defineResource({ + name: 'user', + // override the hook for this resource + afterCreate: function () { + } +}); + +User.create({ + name: 'john' +}, { + // override the hook just for this method call + afterCreate: function () { + } +}).then(()=> { + +}); + +var store = new JSData.DS(); + +var UserWithMethodResource = store.defineResource({ + name: 'user', + methods: { + fullName: function () { + return this.first + ' ' + this.last; + } + } +}); + +var userWithMethod = UserWithMethodResource.createInstance({first: 'John', last: 'Anderson'}); + +userWithMethod.fullName(); // "John Anderson" + +var store = new JSData.DS(); + +var UserWithComputedProperty = store.defineResource({ + name: 'user', + computed: { + // each function's argument list defines the fields + // that the computed property depends on + fullName: ['first', 'last', function (first:string, last:string) { + return first + ' ' + last; + }], + // shortand, use the array syntax above if you want + // you computed properties to work after you've + // minified your code. Shorthand style won't work when minified + initials: function (first:string, last:string) { + return first.toUpperCase()[0] + '. ' + last.toUpperCase()[0] + '.'; + } + } +}); + +var userWithComputedProperty:IUserWithComputedProperty = UserWithComputedProperty.inject({ + id: 1, + first: 'John', + last: 'Anderson' +}); + +userWithComputedProperty.fullName; // "John Anderson" + +userWithComputedProperty.first = 'Fred'; + +// js-data relies on dirty-checking, so the +// computed property (probably) hasn't been updated yet +userWithComputedProperty.fullName; // "John Anderson" + +// If your browser supports Object.observe this will have no effect +// otherwise it will trigger the dirty-checking +store.digest(); + +userWithComputedProperty.fullName; // "Fred Anderson" + +interface IComment { + comments?: any; + profile?: any; +} + +var aComment:JSData.DSResourceDefinition = store.defineResource('comment'); + +// Get all comments where comment.userId == 5 +aComment.filter({ + where: { + userId: { + '==': 5 + } + } +}); + +// Get all comments where comment.userId == 5 +aComment.filter({ + userId: 5 +}); + +// Get all comments where comment.userId === 5 +aComment.filter({ + where: { + userId: { + '===': 5 + } + } +}); + +// Get all comments where comment.userId != 5 +aComment.filter({ + where: { + userId: { + '!=': 5 + } + } +}); + +// Get all comments where comment.userId !== 5 +aComment.filter({ + where: { + userId: { + '!==': 5 + } + } +}); + +// Get all users where user.age > 30 +User.filter({ + where: { + age: { + '>': 30 + } + } +}); + +// Get all users where user.age >= 30 +User.filter({ + where: { + age: { + '>=': 30 + } + } +}); + +// Get all users where user.age < 30 +User.filter({ + where: { + age: { + '<': 30 + } + } +}); + +// Get all users where user.name is in "John Anderson" +User.filter({ + where: { + name: { + 'in': 'John Anderson' + } + } +}); + +// Get all users where user.role is in ["admin", "owner"] +User.filter({ + where: { + role: { + 'in': ['admin', 'owner'] + } + } +}); + +// Get all users where user.name is NOT in "John Anderson" +User.filter({ + where: { + name: { + 'notIn': 'John Anderson' + } + } +}); + +// Get all users where user.role is NOT in ["admin", "owner"] +User.filter({ + where: { + role: { + 'notIn': ['admin', 'owner'] + } + } +}); + +// Get all users where user.name contains "John" +User.filter({ + where: { + name: { + 'contains': 'John' + } + } +}); + +// Get all users where user.roles contains "admin" +User.filter({ + where: { + roles: { + 'contains': 'admin' + } + } +}); + +// Sorts users by age in ascending order +User.filter({ + orderBy: 'age' +}); + +// Sorts users by age in descending order +User.filter({ + orderBy: ['age', 'DESC'] +}); + +// Sorts users by age in descending order and then sort by name in ascending order to break a tie +User.filter({ + orderBy: [ + ['age', 'DESC'], + ['name', 'ASC'] + ] +}); + +var PAGE_SIZE = 20; +var currentPage = 1; + +interface IPost { + +} + +var Post:JSData.DSResourceDefinition; + +// Grab the first "page" of posts +Post.filter({ + offset: PAGE_SIZE * (currentPage - 1), + limit: PAGE_SIZE +}); + +var User3 = store.defineResource({ + name: 'user', + relations: { + hasMany: { + comment: { + localField: 'comments', + foreignKey: 'userId' + } + }, + hasOne: { + profile: { + localField: 'profile', + foreignKey: 'userId' + } + }, + belongsTo: { + organization: { + localKey: 'organizationId', + localField: 'organization', + + // if you add this to a belongsTo relation + // then js-data will attempt to use + // a nested url structure, e.g. /organization/15/user/4 + parent: true + } + } + } +}); + +var Organization = store.defineResource({ + name: 'organization', + relations: { + hasMany: { + // this is an example of multiple relations + // of the same type to the same resource + user: [ + { + localField: 'users', + foreignKey: 'organizationId' + }, + { + localField: 'owners', + foreignKey: 'organizationId' + } + ] + } + } +}); + +var Profile = store.defineResource({ + name: 'profile', + relations: { + belongsTo: { + user: { + localField: 'user', + localKey: 'userId' + } + } + } +}); + +var OtherComment = store.defineResource({ + name: 'comment', + relations: { + belongsTo: { + user: { + localField: 'user', + localKey: 'userId' + } + } + } +}); + +User.find(10).then(function (user:IUser) { + // let's assume the server only returned the user + user.comments; // undefined + user.profile; // undefined + + User.loadRelations(user, ['comment', 'profile']).then(function (user:IUser) { + user.comments; // array + user.profile; // object + }); +}); + +var OtherOtherComment = store.defineResource({ + name: 'comment', + relations: { + belongsTo: { + post: { + parent: true, + localKey: 'postId', + localField: 'post' + } + } + } +}); + +// The comment isn't in the data store yet, so js-data wouldn't know +// what the id of the parent "post" would be, so we pass it in manually +OtherOtherComment.find(5, {params: {postId: 4}}); // GET /post/4/comment/5 + +// vs + +var promise = OtherOtherComment.find(5); // GET /comment/5 + +promise.then().catch().finally(); + +OtherOtherComment.inject({id: 1, postId: 2}); + +// We don't have to provide the parentKey here +// because js-data found it in the comment +OtherOtherComment.update(1, {content: 'stuff'}); // PUT /post/2/comment/1 + +// If you don't want the nested for just one of the calls then +// you can do the following: +OtherOtherComment.update(1, {content: 'stuff'}, {params: {postId: false}}); // PUT /comment/1 + +var store = new JSData.DS({ + // set the default + beforeCreate: function (resource, data, cb) { + // do something general + cb(null, data); + } +}); + +var User4 = store.defineResource({ + name: 'user', + // set just for this resource + beforeCreate: function (resource, data, cb) { + // do something more specific to "users" + cb(null, data); + } +}); + +User4.create({name: 'John'}, { + // set just for this method call + beforeCreate: function (resource, data, cb) { + // do something specific for this method call + cb(null, data); + } +}); + +module CustomAdapterTest { + + class MyCustomAdapter implements JSData.IDSAdapter { + + // All of the methods shown here must return a promise + +// "definition" is a resource defintion that would +// be returned by DS#defineResource + +// "options" would be the options argument that +// was passed into the DS method that is calling +// the adapter method + + create(definition:JSData.DSResourceDefinition, attrs:Object, options:JSData.DSConfiguration):JSData.JSDataPromise { + // Must resolve the promise with the created item + + var promise:JSData.JSDataPromise; + return promise; + } + + find(definition:JSData.DSResourceDefinition, id:any, options:JSData.DSConfiguration):JSData.JSDataPromise { + // Must resolve the promise with the found item + + var promise:JSData.JSDataPromise; + return promise; + } + + findAll(definition:JSData.DSResourceDefinition, params:JSData.DSFilterParams, options:JSData.DSConfiguration):JSData.JSDataPromise { + // Must resolve the promise with the found items + + var promise:JSData.JSDataPromise; + return promise; + } + + update(definition:JSData.DSResourceDefinition, id:any, attrs:Object, options:JSData.DSConfiguration):JSData.JSDataPromise { + // Must resolve the promise with the updated items + + var promise:JSData.JSDataPromise; + return promise; + } + + updateAll(definition:JSData.DSResourceDefinition, attrs:Object, params:JSData.DSFilterParams, options:JSData.DSConfiguration):JSData.JSDataPromise { + // Must resolve the promise with the updated items + + var promise:JSData.JSDataPromise; + return promise; + } + + destroy(definition:JSData.DSResourceDefinition, id:any, options:JSData.DSConfiguration):JSData.JSDataPromise { + // Must return a promise + + var promise:JSData.JSDataPromise; + return promise; + } + + destroyAll(definition:JSData.DSResourceDefinition, params:JSData.DSFilterParams, options:JSData.DSConfiguration):JSData.JSDataPromise { + // Must return a promise + + var promise:JSData.JSDataPromise; + return promise; + } + } + + var store = new JSData.DS(); + store.registerAdapter('mca', new MyCustomAdapter(), {default: true}); + // the data store will now use your custom adapter by default +} + +/** + * showing the use of open ended interface to realize typings + * on the Datastore.definitions object where all resource definitions + * are saved. + */ + +interface MyCustomDataStore { + + myResource: JSData.DSResourceDefinition +} + +interface MyResourceDefinition { + +} + +module JSData { + + interface DS { + + definitions: MyCustomDataStore; + } +} + +var store = new JSData.DS(); + +var myResourceDefinition = store.defineResource('myResource'); + +myResourceDefinition = store.definitions.myResource; + +/** + * Custom action on datastore resource + */ + +interface Resource { + someProp:string; +} + +interface ActionsForResource { + myAction:JSData.DSActionFn; + myOtherAction:JSData.DSActionFn; +} + +var myOtherAction:JSData.DSActionConfig = { + method: 'GET', + endpoint: 'goHere' +}; + +var resourceWithCustomActions = store.defineResource({ + name: 'actionResource', + actions: { + myAction: { + method: 'POST' + }, + myOtherAction: myOtherAction + } +}); + +resourceWithCustomActions.myAction(3).then((result)=>{ + + var theCustomResult:number = result; +}); + +resourceWithCustomActions.myOtherAction(2, {data:'blub'}).then(()=>{ + // success +}); + +resourceWithCustomActions.find(1).then((result)=>{ + + var aProperty = result.someProp; +}); + +/** + * Instance shorthands + */ + +var customActionResourceInstance = resourceWithCustomActions.get(1); + +customActionResourceInstance.DSCompute(); +customActionResourceInstance.DSChanges(); +customActionResourceInstance.DSChangeHistory(); +customActionResourceInstance.DSHasChanges(); +customActionResourceInstance.DSLastModified(); +customActionResourceInstance.DSLastSaved(); +customActionResourceInstance.DSPrevious(); +customActionResourceInstance.DSCreate(); +customActionResourceInstance.DSDestroy(); +customActionResourceInstance.DSLink(); +customActionResourceInstance.DSLinkInverse(); +customActionResourceInstance.DSLoadRelations('myRelation'); +customActionResourceInstance.DSRefresh(); +customActionResourceInstance.DSSave(); +customActionResourceInstance.DSUnlinkInverse(); +customActionResourceInstance.DSUpdate(); diff --git a/js-data/legacy/js-data-1.5.4.d.ts b/js-data/legacy/js-data-1.5.4.d.ts new file mode 100644 index 000000000..0140d8139 --- /dev/null +++ b/js-data/legacy/js-data-1.5.4.d.ts @@ -0,0 +1,317 @@ +// Type definitions for JSData v1.5.4 +// Project: https://github.com/js-data/js-data +// Definitions by: Stefan Steinhart +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/////////////////////////////////////////////////////////////////////////////// +// js-data module (js-data.js) +/////////////////////////////////////////////////////////////////////////////// + +// defining what exists in JSData and how it looks +declare module JSData { + + interface JSDataPromise { + then(onFulfilled?: (value: R) => U | JSDataPromise, onRejected?: (error: any) => U | JSDataPromise): JSDataPromise; + catch(onRejected?: (error: any) => U | JSDataPromise): JSDataPromise; + // enhanced with finally + finally(finallyCb?:() => U):JSDataPromise; + } + + interface DS { + + new(config?:DSConfiguration):DS; + + // rather undocumented + errors:DSErrors; + + // those are objects containing the defined resources and adapters + definitions:any; + adapters:any; + + defaults:DSConfiguration; + + // async + create(resourceName:string, attrs:Object, options?:DSConfiguration):JSDataPromise>; + destroy(resourceName:string, id:string | number, options?:DSAdapterOperationConfiguration):JSDataPromise; + destroyAll(resourceName:string, params?:DSFilterArg, options?:DSAdapterOperationConfiguration):JSDataPromise; + find(resourceName:string, id:string | number, options?:DSAdapterOperationConfiguration):JSDataPromise>; + findAll(resourceName:string, params?:DSFilterArg, options?:DSAdapterOperationConfiguration):JSDataPromise>>; + loadRelations(resourceName:string, idOrInstance:string | number | Object, relations:string | Array, options?:DSAdapterOperationConfiguration):JSDataPromise>; + update(resourceName:string, id:string | number, attrs:Object, options?:DSSaveConfiguration):JSDataPromise>; + updateAll(resourceName:string, attrs:Object, params?:DSFilterArg, options?:DSAdapterOperationConfiguration):JSDataPromise>>; + reap(resourceName:string, options?:DSConfiguration):JSDataPromise; + refresh(resourceName:string, id:string | number, options?:DSAdapterOperationConfiguration):JSDataPromise>; + save(resourceName:string, id:string | number, options?:DSSaveConfiguration):JSDataPromise>; + + // sync + changeHistory(resourceName:string, id?:string | number):Array; + changes(resourceName:string, id:string | number):Object; + compute(resourceName:string, idOrInstance:number | string | Object ):void; + createInstance(resourceName:string, attrs?:T, options?:DSAdapterOperationConfiguration):T & DSInstanceShorthands; + digest():void; + eject(resourceName:string, id:string | number, options?:DSConfiguration):T & DSInstanceShorthands; + ejectAll(resourceName:string, params:DSFilterArg, options?:DSConfiguration):Array>; + filter(resourceName:string, params:DSFilterArg, options?:DSConfiguration):Array>; + get(resourceName:string, id:string | number, options?:DSConfiguration):T & DSInstanceShorthands; + getAll(resourceName:string, ids?:Array):Array>; + hasChanges(resourceName:string, id:string | number):boolean; + inject(resourceName:string, item:T, options?:DSConfiguration):T & DSInstanceShorthands; + inject(resourceName:string, items:Array, options?:DSConfiguration):Array>; + is(resourceName:string, object:Object): boolean; + lastModified(resourceName:string, id?:string | number):number; // timestamp + lastSaved(resourceName:string, id?:string | number):number; // timestamp + link(resourceName:string, id:string | number, relations?:Array):T & DSInstanceShorthands; + linkAll(resourceName:string, params:DSFilterArg, relations?:Array):T & DSInstanceShorthands; + linkInverse(resourceName:string, id:string | number, relations?:Array):T & DSInstanceShorthands; + previous(resourceName:string, id:string | number):T & DSInstanceShorthands; + revert(resourceName:string, id:string | number):T & DSInstanceShorthands; + unlinkInverse(resourceName:string, id:string | number, relations?:Array):T & DSInstanceShorthands; + + defineResource(resourceNameOrDefinition:string | DSResourceDefinitionConfiguration):DSResourceDefinition; + defineResource(resourceNameOrDefinition:string | DSResourceDefinitionConfiguration):DSResourceDefinition & TActions; + registerAdapter(adapterId:string, adapter:IDSAdapter, options?:{default: boolean}):void; + } + + interface DSConfiguration extends IDSResourceLifecycleEventHandlers { + actions?: Object; + allowSimpleWhere?: boolean; + basePath?: string; + bypassCache?: boolean; + cacheResponse?: boolean; + defaultAdapter?: string; + defaultFilter?: (collection:Array, resourceName:string, params:DSFilterArg, options:DSConfiguration)=>Array; + eagerEject?: boolean; + endpoint?: string; + error?: boolean | ((message?:any, ...optionalParams:any[])=> void); + fallbackAdapters?: Array; + findAllFallbackAdapters?: Array; + findAllStrategy?: string; + findBelongsTo?: boolean; + findFallbackAdapters?: Array; + findHasOne?: boolean; + findHasMany?: boolean; + findInverseLinks?: boolean; + findStrategy?: string + idAttribute?: string; + ignoredChanges?: Array; + keepChangeHistory?: boolean; + loadFromServer?: boolean; + log?: boolean | ((message?: any, ...optionalParams: any[])=> void); + maxAge?: number; + notify?: boolean; + reapAction?: string; + reapInterval?: number; + resetHistoryOnInject?: boolean; + strategy?: string; + upsert?: boolean; + useClass?: boolean; + useFilter?: boolean; + } + + interface DSAdapterOperationConfiguration extends DSConfiguration { + adapter?: string; + params?: { + [paramName: string]: string | number | boolean; + }; + } + + interface DSSaveConfiguration extends DSAdapterOperationConfiguration { + changesOnly?: boolean; + } + + interface DSResourceDefinitionConfiguration extends DSConfiguration { + name: string; + computed?: any; + methods?: any; + relations?: { + hasMany?: Object; + hasOne?: Object; + belongsTo?: Object; + }; + } + + interface DSResourceDefinition extends DSResourceDefinitionConfiguration { + + //async + create(attrs:TInject, options?:DSConfiguration):JSDataPromise>; + destroy(id:string | number, options?:DSAdapterOperationConfiguration):JSDataPromise; + destroyAll(params?:DSFilterArg, options?:DSAdapterOperationConfiguration):JSDataPromise; + find(id:string | number, options?:DSAdapterOperationConfiguration):JSDataPromise>; + findAll(params?:DSFilterArg, options?:DSAdapterOperationConfiguration):JSDataPromise>>; + loadRelations(idOrInstance:string | number | Object, relations:string | Array, options?:DSAdapterOperationConfiguration):JSDataPromise>; + update(id:string | number, attrs:Object, options?:DSSaveConfiguration):JSDataPromise>; + updateAll(attrs:Object, params?:DSFilterArg, options?:DSAdapterOperationConfiguration):JSDataPromise>>; + reap(options?:DSConfiguration):JSDataPromise; + refresh(id:string | number, options?:DSAdapterOperationConfiguration):JSDataPromise>; + save(id:string | number, options?:DSSaveConfiguration):JSDataPromise>; + + // sync + changeHistory(id?:string | number):Array; + changes(id:string | number):Object; + compute(idOrInstance:number | string | Object ):void; + createInstance(attrs?:TInject, options?:DSAdapterOperationConfiguration):T & DSInstanceShorthands; + digest():void; + eject(id:string | number, options?:DSConfiguration):T & DSInstanceShorthands; + ejectAll(params:DSFilterArg, options?:DSConfiguration):Array>; + filter(params:DSFilterArg, options?:DSConfiguration):Array>; + get(id:string | number, options?:DSConfiguration):T & DSInstanceShorthands; + getAll(ids?:Array):Array>; + hasChanges(id:string | number):boolean; + inject(item:T, options?:DSConfiguration):T & DSInstanceShorthands; + inject(items:Array, options?:DSConfiguration):Array>; + is(object:Object): boolean; + lastModified(id?:string | number):number; // timestamp + lastSaved(id?:string | number):number; // timestamp + link(id:string | number, relations?:Array):T & DSInstanceShorthands; + linkAll(params:DSFilterArg, relations?:Array):T & DSInstanceShorthands; + linkInverse(id:string | number, relations?:Array):T & DSInstanceShorthands; + previous(id:string | number):T & DSInstanceShorthands; + unlinkInverse(id:string | number, relations?:Array):T & DSInstanceShorthands; + } + + export interface DSInstanceShorthands { + DSCompute():void; + DSRefresh(options?:DSAdapterOperationConfiguration):JSDataPromise>; + DSSave(options?:DSSaveConfiguration):JSDataPromise>; + DSUpdate(options?:DSAdapterOperationConfiguration):JSDataPromise>; + DSDestroy(options?:DSAdapterOperationConfiguration):JSDataPromise; + DSCreate(options?:DSConfiguration):JSDataPromise>; + DSLoadRelations(relations:string | Array, options?:DSAdapterOperationConfiguration):JSDataPromise>; + DSChangeHistory():Array; + DSChanges():Object; + DSHasChanges():boolean; + DSLastModified():number; // timestamp + DSLastSaved():number; // timestamp + DSLink(relations?:Array):T & DSInstanceShorthands; + DSLinkInverse(relations?:Array):T & DSInstanceShorthands; + DSPrevious():T & DSInstanceShorthands; + DSUnlinkInverse(relations?:Array):T & DSInstanceShorthands; + } + + interface DSFilterParams { + where?: Object; + + limit?: number; + + skip?: number; + offset?: number; + + orderBy?: string | Array | Array>; + sort?: string | Array | Array>; + } + + type DSFilterArg = DSFilterParams | Object; + + interface IDSResourceLifecycleValidateEventHandlers { + beforeValidate?: (resourceName:string, data:any, cb:(err:any, data?:any)=>void)=>void; + validate?: (resourceName:string, data:any, cb:(err:any, data?:any)=>void)=>void; + afterValidate?: (resourceName:string, data:any, cb:(err:any, data?:any)=>void)=>void; + } + + interface IDSResourceLifecycleCreateEventHandlers { + beforeCreate?: (resourceName:string, data:any, cb:(err:any, data?:any)=>void)=>void; + afterCreate?: (resourceName:string, data:any, cb:(err:any, data?:any)=>void)=>void; + } + + interface IDSResourceLifecycleCreateInstanceEventHandlers { + beforeCreateInstance?: (resourceName:string, data:any)=>void; + afterCreateInstance?: (resourceName:string, data:any)=>void; + } + + interface IDSResourceLifecycleUpdateEventHandlers { + beforeUpdate?: (resourceName:string, data:any, cb:(err:any, data?:any)=>void)=>void; + afterUpdate?: (resourceName:string, data:any, cb:(err:any, data?:any)=>void)=>void; + } + + interface IDSResourceLifecycleDestroyEventHandlers { + beforeDestroy?: (resourceName:string, data:any, cb:(err:any, data?:any)=>void)=>void; + afterDestroy?: (resourceName:string, data:any, cb:(err:any, data?:any)=>void)=>void; + } + + interface IDSResourceLifecycleInjectEventHandlers { + beforeInject?: (resourceName:string, data:any)=>void; + afterInject?: (resourceName:string, data:any)=>void; + } + + interface IDSResourceLifecycleEjectEventHandlers { + beforeEject?: (resourceName:string, data:any)=>void; + afterEject?: (resourceName:string, data:any)=>void; + } + + interface IDSResourceLifecycleReapEventHandlers { + beforeReap?: (resourceName:string, data:any)=>void; + afterReap?: (resourceName:string, data:any)=>void; + } + + interface IDSResourceLifecycleEventHandlers extends IDSResourceLifecycleCreateEventHandlers, + IDSResourceLifecycleCreateInstanceEventHandlers, + IDSResourceLifecycleValidateEventHandlers, + IDSResourceLifecycleUpdateEventHandlers, + IDSResourceLifecycleDestroyEventHandlers, + IDSResourceLifecycleInjectEventHandlers, + IDSResourceLifecycleEjectEventHandlers, + IDSResourceLifecycleReapEventHandlers { + + } + + // errors + interface DSErrors { + + // types + IllegalArgumentError:DSError; + IA:DSError; + RuntimeError:DSError; + R:DSError; + NonexistentResourceError:DSError; + NER:DSError; + } + + interface DSError extends Error { + new (message?:string):DSError; + message: string; + type: string; + } + + // DSAdapter interface + interface IDSAdapter { + create(config:DSResourceDefinition, attrs:Object, options?:DSConfiguration):JSDataPromise; + + destroy(config:DSResourceDefinition, id:string | number, options?:DSConfiguration):JSDataPromise; + + destroyAll(config:DSResourceDefinition, params:DSFilterArg, options?:DSConfiguration):JSDataPromise; + + find(config:DSResourceDefinition, id:string | number, options?:DSConfiguration):JSDataPromise; + + findAll(config:DSResourceDefinition, params?:DSFilterArg, options?:DSConfiguration):JSDataPromise; + + update(config:DSResourceDefinition, id:string | number, attrs:Object, options?:DSConfiguration):JSDataPromise; + updateAll(config:DSResourceDefinition, attrs:Object, params?:DSFilterArg, options?:DSConfiguration):JSDataPromise; + } + + // Custom action config + interface DSActionConfig { + adapter?: string; + endpoint?: string; + pathname?: string; + method?: string; + } + + // Custom action method definition + // options are passed to adapter.HTTP() method-call, js-data-http adapter by default uses AXIOS but can also be $http in case of angular + // or a custom adapter implementation. The adapter can be set via the DSActionConfig. + interface DSActionFn { + (id:string | number, options?:Object):JSDataPromise + } +} + +// declaring the existing global js object +declare var JSData:{ + DS: JSData.DS; + DSErrors: JSData.DSErrors; +}; + +//Support node require +declare module 'js-data' { + + export = JSData; +} diff --git a/js-data/legacy/js-data-node-1.5.4-tests.ts b/js-data/legacy/js-data-node-1.5.4-tests.ts new file mode 100644 index 000000000..2a89031e7 --- /dev/null +++ b/js-data/legacy/js-data-node-1.5.4-tests.ts @@ -0,0 +1,11 @@ +/// + +import JSData = require('js-data'); +var store = new JSData.DS(); + +// simplest model definition +var User = store.defineResource('user'); + +User.find(1).then(function (user: any) { + user; // { id: 1, name: 'John' } +}); diff --git a/jsnlog/jsnlog-tests.ts b/jsnlog/jsnlog-tests.ts new file mode 100644 index 000000000..dfb32a6c8 --- /dev/null +++ b/jsnlog/jsnlog-tests.ts @@ -0,0 +1,80 @@ +/// + +// ---------------------------------------------------------- +// JL + +var traceLevel: number = JL.getTraceLevel(); +var debugLevel: number = JL.getDebugLevel(); +var infoLevel: number = JL.getInfoLevel(); +var warnLevel: number = JL.getWarnLevel(); +var errorLevel: number = JL.getErrorLevel(); +var fatalLevel: number = JL.getFatalLevel(); + +JL.setOptions({ + enabled: true, + maxMessages: 5, + defaultAjaxUrl: '/jsnlog.logger', + clientIP: '0.0.0.0', + requestId: 'a reuest id', + defaultBeforeSend: null +}); + +// ---------------------------------------------------------- +// Ajax Appender + +var ajaxAppender1: JSNLog.JSNLogAjaxAppender = JL.createAjaxAppender('ajaxAppender'); + +ajaxAppender1.setOptions({ + level: 5000, + ipRegex: 'a regex', + userAgentRegex: 'a user agent string', + disallow: 'regex matching suppressed messages', + sendWithBufferLevel: 5000, + storeInBufferLevel: 2000, + bufferSize: 10, + batchSize: 2, + url: '/jsnlog.logger', + beforeSend: null +}); + +// ---------------------------------------------------------- +// Console Appender + +var consoleAppender1: JSNLog.JSNLogConsoleAppender = JL.createConsoleAppender('consoleAppender'); + +consoleAppender1.setOptions({ + level: 5000, + ipRegex: 'a regex', + userAgentRegex: 'a user agent string', + disallow: 'regex matching suppressed messages', + sendWithBufferLevel: 5000, + storeInBufferLevel: 2000, + bufferSize: 10, + batchSize: 2 +}); + + +// ---------------------------------------------------------- +// Loggers + +var logger1: JSNLog.JSNLogLogger = JL('mylogger'); + +var exception = {}; + +logger1.trace('log message').debug({ x: 1, y: 2}); +logger1.info(function() { return 5; }); +logger1.warn('log message'); +logger1.error('log message'); +logger1.fatal('log message'); +logger1.fatalException('log message', exception); +logger1.log(4000, 'log message', exception); + +logger1.setOptions({ + level: 5000, + ipRegex: 'a regex', + userAgentRegex: 'a user agent string', + disallow: 'regex matching suppressed messages', + appenders: [ ajaxAppender1, consoleAppender1 ], + onceOnly: [ 'regex1', 'regex2' ] +}); + diff --git a/jsnlog/jsnlog.d.ts b/jsnlog/jsnlog.d.ts new file mode 100644 index 000000000..da9893fc7 --- /dev/null +++ b/jsnlog/jsnlog.d.ts @@ -0,0 +1,112 @@ +// Type definitions for JSNLog v2.11.0+ +// Project: https://github.com/mperdeck/jsnlog.js +// Definitions by: Mattijs Perdeck +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +// ------------------------------- +// Full documentation is at +// http://jsnlog.com +// ------------------------------- + +/** +* Copyright 2015 Mattijs Perdeck. +* +* This project is licensed under the MIT license. +* +* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +// Declarations of all interfaces and ambient objects, except for JL itself. +// Provides strong typing in both jsnlog.ts itself and in TypeScript programs that use +// JSNLog. + +declare module JSNLog { + + interface JSNLogOptions { + enabled?: boolean; + maxMessages?: number; + defaultAjaxUrl?: string; + clientIP?: string; + requestId?: string; + defaultBeforeSend?: (xhr: XMLHttpRequest) => void; + } + + interface JSNLogFilterOptions { + level?: number; + ipRegex?: string; + userAgentRegex?: string; + disallow?: string; + } + + interface JSNLogLoggerOptions extends JSNLogFilterOptions { + appenders?: JSNLogAppender[]; + onceOnly?: string[]; + } + + // Base for all appender options types + interface JSNLogAppenderOptions extends JSNLogFilterOptions { + sendWithBufferLevel?: number; + storeInBufferLevel?: number; + bufferSize?: number; + batchSize?: number; + } + + interface JSNLogAjaxAppenderOptions extends JSNLogAppenderOptions { + url?: string; + beforeSend?: (xhr: XMLHttpRequest) => void; + } + + interface JSNLogLogger { + setOptions(options: JSNLogLoggerOptions): JSNLogLogger; + + trace(logObject: any): JSNLogLogger; + debug(logObject: any): JSNLogLogger; + info(logObject: any): JSNLogLogger; + warn(logObject: any): JSNLogLogger; + error(logObject: any): JSNLogLogger; + fatal(logObject: any): JSNLogLogger; + fatalException(logObject: any, e: any): JSNLogLogger; + log(level: number, logObject: any, e?: any): JSNLogLogger; + } + + interface JSNLogAppender { + setOptions(options: JSNLogAppenderOptions): JSNLogAppender; + } + + interface JSNLogAjaxAppender extends JSNLogAppender { + setOptions(options: JSNLogAjaxAppenderOptions): JSNLogAjaxAppender; + } + + interface JSNLogConsoleAppender extends JSNLogAppender { + } + + interface JSNLogStatic { + (loggerName?: string): JSNLogLogger; + + setOptions(options: JSNLogOptions): JSNLogStatic; + createAjaxAppender(appenderName: string): JSNLogAjaxAppender; + createConsoleAppender(appenderName: string): JSNLogConsoleAppender; + + getTraceLevel(): number; + getDebugLevel(): number; + getInfoLevel(): number; + getWarnLevel(): number; + getErrorLevel(): number; + getFatalLevel(): number; + } +} + +declare function __jsnlog_configure(jsnlog: JSNLog.JSNLogStatic): void; + + +// Ambient declaration of the JL object itself + +declare var JL: JSNLog.JSNLogStatic; + + + + diff --git a/jsnox/jsnox-tests.ts b/jsnox/jsnox-tests.ts index e34d71b4a..33e58720e 100644 --- a/jsnox/jsnox-tests.ts +++ b/jsnox/jsnox-tests.ts @@ -19,7 +19,7 @@ var clickHandler: React.MouseEventHandler // Tests with spec string function spec_string () { - var result: React.HTMLComponent + var result: React.ReactHTMLElement // just spec string result = $('div') diff --git a/jsnox/jsnox.d.ts b/jsnox/jsnox.d.ts index dfb59e280..22291956d 100644 --- a/jsnox/jsnox.d.ts +++ b/jsnox/jsnox.d.ts @@ -31,7 +31,7 @@ declare module 'jsnox' { * @param children A single React node (string or ReactElement) or array of nodes. * Note that unlike with React itself, multiple children must be placed into an array. */ - (specString: string, children: React.ReactNode): React.HTMLComponent +

    (specString: string, children: React.ReactNode): React.DOMElement

    /** * Renders an HTML element from the given spec string, with optional props @@ -42,7 +42,7 @@ declare module 'jsnox' { * @param children A single React node (string or ReactElement) or array of nodes. * Note that unlike with React itself, multiple children must be placed into an array. */ - (specString: string, props?: React.HTMLAttributes, children?: React.ReactNode): React.HTMLComponent +

    (specString: string, props?: React.HTMLAttributes, children?: React.ReactNode): React.DOMElement

    /** diff --git a/jsonwebtoken/jsonwebtoken-tests.ts b/jsonwebtoken/jsonwebtoken-tests.ts index 52f116335..6aadaa82c 100644 --- a/jsonwebtoken/jsonwebtoken-tests.ts +++ b/jsonwebtoken/jsonwebtoken-tests.ts @@ -57,6 +57,18 @@ jwt.verify(token, cert, { audience: 'urn:foo', issuer: 'urn:issuer' }, function( // if issuer mismatch, err == invalid issuer }); +// verify algorithm +cert = fs.readFileSync('public.pem'); // get public key +jwt.verify(token, cert, { algorithms: ['RS256'] }, function(err, decoded) { + // if algorithm mismatch, err == invalid algorithm +}); + +// verify without expiration check +cert = fs.readFileSync('public.pem'); // get public key +jwt.verify(token, cert, { ignoreExpiration: true }, function(err, decoded) { + // if ignoreExpration == false and token is expired, err == expired token +}); + /** * jwt.decode * https://github.com/auth0/node-jsonwebtoken#jwtdecodetoken diff --git a/jsonwebtoken/jsonwebtoken.d.ts b/jsonwebtoken/jsonwebtoken.d.ts index 205970f6a..b558df2e5 100644 --- a/jsonwebtoken/jsonwebtoken.d.ts +++ b/jsonwebtoken/jsonwebtoken.d.ts @@ -22,8 +22,13 @@ declare module "jsonwebtoken" { * - none: No digital signature or MAC value included */ algorithm?: string; - /** @member {number} - Lifetime for the token in minutes */ + /** + *@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; audience?: string; subject?: string; issuer?: string; @@ -31,8 +36,11 @@ declare module "jsonwebtoken" { } export interface VerifyOptions { + algorithms?: string[]; audience?: string; issuer?: string; + ignoreExpiration?: boolean; + maxAge?: string; } export interface VerifyCallbak { diff --git a/jsuri/jsuri.d.ts b/jsuri/jsuri.d.ts index a50002140..c96d42092 100644 --- a/jsuri/jsuri.d.ts +++ b/jsuri/jsuri.d.ts @@ -1,6 +1,6 @@ // Type definitions for jsUri 1.3+ // Project: https://github.com/derek-watson/jsUri -// Definitions by: Chris Charabaruk +// Definitions by: Chris Charabaruk , Florian Wagner // Definitions: https://github.com/borisyankov/DefinitelyTyped declare module jsuri { @@ -135,5 +135,9 @@ declare module jsuri { declare type Uri = jsuri.Uri; declare module 'jsuri' { - export = Uri; + export = jsuri.Uri; +} + +declare module 'jsUri' { + export = jsuri.Uri; } diff --git a/jwt-decode/jwt-decode-tests.ts b/jwt-decode/jwt-decode-tests.ts new file mode 100644 index 000000000..66d639b40 --- /dev/null +++ b/jwt-decode/jwt-decode-tests.ts @@ -0,0 +1,12 @@ + /// +import jwtDecode = require('jwt-decode'); + +let token = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJmb28iOiJiYXIiLCJleHAiOjEzOTMyODY4OTMsImlhdCI6MTM5MzI2ODg5M30.4-iaDojEVl0pJQMjrbM1EzUIfAZgsbK_kgnVyVxFSVo"; + +interface TokenDto { + foo: string; + exp: number; + iat: number; +} + +let decodedToken = jwtDecode(token) as TokenDto; diff --git a/jwt-decode/jwt-decode.d.ts b/jwt-decode/jwt-decode.d.ts new file mode 100644 index 000000000..67d7aac16 --- /dev/null +++ b/jwt-decode/jwt-decode.d.ts @@ -0,0 +1,16 @@ +// Type definitions for jwt-decode v1.4.0 +// Project: https://github.com/auth0/jwt-decode +// Definitions by: Giedrius Grabauskas +// Definitions: https://github.com/borisyankov/DefinitelyTyped + + +declare module JwtDecode { + interface JwtDecodeStatic { + (token: string): any; + } +} + +declare module 'jwt-decode' { + var jwtDecode: JwtDecode.JwtDecodeStatic; + export = jwtDecode; +} diff --git a/kendo-ui/kendo-ui-tests.ts b/kendo-ui/kendo-ui-tests.ts index 3c8a9bc04..fba08a02e 100644 --- a/kendo-ui/kendo-ui-tests.ts +++ b/kendo-ui/kendo-ui-tests.ts @@ -1,2 +1,26 @@ /// /// + +var is = { + string: (msg: string) => { + return true; + } +} + +// TreeView +$(() => { + var treeview = $("#treeview").data("kendoTreeView"); + + is.string(treeview.text("#foo")); + + treeview.text("#foo", "bar"); +}); + +// Window +$(() => { + var window = $("#window").data("kendoWindow"); + + var dom = $("Foo"); + + window.content(dom); +}); diff --git a/kendo-ui/kendo-ui.d.ts b/kendo-ui/kendo-ui.d.ts index 0683ab238..5168cdb84 100644 --- a/kendo-ui/kendo-ui.d.ts +++ b/kendo-ui/kendo-ui.d.ts @@ -1,8 +1,10 @@ -// Type definitions for Kendo UI Professional v2015.1.609 +// Type definitions for Kendo UI Professional v2015.3.1111 // Project: http://www.telerik.com/kendo-ui // Definitions by: Telerik // Definitions: https://github.com/borisyankov/DefinitelyTyped +/// + declare module kendo { function culture(): { name: string; @@ -87,7 +89,7 @@ declare module kendo { }; }; - var cultures: {[culture:string] : { + var cultures: {[culture: string] : { name?: string; calendar?: { AM: string[]; @@ -183,7 +185,7 @@ declare module kendo { function observable(data: any): kendo.data.ObservableObject; function observableHierarchy(array: any[]): kendo.data.ObservableArray; - function render(template:(data: any) => string, data: any[]): string; + function render(template: (data: any) => string, data: any[]): string; function template(template: string, options?: TemplateOptions): (data: any) => string; function guid(): string; @@ -214,7 +216,7 @@ declare module kendo { F2: number; F10: number; F12: number; - } + }; var support: { touch: boolean; @@ -242,7 +244,7 @@ declare module kendo { opera: boolean; version: string; }; - } + }; interface TemplateOptions { paramName?: string; @@ -268,6 +270,7 @@ declare module kendo { tagName?: string; wrap?: boolean; model?: Object; + evalTemplate?: boolean; init?: (e: ViewEvent) => void; show?: (e: ViewEvent) => void; hide?: (e: ViewEvent) => void; @@ -275,21 +278,21 @@ declare module kendo { interface ViewEvent { sender: View; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } class View extends Observable { constructor(element: Element, options?: ViewOptions); constructor(element: string, options?: ViewOptions); - init(element: Element, options?: ViewOptions): void; - init(element: string, options?: ViewOptions): void; - render(container?: any): JQuery; - destroy(): void; element: JQuery; content: any; tagName: string; model: Object; + init(element: Element, options?: ViewOptions): void; + init(element: string, options?: ViewOptions): void; + render(container?: any): JQuery; + destroy(): void; } class ViewContainer extends Observable { @@ -297,15 +300,15 @@ declare module kendo { } class Layout extends View { - showIn(selector: string, view: View): void; containers: { [selector: string]: ViewContainer; }; + showIn(selector: string, view: View): void; } class History extends Observable { - start(options: Object): void; - stop(): void; current: string; root: string; + start(options: Object): void; + stop(): void; change(callback: Function): void; navigate(location: string, silent?: boolean): void; } @@ -320,9 +323,9 @@ declare module kendo { interface RouterEvent { sender: Router; - isDefaultPrevented(): boolean; - preventDefault: Function; url: string; + preventDefault: Function; + isDefaultPrevented(): boolean; } class Route extends Class { @@ -333,12 +336,13 @@ declare module kendo { class Router extends Observable { constructor(options?: RouterOptions); + routes: Route[]; init(options?: RouterOptions): void; start(): void; destroy(): void; route(route: string, callback: Function): void; navigate(location: string, silent?: boolean): void; - routes: Route[]; + replace(location: string, silent?: boolean): void; } } @@ -457,8 +461,8 @@ declare module kendo.data { source: any; parents: any[]; path: string; - dependencies: { [path: string]: boolean; }; observable: boolean; + dependencies: { [path: string]: boolean; }; constructor(parents: any[], path: string); change(e: Object): void; start(source: kendo.Observable): void; @@ -491,17 +495,16 @@ declare module kendo.data { class Binder extends Class { static fn: Binder; - static extend(prototype: Object): Binder; - element: any; bindings: Bindings; + options: BinderOptions; constructor(element: any, bindings: Bindings, options?: BinderOptions); + static extend(prototype: Object): Binder; init(element: any, bindings: Bindings, options?: BinderOptions): void; bind(binding: Binding, attribute: string): void; destroy(): void; refresh(): void; refresh(attribute: string): void; - options: BinderOptions; } interface BinderOptions { @@ -509,32 +512,35 @@ declare module kendo.data { class ObservableObject extends Observable{ constructor(value?: any); + uid: string; init(value?: any): void; get(name: string): any; parent(): ObservableObject; set(name: string, value: any): void; toJSON(): Object; - uid: string; } class Model extends ObservableObject { + static idField: string; + static fields: DataSourceSchemaModelFields; + idField: string; _defaultId: any; fields: DataSourceSchemaModelFields; defaults: { [field: string]: any; }; - constructor(data?: any); - init(data?: any):void; - accept(data?: any): void; - dirty: boolean; id: any; - editable(field: string): boolean; - isNew(): boolean; - static idField: string; - static fields: DataSourceSchemaModelFields; + dirty: boolean; + static define(options: DataSourceSchemaModelWithFieldsObject): typeof Model; static define(options: DataSourceSchemaModelWithFieldsArray): typeof Model; + + constructor(data?: any); + init(data?: any): void; + accept(data?: any): void; + editable(field: string): boolean; + isNew(): boolean; } interface SchedulerEventData { @@ -552,8 +558,10 @@ declare module kendo.data { } class SchedulerEvent extends Model { + static idField: string; + static fields: DataSourceSchemaModelFields; + constructor(data?: SchedulerEventData); - init(data?: SchedulerEventData): void; description: string; end: Date; @@ -566,10 +574,11 @@ declare module kendo.data { recurrenceRule: string; recurrenceException: string; title: string; - static idField: string; - static fields: DataSourceSchemaModelFields; + static define(options: DataSourceSchemaModelWithFieldsObject): typeof SchedulerEvent; static define(options: DataSourceSchemaModelWithFieldsArray): typeof SchedulerEvent; + + init(data?: SchedulerEventData): void; clone(options: any, updateUid: boolean): SchedulerEvent; duration(): number; expand(start: Date, end: Date, zone: any): SchedulerEvent[]; @@ -583,19 +592,19 @@ declare module kendo.data { } class TreeListModel extends Model { - constructor(data?: any); - init(data?: any): void; + static idField: string; + static fields: DataSourceSchemaModelFields; id: any; parentId: any; - loaded(value: boolean): void; - loaded(): boolean; - - static idField: string; - static fields: DataSourceSchemaModelFields; static define(options: DataSourceSchemaModelWithFieldsObject): typeof TreeListModel; static define(options: DataSourceSchemaModelWithFieldsArray): typeof TreeListModel; + + constructor(data?: any); + init(data?: any): void; + loaded(value: boolean): void; + loaded(): boolean; } class TreeListDataSource extends DataSource { @@ -619,36 +628,40 @@ declare module kendo.data { } class GanttTask extends Model { - constructor(data?: any); - init(data?: any): void; - - id: any; - parentId: number; - orderId: number; - title: string; - start: Date; - end: Date; - percentComplete: number; - summary: boolean; - expanded: boolean; static idField: string; static fields: DataSourceSchemaModelFields; + + id: any; + parentId: number; + orderId: number; + title: string; + start: Date; + end: Date; + percentComplete: number; + summary: boolean; + expanded: boolean; + static define(options: DataSourceSchemaModelWithFieldsObject): typeof GanttTask; static define(options: DataSourceSchemaModelWithFieldsArray): typeof GanttTask; + + constructor(data?: any); + init(data?: any): void; } class GanttDependency extends Model { - constructor(data?: any); - init(data?: any): void; - - id: any; - predecessorId: number; - successorId: number; - type: number; static idField: string; static fields: DataSourceSchemaModelFields; + + id: any; + predecessorId: number; + successorId: number; + type: number; + static define(options: DataSourceSchemaModelWithFieldsObject): typeof GanttDependency; static define(options: DataSourceSchemaModelWithFieldsArray): typeof GanttDependency; + + constructor(data?: any); + init(data?: any): void; } class Node extends Model { @@ -836,13 +849,14 @@ declare module kendo.data { } interface DataSourceTransport { - parameterMap?(data: DataSourceTransportParameterMapData, type: string): any; create?: DataSourceTransportCreate; destroy?: DataSourceTransportDestroy; push?: Function; read?: DataSourceTransportRead; signalr?: DataSourceTransportSignalr; update?: DataSourceTransportUpdate; + + parameterMap?(data: DataSourceTransportParameterMapData, type: string): any; } interface DataSourceTransportSignalrClient { @@ -950,10 +964,11 @@ declare module kendo.data { } class ObservableArray extends Observable { - constructor(array: any[]); - init(array: any[]): void; + length: number; [index: number]: any; + constructor(array: any[]); + init(array: any[]): void; empty(): void; every(callback: (item: Object, index: number, source: ObservableArray) => boolean): boolean; filter(callback: (item: Object, index: number, source: ObservableArray) => boolean): any[]; @@ -961,7 +976,6 @@ declare module kendo.data { forEach(callback: (item: Object, index: number, source: ObservableArray) => void ): void; indexOf(item: any): number; join(separator: string): string; - length: number; map(callback: (item: Object, index: number, source: ObservableArray) => any): any[]; parent(): ObservableObject; pop(): ObservableObject; @@ -986,10 +1000,12 @@ declare module kendo.data { } class DataSource extends Observable{ + options: DataSourceOptions; + + static create(options?: DataSourceOptions): DataSource; + constructor(options?: DataSourceOptions); init(options?: DataSourceOptions): void; - static create(options?: DataSourceOptions): DataSource; - options: DataSourceOptions; add(model: Object): kendo.data.Model; add(model: kendo.data.Model): kendo.data.Model; aggregate(val: any): void; @@ -1020,6 +1036,12 @@ declare module kendo.data { page(page: number): void; pageSize(): number; pageSize(size: number): void; + pushCreate(model: Object): void; + pushCreate(models: any[]): void; + pushDestroy(model: Object): void; + pushDestroy(models: any[]): void; + pushUpdate(model: Object): void; + pushUpdate(models: any[]): void; query(options?: any): JQueryPromise; read(data?: any): JQueryPromise; remove(model: kendo.data.ObservableObject): void; @@ -1077,7 +1099,7 @@ declare module kendo.data { dir?: string; } - interface DataSourceTransportCreate { + interface DataSourceTransportCreate extends JQueryAjaxSettings { cache?: boolean; contentType?: string; data?: any; @@ -1086,7 +1108,7 @@ declare module kendo.data { url?: any; } - interface DataSourceTransportDestroy { + interface DataSourceTransportDestroy extends JQueryAjaxSettings { cache?: boolean; contentType?: string; data?: any; @@ -1095,7 +1117,7 @@ declare module kendo.data { url?: any; } - interface DataSourceTransportRead { + interface DataSourceTransportRead extends JQueryAjaxSettings { cache?: boolean; contentType?: string; data?: any; @@ -1104,7 +1126,7 @@ declare module kendo.data { url?: any; } - interface DataSourceTransportUpdate { + interface DataSourceTransportUpdate extends JQueryAjaxSettings { cache?: boolean; contentType?: string; data?: any; @@ -1221,7 +1243,7 @@ declare module kendo.data { } declare module kendo.data.transports { - var odata : DataSourceTransport; + var odata: DataSourceTransport; } declare module kendo.ui { @@ -1229,6 +1251,11 @@ declare module kendo.ui { class Widget extends Observable { static fn: Widget; + + element: JQuery; + options: Object; + events: string[]; + static extend(prototype: Object): Widget; constructor(element: Element, options?: Object); @@ -1238,11 +1265,8 @@ declare module kendo.ui { init(element: JQuery, options?: Object): void; init(selector: String, options?: Object): void; destroy(): void; - element: JQuery; setOptions(options: Object): void; resize(force?: boolean): void; - options: Object; - events: string[]; } function plugin(widget: typeof kendo.ui.Widget, register?: typeof kendo.ui, prefix?: String): void; @@ -1359,17 +1383,18 @@ declare module kendo.mobile { function init(element: Element): void; class Application extends Observable { + options: ApplicationOptions; + router: kendo.Router; + pane: kendo.mobile.ui.Pane; + constructor(element?: any, options?: ApplicationOptions); init(element?: any, options?: ApplicationOptions): void; - options: ApplicationOptions; hideLoading(): void; navigate(url: string, transition?: string): void; replace(url: string, transition?: string): void; scroller(): kendo.mobile.ui.Scroller; showLoading(): void; view(): kendo.mobile.ui.View; - router: kendo.Router; - pane: kendo.mobile.ui.Pane; } interface ApplicationOptions { @@ -1429,9 +1454,732 @@ declare module kendo.dataviz.map.layer { } } +declare module kendo.drawing.pdf { + function saveAs(group: kendo.drawing.Group, fileName: string, + proxyUrl?: string, callback?: Function): void; +} + +declare module kendo.drawing { + class Arc extends kendo.drawing.Element { + + + options: ArcOptions; + + + constructor(geometry: kendo.geometry.Arc, options?: ArcOptions); + + + bbox(): kendo.geometry.Rect; + clip(): kendo.drawing.Path; + clip(clip: kendo.drawing.Path): void; + clippedBBox(): kendo.geometry.Rect; + geometry(): kendo.geometry.Arc; + geometry(value: kendo.geometry.Arc): void; + fill(color: string, opacity?: number): kendo.drawing.Arc; + opacity(): number; + opacity(opacity: number): void; + stroke(color: string, width?: number, opacity?: number): kendo.drawing.Arc; + transform(): kendo.geometry.Transformation; + transform(transform: kendo.geometry.Transformation): void; + visible(): boolean; + visible(visible: boolean): void; + + } + + interface ArcOptions { + name?: string; + clip?: kendo.drawing.Path; + fill?: kendo.drawing.FillOptions; + opacity?: number; + stroke?: kendo.drawing.StrokeOptions; + transform?: kendo.geometry.Transformation; + visible?: boolean; + } + interface ArcEvent { + sender: Arc; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + + class Circle extends kendo.drawing.Element { + + + options: CircleOptions; + + + constructor(geometry: kendo.geometry.Circle, options?: CircleOptions); + + + bbox(): kendo.geometry.Rect; + clip(): kendo.drawing.Path; + clip(clip: kendo.drawing.Path): void; + clippedBBox(): kendo.geometry.Rect; + geometry(): kendo.geometry.Circle; + geometry(value: kendo.geometry.Circle): void; + fill(color: string, opacity?: number): kendo.drawing.Circle; + opacity(): number; + opacity(opacity: number): void; + stroke(color: string, width?: number, opacity?: number): kendo.drawing.Circle; + transform(): kendo.geometry.Transformation; + transform(transform: kendo.geometry.Transformation): void; + visible(): boolean; + visible(visible: boolean): void; + + } + + interface CircleOptions { + name?: string; + clip?: kendo.drawing.Path; + fill?: kendo.drawing.FillOptions; + opacity?: number; + stroke?: kendo.drawing.StrokeOptions; + transform?: kendo.geometry.Transformation; + visible?: boolean; + } + interface CircleEvent { + sender: Circle; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + + class Element extends kendo.Class { + + + options: ElementOptions; + + + constructor(options?: ElementOptions); + + + bbox(): kendo.geometry.Rect; + clip(): kendo.drawing.Path; + clip(clip: kendo.drawing.Path): void; + clippedBBox(): kendo.geometry.Rect; + opacity(): number; + opacity(opacity: number): void; + transform(): kendo.geometry.Transformation; + transform(transform: kendo.geometry.Transformation): void; + visible(): boolean; + visible(visible: boolean): void; + + } + + interface ElementOptions { + name?: string; + clip?: kendo.drawing.Path; + opacity?: number; + transform?: kendo.geometry.Transformation; + visible?: boolean; + } + interface ElementEvent { + sender: Element; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + + interface FillOptions { + + + + color: string; + opacity: number; + + + + + } + + + + class Gradient extends kendo.Class { + + + options: GradientOptions; + + stops: any; + + constructor(options?: GradientOptions); + + + addStop(offset: number, color: string, opacity: number): kendo.drawing.GradientStop; + removeStop(stop: kendo.drawing.GradientStop): void; + + } + + interface GradientOptions { + name?: string; + stops?: any; + } + interface GradientEvent { + sender: Gradient; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + + class GradientStop extends kendo.Class { + + + options: GradientStopOptions; + + + constructor(options?: GradientStopOptions); + + + + } + + interface GradientStopOptions { + name?: string; + offset?: number; + color?: string; + opacity?: number; + } + interface GradientStopEvent { + sender: GradientStop; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + + class Group extends kendo.drawing.Element { + + + options: GroupOptions; + + children: any; + + constructor(options?: GroupOptions); + + + append(element: kendo.drawing.Element): void; + clear(): void; + clip(): kendo.drawing.Path; + clip(clip: kendo.drawing.Path): void; + clippedBBox(): kendo.geometry.Rect; + insert(position: number, element: kendo.drawing.Element): void; + opacity(): number; + opacity(opacity: number): void; + remove(element: kendo.drawing.Element): void; + removeAt(index: number): void; + visible(): boolean; + visible(visible: boolean): void; + + } + + interface GroupOptions { + name?: string; + clip?: kendo.drawing.Path; + opacity?: number; + pdf?: kendo.drawing.PDFOptions; + transform?: kendo.geometry.Transformation; + visible?: boolean; + } + interface GroupEvent { + sender: Group; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + + class Image extends kendo.drawing.Element { + + + options: ImageOptions; + + + constructor(src: string, rect: kendo.geometry.Rect); + + + bbox(): kendo.geometry.Rect; + clip(): kendo.drawing.Path; + clip(clip: kendo.drawing.Path): void; + clippedBBox(): kendo.geometry.Rect; + opacity(): number; + opacity(opacity: number): void; + src(): string; + src(value: string): void; + rect(): kendo.geometry.Rect; + rect(value: kendo.geometry.Rect): void; + transform(): kendo.geometry.Transformation; + transform(transform: kendo.geometry.Transformation): void; + visible(): boolean; + visible(visible: boolean): void; + + } + + interface ImageOptions { + name?: string; + clip?: kendo.drawing.Path; + opacity?: number; + transform?: kendo.geometry.Transformation; + visible?: boolean; + } + interface ImageEvent { + sender: Image; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + + class Layout extends kendo.drawing.Group { + + + options: LayoutOptions; + + + constructor(rect: kendo.geometry.Rect, options?: LayoutOptions); + + + rect(): kendo.geometry.Rect; + rect(rect: kendo.geometry.Rect): void; + reflow(): void; + + } + + interface LayoutOptions { + name?: string; + alignContent?: string; + alignItems?: string; + justifyContent?: string; + lineSpacing?: number; + spacing?: number; + orientation?: string; + wrap?: boolean; + } + interface LayoutEvent { + sender: Layout; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + + class LinearGradient extends kendo.drawing.Gradient { + + + options: LinearGradientOptions; + + stops: any; + + constructor(options?: LinearGradientOptions); + + + addStop(offset: number, color: string, opacity: number): kendo.drawing.GradientStop; + end(): kendo.geometry.Point; + end(end: any): void; + end(end: kendo.geometry.Point): void; + start(): kendo.geometry.Point; + start(start: any): void; + start(start: kendo.geometry.Point): void; + removeStop(stop: kendo.drawing.GradientStop): void; + + } + + interface LinearGradientOptions { + name?: string; + stops?: any; + } + interface LinearGradientEvent { + sender: LinearGradient; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + + class MultiPath extends kendo.drawing.Element { + + + options: MultiPathOptions; + + paths: any; + + constructor(options?: MultiPathOptions); + + + bbox(): kendo.geometry.Rect; + clip(): kendo.drawing.Path; + clip(clip: kendo.drawing.Path): void; + clippedBBox(): kendo.geometry.Rect; + close(): kendo.drawing.MultiPath; + 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; + curveTo(controlOut: any, controlIn: kendo.geometry.Point, endPoint: kendo.geometry.Point): kendo.drawing.MultiPath; + curveTo(controlOut: kendo.geometry.Point, controlIn: any, endPoint: any): kendo.drawing.MultiPath; + curveTo(controlOut: kendo.geometry.Point, controlIn: any, endPoint: kendo.geometry.Point): kendo.drawing.MultiPath; + curveTo(controlOut: kendo.geometry.Point, controlIn: kendo.geometry.Point, endPoint: any): kendo.drawing.MultiPath; + curveTo(controlOut: kendo.geometry.Point, controlIn: kendo.geometry.Point, endPoint: kendo.geometry.Point): kendo.drawing.MultiPath; + fill(color: string, opacity?: number): kendo.drawing.MultiPath; + lineTo(x: number, y?: number): kendo.drawing.MultiPath; + lineTo(x: any, y?: number): kendo.drawing.MultiPath; + lineTo(x: kendo.geometry.Point, y?: number): kendo.drawing.MultiPath; + moveTo(x: number, y?: number): kendo.drawing.MultiPath; + moveTo(x: any, y?: number): kendo.drawing.MultiPath; + moveTo(x: kendo.geometry.Point, y?: number): kendo.drawing.MultiPath; + opacity(): number; + opacity(opacity: number): void; + stroke(color: string, width?: number, opacity?: number): kendo.drawing.MultiPath; + transform(): kendo.geometry.Transformation; + transform(transform: kendo.geometry.Transformation): void; + visible(): boolean; + visible(visible: boolean): void; + + } + + interface MultiPathOptions { + name?: string; + clip?: kendo.drawing.Path; + fill?: kendo.drawing.FillOptions; + opacity?: number; + stroke?: kendo.drawing.StrokeOptions; + transform?: kendo.geometry.Transformation; + visible?: boolean; + } + interface MultiPathEvent { + sender: MultiPath; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + + class OptionsStore extends kendo.Class { + + + options: OptionsStoreOptions; + + observer: any; + + constructor(options?: OptionsStoreOptions); + + + get(field: string): any; + set(field: string, value: any): void; + + } + + interface OptionsStoreOptions { + name?: string; + } + interface OptionsStoreEvent { + sender: OptionsStore; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + + interface PDFOptions { + + + + creator: string; + date: Date; + keywords: string; + landscape: boolean; + margin: any; + paperSize: any; + subject: string; + title: string; + + + + + } + + + + class Path extends kendo.drawing.Element { + + + options: PathOptions; + + segments: any; + + constructor(options?: PathOptions); + + static fromPoints(points: any): kendo.drawing.Path; + static fromRect(rect: kendo.geometry.Rect): kendo.drawing.Path; + static parse(svgPath: string, options?: any): kendo.drawing.Path; + + bbox(): kendo.geometry.Rect; + clip(): kendo.drawing.Path; + clip(clip: kendo.drawing.Path): void; + clippedBBox(): kendo.geometry.Rect; + close(): kendo.drawing.Path; + 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; + curveTo(controlOut: any, controlIn: kendo.geometry.Point, endPoint: kendo.geometry.Point): kendo.drawing.Path; + curveTo(controlOut: kendo.geometry.Point, controlIn: any, endPoint: any): kendo.drawing.Path; + curveTo(controlOut: kendo.geometry.Point, controlIn: any, endPoint: kendo.geometry.Point): kendo.drawing.Path; + curveTo(controlOut: kendo.geometry.Point, controlIn: kendo.geometry.Point, endPoint: any): kendo.drawing.Path; + curveTo(controlOut: kendo.geometry.Point, controlIn: kendo.geometry.Point, endPoint: kendo.geometry.Point): kendo.drawing.Path; + fill(color: string, opacity?: number): kendo.drawing.Path; + lineTo(x: number, y?: number): kendo.drawing.Path; + lineTo(x: any, y?: number): kendo.drawing.Path; + lineTo(x: kendo.geometry.Point, y?: number): kendo.drawing.Path; + moveTo(x: number, y?: number): kendo.drawing.Path; + moveTo(x: any, y?: number): kendo.drawing.Path; + moveTo(x: kendo.geometry.Point, y?: number): kendo.drawing.Path; + opacity(): number; + opacity(opacity: number): void; + stroke(color: string, width?: number, opacity?: number): kendo.drawing.Path; + transform(): kendo.geometry.Transformation; + transform(transform: kendo.geometry.Transformation): void; + visible(): boolean; + visible(visible: boolean): void; + + } + + interface PathOptions { + name?: string; + clip?: kendo.drawing.Path; + fill?: kendo.drawing.FillOptions; + opacity?: number; + stroke?: kendo.drawing.StrokeOptions; + transform?: kendo.geometry.Transformation; + visible?: boolean; + } + interface PathEvent { + sender: Path; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + + class RadialGradient extends kendo.drawing.Gradient { + + + options: RadialGradientOptions; + + stops: any; + + constructor(options?: RadialGradientOptions); + + + addStop(offset: number, color: string, opacity: number): kendo.drawing.GradientStop; + center(): kendo.geometry.Point; + center(center: any): void; + center(center: kendo.geometry.Point): void; + radius(): number; + radius(value: number): void; + removeStop(stop: kendo.drawing.GradientStop): void; + + } + + interface RadialGradientOptions { + name?: string; + center?: any|kendo.geometry.Point; + radius?: number; + stops?: any; + } + interface RadialGradientEvent { + sender: RadialGradient; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + + class Rect extends kendo.drawing.Element { + + + options: RectOptions; + + + constructor(geometry: kendo.geometry.Rect, options?: RectOptions); + + + bbox(): kendo.geometry.Rect; + clip(): kendo.drawing.Path; + clip(clip: kendo.drawing.Path): void; + clippedBBox(): kendo.geometry.Rect; + geometry(): kendo.geometry.Rect; + geometry(value: kendo.geometry.Rect): void; + fill(color: string, opacity?: number): kendo.drawing.Rect; + opacity(): number; + opacity(opacity: number): void; + stroke(color: string, width?: number, opacity?: number): kendo.drawing.Rect; + transform(): kendo.geometry.Transformation; + transform(transform: kendo.geometry.Transformation): void; + visible(): boolean; + visible(visible: boolean): void; + + } + + interface RectOptions { + name?: string; + clip?: kendo.drawing.Path; + fill?: kendo.drawing.FillOptions; + opacity?: number; + stroke?: kendo.drawing.StrokeOptions; + transform?: kendo.geometry.Transformation; + visible?: boolean; + } + interface RectEvent { + sender: Rect; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + + class Segment extends kendo.Class { + + + options: SegmentOptions; + + + constructor(anchor: kendo.geometry.Point, controlIn: kendo.geometry.Point, controlOut: kendo.geometry.Point); + + + anchor(): kendo.geometry.Point; + anchor(value: kendo.geometry.Point): void; + controlIn(): kendo.geometry.Point; + controlIn(value: kendo.geometry.Point): void; + controlOut(): kendo.geometry.Point; + controlOut(value: kendo.geometry.Point): void; + + } + + interface SegmentOptions { + name?: string; + } + interface SegmentEvent { + sender: Segment; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + + interface StrokeOptions { + + + + color: string; + dashType: string; + lineCap: string; + lineJoin: string; + opacity: number; + width: number; + + + + + } + + + + class Surface extends kendo.Observable { + + + options: SurfaceOptions; + + + constructor(options?: SurfaceOptions); + + static create(element: JQuery, options?: any): kendo.drawing.Surface; + static create(element: Element, options?: any): kendo.drawing.Surface; + + clear(): void; + draw(element: kendo.drawing.Element): void; + eventTarget(e: any): kendo.drawing.Element; + resize(force?: boolean): void; + + } + + interface SurfaceOptions { + name?: string; + type?: string; + height?: string; + width?: string; + click?(e: SurfaceClickEvent): void; + mouseenter?(e: SurfaceMouseenterEvent): void; + mouseleave?(e: SurfaceMouseleaveEvent): void; + } + interface SurfaceEvent { + sender: Surface; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface SurfaceClickEvent extends SurfaceEvent { + element?: kendo.drawing.Element; + originalEvent?: any; + } + + interface SurfaceMouseenterEvent extends SurfaceEvent { + element?: kendo.drawing.Element; + originalEvent?: any; + } + + interface SurfaceMouseleaveEvent extends SurfaceEvent { + element?: kendo.drawing.Element; + originalEvent?: any; + } + + + class Text extends kendo.drawing.Element { + + + options: TextOptions; + + + constructor(content: string, position: kendo.geometry.Point, options?: TextOptions); + + + bbox(): kendo.geometry.Rect; + clip(): kendo.drawing.Path; + clip(clip: kendo.drawing.Path): void; + clippedBBox(): kendo.geometry.Rect; + content(): string; + content(value: string): void; + fill(color: string, opacity?: number): kendo.drawing.Text; + opacity(): number; + opacity(opacity: number): void; + position(): kendo.geometry.Point; + position(value: kendo.geometry.Point): void; + stroke(color: string, width?: number, opacity?: number): kendo.drawing.Text; + transform(): kendo.geometry.Transformation; + transform(transform: kendo.geometry.Transformation): void; + visible(): boolean; + visible(visible: boolean): void; + + } + + interface TextOptions { + name?: string; + clip?: kendo.drawing.Path; + fill?: kendo.drawing.FillOptions; + font?: string; + opacity?: number; + stroke?: kendo.drawing.StrokeOptions; + transform?: kendo.geometry.Transformation; + visible?: boolean; + } + interface TextEvent { + sender: Text; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + +} declare module kendo.geometry { class Arc extends Observable { + + options: ArcOptions; + + anticlockwise: boolean; + center: kendo.geometry.Point; + endAngle: number; + radiusX: number; + radiusY: number; + startAngle: number; + + + bbox(matrix: kendo.geometry.Matrix): kendo.geometry.Rect; getAnticlockwise(): boolean; getCenter(): kendo.geometry.Point; @@ -1446,12 +2194,7 @@ declare module kendo.geometry { setRadiusX(value: number): kendo.geometry.Arc; setRadiusY(value: number): kendo.geometry.Arc; setStartAngle(value: number): kendo.geometry.Arc; - anticlockwise: boolean; - center: kendo.geometry.Point; - endAngle: number; - radiusX: number; - radiusY: number; - startAngle: number; + } interface ArcOptions { @@ -1459,13 +2202,21 @@ declare module kendo.geometry { } interface ArcEvent { sender: Arc; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } class Circle extends Observable { + + options: CircleOptions; + + center: kendo.geometry.Point; + radius: number; + + + bbox(matrix: kendo.geometry.Matrix): kendo.geometry.Rect; clone(): kendo.geometry.Circle; equals(other: kendo.geometry.Circle): boolean; @@ -1475,8 +2226,7 @@ declare module kendo.geometry { setCenter(value: kendo.geometry.Point): kendo.geometry.Point; setCenter(value: any): kendo.geometry.Point; setRadius(value: number): kendo.geometry.Circle; - center: kendo.geometry.Point; - radius: number; + } interface CircleOptions { @@ -1484,29 +2234,36 @@ declare module kendo.geometry { } interface CircleEvent { sender: Circle; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } class Matrix extends Observable { + + options: MatrixOptions; - clone(): kendo.geometry.Matrix; - equals(other: kendo.geometry.Matrix): boolean; - round(digits: number): kendo.geometry.Matrix; - multiplyCopy(matrix: kendo.geometry.Matrix): kendo.geometry.Matrix; - toArray(digits: number): any; - toString(digits: number, separator: string): string; - static rotate(angle: number, x: number, y: number): kendo.geometry.Matrix; - static scale(scaleX: number, scaleY: number): kendo.geometry.Matrix; - static translate(x: number, y: number): kendo.geometry.Matrix; - static unit(): kendo.geometry.Matrix; + a: number; b: number; c: number; d: number; e: number; f: number; + + + static rotate(angle: number, x: number, y: number): kendo.geometry.Matrix; + static scale(scaleX: number, scaleY: number): kendo.geometry.Matrix; + static translate(x: number, y: number): kendo.geometry.Matrix; + static unit(): kendo.geometry.Matrix; + + clone(): kendo.geometry.Matrix; + equals(other: kendo.geometry.Matrix): boolean; + round(digits: number): kendo.geometry.Matrix; + multiplyCopy(matrix: kendo.geometry.Matrix): kendo.geometry.Matrix; + toArray(digits: number): any; + toString(digits: number, separator: string): string; + } interface MatrixOptions { @@ -1514,13 +2271,29 @@ declare module kendo.geometry { } interface MatrixEvent { sender: Matrix; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } class Point extends Observable { + + options: PointOptions; + + x: number; + y: number; + + constructor(x: number, y: number); + + static create(x: number, y: number): kendo.geometry.Point; + static create(x: any, y: number): kendo.geometry.Point; + static create(x: kendo.geometry.Point, y: number): kendo.geometry.Point; + static min(): kendo.geometry.Point; + static max(): kendo.geometry.Point; + static minPoint(): kendo.geometry.Point; + static maxPoint(): kendo.geometry.Point; + clone(): kendo.geometry.Point; distanceTo(point: kendo.geometry.Point): number; equals(other: kendo.geometry.Point): boolean; @@ -1541,15 +2314,7 @@ declare module kendo.geometry { translate(dx: number, dy: number): kendo.geometry.Point; translateWith(vector: kendo.geometry.Point): kendo.geometry.Point; translateWith(vector: any): kendo.geometry.Point; - static create(x: number, y: number): kendo.geometry.Point; - static create(x: any, y: number): kendo.geometry.Point; - static create(x: kendo.geometry.Point, y: number): kendo.geometry.Point; - static min(): kendo.geometry.Point; - static max(): kendo.geometry.Point; - static minPoint(): kendo.geometry.Point; - static maxPoint(): kendo.geometry.Point; - x: number; - y: number; + } interface PointOptions { @@ -1557,14 +2322,24 @@ declare module kendo.geometry { } interface PointEvent { sender: Point; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } class Rect extends Observable { - constructor(origin: kendo.geometry.Point, size: kendo.geometry.Size); + + options: RectOptions; + + origin: kendo.geometry.Point; + size: kendo.geometry.Size; + + constructor(origin: kendo.geometry.Point, size: kendo.geometry.Size); + + 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; + bbox(matrix: kendo.geometry.Matrix): kendo.geometry.Rect; bottomLeft(): kendo.geometry.Point; bottomRight(): kendo.geometry.Point; @@ -1581,10 +2356,7 @@ declare module kendo.geometry { topLeft(): kendo.geometry.Point; topRight(): kendo.geometry.Point; width(): number; - 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; - origin: kendo.geometry.Point; - size: kendo.geometry.Size; + } interface RectOptions { @@ -1592,24 +2364,31 @@ declare module kendo.geometry { } interface RectEvent { sender: Rect; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } class Size extends Observable { + + options: SizeOptions; + + width: number; + height: number; + + + static create(width: number, height: number): kendo.geometry.Size; + static create(width: any, height: number): kendo.geometry.Size; + static create(width: kendo.geometry.Size, height: number): kendo.geometry.Size; + clone(): kendo.geometry.Size; equals(other: kendo.geometry.Size): boolean; getWidth(): number; getHeight(): number; setWidth(value: number): kendo.geometry.Size; setHeight(value: number): kendo.geometry.Size; - static create(width: number, height: number): kendo.geometry.Size; - static create(width: any, height: number): kendo.geometry.Size; - static create(width: kendo.geometry.Size, height: number): kendo.geometry.Size; - width: number; - height: number; + } interface SizeOptions { @@ -1617,13 +2396,19 @@ declare module kendo.geometry { } interface SizeEvent { sender: Size; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } class Transformation extends Observable { + + options: TransformationOptions; + + + + clone(): kendo.geometry.Transformation; equals(other: kendo.geometry.Transformation): boolean; matrix(): kendo.geometry.Matrix; @@ -1632,6 +2417,7 @@ declare module kendo.geometry { rotate(angle: number, center: kendo.geometry.Point): kendo.geometry.Transformation; scale(scaleX: number, scaleY: number): kendo.geometry.Transformation; translate(x: number, y: number): kendo.geometry.Transformation; + } interface TransformationOptions { @@ -1639,544 +2425,31 @@ declare module kendo.geometry { } interface TransformationEvent { sender: Transformation; - isDefaultPrevented(): boolean; preventDefault: Function; - } - - -} -declare module kendo.drawing { - class Arc extends kendo.drawing.Element { - constructor(geometry: kendo.geometry.Arc, options?: ArcOptions); - options: ArcOptions; - bbox(): kendo.geometry.Rect; - clip(): kendo.drawing.Path; - clip(clip: kendo.drawing.Path): void; - clippedBBox(): kendo.geometry.Rect; - geometry(): kendo.geometry.Arc; - geometry(value: kendo.geometry.Arc): void; - fill(color: string, opacity?: number): kendo.drawing.Arc; - opacity(): number; - opacity(opacity: number): void; - stroke(color: string, width?: number, opacity?: number): kendo.drawing.Arc; - transform(): kendo.geometry.Transformation; - transform(transform: kendo.geometry.Transformation): void; - visible(): boolean; - visible(visible: boolean): void; - } - - interface ArcOptions { - name?: string; - clip?: kendo.drawing.Path; - fill?: kendo.drawing.FillOptions; - opacity?: number; - stroke?: kendo.drawing.StrokeOptions; - transform?: kendo.geometry.Transformation; - visible?: boolean; - } - interface ArcEvent { - sender: Arc; isDefaultPrevented(): boolean; - preventDefault: Function; - } - - - class Circle extends kendo.drawing.Element { - constructor(geometry: kendo.geometry.Circle, options?: CircleOptions); - options: CircleOptions; - bbox(): kendo.geometry.Rect; - clip(): kendo.drawing.Path; - clip(clip: kendo.drawing.Path): void; - clippedBBox(): kendo.geometry.Rect; - geometry(): kendo.geometry.Circle; - geometry(value: kendo.geometry.Circle): void; - fill(color: string, opacity?: number): kendo.drawing.Circle; - opacity(): number; - opacity(opacity: number): void; - stroke(color: string, width?: number, opacity?: number): kendo.drawing.Circle; - transform(): kendo.geometry.Transformation; - transform(transform: kendo.geometry.Transformation): void; - visible(): boolean; - visible(visible: boolean): void; - } - - interface CircleOptions { - name?: string; - clip?: kendo.drawing.Path; - fill?: kendo.drawing.FillOptions; - opacity?: number; - stroke?: kendo.drawing.StrokeOptions; - transform?: kendo.geometry.Transformation; - visible?: boolean; - } - interface CircleEvent { - sender: Circle; - isDefaultPrevented(): boolean; - preventDefault: Function; - } - - - class Element extends kendo.Class { - constructor(options?: ElementOptions); - options: ElementOptions; - bbox(): kendo.geometry.Rect; - clip(): kendo.drawing.Path; - clip(clip: kendo.drawing.Path): void; - clippedBBox(): kendo.geometry.Rect; - opacity(): number; - opacity(opacity: number): void; - transform(): kendo.geometry.Transformation; - transform(transform: kendo.geometry.Transformation): void; - visible(): boolean; - visible(visible: boolean): void; - } - - interface ElementOptions { - name?: string; - clip?: kendo.drawing.Path; - opacity?: number; - transform?: kendo.geometry.Transformation; - visible?: boolean; - } - interface ElementEvent { - sender: Element; - isDefaultPrevented(): boolean; - preventDefault: Function; - } - - - interface FillOptions { - color: string; - opacity: number; - } - - - - class Gradient extends kendo.Class { - constructor(options?: GradientOptions); - options: GradientOptions; - addStop(offset: number, color: string, opacity: number): kendo.drawing.GradientStop; - removeStop(stop: kendo.drawing.GradientStop): void; - stops: any; - } - - interface GradientOptions { - name?: string; - stops?: any; - } - interface GradientEvent { - sender: Gradient; - isDefaultPrevented(): boolean; - preventDefault: Function; - } - - - class GradientStop extends kendo.Class { - constructor(options?: GradientStopOptions); - options: GradientStopOptions; - } - - interface GradientStopOptions { - name?: string; - offset?: number; - color?: string; - opacity?: number; - } - interface GradientStopEvent { - sender: GradientStop; - isDefaultPrevented(): boolean; - preventDefault: Function; - } - - - class Group extends kendo.drawing.Element { - constructor(options?: GroupOptions); - options: GroupOptions; - append(element: kendo.drawing.Element): void; - clear(): void; - clip(): kendo.drawing.Path; - clip(clip: kendo.drawing.Path): void; - clippedBBox(): kendo.geometry.Rect; - opacity(): number; - opacity(opacity: number): void; - remove(element: kendo.drawing.Element): void; - removeAt(index: number): void; - visible(): boolean; - visible(visible: boolean): void; - children: any; - } - - interface GroupOptions { - name?: string; - clip?: kendo.drawing.Path; - opacity?: number; - pdf?: kendo.drawing.PDFOptions; - transform?: kendo.geometry.Transformation; - visible?: boolean; - } - interface GroupEvent { - sender: Group; - isDefaultPrevented(): boolean; - preventDefault: Function; - } - - - class Image extends kendo.drawing.Element { - constructor(src: string, rect: kendo.geometry.Rect); - options: ImageOptions; - bbox(): kendo.geometry.Rect; - clip(): kendo.drawing.Path; - clip(clip: kendo.drawing.Path): void; - clippedBBox(): kendo.geometry.Rect; - opacity(): number; - opacity(opacity: number): void; - src(): string; - src(value: string): void; - rect(): kendo.geometry.Rect; - rect(value: kendo.geometry.Rect): void; - transform(): kendo.geometry.Transformation; - transform(transform: kendo.geometry.Transformation): void; - visible(): boolean; - visible(visible: boolean): void; - } - - interface ImageOptions { - name?: string; - clip?: kendo.drawing.Path; - opacity?: number; - transform?: kendo.geometry.Transformation; - visible?: boolean; - } - interface ImageEvent { - sender: Image; - isDefaultPrevented(): boolean; - preventDefault: Function; - } - - - class Layout extends kendo.drawing.Group { - constructor(rect: kendo.geometry.Rect, options?: LayoutOptions); - options: LayoutOptions; - rect(): kendo.geometry.Rect; - rect(rect: kendo.geometry.Rect): void; - reflow(): void; - } - - interface LayoutOptions { - name?: string; - alignContent?: string; - alignItems?: string; - justifyContent?: string; - lineSpacing?: number; - spacing?: number; - orientation?: string; - wrap?: boolean; - } - interface LayoutEvent { - sender: Layout; - isDefaultPrevented(): boolean; - preventDefault: Function; - } - - - class LinearGradient extends kendo.drawing.Gradient { - constructor(options?: LinearGradientOptions); - options: LinearGradientOptions; - addStop(offset: number, color: string, opacity: number): kendo.drawing.GradientStop; - end(): kendo.geometry.Point; - end(end: any): void; - end(end: kendo.geometry.Point): void; - start(): kendo.geometry.Point; - start(start: any): void; - start(start: kendo.geometry.Point): void; - removeStop(stop: kendo.drawing.GradientStop): void; - stops: any; - } - - interface LinearGradientOptions { - name?: string; - stops?: any; - } - interface LinearGradientEvent { - sender: LinearGradient; - isDefaultPrevented(): boolean; - preventDefault: Function; - } - - - class MultiPath extends kendo.drawing.Element { - constructor(options?: MultiPathOptions); - options: MultiPathOptions; - bbox(): kendo.geometry.Rect; - clip(): kendo.drawing.Path; - clip(clip: kendo.drawing.Path): void; - clippedBBox(): kendo.geometry.Rect; - close(): kendo.drawing.MultiPath; - curveTo(controlOut: any, controlIn: any): kendo.drawing.MultiPath; - curveTo(controlOut: any, controlIn: kendo.geometry.Point): kendo.drawing.MultiPath; - curveTo(controlOut: kendo.geometry.Point, controlIn: any): kendo.drawing.MultiPath; - curveTo(controlOut: kendo.geometry.Point, controlIn: kendo.geometry.Point): kendo.drawing.MultiPath; - fill(color: string, opacity?: number): kendo.drawing.MultiPath; - lineTo(x: number, y?: number): kendo.drawing.MultiPath; - lineTo(x: any, y?: number): kendo.drawing.MultiPath; - lineTo(x: kendo.geometry.Point, y?: number): kendo.drawing.MultiPath; - moveTo(x: number, y?: number): kendo.drawing.MultiPath; - moveTo(x: any, y?: number): kendo.drawing.MultiPath; - moveTo(x: kendo.geometry.Point, y?: number): kendo.drawing.MultiPath; - opacity(): number; - opacity(opacity: number): void; - stroke(color: string, width?: number, opacity?: number): kendo.drawing.MultiPath; - transform(): kendo.geometry.Transformation; - transform(transform: kendo.geometry.Transformation): void; - visible(): boolean; - visible(visible: boolean): void; - paths: any; - } - - interface MultiPathOptions { - name?: string; - clip?: kendo.drawing.Path; - fill?: kendo.drawing.FillOptions; - opacity?: number; - stroke?: kendo.drawing.StrokeOptions; - transform?: kendo.geometry.Transformation; - visible?: boolean; - } - interface MultiPathEvent { - sender: MultiPath; - isDefaultPrevented(): boolean; - preventDefault: Function; - } - - - class OptionsStore extends kendo.Class { - constructor(options?: OptionsStoreOptions); - options: OptionsStoreOptions; - get(field: string): any; - set(field: string, value: any): void; - observer: any; - } - - interface OptionsStoreOptions { - name?: string; - } - interface OptionsStoreEvent { - sender: OptionsStore; - isDefaultPrevented(): boolean; - preventDefault: Function; - } - - - interface PDFOptions { - creator: string; - date: Date; - keywords: string; - landscape: boolean; - margin: any; - paperSize: any; - subject: string; - title: string; - } - - - - class Path extends kendo.drawing.Element { - constructor(options?: PathOptions); - options: PathOptions; - bbox(): kendo.geometry.Rect; - clip(): kendo.drawing.Path; - clip(clip: kendo.drawing.Path): void; - clippedBBox(): kendo.geometry.Rect; - close(): kendo.drawing.Path; - curveTo(controlOut: any, controlIn: any): kendo.drawing.Path; - curveTo(controlOut: any, controlIn: kendo.geometry.Point): kendo.drawing.Path; - curveTo(controlOut: kendo.geometry.Point, controlIn: any): kendo.drawing.Path; - curveTo(controlOut: kendo.geometry.Point, controlIn: kendo.geometry.Point): kendo.drawing.Path; - fill(color: string, opacity?: number): kendo.drawing.Path; - lineTo(x: number, y?: number): kendo.drawing.Path; - lineTo(x: any, y?: number): kendo.drawing.Path; - lineTo(x: kendo.geometry.Point, y?: number): kendo.drawing.Path; - moveTo(x: number, y?: number): kendo.drawing.Path; - moveTo(x: any, y?: number): kendo.drawing.Path; - moveTo(x: kendo.geometry.Point, y?: number): kendo.drawing.Path; - opacity(): number; - opacity(opacity: number): void; - stroke(color: string, width?: number, opacity?: number): kendo.drawing.Path; - transform(): kendo.geometry.Transformation; - transform(transform: kendo.geometry.Transformation): void; - visible(): boolean; - visible(visible: boolean): void; - static fromPoints(points: any): kendo.drawing.Path; - static fromRect(rect: kendo.geometry.Rect): kendo.drawing.Path; - static parse(svgPath: string, options?: any): kendo.drawing.Path; - segments: any; - } - - interface PathOptions { - name?: string; - clip?: kendo.drawing.Path; - fill?: kendo.drawing.FillOptions; - opacity?: number; - stroke?: kendo.drawing.StrokeOptions; - transform?: kendo.geometry.Transformation; - visible?: boolean; - } - interface PathEvent { - sender: Path; - isDefaultPrevented(): boolean; - preventDefault: Function; - } - - - class RadialGradient extends kendo.drawing.Gradient { - constructor(options?: RadialGradientOptions); - options: RadialGradientOptions; - addStop(offset: number, color: string, opacity: number): kendo.drawing.GradientStop; - center(): kendo.geometry.Point; - center(center: any): void; - center(center: kendo.geometry.Point): void; - radius(): number; - radius(value: number): void; - removeStop(stop: kendo.drawing.GradientStop): void; - stops: any; - } - - interface RadialGradientOptions { - name?: string; - center?: any; - radius?: number; - stops?: any; - } - interface RadialGradientEvent { - sender: RadialGradient; - isDefaultPrevented(): boolean; - preventDefault: Function; - } - - - class Segment extends kendo.Class { - constructor(anchor: kendo.geometry.Point, controlIn: kendo.geometry.Point, controlOut: kendo.geometry.Point); - options: SegmentOptions; - anchor(): kendo.geometry.Point; - anchor(value: kendo.geometry.Point): void; - controlIn(): kendo.geometry.Point; - controlIn(value: kendo.geometry.Point): void; - controlOut(): kendo.geometry.Point; - controlOut(value: kendo.geometry.Point): void; - } - - interface SegmentOptions { - name?: string; - } - interface SegmentEvent { - sender: Segment; - isDefaultPrevented(): boolean; - preventDefault: Function; - } - - - interface StrokeOptions { - color: string; - dashType: string; - lineCap: string; - lineJoin: string; - opacity: number; - width: number; - } - - - - class Surface extends kendo.Observable { - constructor(options?: SurfaceOptions); - options: SurfaceOptions; - clear(): void; - draw(element: kendo.drawing.Element): void; - eventTarget(e: any): kendo.drawing.Element; - resize(force?: boolean): void; - static create(element: JQuery, options?: any): kendo.drawing.Surface; - static create(element: Element, options?: any): kendo.drawing.Surface; - } - - interface SurfaceOptions { - name?: string; - type?: string; - height?: string; - width?: string; - click?(e: SurfaceClickEvent): void; - mouseenter?(e: SurfaceMouseenterEvent): void; - mouseleave?(e: SurfaceMouseleaveEvent): void; - } - interface SurfaceEvent { - sender: Surface; - isDefaultPrevented(): boolean; - preventDefault: Function; - } - - interface SurfaceClickEvent extends SurfaceEvent { - element?: kendo.drawing.Element; - originalEvent?: any; - } - - interface SurfaceMouseenterEvent extends SurfaceEvent { - element?: kendo.drawing.Element; - originalEvent?: any; - } - - interface SurfaceMouseleaveEvent extends SurfaceEvent { - element?: kendo.drawing.Element; - originalEvent?: any; - } - - - class Text extends kendo.drawing.Element { - constructor(content: string, position: kendo.geometry.Point, options?: TextOptions); - options: TextOptions; - bbox(): kendo.geometry.Rect; - clip(): kendo.drawing.Path; - clip(clip: kendo.drawing.Path): void; - clippedBBox(): kendo.geometry.Rect; - content(): string; - content(value: string): void; - fill(color: string, opacity?: number): kendo.drawing.Text; - opacity(): number; - opacity(opacity: number): void; - position(): kendo.geometry.Point; - position(value: kendo.geometry.Point): void; - stroke(color: string, width?: number, opacity?: number): kendo.drawing.Text; - transform(): kendo.geometry.Transformation; - transform(transform: kendo.geometry.Transformation): void; - visible(): boolean; - visible(visible: boolean): void; - } - - interface TextOptions { - name?: string; - clip?: kendo.drawing.Path; - fill?: kendo.drawing.FillOptions; - font?: string; - opacity?: number; - stroke?: kendo.drawing.StrokeOptions; - transform?: kendo.geometry.Transformation; - visible?: boolean; - } - interface TextEvent { - sender: Text; - isDefaultPrevented(): boolean; - preventDefault: Function; } } declare module kendo.ui { class AutoComplete extends kendo.ui.Widget { + static fn: AutoComplete; - static extend(proto: Object): AutoComplete; + + options: AutoCompleteOptions; + + dataSource: kendo.data.DataSource; + list: JQuery; + ul: JQuery; element: JQuery; wrapper: JQuery; + + static extend(proto: Object): AutoComplete; + constructor(element: Element, options?: AutoCompleteOptions); - options: AutoCompleteOptions; - dataSource: kendo.data.DataSource; + + close(): void; dataItem(index: number): any; destroy(): void; @@ -2192,8 +2465,7 @@ declare module kendo.ui { suggest(value: string): void; value(): string; value(value: string): void; - list: JQuery; - ul: JQuery; + } interface AutoCompleteAnimationClose { @@ -2219,22 +2491,23 @@ declare module kendo.ui { interface AutoCompleteOptions { name?: string; animation?: AutoCompleteAnimation; - dataSource?: any; + dataSource?: any|any|kendo.data.DataSource; dataTextField?: string; delay?: number; enable?: boolean; filter?: string; - fixedGroupTemplate?: any; - groupTemplate?: any; + fixedGroupTemplate?: string|Function; + groupTemplate?: string|Function; height?: number; highlightFirst?: boolean; ignoreCase?: boolean; minLength?: number; placeholder?: string; + popup?: any; separator?: string; suggest?: boolean; - headerTemplate?: any; - template?: any; + headerTemplate?: string|Function; + template?: string|Function; valuePrimitive?: boolean; virtual?: AutoCompleteVirtual; change?(e: AutoCompleteChangeEvent): void; @@ -2246,8 +2519,8 @@ declare module kendo.ui { } interface AutoCompleteEvent { sender: AutoComplete; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } interface AutoCompleteChangeEvent extends AutoCompleteEvent { @@ -2272,14 +2545,22 @@ declare module kendo.ui { class Button extends kendo.ui.Widget { + static fn: Button; - static extend(proto: Object): Button; + + options: ButtonOptions; + element: JQuery; wrapper: JQuery; + + static extend(proto: Object): Button; + constructor(element: Element, options?: ButtonOptions); - options: ButtonOptions; + + enable(toggle: boolean): void; + } interface ButtonOptions { @@ -2292,8 +2573,8 @@ declare module kendo.ui { } interface ButtonEvent { sender: Button; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } interface ButtonClickEvent extends ButtonEvent { @@ -2302,13 +2583,20 @@ declare module kendo.ui { class Calendar extends kendo.ui.Widget { + static fn: Calendar; - static extend(proto: Object): Calendar; + + options: CalendarOptions; + element: JQuery; wrapper: JQuery; + + static extend(proto: Object): Calendar; + constructor(element: Element, options?: CalendarOptions); - options: CalendarOptions; + + current(): Date; destroy(): void; max(): Date; @@ -2326,6 +2614,7 @@ declare module kendo.ui { value(value: Date): void; value(value: string): void; view(): any; + } interface CalendarMonth { @@ -2338,7 +2627,7 @@ declare module kendo.ui { culture?: string; dates?: any; depth?: string; - footer?: any; + footer?: string|Function; format?: string; max?: Date; min?: Date; @@ -2350,24 +2639,32 @@ declare module kendo.ui { } interface CalendarEvent { sender: Calendar; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } class ColorPalette extends kendo.ui.Widget { + static fn: ColorPalette; - static extend(proto: Object): ColorPalette; + + options: ColorPaletteOptions; + element: JQuery; wrapper: JQuery; + + static extend(proto: Object): ColorPalette; + constructor(element: Element, options?: ColorPaletteOptions); - options: ColorPaletteOptions; + + value(): string; value(color?: string): void; color(): kendo.Color; color(color?: kendo.Color): void; enable(enable?: boolean): void; + } interface ColorPaletteTileSize { @@ -2377,7 +2674,7 @@ declare module kendo.ui { interface ColorPaletteOptions { name?: string; - palette?: any; + palette?: string|any; columns?: number; tileSize?: ColorPaletteTileSize; value?: string; @@ -2385,19 +2682,26 @@ declare module kendo.ui { } interface ColorPaletteEvent { sender: ColorPalette; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } class ColorPicker extends kendo.ui.Widget { + static fn: ColorPicker; - static extend(proto: Object): ColorPicker; + + options: ColorPickerOptions; + element: JQuery; wrapper: JQuery; + + static extend(proto: Object): ColorPicker; + constructor(element: Element, options?: ColorPickerOptions); - options: ColorPickerOptions; + + close(): void; open(): void; toggle(): void; @@ -2406,6 +2710,7 @@ declare module kendo.ui { color(): kendo.Color; color(color?: kendo.Color): void; enable(enable?: boolean): void; + } interface ColorPickerMessages { @@ -2424,7 +2729,7 @@ declare module kendo.ui { columns?: number; tileSize?: ColorPickerTileSize; messages?: ColorPickerMessages; - palette?: any; + palette?: string|any; opacity?: boolean; preview?: boolean; toolIcon?: string; @@ -2436,8 +2741,8 @@ declare module kendo.ui { } interface ColorPickerEvent { sender: ColorPicker; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } interface ColorPickerChangeEvent extends ColorPickerEvent { @@ -2450,14 +2755,24 @@ declare module kendo.ui { class ComboBox extends kendo.ui.Widget { + static fn: ComboBox; - static extend(proto: Object): ComboBox; + + options: ComboBoxOptions; + + dataSource: kendo.data.DataSource; + input: JQuery; + list: JQuery; + ul: JQuery; element: JQuery; wrapper: JQuery; + + static extend(proto: Object): ComboBox; + constructor(element: Element, options?: ComboBoxOptions); - options: ComboBoxOptions; - dataSource: kendo.data.DataSource; + + close(): void; dataItem(index?: number): any; destroy(): void; @@ -2478,9 +2793,7 @@ declare module kendo.ui { toggle(toggle: boolean): void; value(): string; value(value: string): void; - input: JQuery; - list: JQuery; - ul: JQuery; + } interface ComboBoxAnimationClose { @@ -2509,23 +2822,24 @@ declare module kendo.ui { autoBind?: boolean; cascadeFrom?: string; cascadeFromField?: string; - dataSource?: any; + dataSource?: any|any|kendo.data.DataSource; dataTextField?: string; dataValueField?: string; delay?: number; enable?: boolean; filter?: string; - fixedGroupTemplate?: any; - groupTemplate?: any; + fixedGroupTemplate?: string|Function; + groupTemplate?: string|Function; height?: number; highlightFirst?: boolean; ignoreCase?: string; index?: number; minLength?: number; placeholder?: string; + popup?: any; suggest?: boolean; - headerTemplate?: any; - template?: any; + headerTemplate?: string|Function; + template?: string|Function; text?: string; value?: string; valuePrimitive?: boolean; @@ -2540,8 +2854,8 @@ declare module kendo.ui { } interface ComboBoxEvent { sender: ComboBox; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } interface ComboBoxChangeEvent extends ComboBoxEvent { @@ -2569,13 +2883,20 @@ declare module kendo.ui { class ContextMenu extends kendo.ui.Widget { + static fn: ContextMenu; - static extend(proto: Object): ContextMenu; + + options: ContextMenuOptions; + element: JQuery; wrapper: JQuery; + + static extend(proto: Object): ContextMenu; + constructor(element: Element, options?: ContextMenuOptions); - options: ContextMenuOptions; + + append(item: any, referenceItem: string): kendo.ui.ContextMenu; append(item: any, referenceItem: JQuery): kendo.ui.ContextMenu; close(element: Element): kendo.ui.ContextMenu; @@ -2608,6 +2929,7 @@ declare module kendo.ui { remove(element: string): kendo.ui.ContextMenu; remove(element: Element): kendo.ui.ContextMenu; remove(element: JQuery): kendo.ui.ContextMenu; + } interface ContextMenuAnimationClose { @@ -2630,14 +2952,14 @@ declare module kendo.ui { alignToAnchor?: boolean; animation?: ContextMenuAnimation; closeOnClick?: boolean; - dataSource?: any; + dataSource?: any|any; direction?: string; filter?: string; hoverDelay?: number; orientation?: string; popupCollision?: string; showOn?: string; - target?: any; + target?: string|JQuery; close?(e: ContextMenuCloseEvent): void; open?(e: ContextMenuOpenEvent): void; activate?(e: ContextMenuActivateEvent): void; @@ -2646,8 +2968,8 @@ declare module kendo.ui { } interface ContextMenuEvent { sender: ContextMenu; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } interface ContextMenuCloseEvent extends ContextMenuEvent { @@ -2684,13 +3006,20 @@ declare module kendo.ui { class DatePicker extends kendo.ui.Widget { + static fn: DatePicker; - static extend(proto: Object): DatePicker; + + options: DatePickerOptions; + element: JQuery; wrapper: JQuery; + + static extend(proto: Object): DatePicker; + constructor(element: Element, options?: DatePickerOptions); - options: DatePickerOptions; + + close(): void; destroy(): void; enable(enable: boolean): void; @@ -2706,6 +3035,7 @@ declare module kendo.ui { value(): Date; value(value: Date): void; value(value: string): void; + } interface DatePickerAnimationClose { @@ -2735,7 +3065,7 @@ declare module kendo.ui { culture?: string; dates?: any; depth?: string; - footer?: any; + footer?: string|Function; format?: string; max?: Date; min?: Date; @@ -2749,8 +3079,8 @@ declare module kendo.ui { } interface DatePickerEvent { sender: DatePicker; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } interface DatePickerChangeEvent extends DatePickerEvent { @@ -2764,13 +3094,20 @@ declare module kendo.ui { class DateTimePicker extends kendo.ui.Widget { + static fn: DateTimePicker; - static extend(proto: Object): DateTimePicker; + + options: DateTimePickerOptions; + element: JQuery; wrapper: JQuery; + + static extend(proto: Object): DateTimePicker; + constructor(element: Element, options?: DateTimePickerOptions); - options: DateTimePickerOptions; + + close(view: string): void; destroy(): void; enable(enable: boolean): void; @@ -2787,6 +3124,7 @@ declare module kendo.ui { value(): Date; value(value: Date): void; value(value: string): void; + } interface DateTimePickerAnimationClose { @@ -2832,8 +3170,8 @@ declare module kendo.ui { } interface DateTimePickerEvent { sender: DateTimePicker; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } interface DateTimePickerChangeEvent extends DateTimePickerEvent { @@ -2849,14 +3187,25 @@ declare module kendo.ui { class DropDownList extends kendo.ui.Widget { + static fn: DropDownList; - static extend(proto: Object): DropDownList; + + options: DropDownListOptions; + + dataSource: kendo.data.DataSource; + span: JQuery; + filterInput: JQuery; + list: JQuery; + ul: JQuery; element: JQuery; wrapper: JQuery; + + static extend(proto: Object): DropDownList; + constructor(element: Element, options?: DropDownListOptions); - options: DropDownListOptions; - dataSource: kendo.data.DataSource; + + close(): void; dataItem(index?: number): any; destroy(): void; @@ -2876,10 +3225,7 @@ declare module kendo.ui { toggle(toggle: boolean): void; value(): string; value(value: string): void; - span: JQuery; - filterInput: JQuery; - list: JQuery; - ul: JQuery; + } interface DropDownListAnimationClose { @@ -2908,23 +3254,24 @@ declare module kendo.ui { autoBind?: boolean; cascadeFrom?: string; cascadeFromField?: string; - dataSource?: any; + dataSource?: any|any|kendo.data.DataSource; dataTextField?: string; dataValueField?: string; delay?: number; enable?: boolean; filter?: string; - fixedGroupTemplate?: any; - groupTemplate?: any; + fixedGroupTemplate?: string|Function; + groupTemplate?: string|Function; height?: number; ignoreCase?: string; index?: number; minLength?: number; - optionLabel?: any; - optionLabelTemplate?: any; - headerTemplate?: any; - template?: any; - valueTemplate?: any; + popup?: any; + optionLabel?: string|any; + optionLabelTemplate?: string|Function; + headerTemplate?: string|Function; + template?: string|Function; + valueTemplate?: string|Function; text?: string; value?: string; valuePrimitive?: boolean; @@ -2939,8 +3286,8 @@ declare module kendo.ui { } interface DropDownListEvent { sender: DropDownList; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } interface DropDownListChangeEvent extends DropDownListEvent { @@ -2968,13 +3315,21 @@ declare module kendo.ui { class Editor extends kendo.ui.Widget { + static fn: Editor; - static extend(proto: Object): Editor; + + options: EditorOptions; + + body: Element; element: JQuery; wrapper: JQuery; + + static extend(proto: Object): Editor; + constructor(element: Element, options?: EditorOptions); - options: EditorOptions; + + createRange(document?: Document): Range; destroy(): void; encodedValue(): void; @@ -2991,7 +3346,7 @@ declare module kendo.ui { state(toolName: string): boolean; value(): string; value(value: string): void; - body: Element; + } interface EditorFileBrowserMessages { @@ -3038,32 +3393,32 @@ declare module kendo.ui { interface EditorFileBrowserTransportCreate { contentType?: string; - data?: any; + data?: any|string|Function; dataType?: string; type?: string; - url?: any; + url?: string|Function; } interface EditorFileBrowserTransportDestroy { contentType?: string; - data?: any; + data?: any|string|Function; dataType?: string; type?: string; - url?: any; + url?: string|Function; } interface EditorFileBrowserTransportRead { contentType?: string; - data?: any; + data?: any|string|Function; dataType?: string; type?: string; - url?: any; + url?: string|Function; } interface EditorFileBrowserTransport { read?: EditorFileBrowserTransportRead; uploadUrl?: string; - fileUrl?: any; + fileUrl?: string|Function; destroy?: EditorFileBrowserTransportDestroy; create?: EditorFileBrowserTransportCreate; } @@ -3120,33 +3475,33 @@ declare module kendo.ui { interface EditorImageBrowserTransportCreate { contentType?: string; - data?: any; + data?: any|string|Function; dataType?: string; type?: string; - url?: any; + url?: string|Function; } interface EditorImageBrowserTransportDestroy { contentType?: string; - data?: any; + data?: any|string|Function; dataType?: string; type?: string; - url?: any; + url?: string|Function; } interface EditorImageBrowserTransportRead { contentType?: string; - data?: any; + data?: any|string|Function; dataType?: string; type?: string; - url?: any; + url?: string|Function; } interface EditorImageBrowserTransport { read?: EditorImageBrowserTransportRead; - thumbnailUrl?: any; + thumbnailUrl?: string|Function; uploadUrl?: string; - imageUrl?: any; + imageUrl?: string|Function; destroy?: EditorImageBrowserTransportDestroy; create?: EditorImageBrowserTransportCreate; } @@ -3223,14 +3578,15 @@ declare module kendo.ui { } interface EditorPdfMargin { - bottom?: any; - left?: any; - right?: any; - top?: any; + bottom?: number|string; + left?: number|string; + right?: number|string; + top?: number|string; } interface EditorPdf { author?: string; + avoidLinks?: boolean|string; creator?: string; date?: Date; fileName?: string; @@ -3238,7 +3594,7 @@ declare module kendo.ui { keywords?: string; landscape?: boolean; margin?: EditorPdfMargin; - paperSize?: any; + paperSize?: string|any; proxyURL?: string; proxyTarget?: string; subject?: string; @@ -3246,8 +3602,10 @@ declare module kendo.ui { } interface EditorResizable { + content?: boolean; min?: number; max?: number; + toolbar?: boolean; } interface EditorSerialization { @@ -3300,8 +3658,8 @@ declare module kendo.ui { } interface EditorEvent { sender: Editor; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } interface EditorExecuteEvent extends EditorEvent { @@ -3319,19 +3677,27 @@ declare module kendo.ui { class FlatColorPicker extends kendo.ui.Widget { + static fn: FlatColorPicker; - static extend(proto: Object): FlatColorPicker; + + options: FlatColorPickerOptions; + element: JQuery; wrapper: JQuery; + + static extend(proto: Object): FlatColorPicker; + constructor(element: Element, options?: FlatColorPickerOptions); - options: FlatColorPickerOptions; + + focus(): void; value(): string; value(color?: string): void; color(): kendo.Color; color(color?: kendo.Color): void; enable(enable?: boolean): void; + } interface FlatColorPickerMessages { @@ -3351,8 +3717,8 @@ declare module kendo.ui { } interface FlatColorPickerEvent { sender: FlatColorPicker; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } interface FlatColorPickerChangeEvent extends FlatColorPickerEvent { @@ -3361,14 +3727,22 @@ declare module kendo.ui { class Gantt extends kendo.ui.Widget { + static fn: Gantt; - static extend(proto: Object): Gantt; + + options: GanttOptions; + + dataSource: kendo.data.DataSource; + dependencies: kendo.data.GanttDependencyDataSource; element: JQuery; wrapper: JQuery; + + static extend(proto: Object): Gantt; + constructor(element: Element, options?: GanttOptions); - options: GanttOptions; - dataSource: kendo.data.DataSource; + + clearSelection(): void; dataItem(row: string): kendo.data.GanttTask; dataItem(row: Element): kendo.data.GanttTask; @@ -3389,11 +3763,11 @@ declare module kendo.ui { setDependenciesDataSource(dataSource: kendo.data.GanttDependencyDataSource): void; view(): kendo.ui.GanttView; view(type?: string): void; - dependencies: kendo.data.GanttDependencyDataSource; + } interface GanttAssignments { - dataSource?: any; + dataSource?: any|any|kendo.data.DataSource; dataResourceIdField?: string; dataTaskIdField?: string; dataValueField?: string; @@ -3403,7 +3777,7 @@ declare module kendo.ui { field?: string; title?: string; format?: string; - width?: any; + width?: string|number; editable?: boolean; sortable?: boolean; } @@ -3414,7 +3788,7 @@ declare module kendo.ui { interface GanttEditable { confirmation?: boolean; - template?: any; + template?: string|Function; } interface GanttMessagesActions { @@ -3450,7 +3824,9 @@ declare module kendo.ui { interface GanttMessages { actions?: GanttMessagesActions; cancel?: string; + deleteDependencyConfirmation?: string; deleteDependencyWindowTitle?: string; + deleteTaskConfirmation?: string; deleteTaskWindowTitle?: string; destroy?: string; editor?: GanttMessagesEditor; @@ -3459,14 +3835,15 @@ declare module kendo.ui { } interface GanttPdfMargin { - bottom?: any; - left?: any; - right?: any; - top?: any; + bottom?: number|string; + left?: number|string; + right?: number|string; + top?: number|string; } interface GanttPdf { author?: string; + avoidLinks?: boolean|string; creator?: string; date?: Date; fileName?: string; @@ -3474,7 +3851,7 @@ declare module kendo.ui { keywords?: string; landscape?: boolean; margin?: GanttPdfMargin; - paperSize?: any; + paperSize?: string|any; proxyURL?: string; proxyTarget?: string; subject?: string; @@ -3484,31 +3861,31 @@ declare module kendo.ui { interface GanttResources { dataFormatField?: string; dataColorField?: string; - dataSource?: any; + dataSource?: any|any|kendo.data.DataSource; dataTextField?: string; field?: string; } interface GanttToolbarItem { name?: string; - template?: any; + template?: string|Function; text?: string; } interface GanttTooltip { - template?: any; + template?: string|Function; visible?: boolean; } interface GanttView { type?: string; selected?: boolean; - slotSize?: any; - timeHeaderTemplate?: any; - dayHeaderTemplate?: any; - weekHeaderTemplate?: any; - monthHeaderTemplate?: any; - yearHeaderTemplate?: any; + slotSize?: number|string; + timeHeaderTemplate?: string|Function; + dayHeaderTemplate?: string|Function; + weekHeaderTemplate?: string|Function; + monthHeaderTemplate?: string|Function; + yearHeaderTemplate?: string|Function; resizeTooltipFormat?: string; } @@ -3516,10 +3893,11 @@ declare module kendo.ui { name?: string; assignments?: GanttAssignments; autoBind?: boolean; + columnResizeHandleWidth?: number; columns?: GanttColumn[]; currentTimeMarker?: GanttCurrentTimeMarker; - dataSource?: any; - dependencies?: any; + dataSource?: any|any|kendo.data.GanttDataSource; + dependencies?: any|any|kendo.data.GanttDependencyDataSource; editable?: GanttEditable; navigatable?: boolean; workDayStart?: Date; @@ -3528,17 +3906,20 @@ declare module kendo.ui { workWeekEnd?: number; hourSpan?: number; snap?: boolean; - height?: any; - listWidth?: any; + height?: number|string; + listWidth?: string|number; messages?: GanttMessages; pdf?: GanttPdf; + resizable?: boolean; selectable?: boolean; showWorkDays?: boolean; showWorkHours?: boolean; + taskTemplate?: string|Function; toolbar?: GanttToolbarItem[]; tooltip?: GanttTooltip; views?: GanttView[]; resources?: GanttResources; + rowHeight?: number|string; dataBinding?(e: GanttDataBindingEvent): void; dataBound?(e: GanttDataBoundEvent): void; add?(e: GanttAddEvent): void; @@ -3547,6 +3928,7 @@ declare module kendo.ui { cancel?(e: GanttCancelEvent): void; save?(e: GanttSaveEvent): void; change?(e: GanttChangeEvent): void; + columnResize?(e: GanttColumnResizeEvent): void; navigate?(e: GanttNavigateEvent): void; moveStart?(e: GanttMoveStartEvent): void; move?(e: GanttMoveEvent): void; @@ -3558,8 +3940,8 @@ declare module kendo.ui { } interface GanttEvent { sender: Gantt; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } interface GanttDataBindingEvent extends GanttEvent { @@ -3596,6 +3978,12 @@ declare module kendo.ui { interface GanttChangeEvent extends GanttEvent { } + interface GanttColumnResizeEvent extends GanttEvent { + column?: any; + newWidth?: number; + oldWidth?: number; + } + interface GanttNavigateEvent extends GanttEvent { view?: string; } @@ -3638,14 +4026,31 @@ declare module kendo.ui { class Grid extends kendo.ui.Widget { + static fn: Grid; - static extend(proto: Object): Grid; + + options: GridOptions; + + dataSource: kendo.data.DataSource; + columns: GridColumn[]; + footer: JQuery; + pager: kendo.ui.Pager; + table: JQuery; + tbody: JQuery; + thead: JQuery; + content: JQuery; + lockedHeader: JQuery; + lockedTable: JQuery; + lockedContent: JQuery; element: JQuery; wrapper: JQuery; + + static extend(proto: Object): Grid; + constructor(element: Element, options?: GridOptions); - options: GridOptions; - dataSource: kendo.data.DataSource; + + addRow(): void; autoFitColumn(column: number): void; autoFitColumn(column: string): void; @@ -3703,20 +4108,11 @@ declare module kendo.ui { showColumn(column: any): void; unlockColumn(column: number): void; unlockColumn(column: string): void; - columns: GridColumn[]; - footer: JQuery; - pager: kendo.ui.Pager; - table: JQuery; - tbody: JQuery; - thead: JQuery; - content: JQuery; - lockedHeader: JQuery; - lockedTable: JQuery; - lockedContent: JQuery; + } interface GridAllowCopy { - delimeter?: any; + delimeter?: string|any; } interface GridColumnMenuMessages { @@ -3751,7 +4147,7 @@ declare module kendo.ui { } interface GridColumnFilterableCell { - dataSource?: any; + dataSource?: any|kendo.data.DataSource; dataTextField?: string; delay?: number; inputWidth?: number; @@ -3766,10 +4162,10 @@ declare module kendo.ui { interface GridColumnFilterable { cell?: GridColumnFilterableCell; multi?: boolean; - dataSource?: any; + dataSource?: any|any|kendo.data.DataSource; checkAll?: boolean; itemTemplate?: Function; - ui?: any; + ui?: string|Function; } interface GridColumnSortable { @@ -3784,33 +4180,33 @@ declare module kendo.ui { encoded?: boolean; field?: string; filterable?: GridColumnFilterable; - footerTemplate?: any; + footerTemplate?: string|Function; format?: string; groupable?: boolean; - groupHeaderTemplate?: any; - groupFooterTemplate?: any; + groupHeaderTemplate?: string|Function; + groupFooterTemplate?: string|Function; headerAttributes?: any; - headerTemplate?: any; + headerTemplate?: string|Function; hidden?: boolean; locked?: boolean; lockable?: boolean; minScreenWidth?: number; sortable?: GridColumnSortable; - template?: any; + template?: string|Function; title?: string; - width?: any; + width?: string|number; values?: any; menu?: boolean; } interface GridEditable { - confirmation?: any; + confirmation?: boolean|string|Function; cancelDelete?: string; confirmDelete?: string; createAt?: string; destroy?: boolean; mode?: string; - template?: any; + template?: string|Function; update?: boolean; window?: any; } @@ -3907,6 +4303,11 @@ declare module kendo.ui { interface GridMessages { commands?: GridMessagesCommands; + noRecords?: string; + } + + interface GridNoRecords { + template?: string|Function; } interface GridPageableMessages { @@ -3929,22 +4330,23 @@ declare module kendo.ui { numeric?: boolean; buttonCount?: number; input?: boolean; - pageSizes?: any; + pageSizes?: boolean|any; refresh?: boolean; info?: boolean; messages?: GridPageableMessages; } interface GridPdfMargin { - bottom?: any; - left?: any; - right?: any; - top?: any; + bottom?: number|string; + left?: number|string; + right?: number|string; + top?: number|string; } interface GridPdf { allPages?: boolean; author?: string; + avoidLinks?: boolean|string; creator?: string; date?: Date; fileName?: string; @@ -3952,7 +4354,7 @@ declare module kendo.ui { keywords?: string; landscape?: boolean; margin?: GridPdfMargin; - paperSize?: any; + paperSize?: string|any; proxyURL?: string; proxyTarget?: string; subject?: string; @@ -3970,35 +4372,36 @@ declare module kendo.ui { interface GridToolbarItem { name?: string; - template?: any; + template?: string|Function; text?: string; } interface GridOptions { name?: string; allowCopy?: GridAllowCopy; - altRowTemplate?: any; + altRowTemplate?: string|Function; autoBind?: boolean; columnResizeHandleWidth?: number; columns?: GridColumn[]; columnMenu?: GridColumnMenu; - dataSource?: any; - detailTemplate?: any; + dataSource?: any|any|kendo.data.DataSource; + detailTemplate?: string|Function; editable?: GridEditable; excel?: GridExcel; filterable?: GridFilterable; groupable?: GridGroupable; - height?: any; + height?: number|string; messages?: GridMessages; - mobile?: any; + mobile?: boolean|string; navigatable?: boolean; + noRecords?: GridNoRecords; pageable?: GridPageable; pdf?: GridPdf; reorderable?: boolean; resizable?: boolean; - rowTemplate?: any; + rowTemplate?: string|Function; scrollable?: GridScrollable; - selectable?: any; + selectable?: boolean|string; sortable?: GridSortable; toolbar?: GridToolbarItem[]; cancel?(e: GridCancelEvent): void; @@ -4022,11 +4425,12 @@ declare module kendo.ui { saveChanges?(e: GridSaveChangesEvent): void; columnLock?(e: GridColumnLockEvent): void; columnUnlock?(e: GridColumnUnlockEvent): void; + navigate?(e: GridNavigateEvent): void; } interface GridEvent { sender: Grid; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } interface GridCancelEvent extends GridEvent { @@ -4129,16 +4533,27 @@ declare module kendo.ui { column?: any; } + interface GridNavigateEvent extends GridEvent { + element?: JQuery; + } + class ListView extends kendo.ui.Widget { + static fn: ListView; - static extend(proto: Object): ListView; + + options: ListViewOptions; + + dataSource: kendo.data.DataSource; element: JQuery; wrapper: JQuery; + + static extend(proto: Object): ListView; + constructor(element: Element, options?: ListViewOptions); - options: ListViewOptions; - dataSource: kendo.data.DataSource; + + add(): void; cancel(): void; clearSelection(): void; @@ -4155,15 +4570,16 @@ declare module kendo.ui { select(items: JQuery): void; select(items: any): void; setDataSource(dataSource: kendo.data.DataSource): void; + } interface ListViewOptions { name?: string; autoBind?: boolean; - dataSource?: any; + dataSource?: any|any|kendo.data.DataSource; editTemplate?: Function; navigatable?: boolean; - selectable?: any; + selectable?: boolean|string; template?: Function; altTemplate?: Function; cancel?(e: ListViewCancelEvent): void; @@ -4176,8 +4592,8 @@ declare module kendo.ui { } interface ListViewEvent { sender: ListView; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } interface ListViewCancelEvent extends ListViewEvent { @@ -4202,19 +4618,27 @@ declare module kendo.ui { class MaskedTextBox extends kendo.ui.Widget { + static fn: MaskedTextBox; - static extend(proto: Object): MaskedTextBox; + + options: MaskedTextBoxOptions; + element: JQuery; wrapper: JQuery; + + static extend(proto: Object): MaskedTextBox; + constructor(element: Element, options?: MaskedTextBoxOptions); - options: MaskedTextBoxOptions; + + destroy(): void; enable(enable: boolean): void; readonly(readonly: boolean): void; raw(): string; value(): string; value(value: string): void; + } interface MaskedTextBoxOptions { @@ -4230,8 +4654,8 @@ declare module kendo.ui { } interface MaskedTextBoxEvent { sender: MaskedTextBox; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } interface MaskedTextBoxChangeEvent extends MaskedTextBoxEvent { @@ -4239,13 +4663,20 @@ declare module kendo.ui { class Menu extends kendo.ui.Widget { + static fn: Menu; - static extend(proto: Object): Menu; + + options: MenuOptions; + element: JQuery; wrapper: JQuery; + + static extend(proto: Object): Menu; + constructor(element: Element, options?: MenuOptions); - options: MenuOptions; + + append(item: any, referenceItem: string): kendo.ui.Menu; append(item: any, referenceItem: JQuery): kendo.ui.Menu; close(element: string): kendo.ui.Menu; @@ -4279,6 +4710,7 @@ declare module kendo.ui { remove(element: string): kendo.ui.Menu; remove(element: Element): kendo.ui.Menu; remove(element: JQuery): kendo.ui.Menu; + } interface MenuAnimationClose { @@ -4300,7 +4732,7 @@ declare module kendo.ui { name?: string; animation?: MenuAnimation; closeOnClick?: boolean; - dataSource?: any; + dataSource?: any|any; direction?: string; hoverDelay?: number; openOnClick?: boolean; @@ -4314,8 +4746,8 @@ declare module kendo.ui { } interface MenuEvent { sender: Menu; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } interface MenuCloseEvent extends MenuEvent { @@ -4340,14 +4772,25 @@ declare module kendo.ui { class MultiSelect extends kendo.ui.Widget { + static fn: MultiSelect; - static extend(proto: Object): MultiSelect; + + options: MultiSelectOptions; + + dataSource: kendo.data.DataSource; + input: JQuery; + list: JQuery; + ul: JQuery; + tagList: JQuery; element: JQuery; wrapper: JQuery; + + static extend(proto: Object): MultiSelect; + constructor(element: Element, options?: MultiSelectOptions); - options: MultiSelectOptions; - dataSource: kendo.data.DataSource; + + close(): void; dataItems(): any; destroy(): void; @@ -4362,10 +4805,7 @@ declare module kendo.ui { value(): any; value(value: any): void; value(value: string): void; - input: JQuery; - list: JQuery; - ul: JQuery; - tagList: JQuery; + } interface MultiSelectAnimationClose { @@ -4393,23 +4833,25 @@ declare module kendo.ui { animation?: MultiSelectAnimation; autoBind?: boolean; autoClose?: boolean; - dataSource?: any; + dataSource?: any|any|kendo.data.DataSource; dataTextField?: string; dataValueField?: string; delay?: number; enable?: boolean; filter?: string; - fixedGroupTemplate?: any; - groupTemplate?: any; + fixedGroupTemplate?: string|Function; + groupTemplate?: string|Function; height?: number; highlightFirst?: boolean; ignoreCase?: string; minLength?: number; maxSelectedItems?: number; placeholder?: string; - headerTemplate?: any; - itemTemplate?: any; + popup?: any; + headerTemplate?: string|Function; + itemTemplate?: string|Function; tagTemplate?: string; + tagMode?: string; value?: any; valuePrimitive?: boolean; virtual?: MultiSelectVirtual; @@ -4422,8 +4864,8 @@ declare module kendo.ui { } interface MultiSelectEvent { sender: MultiSelect; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } interface MultiSelectChangeEvent extends MultiSelectEvent { @@ -4448,13 +4890,20 @@ declare module kendo.ui { class Notification extends kendo.ui.Widget { + static fn: Notification; - static extend(proto: Object): Notification; + + options: NotificationOptions; + element: JQuery; wrapper: JQuery; + + static extend(proto: Object): Notification; + constructor(element: Element, options?: NotificationOptions); - options: NotificationOptions; + + error(data: any): void; error(data: string): void; error(data: Function): void; @@ -4472,6 +4921,7 @@ declare module kendo.ui { warning(data: any): void; warning(data: string): void; warning(data: Function): void; + } interface NotificationPosition { @@ -4490,23 +4940,23 @@ declare module kendo.ui { interface NotificationOptions { name?: string; allowHideAfter?: number; - animation?: any; - appendTo?: any; + animation?: any|boolean; + appendTo?: string|JQuery; autoHideAfter?: number; button?: boolean; - height?: any; + height?: number|string; hideOnClick?: boolean; position?: NotificationPosition; stacking?: string; templates?: NotificationTemplate[]; - width?: any; + width?: number|string; hide?(e: NotificationHideEvent): void; show?(e: NotificationShowEvent): void; } interface NotificationEvent { sender: Notification; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } interface NotificationHideEvent extends NotificationEvent { @@ -4519,13 +4969,20 @@ declare module kendo.ui { class NumericTextBox extends kendo.ui.Widget { + static fn: NumericTextBox; - static extend(proto: Object): NumericTextBox; + + options: NumericTextBoxOptions; + element: JQuery; wrapper: JQuery; + + static extend(proto: Object): NumericTextBox; + constructor(element: Element, options?: NumericTextBoxOptions); - options: NumericTextBoxOptions; + + destroy(): void; enable(enable: boolean): void; readonly(readonly: boolean): void; @@ -4542,6 +4999,7 @@ declare module kendo.ui { value(): number; value(value: number): void; value(value: string): void; + } interface NumericTextBoxOptions { @@ -4562,8 +5020,8 @@ declare module kendo.ui { } interface NumericTextBoxEvent { sender: NumericTextBox; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } interface NumericTextBoxChangeEvent extends NumericTextBoxEvent { @@ -4574,24 +5032,33 @@ declare module kendo.ui { class Pager extends kendo.ui.Widget { + static fn: Pager; - static extend(proto: Object): Pager; + + options: PagerOptions; + + dataSource: kendo.data.DataSource; element: JQuery; wrapper: JQuery; + + static extend(proto: Object): Pager; + constructor(element: Element, options?: PagerOptions); - options: PagerOptions; - dataSource: kendo.data.DataSource; + + totalPages(): number; pageSize(): number; - page(page: boolean): number; + page(page: number): number; refresh(): void; destroy(): void; + } interface PagerMessages { display?: string; empty?: string; + allPages?: string; page?: string; of?: string; itemsPerPage?: string; @@ -4606,13 +5073,13 @@ declare module kendo.ui { name?: string; autoBind?: boolean; buttonCount?: number; - dataSource?: any; + dataSource?: any|kendo.data.DataSource; selectTemplate?: string; linkTemplate?: string; info?: boolean; input?: boolean; numeric?: boolean; - pageSizes?: any; + pageSizes?: boolean|any; previousNext?: boolean; refresh?: boolean; messages?: PagerMessages; @@ -4620,8 +5087,8 @@ declare module kendo.ui { } interface PagerEvent { sender: Pager; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } interface PagerChangeEvent extends PagerEvent { @@ -4629,13 +5096,20 @@ declare module kendo.ui { class PanelBar extends kendo.ui.Widget { + static fn: PanelBar; - static extend(proto: Object): PanelBar; + + options: PanelBarOptions; + element: JQuery; wrapper: JQuery; + + static extend(proto: Object): PanelBar; + constructor(element: Element, options?: PanelBarOptions); - options: PanelBarOptions; + + append(item: string, referenceItem: string): kendo.ui.PanelBar; append(item: string, referenceItem: Element): kendo.ui.PanelBar; append(item: string, referenceItem: JQuery): kendo.ui.PanelBar; @@ -4693,6 +5167,7 @@ declare module kendo.ui { select(element?: string): void; select(element?: Element): void; select(element?: JQuery): void; + } interface PanelBarAnimationCollapse { @@ -4714,7 +5189,7 @@ declare module kendo.ui { name?: string; animation?: PanelBarAnimation; contentUrls?: any; - dataSource?: any; + dataSource?: any|any; expandMode?: string; activate?(e: PanelBarActivateEvent): void; collapse?(e: PanelBarCollapseEvent): void; @@ -4725,8 +5200,8 @@ declare module kendo.ui { } interface PanelBarEvent { sender: PanelBar; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } interface PanelBarActivateEvent extends PanelBarEvent { @@ -4757,17 +5232,25 @@ declare module kendo.ui { class PivotConfigurator extends kendo.ui.Widget { + static fn: PivotConfigurator; - static extend(proto: Object): PivotConfigurator; + + options: PivotConfiguratorOptions; + + dataSource: kendo.data.DataSource; element: JQuery; wrapper: JQuery; + + static extend(proto: Object): PivotConfigurator; + constructor(element: Element, options?: PivotConfiguratorOptions); - options: PivotConfiguratorOptions; - dataSource: kendo.data.DataSource; + + destroy(): void; refresh(): void; setDataSource(dataSource: kendo.data.PivotDataSource): void; + } interface PivotConfiguratorMessagesFieldMenuOperators { @@ -4810,28 +5293,35 @@ declare module kendo.ui { interface PivotConfiguratorOptions { name?: string; - dataSource?: any; + dataSource?: any|kendo.data.PivotDataSource; filterable?: boolean; sortable?: PivotConfiguratorSortable; - height?: any; + height?: number|string; messages?: PivotConfiguratorMessages; } interface PivotConfiguratorEvent { sender: PivotConfigurator; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } class PivotGrid extends kendo.ui.Widget { + static fn: PivotGrid; - static extend(proto: Object): PivotGrid; + + options: PivotGridOptions; + + dataSource: kendo.data.DataSource; element: JQuery; wrapper: JQuery; + + static extend(proto: Object): PivotGrid; + constructor(element: Element, options?: PivotGridOptions); - options: PivotGridOptions; - dataSource: kendo.data.DataSource; + + cellInfo(columnIndex: number, rowIndex: number): any; cellInfoByElement(cell: string): any; cellInfoByElement(cell: Element): any; @@ -4841,6 +5331,7 @@ declare module kendo.ui { setDataSource(dataSource: kendo.data.PivotDataSource): void; saveAsExcel(): void; saveAsPDF(): JQueryPromise; + } interface PivotGridExcel { @@ -4881,14 +5372,15 @@ declare module kendo.ui { } interface PivotGridPdfMargin { - bottom?: any; - left?: any; - right?: any; - top?: any; + bottom?: number|string; + left?: number|string; + right?: number|string; + top?: number|string; } interface PivotGridPdf { author?: string; + avoidLinks?: boolean|string; creator?: string; date?: Date; fileName?: string; @@ -4896,7 +5388,7 @@ declare module kendo.ui { keywords?: string; landscape?: boolean; margin?: PivotGridPdfMargin; - paperSize?: any; + paperSize?: string|any; proxyURL?: string; proxyTarget?: string; subject?: string; @@ -4909,7 +5401,7 @@ declare module kendo.ui { interface PivotGridOptions { name?: string; - dataSource?: any; + dataSource?: any|kendo.data.PivotDataSource; autoBind?: boolean; reorderable?: boolean; excel?: PivotGridExcel; @@ -4917,12 +5409,12 @@ declare module kendo.ui { filterable?: boolean; sortable?: PivotGridSortable; columnWidth?: number; - height?: any; - columnHeaderTemplate?: any; - dataCellTemplate?: any; - kpiStatusTemplate?: any; - kpiTrendTemplate?: any; - rowHeaderTemplate?: any; + height?: number|string; + columnHeaderTemplate?: string|Function; + dataCellTemplate?: string|Function; + kpiStatusTemplate?: string|Function; + kpiTrendTemplate?: string|Function; + rowHeaderTemplate?: string|Function; messages?: PivotGridMessages; dataBinding?(e: PivotGridDataBindingEvent): void; dataBound?(e: PivotGridDataBoundEvent): void; @@ -4933,8 +5425,8 @@ declare module kendo.ui { } interface PivotGridEvent { sender: PivotGrid; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } interface PivotGridDataBindingEvent extends PivotGridEvent { @@ -4963,19 +5455,96 @@ declare module kendo.ui { } - class ProgressBar extends kendo.ui.Widget { - static fn: ProgressBar; - static extend(proto: Object): ProgressBar; + class Popup extends kendo.ui.Widget { + + static fn: Popup; + + options: PopupOptions; + element: JQuery; wrapper: JQuery; - constructor(element: Element, options?: ProgressBarOptions); + + static extend(proto: Object): Popup; + + constructor(element: Element, options?: PopupOptions); + + + close(): void; + open(): void; + position(): void; + setOptions(options: any): void; + visible(): boolean; + + } + + interface PopupAnimationClose { + effects?: string; + duration?: number; + } + + interface PopupAnimationOpen { + effects?: string; + duration?: number; + } + + interface PopupAnimation { + close?: PopupAnimationClose; + open?: PopupAnimationOpen; + } + + interface PopupOptions { + name?: string; + animation?: PopupAnimation; + anchor?: string|JQuery; + appendTo?: string|JQuery; + origin?: string; + position?: string; + activate?(e: PopupActivateEvent): void; + close?(e: PopupCloseEvent): void; + deactivate?(e: PopupDeactivateEvent): void; + open?(e: PopupOpenEvent): void; + } + interface PopupEvent { + sender: Popup; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface PopupActivateEvent extends PopupEvent { + } + + interface PopupCloseEvent extends PopupEvent { + } + + interface PopupDeactivateEvent extends PopupEvent { + } + + interface PopupOpenEvent extends PopupEvent { + } + + + class ProgressBar extends kendo.ui.Widget { + + static fn: ProgressBar; + options: ProgressBarOptions; + + progressStatus: JQuery; + progressWrapper: JQuery; + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): ProgressBar; + + constructor(element: Element, options?: ProgressBarOptions); + + enable(enable: boolean): void; value(): number; value(value: number): void; - progressStatus: JQuery; - progressWrapper: JQuery; + } interface ProgressBarAnimation { @@ -4999,8 +5568,8 @@ declare module kendo.ui { } interface ProgressBarEvent { sender: ProgressBar; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } interface ProgressBarChangeEvent extends ProgressBarEvent { @@ -5013,18 +5582,26 @@ declare module kendo.ui { class RangeSlider extends kendo.ui.Widget { + static fn: RangeSlider; - static extend(proto: Object): RangeSlider; + + options: RangeSliderOptions; + element: JQuery; wrapper: JQuery; + + static extend(proto: Object): RangeSlider; + constructor(element: Element, options?: RangeSliderOptions); - options: RangeSliderOptions; + + destroy(): void; enable(enable: boolean): void; value(): any; value(selectionStart: number, selectionEnd: number): void; resize(): void; + } interface RangeSliderTooltip { @@ -5049,8 +5626,8 @@ declare module kendo.ui { } interface RangeSliderEvent { sender: RangeSlider; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } interface RangeSliderChangeEvent extends RangeSliderEvent { @@ -5063,16 +5640,24 @@ declare module kendo.ui { class ResponsivePanel extends kendo.ui.Widget { + static fn: ResponsivePanel; - static extend(proto: Object): ResponsivePanel; + + options: ResponsivePanelOptions; + element: JQuery; wrapper: JQuery; + + static extend(proto: Object): ResponsivePanel; + constructor(element: Element, options?: ResponsivePanelOptions); - options: ResponsivePanelOptions; + + close(): void; destroy(): void; open(): void; + } interface ResponsivePanelOptions { @@ -5086,20 +5671,27 @@ declare module kendo.ui { } interface ResponsivePanelEvent { sender: ResponsivePanel; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } class Scheduler extends kendo.ui.Widget { + static fn: Scheduler; - static extend(proto: Object): Scheduler; + + options: SchedulerOptions; + + dataSource: kendo.data.DataSource; element: JQuery; wrapper: JQuery; + + static extend(proto: Object): Scheduler; + constructor(element: Element, options?: SchedulerOptions); - options: SchedulerOptions; - dataSource: kendo.data.DataSource; + + addEvent(data: any): void; cancelEvent(): void; data(): void; @@ -5124,6 +5716,8 @@ declare module kendo.ui { slotByElement(element: JQuery): any; view(): kendo.ui.SchedulerView; view(type?: string): void; + viewName(): string; + } interface SchedulerCurrentTimeMarker { @@ -5132,19 +5726,19 @@ declare module kendo.ui { } interface SchedulerEditable { - confirmation?: any; + confirmation?: boolean|string; create?: boolean; destroy?: boolean; editRecurringMode?: string; move?: boolean; resize?: boolean; - template?: any; + template?: string|Function; update?: boolean; window?: any; } interface SchedulerFooter { - command?: any; + command?: string|boolean; } interface SchedulerGroup { @@ -5152,6 +5746,10 @@ declare module kendo.ui { orientation?: string; } + interface SchedulerMessagesEditable { + confirmation?: string; + } + interface SchedulerMessagesEditor { allDayEvent?: string; description?: string; @@ -5269,6 +5867,7 @@ declare module kendo.ui { showWorkDay?: string; time?: string; today?: string; + editable?: SchedulerMessagesEditable; editor?: SchedulerMessagesEditor; recurrenceEditor?: SchedulerMessagesRecurrenceEditor; recurrenceMessages?: SchedulerMessagesRecurrenceMessages; @@ -5276,14 +5875,15 @@ declare module kendo.ui { } interface SchedulerPdfMargin { - bottom?: any; - left?: any; - right?: any; - top?: any; + bottom?: number|string; + left?: number|string; + right?: number|string; + top?: number|string; } interface SchedulerPdf { author?: string; + avoidLinks?: boolean|string; creator?: string; date?: Date; fileName?: string; @@ -5291,7 +5891,7 @@ declare module kendo.ui { keywords?: string; landscape?: boolean; margin?: SchedulerPdfMargin; - paperSize?: any; + paperSize?: string|any; proxyURL?: string; proxyTarget?: string; subject?: string; @@ -5300,7 +5900,7 @@ declare module kendo.ui { interface SchedulerResource { dataColorField?: string; - dataSource?: any; + dataSource?: any|any|kendo.data.DataSource; dataTextField?: string; dataValueField?: string; field?: string; @@ -5325,26 +5925,26 @@ declare module kendo.ui { } interface SchedulerView { - allDayEventTemplate?: any; + allDayEventTemplate?: string|Function; allDaySlot?: boolean; - allDaySlotTemplate?: any; + allDaySlotTemplate?: string|Function; columnWidth?: number; - dateHeaderTemplate?: any; - dayTemplate?: any; + dateHeaderTemplate?: string|Function; + dayTemplate?: string|Function; editable?: SchedulerViewEditable; endTime?: Date; eventHeight?: number; - eventTemplate?: any; - eventTimeTemplate?: any; + eventTemplate?: string|Function; + eventTimeTemplate?: string|Function; group?: SchedulerViewGroup; majorTick?: number; - majorTimeHeaderTemplate?: any; + majorTimeHeaderTemplate?: string|Function; minorTickCount?: number; - minorTimeHeaderTemplate?: any; + minorTimeHeaderTemplate?: string|Function; selected?: boolean; selectedDateFormat?: string; showWorkHours?: boolean; - slotTemplate?: any; + slotTemplate?: string|Function; startTime?: Date; title?: string; type?: string; @@ -5362,27 +5962,27 @@ declare module kendo.ui { interface SchedulerOptions { name?: string; - allDayEventTemplate?: any; + allDayEventTemplate?: string|Function; allDaySlot?: boolean; autoBind?: boolean; currentTimeMarker?: SchedulerCurrentTimeMarker; - dataSource?: any; + dataSource?: any|any|kendo.data.SchedulerDataSource; date?: Date; - dateHeaderTemplate?: any; + dateHeaderTemplate?: string|Function; editable?: SchedulerEditable; endTime?: Date; - eventTemplate?: any; + eventTemplate?: string|Function; footer?: SchedulerFooter; group?: SchedulerGroup; - height?: any; + height?: number|string; majorTick?: number; - majorTimeHeaderTemplate?: any; + majorTimeHeaderTemplate?: string|Function; max?: Date; messages?: SchedulerMessages; min?: Date; minorTickCount?: number; - minorTimeHeaderTemplate?: any; - mobile?: any; + minorTimeHeaderTemplate?: string|Function; + mobile?: boolean|string; pdf?: SchedulerPdf; resources?: SchedulerResource[]; selectable?: boolean; @@ -5392,8 +5992,8 @@ declare module kendo.ui { timezone?: string; toolbar?: SchedulerToolbarItem[]; views?: SchedulerView[]; - groupHeaderTemplate?: any; - width?: any; + groupHeaderTemplate?: string|Function; + width?: number|string; workDayStart?: Date; workDayEnd?: Date; workWeekStart?: number; @@ -5417,8 +6017,8 @@ declare module kendo.ui { } interface SchedulerEvent { sender: Scheduler; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } interface SchedulerAddEvent extends SchedulerEvent { @@ -5501,18 +6101,26 @@ declare module kendo.ui { class Slider extends kendo.ui.Widget { + static fn: Slider; - static extend(proto: Object): Slider; + + options: SliderOptions; + element: JQuery; wrapper: JQuery; + + static extend(proto: Object): Slider; + constructor(element: Element, options?: SliderOptions); - options: SliderOptions; + + destroy(): void; enable(enable: boolean): void; value(): number; value(value: number): void; resize(): void; + } interface SliderTooltip { @@ -5539,8 +6147,8 @@ declare module kendo.ui { } interface SliderEvent { sender: Slider; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } interface SliderChangeEvent extends SliderEvent { @@ -5553,15 +6161,23 @@ declare module kendo.ui { class Sortable extends kendo.ui.Widget { + static fn: Sortable; - static extend(proto: Object): Sortable; + + options: SortableOptions; + element: JQuery; wrapper: JQuery; + + static extend(proto: Object): Sortable; + constructor(element: Element, options?: SortableOptions); - options: SortableOptions; + + indexOf(element: JQuery): number; items(): JQuery; + } interface SortableCursorOffset { @@ -5572,17 +6188,18 @@ declare module kendo.ui { interface SortableOptions { name?: string; axis?: string; - container?: any; + autoScroll?: boolean; + container?: string|JQuery; connectWith?: string; cursor?: string; cursorOffset?: SortableCursorOffset; disabled?: string; filter?: string; handler?: string; - hint?: any; + hint?: Function|string|JQuery; holdToDrag?: boolean; ignore?: string; - placeholder?: any; + placeholder?: Function|string|JQuery; start?(e: SortableStartEvent): void; move?(e: SortableMoveEvent): void; end?(e: SortableEndEvent): void; @@ -5591,8 +6208,8 @@ declare module kendo.ui { } interface SortableEvent { sender: Sortable; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } interface SortableStartEvent extends SortableEvent { @@ -5629,13 +6246,20 @@ declare module kendo.ui { class Splitter extends kendo.ui.Widget { + static fn: Splitter; - static extend(proto: Object): Splitter; + + options: SplitterOptions; + element: JQuery; wrapper: JQuery; + + static extend(proto: Object): Splitter; + constructor(element: Element, options?: SplitterOptions); - options: SplitterOptions; + + ajaxRequest(pane: string, url: string, data: any): void; ajaxRequest(pane: string, url: string, data: string): void; ajaxRequest(pane: Element, url: string, data: any): void; @@ -5671,6 +6295,7 @@ declare module kendo.ui { toggle(pane: string, expand?: boolean): void; toggle(pane: Element, expand?: boolean): void; toggle(pane: JQuery, expand?: boolean): void; + } interface SplitterPane { @@ -5698,8 +6323,8 @@ declare module kendo.ui { } interface SplitterEvent { sender: Splitter; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } interface SplitterCollapseEvent extends SplitterEvent { @@ -5720,14 +6345,206 @@ declare module kendo.ui { } - class TabStrip extends kendo.ui.Widget { - static fn: TabStrip; - static extend(proto: Object): TabStrip; + class Spreadsheet extends kendo.ui.Widget { + + static fn: Spreadsheet; + + options: SpreadsheetOptions; + element: JQuery; wrapper: JQuery; - constructor(element: Element, options?: TabStripOptions); + + static extend(proto: Object): Spreadsheet; + + constructor(element: Element, options?: SpreadsheetOptions); + + + activeSheet(): kendo.spreadsheet.Sheet; + activeSheet(sheet?: kendo.spreadsheet.Sheet): void; + sheets(): any; + saveAsExcel(): void; + sheetByName(name: string): kendo.spreadsheet.Sheet; + sheetIndex(sheet: kendo.spreadsheet.Sheet): number; + sheetByIndex(index: number): kendo.spreadsheet.Sheet; + insertSheet(options: any): kendo.spreadsheet.Sheet; + moveSheetToIndex(sheet: kendo.spreadsheet.Sheet, index: number): void; + removeSheet(sheet: kendo.spreadsheet.Sheet): void; + renameSheet(sheet: kendo.spreadsheet.Sheet, newSheetName: string): kendo.spreadsheet.Sheet; + toJSON(): any; + fromJSON(options: any): void; + + } + + interface SpreadsheetExcel { + fileName?: string; + forceProxy?: boolean; + proxyURL?: string; + } + + interface SpreadsheetSheetColumn { + index?: number; + width?: number; + } + + interface SpreadsheetSheetFilterColumnCriteriaItem { + operator?: string; + value?: string; + } + + interface SpreadsheetSheetFilterColumn { + criteria?: SpreadsheetSheetFilterColumnCriteriaItem[]; + filter?: string; + index?: number; + logic?: string; + type?: string; + value?: number|string|Date; + values?: any; + } + + interface SpreadsheetSheetFilter { + columns?: SpreadsheetSheetFilterColumn[]; + ref?: string; + } + + interface SpreadsheetSheetRowCellBorderBottom { + color?: string; + size?: string; + } + + interface SpreadsheetSheetRowCellBorderLeft { + color?: string; + size?: string; + } + + interface SpreadsheetSheetRowCellBorderRight { + color?: string; + size?: string; + } + + interface SpreadsheetSheetRowCellBorderTop { + color?: string; + size?: string; + } + + interface SpreadsheetSheetRowCellValidation { + comparerType?: string; + dataType?: string; + from?: string; + to?: string; + allowNulls?: string; + messageTemplate?: string; + titleTemplate?: string; + } + + interface SpreadsheetSheetRowCell { + background?: string; + borderBottom?: SpreadsheetSheetRowCellBorderBottom; + borderLeft?: SpreadsheetSheetRowCellBorderLeft; + borderTop?: SpreadsheetSheetRowCellBorderTop; + borderRight?: SpreadsheetSheetRowCellBorderRight; + color?: string; + fontFamily?: string; + fontSize?: number; + italic?: boolean; + bold?: boolean; + format?: string; + formula?: string; + index?: number; + textAlign?: string; + underline?: boolean; + value?: number|string|boolean|Date; + validation?: SpreadsheetSheetRowCellValidation; + verticalAlign?: string; + wrap?: boolean; + } + + interface SpreadsheetSheetRow { + cells?: SpreadsheetSheetRowCell[]; + height?: number; + index?: number; + } + + interface SpreadsheetSheetSortColumn { + ascending?: boolean; + index?: number; + } + + interface SpreadsheetSheetSort { + columns?: SpreadsheetSheetSortColumn[]; + ref?: string; + } + + interface SpreadsheetSheet { + activeCell?: string; + name?: string; + columns?: SpreadsheetSheetColumn[]; + dataSource?: kendo.data.DataSource; + filter?: SpreadsheetSheetFilter; + frozenColumns?: number; + frozenRows?: number; + mergedCells?: any; + rows?: SpreadsheetSheetRow[]; + selection?: string; + sort?: SpreadsheetSheetSort; + } + + interface SpreadsheetInsertSheetOptions { + rows?: number; + columns?: number; + rowHeight?: number; + columnWidth?: number; + headerHeight?: number; + headerWidth?: number; + dataSource?: kendo.data.DataSource; + } + + interface SpreadsheetOptions { + name?: string; + activeSheet?: string; + columnWidth?: number; + columns?: number; + headerHeight?: number; + headerWidth?: number; + excel?: SpreadsheetExcel; + rowHeight?: number; + rows?: number; + sheets?: SpreadsheetSheet[]; + toolbar?: boolean; + render?(e: SpreadsheetRenderEvent): void; + excelExport?(e: SpreadsheetExcelExportEvent): void; + } + interface SpreadsheetEvent { + sender: Spreadsheet; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface SpreadsheetRenderEvent extends SpreadsheetEvent { + } + + interface SpreadsheetExcelExportEvent extends SpreadsheetEvent { + data?: any; + workbook?: kendo.ooxml.Workbook; + } + + + class TabStrip extends kendo.ui.Widget { + + static fn: TabStrip; + options: TabStripOptions; + + tabGroup: JQuery; + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): TabStrip; + + constructor(element: Element, options?: TabStripOptions); + + activateTab(item: JQuery): void; append(tab: any): kendo.ui.TabStrip; contentElement(itemIndex: number): Element; @@ -5770,7 +6587,7 @@ declare module kendo.ui { select(element: JQuery): void; select(element: number): void; setDataSource(): void; - tabGroup: JQuery; + } interface TabStripAnimationClose { @@ -5788,6 +6605,10 @@ declare module kendo.ui { open?: TabStripAnimationOpen; } + interface TabStripScrollable { + distance?: number; + } + interface TabStripOptions { name?: string; animation?: TabStripAnimation; @@ -5800,7 +6621,9 @@ declare module kendo.ui { dataTextField?: string; dataUrlField?: string; navigatable?: boolean; + scrollable?: TabStripScrollable; tabPosition?: string; + value?: string; activate?(e: TabStripActivateEvent): void; contentLoad?(e: TabStripContentLoadEvent): void; error?(e: TabStripErrorEvent): void; @@ -5809,8 +6632,8 @@ declare module kendo.ui { } interface TabStripEvent { sender: TabStrip; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } interface TabStripActivateEvent extends TabStripEvent { @@ -5840,13 +6663,20 @@ declare module kendo.ui { class TimePicker extends kendo.ui.Widget { + static fn: TimePicker; - static extend(proto: Object): TimePicker; + + options: TimePickerOptions; + element: JQuery; wrapper: JQuery; + + static extend(proto: Object): TimePicker; + constructor(element: Element, options?: TimePickerOptions); - options: TimePickerOptions; + + close(): void; destroy(): void; enable(enable: boolean): void; @@ -5862,6 +6692,7 @@ declare module kendo.ui { value(): Date; value(value: Date): void; value(value: string): void; + } interface TimePickerAnimationClose { @@ -5896,8 +6727,8 @@ declare module kendo.ui { } interface TimePickerEvent { sender: TimePicker; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } interface TimePickerChangeEvent extends TimePickerEvent { @@ -5911,23 +6742,37 @@ declare module kendo.ui { class ToolBar extends kendo.ui.Widget { + static fn: ToolBar; - static extend(proto: Object): ToolBar; + + options: ToolBarOptions; + element: JQuery; wrapper: JQuery; + + static extend(proto: Object): ToolBar; + constructor(element: Element, options?: ToolBarOptions); - options: ToolBarOptions; + + add(command: any): void; destroy(): void; enable(command: string, enable: boolean): void; enable(command: Element, enable: boolean): void; enable(command: JQuery, enable: boolean): void; getSelectedFromGroup(groupName: string): void; + hide(command: string): void; + hide(command: Element): void; + hide(command: JQuery): void; remove(command: string): void; remove(command: Element): void; remove(command: JQuery): void; + show(command: string): void; + show(command: Element): void; + show(command: JQuery): void; toggle(): void; + } interface ToolBarItemButton { @@ -5935,6 +6780,7 @@ declare module kendo.ui { click?: Function; enable?: boolean; group?: string; + hidden?: boolean; icon?: string; id?: string; imageUrl?: string; @@ -5951,6 +6797,7 @@ declare module kendo.ui { interface ToolBarItemMenuButton { attributes?: any; enable?: boolean; + hidden?: boolean; icon?: string; id?: string; imageUrl?: string; @@ -5965,18 +6812,19 @@ declare module kendo.ui { click?: Function; enable?: boolean; group?: string; + hidden?: boolean; icon?: string; id?: string; imageUrl?: string; menuButtons?: ToolBarItemMenuButton[]; overflow?: string; - overflowTemplate?: any; + overflowTemplate?: string|Function; primary?: boolean; selected?: boolean; showIcon?: string; showText?: string; spriteCssClass?: string; - template?: any; + template?: string|Function; text?: string; togglable?: boolean; toggle?: Function; @@ -5997,8 +6845,8 @@ declare module kendo.ui { } interface ToolBarEvent { sender: ToolBar; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } interface ToolBarClickEvent extends ToolBarEvent { @@ -6028,17 +6876,25 @@ declare module kendo.ui { class Tooltip extends kendo.ui.Widget { + static fn: Tooltip; - static extend(proto: Object): Tooltip; + + options: TooltipOptions; + element: JQuery; wrapper: JQuery; + + static extend(proto: Object): Tooltip; + constructor(element: Element, options?: TooltipOptions); - options: TooltipOptions; + + show(element: JQuery): void; hide(): void; refresh(): void; target(): JQuery; + } interface TooltipAnimationClose { @@ -6081,8 +6937,8 @@ declare module kendo.ui { } interface TooltipEvent { sender: Tooltip; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } interface TooltipRequestStartEvent extends TooltipEvent { @@ -6097,15 +6953,23 @@ declare module kendo.ui { class Touch extends kendo.ui.Widget { + static fn: Touch; - static extend(proto: Object): Touch; + + options: TouchOptions; + element: JQuery; wrapper: JQuery; + + static extend(proto: Object): Touch; + constructor(element: Element, options?: TouchOptions); - options: TouchOptions; + + cancel(): void; destroy(): void; + } interface TouchOptions { @@ -6133,8 +6997,8 @@ declare module kendo.ui { } interface TouchEvent { sender: Touch; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } interface TouchTouchstartEvent extends TouchEvent { @@ -6200,14 +7064,21 @@ declare module kendo.ui { class TreeList extends kendo.ui.Widget { + static fn: TreeList; - static extend(proto: Object): TreeList; + + options: TreeListOptions; + + dataSource: kendo.data.DataSource; element: JQuery; wrapper: JQuery; + + static extend(proto: Object): TreeList; + constructor(element: Element, options?: TreeListOptions); - options: TreeListOptions; - dataSource: kendo.data.DataSource; + + addRow(parentRow: string): void; addRow(parentRow: Element): void; addRow(parentRow: JQuery): void; @@ -6220,6 +7091,8 @@ declare module kendo.ui { destroy(): void; editRow(row: JQuery): void; expand(): void; + itemFor(model: kendo.data.TreeListModel): JQuery; + itemFor(model: any): JQuery; refresh(): void; removeRow(row: string): void; removeRow(row: Element): void; @@ -6240,6 +7113,7 @@ declare module kendo.ui { unlockColumn(column: number): void; unlockColumn(column: string): void; reorderColumn(destIndex: number, column: any): void; + } interface TreeListColumnMenuMessages { @@ -6264,7 +7138,7 @@ declare module kendo.ui { } interface TreeListColumnFilterable { - ui?: any; + ui?: string|Function; } interface TreeListColumnSortable { @@ -6278,14 +7152,15 @@ declare module kendo.ui { expandable?: boolean; field?: string; filterable?: TreeListColumnFilterable; - footerTemplate?: any; + footerTemplate?: string|Function; format?: string; headerAttributes?: any; - headerTemplate?: any; + headerTemplate?: string|Function; + minScreenWidth?: number; sortable?: TreeListColumnSortable; - template?: any; + template?: string|Function; title?: string; - width?: any; + width?: string|number; hidden?: boolean; menu?: boolean; locked?: boolean; @@ -6294,7 +7169,8 @@ declare module kendo.ui { interface TreeListEditable { mode?: string; - template?: any; + move?: boolean; + template?: string|Function; window?: any; } @@ -6343,14 +7219,15 @@ declare module kendo.ui { } interface TreeListPdfMargin { - bottom?: any; - left?: any; - right?: any; - top?: any; + bottom?: number|string; + left?: number|string; + right?: number|string; + top?: number|string; } interface TreeListPdf { author?: string; + avoidLinks?: boolean|string; creator?: string; date?: Date; fileName?: string; @@ -6358,7 +7235,7 @@ declare module kendo.ui { keywords?: string; landscape?: boolean; margin?: TreeListPdfMargin; - paperSize?: any; + paperSize?: string|any; proxyURL?: string; proxyTarget?: string; subject?: string; @@ -6382,15 +7259,15 @@ declare module kendo.ui { resizable?: boolean; reorderable?: boolean; columnMenu?: TreeListColumnMenu; - dataSource?: any; + dataSource?: any|any|kendo.data.TreeListDataSource; editable?: TreeListEditable; excel?: TreeListExcel; filterable?: TreeListFilterable; - height?: any; + height?: number|string; messages?: TreeListMessages; pdf?: TreeListPdf; - scrollable?: any; - selectable?: any; + scrollable?: boolean|any; + selectable?: boolean|string; sortable?: TreeListSortable; toolbar?: TreeListToolbarItem[]; cancel?(e: TreeListCancelEvent): void; @@ -6398,6 +7275,10 @@ declare module kendo.ui { collapse?(e: TreeListCollapseEvent): void; dataBinding?(e: TreeListDataBindingEvent): void; dataBound?(e: TreeListDataBoundEvent): void; + dragstart?(e: TreeListDragstartEvent): void; + drag?(e: TreeListDragEvent): void; + dragend?(e: TreeListDragendEvent): void; + drop?(e: TreeListDropEvent): void; edit?(e: TreeListEditEvent): void; excelExport?(e: TreeListExcelExportEvent): void; expand?(e: TreeListExpandEvent): void; @@ -6408,14 +7289,15 @@ declare module kendo.ui { columnShow?(e: TreeListColumnShowEvent): void; columnHide?(e: TreeListColumnHideEvent): void; columnReorder?(e: TreeListColumnReorderEvent): void; + columnResize?(e: TreeListColumnResizeEvent): void; columnMenuInit?(e: TreeListColumnMenuInitEvent): void; columnLock?(e: TreeListColumnLockEvent): void; columnUnlock?(e: TreeListColumnUnlockEvent): void; } interface TreeListEvent { sender: TreeList; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } interface TreeListCancelEvent extends TreeListEvent { @@ -6436,6 +7318,27 @@ declare module kendo.ui { interface TreeListDataBoundEvent extends TreeListEvent { } + interface TreeListDragstartEvent extends TreeListEvent { + source?: kendo.data.TreeListModel; + } + + interface TreeListDragEvent extends TreeListEvent { + source?: kendo.data.TreeListModel; + target?: JQuery; + } + + interface TreeListDragendEvent extends TreeListEvent { + source?: kendo.data.TreeListModel; + destination?: kendo.data.TreeListModel; + } + + interface TreeListDropEvent extends TreeListEvent { + source?: kendo.data.TreeListModel; + destination?: kendo.data.TreeListModel; + valid?: boolean; + setValid?: boolean; + } + interface TreeListEditEvent extends TreeListEvent { container?: JQuery; model?: kendo.data.TreeListModel; @@ -6483,6 +7386,12 @@ declare module kendo.ui { oldIndex?: number; } + interface TreeListColumnResizeEvent extends TreeListEvent { + column?: any; + newWidth?: number; + oldWidth?: number; + } + interface TreeListColumnMenuInitEvent extends TreeListEvent { container?: JQuery; field?: string; @@ -6498,14 +7407,21 @@ declare module kendo.ui { class TreeView extends kendo.ui.Widget { + static fn: TreeView; - static extend(proto: Object): TreeView; + + options: TreeViewOptions; + + dataSource: kendo.data.DataSource; element: JQuery; wrapper: JQuery; + + static extend(proto: Object): TreeView; + constructor(element: Element, options?: TreeViewOptions); - options: TreeViewOptions; - dataSource: kendo.data.DataSource; + + append(nodeData: any, parentNode?: JQuery, success?: Function): JQuery; append(nodeData: JQuery, parentNode?: JQuery, success?: Function): JQuery; collapse(nodes: JQuery): void; @@ -6542,7 +7458,9 @@ declare module kendo.ui { select(node?: Element): void; select(node?: string): void; setDataSource(dataSource: kendo.data.HierarchicalDataSource): void; - text(): string; + text(node: JQuery): string; + text(node: Element): string; + text(node: string): string; text(node: JQuery, newText: string): void; text(node: Element, newText: string): void; text(node: string, newText: string): void; @@ -6550,6 +7468,7 @@ declare module kendo.ui { toggle(node: Element): void; toggle(node: string): void; updateIndeterminate(node: JQuery): void; + } interface TreeViewAnimationCollapse { @@ -6570,7 +7489,7 @@ declare module kendo.ui { interface TreeViewCheckboxes { checkChildren?: boolean; name?: string; - template?: any; + template?: string|Function; } interface TreeViewMessages { @@ -6583,16 +7502,17 @@ declare module kendo.ui { name?: string; animation?: TreeViewAnimation; autoBind?: boolean; + autoScroll?: boolean; checkboxes?: TreeViewCheckboxes; dataImageUrlField?: string; - dataSource?: any; + dataSource?: any|any|kendo.data.HierarchicalDataSource; dataSpriteCssClassField?: string; - dataTextField?: any; + dataTextField?: string|any; dataUrlField?: string; dragAndDrop?: boolean; loadOnDemand?: boolean; messages?: TreeViewMessages; - template?: any; + template?: string|Function; change?(e: TreeViewEvent): void; check?(e: TreeViewCheckEvent): void; collapse?(e: TreeViewCollapseEvent): void; @@ -6607,8 +7527,8 @@ declare module kendo.ui { } interface TreeViewEvent { sender: TreeView; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } interface TreeViewCheckEvent extends TreeViewEvent { @@ -6665,17 +7585,25 @@ declare module kendo.ui { class Upload extends kendo.ui.Widget { + static fn: Upload; - static extend(proto: Object): Upload; + + options: UploadOptions; + element: JQuery; wrapper: JQuery; + + static extend(proto: Object): Upload; + constructor(element: Element, options?: UploadOptions); - options: UploadOptions; + + destroy(): void; disable(): void; enable(enable?: boolean): void; toggle(enable: boolean): void; + } interface UploadAsync { @@ -6717,7 +7645,7 @@ declare module kendo.ui { localization?: UploadLocalization; multiple?: boolean; showFileList?: boolean; - template?: any; + template?: string|Function; cancel?(e: UploadCancelEvent): void; complete?(e: UploadEvent): void; error?(e: UploadErrorEvent): void; @@ -6729,44 +7657,44 @@ declare module kendo.ui { } interface UploadEvent { sender: Upload; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } interface UploadCancelEvent extends UploadEvent { - files?: any; + files?: UploadFile[]; } interface UploadErrorEvent extends UploadEvent { - files?: any; + files?: UploadFile[]; operation?: string; XMLHttpRequest?: any; } interface UploadProgressEvent extends UploadEvent { - files?: any; + files?: UploadFile[]; percentComplete?: number; } interface UploadRemoveEvent extends UploadEvent { - files?: any; + files?: UploadFile[]; data?: any; } interface UploadSelectEvent extends UploadEvent { e?: any; - files?: any; + files?: UploadFile[]; } interface UploadSuccessEvent extends UploadEvent { - files?: any; + files?: UploadFile[]; operation?: string; - response?: string; + response?: any; XMLHttpRequest?: any; } interface UploadUploadEvent extends UploadEvent { - files?: any; + files?: UploadFile[]; data?: any; formData?: any; XMLHttpRequest?: any; @@ -6774,18 +7702,26 @@ declare module kendo.ui { class Validator extends kendo.ui.Widget { + static fn: Validator; - static extend(proto: Object): Validator; + + options: ValidatorOptions; + element: JQuery; wrapper: JQuery; + + static extend(proto: Object): Validator; + constructor(element: Element, options?: ValidatorOptions); - options: ValidatorOptions; + + errors(): any; hideMessages(): void; validate(): boolean; validateInput(input: Element): boolean; validateInput(input: JQuery): boolean; + } interface ValidatorOptions { @@ -6798,8 +7734,8 @@ declare module kendo.ui { } interface ValidatorEvent { sender: Validator; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } interface ValidatorValidateEvent extends ValidatorEvent { @@ -6807,17 +7743,25 @@ declare module kendo.ui { class Window extends kendo.ui.Widget { + static fn: Window; - static extend(proto: Object): Window; + + options: WindowOptions; + element: JQuery; wrapper: JQuery; + + static extend(proto: Object): Window; + constructor(element: Element, options?: WindowOptions); - options: WindowOptions; + + center(): kendo.ui.Window; close(): kendo.ui.Window; content(): any; content(content?: string): void; + content(content?: JQuery): void; destroy(): void; maximize(): kendo.ui.Window; minimize(): kendo.ui.Window; @@ -6831,6 +7775,7 @@ declare module kendo.ui { toFront(): kendo.ui.Window; toggleMaximization(): kendo.ui.Window; unpin(): void; + } interface WindowAnimationClose { @@ -6853,8 +7798,8 @@ declare module kendo.ui { } interface WindowPosition { - top?: any; - left?: any; + top?: number|string; + left?: number|string; } interface WindowRefreshOptions { @@ -6869,7 +7814,7 @@ declare module kendo.ui { name?: string; actions?: any; animation?: WindowAnimation; - appendTo?: any; + appendTo?: any|string; autoFocus?: boolean; content?: WindowContent; draggable?: boolean; @@ -6882,10 +7827,11 @@ declare module kendo.ui { pinned?: boolean; position?: WindowPosition; resizable?: boolean; - title?: any; + scrollable?: boolean; + title?: string|boolean; visible?: boolean; - width?: any; - height?: any; + width?: number|string; + height?: number|string; activate?(e: WindowEvent): void; close?(e: WindowCloseEvent): void; deactivate?(e: WindowEvent): void; @@ -6898,8 +7844,8 @@ declare module kendo.ui { } interface WindowEvent { sender: Window; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } interface WindowCloseEvent extends WindowEvent { @@ -6915,13 +7861,20 @@ declare module kendo.ui { } declare module kendo.dataviz.ui { class Barcode extends kendo.ui.Widget { + static fn: Barcode; - static extend(proto: Object): Barcode; + + options: BarcodeOptions; + element: JQuery; wrapper: JQuery; + + static extend(proto: Object): Barcode; + constructor(element: Element, options?: BarcodeOptions); - options: BarcodeOptions; + + exportImage(options: any): JQueryPromise; exportPDF(options?: kendo.drawing.PDFOptions): JQueryPromise; exportSVG(options: any): JQueryPromise; @@ -6932,6 +7885,7 @@ declare module kendo.dataviz.ui { value(): string; value(value: number): void; value(value: string): void; + } interface BarcodeBorder { @@ -6986,20 +7940,27 @@ declare module kendo.dataviz.ui { } interface BarcodeEvent { sender: Barcode; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } class Chart extends kendo.ui.Widget { + static fn: Chart; - static extend(proto: Object): Chart; + + options: ChartOptions; + + dataSource: kendo.data.DataSource; element: JQuery; wrapper: JQuery; + + static extend(proto: Object): Chart; + constructor(element: Element, options?: ChartOptions); - options: ChartOptions; - dataSource: kendo.data.DataSource; + + destroy(): void; exportImage(options: any): JQueryPromise; exportPDF(options?: kendo.drawing.PDFOptions): JQueryPromise; @@ -7014,6 +7975,7 @@ declare module kendo.dataviz.ui { svg(): string; imageDataURL(): string; toggleHighlight(show: boolean, options: any): void; + } interface ChartCategoryAxisItemAutoBaseUnitSteps { @@ -7046,7 +8008,7 @@ declare module kendo.dataviz.ui { font?: string; format?: string; padding?: ChartCategoryAxisItemCrosshairTooltipPadding; - template?: any; + template?: string|Function; visible?: boolean; } @@ -7086,6 +8048,11 @@ declare module kendo.dataviz.ui { top?: number; } + interface ChartCategoryAxisItemLabelsRotation { + align?: string; + angle?: number|string; + } + interface ChartCategoryAxisItemLabels { background?: string; border?: ChartCategoryAxisItemLabelsBorder; @@ -7097,10 +8064,10 @@ declare module kendo.dataviz.ui { margin?: ChartCategoryAxisItemLabelsMargin; mirror?: boolean; padding?: ChartCategoryAxisItemLabelsPadding; - rotation?: number; + rotation?: ChartCategoryAxisItemLabelsRotation; skip?: number; step?: number; - template?: any; + template?: string|Function; visible?: boolean; visual?: Function; } @@ -7172,7 +8139,7 @@ declare module kendo.dataviz.ui { border?: ChartCategoryAxisItemNotesDataItemLabelBorder; color?: string; font?: string; - template?: any; + template?: string|Function; visible?: boolean; rotation?: number; format?: string; @@ -7218,7 +8185,7 @@ declare module kendo.dataviz.ui { border?: ChartCategoryAxisItemNotesLabelBorder; color?: string; font?: string; - template?: any; + template?: string|Function; visible?: boolean; rotation?: number; format?: string; @@ -7296,7 +8263,7 @@ declare module kendo.dataviz.ui { interface ChartCategoryAxisItem { autoBaseUnitSteps?: ChartCategoryAxisItemAutoBaseUnitSteps; - axisCrossingValue?: any; + axisCrossingValue?: any|Date|any; background?: string; baseUnit?: string; baseUnitStep?: any; @@ -7359,7 +8326,7 @@ declare module kendo.dataviz.ui { interface ChartLegendInactiveItemsLabels { color?: string; font?: string; - template?: any; + template?: string|Function; } interface ChartLegendInactiveItems { @@ -7367,6 +8334,7 @@ declare module kendo.dataviz.ui { } interface ChartLegendItem { + cursor?: string; visual?: Function; } @@ -7389,7 +8357,7 @@ declare module kendo.dataviz.ui { font?: string; margin?: ChartLegendLabelsMargin; padding?: ChartLegendLabelsPadding; - template?: any; + template?: string|Function; } interface ChartLegendMargin { @@ -7481,11 +8449,16 @@ declare module kendo.dataviz.ui { title?: ChartPaneTitle; } + interface ChartPannable { + key?: string; + lock?: string; + } + interface ChartPdfMargin { - bottom?: any; - left?: any; - right?: any; - top?: any; + bottom?: number|string; + left?: number|string; + right?: number|string; + top?: number|string; } interface ChartPdf { @@ -7497,7 +8470,7 @@ declare module kendo.dataviz.ui { keywords?: string; landscape?: boolean; margin?: ChartPdfMargin; - paperSize?: any; + paperSize?: string|any; proxyURL?: string; proxyTarget?: string; subject?: string; @@ -7533,10 +8506,10 @@ declare module kendo.dataviz.ui { } interface ChartSeriesItemBorder { - color?: any; - dashType?: any; - opacity?: any; - width?: any; + color?: string|Function; + dashType?: string|Function; + opacity?: number|Function; + width?: number|Function; } interface ChartSeriesItemConnectors { @@ -7551,26 +8524,26 @@ declare module kendo.dataviz.ui { } interface ChartSeriesItemErrorBars { - value?: any; + value?: string|number|any|Function; visual?: Function; - xValue?: any; - yValue?: any; + xValue?: string|number|any|Function; + yValue?: string|number|any|Function; endCaps?: boolean; color?: string; line?: ChartSeriesItemErrorBarsLine; } interface ChartSeriesItemExtremesBorder { - color?: any; - width?: any; + color?: string|Function; + width?: number|Function; } interface ChartSeriesItemExtremes { - background?: any; + background?: string|Function; border?: ChartSeriesItemExtremesBorder; - size?: any; - type?: any; - rotation?: any; + size?: number|Function; + type?: string|Function; + rotation?: number|Function; } interface ChartSeriesItemHighlightBorder { @@ -7596,15 +8569,15 @@ declare module kendo.dataviz.ui { } interface ChartSeriesItemLabelsBorder { - color?: any; - dashType?: any; - width?: any; + color?: string|Function; + dashType?: string|Function; + width?: number|Function; } interface ChartSeriesItemLabelsFromBorder { - color?: any; - dashType?: any; - width?: any; + color?: string|Function; + dashType?: string|Function; + width?: number|Function; } interface ChartSeriesItemLabelsFromMargin { @@ -7622,16 +8595,16 @@ declare module kendo.dataviz.ui { } interface ChartSeriesItemLabelsFrom { - background?: any; + background?: string|Function; border?: ChartSeriesItemLabelsFromBorder; - color?: any; - font?: any; - format?: any; + color?: string|Function; + font?: string|Function; + format?: string|Function; margin?: ChartSeriesItemLabelsFromMargin; padding?: ChartSeriesItemLabelsFromPadding; - position?: any; - template?: any; - visible?: any; + position?: string|Function; + template?: string|Function; + visible?: boolean|Function; } interface ChartSeriesItemLabelsMargin { @@ -7649,9 +8622,9 @@ declare module kendo.dataviz.ui { } interface ChartSeriesItemLabelsToBorder { - color?: any; - dashType?: any; - width?: any; + color?: string|Function; + dashType?: string|Function; + width?: number|Function; } interface ChartSeriesItemLabelsToMargin { @@ -7669,31 +8642,31 @@ declare module kendo.dataviz.ui { } interface ChartSeriesItemLabelsTo { - background?: any; + background?: string|Function; border?: ChartSeriesItemLabelsToBorder; - color?: any; - font?: any; - format?: any; + color?: string|Function; + font?: string|Function; + format?: string|Function; margin?: ChartSeriesItemLabelsToMargin; padding?: ChartSeriesItemLabelsToPadding; - position?: any; - template?: any; - visible?: any; + position?: string|Function; + template?: string|Function; + visible?: boolean|Function; } interface ChartSeriesItemLabels { align?: string; - background?: any; + background?: string|Function; border?: ChartSeriesItemLabelsBorder; - color?: any; + color?: string|Function; distance?: number; - font?: any; - format?: any; + font?: string|Function; + format?: string|Function; margin?: ChartSeriesItemLabelsMargin; padding?: ChartSeriesItemLabelsPadding; - position?: any; - template?: any; - visible?: any; + position?: string|Function; + template?: string|Function; + visible?: boolean|Function; visual?: Function; from?: ChartSeriesItemLabelsFrom; to?: ChartSeriesItemLabelsTo; @@ -7714,18 +8687,18 @@ declare module kendo.dataviz.ui { } interface ChartSeriesItemMarkersBorder { - color?: any; - width?: any; + color?: string|Function; + width?: number|Function; } interface ChartSeriesItemMarkers { - background?: any; + background?: string|Function; border?: ChartSeriesItemMarkersBorder; - size?: any; - type?: any; - visible?: any; + size?: number|Function; + type?: string|Function; + visible?: boolean|Function; visual?: Function; - rotation?: any; + rotation?: number|Function; } interface ChartSeriesItemNegativeValues { @@ -7757,7 +8730,7 @@ declare module kendo.dataviz.ui { border?: ChartSeriesItemNotesLabelBorder; color?: string; font?: string; - template?: any; + template?: string|Function; visible?: boolean; rotation?: number; format?: string; @@ -7779,16 +8752,16 @@ declare module kendo.dataviz.ui { } interface ChartSeriesItemOutliersBorder { - color?: any; - width?: any; + color?: string|Function; + width?: number|Function; } interface ChartSeriesItemOutliers { - background?: any; + background?: string|Function; border?: ChartSeriesItemOutliersBorder; - size?: any; - type?: any; - rotation?: any; + size?: number|Function; + type?: string|Function; + rotation?: number|Function; } interface ChartSeriesItemOverlay { @@ -7801,18 +8774,18 @@ declare module kendo.dataviz.ui { } interface ChartSeriesItemTargetBorder { - color?: any; - dashType?: any; - width?: any; + color?: string|Function; + dashType?: string|Function; + width?: number|Function; } interface ChartSeriesItemTargetLine { - width?: any; + width?: any|Function; } interface ChartSeriesItemTarget { border?: ChartSeriesItemTargetBorder; - color?: any; + color?: string|Function; line?: ChartSeriesItemTargetLine; } @@ -7835,23 +8808,23 @@ declare module kendo.dataviz.ui { font?: string; format?: string; padding?: ChartSeriesItemTooltipPadding; - template?: any; + template?: string|Function; visible?: boolean; } interface ChartSeriesItem { - aggregate?: any; + aggregate?: string|Function; axis?: string; border?: ChartSeriesItemBorder; categoryField?: string; closeField?: string; - color?: any; + color?: string|Function; colorField?: string; connectors?: ChartSeriesItemConnectors; currentField?: string; dashType?: string; data?: any; - downColor?: any; + downColor?: string|Function; downColorField?: string; segmentSpacing?: number; summaryField?: string; @@ -7961,7 +8934,7 @@ declare module kendo.dataviz.ui { format?: string; margin?: ChartSeriesDefaultsLabelsFromMargin; padding?: ChartSeriesDefaultsLabelsFromPadding; - template?: any; + template?: string|Function; visible?: boolean; } @@ -8007,7 +8980,7 @@ declare module kendo.dataviz.ui { format?: string; margin?: ChartSeriesDefaultsLabelsToMargin; padding?: ChartSeriesDefaultsLabelsToPadding; - template?: any; + template?: string|Function; visible?: boolean; } @@ -8019,7 +8992,7 @@ declare module kendo.dataviz.ui { format?: string; margin?: ChartSeriesDefaultsLabelsMargin; padding?: ChartSeriesDefaultsLabelsPadding; - template?: any; + template?: string|Function; visible?: boolean; visual?: Function; from?: ChartSeriesDefaultsLabelsFrom; @@ -8050,7 +9023,7 @@ declare module kendo.dataviz.ui { border?: ChartSeriesDefaultsNotesLabelBorder; color?: string; font?: string; - template?: any; + template?: string|Function; visible?: boolean; rotation?: number; format?: string; @@ -8097,7 +9070,7 @@ declare module kendo.dataviz.ui { font?: string; format?: string; padding?: ChartSeriesDefaultsTooltipPadding; - template?: any; + template?: string|Function; visible?: boolean; } @@ -8180,8 +9153,8 @@ declare module kendo.dataviz.ui { format?: string; padding?: ChartTooltipPadding; shared?: boolean; - sharedTemplate?: any; - template?: any; + sharedTemplate?: string|Function; + template?: string|Function; visible?: boolean; } @@ -8205,7 +9178,7 @@ declare module kendo.dataviz.ui { font?: string; format?: string; padding?: ChartValueAxisItemCrosshairTooltipPadding; - template?: any; + template?: string|Function; visible?: boolean; } @@ -8237,6 +9210,11 @@ declare module kendo.dataviz.ui { top?: number; } + interface ChartValueAxisItemLabelsRotation { + align?: string; + angle?: number|string; + } + interface ChartValueAxisItemLabels { background?: string; border?: ChartValueAxisItemLabelsBorder; @@ -8246,10 +9224,10 @@ declare module kendo.dataviz.ui { margin?: ChartValueAxisItemLabelsMargin; mirror?: boolean; padding?: ChartValueAxisItemLabelsPadding; - rotation?: number; + rotation?: ChartValueAxisItemLabelsRotation; skip?: number; step?: number; - template?: any; + template?: string|Function; visible?: boolean; visual?: Function; } @@ -8322,7 +9300,7 @@ declare module kendo.dataviz.ui { border?: ChartValueAxisItemNotesDataItemLabelBorder; color?: string; font?: string; - template?: any; + template?: string|Function; visible?: boolean; rotation?: number; format?: string; @@ -8368,7 +9346,7 @@ declare module kendo.dataviz.ui { border?: ChartValueAxisItemNotesLabelBorder; color?: string; font?: string; - template?: any; + template?: string|Function; visible?: boolean; rotation?: number; format?: string; @@ -8432,7 +9410,7 @@ declare module kendo.dataviz.ui { } interface ChartValueAxisItem { - axisCrossingValue?: any; + axisCrossingValue?: any|Date|any; background?: string; color?: string; crosshair?: ChartValueAxisItemCrosshair; @@ -8446,7 +9424,7 @@ declare module kendo.dataviz.ui { majorTicks?: ChartValueAxisItemMajorTicks; minorTicks?: ChartValueAxisItemMinorTicks; minorUnit?: number; - name?: any; + name?: string; narrowRange?: boolean; pane?: string; plotBands?: ChartValueAxisItemPlotBand[]; @@ -8477,7 +9455,7 @@ declare module kendo.dataviz.ui { font?: string; format?: string; padding?: ChartXAxisItemCrosshairTooltipPadding; - template?: any; + template?: string|Function; visible?: boolean; } @@ -8517,6 +9495,11 @@ declare module kendo.dataviz.ui { top?: number; } + interface ChartXAxisItemLabelsRotation { + align?: string; + angle?: number|string; + } + interface ChartXAxisItemLabels { background?: string; border?: ChartXAxisItemLabelsBorder; @@ -8528,10 +9511,10 @@ declare module kendo.dataviz.ui { margin?: ChartXAxisItemLabelsMargin; mirror?: boolean; padding?: ChartXAxisItemLabelsPadding; - rotation?: number; + rotation?: ChartXAxisItemLabelsRotation; skip?: number; step?: number; - template?: any; + template?: string|Function; visible?: boolean; visual?: Function; } @@ -8603,7 +9586,7 @@ declare module kendo.dataviz.ui { border?: ChartXAxisItemNotesDataItemLabelBorder; color?: string; font?: string; - template?: any; + template?: string|Function; visible?: boolean; rotation?: number; format?: string; @@ -8649,7 +9632,7 @@ declare module kendo.dataviz.ui { border?: ChartXAxisItemNotesLabelBorder; color?: string; font?: string; - template?: any; + template?: string|Function; visible?: boolean; rotation?: number; format?: string; @@ -8713,7 +9696,7 @@ declare module kendo.dataviz.ui { } interface ChartXAxisItem { - axisCrossingValue?: any; + axisCrossingValue?: any|Date|any; background?: string; baseUnit?: string; color?: string; @@ -8728,7 +9711,7 @@ declare module kendo.dataviz.ui { max?: any; min?: any; minorUnit?: number; - name?: any; + name?: string; narrowRange?: boolean; pane?: string; plotBands?: ChartXAxisItemPlotBand[]; @@ -8760,7 +9743,7 @@ declare module kendo.dataviz.ui { font?: string; format?: string; padding?: ChartYAxisItemCrosshairTooltipPadding; - template?: any; + template?: string|Function; visible?: boolean; } @@ -8800,6 +9783,11 @@ declare module kendo.dataviz.ui { top?: number; } + interface ChartYAxisItemLabelsRotation { + align?: string; + angle?: number; + } + interface ChartYAxisItemLabels { background?: string; border?: ChartYAxisItemLabelsBorder; @@ -8811,10 +9799,10 @@ declare module kendo.dataviz.ui { margin?: ChartYAxisItemLabelsMargin; mirror?: boolean; padding?: ChartYAxisItemLabelsPadding; - rotation?: number; + rotation?: ChartYAxisItemLabelsRotation; skip?: number; step?: number; - template?: any; + template?: string|Function; visible?: boolean; visual?: Function; } @@ -8886,7 +9874,7 @@ declare module kendo.dataviz.ui { border?: ChartYAxisItemNotesDataItemLabelBorder; color?: string; font?: string; - template?: any; + template?: string|Function; visible?: boolean; rotation?: number; format?: string; @@ -8932,7 +9920,7 @@ declare module kendo.dataviz.ui { border?: ChartYAxisItemNotesLabelBorder; color?: string; font?: string; - template?: any; + template?: string|Function; visible?: boolean; rotation?: number; format?: string; @@ -8996,7 +9984,7 @@ declare module kendo.dataviz.ui { } interface ChartYAxisItem { - axisCrossingValue?: any; + axisCrossingValue?: any|Date|any; background?: string; baseUnit?: string; color?: string; @@ -9011,7 +9999,7 @@ declare module kendo.dataviz.ui { max?: any; min?: any; minorUnit?: number; - name?: any; + name?: string; narrowRange?: boolean; pane?: string; plotBands?: ChartYAxisItemPlotBand[]; @@ -9022,6 +10010,20 @@ declare module kendo.dataviz.ui { notes?: ChartYAxisItemNotes; } + interface ChartZoomableMousewheel { + lock?: string; + } + + interface ChartZoomableSelection { + key?: string; + lock?: string; + } + + interface ChartZoomable { + mousewheel?: ChartZoomableMousewheel; + selection?: ChartZoomableSelection; + } + interface ChartExportImageOptions { width?: string; height?: string; @@ -9037,14 +10039,14 @@ declare module kendo.dataviz.ui { } interface ChartSeriesClickEventSeries { - type?: any; - name?: any; + type?: string; + name?: string; data?: any; } interface ChartSeriesHoverEventSeries { - type?: any; - name?: any; + type?: string; + name?: string; data?: any; } @@ -9054,9 +10056,10 @@ declare module kendo.dataviz.ui { axisDefaults?: any; categoryAxis?: ChartCategoryAxisItem[]; chartArea?: ChartChartArea; - dataSource?: any; + dataSource?: any|any|kendo.data.DataSource; legend?: ChartLegend; panes?: ChartPane[]; + pannable?: ChartPannable; pdf?: ChartPdf; plotArea?: ChartPlotArea; renderAs?: string; @@ -9070,6 +10073,7 @@ declare module kendo.dataviz.ui { valueAxis?: ChartValueAxisItem[]; xAxis?: ChartXAxisItem[]; yAxis?: ChartYAxisItem[]; + zoomable?: ChartZoomable; axisLabelClick?(e: ChartAxisLabelClickEvent): void; legendItemClick?(e: ChartLegendItemClickEvent): void; legendItemHover?(e: ChartLegendItemHoverEvent): void; @@ -9092,8 +10096,8 @@ declare module kendo.dataviz.ui { } interface ChartEvent { sender: Chart; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } interface ChartAxisLabelClickEvent extends ChartEvent { @@ -9145,6 +10149,7 @@ declare module kendo.dataviz.ui { value?: any; series?: any; dataItem?: any; + visual?: any; } interface ChartNoteHoverEvent extends ChartEvent { @@ -9153,6 +10158,7 @@ declare module kendo.dataviz.ui { value?: any; series?: any; dataItem?: any; + visual?: any; } interface ChartPlotAreaClickEvent extends ChartEvent { @@ -9221,14 +10227,23 @@ declare module kendo.dataviz.ui { class Diagram extends kendo.ui.Widget { + static fn: Diagram; - static extend(proto: Object): Diagram; + + options: DiagramOptions; + + dataSource: kendo.data.DataSource; + connections: DiagramConnection[]; + shapes: DiagramShape[]; element: JQuery; wrapper: JQuery; + + static extend(proto: Object): Diagram; + constructor(element: Element, options?: DiagramOptions); - options: DiagramOptions; - dataSource: kendo.data.DataSource; + + addConnection(connection: any, undoable: boolean): void; addShape(obj: any, undoable: boolean): kendo.dataviz.diagram.Shape; alignShapes(direction: string): void; @@ -9281,11 +10296,13 @@ declare module kendo.dataviz.ui { viewToModel(point: any): any; viewport(): void; zoom(zoom: number, point: any): void; + } interface DiagramConnectionDefaultsContent { - template?: any; + template?: string|Function; text?: string; + visual?: Function; } interface DiagramConnectionDefaultsEditableTool { @@ -9293,6 +10310,8 @@ declare module kendo.dataviz.ui { } interface DiagramConnectionDefaultsEditable { + drag?: boolean; + remove?: boolean; tools?: DiagramConnectionDefaultsEditableTool[]; } @@ -9362,16 +10381,20 @@ declare module kendo.dataviz.ui { content?: DiagramConnectionDefaultsContent; editable?: DiagramConnectionDefaultsEditable; endCap?: DiagramConnectionDefaultsEndCap; + fromConnector?: string; hover?: DiagramConnectionDefaultsHover; selectable?: boolean; selection?: DiagramConnectionDefaultsSelection; startCap?: DiagramConnectionDefaultsStartCap; stroke?: DiagramConnectionDefaultsStroke; + toConnector?: string; + type?: string; } interface DiagramConnectionContent { - template?: any; + template?: string|Function; text?: string; + visual?: Function; } interface DiagramConnectionEditableTool { @@ -9464,12 +10487,23 @@ declare module kendo.dataviz.ui { editable?: DiagramConnectionEditable; endCap?: DiagramConnectionEndCap; from?: DiagramConnectionFrom; + fromConnector?: string; hover?: DiagramConnectionHover; points?: DiagramConnectionPoint[]; selection?: DiagramConnectionSelection; startCap?: DiagramConnectionStartCap; stroke?: DiagramConnectionStroke; to?: DiagramConnectionTo; + toConnector?: string; + type?: string; + } + + interface DiagramEditableDragSnap { + size?: number; + } + + interface DiagramEditableDrag { + snap?: DiagramEditableDragSnap; } interface DiagramEditableResizeHandlesFill { @@ -9532,10 +10566,12 @@ declare module kendo.dataviz.ui { } interface DiagramEditable { - connectionTemplate?: any; + connectionTemplate?: string|Function; + drag?: DiagramEditableDrag; + remove?: boolean; resize?: DiagramEditableResize; rotate?: DiagramEditableRotate; - shapeTemplate?: any; + shapeTemplate?: string|Function; tools?: DiagramEditableTool[]; } @@ -9558,6 +10594,7 @@ declare module kendo.dataviz.ui { radialSeparation?: number; startRadialAngle?: number; subtype?: string; + tipOverTreeStartLevel?: number; type?: string; underneathHorizontalOffset?: number; underneathVerticalSeparation?: number; @@ -9570,10 +10607,10 @@ declare module kendo.dataviz.ui { } interface DiagramPdfMargin { - bottom?: any; - left?: any; - right?: any; - top?: any; + bottom?: number|string; + left?: number|string; + right?: number|string; + top?: number|string; } interface DiagramPdf { @@ -9585,7 +10622,7 @@ declare module kendo.dataviz.ui { keywords?: string; landscape?: boolean; margin?: DiagramPdfMargin; - paperSize?: any; + paperSize?: string|any; proxyURL?: string; proxyTarget?: string; subject?: string; @@ -9613,7 +10650,7 @@ declare module kendo.dataviz.ui { color?: string; fontFamily?: string; fontSize?: number; - template?: any; + template?: string|Function; text?: string; } @@ -9624,12 +10661,30 @@ declare module kendo.dataviz.ui { interface DiagramShapeDefaultsEditable { connect?: boolean; + drag?: boolean; + remove?: boolean; tools?: DiagramShapeDefaultsEditableTool[]; } + interface DiagramShapeDefaultsFillGradientStop { + offset?: number; + color?: string; + opacity?: number; + } + + interface DiagramShapeDefaultsFillGradient { + type?: string; + center?: any; + radius?: number; + start?: any; + end?: any; + stops?: DiagramShapeDefaultsFillGradientStop[]; + } + interface DiagramShapeDefaultsFill { color?: string; opacity?: number; + gradient?: DiagramShapeDefaultsFillGradient; } interface DiagramShapeDefaultsHoverFill { @@ -9683,7 +10738,7 @@ declare module kendo.dataviz.ui { color?: string; fontFamily?: string; fontSize?: number; - template?: any; + template?: string|Function; text?: string; } @@ -9697,9 +10752,25 @@ declare module kendo.dataviz.ui { tools?: DiagramShapeEditableTool[]; } + interface DiagramShapeFillGradientStop { + offset?: number; + color?: string; + opacity?: number; + } + + interface DiagramShapeFillGradient { + type?: string; + center?: any; + radius?: number; + start?: any; + end?: any; + stops?: DiagramShapeFillGradientStop[]; + } + interface DiagramShapeFill { color?: string; opacity?: number; + gradient?: DiagramShapeFillGradient; } interface DiagramShapeHoverFill { @@ -9760,8 +10831,8 @@ declare module kendo.dataviz.ui { autoBind?: boolean; connectionDefaults?: DiagramConnectionDefaults; connections?: DiagramConnection[]; - connectionsDataSource?: any; - dataSource?: any; + connectionsDataSource?: any|any|kendo.data.DataSource; + dataSource?: any|any|kendo.data.DataSource; editable?: DiagramEditable; layout?: DiagramLayout; pannable?: DiagramPannable; @@ -9769,7 +10840,7 @@ declare module kendo.dataviz.ui { selectable?: DiagramSelectable; shapeDefaults?: DiagramShapeDefaults; shapes?: DiagramShape[]; - template?: any; + template?: string|Function; zoom?: number; zoomMax?: number; zoomMin?: number; @@ -9779,6 +10850,9 @@ declare module kendo.dataviz.ui { change?(e: DiagramChangeEvent): void; click?(e: DiagramClickEvent): void; dataBound?(e: DiagramDataBoundEvent): void; + drag?(e: DiagramDragEvent): void; + dragEnd?(e: DiagramDragEndEvent): void; + dragStart?(e: DiagramDragStartEvent): void; edit?(e: DiagramEditEvent): void; itemBoundsChange?(e: DiagramItemBoundsChangeEvent): void; itemRotate?(e: DiagramItemRotateEvent): void; @@ -9793,8 +10867,8 @@ declare module kendo.dataviz.ui { } interface DiagramEvent { sender: Diagram; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } interface DiagramAddEvent extends DiagramEvent { @@ -9815,12 +10889,28 @@ declare module kendo.dataviz.ui { interface DiagramClickEvent extends DiagramEvent { item?: any; + meta?: any; point?: kendo.dataviz.diagram.Point; } interface DiagramDataBoundEvent extends DiagramEvent { } + interface DiagramDragEvent extends DiagramEvent { + connections?: any; + shapes?: any; + } + + interface DiagramDragEndEvent extends DiagramEvent { + connections?: any; + shapes?: any; + } + + interface DiagramDragStartEvent extends DiagramEvent { + connections?: any; + shapes?: any; + } + interface DiagramEditEvent extends DiagramEvent { container?: JQuery; connection?: kendo.data.Model; @@ -9829,11 +10919,11 @@ declare module kendo.dataviz.ui { interface DiagramItemBoundsChangeEvent extends DiagramEvent { bounds?: kendo.dataviz.diagram.Rect; - item?: any; + item?: kendo.dataviz.diagram.Shape; } interface DiagramItemRotateEvent extends DiagramEvent { - item?: any; + item?: kendo.dataviz.diagram.Shape; } interface DiagramMouseEnterEvent extends DiagramEvent { @@ -9845,6 +10935,7 @@ declare module kendo.dataviz.ui { } interface DiagramPanEvent extends DiagramEvent { + pan?: kendo.dataviz.diagram.Point; } interface DiagramRemoveEvent extends DiagramEvent { @@ -9875,13 +10966,20 @@ declare module kendo.dataviz.ui { class LinearGauge extends kendo.ui.Widget { + static fn: LinearGauge; - static extend(proto: Object): LinearGauge; + + options: LinearGaugeOptions; + element: JQuery; wrapper: JQuery; + + static extend(proto: Object): LinearGauge; + constructor(element: Element, options?: LinearGaugeOptions); - options: LinearGaugeOptions; + + allValues(values: any): any; destroy(): void; exportImage(options: any): JQueryPromise; @@ -9892,6 +10990,7 @@ declare module kendo.dataviz.ui { svg(): void; imageDataURL(): string; value(): void; + } interface LinearGaugeGaugeAreaBorder { @@ -9900,11 +10999,18 @@ declare module kendo.dataviz.ui { width?: number; } + interface LinearGaugeGaugeAreaMargin { + top?: number; + bottom?: number; + left?: number; + right?: number; + } + interface LinearGaugeGaugeArea { background?: any; border?: LinearGaugeGaugeAreaBorder; height?: number; - margin?: any; + margin?: LinearGaugeGaugeAreaMargin; width?: number; } @@ -9931,7 +11037,7 @@ declare module kendo.dataviz.ui { interface LinearGaugePointerItem { border?: LinearGaugePointerItemBorder; color?: string; - margin?: any; + margin?: number|any; opacity?: number; shape?: string; size?: number; @@ -9945,15 +11051,29 @@ declare module kendo.dataviz.ui { width?: number; } + interface LinearGaugeScaleLabelsMargin { + top?: number; + bottom?: number; + left?: number; + right?: number; + } + + interface LinearGaugeScaleLabelsPadding { + top?: number; + bottom?: number; + left?: number; + right?: number; + } + interface LinearGaugeScaleLabels { background?: string; border?: LinearGaugeScaleLabelsBorder; color?: string; font?: string; format?: string; - margin?: any; - padding?: any; - template?: any; + margin?: LinearGaugeScaleLabelsMargin; + padding?: LinearGaugeScaleLabelsPadding; + template?: string|Function; visible?: boolean; } @@ -10021,19 +11141,27 @@ declare module kendo.dataviz.ui { } interface LinearGaugeEvent { sender: LinearGauge; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } class Map extends kendo.ui.Widget { + static fn: Map; - static extend(proto: Object): Map; + + options: MapOptions; + + layers: any; element: JQuery; wrapper: JQuery; + + static extend(proto: Object): Map; + constructor(element: Element, options?: MapOptions); - options: MapOptions; + + center(): kendo.dataviz.map.Location; center(center: any): void; center(center: kendo.dataviz.map.Location): void; @@ -10061,7 +11189,7 @@ declare module kendo.dataviz.ui { viewToLocation(point: kendo.geometry.Point, zoom: number): kendo.dataviz.map.Location; zoom(): number; zoom(level: number): void; - layers: any; + } interface MapControlsAttribution { @@ -10087,6 +11215,7 @@ declare module kendo.dataviz.ui { opacity?: number; key?: string; imagerySet?: string; + culture?: string; } interface MapLayerDefaultsBubbleStyleFill { @@ -10112,7 +11241,7 @@ declare module kendo.dataviz.ui { maxSize?: number; minSize?: number; style?: MapLayerDefaultsBubbleStyle; - symbol?: any; + symbol?: string|Function; } interface MapLayerDefaultsMarkerTooltipAnimationClose { @@ -10188,6 +11317,7 @@ declare module kendo.dataviz.ui { marker?: MapLayerDefaultsMarker; shape?: MapLayerDefaultsShape; bubble?: MapLayerDefaultsBubble; + tileSize?: number; tile?: MapLayerDefaultsTile; bing?: MapLayerDefaultsBing; } @@ -10245,19 +11375,21 @@ declare module kendo.dataviz.ui { interface MapLayer { attribution?: string; autoBind?: boolean; - dataSource?: any; - extent?: any; + dataSource?: any|any|kendo.data.DataSource; + extent?: any|kendo.dataviz.map.Extent; key?: string; imagerySet?: string; + culture?: string; locationField?: string; shape?: string; + tileSize?: number; titleField?: string; tooltip?: MapLayerTooltip; maxSize?: number; minSize?: number; opacity?: number; subdomains?: any; - symbol?: any; + symbol?: string|Function; type?: string; style?: MapLayerStyle; urlTemplate?: string; @@ -10337,7 +11469,7 @@ declare module kendo.dataviz.ui { } interface MapMarker { - location?: any; + location?: any|kendo.dataviz.map.Location; shape?: string; title?: string; tooltip?: MapMarkerTooltip; @@ -10345,7 +11477,7 @@ declare module kendo.dataviz.ui { interface MapOptions { name?: string; - center?: any; + center?: any|kendo.dataviz.map.Location; controls?: MapControls; layerDefaults?: MapLayerDefaults; layers?: MapLayer[]; @@ -10375,8 +11507,8 @@ declare module kendo.dataviz.ui { } interface MapEvent { sender: Map; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } interface MapBeforeResetEvent extends MapEvent { @@ -10451,13 +11583,20 @@ declare module kendo.dataviz.ui { class QRCode extends kendo.ui.Widget { + static fn: QRCode; - static extend(proto: Object): QRCode; + + options: QRCodeOptions; + element: JQuery; wrapper: JQuery; + + static extend(proto: Object): QRCode; + constructor(element: Element, options?: QRCodeOptions); - options: QRCodeOptions; + + destroy(): void; exportImage(options: any): JQueryPromise; exportPDF(options?: kendo.drawing.PDFOptions): JQueryPromise; @@ -10469,6 +11608,7 @@ declare module kendo.dataviz.ui { svg(): string; value(options: string): void; value(options: number): void; + } interface QRCodeBorder { @@ -10494,24 +11634,31 @@ declare module kendo.dataviz.ui { errorCorrection?: string; padding?: number; renderAs?: string; - size?: any; - value?: any; + size?: number|string; + value?: number|string; } interface QRCodeEvent { sender: QRCode; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } class RadialGauge extends kendo.ui.Widget { + static fn: RadialGauge; - static extend(proto: Object): RadialGauge; + + options: RadialGaugeOptions; + element: JQuery; wrapper: JQuery; + + static extend(proto: Object): RadialGauge; + constructor(element: Element, options?: RadialGaugeOptions); - options: RadialGaugeOptions; + + allValues(values: any): any; destroy(): void; exportImage(options: any): JQueryPromise; @@ -10522,19 +11669,28 @@ declare module kendo.dataviz.ui { svg(): void; imageDataURL(): string; value(): void; + } interface RadialGaugeGaugeAreaBorder { color?: string; dashType?: string; + opacity?: number; width?: number; } + interface RadialGaugeGaugeAreaMargin { + top?: number; + bottom?: number; + left?: number; + right?: number; + } + interface RadialGaugeGaugeArea { background?: any; border?: RadialGaugeGaugeAreaBorder; height?: number; - margin?: any; + margin?: RadialGaugeGaugeAreaMargin; width?: number; } @@ -10552,19 +11708,34 @@ declare module kendo.dataviz.ui { interface RadialGaugeScaleLabelsBorder { color?: string; dashType?: string; + opacity?: number; width?: number; } + interface RadialGaugeScaleLabelsMargin { + top?: number; + bottom?: number; + left?: number; + right?: number; + } + + interface RadialGaugeScaleLabelsPadding { + top?: number; + bottom?: number; + left?: number; + right?: number; + } + interface RadialGaugeScaleLabels { background?: string; border?: RadialGaugeScaleLabelsBorder; color?: string; font?: string; format?: string; - margin?: any; - padding?: any; + margin?: RadialGaugeScaleLabelsMargin; + padding?: RadialGaugeScaleLabelsPadding; position?: string; - template?: any; + template?: string|Function; visible?: boolean; } @@ -10625,20 +11796,27 @@ declare module kendo.dataviz.ui { } interface RadialGaugeEvent { sender: RadialGauge; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } class Sparkline extends kendo.ui.Widget { + static fn: Sparkline; - static extend(proto: Object): Sparkline; + + options: SparklineOptions; + + dataSource: kendo.data.DataSource; element: JQuery; wrapper: JQuery; + + static extend(proto: Object): Sparkline; + constructor(element: Element, options?: SparklineOptions); - options: SparklineOptions; - dataSource: kendo.data.DataSource; + + destroy(): void; exportImage(options: any): JQueryPromise; exportPDF(options?: kendo.drawing.PDFOptions): JQueryPromise; @@ -10648,6 +11826,7 @@ declare module kendo.dataviz.ui { setOptions(options: any): void; svg(): string; imageDataURL(): string; + } interface SparklineCategoryAxisItemCrosshairTooltipBorder { @@ -10661,8 +11840,8 @@ declare module kendo.dataviz.ui { color?: string; font?: string; format?: string; - padding?: any; - template?: any; + padding?: number|any; + template?: string|Function; visible?: boolean; } @@ -10687,13 +11866,13 @@ declare module kendo.dataviz.ui { color?: string; font?: string; format?: string; - margin?: any; + margin?: number|any; mirror?: boolean; - padding?: any; + padding?: number|any; rotation?: number; skip?: number; step?: number; - template?: any; + template?: string|Function; visible?: boolean; culture?: string; dateFormats?: any; @@ -10766,7 +11945,7 @@ declare module kendo.dataviz.ui { border?: SparklineCategoryAxisItemNotesDataItemLabelBorder; color?: string; font?: string; - template?: any; + template?: string|Function; visible?: boolean; rotation?: number; format?: string; @@ -10812,7 +11991,7 @@ declare module kendo.dataviz.ui { border?: SparklineCategoryAxisItemNotesLabelBorder; color?: string; font?: string; - template?: any; + template?: string|Function; visible?: boolean; rotation?: number; format?: string; @@ -10851,7 +12030,7 @@ declare module kendo.dataviz.ui { border?: SparklineCategoryAxisItemTitleBorder; color?: string; font?: string; - margin?: any; + margin?: number|any; position?: string; rotation?: number; text?: string; @@ -10859,7 +12038,7 @@ declare module kendo.dataviz.ui { } interface SparklineCategoryAxisItem { - axisCrossingValue?: any; + axisCrossingValue?: any|Date|any; categories?: any; color?: string; field?: string; @@ -10899,7 +12078,7 @@ declare module kendo.dataviz.ui { opacity?: number; border?: SparklineChartAreaBorder; height?: number; - margin?: any; + margin?: number|any; width?: number; } @@ -10913,14 +12092,14 @@ declare module kendo.dataviz.ui { background?: string; opacity?: number; border?: SparklinePlotAreaBorder; - margin?: any; + margin?: number|any; } interface SparklineSeriesItemBorder { - color?: any; - dashType?: any; - opacity?: any; - width?: any; + color?: string|Function; + dashType?: string|Function; + opacity?: number|Function; + width?: number|Function; } interface SparklineSeriesItemConnectors { @@ -10943,24 +12122,24 @@ declare module kendo.dataviz.ui { } interface SparklineSeriesItemLabelsBorder { - color?: any; - dashType?: any; - width?: any; + color?: string|Function; + dashType?: string|Function; + width?: number|Function; } interface SparklineSeriesItemLabels { align?: string; - background?: any; + background?: string|Function; border?: SparklineSeriesItemLabelsBorder; - color?: any; + color?: string|Function; distance?: number; - font?: any; - format?: any; - margin?: any; - padding?: any; - position?: any; - template?: any; - visible?: any; + font?: string|Function; + format?: string|Function; + margin?: number|any; + padding?: number|any; + position?: string|Function; + template?: string|Function; + visible?: boolean|Function; } interface SparklineSeriesItemLine { @@ -10971,17 +12150,17 @@ declare module kendo.dataviz.ui { } interface SparklineSeriesItemMarkersBorder { - color?: any; - width?: any; + color?: string|Function; + width?: number|Function; } interface SparklineSeriesItemMarkers { - background?: any; + background?: string|Function; border?: SparklineSeriesItemMarkersBorder; - size?: any; - type?: any; - visible?: any; - rotation?: any; + size?: number|Function; + type?: string|Function; + visible?: boolean|Function; + rotation?: number|Function; } interface SparklineSeriesItemNotesIconBorder { @@ -11008,7 +12187,7 @@ declare module kendo.dataviz.ui { border?: SparklineSeriesItemNotesLabelBorder; color?: string; font?: string; - template?: any; + template?: string|Function; visible?: boolean; rotation?: number; format?: string; @@ -11038,18 +12217,18 @@ declare module kendo.dataviz.ui { } interface SparklineSeriesItemTargetBorder { - color?: any; - dashType?: any; + color?: string|Function; + dashType?: string|Function; width?: number; } interface SparklineSeriesItemTargetLine { - width?: any; + width?: any|Function; } interface SparklineSeriesItemTarget { line?: SparklineSeriesItemTargetLine; - color?: any; + color?: string|Function; border?: SparklineSeriesItemTargetBorder; } @@ -11064,8 +12243,8 @@ declare module kendo.dataviz.ui { color?: string; font?: string; format?: string; - padding?: any; - template?: any; + padding?: number|any; + template?: string|Function; visible?: boolean; } @@ -11079,11 +12258,11 @@ declare module kendo.dataviz.ui { field?: string; name?: string; highlight?: SparklineSeriesItemHighlight; - aggregate?: any; + aggregate?: string|Function; axis?: string; border?: SparklineSeriesItemBorder; categoryField?: string; - color?: any; + color?: string|Function; colorField?: string; connectors?: SparklineSeriesItemConnectors; gap?: number; @@ -11125,9 +12304,9 @@ declare module kendo.dataviz.ui { color?: string; font?: string; format?: string; - margin?: any; - padding?: any; - template?: any; + margin?: number|any; + padding?: number|any; + template?: string|Function; visible?: boolean; } @@ -11146,8 +12325,8 @@ declare module kendo.dataviz.ui { color?: string; font?: string; format?: string; - padding?: any; - template?: any; + padding?: number|any; + template?: string|Function; visible?: boolean; } @@ -11178,8 +12357,8 @@ declare module kendo.dataviz.ui { color?: string; font?: string; format?: string; - padding?: any; - template?: any; + padding?: number|any; + template?: string|Function; visible?: boolean; shared?: boolean; sharedTemplate?: string; @@ -11196,8 +12375,8 @@ declare module kendo.dataviz.ui { color?: string; font?: string; format?: string; - padding?: any; - template?: any; + padding?: number|any; + template?: string|Function; visible?: boolean; } @@ -11222,13 +12401,13 @@ declare module kendo.dataviz.ui { color?: string; font?: string; format?: string; - margin?: any; + margin?: number|any; mirror?: boolean; - padding?: any; + padding?: number|any; rotation?: number; skip?: number; step?: number; - template?: any; + template?: string|Function; visible?: boolean; } @@ -11298,7 +12477,7 @@ declare module kendo.dataviz.ui { border?: SparklineValueAxisItemNotesDataItemLabelBorder; color?: string; font?: string; - template?: any; + template?: string|Function; visible?: boolean; rotation?: number; format?: string; @@ -11344,7 +12523,7 @@ declare module kendo.dataviz.ui { border?: SparklineValueAxisItemNotesLabelBorder; color?: string; font?: string; - template?: any; + template?: string|Function; visible?: boolean; rotation?: number; format?: string; @@ -11383,8 +12562,8 @@ declare module kendo.dataviz.ui { border?: SparklineValueAxisItemTitleBorder; color?: string; font?: string; - margin?: any; - padding?: any; + margin?: number|any; + padding?: number|any; position?: string; rotation?: number; text?: string; @@ -11392,7 +12571,7 @@ declare module kendo.dataviz.ui { } interface SparklineValueAxisItem { - axisCrossingValue?: any; + axisCrossingValue?: any|Date|any; color?: string; labels?: SparklineValueAxisItemLabels; line?: SparklineValueAxisItemLine; @@ -11424,14 +12603,14 @@ declare module kendo.dataviz.ui { } interface SparklineSeriesClickEventSeries { - type?: any; - name?: any; + type?: string; + name?: string; data?: any; } interface SparklineSeriesHoverEventSeries { - type?: any; - name?: any; + type?: string; + name?: string; data?: any; } @@ -11468,8 +12647,8 @@ declare module kendo.dataviz.ui { } interface SparklineEvent { sender: Sparkline; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } interface SparklineAxisLabelClickEvent extends SparklineEvent { @@ -11540,14 +12719,21 @@ declare module kendo.dataviz.ui { class StockChart extends kendo.ui.Widget { + static fn: StockChart; - static extend(proto: Object): StockChart; + + options: StockChartOptions; + + dataSource: kendo.data.DataSource; element: JQuery; wrapper: JQuery; + + static extend(proto: Object): StockChart; + constructor(element: Element, options?: StockChartOptions); - options: StockChartOptions; - dataSource: kendo.data.DataSource; + + destroy(): void; exportImage(options: any): JQueryPromise; exportPDF(options?: kendo.drawing.PDFOptions): JQueryPromise; @@ -11558,6 +12744,7 @@ declare module kendo.dataviz.ui { setDataSource(dataSource: kendo.data.DataSource): void; svg(): string; imageDataURL(): string; + } interface StockChartCategoryAxisItemAutoBaseUnitSteps { @@ -11580,8 +12767,8 @@ declare module kendo.dataviz.ui { color?: string; font?: string; format?: string; - padding?: any; - template?: any; + padding?: number|any; + template?: string|Function; visible?: boolean; } @@ -11606,13 +12793,13 @@ declare module kendo.dataviz.ui { color?: string; font?: string; format?: string; - margin?: any; + margin?: number|any; mirror?: boolean; - padding?: any; + padding?: number|any; rotation?: number; skip?: number; step?: number; - template?: any; + template?: string|Function; visible?: boolean; culture?: string; dateFormats?: any; @@ -11685,7 +12872,7 @@ declare module kendo.dataviz.ui { border?: StockChartCategoryAxisItemNotesDataItemLabelBorder; color?: string; font?: string; - template?: any; + template?: string|Function; visible?: boolean; rotation?: number; format?: string; @@ -11731,7 +12918,7 @@ declare module kendo.dataviz.ui { border?: StockChartCategoryAxisItemNotesLabelBorder; color?: string; font?: string; - template?: any; + template?: string|Function; visible?: boolean; rotation?: number; format?: string; @@ -11783,7 +12970,7 @@ declare module kendo.dataviz.ui { border?: StockChartCategoryAxisItemTitleBorder; color?: string; font?: string; - margin?: any; + margin?: number|any; position?: string; rotation?: number; text?: string; @@ -11791,7 +12978,7 @@ declare module kendo.dataviz.ui { } interface StockChartCategoryAxisItem { - axisCrossingValue?: any; + axisCrossingValue?: any|Date|any; categories?: any; color?: string; field?: string; @@ -11834,7 +13021,7 @@ declare module kendo.dataviz.ui { opacity?: number; border?: StockChartChartAreaBorder; height?: number; - margin?: any; + margin?: number|any; width?: number; } @@ -11859,6 +13046,11 @@ declare module kendo.dataviz.ui { markers?: StockChartLegendInactiveItemsMarkers; } + interface StockChartLegendItem { + cursor?: string; + visual?: Function; + } + interface StockChartLegendLabels { color?: string; font?: string; @@ -11868,11 +13060,12 @@ declare module kendo.dataviz.ui { interface StockChartLegend { background?: string; border?: StockChartLegendBorder; + item?: StockChartLegendItem; labels?: StockChartLegendLabels; - margin?: any; + margin?: number|any; offsetX?: number; offsetY?: number; - padding?: any; + padding?: number|any; position?: string; reverse?: boolean; visible?: boolean; @@ -11909,7 +13102,7 @@ declare module kendo.dataviz.ui { font?: string; format?: string; padding?: StockChartNavigatorCategoryAxisItemCrosshairTooltipPadding; - template?: any; + template?: string|Function; visible?: boolean; } @@ -11963,7 +13156,7 @@ declare module kendo.dataviz.ui { rotation?: number; skip?: number; step?: number; - template?: any; + template?: string|Function; visible?: boolean; } @@ -12034,7 +13227,7 @@ declare module kendo.dataviz.ui { border?: StockChartNavigatorCategoryAxisItemNotesDataItemLabelBorder; color?: string; font?: string; - template?: any; + template?: string|Function; visible?: boolean; rotation?: number; format?: string; @@ -12080,7 +13273,7 @@ declare module kendo.dataviz.ui { border?: StockChartNavigatorCategoryAxisItemNotesLabelBorder; color?: string; font?: string; - template?: any; + template?: string|Function; visible?: boolean; rotation?: number; format?: string; @@ -12143,7 +13336,7 @@ declare module kendo.dataviz.ui { interface StockChartNavigatorCategoryAxisItem { autoBaseUnitSteps?: StockChartNavigatorCategoryAxisItemAutoBaseUnitSteps; - axisCrossingValue?: any; + axisCrossingValue?: any|Date|any; background?: string; baseUnit?: string; baseUnitStep?: any; @@ -12172,7 +13365,7 @@ declare module kendo.dataviz.ui { interface StockChartNavigatorHint { visible?: boolean; - template?: any; + template?: string|Function; format?: string; } @@ -12273,10 +13466,10 @@ declare module kendo.dataviz.ui { color?: string; font?: string; format?: string; - margin?: any; - padding?: any; + margin?: number|any; + padding?: number|any; position?: string; - template?: any; + template?: string|Function; visible?: boolean; } @@ -12294,7 +13487,7 @@ declare module kendo.dataviz.ui { interface StockChartNavigatorSeriesItemMarkers { background?: string; border?: StockChartNavigatorSeriesItemMarkersBorder; - rotation?: any; + rotation?: number|Function; size?: number; type?: string; visible?: boolean; @@ -12320,8 +13513,8 @@ declare module kendo.dataviz.ui { color?: string; font?: string; format?: string; - padding?: any; - template?: any; + padding?: number|any; + template?: string|Function; visible?: boolean; } @@ -12334,7 +13527,7 @@ declare module kendo.dataviz.ui { categoryField?: string; name?: string; highlight?: StockChartNavigatorSeriesItemHighlight; - aggregate?: any; + aggregate?: string|Function; axis?: string; border?: StockChartNavigatorSeriesItemBorder; closeField?: string; @@ -12387,7 +13580,7 @@ declare module kendo.dataviz.ui { border?: StockChartPaneTitleBorder; color?: string; font?: string; - margin?: any; + margin?: number|any; position?: string; text?: string; visible?: boolean; @@ -12395,8 +13588,8 @@ declare module kendo.dataviz.ui { interface StockChartPane { name?: string; - margin?: any; - padding?: any; + margin?: number|any; + padding?: number|any; background?: string; border?: StockChartPaneBorder; clip?: boolean; @@ -12405,10 +13598,10 @@ declare module kendo.dataviz.ui { } interface StockChartPdfMargin { - bottom?: any; - left?: any; - right?: any; - top?: any; + bottom?: number|string; + left?: number|string; + right?: number|string; + top?: number|string; } interface StockChartPdf { @@ -12420,7 +13613,7 @@ declare module kendo.dataviz.ui { keywords?: string; landscape?: boolean; margin?: StockChartPdfMargin; - paperSize?: any; + paperSize?: string|any; proxyURL?: string; proxyTarget?: string; subject?: string; @@ -12437,14 +13630,14 @@ declare module kendo.dataviz.ui { background?: string; opacity?: number; border?: StockChartPlotAreaBorder; - margin?: any; + margin?: number|any; } interface StockChartSeriesItemBorder { - color?: any; - dashType?: any; - opacity?: any; - width?: any; + color?: string|Function; + dashType?: string|Function; + opacity?: number|Function; + width?: number|Function; } interface StockChartSeriesItemHighlightBorder { @@ -12468,22 +13661,22 @@ declare module kendo.dataviz.ui { } interface StockChartSeriesItemLabelsBorder { - color?: any; - dashType?: any; - width?: any; + color?: string|Function; + dashType?: string|Function; + width?: number|Function; } interface StockChartSeriesItemLabels { - background?: any; + background?: string|Function; border?: StockChartSeriesItemLabelsBorder; - color?: any; - font?: any; - format?: any; - margin?: any; - padding?: any; - position?: any; - template?: any; - visible?: any; + color?: string|Function; + font?: string|Function; + format?: string|Function; + margin?: number|any; + padding?: number|any; + position?: string|Function; + template?: string|Function; + visible?: boolean|Function; } interface StockChartSeriesItemLine { @@ -12494,17 +13687,17 @@ declare module kendo.dataviz.ui { } interface StockChartSeriesItemMarkersBorder { - color?: any; - width?: any; + color?: string|Function; + width?: number|Function; } interface StockChartSeriesItemMarkers { - background?: any; + background?: string|Function; border?: StockChartSeriesItemMarkersBorder; - size?: any; - rotation?: any; - type?: any; - visible?: any; + size?: number|Function; + rotation?: number|Function; + type?: string|Function; + visible?: boolean|Function; } interface StockChartSeriesItemNotesIconBorder { @@ -12531,7 +13724,7 @@ declare module kendo.dataviz.ui { border?: StockChartSeriesItemNotesLabelBorder; color?: string; font?: string; - template?: any; + template?: string|Function; visible?: boolean; rotation?: number; format?: string; @@ -12561,18 +13754,18 @@ declare module kendo.dataviz.ui { } interface StockChartSeriesItemTargetBorder { - color?: any; - dashType?: any; - width?: any; + color?: string|Function; + dashType?: string|Function; + width?: number|Function; } interface StockChartSeriesItemTargetLine { - width?: any; + width?: any|Function; } interface StockChartSeriesItemTarget { line?: StockChartSeriesItemTargetLine; - color?: any; + color?: string|Function; border?: StockChartSeriesItemTargetBorder; } @@ -12587,8 +13780,8 @@ declare module kendo.dataviz.ui { color?: string; font?: string; format?: string; - padding?: any; - template?: any; + padding?: number|any; + template?: string|Function; visible?: boolean; } @@ -12603,13 +13796,13 @@ declare module kendo.dataviz.ui { targetField?: string; name?: string; highlight?: StockChartSeriesItemHighlight; - aggregate?: any; + aggregate?: string|Function; axis?: string; border?: StockChartSeriesItemBorder; closeField?: string; - color?: any; + color?: string|Function; colorField?: string; - downColor?: any; + downColor?: string|Function; downColorField?: string; gap?: number; labels?: StockChartSeriesItemLabels; @@ -12650,9 +13843,9 @@ declare module kendo.dataviz.ui { color?: string; font?: string; format?: string; - margin?: any; - padding?: any; - template?: any; + margin?: number|any; + padding?: number|any; + template?: string|Function; visible?: boolean; } @@ -12671,8 +13864,8 @@ declare module kendo.dataviz.ui { color?: string; font?: string; format?: string; - padding?: any; - template?: any; + padding?: number|any; + template?: string|Function; visible?: boolean; } @@ -12705,8 +13898,8 @@ declare module kendo.dataviz.ui { border?: StockChartTitleBorder; font?: string; color?: string; - margin?: any; - padding?: any; + margin?: number|any; + padding?: number|any; position?: string; text?: string; visible?: boolean; @@ -12723,8 +13916,8 @@ declare module kendo.dataviz.ui { color?: string; font?: string; format?: string; - padding?: any; - template?: any; + padding?: number|any; + template?: string|Function; visible?: boolean; shared?: boolean; sharedTemplate?: string; @@ -12741,8 +13934,8 @@ declare module kendo.dataviz.ui { color?: string; font?: string; format?: string; - padding?: any; - template?: any; + padding?: number|any; + template?: string|Function; visible?: boolean; } @@ -12767,13 +13960,13 @@ declare module kendo.dataviz.ui { color?: string; font?: string; format?: string; - margin?: any; + margin?: number|any; mirror?: boolean; - padding?: any; + padding?: number|any; rotation?: number; skip?: number; step?: number; - template?: any; + template?: string|Function; visible?: boolean; } @@ -12843,7 +14036,7 @@ declare module kendo.dataviz.ui { border?: StockChartValueAxisItemNotesDataItemLabelBorder; color?: string; font?: string; - template?: any; + template?: string|Function; visible?: boolean; rotation?: number; format?: string; @@ -12889,7 +14082,7 @@ declare module kendo.dataviz.ui { border?: StockChartValueAxisItemNotesLabelBorder; color?: string; font?: string; - template?: any; + template?: string|Function; visible?: boolean; rotation?: number; format?: string; @@ -12928,8 +14121,8 @@ declare module kendo.dataviz.ui { border?: StockChartValueAxisItemTitleBorder; color?: string; font?: string; - margin?: any; - padding?: any; + margin?: number|any; + padding?: number|any; position?: string; rotation?: number; text?: string; @@ -12937,7 +14130,7 @@ declare module kendo.dataviz.ui { } interface StockChartValueAxisItem { - axisCrossingValue?: any; + axisCrossingValue?: any|Date|any; background?: string; color?: string; labels?: StockChartValueAxisItemLabels; @@ -12971,14 +14164,14 @@ declare module kendo.dataviz.ui { } interface StockChartSeriesClickEventSeries { - type?: any; - name?: any; + type?: string; + name?: string; data?: any; } interface StockChartSeriesHoverEventSeries { - type?: any; - name?: any; + type?: string; + name?: string; data?: any; } @@ -13026,8 +14219,8 @@ declare module kendo.dataviz.ui { } interface StockChartEvent { sender: StockChart; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } interface StockChartAxisLabelClickEvent extends StockChartEvent { @@ -13148,38 +14341,46 @@ declare module kendo.dataviz.ui { class TreeMap extends kendo.ui.Widget { + static fn: TreeMap; - static extend(proto: Object): TreeMap; + + options: TreeMapOptions; + + dataSource: kendo.data.DataSource; element: JQuery; wrapper: JQuery; + + static extend(proto: Object): TreeMap; + constructor(element: Element, options?: TreeMapOptions); - options: TreeMapOptions; - dataSource: kendo.data.DataSource; + + + } interface TreeMapOptions { name?: string; - dataSource?: any; + dataSource?: any|any|kendo.data.HierarchicalDataSource; autoBind?: boolean; type?: string; theme?: string; valueField?: string; colorField?: string; textField?: string; - template?: any; + template?: string|Function; colors?: any; itemCreated?(e: TreeMapItemCreatedEvent): void; dataBound?(e: TreeMapDataBoundEvent): void; } interface TreeMapEvent { sender: TreeMap; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } interface TreeMapItemCreatedEvent extends TreeMapEvent { - element?: any; + element?: JQuery|Element; } interface TreeMapDataBoundEvent extends TreeMapEvent { @@ -13189,7 +14390,13 @@ declare module kendo.dataviz.ui { } declare module kendo.dataviz { class ChartAxis extends Observable { + + options: ChartAxisOptions; + + + + range(): any; slot(from: string, to?: string): kendo.geometry.Rect; slot(from: string, to?: number): kendo.geometry.Rect; @@ -13200,6 +14407,7 @@ declare module kendo.dataviz { slot(from: Date, to?: string): kendo.geometry.Rect; slot(from: Date, to?: number): kendo.geometry.Rect; slot(from: Date, to?: Date): kendo.geometry.Rect; + } interface ChartAxisOptions { @@ -13207,23 +14415,49 @@ declare module kendo.dataviz { } interface ChartAxisEvent { sender: ChartAxis; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } } declare module kendo.dataviz.diagram { class Circle extends Observable { - constructor(options?: CircleOptions); + + options: CircleOptions; + + + constructor(options?: CircleOptions); + + + position(): void; + position(offset: kendo.dataviz.diagram.Point): void; + rotate(angle: number, center: kendo.dataviz.diagram.Point): void; visible(): boolean; visible(visible: boolean): void; + + } + + interface CircleFillGradientStop { + offset?: number; + color?: string; + opacity?: number; + } + + interface CircleFillGradient { + type?: string; + center?: any; + radius?: number; + start?: any; + end?: any; + stops?: CircleFillGradientStop[]; } interface CircleFill { color?: string; opacity?: number; + gradient?: CircleFillGradient; } interface CircleStroke { @@ -13240,14 +14474,20 @@ declare module kendo.dataviz.diagram { } interface CircleEvent { sender: Circle; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } class Connection extends Observable { - constructor(options?: ConnectionOptions); + + options: ConnectionOptions; + + + constructor(options?: ConnectionOptions); + + source(): any; source(source: kendo.dataviz.diagram.Shape): void; source(source: kendo.dataviz.diagram.Point): void; @@ -13264,6 +14504,13 @@ declare module kendo.dataviz.diagram { points(): any; allPoints(): any; redraw(): void; + + } + + interface ConnectionContent { + template?: string|Function; + text?: string; + visual?: Function; } interface ConnectionEndCapFill { @@ -13317,24 +14564,35 @@ declare module kendo.dataviz.diagram { interface ConnectionOptions { name?: string; + content?: ConnectionContent; + fromConnector?: string; stroke?: ConnectionStroke; hover?: ConnectionHover; startCap?: ConnectionStartCap; endCap?: ConnectionEndCap; points?: ConnectionPoint[]; selectable?: boolean; + toConnector?: string; + type?: string; } interface ConnectionEvent { sender: Connection; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } class Connector extends Observable { - constructor(options?: ConnectorOptions); + + options: ConnectorOptions; + + + constructor(options?: ConnectorOptions); + + position(): kendo.dataviz.diagram.Point; + } interface ConnectorFill { @@ -13350,19 +14608,29 @@ declare module kendo.dataviz.diagram { } interface ConnectorEvent { sender: Connector; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } class Group extends Observable { - constructor(options?: GroupOptions); + + options: GroupOptions; + + + constructor(options?: GroupOptions); + + append(element: any): void; clear(): void; remove(element: any): void; + position(): void; + position(offset: kendo.dataviz.diagram.Point): void; + rotate(angle: number, center: kendo.dataviz.diagram.Point): void; visible(): boolean; visible(visible: boolean): void; + } interface GroupOptions { @@ -13372,16 +14640,26 @@ declare module kendo.dataviz.diagram { } interface GroupEvent { sender: Group; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } class Image extends Observable { - constructor(options?: ImageOptions); + + options: ImageOptions; + + + constructor(options?: ImageOptions); + + + position(): void; + position(offset: kendo.dataviz.diagram.Point): void; + rotate(angle: number, center: kendo.dataviz.diagram.Point): void; visible(): boolean; visible(visible: boolean): void; + } interface ImageOptions { @@ -13394,16 +14672,63 @@ declare module kendo.dataviz.diagram { } interface ImageEvent { sender: Image; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; + } + + + class Layout extends Observable { + + + options: LayoutOptions; + + + constructor(rect: kendo.dataviz.diagram.Rect, options?: LayoutOptions); + + + append(element: any): void; + clear(): void; + rect(): kendo.dataviz.diagram.Rect; + rect(rect: kendo.dataviz.diagram.Rect): void; + reflow(): void; + remove(element: any): void; + visible(): boolean; + visible(visible: boolean): void; + + } + + interface LayoutOptions { + name?: string; + alignContent?: string; + alignItems?: string; + justifyContent?: string; + lineSpacing?: number; + spacing?: number; + orientation?: string; + wrap?: boolean; + } + interface LayoutEvent { + sender: Layout; + preventDefault: Function; + isDefaultPrevented(): boolean; } class Line extends Observable { - constructor(options?: LineOptions); + + options: LineOptions; + + + constructor(options?: LineOptions); + + + position(): void; + position(offset: kendo.dataviz.diagram.Point): void; + rotate(angle: number, center: kendo.dataviz.diagram.Point): void; visible(): boolean; visible(visible: boolean): void; + } interface LineStroke { @@ -13419,14 +14744,21 @@ declare module kendo.dataviz.diagram { } interface LineEvent { sender: Line; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } class Point extends Observable { - constructor(options?: PointOptions); + + options: PointOptions; + + + constructor(options?: PointOptions); + + + } interface PointOptions { @@ -13436,14 +14768,26 @@ declare module kendo.dataviz.diagram { } interface PointEvent { sender: Point; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } class Rect extends Observable { - constructor(options?: RectOptions); + + options: RectOptions; + + + constructor(options?: RectOptions); + + + position(): void; + position(offset: kendo.dataviz.diagram.Point): void; + rotate(angle: number, center: kendo.dataviz.diagram.Point): void; + visible(): boolean; + visible(visible: boolean): void; + } interface RectOptions { @@ -13455,21 +14799,44 @@ declare module kendo.dataviz.diagram { } interface RectEvent { sender: Rect; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } class Rectangle extends Observable { - constructor(options?: RectangleOptions); + + options: RectangleOptions; + + + constructor(options?: RectangleOptions); + + visible(): boolean; visible(visible: boolean): void; + + } + + interface RectangleFillGradientStop { + offset?: number; + color?: string; + opacity?: number; + } + + interface RectangleFillGradient { + type?: string; + center?: any; + radius?: number; + start?: any; + end?: any; + stops?: RectangleFillGradientStop[]; } interface RectangleFill { color?: string; opacity?: number; + gradient?: RectangleFillGradient; } interface RectangleStroke { @@ -13488,14 +14855,20 @@ declare module kendo.dataviz.diagram { } interface RectangleEvent { sender: Rectangle; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } class Shape extends Observable { - constructor(options?: ShapeOptions); + + options: ShapeOptions; + + + constructor(options?: ShapeOptions); + + position(): void; position(point: kendo.dataviz.diagram.Point): void; clone(): kendo.dataviz.diagram.Shape; @@ -13504,6 +14877,7 @@ declare module kendo.dataviz.diagram { getConnector(): void; getPosition(side: string): void; redraw(): void; + } interface ShapeConnector { @@ -13521,9 +14895,25 @@ declare module kendo.dataviz.diagram { connect?: boolean; } + interface ShapeFillGradientStop { + offset?: number; + color?: string; + opacity?: number; + } + + interface ShapeFillGradient { + type?: string; + center?: any; + radius?: number; + start?: any; + end?: any; + stops?: ShapeFillGradientStop[]; + } + interface ShapeFill { color?: string; opacity?: number; + gradient?: ShapeFillGradient; } interface ShapeHoverFill { @@ -13568,18 +14958,28 @@ declare module kendo.dataviz.diagram { } interface ShapeEvent { sender: Shape; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } class TextBlock extends Observable { - constructor(options?: TextBlockOptions); + + options: TextBlockOptions; + + + constructor(options?: TextBlockOptions); + + content(): string; content(content: string): void; + position(): void; + position(offset: kendo.dataviz.diagram.Point): void; + rotate(angle: number, center: kendo.dataviz.diagram.Point): void; visible(): boolean; visible(visible: boolean): void; + } interface TextBlockOptions { @@ -13595,17 +14995,31 @@ declare module kendo.dataviz.diagram { } interface TextBlockEvent { sender: TextBlock; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } } declare module kendo { class Color extends Observable { + + options: ColorOptions; + + + + diff(): number; equals(): boolean; + toHSV(): any; + toRGB(): any; + toBytes(): any; + toHex(): string; + toCss(): string; + toCssRgba(): string; + toDisplay(): string; + } interface ColorOptions { @@ -13613,14 +15027,14 @@ declare module kendo { } interface ColorEvent { sender: Color; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } module drawing { function align(elements: any, rect: kendo.geometry.Rect, alignment: string): void; - function drawDOM(element: JQuery): JQueryPromise; + function drawDOM(element: JQuery, options: any): JQueryPromise; function exportImage(group: kendo.drawing.Group, options: any): JQueryPromise; function exportPDF(group: kendo.drawing.Group, options: kendo.drawing.PDFOptions): JQueryPromise; function exportSVG(group: kendo.drawing.Group, options: any): JQueryPromise; @@ -13639,6 +15053,7 @@ declare module kendo { function transformOrigin(firstElement: HTMLElement, secondElement: HTMLElement): any; } + function antiForgeryTokens(): any; function bind(element: string, viewModel: any, namespace?: any): void; function bind(element: string, viewModel: kendo.data.ObservableObject, namespace?: any): void; function bind(element: JQuery, viewModel: any, namespace?: any): void; @@ -13671,11 +15086,218 @@ declare module kendo { function unbind(element: JQuery): void; function unbind(element: Element): void; +} +declare module kendo.spreadsheet { + class CustomFilter extends Observable { + + + options: CustomFilterOptions; + + + + + init(options: any): void; + + } + + interface CustomFilterOptions { + name?: string; + } + interface CustomFilterEvent { + sender: CustomFilter; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + + class DynamicFilter extends Observable { + + + options: DynamicFilterOptions; + + + + + init(options: any): void; + + } + + interface DynamicFilterOptions { + name?: string; + } + interface DynamicFilterEvent { + sender: DynamicFilter; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + + class Range extends Observable { + + + options: RangeOptions; + + + + + borderBottom(): any; + borderBottom(value?: any): void; + borderLeft(): any; + borderLeft(value?: any): void; + borderRight(): any; + borderRight(value?: any): void; + borderTop(): any; + borderTop(value?: any): void; + clear(options?: any): void; + clearFilter(indices: any): void; + clearFilter(indices: number): void; + filter(filter: boolean): void; + filter(filter: any): void; + format(): string; + format(format?: string): void; + formula(): string; + formula(formula?: string): void; + hasFilter(): boolean; + input(): any; + input(value?: string): void; + input(value?: number): void; + input(value?: Date): void; + isSortable(): boolean; + isFilterable(): boolean; + merge(): void; + select(): void; + sort(sort: number): void; + sort(sort: any): void; + unmerge(): void; + values(values: any): void; + validation(): any; + validation(value?: any): void; + value(): any; + value(value?: string): void; + value(value?: number): void; + value(value?: Date): void; + wrap(): boolean; + wrap(value?: boolean): void; + + } + + interface RangeOptions { + name?: string; + } + interface RangeEvent { + sender: Range; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + + class Sheet extends Observable { + + + options: SheetOptions; + + + + + clearFilter(indexes: number): void; + clearFilter(indexes: any): void; + columnWidth(): void; + columnWidth(index: number, width?: number): void; + deleteColumn(index: number): void; + fromJSON(data: any): void; + frozenColumns(): number; + frozenColumns(count?: number): void; + frozenRows(): number; + frozenRows(count?: number): void; + hideColumn(index: number): void; + hideRow(index: number): void; + insertColumn(index: number): void; + insertRow(index: number): void; + range(ref: string): kendo.spreadsheet.Range; + rowHeight(): void; + rowHeight(index: number, width?: number): void; + selection(): kendo.spreadsheet.Range; + toJSON(): void; + unhideColumn(index: number): void; + unhideRow(index: number): void; + + } + + interface SheetOptions { + name?: string; + change?(e: SheetChangeEvent): void; + } + interface SheetEvent { + sender: Sheet; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface SheetChangeEvent extends SheetEvent { + } + + + class TopFilter extends Observable { + + + options: TopFilterOptions; + + + + + init(options: any): void; + + } + + interface TopFilterOptions { + name?: string; + } + interface TopFilterEvent { + sender: TopFilter; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + + class ValueFilter extends Observable { + + + options: ValueFilterOptions; + + + + + init(options: any): void; + + } + + interface ValueFilterOptions { + name?: string; + } + interface ValueFilterEvent { + sender: ValueFilter; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + } declare module kendo.dataviz.map { class Extent extends kendo.Class { - constructor(nw: kendo.dataviz.map.Location, se: kendo.dataviz.map.Location); + + options: ExtentOptions; + + nw: kendo.dataviz.map.Location; + se: kendo.dataviz.map.Location; + + constructor(nw: kendo.dataviz.map.Location, se: kendo.dataviz.map.Location); + + 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; + static create(a: any, b?: kendo.dataviz.map.Location): kendo.dataviz.map.Extent; + static create(a: any, b?: any): kendo.dataviz.map.Extent; + contains(location: kendo.dataviz.map.Location): boolean; containsAny(locations: any): boolean; center(): kendo.dataviz.map.Location; @@ -13684,12 +15306,7 @@ declare module kendo.dataviz.map { edges(): any; toArray(): any; overlaps(extent: kendo.dataviz.map.Extent): boolean; - 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; - static create(a: any, b?: kendo.dataviz.map.Location): kendo.dataviz.map.Extent; - static create(a: any, b?: any): kendo.dataviz.map.Extent; - nw: kendo.dataviz.map.Location; - se: kendo.dataviz.map.Location; + } interface ExtentOptions { @@ -13697,17 +15314,24 @@ declare module kendo.dataviz.map { } interface ExtentEvent { sender: Extent; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } class Layer extends kendo.Class { - constructor(map: kendo.dataviz.ui.Map, options?: LayerOptions); + + options: LayerOptions; + + map: kendo.dataviz.ui.Map; + + constructor(map: kendo.dataviz.ui.Map, options?: LayerOptions); + + show(): void; hide(): void; - map: kendo.dataviz.ui.Map; + } interface LayerOptions { @@ -13715,14 +15339,27 @@ declare module kendo.dataviz.map { } interface LayerEvent { sender: Layer; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } class Location extends kendo.Class { - constructor(lat: number, lng: number); + + options: LocationOptions; + + lat: number; + lng: number; + + constructor(lat: number, lng: number); + + static create(lat: number, lng?: number): kendo.dataviz.map.Location; + static create(lat: any, lng?: number): kendo.dataviz.map.Location; + static create(lat: kendo.dataviz.map.Location, lng?: number): kendo.dataviz.map.Location; + static fromLngLat(lnglat: any): kendo.dataviz.map.Location; + static fromLatLng(lnglat: any): kendo.dataviz.map.Location; + clone(): kendo.dataviz.map.Location; destination(destination: kendo.dataviz.map.Location): number; distanceTo(distance: number, bearing: number): kendo.dataviz.map.Location; @@ -13731,13 +15368,7 @@ declare module kendo.dataviz.map { toArray(): any; toString(): string; wrap(): kendo.dataviz.map.Location; - static create(lat: number, lng?: number): kendo.dataviz.map.Location; - static create(lat: any, lng?: number): kendo.dataviz.map.Location; - static create(lat: kendo.dataviz.map.Location, lng?: number): kendo.dataviz.map.Location; - static fromLngLat(lnglat: any): kendo.dataviz.map.Location; - static fromLatLng(lnglat: any): kendo.dataviz.map.Location; - lat: number; - lng: number; + } interface LocationOptions { @@ -13745,30 +15376,90 @@ declare module kendo.dataviz.map { } interface LocationEvent { sender: Location; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; + } + + + class MarkerLayer extends kendo.dataviz.map.Layer { + + + options: MarkerLayerOptions; + + map: kendo.dataviz.ui.Map; + + constructor(map: kendo.dataviz.ui.Map, options?: MarkerLayerOptions); + + + show(): void; + hide(): void; + setDataSource(): void; + + } + + interface MarkerLayerOptions { + name?: string; + } + interface MarkerLayerEvent { + sender: MarkerLayer; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + + class ShapeLayer extends kendo.dataviz.map.Layer { + + + options: ShapeLayerOptions; + + map: kendo.dataviz.ui.Map; + + constructor(map: kendo.dataviz.ui.Map, options?: ShapeLayerOptions); + + + show(): void; + hide(): void; + setDataSource(): void; + + } + + interface ShapeLayerOptions { + name?: string; + } + interface ShapeLayerEvent { + sender: ShapeLayer; + preventDefault: Function; + isDefaultPrevented(): boolean; } } declare module kendo.mobile.ui { class ActionSheet extends kendo.mobile.ui.Widget { + static fn: ActionSheet; - static extend(proto: Object): ActionSheet; + + options: ActionSheetOptions; + element: JQuery; wrapper: JQuery; + + static extend(proto: Object): ActionSheet; + constructor(element: Element, options?: ActionSheetOptions); - options: ActionSheetOptions; + + close(): void; destroy(): void; open(target: JQuery, context: any): void; + } interface ActionSheetPopup { - direction?: any; - height?: any; - width?: any; + direction?: number|string; + height?: number|string; + width?: number|string; } interface ActionSheetOptions { @@ -13781,8 +15472,8 @@ declare module kendo.mobile.ui { } interface ActionSheetEvent { sender: ActionSheet; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } interface ActionSheetOpenEvent extends ActionSheetEvent { @@ -13792,14 +15483,22 @@ declare module kendo.mobile.ui { class BackButton extends kendo.mobile.ui.Widget { + static fn: BackButton; - static extend(proto: Object): BackButton; + + options: BackButtonOptions; + element: JQuery; wrapper: JQuery; + + static extend(proto: Object): BackButton; + constructor(element: Element, options?: BackButtonOptions); - options: BackButtonOptions; + + destroy(): void; + } interface BackButtonOptions { @@ -13808,8 +15507,8 @@ declare module kendo.mobile.ui { } interface BackButtonEvent { sender: BackButton; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } interface BackButtonClickEvent extends BackButtonEvent { @@ -13819,17 +15518,25 @@ declare module kendo.mobile.ui { class Button extends kendo.mobile.ui.Widget { + static fn: Button; - static extend(proto: Object): Button; + + options: ButtonOptions; + element: JQuery; wrapper: JQuery; + + static extend(proto: Object): Button; + constructor(element: Element, options?: ButtonOptions); - options: ButtonOptions; + + badge(value: string): string; badge(value: boolean): string; destroy(): void; enable(enable: boolean): void; + } interface ButtonOptions { @@ -13842,8 +15549,8 @@ declare module kendo.mobile.ui { } interface ButtonEvent { sender: Button; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } interface ButtonClickEvent extends ButtonEvent { @@ -13853,13 +15560,20 @@ declare module kendo.mobile.ui { class ButtonGroup extends kendo.mobile.ui.Widget { + static fn: ButtonGroup; - static extend(proto: Object): ButtonGroup; + + options: ButtonGroupOptions; + element: JQuery; wrapper: JQuery; + + static extend(proto: Object): ButtonGroup; + constructor(element: Element, options?: ButtonGroupOptions); - options: ButtonGroupOptions; + + badge(button: string, value: string): string; badge(button: string, value: boolean): string; badge(button: number, value: string): string; @@ -13869,6 +15583,7 @@ declare module kendo.mobile.ui { enable(enable: boolean): void; select(li: JQuery): void; select(li: number): void; + } interface ButtonGroupOptions { @@ -13880,8 +15595,8 @@ declare module kendo.mobile.ui { } interface ButtonGroupEvent { sender: ButtonGroup; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } interface ButtonGroupSelectEvent extends ButtonGroupEvent { @@ -13890,18 +15605,26 @@ declare module kendo.mobile.ui { class Collapsible extends kendo.mobile.ui.Widget { + static fn: Collapsible; - static extend(proto: Object): Collapsible; + + options: CollapsibleOptions; + element: JQuery; wrapper: JQuery; + + static extend(proto: Object): Collapsible; + constructor(element: Element, options?: CollapsibleOptions); - options: CollapsibleOptions; + + collapse(instant: boolean): void; destroy(): void; expand(instant?: boolean): void; resize(): void; toggle(instant?: boolean): void; + } interface CollapsibleOptions { @@ -13916,20 +15639,28 @@ declare module kendo.mobile.ui { } interface CollapsibleEvent { sender: Collapsible; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } class DetailButton extends kendo.mobile.ui.Widget { + static fn: DetailButton; - static extend(proto: Object): DetailButton; + + options: DetailButtonOptions; + element: JQuery; wrapper: JQuery; + + static extend(proto: Object): DetailButton; + constructor(element: Element, options?: DetailButtonOptions); - options: DetailButtonOptions; + + destroy(): void; + } interface DetailButtonOptions { @@ -13938,8 +15669,8 @@ declare module kendo.mobile.ui { } interface DetailButtonEvent { sender: DetailButton; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } interface DetailButtonClickEvent extends DetailButtonEvent { @@ -13949,16 +15680,24 @@ declare module kendo.mobile.ui { class Drawer extends kendo.mobile.ui.Widget { + static fn: Drawer; - static extend(proto: Object): Drawer; + + options: DrawerOptions; + element: JQuery; wrapper: JQuery; + + static extend(proto: Object): Drawer; + constructor(element: Element, options?: DrawerOptions); - options: DrawerOptions; + + destroy(): void; hide(): void; show(): void; + } interface DrawerOptions { @@ -13977,8 +15716,8 @@ declare module kendo.mobile.ui { } interface DrawerEvent { sender: Drawer; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } interface DrawerAfterHideEvent extends DrawerEvent { @@ -13995,13 +15734,21 @@ declare module kendo.mobile.ui { class Layout extends kendo.mobile.ui.Widget { + static fn: Layout; - static extend(proto: Object): Layout; + + options: LayoutOptions; + element: JQuery; wrapper: JQuery; + + static extend(proto: Object): Layout; + constructor(element: Element, options?: LayoutOptions); - options: LayoutOptions; + + + } interface LayoutOptions { @@ -14014,8 +15761,8 @@ declare module kendo.mobile.ui { } interface LayoutEvent { sender: Layout; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } interface LayoutHideEvent extends LayoutEvent { @@ -14034,14 +15781,21 @@ declare module kendo.mobile.ui { class ListView extends kendo.mobile.ui.Widget { + static fn: ListView; - static extend(proto: Object): ListView; + + options: ListViewOptions; + + dataSource: kendo.data.DataSource; element: JQuery; wrapper: JQuery; + + static extend(proto: Object): ListView; + constructor(element: Element, options?: ListViewOptions); - options: ListViewOptions; - dataSource: kendo.data.DataSource; + + append(dataItems: any): void; prepend(dataItems: any): void; replace(dataItems: any): void; @@ -14051,6 +15805,7 @@ declare module kendo.mobile.ui { items(): JQuery; refresh(): void; setDataSource(dataSource: kendo.data.DataSource): void; + } interface ListViewFilterable { @@ -14072,16 +15827,16 @@ declare module kendo.mobile.ui { name?: string; appendOnRefresh?: boolean; autoBind?: boolean; - dataSource?: any; + dataSource?: kendo.data.DataSource|any; endlessScroll?: boolean; fixedHeaders?: boolean; - headerTemplate?: any; + headerTemplate?: string|Function; loadMore?: boolean; messages?: ListViewMessages; pullToRefresh?: boolean; pullParameters?: Function; style?: string; - template?: any; + template?: string|Function; type?: string; filterable?: ListViewFilterable; virtualViewSize?: number; @@ -14092,8 +15847,8 @@ declare module kendo.mobile.ui { } interface ListViewEvent { sender: ListView; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } interface ListViewClickEvent extends ListViewEvent { @@ -14105,15 +15860,23 @@ declare module kendo.mobile.ui { class Loader extends kendo.mobile.ui.Widget { + static fn: Loader; - static extend(proto: Object): Loader; + + options: LoaderOptions; + element: JQuery; wrapper: JQuery; + + static extend(proto: Object): Loader; + constructor(element: Element, options?: LoaderOptions); - options: LoaderOptions; + + hide(): void; show(): void; + } interface LoaderOptions { @@ -14121,22 +15884,30 @@ declare module kendo.mobile.ui { } interface LoaderEvent { sender: Loader; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } class ModalView extends kendo.mobile.ui.Widget { + static fn: ModalView; - static extend(proto: Object): ModalView; + + options: ModalViewOptions; + element: JQuery; wrapper: JQuery; + + static extend(proto: Object): ModalView; + constructor(element: Element, options?: ModalViewOptions); - options: ModalViewOptions; + + close(): void; destroy(): void; open(target: JQuery): void; + } interface ModalViewOptions { @@ -14151,8 +15922,8 @@ declare module kendo.mobile.ui { } interface ModalViewEvent { sender: ModalView; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } interface ModalViewBeforeOpenEvent extends ModalViewEvent { @@ -14171,15 +15942,23 @@ declare module kendo.mobile.ui { class NavBar extends kendo.mobile.ui.Widget { + static fn: NavBar; - static extend(proto: Object): NavBar; + + options: NavBarOptions; + element: JQuery; wrapper: JQuery; + + static extend(proto: Object): NavBar; + constructor(element: Element, options?: NavBarOptions); - options: NavBarOptions; + + destroy(): void; title(value: string): void; + } interface NavBarOptions { @@ -14187,26 +15966,33 @@ declare module kendo.mobile.ui { } interface NavBarEvent { sender: NavBar; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } class Pane extends kendo.mobile.ui.Widget { + static fn: Pane; - static extend(proto: Object): Pane; + + options: PaneOptions; + element: JQuery; wrapper: JQuery; + + static extend(proto: Object): Pane; + constructor(element: Element, options?: PaneOptions); - options: PaneOptions; + + destroy(): void; hideLoading(): void; navigate(url: string, transition: string): void; replace(url: string, transition: string): void; - Example(): void; showLoading(): void; view(): kendo.mobile.ui.View; + } interface PaneOptions { @@ -14222,8 +16008,8 @@ declare module kendo.mobile.ui { } interface PaneEvent { sender: Pane; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } interface PaneNavigateEvent extends PaneEvent { @@ -14236,16 +16022,24 @@ declare module kendo.mobile.ui { class PopOver extends kendo.mobile.ui.Widget { + static fn: PopOver; - static extend(proto: Object): PopOver; + + options: PopOverOptions; + element: JQuery; wrapper: JQuery; + + static extend(proto: Object): PopOver; + constructor(element: Element, options?: PopOverOptions); - options: PopOverOptions; + + close(): void; destroy(): void; open(target: JQuery): void; + } interface PopOverPane { @@ -14256,8 +16050,8 @@ declare module kendo.mobile.ui { } interface PopOverPopup { - height?: any; - width?: any; + height?: number|string; + width?: number|string; } interface PopOverOptions { @@ -14269,8 +16063,8 @@ declare module kendo.mobile.ui { } interface PopOverEvent { sender: PopOver; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } interface PopOverCloseEvent extends PopOverEvent { @@ -14282,14 +16076,21 @@ declare module kendo.mobile.ui { class ScrollView extends kendo.mobile.ui.Widget { + static fn: ScrollView; - static extend(proto: Object): ScrollView; + + options: ScrollViewOptions; + + dataSource: kendo.data.DataSource; element: JQuery; wrapper: JQuery; + + static extend(proto: Object): ScrollView; + constructor(element: Element, options?: ScrollViewOptions); - options: ScrollViewOptions; - dataSource: kendo.data.DataSource; + + content(content: string): void; content(content: JQuery): void; destroy(): void; @@ -14299,14 +16100,15 @@ declare module kendo.mobile.ui { scrollTo(page: number, instant: boolean): void; setDataSource(dataSource: kendo.data.DataSource): void; value(dataItem: any): any; + } interface ScrollViewOptions { name?: string; autoBind?: boolean; bounceVelocityThreshold?: number; - contentHeight?: any; - dataSource?: any; + contentHeight?: number|string; + dataSource?: kendo.data.DataSource|any; duration?: number; emptyTemplate?: string; enablePager?: boolean; @@ -14321,8 +16123,8 @@ declare module kendo.mobile.ui { } interface ScrollViewEvent { sender: ScrollView; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } interface ScrollViewChangingEvent extends ScrollViewEvent { @@ -14343,14 +16145,22 @@ declare module kendo.mobile.ui { class Scroller extends kendo.mobile.ui.Widget { + static fn: Scroller; - static extend(proto: Object): Scroller; + + options: ScrollerOptions; + element: JQuery; wrapper: JQuery; + + static extend(proto: Object): Scroller; + constructor(element: Element, options?: ScrollerOptions); - options: ScrollerOptions; + + animatedScrollTo(x: number, y: number): void; + contentResized(): void; destroy(): void; disable(): void; enable(): void; @@ -14361,6 +16171,7 @@ declare module kendo.mobile.ui { scrollTo(x: number, y: number): void; scrollWidth(): void; zoomOut(): void; + } interface ScrollerMessages { @@ -14384,8 +16195,8 @@ declare module kendo.mobile.ui { } interface ScrollerEvent { sender: Scroller; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } interface ScrollerScrollEvent extends ScrollerEvent { @@ -14395,16 +16206,24 @@ declare module kendo.mobile.ui { class SplitView extends kendo.mobile.ui.Widget { + static fn: SplitView; - static extend(proto: Object): SplitView; + + options: SplitViewOptions; + element: JQuery; wrapper: JQuery; + + static extend(proto: Object): SplitView; + constructor(element: Element, options?: SplitViewOptions); - options: SplitViewOptions; + + destroy(): void; expandPanes(): void; collapsePanes(): void; + } interface SplitViewOptions { @@ -14415,8 +16234,8 @@ declare module kendo.mobile.ui { } interface SplitViewEvent { sender: SplitView; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } interface SplitViewInitEvent extends SplitViewEvent { @@ -14429,19 +16248,27 @@ declare module kendo.mobile.ui { class Switch extends kendo.mobile.ui.Widget { + static fn: Switch; - static extend(proto: Object): Switch; + + options: SwitchOptions; + element: JQuery; wrapper: JQuery; + + static extend(proto: Object): Switch; + constructor(element: Element, options?: SwitchOptions); - options: SwitchOptions; + + check(): boolean; check(check: boolean): void; destroy(): void; enable(enable: boolean): void; refresh(): void; toggle(): void; + } interface SwitchOptions { @@ -14454,8 +16281,8 @@ declare module kendo.mobile.ui { } interface SwitchEvent { sender: Switch; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } interface SwitchChangeEvent extends SwitchEvent { @@ -14464,13 +16291,20 @@ declare module kendo.mobile.ui { class TabStrip extends kendo.mobile.ui.Widget { + static fn: TabStrip; - static extend(proto: Object): TabStrip; + + options: TabStripOptions; + element: JQuery; wrapper: JQuery; + + static extend(proto: Object): TabStrip; + constructor(element: Element, options?: TabStripOptions); - options: TabStripOptions; + + badge(tab: string, value: string): string; badge(tab: string, value: boolean): string; badge(tab: number, value: string): string; @@ -14481,6 +16315,7 @@ declare module kendo.mobile.ui { switchTo(url: number): void; switchByFullUrl(url: string): void; clear(): void; + } interface TabStripOptions { @@ -14490,8 +16325,8 @@ declare module kendo.mobile.ui { } interface TabStripEvent { sender: TabStrip; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } interface TabStripSelectEvent extends TabStripEvent { @@ -14500,16 +16335,24 @@ declare module kendo.mobile.ui { class View extends kendo.mobile.ui.Widget { + static fn: View; - static extend(proto: Object): View; + + options: ViewOptions; + element: JQuery; wrapper: JQuery; + + static extend(proto: Object): View; + constructor(element: Element, options?: ViewOptions); - options: ViewOptions; + + contentElement(): void; destroy(): void; enable(enable: boolean): void; + } interface ViewOptions { @@ -14532,8 +16375,8 @@ declare module kendo.mobile.ui { } interface ViewEvent { sender: View; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } interface ViewAfterShowEvent extends ViewEvent { @@ -14572,14 +16415,22 @@ declare module kendo.mobile.ui { } declare module kendo.ooxml { class Workbook extends Observable { - constructor(options?: WorkbookOptions); + + options: WorkbookOptions; - toDataURL(): string; + sheets: WorkbookSheet[]; + + constructor(options?: WorkbookOptions); + + + toDataURL(): string; + } interface WorkbookSheetColumn { autoWidth?: boolean; + index?: number; width?: number; } @@ -14598,26 +16449,35 @@ declare module kendo.ooxml { bold?: boolean; color?: string; colSpan?: number; + fontFamily?: string; fontName?: string; fontSize?: number; format?: string; hAlign?: string; + index?: any; italic?: boolean; rowSpan?: number; + textAlign?: string; underline?: boolean; wrap?: boolean; vAlign?: string; - value?: any; + verticalAlign?: string; + value?: Date|number|string|boolean; } interface WorkbookSheetRow { cells?: WorkbookSheetRowCell[]; + index?: number; + height?: number; } interface WorkbookSheet { columns?: WorkbookSheetColumn[]; freezePane?: WorkbookSheetFreezePane; + frozenColumns?: number; + frozenRows?: number; filter?: WorkbookSheetFilter; + name?: string; rows?: WorkbookSheetRow[]; title?: string; } @@ -14630,16 +16490,734 @@ declare module kendo.ooxml { } interface WorkbookEvent { sender: Workbook; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } } +declare module kendo.dataviz.drawing { + class Arc extends kendo.drawing.Element { + + + options: ArcOptions; + + + constructor(geometry: kendo.geometry.Arc, options?: ArcOptions); + + + bbox(): kendo.geometry.Rect; + clip(): kendo.drawing.Path; + clip(clip: kendo.drawing.Path): void; + clippedBBox(): kendo.geometry.Rect; + geometry(): kendo.geometry.Arc; + geometry(value: kendo.geometry.Arc): void; + fill(color: string, opacity?: number): kendo.drawing.Arc; + opacity(): number; + opacity(opacity: number): void; + stroke(color: string, width?: number, opacity?: number): kendo.drawing.Arc; + transform(): kendo.geometry.Transformation; + transform(transform: kendo.geometry.Transformation): void; + visible(): boolean; + visible(visible: boolean): void; + + } + + interface ArcOptions { + name?: string; + clip?: kendo.drawing.Path; + fill?: kendo.drawing.FillOptions; + opacity?: number; + stroke?: kendo.drawing.StrokeOptions; + transform?: kendo.geometry.Transformation; + visible?: boolean; + } + interface ArcEvent { + sender: Arc; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + + class Circle extends kendo.drawing.Element { + + + options: CircleOptions; + + + constructor(geometry: kendo.geometry.Circle, options?: CircleOptions); + + + bbox(): kendo.geometry.Rect; + clip(): kendo.drawing.Path; + clip(clip: kendo.drawing.Path): void; + clippedBBox(): kendo.geometry.Rect; + geometry(): kendo.geometry.Circle; + geometry(value: kendo.geometry.Circle): void; + fill(color: string, opacity?: number): kendo.drawing.Circle; + opacity(): number; + opacity(opacity: number): void; + stroke(color: string, width?: number, opacity?: number): kendo.drawing.Circle; + transform(): kendo.geometry.Transformation; + transform(transform: kendo.geometry.Transformation): void; + visible(): boolean; + visible(visible: boolean): void; + + } + + interface CircleOptions { + name?: string; + clip?: kendo.drawing.Path; + fill?: kendo.drawing.FillOptions; + opacity?: number; + stroke?: kendo.drawing.StrokeOptions; + transform?: kendo.geometry.Transformation; + visible?: boolean; + } + interface CircleEvent { + sender: Circle; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + + class Element extends kendo.Class { + + + options: ElementOptions; + + + constructor(options?: ElementOptions); + + + bbox(): kendo.geometry.Rect; + clip(): kendo.drawing.Path; + clip(clip: kendo.drawing.Path): void; + clippedBBox(): kendo.geometry.Rect; + opacity(): number; + opacity(opacity: number): void; + transform(): kendo.geometry.Transformation; + transform(transform: kendo.geometry.Transformation): void; + visible(): boolean; + visible(visible: boolean): void; + + } + + interface ElementOptions { + name?: string; + clip?: kendo.drawing.Path; + opacity?: number; + transform?: kendo.geometry.Transformation; + visible?: boolean; + } + interface ElementEvent { + sender: Element; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + + interface FillOptions { + + + + color: string; + opacity: number; + + + + + } + + + + class Gradient extends kendo.Class { + + + options: GradientOptions; + + stops: any; + + constructor(options?: GradientOptions); + + + addStop(offset: number, color: string, opacity: number): kendo.drawing.GradientStop; + removeStop(stop: kendo.drawing.GradientStop): void; + + } + + interface GradientOptions { + name?: string; + stops?: any; + } + interface GradientEvent { + sender: Gradient; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + + class GradientStop extends kendo.Class { + + + options: GradientStopOptions; + + + constructor(options?: GradientStopOptions); + + + + } + + interface GradientStopOptions { + name?: string; + offset?: number; + color?: string; + opacity?: number; + } + interface GradientStopEvent { + sender: GradientStop; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + + class Group extends kendo.drawing.Element { + + + options: GroupOptions; + + children: any; + + constructor(options?: GroupOptions); + + + append(element: kendo.drawing.Element): void; + clear(): void; + clip(): kendo.drawing.Path; + clip(clip: kendo.drawing.Path): void; + clippedBBox(): kendo.geometry.Rect; + insert(position: number, element: kendo.drawing.Element): void; + opacity(): number; + opacity(opacity: number): void; + remove(element: kendo.drawing.Element): void; + removeAt(index: number): void; + visible(): boolean; + visible(visible: boolean): void; + + } + + interface GroupOptions { + name?: string; + clip?: kendo.drawing.Path; + opacity?: number; + pdf?: kendo.drawing.PDFOptions; + transform?: kendo.geometry.Transformation; + visible?: boolean; + } + interface GroupEvent { + sender: Group; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + + class Image extends kendo.drawing.Element { + + + options: ImageOptions; + + + constructor(src: string, rect: kendo.geometry.Rect); + + + bbox(): kendo.geometry.Rect; + clip(): kendo.drawing.Path; + clip(clip: kendo.drawing.Path): void; + clippedBBox(): kendo.geometry.Rect; + opacity(): number; + opacity(opacity: number): void; + src(): string; + src(value: string): void; + rect(): kendo.geometry.Rect; + rect(value: kendo.geometry.Rect): void; + transform(): kendo.geometry.Transformation; + transform(transform: kendo.geometry.Transformation): void; + visible(): boolean; + visible(visible: boolean): void; + + } + + interface ImageOptions { + name?: string; + clip?: kendo.drawing.Path; + opacity?: number; + transform?: kendo.geometry.Transformation; + visible?: boolean; + } + interface ImageEvent { + sender: Image; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + + class Layout extends kendo.drawing.Group { + + + options: LayoutOptions; + + + constructor(rect: kendo.geometry.Rect, options?: LayoutOptions); + + + rect(): kendo.geometry.Rect; + rect(rect: kendo.geometry.Rect): void; + reflow(): void; + + } + + interface LayoutOptions { + name?: string; + alignContent?: string; + alignItems?: string; + justifyContent?: string; + lineSpacing?: number; + spacing?: number; + orientation?: string; + wrap?: boolean; + } + interface LayoutEvent { + sender: Layout; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + + class LinearGradient extends kendo.drawing.Gradient { + + + options: LinearGradientOptions; + + stops: any; + + constructor(options?: LinearGradientOptions); + + + addStop(offset: number, color: string, opacity: number): kendo.drawing.GradientStop; + end(): kendo.geometry.Point; + end(end: any): void; + end(end: kendo.geometry.Point): void; + start(): kendo.geometry.Point; + start(start: any): void; + start(start: kendo.geometry.Point): void; + removeStop(stop: kendo.drawing.GradientStop): void; + + } + + interface LinearGradientOptions { + name?: string; + stops?: any; + } + interface LinearGradientEvent { + sender: LinearGradient; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + + class MultiPath extends kendo.drawing.Element { + + + options: MultiPathOptions; + + paths: any; + + constructor(options?: MultiPathOptions); + + + bbox(): kendo.geometry.Rect; + clip(): kendo.drawing.Path; + clip(clip: kendo.drawing.Path): void; + clippedBBox(): kendo.geometry.Rect; + close(): kendo.drawing.MultiPath; + 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; + curveTo(controlOut: any, controlIn: kendo.geometry.Point, endPoint: kendo.geometry.Point): kendo.drawing.MultiPath; + curveTo(controlOut: kendo.geometry.Point, controlIn: any, endPoint: any): kendo.drawing.MultiPath; + curveTo(controlOut: kendo.geometry.Point, controlIn: any, endPoint: kendo.geometry.Point): kendo.drawing.MultiPath; + curveTo(controlOut: kendo.geometry.Point, controlIn: kendo.geometry.Point, endPoint: any): kendo.drawing.MultiPath; + curveTo(controlOut: kendo.geometry.Point, controlIn: kendo.geometry.Point, endPoint: kendo.geometry.Point): kendo.drawing.MultiPath; + fill(color: string, opacity?: number): kendo.drawing.MultiPath; + lineTo(x: number, y?: number): kendo.drawing.MultiPath; + lineTo(x: any, y?: number): kendo.drawing.MultiPath; + lineTo(x: kendo.geometry.Point, y?: number): kendo.drawing.MultiPath; + moveTo(x: number, y?: number): kendo.drawing.MultiPath; + moveTo(x: any, y?: number): kendo.drawing.MultiPath; + moveTo(x: kendo.geometry.Point, y?: number): kendo.drawing.MultiPath; + opacity(): number; + opacity(opacity: number): void; + stroke(color: string, width?: number, opacity?: number): kendo.drawing.MultiPath; + transform(): kendo.geometry.Transformation; + transform(transform: kendo.geometry.Transformation): void; + visible(): boolean; + visible(visible: boolean): void; + + } + + interface MultiPathOptions { + name?: string; + clip?: kendo.drawing.Path; + fill?: kendo.drawing.FillOptions; + opacity?: number; + stroke?: kendo.drawing.StrokeOptions; + transform?: kendo.geometry.Transformation; + visible?: boolean; + } + interface MultiPathEvent { + sender: MultiPath; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + + class OptionsStore extends kendo.Class { + + + options: OptionsStoreOptions; + + observer: any; + + constructor(options?: OptionsStoreOptions); + + + get(field: string): any; + set(field: string, value: any): void; + + } + + interface OptionsStoreOptions { + name?: string; + } + interface OptionsStoreEvent { + sender: OptionsStore; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + + interface PDFOptions { + + + + creator: string; + date: Date; + keywords: string; + landscape: boolean; + margin: any; + paperSize: any; + subject: string; + title: string; + + + + + } + + + + class Path extends kendo.drawing.Element { + + + options: PathOptions; + + segments: any; + + constructor(options?: PathOptions); + + static fromPoints(points: any): kendo.drawing.Path; + static fromRect(rect: kendo.geometry.Rect): kendo.drawing.Path; + static parse(svgPath: string, options?: any): kendo.drawing.Path; + + bbox(): kendo.geometry.Rect; + clip(): kendo.drawing.Path; + clip(clip: kendo.drawing.Path): void; + clippedBBox(): kendo.geometry.Rect; + close(): kendo.drawing.Path; + 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; + curveTo(controlOut: any, controlIn: kendo.geometry.Point, endPoint: kendo.geometry.Point): kendo.drawing.Path; + curveTo(controlOut: kendo.geometry.Point, controlIn: any, endPoint: any): kendo.drawing.Path; + curveTo(controlOut: kendo.geometry.Point, controlIn: any, endPoint: kendo.geometry.Point): kendo.drawing.Path; + curveTo(controlOut: kendo.geometry.Point, controlIn: kendo.geometry.Point, endPoint: any): kendo.drawing.Path; + curveTo(controlOut: kendo.geometry.Point, controlIn: kendo.geometry.Point, endPoint: kendo.geometry.Point): kendo.drawing.Path; + fill(color: string, opacity?: number): kendo.drawing.Path; + lineTo(x: number, y?: number): kendo.drawing.Path; + lineTo(x: any, y?: number): kendo.drawing.Path; + lineTo(x: kendo.geometry.Point, y?: number): kendo.drawing.Path; + moveTo(x: number, y?: number): kendo.drawing.Path; + moveTo(x: any, y?: number): kendo.drawing.Path; + moveTo(x: kendo.geometry.Point, y?: number): kendo.drawing.Path; + opacity(): number; + opacity(opacity: number): void; + stroke(color: string, width?: number, opacity?: number): kendo.drawing.Path; + transform(): kendo.geometry.Transformation; + transform(transform: kendo.geometry.Transformation): void; + visible(): boolean; + visible(visible: boolean): void; + + } + + interface PathOptions { + name?: string; + clip?: kendo.drawing.Path; + fill?: kendo.drawing.FillOptions; + opacity?: number; + stroke?: kendo.drawing.StrokeOptions; + transform?: kendo.geometry.Transformation; + visible?: boolean; + } + interface PathEvent { + sender: Path; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + + class RadialGradient extends kendo.drawing.Gradient { + + + options: RadialGradientOptions; + + stops: any; + + constructor(options?: RadialGradientOptions); + + + addStop(offset: number, color: string, opacity: number): kendo.drawing.GradientStop; + center(): kendo.geometry.Point; + center(center: any): void; + center(center: kendo.geometry.Point): void; + radius(): number; + radius(value: number): void; + removeStop(stop: kendo.drawing.GradientStop): void; + + } + + interface RadialGradientOptions { + name?: string; + center?: any|kendo.geometry.Point; + radius?: number; + stops?: any; + } + interface RadialGradientEvent { + sender: RadialGradient; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + + class Rect extends kendo.drawing.Element { + + + options: RectOptions; + + + constructor(geometry: kendo.geometry.Rect, options?: RectOptions); + + + bbox(): kendo.geometry.Rect; + clip(): kendo.drawing.Path; + clip(clip: kendo.drawing.Path): void; + clippedBBox(): kendo.geometry.Rect; + geometry(): kendo.geometry.Rect; + geometry(value: kendo.geometry.Rect): void; + fill(color: string, opacity?: number): kendo.drawing.Rect; + opacity(): number; + opacity(opacity: number): void; + stroke(color: string, width?: number, opacity?: number): kendo.drawing.Rect; + transform(): kendo.geometry.Transformation; + transform(transform: kendo.geometry.Transformation): void; + visible(): boolean; + visible(visible: boolean): void; + + } + + interface RectOptions { + name?: string; + clip?: kendo.drawing.Path; + fill?: kendo.drawing.FillOptions; + opacity?: number; + stroke?: kendo.drawing.StrokeOptions; + transform?: kendo.geometry.Transformation; + visible?: boolean; + } + interface RectEvent { + sender: Rect; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + + class Segment extends kendo.Class { + + + options: SegmentOptions; + + + constructor(anchor: kendo.geometry.Point, controlIn: kendo.geometry.Point, controlOut: kendo.geometry.Point); + + + anchor(): kendo.geometry.Point; + anchor(value: kendo.geometry.Point): void; + controlIn(): kendo.geometry.Point; + controlIn(value: kendo.geometry.Point): void; + controlOut(): kendo.geometry.Point; + controlOut(value: kendo.geometry.Point): void; + + } + + interface SegmentOptions { + name?: string; + } + interface SegmentEvent { + sender: Segment; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + + interface StrokeOptions { + + + + color: string; + dashType: string; + lineCap: string; + lineJoin: string; + opacity: number; + width: number; + + + + + } + + + + class Surface extends kendo.Observable { + + + options: SurfaceOptions; + + + constructor(options?: SurfaceOptions); + + static create(element: JQuery, options?: any): kendo.drawing.Surface; + static create(element: Element, options?: any): kendo.drawing.Surface; + + clear(): void; + draw(element: kendo.drawing.Element): void; + eventTarget(e: any): kendo.drawing.Element; + resize(force?: boolean): void; + + } + + interface SurfaceOptions { + name?: string; + type?: string; + height?: string; + width?: string; + click?(e: SurfaceClickEvent): void; + mouseenter?(e: SurfaceMouseenterEvent): void; + mouseleave?(e: SurfaceMouseleaveEvent): void; + } + interface SurfaceEvent { + sender: Surface; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface SurfaceClickEvent extends SurfaceEvent { + element?: kendo.drawing.Element; + originalEvent?: any; + } + + interface SurfaceMouseenterEvent extends SurfaceEvent { + element?: kendo.drawing.Element; + originalEvent?: any; + } + + interface SurfaceMouseleaveEvent extends SurfaceEvent { + element?: kendo.drawing.Element; + originalEvent?: any; + } + + + class Text extends kendo.drawing.Element { + + + options: TextOptions; + + + constructor(content: string, position: kendo.geometry.Point, options?: TextOptions); + + + bbox(): kendo.geometry.Rect; + clip(): kendo.drawing.Path; + clip(clip: kendo.drawing.Path): void; + clippedBBox(): kendo.geometry.Rect; + content(): string; + content(value: string): void; + fill(color: string, opacity?: number): kendo.drawing.Text; + opacity(): number; + opacity(opacity: number): void; + position(): kendo.geometry.Point; + position(value: kendo.geometry.Point): void; + stroke(color: string, width?: number, opacity?: number): kendo.drawing.Text; + transform(): kendo.geometry.Transformation; + transform(transform: kendo.geometry.Transformation): void; + visible(): boolean; + visible(visible: boolean): void; + + } + + interface TextOptions { + name?: string; + clip?: kendo.drawing.Path; + fill?: kendo.drawing.FillOptions; + font?: string; + opacity?: number; + stroke?: kendo.drawing.StrokeOptions; + transform?: kendo.geometry.Transformation; + visible?: boolean; + } + interface TextEvent { + sender: Text; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + +} declare module kendo.dataviz.geometry { class Arc extends Observable { + + options: ArcOptions; + + anticlockwise: boolean; + center: kendo.geometry.Point; + endAngle: number; + radiusX: number; + radiusY: number; + startAngle: number; + + + bbox(matrix: kendo.geometry.Matrix): kendo.geometry.Rect; getAnticlockwise(): boolean; getCenter(): kendo.geometry.Point; @@ -14654,12 +17232,7 @@ declare module kendo.dataviz.geometry { setRadiusX(value: number): kendo.geometry.Arc; setRadiusY(value: number): kendo.geometry.Arc; setStartAngle(value: number): kendo.geometry.Arc; - anticlockwise: boolean; - center: kendo.geometry.Point; - endAngle: number; - radiusX: number; - radiusY: number; - startAngle: number; + } interface ArcOptions { @@ -14667,13 +17240,21 @@ declare module kendo.dataviz.geometry { } interface ArcEvent { sender: Arc; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } class Circle extends Observable { + + options: CircleOptions; + + center: kendo.geometry.Point; + radius: number; + + + bbox(matrix: kendo.geometry.Matrix): kendo.geometry.Rect; clone(): kendo.geometry.Circle; equals(other: kendo.geometry.Circle): boolean; @@ -14683,8 +17264,7 @@ declare module kendo.dataviz.geometry { setCenter(value: kendo.geometry.Point): kendo.geometry.Point; setCenter(value: any): kendo.geometry.Point; setRadius(value: number): kendo.geometry.Circle; - center: kendo.geometry.Point; - radius: number; + } interface CircleOptions { @@ -14692,29 +17272,36 @@ declare module kendo.dataviz.geometry { } interface CircleEvent { sender: Circle; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } class Matrix extends Observable { + + options: MatrixOptions; - clone(): kendo.geometry.Matrix; - equals(other: kendo.geometry.Matrix): boolean; - round(digits: number): kendo.geometry.Matrix; - multiplyCopy(matrix: kendo.geometry.Matrix): kendo.geometry.Matrix; - toArray(digits: number): any; - toString(digits: number, separator: string): string; - static rotate(angle: number, x: number, y: number): kendo.geometry.Matrix; - static scale(scaleX: number, scaleY: number): kendo.geometry.Matrix; - static translate(x: number, y: number): kendo.geometry.Matrix; - static unit(): kendo.geometry.Matrix; + a: number; b: number; c: number; d: number; e: number; f: number; + + + static rotate(angle: number, x: number, y: number): kendo.geometry.Matrix; + static scale(scaleX: number, scaleY: number): kendo.geometry.Matrix; + static translate(x: number, y: number): kendo.geometry.Matrix; + static unit(): kendo.geometry.Matrix; + + clone(): kendo.geometry.Matrix; + equals(other: kendo.geometry.Matrix): boolean; + round(digits: number): kendo.geometry.Matrix; + multiplyCopy(matrix: kendo.geometry.Matrix): kendo.geometry.Matrix; + toArray(digits: number): any; + toString(digits: number, separator: string): string; + } interface MatrixOptions { @@ -14722,13 +17309,29 @@ declare module kendo.dataviz.geometry { } interface MatrixEvent { sender: Matrix; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } class Point extends Observable { + + options: PointOptions; + + x: number; + y: number; + + constructor(x: number, y: number); + + static create(x: number, y: number): kendo.geometry.Point; + static create(x: any, y: number): kendo.geometry.Point; + static create(x: kendo.geometry.Point, y: number): kendo.geometry.Point; + static min(): kendo.geometry.Point; + static max(): kendo.geometry.Point; + static minPoint(): kendo.geometry.Point; + static maxPoint(): kendo.geometry.Point; + clone(): kendo.geometry.Point; distanceTo(point: kendo.geometry.Point): number; equals(other: kendo.geometry.Point): boolean; @@ -14749,15 +17352,7 @@ declare module kendo.dataviz.geometry { translate(dx: number, dy: number): kendo.geometry.Point; translateWith(vector: kendo.geometry.Point): kendo.geometry.Point; translateWith(vector: any): kendo.geometry.Point; - static create(x: number, y: number): kendo.geometry.Point; - static create(x: any, y: number): kendo.geometry.Point; - static create(x: kendo.geometry.Point, y: number): kendo.geometry.Point; - static min(): kendo.geometry.Point; - static max(): kendo.geometry.Point; - static minPoint(): kendo.geometry.Point; - static maxPoint(): kendo.geometry.Point; - x: number; - y: number; + } interface PointOptions { @@ -14765,14 +17360,24 @@ declare module kendo.dataviz.geometry { } interface PointEvent { sender: Point; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } class Rect extends Observable { - constructor(origin: kendo.geometry.Point, size: kendo.geometry.Size); + + options: RectOptions; + + origin: kendo.geometry.Point; + size: kendo.geometry.Size; + + constructor(origin: kendo.geometry.Point, size: kendo.geometry.Size); + + 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; + bbox(matrix: kendo.geometry.Matrix): kendo.geometry.Rect; bottomLeft(): kendo.geometry.Point; bottomRight(): kendo.geometry.Point; @@ -14789,10 +17394,7 @@ declare module kendo.dataviz.geometry { topLeft(): kendo.geometry.Point; topRight(): kendo.geometry.Point; width(): number; - 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; - origin: kendo.geometry.Point; - size: kendo.geometry.Size; + } interface RectOptions { @@ -14800,24 +17402,31 @@ declare module kendo.dataviz.geometry { } interface RectEvent { sender: Rect; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } class Size extends Observable { + + options: SizeOptions; + + width: number; + height: number; + + + static create(width: number, height: number): kendo.geometry.Size; + static create(width: any, height: number): kendo.geometry.Size; + static create(width: kendo.geometry.Size, height: number): kendo.geometry.Size; + clone(): kendo.geometry.Size; equals(other: kendo.geometry.Size): boolean; getWidth(): number; getHeight(): number; setWidth(value: number): kendo.geometry.Size; setHeight(value: number): kendo.geometry.Size; - static create(width: number, height: number): kendo.geometry.Size; - static create(width: any, height: number): kendo.geometry.Size; - static create(width: kendo.geometry.Size, height: number): kendo.geometry.Size; - width: number; - height: number; + } interface SizeOptions { @@ -14825,13 +17434,19 @@ declare module kendo.dataviz.geometry { } interface SizeEvent { sender: Size; - isDefaultPrevented(): boolean; preventDefault: Function; + isDefaultPrevented(): boolean; } class Transformation extends Observable { + + options: TransformationOptions; + + + + clone(): kendo.geometry.Transformation; equals(other: kendo.geometry.Transformation): boolean; matrix(): kendo.geometry.Matrix; @@ -14840,6 +17455,7 @@ declare module kendo.dataviz.geometry { rotate(angle: number, center: kendo.geometry.Point): kendo.geometry.Transformation; scale(scaleX: number, scaleY: number): kendo.geometry.Transformation; translate(x: number, y: number): kendo.geometry.Transformation; + } interface TransformationOptions { @@ -14847,530 +17463,8 @@ declare module kendo.dataviz.geometry { } interface TransformationEvent { sender: Transformation; - isDefaultPrevented(): boolean; preventDefault: Function; - } - - -} -declare module kendo.dataviz.drawing { - class Arc extends kendo.drawing.Element { - constructor(geometry: kendo.geometry.Arc, options?: ArcOptions); - options: ArcOptions; - bbox(): kendo.geometry.Rect; - clip(): kendo.drawing.Path; - clip(clip: kendo.drawing.Path): void; - clippedBBox(): kendo.geometry.Rect; - geometry(): kendo.geometry.Arc; - geometry(value: kendo.geometry.Arc): void; - fill(color: string, opacity?: number): kendo.drawing.Arc; - opacity(): number; - opacity(opacity: number): void; - stroke(color: string, width?: number, opacity?: number): kendo.drawing.Arc; - transform(): kendo.geometry.Transformation; - transform(transform: kendo.geometry.Transformation): void; - visible(): boolean; - visible(visible: boolean): void; - } - - interface ArcOptions { - name?: string; - clip?: kendo.drawing.Path; - fill?: kendo.drawing.FillOptions; - opacity?: number; - stroke?: kendo.drawing.StrokeOptions; - transform?: kendo.geometry.Transformation; - visible?: boolean; - } - interface ArcEvent { - sender: Arc; isDefaultPrevented(): boolean; - preventDefault: Function; - } - - - class Circle extends kendo.drawing.Element { - constructor(geometry: kendo.geometry.Circle, options?: CircleOptions); - options: CircleOptions; - bbox(): kendo.geometry.Rect; - clip(): kendo.drawing.Path; - clip(clip: kendo.drawing.Path): void; - clippedBBox(): kendo.geometry.Rect; - geometry(): kendo.geometry.Circle; - geometry(value: kendo.geometry.Circle): void; - fill(color: string, opacity?: number): kendo.drawing.Circle; - opacity(): number; - opacity(opacity: number): void; - stroke(color: string, width?: number, opacity?: number): kendo.drawing.Circle; - transform(): kendo.geometry.Transformation; - transform(transform: kendo.geometry.Transformation): void; - visible(): boolean; - visible(visible: boolean): void; - } - - interface CircleOptions { - name?: string; - clip?: kendo.drawing.Path; - fill?: kendo.drawing.FillOptions; - opacity?: number; - stroke?: kendo.drawing.StrokeOptions; - transform?: kendo.geometry.Transformation; - visible?: boolean; - } - interface CircleEvent { - sender: Circle; - isDefaultPrevented(): boolean; - preventDefault: Function; - } - - - class Element extends kendo.Class { - constructor(options?: ElementOptions); - options: ElementOptions; - bbox(): kendo.geometry.Rect; - clip(): kendo.drawing.Path; - clip(clip: kendo.drawing.Path): void; - clippedBBox(): kendo.geometry.Rect; - opacity(): number; - opacity(opacity: number): void; - transform(): kendo.geometry.Transformation; - transform(transform: kendo.geometry.Transformation): void; - visible(): boolean; - visible(visible: boolean): void; - } - - interface ElementOptions { - name?: string; - clip?: kendo.drawing.Path; - opacity?: number; - transform?: kendo.geometry.Transformation; - visible?: boolean; - } - interface ElementEvent { - sender: Element; - isDefaultPrevented(): boolean; - preventDefault: Function; - } - - - interface FillOptions { - color: string; - opacity: number; - } - - - - class Gradient extends kendo.Class { - constructor(options?: GradientOptions); - options: GradientOptions; - addStop(offset: number, color: string, opacity: number): kendo.drawing.GradientStop; - removeStop(stop: kendo.drawing.GradientStop): void; - stops: any; - } - - interface GradientOptions { - name?: string; - stops?: any; - } - interface GradientEvent { - sender: Gradient; - isDefaultPrevented(): boolean; - preventDefault: Function; - } - - - class GradientStop extends kendo.Class { - constructor(options?: GradientStopOptions); - options: GradientStopOptions; - } - - interface GradientStopOptions { - name?: string; - offset?: number; - color?: string; - opacity?: number; - } - interface GradientStopEvent { - sender: GradientStop; - isDefaultPrevented(): boolean; - preventDefault: Function; - } - - - class Group extends kendo.drawing.Element { - constructor(options?: GroupOptions); - options: GroupOptions; - append(element: kendo.drawing.Element): void; - clear(): void; - clip(): kendo.drawing.Path; - clip(clip: kendo.drawing.Path): void; - clippedBBox(): kendo.geometry.Rect; - opacity(): number; - opacity(opacity: number): void; - remove(element: kendo.drawing.Element): void; - removeAt(index: number): void; - visible(): boolean; - visible(visible: boolean): void; - children: any; - } - - interface GroupOptions { - name?: string; - clip?: kendo.drawing.Path; - opacity?: number; - pdf?: kendo.drawing.PDFOptions; - transform?: kendo.geometry.Transformation; - visible?: boolean; - } - interface GroupEvent { - sender: Group; - isDefaultPrevented(): boolean; - preventDefault: Function; - } - - - class Image extends kendo.drawing.Element { - constructor(src: string, rect: kendo.geometry.Rect); - options: ImageOptions; - bbox(): kendo.geometry.Rect; - clip(): kendo.drawing.Path; - clip(clip: kendo.drawing.Path): void; - clippedBBox(): kendo.geometry.Rect; - opacity(): number; - opacity(opacity: number): void; - src(): string; - src(value: string): void; - rect(): kendo.geometry.Rect; - rect(value: kendo.geometry.Rect): void; - transform(): kendo.geometry.Transformation; - transform(transform: kendo.geometry.Transformation): void; - visible(): boolean; - visible(visible: boolean): void; - } - - interface ImageOptions { - name?: string; - clip?: kendo.drawing.Path; - opacity?: number; - transform?: kendo.geometry.Transformation; - visible?: boolean; - } - interface ImageEvent { - sender: Image; - isDefaultPrevented(): boolean; - preventDefault: Function; - } - - - class Layout extends kendo.drawing.Group { - constructor(rect: kendo.geometry.Rect, options?: LayoutOptions); - options: LayoutOptions; - rect(): kendo.geometry.Rect; - rect(rect: kendo.geometry.Rect): void; - reflow(): void; - } - - interface LayoutOptions { - name?: string; - alignContent?: string; - alignItems?: string; - justifyContent?: string; - lineSpacing?: number; - spacing?: number; - orientation?: string; - wrap?: boolean; - } - interface LayoutEvent { - sender: Layout; - isDefaultPrevented(): boolean; - preventDefault: Function; - } - - - class LinearGradient extends kendo.drawing.Gradient { - constructor(options?: LinearGradientOptions); - options: LinearGradientOptions; - addStop(offset: number, color: string, opacity: number): kendo.drawing.GradientStop; - end(): kendo.geometry.Point; - end(end: any): void; - end(end: kendo.geometry.Point): void; - start(): kendo.geometry.Point; - start(start: any): void; - start(start: kendo.geometry.Point): void; - removeStop(stop: kendo.drawing.GradientStop): void; - stops: any; - } - - interface LinearGradientOptions { - name?: string; - stops?: any; - } - interface LinearGradientEvent { - sender: LinearGradient; - isDefaultPrevented(): boolean; - preventDefault: Function; - } - - - class MultiPath extends kendo.drawing.Element { - constructor(options?: MultiPathOptions); - options: MultiPathOptions; - bbox(): kendo.geometry.Rect; - clip(): kendo.drawing.Path; - clip(clip: kendo.drawing.Path): void; - clippedBBox(): kendo.geometry.Rect; - close(): kendo.drawing.MultiPath; - curveTo(controlOut: any, controlIn: any): kendo.drawing.MultiPath; - curveTo(controlOut: any, controlIn: kendo.geometry.Point): kendo.drawing.MultiPath; - curveTo(controlOut: kendo.geometry.Point, controlIn: any): kendo.drawing.MultiPath; - curveTo(controlOut: kendo.geometry.Point, controlIn: kendo.geometry.Point): kendo.drawing.MultiPath; - fill(color: string, opacity?: number): kendo.drawing.MultiPath; - lineTo(x: number, y?: number): kendo.drawing.MultiPath; - lineTo(x: any, y?: number): kendo.drawing.MultiPath; - lineTo(x: kendo.geometry.Point, y?: number): kendo.drawing.MultiPath; - moveTo(x: number, y?: number): kendo.drawing.MultiPath; - moveTo(x: any, y?: number): kendo.drawing.MultiPath; - moveTo(x: kendo.geometry.Point, y?: number): kendo.drawing.MultiPath; - opacity(): number; - opacity(opacity: number): void; - stroke(color: string, width?: number, opacity?: number): kendo.drawing.MultiPath; - transform(): kendo.geometry.Transformation; - transform(transform: kendo.geometry.Transformation): void; - visible(): boolean; - visible(visible: boolean): void; - paths: any; - } - - interface MultiPathOptions { - name?: string; - clip?: kendo.drawing.Path; - fill?: kendo.drawing.FillOptions; - opacity?: number; - stroke?: kendo.drawing.StrokeOptions; - transform?: kendo.geometry.Transformation; - visible?: boolean; - } - interface MultiPathEvent { - sender: MultiPath; - isDefaultPrevented(): boolean; - preventDefault: Function; - } - - - class OptionsStore extends kendo.Class { - constructor(options?: OptionsStoreOptions); - options: OptionsStoreOptions; - get(field: string): any; - set(field: string, value: any): void; - observer: any; - } - - interface OptionsStoreOptions { - name?: string; - } - interface OptionsStoreEvent { - sender: OptionsStore; - isDefaultPrevented(): boolean; - preventDefault: Function; - } - - - interface PDFOptions { - creator: string; - date: Date; - keywords: string; - landscape: boolean; - margin: any; - paperSize: any; - subject: string; - title: string; - } - - - - class Path extends kendo.drawing.Element { - constructor(options?: PathOptions); - options: PathOptions; - bbox(): kendo.geometry.Rect; - clip(): kendo.drawing.Path; - clip(clip: kendo.drawing.Path): void; - clippedBBox(): kendo.geometry.Rect; - close(): kendo.drawing.Path; - curveTo(controlOut: any, controlIn: any): kendo.drawing.Path; - curveTo(controlOut: any, controlIn: kendo.geometry.Point): kendo.drawing.Path; - curveTo(controlOut: kendo.geometry.Point, controlIn: any): kendo.drawing.Path; - curveTo(controlOut: kendo.geometry.Point, controlIn: kendo.geometry.Point): kendo.drawing.Path; - fill(color: string, opacity?: number): kendo.drawing.Path; - lineTo(x: number, y?: number): kendo.drawing.Path; - lineTo(x: any, y?: number): kendo.drawing.Path; - lineTo(x: kendo.geometry.Point, y?: number): kendo.drawing.Path; - moveTo(x: number, y?: number): kendo.drawing.Path; - moveTo(x: any, y?: number): kendo.drawing.Path; - moveTo(x: kendo.geometry.Point, y?: number): kendo.drawing.Path; - opacity(): number; - opacity(opacity: number): void; - stroke(color: string, width?: number, opacity?: number): kendo.drawing.Path; - transform(): kendo.geometry.Transformation; - transform(transform: kendo.geometry.Transformation): void; - visible(): boolean; - visible(visible: boolean): void; - static fromPoints(points: any): kendo.drawing.Path; - static fromRect(rect: kendo.geometry.Rect): kendo.drawing.Path; - static parse(svgPath: string, options?: any): kendo.drawing.Path; - segments: any; - } - - interface PathOptions { - name?: string; - clip?: kendo.drawing.Path; - fill?: kendo.drawing.FillOptions; - opacity?: number; - stroke?: kendo.drawing.StrokeOptions; - transform?: kendo.geometry.Transformation; - visible?: boolean; - } - interface PathEvent { - sender: Path; - isDefaultPrevented(): boolean; - preventDefault: Function; - } - - - class RadialGradient extends kendo.drawing.Gradient { - constructor(options?: RadialGradientOptions); - options: RadialGradientOptions; - addStop(offset: number, color: string, opacity: number): kendo.drawing.GradientStop; - center(): kendo.geometry.Point; - center(center: any): void; - center(center: kendo.geometry.Point): void; - radius(): number; - radius(value: number): void; - removeStop(stop: kendo.drawing.GradientStop): void; - stops: any; - } - - interface RadialGradientOptions { - name?: string; - center?: any; - radius?: number; - stops?: any; - } - interface RadialGradientEvent { - sender: RadialGradient; - isDefaultPrevented(): boolean; - preventDefault: Function; - } - - - class Segment extends kendo.Class { - constructor(anchor: kendo.geometry.Point, controlIn: kendo.geometry.Point, controlOut: kendo.geometry.Point); - options: SegmentOptions; - anchor(): kendo.geometry.Point; - anchor(value: kendo.geometry.Point): void; - controlIn(): kendo.geometry.Point; - controlIn(value: kendo.geometry.Point): void; - controlOut(): kendo.geometry.Point; - controlOut(value: kendo.geometry.Point): void; - } - - interface SegmentOptions { - name?: string; - } - interface SegmentEvent { - sender: Segment; - isDefaultPrevented(): boolean; - preventDefault: Function; - } - - - interface StrokeOptions { - color: string; - dashType: string; - lineCap: string; - lineJoin: string; - opacity: number; - width: number; - } - - - - class Surface extends kendo.Observable { - constructor(options?: SurfaceOptions); - options: SurfaceOptions; - clear(): void; - draw(element: kendo.drawing.Element): void; - eventTarget(e: any): kendo.drawing.Element; - resize(force?: boolean): void; - static create(element: JQuery, options?: any): kendo.drawing.Surface; - static create(element: Element, options?: any): kendo.drawing.Surface; - } - - interface SurfaceOptions { - name?: string; - type?: string; - height?: string; - width?: string; - click?(e: SurfaceClickEvent): void; - mouseenter?(e: SurfaceMouseenterEvent): void; - mouseleave?(e: SurfaceMouseleaveEvent): void; - } - interface SurfaceEvent { - sender: Surface; - isDefaultPrevented(): boolean; - preventDefault: Function; - } - - interface SurfaceClickEvent extends SurfaceEvent { - element?: kendo.drawing.Element; - originalEvent?: any; - } - - interface SurfaceMouseenterEvent extends SurfaceEvent { - element?: kendo.drawing.Element; - originalEvent?: any; - } - - interface SurfaceMouseleaveEvent extends SurfaceEvent { - element?: kendo.drawing.Element; - originalEvent?: any; - } - - - class Text extends kendo.drawing.Element { - constructor(content: string, position: kendo.geometry.Point, options?: TextOptions); - options: TextOptions; - bbox(): kendo.geometry.Rect; - clip(): kendo.drawing.Path; - clip(clip: kendo.drawing.Path): void; - clippedBBox(): kendo.geometry.Rect; - content(): string; - content(value: string): void; - fill(color: string, opacity?: number): kendo.drawing.Text; - opacity(): number; - opacity(opacity: number): void; - position(): kendo.geometry.Point; - position(value: kendo.geometry.Point): void; - stroke(color: string, width?: number, opacity?: number): kendo.drawing.Text; - transform(): kendo.geometry.Transformation; - transform(transform: kendo.geometry.Transformation): void; - visible(): boolean; - visible(visible: boolean): void; - } - - interface TextOptions { - name?: string; - clip?: kendo.drawing.Path; - fill?: kendo.drawing.FillOptions; - font?: string; - opacity?: number; - stroke?: kendo.drawing.StrokeOptions; - transform?: kendo.geometry.Transformation; - visible?: boolean; - } - interface TextEvent { - sender: Text; - isDefaultPrevented(): boolean; - preventDefault: Function; } @@ -15404,286 +17498,294 @@ interface JQuery { kendoAutoComplete(): JQuery; kendoAutoComplete(options: kendo.ui.AutoCompleteOptions): JQuery; - data(key: "kendoAutoComplete") : kendo.ui.AutoComplete; + data(key: "kendoAutoComplete"): kendo.ui.AutoComplete; kendoBarcode(): JQuery; kendoBarcode(options: kendo.dataviz.ui.BarcodeOptions): JQuery; - data(key: "kendoBarcode") : kendo.dataviz.ui.Barcode; + data(key: "kendoBarcode"): kendo.dataviz.ui.Barcode; kendoButton(): JQuery; kendoButton(options: kendo.ui.ButtonOptions): JQuery; - data(key: "kendoButton") : kendo.ui.Button; + data(key: "kendoButton"): kendo.ui.Button; kendoCalendar(): JQuery; kendoCalendar(options: kendo.ui.CalendarOptions): JQuery; - data(key: "kendoCalendar") : kendo.ui.Calendar; + data(key: "kendoCalendar"): kendo.ui.Calendar; kendoChart(): JQuery; kendoChart(options: kendo.dataviz.ui.ChartOptions): JQuery; - data(key: "kendoChart") : kendo.dataviz.ui.Chart; + data(key: "kendoChart"): kendo.dataviz.ui.Chart; kendoColorPalette(): JQuery; kendoColorPalette(options: kendo.ui.ColorPaletteOptions): JQuery; - data(key: "kendoColorPalette") : kendo.ui.ColorPalette; + data(key: "kendoColorPalette"): kendo.ui.ColorPalette; kendoColorPicker(): JQuery; kendoColorPicker(options: kendo.ui.ColorPickerOptions): JQuery; - data(key: "kendoColorPicker") : kendo.ui.ColorPicker; + data(key: "kendoColorPicker"): kendo.ui.ColorPicker; kendoComboBox(): JQuery; kendoComboBox(options: kendo.ui.ComboBoxOptions): JQuery; - data(key: "kendoComboBox") : kendo.ui.ComboBox; + data(key: "kendoComboBox"): kendo.ui.ComboBox; kendoContextMenu(): JQuery; kendoContextMenu(options: kendo.ui.ContextMenuOptions): JQuery; - data(key: "kendoContextMenu") : kendo.ui.ContextMenu; + data(key: "kendoContextMenu"): kendo.ui.ContextMenu; kendoDatePicker(): JQuery; kendoDatePicker(options: kendo.ui.DatePickerOptions): JQuery; - data(key: "kendoDatePicker") : kendo.ui.DatePicker; + data(key: "kendoDatePicker"): kendo.ui.DatePicker; kendoDateTimePicker(): JQuery; kendoDateTimePicker(options: kendo.ui.DateTimePickerOptions): JQuery; - data(key: "kendoDateTimePicker") : kendo.ui.DateTimePicker; + data(key: "kendoDateTimePicker"): kendo.ui.DateTimePicker; kendoDiagram(): JQuery; kendoDiagram(options: kendo.dataviz.ui.DiagramOptions): JQuery; - data(key: "kendoDiagram") : kendo.dataviz.ui.Diagram; + data(key: "kendoDiagram"): kendo.dataviz.ui.Diagram; kendoDropDownList(): JQuery; kendoDropDownList(options: kendo.ui.DropDownListOptions): JQuery; - data(key: "kendoDropDownList") : kendo.ui.DropDownList; + data(key: "kendoDropDownList"): kendo.ui.DropDownList; kendoEditor(): JQuery; kendoEditor(options: kendo.ui.EditorOptions): JQuery; - data(key: "kendoEditor") : kendo.ui.Editor; + data(key: "kendoEditor"): kendo.ui.Editor; kendoFlatColorPicker(): JQuery; kendoFlatColorPicker(options: kendo.ui.FlatColorPickerOptions): JQuery; - data(key: "kendoFlatColorPicker") : kendo.ui.FlatColorPicker; + data(key: "kendoFlatColorPicker"): kendo.ui.FlatColorPicker; kendoGantt(): JQuery; kendoGantt(options: kendo.ui.GanttOptions): JQuery; - data(key: "kendoGantt") : kendo.ui.Gantt; + data(key: "kendoGantt"): kendo.ui.Gantt; kendoGrid(): JQuery; kendoGrid(options: kendo.ui.GridOptions): JQuery; - data(key: "kendoGrid") : kendo.ui.Grid; + data(key: "kendoGrid"): kendo.ui.Grid; kendoLinearGauge(): JQuery; kendoLinearGauge(options: kendo.dataviz.ui.LinearGaugeOptions): JQuery; - data(key: "kendoLinearGauge") : kendo.dataviz.ui.LinearGauge; + data(key: "kendoLinearGauge"): kendo.dataviz.ui.LinearGauge; kendoListView(): JQuery; kendoListView(options: kendo.ui.ListViewOptions): JQuery; - data(key: "kendoListView") : kendo.ui.ListView; + data(key: "kendoListView"): kendo.ui.ListView; kendoMap(): JQuery; kendoMap(options: kendo.dataviz.ui.MapOptions): JQuery; - data(key: "kendoMap") : kendo.dataviz.ui.Map; + data(key: "kendoMap"): kendo.dataviz.ui.Map; kendoMaskedTextBox(): JQuery; kendoMaskedTextBox(options: kendo.ui.MaskedTextBoxOptions): JQuery; - data(key: "kendoMaskedTextBox") : kendo.ui.MaskedTextBox; + data(key: "kendoMaskedTextBox"): kendo.ui.MaskedTextBox; kendoMenu(): JQuery; kendoMenu(options: kendo.ui.MenuOptions): JQuery; - data(key: "kendoMenu") : kendo.ui.Menu; + data(key: "kendoMenu"): kendo.ui.Menu; kendoMobileActionSheet(): JQuery; kendoMobileActionSheet(options: kendo.mobile.ui.ActionSheetOptions): JQuery; - data(key: "kendoMobileActionSheet") : kendo.mobile.ui.ActionSheet; + data(key: "kendoMobileActionSheet"): kendo.mobile.ui.ActionSheet; kendoMobileBackButton(): JQuery; kendoMobileBackButton(options: kendo.mobile.ui.BackButtonOptions): JQuery; - data(key: "kendoMobileBackButton") : kendo.mobile.ui.BackButton; + data(key: "kendoMobileBackButton"): kendo.mobile.ui.BackButton; kendoMobileButton(): JQuery; kendoMobileButton(options: kendo.mobile.ui.ButtonOptions): JQuery; - data(key: "kendoMobileButton") : kendo.mobile.ui.Button; + data(key: "kendoMobileButton"): kendo.mobile.ui.Button; kendoMobileButtonGroup(): JQuery; kendoMobileButtonGroup(options: kendo.mobile.ui.ButtonGroupOptions): JQuery; - data(key: "kendoMobileButtonGroup") : kendo.mobile.ui.ButtonGroup; + data(key: "kendoMobileButtonGroup"): kendo.mobile.ui.ButtonGroup; kendoMobileCollapsible(): JQuery; kendoMobileCollapsible(options: kendo.mobile.ui.CollapsibleOptions): JQuery; - data(key: "kendoMobileCollapsible") : kendo.mobile.ui.Collapsible; + data(key: "kendoMobileCollapsible"): kendo.mobile.ui.Collapsible; kendoMobileDetailButton(): JQuery; kendoMobileDetailButton(options: kendo.mobile.ui.DetailButtonOptions): JQuery; - data(key: "kendoMobileDetailButton") : kendo.mobile.ui.DetailButton; + data(key: "kendoMobileDetailButton"): kendo.mobile.ui.DetailButton; kendoMobileDrawer(): JQuery; kendoMobileDrawer(options: kendo.mobile.ui.DrawerOptions): JQuery; - data(key: "kendoMobileDrawer") : kendo.mobile.ui.Drawer; + data(key: "kendoMobileDrawer"): kendo.mobile.ui.Drawer; kendoMobileLayout(): JQuery; kendoMobileLayout(options: kendo.mobile.ui.LayoutOptions): JQuery; - data(key: "kendoMobileLayout") : kendo.mobile.ui.Layout; + data(key: "kendoMobileLayout"): kendo.mobile.ui.Layout; kendoMobileListView(): JQuery; kendoMobileListView(options: kendo.mobile.ui.ListViewOptions): JQuery; - data(key: "kendoMobileListView") : kendo.mobile.ui.ListView; + data(key: "kendoMobileListView"): kendo.mobile.ui.ListView; kendoMobileLoader(): JQuery; kendoMobileLoader(options: kendo.mobile.ui.LoaderOptions): JQuery; - data(key: "kendoMobileLoader") : kendo.mobile.ui.Loader; + data(key: "kendoMobileLoader"): kendo.mobile.ui.Loader; kendoMobileModalView(): JQuery; kendoMobileModalView(options: kendo.mobile.ui.ModalViewOptions): JQuery; - data(key: "kendoMobileModalView") : kendo.mobile.ui.ModalView; + data(key: "kendoMobileModalView"): kendo.mobile.ui.ModalView; kendoMobileNavBar(): JQuery; kendoMobileNavBar(options: kendo.mobile.ui.NavBarOptions): JQuery; - data(key: "kendoMobileNavBar") : kendo.mobile.ui.NavBar; + data(key: "kendoMobileNavBar"): kendo.mobile.ui.NavBar; kendoMobilePane(): JQuery; kendoMobilePane(options: kendo.mobile.ui.PaneOptions): JQuery; - data(key: "kendoMobilePane") : kendo.mobile.ui.Pane; + data(key: "kendoMobilePane"): kendo.mobile.ui.Pane; kendoMobilePopOver(): JQuery; kendoMobilePopOver(options: kendo.mobile.ui.PopOverOptions): JQuery; - data(key: "kendoMobilePopOver") : kendo.mobile.ui.PopOver; + data(key: "kendoMobilePopOver"): kendo.mobile.ui.PopOver; kendoMobileScrollView(): JQuery; kendoMobileScrollView(options: kendo.mobile.ui.ScrollViewOptions): JQuery; - data(key: "kendoMobileScrollView") : kendo.mobile.ui.ScrollView; + data(key: "kendoMobileScrollView"): kendo.mobile.ui.ScrollView; kendoMobileScroller(): JQuery; kendoMobileScroller(options: kendo.mobile.ui.ScrollerOptions): JQuery; - data(key: "kendoMobileScroller") : kendo.mobile.ui.Scroller; + data(key: "kendoMobileScroller"): kendo.mobile.ui.Scroller; kendoMobileSplitView(): JQuery; kendoMobileSplitView(options: kendo.mobile.ui.SplitViewOptions): JQuery; - data(key: "kendoMobileSplitView") : kendo.mobile.ui.SplitView; + data(key: "kendoMobileSplitView"): kendo.mobile.ui.SplitView; kendoMobileSwitch(): JQuery; kendoMobileSwitch(options: kendo.mobile.ui.SwitchOptions): JQuery; - data(key: "kendoMobileSwitch") : kendo.mobile.ui.Switch; + data(key: "kendoMobileSwitch"): kendo.mobile.ui.Switch; kendoMobileTabStrip(): JQuery; kendoMobileTabStrip(options: kendo.mobile.ui.TabStripOptions): JQuery; - data(key: "kendoMobileTabStrip") : kendo.mobile.ui.TabStrip; + data(key: "kendoMobileTabStrip"): kendo.mobile.ui.TabStrip; kendoMobileView(): JQuery; kendoMobileView(options: kendo.mobile.ui.ViewOptions): JQuery; - data(key: "kendoMobileView") : kendo.mobile.ui.View; + data(key: "kendoMobileView"): kendo.mobile.ui.View; kendoMultiSelect(): JQuery; kendoMultiSelect(options: kendo.ui.MultiSelectOptions): JQuery; - data(key: "kendoMultiSelect") : kendo.ui.MultiSelect; + data(key: "kendoMultiSelect"): kendo.ui.MultiSelect; kendoNotification(): JQuery; kendoNotification(options: kendo.ui.NotificationOptions): JQuery; - data(key: "kendoNotification") : kendo.ui.Notification; + data(key: "kendoNotification"): kendo.ui.Notification; kendoNumericTextBox(): JQuery; kendoNumericTextBox(options: kendo.ui.NumericTextBoxOptions): JQuery; - data(key: "kendoNumericTextBox") : kendo.ui.NumericTextBox; + data(key: "kendoNumericTextBox"): kendo.ui.NumericTextBox; kendoPager(): JQuery; kendoPager(options: kendo.ui.PagerOptions): JQuery; - data(key: "kendoPager") : kendo.ui.Pager; + data(key: "kendoPager"): kendo.ui.Pager; kendoPanelBar(): JQuery; kendoPanelBar(options: kendo.ui.PanelBarOptions): JQuery; - data(key: "kendoPanelBar") : kendo.ui.PanelBar; + data(key: "kendoPanelBar"): kendo.ui.PanelBar; kendoPivotConfigurator(): JQuery; kendoPivotConfigurator(options: kendo.ui.PivotConfiguratorOptions): JQuery; - data(key: "kendoPivotConfigurator") : kendo.ui.PivotConfigurator; + data(key: "kendoPivotConfigurator"): kendo.ui.PivotConfigurator; kendoPivotGrid(): JQuery; kendoPivotGrid(options: kendo.ui.PivotGridOptions): JQuery; - data(key: "kendoPivotGrid") : kendo.ui.PivotGrid; + data(key: "kendoPivotGrid"): kendo.ui.PivotGrid; + + kendoPopup(): JQuery; + kendoPopup(options: kendo.ui.PopupOptions): JQuery; + data(key: "kendoPopup"): kendo.ui.Popup; kendoProgressBar(): JQuery; kendoProgressBar(options: kendo.ui.ProgressBarOptions): JQuery; - data(key: "kendoProgressBar") : kendo.ui.ProgressBar; + data(key: "kendoProgressBar"): kendo.ui.ProgressBar; kendoQRCode(): JQuery; kendoQRCode(options: kendo.dataviz.ui.QRCodeOptions): JQuery; - data(key: "kendoQRCode") : kendo.dataviz.ui.QRCode; + data(key: "kendoQRCode"): kendo.dataviz.ui.QRCode; kendoRadialGauge(): JQuery; kendoRadialGauge(options: kendo.dataviz.ui.RadialGaugeOptions): JQuery; - data(key: "kendoRadialGauge") : kendo.dataviz.ui.RadialGauge; + data(key: "kendoRadialGauge"): kendo.dataviz.ui.RadialGauge; kendoRangeSlider(): JQuery; kendoRangeSlider(options: kendo.ui.RangeSliderOptions): JQuery; - data(key: "kendoRangeSlider") : kendo.ui.RangeSlider; + data(key: "kendoRangeSlider"): kendo.ui.RangeSlider; kendoResponsivePanel(): JQuery; kendoResponsivePanel(options: kendo.ui.ResponsivePanelOptions): JQuery; - data(key: "kendoResponsivePanel") : kendo.ui.ResponsivePanel; + data(key: "kendoResponsivePanel"): kendo.ui.ResponsivePanel; kendoScheduler(): JQuery; kendoScheduler(options: kendo.ui.SchedulerOptions): JQuery; - data(key: "kendoScheduler") : kendo.ui.Scheduler; + data(key: "kendoScheduler"): kendo.ui.Scheduler; kendoSlider(): JQuery; kendoSlider(options: kendo.ui.SliderOptions): JQuery; - data(key: "kendoSlider") : kendo.ui.Slider; + data(key: "kendoSlider"): kendo.ui.Slider; kendoSortable(): JQuery; kendoSortable(options: kendo.ui.SortableOptions): JQuery; - data(key: "kendoSortable") : kendo.ui.Sortable; + data(key: "kendoSortable"): kendo.ui.Sortable; kendoSparkline(): JQuery; kendoSparkline(options: kendo.dataviz.ui.SparklineOptions): JQuery; - data(key: "kendoSparkline") : kendo.dataviz.ui.Sparkline; + data(key: "kendoSparkline"): kendo.dataviz.ui.Sparkline; kendoSplitter(): JQuery; kendoSplitter(options: kendo.ui.SplitterOptions): JQuery; - data(key: "kendoSplitter") : kendo.ui.Splitter; + data(key: "kendoSplitter"): kendo.ui.Splitter; + + kendoSpreadsheet(): JQuery; + kendoSpreadsheet(options: kendo.ui.SpreadsheetOptions): JQuery; + data(key: "kendoSpreadsheet"): kendo.ui.Spreadsheet; kendoStockChart(): JQuery; kendoStockChart(options: kendo.dataviz.ui.StockChartOptions): JQuery; - data(key: "kendoStockChart") : kendo.dataviz.ui.StockChart; + data(key: "kendoStockChart"): kendo.dataviz.ui.StockChart; kendoTabStrip(): JQuery; kendoTabStrip(options: kendo.ui.TabStripOptions): JQuery; - data(key: "kendoTabStrip") : kendo.ui.TabStrip; + data(key: "kendoTabStrip"): kendo.ui.TabStrip; kendoTimePicker(): JQuery; kendoTimePicker(options: kendo.ui.TimePickerOptions): JQuery; - data(key: "kendoTimePicker") : kendo.ui.TimePicker; + data(key: "kendoTimePicker"): kendo.ui.TimePicker; kendoToolBar(): JQuery; kendoToolBar(options: kendo.ui.ToolBarOptions): JQuery; - data(key: "kendoToolBar") : kendo.ui.ToolBar; + data(key: "kendoToolBar"): kendo.ui.ToolBar; kendoTooltip(): JQuery; kendoTooltip(options: kendo.ui.TooltipOptions): JQuery; - data(key: "kendoTooltip") : kendo.ui.Tooltip; + data(key: "kendoTooltip"): kendo.ui.Tooltip; kendoTouch(): JQuery; kendoTouch(options: kendo.ui.TouchOptions): JQuery; - data(key: "kendoTouch") : kendo.ui.Touch; + data(key: "kendoTouch"): kendo.ui.Touch; kendoTreeList(): JQuery; kendoTreeList(options: kendo.ui.TreeListOptions): JQuery; - data(key: "kendoTreeList") : kendo.ui.TreeList; + data(key: "kendoTreeList"): kendo.ui.TreeList; kendoTreeMap(): JQuery; kendoTreeMap(options: kendo.dataviz.ui.TreeMapOptions): JQuery; - data(key: "kendoTreeMap") : kendo.dataviz.ui.TreeMap; + data(key: "kendoTreeMap"): kendo.dataviz.ui.TreeMap; kendoTreeView(): JQuery; kendoTreeView(options: kendo.ui.TreeViewOptions): JQuery; - data(key: "kendoTreeView") : kendo.ui.TreeView; + data(key: "kendoTreeView"): kendo.ui.TreeView; kendoUpload(): JQuery; kendoUpload(options: kendo.ui.UploadOptions): JQuery; - data(key: "kendoUpload") : kendo.ui.Upload; + data(key: "kendoUpload"): kendo.ui.Upload; kendoValidator(): JQuery; kendoValidator(options: kendo.ui.ValidatorOptions): JQuery; - data(key: "kendoValidator") : kendo.ui.Validator; + data(key: "kendoValidator"): kendo.ui.Validator; kendoWindow(): JQuery; kendoWindow(options: kendo.ui.WindowOptions): JQuery; - data(key: "kendoWindow") : kendo.ui.Window; + data(key: "kendoWindow"): kendo.ui.Window; } diff --git a/keytar/keytar-tests.ts b/keytar/keytar-tests.ts new file mode 100644 index 000000000..1ad9006c6 --- /dev/null +++ b/keytar/keytar-tests.ts @@ -0,0 +1,9 @@ +/// + +import keytar = require('keytar'); + +keytar.addPassword('keytar-tests', 'username', 'password'); +keytar.deletePassword('keytar-tests', 'username'); +keytar.findPassword('keytar-tests'); +keytar.getPassword('keytar-tests', 'username'); +keytar.replacePassword('keytar-tests', 'username', 'password'); diff --git a/keytar/keytar.d.ts b/keytar/keytar.d.ts new file mode 100644 index 000000000..cee7e71bd --- /dev/null +++ b/keytar/keytar.d.ts @@ -0,0 +1,60 @@ +// Type definitions for keytar 3.0.0 +// Project: http://atom.github.io/node-keytar/ +// Definitions by: Milan Burda +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module 'keytar' { + /** + * Get the stored password for the service and account. + * + * @param service The string service name. + * @param account The string account name. + * + * @returns the string password or null on failures. + */ + export function getPassword(service: string, account: string): string; + + /** + * Add the password for the service and account to the keychain. + * + * @param service The string service name. + * @param account The string account name. + * @param password The string password. + * + * @returns true on success, false on failure. + */ + export function addPassword(service: string, account: string, password: string): boolean; + + /** + * Delete the stored password for the service and account. + * + * @param service The string service name. + * @param account The string account name. + * + * @returns the string password or null on failures. + */ + export function deletePassword(service: string, account: string): string; + + /** + * Replace the password for the service and account in the keychain. + * + * This is a simple convenience function that internally calls deletePassword(service, account) + * followed by addPassword(service, account, password). + * + * @param service The string service name. + * @param account The string account name. + * @param password The string password. + * + * @returns true on success, false on failure. + */ + export function replacePassword(service: string, account: string, password: string): boolean; + + /** + * Find a password for the service in the keychain. + * + * @param service The string service name. + * + * @returns the string password or null on failures. + */ + export function findPassword(service: string): string; +} diff --git a/kii-cloud-sdk/kii-cloud-sdk-tests.ts b/kii-cloud-sdk/kii-cloud-sdk-tests.ts new file mode 100644 index 000000000..f92642538 --- /dev/null +++ b/kii-cloud-sdk/kii-cloud-sdk-tests.ts @@ -0,0 +1,49 @@ +/// + +function main() { + Kii.initializeWithSite("abc", "def", KiiSite.JP); + + var user = KiiUser.userWithUsername("name", "password"); + + user.register({ + success(user: KiiUser) { + }, + failure(user: KiiUser, message: string) { + } + }); + + user.register({ + success: (user: KiiUser) => 123, + failure: (user: KiiUser, message: string) => 456 + }); + + user.register() + .then(function (user: KiiUser) { + }); + + var bucket = Kii.bucketWithName("foo"); + var clause1 = KiiClause.lessThan("x", 1); + var clause2 = KiiClause.greaterThan("y", 1); + var clause3 = KiiClause.and(clause1, clause2); + var query = KiiQuery.queryWithClause(clause3); + + bucket.executeQuery(query, { + success: function (query: KiiQuery, + results: KiiObject[], + nextQuery: KiiQuery) { + }, + failure: function (bucket: KiiBucket, message: string) { + } + }); + + bucket.executeQuery(query) + .then(function (params: [KiiQuery, KiiObject[], KiiQuery]) { + var [query, results, nextQuery] = params; + }); + + var object = bucket.createObject(); + + object.set("foo", 1); + + object.save(); +} diff --git a/kii-cloud-sdk/kii-cloud-sdk.d.ts b/kii-cloud-sdk/kii-cloud-sdk.d.ts new file mode 100644 index 000000000..57c8f50b1 --- /dev/null +++ b/kii-cloud-sdk/kii-cloud-sdk.d.ts @@ -0,0 +1,7279 @@ +// Type definitions for Kii Cloud SDK v2.3.0 +// Project: http://en.kii.com/ +// Definitions by: Kii Consortium +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module KiiCloud { + enum KiiACLAction { + KiiACLBucketActionCreateObjects, + KiiACLBucketActionQueryObjects, + KiiACLBucketActionDropBucket, + KiiACLObjectActionRead, + KiiACLObjectActionWrite, + } + + export enum KiiSite { + US, + JP, + CN, + SG, + CN3 + } + + export enum KiiAnalyticsSite { + US, + JP, + CN, + SG, + CN3 + } + + enum KiiSocialNetworkName { + FACEBOOK = 1, + TWITTER = 2, + QQ = 3, + GOOGLEPLUS = 4, + RENREN = 5 + } + + type KiiSocialConnectOptions = { + access_token: string, + openID?: string + } | { + oauth_token: string, + oauth_token_secret: string + } + + interface KiiSocialAccountInfo { + createdAt: number; + provider: KiiSocialNetworkName; + socialAccountId: string; + } + + interface KiiThingFields { + /** + * thing identifier given by thing vendor. + */ + _vendorThingID: string; + + /** + * thing password given by thing vendor. + */ + _password: string; + + /** + * thing type given by thing vendor. + */ + _thingType?: string; + + /** + * vendor identifier given by thing vendor. + */ + _vendor?: string; + + /** + * firmware version given by thing vendor. + */ + _firmwareVersion?: string; + + /** + * lot identifier given by thing vendor. + */ + _lot?: string; + + /** + * arbitrary string field. + */ + _stringField1?: string; + + /** + * arbitrary string field. + */ + _stringField2?: string; + + /** + * arbitrary string field. + */ + _stringField3?: string; + + /** + * arbitrary string field. + */ + _stringField4?: string; + + /** + * arbitrary string field. + */ + _stringField5?: string; + + /** + * arbitrary number field. + */ + _numberField1?: number; + + /** + * arbitrary number field. + */ + _numberField2?: number; + + /** + * arbitrary number field. + */ + _numberField3?: number; + + /** + * arbitrary number field. + */ + _numberField4?: number; + + /** + * arbitrary number field. + */ + _numberField5?: number; + + /** + * custom fields. + */ + [name: string]: any; + } + + type KiiACLSubject = + KiiGroup | + KiiUser | + KiiAnyAuthenticatedUser | + KiiAnonymousUser | + KiiThing; + + interface APNSAlert { + title: string; + body: string; + "title-loc-key": string; + "title-loc-args": string[]; + "action-loc-key": string; + "loc-key": string; + "loc-args": string[]; + "launch-image": string; + } + + interface identityData { + emailAddress?: string; + phoneNumber?: string; + username?: string; + } + + /** + * The main SDK class + */ + export class Kii { + /** + * Kii SDK Build Number + * + * @return current build number of the SDK + */ + static getBuildNumber(): string; + + /** + * Kii SDK Version Number + * + * @return current version number of the SDK + */ + static getSDKVersion(): string; + + /** + * Retrieve the current app ID + * + * @return The current app ID + */ + static getAppID(): string; + + /** + * Retrieve the current app key + * + * @return The current app key + */ + static getAppKey(): string; + + /** + * Set the access token lifetime in seconds. + * + * If you don't call this method or call it with 0, token won't be expired. + * Call this method if you like the access token to be expired + * after a certain period. Once called, token retrieved + * by each future authentication will have the specified lifetime. + * Note that, it will not update the lifetime of token received prior + * calling this method. Once expired, you have to login again to renew the token. + * + * @param expiresIn The life time of access token in seconds. + * + * @throws If specified expiresIn is negative. + * @throws If Kii has not been initialized + * + * @example + * Kii.setAccessTokenExpiration(3600); + */ + static setAccessTokenExpiration(expiresIn: number): void; + + /** + * Returns access token lifetime in seconds. + * + * If access token lifetime has not set explicitly by {@link Kii.setAccessTokenExpiration(expiresIn)}, returns 0. + * + * @return access token lifetime in seconds. + * + * @throws If Kii has not been initialized + */ + static getAccessTokenExpiration(): number; + + /** + * Initialize the Kii SDK with a specific URL + * + * Should be the first Kii SDK action your application makes. + * + * @param appID The application ID found in your Kii developer console + * @param appKey The application key found in your Kii developer console + * @param site Can be one of the constants KiiSite.US, KiiSite.JP, KiiSite.CN or KiiSite.SG depending on your location. + * @param analyticsOption An object used for initializing KiiAnalytics, If not provided or invalid object provided, KiiAnalytics won't be initialized. If provided, it can be empty object or with analyticsOption.deviceId.
    If provided, but deviceId is not provided, SDK generates a new deviceId and use it when upload events. It can be retrieved by {@link KiiAnalytics.getDeviceId()}. It is recommended to retrieve the deviceId and store it to identify the device properly. + * + * @example + * // Disable KiiAnalytics + * Kii.initializeWithSite("my-app-id", "my-app-key", KiiSite.JP); + * + * // Enable KiiAnalytics with deviceId + * var analyticsOption = { deviceId: "my-device-id" }; + * Kii.initializeWithSite("my-app-id", "my-app-key", KiiSite.JP, analyticsOption); + * + * // Enable KiiAnalytics without deviceId + * Kii.initializeWithSite("my-app-id", "my-app-key", KiiSite.JP, {}); + */ + static initializeWithSite(appID: string, appKey: string, site: KiiSite, analyticsOption?: any): void; + + /** + * Initialize the Kii SDK + * + * Should be the first Kii SDK action your application makes. + * Meanwhile, Kii Analytics is initialized. + * + * @param appID The application ID found in your Kii developer console + * @param appKey The application key found in your Kii developer console + * @param analyticsOption An object used for initializing KiiAnalytics, If not provided or invalid object provided, KiiAnalytics won't be initialized. If provided, it can be empty object or with analyticsOption.deviceId.
    If provided, but deviceId is not provided, SDK generates a new deviceId and use it when upload events. It can be retrieved by {@link KiiAnalytics.getDeviceId()}. It is recommended to retrieve the deviceId and store it to identify the device properly. + * + * @example + * // Disable KiiAnalytics + * Kii.initialize("my-app-id", "my-app-key"); + * + * // Enable KiiAnalytics with deviceId + * var analyticsOption = { deviceId: "my-device-id" }; + * Kii.initialize("my-app-id", "my-app-key", analyticsOption); + * + * // Enable KiiAnalytics without deviceId + * Kii.initialize("my-app-id", "my-app-key", {}); + */ + static initialize(appID: string, appKey: string, analyticsOption?: any): void; + + /** + * Creates a reference to a bucket for this app + * + *

    The bucket will be created/accessed within this app's scope + * + * @param bucketName The name of the bucket the app should create/access + * + * @return A working KiiBucket object + * + * @example + * var bucket = Kii.bucketWithName("myBucket"); + */ + static bucketWithName(bucketName: string): KiiBucket; + + /** + * Creates a reference to a encrypted bucket for this app + * + *

    The bucket will be created/accessed within this app's scope + * + * @param bucketName The name of the bucket the app should create/access + * + * @return A working KiiEncryptedBucket object + * + * @example + * var bucket = Kii.encryptedBucketWithName("myBucket"); + */ + static encryptedBucketWithName(bucketName: string): KiiBucket; + + /** + * Creates a reference to a group with the given name + * + * @param groupName An application-specific group name + * + * @return A new KiiGroup reference + * + * @example + * var group = new Kii.groupWithName("myGroup"); + */ + static groupWithName(groupName: string): KiiGroup; + + /** + * Creates a reference to a group with the given name and a list of default members + * + * @param groupName An application-specific group name + * @param members An array of KiiUser objects to add to the group + * + * @return A new KiiGroup reference + * + * @example + * var group = new KiiGroup.groupWithName("myGroup", members); + */ + static groupWithNameAndMembers(groupName: string, members: KiiUser[]): KiiGroup; + + /** + * Authenticate as app admin. + *

    + * This api call must not placed on code which can be accessed by browser. + * This api is intended to be used by server side code like Node.js. + * If you use this api in code accessible by browser, your application id and application secret could be stolen. + * Attacker will be act as appadmin and all the data in your application will be suffered. + * + * + * @param clientId assigned to your application. + * @param clientSecret assigned to your application. + * @param callbacks The callback methods called when authentication succeeded/failed. + * + * @return return promise object. + *

      + *
    • fulfill callback function: function(adminContext). adminContext is a KiiAppAdminContext instance.
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.message
      • + *
      + *
    • + *
    + * + * @example + * // example to use callbacks directly + * Kii.authenticateAsAppAdmin("your client id", "your client secret", { + * success: function(adminContext) { + * // adminContext : KiiAppAdminContext instance + * // Operate entities with adminContext. + * }, + * failure: function(error, statusCode) { + * // Authentication failed. + * } + * ); + * + * // example to use Promise + * Kii.authenticateAsAppAdmin("your client id", "your client secret").then( + * function(adminContext) { // fulfill callback function + * // adminContext : KiiAppAdminContext instance + * // Operate entities with adminContext. + * + * }, + * function(error) { // reject callback function + * // Authentication failed. + * var errorString = error.message; + * } + * ); + */ + static authenticateAsAppAdmin(clientId: string, clientSecret: string, callbacks?: { success(adminContext: KiiAppAdminContext): any; failure(error: string, statusCode: number): any; }): Promise; + + /** + * Instantiate KiiServerCodeEntry with specified entry name. + * + * @param entryName Name of the entry. + * + * @return KiiServerCodeEntry instance. + * + * @throws Thrown when entryName is invalid in the following cases: + *
  • not type of string
  • + *
  • empty string
  • + *
  • invalid string. Valid entryName pattern is "[a-zA-Z][_a-zA-Z0-9]*$".
  • + * + * @example + * var entry = Kii.serverCodeEntry("main"); + */ + static serverCodeEntry(entryName: string): KiiServerCodeEntry; + + /** + * Instantiate serverCodeEntryWithVersion with specified entry name and version. + * + * @param entryName Name of the entry. + * @param version Version of the entry. + * + * @return KiiServerCodeEntry instance. + * + * @throws Thrown in the following cases:
    + *
  • entryName or version is not type of string
  • + *
  • entryName or version is empty string
  • + *
  • entryName is invalid string. Valid entryName pattern is "[a-zA-Z][_a-zA-Z0-9]*$".
  • + * + * @example + * var entry = Kii.serverCodeEntryWithVersion("main", "gulsdf6ful8jvf8uq6fe7vjy6"); + */ + static serverCodeEntryWithVersion(entryName: string, version: string): KiiServerCodeEntry; + + /** + * Instantiate topic belongs to application. + * + * @param topicName name of the topic. Must be a not empty string. + * + * @return topic instance. + */ + static topicWithName(topicName: string): KiiTopic; + + /** + * Gets a list of topics in app scope + * + * @param callbacks An object with callback methods defined + * @param paginationKey You can specify the pagination key with the nextPaginationKey passed by callbacks.success or fullfill callback of promise. If empty string or no string object is provided, this API regards no paginationKey specified. + * + * @return return promise object. + *
      + *
    • fulfill callback function: function(params). params is Array instance. + *
        + *
      • params[0] is array of KiiTopic instances.
      • + *
      • params[1] is string of nextPaginationKey.
      • + *
      + *
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.message
      • + *
      + *
    • + *
    + * + * @example + * // example to use callbacks directly + * Kii.listTopics({ + * success: function(topicList, nextPaginationKey) { + * // do something with the result + * for(var i=0; i<topicList.length; i++){ + * var topic = topicList[i]; + * } + * if (nextPaginationKey != null) { + * Kii.listTopics({ + * success: function(topicList, nextPaginationKey) {...}, + * failure: function(anErrorString) {...} + * }, nextPaginationKey); + * } + * }, + * failure: function(anErrorString) { + * // do something with the error response + * } + * }); + * + * // example to use promise + * Kii.listTopics().then( + * function(params) { + * var topicList = params[0]; + * var nextPaginationKey = params[1]; + * // do something with the result + * for(var i=0; i<topicList.length; i++){ + * var topic = topicList[i]; + * } + * if (nextPaginationKey != null) { + * Kii.listTopics(null, nextPaginationKey).then( + * function(params) {...}, + * function(error) {...} + * ); + * } + * }, + * function(error) { + * // do something with the error response + * } + * ); + */ + static listTopics(callbacks?: { success(topicList: KiiTopic[], nextPaginationKey: string): any; failure(anErrorString: string): any; }, paginationKey?: string): Promise<[KiiTopic[], string]>; + } + + /** + * Represents a KiiACL object + */ + export class KiiACL { + /** + * Get the list of active ACLs associated with this object from the server + * + * @param callbacks An object with callback methods defined + * + * @return return promise object. + *
      + *
    • fulfill callback function: function(params). params is Array instance. + *
        + *
      • params[0] is the KiiACL instance which this method was called on.
      • + *
      • params[1] is array of KiiACLEntry instances.
      • + *
      + *
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.target is the KiiACL instance which this method was called on.
      • + *
      • error.message
      • + *
      + *
    • + *
    + * + * @example + * // example to use callbacks directly + * var acl = . . .; // a KiiACL object + * acl.listACLEntries({ + * success: function(theACL, theEntries) { + * // do something + * }, + * + * failure: function(theACL, anErrorString) { + * // do something with the error response + * } + * }); + * + * // example to use Promise + * var acl = . . .; // a KiiACL object + * acl.listACLEntries().then( + * function(params) { // fulfill callback function + * var theACL = params[0]; + * var theEntries = params[1]; + * // do something + * }, + * function(error) { // reject callback function + * var theACL = error.target; + * var anErrorString = error.message; + * // do something with the error response + * }); + */ + listACLEntries(callbacks?: { success(theACL: KiiACL, theEntries: KiiACLEntry[]): any; failure(theACL: KiiACL, anErrorString: string): any; }): Promise<[KiiACL, KiiACLEntry[]]>; + + /** + * Add a KiiACLEntry to the local object, if not already present. This does not explicitly grant any permissions, which should be done through the KiiACLEntry itself. This method simply adds the entry to the local ACL object so it can be saved to the server. + * + * @param entry The KiiACLEntry to add + * + * @throws If specified entry is not an instance of KiiACLEntry. + * + * @example + * var aclEntry = . . .; // a KiiACLEntry object + * var acl = . . .; // a KiiACL object + * acl.putACLEntry(aclEntry); + */ + putACLEntry(entry: KiiACLEntry): void; + + /** + * Remove a KiiACLEntry to the local object. This does not explicitly revoke any permissions, which should be done through the KiiACLEntry itself. This method simply removes the entry from the local ACL object and will not be saved to the server. + * + * @param entry The KiiACLEntry to remove + * + * @throws If specified entry is not an instance of KiiACLEntry. + * + * @example + * var aclEntry = . . .; // a KiiACLEntry object + * var acl = . . .; // a KiiACL object + * acl.removeACLEntry(aclEntry); + */ + removeACLEntry(entry: KiiACLEntry): void; + + /** + * Save the list of ACLEntry objects associated with this ACL object to the server + * + * @param callbacks An object with callback methods defined + * + * @return return promise object. + *
      + *
    • fulfill callback function: function(theSavedACL). theSavedACL is KiiACL instance.
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.target is the KiiACL instance which this method was called on.
      • + *
      • error.message
      • + *
      + *
    • + *
    + * + * @example + * // example to use callbacks directly + * var acl = . . .; // a KiiACL object + * acl.save({ + * success: function(theSavedACL) { + * // do something with the saved acl + * }, + * + * failure: function(theACL, anErrorString) { + * // do something with the error response + * } + * }); + * + * // example to use Promise + * var acl = . . .; // a KiiACL object + * acl.save().then( + * function(theSavedACL) { // fulfill callback function + * // do something with the saved acl + * }, + * function(error) { // reject callback function + * var theACL = error.target; + * var anErrorString = error.message; + * // do something with the error response + * }); + */ + save(callbacks?: { success(theSavedACL: KiiACL): any; failure(theACL: KiiACL, anErrorString: string): any; }): Promise; + } + + /** + * Represents a KiiACLEntry object + */ + export class KiiACLEntry { + /** + * The action that is being permitted/restricted. Possible values: + *

    + * KiiACLAction.KiiACLBucketActionCreateObjects,
    + * KiiACLAction.KiiACLBucketActionQueryObjects,
    + * KiiACLAction.KiiACLBucketActionDropBucket,
    + * KiiACLAction.KiiACLObjectActionRead,
    + * KiiACLAction.KiiACLObjectActionWrite,
    + * KiiACLAction.KiiACLSubscribeToTopic,
    + * KiiACLAction.KiiACLSendMessageToTopic + * + * @param value The action being permitted/restricted + * + * @throws If the value is not one of the permitted values + */ + setAction(value: KiiACLAction): void; + + /** + * Get the action that is being permitted/restricted in this entry + * + * @return + */ + getAction(): KiiACLAction; + + /** + * Set the subject to which the action/grant is being applied + * + * @param subject instance. + * + * @throws If the value is not one of the permitted values + */ + setSubject(subject: KiiACLSubject): void; + + /** + * Get the subject that is being permitted/restricted in this entry + * + * @return + */ + getSubject(): T; + + /** + * Set whether or not the action is being permitted to the subject + * + * @param value true if the action is permitted, false otherwise + * + * @throws If the value is not a boolean type + */ + setGrant(value: boolean): void; + + /** + * Get whether or not the action is being permitted to the subject + * + * @return + */ + getGrant(): boolean; + + /** + * Create a KiiACLEntry object with a subject and action + * + * The entry will not be applied on the server until the KiiACL object is + * explicitly saved. This method simply returns a working KiiACLEntry with + * a specified subject and action. + * + * @param Subject to which the action/grant is being applied + * @param action One of the specified KiiACLAction values the + * permissions is being applied to + * + * @return A KiiACLEntry object with the specified attributes + * + * @throws If specified subject is invalid. + * @throws If the specified action is invalid. + */ + static entryWithSubject(Subject: KiiACLSubject, action: KiiACLAction): KiiACLEntry; + } + + /** + * The main SDK class + */ + export class KiiAnalytics { + /** + * Retrieve the current app ID + * + * @return The current app ID + */ + static getAppID(): string; + + /** + * Retrieve the current app key + * + * @return The current app key + */ + static getAppKey(): string; + + /** + * Get the deviceId. If deviceId has not specified while initialization, it returns SDK generated deviceId.It is recommended to retrieve the deviceId and store it to identify the device properly. + * + * @return deviceId. + */ + static getDeviceId(): string; + + /** + * Is the SDK printing logs to the console? + * + * @return True if printing logs, false otherwise + */ + static isLogging(): boolean; + + /** + * Set the logging status of the SDK + * + * Helpful for development - we strongly advice you turn off logging for any production code. + * + * @param True if logs should be printed, false otherwise + * + * @example + * KiiAnalytics.setLogging(true); + */ + static setLogging(True: boolean): void; + + /** + * + * + * @deprecated Use {@link Kii.initializeWithSite} instead. Initialize the Kii SDK with a specific URL + * + * Should be the first Kii SDK action your application makes + * + * @param appID The application ID found in your Kii developer console + * @param appKey The application key found in your Kii developer console + * @param site Can be one of the constants KiiAnalyticsSite.US, KiiAnalyticsSite.JP, KiiAnalyticsSite.CN, KiiAnalyticsSite.CN3 or KiiAnalyticsSite.SG depending on your location. + * @param deviceid If deviceId is not provided, SDK generates a new deviceId and use it when upload events.deviceId can be retrieved by {@link KiiAnalytics.getDeviceId()}.It is recommended to retrieve the deviceId and store it to identify the device properly. + * + * @example + * // initialize without deviceId + * Kii.initializeWithSite("my-app-id", "my-app-key", KiiAnalyticsSite.JP); + * // initialize with deviceId + * Kii.initializeWithSite("my-app-id", "my-app-key", KiiAnalyticsSite.JP, "my-device-id"); + */ + static initializeWithSite(appID: string, appKey: string, site: KiiAnalyticsSite, deviceid: string): void; + + /** + * + * + * @deprecated Use {@link Kii.initialize} instead. Initialize the KiiAnalytics SDK + * + * Should be the first KiiAnalytics SDK action your application makes + * + * @param appID The application ID found in your Kii developer console + * @param appKey The application key found in your Kii developer console + * @param deviceid If deviceId is not provided, SDK generates a new deviceId and use it when upload events. deviceId can be retrieved by {@link KiiAnalytics.getDeviceId()}.It is recommended to retrieve the deviceId and store it to identify the device properly. + * + * @example + * // initialize without deviceId + * Kii.initializeWithSite("my-app-id", "my-app-key", KiiAnalyticsSite.JP); + * // initialize with deviceId + * Kii.initializeWithSite("my-app-id", "my-app-key", KiiAnalyticsSite.JP, "my-device-id"); + */ + static initialize(appID: string, appKey: string, deviceid: string): void; + + /** + * Utilize the KiiAnalytics logger to track SDK-specific actions + * + * Helpful for development - we strongly advice you turn off logging for any production code. + * + * @param message The message to print to console.log in your browser + * + * @example + * KiiAnalytics.logger("My message"); + */ + static logger(message: string): void; + + /** + * Log a single event to be uploaded to KiiAnalytics + * + * Use this method if you'd like to track an event by name only. If you'd like to track other attributes/dimensions, please use KiiAnalytics.trackEventWithExtras(eventName, parameters) + * + * @param eventName A string representing the event name for later tracking + * + * @return return promise object. + *
      + *
    • fulfill callback function: function(). No parameters.
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.message
      • + *
      + *
    • + *
    + */ + static trackEvent(eventName: string): Promise; + + /** + * Log a single event to be uploaded to KiiAnalytics + * + * Use this method if you'd like to track an event by name and add extra information to the event. + * + * @param eventName A string representing the event name for later tracking + * @param extras A dictionary of JSON-encodable key/value pairs to be attached to the event. + * Key must follow the pattern "^[a-zA-Z][a-zA-Z0-9_]{0,63}$".Supported value type is string, number, boolean and array. + * Empty string or empty array will be considered as invalid.Type of array elements must be string, number or boolean. + * If any key/value pair is invalid, it will be ignored and not sent to the KiiCloud. + * + * @return return promise object. + *
      + *
    • fulfill callback function: function(). No parameters.
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.message
      • + *
      + *
    • + *
    + */ + static trackEventWithExtras(eventName: string, extras: any): Promise; + + /** + * Log a single event to be uploaded to KiiAnalytics + * + * Use this method if you'd like to track an event asynchronously by name and add extra information to the event. + * + * @param eventName A string representing the event name for later tracking + * @param extras A dictionary of JSON-encodable key/value pairs to be attached to the event. + * Key must follow the pattern "^[a-zA-Z][a-zA-Z0-9_]{0,63}$".Supported value type is string, number, boolean and array. + * Empty string or empty array will be considered as invalid.Type of array elements must be string, number or boolean. + * If any key/value pair is invalid, it will be ignored and not sent to the KiiCloud. + * @param callbacks An object with callback methods defined + * + * @return return promise object. + *
      + *
    • fulfill callback function: function(). No parameters.
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.message
      • + *
      + *
    • + *
    + */ + static trackEventWithExtrasAndCallbacks(eventName: string, extras: any, callbacks?: { success(): any; failure(error: Error): any; }): Promise; + + /** + * + * + * @deprecated Set a custom API endpoint URL + * + * @param url A string containing the desired endpoint + */ + static setBaseURL(url: string): void; + + /** + * + * + * @deprecated Use {@link Kii.getSDKVersion} instead. Kii Analytics SDK Version Number + * + * @return current version number of the SDK + */ + static getSDKVersion(): string; + } + + /** + * Represent an anonymous user for setting the ACL of an object. This will include anyone using the application but have not signed up or authenticated as registered user. + * + * When retrieving ACL from an object, test for this class to determine the subject type. + */ + export class KiiAnonymousUser { + /** + * Returns the ID of Anonymous user. + */ + getID(): string; + } + + /** + * Represent any authenticated user for setting the ACL of an object. This will include anyone using the application who has registered and authenticated in the current session. + * + * When retrieving ACL from an object, test for this class to determine the subject type. Example: + */ + export class KiiAnyAuthenticatedUser { + /** + * Returns the ID of AuthenticatedUser user. + */ + getID(): string; + } + + /** + * represents the app admin context + *

    + * This class must not referred from code accessible from browser. + * This class is intended to be used by server side code like Node.js. + * If you use this class in code accessible by browser, your application client id and client secret could be stolen. + * Attacker will be act as application admin and all the data in your application will be suffered. + * + * Application administrator context. Entities obtained from this class will be manipulated by application admin. + */ + export class KiiAppAdminContext { + /** + * Creates a reference to a bucket operated by app admin. + *

    The bucket will be created/accessed within this app's scope + * + * @param bucketName The name of the bucket the app should create/access + * + * @return A working KiiBucket object + * + * @example + * Kii.authenticateAsAppAdmin("client-id", "client-secret", { + * success: function(adminContext) { + * var bucket = adminContext.bucketWithName("myBucket"); + * // KiiBucket operation by app admin is available now. + * }, + * failure: function(errorString, errorCode) { + * // auth failed. + * } + * }); + */ + bucketWithName(bucketName: string): KiiBucket; + + /** + * Creates a reference to a encrypted bucket operated by app admin. + *

    The bucket will be created/accessed within this app's scope + * + * @param bucketName The name of the bucket the app should create/access + * + * @return A working KiiBucket object + * + * @example + * Kii.authenticateAsAppAdmin("client-id", "client-secret", { + * success: function(adminContext) { + * var bucket = adminContext.encryptedBucketWithName("myBucket"); + * // KiiBucket operation by app admin is available now. + * }, + * failure: function(errorString, errorCode) { + * // auth failed. + * } + * }); + */ + encryptedBucketWithName(bucketName: string): KiiBucket; + + /** + * Creates a reference to a group operated by app admin. + *

    + * Note: + * Returned instance from this API can not operate existing KiiGroup.
    + * If you want to operate existing KiiGroup, please use {@link KiiAppAdminContext#groupWithURI} or {@link KiiAppAdminContext#groupWithID}. + * + * @param group name. + * + * @return A working KiiGroup object + * + * @example + * Kii.authenticateAsAppAdmin("client-id", "client-secret", { + * success: function(adminContext) { + * var group = adminContext.groupWithName("newGroup"); + * // KiiGroup operation by app admin is available now. + * }, + * failure: function(errorString, errorCode) { + * // auth failed. + * } + * }); + */ + groupWithName(group: string): KiiGroup; + + /** + * Creates a reference to a user operated by app admin. + * + * @param user id. + * + * @return A working KiiUser object + * + * @example + * Kii.authenticateAsAppAdmin("client-id", "client-secret", { + * success: function(adminContext) { + * var user = adminContext.userWithID("userid"); + * // KiiUser operation by app admin is available now. + * }, + * failure: function(errorString, errorCode) { + * // auth failed. + * } + * }); + */ + userWithID(user: string): KiiUser; + + /** + * Creates a reference to an object operated by app admin using object`s URI. + * + * @param object URI. + * + * @return A working KiiObject instance + * + * @throws If the URI is null, empty or does not have correct format. + */ + objectWithURI(object: string): KiiObject; + + /** + * Creates a reference to a group operated by app admin using group's ID. + *

    + * Note: + * Returned instance from this API can operate existing KiiGroup.
    + * If you want to create a new KiiGroup, please use {@link KiiAppAdminContext#groupWithName}. + * + * @param group ID. + * + * @return A working KiiGroup object + * + * @throws Thrown if passed groupID is null or empty. + * + * @example + * Kii.authenticateAsAppAdmin("client-id", "client-secret", { + * success: function(adminContext) { + * var groupID = "0123456789abcdefghijklmno"; + * var group = adminContext.groupWithID(groupID); + * // KiiGroup operation by app admin is available now. + * }, + * failure: function(errorString, errorCode) { + * // auth failed. + * } + * }); + */ + groupWithID(group: string): KiiGroup; + + /** + * Creates a reference to a group operated by app admin using group's URI. + *

    + * Note: + * Returned instance from this API can operate existing KiiGroup.
    + * If you want to create a new KiiGroup, please use {@link KiiAppAdminContext#groupWithName}. + * + * @param group URI. + * + * @return A working KiiGroup object + * + * @throws Thrown if the URI is null, empty or does not have correct format. + * + * @example + * Kii.authenticateAsAppAdmin("client-id", "client-secret", { + * success: function(adminContext) { + * var groupUri = ...; // KiiGroup's URI + * var group = adminContext.groupWithURI(groupUri); + * // KiiGroup operation by app admin is available now. + * }, + * failure: function(errorString, errorCode) { + * // auth failed. + * } + * }); + */ + groupWithURI(group: string): KiiGroup; + + /** + * Find registered KiiUser with the email.
    + * If there are no user registers with the specified email or if there are but not verified email yet, + * callbacks.failure or reject callback of promise will be called.
    + * If the email is null or empty, callbacks.failure or reject callback of promise will be callded. + *

    + * Note: + *
      + *
    • If "Expose Full User Data To Others" is enabled in the application console, the response will contain full of the user data.
    • + *
    • Otherwise, the response will only contain "userID", "loginName" and "displayName" field values if exist.
    • + *
    + * + * @param email The email to find KiiUser who owns it.
    + * Don't add prefix of "EMAIL:" described in REST API documentation. SDK will take care of it. + * @param callbacks An object with callback methods defined. + * This argument is mandatory and can't be omitted. + * + * @return return promise object. + *
      + *
    • fulfill callback function: function(params). params is Array instance. + *
        + *
      • params[0] is a KiiAppAdminContext instance which this method was called on.
      • + *
      • params[1] is a found KiiUser instance.
      • + *
      + *
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.target is a KiiAppAdminContext instance which this method was called on.
      • + *
      • error.message
      • + *
      + *
    • + *
    + * + * @example + * // example to use callbacks directly + * Kii.authenticateAsAppAdmin("client-id", "client-secret", { + * success: function(adminContext) { + * adminContext.findUserByEmail("user_to_find@example.com", { + * success: function(adminContext, theMatchedUser) { + * // Do something with the found user + * }, + * failure: function(adminContext, anErrorString) { + * // Do something with the error response + * } + * }); + * }, + * failure: function(errorString, errorCode) { + * // Auth failed. + * } + * }); + * + * // example to use Promise + * Kii.authenticateAsAppAdmin("client-id", "client-secret").then( + * function(adminContext) { + * adminContext.findUserByEmail("user_to_find@example.com").then( + * function(params) { // fullfill callback function + * var adminContext = params[0]; + * var theMatchedUser = params[1]; + * // Do something with the found user + * }, + * function(error) { // reject callback function + * var adminContext = error.target; + * var anErrorString = error.message; + * // Do something with the error response + * } + * ); + * }, + * function(error) { + * // Auth failed. + * } + * ); + */ + findUserByEmail(email: string, callbacks?: { success(adminContext: KiiAppAdminContext, theMatchedUser: KiiUser): any; failure(adminContext: KiiAppAdminContext, anErrorString: string): any; }): Promise<[KiiAppAdminContext, KiiUser]>; + + /** + * Find registered KiiUser with the phone.
    + * If there are no user registers with the specified phone or if there are but not verified phone yet, + * callbacks.failure or reject callback of promise will be called.
    + * If the phone is null or empty, callbacks.failure or reject callback of promise will be called. + *

    + * Note: + *
      + *
    • If "Expose Full User Data To Others" is enabled in the application console, the response will contain full of the user data.
    • + *
    • Otherwise, the response will only contain "userID", "loginName" and "displayName" field values if exist.
    • + *
    + * + * @param phone The phone number to find KiiUser who owns it.
    + * Don't add prefix of "PHONE:" described in REST API documentation. SDK will take care of it. + * @param callbacks An object with callback methods defined. + * This argument is mandatory and can't be omitted. + * + * @return return promise object. + *
      + *
    • fulfill callback function: function(params). params is Array instance. + *
        + *
      • params[0] is a KiiAppAdminContext instance which this method was called on.
      • + *
      • params[1] is a found KiiUser instance.
      • + *
      + *
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.target is a KiiAppAdminContext instance which this method was called on.
      • + *
      • error.message
      • + *
      + *
    • + *
    + * + * @example + * // example to use callbacks directly + * Kii.authenticateAsAppAdmin("client-id", "client-secret", { + * success: function(adminContext) { + * adminContext.findUserByPhone("phone_number_to_find", { + * success: function(adminContext, theMatchedUser) { + * // Do something with the found user + * }, + * failure: function(adminContext, anErrorString) { + * // Do something with the error response + * } + * }); + * }, + * failure: function(errorString, errorCode) { + * // Auth failed. + * } + * }); + * + * // example to use Promise + * Kii.authenticateAsAppAdmin("client-id", "client-secret").then( + * function(adminContext) { + * adminContext.findUserByPhone("phone_number_to_find").then( + * function(params) { // fullfill callback function + * var adminContext = params[0]; + * var theMatchedUser = params[1]; + * // Do something with the found user + * }, + * function(error) { // reject callback function + * var adminContext = error.target; + * var anErrorString = error.message; + * // Do something with the error response + * } + * ); + * }, + * function(error) { + * // Auth failed. + * } + * ); + */ + findUserByPhone(phone: string, callbacks?: { success(adminContext: KiiAppAdminContext, theMatchedUser: KiiUser): any; failure(adminContext: KiiAppAdminContext, anErrorString: string): any; }): Promise<[KiiAppAdminContext, KiiUser]>; + + /** + * Find registered KiiUser with the user name.
    + * If there are no user registers with the specified user name, callbacks.failure or reject callback of promise will be called.
    + * If the user name is null or empty, callbacks.failure or reject callback of promise will be called. + *

    + * Note: + *
      + *
    • If "Expose Full User Data To Others" is enabled in the application console, the response will contain full of the user data.
    • + *
    • Otherwise, the response will only contain "userID", "loginName" and "displayName" field values if exist.
    • + *
    + * + * @param username The user name to find KiiUser who owns it.
    + * Don't add prefix of "LOGIN_NAME:" described in REST API documentation. SDK will take care of it. + * @param callbacks An object with callback methods defined. + * This argument is mandatory and can't be omitted. + * + * @return return promise object. + *
      + *
    • fulfill callback function: function(params). params is Array instance. + *
        + *
      • params[0] is a KiiAppAdminContext instance which this method was called on.
      • + *
      • params[1] is a found KiiUser instance.
      • + *
      + *
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.target is a KiiAppAdminContext instance which this method was called on.
      • + *
      • error.message
      • + *
      + *
    • + *
    + * + * @example + * // example to use callbacks directly + * Kii.authenticateAsAppAdmin("client-id", "client-secret", { + * success: function(adminContext) { + * adminContext.findUserByUsername("user_name_to_find", { + * success: function(adminContext, theMatchedUser) { + * // Do something with the found user + * }, + * failure: function(adminContext, anErrorString) { + * // Do something with the error response + * } + * }); + * }, + * failure: function(errorString, errorCode) { + * // Auth failed. + * } + * }); + * // example to use Promise + * Kii.authenticateAsAppAdmin("client-id", "client-secret").then( + * function(adminContext) { + * adminContext.findUserByUsername("user_name_to_find").then( + * function(params) { // fullfill callback function + * var adminContext = params[0]; + * var theMatchedUser = params[1]; + * // Do something with the found user + * }, + * function(error) { // reject callback function + * var adminContext = error.target; + * var anErrorString = error.message; + * // Do something with the error response + * } + * ); + * }, + * function(error) { + * // Auth failed. + * } + * ); + */ + findUserByUsername(username: string, callbacks?: { success(adminContext: KiiAppAdminContext, theMatchedUser: KiiUser): any; failure(adminContext: KiiAppAdminContext, anErrorString: string): any; }): Promise<[KiiAppAdminContext, KiiUser]>; + + /** + * Register thing by app admin. + * Method interface is same as {@link KiiThing#register()}. + * Please refer to KiiThing document for details. + * + * @param fields of the thing to be registered. Please refer to {@link KiiThing#register()} for the details of fields. + * @param callbacks object holds callback functions. + * + * @return return promise object. + *
      + *
    • fulfill callback function: function(thing). thing is KiiThing instance with adminToken.
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.message
      • + *
      + *
    • + *
    + * + * @example + * // example to use callbacks directly + * // Assume you already have adminContext instance. + * adminContext.registerThing( + * { + * _vendorThingID: "thing-XXXX-YYYY-ZZZZZ", + * _password: "thing-password", + * _thingType: "thermometer", + * yourCustomObj: // Arbitrary key can be used. + * { // Object, Array, Number, String can be used. Should be compatible with JSON. + * yourCustomKey1: "value", + * yourCustomKey2: 100 + * } + * }, + * { + * success: function(thing) { + * // Register Thing succeeded. + * // Operation using thing instance in the parameter + * // is authored by app admin. + * }, + * failure: function(error) { + * // Handle error. + * } + * } + * ); + * + * // example to use Promise + * // Assume you already have adminContext instance. + * adminContext.registerThing( + * { + * _vendorThingID: "thing-XXXX-YYYY-ZZZZZ", + * _password: "thing-password", + * _thingType: "thermometer", + * yourCustomObj: // Arbitrary key can be used. + * { // Object, Array, Number, String can be used. Should be compatible with JSON. + * yourCustomKey1: "value", + * yourCustomKey2: 100 + * } + * } + * ).then( + * function(thing) { + * // Register Thing succeeded. + * // Operation using thing instance in the parameter + * // is authored by app admin. + * }, + * function(error) { + * // Handle error. + * } + * ); + */ + registerThing(fields: KiiThingFields, callbacks?: { success(thing: KiiThing): any; failure(error: Error): any; }): Promise; + + /** + * Creates a reference to a thing operated by app admin. + * + * @param thing id. + * + * @return A working KiiThing object + * + * @example + * // Assume you already have adminContext instance. + * adminContext.thingWithID(thingID); + */ + thingWithID(thing: string): KiiThing; + + /** + * Register user/group as owner of specified thing by app admin. + * + * @param thingID The ID of thing + * @param owner to be registered as owner. + * @param callbacks object holds callback functions. + * + * @return return promise object. + *
      + *
    • fulfill callback function: function(params). params is an Array instance. + *
        + *
      • params[0] is a KiiUser/KiiGroup instance.
      • + *
      + *
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.message
      • + *
      + *
    • + *
    + * + * @example + * // example to use callbacks directly + * // assume thing/group is already registered. + * var group = KiiGroup.groupWithURI("kiicloud://groups/xxxyyyy"); + * // example to use Promise + * // Assume you already have adminContext instance. + * adminContext.registerOwnerWithThingID("th.xxxx-yyyy-zzzz", group, { + * success: function(group) { + * // Register owner succeeded. + * }, + * failure: function(error) { + * // Handle error. + * } + * }); + * + * // example to use Promise + * // assume thing/group is already registered. + * var group = KiiGroup.groupWithURI("kiicloud://groups/xxxyyyy"); + * // example to use Promise + * // Assume you already have adminContext instance. + * adminContext.registerOwnerWithThingID("th.xxxx-yyyy-zzzz", group).then( + * function(params) { + * // Register owner succeeded. + * var group = params[0]; + * }, + * function(error) { + * // Handle error. + * } + * ); + */ + registerOwnerWithThingID(thingID: string, owner: T, callbacks?: { success(group: T): any; failure(error: Error): any; }): Promise; + + /** + * Register user/group as owner of specified thing by app admin. + * + * @param vendorThingID The vendor thing ID of thing + * @param owner to be registered as owner. + * @param callbacks object holds callback functions. + * + * @return return promise object. + *
      + *
    • fulfill callback function: function(params). params is an Array instance. + *
        + *
      • params[0] is a KiiUser/KiiGroup instance.
      • + *
      + *
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.message
      • + *
      + *
    • + *
    + * + * @example + * // example to use callbacks directly + * // assume thing/group is already registered. + * var group = KiiGroup.groupWithURI("kiicloud://groups/xxxyyyy"); + * // example to use Promise + * // Assume you already have adminContext instance. + * adminContext.registerOwnerWithVendorThingID("xxxx-yyyy-zzzz", group, { + * success: function(group) { + * // Register owner succeeded. + * }, + * failure: function(error) { + * // Handle error. + * } + * }); + * + * // example to use Promise + * // assume thing/group is already registered. + * var group = KiiGroup.groupWithURI("kiicloud://groups/xxxyyyy"); + * // example to use Promise + * // Assume you already have adminContext instance. + * adminContext.registerOwnerWithVendorThingID("xxxx-yyyy-zzzz", group).then( + * function(group) { + * // Register owner succeeded. + * }, + * function(error) { + * // Handle error. + * } + * ); + */ + registerOwnerWithVendorThingID(vendorThingID: string, owner: T, callbacks?: { success(group: T): any; failure(error: Error): any; }): Promise; + + /** + * Load thing with vendor thing ID by app admin. + * Method interface is same as {@link KiiThing#loadWithVendorThingID()}. + * Please refer to KiiThing document for details. + * + * @param vendorThingID registered vendor thing id. + * @param callbacks object holds callback functions. + * + * @return return promise object. + *
      + *
    • fulfill callback function: function(thing). thing is KiiThing instance with adminToken.
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.message
      • + *
      + *
    • + *
    + * + * @example + * // example to use callbacks directly + * // Assume you already have adminContext instance. + * adminContext.loadThingWithVendorThingID("thing-xxxx-yyyy",{ + * success: function(thing) { + * // Load succeeded. + * // Operation using thing instance in the parameter + * // is authored by app admin. + * }, + * failure: function(error) { + * // Handle error. + * } + * }); + * + * // example to use Promise + * // Assume you already have adminContext instance. + * adminContext.loadThingWithVendorThingID("thing-xxxx-yyyy").then( + * function(thing) { + * // Load succeeded. + * // Operation using thing instance in the parameter + * // is authored by app admin. + * }, + * function(error) { + * // Handle error. + * } + * ); + */ + loadThingWithVendorThingID(vendorThingID: string, callbacks?: { success(thing: KiiThing): any; failure(error: Error): any; }): Promise; + + /** + * Load thing with thing ID by app admin. + * Method interface is same as {@link KiiThing#loadWithThingID()}. + * Please refer to KiiThing document for details. + * + * @param thingID registered thing id. + * @param callbacks object holds callback functions. + * + * @return return promise object. + *
      + *
    • fulfill callback function: function(thing). thing is KiiThing instance with adminToken.
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.message
      • + *
      + *
    • + *
    + * + * @example + * // example to use callbacks directly + * // Assume you already have adminContext instance. + * adminContext.loadThingWithThingID("thing-xxxx-yyyy",{ + * success: function(thing) { + * // Load succeeded. + * // Operation using thing instance in the parameter + * // is authored by app admin. + * }, + * failure: function(error) { + * // Handle error. + * } + * }); + * + * // example to use Promise + * // Assume you already have adminContext instance. + * adminContext.loadThingWithThingID("thing-xxxx-yyyy").then( + * function(thing) { + * // Load succeeded. + * // Operation using thing instance in the parameter + * // is authored by app admin. + * }, + * function(error) { + * // Handle error. + * } + * ); + */ + loadThingWithThingID(thingID: string, callbacks?: { success(thing: KiiThing): any; failure(error: Error): any; }): Promise; + + /** + * Creates a reference to a topic operated by app admin + * + * @param topicName name of the topic. Must be a not empty string. + * + * @return topic instance. + */ + topicWithName(topicName: string): KiiTopic; + + /** + * Gets a list of topics in app scope + * + * @param callbacks An object with callback methods defined + * @param paginationKey You can specify the pagination key with the nextPaginationKey passed by callbacks.success. If empty string or no string object is provided, this API regards no paginationKey specified. + * + * @return return promise object. + *
      + *
    • fulfill callback function: function(params). params is Array instance. + *
        + *
      • params[0] is array of KiiTopic instances.
      • + *
      • params[1] is string of nextPaginationKey.
      • + *
      + *
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.target is a KiiAppAdminContext instance which this method was called on.
      • + *
      • error.message
      • + *
      + *
    • + *
    + * + * @example + * // example to use callbacks directly + * // Assume you already have adminContext instance. + * adminContext.listTopics({ + * success: function(topicList, nextPaginationKey) { + * // do something with the result + * for(var i=0; i<topicList.length; i++){ + * var topic = topicList[i]; + * } + * if (nextPaginationKey != null) { + * Kii.listTopics({ + * success: function(topicList, nextPaginationKey) {...}, + * failure: function(anErrorString) {...} + * }, nextPaginationKey); + * } + * }, + * failure: function(anErrorString) { + * // do something with the error response + * } + * }); + * + * // example to use Promise + * // Assume you already have adminContext instance. + * adminContext.listTopics().then( + * function(params) { + * var topicList = params[0]; + * var nextPaginationKey = params[1]; + * // do something with the result + * for(var i=0; i<topicList.length; i++){ + * var topic = topicList[i]; + * } + * if (nextPaginationKey != null) { + * adminContext.listTopics(null, nextPaginationKey).then( + * function(params) {...}, + * function(error) {...} + * ); + * } + * }, + * function(error) { + * // do something with the error response + * } + * ); + */ + listTopics(callbacks?: { success(topicList: KiiTopic[], nextPaginationKey: string): any; failure(anErrorString: string): any; }, paginationKey?: string): Promise<[KiiTopic[], string]>; + } + + /** + * Represents a KiiBucket object + */ + export class KiiBucket { + /** + * The name of this bucket + * + * @return + */ + getBucketName(): string; + + /** + * Create a KiiObject within the current bucket + * + *

    The object will not be created on the server until the KiiObject is explicitly saved. This method simply returns an empty working KiiObject. + * + * @return An empty KiiObject with no specific type + * + * @example + * var bucket = . . .; // a KiiBucket + * var object = bucket.createObject(); + */ + createObject(): KiiObject; + + /** + * Create a KiiObject within the current bucket, with type + * + *

    The object will not be created on the server until the KiiObject is explicitly saved. This method simply returns an empty working KiiObject with a specified type. The type allows for better indexing and improved query results. It is recommended to use this method - but for lazy creation, the createObject method is also available. + * + * @param type A string representing the desired object type + * + * @return An empty KiiObject with specified type + * + * @example + * var bucket = . . .; // a KiiBucket + * var object = bucket.createObjectWithType("scores"); + */ + createObjectWithType(type: string): KiiObject; + + /** + * Create a KiiObject within the current bucket, specifying its ID. + * + *

    If the object has not exist on KiiCloud, {@link KiiObject#saveAllFields(callback)} + * will create new Object which has ID specified in the argument. + * If the object exist in KiiCloud, references the existing object which has + * specified ID. use {@link KiiObject#refresh(callback)} to retrieve the contents of + * KiiObject. + * + * @param objectID ID of the obeject you want to instantiate. + * + * @return KiiObject instance. + * + * @throws objectID is not acceptable. + * Refer to {@link KiiObject.isValidObjectID(string)} for details of acceptable string. + * + * @example + * var bucket = . . .; // KiiBucket + * var object = bucket.createObjectWithID('__OBJECT_ID_'); + */ + createObjectWithID(objectID: string): KiiObject; + + /** + * Get the ACL handle for this bucket + * + *

    Any KiiACLEntry objects added or revoked from this ACL object will be appended to/removed from the server on ACL save. + * + * @return A KiiACL object associated with this KiiObject + * + * @example + * var bucket = . . .; // a KiiBucket + * var acl = bucket.acl(); + */ + acl(): KiiACL; + + /** + * Perform a query on the given bucket + * + *

    The query will be executed against the server, returning a result set. + * + * @param query An object with callback methods defined + * @param callbacks An object with callback methods defined + * + * @return return promise object. + *
      + *
    • fulfill callback function: function(params). params is Array instance. + *
        + *
      • params[0] is a performed KiiQuery instance.
      • + *
      • params[1] is resultSet Array instance. Could be KiiObject, KiiGroup, KiiUser, etc.
      • + *
      • params[2] is a KiiQuery instance for next query. If there are no more results to be retrieved, it will be null.
      • + *
      + *
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.target is the KiiBucket instance which this method was called on.
      • + *
      • error.message
      • + *
      + *
    • + *
    + * + * @example + * // example to use callbacks directly + * var bucket = . . .; // a KiiBucket + * var queryObject = . . .; // a KiiQuery + * + * // define the callbacks (stored in a variable for reusability) + * var queryCallbacks = { + * success: function(queryPerformed, resultSet, nextQuery) { + * // do something with the results + * for(var i=0; i<resultSet.length; i++) { + * // do something with the object + * // resultSet[i]; // could be KiiObject, KiiGroup, KiiUser, etc + * } + * + * // if there are more results to be retrieved + * if(nextQuery != null) { + * + * // get them and repeat recursively until no results remain + * bucket.executeQuery(nextQuery, queryCallbacks); + * } + * }, + * + * failure: function(bucket, anErrorString) { + * // do something with the error response + * } + * }; + * bucket.executeQuery(queryObject, queryCallbacks); + * + * // example to use Promise + * var bucket = . . .; // a KiiBucket + * var queryObject = . . .; // a KiiQuery + * bucket.executeQuery(queryObject).then( + * function(params) { + * var queryPerformed = params[0]; + * var resultSet = params[1]; + * var nextQuery = params[2]; + * // do something with the results + * for(var i=0; i<resultSet.length; i++) { + * // do something with the object + * // resultSet[i]; // could be KiiObject, KiiGroup, KiiUser, etc + * } + * + * // if there are more results to be retrieved + * if(nextQuery != null) { + * + * // get them and repeat recursively until no results remain + * bucket.executeQuery(nextQuery).then( + * function(params) { + * // next query success + * }, + * function(error) { + * // next query failed, please handle the error + * } + * ); + * } + * + * }, + * function(error) { + * // do something with the error response + * } + * ); + */ + executeQuery(query: KiiQuery, callbacks?: { success(queryPerformed: KiiQuery, resultSet: T[], nextQuery: KiiQuery): any; failure(bucket: KiiBucket, anErrorString: string): any; }): Promise<[KiiQuery, T[], KiiQuery]>; + + /** + * Execute count aggregation of specified query on current bucket. + * Query that passed as nextQuery in success callback of {@link #executeQuery}, is not + * supported, callbacks.failure will be fired in this case. + * + * @param query to be executed. If null, the operation will be same as {@link #count}. + * @param callbacks An object with callback methods defined. + * + * @return return promise object. + *
      + *
    • fulfill callback function: function(params). params is Array instance. + *
        + *
      • params[0] is a KiiBucket instance which this method was called on.
      • + *
      • params[1] is a KiiQuery instance.
      • + *
      • params[2] is an integer count result.
      • + *
      + *
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.target is the KiiBucket instance which this method was called on.
      • + *
      • error.message
      • + *
      + *
    • + *
    + * + * @example + * // example to use callbacks directly + * var bucket = . . .; // a KiiBucket + * var queryObject = . . .; // a KiiQuery + * + * // define the callbacks + * var callbacks = { + * success: function(bucket, query, count) { + * // do something with the results + * }, + * + * failure: function(bucket, errorString) { + * // error happened. + * } + * }; + * + * bucket.countWithQuery(queryObject, callbacks); + * + * // example to use Promise + * var bucket = . . .; // a KiiBucket + * var queryObject = . . .; // a KiiQuery + * + * bucket.countWithQuery(queryObject, callbacks).then( + * function(params) { + * var bucket = params[0]; + * var query = params[1]; + * var count = params[2]; + * // do something with the results + * }, + * function(error) { + * var bucket = error.target; + * var errorString = error.message; + * // error happened. + * } + * ); + */ + countWithQuery(query: KiiQuery, callbacks?: { success(bucket: KiiBucket, query: KiiQuery, count: number): any; failure(bucket: KiiBucket, errorString: string): any; }): Promise<[KiiBucket, KiiQuery, number]>; + + /** + * Execute count aggregation of all clause query on current bucket. + * + * @param callbacks An object with callback methods defined. + * + * @return return promise object. + *
      + *
    • fulfill callback function: function(params). params is Array instance. + *
        + *
      • params[0] is a KiiBucket instance which this method was called on.
      • + *
      • params[1] is a KiiQuery instance.
      • + *
      • params[2] is an integer count result.
      • + *
      + *
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.target is the KiiBucket instance which this method was called on.
      • + *
      • error.message
      • + *
      + *
    • + *
    + * + * @example + * // example to use callbacks directly + * var bucket = . . .; // a KiiBucket + * // define the callbacks + * var callbacks = { + * success: function(bucket, query, count) { + * // do something with the results + * }, + * + * failure: function(bucket, errorString) { + * // error happened. + * } + * }; + * + * bucket.count(callbacks); + * + * // example to use Promise + * var bucket = . . .; // a KiiBucket + * var queryObject = . . .; // a KiiQuery + * + * bucket.count().then( + * function(params) { + * var bucket = params[0]; + * var count = params[2]; + * // do something with the results + * }, + * function(error) { + * var bucket = error.target; + * var errorString = error.message; + * // error happened. + * } + * ); + */ + count(callbacks?: { success(bucket: KiiBucket, query: KiiQuery, count: number): any; failure(bucket: KiiBucket, errorString: string): any; }): Promise<[KiiBucket, KiiQuery, number]>; + + /** + * Delete the given bucket from the server + * + * @param callbacks An object with callback methods defined + * + * @return return promise object. + *
      + *
    • fulfill callback function: function(deletedBucket). deletedBucket is KiiBucket instance.
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.target is the KiiBucket instance which this method was called on.
      • + *
      • error.message
      • + *
      + *
    • + *
    + * + * @example + * // example to use callbacks directly + * var bucket = . . .; // a KiiBucket + * bucket['delete']({ + * success: function(deletedBucket) { + * // do something with the result + * }, + * + * failure: function(bucketToDelete, anErrorString) { + * // do something with the error response + * } + * }); + * + * // example to use Promise + * var bucket = . . .; // a KiiBucket + * bucket['delete']({ + * success: function(deletedBucket) { + * // do something with the result + * }, + * + * failure: function(bucketToDelete, anErrorString) { + * // do something with the error response + * } + * }).then( + * function(deletedBucket) { + * // do something with the result + * }, + * function(error) { + * // do something with the error response + * } + * ); + */ + delete(callbacks?: { success(deletedBucket: KiiBucket): any; failure(bucketToDelete: KiiBucket, anErrorString: string): any; }): Promise; + } + + /** + * Represents a KiiClause expression object + */ + export class KiiClause { + /** + * Create a KiiClause with the AND operator concatenating multiple KiiClause objects + * + * @param A variable-length list of KiiClause objects to concatenate + * + * @example + * KiiClause clause = KiiClause.and(clause1, clause2, clause3, . . .) + */ + static and(...A: KiiClause[]): KiiClause; + + /** + * Create a KiiClause with the OR operator concatenating multiple KiiClause objects + * + * @param A variable-length list of KiiClause objects to concatenate + * + * @example + * KiiClause clause = KiiClause.or(clause1, clause2, clause3, . . .) + */ + static or(...A: KiiClause[]): KiiClause; + + /** + * Create an expression of the form (key == value) + * + * @param key The key to compare + * @param value the value to compare + */ + static equals(key: string, value: any): KiiClause; + + /** + * Create an expression of the form (key != value) + * + * @param key The key to compare + * @param value the value to compare + */ + static notEquals(key: string, value: any): KiiClause; + + /** + * Create an expression of the form (key > value) + * + * @param key The key to compare + * @param value the value to compare + */ + static greaterThan(key: string, value: any): KiiClause; + + /** + * Create an expression of the form (key >= value) + * + * @param key The key to compare + * @param value the value to compare + */ + static greaterThanOrEqual(key: string, value: any): KiiClause; + + /** + * Create an expression of the form (key < value) + * + * @param key The key to compare + * @param value the value to compare + */ + static lessThan(key: string, value: any): KiiClause; + + /** + * Create an expression of the form (key <= value) + * + * @param key The key to compare + * @param value the value to compare + */ + static lessThanOrEqual(key: string, value: any): KiiClause; + + /** + * Create an expression of the form (key in values) + * + * @param key The key to compare + * @param values to compare + */ + static inClause(key: string, values: any[]): KiiClause; + + /** + * Create an expression of the form (key STARTS WITH value) + * + * @param key The key to compare + * @param value the value to compare + */ + static startsWith(key: string, value: any): KiiClause; + + /** + * Create a clause of geo distance. This clause inquires objects in the specified circle. + * + * @param key Name of the key to inquire, which holds geo point. + * @param center Geo point which specify center of the circle. + * @param radius Radius of the circle. unit is meter. value should be in range of ]0, 20000000] + * @param putDistanceInto Used for retrieve distance from the center from the query result.Must match the pattern "^[a-zA-Z_][a-zA-Z0-9_]*$". + * If the specified value is null, query result will not contain the distance. + * Note: You can get the results in ascending order of distances from center. To do so, build the orderBy field by + * "_calculated.{specified value of putDistanceInto}" and pass it in {@link KiiQuery#sortByAsc}. Note that, descending order + * of distances is not supported. The unit of distance is meter. + * + * @return KiiClaluse reference. + * + * @throws
  • Specified key is not a string or an empty string.
  • + *
  • center is not an object of KiiGeoPoint.
  • + *
  • putDistanceInto is not a string or an empty string.
  • + * + * @example + * var putDistanceInto = "distanceFromCurrentLoc"; + * var currentLoc = ..; // current location + * var clause = KiiClause.geoDistance("location", currentLoc, 4000, putDistanceInto); + * var query = KiiQuery.queryWithClause(clause); + * // Sort by distances by ascending order.(Optional, use only if you intend to retrieve the distances in a ascending order). + * var orderByKey = "_calculated." + putDistanceInto; + * query.sortByAsc(orderByKey); + * // Define the callbacks + * var bucket = Kii.bucketWithName("MyBucket"); + * var queryCallback = { + * success: function(queryPerformed, resultSet, nextQuery) { + * // check the first object from resultSet. + * var object = resultSet[0]; + * var point = object.get("location"); + * var distanceToMyLocation = object.get("_calculated")[putDistanceInto]; + * }, + * failure: function(queryPerformed, anErrorString) { + * // do something with the error response + * } + * }; + * bucket.executeQuery(query, queryCallback); + */ + static geoDistance(key: string, center: KiiGeoPoint, radius: number, putDistanceInto: string): KiiClause; + + /** + * Create a clause of geo box. This clause inquires objects in the specified rectangle. + * Rectangle would be placed parallel to the equator with specified coordinates of the corner. + * + * @param key Key to inquire which holds geo point. + * @param northEast North-Eest corner of the rectangle. + * @param southWest South-Wast corner of the rectangle. + * + * @return KiiClause reference. + * + * @throws
  • Specified key is not a string or is an empty string.
  • + *
  • northEast or southWest is not a reference of KiiGeoPoint.
  • + */ + static geoBox(key: string, northEast: KiiGeoPoint, southWest: KiiGeoPoint): KiiClause; + } + + /** + * Represents Geo Point. + */ + export class KiiGeoPoint { + /** + * Return the latitide of this point. + */ + getLatitude(): number; + + /** + * Return the longitude of this point. + */ + getLongitude(): number; + + /** + * Create a geo point with the given latitude and longitude. + * + * @param latitude Latitude of the point in degrees. Valid if the value is greater than -90 degrees and less than +90 degrees. + * @param longitude Longitude of the point in degrees. Valid if the value is greater than -180 degrees and less than +180 degrees. + * + * @return A new reference of KiiGeoPoint. + * + * @throws Specified latitude or longitude is invalid. + * + * @example + * var point = KiiGeoPoint.geoPoint(35.07, 139.02); + */ + static geoPoint(latitude: number, longitude: number): KiiGeoPoint; + } + + /** + * Represents a KiiGroup object + */ + export class KiiGroup { + /** + * + * + * @deprecated Use {@link KiiGroup.getId} instead. + * Get the UUID of the given group, assigned by the server + * + * @return + */ + getUUID(): string; + + /** + * Get the ID of the current KiiGroup instance. + * + * @return Id of the group or null if the group has not saved to cloud. + */ + getID(): string; + + /** + * The name of this group + * + * @return + */ + getName(): string; + + /** + * Returns the owner of this group if this group holds the information of owner. + * + * Group will holds the information of owner when "saving group on cloud" or "retrieving group info/owner from cloud". + * The cache will not be shared among the different instances of KiiGroup. + *
      + *
    • This API will not access to server. + * To update the group owner information on cloud, please call {@link KiiGroup#refresh} or {@link KiiGroup#getOwner}. + *
    • + *
    • This API does not return all the properties of the owner. + * To get all owner properties, {@link KiiUser#refresh} is necessary.
    • + *
    + * + * @return KiiUser who owns this group, undefined if this group doesn't hold the information of owner yet. + * + * @see KiiGroup#getOwner + */ + getCachedOwner(): KiiUser; + + /** + * Get a specifically formatted string referencing the group + * + *

    The group must exist in the cloud (have a valid UUID). + * + * @return A URI string based on the current group. null if a URI couldn't be generated. + * + * @example + * var group = . . .; // a KiiGroup + * var uri = group.objectURI(); + */ + objectURI(): string; + + /** + * Creates a reference to a bucket for this group + * + *

    The bucket will be created/accessed within this group's scope + * + * @param bucketName The name of the bucket the user should create/access + * + * @return A working KiiBucket object + * + * @example + * var group = . . .; // a KiiGroup + * var bucket = group.bucketWithName("myBucket"); + */ + bucketWithName(bucketName: string): KiiBucket; + + /** + * Creates a reference to a encrypted bucket for this group + * + *

    The bucket will be created/accessed within this group's scope + * + * @param bucketName The name of the bucket the user should create/access + * + * @return A working KiiEncryptedBucket object + * + * @example + * var group = . . .; // a KiiGroup + * var bucket = group.encryptedBucketWithName("myBucket"); + */ + encryptedBucketWithName(bucketName: string): KiiBucket; + + /** + * Adds a user to the given group + * + *

    This method will NOT access the server immediately. You must call save to add the user on the server. This allows multiple users to be added/removed before calling save. + * + * @param member The user to be added to the group + * + * @example + * var user = . . .; // a KiiUser + * var group = . . .; // a KiiGroup + * group.addUser(user); + * group.save(callbacks); + */ + addUser(member: KiiUser): void; + + /** + * Removes a user from the given group + * + *

    This method will NOT access the server immediately. You must call save to remove the user on the server. This allows multiple users to be added/removed before calling save. + * + * @param member The user to be added to the group + * + * @example + * var user = . . .; // a KiiUser + * var group = . . .; // a KiiGroup + * group.removeUser(user); + * group.save(callbacks); + */ + removeUser(member: KiiUser): void; + + /** + * Gets a list of all current members of a group + * + * @param callbacks An object with callback methods defined + * + * @return return promise object. + *
      + *
    • fulfill callback function: function(params). params is Array instance. + *
        + *
      • params[0] is a KiiGroup instance which this method was called on.
      • + *
      • params[1] is array of memeber KiiUser instances.
      • + *
      + *
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.target is the KiiACL instance which this method was called on.
      • + *
      • error.message
      • + *
      + *
    • + *
    + * + * @example + * // example to use callbacks directly + * var group = . . .; // a KiiGroup + * group.getMemberList({ + * success: function(theGroup, memberList) { + * // do something with the result + * for(var i=0; i<memberList.length; i++){ + * var u = memberList[i]; // a KiiUser within the group + * } + * }, + * + * failure: function(theGroup, anErrorString) { + * // do something with the error response + * } + * }); + * + * // example to use Promise + * var group = . . .; // a KiiGroup + * group.getMemberList().then( + * function(params) { + * var theGroup = params[0]; + * var memberlist = params[1]; + * // do something with the result + * for(var i=0; i<memberList.length; i++){ + * var u = memberList[i]; // a KiiUser within the group + * } + * }, + * function(error) { + * // do something with the error response + * } + * ); + */ + getMemberList(callbacks?: { success(theGroup: KiiGroup, memberList: KiiUser[]): any; failure(theGroup: KiiGroup, anErrorString: string): any; }): Promise<[KiiGroup, KiiUser[]]>; + + /** + * Updates the group name on the server + * + * @param newName A String of the desired group name + * @param callbacks An object with callback methods defined + * + * @return return promise object. + *
      + *
    • fulfill callback function: function(theRenamedGroup). theRenamedGroup is KiiGroup instance.
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.target is the KiiGroup instance which this method was called on.
      • + *
      • error.message
      • + *
      + *
    • + *
    + * + * @example + * // example to use callbacks directly + * var group = . . .; // a KiiGroup + * group.changeGroupName("myNewName", { + * success: function(theRenamedGroup) { + * // do something with the group + * }, + * + * failure: function(theGroup, anErrorString) { + * // do something with the error response + * } + * }); + * + * // example to use Promise + * var group = . . .; // a KiiGroup + * group.changeGroupName("myNewName").then( + * function(theRenamedGroup) { + * // do something with the group + * }, + * function(error) { + * // do something with the error response + * } + * ); + */ + changeGroupName(newName: string, callbacks?: { success(theRenamedGroup: KiiGroup): any; failure(theGroup: KiiGroup, anErrorString: string): any; }): Promise; + + /** + * Saves the latest group values to the server + * + *

    If the group does not yet exist, it will be created. If the group already exists, the members that have changed will be updated accordingly. If the group already exists and there is no updates of members, it will allways succeed but does not execute update. To change the name of group, use {@link #changeGroupName}. + * + * @param callbacks An object with callback methods defined + * + * @return return promise object. + *
      + *
    • fulfill callback function: function(theSavedGroup). theSavedGroup is KiiGroup instance.
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.target is the KiiGroup instance which this method was called on.
      • + *
      • error.message
      • + *
      • error.addMembersArray is array of KiiUser to be added as memebers of this group.
      • + *
      • error.removeMembersArray is array of KiiUser to be removed from the memebers list of this group.
      • + *
      + *
    • + *
    + * + * @example + * // example to use callbacks directly + * 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 + * } + * }); + * + * // 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( + * function(theSavedGroup) { + * // do something with the saved group + * }, + * function(error) { + * var theGroup = error.target; + * var anErrorString = error.message; + * var addMembersArray = error.addMembersArray; + * var removeMembersArray = error.removeMembersArray; + * // do something with the error response + * }); + */ + save(callbacks?: { success(theSavedGroup: KiiGroup): any; failure(theGroup: KiiGroup, anErrorString: string, addMembersArray: KiiUser[], removeMembersArray: KiiUser[]): any; }): Promise; + + /** + * Updates the local group's data with the group data on the server + * + *

    The group must exist on the server. Local data will be overwritten. + * + * @param callbacks An object with callback methods defined + * + * @return return promise object. + *
      + *
    • fulfill callback function: function(theRefreshedGroup). theRefreshedGroup is KiiGroup instance.
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.target is the KiiGroup instance which this method was called on.
      • + *
      • error.message
      • + *
      + *
    • + *
    + * + * @example + * // example to use callbacks directly + * var group = . . .; // a KiiGroup + * group.refresh({ + * success: function(theRefreshedGroup) { + * // do something with the refreshed group + * }, + * + * failure: function(theGroup, anErrorString) { + * // do something with the error response + * } + * }); + * + * // example to use Promise + * var group = . . .; // a KiiGroup + * group.refresh().then( + * function(theRefreshedGroup) { + * // do something with the refreshed group + * }, + * function(error) { + * // do something with the error response + * } + * ); + */ + refresh(callbacks?: { success(theRefreshedGroup: KiiGroup): any; failure(theGroup: KiiGroup, anErrorString: string): any; }): Promise; + + /** + * Delete the group from the server + * + * @param callbacks An object with callback methods defined + * + * @return return promise object. + *
      + *
    • fulfill callback function: function(theDeletedGroup). theDeletedGroup is KiiGroup instance.
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.target is the KiiGroup instance which this method was called on.
      • + *
      • error.message
      • + *
      + *
    • + *
    + * + * @example + * // example to use callbacks directly + * var group = . . .; // a KiiGroup + * group['delete']({ + * success: function(theDeletedGroup) { + * // do something + * }, + * + * failure: function(theGroup, anErrorString) { + * // do something with the error response + * } + * }); + * + * // example to use Promise + * var group = . . .; // a KiiGroup + * group['delete']({ + * success: function(theDeletedGroup) { + * }, + * + * failure: function(theGroup, anErrorString) { + * } + * }).then( + * function(theDeletedGroup) { + * // do something + * }, + * function(error) { + * // do something with the error response + * } + * ); + */ + delete(callbacks?: { success(theDeletedGroup: KiiGroup): any; failure(theGroup: KiiGroup, anErrorString: string): any; }): Promise; + + /** + * Gets the owner of the associated group + * + * This API does not return all the properties of the owner. + * To get all owner properties, {@link KiiUser#refresh} is necessary. + * + * @param callbacks An object with callback methods defined + * + * @return return promise object. + *
      + *
    • fulfill callback function: function(params). params is Array instance. + *
        + *
      • params[0] is the KiiGroup instance which this method was called on.
      • + *
      • params[1] is an group owner KiiUser instances.
      • + *
      + *
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.target is the KiiGroup instance which this method was called on.
      • + *
      • error.message
      • + *
      + *
    • + *
    + * + * @example + * // example to use callbacks directly + * var group = . . .; // a KiiGroup + * group.getOwner({ + * success: function(theGroup, theOwner) { + * // do something + * }, + * failure: function(theGroup, anErrorString) { + * // do something with the error response + * } + * }); + * + * // example to use Promise + * var group = . . .; // a KiiGroup + * group.getOwner().then( + * function(params) { + * // do something + * }, + * function(error) { + * // do something with the error response + * } + * ); + */ + getOwner(callbacks?: { success(theGroup: KiiGroup, theOwner: KiiUser): any; failure(theGroup: KiiGroup, anErrorString: string): any; }): Promise<[KiiGroup, KiiUser]>; + + /** + * Creates a reference to a group with the given name + *

    + * Note: + * Returned instance from this API can not operate existing KiiGroup.
    + * If you want to operate existing KiiGroup, please use {@link KiiGroup.groupWithURI}. + * + * @param groupName An application-specific group name + * + * @return A new KiiGroup reference + * + * @example + * var group = new KiiGroup.groupWithName("myGroup"); + */ + static groupWithName(groupName: string): KiiGroup; + + /** + * Creates a reference to a group with the given name and a list of default members + *

    + * Note: + * Returned instance from this API can not operate existing KiiGroup.
    + * If you want to operate existing KiiGroup, please use {@link KiiGroup.groupWithURI}. + * + * @param groupName An application-specific group name + * @param members An array of KiiUser objects to add to the group + * + * @return A new KiiGroup reference + * + * @example + * var group = new KiiGroup.groupWithName("myGroup", members); + */ + static groupWithNameAndMembers(groupName: string, members: KiiUser[]): KiiGroup; + + /** + * Instantiate KiiGroup that refers to existing group which has specified ID. + * You have to specify the ID of existing KiiGroup. Unlike KiiObject, + * you can not assign ID in the client side.
    + * NOTE: This API does not access to the server. + * After instantiation, call {@link KiiGroup#refresh} to fetch the properties. + * + * @param groupId ID of the KiiGroup to instantiate. + * + * @return instance of KiiGroup. + * + * @throws when passed groupID is empty or null. + * + * @example + * var group = new KiiUser.groupWithID("__GROUP_ID__"); + */ + static groupWithID(groupId: string): KiiGroup; + + /** + * Generate a new KiiGroup based on a given URI + *

    + * Note: + * Returned instance from this API can operate existing KiiGroup.
    + * If you want to create a new KiiGroup, please use {@link KiiGroup.groupWithName}. + * + * @param uri The URI of the group to be represented + * + * @return A new KiiGroup with its parameters filled in from the URI + * + * @throws If the URI given is invalid + * + * @example + * var group = new KiiGroup.groupWithURI("kiicloud://myuri"); + */ + static groupWithURI(uri: string): KiiGroup; + + /** + * Instantiate topic belongs to this group. + * + * @param topicName name of the topic. Must be a not empty string. + * + * @return topic instance. + */ + topicWithName(topicName: string): KiiTopic; + + /** + * Gets a list of topics in this group scope + * + * @param callbacks An object with callback methods defined + * @param paginationKey You can specify the pagination key with the nextPaginationKey passed by callbacks.success. If empty string or no string object is provided, this API regards no paginationKey specified. + * + * @return return promise object. + *
      + *
    • fulfill callback function: function(params). params is Array instance. + *
        + *
      • params[0] is array of KiiTopic instances.
      • + *
      • params[1] is string of nextPaginationKey.
      • + *
      + *
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.target is the KiiGroup instance which this method was called on.
      • + *
      • error.message
      • + *
      + *
    • + *
    + * + * @example + * // example to use callbacks directly + * var group = . . .; // a KiiGroup + * group.listTopics({ + * success: function(topicList, nextPaginationKey) { + * // do something with the result + * for(var i=0; i<topicList.length; i++){ + * var topic = topicList[i]; + * } + * if (nextPaginationKey != null) { + * group.listTopics({ + * success: function(topicList, nextPaginationKey) {...}, + * failure: function(anErrorString) {...} + * }, nextPaginationKey); + * } + * }, + * failure: function(anErrorString) { + * // do something with the error response + * } + * }); + * + * // example to use promise + * var group = . . .; // a KiiGroup + * group.listTopics().then( + * function(params) { + * var topicList = params[0]; + * var nextPaginationKey = params[1]; + * // do something with the result + * for(var i=0; i<topicList.length; i++){ + * var topic = topicList[i]; + * } + * if (nextPaginationKey != null) { + * group.listTopics(null, nextPaginationKey).then( + * function(params) {...}, + * function(error) {...} + * ); + * } + * }, + * function(error) { + * // do something with the error response + * } + * ); + */ + listTopics(callbacks?: { success(topicList: KiiTopic[], nextPaginationKey: string): any; failure(anErrorString: string): any; }, paginationKey?: string): Promise<[KiiTopic[], string]>; + } + + /** + * Represents a KiiObject object + */ + export class KiiObject { + /** + * Get the UUID of the given object, assigned by the server + * + * @return + */ + getUUID(): string; + + /** + * Get the server's creation date of this object + * + * @return + */ + getCreated(): number; + + /** + * Get the modified date of the given object, assigned by the server + * + * @return + */ + getModified(): string; + + /** + * Get the application-defined type name of the object + * + * @return + */ + getObjectType(): string; + + /** + * Get the body content-type. + * It will be updated after the success of {@link KiiObject#uploadBody} and {@link KiiObject#downloadBody} + * returns null when this object doesn't have body content-type information. + * + * @return content-type of object body + */ + getBodyContentType(): string; + + /** + * Sets a key/value pair to a KiiObject + * + *

    If the key already exists, its value will be written over. If the object is of invalid type, it will return false and a KiiError will be thrown (quietly). Accepted types are any JSON-encodable objects. + *
    NOTE: Before involving floating point value, please consider using integer instead. For example, use percentage, permil, ppm, etc.
    + * The reason is: + *
  • Will dramatically improve the performance of bucket query.
  • + *
  • Bucket query does not support the mixed result of integer and floating point. + * ex.) If you use same key for integer and floating point and inquire object with the integer value, objects which has floating point value with the key would not be evaluated in the query. (and vice versa)
  • + * + * @param key The key to set. The key must not be a system key (created, metadata, modified, type, uuid) or begin with an underscore (_) + * @param value The value to be set. Object must be of a JSON-encodable type (Ex: dictionary, array, string, number, etc) + * + * @example + * var obj = . . .; // a KiiObject + * obj.set("score", 4298); + */ + set(key: string, value: any): void; + + /** + * Gets the value associated with the given key + * + * @param key The key to retrieve + * + * @return The object associated with the key. null if none exists + * + * @example + * var obj = . . .; // a KiiObject + * var score = obj.get("score"); + */ + get(key: string): T; + + /** + * Set Geo point to this object with the specified key. + * + * @param key The key to set. + * @param KiiGeoPoint to be tied to the specified key. + * + * @throws Specified kiiGeoPint is not an instance of KiiGeoPoint. + */ + setGeoPoint(key: string, KiiGeoPoint: KiiGeoPoint): void; + + /** + * Gets the geo point associated with the given key. + * + * @param key The key of the geo point to retrieve. + * + * @return KiiGeoPoint tied to the key. null if null exists. + */ + getGeoPoint(key: string): KiiGeoPoint; + + /** + * Get the ACL handle for this file + * + *

    Any KiiACLEntry objects added or revoked from this ACL object will be appended to/removed from the server on ACL save. + * + * @return A KiiACL object associated with this KiiObject + * + * @example + * var obj = . . .; // a KiiObject + * var acl = obj.objectACL(); + */ + objectACL(): KiiACL; + + /** + * Get a specifically formatted string referencing the object + * + *

    The object must exist in the cloud (have a valid UUID). + * + * @return A URI string based on the current object. null if a URI couldn't be generated. + * + * @example + * var obj = . . .; // a KiiObject + * var uri = obj.objectURI(); + */ + objectURI(): string; + + /** + * Create or update the KiiObject on KiiCloud. + *

    When call this method for the object that has not saved on cloud, will send all fields. + * Call this method for the object that has saved on cloud, Update all field of this object. + * + * @param callbacks An object with callback methods defined + * sucess: function called when save succeeded.
    + * failure: function called when save failed. + * @param overwrite optional, true by default. + *
      + *
    • If overwrite is true: + *
        + *
      • If a KiiObject with the same ID exists in cloud, the local copy will overwrite the remote copy, even if the remote copy is newer.
      • + *
      + *
    • Otherwise: + *
        + *
      • If a KiiObject with the same ID exists in cloud and the remote copy is newer, save will fail.
      • + *
      + *
    + * + * @return return promise object. + *
      + *
    • fulfill callback function: function(theSavedObject). theSavedObject is KiiObject instance.
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.target is the KiiObject instance which this method was called on.
      • + *
      • error.message
      • + *
      + *
    • + *
    + * + * @example + * // example to use callbacks directly + * var obj = . . .; // a KiiObject + * obj.saveAllFields({ + * success: function(theSavedObject) { + * // do something with the saved object + * }, + * + * failure: function(theObject, anErrorString) { + * // do something with the error response + * } + * }); + * + * // example to use Promise + * var obj = . . .; // a KiiObject + * obj.saveAllFields().then( + * function(theSavedObject) { + * // do something with the saved object + * }, + * function(error) { + * // do something with the error response + * } + * ); + */ + saveAllFields(callbacks?: { success(theSavedObject: KiiObject): any; failure(theObject: KiiObject, anErrorString: string): any; }, overwrite?: boolean): Promise; + + /** + * Create or update the KiiObject on KiiCloud. + *

    When call this method for the object that has not saved on cloud, will send all fields. + * Call this method for the object that has saved on cloud, Update only updated fields. + * Do not send fields that has not updated locally. To send all fields regardless of updates, call {@link KiiObject#saveAllFields}. + * + * @param callbacks An object with callback methods defined + * sucess: function called when save succeeded.
    + * failure: function called when save failed. + * @param overwrite optional, true by default. + *
      + *
    • If overwrite is true: + *
        + *
      • If a KiiObject with the same ID exists in cloud, the local copy will overwrite the remote copy, even if the remote copy is newer.
      • + *
      + *
    • Otherwise: + *
        + *
      • If a KiiObject with the same ID exists in cloud and the remote copy is newer, save will fail.
      • + *
      + *
    + * + * @return return promise object. + *
      + *
    • fulfill callback function: function(theSavedObject). theSavedObject is KiiObject instance.
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.target is the KiiObject instance which this method was called on.
      • + *
      • error.message
      • + *
      + *
    • + *
    + * + * @example + * // example to use callbacks directly + * var obj = . . .; // a KiiObject + * obj.save({ + * success: function(theSavedObject) { + * // do something with the saved object + * }, + * + * failure: function(theObject, anErrorString) { + * // do something with the error response + * } + * }); + * + * // example to use Promise + * var obj = . . .; // a KiiObject + * obj.save().then( + * function(theSavedObject) { + * // do something with the saved object + * }, + * function(error) { + * // do something with the error response + * } + * ); + */ + save(callbacks?: { success(theSavedObject: KiiObject): any; failure(theObject: KiiObject, anErrorString: string): any; }, overwrite?: boolean): Promise; + + /** + * Updates the local object's data with the user data on the server + * + *

    The object must exist on the server. Local data will be overwritten. + * + * @param callbacks An object with callback methods defined + * + * @return return promise object. + *
      + *
    • fulfill callback function: function(theRefreshedObject). theRefreshedObject is KiiObject instance.
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.target is the KiiObject instance which this method was called on.
      • + *
      • error.message
      • + *
      + *
    • + *
    + * + * @example + * // example to use callbacks directly + * var obj = . . .; // a KiiObject + * obj.refresh({ + * success: function(theRefreshedObject) { + * // do something with the refreshed object + * }, + * + * failure: function(theObject, anErrorString) { + * // do something with the error response + * } + * }); + * + * // example to use Promise + * var obj = . . .; // a KiiObject + * obj.refresh().then( + * function(theRefreshedObject) { + * // do something with the refreshed object + * }, + * function(error) { + * // do something with the error response + * } + * ); + */ + refresh(callbacks?: { success(theRefreshedObject: KiiObject): any; failure(theObject: KiiObject, anErrorString: string): any; }): Promise; + + /** + * Delete the object from the server + * + * @param callbacks An object with callback methods defined + * + * @return return promise object. + *
      + *
    • fulfill callback function: function(theDeletedObject). theDeletedObject is KiiObject instance.
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.target is the KiiObject instance which this method was called on.
      • + *
      • error.message
      • + *
      + *
    • + *
    + * + * @example + * // example to use callbacks directly + * var obj = . . .; // a KiiObject + * obj['delete']({ + * success: function(theDeletedObject) { + * // do something + * }, + * + * failure: function(theObject, anErrorString) { + * // do something with the error response + * } + * }); + * + * // example to use Promise + * var obj = . . .; // a KiiObject + * obj['delete']().then( + * function(theDeletedObject) { + * // do something + * }, + * function(error) { + * // do something with the error response + * } + * ); + */ + delete(callbacks?: { success(theDeletedObject: KiiObject): any; failure(theObject: KiiObject, anErrorString: string): any; }): Promise; + + /** + * Generate a new KiiObject based on a given URI + * + * @param uri The URI of the object to be represented + * + * @return A new KiiObject with its parameters filled in from the URI + * + * @throws If the URI is not in the proper format + * + * @example + * var group = new KiiObject.objectWithURI("kiicloud://myuri"); + */ + static objectWithURI(uri: string): KiiObject; + + /** + * Move KiiObject body from an object to another object. + *
    + * This moving can be allowed under same application, across different scopes + * and source/target KiiObject have a read and write permission (READ_EXISTING_OBJECT and WRITE_EXISTING_OBJECT). + *

    If target KiiObject has a body, it will be overwritten. + * + * @param targetObjectUri A KiiObject URI which KiiObject body is moved to. + * @param callbacks An object with callback methods defined + * + * @return return promise object. + *
      + *
    • fulfill callback function: function(params). params is Array instance. + *
        + *
      • params[0] is the source KiiObject instance which this method was called on.
      • + *
      • params[1] is the target targetObjectUri String.
      • + *
      + *
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.target is the source KiiObject instance which this method was called on.
      • + *
      • error.targetObjectUri is the targetObjectUri String.
      • + *
      • error.message
      • + *
      + *
    • + *
    + * + * @example + * // example to use callbacks directly + * var sourceObject = ...; // Source KiiObject + * var targetObject = ...; // Target KiiObject + * var targetObjectUri = targetObject.objectURI(); + * sourceObject.moveBody(targetObjectUri, { + * success: function(theSrcObject, theTgtObjectUri) { + * // Do something with the objects + * }, + * + * failure: function(theSrcObject, theTgtObjectUri, anErrorString) { + * // Do something with the error response + * } + * }); + * + * // example to use Promise + * var sourceObject = ...; // Source KiiObject + * var targetObject = ...; // Target KiiObject + * var targetObjectUri = targetObject.objectURI(); + * sourceObject.moveBody(targetObjectUri).then( + * function(params) { + * var theSrcObject = params[0]; + * var theTgtObjectUri = params[1]; + * // Do something with the objects + * }, + * function(error) { + * // Do something with the error response + * } + * ); + */ + moveBody(targetObjectUri: string, callbacks?: { success(theSrcObject: KiiObject, theTgtObjectUri: string): any; failure(theSrcObject: KiiObject, theTgtObjectUri: string, anErrorString: string): any; }): Promise<[KiiObject, string]>; + + /** + * Upload body data of this object.
    + * If the KiiObject has not saved on the cloud or deleted, + * request will be failed. + *
    NOTE: this requires XMLHttpRequest Level 2, FileReader and Blob supports. Do not use it in server code.
    + * + * @param srcDataBlob data to be uploaded. + * type is used to determin content-type managed in Kii Cloud. + * If type was not specified in the Blob, + * 'application/octet-stream' will be used. + * @param callbacks progress: function called on XMLHttpRequest 'progress' event listener.
    + * sucess: function called when upload succeeded.
    + * failure: function called when upload failed. + * + * @return return promise object. + *
    NOTE: Promise will not handle progress event. Please pass callbacks with progress function to handle progress. + *
      + *
    • fulfill callback function: function(theObject). theObject is a KiiObject instance which this method was called on.
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.target is the KiiObject instance which this method was called on.
      • + *
      • error.message
      • + *
      + *
    • + *
    + * + * @example + * // example to use callbacks directly + * var myObject = Kii.bucketWithName('myBucket').createObject(); + * myObject.save({ + * success: function(obj) { + * var srcData = new Blob(['Hello Blob'], {type: 'text/plain'}); + * obj.uploadBody(srcData, { + * progress: function (oEvent) { + * if (oEvent.lengthComputable) { + * var percentComplete = oEvent.loaded / oEvent.total; + * //getting upload progress. You can update progress bar on this function. + * } + * }, + * success: function(obj) { + * // Upload succeeded. + * }, + * failure: function(obj, anErrorString) { + * // Handle error. + * } + * }); + * }, + * failure: function(obj, error) { + * // Handle error. + * } + * }); + * + * // example to use Promise + * var myObject = Kii.bucketWithName('myBucket').createObject(); + * myObject.save().then( + * function(obj) { + * var srcData = new Blob(['Hello Blob'], {type: 'text/plain'}); + * obj.uploadBody(srcData, { + * progress: function (oEvent) { + * if (oEvent.lengthComputable) { + * var percentComplete = oEvent.loaded / oEvent.total; + * //getting upload progress. You can update progress bar on this function. + * } + * } + * }).then( + * function(obj) { // fullfill callback function + * // Upload succeeded. + * }, + * function(error) { // reject callback function + * // Handle error. + * } + * ); + * }, + * function(error) { + * // Handle error. + * } + * ); + */ + uploadBody(srcDataBlob: Blob, callbacks?: { success(obj: KiiObject): any; failure(obj: KiiObject, anErrorString: string): any; }): Promise; + + /** + * Download body data of this object.
    + * If the KiiObject has not saved on the cloud or deleted + * or exist but does not have body object, request will be failed. + *
    NOTE: this requires XMLHttpRequest Level 2, FileReader and Blob supports. Do not use it in server code.
    + * + * @param callbacks progress: function called on XMLHttpRequest 'progress' event listener.
    + * sucess: function called when download succeeded.
    + * failure: function called when download failed. + * + * @return return promise object. + *
    NOTE: Promise will not handle progress event. Please pass callbacks with progress function to handle progress. + *
      + *
    • fulfill callback function: function(params). params is Array instance. + *
        + *
      • params[0] is a KiiObject instance which this method was called on.
      • + *
      • params[1] is the returned body blob object.
      • + *
      + *
    • + *
    • reject callback function: function(error). error is an Error instance.
    • + *
        + *
      • error.target is the KiiObject instance which this method was called on.
      • + *
      • error.message
      • + *
      + * + *
    + * + * @example + * // example to use callbacks directly + * var myObject = KiiObject.objectWithURI('put existing object uri here'); + * myObject.downloadBody({ + * progress: function (oEvent) { + * if (oEvent.lengthComputable) { + * var percentComplete = oEvent.loaded / oEvent.total; + * //getting download progress. You can update progress bar on this function. + * + * } + * }, + * success: function(obj, bodyBlob) { + * // Obtaind body contents as bodyBlob. + * // content-type managed in Kii Cloud can be obtained from type attr. + * // It is same as obj.getBodyContentType(); + * var contentType = bodyBlob.type; + * }, + * failure: function(obj, anErrorString) { + * // Handle error. + * } + * }); + * + * // example to use Promise + * var myObject = KiiObject.objectWithURI('put existing object uri here'); + * myObject.downloadBody({ + * progress: function (oEvent) { + * if (oEvent.lengthComputable) { + * var percentComplete = oEvent.loaded / oEvent.total; + * //getting download progress. You can update progress bar on this function. + * + * } + * } + * ).then( + * function(params) { + * // 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 bodyBlob = params[1]; + * var contentType = bodyBlob.type; + * }, + * function(error) { + * // Handle error. + * } + * ); + */ + downloadBody(callbacks?: { success(obj: KiiObject, bodyBlob: Blob): any; failure(obj: KiiObject, anErrorString: string): any; }): Promise<[KiiObject, Blob]>; + + /** + * Publish object body.
    + * Publish object body and obtain public URL links to the body.
    + * It doesn't expires.
    + * If the KiiObject has not saved on the cloud or deleted + * or exist but does not have body object, request will be failed. + * + * @param callbacks sucess: function called when publish succeeded.
    + * failure: function called when publish failed. + * + * @return return promise object. + *
      + *
    • fulfill callback function: function(params). params is Array instance. + *
        + *
      • params[0] is the KiiObject instance which this method was called on.
      • + *
      • params[1] is the published url string.
      • + *
      + *
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.target is the KiiObject instance which this method was called on.
      • + *
      • error.message
      • + *
      + *
    • + *
    + * + * @example + * // example to use callbacks directly + * var myObject = KiiObject.objectWithURI('put existing object uri here'); + * myObject.publishBody({ + * success: function(obj, publishedUrl) { + * // ex.) You can show publishedUrl in the view. + * }, + * failure: function(obj, anErrorString) { + * // Handle error. + * } + * }); + * + * // example to use Promise + * var myObject = KiiObject.objectWithURI('put existing object uri here'); + * myObject.publishBody().then( + * function(params) { + * // ex.) You can show publishedUrl in the view. + * var obj = params[0]; + * var publishedUrl = params[1]; + * }, + * function(error) { + * // Handle error. + * } + * ); + */ + publishBody(callbacks?: { success(obj: KiiObject, publishedUrl: string): any; failure(obj: KiiObject, anErrorString: string): any; }): Promise<[KiiObject, string]>; + + /** + * Publish object body with expiration date.
    + * Publish object body and obtain public URL links to the body.
    + * Expires at specified date
    + * If the KiiObject has not saved on the cloud or deleted + * or exist but does not have body object, request will be failed. + * + * @param expiresAt expiration date. should specify future date. + * @param callbacks sucess: function called when publish succeeded.
    + * failure: function called when publish failed. + * + * @return return promise object. + *
      + *
    • fulfill callback function: function(params). params is Array instance. + *
        + *
      • params[0] is the KiiObject instance which this method was called on.
      • + *
      • params[1] is the published url string.
      • + *
      + *
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.target is the KiiObject instance which this method was called on.
      • + *
      • error.message
      • + *
      + *
    • + *
    + * + * @example + * // example to use callbacks directly + * var myObject = KiiObject.objectWithURI('put existing object uri here'); + * var expiresAt = new Date(2014, 11, 24); + * myObject.publishBodyExpiresAt(expiresAt, { + * success: function(obj, publishedUrl) { + * // ex.) You can show publishedUrl in the view. + * }, + * failure: function(obj, anErrorString) { + * // Handle error. + * } + * }); + * + * // example to use Promise + * var myObject = KiiObject.objectWithURI('put existing object uri here'); + * var expiresAt = new Date(2014, 11, 24); + * myObject.publishBodyExpiresAt(expiresAt).then( + * function(params) { + * // ex.) You can show publishedUrl in the view. + * var obj = params[0]; + * var publishedUrl = params[1]; + * }, + * function(error) { + * // Handle error. + * } + * ); + */ + publishBodyExpiresAt(expiresAt: Date, callbacks?: { success(obj: KiiObject, publishedUrl: string): any; failure(obj: KiiObject, anErrorString: string): any; }): Promise<[KiiObject, string]>; + + /** + * Publish object body with expiration duration.
    + * Publish object body and obtain public URL links to the body.
    + * Expires in specified duration
    + * If the KiiObject has not saved on the cloud or deleted + * or exist but does not have body object, request will be failed. + * + * @param expiresIn duration in seconds. greater than 0. + * @param callbacks sucess: function called when publish succeeded.
    + * failure: function called when publish failed. + * + * @return return promise object. + *
      + *
    • fulfill callback function: function(params). params is Array instance. + *
        + *
      • params[0] is the KiiObject instance which this method was called on.
      • + *
      • params[1] is the published url string.
      • + *
      + *
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.target is the KiiObject instance which this method was called on.
      • + *
      • error.message
      • + *
      + *
    • + *
    + * + * @example + * // example to use callbacks directly + * var myObject = KiiObject.objectWithURI('put existing object uri here'); + * var expiresIn = 60 * 60; // Expires in 1 hour. + * myObject.publishBodyExpiresIn(expiresIn, { + * success: function(obj, publishedUrl) { + * // ex.) You can show publishedUrl in the view. + * }, + * failure: function(obj, anErrorString) { + * // Handle error. + * } + * }); + * + * // example to use Promise + * var myObject = KiiObject.objectWithURI('put existing object uri here'); + * var expiresIn = 60 * 60; // Expires in 1 hour. + * myObject.publishBodyExpiresIn(expiresIn).then( + * function(params) { + * // ex.) You can show publishedUrl in the view. + * var obj = params[0]; + * var publishedUrl = params[1]; + * }, + * function(error) { + * // Handle error. + * } + * ); + */ + publishBodyExpiresIn(expiresIn: number, callbacks?: { success(obj: KiiObject, publishedUrl: string): any; failure(obj: KiiObject, anErrorString: string): any; }): Promise<[KiiObject, string]>; + + /** + * Delete the object body from the server.
    + * If the KiiObject has not saved on the cloud or deleted + * or exist but does not have body object, request will be failed.
    + * If succeeded, The object body content type will be nullified. + * + * @param callbacks An object with callback methods defined + * + * @return return promise object. + *
      + *
    • fulfill callback function: function(theDeletedObject). theDeletedObject is the KiiObject instance which this method was called on.
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.target is the KiiObject instance which this method was called on.
      • + *
      • error.message
      • + *
      + *
    • + *
    + * + * @example + * // example to use callbacks directly + * var obj = . . .; // a KiiObject + * obj.deleteBody({ + * success: function(theDeletedObject) { + * // do something + * }, + * + * failure: function(obj, anErrorString) { + * // do something with the error response + * } + * }); + * + * // example to use Promise + * var obj = . . .; // a KiiObject + * obj.deleteBody().then( + * function(theDeletedObject) { + * // do something + * }, + * function(error) { + * // do something with the error response + * } + * ); + */ + deleteBody(callbacks?: { success(theDeletedObject: KiiObject): any; failure(obj: KiiObject, anErrorString: string): any; }): Promise; + + /** + * Check if given ID is valid for object ID. + * Valid pattern: ^[a-zA-Z0-9-_\\.]{2,100}$ + * + * @param objectID to be checked. + * + * @return true if given ID is valid, false otherwise. + */ + static isValidObjectID(objectID: string): boolean; + } + + /** + * Builder of push message + */ + export class KiiPushMessageBuilder { + /** + * instantiate builder with push message data. + * By default all push channels (gcm, apns, jpush, mqtt) is enabled. + * All other properties configured by method of this class won't be set and default + * value would be applied.
    + * Details of properties of message and its default value, please refer to + * http://documentation.kii.com/rest/#notification_management-leverage__push_to_users__notification-group_scope-send_messages-send_a_push_message_to_the_current_topic + * + * @param data sent to all push channels (gcm, apns, jpush, mqtt). + */ + constructor(data: any); + + /** + * build push message. + * + * @return push message object. Can be used in {@link KiiTopic#sendMessage()} + */ + build(): any; + + /** + * Indicate whether send this message to development environment. + * If this method is not called, true will be applied as default. + * + * @param flag indicate whether send this message to development env. + * + * @return builder instance. + */ + setSendToDevelopment(flag: boolean): KiiPushMessageBuilder; + + /** + * Indicate whether send this message to production environment. + * If this method is not called, true will be applied as default. + * + * @param flag indicate whether send this message to production env. + * + * @return builder instance. + */ + setSendToProduction(flag: boolean): KiiPushMessageBuilder; + + /** + * Enable/ Disable message distribution via GCM. + * If this method is not called, true will be applied as default. + * + * @param enable flag indicate whether distribute this message to GCM subscribers. + * + * @return builder instance. + */ + enableGcm(enable: boolean): KiiPushMessageBuilder; + + /** + * Enable/ Disable message distribution via APNS. + * If this method is not called, true will be applied as default. + * + * @param enable flag indicate whether distribute this message to APNS subscribers. + * + * @return builder instance. + */ + enableApns(enable: boolean): KiiPushMessageBuilder; + + /** + * Enable/ Disable message distribution via JPush. + * If this method is not called, true will be applied as default. + * + * @param enable flag indicate whether distribute this message to JPush subscribers. + * + * @return builder instance. + */ + enableJpush(enable: boolean): KiiPushMessageBuilder; + + /** + * Enable/ Disable message distribution via MQTT. + * If this method is not called, true will be applied as default. + * + * @param enable flag indicate whether distribute this message to MQTT subscribers. + * + * @return builder instance. + */ + enableMqtt(enable: boolean): KiiPushMessageBuilder; + + /** + * Set specific data for GCM subscribers. + * If this method is not called, no specific data is not applied + * and data passed to the constructor would be sent to subscribers. + * + * @param data specific data applied to only GCM subscribers. + * Contents should be JSON Object with only one-level of nesting, + * and only strings in values + * + * @return builder instance. + */ + gcmData(data: { [key: string]: string }): KiiPushMessageBuilder; + + /** + * Set collapse_key for GCM subscribers. + * If this method is not called, no collapse_key is applied. + * For details please refer to GCM document of collapse_key. + * + * @param collapseKey + * + * @return builder instance. + */ + gcmCollapseKey(collapseKey: string): KiiPushMessageBuilder; + + /** + * Set delay_while_idle for GCM subscribers. + * If this method is not called, no delay_while_idle is applied. + * For details please refer to GCM document of delay_while_idle. + * + * @param delayWhileIdle + * + * @return builder instance. + */ + gcmDelayWhileIdle(delayWhileIdle: boolean): KiiPushMessageBuilder; + + /** + * Set time_to_live for GCM subscribers. + * If this method is not called, no time_to_live is applied. + * For details please refer to GCM document of time_to_live. + * + * @param timeToLive + * + * @return builder instance. + */ + gcmTimeToLive(timeToLive: number): KiiPushMessageBuilder; + + /** + * Set restricted_package_name for GCM subscribers. + * If this method is not called, no restricted_package_name is applied. + * For details please refer to GCM document of restricted_package_name. + * + * @param restrictedPackageName + * + * @return builder instance. + */ + gcmRestrictedPackageName(restrictedPackageName: string): KiiPushMessageBuilder; + + /** + * Set specific data for APNS subscribers. + * If this method is not called, no specific data is not applied + * and data passed to the constructor would be sent to subscribers. + * + * @param data specific data applied to only APNS subscribers. + * Contents should be JSON Object with only one-level of nesting, + * and only strings, integers, booleans or doubles in the values. + * + * @return builder instance. + */ + apnsData(data: { [key: string]: string | number | boolean }): KiiPushMessageBuilder; + + /** + * Set alert for APNS subscribers. + * If this method is not called, no alert is applied. + * For details please refer to APNS document of alert. + * + * @param alert alert object + * + * @return builder instance. + */ + apnsAlert(alert: string | APNSAlert): KiiPushMessageBuilder; + + /** + * Set sound for APNS subscribers. + * If this method is not called, no sound is applied. + * For details please refer to APNS document of sound. + * + * @param sound + * + * @return builder instance. + */ + apnsSound(sound: string): KiiPushMessageBuilder; + + /** + * Set badge for APNS subscribers. + * If this method is not called, no badge is applied. + * For details please refer to APNS document of badge. + * + * @param badge + * + * @return builder instance. + */ + apnsBadge(badge: number): KiiPushMessageBuilder; + + /** + * Set content-available for APNS subscribers. + * If this method is not called, no content-available is applied. + * + * @param contentAvailable If 0 or this method is not invoked, + * content-available payload is not delivered. + * Otherwise, content-available=1 payload is delivered. + * + * @return builder instance. + */ + apnsContentAvailable(contentAvailable: number): KiiPushMessageBuilder; + + /** + * Set category for APNS subscribers. + * If this method is not called, no category is applied. + * For details please refer to APNS document of category. + * + * @param category + * + * @return builder instance. + */ + apnsCategory(category: string): KiiPushMessageBuilder; + + /** + * Set specific data for JPush subscribers. + * If this method is not called, no specific data is not applied + * and data passed to the constructor would be sent to subscribers. + * + * @param data specific data applied to only JPush subscribers. + * Contents should be JSON Object with only one-level of nesting, + * and only strings, integers, booleans or doubles in the values. + * + * @return builder instance. + */ + jpushData(data: { [name: string]: string | number | boolean }): KiiPushMessageBuilder; + + /** + * Set specific data for MQTT subscribers. + * If this method is not called, no specific data is not applied + * and data passed to the constructor would be sent to subscribers. + * + * @param data specific data applied to only MQTT subscribers. + * Contents should be JSON Object with only one-level of nesting, + * and only strings in the values. + * + * @return builder instance. + */ + mqttData(data: { [key: string]: string }): KiiPushMessageBuilder; + } + + /** + * Represents a KiiPushSubscription. + */ + export class KiiPushSubscription { + /** + * Subscribe to bucket or topic. + * + * @param target to be subscribed. KiiBucket or KiiTopic instance. + * @param callbacks object contains callback functions. + * + * @return return promise object. + *
      + *
    • fulfill callback function: function(params). params is an Array instance. + *
        + *
      • params[0] is a KiiPushSubscription instance.
      • + *
      • params[1] is the KiiTopic instance to subscribe.
      • + *
      + *
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.target is a KiiPushSubscription instance.
      • + *
      • error.message
      • + *
      + *
    • + *
    + * + * @example + * // example to use callbacks directly + * var topic = Kii.topicWithName("myAppTopic"); + * var user = KiiUser.getCurrentUser(); + * user.pushSubscription().subscribe(topic, { + * success: function(subscription, topic) { + * // Succeeded. + * }, + * failure: function(error) { + * // Handle error. + * } + * }); + * + * // example to use Promise + * var topic = Kii.topicWithName("myAppTopic"); + * var user = KiiUser.getCurrentUser(); + * user.pushSubscription().subscribe(topic).then( + * function(params) { + * var subscription = params[0]; + * var topic = params[1]; + * // Succeeded. + * }, + * function(error) { + * // Handle error. + * } + * ); + */ + subscribe(target: T, callbacks?: { success(subscription: KiiPushSubscription, topic: T): any; failure(error: Error): any; }): Promise<[KiiPushSubscription, T]>; + + /** + * Unsubscribe to bucket or topic. + * + * @param target to be unsubscribed. KiiBucket or KiiTopic instance. + * @param callbacks object contains callback functions. + * + * @return return promise object. + *
      + *
    • fulfill callback function: function(params). params is an Array instance. + *
        + *
      • params[0] is a KiiPushSubscription instance.
      • + *
      • params[1] is the KiiTopic instance to unsubscribe.
      • + *
      + *
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.target is a KiiPushSubscription instance.
      • + *
      • error.message
      • + *
      + *
    • + *
    + * + * @example + * // example to use callbacks directly + * var topic = Kii.topicWithName("myAppTopic"); + * var user = KiiUser.getCurrentUser(); + * user.pushSubscription().unsubscribe(topic, { + * success: function(subscription, topic) { + * // Succeeded. + * }, + * failure: function(error) { + * // Handle error. + * } + * }); + * + * // example to use Promise + * var topic = Kii.topicWithName("myAppTopic"); + * var user = KiiUser.getCurrentUser(); + * user.pushSubscription().unsubscribe(topic).then( + * function(params) { + * var subscription = params[0]; + * var topic = params[1]; + * // Succeeded. + * }, + * function(error) { + * // Handle error. + * } + * ); + */ + unsubscribe(target: T, callbacks?: { success(subscription: KiiPushSubscription, topic: T): any; failure(error: Error): any; }): Promise<[KiiPushSubscription, T]>; + + /** + * Check subscription of bucket, topic. + * + * @param target to check subscription. KiiBucket or KiiTopic instance. + * @param callbacks object contains callback functions. + * + * @return return promise object. + *
      + *
    • fulfill callback function: function(params). params is an Array instance. + *
        + *
      • params[0] is a KiiPushSubscription instance.
      • + *
      • params[1] is the KiiTopic instance to subscribe.
      • + *
      • params[2] is Boolean value. true if subscirbed, otherwise false.
      • + *
      + *
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.target is a KiiPushSubscription instance.
      • + *
      • error.message
      • + *
      + *
    • + *
    + * + * @example + * // example to use callbacks directly + * var topic = Kii.topicWithName("myAppTopic"); + * var user = KiiUser.getCurrentUser(); + * user.pushSubscription().isSubscribed(topic, { + * success: function(subscription, topic, isSubscribed) { + * // Succeeded. + * if (isSubscribed) { + * // The topic is subscribed by current user. + * } else { + * // The topic is not subscribed by current user. + * } + * }, + * failure: function(error) { + * // Handle error. + * } + * }); + * + * // example to use Promise + * var topic = Kii.topicWithName("myAppTopic"); + * var user = KiiUser.getCurrentUser(); + * user.pushSubscription().isSubscribed(topic).then( + * function(params) { + * // Succeeded. + * var subscription = params[0]; + * var topic = params[1]; + * var isSubscribed = params[2]; + * if (isSubscribed) { + * // The topic is subscribed by current user. + * } else { + * // The topic is not subscribed by current user. + * } + * }, + * function(error) { + * // Handle error. + * } + * ); + */ + isSubscribed(target: T, callbacks?: { success(subscription: KiiPushSubscription, topic: T, isSubscribed: boolean): any; failure(error: Error): any; }): Promise<[KiiPushSubscription, T, boolean]>; + } + + /** + * Represents a KiiQuery object + */ + export class KiiQuery { + /** + * Get the limit of the current query + * + * @return + */ + getLimit(): number; + + /** + * Set the limit of the given query + * + * @param value The desired limit. Must be an integer > 0 + * + * @throws InvalidLimitException + */ + setLimit(value: number): void; + + /** + * Create a KiiQuery object based on a KiiClause + *

    + * By passing null as the ‘clause’ parameter, all objects can be retrieved. + * + * @param clause The KiiClause to be executed with the query + */ + static queryWithClause(clause: KiiClause): KiiQuery; + + /** + * Set the query to sort by a field in descending order + * + * If a sort has already been set, it will be overwritten. + * + * @param field The key that should be used to sort + */ + sortByDesc(field: string): void; + + /** + * Set the query to sort by a field in ascending order + * + * If a sort has already been set, it will be overwritten. + * + * @param field The key that should be used to sort + */ + sortByAsc(field: string): void; + } + + /** + * Represents a server side code entry in KiiCloud. + */ + export class KiiServerCodeEntry { + /** + * Execute this server code entry.
    + * If argument is an empty object or not type of Object, callbacks.failure or reject callback of promise will be called.
    + * + * @param argument pass to the entry of script in the cloud. + * If null is specified, no argument pass to the script. + * @param callbacks called on completion of execution. + * + * @return return promise object. + *
      + *
    • fulfill callback function: function(params). params is Array instance. + *
        + *
      • params[0] is the KiiServerCodeEntry instance which this method was called on.
      • + *
      • params[1] is the passed argument object.
      • + *
      • params[2] is a KiiServerCodeExecResult instance.
      • + *
      + *
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.target is the KiiServerCodeEntry instance which this method was called on.
      • + *
      • error.message
      • + *
      • error.argument is passed argument object.
      • + *
      + *
    • + *
    + * + * @example + * // example to use callbacks directly + * // Instantiate with the endpoint. + * var entry = Kii.serverCodeEntry("main"); + * + * // Set the custom parameters. + * var arg = {"username":"name_of_my_friend", "password":"password_for_my_friend"}; + * + * // Example of executing the Server Code + * entry.execute(arg, { + * + * success: function(entry, argument, execResult) { + * // do something now that the user is logged in + * }, + * + * failure: function(entry, argument, execResult, anErrorString) { + * // do something with the error response + * } + * }); + * + * // example to use Promise + * // Instantiate with the endpoint. + * var entry = Kii.serverCodeEntry("main"); + * + * // Set the custom parameters. + * var arg = {"username":"name_of_my_friend", "password":"password_for_my_friend"}; + * + * // Example of executing the Server Code + * entry.execute(arg).then( + * function(params) { + * var entry = params[0]; + * var argument = params[1]; + * var execResult = params[2]; + * // do something + * }, + * function(error) { + * // do something with the error response + * } + * ); + */ + execute(argument: T, callbacks?: { success(entry: KiiServerCodeEntry, argument: T, execResult: KiiServerCodeExecResult): any; failure(entry: KiiServerCodeEntry, argument: T, execResult: KiiServerCodeExecResult, anErrorString: string): any; }): Promise<[KiiServerCodeEntry, T, KiiServerCodeExecResult]>; + + /** + * Get the entryName of this server code entry. + * + * @return entryName. + */ + getEntryName(): string; + } + + /** + * Represents a server side code execution result in KiiCloud. + */ + export class KiiServerCodeExecResult { + /** + * Get calculated number of executed steps. + * + * @return calculated number of executed steps + */ + getExecutedSteps(): number; + + /** + * Get Object returned by server code entry. + * + * @return returned by server code entry. + */ + getReturnedValue(): any; + } + + /** + * Represents a KiiSocialConnect object + */ + export class KiiSocialConnect { + /** + * + * + * @deprecated You don't have to call this method. + * Set up a reference to one of the supported KiiSocialNetworks. + * + * Set up the network. Need to be called before accessing other methods. + *
    Facebook + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
    ArgumentValue TypeValueNote
    networkNameNumberKiiSocialNetworkName.FACEBOOKSpecify Facebook
    apiKeyStringnullFacebook does not requires this argument.
    apiSecretStringnullFacebook does not requires this argument.
    extrasObjectnullFacebook does not requires this argument.
    + * + *
    Twitter + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
    ArgumentValue TypeValueNote
    networkNameNumberKiiSocialNetworkName.TWITTERSpecify Twitter
    apiKeyStringnullTwitter does not requires this argument.
    apiSecretStringnullTwitter does not requires this argument.
    extrasObjectnullTwitter does not requires this argument.
    + *
    QQ + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
    ArgumentValue TypeValueNote
    networkNameNumberKiiSocialNetworkName.QQSpecify QQ
    apiKeyStringnullQQ does not requires this argument.
    apiSecretStringnullQQ does not requires this argument.
    extrasObjectnullQQ does not requires this argument.
    + * + * @param networkName One of the supported KiiSocialNetworkName values + * @param apiKey The SDK key assigned by the social network provider. For details refer to the table above. + * @param apiSecret The SDK secret assigned by the social network provider. For details refer to the table above. + * @param extras Extra options that should be passed to the SNS. For details refer to the table above. + * + * @throws For details refer to the table above + */ + static setupNetwork(networkName: KiiSocialNetworkName, apiKey: string, apiSecret: string, extras: any): void; + + /** + * Log a user into the social network provided + * + * This will initiate the login process for the given network. If user has already linked with the specified social network, + * sign-in with the social network. Otherwise, this will sign-up and create new user authenticated by the specified social network. + * If sign-up successful, the user is cached inside SDK as current user,and accessible via {@link KiiUser.getCurrentUser()}. + * User token and token expiration is also cached and can be get by {@link KiiUser#getAccessTokenObject()}. + * Access token won't be expired unless you set it explicitly by {@link Kii.setAccessTokenExpiration()}. + * The network must already be set up via setupNetwork
    + * If the opitons is invalid, callbacks.failure or reject callback of promise will be called.
    + * + * @param networkName One of the supported KiiSocialNetworkName values + * @param options A dictionary of key/values to pass to KiiSocialConnect + * + *
    Facebook + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
    KeyValue typeValueNote
    access_tokenStringAccess token of Facebook.This is mandatory.
    + * + *
    Twitter + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
    KeyValue typeValueNote
    oauth_tokenStringOAuth access token of twitter.This is mandatory.
    oauth_token_secretStringOAuth access token secret of twitter.This is mandatory.
    + * + *
    Google + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
    KeyValue typeValueNote
    access_tokenStringAccess token of Google.This is mandatory.
    + * + *
    Renren + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
    KeyValue typeValueNote
    access_tokenStringAccess token of Renren.This is mandatory.
    + * + *
    QQ + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
    KeyValue typeValueNote
    access_tokenStringAccess token of QQ.This is mandatory.
    openIDStringOpenID of QQ.This is mandatory.
    + * @param callbacks An object with callback methods defined + * + * @return return promise object. + *
      + *
    • fulfill callback function: function(params). params is Array instance. + *
        + *
      • params[0] is a logged in KiiUser instance.
      • + *
      • params[1] is the KiiSocialNetworkName used to login.
      • + *
      + *
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.message
      • + *
      • error.network is the KiiSocialNetworkName used to login.
      • + *
      + *
    • + *
    + * + * @example + * // example to use callbacks directly + * // Example of using no option + * KiiSocialConnect.logIn(KiiSocialNetworkName.FACEBOOK, null, { + * + * success: function(user, network) { + * // do something now that the user is logged in + * }, + * + * failure: function(user, network, anErrorString) { + * // do something with the error response + * } + * }); + * + * // example to use Promise + * KiiSocialConnect.logIn(KiiSocialNetworkName.FACEBOOK, null).then( + * function(params) { + * // do something now that the user is logged in + * }, + * function(error) { + * // do something with the error response + * } + * ); + */ + static logIn(networkName: KiiSocialNetworkName, options: KiiSocialConnectOptions, callbacks?: { success(user: KiiUser, network: KiiSocialNetworkName): any; failure(user: KiiUser, network: KiiSocialNetworkName, anErrorString: string): any; }): Promise<[KiiUser, KiiSocialNetworkName]>; + + /** + * Link the currently logged in user with a social network + * + * This will initiate the login process for the given network, which for SSO-enabled services like Facebook, will send the user to the Facebook site for authentication. There must be a currently authenticated KiiUser. Otherwise, you can use the logIn: method to create and log in a KiiUser using a network. The network must already be set up via setupNetwork
    + * If there is not logged-in user to link with, callbacks.failure or reject callback of promise will be called.
    + * If the opitons is invalid, callbacks.failure or reject callback of promise will be called.
    + * + * @param networkName One of the supported KiiSocialNetworkName values + * @param options A dictionary of key/values to pass to KiiSocialConnect + *
    Facebook + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
    KeyValue typeValueNote
    access_tokenStringAccess token of Facebook.This is mandatory.
    + * + *
    Twitter + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
    KeyValue typeValueNote
    oauth_tokenStringOAuth access token of twitter.This is mandatory.
    oauth_token_secretStringOAuth access token secret of twitter.This is mandatory.
    + * + *
    Google + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
    KeyValue typeValueNote
    access_tokenStringAccess token of Google.This is mandatory.
    + * + *
    Renren + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
    KeyValue typeValueNote
    access_tokenStringAccess token of Renren.This is mandatory.
    + * + *
    QQ + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
    KeyValue typeValueNote
    access_tokenStringAccess token of QQ.This is mandatory.
    openIDStringOpenID of QQ.This is mandatory.
    + * @param callbacks An object with callback methods defined + * + * @return return promise object. + *
      + *
    • fulfill callback function: function(params). params is Array instance. + *
        + *
      • params[0] is a linked KiiUser instance.
      • + *
      • params[1] is the KiiSocialNetworkName used to link.
      • + *
      + *
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.target is current logged-in KiiUser instance. If there is not logged-in user, it will be null.
      • + *
      • error.message
      • + *
      • error.network is the KiiSocialNetworkName used to link.
      • + *
      + *
    • + *
    + * + * @example + * // example to use callbacks directly + * // Example of using no option + * KiiSocialConnect.linkCurrentUserWithNetwork(KiiSocialNetworkName.FACEBOOK, null, { + * + * success: function(user, network) { + * // do something now that the user is linked + * }, + * + * failure: function(user, network, anErrorString) { + * // do something with the error response + * } + * }); + * + * // example to use Promise + * // Example of using no option + * KiiSocialConnect.linkCurrentUserWithNetwork(KiiSocialNetworkName.FACEBOOK, null).then( + * function(params) { + * // do something now that the user is linked + * }, + * function(error) { + * // do something with the error response + * } + * ); + */ + static linkCurrentUserWithNetwork(networkName: KiiSocialNetworkName, options: KiiSocialConnectOptions, callbacks?: { success(user: KiiUser, network: KiiSocialNetworkName): any; failure(user: KiiUser, network: KiiSocialNetworkName, anErrorString: string): any; }): Promise<[KiiUser, KiiSocialNetworkName]>; + + /** + * Unlink the currently logged in user with a social network + * + * The network must already be set up via setupNetwork + * + * @param networkName One of the supported KiiSocialNetworkName values + * @param callbacks An object with callback methods defined + * + * @return return promise object. + *
      + *
    • fulfill callback function: function(params). params is Array instance. + *
        + *
      • params[0] is a unlinked KiiUser instance.
      • + *
      • params[1] is the KiiSocialNetworkName used to unlink.
      • + *
      + *
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.target is current logged-in KiiUser instance. If there is not logged-in user, it will be null.
      • + *
      • error.message
      • + *
      • error.network is the KiiSocialNetworkName used to unlink.
      • + *
      + *
    • + *
    + * + * @example + * + * // example to use callbacks directly + * KiiSocialConnect.unLinkCurrentUserFromNetwork(KiiSocialNetworkName.FACEBOOK, { + * + * success: function(user, network) { + * // do something now that the user is unlinked + * }, + * + * failure: function(user, network, anErrorString) { + * // do something with the error response + * } + * }); + * + * // example to use Promise + * KiiSocialConnect.unLinkCurrentUserFromNetwork(KiiSocialNetworkName.FACEBOOK).then( + * function(params) { + * // do something now that the user is unlinked + * }, + * function(error) { + * // do something with the error response + * } + * ); + */ + static unLinkCurrentUserFromNetwork(networkName: KiiSocialNetworkName, callbacks?: { success(user: KiiUser, network: KiiSocialNetworkName): any; failure(user: KiiUser, network: KiiSocialNetworkName, anErrorString: string): any; }): Promise<[KiiUser, KiiSocialNetworkName]>; + + /** + * Retrieve the current user's access token from a social network + * The network must be set up and linked to the current user. It is recommended you save this to preferences for multi-session use. + * + * @deprecated Use {@link KiiSocialConnect.getAccessTokenObjectForNetwork} instead. + * + * @param networkName One of the supported KiiSocialNetworkName values + * + * @return The current access token, null if unavailable + */ + static getAccessTokenForNetwork(networkName: KiiSocialNetworkName): string; + + /** + * Retrieve the current user's access token expiration date from a social network + * + * The network must be set up and linked to the current user. It is recommended you save this to preferences for multi-session use. + * + * @deprecated Use {@link KiiSocialConnect.getAccessTokenObjectForNetwork} instead. + * + * @param networkName One of the supported KiiSocialNetworkName values + * + * @return The current access token expiration date, null if unavailable + */ + static getAccessTokenExpirationForNetwork(networkName: KiiSocialNetworkName): string; + + /** + * Retrieve the current user's access token object from a social network + * + * The network must be set up and linked to the current user. + * It is recommended you save this to preferences for multi-session use.

    + * Following parameters can be assigned to object.

    + * Facebook + *
  • access_token
  • + *
  • expires_in
  • + *
  • kii_new_user
  • + *
    + * Twitter + *
  • oauth_token
  • + *
  • oauth_token_secret
  • + *
  • kii_new_user
  • + *
    + * Google + *
  • access_token
  • + *
  • kii_new_user
  • + *
    + * RenRen + *
  • access_token
  • + *
  • kii_new_user
  • + *
    + * QQ + *
  • access_token
  • + *
  • openID
  • + *
  • kii_new_user
  • + * + * @param networkName One of the supported KiiSocialNetworkName values + * + * @return tokenObject The current access token object, null if unavailable. + */ + static getAccessTokenObjectForNetwork(networkName: KiiSocialNetworkName): any; + } + + /** + * Represents a Thing object + */ + export class KiiThing { + /** + * of this thing. + * For details refer to {@link KiiThing.register} + */ + fields: KiiThingFields; + + /** + * Get thing ID. + * + * @return thing id + */ + getThingID(): string; + + /** + * Get vendor thing ID. + * + * @return vendor thing id + */ + getVendorThingID(): string; + + /** + * Get access token of this thing. + * + * @return access token of this thing. + */ + getAccessToken(): string; + + /** + * Get created time of this thing. + * + * @return created time of this thing. + */ + getCreated(): Date; + + /** + * Get disabled status of this thing. + * + * @return true if thing is disabled, false otherwise. + */ + getDisabled(): boolean; + + /** + * Register thing in KiiCloud.
    + * This API doesnt require users login Anonymous user can register thing. + *
    + * Propertis started with '_' in the fields is reserved by Kii Cloud.
    + * Those properties are indexed in Kii Cloud storage.
    + * Properties not started with '_' is custom properties defined by developer.
    + * Custom properties are not indexed in KiiCloud storage.
    + * Following properties are readonly and ignored on creation/{@link #update} of thing.
    + * '_thingID', '_created', '_accessToken'
    + * Following properties are readonly after creation and will be ignored on {@link #update} of thing.
    + * '_vendorThingID', '_password'
    + * + * @param fields of the thing to be registered. + * @param callbacks object holds callback functions. + * + * @return return promise object. + *
      + *
    • fulfill callback function: function(thing). thing is a KiiThing instance.
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.target is the KiiThing instance.
      • + *
      • error.message
      • + *
      + *
    • + *
    + * + * @example + * // example to use callbacks directly + * KiiThing.register( + * { + * _vendorThingID: "thing-XXXX-YYYY-ZZZZZ", + * _password: "thing-password", + * _thingType: "thermometer", + * yourCustomObj: // Arbitrary key can be used. + * { // Object, Array, Number, String can be used. Should be compatible with JSON. + * yourCustomKey1: "value", + * yourCustomKey2: 100 + * } + * }, + * { + * success: function(thing) { + * // Register Thing succeeded. + * }, + * failure: function(error) { + * // Handle error. + * } + * } + * ); + * + * // example to use Promise + * KiiThing.register( + * { + * _vendorThingID: "thing-XXXX-YYYY-ZZZZZ", + * _password: "thing-password", + * _thingType: "thermometer", + * yourCustomObj: // Arbitrary key can be used. + * { // Object, Array, Number, String can be used. Should be compatible with JSON. + * yourCustomKey1: "value", + * yourCustomKey2: 100 + * } + * } + * ).then( + * function(thing) { + * // Register Thing succeeded. + * }, + * function(error) { + * // Handle error. + * } + * ); + */ + static register(fields: KiiThingFields, callbacks?: { success(thing: KiiThing): any; failure(error: Error): any; }): Promise; + + /** + * Retrieve the latest thing information from KiiCloud. + *
    This API is authorized by owner of thing. + *
    Need user login who owns this thing before execute this API. + *
    To let users to own thing, please call {@link KiiThing#registerOwner} + *
    Note: if you obtain thing instance from {@link KiiAppAdminContext}, + * API is authorized by app admin.
    + * + * @param callbacks object holds callback functions. + * + * @return return promise object. + *
      + *
    • fulfill callback function: function(thing). thing is KiiThing instance.
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.target is the KiiThing instance which this method was called on.
      • + *
      • error.message
      • + *
      + *
    • + *
    + * + * @example + * // example to use callbacks directly + * // assume thing is already registered. + * thing.refresh({ + * success: function(thing) { + * // Refresh succeeded. + * }, + * failure: function(error) { + * // Handle error. + * } + * }); + * + * // example to use Promise + * // assume thing is already registered. + * thing.refresh().then( + * function(thing) { + * // Refresh succeeded. + * }, + * function(error) { + * // Handle error. + * } + * ); + */ + refresh(callbacks?: { success(thing: KiiThing): any; failure(error: Error): any; }): Promise; + + /** + * Update registered thing information in Kii Cloud + *
    This API is authorized by owner of thing. + *
    Need user login who owns this thing before execute this API. + *
    To let users to own thing, please call {@link KiiThing#registerOwner} + *
    Note: if you obtain thing instance from {@link KiiAppAdminContext}, + * API is authorized by app admin.
    + * + * @param callbacks object holds callback functions. + * + * @return return promise object. + *
      + *
    • fulfill callback function: function(thing). thing is a KiiThing instance.
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.target is the KiiThing instance which this method was called on.
      • + *
      • error.message
      • + *
      + *
    • + *
    + * + * @see KiiThing.register + * + * @example + * // example to use callbacks directly + * // assume thing is already registered. + * thing.fields._stringField1 = "new string value"; + * thing.fields.customObject = { + * "customField1" : "abcd", + * "customField2" : 123 + * }; + * thing.update({ + * success: function(thing) { + * // Update succeeded. + * }, + * failure: function(error) { + * // Handle error. + * } + * }); + * + * // example to use Promise + * // assume thing is already registered. + * thing.fields._stringField1 = "new string value"; + * thing.fields.customObject = { + * "customField1" : "abcd", + * "customField2" : 123 + * }; + * thing.update().then( + * function(thing) { + * // Update succeeded. + * }, + * function(error) { + * // Handle error. + * } + * ); + */ + update(callbacks?: { success(thing: KiiThing): any; failure(error: Error): any; }): Promise; + + /** + * Delete registered thing in Kii Cloud. + *
    This API is authorized by owner of thing. + *
    Need user login who owns this thing before execute this API. + *
    To let users to own thing, please call {@link KiiThing#registerOwner} + *
    Note: if you obtain thing instance from {@link KiiAppAdminContext}, + * API is authorized by app admin.
    + * + * It will delete bucket, topic which belongs to this thing, + * entity belongs to the bucket/topic and all ownership information of thing. + * This operation can not be reverted. Please carefully use this. + * + * @param callbacks object holds callback functions. + * + * @return return promise object. + *
      + *
    • fulfill callback function: function(thing). thing is a KiiThing instance.
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.target is the KiiThing instance which this method was called on.
      • + *
      • error.message
      • + *
      + *
    • + *
    + * + * @example + * // example to use callbacks directly + * // assume thing is already registered. + * thing.deleteThing({ + * success: function(thing) { + * // Delete succeeded. + * }, + * failure: function(error) { + * // Handle error. + * } + * }); + * + * // example to use Promise + * // assume thing is already registered. + * thing.deleteThing().then( + * function(thing) { + * // Delete succeeded. + * }, + * function(error) { + * // Handle error. + * } + * ); + */ + deleteThing(callbacks?: { success(thing: KiiThing): any; failure(error: Error): any; }): Promise; + + /** + * Check if user/ group is owner of the thing. + *
    This API is authorized by owner of thing. + *
    Need user login before execute this API. + *
    To let users to own Thing, please call {@link KiiThing#registerOwner} + *
    Note: if you obtain thing instance from {@link KiiAppAdminContext}, + * API is authorized by app admin.
    + * + * @param owner whether the instance is owner of thing or not. + * @param callbacks object holds callback functions. + * + * @return return promise object. + *
      + *
    • fulfill callback function: function(params). params is an Array instance. + *
        + *
      • params[0] is the KiiThing instance which this method was called on.
      • + *
      • params[1] is a KiiUser/KiiGroup instance.
      • + *
      • params[2] is Boolean value, true is the user/group is owner of the thing, otherwise false.
      • + *
      + *
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.target is the KiiThing instance which this method was called on.
      • + *
      • error.message
      • + *
      + *
    • + *
    + * + * @example + * // example to use callbacks directly + * // assume thing/user is already registered. + * var user = KiiUser.userWithURI("kiicloud://users/xxxyyyy"); + * thing.isOwner(user, { + * success: function(thing, user, isOwner) { + * if (isOwner) { + * // user is owner of the thing. + * } else { + * // user is not owner of the thing. + * } + * }, + * failure: function(error) { + * // Handle error. + * } + * }); + * + * // example to use Promise + * // assume thing/user is already registered. + * var user = KiiUser.userWithURI("kiicloud://users/xxxyyyy"); + * thing.isOwner(user).then( + * function(params) { + * var thing = params[0]; + * var user = params[1]; + * var isOwner = params[2]; + * if (isOwner) { + * // user is owner of the thing. + * } else { + * // user is not owner of the thing. + * } + * }, + * function(error) { + * // Handle error. + * } + * ); + */ + isOwner(owner: T, callbacks?: { success(thing: KiiThing, user: T, isOwner: boolean): any; failure(error: Error): any; }): Promise<[KiiThing, T, boolean]>; + + /** + * Register user/group as owner of this thing. + *
    Need user login before execute this API. + *
    Note: if you obtain thing instance from {@link KiiAppAdminContext}, + * API is authorized by app admin.
    + * + * @param owner to be registered as owner. + * @param callbacks object holds callback functions. + * + * @return return promise object. + *
      + *
    • fulfill callback function: function(params). params is an Array instance. + *
        + *
      • params[0] is the KiiThing instance which this method was called on.
      • + *
      • params[1] is a KiiUser/KiiGroup instance.
      • + *
      + *
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.target is the KiiThing instance which this method was called on.
      • + *
      • error.message
      • + *
      + *
    • + *
    + * + * @example + * // example to use callbacks directly + * // assume thing/group is already registered. + * var group = KiiGroup.groupWithURI("kiicloud://groups/xxxyyyy"); + * thing.registerOwner(group, { + * success: function(thing, group) { + * // Register owner succeeded. + * }, + * failure: function(error) { + * // Handle error. + * } + * }); + * + * // example to use Promise + * // assume thing/group is already registered. + * var group = KiiGroup.groupWithURI("kiicloud://groups/xxxyyyy"); + * thing.registerOwner(group).then( + * function(params) { + * // Register owner succeeded. + * var thing = params[0]; + * var group = params[1]; + * }, + * function(error) { + * // Handle error. + * } + * ); + */ + registerOwner(owner: T, callbacks?: { success(thing: KiiThing, group: T): any; failure(error: Error): any; }): Promise<[KiiThing, T]>; + + /** + * Register user/group as owner of specified thing. + *
    Need user login before execute this API. + *
    Note: if you obtain thing instance from {@link KiiAppAdminContext}, + * API is authorized by app admin.
    + * + * @param thingID The ID of thing + * @param owner to be registered as owner. + * @param callbacks object holds callback functions. + * + * @return return promise object. + *
      + *
    • fulfill callback function: function(params). params is an Array instance. + *
        + *
      • params[0] is a KiiUser/KiiGroup instance.
      • + *
      + *
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.message
      • + *
      + *
    • + *
    + * + * @example + * // example to use callbacks directly + * // assume thing/group is already registered. + * var group = KiiGroup.groupWithURI("kiicloud://groups/xxxyyyy"); + * KiiThing.registerOwnerWithThingID("th.xxxx-yyyy-zzzz", group, { + * success: function(group) { + * // Register owner succeeded. + * }, + * failure: function(error) { + * // Handle error. + * } + * }); + * + * // example to use Promise + * // assume thing/group is already registered. + * var group = KiiGroup.groupWithURI("kiicloud://groups/xxxyyyy"); + * KiiThing.registerOwnerWithThingID("th.xxxx-yyyy-zzzz", group).then( + * function(params) { + * // Register owner succeeded. + * var group = params[0]; + * }, + * function(error) { + * // Handle error. + * } + * ); + */ + static registerOwnerWithThingID(thingID: string, owner: T, callbacks?: { success(group: T): any; failure(error: Error): any; }): Promise; + + /** + * Register user/group as owner of specified thing. + *
    Need user login before execute this API. + *
    Note: if you obtain thing instance from {@link KiiAppAdminContext}, + * API is authorized by app admin.
    + * + * @param vendorThingID The vendor thing ID of thing + * @param owner to be registered as owner. + * @param callbacks object holds callback functions. + * + * @return return promise object. + *
      + *
    • fulfill callback function: function(params). params is an Array instance. + *
        + *
      • params[0] is a KiiUser/KiiGroup instance.
      • + *
      + *
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.message
      • + *
      + *
    • + *
    + * + * @example + * // example to use callbacks directly + * // assume thing/group is already registered. + * var group = KiiGroup.groupWithURI("kiicloud://groups/xxxyyyy"); + * KiiThing.registerOwnerWithVendorThingID("xxxx-yyyy-zzzz", group, { + * success: function(group) { + * // Register owner succeeded. + * }, + * failure: function(error) { + * // Handle error. + * } + * }); + * + * // example to use Promise + * // assume thing/group is already registered. + * var group = KiiGroup.groupWithURI("kiicloud://groups/xxxyyyy"); + * KiiThing.registerOwnerWithVendorThingID("xxxx-yyyy-zzzz", group).then( + * function(group) { + * // Register owner succeeded. + * }, + * function(error) { + * // Handle error. + * } + * ); + */ + static registerOwnerWithVendorThingID(vendorThingID: string, owner: T, callbacks?: { success(group: T): any; failure(error: Error): any; }): Promise; + + /** + * Remove ownership of thing from specified user/group. + *
    This API is authorized by owner of thing. + *
    Need user login who owns this thing before execute this API. + *
    Note: if you obtain thing instance from {@link KiiAppAdminContext}, + * API is authorized by app admin.
    + * + * @param owner to be unregistered. + * @param callbacks object holds callback functions. + * + * @return return promise object. + *
      + *
    • fulfill callback function: function(params). params is an Array instance. + *
        + *
      • params[0] is the KiiThing instance which this method was called on.
      • + *
      • params[1] is a KiiUser/KiiGroup instance which had ownership of the thing removed.
      • + *
      + *
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.target is the KiiThing instance which this method was called on.
      • + *
      • error.message
      • + *
      + *
    • + *
    + * + * @example + * // example to use callbacks directly + * // assume thing/group is already registered. + * var group = KiiGroup.groupWithURI("kiicloud://groups/xxxyyyy"); + * thing.unregisterOwner(group, { + * success: function(thing, group) { + * // Unregister owner succeeded. + * }, + * failure: function(error) { + * // Handle error. + * } + * }); + * + * // example to use Promise + * // assume thing/group is already registered. + * var group = KiiGroup.groupWithURI("kiicloud://groups/xxxyyyy"); + * thing.unregisterOwner(group).then( + * function(params) { + * // Unregister owner succeeded. + * }, + * function(error) { + * // Handle error. + * } + * ); + */ + unregisterOwner(owner: T, callbacks?: { success(thing: KiiThing, group: T): any; failure(error: Error): any; }): Promise<[KiiThing, T]>; + + /** + * Disable the thing. + *
    This API is authorized by owner of thing. + *
    Need user login who owns this thing before execute this API. + *
    To let users to own Thing, please call {@link KiiThing#registerOwner} + *
    Note: if you obtain thing instance from {@link KiiAppAdminContext}, + * API is authorized by app admin.
    + * + * After succeeded, access token published for thing is disabled. + * In a result, only the app administrator and owners of thing can access the thing. + * Used when user lost the thing and avoid using by unknown users. + * It doesn't throw error when the thing is already disabled. + * + * @param callbacks object holds callback functions. + * + * @return return promise object. + *
      + *
    • fulfill callback function: function(thing). thing is a KiiThing instance.
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.target is the KiiThing instance which this method was called on.
      • + *
      • error.message
      • + *
      + *
    • + *
    + * + * @example + * // example to use callbacks directly + * // assume thing is already registered. + * thing.disable({ + * success: function(thing) { + * // Disable succeeded. + * }, + * failure: function(error) { + * // Handle error. + * } + * }); + * + * // example to use Promise + * // assume thing is already registered. + * thing.disable().then( + * function(thing) { + * // Disable succeeded. + * }, + * function(error) { + * // Handle error. + * } + * ); + */ + disable(callbacks?: { success(thing: KiiThing): any; failure(error: Error): any; }): Promise; + + /** + * Enable the thing. + *
    This API is authorized by owner of thing. + *
    Need user login who owns this thing before execute this API. + *
    To let users to own Thing, please call {@link KiiThing#registerOwner} + *
    Note: if you obtain thing instance from {@link KiiAppAdminContext}, + * API is authorized by app admin.
    + * + * After succeeded, If thing is registered with "persistentToken" option, + * token should be recovered (Access token which is used before disabling can be available). + * Otherwise, it does not recovered. + * It doesn't throw error when the thing is already enabled. + * + * @param callbacks object holds callback functions. + * + * @return return promise object. + *
      + *
    • fulfill callback function: function(thing). thing is a KiiThing instance.
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.target is the KiiThing instance which this method was called on.
      • + *
      • error.message
      • + *
      + *
    • + *
    + * + * @example + * // example to use callbacks directly + * // assume thing is already registered. + * thing.enable({ + * success: function(thing) { + * // Enable succeeded. + * }, + * failure: function(error) { + * // Handle error. + * } + * }); + * + * // example to use Promise + * // assume thing is already registered. + * thing.enable().then( + * function(thing) { + * // Disable succeeded. + * }, + * function(error) { + * // Handle error. + * } + * ); + */ + enable(callbacks?: { success(thing: KiiThing): any; failure(error: Error): any; }): Promise; + + /** + * Load thing with given vendor thing id. + *
    This API is authorized by owner of thing. + *
    Need user login who owns this thing before execute this API. + *
    To let users to own Thing, please call {@link KiiThing#registerOwner} + *
    Note: if you obtain thing instance from {@link KiiAppAdminContext}, + * API is authorized by app admin.
    + * + * @param vendorThingID registered vendor thing id. + * @param callbacks object holds callback functions. + * + * @return return promise object. + *
      + *
    • fulfill callback function: function(thing). thing is a KiiThing instance.
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.message
      • + *
      + *
    • + *
    + * + * @example + * // example to use callbacks directly + * KiiThing.loadWithVendorThingID("thing-xxxx-yyyy",{ + * success: function(thing) { + * // Load succeeded. + * }, + * failure: function(error) { + * // Handle error. + * } + * }); + * + * // example to use Promise + * KiiThing.loadWithVendorThingID("thing-xxxx-yyyy").then( + * function(thing) { + * // Load succeeded. + * }, + * function(error) { + * // Handle error. + * } + * ); + */ + static loadWithVendorThingID(vendorThingID: string, callbacks?: { success(thing: KiiThing): any; failure(error: Error): any; }): Promise; + + /** + * Load thing with thing id given by Kii Cloud. + *
    This API is authorized by owner of thing. + *
    Need user login who owns this thing before execute this API. + *
    To let users to own Thing, please call {@link KiiThing#registerOwner} + *
    Note: if you obtain thing instance from {@link KiiAppAdminContext}, + * API is authorized by app admin.
    + * + * thing id can be obtained by {@link thingID} + * + * @param thingID registered thing id. + * @param callbacks object holds callback functions. + * + * @return return promise object. + *
      + *
    • fulfill callback function: function(thing). thing is a KiiThing instance.
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.message
      • + *
      + *
    • + *
    + * + * @example + * // example to use callbacks directly + * KiiThing.loadWithThingID("thing-xxxx-yyyy",{ + * success: function(thing) { + * // Load succeeded. + * }, + * failure: function(error) { + * // Handle error. + * } + * }); + * + * // example to use Promise + * KiiThing.loadWithVendorThingID("thing-xxxx-yyyy").then( + * function(thing) { + * // Load succeeded. + * }, + * function(error) { + * // Handle error. + * } + * ); + */ + static loadWithThingID(thingID: string, callbacks?: { success(thing: KiiThing): any; failure(error: Error): any; }): Promise; + + /** + * Instantiate bucket belongs to this thing. + * + * @param bucketName name of the bucket. + * + * @return bucket instance. + */ + bucketWithName(bucketName: string): KiiBucket; + + /** + * Creates a reference to a encrypted bucket for this thing + * + *

    The bucket will be created/accessed within this thing's scope + * + * @param bucketName The name of the bucket the user should create/access + * + * @return A working KiiEncryptedBucket object + * + * @example + * var thing = . . .; // a KiiThing + * var bucket = thing.encryptedBucketWithName("myBucket"); + */ + encryptedBucketWithName(bucketName: string): KiiBucket; + + /** + * Instantiate topic belongs to this thing. + * + * @param topicName name of the topic. Must be a not empty string. + * + * @return topic instance. + */ + topicWithName(topicName: string): KiiTopic; + + /** + * Gets a list of topics in this thing scope + * + * @param callbacks An object with callback methods defined + * @param paginationKey You can specify the pagination key with the nextPaginationKey passed by callbacks.success. If empty string or no string object is provided, this API regards no paginationKey specified. + * + * @return return promise object. + *
      + *
    • fulfill callback function: function(params). params is Array instance. + *
        + *
      • params[0] is array of KiiTopic instances.
      • + *
      • params[1] is string of nextPaginationKey.
      • + *
      + *
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.target is the KiiThing instance which this method was called on.
      • + *
      • error.message
      • + *
      + *
    • + *
    + * + * @example + * // example to use callbacks directly + * var thing = . . .; // a KiiThing + * thing.listTopics({ + * success: function(topicList, nextPaginationKey) { + * // do something with the result + * for(var i=0; i<topicList.length; i++){ + * var topic = topicList[i]; + * } + * if (nextPaginationKey != null) { + * thing.listTopics({ + * success: function(topicList, nextPaginationKey) {...}, + * failure: function(anErrorString) {...} + * }, nextPaginationKey); + * } + * }, + * failure: function(anErrorString) { + * // do something with the error response + * } + * }); + * + * // example to use promise + * var thing = . . .; // a KiiThing + * thing.listTopics().then( + * function(params) { + * var topicList = params[0]; + * var nextPaginationKey = params[1]; + * // do something with the result + * for(var i=0; i<topicList.length; i++){ + * var topic = topicList[i]; + * } + * if (nextPaginationKey != null) { + * thing.listTopics(null, nextPaginationKey).then( + * function(params) {...}, + * function(error) {...} + * ); + * } + * }, + * function(error) { + * // do something with the error response + * } + * ); + */ + listTopics(callbacks?: { success(topicList: KiiTopic[], nextPaginationKey: string): any; failure(anErrorString: string): any; }, paginationKey?: string): Promise<[KiiTopic[], string]>; + + /** + * Instantiate push subscription for this thing. + * + * @return push subscription object. + */ + pushSubscription(): KiiPushSubscription; + } + + /** + * Represents a Topic object. + */ + export class KiiTopic { + /** + * get name of this topic + * + * @return name of this topic. + */ + getName(): string; + + /** + * Checks whether the topic already exists or not. + * + * @param callbacks An object with callback methods defined + * + * @return return promise object. + *
      + *
    • fulfill callback function: function(existed). true if the topic exists.
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.target is the KiiTopic instance which this method was called on.
      • + *
      • error.message
      • + *
      + *
    • + *
    + * + * @example + * // example to use callbacks directly + * // assume topic is already instantiated. + * topic.exists({ + * success: function(existed) { + * }, + * failure: function(error) { + * // Handle error. + * } + * }); + * + * // example to use Promise + * // assume topic is already instantiated. + * topic.exists().then( + * function(existed){ + * }, + * function(error){ + * // Handle error. + * }); + */ + exists(callbacks?: { success(existed: boolean): any; failure(error: Error): any; }): Promise; + + /** + * Save this topic on Kii Cloud. + * Note that only app admin can save application scope topic. + * + * @param callbacks callback functions. + * + * @return return promise object. + *
      + *
    • fulfill callback function: function(theSavedTopic). theSavedTopic is a KiiTopic instance.
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.target is the KiiTopic instance which this method was called on.
      • + *
      • error.message
      • + *
      + *
    • + *
    + * + * @example + * // example to use callbacks directly + * // assume topic is already instantiated. + * topic.save({ + * success: function(topic) { + * // Save topic succeeded. + * }, + * failure: function(error) { + * // Handle error. + * } + * }); + * + * // example to use Promise + * // assume topic is already instantiated. + * topic.save().then( + * function(topic) { + * // Save topic succeeded. + * }, + * function(error) { + * // Handle error. + * } + * ); + */ + save(callbacks?: { success(topic: KiiTopic): any; failure(error: Error): any; }): Promise; + + /** + * Send message to the topic. + * + * @param message to be sent. + * @param callbacks callback functions. + * + * @return return promise object. + *
      + *
    • fulfill callback function: function(params). params is an Array instance. + *
        + *
      • params[0] is the KiiTopic instance which this method was called on.
      • + *
      • params[1] is the message object to send.
      • + *
      + *
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.target is the KiiTopic instance which this method was called on.
      • + *
      • error.message
      • + *
      + *
    • + *
    + * + * @example + * // example to use callbacks directly + * // assume topic is already instantiated. + * var contents = { + * message : "hello push!" + * }; + * var message = new KiiPushMessageBuilder(contents).build(); + * topic.sendMessage(message, { + * success: function(topic, message) { + * // Send message succeeded. + * }, + * failure: function(error) { + * // Handle error. + * } + * }); + * + * // example to use Promise + * // assume topic is already instantiated. + * var contents = { + * message : "hello push!" + * }; + * var message = new KiiPushMessageBuilder(contents).build(); + * topic.sendMessage(message).then( + * function(params) { + * // Send message succeeded. + * }, + * function(error) { + * // Handle error. + * } + * ); + */ + sendMessage(message: T, callbacks?: { success(topic: KiiTopic, message: T): any; failure(error: Error): any; }): Promise<[KiiTopic, T]>; + + /** + * Delete the topic. + * + * @param callbacks callback functions. + * + * @return return promise object. + *
      + *
    • fulfill callback function: function(theDeletedTopic). theDeletedTopic is a KiiTopic instance.
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.target is the KiiTopic instance which this method was called on.
      • + *
      • error.message
      • + *
      + *
    • + *
    + * + * @example + * // example to use callbacks directly + * // assume topic is already instantiated. + * topic.deleteTopic({ + * success: function(topic) { + * // Delete topic succeeded. + * }, + * failure: function(error) { + * // Handle error. + * } + * }); + * + * // example to use Promise + * // assume topic is already instantiated. + * topic.deleteTopic().then( + * function(topic) { + * // Delete topic succeeded. + * }, + * function(error) { + * // Handle error. + * } + * ); + */ + deleteTopic(callbacks?: { success(topic: KiiTopic): any; failure(error: Error): any; }): Promise; + + /** + * Get ACL object of this topic. + * Access to topic can be configured by adding/removing KiiACLEntry + * to/from obtained acl object. + * + * @return acl object of this topic. + */ + acl(): KiiACL; + } + + /** + * Represents a KiiUser object + */ + export class KiiUser { + /** + * + * + * @deprecated Use {@link KiiUser.getId} instead. + * Get the UUID of the given user, assigned by the server + * + * @return + */ + getUUID(): string; + + /** + * Get the ID of the current KiiUser instance. + * + * @return Id of the user or null if the user has not saved to cloud. + */ + getID(): string; + + /** + * Get the username of the given user + * + * @return + */ + getUsername(): string; + + /** + * Return true if the user is disabled, false when enabled and undefined + * when user is not refreshed. + * Call {@link KiiUser#refresh()} prior calling this method to get + * correct status. + */ + disabled(): void; + + /** + * Get the display name associated with this user + * + * @return + */ + getDisplayName(): string; + + /** + * Set the display name associated with this user. Cannot be used for logging a user in; is non-unique + * + * @param value Must be between 1-50 alphanumeric characters. + * + * @throws If the displayName is not a valid format + */ + setDisplayName(value: string): void; + + /** + * Get whether or not the user is pseudo user. + * If this method is not called for current login user, calling + * {@link KiiUser#refresh()} method is necessary to get a correct value. + * + * @return whether this user is pseudo user or not. + */ + isPseudoUser(): boolean; + + /** + * Get the email address associated with this user + * + * @return + */ + getEmailAddress(): string; + + /** + * Get the phone number associated with this user + * + * @return + */ + getPhoneNumber(): string; + + /** + * Get the country code associated with this user + * + * @return + */ + getCountry(): string; + + /** + * Set the country code associated with this user + * + * @param value The country code to set. Must be 2 alphabetic characters. Ex: US, JP, CN + * + * @throws If the country code is not a valid format + */ + setCountry(value: string): void; + + /** + * Get the server's creation date of this user + * + * @return + */ + getCreated(): string; + + /** + * + * + * @deprecated Get the modified date of the given user, assigned by the server + * + * @return + */ + getModified(): string; + + /** + * Get the status of the user's email verification. This field is assigned by the server + * + * @return true if the user's email address has been verified by the user, false otherwise. + * Could be undefined if haven't obtained value from server or not allowed to see the value. + * Should be used by current login user to check the email verification status. + */ + getEmailVerified(): boolean; + + /** + * Get the status of the user's phone number verification. This field is assigned by the server + * + * @return true if the user's email address has been verified by the user, false otherwise + * Could be undefined if haven't obtained value from server or not allowed to see the value. + * Should be used by current login user to check the phone verification status. + */ + getPhoneVerified(): boolean; + + /** + * Get the social accounts that is linked to this user. + * Refresh the user by {@link KiiUser#refresh()} prior call the method. + * Otherwise, it returns empty object. + * + * @return Social network name as key and account info as value. + */ + getLinkedSocialAccounts(): { [name: string]: KiiSocialAccountInfo }; + + /** + * Get the access token for the user - only available if the user is currently logged in + * + * @return + */ + getAccessToken(): string; + + /** + * Return the access token and token expire time in a object. + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
    KeyTypeValue
    "access_token"Stringrequired for accessing KiiCloud
    "expires_at"DateAccess token expiration time, null if the user is not login user.
    + * + * @return Access token and token expires in a object. + */ + getAccessTokenObject(): { access_token: string, expires_at: Date }; + + /** + * Get a specifically formatted string referencing the user + * + *

    The user must exist in the cloud (have a valid UUID). + * + * @return A URI string based on the given user. null if a URI couldn't be generated. + * + * @example + * var user = . . .; // a KiiUser + * var uri = user.objectURI(); + */ + objectURI(): string; + + /** + * Sets a key/value pair to a KiiUser + * + *

    If the key already exists, its value will be written over. If the object is of invalid type, it will return false and a KiiError will be thrown (quietly). Accepted types are any JSON-encodable objects. + * + * @param key The key to set. The key must not be a system key (created, metadata, modified, type, uuid) or begin with an underscore (_) + * @param value The value to be set. Object must be of a JSON-encodable type (Ex: dictionary, array, string, number, etc) + * + * @example + * var user = . . .; // a KiiUser + * user.set("score", 4298); + */ + set(key: string, value: any): void; + + /** + * Gets the value associated with the given key + * + * @param key The key to retrieve + * + * @return The object associated with the key. null if none exists + * + * @example + * var user = . . .; // a KiiUser + * var score = user.get("score"); + */ + get(key: string): T; + + /** + * The currently authenticated user + * + * @return + * + * @example + * var user = KiiUser.getCurrentUser(); + */ + static getCurrentUser(): KiiUser; + + /** + * Create a user object to prepare for registration with credentials pre-filled + * + *

    Creates an pre-filled user object for manipulation. This user will not be authenticated until one of the authentication methods are called on it. It can be treated as any other KiiObject before it is authenticated. + * + * @param username The user's desired username. Must be between 3 and 64 characters, which can include alphanumeric characters as well as underscores '_', dashes '-' and periods '.' + * @param password The user's password. Must be between 4-50 characters, made up of ascii characters excludes control characters. + * + * @return a working KiiUser object + * + * @throws If the username is not in the proper format + * @throws If the password is not in the proper format + * + * @example + * var user = KiiUser.userWithUsername("myusername", "mypassword"); + */ + static userWithUsername(username: string, password: string): KiiUser; + + /** + * Create a user object to prepare for registration with credentials pre-filled + * + *

    Creates an pre-filled user object for registration. This user will not be authenticated until the registration method is called on it. It can be treated as any other KiiUser before it is registered. + * + * @param phoneNumber The user's phone number + * @param password The user's password. Must be at least 4 characters, made up of alphanumeric and/or: @,#,$,%,^,& + * + * @return a working KiiUser object + * + * @throws If the password is not in the proper format + * @throws If the phone number is not in the proper format + * + * @example + * var user = KiiUser.userWithPhoneNumber("+874012345678", "mypassword"); + */ + static userWithPhoneNumber(phoneNumber: string, password: string): KiiUser; + + /** + * Create a user object to prepare for registration with credentials pre-filled + * + *

    Creates an pre-filled user object for registration. This user will not be authenticated until the registration method is called on it. It can be treated as any other KiiUser before it is registered. + * + * @param phoneNumber The user's phone number + * @param username The user's desired username. Must be between 3 and 64 characters, which can include alphanumeric characters as well as underscores '_', dashes '-' and periods '.' + * @param password The user's password. Must be at least 4 characters, made up of alphanumeric and/or: @,#,$,%,^,& + * + * @return a working KiiUser object + * + * @throws If the username is not in the proper format + * @throws If the password is not in the proper format + * @throws If the phone number is not in the proper format + * + * @example + * var user = KiiUser.userWithPhoneNumberAndUsername("+874012345678", "johndoe", "mypassword"); + */ + static userWithPhoneNumberAndUsername(phoneNumber: string, username: string, password: string): KiiUser; + + /** + * Create a user object to prepare for registration with credentials pre-filled + * + *

    Creates an pre-filled user object for registration. This user will not be authenticated until the registration method is called on it. It can be treated as any other KiiUser before it is registered. + * + * @param emailAddress The user's email address + * @param password The user's password. Must be at least 4 characters, made up of alphanumeric and/or: @,#,$,%,^,& + * + * @return a working KiiUser object + * + * @throws If the password is not in the proper format + * @throws If the email address is not in the proper format + * + * @example + * var user = KiiUser.userWithEmailAddress("johndoe@example.com", "mypassword"); + */ + static userWithEmailAddress(emailAddress: string, password: string): KiiUser; + + /** + * Create a user object to prepare for registration with credentials pre-filled + * + *

    Creates an pre-filled user object for registration. This user will not be authenticated until the registration method is called on it. It can be treated as any other KiiUser before it is registered. + * + * @param emailAddress The user's email address + * @param username The user's desired username. Must be between 3 and 64 characters, which can include alphanumeric characters as well as underscores '_', dashes '-' and periods '.' + * @param password The user's password. Must be at least 4 characters, made up of alphanumeric and/or: @,#,$,%,^,& + * + * @return a working KiiUser object + * + * @throws If the username is not in the proper format + * @throws If the password is not in the proper format + * @throws If the phone number is not in the proper format + * + * @example + * var user = KiiUser.userWithEmailAddressAndUsername("johndoe@example.com", "johndoe", "mypassword"); + */ + static userWithEmailAddressAndUsername(emailAddress: string, username: string, password: string): KiiUser; + + /** + * Create a user object to prepare for registration with credentials pre-filled + * + *

    Creates an pre-filled user object for registration. This user will not be authenticated until the registration method is called on it. It can be treated as any other KiiUser before it is registered. + * + * @param emailAddress The user's email address + * @param phoneNumber The user's phone number + * @param password The user's password. Must be at least 4 characters, made up of alphanumeric and/or: @,#,$,%,^,& + * + * @return a working KiiUser object + * + * @throws If the phone number is not in the proper format + * @throws If the password is not in the proper format + * @throws If the phone number is not in the proper format + * + * @example + * var user = KiiUser.userWithEmailAddressAndPhoneNumber("johndoe@example.com", "+874012345678", "mypassword"); + */ + static userWithEmailAddressAndPhoneNumber(emailAddress: string, phoneNumber: string, password: string): KiiUser; + + /** + * Create a user object to prepare for registration with credentials pre-filled + * + *

    Creates an pre-filled user object for registration. This user will not be authenticated until the registration method is called on it. It can be treated as any other KiiUser before it is registered. + * + * @param emailAddress The user's email address + * @param phoneNumber The user's phone number + * @param username The user's desired username. Must be between 3 and 64 characters, which can include alphanumeric characters as well as underscores '_', dashes '-' and periods '.' + * @param password The user's password. Must be at least 4 characters, made up of alphanumeric and/or: @,#,$,%,^,& + * + * @return a working KiiUser object + * + * @throws If the phone number is not in the proper format + * @throws If the phone number is not in the proper format + * @throws If the username is not in the proper format + * @throws If the password is not in the proper format + * + * @example + * var user = KiiUser.userWithCredentials("johndoe@example.com", "+874012345678", "johndoe", "mypassword"); + */ + static userWithCredentials(emailAddress: string, phoneNumber: string, username: string, password: string): KiiUser; + + /** + * Instantiate KiiUser that refers to existing user which has specified ID. + * You have to specify the ID of existing KiiUser. Unlike KiiObject, + * you can not assign ID in the client side.
    + * NOTE: This API does not access to the server. + * After instantiation, call {@link KiiUser#refresh} to fetch the properties. + * + * @param userID ID of the KiiUser to instantiate. + * + * @return instance of KiiUser. + * + * @throws when passed userID is empty or null. + * + * @example + * var user = new KiiUser.userWithID("__USER_ID__"); + */ + static userWithID(userID: string): KiiUser; + + /** + * Generate a new KiiUser based on a given URI + * + * @param uri The URI of the object to be represented + * + * @return A new KiiUser with its parameters filled in from the URI + * + * @throws If the URI is not in the proper format + * + * @example + * var user = new KiiUser.userWithURI("kiicloud://myuri"); + */ + static userWithURI(uri: string): KiiUser; + + /** + * Creates a reference to a bucket for this user + * + *

    The bucket will be created/accessed within this user's scope + * + * @param bucketName The name of the bucket the user should create/access + * + * @return A working KiiBucket object + * + * @example + * var user = . . .; // a KiiUser + * var bucket = user.bucketWithName("myBucket"); + */ + bucketWithName(bucketName: string): KiiBucket; + + /** + * Creates a reference to a encrypted bucket for this user + * + *

    The bucket will be created/accessed within this user's scope + * + * @param bucketName The name of the bucket the user should create/access + * + * @return A working KiiEncryptedBucket object + * + * @example + * var user = . . .; // a KiiUser + * var bucket = user.encryptedBucketWithName("myBucket"); + */ + encryptedBucketWithName(bucketName: string): KiiBucket; + + /** + * Authenticates a user with the server. + * If authentication successful, the user is cached inside SDK as current user,and accessible via + * {@link KiiUser.getCurrentUser()}. + * User token and token expiration is also cached and can be get by {@link KiiUser#getAccessTokenObject()}. + * Access token won't be expired unless you set it explicitly by {@link Kii.setAccessTokenExpiration()}.
    + * If password or userIdentifier is invalid, callbacks.failure or reject callback of promise will be called.
    + * + * @param userIdentifier The username, validated email address, or validated phone number of the user to authenticate + * @param password The password of the user to authenticate + * @param callbacks An object with callback methods defined + * + * @return return promise object. + *
      + *
    • fulfill callback function: function(theAuthenticatedUser). theAuthenticatedUser is KiiUser instance.
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.target is a KiiUser instance.If given password or userIdentifier is invalid, it will be null.
      • + *
      • error.message
      • + *
      + *
    • + *
    + * + * @example + * // example to use callbacks directly + * KiiUser.authenticate("myusername", "mypassword", { + * success: function(theAuthenticatedUser) { + * // do something with the authenticated user + * }, + * + * failure: function(theUser, anErrorString) { + * // do something with the error response + * } + * }); + * + * // example to use Promise + * KiiUser.authenticate("myusername", "mypassword").then( + * function(theAuthenticatedUser) { + * // do something with the authenticated user + * }, + * function(error) { + * // do something with the error response + * } + * ); + */ + static authenticate(userIdentifier: string, password: string, callbacks?: { success(theAuthenticatedUser: KiiUser): any; failure(theUser: KiiUser, anErrorString: string): any; }): Promise; + + /** + * Asynchronously authenticates a user with the server using specified access token. + * This method is non-blocking.

    + * Specified expiresAt won't be used by SDK. IF login successful, + * we set this property so that you can get it later along with token + * by {@link KiiUser#getAccessTokenObject()}.
    + * Also, if successful, the user is cached inside SDK as current user + * and accessible via {@link KiiUser.getCurrentUser()}.
    + * + * Note that, if not specified, token expiration time is not cached + * and set to value equivalant to 275760 years.
    + * + * If the specified token is expired, authenticataiton will be failed. + * Authenticate the user again to renew the token.
    + * + * If expiresAt is invalid, callbacks.failure or reject callback of promise will be called.
    + * + * @param accessToken A valid access token associated with the desired user + * @param callbacks An object with callback methods defined + * @param expiresAt Access token expire time that has received by {@link KiiUser#getAccessTokenObject()}. This param is optional and can be omitted. + * + * @return return promise object. + *
      + *
    • fulfill callback function: function(theAuthenticatedUser). theAuthenticatedUser is KiiUser instance.
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.target is a KiiUser instance.If expiresAt is invalid, it will be null.
      • + *
      • error.message
      • + *
      + *
    • + *
    + * + * @example + * // example to use callbacks directly + * // Assume you stored the object get from KiiUser#getAccessTokenObject() + * // and now accessing by 'tokenObject' var. + * var token = tokenObject["access_token"]; + * var expiresAt = tokenObject["expires_at"]; + * expireDate.setHours(expireDate.getHours() + 24); + * KiiUser.authenticateWithToken(token, { + * success: function(theAuthenticatedUser) { + * // do something with the authenticated user + * }, + * + * failure: function(theUser, anErrorString) { + * // do something with the error response + * } + * }, expiresAt); + * + * // example to use Promise + * // Assume you stored the object get from KiiUser#getAccessTokenObject() + * // and now accessing by 'tokenObject' var. + * var token = tokenObject["access_token"]; + * var expiresAt = tokenObject["expires_at"]; + * expireDate.setHours(expireDate.getHours() + 24); + * KiiUser.authenticateWithToken(token, null, expiresAt).then( + * function(theAuthenticatedUser) { + * // do something with the authenticated user + * }, + * function(error) { + * // do something with the error response + * } + * ); + */ + static authenticateWithToken(accessToken: string, callbacks?: { success(theAuthenticatedUser: KiiUser): any; failure(theUser: KiiUser, anErrorString: string): any; }, expiresAt?: Date): Promise; + + /** + * Registers a user with the server + * + *

    The user object must have an associated email/password combination. + * + * @param callbacks An object with callback methods defined + * + * @return return promise object. + *
      + *
    • fulfill callback function: function(theAuthenticatedUser). theAuthenticatedUser is KiiUser instance.
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.target is a KiiUser instance.
      • + *
      • error.message
      • + *
      + *
    • + *
    + * + * @example + * // example to use callbacks directly + * var user = KiiUser.userWithUsername("myusername", "mypassword"); + * user.register({ + * success: function(theAuthenticatedUser) { + * // do something with the authenticated user + * }, + * + * failure: function(theUser, anErrorString) { + * // do something with the error response + * } + * }); + * + * // example to use Promise + * var user = KiiUser.userWithUsername("myusername", "mypassword"); + * user.register().then( + * function(params) { + * // do something with the authenticated user + * }, + * function(error) { + * // do something with the error response + * } + * ); + */ + register(callbacks?: { success(theAuthenticatedUser: KiiUser): any; failure(theUser: KiiUser, anErrorString: string): any; }): Promise; + + /** + * Registers a user as pseudo user with the server + * + * @param callbacks An object with callback methods defined. + * This argument is mandatory and can't be ommited. + * @param userFields Custom Fields to add to the user. This is optional and can be omitted. + * + * @return return promise object. + *
      + *
    • fulfill callback function: function(theAuthenticatedUser). theAuthenticatedUser is KiiUser instance.
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.message
      • + *
      + *
    • + *
    + * + * @example + * // example to use callbacks directly + * var userFields = {"displayName":"yourName", "country":"JP", "age":30}; + * KiiUser.registerAsPseudoUser({ + * success: function(theAuthenticatedUser) { + * // do something with the authenticated user + * }, + * + * failure: function(theUser, anErrorString) { + * // do something with the error response + * } + * }, userFields); + * + * // example to use Promise + * var userFields = {"displayName":"yourName", "country":"JP", "age":30}; + * KiiUser.registerAsPseudoUser(null, userFields).then( + * function(theAuthenticatedUser) { + * // do something with the authenticated user + * }, + * function(error) { + * // do something with the error response + * } + * ); + */ + static registerAsPseudoUser(callbacks?: { success(theAuthenticatedUser: KiiUser): any; failure(theUser: KiiUser, anErrorString: string): any; }, userFields?: any): Promise; + + /** + * Sets credentials data and custom fields to pseudo user. + * + *

    This method is exclusive to pseudo user. + *
    password is mandatory and needs to provide at least one of login name, email address or phone number. + * + * @param identityData + * @param password The user's password. Valid pattern is ^[\x20-\x7E]{4,50}$. + * @param callbacks An object with callback methods defined. + * This argument is mandatory and can't be ommited. + * @param userFields Custom Fields to add to the user. This is optional and can be omitted. + * @param removeFields An array of field names to remove from the user custom fields. Default fields are not removed from server. + * This is optional and can be omitted. + * + * @return return promise object. + *
      + *
    • fulfill callback function: function(user). user is KiiUser instance which this method was called on.
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.target is the KiiUser instance which this method was called on.
      • + *
      • error.message
      • + *
      + *
    • + *
    + * + * @example + * // example to use callbacks directly + * var identityData = { "username": "__USER_NAME_" }; + * var userFields = { "displayName":"__DISPLAY_NAME","score":12344300 }; + * var removeFields = ["age"]; + * user.putIdentity( + * identityData, + * "__PASSWORD__", + * { + * success: function(user) { + * // do something with the updated user. + * }, + * failure: function(user, errorString) { + * // check error response. + * } + * }, + * userFields, + * removeFields + * ); + * + * // example to use Promise + * var identityData = { "username": "__USER_NAME_" }; + * var userFields = { "displayName":"__DISPLAY_NAME","score":12344300 }; + * var removeFields = ["age"]; + * user.putIdentity( + * identityData, + * "__PASSWORD__", + * null, + * userFields, + * removeFields + * ).then( + * function(user) { + * // do something with the updated user. + * }, + * function(error) { + * // check error response. + * } + * ); + */ + putIdentity(identityData: identityData, password: string, callbacks?: { success(user: KiiUser): any; failure(user: KiiUser, errorString: string): any; }, userFields?: any, removeFields?: string[]): Promise; + + /** + * Update user attributes. + * + * + *

    If you want to update identity data of pseudo user, you must use KiiUser.putIdentity instead. + * + * @param identityData + * @param callbacks An object with callback methods defined. + * This argument is mandatory and can't be ommited. + * @param userFields Custom Fields to add to the user. + * @param removeFields An array of field names to remove from the user custom fields. Default fields are not removed from server. + * + * @return return promise object. + *
      + *
    • fulfill callback function: function(user). user is KiiUser instance which this method was called on.
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.target is a KiiUser instance.
      • + *
      • error.message
      • + *
      + *
    • + *
    + * + * @example + * // example to use callbacks directly + * var identityData = { "username": "__USER_NAME_" }; + * var userFields = { "displayName":"__DISPLAY_NAME","score":12344300 }; + * var removeFields = ["age"]; + * user.update( + * identityData, + * { + * success: function(user) { + * // do something with the updated user. + * }, + * failure: function(user, errorString) { + * // check error response. + * } + * }, + * userFields, + * removeFields + * ); + * + * // example to use Promise + * var identityData = { "username": "__USER_NAME_" }; + * var userFields = { "displayName":"__DISPLAY_NAME","score":12344300 }; + * var removeFields = ["age"]; + * user.update( + * identityData, + * null, + * userFields, + * removeFields + * ).then( + * function(user) { + * // do something with the updated user. + * }, + * function(error) { + * // check error response. + * } + * ); + */ + update(identityData: identityData, callbacks?: { success(user: KiiUser): any; failure(user: KiiUser, errorString: string): any; }, userFields?: any, removeFields?: string[]): Promise; + + /** + * Update a user's password on the server + * + *

    Update a user's password with the server. The fromPassword must be equal to the current password associated with the account in order to succeed. + * + * @param fromPassword The user's current password + * @param toPassword The user's desired password. Must be at least 4 characters, made up of alphanumeric and/or: @,#,$,%,^,& + * @param callbacks An object with callback methods defined + * + * @return return promise object. + *
      + *
    • fulfill callback function: function(theUser). theUser is KiiUser instance which this method was called on.
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.target is the KiiUser instance which this method was called on.
      • + *
      • error.message
      • + *
      + *
    • + *
    + * + * @example + * // example to use callbacks directly + * var user = Kii.currentUser(); + * user.updatePassword("oldpassword", "newpassword", { + * success: function(theUser) { + * // do something + * }, + * + * failure: function(theUser, anErrorString) { + * // do something with the error response + * } + * }); + * + * // example to use Promise + * var user = Kii.currentUser(); + * user.updatePassword("oldpassword", "newpassword").then( + * function(theUser) { + * // do something + * }, + * function(error) { + * // do something with the error response + * } + * ); + */ + updatePassword(fromPassword: string, toPassword: string, callbacks?: { success(theUser: KiiUser): any; failure(theUser: KiiUser, anErrorString: string): any; }): Promise; + + /** + * Reset a user's password on the server + * + *

    Reset a user's password on the server. The user is determined by the specified userIdentifier - which is an email address that has already been associated with an account. Reset instructions will be sent to that identifier. + *

    Please Note: This will reset the user's access token, so if they are currently logged in - their session will no longer be valid. + * + * @param userIdentifier The user's email address + * @param callbacks An object with callback methods defined + * + * @return return promise object. + *
      + *
    • fulfill callback function: function(). No parameter used.
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.message
      • + *
      + *
    • + *
    + * + * @example + * // example to use callbacks directly + * KiiUser.resetPassword("johndoe@example.com", { + * success: function() { + * // do something + * }, + * + * failure: function(anErrorString) { + * // do something with the error response + * } + * }); + * + * // example to use Promise + * KiiUser.resetPassword("johndoe@example.com").then( + * function() { + * // do something + * }, + * function(error) { + * // do something with the error response + * } + * ); + */ + static resetPassword(userIdentifier: string, callbacks?: { success(): any; failure(anErrorString: string): any; }): Promise; + + /** + * Reset the password of user
    + * Reset the password of user specified by given identifier.
    + * This api does not execute login after reset password. + * + * @param userIdentifier should be valid email address, + * global phone number or user identifier obtained by {@link #getID}. + * @param notificationMethod specify the destination of message include link + * of resetting password. must be "EMAIL" or "SMS". + * different type of identifier and destination can be used + * as long as user have verified email, phone. + * (ex. User registers both email and phone. Identifier is email and + * notificationMethod is SMS.) + * @param callbacks object includes callback functions. + * + * @return return promise object. + *
      + *
    • fulfill callback function: function(). No parameter used.
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.message
      • + *
      + *
    • + *
    + * + * @example + * // example to use callbacks directly + * KiiUser.resetPasswordWithNotificationMethod("+819001234567", "SMS", { + * success: function() { + * // Operation succeeded. + * }, + * failure: function(errString) { + * // Handle error. + * } + * }); + * + * // example to use Promise + * KiiUser.resetPasswordWithNotificationMethod("+819001234567", "SMS").then( + * function() { + * // Operation succeeded. + * }, + * function(error) { + * // Handle error. + * } + * ); + */ + static resetPasswordWithNotificationMethod(userIdentifier: string, notificationMethod: string, callbacks?: { success(): any; failure(errString: string): any; }): Promise; + + /** + * Verify the current user's phone number + *

    This method is used to verify the phone number of user currently + * logged in.
    + * Verification code is sent from Kii Cloud when new user is registered with + * phone number or user requested to change their phone number in the + * application which requires phone verification.
    + * (You can enable/disable phone verification through the console in + * developer.kii.com)
    + * After the verification succeeded, new phone number becomes users phone + * number and user is able to login with the phone number.
    + * To get the new phone number, please call {@link #refresh()} and call + * {@link #getPhoneNumber()}
    + * Before completion of {@link #refresh()}, {@link #getPhoneNumber()} returns + * cached phone number. It could be old phone number or undefined. + * + * @param verificationCode The code which verifies the currently logged in user + * @param callbacks An object with callback methods defined + * + * @return return promise object. + *
      + *
    • fulfill callback function: function(theUser). theUser is KiiUser instance which this method was called on.
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.target is the KiiUser instance which this method was called on.
      • + *
      • error.message
      • + *
      + *
    • + *
    + * + * @example + * // example to use callbacks directly + * var user = Kii.currentUser(); + * user.verifyPhoneNumber("012345", { + * success: function(theUser) { + * // do something + * }, + * + * failure: function(theUser, anErrorString) { + * // do something with the error response + * } + * }); + * + * // example to use Promise + * var user = Kii.currentUser(); + * user.verifyPhoneNumber("012345").then( + * function(theUser) { + * // do something + * }, + * function(error) { + * // do something with the error response + * } + * ); + */ + verifyPhoneNumber(verificationCode: string, callbacks?: { success(theUser: KiiUser): any; failure(theUser: KiiUser, anErrorString: string): any; }): Promise; + + /** + * Resend the email verification code to the user + * + *

    This method will re-send the email verification to the currently logged in user + * + * @param callbacks An object with callback methods defined + * + * @return return promise object. + *
      + *
    • fulfill callback function: function(theUser). theUser is KiiUser instance which this method was called on.
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.target is the KiiUser instance which this method was called on.
      • + *
      • error.message
      • + *
      + *
    • + *
    + * + * @example + * // example to use callbacks directly + * var user = Kii.currentUser(); + * user.resendEmailVerification({ + * success: function(theUser) { + * // do something + * }, + * + * failure: function(theUser, anErrorString) { + * // do something with the error response + * } + * }); + * + * // example to use Promise + * var user = Kii.currentUser(); + * user.resendEmailVerification().then( + * function(theUser) { + * // do something + * }, + * function(error) { + * // do something with the error response + * } + * ); + */ + resendEmailVerification(callbacks?: { success(theUser: KiiUser): any; failure(theUser: KiiUser, anErrorString: string): any; }): Promise; + + /** + * Resend the SMS verification code to the user + * + *

    This method will re-send the SMS verification to the currently logged in user + * + * @param callbacks An object with callback methods defined + * + * @return return promise object. + *
      + *
    • fulfill callback function: function(theUser). theUser is KiiUser instance which this method was called on.
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.target is the KiiUser instance which this method was called on.
      • + *
      • error.message
      • + *
      + *
    • + *
    + * + * @example + * // example to use callbacks directly + * var user = Kii.currentUser(); + * user.resendPhoneNumberVerification({ + * success: function(theUser) { + * // do something + * }, + * + * failure: function(theUser, anErrorString) { + * // do something with the error response + * } + * }); + * + * // example to use Promise + * var user = Kii.currentUser(); + * user.resendPhoneNumberVerification().then( + * function(theUser) { + * // do something + * }, + * function(error) { + * // do something with the error response + * } + * ); + */ + resendPhoneNumberVerification(callbacks?: { success(theUser: KiiUser): any; failure(theUser: KiiUser, anErrorString: string): any; }): Promise; + + /** + * Retrieve a list of groups which the user is a member of + * + * @param callbacks An object with callback methods defined + * + * @return return promise object. + *
      + *
    • fulfill callback function: function(params). params is Array instance. + *
        + *
      • params[0] is the KiiUser instance which this method was called on.
      • + *
      • params[1] is array of KiiGroup instances.
      • + *
      + *
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.target is the KiiUser instance which this method was called on.
      • + *
      • error.message
      • + *
      + *
    • + *
    + * + * @example + * // example to use callbacks directly + * var user = Kii.currentUser(); + * user.memberOfGroups({ + * success: function(theUser, groupList) { + * // do something with the results + * for(var i=0; i<groupList.length; i++) { + * var g = groupList[i]; // a KiiGroup object + * } + * }, + * + * failure: function(theUser, anErrorString) { + * // do something with the error response + * } + * }); + * + * // example to use Promise + * var user = Kii.currentUser(); + * user.memberOfGroups().then( + * function(params) { + * // do something with the results + * var theUser = params[0]; + * var groupList = params[1]; + * for(var i=0; i<groupList.length; i++) { + * var g = groupList[i]; // a KiiGroup object + * } + * }, + * function(error) { + * // do something with the error response + * } + * ); + */ + memberOfGroups(callbacks?: { success(theUser: KiiUser, groupList: KiiGroup[]): any; failure(theUser: KiiUser, anErrorString: string): any; }): Promise<[KiiUser, KiiGroup[]]>; + + /** + * Retrieve the groups owned by this user. Group in the groupList + * does not contain all the property of group. To get all the + * property from cloud, a {@link KiiGroup#refresh(callback)} is necessary. + * + * @param callbacks An object with callback methods defined + * + * @return return promise object. + *
      + *
    • fulfill callback function: function(params). params is Array instance. + *
        + *
      • params[0] is the KiiUser instance which this method was called on.
      • + *
      • params[1] is array of KiiGroup instances.
      • + *
      + *
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.target is the KiiUser instance which this method was called on.
      • + *
      • error.message
      • + *
      + *
    • + *
    + * + * @example + * // example to use callbacks directly + * var user = Kii.currentUser(); + * user.ownerOfGroups({ + * success: function(theUser, groupList) { + * // do something with the results + * for(var i=0; i<groupList.length; i++) { + * var g = groupList[i]; // a KiiGroup object + * } + * }, + * + * failure: function(theUser, anErrorString) { + * // do something with the error response + * } + * }); + * + * // example to use Promise + * var user = Kii.currentUser(); + * user.ownerOfGroups().then( + * function(params) { + * // do something with the results + * var theUser = params[0]; + * var groupList = params[1]; + * for(var i=0; i<groupList.length; i++) { + * var g = groupList[i]; // a KiiGroup object + * } + * }, + * function(error) { + * // do something with the error response + * } + * ); + */ + 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 + * + * @param newPhoneNumber The new phone number to change to + * @param callbacks An object with callback methods defined + * + * @return return promise object. + *
      + *
    • fulfill callback function: function(theUser). theUser is KiiUser instance which this method was called on.
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.target is the KiiUser instance which this method was called on.
      • + *
      • error.message
      • + *
      + *
    • + *
    + * + * @example + * // example to use callbacks directly + * var user = Kii.currentUser(); + * user.changePhone('+19415551234', { + * success: function(theUser) { + * // do something on success + * }, + * + * failure: function(theUser, anErrorString) { + * // do something with the error response + * } + * }); + * + * // example to use Promise + * var user = Kii.currentUser(); + * user.changePhone('+19415551234').then( + * function(theUser) { + * // do something on success + * }, + * function(error) { + * // do something with the error response + * } + * ); + */ + changePhone(newPhoneNumber: string, callbacks?: { success(theUser: KiiUser): any; failure(theUser: KiiUser, anErrorString: string): any; }): Promise; + + /** + * Updates the user's email address on the server + * + * @param newEmail The new email address to change to + * @param callbacks An object with callback methods defined + * + * @return return promise object. + *
      + *
    • fulfill callback function: function(theUser). theUser is KiiUser instance which this method was called on.
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.target is the KiiUser instance which this method was called on.
      • + *
      • error.message
      • + *
      + *
    • + *
    + * + * @example + * // example to use callbacks directly + * var user = Kii.currentUser(); + * user.changeEmail('mynewemail@kii.com', { + * success: function(theUser) { + * // do something on success + * }, + * + * failure: function(theUser, anErrorString) { + * // do something with the error response + * } + * }); + * + * // example to use Promise + * var user = Kii.currentUser(); + * user.changeEmail('mynewemail@kii.com').then( + * function(theUser) { + * // do something on success + * }, + * function(error) { + * // do something with the error response + * } + * ); + */ + changeEmail(newEmail: string, callbacks?: { success(theUser: KiiUser): any; failure(theUser: KiiUser, anErrorString: string): any; }): Promise; + + /** + * Saves the latest user values to the server + * + *

    If the user does not yet exist, it will NOT be created. Otherwise, the fields that have changed will be updated accordingly. + * + * @param callbacks An object with callback methods defined + * + * @return return promise object. + *
      + *
    • fulfill callback function: function(theSavedUser). theSavedUser is KiiUser instance.
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.target is the KiiUser instance which this method was called on.
      • + *
      • error.message
      • + *
      + *
    • + *
    + * + * @example + * // example to use callbacks directly + * var user = Kii.getCurrentUser(); // a KiiUser + * user.save({ + * success: function(theSavedUser) { + * // do something with the saved user + * }, + * + * failure: function(theUser, anErrorString) { + * // do something with the error response + * } + * }); + * + * // example to use Promise + * var user = Kii.getCurrentUser(); // a KiiUser + * user.save().then( + * function(theSavedUser) { + * // do something with the saved user + * }, + * function(error) { + * // do something with the error response + * } + * ); + */ + save(callbacks?: { success(theSavedUser: KiiUser): any; failure(theUser: KiiUser, anErrorString: string): any; }): Promise; + + /** + * Updates the local user's data with the user data on the server + * + *

    The user must exist on the server. Local data will be overwritten. + * + * @param callbacks An object with callback methods defined + * + * @return return promise object. + *
      + *
    • fulfill callback function: function(theRefreshedUser). theRefreshedUser is KiiUser instance.
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.target is the KiiUser instance which this method was called on.
      • + *
      • error.message
      • + *
      + *
    • + *
    + * + * @example + * // example to use callbacks directly + * var user = Kii.getCurrentUser(); // a KiiUser + * user.refresh({ + * success: function(theRefreshedUser) { + * // do something with the refreshed user + * }, + * + * failure: function(theUser, anErrorString) { + * // do something with the error response + * } + * }); + * + * // example to use Promise + * var user = Kii.getCurrentUser(); // a KiiUser + * user.refresh().then( + * function(theRefreshedUser) { + * // do something with the refreshed user + * }, + * function(error) { + * // do something with the error response + * } + * ); + */ + refresh(callbacks?: { success(theRefreshedUser: KiiUser): any; failure(theUser: KiiUser, anErrorString: string): any; }): Promise; + + /** + * Delete the user from the server + * + * @param callbacks An object with callback methods defined + * + * @return return promise object. + *
      + *
    • fulfill callback function: function(theDeletedUser). theDeletedUser is KiiUser instance.
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.target is the KiiUser instance which this method was called on.
      • + *
      • error.message
      • + *
      + *
    • + *
    + * + * @example + * // example to use callbacks directly + * var user = Kii.getCurrentUser(); // a KiiUser + * user['delete']({ + * success: function(theDeletedUser) { + * // do something + * }, + * + * failure: function(theUser, anErrorString) { + * // do something with the error response + * } + * }); + * + * // example to use Promise + * var user = Kii.getCurrentUser(); // a KiiUser + * user['delete']().then( + * function(theDeletedUser) { + * // do something + * }, + * function(error) { + * // do something with the error response + * } + * ); + */ + delete(callbacks?: { success(theDeletedUser: KiiUser): any; failure(theUser: KiiUser, anErrorString: string): any; }): Promise; + + /** + * Logs the currently logged-in user out of the KiiSDK + * + * @example + * KiiUser.logOut(); + */ + static logOut(): void; + + /** + * Checks to see if there is a user authenticated with the SDK + * + * @example + * if(KiiUser.loggedIn()) { + * // do something + * } + */ + static loggedIn(): boolean; + + /** + * Find registered KiiUser with the email.
    + * If there are no user registers with the specified email or if there are but not verified email yet, + * callbacks.failure or reject callback of promise will be called.
    + *

    + * Note: + *
      + *
    • If "Expose Full User Data To Others" is enabled in the application console, the response will contain full of the user data.
    • + *
    • Otherwise, the response will only contain "userID", "loginName" and "displayName" field values if exist.
    • + *
    + * + * @param email The email to find KiiUser who owns it.
    + * Don't add prefix of "EMAIL:" described in REST API documentation. SDK will take care of it. + * @param callbacks An object with callback methods defined. + * This argument is mandatory and can't be ommited. + * + * @return return promise object. + *
      + *
    • fulfill callback function: function(theMatchedUser). theMatchedUser is KiiUser instance.
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.message
      • + *
      + *
    • + *
    + * + * @example + * // example to use callbacks directly + * KiiUser.findUserByEmail("user_to_find@example.com", { + * success: function(theMatchedUser) { + * // Do something with the found user + * }, + * failure: function(anErrorString) { + * // Do something with the error response + * } + * }); + * + * // example to use Promise + * KiiUser.findUserByEmail("user_to_find@example.com").then( + * function(theMatchedUser) { + * // Do something with the matched user + * }, + * function(error) { + * // Do something with the error response + * } + * ); + */ + static findUserByEmail(email: string, callbacks?: { success(theMatchedUser: KiiUser): any; failure(anErrorString: string): any; }): Promise; + + /** + * Find registered KiiUser with the phone.
    + * If there are no user registers with the specified phone or if there are but not verified phone yet, + * callbacks.failure or reject callback of promise will be called. + *

    + * Note: + *
      + *
    • If "Expose Full User Data To Others" is enabled in the application console, the response will contain full of the user data.
    • + *
    • Otherwise, the response will only contain "userID", "loginName" and "displayName" field values if exist.
    • + *
    + * + * @param phone The phone number to find KiiUser who owns it.
    + * Don't add prefix of "PHONE:" described in REST API documentation. SDK will take care of it. + * @param callbacks An object with callback methods defined. + * This argument is mandatory and can't be ommited. + * + * @return return promise object. + *
      + *
    • fulfill callback function: function(theMatchedUser). theMatchedUser is KiiUser instance.
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.message
      • + *
      + *
    • + *
    + * + * @example + * // example to use callbacks directly + * KiiUser.findUserByPhone("phone_number_to_find", { + * success: function(theMatchedUser) { + * // Do something with the found user + * }, + * failure: function(anErrorString) { + * // Do something with the error response + * } + * }); + * + * // example to use Promise + * KiiUser.findUserByPhone("phone_number_to_find").then( + * function(theMatchedUser) { + * // Do something with the matched user + * }, + * function(error) { + * // Do something with the error response + * } + * ); + */ + static findUserByPhone(phone: string, callbacks?: { success(theMatchedUser: KiiUser): any; failure(anErrorString: string): any; }): Promise; + + /** + * Find registered KiiUser with the user name.
    + * If there are no user registers with the specified user name, callbacks.failure or reject callback of promise will be called. + *

    + * Note: + *
      + *
    • If "Expose Full User Data To Others" is enabled in the application console, the response will contain full of the user data.
    • + *
    • Otherwise, the response will only contain "userID", "loginName" and "displayName" field values if exist.
    • + *
    + * + * @param username The user name to find KiiUser who owns it.
    + * Don't add prefix of "LOGIN_NAME:" described in REST API documentation. SDK will take care of it. + * @param callbacks An object with callback methods defined. + * This argument is mandatory and can't be ommited. + * + * @return return promise object. + *
      + *
    • fulfill callback function: function(theMatchedUser). theMatchedUser is KiiUser instance.
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.message
      • + *
      + *
    • + *
    + * + * @example + * // example to use callbacks directly + * KiiUser.findUserByUsername("user_name_to_find", { + * success: function(theMatchedUser) { + * // Do something with the found user + * }, + * failure: function(anErrorString) { + * // Do something with the error response + * } + * }); + * + * // example to use Promise + * KiiUser.findUserByUsername("user_name_to_find").then( + * function(theMatchedUser) { + * // Do something with the matched user + * }, + * function(error) { + * // Do something with the error response + * } + * ); + */ + static findUserByUsername(username: string, callbacks?: { success(theMatchedUser: KiiUser): any; failure(anErrorString: string): any; }): Promise; + + /** + * Instantiate topic belongs to this user. + * + * @param topicName name of the topic. Must be a not empty string. + * + * @return topic instance. + */ + topicWithName(topicName: string): KiiTopic; + + /** + * Gets a list of topics in this user scope + * + * @param callbacks An object with callback methods defined + * @param paginationKey You can specify the pagination key with the nextPaginationKey passed by callbacks.success. If empty string or no string object is provided, this API regards no paginationKey specified. + * + * @return return promise object. + *
      + *
    • fulfill callback function: function(params). params is Array instance. + *
        + *
      • params[0] is array of KiiTopic instances.
      • + *
      • params[1] is string of nextPaginationKey.
      • + *
      + *
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.target is the KiiUser instance which this method was called on.
      • + *
      • error.message
      • + *
      + *
    • + *
    + * + * @example + * // example to use callbacks directly + * var user = . . .; // a KiiUser + * user.listTopics({ + * success: function(topicList, nextPaginationKey) { + * // do something with the result + * for(var i=0; i<topicList.length; i++){ + * var topic = topicList[i]; + * } + * if (nextPaginationKey != null) { + * user.listTopics({ + * success: function(topicList, nextPaginationKey) {...}, + * failure: function(anErrorString) {...} + * }, nextPaginationKey); + * } + * }, + * failure: function(anErrorString) { + * // do something with the error response + * } + * }); + * + * // example to use callbacks directly + * var user = . . .; // a KiiUser + * user.listTopics().then( + * function(params) { + * var topicList = params[0]; + * var nextPaginationKey = params[1]; + * // do something with the result + * for(var i=0; i<topicList.length; i++){ + * var topic = topicList[i]; + * } + * if (nextPaginationKey != null) { + * user.listTopics(null, nextPaginationKey).then( + * function(params) {...}, + * function(error) {...} + * ); + * } + * }, + * function(error) { + * // do something with the error response + * } + * ); + */ + listTopics(callbacks?: { success(topicList: KiiTopic[], nextPaginationKey: string): any; failure(anErrorString: string): any; }, paginationKey?: string): Promise<[KiiTopic[], string]>; + + /** + * Instantiate push subscription for this user. + * + * @return push subscription object. + */ + pushSubscription(): KiiPushSubscription; + } +} + +import KiiACLAction = KiiCloud.KiiACLAction; +import KiiSite = KiiCloud.KiiSite; +import KiiAnalyticsSite = KiiCloud.KiiAnalyticsSite; +import KiiSocialNetworkName = KiiCloud.KiiSocialNetworkName; +import Kii = KiiCloud.Kii; +import KiiACL = KiiCloud.KiiACL; +import KiiACLEntry = KiiCloud.KiiACLEntry; +import KiiAnalytics = KiiCloud.KiiAnalytics; +import KiiAnonymousUser = KiiCloud.KiiAnonymousUser; +import KiiAnyAuthenticatedUser = KiiCloud.KiiAnyAuthenticatedUser; +import KiiAppAdminContext = KiiCloud.KiiAppAdminContext; +import KiiBucket = KiiCloud.KiiBucket; +import KiiClause = KiiCloud.KiiClause; +import KiiGeoPoint = KiiCloud.KiiGeoPoint; +import KiiGroup = KiiCloud.KiiGroup; +import KiiObject = KiiCloud.KiiObject; +import KiiPushMessageBuilder = KiiCloud.KiiPushMessageBuilder; +import KiiPushSubscription = KiiCloud.KiiPushSubscription; +import KiiQuery = KiiCloud.KiiQuery; +import KiiServerCodeEntry = KiiCloud.KiiServerCodeEntry; +import KiiServerCodeExecResult = KiiCloud.KiiServerCodeExecResult; +import KiiSocialConnect = KiiCloud.KiiSocialConnect; +import KiiThing = KiiCloud.KiiThing; +import KiiTopic = KiiCloud.KiiTopic; +import KiiUser = KiiCloud.KiiUser; diff --git a/knockout/knockout.d.ts b/knockout/knockout.d.ts index bee7041de..8f5d6fef4 100644 --- a/knockout/knockout.d.ts +++ b/knockout/knockout.d.ts @@ -142,6 +142,7 @@ interface KnockoutAllBindingsAccessor { } interface KnockoutBindingHandler { + after?: Array; init?: (element: any, valueAccessor: () => any, allBindingsAccessor?: KnockoutAllBindingsAccessor, viewModel?: any, bindingContext?: KnockoutBindingContext) => void | { controlsDescendantBindings: boolean; }; update?: (element: any, valueAccessor: () => any, allBindingsAccessor?: KnockoutAllBindingsAccessor, viewModel?: any, bindingContext?: KnockoutBindingContext) => void; options?: any; diff --git a/leaflet-label/leaflet-label.d.ts b/leaflet-label/leaflet-label.d.ts index a77def73c..02d94a321 100644 --- a/leaflet-label/leaflet-label.d.ts +++ b/leaflet-label/leaflet-label.d.ts @@ -56,6 +56,7 @@ declare module L { className?: string; clickable?: boolean; direction?: string; // 'left' | 'right' | 'auto'; + pane?: string; noHide?: boolean; offset?: Point; opacity?: number; diff --git a/leaflet/leaflet.d.ts b/leaflet/leaflet.d.ts index 110bdd6f7..565a3c25d 100755 --- a/leaflet/leaflet.d.ts +++ b/leaflet/leaflet.d.ts @@ -1088,7 +1088,7 @@ declare namespace L { /** * Size of the icon image in pixels. */ - iconSize?: Point; + iconSize?: Point|[number, number]; /** * The coordinates of the "tip" of the icon (relative to its top left corner). @@ -1096,7 +1096,7 @@ declare namespace L { * location. Centered by default if size is specified, also can be set in CSS * with negative margins. */ - iconAnchor?: Point; + iconAnchor?: Point|[number, number]; /** * The URL to the icon shadow image. If not specified, no shadow image will be @@ -1113,19 +1113,19 @@ declare namespace L { /** * Size of the shadow image in pixels. */ - shadowSize?: Point; + shadowSize?: Point|[number, number]; /** * The coordinates of the "tip" of the shadow (relative to its top left corner) * (the same as iconAnchor if not specified). */ - shadowAnchor?: Point; + shadowAnchor?: Point|[number, number]; /** * The coordinates of the point from which popups will "open", relative to the * icon anchor. */ - popupAnchor?: Point; + popupAnchor?: Point|[number, number]; /** * A custom class name to assign to both icon and shadow images. Empty by default. @@ -4176,6 +4176,11 @@ declare namespace L { * When this option is set, the TileLayer only loads tiles that are in the given geographical bounds. */ bounds?: LatLngBounds; + + /** + * Custom keys may be specified in TileLayerOptions so they can be used in a provided URL template. + */ + [additionalKeys: string]: any; } } diff --git a/line-reader/line-reader-tests.ts b/line-reader/line-reader-tests.ts new file mode 100644 index 000000000..4d6ce4246 --- /dev/null +++ b/line-reader/line-reader-tests.ts @@ -0,0 +1,29 @@ +/// + +import lineReader = require('line-reader'); + +lineReader.open('line-reader-tests.ts', function(err: Error, reader: LineReader) { + if (err) throw err; + if (reader.hasNextLine()) { + try { + reader.nextLine(function(err: Error, line: string) { + if (err) throw err; + console.log(line); + }); + } finally { + reader.close(function(err: Error) { + if (err) throw err; + }) + } + } + else { + reader.close(function(err: Error) { + if (err) throw err; + }); + } +}); + +lineReader.eachLine('line-reader.d.ts', {encoding: 'utf8'}, function(line: string, last: boolean) { + console.log(line); + if (last) console.log(''); +}); diff --git a/line-reader/line-reader.d.ts b/line-reader/line-reader.d.ts new file mode 100644 index 000000000..f744dec6f --- /dev/null +++ b/line-reader/line-reader.d.ts @@ -0,0 +1,27 @@ +// Type definitions for line-reader +// Project: https://github.com/nickewing/line-reader +// Definitions by: Sam Saint-Pettersen +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +interface LineReaderOptions { + separator?: any; + encoding?: string; + bufferSize?: number; +} + +interface LineReader { + eachLine(): Function; // For Promise.promisify; + open(): Function; + eachLine(file: string, cb: (line: string, last?: boolean, cb?: Function) => void): LineReader; + eachLine(file: string, options: LineReaderOptions, cb: (line: string, last?: boolean, cb?: Function) => void): LineReader; + open(file: string, cb: (err: Error, reader: LineReader) => void): void; + open(file: string, options: LineReaderOptions, cb: (err: Error, reader: LineReader) => void): void; + hasNextLine(): boolean; + nextLine(cb: (err: Error, line: string) => void): void; + close(cb: (err: Error) => void): void; +} + +declare module "line-reader" { + var lr: LineReader; + export = lr; +} diff --git a/linq/linq.d.ts b/linq/linq.d.ts index c15bc895e..11bf36df9 100644 --- a/linq/linq.d.ts +++ b/linq/linq.d.ts @@ -205,9 +205,9 @@ declare module linq { } interface OrderedEnumerable extends Enumerable { - ThenBy(keySelector: ($) => T): OrderedEnumerable; + ThenBy(keySelector: ($: T) => any): OrderedEnumerable; ThenBy(keySelector: string): OrderedEnumerable; - ThenByDescending(keySelector: ($) => T): OrderedEnumerable; + ThenByDescending(keySelector: ($: T) => any): OrderedEnumerable; ThenByDescending(keySelector: string): OrderedEnumerable; } diff --git a/linqsharp/linqsharp-tests.ts b/linqsharp/linqsharp-tests.ts new file mode 100644 index 000000000..ec6b1c725 --- /dev/null +++ b/linqsharp/linqsharp-tests.ts @@ -0,0 +1,92 @@ +/// + +import Linq, { LinqSharp } from "linqsharp"; + +var linq: Linq = new Linq([0, 1, 2, 3]); + +var linqResult: Linq; +var linqAny: Linq; +var arrayResult: number[]; + +var numberResult: number; +var boolResult: boolean; + +var comparer: LinqSharp.IEqualityComparer = { + Equals: (x: number, y: number): boolean => + { + return x === y; + }, + GetHashCode: (obj: number): number => + { + return obj.valueOf(); + } +}; +var comparer2: (o: number, i: number) => number; +var comparer3: (o: number, i: number) => boolean; + +numberResult = linq.Aggregate((prev: number, next: number) => { return prev + next; }); +boolResult = linq.All((value: number) => value == 0); +boolResult = linq.Any(); +boolResult = linq.Any((value: number) => value == 0); +numberResult = linq.Average(); +numberResult = linq.Average((value: number) => value); +linqResult = linq.Concat([4, 5, 6]); +boolResult = linq.Contains(0); +boolResult = linq.Contains(0, comparer); +numberResult = linq.Count(); +numberResult = linq.Count((value: number) => value == 0); +linqResult = linq.Distinct(); +linqResult = linq.Distinct(comparer); +linqResult = linq.DistinctBy((value: number) => value); +numberResult = linq.ElementAt(0); +numberResult = linq.ElementAtOrDefault(0, 1); +linqResult = linq.Except([2]); +linqResult = linq.Except([2], comparer); +numberResult = linq.First(); +numberResult = linq.First((value: number) => value == 0); +numberResult = linq.FirstOrDefault(); +numberResult = linq.FirstOrDefault((value: number) => value == 0); +linq.ForEach((value: number, index: number) => { }); +linqAny = linq.GroupBy((value: number) => value % 2); +linqAny = linq.GroupBy((value: number) => value % 2, (value: number) => value * 2); +linqAny = linq.GroupBy((value: number) => value % 2, (value: number) => value * 2, comparer); +numberResult = linq.IndexOf(0); +numberResult = linq.IndexOf(0, comparer); +linqResult = linq.Intersect([0]); +linqResult = linq.Intersect([0], comparer); +linqResult = linq.Join([0], (outer: number) => outer, (inner: number) => inner, (outer: number, inner: number) => outer + inner); +linqResult = linq.Join([0], (outer: number) => outer, (inner: number) => inner, (outer: number, inner: number) => outer + inner, comparer); +numberResult = linq.Last(); +numberResult = linq.Last((value: number) => value == 0); +numberResult = linq.LastOrDefault(); +numberResult = linq.LastOrDefault((value: number) => value == 0); +numberResult = linq.Max(); +numberResult = linq.Max((value: number) => value); +numberResult = linq.Min(); +numberResult = linq.Min((value: number) => value); +linqResult = linq.OrderBy((value: number) => value); +linqResult = linq.OrderBy((value: number) => value, comparer2); +linqResult = linq.OrderByDescending((value: number) => value); +linqResult = linq.OrderByDescending((value: number) => value, comparer2); +linqResult = linq.Reverse(); +linqResult = linq.Select((value: number) => value); +linqResult = linq.Select((value: number, index: number) => value + index); +linqResult = linq.SelectMany((value: number) => [ value ]); +linqResult = linq.SelectMany((value: number) => [ value ], (value: number) => value); +boolResult = linq.SequenceEqual([0]); +boolResult = linq.SequenceEqual([0], comparer3); +numberResult = linq.Single(); +numberResult = linq.Single((value: number) => value == 0); +numberResult = linq.SingleOrDefault(); +numberResult = linq.SingleOrDefault((value: number) => value == 0); +linqResult = linq.Skip(0); +linqResult = linq.SkipWhile((value: number) => value < 2); +numberResult = linq.Sum(); +numberResult = linq.Sum((value: number) => value * 2); +linqResult = linq.Take(2); +linqResult = linq.TakeWhile((value: number) => value < 2); +arrayResult = linq.ToArray(); +linqResult = linq.Union([0]); +linqResult = linq.Union([0], comparer); +linqResult = linq.Where((value: number) => value > 0); +linqResult = linq.Zip([0], (outer: number, inner: number) => outer + inner); \ No newline at end of file diff --git a/linqsharp/linqsharp.d.ts b/linqsharp/linqsharp.d.ts new file mode 100644 index 000000000..0ead62cd7 --- /dev/null +++ b/linqsharp/linqsharp.d.ts @@ -0,0 +1,500 @@ +// Type definitions for linqsharp +// Project: https://www.npmjs.com/package/linqsharp +// Definitions by: Bruno Leonardo Michels +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +// JSDoc: Extracted and adapted from .NET source code. + +/** + * LinqSharp module defines a helper class with + * .NET's Linq methods. + * + * @module linqsharp + */ +declare module "linqsharp" +{ + export namespace LinqSharp { + /** + * Defines methods to support the comparison of objects for equality. + * + * {T} The type of objects to compare. + */ + export interface IEqualityComparer { + Equals(x: T, y: T): boolean; + GetHashCode(obj: T): number; + } + + /** + * Represents a collection of objects that have a common key. + * + * {TKey} The type of the key. + * {T} The type of the values. + */ + export interface IGrouping { + Key: TKey; + Elements: T[]; + } + + /** + * Gets the HashCode of the object. + * + * @param e Object to compute hash. + * @returns A computed HashCode for the object. + */ + export function GetHashCode(e: any): any; + + /** + * Transforms a object into a string replacing circular + * references by reference tokens. + * + * @param obj Object to convert to string. + * @returns String representation of the object. + */ + export function StringifyNonCircular(obj: any): string; + } + + /** + * Wrapper class for an array that provides Linq functionallity. + * + * @class Linq + */ + class Linq { + /** {T[]} Internal array reference. */ + private a: T[]; + + /** + * Creates a new instance holding an array of . + * @constructor + * + * @param {Array} a Array. + */ + constructor(a?: T[]); + + /** + * Applies an accumulator function over a sequence. + * + * @param func An accumulator function to be + * invoked on each element. + * @param {T} [initialValue] The initial accumulator value. + * + * @throws Error if array is empty. + * + * @returns {T} The final accumulator value. + */ + Aggregate(func: (previous: T, next: T) => TResult, initialValue?: T): T; + + /** + * Determines whether all elements of a sequence satisfy a condition. + * + * @param predicate A function to test each element for a condition. + * + * @returns true if every element of the source sequence passes the test in the specified + * predicate, or if the sequence is empty; otherwise, false. + */ + All(predicate: (value: T) => boolean): boolean; + + /** + * Determines whether a sequence contains any elements. + * + * @param [predicate] A function to test each element for a condition. + * + * @returns true if any elements in the source sequence pass the test in the specified predicate; + * otherwise, false. If no predicate is specified return true if the source sequence contains any elements; + * otherwise, false. + */ + Any(predicate?: (value: T) => boolean): boolean; + + /** + * Computes the average of a sequence of {number} values. + * + * @param [selector] A transform function to apply to each element. + * + * @returns The average of the sequence of values. + */ + Average(selector?: (value: T) => number): number; + + /** + * Concatenates two sequences. + * + * @param array The sequence to concatenate to the first sequence. + * + * @returns An array that contains the concatenated elements of the two input sequences. + */ + Concat(array: T[]): Linq; + + /** + * Determines whether a sequence contains a specified element by using a specified comparer. + * + * @param value The value to locate in the sequence. + * @param [comparer] An IEqualityComparer to compare values. + * + * @returns true if the source sequence contains an element that has the specified value; + * otherwise, false. + */ + Contains(value: T, comparer?: LinqSharp.IEqualityComparer): boolean; + + /** + * Returns a number that represents how many elements in the specified sequence satisfy a condition. + * + * @param [selector] A function to test each element for a condition. + * + * @returns A number that represents how many elements in the sequence satisfy the condition + * in the predicate function. + */ + Count(selector?: (value: T) => boolean): number; + + /** + * Returns distinct elements from a sequence by using a specified IEqualityComparer + * to compare values. + * + * @param [comparer] An IEqualityComparer to compare values. + * + * @returns An array that contains distinct elements from the source sequence. + */ + Distinct(comparer?: LinqSharp.IEqualityComparer): Linq; + + /** + * Returns distinct elements from a sequence by using a specified IEqualityComparer + * to compare values. + * + * @param selector A function to test each element for a condition. + * @param [comparer] An IEqualityComparer to compare values. + * + * @returns An array that contains distinct elements from the source sequence. + */ + DistinctBy(selector: (e: T) => U, comparer?: LinqSharp.IEqualityComparer): Linq; + + /** + * Returns the element at a specified index in a sequence. + * + * @param index The zero-based index of the element to retrieve. + * + * @throws index is less than 0 or greater than or equal to the number of elements in source. + * + * @returns The element at the specified position in the source sequence. + */ + ElementAt(index: number): T; + + /** + * Returns the element at a specified index in a sequence or a default value if + * the index is out of range. + * + * @param index The zero-based index of the element to retrieve. + * @param defaultValue A default value if no element is found. + * + * @returns defaultValue if the index is outside the bounds of the source sequence; + * otherwise, the element at the specified position in the source sequence. + */ + ElementAtOrDefault(index: number, defaultValue: T): T; + + /** + * Produces the set difference of two sequences by using the specified IEqualityComparer + * to compare values. + * + * @param except An array whose elements that also occur in the first sequence will cause + * those elements to be removed from the returned sequence. + * @param [comparer] An IEqualityComparer to compare values. + * + * @returns A sequence that contains the set difference of the elements of two sequences. + */ + Except(except: T[], comparer?: LinqSharp.IEqualityComparer): Linq; + + /** + * Returns the first element in a sequence that satisfies a specified condition. + * + * @param [selector] A function to test each element for a condition. + * + * @throws No element satisfies the condition in predicate.-or-The source sequence is empty. + * + * @returns The first element in the sequence that passes the test in the specified predicate function. + */ + First(selector?: (e: T) => boolean): T; + + /** + * Returns the first element of the sequence that satisfies a condition or a default + * value if no such element is found. + * + * @param [selector] A function to test each element for a condition. + * @param [defaultValue] A default value to return if no element is found. + * + * @returns defaultValue if source is empty or if no element passes the test specified by predicate; + * otherwise, the first element in source that passes the test specified by predicate. + */ + FirstOrDefault(selector?: (e: T) => boolean, defaultValue?: T): T; + + /** + * Performs the specified action on each element of the array. + * + * @param callback The function delegate to perform on each element of the array. + */ + ForEach(callback: (e: T, index: number) => any): void; + + /** + * Groups the elements of a sequence according to a specified key selector function. + * + * @param keySelector A function to extract the key for each element. + * @param [elementSelector] A function to create a result value from each group. + * @param [comparer] An IEqualityComparer to compare keys with. + * + * @returns A collection of elements of type TResult where each element represents a projection + * over a group and its key. + */ + GroupBy(keySelector: (e: T) => TKey, elementSelector?: (e: T) => TElement, comparer?: LinqSharp.IEqualityComparer): Linq; + + /** + * Searches for the specified object and returns the zero-based index of the first + * occurrence within the entire array. + * + * @param e The object to locate in the array. + * @param [comparer] An IEqualityComparer to compare elements with. + * + * @returns The zero-based index of the first occurrence of item within the entire array, if found; + * otherwise, –1. + */ + IndexOf(e: T, comparer?: LinqSharp.IEqualityComparer): number; + + /** + * Produces the set intersection of two sequences by using the specified IEqualityComparer + * to compare values. + * + * @param array An array whose distinct elements that also appear in the first sequence will be returned. + * @param [comparer] An IEqualityComparer to compare values. + * + * @returns A sequence that contains the elements that form the set intersection of two sequences. + */ + Intersect(array: T[], comparer?: LinqSharp.IEqualityComparer): Linq; + + /** + * Correlates the elements of two sequences based on matching keys. A specified IEqualityComparer is used to compare keys. + * + * @param array The sequence to join to the first sequence. + * @param outerKeySelector A function to extract the join key from each element of the first sequence. + * @param innerKeySelector A function to extract the join key from each element of the second sequence. + * @param resultSelector A function to create a result element from two matching elements. + * @param [comparer] An IEqualityComparer to hash and compare keys. + * + * @returns An array that has elements of type TResult that are obtained by performing an inner join on two sequences. + */ + Join(array: TInner[], outerKeySelector: (e: T) => TKey, innerKeySelector: (e: TInner) => TKey, resultSelector: (outer: T, inner: TInner) => TResult, comparer?: LinqSharp.IEqualityComparer): Linq; + + /** + * Returns the last element of a sequence that satisfies a specified condition. + * + * @param [predicate] A function to test each element for a condition. + * + * @throws No element satisfies the condition in predicate.-or-The source sequence is empty. + * + * @returns The last element in the sequence that passes the test in the specified predicate function. + */ + Last(predicate?: (e: T) => boolean): T; + + /** + * Returns the last element of a sequence that satisfies a condition or a default + * value if no such element is found. + * + * @param [predicate] A function to test each element for a condition. + * @param [defaultValue] A default value to return if no element is found. + * + * @returns defaultValue if the sequence is empty or if no elements pass the test in + * the predicate function; otherwise, the last element that passes the test in the + * predicate function. + */ + LastOrDefault(predicate?: (e: T) => boolean, defaultValue?: T): T; + + /** + * Returns the maximum value in a sequence of System.Double values. + * + * @param [selector] A transform function to apply to each element. + * + * @returns The maximum value in the sequence. + */ + Max(): T; + Max(selector?: (e: T) => TResult): TResult; + + /** + * Returns the minimum value in a sequence of System.Int64 values. + * + * @param [selector] A transform function to apply to each element. + * + * @returns The minimum value in the sequence. + */ + Min(): T; + Min(selector?: (e: T) => TResult): TResult; + + /** + * Sorts the elements of a sequence in ascending order according to a key. + * + * @param keySelector A function to extract a key from an element. + * @param [comparer] An IEqualityComparer to compare values. + * + * @returns An array whose elements are sorted according to a key. + */ + OrderBy(keySelector: (e: T) => TKey, comparer?: (a: TKey, b: TKey) => number): Linq; + + /** + * Sorts the elements of a sequence in descending order according to a key. + * + * @param keySelector A function to extract a key from an element. + * @param [comparer] An IEqualityComparer to compare values. + * + * @returns An array whose elements are sorted in descending order according to a key. + */ + OrderByDescending(keySelector: (e: T) => TKey, comparer?: (a: TKey, b: TKey) => number): Linq; + + /** + * Inverts the order of the elements in a sequence. + * + * @returns A sequence whose elements correspond to those of the input sequence in reverse order. + */ + Reverse(): Linq; + + /** + * Projects each element of a sequence into a new form. + * + * @param selector A transform function to apply to each element. + * + * @returns An array whose elements are the result of invoking the transform function on each element of source. + */ + Select(selector: (e: T, i?: number) => TResult): Linq; + + /** + * Projects each element of a sequence to an array flattens the resulting sequences into one sequence, + * and invokes a result selector function on each element therein. + * + * @param selector A transform function to apply to each element of the input sequence. + * @param [resultSelector] A transform function to apply to each element of the intermediate sequence. + * + * @returns An array whose elements are the result of invoking the one-to-many transform function + * selector on each element of source and then mapping each of those sequence elements and + * their corresponding source element to a result element. + */ + SelectMany(selector: (e: T) => T[], resultSelector?: (e: T) => TResult): Linq; + + /** + * Determines whether two sequences are equal by comparing their elements by using + * a specified IEqualityComparer. + * + * @param second An array to compare to the first sequence. + * @param [comparer] An equality comparer to compare values. + * + * @returns true if the two source sequences are of equal length and their corresponding + * elements compare equal according to comparer; otherwise, false. + */ + SequenceEqual(second: T[], comparer?: (a: T, b: T) => boolean): boolean; + + /** + * Returns the only element of a sequence that satisfies a specified condition, + * and throws an exception if more than one such element exists. + * + * @param [predicate] A function to test an element for a condition. + * + * @returns The single element of the input sequence that satisfies a condition. + */ + Single(predicate?: (e: T) => boolean): T; + + /** + * Returns the only element of a sequence that satisfies a specified condition or + * a default value if no such element exists; this method throws an exception if + * more than one element satisfies the condition. + * + * @param [predicate] A function to test an element for a condition. + * @param [defaultValue] A default value if no element is found. + * + * @returns The single element of the input sequence that satisfies the condition, + * or defaultValue if no such element is found. + */ + SingleOrDefault(predicate?: (e: T) => boolean, defaultValue?: T): T; + + /** + * Bypasses a specified number of elements in a sequence and then returns the remaining + * elements. + * + * @param count The number of elements to skip before returning the remaining elements. + * + * @returns An array that contains the elements that occur + * after the specified index in the input sequence. + */ + Skip(count: number): Linq; + + /** + * Bypasses elements in a sequence as long as a specified condition is true and + * then returns the remaining elements. + * + * @param predicate A function to test an element for a condition. + * + * @returns An array that contains the elements from the + * input sequence starting at the first element in the linear series that does not + * pass the test specified by predicate. + */ + SkipWhile(predicate: (e: T) => boolean): Linq; + + /** + * Computes the sum of a sequence values. + * + * @param [selector] A transform function to apply to each element. + * + * @returns The sum of the values in the sequence. + */ + Sum(selector?: (value: T) => number): number; + + /** + * Returns a specified number of contiguous elements from the start of a sequence. + * + * @param count The number of elements to skip before returning the remaining elements. + * + * @returns An array that contains the specified number of elements from the start + * of the input sequence. + */ + Take(count: number): Linq; + + /** + * Returns elements from a sequence as long as a specified condition is true. + * + * @param predicate A function to test an element for a condition. + * + * @returns An array that contains the elements from the + * input sequence that occur before the element at which the test no longer passes. + */ + TakeWhile(predicate: (e: T) => boolean): Linq; + + /** + * Produces the set union of two sequences by using a specified IEqualityComparer. + * + * @param second An array whose distinct elements form the second set for the union. + * @param [comparer] An equality comparer to compare values. + * + * @returns An array that contains the elements from both + * input sequences, excluding duplicates. + */ + Union(second: T[], comparer?: LinqSharp.IEqualityComparer): Linq; + + /** + * Filters a sequence of values based on a predicate. + * + * @param selector A transform function to apply to each element. + * + * @returns An array that contains elements from the input sequence + * that satisfy the condition. + */ + Where(selector: (value: T) => boolean): Linq; + + /** + * Applies a specified function to the corresponding elements of two sequences, + * producing a sequence of the results. + * + * @param array The second sequence to merge. + * @param resultSelector A function that specifies how to merge the elements from the two sequences. + * + * @returns An array that contains merged elements of two input sequences. + */ + Zip(array: TInner[], resultSelector: (o: T, i: TInner) => TResult): Linq; + + /** + * Retrieves the internal array. + * + * @returns Internal array. + */ + ToArray(): T[]; + } + export default Linq; +} diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 876547fd6..9cae2a872 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -453,13 +453,58 @@ module TestDropWhile { } // _.fill -var testFillArray = [1, 2, 3]; -var testFillList: _.List = {0: 1, 1: 2, 2: 3, length: 3}; +module TestFill { + let array: number[]; + let list: _.List; -result = _.fill(testFillArray, 'a', 0, 3); -result = <_.List>_.fill(testFillList, 'a', 0, 3); -result = _(testFillArray).fill(0, 0, 3).value(); -result = <_.List>_(testFillList).fill(0, 0, 3).value(); + { + let result: number[]; + + result = _.fill(array, 42); + result = _.fill(array, 42, 0); + result = _.fill(array, 42, 0, 10); + } + + { + let result: _.List; + + result = _.fill(list, 42); + result = _.fill(list, 42, 0); + result = _.fill(list, 42, 0, 10); + } + + { + let result: _.LoDashImplicitArrayWrapper; + + result = _(array).fill(42); + result = _(array).fill(42, 0); + result = _(array).fill(42, 0, 10); + } + + { + let result: _.LoDashImplicitObjectWrapper<_.List>; + + result = _(list).fill(42); + result = _(list).fill(42, 0); + result = _(list).fill(42, 0, 10); + } + + { + let result: _.LoDashExplicitArrayWrapper; + + result = _(array).chain().fill(42); + result = _(array).chain().fill(42, 0); + result = _(array).chain().fill(42, 0, 10); + } + + { + let result: _.LoDashExplicitObjectWrapper<_.List>; + + result = _(list).chain().fill(42); + result = _(list).chain().fill(42, 0); + result = _(list).chain().fill(42, 0, 10); + } +} // _.findIndex module TestFindIndex { @@ -615,18 +660,40 @@ module TestFlattenDeep { result = _.flattenDeep(recursiveArray); result = _.flattenDeep(listOfMaybeRecursiveArraysOrValues); - - result = _(recursiveArray).flattenDeep().value(); - - result = _(listOfMaybeRecursiveArraysOrValues).flattenDeep().value(); } { - let result: any; + let result: any[]; result = _.flattenDeep(recursiveList); + } - result = _(recursiveList).flattenDeep().value(); + { + let result: _.LoDashImplicitArrayWrapper; + + result = _(recursiveArray).flattenDeep(); + + result = _(listOfMaybeRecursiveArraysOrValues).flattenDeep(); + } + + { + let result: _.LoDashImplicitArrayWrapper; + + result = _(recursiveList).flattenDeep(); + } + + { + let result: _.LoDashExplicitArrayWrapper; + + result = _(recursiveArray).chain().flattenDeep(); + + result = _(listOfMaybeRecursiveArraysOrValues).chain().flattenDeep(); + } + + { + let result: _.LoDashExplicitArrayWrapper; + + result = _(recursiveList).chain().flattenDeep(); } } @@ -744,12 +811,28 @@ module TestIntersection { module TestLast { let array: TResult[]; let list: _.List; - let result: TResult; - result = _.last(array); - result = _.last(list); - result = _(array).last(); - result = _(list).last(); + { + let result: TResult; + + result = _.last(array); + result = _.last(list); + + result = _(array).last(); + result = _(list).last(); + } + + { + let result: _.LoDashExplicitArrayWrapper; + + result = _(array).chain().last(); + } + + { + let result: _.LoDashExplicitObjectWrapper<_.List>; + + result = _(list).chain().last<_.List>(); + } } // _.lastIndexOf @@ -795,18 +878,17 @@ module TestLastIndexOf { module TestObject { let arrayOfKeys: string[]; let arrayOfValues: number[]; + let arrayOfKeyValuePairs: (string|number)[][] let listOfKeys: _.List; let listOfValues: _.List; + let listOfKeyValuePairs: _.List<_.List>; { let result: _.Dictionary; result = _.object<_.Dictionary>(arrayOfKeys); result = _.object<_.Dictionary>(listOfKeys); - - result = _(arrayOfKeys).object<_.Dictionary>().value(); - result = _(listOfKeys).object<_.Dictionary>().value(); } { @@ -822,15 +904,8 @@ module TestObject { result = _.object>(listOfKeys, listOfValues); result = _.object>(listOfKeys, arrayOfValues); - result = _(arrayOfKeys).object<_.Dictionary>(arrayOfValues).value(); - result = _(arrayOfKeys).object<_.Dictionary>(listOfValues).value(); - result = _(listOfKeys).object<_.Dictionary>(listOfValues).value(); - result = _(listOfKeys).object<_.Dictionary>(arrayOfValues).value(); - - result = _(arrayOfKeys).object>(arrayOfValues).value(); - result = _(arrayOfKeys).object>(listOfValues).value(); - result = _(listOfKeys).object>(listOfValues).value(); - result = _(listOfKeys).object>(arrayOfValues).value(); + result = _.object<_.Dictionary>(arrayOfKeyValuePairs); + result = _.object<_.Dictionary>(listOfKeyValuePairs); } { @@ -844,13 +919,86 @@ module TestObject { result = _.object(listOfKeys, listOfValues); result = _.object(listOfKeys, arrayOfValues); - result = _(arrayOfKeys).object().value(); - result = _(arrayOfKeys).object(arrayOfValues).value(); - result = _(arrayOfKeys).object(listOfValues).value(); + result = _.object<_.Dictionary>(arrayOfKeyValuePairs); + result = _.object<_.Dictionary>(listOfKeyValuePairs); + } - result = _(listOfKeys).object().value(); - result = _(listOfKeys).object(listOfValues).value(); - result = _(listOfKeys).object(arrayOfValues).value(); + { + let result: _.LoDashImplicitObjectWrapper<_.Dictionary>; + + result = _(arrayOfKeys).object<_.Dictionary>(); + result = _(listOfKeys).object<_.Dictionary>(); + } + + { + let result: _.LoDashImplicitObjectWrapper<_.Dictionary>; + + result = _(arrayOfKeys).object<_.Dictionary>(arrayOfValues); + result = _(arrayOfKeys).object<_.Dictionary>(listOfValues); + result = _(listOfKeys).object<_.Dictionary>(listOfValues); + result = _(listOfKeys).object<_.Dictionary>(arrayOfValues); + + result = _(arrayOfKeys).object>(arrayOfValues); + result = _(arrayOfKeys).object>(listOfValues); + result = _(listOfKeys).object>(listOfValues); + result = _(listOfKeys).object>(arrayOfValues); + + result = _(listOfKeys).object<_.Dictionary>(arrayOfKeyValuePairs); + result = _(listOfKeys).object<_.Dictionary>(listOfKeyValuePairs); + } + + { + let result: _.LoDashImplicitObjectWrapper<_.Dictionary>; + + result = _(arrayOfKeys).object(); + result = _(arrayOfKeys).object(arrayOfValues); + result = _(arrayOfKeys).object(listOfValues); + + result = _(listOfKeys).object(); + result = _(listOfKeys).object(listOfValues); + result = _(listOfKeys).object(arrayOfValues); + + result = _(listOfKeys).object(arrayOfKeyValuePairs); + result = _(listOfKeys).object(listOfKeyValuePairs); + } + + { + let result: _.LoDashExplicitObjectWrapper<_.Dictionary>; + + result = _(arrayOfKeys).chain().object<_.Dictionary>(); + result = _(listOfKeys).chain().object<_.Dictionary>(); + } + + { + let result: _.LoDashExplicitObjectWrapper<_.Dictionary>; + + result = _(arrayOfKeys).chain().object<_.Dictionary>(arrayOfValues); + result = _(arrayOfKeys).chain().object<_.Dictionary>(listOfValues); + result = _(listOfKeys).chain().object<_.Dictionary>(listOfValues); + result = _(listOfKeys).chain().object<_.Dictionary>(arrayOfValues); + + result = _(arrayOfKeys).chain().object>(arrayOfValues); + result = _(arrayOfKeys).chain().object>(listOfValues); + result = _(listOfKeys).chain().object>(listOfValues); + result = _(listOfKeys).chain().object>(arrayOfValues); + + result = _(listOfKeys).chain().object<_.Dictionary>(arrayOfKeyValuePairs); + result = _(listOfKeys).chain().object<_.Dictionary>(listOfKeyValuePairs); + } + + { + let result: _.LoDashExplicitObjectWrapper<_.Dictionary>; + + result = _(arrayOfKeys).chain().object(); + result = _(arrayOfKeys).chain().object(arrayOfValues); + result = _(arrayOfKeys).chain().object(listOfValues); + + result = _(listOfKeys).chain().object(); + result = _(listOfKeys).chain().object(listOfValues); + result = _(listOfKeys).chain().object(arrayOfValues); + + result = _(listOfKeys).chain().object(arrayOfKeyValuePairs); + result = _(listOfKeys).chain().object(listOfKeyValuePairs); } } @@ -916,26 +1064,51 @@ module TestPull { } // _.pullAt -{ - let testPullAtArray: TResult[]; - let testPullAtList: _.List; - let result: TResult[]; - result = _.pullAt(testPullAtArray); - result = _.pullAt(testPullAtArray, 1); - result = _.pullAt(testPullAtArray, [2, 3], 1); - result = _.pullAt(testPullAtArray, 4, [2, 3], 1); - result = _.pullAt(testPullAtList); - result = _.pullAt(testPullAtList, 1); - result = _.pullAt(testPullAtList, [2, 3], 1); - result = _.pullAt(testPullAtList, 4, [2, 3], 1); - result = _(testPullAtArray).pullAt().value(); - result = _(testPullAtArray).pullAt(1).value(); - result = _(testPullAtArray).pullAt([2, 3], 1).value(); - result = _(testPullAtArray).pullAt(4, [2, 3], 1).value(); - result = _(testPullAtList).pullAt().value(); - result = _(testPullAtList).pullAt(1).value(); - result = _(testPullAtList).pullAt([2, 3], 1).value(); - result = _(testPullAtList).pullAt(4, [2, 3], 1).value(); +module TestPullAt { + let array: TResult[]; + let list: _.List; + + { + let result: TResult[]; + + result = _.pullAt(array); + result = _.pullAt(array, 1); + result = _.pullAt(array, [2, 3], 1); + result = _.pullAt(array, 4, [2, 3], 1); + + result = _.pullAt(list); + result = _.pullAt(list, 1); + result = _.pullAt(list, [2, 3], 1); + result = _.pullAt(list, 4, [2, 3], 1); + } + + { + let result: _.LoDashImplicitArrayWrapper; + + result = _(array).pullAt(); + result = _(array).pullAt(1); + result = _(array).pullAt([2, 3], 1); + result = _(array).pullAt(4, [2, 3], 1); + + result = _(list).pullAt(); + result = _(list).pullAt(1); + result = _(list).pullAt([2, 3], 1); + result = _(list).pullAt(4, [2, 3], 1); + } + + { + let result: _.LoDashExplicitArrayWrapper; + + result = _(array).chain().pullAt(); + result = _(array).chain().pullAt(1); + result = _(array).chain().pullAt([2, 3], 1); + result = _(array).chain().pullAt(4, [2, 3], 1); + + result = _(list).chain().pullAt(); + result = _(list).chain().pullAt(1); + result = _(list).chain().pullAt([2, 3], 1); + result = _(list).chain().pullAt(4, [2, 3], 1); + } } // _.remove @@ -1058,17 +1231,86 @@ module TestSlice { // _.sortedIndex module TestSortedIndex { - result = _.sortedIndex([20, 30, 50], 40); - result = _.sortedIndex([{ 'x': 20 }, { 'x': 30 }, { 'x': 50 }], { 'x': 40 }, 'x'); - var sortedIndexDict: { wordToNumber: { [idx: string]: number } } = { - 'wordToNumber': { 'twenty': 20, 'thirty': 30, 'fourty': 40, 'fifty': 50 } - }; - result = _.sortedIndex(['twenty', 'thirty', 'fifty'], 'fourty', function (word: string) { - return sortedIndexDict.wordToNumber[word]; - }); - result = _.sortedIndex(['twenty', 'thirty', 'fifty'], 'fourty', function (word: string) { - return this.wordToNumber[word]; - }, sortedIndexDict); + type SampleType = {a: number; b: string; c: boolean;}; + + let array: SampleType[]; + let list: _.List; + + let value: SampleType; + + let stringIterator: (x: string) => number; + let arrayIterator: (x: SampleType) => number; + let listIterator: (x: SampleType) => number; + + { + let result: number; + + result = _.sortedIndex('', ''); + result = _.sortedIndex('', '', stringIterator); + result = _.sortedIndex('', '', stringIterator, any); + result = _.sortedIndex('', '', stringIterator); + result = _.sortedIndex('', '', stringIterator, any); + + result = _.sortedIndex(array, value); + result = _.sortedIndex(array, value, arrayIterator); + result = _.sortedIndex(array, value, arrayIterator, any); + result = _.sortedIndex(array, value, ''); + result = _.sortedIndex(array, value, {a: 42}); + result = _.sortedIndex(array, value, arrayIterator); + result = _.sortedIndex(array, value, arrayIterator, any); + result = _.sortedIndex<{a: number}, SampleType>(array, value, {a: 42}); + + result = _.sortedIndex(list, value); + result = _.sortedIndex(list, value, listIterator); + result = _.sortedIndex(list, value, listIterator, any); + result = _.sortedIndex(list, value, ''); + result = _.sortedIndex(list, value, {a: 42}); + result = _.sortedIndex(list, value, listIterator); + result = _.sortedIndex(list, value, listIterator, any); + result = _.sortedIndex<{a: number}, SampleType>(list, value, {a: 42}); + + result = _('').sortedIndex(''); + result = _('').sortedIndex('', stringIterator); + result = _('').sortedIndex('', stringIterator, any); + + result = _(array).sortedIndex(value); + result = _(array).sortedIndex(value, arrayIterator); + result = _(array).sortedIndex(value, arrayIterator, any); + result = _(array).sortedIndex(value, ''); + result = _(array).sortedIndex<{a: number}>(value, {a: 42}); + + result = _(list).sortedIndex(value); + result = _(list).sortedIndex(value, listIterator); + result = _(list).sortedIndex(value, listIterator, any); + result = _(list).sortedIndex(value, ''); + result = _(list).sortedIndex(value, {a: 42}); + result = _(list).sortedIndex(value, listIterator); + result = _(list).sortedIndex(value, listIterator, any); + result = _(list).sortedIndex<{a: number}, SampleType>(value, {a: 42}); + } + + { + let result: _.LoDashExplicitWrapper; + + result = _('').chain().sortedIndex(''); + result = _('').chain().sortedIndex('', stringIterator); + result = _('').chain().sortedIndex('', stringIterator, any); + + result = _(array).chain().sortedIndex(value); + result = _(array).chain().sortedIndex(value, arrayIterator); + result = _(array).chain().sortedIndex(value, arrayIterator, any); + result = _(array).chain().sortedIndex(value, ''); + result = _(array).chain().sortedIndex<{a: number}>(value, {a: 42}); + + result = _(list).chain().sortedIndex(value); + result = _(list).chain().sortedIndex(value, listIterator); + result = _(list).chain().sortedIndex(value, listIterator, any); + result = _(list).chain().sortedIndex(value, ''); + result = _(list).chain().sortedIndex(value, {a: 42}); + result = _(list).chain().sortedIndex(value, listIterator); + result = _(list).chain().sortedIndex(value, listIterator, any); + result = _(list).chain().sortedIndex<{a: number}, SampleType>(value, {a: 42}); + } } // _.sortedLastIndex @@ -1151,18 +1393,39 @@ module TestTake { } // _.takeRight -{ - let testTakeRightArray: TResult[]; - let testTakeRightList: _.List; - let result: TResult[]; - result = _.takeRight(testTakeRightArray); - result = _.takeRight(testTakeRightArray, 42); - result = _.takeRight(testTakeRightList); - result = _.takeRight(testTakeRightList, 42); - result = _(testTakeRightArray).takeRight().value(); - result = _(testTakeRightArray).takeRight(42).value(); - result = _(testTakeRightList).takeRight().value(); - result = _(testTakeRightList).takeRight(42).value(); +module TestTakeRight { + let array: TResult[]; + let list: _.List; + + { + let result: TResult[]; + + result = _.takeRight(array); + result = _.takeRight(array, 42); + + result = _.takeRight(list); + result = _.takeRight(list, 42); + } + + { + let result: _.LoDashImplicitArrayWrapper; + + result = _(array).takeRight(); + result = _(array).takeRight(42); + + result = _(list).takeRight(); + result = _(list).takeRight(42); + } + + { + let result: _.LoDashExplicitArrayWrapper; + + result = _(array).chain().takeRight(); + result = _(array).chain().takeRight(42); + + result = _(list).chain().takeRight(); + result = _(list).chain().takeRight(42); + } } // _.takeRightWhile @@ -1231,35 +1494,60 @@ module TestTakeWhile { let array: TResult[]; let list: _.List; let predicateFn: (value: TResult, index: number, collection: _.List) => boolean; - let result: TResult[]; - 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}); + { + let result: TResult[]; - 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}); + 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 = _(array).takeWhile().value(); - result = _(array).takeWhile(predicateFn).value(); - result = _(array).takeWhile(predicateFn, any).value(); - result = _(array).takeWhile('').value(); - result = _(array).takeWhile('', any).value(); - result = _(array).takeWhile<{a: number;}>({a: 42}).value(); + 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}); + } - result = _(list).takeWhile().value(); - result = _(list).takeWhile(predicateFn).value(); - result = _(list).takeWhile(predicateFn, any).value(); - result = _(list).takeWhile('').value(); - result = _(list).takeWhile('', any).value(); - result = _(list).takeWhile<{a: number;}, TResult>({a: 42}).value(); + { + let result: _.LoDashImplicitArrayWrapper; + + 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}); + } + + { + let result: _.LoDashExplicitArrayWrapper; + + 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}); + } } // _.union @@ -1346,6 +1634,39 @@ result = _(['A', 'b', 'C', 'a', 'B', 'c']).unique(function (letter) { result = _([1, 2.5, 3, 1.5, 2, 3.5]).unique(function (num) { return this.floor(num); }, Math).value(); result = <{ x: number; }[]>_([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }]).unique('x').value(); +// _.upzip +module TestUnzip { + let array = [['a', 'b'], [1, 2], [true, false]]; + + let list: _.List<_.List> = { + 0: {0: 'a', 1: 'b', length: 2}, + 1: {0: 1, 1: 2, length: 2}, + 2: {0: true, 1: false, length: 2}, + length: 3 + }; + + { + let result: (string|number|boolean)[][]; + + result = _.unzip(array); + result = _.unzip(list); + } + + { + let result: _.LoDashImplicitArrayWrapper<(string|number|boolean)[]>; + + result = _(array).unzip(); + result = _(list).unzip(); + } + + { + let result: _.LoDashExplicitArrayWrapper<(string|number|boolean)[]>; + + result = _(array).chain().unzip(); + result = _(list).chain().unzip(); + } +} + // _.unzipWith { let testUnzipWithArray: (number[]|_.List)[]; @@ -1365,74 +1686,149 @@ result = <{ x: number; }[]>_([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }]).unique('x').v } // _.without -{ - let testWithoutArray: number[]; - let testWithoutList: _.List; - let result: number[]; - result = _.without(testWithoutArray); - result = _.without(testWithoutArray, 1); - result = _.without(testWithoutArray, 1, 2); - result = _.without(testWithoutArray, 1, 2, 3); - result = _.without(testWithoutList); - result = _.without(testWithoutList, 1); - result = _.without(testWithoutList, 1, 2); - result = _.without(testWithoutList, 1, 2, 3); - result = _(testWithoutArray).without().value(); - result = _(testWithoutArray).without(1).value(); - result = _(testWithoutArray).without(1, 2).value(); - result = _(testWithoutArray).without(1, 2, 3).value(); - result = _(testWithoutList).without().value(); - result = _(testWithoutList).without(1).value(); - result = _(testWithoutList).without(1, 2).value(); - result = _(testWithoutList).without(1, 2, 3).value(); +module TestWithout { + let array: number[]; + let list: _.List; + + { + let result: number[]; + + result = _.without(array); + result = _.without(array, 1); + result = _.without(array, 1, 2); + result = _.without(array, 1, 2, 3); + + result = _.without(list); + result = _.without(list, 1); + result = _.without(list, 1, 2); + result = _.without(list, 1, 2, 3); + } + + { + let result: _.LoDashImplicitArrayWrapper; + + result = _(array).without(); + result = _(array).without(1); + result = _(array).without(1, 2); + result = _(array).without(1, 2, 3); + result = _(list).without(); + result = _(list).without(1); + result = _(list).without(1, 2); + result = _(list).without(1, 2, 3); + } + + { + let result: _.LoDashExplicitArrayWrapper; + + result = _(array).chain().without(); + result = _(array).chain().without(1); + result = _(array).chain().without(1, 2); + result = _(array).chain().without(1, 2, 3); + + result = _(list).chain().without(); + result = _(list).chain().without(1); + result = _(list).chain().without(1, 2); + result = _(list).chain().without(1, 2, 3); + } } // _.xor module TestXor { let array: TResult[]; let list: _.List; - let result: TResult[]; - result = _.xor(); + { + let result: TResult[]; - result = _.xor(array); - result = _.xor(array, list); - result = _.xor(array, list, array); + result = _.xor(); - result = _.xor(list); - result = _.xor(list, array); - result = _.xor(list, array, list); + result = _.xor(array); + result = _.xor(array, list); + result = _.xor(array, list, array); - result = _(array).xor().value(); - result = _(array).xor(list).value(); - result = _(array).xor(list, array).value(); + result = _.xor(list); + result = _.xor(list, array); + result = _.xor(list, array, list); + } - result = _(list).xor().value(); - result = _(list).xor(array).value(); - result = _(list).xor(array, list).value(); + { + let result: _.LoDashImplicitArrayWrapper; + + result = _(array).xor(); + result = _(array).xor(list); + result = _(array).xor(list, array); + + result = _(list).xor(); + result = _(list).xor(array); + result = _(list).xor(array, list); + } + + { + let result: _.LoDashExplicitArrayWrapper; + + result = _(array).chain().xor(); + result = _(array).chain().xor(list); + result = _(array).chain().xor(list, array); + + result = _(list).chain().xor(); + result = _(list).chain().xor(array); + result = _(list).chain().xor(array, list); + } } -result = _.zip(['moe', 'larry'], [30, 40], [true, false]); -result = _.unzip(['moe', 'larry'], [30, 40], [true, false]); -result = _(['moe', 'larry']).zip([30, 40], [true, false]).value(); -result = _(['moe', 'larry']).unzip([30, 40], [true, false]).value(); +// _.zip +module TestZip { + let array: TResult[]; + let list: _.List; + + { + let result: TResult[][]; + + result = _.zip(array); + result = _.zip(array, list); + result = _.zip(array, list, array); + + result = _.zip(list); + result = _.zip(list, array); + result = _.zip(list, array, list); + } + + { + let result: _.LoDashImplicitArrayWrapper; + + result = _(array).zip(list); + result = _(array).zip(list, array); + + result = _(list).zip(array); + result = _(list).zip(array, list); + } + + { + let result: _.LoDashExplicitArrayWrapper; + + result = _(array).chain().zip(list); + result = _(array).chain().zip(list, array); + + result = _(list).chain().zip(array); + result = _(list).chain().zip(array, list); + } +} // _.zipObject module TestZipObject { let arrayOfKeys: string[]; let arrayOfValues: number[]; + let arrayOfKeyValuePairs: (string|number)[][] let listOfKeys: _.List; let listOfValues: _.List; + let listOfKeyValuePairs: _.List<_.List>; { let result: _.Dictionary; result = _.zipObject<_.Dictionary>(arrayOfKeys); result = _.zipObject<_.Dictionary>(listOfKeys); - - result = _(arrayOfKeys).zipObject<_.Dictionary>().value(); - result = _(listOfKeys).zipObject<_.Dictionary>().value(); } { @@ -1448,15 +1844,8 @@ module TestZipObject { result = _.zipObject>(listOfKeys, listOfValues); result = _.zipObject>(listOfKeys, arrayOfValues); - result = _(arrayOfKeys).zipObject<_.Dictionary>(arrayOfValues).value(); - result = _(arrayOfKeys).zipObject<_.Dictionary>(listOfValues).value(); - result = _(listOfKeys).zipObject<_.Dictionary>(listOfValues).value(); - result = _(listOfKeys).zipObject<_.Dictionary>(arrayOfValues).value(); - - result = _(arrayOfKeys).zipObject>(arrayOfValues).value(); - result = _(arrayOfKeys).zipObject>(listOfValues).value(); - result = _(listOfKeys).zipObject>(listOfValues).value(); - result = _(listOfKeys).zipObject>(arrayOfValues).value(); + result = _.zipObject<_.Dictionary>(arrayOfKeyValuePairs); + result = _.zipObject<_.Dictionary>(listOfKeyValuePairs); } { @@ -1470,13 +1859,86 @@ module TestZipObject { result = _.zipObject(listOfKeys, listOfValues); result = _.zipObject(listOfKeys, arrayOfValues); - result = _(arrayOfKeys).zipObject().value(); - result = _(arrayOfKeys).zipObject(arrayOfValues).value(); - result = _(arrayOfKeys).zipObject(listOfValues).value(); + result = _.zipObject<_.Dictionary>(arrayOfKeyValuePairs); + result = _.zipObject<_.Dictionary>(listOfKeyValuePairs); + } - result = _(listOfKeys).zipObject().value(); - result = _(listOfKeys).zipObject(listOfValues).value(); - result = _(listOfKeys).zipObject(arrayOfValues).value(); + { + let result: _.LoDashImplicitObjectWrapper<_.Dictionary>; + + result = _(arrayOfKeys).zipObject<_.Dictionary>(); + result = _(listOfKeys).zipObject<_.Dictionary>(); + } + + { + let result: _.LoDashImplicitObjectWrapper<_.Dictionary>; + + result = _(arrayOfKeys).zipObject<_.Dictionary>(arrayOfValues); + result = _(arrayOfKeys).zipObject<_.Dictionary>(listOfValues); + result = _(listOfKeys).zipObject<_.Dictionary>(listOfValues); + result = _(listOfKeys).zipObject<_.Dictionary>(arrayOfValues); + + result = _(arrayOfKeys).zipObject>(arrayOfValues); + result = _(arrayOfKeys).zipObject>(listOfValues); + result = _(listOfKeys).zipObject>(listOfValues); + result = _(listOfKeys).zipObject>(arrayOfValues); + + result = _(listOfKeys).zipObject<_.Dictionary>(arrayOfKeyValuePairs); + result = _(listOfKeys).zipObject<_.Dictionary>(listOfKeyValuePairs); + } + + { + let result: _.LoDashImplicitObjectWrapper<_.Dictionary>; + + result = _(arrayOfKeys).zipObject(); + result = _(arrayOfKeys).zipObject(arrayOfValues); + result = _(arrayOfKeys).zipObject(listOfValues); + + result = _(listOfKeys).zipObject(); + result = _(listOfKeys).zipObject(listOfValues); + result = _(listOfKeys).zipObject(arrayOfValues); + + result = _(listOfKeys).zipObject(arrayOfKeyValuePairs); + result = _(listOfKeys).zipObject(listOfKeyValuePairs); + } + + { + let result: _.LoDashExplicitObjectWrapper<_.Dictionary>; + + result = _(arrayOfKeys).chain().zipObject<_.Dictionary>(); + result = _(listOfKeys).chain().zipObject<_.Dictionary>(); + } + + { + let result: _.LoDashExplicitObjectWrapper<_.Dictionary>; + + result = _(arrayOfKeys).chain().zipObject<_.Dictionary>(arrayOfValues); + result = _(arrayOfKeys).chain().zipObject<_.Dictionary>(listOfValues); + result = _(listOfKeys).chain().zipObject<_.Dictionary>(listOfValues); + result = _(listOfKeys).chain().zipObject<_.Dictionary>(arrayOfValues); + + result = _(arrayOfKeys).chain().zipObject>(arrayOfValues); + result = _(arrayOfKeys).chain().zipObject>(listOfValues); + result = _(listOfKeys).chain().zipObject>(listOfValues); + result = _(listOfKeys).chain().zipObject>(arrayOfValues); + + result = _(listOfKeys).chain().zipObject<_.Dictionary>(arrayOfKeyValuePairs); + result = _(listOfKeys).chain().zipObject<_.Dictionary>(listOfKeyValuePairs); + } + + { + let result: _.LoDashExplicitObjectWrapper<_.Dictionary>; + + result = _(arrayOfKeys).chain().zipObject(); + result = _(arrayOfKeys).chain().zipObject(arrayOfValues); + result = _(arrayOfKeys).chain().zipObject(listOfValues); + + result = _(listOfKeys).chain().zipObject(); + result = _(listOfKeys).chain().zipObject(listOfValues); + result = _(listOfKeys).chain().zipObject(arrayOfValues); + + result = _(listOfKeys).chain().zipObject(arrayOfKeyValuePairs); + result = _(listOfKeys).chain().zipObject(listOfKeyValuePairs); } } @@ -2231,17 +2693,34 @@ module TestAny { } // _.at -{ - let testAtArray: TResult[]; - let testAtList: _.List; - let testAtDictionary: _.Dictionary; - let result: TResult[]; - result = _.at(testAtArray, 0, '1', [2], ['3'], [4, '5']); - result = _.at(testAtList, 0, '1', [2], ['3'], [4, '5']); - result = _.at(testAtDictionary, 0, '1', [2], ['3'], [4, '5']); - result = _(testAtArray).at(0, '1', [2], ['3'], [4, '5']).value(); - result = _(testAtList).at(0, '1', [2], ['3'], [4, '5']).value(); - result = _(testAtDictionary).at(0, '1', [2], ['3'], [4, '5']).value(); +module TestAt { + let array: TResult[]; + let list: _.List; + let dictionary: _.Dictionary; + + { + let result: TResult[]; + + result = _.at(array, 0, '1', [2], ['3'], [4, '5']); + result = _.at(list, 0, '1', [2], ['3'], [4, '5']); + result = _.at(dictionary, 0, '1', [2], ['3'], [4, '5']); + } + + { + let result: _.LoDashImplicitArrayWrapper; + + result = _(array).at(0, '1', [2], ['3'], [4, '5']); + result = _(list).at(0, '1', [2], ['3'], [4, '5']); + result = _(dictionary).at(0, '1', [2], ['3'], [4, '5']); + } + + { + let result: _.LoDashExplicitArrayWrapper; + + result = _(array).chain().at(0, '1', [2], ['3'], [4, '5']); + result = _(list).chain().at(0, '1', [2], ['3'], [4, '5']); + result = _(dictionary).chain().at(0, '1', [2], ['3'], [4, '5']); + } } // _.collect @@ -2335,35 +2814,51 @@ module TestCollect { } } -result = _.contains([1, 2, 3], 1); -result = _.contains([1, 2, 3], 1, 2); -result = _.contains({ 'moe': 30, 'larry': 40, 'curly': 67 }, 40); -result = _.contains('curly', 'ur'); +// _.contains +module TestContains { + type SampleType = {a: string; b: number; c: boolean;}; -result = _([1, 2, 3]).contains(1); -result = _([1, 2, 3]).contains(1, 2); -result = _({ 'moe': 30, 'larry': 40, 'curly': 67 }).contains(40); -result = _('curly').contains('ur'); + let array: SampleType[]; + let list: _.List; + let dictionary: _.Dictionary; -result = _.include([1, 2, 3], 1); -result = _.include([1, 2, 3], 1, 2); -result = _.include({ 'moe': 30, 'larry': 40, 'curly': 67 }, 40); -result = _.include('curly', 'ur'); + let target: SampleType; -result = _([1, 2, 3]).include(1); -result = _([1, 2, 3]).include(1, 2); -result = _({ 'moe': 30, 'larry': 40, 'curly': 67 }).include(40); -result = _('curly').include('ur'); + { + let result: boolean; -result = _.includes([1, 2, 3], 1); -result = _.includes([1, 2, 3], 1, 2); -result = _.includes({ 'moe': 30, 'larry': 40, 'curly': 67 }, 40); -result = _.includes('curly', 'ur'); + result = _.contains(array, target); + result = _.contains(array, target, 42); -result = _([1, 2, 3]).includes(1); -result = _([1, 2, 3]).includes(1, 2); -result = _({ 'moe': 30, 'larry': 40, 'curly': 67 }).includes(40); -result = _('curly').includes('ur'); + result = _.contains(list, target); + result = _.contains(list, target, 42); + + result = _.contains(dictionary, target); + result = _.contains(dictionary, target, 42); + + result = _(array).contains(target); + result = _(array).contains(target, 42); + + result = _(list).contains(target); + result = _(list).contains(target, 42); + + result = _(dictionary).contains(target); + result = _(dictionary).contains(target, 42); + } + + { + let result: _.LoDashExplicitWrapper; + + result = _(array).chain().contains(target); + result = _(array).chain().contains(target, 42); + + result = _(list).chain().contains(target); + result = _(list).chain().contains(target, 42); + + result = _(dictionary).chain().contains(target); + result = _(dictionary).chain().contains(target, 42); + } +} result = <_.Dictionary>_.countBy([4.3, 6.1, 6.4], function (num) { return Math.floor(num); }); result = <_.Dictionary>_.countBy([4.3, 6.1, 6.4], function (num) { return this.floor(num); }, Math); @@ -2427,9 +2922,9 @@ module TestEach { let list: _.List; let dictionary: _.Dictionary; - let stringIterator: (char: string, index: number, string: string) => boolean|void; - let listIterator: (value: TResult, index: number, collection: _.List) => boolean|void; - let dictionaryIterator: (value: TResult, key: string, collection: _.Dictionary) => boolean|void; + let stringIterator: (char: string, index: number, string: string) => any; + let listIterator: (value: TResult, index: number, collection: _.List) => any; + let dictionaryIterator: (value: TResult, key: string, collection: _.Dictionary) => any; { let result: string; @@ -2516,6 +3011,101 @@ module TestEach { } } +// _.eachRight +module TestEachRight { + let array: TResult[]; + let list: _.List; + let dictionary: _.Dictionary; + + let stringIterator: (char: string, index: number, string: string) => any; + let listIterator: (value: TResult, index: number, collection: _.List) => any; + let dictionaryIterator: (value: TResult, key: string, collection: _.Dictionary) => any; + + { + 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); + } +} + // _.every module TestEvery { let array: TResult[]; @@ -2588,22 +3178,103 @@ module TestEvery { } } -result = _.filter([1, 2, 3, 4, 5, 6]); -result = _.filter([1, 2, 3, 4, 5, 6], function (num) { return num % 2 == 0; }); -result = _.filter(foodsCombined, 'organic'); -result = _.filter(foodsCombined, { 'type': 'fruit' }); +// _.filter +module TestFilter { + let array: TResult[]; + let list: _.List; + let dictionary: _.Dictionary; -result = _([1, 2, 3, 4, 5, 6]).filter(function (num) { return num % 2 == 0; }).value(); -result = _(foodsCombined).filter('organic').value(); -result = _(foodsCombined).filter({ 'type': 'fruit' }).value(); + let stringIterator: (char: string, index: number, string: string) => any; + let listIterator: (value: TResult, index: number, collection: _.List) => any; + let dictionaryIterator: (value: TResult, key: string, collection: _.Dictionary) => any; -result = _.select([1, 2, 3, 4, 5, 6], function (num) { return num % 2 == 0; }); -result = _.select(foodsCombined, 'organic'); -result = _.select(foodsCombined, { 'type': 'fruit' }); + { + let result: string[]; -result = _([1, 2, 3, 4, 5, 6]).select(function (num) { return num % 2 == 0; }).value(); -result = _(foodsCombined).select('organic').value(); -result = _(foodsCombined).select({ 'type': 'fruit' }).value(); + 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}); + } + + { + 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}); + } + + { + 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}); + } +} // _.find module TestFind { @@ -2677,9 +3348,9 @@ module TestForEach { let list: _.List; let dictionary: _.Dictionary; - let stringIterator: (char: string, index: number, string: string) => boolean|void; - let listIterator: (value: TResult, index: number, collection: _.List) => boolean|void; - let dictionaryIterator: (value: TResult, key: string, collection: _.Dictionary) => boolean|void; + let stringIterator: (char: string, index: number, string: string) => any; + let listIterator: (value: TResult, index: number, collection: _.List) => any; + let dictionaryIterator: (value: TResult, key: string, collection: _.Dictionary) => any; { let result: string; @@ -2766,33 +3437,341 @@ module TestForEach { } } -result = _.forEachRight([1, 2, 3], function (num) { console.log(num); }); -result = <_.Dictionary>_.forEachRight({ 'one': 1, 'two': 2, 'three': 3 }, function (num) { console.log(num); }); +// _.forEachRight +module TestForEachRight { + let array: TResult[]; + let list: _.List; + let dictionary: _.Dictionary; -result = _.eachRight([1, 2, 3], function (num) { console.log(num); }); -result = <_.Dictionary>_.eachRight({ 'one': 1, 'two': 2, 'three': 3 }, function (num) { console.log(num); }); + let stringIterator: (char: string, index: number, string: string) => any; + let listIterator: (value: TResult, index: number, collection: _.List) => any; + let dictionaryIterator: (value: TResult, key: string, collection: _.Dictionary) => any; -result = <_.LoDashImplicitArrayWrapper>_([1, 2, 3]).forEachRight(function (num) { console.log(num); }); -result = <_.LoDashImplicitObjectWrapper<_.Dictionary>>_(<{ [index: string]: number; }>{ 'one': 1, 'two': 2, 'three': 3 }).forEachRight(function (num) { console.log(num); }); + { + let result: string; -result = <_.LoDashImplicitArrayWrapper>_([1, 2, 3]).eachRight(function (num) { console.log(num); }); -result = <_.LoDashImplicitObjectWrapper<_.Dictionary>>_(<{ [index: string]: number; }>{ 'one': 1, 'two': 2, 'three': 3 }).eachRight(function (num) { console.log(num); }); + _.forEachRight('', stringIterator); + _.forEachRight('', stringIterator, any); + } -result = <_.Dictionary>_.groupBy([4.2, 6.1, 6.4], function (num) { return Math.floor(num); }); -result = <_.Dictionary>_.groupBy([4.2, 6.1, 6.4], function (num) { return this.floor(num); }, Math); -result = <_.Dictionary>_.groupBy(['one', 'two', 'three'], 'length'); + { + let result: TResult[]; -result = <_.Dictionary>_.groupBy({ prop1: 4.2, prop2: 6.1, prop3: 6.4}, function (num) { return Math.floor(num); }); -result = <_.Dictionary>_.groupBy({ prop1: 4.2, prop2: 6.1, prop3: 6.4}, function (num) { return this.floor(num); }, Math); -result = <_.Dictionary>_.groupBy({ prop1: 'one', prop2: 'two', prop3: 'three'}, 'length'); + _.forEachRight(array, listIterator); + _.forEachRight(array, listIterator, any); + } -result = <_.Dictionary>_([4.2, 6.1, 6.4]).groupBy(function (num) { return Math.floor(num); }).value(); -result = <_.Dictionary>_([4.2, 6.1, 6.4]).groupBy(function (num) { return this.floor(num); }, Math).value(); -result = <_.Dictionary>_(['one', 'two', 'three']).groupBy('length').value(); + { + let result: _.List; -result = <_.Dictionary>_({ prop1: 4.2, prop2: 6.1, prop3: 6.4}).groupBy(function (num) { return Math.floor(num); }).value(); -result = <_.Dictionary>_({ prop1: 4.2, prop2: 6.1, prop3: 6.4}).groupBy(function (num) { return this.floor(num); }, Math).value(); -result = <_.Dictionary>_({ prop1: 'one', prop2: 'two', prop3: 'three'}).groupBy('length').value(); + _.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); + } +} + +// _.groupBy +module TestGroupBy { + type SampleType = {a: number; b: string; c: boolean;}; + + let array: SampleType[]; + let list: _.List; + let dictionary: _.Dictionary; + + let stringIterator: (char: string, index: number, string: string) => number; + let listIterator: (value: SampleType, index: number, collection: _.List) => number; + let dictionaryIterator: (value: SampleType, key: string, collection: _.Dictionary) => number; + + { + let result: _.Dictionary; + + result = _.groupBy(''); + result = _.groupBy('', stringIterator); + result = _.groupBy('', stringIterator, any); + result = _.groupBy('', stringIterator); + result = _.groupBy('', stringIterator, any); + } + + { + let result: _.Dictionary; + + 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<{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<{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<{a: number}, SampleType>(dictionary, {a: 42}); + } + + { + let result: _.LoDashImplicitObjectWrapper<_.Dictionary>; + + result = _('').groupBy(); + result = _('').groupBy(stringIterator); + result = _('').groupBy(stringIterator, any); + } + + { + let result: _.LoDashImplicitObjectWrapper<_.Dictionary>; + + result = _(array).groupBy(); + result = _(array).groupBy(listIterator); + result = _(array).groupBy(listIterator, any); + result = _(array).groupBy(''); + result = _(array).groupBy('', true); + 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<{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<{a: number}, SampleType>({a: 42}); + } + + { + let result: _.LoDashExplicitObjectWrapper<_.Dictionary>; + + result = _('').chain().groupBy(); + result = _('').chain().groupBy(stringIterator); + result = _('').chain().groupBy(stringIterator, any); + } + + { + let result: _.LoDashExplicitObjectWrapper<_.Dictionary>; + + 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<{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<{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<{a: number}, SampleType>({a: 42}); + } +} + +// _.include +module TestInclude { + type SampleType = {a: string; b: number; c: boolean;}; + + let array: SampleType[]; + let list: _.List; + let dictionary: _.Dictionary; + + let target: SampleType; + + { + let result: boolean; + + result = _.include(array, target); + result = _.include(array, target, 42); + + result = _.include(list, target); + result = _.include(list, target, 42); + + result = _.include(dictionary, target); + result = _.include(dictionary, target, 42); + + result = _(array).include(target); + result = _(array).include(target, 42); + + result = _(list).include(target); + result = _(list).include(target, 42); + + result = _(dictionary).include(target); + result = _(dictionary).include(target, 42); + } + + { + let result: _.LoDashExplicitWrapper; + + result = _(array).chain().include(target); + result = _(array).chain().include(target, 42); + + result = _(list).chain().include(target); + result = _(list).chain().include(target, 42); + + result = _(dictionary).chain().include(target); + result = _(dictionary).chain().include(target, 42); + } +} + +// _.includes +module TestIncludes { + type SampleType = {a: string; b: number; c: boolean;}; + + let array: SampleType[]; + let list: _.List; + let dictionary: _.Dictionary; + + let target: SampleType; + + { + let result: boolean; + + result = _.includes(array, target); + result = _.includes(array, target, 42); + + result = _.includes(list, target); + result = _.includes(list, target, 42); + + result = _.includes(dictionary, target); + result = _.includes(dictionary, target, 42); + + result = _(array).includes(target); + result = _(array).includes(target, 42); + + result = _(list).includes(target); + result = _(list).includes(target, 42); + + result = _(dictionary).includes(target); + result = _(dictionary).includes(target, 42); + } + + { + let result: _.LoDashExplicitWrapper; + + result = _(array).chain().includes(target); + result = _(array).chain().includes(target, 42); + + result = _(list).chain().includes(target); + result = _(list).chain().includes(target, 42); + + result = _(dictionary).chain().includes(target); + result = _(dictionary).chain().includes(target, 42); + } +} result = <_.Dictionary>_.indexBy(keys, 'dir'); result = <_.Dictionary>_.indexBy(keys, function (key) { return String.fromCharCode(key.code); }); @@ -3041,13 +4020,103 @@ result = _({ 'a': 1, 'b': 2, 'c': 3 }).inject(function (r: ABC result = _.reduceRight([[0, 1], [2, 3], [4, 5]], function (a: number[], b: number[]) { return a.concat(b); }, []); result = _.foldr([[0, 1], [2, 3], [4, 5]], function (a: number[], b: number[]) { return a.concat(b); }, []); -result = _.reject([1, 2, 3, 4, 5, 6], function (num) { return num % 2 == 0; }); -result = _.reject(foodsCombined, 'organic'); -result = _.reject(foodsCombined, { 'type': 'fruit' }); +// _.reject +module TestReject { + let array: TResult[]; + let list: _.List; + let dictionary: _.Dictionary; -result = _([1, 2, 3, 4, 5, 6]).reject(function (num) { return num % 2 == 0; }).value(); -result = _(foodsCombined).reject('organic').value(); -result = _(foodsCombined).reject({ 'type': 'fruit' }).value(); + let stringIterator: (char: string, index: number, string: string) => any; + let listIterator: (value: TResult, index: number, collection: _.List) => any; + let dictionaryIterator: (value: TResult, key: string, collection: _.Dictionary) => any; + + { + 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}); + } + + { + 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}); + } + + { + 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}); + } +} result = _.sample([1, 2, 3, 4]); result = _.sample([1, 2, 3, 4], 2); @@ -3056,15 +4125,184 @@ result = <_.LoDashImplicitArrayWrapper>_([1, 2, 3, 4]).sample(2); result = _([1, 2, 3, 4]).sample().value(); result = _([1, 2, 3, 4]).sample(2).value(); -result = _.shuffle([1, 2, 3, 4, 5, 6]); -result = <_.LoDashImplicitArrayWrapper>_([1, 2, 3]).shuffle(); -result = <_.LoDashImplicitArrayWrapper<_.Dictionary>>_(<{ [index: string]: string; }>{ 'key1': 'test1', 'key2': 'test2' }).shuffle(); +// _.select +module TestSelect { + let array: TResult[]; + let list: _.List; + let dictionary: _.Dictionary; -result = _.size([1, 2]); -result = _([1, 2]).size(); -result = _.size({ 'one': 1, 'two': 2, 'three': 3 }); -result = _({ 'one': 1, 'two': 2, 'three': 3 }).size(); -result = _.size('curly'); + let stringIterator: (char: string, index: number, string: string) => any; + let listIterator: (value: TResult, index: number, collection: _.List) => any; + let dictionaryIterator: (value: TResult, key: string, collection: _.Dictionary) => any; + + { + let result: string[]; + + result = _.select('', stringIterator); + result = _.select('', stringIterator, any); + } + + { + let result: TResult[]; + + result = _.select(array, listIterator); + result = _.select(array, listIterator, any); + result = _.select(array, ''); + result = _.select(array, '', any); + result = _.select<{a: number}, TResult>(array, {a: 42}); + + result = _.select(list, listIterator); + result = _.select(list, listIterator, any); + result = _.select(list, ''); + result = _.select(list, '', any); + result = _.select<{a: number}, TResult>(list, {a: 42}); + + result = _.select(dictionary, dictionaryIterator); + result = _.select(dictionary, dictionaryIterator, any); + result = _.select(dictionary, ''); + result = _.select(dictionary, '', any); + result = _.select<{a: number}, TResult>(dictionary, {a: 42}); + } + + { + let result: _.LoDashImplicitArrayWrapper; + + result = _('').select(stringIterator); + result = _('').select(stringIterator, any); + } + + { + let result: _.LoDashImplicitArrayWrapper; + + result = _(array).select(listIterator); + result = _(array).select(listIterator, any); + result = _(array).select(''); + result = _(array).select('', any); + result = _(array).select<{a: number}>({a: 42}); + + result = _(list).select(listIterator); + result = _(list).select(listIterator, any); + result = _(list).select(''); + result = _(list).select('', any); + result = _(list).select<{a: number}, TResult>({a: 42}); + + result = _(dictionary).select(dictionaryIterator); + result = _(dictionary).select(dictionaryIterator, any); + result = _(dictionary).select(''); + result = _(dictionary).select('', any); + result = _(dictionary).select<{a: number}, TResult>({a: 42}); + } + + { + let result: _.LoDashExplicitArrayWrapper; + + result = _('').chain().select(stringIterator); + result = _('').chain().select(stringIterator, any); + } + + { + let result: _.LoDashExplicitArrayWrapper; + + result = _(array).chain().select(listIterator); + result = _(array).chain().select(listIterator, any); + result = _(array).chain().select(''); + result = _(array).chain().select('', any); + result = _(array).chain().select<{a: number}>({a: 42}); + + result = _(list).chain().select(listIterator); + result = _(list).chain().select(listIterator, any); + result = _(list).chain().select(''); + result = _(list).chain().select('', any); + result = _(list).chain().select<{a: number}, TResult>({a: 42}); + + result = _(dictionary).chain().select(dictionaryIterator); + result = _(dictionary).chain().select(dictionaryIterator, any); + result = _(dictionary).chain().select(''); + result = _(dictionary).chain().select('', any); + result = _(dictionary).chain().select<{a: number}, TResult>({a: 42}); + } +} + +// _.shuffle +module TestShuffle { + let array: TResult[]; + let list: _.List; + let dictionary: _.Dictionary; + + { + let result: string[]; + + result = _.shuffle('abc'); + } + + { + let result: TResult[]; + + result = _.shuffle(array); + result = _.shuffle(list); + result = _.shuffle(dictionary); + } + + { + let result: _.LoDashImplicitArrayWrapper; + + result = _('abc').shuffle(); + } + + { + let result: _.LoDashImplicitArrayWrapper; + + result = _(array).shuffle(); + result = _(list).shuffle(); + result = _(dictionary).shuffle(); + } + + { + let result: _.LoDashExplicitArrayWrapper; + + result = _('abc').chain().shuffle(); + } + + { + let result: _.LoDashExplicitArrayWrapper; + + result = _(array).chain().shuffle(); + result = _(list).chain().shuffle(); + result = _(dictionary).chain().shuffle(); + } +} + +// _.size +module TestSize { + type SampleType = {a: string; b: number; c: boolean;}; + + let array: SampleType[]; + let list: _.List; + let dictionary: _.Dictionary; + + { + let result: number; + + result = _.size(array); + result = _.size(list); + result = _.size(dictionary); + result = _.size(''); + + result = _(array).size(); + result = _(list).size(); + result = _(dictionary).size(); + result = _('').size(); + } + + { + let result: _.LoDashExplicitWrapper; + + result = _(array).chain().size(); + result = _(list).chain().size(); + result = _(dictionary).chain().size(); + result = _('').chain().size(); + } +} // _.some module TestSome { @@ -3262,27 +4500,93 @@ module TestNow { /************* * Functions * *************/ -var saves = ['profile', 'settings']; -var asyncSave = (obj: any) => obj.done(); -var done: Function; -done = _.after(saves.length, function () { - console.log('Done saving!'); -}); +// _after +module TestAfter { + interface Func { + (a: string, b: number): boolean; + } -done = _(saves.length).after(function () { - console.log('Done saving!'); -}).value(); + let func: Func; + + { + let result: Func; + + _.after(42, func); + } + + { + let result: _.LoDashImplicitObjectWrapper; + + _(42).after(func); + } + + { + let result: _.LoDashExplicitObjectWrapper; + + _(42).chain().after(func); + } +} // _.ary -result = ['6', '8', '10'].map(_.ary<(s: string) => number>(parseInt, 1)); -result = ['6', '8', '10'].map(_(parseInt).ary<(s: string) => number>(1).value()); +module TestAry { + type SampleFunc = (a: number, b: string) => boolean; + + let func: SampleFunc; + + { + let result: SampleFunc; + + result = _.ary(func); + result = _.ary(func, 2); + result = _.ary(func); + result = _.ary(func, 2); + } + + { + let result: _.LoDashImplicitObjectWrapper; + + result = _(func).ary(); + result = _(func).ary(2); + } + + { + let result: _.LoDashExplicitObjectWrapper; + + result = _(func).chain().ary(); + result = _(func).chain().ary(2); + } +} // _.backflow -var testBackflowSquareFn = (n: number) => n * n; -var testBackflowAddFn = (n: number, m: number) => n + m; -result = _.backflow<(n: number, m: number) => number>(testBackflowSquareFn, testBackflowAddFn)(1, 2); -result = _(testBackflowSquareFn).backflow<(n: number, m: number) => number>(testBackflowAddFn).value()(1, 2); +module TestBackflow { + let Fn1: (n: number) => number; + let Fn2: (m: number, n: number) => number; + + { + let result: (m: number, n: number) => number; + + result = _.backflow<(m: number, n: number) => number>(Fn1, Fn2); + result = _.backflow<(m: number, n: number) => number>(Fn1, Fn1, Fn2); + result = _.backflow<(m: number, n: number) => number>(Fn1, Fn1, Fn1, Fn2); + } + + { + let result: _.LoDashImplicitObjectWrapper<(m: number, n: number) => number>; + + result = _(Fn1).backflow<(m: number, n: number) => number>(Fn2); + result = _(Fn1).backflow<(m: number, n: number) => number>(Fn1, Fn2); + result = _(Fn1).backflow<(m: number, n: number) => number>(Fn1, Fn1, Fn2); + } + + { + let result: _.LoDashExplicitObjectWrapper<(m: number, n: number) => number>; + + result = _(Fn1).chain().backflow<(m: number, n: number) => number>(Fn2); + result = _(Fn1).chain().backflow<(m: number, n: number) => number>(Fn1, Fn2); + result = _(Fn1).chain().backflow<(m: number, n: number) => number>(Fn1, Fn1, Fn2); + } +} // _.before var testBeforeFn = ((n: number) => () => ++n)(0); @@ -3344,10 +4648,34 @@ funcBindKey = _(objectBindKey).bindKey('greet', 'hi').value(); funcBindKey(); // _.compose -var testComposeSquareFn = (n: number) => n * n; -var testComposeAddFn = (n: number, m: number) => n + m; -result = _.compose<(n: number, m: number) => number>(testComposeSquareFn, testComposeAddFn)(1, 2); -result = _(testComposeSquareFn).compose<(n: number, m: number) => number>(testComposeAddFn).value()(1, 2); +module TestCompose { + let Fn1: (n: number) => number; + let Fn2: (m: number, n: number) => number; + + { + let result: (m: number, n: number) => number; + + result = _.compose<(m: number, n: number) => number>(Fn1, Fn2); + result = _.compose<(m: number, n: number) => number>(Fn1, Fn1, Fn2); + result = _.compose<(m: number, n: number) => number>(Fn1, Fn1, Fn1, Fn2); + } + + { + let result: _.LoDashImplicitObjectWrapper<(m: number, n: number) => number>; + + result = _(Fn1).compose<(m: number, n: number) => number>(Fn2); + result = _(Fn1).compose<(m: number, n: number) => number>(Fn1, Fn2); + result = _(Fn1).compose<(m: number, n: number) => number>(Fn1, Fn1, Fn2); + } + + { + let result: _.LoDashExplicitObjectWrapper<(m: number, n: number) => number>; + + result = _(Fn1).chain().compose<(m: number, n: number) => number>(Fn2); + result = _(Fn1).chain().compose<(m: number, n: number) => number>(Fn1, Fn2); + result = _(Fn1).chain().compose<(m: number, n: number) => number>(Fn1, Fn1, Fn2); + } +} var createCallbackObj: { [index: string]: string; } = { name: 'Joe' }; result = <() => any>_.createCallback('name'); @@ -3428,15 +4756,70 @@ source.addEventListener('message', <_.LoDashImplicitObjectWrapper>_(fu 'maxWait': 1000 }), false); -var returnedDebounce = _.throttle(function (a: any) { return a * 5; }, 5); -returnedThrottled(4); +// _.defer +module TestDefer { + type SampleFunc = (a: number, b: string) => boolean; -result = _.defer(function () { console.log('deferred'); }); -result = <_.LoDashImplicitWrapper>_(function () { console.log('deferred'); }).defer(); + let func: SampleFunc; -var log = _.bind(console.log, console); -result = _.delay(log, 1000, 'logged later'); -result = <_.LoDashImplicitWrapper>_(log).delay(1000, 'logged later'); + { + let result: number; + + result = _.defer(func); + result = _.defer(func, any); + result = _.defer(func, any, any); + result = _.defer(func, any, any, any); + } + + { + let result: _.LoDashImplicitWrapper; + + result = _(func).defer(); + result = _(func).defer(any); + result = _(func).defer(any, any); + result = _(func).defer(any, any, any); + } + + { + let result: _.LoDashExplicitWrapper; + + result = _(func).chain().defer(); + result = _(func).chain().defer(any); + result = _(func).chain().defer(any, any); + result = _(func).chain().defer(any, any, any); + } +} + +// _.delay +module TestDelay { + type SampleFunc = (a: number, b: string) => boolean; + + let func: SampleFunc; + + { + let result: number; + + result = _.delay(func, 1); + result = _.delay(func, 1, 2); + result = _.delay(func, 1, 2, ''); + } + + { + let result: _.LoDashImplicitWrapper; + + result = _(func).delay(1); + result = _(func).delay(1, 2); + result = _(func).delay(1, 2, ''); + } + + { + let result: _.LoDashExplicitWrapper; + + result = _(func).chain().delay(1); + result = _(func).chain().delay(1, 2); + result = _(func).chain().delay(1, 2, ''); + } +} // _.flow var testFlowSquareFn = (n: number) => n * n; @@ -3445,10 +4828,34 @@ result = _.flow<(n: number, m: number) => number>(testFlowAddFn, testFlo result = _(testFlowAddFn).flow<(n: number, m: number) => number>(testFlowSquareFn).value()(1, 2); // _.flowRight -var testFlowRightSquareFn = (n: number) => n * n; -var testFlowRightAddFn = (n: number, m: number) => n + m; -result = _.flowRight<(n: number, m: number) => number>(testFlowRightSquareFn, testFlowRightAddFn)(1, 2); -result = _(testFlowRightSquareFn).flowRight<(n: number, m: number) => number>(testFlowRightAddFn).value()(1, 2); +module TestFlowRight { + let Fn1: (n: number) => number; + let Fn2: (m: number, n: number) => number; + + { + let result: (m: number, n: number) => number; + + result = _.flowRight<(m: number, n: number) => number>(Fn1, Fn2); + result = _.flowRight<(m: number, n: number) => number>(Fn1, Fn1, Fn2); + result = _.flowRight<(m: number, n: number) => number>(Fn1, Fn1, Fn1, Fn2); + } + + { + let result: _.LoDashImplicitObjectWrapper<(m: number, n: number) => number>; + + result = _(Fn1).flowRight<(m: number, n: number) => number>(Fn2); + result = _(Fn1).flowRight<(m: number, n: number) => number>(Fn1, Fn2); + result = _(Fn1).flowRight<(m: number, n: number) => number>(Fn1, Fn1, Fn2); + } + + { + let result: _.LoDashExplicitObjectWrapper<(m: number, n: number) => number>; + + result = _(Fn1).chain().flowRight<(m: number, n: number) => number>(Fn2); + result = _(Fn1).chain().flowRight<(m: number, n: number) => number>(Fn1, Fn2); + result = _(Fn1).chain().flowRight<(m: number, n: number) => number>(Fn1, Fn1, Fn2); + } +} // _.memoize var testMemoizedFunction: _.MemoizedFunction; @@ -3463,29 +4870,59 @@ result = _.memoize(testMemoizeFn, te result = (_(testMemoizeFn).memoize().value()); result = (_(testMemoizeFn).memoize(testMemoizeResolverFn).value()); -var returnedMemoize = _.throttle(function (a: any) { return a * 5; }, 5); -returnedMemoize(4); - // _.modArgs -function modArgsFn1(n: number): string {return n.toString()} -function modArgsFn2(n: boolean): string {return n.toString()} -interface ModArgsFunc { - (x: string, y: string): string[]; +module TestModArgs { + type Func1 = (a: boolean) => boolean; + type Func2 = (a: boolean, b: boolean) => boolean; + + let func1: Func1; + let func2: Func2; + + let transform1: (a: string) => boolean; + let transform2: (b: number) => boolean; + + { + let result: (a: string) => boolean; + + result = _.modArgs boolean>(func1, transform1); + result = _.modArgs boolean>(func1, [transform1]); + } + + { + let result: (a: string, b: number) => boolean; + + result = _.modArgs boolean>(func2, transform1, transform2); + result = _.modArgs boolean>(func2, [transform1, transform2]); + } + + { + let result: _.LoDashImplicitObjectWrapper<(a: string) => boolean>; + + result = _(func1).modArgs<(a: string) => boolean>(transform1); + result = _(func1).modArgs<(a: string) => boolean>([transform1]); + } + + { + let result: _.LoDashImplicitObjectWrapper<(a: string, b: number) => boolean>; + + result = _(func2).modArgs<(a: string, b: number) => boolean>(transform1, transform2); + result = _(func2).modArgs<(a: string, b: number) => boolean>([transform1, transform2]); + } + + { + let result: _.LoDashExplicitObjectWrapper<(a: string) => boolean>; + + result = _(func1).chain().modArgs<(a: string) => boolean>(transform1); + result = _(func1).chain().modArgs<(a: string) => boolean>([transform1]); + } + + { + let result: _.LoDashExplicitObjectWrapper<(a: string, b: number) => boolean>; + + result = _(func2).chain().modArgs<(a: string, b: number) => boolean>(transform1, transform2); + result = _(func2).chain().modArgs<(a: string, b: number) => boolean>([transform1, transform2]); + } } -interface ModArgsResult { - (x: number, y: boolean): string[] -} -result = _.modArgs((x: string, y: string) => [x, y], modArgsFn1, modArgsFn2); -result = result(1, true); - -result = _.modArgs((x: string, y: string) => [x, y], [modArgsFn1, modArgsFn2]); -result = result(1, true); - -result = _((x: string, y: string) => [x, y]).modArgs(modArgsFn1, modArgsFn2).value(); -result = result(1, true); - -result = _((x: string, y: string) => [x, y]).modArgs([modArgsFn1, modArgsFn2]).value(); -result = result(1, true); // _.negate interface TestNegatePredicate { @@ -3501,11 +4938,31 @@ result = _(testNegatePredicate).negate().value(); result = _(testNegatePredicate).negate().value(); // _.once -result = <() => void>_.once<() => void>(function () {}); -result = <() => void>(_(function () {}).once().value()); +module TestOnce { + interface Func { + (a: number, b: string): boolean; + } -var returnedOnce = _.throttle(function (a: any) { return a * 5; }, 5); -returnedOnce(4); + let func: Func; + + { + let result: Func; + + result = _.once(func); + } + + { + let result: _.LoDashImplicitObjectWrapper; + + result = _(func).once(); + } + + { + let result: _.LoDashExplicitObjectWrapper; + + result = _(func).chain().once(); + } +} var greetPartial = function (greeting: string, name: string) { return greeting + ' ' + name; }; var hi = _.partial(greetPartial, 'hi'); @@ -3531,17 +4988,37 @@ result = (_.rearg(testReargFn, [2, 0, 1]))('b', 'c' result = (_(testReargFn).rearg(2, 0, 1).value())('b', 'c', 'a'); result = (_(testReargFn).rearg([2, 0, 1]).value())('b', 'c', 'a'); -//_.restParam -var testRestParamFn = (a: string, b: string, c: number[]) => a + ' ' + b + ' ' + c.join(' '); -interface testRestParamFunc { - (a: string, b: string, c: number[]): string; +// _.restParam +module TestRestParam { + type Func = (a: string, b: number[]) => boolean; + type ResultFunc = (a: string, ...b: number[]) => boolean; + + let func: Func; + + { + let result: ResultFunc; + + result = _.restParam(func); + result = _.restParam(func, 1); + + result = _.restParam(func); + result = _.restParam(func, 1); + } + + { + let result: _.LoDashImplicitObjectWrapper; + + result = _(func).restParam(); + result = _(func).restParam(1); + } + + { + let result: _.LoDashExplicitObjectWrapper; + + result = _(func).chain().restParam(); + result = _(func).chain().restParam(1); + } } -interface testRestParamResult { - (a: string, b: string, ...c: number[]): string; -} -result = (_.restParam(testRestParamFn, 2))('a', 'b', 1, 2, 3); -result = (_.restParam(testRestParamFn, 2))('a', 'b', 1, 2, 3); -result = (_(testRestParamFn).restParam(2).value())('a', 'b', 1, 2, 3); //_.spread var testSpreadFn = (who: string, what: string) => who + ' says ' + what; @@ -3551,15 +5028,49 @@ interface TestSpreadResultFn { result = (_.spread(testSpreadFn))(['fred', 'hello']); result = (_(testSpreadFn).spread().value())(['fred', 'hello']); -var throttled = _.throttle(function () { }, 100); -jQuery(window).on('scroll', throttled); +// _.throttle +module TestThrottle { + interface SampleFunc { + (n: number, s: string): boolean; + } -jQuery('.interactive').on('click', _.throttle(function () { }, 300000, { - 'trailing': false -})); + interface Options { + leading?: boolean; + trailing?: boolean; + } -var returnedThrottled = _.throttle(function (a: any) { return a * 5; }, 5); -returnedThrottled(4); + interface ResultFunc { + (n: number, s: string): boolean; + cancel(): void; + } + + let func: SampleFunc; + let options: Options; + + { + let result: ResultFunc; + + result = _.throttle(func); + result = _.throttle(func, 42); + result = _.throttle(func, 42, options); + } + + { + let result: _.LoDashImplicitObjectWrapper; + + result = _(func).throttle(); + result = _(func).throttle(42); + result = _(func).throttle(42, options); + } + + { + let result: _.LoDashExplicitObjectWrapper; + + result = _(func).chain().throttle(); + result = _(func).chain().throttle(42); + result = _(func).chain().throttle(42, options); + } +} var helloWrap = function (name: string) { return 'hello ' + name; }; var helloWrap2 = _.wrap(helloWrap, function (func) { @@ -3658,28 +5169,67 @@ var testCloneDeepCustomizerFn: TestCloneDeepCustomizerFn; // _.eq module TestEq { let customizer: (value: any, other: any, indexOrKey?: number|string) => boolean; - let result: boolean; - result = _.eq(any, any); - result = _.eq(any, any, customizer); - result = _.eq(any, any, customizer, any); + { + let result: boolean; - result = _(any).eq(any); - result = _(any).eq(any, customizer); - result = _(any).eq(any, customizer, any) + result = _.eq(any, any); + result = _.eq(any, any, customizer); + result = _.eq(any, any, customizer, any); + + result = _(any).eq(any); + result = _(any).eq(any, customizer); + result = _(any).eq(any, customizer, any); + } + + { + let result: _.LoDashExplicitWrapper; + + result = _(any).chain().eq(any); + result = _(any).chain().eq(any, customizer); + result = _(any).chain().eq(any, customizer, any); + } } // _.gt -result = _.gt(1, 2); -result = _(1).gt(2); -result = _([]).gt(2); -result = _({}).gt(2); +module TestGt { + { + let result: boolean; + + result = _.gt(any, any); + result = _(1).gt(any); + result = _([]).gt(any); + result = _({}).gt(any); + } + + { + let result: _.LoDashExplicitWrapper; + + result = _(1).chain().gt(any); + result = _([]).chain().gt(any); + result = _({}).chain().gt(any); + } +} // _.gte -result = _.gte(1, 2); -result = _(1).gte(2); -result = _([]).gte(2); -result = _({}).gte(2); +module TestGte { + { + let result: boolean; + + result = _.gte(any, any); + result = _(1).gte(any); + result = _([]).gte(any); + result = _({}).gte(any); + } + + { + let result: _.LoDashExplicitWrapper; + + result = _(1).chain().gte(any); + result = _([]).chain().gte(any); + result = _({}).chain().gte(any); + } +} // _.isArguments result = _.isArguments(any); @@ -3750,10 +5300,25 @@ result = _({}).isDate(); } // _.isElement -result = _.isElement(any); -result = _(42).isElement(); -result = _([]).isElement(); -result = _({}).isElement(); +module TestIsElement { + { + let result: boolean; + + result = _.isElement(any); + + result = _(42).isElement(); + result = _([]).isElement(); + result = _({}).isElement(); + } + + { + let result: _.LoDashExplicitWrapper; + + result = _(42).chain().isElement(); + result = _([]).chain().isElement(); + result = _({}).chain().isElement(); + } +} // _.isEmpty result = _.isEmpty([1, 2, 3]); @@ -3766,15 +5331,26 @@ result = _('').isEmpty(); // _.isEqual module TestIsEqual { let customizer: (value: any, other: any, indexOrKey?: number|string) => boolean; - let result: boolean; - result = _.isEqual(any, any); - result = _.isEqual(any, any, customizer); - result = _.isEqual(any, any, customizer, any); + { + let result: boolean; - result = _(any).isEqual(any); - result = _(any).isEqual(any, customizer); - result = _(any).isEqual(any, customizer, any) + result = _.isEqual(any, any); + result = _.isEqual(any, any, customizer); + result = _.isEqual(any, any, customizer, any); + + result = _(any).isEqual(any); + result = _(any).isEqual(any, customizer); + result = _(any).isEqual(any, customizer, any); + } + + { + let result: _.LoDashExplicitWrapper; + + result = _(any).chain().isEqual(any); + result = _(any).chain().isEqual(any, customizer); + result = _(any).chain().isEqual(any, customizer, any); + } } // _.isError @@ -3841,10 +5417,25 @@ result = _(Array.prototype.push).isNative(); } // _.isNull -result = _.isNull(any); -result = _(1).isNull(); -result = _([]).isNull(); -result = _({}).isNull(); +module TestIsNull { + { + let result: boolean; + + result = _.isNull(any); + + result = _(1).isNull(); + result = _([]).isNull(); + result = _({}).isNull(); + } + + { + let result: _.LoDashExplicitWrapper; + + result = _(1).chain().isNull(); + result = _([]).chain().isNull(); + result = _({}).chain().isNull(); + } +} // _.isNumber result = _.isNumber(any); @@ -3902,8 +5493,20 @@ result = _({}).isString(); } // _.isTypedArray -result = _.isTypedArray([]); -result = _([]).isTypedArray(); +module TestIsTypedArray { + { + let result: boolean; + + result = _.isTypedArray([]); + result = _([]).isTypedArray(); + } + + { + let result: _.LoDashExplicitWrapper; + + result = _([]).chain().isTypedArray(); + } +} // _.isUndefined result = _.isUndefined(any); @@ -3912,16 +5515,44 @@ result = _([]).isUndefined(); result = _({}).isUndefined(); // _.lt -result = _.lt(1, 2); -result = _(1).lt(2); -result = _([]).lt(2); -result = _({}).lt(2); +module TestLt { + { + let result: boolean; + + result = _.lt(any, any); + result = _(1).lt(any); + result = _([]).lt(any); + result = _({}).lt(any); + } + + { + let result: _.LoDashExplicitWrapper; + + result = _(1).chain().lt(any); + result = _([]).chain().lt(any); + result = _({}).chain().lt(any); + } +} // _.lte -result = _.lte(1, 2); -result = _(1).lte(2); -result = _([]).lte(2); -result = _({}).lte(2); +module TestLte { + { + let result: boolean; + + result = _.lte(any, any); + result = _(1).lte(any); + result = _([]).lte(any); + result = _({}).lte(any); + } + + { + let result: _.LoDashExplicitWrapper; + + result = _(1).chain().lte(any); + result = _([]).chain().lte(any); + result = _({}).chain().lte(any); + } +} // _.toArray module TestToArray { @@ -4285,32 +5916,166 @@ module TestRandom { } } -/********* -* Object * -**********/ -interface NameAge { - name: string; - age: number; +/********** + * Object * + **********/ + +// _.assign +module 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}; + + 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 = _.assign(obj); + } + + { + let result: {a: number}; + + result = _.assign(obj, s1); + result = _.assign(obj, s1, customizer); + result = _.assign(obj, s1, customizer, any); + } + + { + let result: {a: number, b: number}; + + result = _.assign(obj, s1, s2); + result = _.assign(obj, s1, s2, customizer); + result = _.assign(obj, s1, s2, customizer, any); + } + + { + let result: {a: number, b: number, c: number}; + + result = _.assign(obj, s1, s2, s3); + result = _.assign(obj, s1, s2, s3, customizer); + result = _.assign(obj, s1, s2, s3, customizer, any); + } + + { + let result: {a: number, b: number, c: number, d: number}; + + result = _.assign(obj, s1, s2, s3, s4); + result = _.assign(obj, s1, s2, s3, s4, customizer); + result = _.assign(obj, s1, s2, s3, s4, customizer, any); + } + + { + let result: {a: number, b: number, c: number, d: number, e: number}; + + result = _.assign(obj, s1, s2, s3, s4, s5); + result = _.assign(obj, s1, s2, s3, s4, s5, customizer); + result = _.assign(obj, s1, s2, s3, s4, s5, customizer, any); + } + + { + let result: _.LoDashImplicitObjectWrapper; + + result = _(obj).assign(); + } + + { + let result: _.LoDashImplicitObjectWrapper<{a: number}>; + + result = _(obj).assign(s1); + result = _(obj).assign(s1, customizer); + result = _(obj).assign(s1, customizer, any); + } + + { + let result: _.LoDashImplicitObjectWrapper<{a: number, b: number}>; + + result = _(obj).assign(s1, s2); + result = _(obj).assign(s1, s2, customizer); + result = _(obj).assign(s1, s2, customizer, any); + } + + { + let result: _.LoDashImplicitObjectWrapper<{a: number, b: number, c: number}>; + + result = _(obj).assign(s1, s2, s3); + result = _(obj).assign(s1, s2, s3, customizer); + result = _(obj).assign(s1, s2, s3, customizer, any); + } + + { + 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, customizer); + result = _(obj).assign(s1, s2, s3, s4, customizer, any); + } + + { + 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, customizer); + result = _(obj).assign<{a: number, b: number, c: number, d: number, e: number}>(s1, s2, s3, s4, s5, customizer, any); + } + + { + let result: _.LoDashExplicitObjectWrapper; + + result = _(obj).chain().assign(); + } + + { + let result: _.LoDashExplicitObjectWrapper<{a: number}>; + + result = _(obj).chain().assign(s1); + result = _(obj).chain().assign(s1, customizer); + result = _(obj).chain().assign(s1, customizer, any); + } + + { + let result: _.LoDashExplicitObjectWrapper<{a: number, b: number}>; + + result = _(obj).chain().assign(s1, s2); + result = _(obj).chain().assign(s1, s2, customizer); + result = _(obj).chain().assign(s1, s2, customizer, any); + } + + { + let result: _.LoDashExplicitObjectWrapper<{a: number, b: number, c: number}>; + + result = _(obj).chain().assign(s1, s2, s3); + result = _(obj).chain().assign(s1, s2, s3, customizer); + result = _(obj).chain().assign(s1, s2, s3, customizer, any); + } + + { + 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, customizer); + result = _(obj).chain().assign(s1, s2, s3, s4, customizer, any); + } + + { + 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, customizer); + result = _(obj).chain().assign<{a: number, b: number, c: number, d: number, e: number}>(s1, s2, s3, s4, s5, customizer, any); + } } -result = _.assign({ 'name': 'moe' }, { 'age': 40 }); -result = _.assign({ 'name': 'moe' }, { 'age': 40 }, function (a, b) { - return typeof a == 'undefined' ? b : a; -}); - -result = <_.LoDashImplicitObjectWrapper>_({ 'name': 'moe' }).assign({ 'age': 40 }); -result = <_.LoDashImplicitObjectWrapper>_({ 'name': 'moe' }).assign({ 'age': 40 }, function (a, b) { - return typeof a == 'undefined' ? b : a; -}); - -result = _.extend({ 'name': 'moe' }, { 'age': 40 }); -result = _.extend({ 'name': 'moe' }, { 'age': 40 }, function (a, b) { - return typeof a == 'undefined' ? b : a; -}); - -result = <_.LoDashImplicitObjectWrapper>_({ 'name': 'moe' }).extend({ 'age': 40 }); -result = <_.LoDashImplicitObjectWrapper>_({ 'name': 'moe' }).extend({ 'age': 40 }, function (a, b) { - return typeof a == 'undefined' ? b : a; -}); // _.create interface TestCreateProto { @@ -4331,13 +6096,130 @@ result = <{}>_(testCreateProto).create(testCreateProps).value(); result = _(testCreateProto).create().value(); result = _(testCreateProto).create(testCreateProps).value(); -interface Food { - name: string; - type: string; +// _.defaults +module 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}; + + let obj: Obj; + let s1: S1; + let s2: S2; + let s3: S3; + let s4: S4; + let s5: S5; + + { + let result: Obj; + + result = _.defaults(obj); + } + + { + let result: {a: string}; + + result = _.defaults(obj, s1); + } + + { + let result: {a: string, b: number}; + + result = _.defaults(obj, s1, s2); + } + + { + let result: {a: string, b: number, c: number}; + + result = _.defaults(obj, s1, s2, s3); + } + + { + let result: {a: string, b: number, c: number, d: number}; + + result = _.defaults(obj, s1, s2, s3, s4); + } + + { + let result: {a: string, b: number, c: number, d: number, e: number}; + + result = _.defaults(obj, s1, s2, s3, s4, s5); + } + + { + let result: _.LoDashImplicitObjectWrapper; + + result = _(obj).defaults(); + } + + { + let result: _.LoDashImplicitObjectWrapper<{a: string}>; + + result = _(obj).defaults(s1); + } + + { + let result: _.LoDashImplicitObjectWrapper<{a: string, b: number}>; + + result = _(obj).defaults(s1, s2); + } + + { + let result: _.LoDashImplicitObjectWrapper<{a: string, b: number, c: number}>; + + result = _(obj).defaults(s1, s2, s3); + } + + { + let result: _.LoDashImplicitObjectWrapper<{a: string, b: number, c: number, d: number}>; + + result = _(obj).defaults(s1, s2, s3, s4); + } + + { + 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); + } + + { + let result: _.LoDashExplicitObjectWrapper; + + result = _(obj).chain().defaults(); + } + + { + let result: _.LoDashExplicitObjectWrapper<{a: string}>; + + result = _(obj).chain().defaults(s1); + } + + { + let result: _.LoDashExplicitObjectWrapper<{a: string, b: number}>; + + result = _(obj).chain().defaults(s1, s2); + } + + { + let result: _.LoDashExplicitObjectWrapper<{a: string, b: number, c: number}>; + + result = _(obj).chain().defaults(s1, s2, s3); + } + + { + let result: _.LoDashExplicitObjectWrapper<{a: string, b: number, c: number, d: number}>; + + result = _(obj).chain().defaults(s1, s2, s3, s4); + } + + { + 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); + } } -var foodDefaults = { 'name': 'apple' }; -result = _.defaults(foodDefaults, { 'name': 'banana', 'type': 'fruit' }); -result = <_.LoDashImplicitObjectWrapper>_(foodDefaults).defaults({ 'name': 'banana', 'type': 'fruit' }); //_.defaultsDeep interface DefaultsDeepResult { @@ -4351,12 +6233,168 @@ var TestDefaultsDeepSource = {'user': {'name': 'fred', 'age': 36}}; result = _.defaultsDeep(TestDefaultsDeepObject, TestDefaultsDeepSource); result = _(TestDefaultsDeepObject).defaultsDeep(TestDefaultsDeepSource).value(); -// _.findKey -module TestFindKey { - let result: string; +// _.extend +module 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}; + + 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 = _.extend(obj); + } + + { + let result: {a: number}; + + result = _.extend(obj, s1); + result = _.extend(obj, s1, customizer); + result = _.extend(obj, s1, customizer, any); + } + + { + let result: {a: number, b: number}; + + result = _.extend(obj, s1, s2); + result = _.extend(obj, s1, s2, customizer); + result = _.extend(obj, s1, s2, customizer, any); + } + + { + 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); + } + + { + 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); + } + + { + 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); + } + + { + let result: _.LoDashImplicitObjectWrapper; + + result = _(obj).extend(); + } + + { + let result: _.LoDashImplicitObjectWrapper<{a: number}>; + + result = _(obj).extend(s1); + result = _(obj).extend(s1, customizer); + result = _(obj).extend(s1, customizer, any); + } + + { + 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); + } + + { + 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); + } + + { + 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); + } + + { + 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); + } + + { + let result: _.LoDashExplicitObjectWrapper; + + result = _(obj).chain().extend(); + } + + { + let result: _.LoDashExplicitObjectWrapper<{a: number}>; + + result = _(obj).chain().extend(s1); + result = _(obj).chain().extend(s1, customizer); + result = _(obj).chain().extend(s1, customizer, any); + } + + { + 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); + } + + { + 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); + } + + { + 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); + } + + { + 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); + } +} + +// _.findKey +module TestFindKey { { let predicateFn: (value: any, key?: string, object?: {}) => boolean; + let result: string; result = _.findKey<{a: string;}>({a: ''}); @@ -4383,6 +6421,7 @@ module TestFindKey { { let predicateFn: (value: string, key?: string, collection?: _.Dictionary) => boolean; + let result: string; result = _.findKey({a: ''}, predicateFn); result = _.findKey({a: ''}, predicateFn, any); @@ -4390,14 +6429,37 @@ module TestFindKey { result = _<{a: string;}>({a: ''}).findKey(predicateFn); result = _<{a: string;}>({a: ''}).findKey(predicateFn, any); } + + { + let predicateFn: (value: any, key?: string, object?: {}) => boolean; + let result: _.LoDashExplicitWrapper; + + 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}); + } + + { + let predicateFn: (value: string, key?: string, collection?: _.Dictionary) => boolean; + let result: _.LoDashExplicitWrapper; + + result = _<{a: string;}>({a: ''}).chain().findKey(predicateFn); + result = _<{a: string;}>({a: ''}).chain().findKey(predicateFn, any); + } } // _.findLastKey module TestFindLastKey { - let result: string; - { let predicateFn: (value: any, key?: string, object?: {}) => boolean; + let result: string; result = _.findLastKey<{a: string;}>({a: ''}); @@ -4424,6 +6486,7 @@ module TestFindLastKey { { let predicateFn: (value: string, key?: string, collection?: _.Dictionary) => boolean; + let result: string; result = _.findLastKey({a: ''}, predicateFn); result = _.findLastKey({a: ''}, predicateFn, any); @@ -4431,51 +6494,228 @@ module TestFindLastKey { result = _<{a: string;}>({a: ''}).findLastKey(predicateFn); result = _<{a: string;}>({a: ''}).findLastKey(predicateFn, any); } + + { + let predicateFn: (value: any, key?: string, object?: {}) => boolean; + let result: _.LoDashExplicitWrapper; + + 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}); + } + + { + let predicateFn: (value: string, key?: string, collection?: _.Dictionary) => boolean; + let result: _.LoDashExplicitWrapper; + + result = _<{a: string;}>({a: ''}).chain().findLastKey(predicateFn); + result = _<{a: string;}>({a: ''}).chain().findLastKey(predicateFn, any); + } } -result = _.forIn(new Dog('Dagny'), function (value, key) { - console.log(key); -}); +// _.forIn +module TestForIn { + type SampleObject = {a: number; b: string; c: boolean;}; -result = <_.LoDashImplicitObjectWrapper>_(new Dog('Dagny')).forIn(function (value, key) { - console.log(key); -}); + let dictionary: _.Dictionary; + let dictionaryIterator: (value: number, key: string, collection: _.Dictionary) => any; -result = _.forInRight(new Dog('Dagny'), function (value, key) { - console.log(key); -}); + let object: SampleObject; + let objectIterator: (element: any, key?: string, collection?: any) => any; -result = <_.LoDashImplicitObjectWrapper>_(new Dog('Dagny')).forInRight(function (value, key) { - console.log(key); -}); + { + let result: _.Dictionary; -interface ZeroOne { - 0: string; - 1: string; - one: string; + result = _.forIn(dictionary); + result = _.forIn(dictionary, dictionaryIterator); + result = _.forIn(dictionary, dictionaryIterator, any); + } + + { + let result: SampleObject; + + result = _.forIn(object); + result = _.forIn(object, objectIterator); + result = _.forIn(object, objectIterator, any); + } + + { + let result: _.LoDashImplicitObjectWrapper<_.Dictionary>; + + result = _(dictionary).forIn(); + result = _(dictionary).forIn(dictionaryIterator); + result = _(dictionary).forIn(dictionaryIterator, any); + } + + { + let result: _.LoDashExplicitObjectWrapper<_.Dictionary>; + + result = _(dictionary).chain().forIn(); + result = _(dictionary).chain().forIn(dictionaryIterator); + result = _(dictionary).chain().forIn(dictionaryIterator, any); + } } -result = _.forOwn({ '0': 'zero', '1': 'one', 'one': '2' }, function (num, key) { - console.log(key); -}); +// _.forInRight +module TestForInRight { + type SampleObject = {a: number; b: string; c: boolean;}; -result = <_.LoDashImplicitObjectWrapper>_({ '0': 'zero', '1': 'one', 'length': 2 }).forOwn(function (num, key) { - console.log(key); -}); + let dictionary: _.Dictionary; + let dictionaryIterator: (value: number, key: string, collection: _.Dictionary) => any; -result = _.forOwnRight({ '0': 'zero', '1': 'one', 'length': 2 }, function (num, key) { - console.log(key); -}); + let object: SampleObject; + let objectIterator: (element: any, key?: string, collection?: any) => any; -result = <_.LoDashImplicitObjectWrapper>_({ '0': 'zero', '1': 'one', 'length': 2 }).forOwnRight(function (num, key) { - console.log(key); -}); + { + let result: _.Dictionary; -result = _.functions(_); -result = _.methods(_); + result = _.forInRight(dictionary); + result = _.forInRight(dictionary, dictionaryIterator); + result = _.forInRight(dictionary, dictionaryIterator, any); + } -result = <_.LoDashImplicitArrayWrapper>_(_).functions(); -result = <_.LoDashImplicitArrayWrapper>_(_).methods(); + { + let result: SampleObject; + + result = _.forInRight(object); + result = _.forInRight(object, objectIterator); + result = _.forInRight(object, objectIterator, any); + } + + { + let result: _.LoDashImplicitObjectWrapper<_.Dictionary>; + + result = _(dictionary).forInRight(); + result = _(dictionary).forInRight(dictionaryIterator); + result = _(dictionary).forInRight(dictionaryIterator, any); + } + + { + let result: _.LoDashExplicitObjectWrapper<_.Dictionary>; + + result = _(dictionary).chain().forInRight(); + result = _(dictionary).chain().forInRight(dictionaryIterator); + result = _(dictionary).chain().forInRight(dictionaryIterator, any); + } +} + +// _.forOwn +module TestForOwn { + type SampleObject = {a: number; b: string; c: boolean;}; + + let dictionary: _.Dictionary; + let dictionaryIterator: (value: number, key: string, collection: _.Dictionary) => any; + + let object: SampleObject; + let objectIterator: (element: any, key?: string, collection?: any) => any; + + { + let result: _.Dictionary; + + result = _.forOwn(dictionary); + result = _.forOwn(dictionary, dictionaryIterator); + result = _.forOwn(dictionary, dictionaryIterator, any); + } + + { + let result: SampleObject; + + result = _.forOwn(object); + result = _.forOwn(object, objectIterator); + result = _.forOwn(object, objectIterator, any); + } + + { + let result: _.LoDashImplicitObjectWrapper<_.Dictionary>; + + result = _(dictionary).forOwn(); + result = _(dictionary).forOwn(dictionaryIterator); + result = _(dictionary).forOwn(dictionaryIterator, any); + } + + { + let result: _.LoDashExplicitObjectWrapper<_.Dictionary>; + + result = _(dictionary).chain().forOwn(); + result = _(dictionary).chain().forOwn(dictionaryIterator); + result = _(dictionary).chain().forOwn(dictionaryIterator, any); + } +} + +// _.forOwnRight +module TestForOwnRight { + type SampleObject = {a: number; b: string; c: boolean;}; + + let dictionary: _.Dictionary; + let dictionaryIterator: (value: number, key: string, collection: _.Dictionary) => any; + + let object: SampleObject; + let objectIterator: (element: any, key?: string, collection?: any) => any; + + { + let result: _.Dictionary; + + result = _.forOwnRight(dictionary); + result = _.forOwnRight(dictionary, dictionaryIterator); + result = _.forOwnRight(dictionary, dictionaryIterator, any); + } + + { + let result: SampleObject; + + result = _.forOwnRight(object); + result = _.forOwnRight(object, objectIterator); + result = _.forOwnRight(object, objectIterator, any); + } + + { + let result: _.LoDashImplicitObjectWrapper<_.Dictionary>; + + result = _(dictionary).forOwnRight(); + result = _(dictionary).forOwnRight(dictionaryIterator); + result = _(dictionary).forOwnRight(dictionaryIterator, any); + } + + { + let result: _.LoDashExplicitObjectWrapper<_.Dictionary>; + + result = _(dictionary).chain().forOwnRight(); + result = _(dictionary).chain().forOwnRight(dictionaryIterator); + result = _(dictionary).chain().forOwnRight(dictionaryIterator, any); + } +} + +// _.functions +module TestFunctions { + type SampleObject = {a: number; b: string; c: boolean;}; + + let object: SampleObject; + + { + let result: string[]; + + result = _.functions(object); + } + + { + let result: _.LoDashImplicitArrayWrapper; + + result = _(object).functions(); + } + + { + let result: _.LoDashExplicitArrayWrapper; + + result = _(object).chain().functions(); + } +} // _.get result = _.get({ 'a': [{ 'b': { 'c': 3 } }] }, 'a[0].b.c'); @@ -4493,36 +6733,107 @@ result = _.get({ 'a': [{ 'b': { 'c': 3 } }] }, 'a[0].b.c'); } // _.has -result = _.has({}, ''); -result = _.has({}, 42); -result = _.has({}, true); -result = _.has({}, ['', 42, true]); -result = _({}).has(''); -result = _({}).has(42); -result = _({}).has(true); -result = _({}).has(['', 42, true]); +module TestHas { + type SampleObject = {a: number; b: string; c: boolean;}; + + let object: SampleObject; + + { + let result: boolean; + + result = _.has(object, ''); + result = _.has(object, 42); + result = _.has(object, true); + result = _.has(object, ['', 42, true]); + + result = _(object).has(''); + result = _(object).has(42); + result = _(object).has(true); + result = _(object).has(['', 42, true]); + } + + { + let result: _.LoDashExplicitWrapper; + + result = _(object).chain().has(''); + result = _(object).chain().has(42); + result = _(object).chain().has(true); + result = _(object).chain().has(['', 42, true]); + } +} // _.invert -{ - let result: TResult; - result = _.invert({}); - result = _.invert({}, true); - result = _({}).invert().value(); - result = _({}).invert(true).value(); +module TestInvert { + { + let result: TResult; + + result = _.invert({}); + result = _.invert({}, true); + + result = _.invert({}); + result = _.invert({}, true); + } + + { + let result: _.LoDashImplicitObjectWrapper; + + result = _({}).invert(); + result = _({}).invert(true); + } + + { + let result: _.LoDashExplicitObjectWrapper; + + result = _({}).chain().invert(); + result = _({}).chain().invert(true); + } } -class Stooge { - constructor( - public name: string, - public age: number - ) { } +// _.keys +module TestKeys { + let object: _.Dictionary; + + { + let result: string[]; + + result = _.keys(object); + } + + { + let result: _.LoDashImplicitArrayWrapper; + + result = _(object).keys(); + } + + { + let result: _.LoDashExplicitArrayWrapper; + + result = _(object).chain().keys(); + } } -result = _.keys({ 'one': 1, 'two': 2, 'three': 3 }); -result = _({ 'one': 1, 'two': 2, 'three': 3 }).keys().value(); +// _.keysIn +module TestKeysIn { + let object: _.Dictionary; -result = _.keysIn({ 'one': 1, 'two': 2, 'three': 3 }); -result = _({ 'one': 1, 'two': 2, 'three': 3 }).keysIn().value(); + { + let result: string[]; + + result = _.keysIn(object); + } + + { + let result: _.LoDashImplicitArrayWrapper; + + result = _(object).keysIn(); + } + + { + let result: _.LoDashExplicitArrayWrapper; + + result = _(object).chain().keysIn(); + } +} // _.mapKeys module TestMapKeys { @@ -4533,43 +6844,80 @@ module TestMapKeys { let listIterator: (value: TResult, index: number, collection: _.List) => string; let dictionaryIterator: (value: TResult, key: string, collection: _.Dictionary) => string; - let result: _.Dictionary; + { + let result: _.Dictionary; - result = _.mapKeys(array); - result = _.mapKeys(array, listIterator); - result = _.mapKeys(array, listIterator, any); - result = _.mapKeys(array, ''); - result = _.mapKeys(array, {}); + 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, {}); + 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, {}); + result = _.mapKeys(dictionary); + result = _.mapKeys(dictionary, dictionaryIterator); + result = _.mapKeys(dictionary, dictionaryIterator, any); + result = _.mapKeys(dictionary, ''); + result = _.mapKeys(dictionary, '', any); + result = _.mapKeys(dictionary, {}); + } - result = _(array).mapKeys().value(); - result = _(array).mapKeys(listIterator).value(); - result = _(array).mapKeys(listIterator, any).value(); - result = _(array).mapKeys('').value(); - result = _(array).mapKeys<{}>({}).value(); + { + let result: _.LoDashImplicitObjectWrapper<_.Dictionary>; - result = _(list).mapKeys().value(); - result = _(list).mapKeys(listIterator).value(); - result = _(list).mapKeys(listIterator, any).value(); - result = _(list).mapKeys('').value(); - result = _(list).mapKeys({}).value(); + result = _(array).mapKeys(); + result = _(array).mapKeys(listIterator); + result = _(array).mapKeys(listIterator, any); + result = _(array).mapKeys(''); + result = _(array).mapKeys('', any); + result = _(array).mapKeys<{}>({}); - result = _(dictionary).mapKeys().value(); - result = _(dictionary).mapKeys(dictionaryIterator).value(); - result = _(dictionary).mapKeys(dictionaryIterator, any).value(); - result = _(dictionary).mapKeys('').value(); - result = _(dictionary).mapKeys({}).value(); + 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({}); + } + + { + let result: _.LoDashExplicitObjectWrapper<_.Dictionary>; + + 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({}); + } } // _.merge @@ -4618,6 +6966,31 @@ module TestMerge { result = _({}).merge({}, {}, {}, {}, {}, customizer, any).value(); } +// _.methods +module TestFunctions { + type SampleObject = {a: number; b: string; c: boolean;}; + + let object: SampleObject; + + { + let result: string[]; + + result = _.methods(object); + } + + { + let result: _.LoDashImplicitArrayWrapper; + + result = _(object).methods(); + } + + { + let result: _.LoDashExplicitArrayWrapper; + + result = _(object).chain().methods(); + } +} + interface HasName { name: string; } @@ -4632,8 +7005,46 @@ result = _({ 'name': 'moe', 'age': 40 }).omit(function (value) { return typeof value == 'number'; }).value(); -result = _.pairs({ 'moe': 30, 'larry': 40 }); -result = _({ 'moe': 30, 'larry': 40 }).pairs().value(); +// _.pairs +module TestPairs { + let object: _.Dictionary; + + { + let result: any[][]; + + result = _.pairs<_.Dictionary>(object); + } + + { + let result: string[][]; + + result = _.pairs<_.Dictionary, string>(object); + } + + { + let result: _.LoDashImplicitArrayWrapper; + + result = _(object).pairs(); + } + + { + let result: _.LoDashImplicitArrayWrapper; + + result = _(object).pairs(); + } + + { + let result: _.LoDashExplicitArrayWrapper; + + result = _(object).chain().pairs(); + } + + { + let result: _.LoDashExplicitArrayWrapper; + + result = _(object).chain().pairs(); + } +} // _.pick interface TestPickFn { @@ -4662,14 +7073,41 @@ interface TestPickFn { } // _.set -{ - let testSetObject: TResult; - let testSetPath: {toSting(): string}; - let result: TResult; - result = _.set(testSetObject, testSetPath, any); - result = _.set(testSetObject, [testSetPath], any); - result = _(testSetObject).set(testSetPath, any).value(); - result = _(testSetObject).set([testSetPath], any).value(); +module TestSet { + type SampleValue = {a: number; b: string; c: boolean;}; + + let object: TResult; + let value = {a: 1, b: '', c: true}; + + { + let result: TResult; + + result = _.set(object, '', any); + result = _.set(object, ['a', 'b', 1], any); + + result = _.set(object, '', value); + result = _.set(object, ['a', 'b', 1], value); + } + + { + let result: _.LoDashImplicitObjectWrapper; + + result = _(object).set('', any); + result = _(object).set(['a', 'b', 1], any); + + result = _(object).set('', value); + result = _(object).set(['a', 'b', 1], value); + } + + { + let result: _.LoDashExplicitObjectWrapper; + + result = _(object).chain().set('', any); + result = _(object).chain().set(['a', 'b', 1], any); + + result = _(object).chain().set('', value); + result = _(object).chain().set(['a', 'b', 1], value); + } } // _.transform @@ -4739,96 +7177,54 @@ module TestTransform { } // _.values -class TestValues { - public a = 1; - public b = 2; - public c: string; -} -TestValues.prototype.c = 'a'; -result = _.values(new TestValues()); -// → [1, 2] (iteration order is not guaranteed) -result = _(new TestValues()).values().value(); -// → [1, 2] (iteration order is not guaranteed) +module TestValues { + let object: _.Dictionary; -// _.valueIn -class TestValueIn { - public a = 1; - public b = 2; - public c: number; + { + let result: TResult[]; + + result = _.values(object); + } + + { + let result: _.LoDashImplicitArrayWrapper; + + result = _(object).values(); + } + + { + let result: _.LoDashExplicitArrayWrapper; + + result = _(object).chain().values(); + } +} + +// _.valuesIn +module TestValuesIn { + let object: _.Dictionary; + + { + let result: TResult[]; + + result = _.valuesIn(object); + } + + { + let result: _.LoDashImplicitArrayWrapper; + + result = _(object).valuesIn(); + } + + { + let result: _.LoDashExplicitArrayWrapper; + + result = _(object).chain().valuesIn(); + } } -TestValueIn.prototype.c = 3; -result = _.valuesIn(new TestValueIn()); -// → [1, 2, 3] -result = _(new TestValueIn()).valuesIn().value(); -// → [1, 2, 3] /********** -* Utility * -***********/ - -// _.property -interface TestPropertyObject { - a: { - b: number; - } -} -var testPropertyObject: TestPropertyObject; -result = _.property('a.b')(testPropertyObject); -result = _.property(['a', 'b'])(testPropertyObject); -result = (_('a.b').property().value())(testPropertyObject); -result = (_(['a', 'b']).property().value())(testPropertyObject); - -// _.propertyOf -module TestPropertyOf { - interface SampleObject { - a: { - b: number[]; - } - } - - let object: SampleObject; - - { - let result: (path: string|string[]) => any; - - result = _.propertyOf({}); - result = _.propertyOf(object); - } - - { - let result: _.LoDashImplicitObjectWrapper<(path: string|string[]) => any>; - - result = _({}).propertyOf(); - } - - { - let result: _.LoDashExplicitObjectWrapper<(path: string|string[]) => any>; - - result = _({}).chain().propertyOf(); - } -} - -// _.range -result = _.range(10); -result = _.range(1, 11); -result = _.range(0, 30, 5); -result = _(10).range().value(); -result = _(1).range(11).value(); -result = _(0).range(30, 5).value(); - -class Mage { - public castSpell(n: number) { - return n; - } - - public cast(n: number) { - return n; - } -} - -/********* -* String -*********/ + * String * + **********/ // _.camelCase module TestCamelCase { @@ -5673,16 +8069,44 @@ module TestMethod { } // _.methodOf -class TestMethodOf { - a = [ - (a1: number, a2: number) => a1 + a2 - ]; +module TestMethodOf { + type SampleObject = {a: {b: () => TResult}[]}; + type ResultFn = (path: _.StringRepresentable|_.StringRepresentable[]) => TResult; + + let object: SampleObject; + + { + let result: ResultFn; + + result = _.methodOf(object); + result = _.methodOf(object, any); + result = _.methodOf(object, any, any); + result = _.methodOf(object, any, any, any); + + result = _.methodOf(object); + result = _.methodOf(object, any); + result = _.methodOf(object, any, any); + result = _.methodOf(object, any, any, any); + } + + { + let result: _.LoDashImplicitObjectWrapper; + + result = _(object).methodOf(); + result = _(object).methodOf(any); + result = _(object).methodOf(any, any); + result = _(object).methodOf(any, any, any); + } + + { + let result: _.LoDashExplicitObjectWrapper; + + result = _(object).chain().methodOf(); + result = _(object).chain().methodOf(any); + result = _(object).chain().methodOf(any, any); + result = _(object).chain().methodOf(any, any, any); + } } -var TestMethodOfObject = new TestMethodOf(); -result = (_.methodOf(TestMethodOfObject, 1, 2))('a[0]'); -result = (_.methodOf(TestMethodOfObject, 1, 2))(['a', '0']); -result = (_(TestMethodOfObject).methodOf(1, 2).value())('a[0]'); -result = (_(TestMethodOfObject).methodOf(1, 2).value())(['a', '0']); // _.mixin module TestMixin { @@ -5754,6 +8178,93 @@ module TestNoop { } } +// _.property +module TestProperty { + interface SampleObject { + a: { + b: number[]; + } + } + + { + let result: (object: SampleObject) => number; + + result = _.property('a.b[0]'); + result = _.property(['a', 'b', 0]); + } + + { + let result: _.LoDashImplicitObjectWrapper<(object: SampleObject) => number>; + + result = _('a.b[0]').property(); + result = _(['a', 'b', 0]).property(); + } + + { + let result: _.LoDashExplicitObjectWrapper<(object: SampleObject) => number>; + + result = _('a.b[0]').chain().property(); + result = _(['a', 'b', 0]).chain().property(); + } +} + +// _.propertyOf +module TestPropertyOf { + interface SampleObject { + a: { + b: number[]; + } + } + + let object: SampleObject; + + { + let result: (path: string|string[]) => any; + + result = _.propertyOf({}); + result = _.propertyOf(object); + } + + { + let result: _.LoDashImplicitObjectWrapper<(path: string|string[]) => any>; + + result = _({}).propertyOf(); + } + + { + let result: _.LoDashExplicitObjectWrapper<(path: string|string[]) => any>; + + result = _({}).chain().propertyOf(); + } +} + +// _.range +module TestRange { + { + let result: number[]; + + result = _.range(10); + result = _.range(1, 11); + result = _.range(0, 30, 5); + } + + { + let result: _.LoDashImplicitArrayWrapper; + + result = _(10).range(); + result = _(1).range(11); + result = _(0).range(30, 5); + } + + { + let result: _.LoDashExplicitArrayWrapper; + + result = _(10).chain().range(); + result = _(1).chain().range(11); + result = _(0).chain().range(30, 5); + } +} + // _.runInContext { let result: typeof _; @@ -5807,9 +8318,22 @@ module TestTimes { } // _.uniqueId -result = _.uniqueId(); -result = _.uniqueId(''); -result = _('').uniqueId(); +module TestUniqueId { + { + let result: string; + + result = _.uniqueId(); + result = _.uniqueId(''); + + result = _('').uniqueId(); + } + + { + let result: _.LoDashExplicitWrapper; + + result = _('').chain().uniqueId(); + } +} result = _.VERSION; result = <_.Support>_.support; diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index 359cc0fb9..ed8d72443 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -749,6 +749,81 @@ declare module _ { ): LoDashExplicitArrayWrapper; } + //_.fill + interface LoDashStatic { + /** + * Fills elements of array with value from start up to, but not including, end. + * + * Note: This method mutates array. + * + * @param array The array to fill. + * @param value The value to fill array with. + * @param start The start position. + * @param end The end position. + * @return Returns array. + */ + fill( + array: any[], + value: T, + start?: number, + end?: number + ): T[]; + + /** + * @see _.fill + */ + fill( + array: List, + value: T, + start?: number, + end?: number + ): List; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.fill + */ + fill( + value: T, + start?: number, + end?: number + ): LoDashImplicitArrayWrapper; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.fill + */ + fill( + value: T, + start?: number, + end?: number + ): LoDashImplicitObjectWrapper>; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.fill + */ + fill( + value: T, + start?: number, + end?: number + ): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.fill + */ + fill( + value: T, + start?: number, + end?: number + ): LoDashExplicitObjectWrapper>; + } + //_.findIndex interface LoDashStatic { /** @@ -1131,14 +1206,28 @@ declare module _ { /** * @see _.flattenDeep */ - flattenDeep(): LoDashImplicitArrayWrapper; + flattenDeep(): LoDashImplicitArrayWrapper; } interface LoDashImplicitObjectWrapper { /** * @see _.flattenDeep */ - flattenDeep(): LoDashImplicitArrayWrapper; + flattenDeep(): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.flattenDeep + */ + flattenDeep(): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.flattenDeep + */ + flattenDeep(): LoDashExplicitArrayWrapper; } //_.head @@ -1326,6 +1415,20 @@ declare module _ { last(): T; } + interface LoDashExplicitArrayWrapper { + /** + * @see _.last + */ + last(): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.last + */ + last(): LoDashExplicitObjectWrapper; + } + //_.lastIndexOf interface LoDashStatic { /** @@ -1389,7 +1492,7 @@ declare module _ { * @see _.zipObject */ object( - props: List, + props: List|List>, values?: List ): TResult; @@ -1397,7 +1500,7 @@ declare module _ { * @see _.zipObject */ object( - props: List, + props: List|List>, values?: List ): TResult; @@ -1405,7 +1508,7 @@ declare module _ { * @see _.zipObject */ object( - props: List, + props: List|List>, values?: List ): _.Dictionary; } @@ -1456,6 +1559,52 @@ declare module _ { ): _.LoDashImplicitObjectWrapper<_.Dictionary>; } + interface LoDashExplicitArrayWrapper { + /** + * @see _.zipObject + */ + object( + values?: List + ): _.LoDashExplicitObjectWrapper; + + /** + * @see _.zipObject + */ + object( + values?: List + ): _.LoDashExplicitObjectWrapper; + + /** + * @see _.zipObject + */ + object( + values?: List + ): _.LoDashExplicitObjectWrapper<_.Dictionary>; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.zipObject + */ + object( + values?: List + ): _.LoDashExplicitObjectWrapper; + + /** + * @see _.zipObject + */ + object( + values?: List + ): _.LoDashExplicitObjectWrapper; + + /** + * @see _.zipObject + */ + object( + values?: List + ): _.LoDashExplicitObjectWrapper<_.Dictionary>; + } + //_.pull interface LoDashStatic { /** @@ -1522,7 +1671,7 @@ declare module _ { * @return Returns the new array of removed elements. */ pullAt( - array: T[]|List, + array: List, ...indexes: (number|number[])[] ): T[]; } @@ -1538,7 +1687,21 @@ declare module _ { /** * @see _.pullAt */ - pullAt(...indexes: (number|number[])[]): LoDashImplicitArrayWrapper; + pullAt(...indexes: (number|number[])[]): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.pullAt + */ + pullAt(...indexes: (number|number[])[]): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.pullAt + */ + pullAt(...indexes: (number|number[])[]): LoDashExplicitArrayWrapper; } //_.remove @@ -1768,71 +1931,226 @@ declare module _ { //_.sortedIndex interface LoDashStatic { /** - * Uses a binary search to determine the smallest index at which a value should be inserted - * into a given sorted array in order to maintain the sort order of the array. If a callback - * is provided it will be executed for value and each element of array to compute their sort - * ranking. The callback is bound to thisArg and invoked with one argument; (value). - * - * If a property name is provided for callback the created "_.pluck" style callback will - * return the property value of the given element. - * - * If an object is provided for callback the created "_.where" style callback will return - * true for elements that have the properties of the given object, else false. - * @param array The sorted list. - * @param value The value to determine its index within `list`. - * @param callback Iterator to compute the sort ranking of each value, optional. - * @return The index at which value should be inserted into array. - **/ - sortedIndex( - array: Array, - value: T, - callback?: (x: T) => TSort, - thisArg?: any): number; - - /** - * @see _.sortedIndex - **/ + * Uses a binary search to determine the lowest index at which value should be inserted into array in order to maintain its sort order. If an iteratee function is provided it’s invoked for value and each element of array to compute their sort ranking. The iteratee is bound to thisArg and invoked with one argument; (value). + * + * If a property name is provided for iteratee the created _.property style callback returns the property value of the given element. + * + * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for elements that have a matching property value, else false. + * + * If an object is provided for iteratee the created _.matches style callback returns true for elements that have the properties of the given object, else false. + * + * @param array The sorted array to inspect. + * @param value The value to evaluate. + * @param iteratee The function invoked per iteration. + * @return The this binding of iteratee. + */ sortedIndex( array: List, value: T, - callback?: (x: T) => TSort, - thisArg?: any): number; + iteratee?: (x: T) => TSort, + thisArg?: any + ): number; /** - * @see _.sortedIndex - * @param pluckValue the _.pluck style callback - **/ - sortedIndex( - array: Array, - value: T, - pluckValue: string): number; - - /** - * @see _.sortedIndex - * @param pluckValue the _.pluck style callback - **/ + * @see _.sortedIndex + */ sortedIndex( array: List, value: T, - pluckValue: string): number; + iteratee?: (x: T) => any, + thisArg?: any + ): number; /** - * @see _.sortedIndex - * @param pluckValue the _.where style callback - **/ - sortedIndex( - array: Array, + * @see _.sortedIndex + */ + sortedIndex( + array: List, value: T, - whereValue: W): number; + iteratee: string + ): number; /** - * @see _.sortedIndex - * @param pluckValue the _.where style callback - **/ + * @see _.sortedIndex + */ sortedIndex( array: List, value: T, - whereValue: W): number; + iteratee: W + ): number; + + /** + * @see _.sortedIndex + */ + sortedIndex( + array: List, + value: T, + iteratee: Object + ): number; + } + + interface LoDashImplicitWrapper { + /** + * @see _.sortedIndex + */ + sortedIndex( + value: string, + iteratee?: (x: string) => TSort, + thisArg?: any + ): number; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.sortedIndex + */ + sortedIndex( + value: T, + iteratee?: (x: T) => TSort, + thisArg?: any + ): number; + + /** + * @see _.sortedIndex + */ + sortedIndex( + value: T, + iteratee: string + ): number; + + /** + * @see _.sortedIndex + */ + sortedIndex( + value: T, + iteratee: W + ): number; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.sortedIndex + */ + sortedIndex( + value: T, + iteratee?: (x: T) => TSort, + thisArg?: any + ): number; + + /** + * @see _.sortedIndex + */ + sortedIndex( + value: T, + iteratee?: (x: T) => any, + thisArg?: any + ): number; + + /** + * @see _.sortedIndex + */ + sortedIndex( + value: T, + iteratee: string + ): number; + + /** + * @see _.sortedIndex + */ + sortedIndex( + value: T, + iteratee: W + ): number; + + /** + * @see _.sortedIndex + */ + sortedIndex( + value: T, + iteratee: Object + ): number; + } + + interface LoDashExplicitWrapper { + /** + * @see _.sortedIndex + */ + sortedIndex( + value: string, + iteratee?: (x: string) => TSort, + thisArg?: any + ): LoDashExplicitWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.sortedIndex + */ + sortedIndex( + value: T, + iteratee?: (x: T) => TSort, + thisArg?: any + ): LoDashExplicitWrapper; + + /** + * @see _.sortedIndex + */ + sortedIndex( + value: T, + iteratee: string + ): LoDashExplicitWrapper; + + /** + * @see _.sortedIndex + */ + sortedIndex( + value: T, + iteratee: W + ): LoDashExplicitWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.sortedIndex + */ + sortedIndex( + value: T, + iteratee?: (x: T) => TSort, + thisArg?: any + ): LoDashExplicitWrapper; + + /** + * @see _.sortedIndex + */ + sortedIndex( + value: T, + iteratee?: (x: T) => any, + thisArg?: any + ): LoDashExplicitWrapper; + + /** + * @see _.sortedIndex + */ + sortedIndex( + value: T, + iteratee: string + ): LoDashExplicitWrapper; + + /** + * @see _.sortedIndex + */ + sortedIndex( + value: T, + iteratee: W + ): LoDashExplicitWrapper; + + /** + * @see _.sortedIndex + */ + sortedIndex( + value: T, + iteratee: Object + ): LoDashExplicitWrapper; } //_.sortedLastIndex @@ -1994,7 +2312,7 @@ declare module _ { * @return Returns the slice of array. */ takeRight( - array: T[]|List, + array: List, n?: number ): T[]; } @@ -2013,6 +2331,20 @@ declare module _ { takeRight(n?: number): LoDashImplicitArrayWrapper; } + interface LoDashExplicitArrayWrapper { + /** + * @see _.takeRight + */ + takeRight(n?: number): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.takeRight + */ + takeRight(n?: number): LoDashExplicitArrayWrapper; + } + //_.takeRightWhile interface LoDashStatic { /** @@ -2251,6 +2583,56 @@ declare module _ { ): LoDashImplicitArrayWrapper; } + interface LoDashExplicitArrayWrapper { + /** + * @see _.takeWhile + */ + takeWhile( + predicate?: ListIterator, + thisArg?: any + ): LoDashExplicitArrayWrapper; + + /** + * @see _.takeWhile + */ + takeWhile( + predicate?: string, + thisArg?: any + ): LoDashExplicitArrayWrapper; + + /** + * @see _.takeWhile + */ + takeWhile( + predicate?: TWhere + ): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.takeWhile + */ + takeWhile( + predicate?: ListIterator, + thisArg?: any + ): LoDashExplicitArrayWrapper; + + /** + * @see _.takeWhile + */ + takeWhile( + predicate?: string, + thisArg?: any + ): LoDashExplicitArrayWrapper; + + /** + * @see _.takeWhile + */ + takeWhile( + predicate?: TWhere + ): LoDashExplicitArrayWrapper; + } + //_.union interface LoDashStatic { /** @@ -2643,6 +3025,46 @@ declare module _ { whereValue: W): LoDashImplicitArrayWrapper; } + //_.unzip + interface LoDashStatic { + /** + * This method is like _.zip except that it accepts an array of grouped elements and creates an array + * regrouping the elements to their pre-zip configuration. + * + * @param array The array of grouped elements to process. + * @return Returns the new array of regrouped elements. + */ + unzip(array: List>): T[][]; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.unzip + */ + unzip(): LoDashImplicitArrayWrapper; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.unzip + */ + unzip(): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.unzip + */ + unzip(): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.unzip + */ + unzip(): LoDashExplicitArrayWrapper; + } + //_.unzipWith interface LoDashStatic { /** @@ -2692,7 +3114,7 @@ declare module _ { * @return Returns the new array of filtered values. */ without( - array: T[]|List, + array: List, ...values: T[] ): T[]; } @@ -2708,7 +3130,21 @@ declare module _ { /** * @see _.without */ - without(...values: TValue[]): LoDashImplicitArrayWrapper; + without(...values: T[]): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.without + */ + without(...values: T[]): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.without + */ + without(...values: T[]): LoDashExplicitArrayWrapper; } //_.xor @@ -2733,46 +3169,61 @@ declare module _ { /** * @see _.xor */ - xor(...arrays: List[]): LoDashImplicitArrayWrapper; + xor(...arrays: List[]): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.xor + */ + xor(...arrays: List[]): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.xor + */ + xor(...arrays: List[]): LoDashExplicitArrayWrapper; } //_.zip interface LoDashStatic { /** - * Creates an array of grouped elements, the first of which contains the first - * elements of the given arrays, the second of which contains the second elements - * of the given arrays, and so on. - * @param arrays Arrays to process. - * @return A new array of grouped elements. - **/ - zip(...arrays: any[][]): any[][]; - - /** - * @see _.zip - **/ - zip(...arrays: any[]): any[]; - - /** - * @see _.zip - **/ - unzip(...arrays: any[][]): any[][]; - - /** - * @see _.zip - **/ - unzip(...arrays: any[]): any[]; + * Creates an array of grouped elements, the first of which contains the first elements of the given arrays, + * the second of which contains the second elements of the given arrays, and so on. + * + * @param arrays The arrays to process. + * @return Returns the new array of grouped elements. + */ + zip(...arrays: List[]): T[][]; } interface LoDashImplicitArrayWrapper { /** - * @see _.zip - **/ - zip(...arrays: any[][]): _.LoDashImplicitArrayWrapper; + * @see _.zip + */ + zip(...arrays: List[]): _.LoDashImplicitArrayWrapper; + } + interface LoDashImplicitObjectWrapper { /** - * @see _.zip - **/ - unzip(...arrays: any[]): _.LoDashImplicitArrayWrapper; + * @see _.zip + */ + zip(...arrays: List[]): _.LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.zip + */ + zip(...arrays: List[]): _.LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.zip + */ + zip(...arrays: List[]): _.LoDashExplicitArrayWrapper; } //_.zipObject @@ -2789,7 +3240,7 @@ declare module _ { * @return Returns the new object. */ zipObject( - props: List, + props: List|List>, values?: List ): TResult; @@ -2797,7 +3248,7 @@ declare module _ { * @see _.zipObject */ zipObject( - props: List, + props: List|List>, values?: List ): TResult; @@ -2805,7 +3256,7 @@ declare module _ { * @see _.zipObject */ zipObject( - props: List, + props: List|List>, values?: List ): _.Dictionary; } @@ -2856,6 +3307,52 @@ declare module _ { ): _.LoDashImplicitObjectWrapper<_.Dictionary>; } + interface LoDashExplicitArrayWrapper { + /** + * @see _.zipObject + */ + zipObject( + values?: List + ): _.LoDashExplicitObjectWrapper; + + /** + * @see _.zipObject + */ + zipObject( + values?: List + ): _.LoDashExplicitObjectWrapper; + + /** + * @see _.zipObject + */ + zipObject( + values?: List + ): _.LoDashExplicitObjectWrapper<_.Dictionary>; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.zipObject + */ + zipObject( + values?: List + ): _.LoDashExplicitObjectWrapper; + + /** + * @see _.zipObject + */ + zipObject( + values?: List + ): _.LoDashExplicitObjectWrapper; + + /** + * @see _.zipObject + */ + zipObject( + values?: List + ): _.LoDashExplicitObjectWrapper<_.Dictionary>; + } + //_.zipWith interface LoDashStatic { /** @@ -3540,7 +4037,7 @@ declare module _ { */ at( collection: List|Dictionary, - ...props: Array> + ...props: (number|string|(number|string)[])[] ): T[]; } @@ -3548,14 +4045,28 @@ declare module _ { /** * @see _.at */ - at(...props: Array>): LoDashImplicitArrayWrapper; + at(...props: (number|string|(number|string)[])[]): LoDashImplicitArrayWrapper; } interface LoDashImplicitObjectWrapper { /** * @see _.at */ - at(...props: Array>): LoDashImplicitArrayWrapper; + at(...props: (number|string|(number|string)[])[]): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.at + */ + at(...props: (number|string|(number|string)[])[]): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.at + */ + at(...props: (number|string|(number|string)[])[]): LoDashExplicitArrayWrapper; } //_.collect @@ -3694,160 +4205,82 @@ declare module _ { //_.contains interface LoDashStatic { /** - * Checks if a given value is present in a collection using strict equality for comparisons, - * i.e. ===. If fromIndex is negative, it is used as the offset from the end of the collection. - * @param collection The collection to iterate over. - * @param target The value to check for. - * @param fromIndex The index to search from. - * @return True if the target element is found, else false. - **/ + * @see _.includes + */ contains( - collection: Array, + collection: List|Dictionary, target: T, - fromIndex?: number): boolean; + fromIndex?: number + ): boolean; /** - * @see _.contains - **/ - contains( - collection: List, - target: T, - fromIndex?: number): boolean; - - /** - * @see _.contains - * @param dictionary The dictionary to iterate over. - * @param value The value in the dictionary to search for. - **/ - contains( - dictionary: Dictionary, - value: T, - fromIndex?: number): boolean; - - /** - * @see _.contains - * @param searchString the string to search - * @param targetString the string to search for - **/ + * @see _.includes + */ contains( - searchString: string, - targetString: string, - fromIndex?: number): boolean; - - /** - * @see _.contains - **/ - include( - collection: Array, - target: T, - fromIndex?: number): boolean; - - /** - * @see _.contains - **/ - include( - collection: List, - target: T, - fromIndex?: number): boolean; - - /** - * @see _.contains - **/ - include( - dictionary: Dictionary, - value: T, - fromIndex?: number): boolean; - - /** - * @see _.contains - **/ - include( - searchString: string, - targetString: string, - fromIndex?: number): boolean; - - /** - * @see _.contains - **/ - includes( - collection: Array, - target: T, - fromIndex?: number): boolean; - - /** - * @see _.contains - **/ - includes( - collection: List, - target: T, - fromIndex?: number): boolean; - - /** - * @see _.contains - **/ - includes( - dictionary: Dictionary, - value: T, - fromIndex?: number): boolean; - - /** - * @see _.contains - **/ - includes( - searchString: string, - targetString: string, - fromIndex?: number): boolean; + collection: string, + target: string, + fromIndex?: number + ): boolean; } interface LoDashImplicitArrayWrapper { /** - * @see _.contains - **/ - contains(target: T, fromIndex?: number): boolean; - - /** - * @see _.contains - **/ - include(target: T, fromIndex?: number): boolean; - - /** - * @see _.contains - **/ - includes(target: T, fromIndex?: number): boolean; + * @see _.includes + */ + contains( + target: T, + fromIndex?: number + ): boolean; } interface LoDashImplicitObjectWrapper { /** - * @see _.contains - **/ - contains(target: TValue, fromIndex?: number): boolean; - - /** - * @see _.contains - **/ - include(target: TValue, fromIndex?: number): boolean; - - /** - * @see _.contains - **/ - includes(target: TValue, fromIndex?: number): boolean; + * @see _.includes + */ + contains( + target: TValue, + fromIndex?: number + ): boolean; } - interface LoDashImplicitStringWrapper { + interface LoDashImplicitWrapper { /** - * @see _.contains - **/ - contains(target: string, fromIndex?: number): boolean; + * @see _.includes + */ + contains( + target: string, + fromIndex?: number + ): boolean; + } + interface LoDashExplicitArrayWrapper { /** - * @see _.contains - **/ - include(target: string, fromIndex?: number): boolean; + * @see _.includes + */ + contains( + target: T, + fromIndex?: number + ): LoDashExplicitWrapper; + } + interface LoDashExplicitObjectWrapper { /** - * @see _.contains - **/ - includes(target: string, fromIndex?: number): boolean; + * @see _.includes + */ + contains( + target: TValue, + fromIndex?: number + ): LoDashExplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.includes + */ + contains( + target: string, + fromIndex?: number + ): LoDashExplicitWrapper; } //_.countBy @@ -4026,21 +4459,12 @@ declare module _ { //_.each interface LoDashStatic { - /** - * @see _.forEach - */ - each( - collection: string, - iteratee?: StringIterator, - thisArg?: any - ): string; - /** * @see _.forEach */ each( collection: T[], - iteratee?: ListIterator, + iteratee?: ListIterator, thisArg?: any ): T[]; @@ -4049,7 +4473,7 @@ declare module _ { */ each( collection: List, - iteratee?: ListIterator, + iteratee?: ListIterator, thisArg?: any ): List; @@ -4058,9 +4482,27 @@ declare module _ { */ each( collection: Dictionary, - iteratee?: DictionaryIterator, + iteratee?: DictionaryIterator, thisArg?: any ): Dictionary; + + /** + * @see _.forEach + */ + each( + collection: T, + iteratee?: ObjectIterator, + thisArgs?: any + ): T; + + /** + * @see _.forEach + */ + each( + collection: T, + iteratee?: ObjectIterator, + thisArgs?: any + ): T; } interface LoDashImplicitWrapper { @@ -4068,7 +4510,7 @@ declare module _ { * @see _.forEach */ each( - iteratee: StringIterator, + iteratee: ListIterator, thisArg?: any ): LoDashImplicitWrapper; } @@ -4078,7 +4520,7 @@ declare module _ { * @see _.forEach */ each( - iteratee: ListIterator, + iteratee: ListIterator, thisArg?: any ): LoDashImplicitArrayWrapper; } @@ -4088,7 +4530,7 @@ declare module _ { * @see _.forEach */ each( - iteratee?: ListIterator|DictionaryIterator, + iteratee?: ListIterator|DictionaryIterator, thisArg?: any ): LoDashImplicitObjectWrapper; } @@ -4098,7 +4540,7 @@ declare module _ { * @see _.forEach */ each( - iteratee: StringIterator, + iteratee: ListIterator, thisArg?: any ): LoDashExplicitWrapper; } @@ -4108,7 +4550,7 @@ declare module _ { * @see _.forEach */ each( - iteratee: ListIterator, + iteratee: ListIterator, thisArg?: any ): LoDashExplicitArrayWrapper; } @@ -4118,7 +4560,115 @@ declare module _ { * @see _.forEach */ each( - iteratee?: ListIterator|DictionaryIterator, + iteratee?: ListIterator|DictionaryIterator, + thisArg?: any + ): LoDashExplicitObjectWrapper; + } + + //_.eachRight + interface LoDashStatic { + /** + * @see _.forEachRight + */ + eachRight( + collection: T[], + iteratee?: ListIterator, + thisArg?: any + ): T[]; + + /** + * @see _.forEachRight + */ + eachRight( + collection: List, + iteratee?: ListIterator, + thisArg?: any + ): List; + + /** + * @see _.forEachRight + */ + eachRight( + collection: Dictionary, + iteratee?: DictionaryIterator, + thisArg?: any + ): Dictionary; + + /** + * @see _.forEachRight + */ + eachRight( + collection: T, + iteratee?: ObjectIterator, + thisArgs?: any + ): T; + + /** + * @see _.forEachRight + */ + eachRight( + collection: T, + iteratee?: ObjectIterator, + thisArgs?: any + ): T; + } + + interface LoDashImplicitWrapper { + /** + * @see _.forEachRight + */ + eachRight( + iteratee: ListIterator, + thisArg?: any + ): LoDashImplicitWrapper; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.forEachRight + */ + eachRight( + iteratee: ListIterator, + thisArg?: any + ): LoDashImplicitArrayWrapper; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.forEachRight + */ + eachRight( + iteratee?: ListIterator|DictionaryIterator, + thisArg?: any + ): LoDashImplicitObjectWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.forEachRight + */ + eachRight( + iteratee: ListIterator, + thisArg?: any + ): LoDashExplicitWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.forEachRight + */ + eachRight( + iteratee: ListIterator, + thisArg?: any + ): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.forEachRight + */ + eachRight( + iteratee?: ListIterator|DictionaryIterator, thisArg?: any ): LoDashExplicitObjectWrapper; } @@ -4278,280 +4828,180 @@ declare module _ { ): LoDashExplicitWrapper; } - //_.fill - interface LoDashStatic { - /** - * Fills elements of array with value from start up to, but not including, end. - * - * Note: This method mutates array. - * - * @param array (Array): The array to fill. - * @param value (*): The value to fill array with. - * @param [start=0] (number): The start position. - * @param [end=array.length] (number): The end position. - * @return (Array): Returns array. - */ - fill( - array: any[], - value: any, - start?: number, - end?: number): TResult[]; - - /** - * @see _.fill - */ - fill( - array: List, - value: any, - start?: number, - end?: number): List; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.fill - */ - fill( - value: TResult, - start?: number, - end?: number): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.fill - */ - fill( - value: TResult, - start?: number, - end?: number): LoDashImplicitObjectWrapper>; - } - //_.filter interface LoDashStatic { /** - * Iterates over elements of a collection, returning an array of all elements the - * identity function returns truey for. - * - * @param collection The collection to iterate over. - * @return Returns a new array of elements that passed the callback check. - **/ - filter( - collection: (Array|List)): T[]; - - /** - * Iterates over elements of a collection, returning an array of all elements the - * callback returns truey for. The callback is bound to thisArg and invoked with three - * arguments; (value, index|key, collection). - * - * If a property name is provided for callback the created "_.pluck" style callback will - * return the property value of the given element. - * - * If an object is provided for callback the created "_.where" style callback will return - * true for elements that have the properties of the given object, else false. - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param context The this binding of callback. - * @return Returns a new array of elements that passed the callback check. - **/ - filter( - collection: Array, - callback: ListIterator, - thisArg?: any): T[]; - - /** - * @see _.filter - **/ + * Iterates over elements of collection, returning an array of all elements predicate returns truthy for. The + * predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). + * + * If a property name is provided for predicate the created _.property style callback returns the property + * value of the given element. + * + * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for + * elements that have a matching property value, else false. + * + * If an object is provided for predicate the created _.matches style callback returns true for elements that + * have the properties of the given object, else false. + * + * @alias _.select + * + * @param collection The collection to iterate over. + * @param predicate The function invoked per iteration. + * @param thisArg The this binding of predicate. + * @return Returns the new filtered array. + */ filter( collection: List, - callback: ListIterator, - thisArg?: any): T[]; + predicate?: ListIterator, + thisArg?: any + ): T[]; /** - * @see _.filter - **/ + * @see _.filter + */ filter( collection: Dictionary, - callback: DictionaryIterator, - thisArg?: any): T[]; + predicate?: DictionaryIterator, + thisArg?: any + ): T[]; /** - * @see _.filter - * @param pluckValue _.pluck style callback - **/ + * @see _.filter + */ + filter( + collection: string, + predicate?: StringIterator, + thisArg?: any + ): string[]; + + /** + * @see _.filter + */ filter( - collection: Array, - pluckValue: string): T[]; + collection: List|Dictionary, + predicate: string, + thisArg?: any + ): T[]; /** - * @see _.filter - * @param pluckValue _.pluck style callback - **/ - filter( - collection: List, - pluckValue: string): T[]; + * @see _.filter + */ + filter( + collection: List|Dictionary, + predicate: W + ): T[]; + } + interface LoDashImplicitWrapper { /** - * @see _.filter - * @param pluckValue _.pluck style callback - **/ - filter( - collection: Dictionary, - pluckValue: string): T[]; - - /** - * @see _.filter - * @param pluckValue _.pluck style callback - **/ - filter( - collection: Array, - whereValue: W): T[]; - - /** - * @see _.filter - * @param pluckValue _.pluck style callback - **/ - filter( - collection: List, - whereValue: W): T[]; - - /** - * @see _.filter - * @param pluckValue _.pluck style callback - **/ - filter( - collection: Dictionary, - whereValue: W): T[]; - - /** - * @see _.filter - **/ - select( - collection: Array, - callback: ListIterator, - thisArg?: any): T[]; - - /** - * @see _.filter - **/ - select( - collection: List, - callback: ListIterator, - thisArg?: any): T[]; - - /** - * @see _.filter - **/ - select( - collection: Dictionary, - callback: DictionaryIterator, - thisArg?: any): T[]; - - /** - * @see _.filter - * @param pluckValue _.pluck style callback - **/ - select( - collection: Array, - pluckValue: string): T[]; - - /** - * @see _.filter - * @param pluckValue _.pluck style callback - **/ - select( - collection: List, - pluckValue: string): T[]; - - /** - * @see _.filter - * @param pluckValue _.pluck style callback - **/ - select( - collection: Dictionary, - pluckValue: string): T[]; - - /** - * @see _.filter - * @param pluckValue _.pluck style callback - **/ - select( - collection: Array, - whereValue: W): T[]; - - /** - * @see _.filter - * @param pluckValue _.pluck style callback - **/ - select( - collection: List, - whereValue: W): T[]; - - /** - * @see _.filter - * @param pluckValue _.pluck style callback - **/ - select( - collection: Dictionary, - whereValue: W): T[]; + * @see _.filter + */ + filter( + predicate?: StringIterator, + thisArg?: any + ): LoDashImplicitArrayWrapper; } interface LoDashImplicitArrayWrapper { /** - * @see _.filter - **/ - filter(): LoDashImplicitArrayWrapper; - - /** - * @see _.filter - **/ + * @see _.filter + */ filter( - callback: ListIterator, - thisArg?: any): LoDashImplicitArrayWrapper; + predicate: ListIterator, + thisArg?: any + ): LoDashImplicitArrayWrapper; /** - * @see _.filter - * @param pluckValue _.pluck style callback - **/ + * @see _.filter + */ filter( - pluckValue: string): LoDashImplicitArrayWrapper; + predicate: string, + thisArg?: any + ): LoDashImplicitArrayWrapper; /** - * @see _.filter - * @param pluckValue _.pluck style callback - **/ - filter( - whereValue: W): LoDashImplicitArrayWrapper; - - /** - * @see _.filter - **/ - select( - callback: ListIterator, - thisArg?: any): LoDashImplicitArrayWrapper; - - /** - * @see _.filter - * @param pluckValue _.pluck style callback - **/ - select( - pluckValue: string): LoDashImplicitArrayWrapper; - - /** - * @see _.filter - * @param pluckValue _.pluck style callback - **/ - select( - whereValue: W): LoDashImplicitArrayWrapper; + * @see _.filter + */ + filter(predicate: W): LoDashImplicitArrayWrapper; } interface LoDashImplicitObjectWrapper { /** - * @see _.filter - **/ - filter( - callback: ObjectIterator, - thisArg?: any): LoDashImplicitObjectWrapper; + * @see _.filter + */ + filter( + predicate: ListIterator|DictionaryIterator, + thisArg?: any + ): LoDashImplicitArrayWrapper; + + /** + * @see _.filter + */ + filter( + predicate: string, + thisArg?: any + ): LoDashImplicitArrayWrapper; + + /** + * @see _.filter + */ + filter(predicate: W): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.filter + */ + filter( + predicate?: StringIterator, + thisArg?: any + ): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.filter + */ + filter( + predicate: ListIterator, + thisArg?: any + ): LoDashExplicitArrayWrapper; + + /** + * @see _.filter + */ + filter( + predicate: string, + thisArg?: any + ): LoDashExplicitArrayWrapper; + + /** + * @see _.filter + */ + filter(predicate: W): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.filter + */ + filter( + predicate: ListIterator|DictionaryIterator, + thisArg?: any + ): LoDashExplicitArrayWrapper; + + /** + * @see _.filter + */ + filter( + predicate: string, + thisArg?: any + ): LoDashExplicitArrayWrapper; + + /** + * @see _.filter + */ + filter(predicate: W): LoDashExplicitArrayWrapper; } //_.find @@ -4852,18 +5302,9 @@ declare module _ { * @param iteratee The function invoked per iteration. * @param thisArg The this binding of iteratee. */ - forEach( - collection: string, - iteratee?: StringIterator, - thisArg?: any - ): string; - - /** - * @see _.forEach - */ forEach( collection: T[], - iteratee?: ListIterator, + iteratee?: ListIterator, thisArg?: any ): T[]; @@ -4872,7 +5313,7 @@ declare module _ { */ forEach( collection: List, - iteratee?: ListIterator, + iteratee?: ListIterator, thisArg?: any ): List; @@ -4881,9 +5322,27 @@ declare module _ { */ forEach( collection: Dictionary, - iteratee?: DictionaryIterator, + iteratee?: DictionaryIterator, thisArg?: any ): Dictionary; + + /** + * @see _.forEach + */ + forEach( + collection: T, + iteratee?: ObjectIterator, + thisArgs?: any + ): T; + + /** + * @see _.forEach + */ + forEach( + collection: T, + iteratee?: ObjectIterator, + thisArgs?: any + ): T; } interface LoDashImplicitWrapper { @@ -4891,7 +5350,7 @@ declare module _ { * @see _.forEach */ forEach( - iteratee: StringIterator, + iteratee: ListIterator, thisArg?: any ): LoDashImplicitWrapper; } @@ -4901,7 +5360,7 @@ declare module _ { * @see _.forEach */ forEach( - iteratee: ListIterator, + iteratee: ListIterator, thisArg?: any ): LoDashImplicitArrayWrapper; } @@ -4911,7 +5370,7 @@ declare module _ { * @see _.forEach */ forEach( - iteratee?: ListIterator|DictionaryIterator, + iteratee?: ListIterator|DictionaryIterator, thisArg?: any ): LoDashImplicitObjectWrapper; } @@ -4921,7 +5380,7 @@ declare module _ { * @see _.forEach */ forEach( - iteratee: StringIterator, + iteratee: ListIterator, thisArg?: any ): LoDashExplicitWrapper; } @@ -4931,7 +5390,7 @@ declare module _ { * @see _.forEach */ forEach( - iteratee: ListIterator, + iteratee: ListIterator, thisArg?: any ): LoDashExplicitArrayWrapper; } @@ -4941,7 +5400,7 @@ declare module _ { * @see _.forEach */ forEach( - iteratee?: ListIterator|DictionaryIterator, + iteratee?: ListIterator|DictionaryIterator, thisArg?: any ): LoDashExplicitObjectWrapper; } @@ -4949,223 +5408,541 @@ declare module _ { //_.forEachRight interface LoDashStatic { /** - * This method is like _.forEach except that it iterates over elements of a - * collection from right to left. - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param thisArg The this binding of callback. - **/ + * This method is like _.forEach except that it iterates over elements of collection from right to left. + * + * @alias _.eachRight + * + * @param collection The collection to iterate over. + * @param iteratee The function called per iteration. + * @param thisArg The this binding of callback. + */ forEachRight( - collection: Array, - callback: ListIterator, - thisArg?: any): Array; + collection: T[], + iteratee?: ListIterator, + thisArg?: any + ): T[]; /** - * @see _.forEachRight - **/ + * @see _.forEachRight + */ forEachRight( collection: List, - callback: ListIterator, - thisArg?: any): List; + iteratee?: ListIterator, + thisArg?: any + ): List; /** - * @see _.forEachRight - **/ + * @see _.forEachRight + */ + forEachRight( + collection: Dictionary, + iteratee?: DictionaryIterator, + thisArg?: any + ): Dictionary; + + /** + * @see _.forEachRight + */ forEachRight( - object: Dictionary, - callback: DictionaryIterator, - thisArg?: any): Dictionary; + collection: T, + iteratee?: ObjectIterator, + thisArgs?: any + ): T; /** - * @see _.forEachRight - **/ - eachRight( - collection: Array, - callback: ListIterator, - thisArg?: any): Array; + * @see _.forEachRight + */ + forEachRight( + collection: T, + iteratee?: ObjectIterator, + thisArgs?: any + ): T; + } + interface LoDashImplicitWrapper { /** - * @see _.forEachRight - **/ - eachRight( - collection: List, - callback: ListIterator, - thisArg?: any): List; - - /** - * @see _.forEachRight - * @param object The object to iterate over - * @param callback The function called per iteration. - * @param thisArg The this binding of callback. - **/ - eachRight( - object: Dictionary, - callback: DictionaryIterator, - thisArg?: any): Dictionary; + * @see _.forEachRight + */ + forEachRight( + iteratee: ListIterator, + thisArg?: any + ): LoDashImplicitWrapper; } interface LoDashImplicitArrayWrapper { /** - * @see _.forEachRight - **/ + * @see _.forEachRight + */ forEachRight( - callback: ListIterator, - thisArg?: any): LoDashImplicitArrayWrapper; - - /** - * @see _.forEachRight - **/ - eachRight( - callback: ListIterator, - thisArg?: any): LoDashImplicitArrayWrapper; + iteratee: ListIterator, + thisArg?: any + ): LoDashImplicitArrayWrapper; } interface LoDashImplicitObjectWrapper { /** - * @see _.forEachRight - **/ - forEachRight( - callback: ObjectIterator, - thisArg?: any): LoDashImplicitObjectWrapper>; + * @see _.forEachRight + */ + forEachRight( + iteratee?: ListIterator|DictionaryIterator, + thisArg?: any + ): LoDashImplicitObjectWrapper; + } + interface LoDashExplicitWrapper { /** - * @see _.forEachRight - * @param object The object to iterate over - * @param callback The function called per iteration. - * @param thisArg The this binding of callback. - **/ - eachRight( - callback: ObjectIterator, - thisArg?: any): LoDashImplicitObjectWrapper>; + * @see _.forEachRight + */ + forEachRight( + iteratee: ListIterator, + thisArg?: any + ): LoDashExplicitWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.forEachRight + */ + forEachRight( + iteratee: ListIterator, + thisArg?: any + ): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.forEachRight + */ + forEachRight( + iteratee?: ListIterator|DictionaryIterator, + thisArg?: any + ): LoDashExplicitObjectWrapper; } //_.groupBy interface LoDashStatic { /** - * Creates an object composed of keys generated from the results of running each element - * of a collection through the callback. The corresponding value of each key is an array - * of the elements responsible for generating the key. The callback is bound to thisArg - * and invoked with three arguments; (value, index|key, collection). - * - * If a property name is provided for callback the created "_.pluck" style callback will - * return the property value of the given element. - * If an object is provided for callback the created "_.where" style callback will return - * true for elements that have the properties of the given object, else false - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param thisArg The this binding of callback. - * @return Returns the composed aggregate object. - **/ - groupBy( - collection: Array, - callback?: ListIterator, - thisArg?: any): Dictionary; - - /** - * @see _.groupBy - **/ - groupBy( + * Creates an object composed of keys generated from the results of running each element of collection through + * iteratee. The corresponding value of each key is an array of the elements responsible for generating the + * key. The iteratee is bound to thisArg and invoked with three arguments: + * (value, index|key, collection). + * + * If a property name is provided for iteratee the created _.property style callback returns the property + * value of the given element. + * + * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for + * elements that have a matching property value, else false. + * + * If an object is provided for iteratee the created _.matches style callback returns true for elements that + * have the properties of the given object, else false. + * + * @param collection The collection to iterate over. + * @param iteratee The function invoked per iteration. + * @param thisArg The this binding of iteratee. + * @return Returns the composed aggregate object. + */ + groupBy( collection: List, - callback?: ListIterator, - thisArg?: any): Dictionary; + iteratee?: ListIterator, + thisArg?: any + ): Dictionary; /** - * @see _.groupBy - * @param pluckValue _.pluck style callback - **/ + * @see _.groupBy + */ groupBy( - collection: Array, - pluckValue: string): Dictionary; + collection: List, + iteratee?: ListIterator, + thisArg?: any + ): Dictionary; /** - * @see _.groupBy - * @param pluckValue _.pluck style callback - **/ - groupBy( - collection: List, - pluckValue: string): Dictionary; - - /** - * @see _.groupBy - * @param whereValue _.where style callback - **/ - groupBy( - collection: Array, - whereValue: W): Dictionary; - - /** - * @see _.groupBy - * @param whereValue _.where style callback - **/ - groupBy( - collection: List, - whereValue: W): Dictionary; - - /** - * @see _.groupBy - **/ - groupBy( + * @see _.groupBy + */ + groupBy( collection: Dictionary, - callback?: DictionaryIterator, - thisArg?: any): Dictionary; + iteratee?: DictionaryIterator, + thisArg?: any + ): Dictionary; /** - * @see _.groupBy - * @param pluckValue _.pluck style callback - **/ - groupBy( - collection: Dictionary, - pluckValue: string): Dictionary; + * @see _.groupBy + */ + groupBy( + collection: Dictionary, + iteratee?: DictionaryIterator, + thisArg?: any + ): Dictionary; /** - * @see _.groupBy - * @param whereValue _.where style callback - **/ - groupBy( - collection: Dictionary, - whereValue: W): Dictionary; + * @see _.groupBy + */ + groupBy( + collection: List|Dictionary, + iteratee?: string, + thisArg?: TValue + ): Dictionary; + + /** + * @see _.groupBy + */ + groupBy( + collection: List|Dictionary, + iteratee?: string, + thisArg?: any + ): Dictionary; + + /** + * @see _.groupBy + */ + groupBy( + collection: List|Dictionary, + iteratee?: TWhere + ): Dictionary; + + /** + * @see _.groupBy + */ + groupBy( + collection: List|Dictionary, + iteratee?: Object + ): Dictionary; + } + + interface LoDashImplicitWrapper { + /** + * @see _.groupBy + */ + groupBy( + iteratee?: ListIterator, + thisArg?: any + ): LoDashImplicitObjectWrapper>; } interface LoDashImplicitArrayWrapper { /** - * @see _.groupBy - **/ - groupBy( - callback: ListIterator, - thisArg?: any): _.LoDashImplicitObjectWrapper<_.Dictionary>; + * @see _.groupBy + */ + groupBy( + iteratee?: ListIterator, + thisArg?: any + ): LoDashImplicitObjectWrapper>; /** - * @see _.groupBy - **/ - groupBy( - pluckValue: string): _.LoDashImplicitObjectWrapper<_.Dictionary>; + * @see _.groupBy + */ + groupBy( + iteratee?: string, + thisArg?: TValue + ): LoDashImplicitObjectWrapper>; /** - * @see _.groupBy - **/ - groupBy( - whereValue: W): _.LoDashImplicitObjectWrapper<_.Dictionary>; + * @see _.groupBy + */ + groupBy( + iteratee?: TWhere + ): LoDashImplicitObjectWrapper>; } interface LoDashImplicitObjectWrapper { /** - * @see _.groupBy - **/ - groupBy( - callback: ListIterator, - thisArg?: any): _.LoDashImplicitObjectWrapper<_.Dictionary>; + * @see _.groupBy + */ + groupBy( + iteratee?: ListIterator|DictionaryIterator, + thisArg?: any + ): LoDashImplicitObjectWrapper>; /** - * @see _.groupBy - **/ - groupBy( - pluckValue: string): _.LoDashImplicitObjectWrapper<_.Dictionary>; + * @see _.groupBy + */ + groupBy( + iteratee?: ListIterator|DictionaryIterator, + thisArg?: any + ): LoDashImplicitObjectWrapper>; /** - * @see _.groupBy - **/ - groupBy( - whereValue: W): _.LoDashImplicitObjectWrapper<_.Dictionary>; + * @see _.groupBy + */ + groupBy( + iteratee?: string, + thisArg?: TValue + ): LoDashImplicitObjectWrapper>; + + /** + * @see _.groupBy + */ + groupBy( + iteratee?: string, + thisArg?: any + ): LoDashImplicitObjectWrapper>; + + /** + * @see _.groupBy + */ + groupBy( + iteratee?: TWhere + ): LoDashImplicitObjectWrapper>; + + /** + * @see _.groupBy + */ + groupBy( + iteratee?: Object + ): LoDashImplicitObjectWrapper>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.groupBy + */ + groupBy( + iteratee?: ListIterator, + thisArg?: any + ): LoDashExplicitObjectWrapper>; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.groupBy + */ + groupBy( + iteratee?: ListIterator, + thisArg?: any + ): LoDashExplicitObjectWrapper>; + + /** + * @see _.groupBy + */ + groupBy( + iteratee?: string, + thisArg?: TValue + ): LoDashExplicitObjectWrapper>; + + /** + * @see _.groupBy + */ + groupBy( + iteratee?: TWhere + ): LoDashExplicitObjectWrapper>; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.groupBy + */ + groupBy( + iteratee?: ListIterator|DictionaryIterator, + thisArg?: any + ): LoDashExplicitObjectWrapper>; + + /** + * @see _.groupBy + */ + groupBy( + iteratee?: ListIterator|DictionaryIterator, + thisArg?: any + ): LoDashExplicitObjectWrapper>; + + /** + * @see _.groupBy + */ + groupBy( + iteratee?: string, + thisArg?: TValue + ): LoDashExplicitObjectWrapper>; + + /** + * @see _.groupBy + */ + groupBy( + iteratee?: string, + thisArg?: any + ): LoDashExplicitObjectWrapper>; + + /** + * @see _.groupBy + */ + groupBy( + iteratee?: TWhere + ): LoDashExplicitObjectWrapper>; + + /** + * @see _.groupBy + */ + groupBy( + iteratee?: Object + ): LoDashExplicitObjectWrapper>; + } + + //_.include + interface LoDashStatic { + /** + * @see _.includes + */ + include( + collection: List|Dictionary, + target: T, + fromIndex?: number + ): boolean; + + /** + * @see _.includes + */ + include( + collection: string, + target: string, + fromIndex?: number + ): boolean; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.includes + */ + include( + target: T, + fromIndex?: number + ): boolean; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.includes + */ + include( + target: TValue, + fromIndex?: number + ): boolean; + } + + interface LoDashImplicitWrapper { + /** + * @see _.includes + */ + include( + target: string, + fromIndex?: number + ): boolean; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.includes + */ + include( + target: T, + fromIndex?: number + ): LoDashExplicitWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.includes + */ + include( + target: TValue, + fromIndex?: number + ): LoDashExplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.includes + */ + include( + target: string, + fromIndex?: number + ): LoDashExplicitWrapper; + } + + //_.includes + interface LoDashStatic { + /** + * Checks if target is in collection using SameValueZero for equality comparisons. If fromIndex is negative, + * it’s used as the offset from the end of collection. + * + * @alias _.contains, _.include + * + * @param collection The collection to search. + * @param target The value to search for. + * @param fromIndex The index to search from. + * @return True if the target element is found, else false. + */ + includes( + collection: List|Dictionary, + target: T, + fromIndex?: number + ): boolean; + + /** + * @see _.includes + */ + includes( + collection: string, + target: string, + fromIndex?: number + ): boolean; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.includes + */ + includes( + target: T, + fromIndex?: number + ): boolean; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.includes + */ + includes( + target: TValue, + fromIndex?: number + ): boolean; + } + + interface LoDashImplicitWrapper { + /** + * @see _.includes + */ + includes( + target: string, + fromIndex?: number + ): boolean; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.includes + */ + includes( + target: T, + fromIndex?: number + ): LoDashExplicitWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.includes + */ + includes( + target: TValue, + fromIndex?: number + ): LoDashExplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.includes + */ + includes( + target: string, + fromIndex?: number + ): LoDashExplicitWrapper; } //_.indexBy @@ -6019,108 +6796,166 @@ declare module _ { //_.reject interface LoDashStatic { /** - * The opposite of _.filter this method returns the elements of a collection that - * the callback does not return truey for. - * - * If a property name is provided for callback the created "_.pluck" style callback - * will return the property value of the given element. - * - * If an object is provided for callback the created "_.where" style callback will - * return true for elements that have the properties of the given object, else false. - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param thisArg The this binding of callback. - * @return A new array of elements that failed the callback check. - **/ - reject( - collection: Array, - callback: ListIterator, - thisArg?: any): T[]; - - /** - * @see _.reject - **/ + * The opposite of _.filter; this method returns the elements of collection that predicate does not return + * truthy for. + * + * @param collection The collection to iterate over. + * @param predicate The function invoked per iteration. + * @param thisArg The this binding of predicate. + * @return Returns the new filtered array. + */ reject( collection: List, - callback: ListIterator, - thisArg?: any): T[]; + predicate?: ListIterator, + thisArg?: any + ): T[]; /** - * @see _.reject - **/ + * @see _.reject + */ reject( collection: Dictionary, - callback: DictionaryIterator, - thisArg?: any): T[]; + predicate?: DictionaryIterator, + thisArg?: any + ): T[]; /** - * @see _.reject - * @param pluckValue _.pluck style callback - **/ + * @see _.reject + */ + reject( + collection: string, + predicate?: StringIterator, + thisArg?: any + ): string[]; + + /** + * @see _.reject + */ reject( - collection: Array, - pluckValue: string): T[]; + collection: List|Dictionary, + predicate: string, + thisArg?: any + ): T[]; /** - * @see _.reject - * @param pluckValue _.pluck style callback - **/ - reject( - collection: List, - pluckValue: string): T[]; + * @see _.reject + */ + reject( + collection: List|Dictionary, + predicate: W + ): T[]; + } + interface LoDashImplicitWrapper { /** - * @see _.reject - * @param pluckValue _.pluck style callback - **/ - reject( - collection: Dictionary, - pluckValue: string): T[]; - - /** - * @see _.reject - * @param whereValue _.where style callback - **/ - reject( - collection: Array, - whereValue: W): T[]; - - /** - * @see _.reject - * @param whereValue _.where style callback - **/ - reject( - collection: List, - whereValue: W): T[]; - - /** - * @see _.reject - * @param whereValue _.where style callback - **/ - reject( - collection: Dictionary, - whereValue: W): T[]; + * @see _.reject + */ + reject( + predicate?: StringIterator, + thisArg?: any + ): LoDashImplicitArrayWrapper; } interface LoDashImplicitArrayWrapper { /** - * @see _.reject - **/ + * @see _.reject + */ reject( - callback: ListIterator, - thisArg?: any): LoDashImplicitArrayWrapper; + predicate: ListIterator, + thisArg?: any + ): LoDashImplicitArrayWrapper; /** - * @see _.reject - * @param pluckValue _.pluck style callback - **/ - reject(pluckValue: string): LoDashImplicitArrayWrapper; + * @see _.reject + */ + reject( + predicate: string, + thisArg?: any + ): LoDashImplicitArrayWrapper; /** - * @see _.reject - * @param whereValue _.where style callback - **/ - reject(whereValue: W): LoDashImplicitArrayWrapper; + * @see _.reject + */ + reject(predicate: W): LoDashImplicitArrayWrapper; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.reject + */ + reject( + predicate: ListIterator|DictionaryIterator, + thisArg?: any + ): LoDashImplicitArrayWrapper; + + /** + * @see _.reject + */ + reject( + predicate: string, + thisArg?: any + ): LoDashImplicitArrayWrapper; + + /** + * @see _.reject + */ + reject(predicate: W): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.reject + */ + reject( + predicate?: StringIterator, + thisArg?: any + ): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.reject + */ + reject( + predicate: ListIterator, + thisArg?: any + ): LoDashExplicitArrayWrapper; + + /** + * @see _.reject + */ + reject( + predicate: string, + thisArg?: any + ): LoDashExplicitArrayWrapper; + + /** + * @see _.reject + */ + reject(predicate: W): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.reject + */ + reject( + predicate: ListIterator|DictionaryIterator, + thisArg?: any + ): LoDashExplicitArrayWrapper; + + /** + * @see _.reject + */ + reject( + predicate: string, + thisArg?: any + ): LoDashExplicitArrayWrapper; + + /** + * @see _.reject + */ + reject(predicate: W): LoDashExplicitArrayWrapper; } //_.sample @@ -6173,85 +7008,282 @@ declare module _ { sample(): LoDashImplicitWrapper; } + //_.select + interface LoDashStatic { + /** + * @see _.filter + */ + select( + collection: List, + predicate?: ListIterator, + thisArg?: any + ): T[]; + + /** + * @see _.filter + */ + select( + collection: Dictionary, + predicate?: DictionaryIterator, + thisArg?: any + ): T[]; + + /** + * @see _.filter + */ + select( + collection: string, + predicate?: StringIterator, + thisArg?: any + ): string[]; + + /** + * @see _.filter + */ + select( + collection: List|Dictionary, + predicate: string, + thisArg?: any + ): T[]; + + /** + * @see _.filter + */ + select( + collection: List|Dictionary, + predicate: W + ): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.filter + */ + select( + predicate?: StringIterator, + thisArg?: any + ): LoDashImplicitArrayWrapper; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.filter + */ + select( + predicate: ListIterator, + thisArg?: any + ): LoDashImplicitArrayWrapper; + + /** + * @see _.filter + */ + select( + predicate: string, + thisArg?: any + ): LoDashImplicitArrayWrapper; + + /** + * @see _.filter + */ + select(predicate: W): LoDashImplicitArrayWrapper; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.filter + */ + select( + predicate: ListIterator|DictionaryIterator, + thisArg?: any + ): LoDashImplicitArrayWrapper; + + /** + * @see _.filter + */ + select( + predicate: string, + thisArg?: any + ): LoDashImplicitArrayWrapper; + + /** + * @see _.filter + */ + select(predicate: W): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.filter + */ + select( + predicate?: StringIterator, + thisArg?: any + ): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.filter + */ + select( + predicate: ListIterator, + thisArg?: any + ): LoDashExplicitArrayWrapper; + + /** + * @see _.filter + */ + select( + predicate: string, + thisArg?: any + ): LoDashExplicitArrayWrapper; + + /** + * @see _.filter + */ + select(predicate: W): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.filter + */ + select( + predicate: ListIterator|DictionaryIterator, + thisArg?: any + ): LoDashExplicitArrayWrapper; + + /** + * @see _.filter + */ + select( + predicate: string, + thisArg?: any + ): LoDashExplicitArrayWrapper; + + /** + * @see _.filter + */ + select(predicate: W): LoDashExplicitArrayWrapper; + } + //_.shuffle interface LoDashStatic { /** - * Creates an array of shuffled values, using a version of the Fisher-Yates shuffle. - * See http://en.wikipedia.org/wiki/Fisher-Yates_shuffle. - * @param collection The collection to shuffle. - * @return Returns a new shuffled collection. - **/ - shuffle(collection: Array): T[]; + * Creates an array of shuffled values, using a version of the Fisher-Yates shuffle. + * + * @param collection The collection to shuffle. + * @return Returns the new shuffled array. + */ + shuffle(collection: List|Dictionary): T[]; /** - * @see _.shuffle - **/ - shuffle(collection: List): T[]; + * @see _.shuffle + */ + shuffle(collection: string): string[]; + } + interface LoDashImplicitWrapper { /** - * @see _.shuffle - **/ - shuffle(collection: Dictionary): T[]; + * @see _.shuffle + */ + shuffle(): LoDashImplicitArrayWrapper; } interface LoDashImplicitArrayWrapper { /** * @see _.shuffle - **/ + */ shuffle(): LoDashImplicitArrayWrapper; } interface LoDashImplicitObjectWrapper { /** * @see _.shuffle - **/ - shuffle(): LoDashImplicitArrayWrapper; + */ + shuffle(): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.shuffle + */ + shuffle(): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.shuffle + */ + shuffle(): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.shuffle + */ + shuffle(): LoDashExplicitArrayWrapper; } //_.size interface LoDashStatic { /** - * Gets the size of the collection by returning collection.length for arrays and array-like - * objects or the number of own enumerable properties for objects. - * @param collection The collection to inspect. - * @return collection.length - **/ - size(collection: Array): number; + * Gets the size of collection by returning its length for array-like values or the number of own enumerable + * properties for objects. + * + * @param collection The collection to inspect. + * @return Returns the size of collection. + */ + size(collection: List|Dictionary): number; /** - * @see _.size - **/ - size(collection: List): number; + * @see _.size + */ + size(collection: string): number; + } + interface LoDashImplicitWrapper { /** - * @see _.size - * @param object The object to inspect - * @return The number of own enumerable properties. - **/ - size(object: T): number; - - /** - * @see _.size - * @param aString The string to inspect - * @return The length of aString - **/ - size(aString: string): number; + * @see _.size + */ + size(): number; } interface LoDashImplicitArrayWrapper { /** * @see _.size - **/ + */ size(): number; } interface LoDashImplicitObjectWrapper { /** * @see _.size - **/ + */ size(): number; } + interface LoDashExplicitWrapper { + /** + * @see _.size + */ + size(): LoDashExplicitWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.size + */ + size(): LoDashExplicitWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.size + */ + size(): LoDashExplicitWrapper; + } + //_.some interface LoDashStatic { /** @@ -6779,41 +7811,64 @@ declare module _ { //_.after interface LoDashStatic { /** - * Creates a function that executes func, with the this binding and arguments of the - * created function, only after being called n times. - * @param n The number of times the function must be called before func is executed. - * @param func The function to restrict. - * @return The new restricted function. - **/ - after( + * The opposite of _.before; this method creates a function that invokes func once it’s called n or more times. + * + * @param n The number of calls before func is invoked. + * @param func The function to restrict. + * @return Returns the new restricted function. + */ + after( n: number, - func: Function): Function; + func: TFunc + ): TFunc; } interface LoDashImplicitWrapper { /** * @see _.after **/ - after(func: Function): LoDashImplicitObjectWrapper; + after(func: TFunc): LoDashImplicitObjectWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.after + **/ + after(func: TFunc): LoDashExplicitObjectWrapper; } //_.ary interface LoDashStatic { /** * Creates a function that accepts up to n arguments ignoring any additional arguments. + * * @param func The function to cap arguments for. * @param n The arity cap. - * @param guard Enables use as a callback for functions like `_.map`. * @returns Returns the new function. */ - ary(func: Function, n?: number, guard?: Object): TResult; + ary( + func: Function, + n?: number + ): TResult; + + ary( + func: T, + n?: number + ): TResult; } interface LoDashImplicitObjectWrapper { /** * @see _.ary */ - ary(n?: number, guard?: Object): LoDashImplicitObjectWrapper; + ary(n?: number): LoDashImplicitObjectWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.ary + */ + ary(n?: number): LoDashExplicitObjectWrapper; } //_.backflow @@ -6827,10 +7882,17 @@ declare module _ { interface LoDashImplicitObjectWrapper { /** * @see _.flowRight - **/ + */ backflow(...funcs: Function[]): LoDashImplicitObjectWrapper; } + interface LoDashExplicitObjectWrapper { + /** + * @see _.flowRight + */ + backflow(...funcs: Function[]): LoDashExplicitObjectWrapper; + } + //_.before interface LoDashStatic { /** @@ -6941,6 +8003,13 @@ declare module _ { compose(...funcs: Function[]): LoDashImplicitObjectWrapper; } + interface LoDashExplicitObjectWrapper { + /** + * @see _.flowRight + */ + compose(...funcs: Function[]): LoDashExplicitObjectWrapper; + } + //_.createCallback interface LoDashStatic { /** @@ -7202,47 +8271,68 @@ declare module _ { //_.defer interface LoDashStatic { /** - * Defers executing the func function until the current call stack has cleared. Additional - * arguments will be provided to func when it is invoked. - * @param func The function to defer. - * @param args Arguments to invoke the function with. - * @return The timer id. - **/ - defer( - func: Function, - ...args: any[]): number; + * Defers invoking the func until the current call stack has cleared. Any additional arguments are provided to + * func when it’s invoked. + * + * @param func The function to defer. + * @param args The arguments to invoke the function with. + * @return Returns the timer id. + */ + defer( + func: T, + ...args: any[] + ): number; } interface LoDashImplicitObjectWrapper { /** - * @see _.defer - **/ + * @see _.defer + */ defer(...args: any[]): LoDashImplicitWrapper; } + interface LoDashExplicitObjectWrapper { + /** + * @see _.defer + */ + defer(...args: any[]): LoDashExplicitWrapper; + } + //_.delay interface LoDashStatic { /** - * Executes the func function after wait milliseconds. Additional arguments will be provided - * to func when it is invoked. - * @param func The function to delay. - * @param wait The number of milliseconds to delay execution. - * @param args Arguments to invoke the function with. - * @return The timer id. - **/ - delay( - func: Function, + * Invokes func after wait milliseconds. Any additional arguments are provided to func when it’s invoked. + * + * @param func The function to delay. + * @param wait The number of milliseconds to delay invocation. + * @param args The arguments to invoke the function with. + * @return Returns the timer id. + */ + delay( + func: T, wait: number, - ...args: any[]): number; + ...args: any[] + ): number; } interface LoDashImplicitObjectWrapper { /** - * @see _.delay - **/ + * @see _.delay + */ delay( wait: number, - ...args: any[]): LoDashImplicitWrapper; + ...args: any[] + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.delay + */ + delay( + wait: number, + ...args: any[] + ): LoDashExplicitWrapper; } //_.flow @@ -7268,6 +8358,9 @@ declare module _ { /** * This method is like _.flow except that it creates a function that invokes the provided functions from right * to left. + * + * @alias _.backflow, _.compose + * * @param funcs Functions to invoke. * @return Returns the new function. */ @@ -7277,10 +8370,18 @@ declare module _ { interface LoDashImplicitObjectWrapper { /** * @see _.flowRight - **/ + */ flowRight(...funcs: Function[]): LoDashImplicitObjectWrapper; } + interface LoDashExplicitObjectWrapper { + /** + * @see _.flowRight + */ + flowRight(...funcs: Function[]): LoDashExplicitObjectWrapper; + } + + //_.memoize interface MemoizedFunction extends Function { cache: MapCache; @@ -7312,6 +8413,7 @@ declare module _ { interface LoDashStatic { /** * Creates a function that runs each argument through a corresponding transform function. + * * @param func The function to wrap. * @param transforms The functions to transform arguments, specified as individual functions or arrays * of functions. @@ -7343,6 +8445,18 @@ declare module _ { modArgs(transforms: Function[]): LoDashImplicitObjectWrapper; } + interface LoDashExplicitObjectWrapper { + /** + * @see _.modArgs + */ + modArgs(...transforms: Function[]): LoDashExplicitObjectWrapper; + + /** + * @see _.modArgs + */ + modArgs(transforms: Function[]): LoDashExplicitObjectWrapper; + } + //_.negate interface LoDashStatic { /** @@ -7376,10 +8490,10 @@ declare module _ { /** * Creates a function that is restricted to invoking func once. Repeat calls to the function return the value * of the first call. The func is invoked with the this binding and arguments of the created function. + * * @param func The function to restrict. * @return Returns the new restricted function. */ - once(func: T): T; } @@ -7390,6 +8504,13 @@ declare module _ { once(): LoDashImplicitObjectWrapper; } + interface LoDashExplicitObjectWrapper { + /** + * @see _.once + */ + once(): LoDashExplicitObjectWrapper; + } + //_.partial interface LoDashStatic { /** @@ -7550,16 +8671,25 @@ declare module _ { /** * Creates a function that invokes func with the this binding of the created function and arguments from start * and beyond provided as an array. + * + * Note: This method is based on the rest parameter. + * * @param func The function to apply a rest parameter to. * @param start The start position of the rest parameter. * @return Returns the new function. */ - restParam(func: Function, start?: number): TResult; + restParam( + func: Function, + start?: number + ): TResult; /** * @see _.restParam */ - restParam(func: TFunc, start?: number): TResult; + restParam( + func: TFunc, + start?: number + ): TResult; } interface LoDashImplicitObjectWrapper { @@ -7569,6 +8699,13 @@ declare module _ { restParam(start?: number): LoDashImplicitObjectWrapper; } + interface LoDashExplicitObjectWrapper { + /** + * @see _.restParam + */ + restParam(start?: number): LoDashExplicitObjectWrapper; + } + //_.spread interface LoDashStatic { /** @@ -7589,41 +8726,62 @@ declare module _ { //_.throttle - interface LoDashStatic { - /** - * Creates a function that, when executed, will only call the func function at most once per - * every wait milliseconds. Provide an options object to indicate that func should be invoked - * on the leading and/or trailing edge of the wait timeout. Subsequent calls to the throttled - * function will return the result of the last func call. - * - * Note: If leading and trailing options are true func will be called on the trailing edge of - * the timeout only if the the throttled function is invoked more than once during the wait timeout. - * @param func The function to throttle. - * @param wait The number of milliseconds to throttle executions to. - * @param options The options object. - * @param options.leading Specify execution on the leading edge of the timeout. - * @param options.trailing Specify execution on the trailing edge of the timeout. - * @return The new throttled function. - **/ - throttle( - func: T, - wait: number, - options?: ThrottleSettings): T; - } - interface ThrottleSettings { - /** - * If you'd like to disable the leading-edge call, pass this as false. - **/ + * If you'd like to disable the leading-edge call, pass this as false. + */ leading?: boolean; /** - * If you'd like to disable the execution on the trailing-edge, pass false. - **/ + * If you'd like to disable the execution on the trailing-edge, pass false. + */ trailing?: boolean; } + interface LoDashStatic { + /** + * Creates a throttled function that only invokes func at most once per every wait milliseconds. The throttled + * function comes with a cancel method to cancel delayed invocations. Provide an options object to indicate + * that func should be invoked on the leading and/or trailing edge of the wait timeout. Subsequent calls to + * the throttled function return the result of the last func call. + * + * Note: If leading and trailing options are true, func is invoked on the trailing edge of the timeout only if + * the the throttled function is invoked more than once during the wait timeout. + * + * @param func The function to throttle. + * @param wait The number of milliseconds to throttle invocations to. + * @param options The options object. + * @param options.leading Specify invoking on the leading edge of the timeout. + * @param options.trailing Specify invoking on the trailing edge of the timeout. + * @return Returns the new throttled function. + */ + throttle( + func: T, + wait?: number, + options?: ThrottleSettings + ): T & Cancelable; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.throttle + */ + throttle( + wait?: number, + options?: ThrottleSettings + ): LoDashImplicitObjectWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.throttle + */ + throttle( + wait?: number, + options?: ThrottleSettings + ): LoDashExplicitObjectWrapper; + } + //_.wrap interface LoDashStatic { /** @@ -7796,42 +8954,75 @@ declare module _ { ): boolean; } + interface LoDashExplicitWrapperBase { + /** + * @see _.isEqual + */ + eq( + other: any, + customizer?: IsEqualCustomizer, + thisArg?: any + ): LoDashExplicitWrapper; + } + //_.gt interface LoDashStatic { /** * Checks if value is greater than other. + * * @param value The value to compare. * @param other The other value to compare. * @return Returns true if value is greater than other, else false. */ - gt(value: any, other: any): boolean; + gt( + value: any, + other: any + ): boolean; } - interface LoDashImplicitWrapperBase { + interface LoDashImplicitWrapperBase { /** * @see _.gt */ gt(other: any): boolean; } + interface LoDashExplicitWrapperBase { + /** + * @see _.gt + */ + gt(other: any): LoDashExplicitWrapper; + } + //_.gte interface LoDashStatic { /** * Checks if value is greater than or equal to other. + * * @param value The value to compare. * @param other The other value to compare. * @return Returns true if value is greater than or equal to other, else false. */ - gte(value: any, other: any): boolean; + gte( + value: any, + other: any + ): boolean; } - interface LoDashImplicitWrapperBase { + interface LoDashImplicitWrapperBase { /** * @see _.gte */ gte(other: any): boolean; } + interface LoDashExplicitWrapperBase { + /** + * @see _.gte + */ + gte(other: any): LoDashExplicitWrapper; + } + //_.isArguments interface LoDashStatic { /** @@ -7904,6 +9095,7 @@ declare module _ { interface LoDashStatic { /** * Checks if value is a DOM element. + * * @param value The value to check. * @return Returns true if value is a DOM element, else false. */ @@ -7917,6 +9109,13 @@ declare module _ { isElement(): boolean; } + interface LoDashExplicitWrapperBase { + /** + * @see _.isElement + */ + isElement(): LoDashExplicitWrapper; + } + //_.isEmpty interface LoDashStatic { /** @@ -7978,6 +9177,17 @@ declare module _ { ): boolean; } + interface LoDashExplicitWrapperBase { + /** + * @see _.isEqual + */ + isEqual( + other: any, + customizer?: IsEqualCustomizer, + thisArg?: any + ): LoDashExplicitWrapper; + } + //_.isError interface LoDashStatic { /** @@ -8097,9 +9307,10 @@ declare module _ { interface LoDashStatic { /** * Checks if value is null. + * * @param value The value to check. * @return Returns true if value is null, else false. - **/ + */ isNull(value?: any): boolean; } @@ -8110,6 +9321,13 @@ declare module _ { isNull(): boolean; } + interface LoDashExplicitWrapperBase { + /** + * see _.isNull + */ + isNull(): LoDashExplicitWrapper; + } + //_.isNumber interface LoDashStatic { /** @@ -8205,6 +9423,7 @@ declare module _ { interface LoDashStatic { /** * Checks if value is classified as a typed array. + * * @param value The value to check. * @return Returns true if value is correctly classified, else false. */ @@ -8218,6 +9437,13 @@ declare module _ { isTypedArray(): boolean; } + interface LoDashExplicitWrapperBase { + /** + * see _.isTypedArray + */ + isTypedArray(): LoDashExplicitWrapper; + } + //_.isUndefined interface LoDashStatic { /** @@ -8239,38 +9465,60 @@ declare module _ { interface LoDashStatic { /** * Checks if value is less than other. + * * @param value The value to compare. * @param other The other value to compare. * @return Returns true if value is less than other, else false. */ - lt(value: any, other: any): boolean; + lt( + value: any, + other: any + ): boolean; } - interface LoDashImplicitWrapperBase { + interface LoDashImplicitWrapperBase { /** * @see _.lt */ lt(other: any): boolean; } + interface LoDashExplicitWrapperBase { + /** + * @see _.lt + */ + lt(other: any): LoDashExplicitWrapper; + } + //_.lte interface LoDashStatic { /** * Checks if value is less than or equal to other. + * * @param value The value to compare. * @param other The other value to compare. * @return Returns true if value is less than or equal to other, else false. */ - lte(value: any, other: any): boolean; + lte( + value: any, + other: any + ): boolean; } - interface LoDashImplicitWrapperBase { + interface LoDashImplicitWrapperBase { /** * @see _.lte */ lte(other: any): boolean; } + interface LoDashExplicitWrapperBase { + /** + * @see _.lte + */ + lte(other: any): LoDashExplicitWrapper; + } + //_.toArray interface LoDashStatic { /** @@ -8922,195 +10170,191 @@ declare module _ { **********/ //_.assign + interface AssignCustomizer { + (objectValue: any, sourceValue: any, key?: string, object?: {}, source?: {}): any; + } + interface LoDashStatic { /** - * Assigns own enumerable properties of source object(s) to the destination object. Subsequent - * sources will overwrite property assignments of previous sources. If a callback is provided - * it will be executed to produce the assigned values. The callback is bound to thisArg and - * invoked with two arguments; (objectValue, sourceValue). - * @param object The destination object. - * @param s1-8 The source object(s) - * @param callback The function to customize merging properties. - * @param thisArg The this binding of callback. - * @return The destination object. - **/ - assign( - object: T, - s1: S1, - callback?: (objectValue: Value, sourceValue: Value) => Value, - thisArg?: any): Result; + * Assigns own enumerable properties of source object(s) to the destination object. Subsequent sources + * overwrite property assignments of previous sources. If customizer is provided it’s invoked to produce the + * assigned values. The customizer is bound to thisArg and invoked with five arguments: + * (objectValue, sourceValue, key, object, source). + * + * Note: This method mutates object and is based on Object.assign. + * + * @alias _.extend + * + * @param object The destination object. + * @param source The source objects. + * @param customizer The function to customize assigned values. + * @param thisArg The this binding of callback. + * @return The destination object. + */ + assign( + object: TObject, + source: TSource, + customizer?: AssignCustomizer, + thisArg?: any + ): TResult; /** - * @see _.assign - **/ - assign( - object: T, - s1: S1, - s2: S2, - callback?: (objectValue: Value, sourceValue: Value) => Value, - thisArg?: any): Result; + * @see assign + */ + assign( + object: TObject, + source1: TSource1, + source2: TSource2, + customizer?: AssignCustomizer, + thisArg?: any + ): TResult; /** - * @see _.assign - **/ - assign( - object: T, - s1: S1, - s2: S2, - s3: S3, - callback?: (objectValue: Value, sourceValue: Value) => Value, - thisArg?: any): Result; + * @see assign + */ + assign( + object: TObject, + source1: TSource1, + source2: TSource2, + source3: TSource3, + customizer?: AssignCustomizer, + thisArg?: any + ): TResult; /** - * @see _.assign - **/ - assign( - object: T, - s1: S1, - s2: S2, - s3: S3, - s4: S4, - callback?: (objectValue: Value, sourceValue: Value) => Value, - thisArg?: any): Result; + * @see assign + */ + assign + ( + object: TObject, + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4, + customizer?: AssignCustomizer, + thisArg?: any + ): TResult; /** - * @see _.assign - **/ - extend( - object: T, - s1: S1, - callback?: (objectValue: Value, sourceValue: Value) => Value, - thisArg?: any): Result; + * @see _.assign + */ + assign(object: TObject): TObject; /** - * @see _.assign - **/ - extend( - object: T, - s1: S1, - s2: S2, - callback?: (objectValue: Value, sourceValue: Value) => Value, - thisArg?: any): Result; - - /** - * @see _.assign - **/ - extend( - object: T, - s1: S1, - s2: S2, - s3: S3, - callback?: (objectValue: Value, sourceValue: Value) => Value, - thisArg?: any): Result; - - /** - * @see _.assign - **/ - extend( - object: T, - s1: S1, - s2: S2, - s3: S3, - s4: S4, - callback?: (objectValue: Value, sourceValue: Value) => Value, - thisArg?: any): Result; + * @see _.assign + */ + assign( + object: TObject, ...otherArgs: any[] + ): TResult; } interface LoDashImplicitObjectWrapper { /** - * @see _.assign - **/ - assign( - s1: S1, - callback?: (objectValue: Value, sourceValue: Value) => Value, - thisArg?: any): TResult; + * @see _.assign + */ + assign( + source: TSource, + customizer?: AssignCustomizer, + thisArg?: any + ): LoDashImplicitObjectWrapper; /** - * @see _.assign - **/ - assign( - s1: S1, - s2: S2, - callback?: (objectValue: Value, sourceValue: Value) => Value, - thisArg?: any): TResult; - /** - * @see _.assign - **/ - assign( - s1: S1, - s2: S2, - s3: S3, - callback?: (objectValue: Value, sourceValue: Value) => Value, - thisArg?: any): TResult; - /** - * @see _.assign - **/ - assign( - s1: S1, - s2: S2, - s3: S3, - s4: S4, - callback?: (objectValue: Value, sourceValue: Value) => Value, - thisArg?: any): TResult; - /** - * @see _.assign - **/ - assign( - s1: S1, - s2: S2, - s3: S3, - s4: S4, - s5: S5, - callback?: (objectValue: Value, sourceValue: Value) => Value, - thisArg?: any): TResult; + * @see assign + */ + assign( + source1: TSource1, + source2: TSource2, + customizer?: AssignCustomizer, + thisArg?: any + ): LoDashImplicitObjectWrapper; /** - * @see _.assign - **/ - extend( - s1: S1, - callback?: (objectValue: Value, sourceValue: Value) => Value, - thisArg?: any): TResult; + * @see assign + */ + assign( + source1: TSource1, + source2: TSource2, + source3: TSource3, + customizer?: AssignCustomizer, + thisArg?: any + ): LoDashImplicitObjectWrapper; /** - * @see _.assign - **/ - extend( - s1: S1, - s2: S2, - callback?: (objectValue: Value, sourceValue: Value) => Value, - thisArg?: any): TResult; - /** - * @see _.assign - **/ - extend( - s1: S1, - s2: S2, - s3: S3, - callback?: (objectValue: Value, sourceValue: Value) => Value, - thisArg?: any): TResult; - /** - * @see _.assign - **/ - extend( - s1: S1, - s2: S2, - s3: S3, - s4: S4, - callback?: (objectValue: Value, sourceValue: Value) => Value, - thisArg?: any): TResult; - /** - * @see _.assign - **/ - extend( - s1: S1, - s2: S2, - s3: S3, - s4: S4, - s5: S5, - callback?: (objectValue: Value, sourceValue: Value) => Value, - thisArg?: any): TResult; + * @see assign + */ + assign( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4, + customizer?: AssignCustomizer, + thisArg?: any + ): LoDashImplicitObjectWrapper; + /** + * @see _.assign + */ + assign(): LoDashImplicitObjectWrapper; + + /** + * @see _.assign + */ + assign(...otherArgs: any[]): LoDashImplicitObjectWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.assign + */ + assign( + source: TSource, + customizer?: AssignCustomizer, + thisArg?: any + ): LoDashExplicitObjectWrapper; + + /** + * @see assign + */ + assign( + source1: TSource1, + source2: TSource2, + customizer?: AssignCustomizer, + thisArg?: any + ): LoDashExplicitObjectWrapper; + + /** + * @see assign + */ + assign( + source1: TSource1, + source2: TSource2, + source3: TSource3, + customizer?: AssignCustomizer, + thisArg?: any + ): LoDashExplicitObjectWrapper; + + /** + * @see assign + */ + assign( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4, + customizer?: AssignCustomizer, + thisArg?: any + ): LoDashExplicitObjectWrapper; + + /** + * @see _.assign + */ + assign(): LoDashExplicitObjectWrapper; + + /** + * @see _.assign + */ + assign(...otherArgs: any[]): LoDashExplicitObjectWrapper; } //_.create @@ -9135,23 +10379,170 @@ declare module _ { //_.defaults interface LoDashStatic { /** - * Assigns own enumerable properties of source object(s) to the destination object for all - * destination properties that resolve to undefined. Once a property is set, additional defaults - * of the same property will be ignored. - * @param object The destination object. - * @param sources The source objects. - * @return The destination object. - **/ - defaults( - object: T, - ...sources: any[]): TResult; + * Assigns own enumerable properties of source object(s) to the destination object for all destination + * properties that resolve to undefined. Once a property is set, additional values of the same property are + * ignored. + * + * Note: This method mutates object. + * + * @param object The destination object. + * @param sources The source objects. + * @return The destination object. + */ + defaults( + object: Obj, + ...sources: {}[] + ): TResult; + + /** + * @see _.defaults + */ + defaults( + object: Obj, + source1: S1, + ...sources: {}[] + ): TResult; + + /** + * @see _.defaults + */ + defaults( + object: Obj, + source1: S1, + source2: S2, + ...sources: {}[] + ): TResult; + + /** + * @see _.defaults + */ + defaults( + object: Obj, + source1: S1, + source2: S2, + source3: S3, + ...sources: {}[] + ): TResult; + + /** + * @see _.defaults + */ + defaults( + object: Obj, + source1: S1, + source2: S2, + source3: S3, + source4: S4, + ...sources: {}[] + ): TResult; + + /** + * @see _.defaults + */ + defaults( + object: {}, + ...sources: {}[] + ): TResult; } interface LoDashImplicitObjectWrapper { /** - * @see _.defaults - **/ - defaults(...sources: any[]): LoDashImplicitObjectWrapper + * @see _.defaults + */ + defaults( + source1: S1, + ...sources: {}[] + ): LoDashImplicitObjectWrapper; + + /** + * @see _.defaults + */ + defaults( + source1: S1, + source2: S2, + ...sources: {}[] + ): LoDashImplicitObjectWrapper; + + /** + * @see _.defaults + */ + defaults( + source1: S1, + source2: S2, + source3: S3, + ...sources: {}[] + ): LoDashImplicitObjectWrapper; + + /** + * @see _.defaults + */ + defaults( + source1: S1, + source2: S2, + source3: S3, + source4: S4, + ...sources: {}[] + ): LoDashImplicitObjectWrapper; + + /** + * @see _.defaults + */ + defaults(): LoDashImplicitObjectWrapper; + + /** + * @see _.defaults + */ + defaults(...sources: {}[]): LoDashImplicitObjectWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.defaults + */ + defaults( + source1: S1, + ...sources: {}[] + ): LoDashExplicitObjectWrapper; + + /** + * @see _.defaults + */ + defaults( + source1: S1, + source2: S2, + ...sources: {}[] + ): LoDashExplicitObjectWrapper; + + /** + * @see _.defaults + */ + defaults( + source1: S1, + source2: S2, + source3: S3, + ...sources: {}[] + ): LoDashExplicitObjectWrapper; + + /** + * @see _.defaults + */ + defaults( + source1: S1, + source2: S2, + source3: S3, + source4: S4, + ...sources: {}[] + ): LoDashExplicitObjectWrapper; + + /** + * @see _.defaults + */ + defaults(): LoDashExplicitObjectWrapper; + + /** + * @see _.defaults + */ + defaults(...sources: {}[]): LoDashExplicitObjectWrapper; } //_.defaultsDeep @@ -9174,6 +10565,177 @@ declare module _ { defaultsDeep(...sources: any[]): LoDashImplicitObjectWrapper } + //_.extend + interface LoDashStatic { + /** + * @see assign + */ + extend( + object: TObject, + source: TSource, + customizer?: AssignCustomizer, + thisArg?: any + ): TResult; + + /** + * @see assign + */ + extend( + object: TObject, + source1: TSource1, + source2: TSource2, + customizer?: AssignCustomizer, + thisArg?: any + ): TResult; + + /** + * @see assign + */ + extend( + object: TObject, + source1: TSource1, + source2: TSource2, + source3: TSource3, + customizer?: AssignCustomizer, + thisArg?: any + ): TResult; + + /** + * @see assign + */ + extend + ( + object: TObject, + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4, + customizer?: AssignCustomizer, + thisArg?: any + ): TResult; + + /** + * @see _.assign + */ + extend(object: TObject): TObject; + + /** + * @see _.assign + */ + extend( + object: TObject, ...otherArgs: any[] + ): TResult; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.assign + */ + extend( + source: TSource, + customizer?: AssignCustomizer, + thisArg?: any + ): LoDashImplicitObjectWrapper; + + /** + * @see assign + */ + extend( + source1: TSource1, + source2: TSource2, + customizer?: AssignCustomizer, + thisArg?: any + ): LoDashImplicitObjectWrapper; + + /** + * @see assign + */ + extend( + source1: TSource1, + source2: TSource2, + source3: TSource3, + customizer?: AssignCustomizer, + thisArg?: any + ): LoDashImplicitObjectWrapper; + + /** + * @see assign + */ + extend( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4, + customizer?: AssignCustomizer, + thisArg?: any + ): LoDashImplicitObjectWrapper; + + /** + * @see _.assign + */ + extend(): LoDashImplicitObjectWrapper; + + /** + * @see _.assign + */ + extend(...otherArgs: any[]): LoDashImplicitObjectWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.assign + */ + extend( + source: TSource, + customizer?: AssignCustomizer, + thisArg?: any + ): LoDashExplicitObjectWrapper; + + /** + * @see assign + */ + extend( + source1: TSource1, + source2: TSource2, + customizer?: AssignCustomizer, + thisArg?: any + ): LoDashExplicitObjectWrapper; + + /** + * @see assign + */ + extend( + source1: TSource1, + source2: TSource2, + source3: TSource3, + customizer?: AssignCustomizer, + thisArg?: any + ): LoDashExplicitObjectWrapper; + + /** + * @see assign + */ + extend( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4, + customizer?: AssignCustomizer, + thisArg?: any + ): LoDashExplicitObjectWrapper; + + /** + * @see _.assign + */ + extend(): LoDashExplicitObjectWrapper; + + /** + * @see _.assign + */ + extend(...otherArgs: any[]): LoDashExplicitObjectWrapper; + } + //_.findKey interface LoDashStatic { /** @@ -9260,6 +10822,39 @@ declare module _ { ): string; } + interface LoDashExplicitObjectWrapper { + /** + * @see _.findKey + */ + findKey( + predicate?: DictionaryIterator, + thisArg?: any + ): LoDashExplicitWrapper; + + /** + * @see _.findKey + */ + findKey( + predicate?: ObjectIterator, + thisArg?: any + ): LoDashExplicitWrapper; + + /** + * @see _.findKey + */ + findKey( + predicate?: string, + thisArg?: any + ): LoDashExplicitWrapper; + + /** + * @see _.findKey + */ + findKey>( + predicate?: TWhere + ): LoDashExplicitWrapper; + } + //_.findLastKey interface LoDashStatic { /** @@ -9345,165 +10940,252 @@ declare module _ { ): string; } + interface LoDashExplicitObjectWrapper { + /** + * @see _.findLastKey + */ + findLastKey( + predicate?: DictionaryIterator, + thisArg?: any + ): LoDashExplicitWrapper; + + /** + * @see _.findLastKey + */ + findLastKey( + predicate?: ObjectIterator, + thisArg?: any + ): LoDashExplicitWrapper; + + /** + * @see _.findLastKey + */ + findLastKey( + predicate?: string, + thisArg?: any + ): LoDashExplicitWrapper; + + /** + * @see _.findLastKey + */ + findLastKey>( + predicate?: TWhere + ): LoDashExplicitWrapper; + } + //_.forIn interface LoDashStatic { /** - * Iterates over own and inherited enumerable properties of an object, executing the callback for - * each property. The callback is bound to thisArg and invoked with three arguments; (value, key, - * object). Callbacks may exit iteration early by explicitly returning false. - * @param object The object to iterate over. - * @param callback The function called per iteration. - * @param thisArg The this binding of callback. - * @return object - **/ + * Iterates over own and inherited enumerable properties of an object invoking iteratee for each property. The + * iteratee is bound to thisArg and invoked with three arguments: (value, key, object). Iteratee functions may + * exit iteration early by explicitly returning false. + * + * @param object The object to iterate over. + * @param iteratee The function invoked per iteration. + * @param thisArg The this binding of iteratee. + * @return Returns object. + */ forIn( object: Dictionary, - callback?: DictionaryIterator, - thisArg?: any): Dictionary; + iteratee?: DictionaryIterator, + thisArg?: any + ): Dictionary; /** - * @see _.forIn - **/ - forIn( + * @see _.forIn + */ + forIn( object: T, - callback?: ObjectIterator, - thisArg?: any): T; + iteratee?: ObjectIterator, + thisArg?: any + ): T; } interface LoDashImplicitObjectWrapper { /** - * @see _.forIn - **/ - forIn( - callback: ObjectIterator, - thisArg?: any): _.LoDashImplicitObjectWrapper; + * @see _.forIn + */ + forIn( + iteratee?: DictionaryIterator, + thisArg?: any + ): _.LoDashImplicitObjectWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.forIn + */ + forIn( + iteratee?: DictionaryIterator, + thisArg?: any + ): _.LoDashExplicitObjectWrapper; } //_.forInRight interface LoDashStatic { /** - * This method is like _.forIn except that it iterates over elements of a collection in the - * opposite order. - * @param object The object to iterate over. - * @param callback The function called per iteration. - * @param thisArg The this binding of callback. - * @return object - **/ - forInRight( + * This method is like _.forIn except that it iterates over properties of object in the opposite order. + * + * @param object The object to iterate over. + * @param iteratee The function invoked per iteration. + * @param thisArg The this binding of iteratee. + * @return Returns object. + */ + forInRight( object: Dictionary, - callback?: DictionaryIterator, - thisArg?: any): Dictionary; + iteratee?: DictionaryIterator, + thisArg?: any + ): Dictionary; /** - * @see _.forInRight - **/ + * @see _.forInRight + */ forInRight( object: T, - callback?: ObjectIterator, - thisArg?: any): T; + iteratee?: ObjectIterator, + thisArg?: any + ): T; } interface LoDashImplicitObjectWrapper { /** - * @see _.forInRight - **/ - forInRight( - callback: ObjectIterator, - thisArg?: any): _.LoDashImplicitObjectWrapper; + * @see _.forInRight + */ + forInRight( + iteratee?: DictionaryIterator, + thisArg?: any + ): _.LoDashImplicitObjectWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.forInRight + */ + forInRight( + iteratee?: DictionaryIterator, + thisArg?: any + ): _.LoDashExplicitObjectWrapper; } //_.forOwn interface LoDashStatic { /** - * Iterates over own enumerable properties of an object, executing the callback for each - * property. The callback is bound to thisArg and invoked with three arguments; (value, key, - * object). Callbacks may exit iteration early by explicitly returning false. - * @param object The object to iterate over. - * @param callback The function called per iteration. - * @param thisArg The this binding of callback. - * @return object - **/ - forOwn( + * Iterates over own enumerable properties of an object invoking iteratee for each property. The iteratee is + * bound to thisArg and invoked with three arguments: (value, key, object). Iteratee functions may exit + * iteration early by explicitly returning false. + * + * @param object The object to iterate over. + * @param iteratee The function invoked per iteration. + * @param thisArg The this binding of iteratee. + * @return Returns object. + */ + forOwn( object: Dictionary, - callback?: DictionaryIterator, - thisArg?: any): Dictionary; + iteratee?: DictionaryIterator, + thisArg?: any + ): Dictionary; /** - * @see _.forOwn - **/ + * @see _.forOwn + */ forOwn( object: T, - callback?: ObjectIterator, - thisArg?: any): T; + iteratee?: ObjectIterator, + thisArg?: any + ): T; } interface LoDashImplicitObjectWrapper { /** - * @see _.forOwn - **/ - forOwn( - callback: ObjectIterator, - thisArg?: any): _.LoDashImplicitObjectWrapper; + * @see _.forOwn + */ + forOwn( + iteratee?: DictionaryIterator, + thisArg?: any + ): _.LoDashImplicitObjectWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.forOwn + */ + forOwn( + iteratee?: DictionaryIterator, + thisArg?: any + ): _.LoDashExplicitObjectWrapper; } //_.forOwnRight interface LoDashStatic { /** - * This method is like _.forOwn except that it iterates over elements of a collection in the - * opposite order. - * @param object The object to iterate over. - * @param callback The function called per iteration. - * @param thisArg The this binding of callback. - * @return object - **/ - forOwnRight( + * This method is like _.forOwn except that it iterates over properties of object in the opposite order. + * + * @param object The object to iterate over. + * @param iteratee The function invoked per iteration. + * @param thisArg The this binding of iteratee. + * @return Returns object. + */ + forOwnRight( object: Dictionary, - callback?: DictionaryIterator, - thisArg?: any): Dictionary; + iteratee?: DictionaryIterator, + thisArg?: any + ): Dictionary; + /** - * @see _.forOwnRight - **/ + * @see _.forOwnRight + */ forOwnRight( object: T, - callback?: ObjectIterator, - thisArg?: any): T; + iteratee?: ObjectIterator, + thisArg?: any + ): T; } interface LoDashImplicitObjectWrapper { /** - * @see _.forOwnRight - **/ - forOwnRight( - callback: ObjectIterator, - thisArg?: any): _.LoDashImplicitObjectWrapper; + * @see _.forOwnRight + */ + forOwnRight( + iteratee?: DictionaryIterator, + thisArg?: any + ): _.LoDashImplicitObjectWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.forOwnRight + */ + forOwnRight( + iteratee?: DictionaryIterator, + thisArg?: any + ): _.LoDashExplicitObjectWrapper; } //_.functions interface LoDashStatic { /** - * Creates a sorted array of property names of all enumerable properties, own and inherited, of - * object that have function values. - * @param object The object to inspect. - * @return An array of property names that have function values. - **/ - functions(object: any): string[]; - - /** - * @see _functions - **/ - methods(object: any): string[]; + * Creates an array of function property names from all enumerable properties, own and inherited, of object. + * + * @alias _.methods + * + * @param object The object to inspect. + * @return Returns the new array of property names. + */ + functions(object: any): string[]; } interface LoDashImplicitObjectWrapper { /** - * @see _.functions - **/ + * @see _.functions + */ functions(): _.LoDashImplicitArrayWrapper; + } + interface LoDashExplicitObjectWrapper { /** - * @see _.functions - **/ - methods(): _.LoDashImplicitArrayWrapper; + * @see _.functions + */ + functions(): _.LoDashExplicitArrayWrapper; } //_.get @@ -9540,14 +11222,24 @@ declare module _ { * @param path The path to check. * @return Returns true if path is a direct property, else false. */ - has(object: any, path: string|number|boolean|Array): boolean; + has( + object: T, + path: StringRepresentable|StringRepresentable[] + ): boolean; } interface LoDashImplicitObjectWrapper { /** * @see _.has */ - has(path: string|number|boolean|Array): boolean; + has(path: StringRepresentable|StringRepresentable[]): boolean; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.has + */ + has(path: StringRepresentable|StringRepresentable[]): LoDashExplicitWrapper; } //_.invert @@ -9560,7 +11252,18 @@ declare module _ { * @param multiValue Allow multiple values per key. * @return Returns the new inverted object. */ - invert(object: T, multiValue?: boolean): TResult; + invert( + object: T, + multiValue?: boolean + ): TResult; + + /** + * @see _.invert + */ + invert( + object: Object, + multiValue?: boolean + ): TResult; } interface LoDashImplicitObjectWrapper { @@ -9570,38 +11273,65 @@ declare module _ { invert(multiValue?: boolean): LoDashImplicitObjectWrapper; } + interface LoDashExplicitObjectWrapper { + /** + * @see _.invert + */ + invert(multiValue?: boolean): LoDashExplicitObjectWrapper; + } + //_.keys interface LoDashStatic { /** - * Creates an array composed of the own enumerable property names of an object. - * @param object The object to inspect. - * @return An array of property names. - **/ + * Creates an array of the own enumerable property names of object. + * + * Note: Non-object values are coerced to objects. See the ES spec for more details. + * + * @param object The object to query. + * @return Returns the array of property names. + */ keys(object?: any): string[]; } interface LoDashImplicitObjectWrapper { /** - * @see _.keys - **/ - keys(): LoDashImplicitArrayWrapper + * @see _.keys + */ + keys(): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.keys + */ + keys(): LoDashExplicitArrayWrapper; } //_.keysIn interface LoDashStatic { /** * Creates an array of the own and inherited enumerable property names of object. + * + * Note: Non-object values are coerced to objects. + * * @param object The object to query. * @return An array of property names. - **/ + */ keysIn(object?: any): string[]; } interface LoDashImplicitObjectWrapper { /** * @see _.keysIn - **/ - keysIn(): LoDashImplicitArrayWrapper + */ + keysIn(): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.keysIn + */ + keysIn(): LoDashExplicitArrayWrapper; } //_.mapKeys @@ -9643,7 +11373,8 @@ declare module _ { */ mapKeys( object: List|Dictionary, - iteratee?: string + iteratee?: string, + thisArg?: any ): Dictionary; } @@ -9667,7 +11398,8 @@ declare module _ { * @see _.mapKeys */ mapKeys( - iteratee?: string + iteratee?: string, + thisArg?: any ): LoDashImplicitObjectWrapper>; } @@ -9691,10 +11423,61 @@ declare module _ { * @see _.mapKeys */ mapKeys( - iteratee?: string + iteratee?: string, + thisArg?: any ): LoDashImplicitObjectWrapper>; } + interface LoDashExplicitArrayWrapper { + /** + * @see _.mapKeys + */ + mapKeys( + iteratee?: ListIterator, + thisArg?: any + ): LoDashExplicitObjectWrapper>; + + /** + * @see _.mapKeys + */ + mapKeys( + iteratee?: TObject + ): LoDashExplicitObjectWrapper>; + + /** + * @see _.mapKeys + */ + mapKeys( + iteratee?: string, + thisArg?: any + ): LoDashExplicitObjectWrapper>; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.mapKeys + */ + mapKeys( + iteratee?: ListIterator|DictionaryIterator, + thisArg?: any + ): LoDashExplicitObjectWrapper>; + + /** + * @see _.mapKeys + */ + mapKeys( + iteratee?: TObject + ): LoDashExplicitObjectWrapper>; + + /** + * @see _.mapKeys + */ + mapKeys( + iteratee?: string, + thisArg?: any + ): LoDashExplicitObjectWrapper>; + } + //_.mapValues interface LoDashStatic { /** @@ -9874,6 +11657,28 @@ declare module _ { ): LoDashImplicitObjectWrapper; } + //_.methods + interface LoDashStatic { + /** + * @see _.functions + */ + methods(object: any): string[]; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.functions + */ + methods(): _.LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.functions + */ + methods(): _.LoDashExplicitArrayWrapper; + } + //_.omit interface LoDashStatic { /** @@ -9930,19 +11735,28 @@ declare module _ { //_.pairs interface LoDashStatic { /** - * Creates a two dimensional array of an object's key-value pairs, - * i.e. [[key1, value1], [key2, value2]]. - * @param object The object to inspect. - * @return Aew array of key-value pairs. - **/ - pairs(object?: any): any[][]; + * Creates a two dimensional array of the key-value pairs for object, e.g. [[key1, value1], [key2, value2]]. + * + * @param object The object to query. + * @return Returns the new array of key-value pairs. + */ + pairs(object?: T): any[][]; + + pairs(object?: T): TResult[][]; } interface LoDashImplicitObjectWrapper { /** - * @see _.pairs - **/ - pairs(): LoDashImplicitArrayWrapper; + * @see _.pairs + */ + pairs(): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.pairs + */ + pairs(): LoDashExplicitArrayWrapper; } //_.pick @@ -10034,18 +11848,37 @@ declare module _ { path: StringRepresentable|StringRepresentable[], value: any ): T; + + /** + * @see _.set + */ + set( + object: T, + path: StringRepresentable|StringRepresentable[], + value: V + ): T; } interface LoDashImplicitObjectWrapper { /** * @see _.set */ - set( + set( path: StringRepresentable|StringRepresentable[], - value: any + value: V ): LoDashImplicitObjectWrapper; } + interface LoDashExplicitObjectWrapper { + /** + * @see _.set + */ + set( + path: StringRepresentable|StringRepresentable[], + value: V + ): LoDashExplicitObjectWrapper; + } + //_.transform interface LoDashStatic { /** @@ -10141,35 +11974,51 @@ declare module _ { //_.values interface LoDashStatic { /** - * Creates an array of the own enumerable property values of object. - * @param object The object to query. - * @return Returns an array of property values. - **/ + * Creates an array of the own enumerable property values of object. + * + * @param object The object to query. + * @return Returns an array of property values. + */ values(object?: any): T[]; } interface LoDashImplicitObjectWrapper { /** - * @see _.values - **/ - values(): LoDashImplicitObjectWrapper; + * @see _.values + */ + values(): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.values + */ + values(): LoDashExplicitArrayWrapper; } //_.valuesIn interface LoDashStatic { /** - * Creates an array of the own and inherited enumerable property values of object. - * @param object The object to query. - * @return Returns the array of property values. - **/ + * Creates an array of the own and inherited enumerable property values of object. + * + * @param object The object to query. + * @return Returns the array of property values. + */ valuesIn(object?: any): T[]; } interface LoDashImplicitObjectWrapper { /** - * @see _.valuesIn - **/ - valuesIn(): LoDashImplicitObjectWrapper; + * @see _.valuesIn + */ + valuesIn(): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.valuesIn + */ + valuesIn(): LoDashExplicitArrayWrapper; } /********** @@ -11276,18 +13125,41 @@ declare module _ { /** * The opposite of _.method; this method creates a function that invokes the method at a given path on object. * Any additional arguments are provided to the invoked method. + * * @param object The object to query. * @param args The arguments to invoke the method with. * @return Returns the new function. */ - methodOf(object: Object, ...args: any[]): (path: string | any[]) => TResult; + methodOf( + object: TObject, + ...args: any[] + ): (path: StringRepresentable|StringRepresentable[]) => TResult; + + /** + * @see _.methodOf + */ + methodOf( + object: {}, + ...args: any[] + ): (path: StringRepresentable|StringRepresentable[]) => TResult; } interface LoDashImplicitObjectWrapper { /** * @see _.methodOf */ - methodOf(...args: any[]): LoDashImplicitObjectWrapper<(path: string | any[]) => TResult>; + methodOf( + ...args: any[] + ): LoDashImplicitObjectWrapper<(path: StringRepresentable|StringRepresentable[]) => TResult>; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.methodOf + */ + methodOf( + ...args: any[] + ): LoDashExplicitObjectWrapper<(path: StringRepresentable|StringRepresentable[]) => TResult>; } //_.mixin @@ -11403,13 +13275,14 @@ declare module _ { interface LoDashStatic { /** * Creates a function that returns the property value at path on a given object. + * * @param path The path of the property to get. * @return Returns the new function. */ - property(path: string|string[]): (obj: TObj) => TResult; + property(path: StringRepresentable|StringRepresentable[]): (obj: TObj) => TResult; } - interface LoDashImplicitStringWrapper { + interface LoDashImplicitWrapper { /** * @see _.property */ @@ -11423,6 +13296,20 @@ declare module _ { property(): LoDashImplicitObjectWrapper<(obj: TObj) => TResult>; } + interface LoDashExplicitWrapper { + /** + * @see _.property + */ + property(): LoDashExplicitObjectWrapper<(obj: TObj) => TResult>; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.property + */ + property(): LoDashExplicitObjectWrapper<(obj: TObj) => TResult>; + } + //_.propertyOf interface LoDashStatic { /** @@ -11455,6 +13342,7 @@ declare module _ { * Creates an array of numbers (positive and/or negative) progressing from start up to, but not including, end. * If end is not specified it’s set to start with start then set to 0. If end is less than start a zero-length * range is created unless a negative step is specified. + * * @param start The start of the range. * @param end The end of the range. * @param step The value to increment or decrement by. @@ -11463,14 +13351,16 @@ declare module _ { range( start: number, end: number, - step?: number): number[]; + step?: number + ): number[]; /** * @see _.range */ range( end: number, - step?: number): number[]; + step?: number + ): number[]; } interface LoDashImplicitWrapper { @@ -11479,7 +13369,18 @@ declare module _ { */ range( end?: number, - step?: number): LoDashImplicitArrayWrapper; + step?: number + ): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.range + */ + range( + end?: number, + step?: number + ): LoDashExplicitArrayWrapper; } //_.runInContext @@ -11557,6 +13458,7 @@ declare module _ { interface LoDashStatic { /** * Generates a unique ID. If prefix is provided the ID is appended to it. + * * @param prefix The value to prefix the ID with. * @return Returns the unique ID. */ @@ -11570,6 +13472,13 @@ declare module _ { uniqueId(): string; } + interface LoDashExplicitWrapper { + /** + * @see _.uniqueId + */ + uniqueId(): LoDashExplicitWrapper; + } + interface ListIterator { (value: T, index: number, collection: List): TResult; } @@ -11615,6 +13524,10 @@ declare module _ { interface StringRepresentable { toString(): string; } + + interface Cancelable { + cancel(): void; + } } declare module "lodash" { diff --git a/loglevel/loglevel-tests.ts b/loglevel/loglevel-tests.ts index 2c4f89733..ab1993956 100644 --- a/loglevel/loglevel-tests.ts +++ b/loglevel/loglevel-tests.ts @@ -13,8 +13,15 @@ log.setLevel(0, false); log.setLevel("error"); log.setLevel("error", false); -log.setLevel(log.levels.WARN); -log.setLevel(log.levels.WARN, false); +log.setLevel(LogLevel.WARN); +log.setLevel(LogLevel.WARN, false); + +var logLevel = log.getLevel(); + +var testLogger = log.getLogger("TestLogger"); + +testLogger.setLevel(logLevel); +testLogger.warn("logging test"); var logging = log.noConflict(); diff --git a/loglevel/loglevel.d.ts b/loglevel/loglevel.d.ts index 9f3c53f5a..33dd8cd63 100644 --- a/loglevel/loglevel.d.ts +++ b/loglevel/loglevel.d.ts @@ -1,101 +1,144 @@ -// Type definitions for loglevel 1.3.1 +// Type definitions for loglevel 1.4.0 // Project: https://github.com/pimterry/loglevel -// Definitions by: Stefan Profanter +// Definitions by: Stefan Profanter , Florian Wagner // Definitions: https://github.com/borisyankov/DefinitelyTyped -declare module loglevel { - - /** - * Log levels - */ - export enum levels { - TRACE = 0, - DEBUG = 1, - INFO = 2, - WARN = 3, - ERROR = 4, - SILENT = 5 - } - - /** - * Output trace message to console. - * This will also include a full stack trace - * - * @param msg any data to log to the console - */ - export function trace(msg:any):void; - - /** - * Output debug message to console including appropriate icons - * - * @param msg any data to log to the console - */ - export function debug(msg:any):void; - - /** - * Output info message to console including appropriate icons - * - * @param msg any data to log to the console - */ - export function info(msg:any):void; - - /** - * Output warn message to console including appropriate icons - * - * @param msg any data to log to the console - */ - export function warn(msg:any):void; - - /** - * Output error message to console including appropriate icons - * - * @param msg any data to log to the console - */ - export function error(msg:any):void; - - - /** - * This disables all logging below the given level, so that after a log.setLevel("warn") call log.warn("something") - * or log.error("something") will output messages, but log.info("something") will not. - * - * @param level 0=trace to 5=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. - */ - export function setLevel(level:number, persist?:boolean):void; - - - /** - * This disables all logging below the given level, so that after a log.setLevel("warn") call log.warn("something") - * or log.error("something") will output messages, but log.info("something") will not. - * - * @param level as a string, like 'error' (case-insensitive) - * @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. - */ - export function setLevel(level:string, persist?:boolean):void; - - - /** - * This disables all logging below the given level, so that after a log.setLevel("warn") call log.warn("something") - * or log.error("something") will output messages, but log.info("something") will not. - * - * @param level as the value from the enum - * @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. - */ - export function setLevel(level:levels, persist?:boolean):void; - - /** - * If you're using another JavaScript library that exposes a 'log' global, you can run into conflicts with loglevel. - * Similarly to jQuery, you can solve this by putting loglevel into no-conflict mode immediately after it is loaded - * onto the page. This resets to 'log' global to its value before loglevel was loaded (typically undefined), and - * returns the loglevel object, which you can then bind to another name yourself. - */ - export function noConflict():any; +/** + * Log levels + */ +declare const enum LogLevel { + TRACE = 0, + DEBUG = 1, + INFO = 2, + WARN = 3, + ERROR = 4, + SILENT = 5 } -declare var log:typeof loglevel; +interface Log { + + /** + * Output trace message to console. + * This will also include a full stack trace + * + * @param msg any data to log to the console + */ + trace(...msg : any[]):void; + + /** + * Output debug message to console including appropriate icons + * + * @param msg any data to log to the console + */ + debug(...msg : any[]):void; + + /** + * Output info message to console including appropriate icons + * + * @param msg any data to log to the console + */ + info(...msg : any[]):void; + + /** + * Output warn message to console including appropriate icons + * + * @param msg any data to log to the console + */ + warn(...msg : any[]):void; + + /** + * Output error message to console including appropriate icons + * + * @param msg any data to log to the console + */ + error(...msg : any[]):void; + + + /** + * This disables all logging below the given level, so that after a log.setLevel("warn") call log.warn("something") + * or log.error("something") will output messages, but log.info("something") will not. + * + * @param level 0=trace to 5=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. + */ + setLevel(level : LogLevel, persist? : boolean):void; + + + /** + * This disables all logging below the given level, so that after a log.setLevel("warn") call log.warn("something") + * or log.error("something") will output messages, but log.info("something") will not. + * + * @param level as a string, like 'error' (case-insensitive) + * @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. + */ + setLevel(level : string, persist? : boolean):void; + + + /** + * This disables all logging below the given level, so that after a log.setLevel("warn") call log.warn("something") + * or log.error("something") will output messages, but log.info("something") will not. + * + * @param level as the value from the enum + * @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. + */ + setLevel(level : LogLevel, persist? : boolean):void; + + /** + * If you're using another JavaScript library that exposes a 'log' global, you can run into conflicts with loglevel. + * Similarly to jQuery, you can solve this by putting loglevel into no-conflict mode immediately after it is loaded + * onto the page. This resets to 'log' global to its value before loglevel was loaded (typically undefined), and + * returns the loglevel object, which you can then bind to another name yourself. + */ + noConflict():any; + + /** + * Returns the current logging level, as a value from the enum. + * It's very unlikely you'll need to use this for normal application logging; it's provided partly to help plugin + * development, and partly to let you optimize logging code as below, where debug data is only generated if the + * level is set such that it'll actually be logged. This probably doesn't affect you, unless you've run profiling + * on your code and you have hard numbers telling you that your log data generation is a real performance problem. + */ + getLevel():LogLevel; + + /** + * This sets the current log level only if one has not been persisted and can’t be loaded. This is useful when + * initializing scripts; if a developer or user has previously called setLevel(), this won’t alter their settings. + * For example, your application might set the log level to error in a production environment, but when debugging + * an issue, you might call setLevel("trace") on the console to see all the logs. If that error setting was set + * using setDefaultLevel(), it will still say as trace on subsequent page loads and refreshes instead of resetting + * to error. + * + * The level argument takes is the same values that you might pass to setLevel(). Levels set using + * setDefaultLevel() never persist to subsequent page loads. + * + * @param level as the value from the enum + */ + setDefaultLevel(level : LogLevel):void; + + /** + * This gets you a new logger object that works exactly like the root log object, but can have its level and + * logging methods set independently. All loggers must have a name (which is a non-empty string). Calling + * getLogger() multiple times with the same name will return an identical logger object. + * In large applications, it can be incredibly useful to turn logging on and off for particular modules as you are + * working with them. Using the getLogger() method lets you create a separate logger for each part of your + * application with its own logging level. Likewise, for small, independent modules, using a named logger instead + * of the default root logger allows developers using your module to selectively turn on deep, trace-level logging + * when trying to debug problems, while logging only errors or silencing logging altogether under normal + * circumstances. + * @param name The name of the produced logger + */ + getLogger(name : String):Log; + +} + +declare var log : Log; + +declare module "loglevel" { + export = log; +} diff --git a/long/long-tests.ts b/long/long-tests.ts index f70835f66..928cc9453 100644 --- a/long/long-tests.ts +++ b/long/long-tests.ts @@ -2,7 +2,7 @@ import Long = require("long"); -var val: dcodeIO.Long; +var val: Long; var n: number = 42; var b: boolean = true; var s: string = "1337"; diff --git a/long/long.d.ts b/long/long.d.ts index 32d773b9d..492dc3362 100644 --- a/long/long.d.ts +++ b/long/long.d.ts @@ -1,75 +1,352 @@ -// Type definitions for Long.js v2.2.5 -// Project: https://github.com/dcodeIO/Long.js +// Type definitions for long.js 3.0.2 +// Project: https://github.com/dcodeIO/long.js // Definitions by: Peter Kooijmans // Definitions: https://github.com/borisyankov/DefinitelyTyped +// Definitions by: Denis Cappellin -declare module dcodeIO { - interface LongStatic { - new (low: number, high?: number, unsigned?: boolean): Long; +declare class Long +{ + /** + * Constructs a 64 bit two's-complement integer, given its low and high 32 bit values as signed integers. See the from* functions below for more convenient ways of constructing Longs. + */ + constructor( low: number, high?: number, unsigned?: boolean ); - MAX_UNSIGNED_VALUE: Long; - MAX_VALUE: Long; - MIN_VALUE: Long; - NEG_ONE: Long; - ONE: Long; - UONE: Long; - UZERO: Long; - ZERO: Long; + /** + * Maximum unsigned value. + */ + static MAX_UNSIGNED_VALUE: Long; - fromBits(lowBits: number, highBits: number, unsigned?: boolean): Long; - fromInt(value: number, unsigned?: boolean): Long; - fromNumber(value: number, unsigned?: boolean): Long; - fromString(str: string, unsigned?: boolean | number, radix?: number): Long; - fromValue(val: Long | number | string): Long; - isLong(obj: any): boolean; - } + /** + * Maximum signed value. + */ + static MAX_VALUE: Long; - interface Long { - high: number; - low: number; - unsigned: boolean; + /** + * Minimum signed value. + */ + static MIN_VALUE: Long; - add(other: Long | number | string): Long; - and(other: Long | number | string): Long; - compare(other: Long | number | string): number; - div(divisor: Long | number | string): Long; - equals(other: Long | number | string): boolean; - getHighBits(): number; - getHighBitsUnsigned(): number; - getLowBits(): number; - getLowBitsUnsigned(): number; - getNumBitsAbs(): number; - greaterThan(other: Long | number | string): boolean; - greaterThanOrEqual(other: Long | number | string): boolean; - isEven(): boolean; - isNegative(): boolean; - isOdd(): boolean; - isPositive(): boolean; - isZero(): boolean; - lessThan(other: Long | number | string): boolean; - lessThanOrEqual(other: Long | number | string): boolean; - modulo(divisor: Long | number | string): Long; - multiply(multiplier: Long | number | string): Long; - negate(): Long; - not(): Long; - notEquals(other: Long | number | string): boolean; - or(other: Long | number | string): Long; - shiftLeft(numBits: number | Long): Long; - shiftRight(numBits: number | Long): Long; - shiftRightUnsigned(numBits: number | Long): Long; - subtract(other: Long | number | string): Long; - toInt(): number; - toNumber(): number; - toSigned(): Long; - toString(radix?: number): string; - toUnsigned(): Long; - xor(other: Long | number | string): Long; - } + /** + * Signed negative one. + */ + static NEG_ONE: Long; - export var Long: LongStatic; + /** + * Signed one. + */ + static ONE: Long; + + /** + * Unsigned one. + */ + static UONE: Long; + + /** + * Unsigned zero. + */ + static UZERO: Long; + + /** + * Signed zero + */ + static ZERO: Long; + + /** + * The high 32 bits as a signed value. + */ + high: number; + + /** + * The low 32 bits as a signed value. + */ + low: number; + + /** + * Whether unsigned or not. + */ + unsigned: boolean; + + /** + * Returns a Long representing the 64 bit integer that comes by concatenating the given low and high bits. Each is assumed to use 32 bits. + */ + static fromBits( lowBits:number, highBits:number, unsigned?:boolean ): Long; + + /** + * Returns a Long representing the given 32 bit integer value. + */ + static fromInt( value: number, unsigned?: boolean ): Long; + + /** + * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned. + */ + static fromNumber( value: number, unsigned?: boolean ): Long; + + /** + * Returns a Long representation of the given string, written using the specified radix. + */ + static fromString( str: string, unsigned?: boolean | number, radix?: number ): Long; + + /** + * Tests if the specified object is a Long. + */ + static isLong( obj: any ): boolean; + + /** + * Converts the specified value to a Long. + */ + static fromValue( val: Long | number | string | {low: number, high: number, unsigned: boolean} ): Long; + + /** + * Returns the sum of this and the specified Long. + */ + add( addend: number | Long | string ): Long; + + /** + * Returns the bitwise AND of this Long and the specified. + */ + and( other: Long | number | string ): Long; + + /** + * Compares this Long's value with the specified's. + */ + compare( other: Long | number | string ): number; + + /** + * Compares this Long's value with the specified's. + */ + comp( other: Long | number | string ): number; + + /** + * Returns this Long divided by the specified. + */ + divide( divisor: Long | number | string ): Long; + + /** + * Returns this Long divided by the specified. + */ + div( divisor: Long | number | string ): Long; + + /** + * Tests if this Long's value equals the specified's. + */ + equals( other: Long | number | string ): boolean; + + /** + * Tests if this Long's value equals the specified's. + */ + eq( other: Long | number | string ): boolean; + + /** + * Gets the high 32 bits as a signed integer. + */ + getHighBits(): number; + + /** + * Gets the high 32 bits as an unsigned integer. + */ + getHighBitsUnsigned(): number; + + /** + * Gets the low 32 bits as a signed integer. + */ + getLowBits(): number; + + /** + * Gets the low 32 bits as an unsigned integer. + */ + getLowBitsUnsigned(): number; + + /** + * Gets the number of bits needed to represent the absolute value of this Long. + */ + getNumBitsAbs(): number; + + /** + * Tests if this Long's value is greater than the specified's. + */ + greaterThan( other: Long | number | string ): boolean; + + /** + * Tests if this Long's value is greater than the specified's. + */ + gt( other: Long | number | string ): boolean; + + /** + * Tests if this Long's value is greater than or equal the specified's. + */ + greaterThanOrEqual( other: Long | number | string ): boolean; + + /** + * Tests if this Long's value is greater than or equal the specified's. + */ + gte( other: Long | number | string ): boolean; + + /** + * Tests if this Long's value is even. + */ + isEven(): boolean; + + /** + * Tests if this Long's value is negative. + */ + isNegative(): boolean; + + /** + * Tests if this Long's value is odd. + */ + isOdd(): boolean; + + /** + * Tests if this Long's value is positive. + */ + isPositive(): boolean; + + /** + * Tests if this Long's value equals zero. + */ + isZero(): boolean; + + /** + * Tests if this Long's value is less than the specified's. + */ + lessThan( other: Long | number | string ): boolean; + + /** + * Tests if this Long's value is less than the specified's. + */ + lt( other: Long | number | string ): boolean; + + /** + * Tests if this Long's value is less than or equal the specified's. + */ + lessThanOrEqual( other: Long | number | string ): boolean; + + /** + * Tests if this Long's value is less than or equal the specified's. + */ + lte( other: Long | number | string ): boolean; + + /** + * Returns this Long modulo the specified. + */ + modulo( other: Long | number | string ): Long; + + /** + * Returns this Long modulo the specified. + */ + mod( other: Long | number | string ): Long; + + /** + * Returns the product of this and the specified Long. + */ + multiply( multiplier: Long | number | string ): Long; + + /** + * Returns the product of this and the specified Long. + */ + mul( multiplier: Long | number | string ): Long; + + /** + * Negates this Long's value. + */ + negate(): Long; + + /** + * Negates this Long's value. + */ + neg(): Long; + + /** + * Returns the bitwise NOT of this Long. + */ + not(): Long; + + /** + * Tests if this Long's value differs from the specified's. + */ + notEquals( other: Long | number | string ): boolean; + + /** + * Tests if this Long's value differs from the specified's. + */ + neq( other: Long | number | string ): boolean; + + /** + * Returns the bitwise OR of this Long and the specified. + */ + or( other: Long | number | string ): Long; + + /** + * Returns this Long with bits shifted to the left by the given amount. + */ + shiftLeft( numBits: number | Long ): Long; + + /** + * Returns this Long with bits shifted to the left by the given amount. + */ + shl( numBits: number | Long ): Long; + + /** + * Returns this Long with bits arithmetically shifted to the right by the given amount. + */ + shiftRight( numBits: number | Long ): Long; + + /** + * Returns this Long with bits arithmetically shifted to the right by the given amount. + */ + shr( numBits: number | Long ): Long; + + /** + * Returns this Long with bits logically shifted to the right by the given amount. + */ + shiftRightUnsigned( numBits: number | Long ): Long; + + /** + * Returns this Long with bits logically shifted to the right by the given amount. + */ + shru( numBits: number | Long ): Long; + + /** + * Returns the difference of this and the specified Long. + */ + subtract( subtrahend: number | Long | string ): Long; + + /** + * Returns the difference of this and the specified Long. + */ + sub( subtrahend: number | Long |string ): Long; + + /** + * Converts the Long to a 32 bit integer, assuming it is a 32 bit integer. + */ + toInt(): number; + + /** + * Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa). + */ + toNumber(): number; + + /** + * Converts this Long to signed. + */ + toSigned(): Long; + + /** + * Converts the Long to a string written in the specified radix. + */ + toString( radix?: number ): string; + + /** + * Converts this Long to unsigned. + */ + toUnsigned(): Long; + + /** + * Returns the bitwise XOR of this Long and the given one. + */ + xor( other: Long | number | string ): Long; } -declare module "long" { - var Long: dcodeIO.LongStatic; +declare module 'long' { export = Long; } \ No newline at end of file diff --git a/lovefield/lovefield-tests.ts b/lovefield/lovefield-tests.ts index 45de3299d..b9bc73a82 100644 --- a/lovefield/lovefield-tests.ts +++ b/lovefield/lovefield-tests.ts @@ -9,7 +9,9 @@ function main(): void { addColumn('deadline', lf.Type.DATE_TIME). addColumn('done', lf.Type.BOOLEAN). addPrimaryKey(['id'], false). - addIndex('idxDeadline', ['deadline'], false, lf.Order.DESC); + addIndex('idxDeadline', ['deadline'], false, lf.Order.DESC). + addNullable(['deadline']). + addUnique('uq_description', ['description']); var todoDb: lf.Database = null; var itemSchema: lf.schema.Table = null; diff --git a/lovefield/lovefield.d.ts b/lovefield/lovefield.d.ts index dc91b9f90..0b0afe023 100644 --- a/lovefield/lovefield.d.ts +++ b/lovefield/lovefield.d.ts @@ -199,11 +199,11 @@ declare module lf { addIndex( name: string, columns: Array|Array, unique?: boolean, order?: Order): TableBuilder - addNullable(columns: Array): TableBuilder + addNullable(columns: Array): TableBuilder addPrimaryKey( columns: Array|Array, autoInc?: boolean): TableBuilder - addUnique(name: string, columns: Array): TableBuilder + addUnique(name: string, columns: Array): TableBuilder } function create(dbName: string, dbVersion: number): Builder diff --git a/lwip/lwip-tests.ts b/lwip/lwip-tests.ts new file mode 100644 index 000000000..4fca56381 --- /dev/null +++ b/lwip/lwip-tests.ts @@ -0,0 +1,285 @@ +/// + +import * as lwip from 'lwip'; + +lwip.open('lena.jpg', function(err, image) { + if (err) return console.log(err); + image.batch() + .blur(10) + .writeFile('lena_blur.jpg', function(err) { + if (err) return console.log(err); + console.log('done'); + }); +}); + +lwip.open('lena.jpg', function(err, image) { + if (err) return console.log(err); + image.batch() + .border(10, 'green') + .writeFile('lena_border.jpg', function(err) { + if (err) return console.log(err); + console.log('done'); + }); +}); + +lwip.open('lena.jpg', function(err, image) { + if (err) return console.log(err); + + image.batch() + .scale(0.75) + .border(5, [50, 100, 75, 75]) + .exec(function(err, image) { + if (err) return console.log(err); + + image.clone(function(err, clone1) { + if (err) return console.log("clone1:", err); + clone1.batch() + .mirror('y') + .hue(100) + .writeFile('lena_clone1.png', function(err) { + if (err) return console.log(err); + console.log('clone1: done'); + }); + }); + + image.clone(function(err, clone2) { + if (err) return console.log("clone2:", err); + clone2.batch() + .fade(0.5) + .mirror('x') + .writeFile('lena_clone2.png', function(err) { + if (err) return console.log(err); + console.log('clone2: done'); + }); + }); + + }); + +}); + +lwip.open('lena.jpg', function(err, image) { + if (err) return console.log(err); + image.contain(400,700,'green',function(err, image){ + image.writeFile('lena_contain.jpg', function(err){ + if (err) return console.log(err); + console.log('done'); + }); + }); +}); + +lwip.open('lena.gif', function(err, image) { + if (err) return console.log(err); + image.writeFile('lena_from_gif.png', function(err) { + if (err) return console.log(err); + console.log('done') + }); +}); + +lwip.open('lena.jpg', function(err, image) { + if (err) return console.log(err); + image.cover(400,800,function(err, image){ + image.writeFile('lena_cover.jpg', function(err){ + if (err) return console.log(err); + console.log('done'); + }); + }); +}); + +lwip.open('lena.jpg', function(err, image) { + if (err) return console.log(err); + image.batch() + .crop(400, 400) + .writeFile('lena_crop.jpg', function(err) { + if (err) return console.log(err); + console.log('done'); + }); +}); + +lwip.open('lena.jpg', function(err, image) { + if (err) return console.log(err); + + image.extract(230, 230, 370, 300, function(err, eyes) { + eyes.writeFile('lena_eyes.jpg', function(err) { + if (err) return console.log("eyes:", err); + console.log('eyes: done'); + }); + + eyes.extract(0, 0, 70, 71, function(err, left_eye) { + left_eye.writeFile('lena_eyes_left.jpg', function(err) { + if (err) return console.log("eyes left:", err); + console.log('eyes left: done'); + }); + }); + + eyes.extract(71, 0, 141, 71, function(err, right_eye) { + right_eye.writeFile('lena_eyes_right.jpg', function(err) { + if (err) return console.log("eyes right:", err); + console.log('eyes right: done'); + }); + }); + }); + + image.extract(240, 320, 350, 380, function(err, eyes) { + eyes.writeFile('lena_mouth.jpg', function(err) { + if (err) return console.log("mouth:", err); + console.log('mouth: done'); + }); + }); + +}); + +lwip.open('lena.jpg', function(err, image) { + if (err) return console.log(err); + image.batch() + .fade(0.5) + .writeFile('lena_fade.png', function(err) { + if (err) return console.log(err); + console.log('done'); + }); +}); + +lwip.open('lena.jpg', function(err, image) { + if (err) return console.log(err); + image.writeFile('lena_interlaced.gif', { + colors: 222, + interlaced: true + }, function(err) { + if (err) return console.log(err); + console.log('done'); + }); +}); + +lwip.open('lena.jpg', function(err, image) { + if (err) return console.log(err); + image.batch() + .hue(50) + .writeFile('lena_hue.jpg', function(err) { + if (err) return console.log(err); + console.log('done'); + }); +}); + +lwip.open('lena.jpg', function(err, image) { + if (err) return console.log(err); + image.batch() + .lighten(0.5) + .writeFile('lena_lighten.jpg', function(err) { + if (err) return console.log(err); + console.log('done'); + }); +}); + +lwip.open('lena.jpg', function(err, image) { + if (err) return console.log(err); + image.batch() + .mirror('x') + .writeFile('lena_mirror.jpg', function(err) { + if (err) return console.log(err); + console.log('done'); + }); +}); + +lwip.open(new Buffer(1000), { width: 10, height: 10 }, function(err, image) { + if (err) return console.log("err open", err); + image.batch() + .blur(9) + .writeFile('image_from_pixelbuffer.png', function(err){ + if (err) return console.log("err write", err); + console.log('done'); + }); +}); + +lwip.open('lena.jpg', function(err, image) { + if (err) return console.log(err); + image.batch() + .pad(10, 5, 10, 5, 'blue') + .writeFile('lena_pad.jpg', function(err) { + if (err) return console.log(err); + console.log('done'); + }); +}); + +lwip.open('lena.jpg', function(err, image) { + if (err) return console.log(err); + image.writeFile('lena_interlaced.png', { + compression: 'high', + interlaced: true + }, function(err) { + if (err) return console.log(err); + console.log('done'); + }); +}); + +lwip.open('lena.jpg', function(err, image) { + if (err) return console.log(err); + image.writeFile('lena_low_quality.jpg', { + quality: 10 + }, function(err) { + if (err) return console.log(err); + console.log('done'); + }); +}); + +lwip.open('lena.jpg', function(err, image) { + if (err) return console.log(err); + image.batch() + .rotate(45, { + r: 90, + g: 55, + b: 40 + }) + .writeFile('lena_rotate.gif', function(err) { + if (err) return console.log(err); + console.log('done') + }); +}); + +lwip.open('lena.png', function(err, image) { + if (err) return console.log(err); + image.batch() + .rotate(-33, 'white') + .scale(1.5) + .blur(5) + .writeFile('lena_rotate_scale_blur.jpg', function(err) { + if (err) return console.log(err); + console.log('done'); + }); +}); + +lwip.open('lena.jpg', function(err, image) { + if (err) return console.log(err); + image.batch() + .saturate(0.5) + .writeFile('lena_saturate.jpg', function(err) { + if (err) return console.log(err); + console.log('done'); + }); +}); + +lwip.create(3, 3, function(err, image){ + if (err) return console.log(err); + + var batch = image.batch(); + + // set the same color for each columns in the image + for (let x = 0; x < 3 ; x++){ + let c = {r: 100, g: 100, b: 100}; + for (let y = 0; y < 3; y++){ + batch.setPixel(x, y, c); + } + } + + batch.writeFile('rainbow.png', function(err){ + if (err) console.log(err); + }); +}); + +lwip.open('lena.jpg', function(err, image) { + if (err) return console.log(err); + image.batch() + .sharpen(200) + .writeFile('lena_sharpen.jpg', function(err) { + if (err) return console.log(err); + console.log('done'); + }); +}); diff --git a/lwip/lwip.d.ts b/lwip/lwip.d.ts new file mode 100644 index 000000000..63d2c701b --- /dev/null +++ b/lwip/lwip.d.ts @@ -0,0 +1,1003 @@ +// Type definitions for Light-weight image processor 0.0.8 +// Project: https://github.com/EyalAr/lwip +// Definitions by: Aya Morisawa +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare module "lwip" { + type ColorObject = {r: number, g: number, b: number, a?: number}; + type Color = string | [number, number, number, number] | ColorObject; + + interface ImageCallback { + (err: any, image: Image): void; + } + + /** + * Open an image + * @param source The path to the image on disk. + */ + function open(source: string, callback: ImageCallback): void; + + /** + * Open an image + * @param source The path to the image on disk. + * @param type Optional type of the image. If omitted, the type will be inferred from the file extension. Type must be a string of the image type (i.e. "jpg"). + */ + function open(source: string, type: string, callback: ImageCallback): void; + + /** + * Open an image + * @param source The path to the image on disk or an image buffer. + * @param type Type of the image. If source is an encoded image buffer, type must be a string of the image type (i.e. "jpg"). If source is a raw pixels buffer type must be an object with type.width and type.height properties. + */ + function open(source: Buffer, type: string | {width: number, height: number}, callback: ImageCallback): any; + + /** + * Create a new image + * @param width The width of the new image. + * @param height The height of the new image. + */ + function create(width: number, height: number, callback: ImageCallback): void; + + /** + * Create a new image + * @param width The width of the new image. + * @param height The height of the new image. + * @param color Optional Color of the canvas. + */ + function create(width: number, height: number, color: Color, callback: ImageCallback): void; + + type JpegBufferParams = { + quality?: number; + }; + + type PngBufferParams = { + compression?: string; + interlaced?: boolean; + transparency?: boolean | string; + }; + + type GifBufferParams = { + colors?: number; + interlaced?: boolean; + transparency?: boolean | string; + threshold: number; + } + + interface Image { + // Image operations + + /** + * Resize + * @param Width in pixels. + */ + resize(width: number, callback: ImageCallback): void; + + /** + * Resize + * @param Width in pixels. + * @param Interpolation method. + */ + resize(width: number, inter: string, callback: ImageCallback): void; + + /** + * Resize + * @param Width in pixels. + * @param Height in pixels. + */ + resize(width: number, height: number, callback: ImageCallback): void; + + /** + * Resize + * @param Width in pixels. + * @param Height in pixels. + * @param Interpolation method. + */ + resize(width: number, height: number, inter: string, callback: ImageCallback): void; + + /** + * Scale + * @param wRatio Width scale ratio. + */ + scale(wRatio: number, callback: ImageCallback): void; + + /** + * Scale + * @param wRatio Width scale ratio. + * @param inter Interpolation method. + */ + scale(wRatio: number, inter: string, callback: ImageCallback): void; + + /** + * Scale + * @param wRatio Width scale ratio. + * @param hRatio Height scale ratio. + */ + scale(wRatio: number, hRatio: number, callback: ImageCallback): void; + + /** + * Scale + * @param wRatio Width scale ratio. + * @param hRatio Height scale ratio. + * @param inter Interpolation method. + */ + scale(wRatio: number, hRatio: number, inter: string, callback: ImageCallback): void; + + /** + * Contain the image in a colored canvas. The image will be resized to the largest possible size such that it's fully contained inside the canvas. + * @param width Canvas' width in pixels. + * @param height Canvas' height in pixels. + */ + contain(width: number, height: number, callback: ImageCallback): void; + + /** + * Contain the image in a colored canvas. The image will be resized to the largest possible size such that it's fully contained inside the canvas. + * @param width Canvas' width in pixels. + * @param height Canvas' height in pixels. + * @param color Color of the canvas. + */ + contain(width: number, height: number, color: Color, callback: ImageCallback): void; + + /** + * Contain the image in a colored canvas. The image will be resized to the largest possible size such that it's fully contained inside the canvas. + * @param width Canvas' width in pixels. + * @param height Canvas' height in pixels. + * @param inter Interpolation method. + */ + contain(width: number, height: number, inter: string, callback: ImageCallback): void; + + /** + * Contain the image in a colored canvas. The image will be resized to the largest possible size such that it's fully contained inside the canvas. + * @param width Canvas' width in pixels. + * @param height Canvas' height in pixels. + * @param color Color of the canvas. + * @param inter Interpolation method. + */ + contain(width: number, height: number, color: Color, inter: string, callback: ImageCallback): void; + + /** + * Cover a canvas with the image. The image will be resized to the smallest possible size such that both its dimensions are bigger than the canvas's dimensions. Margins of the image exceeding the canvas will be discarded. + * @param width Canvas' width in pixels. + * @param height Canvas' height in pixels. + */ + cover(width: number, height: number, callback: ImageCallback): void; + + /** + * Cover a canvas with the image. The image will be resized to the smallest possible size such that both its dimensions are bigger than the canvas's dimensions. Margins of the image exceeding the canvas will be discarded. + * @param width Canvas' width in pixels. + * @param height Canvas' height in pixels. + * @param inter Interpolation method. + */ + cover(width: number, height: number, inter: string, callback: ImageCallback): void; + + /** + * Rotate + * @param degs Clockwise rotation degrees. + */ + rotate(degs: number, callback: ImageCallback): void; + + /** + * Rotate + * @param degs Clockwise rotation degrees. + * @param color Color of the canvas. + */ + rotate(degs: number, color: Color, callback: ImageCallback): void; + + /** + * Crop with rectangle coordinates + */ + crop(left: number, top: number, right: number, bottom: number, callback: ImageCallback): void; + + /** + * Crop a rectangle from center + * @param width Width of the rectangle to crop from the center of the image. + * @param height Height of the rectangle to crop from the center of the image. + */ + crop(width: number, height: number, callback: ImageCallback): void; + + /** + * Gaussian blur. + * @param sigma Standard deviation of the Gaussian filter. + */ + blur(sigma: number, callback: ImageCallback): void; + + /** + * Inverse diffusion shapren. + * @param amplitude Sharpening amplitude. + */ + sharpen(amplitude: number, callback: ImageCallback): void; + + /** + * Mirror an image along the 'x' axis, 'y' axis or both. + * @param axes 'x', 'y' or 'xy' (case sensitive). + */ + mirror(axes: string, callback: ImageCallback): void; + + /** + * Alias of mirror. Mirror an image along the 'x' axis, 'y' axis or both. + * @param axes 'x', 'y' or 'xy' (case sensitive). + */ + flip(axes: string, callback: ImageCallback): void; + + /** + * Add a colored border to the image. + * @param width Border width in pixels. + */ + border(width: number, callback: ImageCallback): void; + + /** + * Add a colored border to the image. + * @param width Border width in pixels. + * @param color Color of the border. + */ + border(width: number, color: Color, callback: ImageCallback): void; + + /** + * Pad image edges with colored pixels. + * @param left Number of pixels to add to left edge. + * @param top Number of pixels to add to top edge. + * @param right Number of pixels to add to right edge. + * @param bottom Number of pixels to add to bottom edge. + */ + pad(left: number, top: number, right: number, bottom: number, callback: ImageCallback): void; + + /** + * Pad image edges with colored pixels. + * @param left Number of pixels to add to left edge. + * @param top Number of pixels to add to top edge. + * @param right Number of pixels to add to right edge. + * @param bottom Number of pixels to add to bottom edge. + * @param color Color of the padding. + */ + pad(left: number, top: number, right: number, bottom: number, color: Color, callback: ImageCallback): void; + + /** + * Adjust image saturation. + * + * Examples: + * 1. image.saturate(0, ...) will have no effect on the image. + * 2. image.saturate(0.5, ...) will increase the saturation by 50%. + * 3. image.saturate(-1, ...) will decrease the saturation by 100%, effectively desaturating the image. + * + * @param delta By how much to increase / decrease the saturation. + */ + saturate(delta: number, callback: ImageCallback): void; + + /** + * Adjust image lightness. + * + * Examples: + * 1. image.lighten(0, ...) will have no effect on the image. + * 2. image.lighten(0.5, ...) will increase the lightness by 50%. + * 3. image.lighten(-1, ...) will decrease the lightness by 100%, effectively making the image black. + * + * @param delta By how much to increase / decrease the lightness. + */ + lighten(delta: number, callback: ImageCallback): void; + + /** + * Adjust image lightness. Equivalent to image.lighten(-delta, callback). + * @param delta By how much to increase / decrease the lightness. + */ + darken(delta: number, callback: ImageCallback): void; + + /** + * Adjust image hue. + * + * Examples: + * 1. image.hue(0, ...) will have no effect on the image. + * 2. image.hue(100, ...) will shift pixels' hue by 100 degrees. + * + * Note: The hue is shifted in a circular manner in the range [0,360] for each pixel individually. + * + * @param shift By how many degrees to shift each pixel's hue. + */ + hue(shift: number, callback: ImageCallback): void; + + /** + * Adjust image transperancy. + * + * Examples: + * 1. image.fade(0, ...) will have no effect on the image. + * 2. image.fade(0.5, ...) will increase the transparency by 50%. + * 3. image.fade(1, ...) will make the image completely transparent. + * + * Note: The transparency is adjusted independently for each pixel. + * + * @param delta By how much to increase / decrease the transperancy. + */ + fade(delta: number, callback: ImageCallback): void; + + /** + * Make image completely opaque. + */ + opacity(callback: ImageCallback): void; + + /** + * Paste an image on top of this image. + * + * Notes: + * 1. If the pasted image exceeds the bounds of the base image, an exception is thrown. + * 2. img is pasted in the state it was at the time image.paste( ... ) was called, eventhough callback is called asynchronously. + * 3. For transparent images, alpha blending is done according to the equations described here. + * 4. Extra caution is required when using this method in batch mode, as the images may change by the time this operation is called. + * + * @param left Coordinates of the left corner of the pasted image. + * @param top Coordinates of the top corner of the pasted image. + * @param img The image to paste. + */ + paste(left: number, top: number, img: Image, callback: ImageCallback): void; + + /** + * Set the color of a pixel. + * + * Notes: + * 1. If the coordinates exceed the bounds of the image, an exception is thrown. + * 2. Extra caution is required when using this method in batch mode, as the dimensions of the image may change by the time this operation is called. + * + * @param left Coordinates of the pixel from the left corner of the image. + * @param top Coordinates of the pixel from the top corner of the image. + * @param color Color of the pixel to set. + */ + setPixel(left: number, top: number, color: Color, callback: ImageCallback): void; + + /** + * Set the metadata in an image. This is currently only supported for PNG files. Sets a tEXt chunk with the key lwip_data and comment as the given string. If called with a null parameter, removes existing metadata from the image, if present. + * @param metadata A string of arbitrary length, or null. + */ + setMetaData(metadata: string): void; + + // Getters + + /** + * Return the image's width in pixels. + */ + width(): number; + + /** + * Return the image's height in pixels. + */ + height(): number; + + /** + * Return the color of the pixel at the (left, top) coordinate. + */ + getPixel(left: number, top: number): ColorObject; + + /** + * Clone the image into a new image object. + * + * Note: The image is cloned to the state it was at the time image.clone( ... ) was called, eventhough callback is called asynchronously. + */ + clone(callback: ImageCallback): void; + + /** + * Copy an area of the image into a new image object. + * + * Note: The sub-image is extracted from the original image in the state it was at the time image.extract( ... ) was called, eventhough callback is called asynchronously. + */ + extract(left: number, top: number, right: number, bottom: number, callback: ImageCallback): void; + + /** + * Get encoded binary image data as a NodeJS Buffer. + * + * When opening an image, it is decoded and stored in memory as an uncompressed image. All manipulations are done on the uncompressed data in memory. This method allows to encode the image to one of the specified formats and get the encoded data as a NodeJS Buffer object. + * + * @param format Encoding format. + */ + toBuffer(format: "jpg", callback: ImageCallback): void; + + /** + * Get encoded binary image data as a NodeJS Buffer. + * + * When opening an image, it is decoded and stored in memory as an uncompressed image. All manipulations are done on the uncompressed data in memory. This method allows to encode the image to one of the specified formats and get the encoded data as a NodeJS Buffer object. + * + * @param format Encoding format. + * @param params Format-specific parameters. + */ + toBuffer(format: "jpg", params: JpegBufferParams, callback: ImageCallback): void; + + /** + * Get encoded binary image data as a NodeJS Buffer. + * + * When opening an image, it is decoded and stored in memory as an uncompressed image. All manipulations are done on the uncompressed data in memory. This method allows to encode the image to one of the specified formats and get the encoded data as a NodeJS Buffer object. + * + * @param format Encoding format. + */ + toBuffer(format: "png", callback: ImageCallback): void; + + /** + * Get encoded binary image data as a NodeJS Buffer. + * + * When opening an image, it is decoded and stored in memory as an uncompressed image. All manipulations are done on the uncompressed data in memory. This method allows to encode the image to one of the specified formats and get the encoded data as a NodeJS Buffer object. + * + * @param format Encoding format. + * @param params Format-specific parameters. + */ + toBuffer(format: "png", params: PngBufferParams, callback: ImageCallback): void; + + /** + * Get encoded binary image data as a NodeJS Buffer. + * + * When opening an image, it is decoded and stored in memory as an uncompressed image. All manipulations are done on the uncompressed data in memory. This method allows to encode the image to one of the specified formats and get the encoded data as a NodeJS Buffer object. + * + * @param format Encoding format. + */ + toBuffer(format: "gif", callback: ImageCallback): void; + + /** + * Get encoded binary image data as a NodeJS Buffer. + * + * When opening an image, it is decoded and stored in memory as an uncompressed image. All manipulations are done on the uncompressed data in memory. This method allows to encode the image to one of the specified formats and get the encoded data as a NodeJS Buffer object. + * + * @param format Encoding format. + * @param params Format-specific parameters. + */ + toBuffer(format: "gif", params: GifBufferParams, callback: ImageCallback): void; + + /** + * Get encoded binary image data as a NodeJS Buffer. + * + * When opening an image, it is decoded and stored in memory as an uncompressed image. All manipulations are done on the uncompressed data in memory. This method allows to encode the image to one of the specified formats and get the encoded data as a NodeJS Buffer object. + * + * @param format Encoding format. + */ + toBuffer(format: string, callback: ImageCallback): void; + + /** + * Get encoded binary image data as a NodeJS Buffer. + * + * When opening an image, it is decoded and stored in memory as an uncompressed image. All manipulations are done on the uncompressed data in memory. This method allows to encode the image to one of the specified formats and get the encoded data as a NodeJS Buffer object. + * + * @param format Encoding format. + * @param params Format-specific parameters. + */ + toBuffer(format: string, params: JpegBufferParams | PngBufferParams | GifBufferParams, callback: ImageCallback): void; + + /** + * Write encoded binary image data directly to a file. + * + * @param path Path of file to write. + */ + writeFile(path: string, callback: ImageCallback): void; + + /** + * Write encoded binary image data directly to a file. + * + * @param path Path of file to write. + * @param params Format-specific parameters. + */ + writeFile(path: string, params: JpegBufferParams | PngBufferParams | GifBufferParams, callback: ImageCallback): void; + + /** + * Write encoded binary image data directly to a file. + * + * @param path Path of file to write. + * @param format Encoding format. + */ + writeFile(path: string, format: "jpg", callback: ImageCallback): void; + + /** + * Write encoded binary image data directly to a file. + * + * @param path Path of file to write. + * @param format Encoding format. + * @param params Format-specific parameters. + */ + writeFile(path: string, format: "jpg", params: JpegBufferParams, callback: ImageCallback): void; + + /** + * Write encoded binary image data directly to a file. + * + * @param path Path of file to write. + * @param format Encoding format. + */ + writeFile(path: string, format: "png", callback: ImageCallback): void; + + /** + * Write encoded binary image data directly to a file. + * + * @param path Path of file to write. + * @param format Encoding format. + * @param params Format-specific parameters. + */ + writeFile(path: string, format: "png", params: PngBufferParams, callback: ImageCallback): void; + + /** + * Write encoded binary image data directly to a file. + * + * @param path Path of file to write. + * @param format Encoding format. + */ + writeFile(path: string, format: "gif", callback: ImageCallback): void; + + /** + * Write encoded binary image data directly to a file. + * + * @param path Path of file to write. + * @param format Encoding format. + * @param params Format-specific parameters. + */ + writeFile(path: string, format: "gif", params: GifBufferParams, callback: ImageCallback): void; + + /** + * Write encoded binary image data directly to a file. + * + * @param path Path of file to write. + * @param format Encoding format. + */ + writeFile(path: string, format: string, callback: ImageCallback): void; + + /** + * Write encoded binary image data directly to a file. + * + * @param path Path of file to write. + * @param format Encoding format. + * @param params Format-specific parameters. + */ + writeFile(path: string, format: string, params: JpegBufferParams | PngBufferParams | GifBufferParams, callback: ImageCallback): void; + + /** + * Get the textual metadata from an image. This is currently only supported for tEXt chunks in PNG images, and will get the first tEXt chunk found with the key lwip_data. If none is found, returns null. + */ + getMetaData(): T; + + // Obtaining a batch object + + /** + * Obtain a batch object from the image + */ + batch(): Batch; + } + + interface Batch { + // Using a batch object + + /** + * Resize + * @param Width in pixels. + */ + resize(width: number): Batch; + + /** + * Resize + * @param Width in pixels. + * @param Interpolation method. + */ + resize(width: number, inter: string): Batch; + + /** + * Resize + * @param Width in pixels. + * @param Height in pixels. + */ + resize(width: number, height: number): Batch; + + /** + * Resize + * @param Width in pixels. + * @param Height in pixels. + * @param Interpolation method. + */ + resize(width: number, height: number, inter: string): Batch; + + /** + * Scale + * @param wRatio Width scale ratio. + */ + scale(wRatio: number): Batch; + + /** + * Scale + * @param wRatio Width scale ratio. + * @param inter Interpolation method. + */ + scale(wRatio: number, inter: string): Batch; + + /** + * Scale + * @param wRatio Width scale ratio. + * @param hRatio Height scale ratio. + */ + scale(wRatio: number, hRatio: number): Batch; + + /** + * Scale + * @param wRatio Width scale ratio. + * @param hRatio Height scale ratio. + * @param inter Interpolation method. + */ + scale(wRatio: number, hRatio: number, inter: string): Batch; + + /** + * Contain the image in a colored canvas. The image will be resized to the largest possible size such that it's fully contained inside the canvas. + * @param width Canvas' width in pixels. + * @param height Canvas' height in pixels. + */ + contain(width: number, height: number): Batch; + + /** + * Contain the image in a colored canvas. The image will be resized to the largest possible size such that it's fully contained inside the canvas. + * @param width Canvas' width in pixels. + * @param height Canvas' height in pixels. + * @param color Color of the canvas. + */ + contain(width: number, height: number, color: Color): Batch; + + /** + * Contain the image in a colored canvas. The image will be resized to the largest possible size such that it's fully contained inside the canvas. + * @param width Canvas' width in pixels. + * @param height Canvas' height in pixels. + * @param inter Interpolation method. + */ + contain(width: number, height: number, inter: string): Batch; + + /** + * Contain the image in a colored canvas. The image will be resized to the largest possible size such that it's fully contained inside the canvas. + * @param width Canvas' width in pixels. + * @param height Canvas' height in pixels. + * @param color Color of the canvas. + * @param inter Interpolation method. + */ + contain(width: number, height: number, color: Color, inter: string): Batch; + + /** + * Cover a canvas with the image. The image will be resized to the smallest possible size such that both its dimensions are bigger than the canvas's dimensions. Margins of the image exceeding the canvas will be discarded. + * @param width Canvas' width in pixels. + * @param height Canvas' height in pixels. + */ + cover(width: number, height: number): Batch; + + /** + * Cover a canvas with the image. The image will be resized to the smallest possible size such that both its dimensions are bigger than the canvas's dimensions. Margins of the image exceeding the canvas will be discarded. + * @param width Canvas' width in pixels. + * @param height Canvas' height in pixels. + * @param inter Interpolation method. + */ + cover(width: number, height: number, inter: string): Batch; + + /** + * Rotate + * @param degs Clockwise rotation degrees. + */ + rotate(degs: number): Batch; + + /** + * Rotate + * @param degs Clockwise rotation degrees. + * @param color Color of the canvas. + */ + rotate(degs: number, color: Color): Batch; + + /** + * Crop with rectangle coordinates + */ + crop(left: number, top: number, right: number, bottom: number): Batch; + + /** + * Crop a rectangle from center + * @param width Width of the rectangle to crop from the center of the image. + * @param height Height of the rectangle to crop from the center of the image. + */ + crop(width: number, height: number): Batch; + + /** + * Gaussian blur. + * @param sigma Standard deviation of the Gaussian filter. + */ + blur(sigma: number): Batch; + + /** + * Inverse diffusion shapren. + * @param amplitude Sharpening amplitude. + */ + sharpen(amplitude: number): Batch; + + /** + * Mirror an image along the 'x' axis, 'y' axis or both. + * @param axes 'x', 'y' or 'xy' (case sensitive). + */ + mirror(axes: string): Batch; + + /** + * Alias of mirror. Mirror an image along the 'x' axis, 'y' axis or both. + * @param axes 'x', 'y' or 'xy' (case sensitive). + */ + flip(axes: string): Batch; + + /** + * Add a colored border to the image. + * @param width Border width in pixels. + */ + border(width: number): Batch; + + /** + * Add a colored border to the image. + * @param width Border width in pixels. + * @param color Color of the border. + */ + border(width: number, color: Color): Batch; + + /** + * Pad image edges with colored pixels. + * @param left Number of pixels to add to left edge. + * @param top Number of pixels to add to top edge. + * @param right Number of pixels to add to right edge. + * @param bottom Number of pixels to add to bottom edge. + */ + pad(left: number, top: number, right: number, bottom: number): Batch; + + /** + * Pad image edges with colored pixels. + * @param left Number of pixels to add to left edge. + * @param top Number of pixels to add to top edge. + * @param right Number of pixels to add to right edge. + * @param bottom Number of pixels to add to bottom edge. + * @param color Color of the padding. + */ + pad(left: number, top: number, right: number, bottom: number, color: Color): Batch; + + /** + * Adjust image saturation. + * + * Examples: + * 1. image.saturate(0, ...) will have no effect on the image. + * 2. image.saturate(0.5, ...) will increase the saturation by 50%. + * 3. image.saturate(-1, ...) will decrease the saturation by 100%, effectively desaturating the image. + * + * @param delta By how much to increase / decrease the saturation. + */ + saturate(delta: number): Batch; + + /** + * Adjust image lightness. + * + * Examples: + * 1. image.lighten(0, ...) will have no effect on the image. + * 2. image.lighten(0.5, ...) will increase the lightness by 50%. + * 3. image.lighten(-1, ...) will decrease the lightness by 100%, effectively making the image black. + * + * @param delta By how much to increase / decrease the lightness. + */ + lighten(delta: number): Batch; + + /** + * Adjust image lightness. Equivalent to image.lighten(-delta, callback). + * @param delta By how much to increase / decrease the lightness. + */ + darken(delta: number): Batch; + + /** + * Adjust image hue. + * + * Examples: + * 1. image.hue(0, ...) will have no effect on the image. + * 2. image.hue(100, ...) will shift pixels' hue by 100 degrees. + * + * Note: The hue is shifted in a circular manner in the range [0,360] for each pixel individually. + * + * @param shift By how many degrees to shift each pixel's hue. + */ + hue(shift: number): Batch; + + /** + * Adjust image transperancy. + * + * Examples: + * 1. image.fade(0, ...) will have no effect on the image. + * 2. image.fade(0.5, ...) will increase the transparency by 50%. + * 3. image.fade(1, ...) will make the image completely transparent. + * + * Note: The transparency is adjusted independently for each pixel. + * + * @param delta By how much to increase / decrease the transperancy. + */ + fade(delta: number): Batch; + + /** + * Make image completely opaque. + */ + opacity(callback: ImageCallback): void; + + /** + * Paste an image on top of this image. + * + * Notes: + * 1. If the pasted image exceeds the bounds of the base image, an exception is thrown. + * 2. img is pasted in the state it was at the time image.paste( ... ) was called, eventhough callback is called asynchronously. + * 3. For transparent images, alpha blending is done according to the equations described here. + * 4. Extra caution is required when using this method in batch mode, as the images may change by the time this operation is called. + * + * @param left Coordinates of the left corner of the pasted image. + * @param top Coordinates of the top corner of the pasted image. + * @param img The image to paste. + */ + paste(left: number, top: number, img: Image): Batch; + + /** + * Set the color of a pixel. + * + * Notes: + * 1. If the coordinates exceed the bounds of the image, an exception is thrown. + * 2. Extra caution is required when using this method in batch mode, as the dimensions of the image may change by the time this operation is called. + * + * @param left Coordinates of the pixel from the left corner of the image. + * @param top Coordinates of the pixel from the top corner of the image. + * @param color Color of the pixel to set. + */ + setPixel(left: number, top: number, color: Color): Batch; + + /** + * Set the metadata in an image. This is currently only supported for PNG files. Sets a tEXt chunk with the key lwip_data and comment as the given string. If called with a null parameter, removes existing metadata from the image, if present. + * @param metadata A string of arbitrary length, or null. + */ + setMetaData(metadata: string): void; + + // Executing a batch + + /** + * Execute batch and obtain the manipulated image object + */ + exec(callback: ImageCallback): void; + + /** + * Execute batch and obtain a Buffer object + * + * When opening an image, it is decoded and stored in memory as an uncompressed image. All manipulations are done on the uncompressed data in memory. This method allows to encode the image to one of the specified formats and get the encoded data as a NodeJS Buffer object. + * + * @param format Encoding format. + */ + toBuffer(format: "jpg", callback: ImageCallback): void; + + /** + * Execute batch and obtain a Buffer object + * + * When opening an image, it is decoded and stored in memory as an uncompressed image. All manipulations are done on the uncompressed data in memory. This method allows to encode the image to one of the specified formats and get the encoded data as a NodeJS Buffer object. + * + * @param format Encoding format. + * @param params Format-specific parameters. + */ + toBuffer(format: "jpg", params: JpegBufferParams, callback: ImageCallback): void; + + /** + * Execute batch and obtain a Buffer object + * + * When opening an image, it is decoded and stored in memory as an uncompressed image. All manipulations are done on the uncompressed data in memory. This method allows to encode the image to one of the specified formats and get the encoded data as a NodeJS Buffer object. + * + * @param format Encoding format. + */ + toBuffer(format: "png", callback: ImageCallback): void; + + /** + * Execute batch and obtain a Buffer object + * + * When opening an image, it is decoded and stored in memory as an uncompressed image. All manipulations are done on the uncompressed data in memory. This method allows to encode the image to one of the specified formats and get the encoded data as a NodeJS Buffer object. + * + * @param format Encoding format. + * @param params Format-specific parameters. + */ + toBuffer(format: "png", params: PngBufferParams, callback: ImageCallback): void; + + /** + * Execute batch and obtain a Buffer object + * + * When opening an image, it is decoded and stored in memory as an uncompressed image. All manipulations are done on the uncompressed data in memory. This method allows to encode the image to one of the specified formats and get the encoded data as a NodeJS Buffer object. + * + * @param format Encoding format. + */ + toBuffer(format: "gif", callback: ImageCallback): void; + + /** + * Execute batch and obtain a Buffer object + * + * When opening an image, it is decoded and stored in memory as an uncompressed image. All manipulations are done on the uncompressed data in memory. This method allows to encode the image to one of the specified formats and get the encoded data as a NodeJS Buffer object. + * + * @param format Encoding format. + * @param params Format-specific parameters. + */ + toBuffer(format: "gif", params: GifBufferParams, callback: ImageCallback): void; + + /** + * Execute batch and obtain a Buffer object + * + * When opening an image, it is decoded and stored in memory as an uncompressed image. All manipulations are done on the uncompressed data in memory. This method allows to encode the image to one of the specified formats and get the encoded data as a NodeJS Buffer object. + * + * @param format Encoding format. + */ + toBuffer(format: string, callback: ImageCallback): void; + + /** + * Execute batch and obtain a Buffer object + * + * When opening an image, it is decoded and stored in memory as an uncompressed image. All manipulations are done on the uncompressed data in memory. This method allows to encode the image to one of the specified formats and get the encoded data as a NodeJS Buffer object. + * + * @param format Encoding format. + * @param params Format-specific parameters. + */ + toBuffer(format: string, params: JpegBufferParams | PngBufferParams | GifBufferParams, callback: ImageCallback): void; + + /** + * Execute batch and write to file + * + * @param path Path of file to write. + */ + writeFile(path: string, callback: ImageCallback): void; + + /** + * Execute batch and write to file + * + * @param path Path of file to write. + * @param params Format-specific parameters. + */ + writeFile(path: string, params: JpegBufferParams | PngBufferParams | GifBufferParams, callback: ImageCallback): void; + + /** + * Execute batch and write to file + * + * @param path Path of file to write. + * @param format Encoding format. + */ + writeFile(path: string, format: "jpg", callback: ImageCallback): void; + + /** + * Execute batch and write to file + * + * @param path Path of file to write. + * @param format Encoding format. + * @param params Format-specific parameters. + */ + writeFile(path: string, format: "jpg", params: JpegBufferParams, callback: ImageCallback): void; + + /** + * Execute batch and write to file + * + * @param path Path of file to write. + * @param format Encoding format. + */ + writeFile(path: string, format: "png", callback: ImageCallback): void; + + /** + * Execute batch and write to file + * + * @param path Path of file to write. + * @param format Encoding format. + * @param params Format-specific parameters. + */ + writeFile(path: string, format: "png", params: PngBufferParams, callback: ImageCallback): void; + + /** + * Execute batch and write to file + * + * @param path Path of file to write. + * @param format Encoding format. + */ + writeFile(path: string, format: "gif", callback: ImageCallback): void; + + /** + * Execute batch and write to file + * + * @param path Path of file to write. + * @param format Encoding format. + * @param params Format-specific parameters. + */ + writeFile(path: string, format: "gif", params: GifBufferParams, callback: ImageCallback): void; + + /** + * Execute batch and write to file + * + * @param path Path of file to write. + * @param format Encoding format. + */ + writeFile(path: string, format: string, callback: ImageCallback): void; + + /** + * Execute batch and write to file + * + * @param path Path of file to write. + * @param format Encoding format. + * @param params Format-specific parameters. + */ + writeFile(path: string, format: string, params: JpegBufferParams | PngBufferParams | GifBufferParams, callback: ImageCallback): void; + } +} diff --git a/mCustomScrollbar/mCustomScrollbar-tests.ts b/mCustomScrollbar/mCustomScrollbar-tests.ts index 983dc3a83..7dcf79356 100644 --- a/mCustomScrollbar/mCustomScrollbar-tests.ts +++ b/mCustomScrollbar/mCustomScrollbar-tests.ts @@ -22,9 +22,9 @@ class SimpleTestAllParams { this.element = $(".content"); this.element.mCustomScrollbar({ - set_width: false, - set_height: false, - horizontalScroll: false, + setWidth: false, + setHeight: false, + axis: "y", scrollInertia: 950, mouseWheel: true, mouseWheelPixels: "auto", @@ -147,4 +147,4 @@ class DisableDestroyTest { }); }); } -} \ No newline at end of file +} diff --git a/mCustomScrollbar/mCustomScrollbar.d.ts b/mCustomScrollbar/mCustomScrollbar.d.ts index f41aca00a..e20384968 100644 --- a/mCustomScrollbar/mCustomScrollbar.d.ts +++ b/mCustomScrollbar/mCustomScrollbar.d.ts @@ -10,15 +10,27 @@ declare module MCustomScrollbar { /** * Set the width of your content (overwrites CSS width), value in pixels (integer) or percentage (string) */ - set_width?: any; + setWidth?: any; /** * Set the height of your content (overwirtes CSS height), value in pixels (integer) or percentage (string) */ - set_height?: any; + setHeight?: any; /** - * Add horizontal scrollbar (default is vertical), value: true, false + * Define content’s scrolling axis (the type of scrollbars added to the element: vertical and/of horizontal). + * Available values: "y", "x", "yx". y -vertical, x - horizontal + */ + axis?: string; + /** + * Always keep scrollbar(s) visible, even when there’s nothing to scroll. + * 0 – disable (default) + * 1 – keep dragger rail visible + * 2 – keep all scrollbar components (dragger, rail, buttons etc.) visible */ - horizontalScroll?: boolean; + alwaysShowScrollbar?: number; + /** + * Enable or disable auto-expanding the scrollbar when cursor is over or dragging the scrollbar. + */ + autoExpandScrollbar?: boolean; /** * Scrolling inertia (easing), value in milliseconds (0 for no scrolling inertia) */ @@ -119,6 +131,12 @@ declare module MCustomScrollbar { * User defined callback function, triggered while scrolling */ whileScrolling?: () => void; + /** + * Set the behavior of calling onTotalScroll and onTotalScrollBack offsets. + * By default, callback offsets will trigger repeatedly while content is scrolling within the offsets. + * Set alwaysTriggerOffsets: false when you need to trigger onTotalScroll and onTotalScrollBack callbacks once, each time scroll end or beginning is reached. + */ + alwaysTriggerOffsets?: boolean; } /** * Set a scrollbar ready-to-use theme. See themes demo for all themes - http://manos.malihu.gr/tuts/custom-scrollbar-plugin/scrollbar_themes_demo.html @@ -132,10 +150,18 @@ declare module MCustomScrollbar { */ scrollInertia?: number; /** + * Scroll-to animation easing, values: "linear", "easeOut", "easeInOut". + */ + scrollEasing?: string; + /** * Scroll scrollbar dragger (instead of content) to a number of pixels, values: true, false */ moveDragger?: boolean; /** + * Set a timeout for the method (the default timeout is 60 ms in order to work with automatic scrollbar update), value in milliseconds. + */ + timeout?: number; + /** * Trigger user defined callback after scroll-to completes, value: true, false */ callbacks?: boolean; @@ -163,4 +189,4 @@ interface JQuery { * @param options Override default options */ mCustomScrollbar(options?: MCustomScrollbar.CustomScrollbarOptions): JQuery; -} \ No newline at end of file +} diff --git a/material-ui/legacy/material-ui-0.11.1-tests.tsx b/material-ui/legacy/material-ui-0.11.1-tests.tsx index c686efa9e..7f81cf177 100644 --- a/material-ui/legacy/material-ui-0.11.1-tests.tsx +++ b/material-ui/legacy/material-ui-0.11.1-tests.tsx @@ -1,7 +1,8 @@ -/// +/// /// import * as React from "react/addons"; + import mui = require("material-ui"); import Colors = require("material-ui/lib/styles/colors"); import AppBar = require("material-ui/lib/app-bar"); @@ -473,4 +474,4 @@ class MaterialUiTests extends React.Component<{}, {}> implements React.LinkedSta return element; } -} \ No newline at end of file +} diff --git a/material-ui/legacy/material-ui-0.11.1.d.ts b/material-ui/legacy/material-ui-0.11.1.d.ts index 7f464bc57..706a98537 100644 --- a/material-ui/legacy/material-ui-0.11.1.d.ts +++ b/material-ui/legacy/material-ui-0.11.1.d.ts @@ -3,7 +3,7 @@ // Definitions by: Nathan Brown // Definitions: https://github.com/borisyankov/DefinitelyTyped -/// +/// declare module "material-ui" { // The reason for exporting the namespace types (__MaterialUI.*) is to also export the type for casting variable. diff --git a/material-ui/legacy/material-ui-0.12.1-tests.tsx b/material-ui/legacy/material-ui-0.12.1-tests.tsx new file mode 100644 index 000000000..6792e9f4f --- /dev/null +++ b/material-ui/legacy/material-ui-0.12.1-tests.tsx @@ -0,0 +1,468 @@ +/// +/// + +import * as React from "react/addons"; +import Checkbox = require("material-ui/lib/checkbox"); +import Colors = require("material-ui/lib/styles/colors"); +import AppBar = require("material-ui/lib/app-bar"); +import IconButton = require("material-ui/lib/icon-button"); +import FlatButton = require("material-ui/lib/flat-button"); +import Avatar = require("material-ui/lib/avatar"); +import FontIcon = require("material-ui/lib/font-icon"); +import Typography = require("material-ui/lib/styles/typography"); +import RaisedButton = require("material-ui/lib/raised-button"); +import FloatingActionButton = require("material-ui/lib/floating-action-button"); +import Card = require("material-ui/lib/card/card"); +import CardHeader = require("material-ui/lib/card/card-header"); +import CardText = require("material-ui/lib/card/card-text"); +import CardActions = require("material-ui/lib/card/card-actions"); +import Dialog = require("material-ui/lib/dialog"); +import DropDownMenu = require("material-ui/lib/drop-down-menu"); +import RadioButtonGroup = require("material-ui/lib/radio-button-group"); +import RadioButton = require("material-ui/lib/radio-button"); +import Toggle = require("material-ui/lib/toggle"); +import TextField = require("material-ui/lib/text-field"); +import SelectField = require("material-ui/lib/select-field"); +import IconMenu = require("material-ui/lib/menus/icon-menu"); +import Menu = require('material-ui/lib/menus/menu'); +import MenuItem = require('material-ui/lib/menus/menu-item'); +import MenuDivider = require('material-ui/lib/menus/menu-divider'); +import ThemeManager = require('material-ui/lib/styles/theme-manager'); + +import NavigationClose = require("material-ui/lib/svg-icon"); // TODO: Should actually import the actual "material-ui/lib/svg-icons/navigation/close", but they aren't defined yet. +import FileFolder = require("material-ui/lib/svg-icon"); // TODO: Should actually import the actual "material-ui/lib/svg-icons/file/folder", but they aren't defined yet. +import ToggleStar = require("material-ui/lib/svg-icon"); // TODO: Should actually import the actual "material-ui/lib/svg-icons/toggle/star", but they aren't defined yet. +import ActionGrade = require("material-ui/lib/svg-icon"); // TODO: Should actually import the actual "material-ui/lib/svg-icons/action/grade", but they aren't defined yet. +import ToggleStarBorder = require("material-ui/lib/svg-icon"); // TODO: Should actually import the actual "material-ui/lib/svg-icons/toggle/star-border", but they aren't defined yet. +import ArrowDropRight = require("material-ui/lib/svg-icon"); // TODO: Should actually import the actual "material-ui/lib/svg-icons/toggle/star-border", but they aren't defined yet. + +type CheckboxProps = __MaterialUI.CheckboxProps; +type MuiTheme = __MaterialUI.Styles.MuiTheme; +type TouchTapEvent = __MaterialUI.TouchTapEvent; + +class MaterialUiTests extends React.Component<{}, {}> implements React.LinkedStateMixin { + + // injected with mixin + linkState: (key: string) => React.ReactLink; + dialog: Dialog; + + private touchTapEventHandler(e: TouchTapEvent) { + this.dialog.show(); + } + private formEventHandler(e: React.FormEvent) { + } + private selectFieldChangeHandler(e: TouchTapEvent, si: number, mi: any) { + } + + render() { + + // "http://material-ui.com/#/customization/themes" + let muiTheme: MuiTheme = ThemeManager.getMuiTheme({ + palette: { + accent1Color: Colors.cyan100 + }, + spacing: { + + } + }); + + // "http://material-ui.com/#/customization/inline-styles" + let element: React.ReactElement; + element = + element = React.createElement(Checkbox, { + id: "checkboxId1", name: "checkboxName1", value: "checkboxValue1", label: "went for a run today", style: { + width: '50%', + margin: '0 auto' + }, iconStyle: { + fill: '#FF4081' + } + }); + + // "http://material-ui.com/#/components/appbar" + element = + element = } + iconElementRight={} />; + + // "http://material-ui.com/#/components/avatars" + //image avatar + element = ; + //SvgIcon avatar + element = } />; + //SvgIcon avatar with custom colors + element = } + color={Colors.orange200} + backgroundColor={Colors.pink400} />; + //FontIcon avatar + element = + } />; + //FontIcon avatar with custom colors + element = } + color={Colors.blue300} + backgroundColor={Colors.indigo900} />; + //Letter avatar + element = A; + //Letter avatar with custom colors + element = + + + + // "http://material-ui.com/#/components/buttons" + element = + + ; + element = + + ; + element = + + ; + + // "http://material-ui.com/#/components/cards" + element = + A} + showExpandableButton={true}> + + + Lorem ipsum dolor sit amet, consectetur adipiscing elit. + + + + + + + Lorem ipsum dolor sit amet, consectetur adipiscing elit. + + ; + + // "http://material-ui.com/#/components/date-picker" + + + // "http://material-ui.com/#/components/dialog" + let standardActions = [ + { text: 'Cancel' }, + { text: 'Submit', onTouchTap: this.touchTapEventHandler, ref: 'submit' } + ]; + + element = + The actions in this window are created from the json that's passed in. + ; + + //Custom Actions + let customActions = [ + , + + ]; + + element = + The actions in this window were passed in as an array of react objects. + ; + + + // "http://material-ui.com/#/components/dropdown-menu" + let menuItems = [ + { payload: '1', text: 'Never' }, + { payload: '2', text: 'Every Night' }, + { payload: '3', text: 'Weeknights' }, + { payload: '4', text: 'Weekends' }, + { payload: '5', text: 'Weekly' }, + ]; + element = ; + + // "http://material-ui.com/#/components/icons" + element = home; + + // "http://material-ui.com/#/components/icon-buttons" + //Method 1: muidocs-icon-github is defined in a style sheet. + element = ; + //Method 2: ActionGrade is a component created using mui.SvgIcon. + element = + + ; + //Method 3: Manually creating a mui.FontIcon component within IconButton + element = + + ; + //Method 4: Using Google material-icons + element = settings_system_daydream; + + // "http://material-ui.com/#/components/icon-menus" + element = }> + + + + + + ; + + // "http://material-ui.com/#/components/left-nav" + + + // "http://material-ui.com/#/components/lists" + + + // "http://material-ui.com/#/components/menus" + element = + + + + + ; + element = + + + + + + + + } /> + } /> + } /> + } /> + } /> + + + ; + + // "http://material-ui.com/#/components/paper" + + + // "http://material-ui.com/#/components/progress" + + + // "http://material-ui.com/#/components/refresh-indicator" + + + // "http://material-ui.com/#/components/sliders" + + + // "http://material-ui.com/#/components/switches" + element = ; + element = ; + element = } + unCheckedIcon={} + label="custom icon" />; + + element = + ; + ; + + ; + + element = ; + + element = ; + + element = ; + + // "http://material-ui.com/#/components/snackbar" + + + // "http://material-ui.com/#/components/table" + + + // "http://material-ui.com/#/components/tabs" + + + // "http://material-ui.com/#/components/text-fields" + element = ; + element = ; + element = ; + element = ; + element = ('valueLinkValue') } />; + element = ; + element = ; + element = ; + element = ; + element = ; + element = ; + element = ; + + //Select Fields + let arbitraryArrayMenuItems = [ + { + id: 0, + name: "zero", + }, + ]; + element = ; + element = ; + element = ; + element = ; + + //Floating Hint Text Labels + element = ; + element = ; + element = ; + element = ('floatingValueLinkValue') } />; + element = ; + element = ; + element = ; + element = ; + element = ; + element = ; + + + // "http://material-ui.com/#/components/time-picker" + + + // "http://material-ui.com/#/components/toolbars" + + return element; + } +} diff --git a/material-ui/legacy/material-ui-0.12.1.d.ts b/material-ui/legacy/material-ui-0.12.1.d.ts new file mode 100644 index 000000000..23b438357 --- /dev/null +++ b/material-ui/legacy/material-ui-0.12.1.d.ts @@ -0,0 +1,2249 @@ +// Type definitions for material-ui v0.12.1 +// Project: https://github.com/callemall/material-ui +// Definitions by: Nathan Brown +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module "material-ui" { + export import AppBar = __MaterialUI.AppBar; // require('material-ui/lib/app-bar'); + export import AppCanvas = __MaterialUI.AppCanvas; // require('material-ui/lib/app-canvas'); + export import Avatar = __MaterialUI.Avatar; // require('material-ui/lib/avatar'); + export import BeforeAfterWrapper = __MaterialUI.BeforeAfterWrapper; // require('material-ui/lib/before-after-wrapper'); + export import Card = __MaterialUI.Card.Card; // require('material-ui/lib/card/card'); + export import CardActions = __MaterialUI.Card.CardActions; // require('material-ui/lib/card/card-actions'); + export import CardExpandable = __MaterialUI.Card.CardExpandable; // require('material-ui/lib/card/card-expandable'); + export import CardHeader = __MaterialUI.Card.CardHeader; // require('material-ui/lib/card/card-header'); + export import CardMedia = __MaterialUI.Card.CardMedia; // require('material-ui/lib/card/card-media'); + export import CardText = __MaterialUI.Card.CardText; // require('material-ui/lib/card/card-text'); + export import CardTitle = __MaterialUI.Card.CardTitle; // require('material-ui/lib/card/card-title'); + export import Checkbox = __MaterialUI.Checkbox; // require('material-ui/lib/checkbox'); + export import CircularProgress = __MaterialUI.CircularProgress; // require('material-ui/lib/circular-progress'); + export import ClearFix = __MaterialUI.ClearFix; // require('material-ui/lib/clearfix'); + export import DatePicker = __MaterialUI.DatePicker.DatePicker; // require('material-ui/lib/date-picker/date-picker'); + export import DatePickerDialog = __MaterialUI.DatePicker.DatePickerDialog; // require('material-ui/lib/date-picker/date-picker-dialog'); + export import Dialog = __MaterialUI.Dialog // require('material-ui/lib/dialog'); + export import DropDownIcon = __MaterialUI.DropDownIcon; // require('material-ui/lib/drop-down-icon'); + export import DropDownMenu = __MaterialUI.DropDownMenu; // require('material-ui/lib/drop-down-menu'); + export import EnhancedButton = __MaterialUI.EnhancedButton; // require('material-ui/lib/enhanced-button'); + export import FlatButton = __MaterialUI.FlatButton; // require('material-ui/lib/flat-button'); + export import FloatingActionButton = __MaterialUI.FloatingActionButton; // require('material-ui/lib/floating-action-button'); + export import FontIcon = __MaterialUI.FontIcon; // require('material-ui/lib/font-icon'); + export import IconButton = __MaterialUI.IconButton; // require('material-ui/lib/icon-button'); + export import IconMenu = __MaterialUI.Menus.IconMenu; // require('material-ui/lib/menus/icon-menu'); + export import LeftNav = __MaterialUI.LeftNav; // require('material-ui/lib/left-nav'); + export import LinearProgress = __MaterialUI.LinearProgress; // require('material-ui/lib/linear-progress'); + export import List = __MaterialUI.Lists.List; // require('material-ui/lib/lists/list'); + export import ListDivider = __MaterialUI.Lists.ListDivider; // require('material-ui/lib/lists/list-divider'); + export import ListItem = __MaterialUI.Lists.ListItem; // require('material-ui/lib/lists/list-item'); + export import Menu = __MaterialUI.Menu.Menu; // require('material-ui/lib/menu/menu'); + export import MenuItem = __MaterialUI.Menu.MenuItem; // require('material-ui/lib/menu/menu-item'); + export import Mixins = __MaterialUI.Mixins; // require('material-ui/lib/mixins/'); + export import Overlay = __MaterialUI.Overlay; // require('material-ui/lib/overlay'); + export import Paper = __MaterialUI.Paper; // require('material-ui/lib/paper'); + export import RadioButton = __MaterialUI.RadioButton; // require('material-ui/lib/radio-button'); + export import RadioButtonGroup = __MaterialUI.RadioButtonGroup; // require('material-ui/lib/radio-button-group'); + export import RaisedButton = __MaterialUI.RaisedButton; // require('material-ui/lib/raised-button'); + export import RefreshIndicator = __MaterialUI.RefreshIndicator; // require('material-ui/lib/refresh-indicator'); + export import Ripples = __MaterialUI.Ripples; // require('material-ui/lib/ripples/'); + export import SelectField = __MaterialUI.SelectField; // require('material-ui/lib/select-field'); + export import Slider = __MaterialUI.Slider; // require('material-ui/lib/slider'); + export import SvgIcon = __MaterialUI.SvgIcon; // require('material-ui/lib/svg-icon'); + export import Icons = __MaterialUI.Icons; + export import Styles = __MaterialUI.Styles; // require('material-ui/lib/styles/'); + export import Snackbar = __MaterialUI.Snackbar; // require('material-ui/lib/snackbar'); + export import Tab = __MaterialUI.Tabs.Tab; // require('material-ui/lib/tabs/tab'); + export import Tabs = __MaterialUI.Tabs.Tabs; // require('material-ui/lib/tabs/tabs'); + export import Table = __MaterialUI.Table.Table; // require('material-ui/lib/table/table'); + export import TableBody = __MaterialUI.Table.TableBody; // require('material-ui/lib/table/table-body'); + export import TableFooter = __MaterialUI.Table.TableFooter; // require('material-ui/lib/table/table-footer'); + export import TableHeader = __MaterialUI.Table.TableHeader; // require('material-ui/lib/table/table-header'); + export import TableHeaderColumn = __MaterialUI.Table.TableHeaderColumn; // require('material-ui/lib/table/table-header-column'); + export import TableRow = __MaterialUI.Table.TableRow; // require('material-ui/lib/table/table-row'); + export import TableRowColumn = __MaterialUI.Table.TableRowColumn; // require('material-ui/lib/table/table-row-column'); + export import ThemeWrapper = __MaterialUI.ThemeWrapper; // require('material-ui/lib/theme-wrapper'); + export import Toggle = __MaterialUI.Toggle; // require('material-ui/lib/toggle'); + export import TimePicker = __MaterialUI.TimePicker; // require('material-ui/lib/time-picker'); + export import TextField = __MaterialUI.TextField; // require('material-ui/lib/text-field'); + export import Toolbar = __MaterialUI.Toolbar.Toolbar; // require('material-ui/lib/toolbar/toolbar'); + export import ToolbarGroup = __MaterialUI.Toolbar.ToolbarGroup; // require('material-ui/lib/toolbar/toolbar-group'); + export import ToolbarSeparator = __MaterialUI.Toolbar.ToolbarSeparator; // require('material-ui/lib/toolbar/toolbar-separator'); + export import ToolbarTitle = __MaterialUI.Toolbar.ToolbarTitle; // require('material-ui/lib/toolbar/toolbar-title'); + export import Tooltip = __MaterialUI.Tooltip; // require('material-ui/lib/tooltip'); + export import Utils = __MaterialUI.Utils; // require('material-ui/lib/utils/'); + + // export type definitions + export type TouchTapEvent = __MaterialUI.TouchTapEvent; + export type TouchTapEventHandler = __MaterialUI.TouchTapEventHandler; + export type DialogAction = __MaterialUI.DialogAction; +} + +declare namespace __MaterialUI { + import React = __React; + + // ReactLink is from "react/addons" + interface ReactLink { + value: T; + requestChange(newValue: T): void; + } + + // What's common between React.TouchEvent and React.MouseEvent + interface TouchTapEvent extends React.SyntheticEvent { + altKey: boolean; + ctrlKey: boolean; + getModifierState(key: string): boolean; + metaKey: boolean; + shiftKey: boolean; + } + + // What's common between React.TouchEventHandler and React.MouseEventHandler + interface TouchTapEventHandler extends React.EventHandler { } + + // more specific than React.HTMLAttributes + + interface AppBarProps extends React.Props { + iconClassNameLeft?: string; + iconClassNameRight?: string; + iconElementLeft?: React.ReactElement; + iconElementRight?: React.ReactElement; + iconStyleRight?: string; + style?: React.CSSProperties; + showMenuIconButton?: boolean; + title?: React.ReactNode; + zDepth?: number; + + onLeftIconButtonTouchTap?: TouchTapEventHandler; + onRightIconButtonTouchTap?: TouchTapEventHandler; + } + export class AppBar extends React.Component{ + } + + interface AppCanvasProps extends React.Props { + } + export class AppCanvas extends React.Component { + } + + interface AvatarProps extends React.Props { + icon?: React.ReactElement; + backgroundColor?: string; + color?: string; + size?: number; + src?: string; + style?: React.CSSProperties; + } + export class Avatar extends React.Component { + } + + interface BeforeAfterWrapperProps extends React.Props { + beforeStyle?: React.CSSProperties; + afterStyle?: React.CSSProperties; + beforeElementType?: string; + afterElementType?: string; + elementType?: string; + } + export class BeforeAfterWrapper extends React.Component { + } + + namespace Card { + + interface CardProps extends React.Props { + expandable?: boolean; + initiallyExpanded?: boolean; + onExpandedChange?: (isExpanded: boolean) => void; + style?: React.CSSProperties; + } + export class Card extends React.Component { + } + + interface CardActionsProps extends React.Props { + expandable?: boolean; + showExpandableButton?: boolean; + } + export class CardActions extends React.Component { + } + + interface CardExpandableProps extends React.Props { + onExpanding?: (isExpanded: boolean) => void; + expanded?: boolean; + } + export class CardExpandable extends React.Component { + } + + interface CardHeaderProps extends React.Props { + expandable?: boolean; + showExpandableButton?: boolean; + title?: string | React.ReactElement; + titleColor?: string; + titleStyle?: React.CSSProperties; + subtitle?: string | React.ReactElement; + subtitleColor?: string; + subtitleStyle?: React.CSSProperties; + textStyle?: React.CSSProperties; + style?: React.CSSProperties; + avatar: React.ReactElement | string; + } + export class CardHeader extends React.Component { + } + + interface CardMediaProps extends React.Props { + expandable?: boolean; + overlay?: React.ReactNode; + overlayStyle?: React.CSSProperties; + overlayContainerStyle?: React.CSSProperties; + overlayContentStyle?: React.CSSProperties; + mediaStyle?: React.CSSProperties; + style?: React.CSSProperties; + } + export class CardMedia extends React.Component { + } + + interface CardTextProps extends React.Props { + expandable?: boolean; + color?: string; + style?: React.CSSProperties; + } + export class CardText extends React.Component { + } + + interface CardTitleProps extends React.Props { + expandable?: boolean; + showExpandableButton?: boolean; + title?: string | React.ReactElement; + titleColor?: string; + titleStyle?: React.CSSProperties; + subtitle?: string | React.ReactElement; + subtitleColor?: string; + subtitleStyle?: React.CSSProperties; + textStyle?: React.CSSProperties; + style?: React.CSSProperties; + } + export class CardTitle extends React.Component { + } + } + + // what's not commonly overridden by Checkbox, RadioButton, or Toggle + interface CommonEnhancedSwitchProps extends React.HTMLAttributesBase { + // is root element + id?: string; + iconStyle?: React.CSSProperties; + labelStyle?: React.CSSProperties; + rippleStyle?: React.CSSProperties; + thumbStyle?: React.CSSProperties; + trackStyle?: React.CSSProperties; + name?: string; + value?: string; + label?: string; + required?: boolean; + disabled?: boolean; + defaultSwitched?: boolean; + disableFocusRipple?: boolean; + disableTouchRipple?: boolean; + } + + interface EnhancedSwitchProps extends CommonEnhancedSwitchProps { + // is root element + inputType: string; + switchElement: React.ReactElement; + onParentShouldUpdate: (isInputChecked: boolean) => void; + switched: boolean; + rippleColor?: string; + onSwitch?: (e: React.MouseEvent, isInputChecked: boolean) => void; + labelPosition?: string; + } + export class EnhancedSwitch extends React.Component { + isSwitched(): boolean; + setSwitched(newSwitchedValue: boolean): void; + getValue(): any; + isKeyboardFocused(): boolean; + } + + interface CheckboxProps extends CommonEnhancedSwitchProps { + // is root element + checkedIcon?: React.ReactElement<{ style?: React.CSSProperties }>; // Normally an SvgIcon + defaultChecked?: boolean; + iconStyle?: React.CSSProperties; + label?: string; + labelStyle?: React.CSSProperties; + labelPosition?: string; + style?: React.CSSProperties; + checked?: boolean; + unCheckedIcon?: React.ReactElement<{ style?: React.CSSProperties }>; // Normally an SvgIcon + + disabled?: boolean; + valueLink?: ReactLink; + checkedLink?: ReactLink; + + onCheck?: (event: React.MouseEvent, checked: boolean) => void; + } + export class Checkbox extends React.Component { + isChecked(): void; + setChecked(newCheckedValue: boolean): void; + } + + interface CircularProgressProps extends React.Props { + mode?: string; + value?: number; + min?: number; + max?: number; + size?: number; + color?: string; + innerStyle?: React.CSSProperties; + + } + export class CircularProgress extends React.Component { + } + + interface ClearFixProps extends React.Props { + } + export class ClearFix extends React.Component { + } + + namespace DatePicker { + interface DatePickerProps extends React.Props { + autoOk?: boolean; + defaultDate?: Date; + formatDate?: string; + hideToolbarYearChange?: boolean; + maxDate?: Date; + minDate?: Date; + mode?: string; + onDismiss?: () => void; + + // e is always null + onChange?: (e: any, d: Date) => void; + + onFocus?: React.FocusEventHandler; + onShow?: () => void; + onTouchTap?: React.TouchEventHandler; + shouldDisableDate?: (day: Date) => boolean; + showYearSelector?: boolean; + textFieldStyle?: React.CSSProperties; + } + export class DatePicker extends React.Component { + } + + interface DatePickerDialogProps extends React.Props { + disableYearSelection?: boolean; + initialDate?: Date; + maxDate?: Date; + minDate?: Date; + onAccept?: (d: Date) => void; + onClickAway?: () => void; + onDismiss?: () => void; + onShow?: () => void; + shouldDisableDate?: (day: Date) => boolean; + showYearSelector?: boolean; + } + export class DatePickerDialog extends React.Component { + } + } + + export interface DialogAction { + id?: string; + text: string; + ref?: string; + + onTouchTap?: TouchTapEventHandler; + onClick?: React.MouseEventHandler; + } + interface DialogProps extends React.Props { + actions?: Array>; + actionFocus?: string; + autoDetectWindowHeight?: boolean; + autoScrollBodyContent?: boolean; + bodyStyle?: React.CSSProperties; + contentClassName?: string; + contentInnerStyle?: React.CSSProperties; + contentStyle?: React.CSSProperties; + modal?: boolean; + openImmediately?: boolean; + repositionOnUpdate?: boolean; + title?: React.ReactNode; + + onClickAway?: () => void; + onDismiss?: () => void; + onShow?: () => void; + } + export class Dialog extends React.Component { + dismiss(): void; + show(): void; + } + + interface DropDownIconProps extends React.Props { + menuItems: Menu.MenuItemRequest[]; + closeOnMenuItemTouchTap?: boolean; + iconStyle?: React.CSSProperties; + iconClassName?: string; + iconLigature?: string; + + onChange?: Menu.ItemTapEventHandler; + } + export class DropDownIcon extends React.Component { + } + + interface DropDownMenuProps extends React.Props { + displayMember?: string; + valueMember?: string; + autoWidth?: boolean; + menuItems: Menu.MenuItemRequest[]; + menuItemStyle?: React.CSSProperties; + selectedIndex?: number; + underlineStyle?: React.CSSProperties; + iconStyle?: React.CSSProperties; + labelStyle?: React.CSSProperties; + style?: React.CSSProperties; + disabled?: boolean; + valueLink?: ReactLink; + value?: number; + + onChange?: Menu.ItemTapEventHandler; + } + export class DropDownMenu extends React.Component { + } + + // non generally overridden elements of EnhancedButton + interface SharedEnhancedButtonProps extends React.HTMLAttributesBase { + centerRipple?: boolean; + containerElement?: string | React.ReactElement; + disabled?: boolean; + disableFocusRipple?: boolean; + disableKeyboardFocus?: boolean; + disableTouchRipple?: boolean; + keyboardFocused?: boolean; + linkButton?: boolean; + focusRippleColor?: string; + focusRippleOpacity?: number; + touchRippleOpacity?: number; + tabIndex?: number; + + onBlur?: React.FocusEventHandler; + onFocus?: React.FocusEventHandler; + onKeyboardFocus?: (e: React.FocusEvent, isKeyboardFocused: boolean) => void; + onKeyDown?: React.KeyboardEventHandler; + onKeyUp?: React.KeyboardEventHandler; + onMouseEnter?: React.MouseEventHandler; + onMouseLeave?: React.MouseEventHandler; + onTouchStart?: React.TouchEventHandler; + onTouchEnd?: React.TouchEventHandler; + onTouchTap?: TouchTapEventHandler; + } + + interface EnhancedButtonProps extends SharedEnhancedButtonProps { + touchRippleColor?: string; + focusRippleColor?: string; + style?: React.CSSProperties; + } + export class EnhancedButton extends React.Component { + } + + interface FlatButtonProps extends SharedEnhancedButtonProps { + hoverColor?: string; + label?: string; + labelPosition?: string; + labelStyle?: React.CSSProperties; + linkButton?: boolean; + primary?: boolean; + secondary?: boolean; + rippleColor?: string; + style?: React.CSSProperties; + } + export class FlatButton extends React.Component { + } + + interface FloatingActionButtonProps extends SharedEnhancedButtonProps { + backgroundColor?: string; + disabled?: boolean; + disabledColor?: string; + iconClassName?: string; + iconStyle?: React.CSSProperties; + mini?: boolean; + secondary?: boolean; + style?: React.CSSProperties; + } + export class FloatingActionButton extends React.Component { + } + + interface FontIconProps extends React.Props { + color?: string; + hoverColor?: string; + onMouseLeave?: React.MouseEventHandler; + onMouseEnter?: React.MouseEventHandler; + style?: React.CSSProperties; + className?: string; + } + export class FontIcon extends React.Component { + } + + interface IconButtonProps extends SharedEnhancedButtonProps { + iconClassName?: string; + iconStyle?: React.CSSProperties; + style?: React.CSSProperties; + tooltip?: string; + tooltipPosition?: string; + tooltipStyles?: React.CSSProperties; + touch?: boolean; + + onBlur?: React.FocusEventHandler; + onFocus?: React.FocusEventHandler; + } + export class IconButton extends React.Component { + } + + interface LeftNavProps extends React.Props { + disableSwipeToOpen?: boolean; + docked?: boolean; + header?: React.ReactElement; + menuItems: Menu.MenuItemRequest[]; + onChange?: Menu.ItemTapEventHandler; + onNavOpen?: () => void; + onNavClose?: () => void; + openRight?: Boolean; + selectedIndex?: number; + menuItemClassName?: string; + menuItemClassNameSubheader?: string; + menuItemClassNameLink?: string; + } + export class LeftNav extends React.Component { + } + + interface LinearProgressProps extends React.Props { + mode?: string; + value?: number; + min?: number; + max?: number; + } + export class LinearProgress extends React.Component { + } + + namespace Lists { + interface ListProps extends React.Props { + insetSubheader?: boolean; + subheader?: string; + subheaderStyle?: React.CSSProperties; + zDepth?: number; + } + export class List extends React.Component { + } + + interface ListDividerProps extends React.Props { + inset?: boolean; + } + export class ListDivider extends React.Component { + } + + interface ListItemProps extends React.Props { + autoGenerateNestedIndicator?: boolean; + disableKeyboardFocus?: boolean; + initiallyOpen?: boolean; + innerDivStyle?: React.CSSProperties; + insetChildren?: boolean; + innerStyle?: React.CSSProperties; + leftAvatar?: React.ReactElement; + leftCheckbox?: React.ReactElement; + leftIcon?: React.ReactElement; + nestedLevel?: number; + nestedItems?: React.ReactElement[]; + onKeyboardFocus?: React.FocusEventHandler; + onNestedListToggle?: (item: ListItem) => void; + rightAvatar?: React.ReactElement; + rightIcon?: React.ReactElement; + rightIconButton?: React.ReactElement; + rightToggle?: React.ReactElement; + primaryText?: React.ReactNode; + secondaryText?: React.ReactNode; + secondaryTextLines?: number; + } + export class ListItem extends React.Component { + } + } + + // Old menu implementation. Being replaced by new "menus". + namespace Menu { + interface ItemTapEventHandler { + (e: TouchTapEvent, index: number, menuItem: MenuItemRequest): void; + } + + // almost extends MenuItemProps, but certain required items are generated in Menu and not passed here. + interface MenuItemRequest extends React.Props { + // use value from MenuItem.Types.* + type?: string; + + text?: string; + data?: string; + payload?: string; + icon?: React.ReactElement; + attribute?: string; + number?: string; + toggle?: boolean; + onTouchTap?: TouchTapEventHandler; + isDisabled?: boolean; + + // for MenuItems.Types.NESTED + items?: MenuItemRequest[]; + + // for custom text or payloads + [propertyName: string]: any; + } + + interface MenuProps extends React.Props { + index: number; + text?: string; + menuItems: MenuItemRequest[]; + zDepth?: number; + active?: boolean; + onItemTap?: ItemTapEventHandler; + menuItemStyle?: React.CSSProperties; + } + export class Menu extends React.Component { + } + + interface MenuItemProps extends React.Props { + index: number; + icon?: React.ReactElement; + iconClassName?: string; + iconRightClassName?: string; + iconStyle?: React.CSSProperties; + iconRightStyle?: React.CSSProperties; + attribute?: string; + number?: string; + data?: string; + toggle?: boolean; + onTouchTap?: (e: React.MouseEvent, key: number) => void; + onToggle?: (e: React.MouseEvent, key: number, toggled: boolean) => void; + selected?: boolean; + active?: boolean; + } + export class MenuItem extends React.Component { + static Types: { LINK: string, SUBHEADER: string, NESTED: string, } + } + } + + export namespace Mixins { + interface ClickAwayable extends React.Mixin { + } + var ClickAwayable: ClickAwayable; + + interface WindowListenable extends React.Mixin { + } + var WindowListenable: WindowListenable; + + interface StylePropable extends React.Mixin { + } + var StylePropable: StylePropable + + interface StyleResizable extends React.Mixin { + } + var StyleResizable: StyleResizable + } + + interface OverlayProps extends React.Props { + autoLockScrolling?: boolean; + show?: boolean; + transitionEnabled?: boolean; + } + export class Overlay extends React.Component { + } + + interface PaperProps extends React.HTMLAttributesBase { + circle?: boolean; + rounded?: boolean; + transitionEnabled?: boolean; + zDepth?: number; + } + export class Paper extends React.Component { + } + + interface RadioButtonProps extends CommonEnhancedSwitchProps { + // is root element + defaultChecked?: boolean; + iconStyle?: React.CSSProperties; + label?: string; + labelStyle?: React.CSSProperties; + labelPosition?: string; + style?: React.CSSProperties; + value?: string; + + onCheck?: (e: React.FormEvent, selected: string) => void; + } + export class RadioButton extends React.Component { + } + + interface RadioButtonGroupProps extends React.Props { + defaultSelected?: string; + labelPosition?: string; + name: string; + style?: React.CSSProperties; + valueSelected?: string; + + onChange?: (e: React.FormEvent, selected: string) => void; + } + export class RadioButtonGroup extends React.Component { + getSelectedValue(): string; + setSelectedValue(newSelectionValue: string): void; + clearValue(): void; + } + + interface RaisedButtonProps extends SharedEnhancedButtonProps { + className?: string; + disabled?: boolean; + label?: string; + primary?: boolean; + secondary?: boolean; + labelStyle?: React.CSSProperties; + backgroundColor?: string; + labelColor?: string; + disabledBackgroundColor?: string; + disabledLabelColor?: string; + fullWidth?: boolean; + } + export class RaisedButton extends React.Component { + } + + interface RefreshIndicatorProps extends React.Props { + left: number; + percentage?: number; + size?: number; + status?: string; + top: number; + } + export class RefreshIndicator extends React.Component { + } + + namespace Ripples { + interface CircleRippleProps extends React.Props { + color?: string; + opacity?: number; + } + export class CircleRipple extends React.Component { + } + + interface FocusRippleProps extends React.Props { + color?: string; + innerStyle?: React.CSSProperties; + opacity?: number; + show?: boolean; + } + export class FocusRipple extends React.Component { + } + + interface TouchRippleProps extends React.Props { + centerRipple?: boolean; + color?: string; + opacity?: number; + } + export class TouchRipple extends React.Component { + } + } + + interface SelectFieldProps extends React.Props { + // passed to TextField + errorStyle?: React.CSSProperties; + errorText?: string; + floatingLabelText?: string; + floatingLabelStyle?: React.CSSProperties; + fullWidth?: boolean; + hintText?: string | React.ReactElement; + + // passed to DropDownMenu + displayMember?: string; + valueMember?: string; + autoWidth?: boolean; + menuItems: Menu.MenuItemRequest[]; + menuItemStyle?: React.CSSProperties; + selectedIndex?: number; + underlineStyle?: React.CSSProperties; + iconStyle?: React.CSSProperties; + labelStyle?: React.CSSProperties; + style?: React.CSSProperties; + disabled?: boolean; + valueLink?: ReactLink; + value?: number; + + onChange?: Menu.ItemTapEventHandler; + onEnterKeyDown?: React.KeyboardEventHandler; + + // own properties + selectFieldRoot?: string; + multiLine?: boolean; + type?: string; + rows?: number; + inputStyle?: React.CSSProperties; + } + export class SelectField extends React.Component { + } + + interface SliderProps extends React.Props { + name: string; + defaultValue?: number; + description?: string; + error?: string; + max?: number; + min?: number; + required?: boolean; + step?: number; + value?: number; + } + export class Slider extends React.Component { + } + + interface SvgIconProps extends React.Props { + color?: string; + hoverColor?: string; + viewBox?: string; + } + export class SvgIcon extends React.Component { + } + + export namespace Icons { + export import NavigationMenu = __MaterialUI.NavigationMenu; + export import NavigationChevronLeft = __MaterialUI.NavigationChevronLeft; + export import NavigationChevronRight = __MaterialUI.NavigationChevronRight; + } + + interface NavigationMenuProps extends React.Props { + } + export class NavigationMenu extends React.Component { + } + + interface NavigationChevronLeftProps extends React.Props { + } + export class NavigationChevronLeft extends React.Component { + } + + interface NavigationChevronRightProps extends React.Props { + } + export class NavigationChevronRight extends React.Component { + } + + export namespace Styles { + interface AutoPrefix { + all(styles: React.CSSProperties): React.CSSProperties; + set(style: React.CSSProperties, key: string, value: string | number): void; + single(key: string): string; + singleHyphened(key: string): string; + } + export var AutoPrefix: AutoPrefix; + + interface Spacing { + iconSize?: number; + + desktopGutter?: number; + desktopGutterMore?: number; + desktopGutterLess?: number; + desktopGutterMini?: number; + desktopKeylineIncrement?: number; + desktopDropDownMenuItemHeight?: number; + desktopDropDownMenuFontSize?: number; + desktopLeftNavMenuItemHeight?: number; + desktopSubheaderHeight?: number; + desktopToolbarHeight?: number; + } + interface ThemePalette { + primary1Color?: string; + primary2Color?: string; + primary3Color?: string; + accent1Color?: string; + accent2Color?: string; + accent3Color?: string; + textColor?: string; + canvasColor?: string; + borderColor?: string; + disabledColor?: string; + alternateTextColor?: string; + } + interface MuiTheme { + rawTheme: RawTheme; + static: boolean; + appBar?: { + color?: string, + textColor?: string, + height?: number + }, + avatar?: { + borderColor?: string; + } + button?: { + height?: number, + minWidth?: number, + iconButtonSize?: number + }, + checkbox?: { + boxColor?: string, + checkedColor?: string, + requiredColor?: string, + disabledColor?: string, + labelColor?: string, + labelDisabledColor?: string + }, + datePicker?: { + color?: string, + textColor?: string, + calendarTextColor?: string, + selectColor?: string, + selectTextColor?: string, + }, + dropDownMenu?: { + accentColor?: string, + }, + flatButton?: { + color?: string, + textColor?: string, + primaryTextColor?: string, + secondaryTextColor?: string, + disabledColor?: string + }, + floatingActionButton?: { + buttonSize?: number, + miniSize?: number, + color?: string, + iconColor?: string, + secondaryColor?: string, + secondaryIconColor?: string, + disabledColor?: string, + disabledTextColor?: string + }, + inkBar?: { + backgroundColor?: string; + }, + leftNav?: { + width?: number, + color?: string, + }, + listItem?: { + nestedLevelDepth?: number; + }, + menu?: { + backgroundColor?: string, + containerBackgroundColor?: string, + }, + menuItem?: { + dataHeight?: number, + height?: number, + hoverColor?: string, + padding?: number, + selectedTextColor?: string, + }, + menuSubheader?: { + padding?: number, + borderColor?: string, + textColor?: string, + }, + paper?: { + backgroundColor?: string, + }, + radioButton?: { + borderColor?: string, + backgroundColor?: string, + checkedColor?: string, + requiredColor?: string, + disabledColor?: string, + size?: number, + labelColor?: string, + labelDisabledColor?: string + }, + raisedButton?: { + color?: string, + textColor?: string, + primaryColor?: string, + primaryTextColor?: string, + secondaryColor?: string, + secondaryTextColor?: string, + disabledColor?: string, + disabledTextColor?: string + }, + refreshIndicator?: { + strokeColor?: string; + loadingStrokeColor?: string; + }; + slider?: { + trackSize?: number, + trackColor?: string, + trackColorSelected?: string, + handleSize?: number, + handleSizeActive?: number, + handleSizeDisabled?: number, + handleColorZero?: string, + handleFillColor?: string, + selectionColor?: string, + rippleColor?: string, + }, + snackbar?: { + textColor?: string, + backgroundColor?: string, + actionColor?: string, + }, + table?: { + backgroundColor?: string; + }; + tableHeader?: { + borderColor?: string; + }; + tableHeaderColumn?: { + textColor?: string; + }; + tableFooter?: { + borderColor?: string; + textColor?: string; + }; + tableRow?: { + hoverColor?: string; + stripeColor?: string; + selectedColor?: string; + textColor?: string; + borderColor?: string; + }; + tableRowColumn?: { + height?: number; + spacing?: number; + }; + timePicker?: { + color?: string; + textColor?: string; + accentColor?: string; + clockColor?: string; + selectColor?: string; + selectTextColor?: string; + }; + toggle?: { + thumbOnColor?: string, + thumbOffColor?: string, + thumbDisabledColor?: string, + thumbRequiredColor?: string, + trackOnColor?: string, + trackOffColor?: string, + trackDisabledColor?: string, + trackRequiredColor?: string, + labelColor?: string, + labelDisabledColor?: string + }, + toolbar?: { + backgroundColor?: string, + height?: number, + titleFontSize?: number, + iconColor?: string, + separatorColor?: string, + menuHoverColor?: string, + }; + tabs?: { + backgroundColor?: string; + }; + textField?: { + textColor?: string; + hintColor?: string; + floatingLabelColor?: string; + disabledTextColor?: string; + errorColor?: string; + focusColor?: string; + backgroundColor?: string; + borderColor?: string; + }; + } + + interface RawTheme { + spacing: Spacing; + fontFamily?: string; + palette: ThemePalette; + } + + export function ThemeDecorator(muiTheme: Styles.MuiTheme):

    (Component: React.ComponentClass

    ) => React.ComponentClass

    ; + + interface ThemeManager { + getMuiTheme(rawTheme: RawTheme): MuiTheme; + modifyRawThemeSpacing(muiTheme: MuiTheme, newSpacing: Spacing): MuiTheme; + modifyRawThemePalette(muiTheme: MuiTheme, newPaletteKeys: ThemePalette): MuiTheme; + modifyRawThemeFontFamily(muiTheme: MuiTheme, newFontFamily: string): MuiTheme; + } + export var ThemeManager: ThemeManager; + + interface Transitions { + easeOut(duration?: string, property?: string | string[], delay?: string, easeFunction?: string): string; + create(duration?: string, property?: string, delay?: string, easeFunction?: string): string; + easeOutFunction: string; + easeInOutFunction: string; + } + export var Transitions: Transitions; + + interface Typography { + textFullBlack:string; + textDarkBlack: string; + textLightBlack: string; + textMinBlack: string; + textFullWhite: string; + textDarkWhite: string; + textLightWhite: string; + + // font weight + fontWeightLight: number; + fontWeightNormal: number; + fontWeightMedium: number; + + fontStyleButtonFontSize: number; + } + export var Typography: Typography; + + export var DarkRawTheme: RawTheme; + export var LightRawTheme: RawTheme; + } + + interface SnackbarProps extends React.Props { + message: string; + action?: string; + autoHideDuration?: number; + onActionTouchTap?: React.TouchEventHandler; + onShow?: () => void; + onDismiss?: () => void; + openOnMount?: boolean; + } + export class Snackbar extends React.Component { + } + + namespace Tabs { + interface TabProps extends React.Props { + label?: string; + value?: string; + selected?: boolean; + width?: string; + + // Called by Tabs component + onActive?: (tab: Tab) => void; + + onTouchTap?: (value: string, e: TouchTapEvent, tab: Tab) => void; + } + export class Tab extends React.Component { + } + + interface TabsProps extends React.Props { + contentContainerStyle?: React.CSSProperties; + initialSelectedIndex?: number; + inkBarStyle?: React.CSSProperties; + style?: React.CSSProperties; + tabItemContainerStyle?: React.CSSProperties; + tabWidth?: number; + value?: string | number; + + onChange?: (value: string | number, e: React.FormEvent, tab: Tab) => void; + } + export class Tabs extends React.Component { + } + } + + namespace Table { + interface TableProps extends React.Props { + allRowsSelected?: boolean; + fixedFooter?: boolean; + fixedHeader?: boolean; + height?: string; + multiSelectable?: boolean; + onCellClick?: (row: number, column: number) => void; + onCellHover?: (row: number, column: number) => void; + onCellHoverExit?: (row: number, column: number) => void; + onRowHover?: (row: number) => void; + onRowHoverExit?: (row: number) => void; + onRowSelection?: (selectedRows: number[])=> void; + selectable?: boolean; + } + export class Table extends React.Component { + } + + interface TableBodyProps extends React.Props { + allRowsSelected?: boolean; + deselectOnClickaway?: boolean; + displayRowCheckbox?: boolean; + multiSelectable?: boolean; + onCellClick?: (row: number, column: number) => void; + onCellHover?: (row: number, column: number) => void; + onCellHoverExit?: (row: number, column: number) => void; + onRowHover?: (row: number) => void; + onRowHoverExit?: (row: number) => void; + onRowSelection?: (selectedRows: number[])=> void; + preScanRows?: boolean; + selectable?: boolean; + showRowHover?: boolean; + stripedRows?: boolean; + } + export class TableBody extends React.Component { + } + + interface TableFooterProps extends React.Props { + adjustForCheckbox?: boolean; + } + export class TableFooter extends React.Component { + } + + interface TableHeaderProps extends React.Props { + adjustForCheckbox?: boolean; + displaySelectAll?: boolean; + enableSelectAll?: boolean; + onSelectAll?: (event: React.MouseEvent) => void; + selectAllSelected?: boolean; + } + export class TableHeader extends React.Component { + } + + interface TableHeaderColumnProps extends React.Props { + columnNumber?: number; + onClick?: (e: React.MouseEvent, column: number) => void; + tooltip?: string; + tooltipStyle?: React.CSSProperties; + } + export class TableHeaderColumn extends React.Component { + } + + interface TableRowProps extends React.Props { + displayBorder?: boolean; + hoverable?: boolean; + onCellClick?: (e: React.MouseEvent, row: number, column: number) => void; + onCellHover?: (e: React.MouseEvent, row: number, column: number) => void; + onCellHoverExit?: (e: React.MouseEvent, row: number, column: number) => void; + onRowClick?: (e: React.MouseEvent, row: number) => void; + onRowHover?: (e: React.MouseEvent, row: number) => void; + onRowHoverExit?: (e: React.MouseEvent, row: number) => void; + rowNumber?: number; + selectable?: boolean; + selected?: boolean; + striped?: boolean; + } + export class TableRow extends React.Component { + } + + interface TableRowColumnProps extends React.Props { + columnNumber?: number; + hoverable?: boolean; + onHover?: (e: React.MouseEvent, column: number) => void; + onHoverExit?: (e: React.MouseEvent, column: number) => void; + } + export class TableRowColumn extends React.Component { + } + } + + interface ThemeWrapperProps extends React.Props { + theme: Styles.MuiTheme; + } + export class ThemeWrapper extends React.Component { + } + + interface ToggleProps extends CommonEnhancedSwitchProps { + // is root element + + elementStyle?: React.CSSProperties; + labelStyle?: React.CSSProperties; + onToggle?: (e: React.MouseEvent, isInputChecked: boolean) => void; + toggled?: boolean; + defaultToggled?: boolean; + } + export class Toggle extends React.Component { + isToggled(): boolean; + setToggled(newToggledValue: boolean): void; + } + + interface TimePickerProps extends React.Props { + defaultTime?: Date; + format?: string; + pedantic?: boolean; + onFocus?: React.FocusEventHandler; + onTouchTap?: TouchTapEventHandler; + onChange?: (e: any, time: Date) => void; + onShow?: () => void; + onDismiss?: () => void; + } + export class TimePicker extends React.Component { + } + + interface TextFieldProps extends React.Props { + errorStyle?: React.CSSProperties; + errorText?: string; + floatingLabelText?: string; + floatingLabelStyle?: React.CSSProperties; + fullWidth?: boolean; + hintText?: string | React.ReactElement; + id?: string; + inputStyle?: React.CSSProperties; + multiLine?: boolean; + onEnterKeyDown?: React.KeyboardEventHandler; + style?: React.CSSProperties; + rows?: number, + underlineStyle?: React.CSSProperties; + underlineFocusStyle?: React.CSSProperties; + underlineDisabledStyle?: React.CSSProperties; + type?: string; + + disabled?: boolean; + isRtl?: boolean; + value?: string; + defaultValue?: string; + valueLink?: ReactLink; + + onBlur?: React.FocusEventHandler; + onChange?: React.FormEventHandler; + onFocus?: React.FocusEventHandler; + onKeyDown?: React.KeyboardEventHandler; + } + export class TextField extends React.Component { + blur(): void; + clearValue(): void; + focus(): void; + getValue(): string; + setErrorText(newErrorText: string): void; + setValue(newValue: string): void; + } + + namespace Toolbar { + interface ToolbarProps extends React.Props { + } + export class Toolbar extends React.Component { + } + + interface ToolbarGroupProps extends React.Props { + float?: string; + } + export class ToolbarGroup extends React.Component { + } + + interface ToolbarSeparatorProps extends React.Props { + } + export class ToolbarSeparator extends React.Component { + } + + interface ToolbarTitleProps extends React.HTMLAttributesBase { + text?: string; + } + export class ToolbarTitle extends React.Component { + } + } + + interface TooltipProps extends React.Props { + label: string; + show?: boolean; + touch?: boolean; + verticalPosition?: string; + horizontalPosition?: string; + } + export class Tooltip extends React.Component { + } + + export namespace Utils { + interface ContrastLevel { + range: [number, number]; + color: string; + } + interface ColorManipulator { + fade(color: string, amount: string|number): string; + lighten(color: string, amount: string|number): string; + darken(color: string, amount: string|number): string; + contrastRatio(background: string, foreground: string): number; + contrastRatioLevel(background: string, foreground: string): ContrastLevel; + } + export var ColorManipulator: ColorManipulator; + + interface CssEvent { + transitionEndEventName(): string; + animationEndEventName(): string; + onTransitionEnd(el: Element, callback: () => void): void; + onAnimationEnd(el: Element, callback: () => void): void; + } + export var CssEvent: CssEvent; + + interface Dom { + isDescendant(parent: Node, child: Node): boolean; + offset(el: Element): { top: number, left: number }; + getStyleAttributeAsNumber(el: HTMLElement, attr: string): number; + addClass(el: Element, className: string): void; + removeClass(el: Element, className: string): void; + hasClass(el: Element, className: string): boolean; + toggleClass(el: Element, className: string): void; + forceRedraw(el: HTMLElement): void; + withoutTransition(el: HTMLElement, callback: () => void): void; + } + export var Dom: Dom; + + interface Events { + once(el: Element, type: string, callback: EventListener): void; + on(el: Element, type: string, callback: EventListener): void; + off(el: Element, type: string, callback: EventListener): void; + isKeyboard(e: Event): boolean; + } + export var Events: Events; + + function Extend(base: T, override: S1): (T & S1); + + interface ImmutabilityHelper { + merge(base: any, ...args: any[]): any; + mergeItem(obj: any, key: any, newValueObject: any): any; + push(array: any[], obj: any): any[]; + shift(array: any[]): any[]; + } + export var ImmutabilityHelper: ImmutabilityHelper; + + interface KeyCode { + DOWN: number; + ESC: number; + ENTER: number; + LEFT: number; + RIGHT: number; + SPACE: number; + TAB: number; + UP: number; + } + var KeyCode: KeyCode; + + interface KeyLine { + Desktop: { + GUTTER: number; + GUTTER_LESS: number; + INCREMENT: number; + MENU_ITEM_HEIGHT: number; + }; + + getIncrementalDim(dim: number): number; + } + export var KeyLine: KeyLine; + + interface UniqueId { + generate(): string; + } + export var UniqueId: UniqueId; + + interface Styles { + mergeAndPrefix(base: any, ...args: any[]): React.CSSProperties; + } + export var Styles: Styles; + } + + // New menus available only through requiring directly to the end file + namespace Menus { + interface IconMenuProps extends React.Props { + closeOnItemTouchTap?: boolean; + desktop?: boolean; + iconButtonElement: React.ReactElement; + openDirection?: string; + menuStyle?: React.CSSProperties; + multiple?: boolean; + value?: string | Array; + width?: string | number; + touchTapCloseDelay?: number; + + onKeyboardFocus?: React.FocusEventHandler; + onItemTouchTap?: (e: TouchTapEvent, item: React.ReactElement) => void; + onChange?: (e: React.FormEvent, value: string | Array) => void; + } + export class IconMenu extends React.Component { + } + + interface MenuProps extends React.Props { + animated?: boolean; + autoWidth?: boolean; + desktop?: boolean; + listStyle?: React.CSSProperties; + maxHeight?: number; + multiple?: boolean; + openDirection?: string; + value?: string | Array; + width?: string | number; + zDepth?: number; + } + export class Menu extends React.Component{ + } + + interface MenuItemProps extends React.Props { + checked?: boolean; + desktop?: boolean; + disabled?: boolean; + innerDivStyle?: React.CSSProperties; + insetChildren?: boolean; + leftIcon?: React.ReactElement; + primaryText?: string | React.ReactElement; + rightIcon?: React.ReactElement; + secondaryText?: React.ReactNode; + value?: string; + + onEscKeyDown?: React.KeyboardEventHandler; + onItemTouchTap?: (e: TouchTapEvent, item: React.ReactElement) => void; + onChange?: (e: React.FormEvent, value: string) => void; + } + export class MenuItem extends React.Component{ + } + + interface MenuDividerProps extends React.Props { + inset?: boolean; + style?: React.CSSProperties; + } + export class MenuDivider extends React.Component{ + } + } +} // __MaterialUI + +declare module 'material-ui/lib/app-bar' { + import AppBar = __MaterialUI.AppBar; + export = AppBar; +} + +declare module 'material-ui/lib/app-canvas' { + import AppCanvas = __MaterialUI.AppCanvas; + export = AppCanvas; +} + +declare module 'material-ui/lib/avatar' { + import Avatar = __MaterialUI.Avatar; + export = Avatar; +} + +declare module 'material-ui/lib/before-after-wrapper' { + import BeforeAfterWrapper = __MaterialUI.BeforeAfterWrapper; + export = BeforeAfterWrapper; +} + +declare module 'material-ui/lib/card/card' { + import Card = __MaterialUI.Card.Card; + export = Card; +} + +declare module 'material-ui/lib/card/card-actions' { + import CardActions = __MaterialUI.Card.CardActions; + export = CardActions; +} + +declare module 'material-ui/lib/card/card-expandable' { + import CardExpandable = __MaterialUI.Card.CardExpandable; + export = CardExpandable; +} + +declare module 'material-ui/lib/card/card-header' { + import CardHeader = __MaterialUI.Card.CardHeader; + export = CardHeader; +} + +declare module 'material-ui/lib/card/card-media' { + import CardMedia = __MaterialUI.Card.CardMedia; + export = CardMedia; +} + +declare module 'material-ui/lib/card/card-text' { + import CardText = __MaterialUI.Card.CardText; + export = CardText; +} + +declare module 'material-ui/lib/card/card-title' { + import CardTitle = __MaterialUI.Card.CardTitle; + export = CardTitle; +} + +declare module 'material-ui/lib/checkbox' { + import Checkbox = __MaterialUI.Checkbox; + export = Checkbox; +} + +declare module 'material-ui/lib/circular-progress' { + import CircularProgress = __MaterialUI.CircularProgress; + export = CircularProgress; +} + +declare module 'material-ui/lib/clearfix' { + import ClearFix = __MaterialUI.ClearFix; + export = ClearFix; +} + +declare module 'material-ui/lib/date-picker/date-picker' { + import DatePicker = __MaterialUI.DatePicker.DatePicker; + export = DatePicker; +} + +declare module 'material-ui/lib/date-picker/date-picker-dialog' { + import DatePickerDialog = __MaterialUI.DatePicker.DatePickerDialog; + export = DatePickerDialog; +} + +declare module 'material-ui/lib/dialog' { + import Dialog = __MaterialUI.Dialog; + export = Dialog; +} + +declare module 'material-ui/lib/drop-down-icon' { + import DropDownIcon = __MaterialUI.DropDownIcon; + export = DropDownIcon; +} + +declare module 'material-ui/lib/drop-down-menu' { + import DropDownMenu = __MaterialUI.DropDownMenu; + export = DropDownMenu; +} + +declare module 'material-ui/lib/enhanced-button' { + import EnhancedButton = __MaterialUI.EnhancedButton; + export = EnhancedButton; +} + +declare module 'material-ui/lib/flat-button' { + import FlatButton = __MaterialUI.FlatButton; + export = FlatButton; +} + +declare module 'material-ui/lib/floating-action-button' { + import FloatingActionButton = __MaterialUI.FloatingActionButton; + export = FloatingActionButton; +} + +declare module 'material-ui/lib/font-icon' { + import FontIcon = __MaterialUI.FontIcon; + export = FontIcon; +} + +declare module 'material-ui/lib/icon-button' { + import IconButton = __MaterialUI.IconButton; + export = IconButton; +} + +declare module 'material-ui/lib/left-nav' { + import LeftNav = __MaterialUI.LeftNav; + export = LeftNav; +} + +declare module 'material-ui/lib/linear-progress' { + import LinearProgress = __MaterialUI.LinearProgress; + export = LinearProgress; +} + +declare module 'material-ui/lib/lists/list' { + import List = __MaterialUI.Lists.List; + export = List; +} + +declare module 'material-ui/lib/lists/list-divider' { + import ListDivider = __MaterialUI.Lists.ListDivider; + export = ListDivider; +} + +declare module 'material-ui/lib/lists/list-item' { + import ListItem = __MaterialUI.Lists.ListItem; + export = ListItem; +} + +declare module 'material-ui/lib/menu/menu' { + import Menu = __MaterialUI.Menu.Menu; + export = Menu; +} + +declare module 'material-ui/lib/menu/menu-item' { + import MenuItem = __MaterialUI.Menu.MenuItem; + export = MenuItem; +} + +declare module 'material-ui/lib/mixins/' { + export import ClickAwayable = __MaterialUI.Mixins.ClickAwayable; // require('material-ui/lib/mixins/click-awayable'); + export import WindowListenable = __MaterialUI.Mixins.WindowListenable; // require('material-ui/lib/mixins/window-listenable'); + export import StylePropable = __MaterialUI.Mixins.StylePropable; // require('material-ui/lib/mixins/style-propable'); + export import StyleResizable = __MaterialUI.Mixins.StyleResizable; // require('material-ui/lib/mixins/style-resizable'); +} + +declare module 'material-ui/lib/mixins/click-awayable' { + import ClickAwayable = __MaterialUI.Mixins.ClickAwayable; + export = ClickAwayable; +} + +declare module 'material-ui/lib/mixins/window-listenable' { + import WindowListenable = __MaterialUI.Mixins.WindowListenable; + export = WindowListenable; +} + +declare module 'material-ui/lib/mixins/style-propable' { + import StylePropable = __MaterialUI.Mixins.StylePropable; + export = StylePropable; +} + +declare module 'material-ui/lib/mixins/style-resizable' { + import StyleResizable = __MaterialUI.Mixins.StyleResizable; + export = StyleResizable; +} + +declare module 'material-ui/lib/overlay' { + import Overlay = __MaterialUI.Overlay; + export = Overlay; +} + +declare module 'material-ui/lib/paper' { + import Paper = __MaterialUI.Paper; + export = Paper; +} + +declare module 'material-ui/lib/radio-button' { + import RadioButton = __MaterialUI.RadioButton; + export = RadioButton; +} + +declare module 'material-ui/lib/radio-button-group' { + import RadioButtonGroup = __MaterialUI.RadioButtonGroup; + export = RadioButtonGroup; +} + +declare module 'material-ui/lib/raised-button' { + import RaisedButton = __MaterialUI.RaisedButton; + export = RaisedButton; +} + +declare module 'material-ui/lib/refresh-indicator' { + import RefreshIndicator = __MaterialUI.RefreshIndicator; + export = RefreshIndicator; +} + +declare module 'material-ui/lib/ripples/' { + export import CircleRipple = __MaterialUI.Ripples.CircleRipple; + export import FocusRipple = __MaterialUI.Ripples.FocusRipple; + export import TouchRipple = __MaterialUI.Ripples.TouchRipple; +} + +declare module 'material-ui/lib/select-field' { + import SelectField = __MaterialUI.SelectField; + export = SelectField; +} + +declare module 'material-ui/lib/slider' { + import Slider = __MaterialUI.Slider; + export = Slider; +} + +declare module 'material-ui/lib/svg-icon' { + import SvgIcon = __MaterialUI.SvgIcon; + export = SvgIcon; +} + +declare module 'material-ui/lib/svg-icons/navigation/menu' { + import NavigationMenu = __MaterialUI.NavigationMenu; + export = NavigationMenu; +} + +declare module 'material-ui/lib/svg-icons/navigation/chevron-left' { + import NavigationChevronLeft = __MaterialUI.NavigationChevronLeft; + export = NavigationChevronLeft; +} + +declare module 'material-ui/lib/svg-icons/navigation/chevron-right' { + import NavigationChevronRight = __MaterialUI.NavigationChevronRight; + export = NavigationChevronRight; +} + +declare module 'material-ui/lib/styles/' { + export import AutoPrefix = __MaterialUI.Styles.AutoPrefix; // require('material-ui/lib/styles/auto-prefix'); + export import Colors = __MaterialUI.Styles.Colors; // require('material-ui/lib/styles/colors'); + export import Spacing = require('material-ui/lib/styles/spacing'); + export import ThemeManager = __MaterialUI.Styles.ThemeManager; // require('material-ui/lib/styles/theme-manager'); + export import Transitions = __MaterialUI.Styles.Transitions; // require('material-ui/lib/styles/transitions'); + export import Typography = __MaterialUI.Styles.Typography; // require('material-ui/lib/styles/typography'); + export import LightRawTheme = __MaterialUI.Styles.LightRawTheme; // require('material-ui/lib/styles/raw-themes/light-raw-theme'), + export import DarkRawTheme = __MaterialUI.Styles.DarkRawTheme; // require('material-ui/lib/styles/raw-themes/dark-raw-theme'), + export import ThemeDecorator = __MaterialUI.Styles.ThemeDecorator; //require('material-ui/lib/styles/theme-decorator'); +} + +declare module 'material-ui/lib/styles/auto-prefix' { + import AutoPrefix = __MaterialUI.Styles.AutoPrefix; + export = AutoPrefix; +} + +declare module 'material-ui/lib/styles/spacing' { + type Spacing = __MaterialUI.Styles.Spacing; + var Spacing: Spacing; + export = Spacing; +} + +declare module 'material-ui/lib/styles/theme-manager' { + import ThemeManager = __MaterialUI.Styles.ThemeManager; + export = ThemeManager; +} + +declare module 'material-ui/lib/styles/transitions' { + import Transitions = __MaterialUI.Styles.Transitions; + export = Transitions; +} + +declare module 'material-ui/lib/styles/typography' { + import Typography = __MaterialUI.Styles.Typography; + export = Typography; +} + +declare module 'material-ui/lib/styles/raw-themes/light-raw-theme' { + import LightRawTheme = __MaterialUI.Styles.LightRawTheme; + export = LightRawTheme; +} + +declare module 'material-ui/lib/styles/raw-themes/dark-raw-theme' { + import DarkRawTheme = __MaterialUI.Styles.DarkRawTheme; + export = DarkRawTheme; +} + +declare module 'material-ui/lib/styles/theme-decorator' { + import ThemeDecorator = __MaterialUI.Styles.ThemeDecorator; + export = ThemeDecorator; +} + + +declare module 'material-ui/lib/snackbar' { + import Snackbar = __MaterialUI.Snackbar; + export = Snackbar; +} + +declare module 'material-ui/lib/tabs/tab' { + import Tab = __MaterialUI.Tabs.Tab; + export = Tab; +} + +declare module 'material-ui/lib/tabs/tabs' { + import Tabs = __MaterialUI.Tabs.Tabs; + export = Tabs; +} + +declare module 'material-ui/lib/table/table' { + import Table = __MaterialUI.Table.Table; + export = Table; +} + +declare module 'material-ui/lib/table/table-body' { + import TableBody = __MaterialUI.Table.TableBody; + export = TableBody; +} + +declare module 'material-ui/lib/table/table-footer' { + import TableFooter = __MaterialUI.Table.TableFooter; + export = TableFooter; +} + +declare module 'material-ui/lib/table/table-header' { + import TableHeader = __MaterialUI.Table.TableHeader; + export = TableHeader; +} + +declare module 'material-ui/lib/table/table-header-column' { + import TableHeaderColumn = __MaterialUI.Table.TableHeaderColumn; + export = TableHeaderColumn; +} + +declare module 'material-ui/lib/table/table-row' { + import TableRow = __MaterialUI.Table.TableRow; + export = TableRow; +} + +declare module 'material-ui/lib/table/table-row-column' { + import TableRowColumn = __MaterialUI.Table.TableRowColumn; + export = TableRowColumn; +} + +declare module 'material-ui/lib/theme-wrapper' { + import ThemeWrapper = __MaterialUI.ThemeWrapper; + export = ThemeWrapper; +} + +declare module 'material-ui/lib/toggle' { + import Toggle = __MaterialUI.Toggle; + export = Toggle; +} + +declare module 'material-ui/lib/time-picker' { + import TimePicker = __MaterialUI.TimePicker; + export = TimePicker; +} + +declare module 'material-ui/lib/text-field' { + import TextField = __MaterialUI.TextField; + export = TextField; +} + +declare module 'material-ui/lib/toolbar/toolbar' { + import Toolbar = __MaterialUI.Toolbar.Toolbar; + export = Toolbar; +} + +declare module 'material-ui/lib/toolbar/toolbar-group' { + import ToolbarGroup = __MaterialUI.Toolbar.ToolbarGroup; + export = ToolbarGroup; +} + +declare module 'material-ui/lib/toolbar/toolbar-separator' { + import ToolbarSeparator = __MaterialUI.Toolbar.ToolbarSeparator; + export = ToolbarSeparator; +} + +declare module 'material-ui/lib/toolbar/toolbar-title' { + import ToolbarTitle = __MaterialUI.Toolbar.ToolbarTitle; + export = ToolbarTitle; +} + +declare module 'material-ui/lib/tooltip' { + import Tooltip = __MaterialUI.Tooltip; + export = Tooltip; +} + +declare module 'material-ui/lib/utils/' { + export import ColorManipulator = __MaterialUI.Utils.ColorManipulator; // require('material-ui/lib/utils/color-manipulator'); + export import CssEvent = __MaterialUI.Utils.CssEvent; // require('material-ui/lib/utils/css-event'); + export import Dom = __MaterialUI.Utils.Dom; // require('material-ui/lib/utils/dom'); + export import Events = __MaterialUI.Utils.Events; // require('material-ui/lib/utils/events'); + export import Extend = __MaterialUI.Utils.Extend; // require('material-ui/lib/utils/extend'); + export import ImmutabilityHelper = __MaterialUI.Utils.ImmutabilityHelper; // require('material-ui/lib/utils/immutability-helper'); + export import KeyCode = __MaterialUI.Utils.KeyCode; // require('material-ui/lib/utils/key-code'); + export import KeyLine = __MaterialUI.Utils.KeyLine; // require('material-ui/lib/utils/key-line'); + export import UniqueId = __MaterialUI.Utils.UniqueId; // require('material-ui/lib/utils/unique-id'); + export import Styles = __MaterialUI.Utils.Styles; // require('material-ui/lib/utils/styles'); +} + +declare module 'material-ui/lib/utils/color-manipulator' { + import ColorManipulator = __MaterialUI.Utils.ColorManipulator; + export = ColorManipulator; +} + +declare module 'material-ui/lib/utils/css-event' { + import CssEvent = __MaterialUI.Utils.CssEvent; + export = CssEvent; +} + +declare module 'material-ui/lib/utils/dom' { + import Dom = __MaterialUI.Utils.Dom; + export = Dom; +} + +declare module 'material-ui/lib/utils/events' { + import Events = __MaterialUI.Utils.Events; + export = Events; +} + +declare module 'material-ui/lib/utils/extend' { + import Extend = __MaterialUI.Utils.Extend; + export = Extend; +} + +declare module 'material-ui/lib/utils/immutability-helper' { + import ImmutabilityHelper = __MaterialUI.Utils.ImmutabilityHelper; + export = ImmutabilityHelper; +} + +declare module 'material-ui/lib/utils/key-code' { + import KeyCode = __MaterialUI.Utils.KeyCode; + export = KeyCode; +} + +declare module 'material-ui/lib/utils/key-line' { + import KeyLine = __MaterialUI.Utils.KeyLine; + export = KeyLine; +} + +declare module 'material-ui/lib/utils/unique-id' { + import UniqueId = __MaterialUI.Utils.UniqueId; + export = UniqueId; +} + +declare module 'material-ui/lib/utils/styles' { + import Styles = __MaterialUI.Utils.Styles; + export = Styles; +} + +declare module "material-ui/lib/menus/icon-menu" { + import IconMenu = __MaterialUI.Menus.IconMenu; + export = IconMenu; +} + +declare module "material-ui/lib/menus/menu" { + import Menu = __MaterialUI.Menus.Menu; + export = Menu; +} + +declare module "material-ui/lib/menus/menu-item" { + import MenuItem = __MaterialUI.Menus.MenuItem; + export = MenuItem; +} + +declare module "material-ui/lib/menus/menu-divider" { + import MenuDivider = __MaterialUI.Menus.MenuDivider; + export = MenuDivider; +} + +declare module "material-ui/lib/styles/colors" { + import Colors = __MaterialUI.Styles.Colors; + export = Colors; +} + +declare namespace __MaterialUI.Styles { + interface Colors { + red50: string; + red100: string; + red200: string; + red300: string; + red400: string; + red500: string; + red600: string; + red700: string; + red800: string; + red900: string; + redA100: string; + redA200: string; + redA400: string; + redA700: string; + + pink50: string; + pink100: string; + pink200: string; + pink300: string; + pink400: string; + pink500: string; + pink600: string; + pink700: string; + pink800: string; + pink900: string; + pinkA100: string; + pinkA200: string; + pinkA400: string; + pinkA700: string; + + purple50: string; + purple100: string; + purple200: string; + purple300: string; + purple400: string; + purple500: string; + purple600: string; + purple700: string; + purple800: string; + purple900: string; + purpleA100: string; + purpleA200: string; + purpleA400: string; + purpleA700: string; + + deepPurple50: string; + deepPurple100: string; + deepPurple200: string; + deepPurple300: string; + deepPurple400: string; + deepPurple500: string; + deepPurple600: string; + deepPurple700: string; + deepPurple800: string; + deepPurple900: string; + deepPurpleA100: string; + deepPurpleA200: string; + deepPurpleA400: string; + deepPurpleA700: string; + + indigo50: string; + indigo100: string; + indigo200: string; + indigo300: string; + indigo400: string; + indigo500: string; + indigo600: string; + indigo700: string; + indigo800: string; + indigo900: string; + indigoA100: string; + indigoA200: string; + indigoA400: string; + indigoA700: string; + + blue50: string; + blue100: string; + blue200: string; + blue300: string; + blue400: string; + blue500: string; + blue600: string; + blue700: string; + blue800: string; + blue900: string; + blueA100: string; + blueA200: string; + blueA400: string; + blueA700: string; + + lightBlue50: string; + lightBlue100: string; + lightBlue200: string; + lightBlue300: string; + lightBlue400: string; + lightBlue500: string; + lightBlue600: string; + lightBlue700: string; + lightBlue800: string; + lightBlue900: string; + lightBlueA100: string; + lightBlueA200: string; + lightBlueA400: string; + lightBlueA700: string; + + cyan50: string; + cyan100: string; + cyan200: string; + cyan300: string; + cyan400: string; + cyan500: string; + cyan600: string; + cyan700: string; + cyan800: string; + cyan900: string; + cyanA100: string; + cyanA200: string; + cyanA400: string; + cyanA700: string; + + teal50: string; + teal100: string; + teal200: string; + teal300: string; + teal400: string; + teal500: string; + teal600: string; + teal700: string; + teal800: string; + teal900: string; + tealA100: string; + tealA200: string; + tealA400: string; + tealA700: string; + + green50: string; + green100: string; + green200: string; + green300: string; + green400: string; + green500: string; + green600: string; + green700: string; + green800: string; + green900: string; + greenA100: string; + greenA200: string; + greenA400: string; + greenA700: string; + + lightGreen50: string; + lightGreen100: string; + lightGreen200: string; + lightGreen300: string; + lightGreen400: string; + lightGreen500: string; + lightGreen600: string; + lightGreen700: string; + lightGreen800: string; + lightGreen900: string; + lightGreenA100: string; + lightGreenA200: string; + lightGreenA400: string; + lightGreenA700: string; + + lime50: string; + lime100: string; + lime200: string; + lime300: string; + lime400: string; + lime500: string; + lime600: string; + lime700: string; + lime800: string; + lime900: string; + limeA100: string; + limeA200: string; + limeA400: string; + limeA700: string; + + yellow50: string; + yellow100: string; + yellow200: string; + yellow300: string; + yellow400: string; + yellow500: string; + yellow600: string; + yellow700: string; + yellow800: string; + yellow900: string; + yellowA100: string; + yellowA200: string; + yellowA400: string; + yellowA700: string; + + amber50: string; + amber100: string; + amber200: string; + amber300: string; + amber400: string; + amber500: string; + amber600: string; + amber700: string; + amber800: string; + amber900: string; + amberA100: string; + amberA200: string; + amberA400: string; + amberA700: string; + + orange50: string; + orange100: string; + orange200: string; + orange300: string; + orange400: string; + orange500: string; + orange600: string; + orange700: string; + orange800: string; + orange900: string; + orangeA100: string; + orangeA200: string; + orangeA400: string; + orangeA700: string; + + deepOrange50: string; + deepOrange100: string; + deepOrange200: string; + deepOrange300: string; + deepOrange400: string; + deepOrange500: string; + deepOrange600: string; + deepOrange700: string; + deepOrange800: string; + deepOrange900: string; + deepOrangeA100: string; + deepOrangeA200: string; + deepOrangeA400: string; + deepOrangeA700: string; + + brown50: string; + brown100: string; + brown200: string; + brown300: string; + brown400: string; + brown500: string; + brown600: string; + brown700: string; + brown800: string; + brown900: string; + + blueGrey50: string; + blueGrey100: string; + blueGrey200: string; + blueGrey300: string; + blueGrey400: string; + blueGrey500: string; + blueGrey600: string; + blueGrey700: string; + blueGrey800: string; + blueGrey900: string; + + grey50: string; + grey100: string; + grey200: string; + grey300: string; + grey400: string; + grey500: string; + grey600: string; + grey700: string; + grey800: string; + grey900: string; + + black: string; + white: string; + + transparent: string; + fullBlack: string; + darkBlack: string; + lightBlack: string; + minBlack: string; + faintBlack: string; + fullWhite: string; + darkWhite: string; + lightWhite: string; + } + export var Colors: Colors; +} diff --git a/material-ui/material-ui-tests.tsx b/material-ui/material-ui-tests.tsx index 4c69f3410..0165dee1f 100644 --- a/material-ui/material-ui-tests.tsx +++ b/material-ui/material-ui-tests.tsx @@ -1,10 +1,13 @@ /// +/// /// -import * as React from "react/addons"; +import * as React from "react"; +import * as LinkedStateMixin from "react-addons-linked-state-mixin"; import Checkbox = require("material-ui/lib/checkbox"); import Colors = require("material-ui/lib/styles/colors"); import AppBar = require("material-ui/lib/app-bar"); +import Badge = require("material-ui/lib/badge"); import IconButton = require("material-ui/lib/icon-button"); import FlatButton = require("material-ui/lib/flat-button"); import Avatar = require("material-ui/lib/avatar"); @@ -14,6 +17,7 @@ import RaisedButton = require("material-ui/lib/raised-button"); import FloatingActionButton = require("material-ui/lib/floating-action-button"); import Card = require("material-ui/lib/card/card"); import CardHeader = require("material-ui/lib/card/card-header"); +import DatePicker = require("material-ui/lib/date-picker/date-picker"); import CardText = require("material-ui/lib/card/card-text"); import CardActions = require("material-ui/lib/card/card-actions"); import Dialog = require("material-ui/lib/dialog"); @@ -28,6 +32,9 @@ import Menu = require('material-ui/lib/menus/menu'); import MenuItem = require('material-ui/lib/menus/menu-item'); import MenuDivider = require('material-ui/lib/menus/menu-divider'); import ThemeManager = require('material-ui/lib/styles/theme-manager'); +import GridList = require('material-ui/lib/grid-list/grid-list'); +import GridTile = require('material-ui/lib/grid-list/grid-tile'); + import NavigationClose = require("material-ui/lib/svg-icon"); // TODO: Should actually import the actual "material-ui/lib/svg-icons/navigation/close", but they aren't defined yet. import FileFolder = require("material-ui/lib/svg-icon"); // TODO: Should actually import the actual "material-ui/lib/svg-icons/file/folder", but they aren't defined yet. @@ -126,6 +133,17 @@ class MaterialUiTests extends React.Component<{}, {}> implements React.LinkedSta backgroundColor={Colors.purple500}> + // "http://material-ui.com/#/components/badge" + element = Hello}> + + ; + element = Hello} + badgeStyle={{height: '24px', width: '24px'}} + > + This text has a badge! + ; // "http://material-ui.com/#/components/buttons" element = @@ -160,7 +178,10 @@ class MaterialUiTests extends React.Component<{}, {}> implements React.LinkedSta ; // "http://material-ui.com/#/components/date-picker" - + element = ; + element = ; // "http://material-ui.com/#/components/dialog" let standardActions = [ @@ -456,13 +477,30 @@ class MaterialUiTests extends React.Component<{}, {}> implements React.LinkedSta hintText="Password Field" floatingLabelText="Password" type="password" />; - + // "http://material-ui.com/#/components/time-picker" // "http://material-ui.com/#/components/toolbars" + + // "http://material-ui.com/#/components/grid-list" + element = ; + + element = GridTile} + actionPosition="left" + titlePosition="top" + titleBackground="rgba(0, 0, 0, 0.4)" + cols={2} + rows={1} > +

    Children are Required!

    +
    ; return element; } -} \ No newline at end of file +} diff --git a/material-ui/material-ui.d.ts b/material-ui/material-ui.d.ts index ecd32ae06..df6a088a7 100644 --- a/material-ui/material-ui.d.ts +++ b/material-ui/material-ui.d.ts @@ -1,6 +1,6 @@ -// Type definitions for material-ui v0.12.1 +// Type definitions for material-ui v0.13.1 // Project: https://github.com/callemall/material-ui -// Definitions by: Nathan Brown +// Definitions by: Nathan Brown , Oliver Herrmann // Definitions: https://github.com/borisyankov/DefinitelyTyped /// @@ -9,6 +9,7 @@ declare module "material-ui" { export import AppBar = __MaterialUI.AppBar; // require('material-ui/lib/app-bar'); export import AppCanvas = __MaterialUI.AppCanvas; // require('material-ui/lib/app-canvas'); export import Avatar = __MaterialUI.Avatar; // require('material-ui/lib/avatar'); + export import Badge = __MaterialUI.Badge; // require('material-ui/lib/badge'); export import BeforeAfterWrapper = __MaterialUI.BeforeAfterWrapper; // require('material-ui/lib/before-after-wrapper'); export import Card = __MaterialUI.Card.Card; // require('material-ui/lib/card/card'); export import CardActions = __MaterialUI.Card.CardActions; // require('material-ui/lib/card/card-actions'); @@ -71,6 +72,9 @@ declare module "material-ui" { export import ToolbarTitle = __MaterialUI.Toolbar.ToolbarTitle; // require('material-ui/lib/toolbar/toolbar-title'); export import Tooltip = __MaterialUI.Tooltip; // require('material-ui/lib/tooltip'); export import Utils = __MaterialUI.Utils; // require('material-ui/lib/utils/'); + + export import GridList = __MaterialUI.GridList.GridList; // require('material-ui/lib/gridlist/grid-list'); + export import GridTile = __MaterialUI.GridList.GridTile; // require('material-ui/lib/gridlist/grid-tile'); // export type definitions export type TouchTapEvent = __MaterialUI.TouchTapEvent; @@ -134,6 +138,16 @@ declare namespace __MaterialUI { export class Avatar extends React.Component { } + interface BadgeProps extends React.Props { + badgeContent: React.ReactElement | string | number; + primary?: boolean; + secondary?: boolean; + style?: React.CSSProperties; + badgeStyle?: React.CSSProperties; + } + export class Badge extends React.Component { + } + interface BeforeAfterWrapperProps extends React.Props { beforeStyle?: React.CSSProperties; afterStyle?: React.CSSProperties; @@ -158,6 +172,7 @@ declare namespace __MaterialUI { interface CardActionsProps extends React.Props { expandable?: boolean; showExpandableButton?: boolean; + style?: React.CSSProperties; } export class CardActions extends React.Component { } @@ -165,6 +180,7 @@ declare namespace __MaterialUI { interface CardExpandableProps extends React.Props { onExpanding?: (isExpanded: boolean) => void; expanded?: boolean; + style?: React.CSSProperties; } export class CardExpandable extends React.Component { } @@ -222,7 +238,7 @@ declare namespace __MaterialUI { } // what's not commonly overridden by Checkbox, RadioButton, or Toggle - interface CommonEnhancedSwitchProps extends React.HTMLAttributesBase { + interface CommonEnhancedSwitchProps extends React.HTMLAttributes, React.Props { // is root element id?: string; iconStyle?: React.CSSProperties; @@ -288,6 +304,7 @@ declare namespace __MaterialUI { size?: number; color?: string; innerStyle?: React.CSSProperties; + style?: React.CSSProperties; } export class CircularProgress extends React.Component { @@ -303,6 +320,8 @@ declare namespace __MaterialUI { autoOk?: boolean; defaultDate?: Date; formatDate?: string; + hintText?: string; + floatingLabelText?: string; hideToolbarYearChange?: boolean; maxDate?: Date; minDate?: Date; @@ -351,6 +370,7 @@ declare namespace __MaterialUI { actionFocus?: string; autoDetectWindowHeight?: boolean; autoScrollBodyContent?: boolean; + style?: React.CSSProperties; bodyStyle?: React.CSSProperties; contentClassName?: string; contentInnerStyle?: React.CSSProperties; @@ -402,7 +422,7 @@ declare namespace __MaterialUI { } // non generally overridden elements of EnhancedButton - interface SharedEnhancedButtonProps extends React.HTMLAttributesBase { + interface SharedEnhancedButtonProps extends React.HTMLAttributes, React.Props { centerRipple?: boolean; containerElement?: string | React.ReactElement; disabled?: boolean; @@ -502,6 +522,7 @@ declare namespace __MaterialUI { menuItemClassName?: string; menuItemClassNameSubheader?: string; menuItemClassNameLink?: string; + style?: React.CSSProperties; } export class LeftNav extends React.Component { } @@ -521,6 +542,7 @@ declare namespace __MaterialUI { subheader?: string; subheaderStyle?: React.CSSProperties; zDepth?: number; + style?: React.CSSProperties; } export class List extends React.Component { } @@ -552,6 +574,7 @@ declare namespace __MaterialUI { primaryText?: React.ReactNode; secondaryText?: React.ReactNode; secondaryTextLines?: number; + style?: React.CSSProperties; } export class ListItem extends React.Component { } @@ -577,6 +600,7 @@ declare namespace __MaterialUI { toggle?: boolean; onTouchTap?: TouchTapEventHandler; isDisabled?: boolean; + style?: React.CSSProperties; // for MenuItems.Types.NESTED items?: MenuItemRequest[]; @@ -593,6 +617,7 @@ declare namespace __MaterialUI { active?: boolean; onItemTap?: ItemTapEventHandler; menuItemStyle?: React.CSSProperties; + style?: React.CSSProperties; } export class Menu extends React.Component { } @@ -612,6 +637,7 @@ declare namespace __MaterialUI { onToggle?: (e: React.MouseEvent, key: number, toggled: boolean) => void; selected?: boolean; active?: boolean; + style?: React.CSSProperties; } export class MenuItem extends React.Component { static Types: { LINK: string, SUBHEADER: string, NESTED: string, } @@ -644,7 +670,7 @@ declare namespace __MaterialUI { export class Overlay extends React.Component { } - interface PaperProps extends React.HTMLAttributesBase { + interface PaperProps extends React.HTMLAttributes, React.Props { circle?: boolean; rounded?: boolean; transitionEnabled?: boolean; @@ -705,6 +731,7 @@ declare namespace __MaterialUI { size?: number; status?: string; top: number; + style?: React.CSSProperties; } export class RefreshIndicator extends React.Component { } @@ -713,12 +740,14 @@ declare namespace __MaterialUI { interface CircleRippleProps extends React.Props { color?: string; opacity?: number; + style?: React.CSSProperties; } export class CircleRipple extends React.Component { } interface FocusRippleProps extends React.Props { color?: string; + style?: React.CSSProperties; innerStyle?: React.CSSProperties; opacity?: number; show?: boolean; @@ -730,6 +759,7 @@ declare namespace __MaterialUI { centerRipple?: boolean; color?: string; opacity?: number; + style?: React.CSSProperties; } export class TouchRipple extends React.Component { } @@ -782,6 +812,7 @@ declare namespace __MaterialUI { required?: boolean; step?: number; value?: number; + style?: React.CSSProperties; } export class Slider extends React.Component { } @@ -790,6 +821,7 @@ declare namespace __MaterialUI { color?: string; hoverColor?: string; viewBox?: string; + style?: React.CSSProperties; } export class SvgIcon extends React.Component { } @@ -1037,6 +1069,7 @@ declare namespace __MaterialUI { backgroundColor?: string; borderColor?: string; }; + isRtl: boolean; } interface RawTheme { @@ -1064,7 +1097,7 @@ declare namespace __MaterialUI { export var Transitions: Transitions; interface Typography { - textFullBlack:string; + textFullBlack: string; textDarkBlack: string; textLightBlack: string; textMinBlack: string; @@ -1093,6 +1126,7 @@ declare namespace __MaterialUI { onShow?: () => void; onDismiss?: () => void; openOnMount?: boolean; + style?: React.CSSProperties; } export class Snackbar extends React.Component { } @@ -1103,6 +1137,7 @@ declare namespace __MaterialUI { value?: string; selected?: boolean; width?: string; + style?: React.CSSProperties; // Called by Tabs component onActive?: (tab: Tab) => void; @@ -1120,6 +1155,7 @@ declare namespace __MaterialUI { tabItemContainerStyle?: React.CSSProperties; tabWidth?: number; value?: string | number; + tabTemplate?: __React.ComponentClass; onChange?: (value: string | number, e: React.FormEvent, tab: Tab) => void; } @@ -1139,8 +1175,9 @@ declare namespace __MaterialUI { onCellHoverExit?: (row: number, column: number) => void; onRowHover?: (row: number) => void; onRowHoverExit?: (row: number) => void; - onRowSelection?: (selectedRows: number[])=> void; + onRowSelection?: (selectedRows: number[]) => void; selectable?: boolean; + style?: React.CSSProperties; } export class Table extends React.Component { } @@ -1155,17 +1192,19 @@ declare namespace __MaterialUI { onCellHoverExit?: (row: number, column: number) => void; onRowHover?: (row: number) => void; onRowHoverExit?: (row: number) => void; - onRowSelection?: (selectedRows: number[])=> void; + onRowSelection?: (selectedRows: number[]) => void; preScanRows?: boolean; selectable?: boolean; showRowHover?: boolean; stripedRows?: boolean; + style?: React.CSSProperties; } export class TableBody extends React.Component { } interface TableFooterProps extends React.Props { adjustForCheckbox?: boolean; + style?: React.CSSProperties; } export class TableFooter extends React.Component { } @@ -1176,15 +1215,17 @@ declare namespace __MaterialUI { enableSelectAll?: boolean; onSelectAll?: (event: React.MouseEvent) => void; selectAllSelected?: boolean; + style?: React.CSSProperties; } export class TableHeader extends React.Component { } interface TableHeaderColumnProps extends React.Props { columnNumber?: number; - onClick?: (e: React.MouseEvent, column: number) => void; + onClick?: (e: React.MouseEvent, column: number) => void; tooltip?: string; tooltipStyle?: React.CSSProperties; + style?: React.CSSProperties; } export class TableHeaderColumn extends React.Component { } @@ -1202,6 +1243,7 @@ declare namespace __MaterialUI { selectable?: boolean; selected?: boolean; striped?: boolean; + style?: React.CSSProperties; } export class TableRow extends React.Component { } @@ -1211,6 +1253,7 @@ declare namespace __MaterialUI { hoverable?: boolean; onHover?: (e: React.MouseEvent, column: number) => void; onHoverExit?: (e: React.MouseEvent, column: number) => void; + style?: React.CSSProperties; } export class TableRowColumn extends React.Component { } @@ -1240,6 +1283,10 @@ declare namespace __MaterialUI { defaultTime?: Date; format?: string; pedantic?: boolean; + style?: __React.CSSProperties; + textFieldStye?: __React.CSSProperties; + autoOk?: boolean; + openDialog?: () => void; onFocus?: React.FocusEventHandler; onTouchTap?: TouchTapEventHandler; onChange?: (e: any, time: Date) => void; @@ -1266,6 +1313,7 @@ declare namespace __MaterialUI { underlineFocusStyle?: React.CSSProperties; underlineDisabledStyle?: React.CSSProperties; type?: string; + hintStyle?: React.CSSProperties; disabled?: boolean; isRtl?: boolean; @@ -1289,23 +1337,27 @@ declare namespace __MaterialUI { namespace Toolbar { interface ToolbarProps extends React.Props { + style?: React.CSSProperties; } export class Toolbar extends React.Component { } interface ToolbarGroupProps extends React.Props { float?: string; + style?: React.CSSProperties; } export class ToolbarGroup extends React.Component { } interface ToolbarSeparatorProps extends React.Props { + style?: React.CSSProperties; } export class ToolbarSeparator extends React.Component { } - interface ToolbarTitleProps extends React.HTMLAttributesBase { - text?: string; + interface ToolbarTitleProps extends React.HTMLAttributes, React.Props { + text?: string; + style?: React.CSSProperties; } export class ToolbarTitle extends React.Component { } @@ -1327,9 +1379,9 @@ declare namespace __MaterialUI { color: string; } interface ColorManipulator { - fade(color: string, amount: string|number): string; - lighten(color: string, amount: string|number): string; - darken(color: string, amount: string|number): string; + fade(color: string, amount: string | number): string; + lighten(color: string, amount: string | number): string; + darken(color: string, amount: string | number): string; contrastRatio(background: string, foreground: string): number; contrastRatioLevel(background: string, foreground: string): ContrastLevel; } @@ -1421,6 +1473,7 @@ declare namespace __MaterialUI { value?: string | Array; width?: string | number; touchTapCloseDelay?: number; + style?: React.CSSProperties; onKeyboardFocus?: React.FocusEventHandler; onItemTouchTap?: (e: TouchTapEvent, item: React.ReactElement) => void; @@ -1440,6 +1493,7 @@ declare namespace __MaterialUI { value?: string | Array; width?: string | number; zDepth?: number; + style?: React.CSSProperties; } export class Menu extends React.Component{ } @@ -1455,6 +1509,7 @@ declare namespace __MaterialUI { rightIcon?: React.ReactElement; secondaryText?: React.ReactNode; value?: string; + style?: React.CSSProperties; onEscKeyDown?: React.KeyboardEventHandler; onItemTouchTap?: (e: TouchTapEvent, item: React.ReactElement) => void; @@ -1470,6 +1525,34 @@ declare namespace __MaterialUI { export class MenuDivider extends React.Component{ } } + + namespace GridList { + + interface GridListProps extends React.Props { + cols?: number; + padding?: number; + cellHeight?: number; + } + + export class GridList extends React.Component{ + } + + interface GridTileProps extends React.Props { + title?: string; + subtitle?: __React.ReactNode; + titlePosition?: string; //"top"|"bottom" + titleBackground?: string; + actionIcon?: __React.ReactElement; + actionPosition?: string; //"left"|"right" + cols?: number; + rows?: number; + rootClass?: string | __React.Component; + } + + export class GridTile extends React.Component{ + } + + } } // __MaterialUI declare module 'material-ui/lib/app-bar' { @@ -1487,6 +1570,11 @@ declare module 'material-ui/lib/avatar' { export = Avatar; } +declare module "material-ui/lib/badge" { + import Badge = __MaterialUI.Badge; + export = Badge; +} + declare module 'material-ui/lib/before-after-wrapper' { import BeforeAfterWrapper = __MaterialUI.BeforeAfterWrapper; export = BeforeAfterWrapper; @@ -1952,6 +2040,16 @@ declare module "material-ui/lib/menus/menu-divider" { export = MenuDivider; } +declare module "material-ui/lib/grid-list/grid-list" { + import GridList = __MaterialUI.GridList.GridList; + export = GridList; +} + +declare module "material-ui/lib/grid-list/grid-tile" { + import GridTile = __MaterialUI.GridList.GridTile; + export = GridTile; +} + declare module "material-ui/lib/styles/colors" { import Colors = __MaterialUI.Styles.Colors; export = Colors; diff --git a/mathjs/mathjs-tests.ts b/mathjs/mathjs-tests.ts new file mode 100644 index 000000000..78c9ed941 --- /dev/null +++ b/mathjs/mathjs-tests.ts @@ -0,0 +1,581 @@ +/// + + +/* +Basic usage examples +*/ +(function(){ + // functions and constants + math.round(math.e, 3); // 2.718 + math.atan2(3, -3) / math.pi; // 0.75 + math.log(10000, 10); // 4 + math.sqrt(-4); // 2i + math.pow([[-1, 2], [3, 1]], 2); // [[7, 0], [0, 7]] + + // expressions + math.eval('1.2 * (2 + 4.5)'); // 7.8 + math.eval('5.08 cm to inch'); // 2 inch + math.eval('sin(45 deg) ^ 2'); // 0.5 + math.eval('9 / 3 + 2i'); // 3 + 2i + math.eval('det([-1, 2; 3, 1])'); // -7 + + // chained operations + var a = math.chain(3) + .add(4) + .multiply(2) + .done(); // 14 + + // mixed use of different data types in functions + console.log('mixed use of data types'); + math.add(4, [5, 6]); // number + Array, [9, 10] + math.multiply(math.unit('5 mm'), 3); // Unit * number, 15 mm + math.subtract([2, 3, 4], 5); // Array - number, [-3, -2, -1] + math.add(math.matrix([2, 3]), [4, 5]); // Matrix + Array, [6, 8] +}()); + + +/* +Bignumbers examples +*/ +(function() { + // configure the default type of numbers as BigNumbers + math.config({ + number: 'bignumber', // Default type of number: + // 'number' (default), 'bignumber', or 'fraction' + precision: 20 // Number of significant digits for BigNumbers + }); + + console.log('round-off errors with numbers'); + math.add(0.1, 0.2); // number, 0.30000000000000004 + math.divide(0.3, 0.2); // number, 1.4999999999999998 + console.log(); + + console.log('no round-off errors with BigNumbers'); + math.add(math.bignumber(0.1), math.bignumber(0.2)); // BigNumber, 0.3 + math.divide(math.bignumber(0.3), math.bignumber(0.2)); // BigNumber, 1.5 + console.log(); + + console.log('create BigNumbers from strings when exceeding the range of a number'); + math.bignumber(1.2e+500); // BigNumber, Infinity WRONG + math.bignumber('1.2e+500'); // BigNumber, 1.2e+500 + console.log(); + + // one can work conveniently with BigNumbers using the expression parser. + // note though that BigNumbers are only supported in arithmetic functions + console.log('use BigNumbers in the expression parser'); + math.eval('0.1 + 0.2'); // BigNumber, 0.3 + math.eval('0.3 / 0.2'); // BigNumber, 1.5 + console.log(); +}()); + + + +/* +Chaining examples +*/ +(function() { + // create a chained operation using the function `chain(value)` + // end a chain using done(). Let's calculate (3 + 4) * 2 + var a = math.chain(3) + .add(4) + .multiply(2) + .done(); // 14 + + // Another example, calculate square(sin(pi / 4)) + var b = math.chain(math.pi) + .divide(4) + .sin() + .square() + .done(); // 0.5 + + // A chain has a few special methods: done, toString, valueOf, get, and set. + // these are demonstrated in the following examples + + // toString will return a string representation of the chain's value + var chain = math.chain(2).divide(3); + var str = chain.toString(); // "0.6666666666666666" + + // a chain has a function .valueOf(), which returns the value hold by the chain. + // This allows using it in regular operations. The function valueOf() acts the + // same as function done(). + chain.valueOf(); // 0.66666666666667 + + + // the function subset can be used to get or replace sub matrices + var array = [[1, 2], [3, 4]]; + var v = math.chain(array) + .subset(math.index(1, 0)) + .done(); // 3 + + var m = math.chain(array) + .subset(math.index(0, 0), 8) + .multiply(3) + .done(); // [[24, 6], [9, 12]] +}()); + + +/* +Complex numbers examples +*/ +(function(){ + var a = math.complex(2, 3); // 2 + 3i + + // read the real and complex parts of the complex number + a.re; // 2 + a.im; // 3 + + // clone a complex value + var clone = a.clone(); // 2 + 3i + + // adjust the complex value + a.re = 5; // 5 + 3i + + // create a complex number by providing a string with real and complex parts + var b = math.complex('3 - 7i'); // 3 - 7i + console.log(); + + // perform operations with complex numbers + console.log('perform operations'); + math.add(a, b); // 8 - 4i + math.multiply(a, b); // 36 - 26i + math.sin(a); // -9.6541254768548 + 2.8416922956064i + + // some operations will return a complex number depending on the arguments + math.sqrt(4); // 2 + math.sqrt(-4); // 2i + + // create a complex number from polar coordinates + console.log('create complex numbers with polar coordinates'); + var c = math.complex({r: math.sqrt(2), phi: math.pi / 4}); // 1 + i + + // get polar coordinates of a complex number + var d = math.complex(3, 4); + d.toPolar(); // { r: 5, phi: 0.9272952180016122 } +}()); + + +/* +Expressions examples +*/ +(function() { + // 1. using the function math.eval + // + // Function `eval` accepts a single expression or an array with + // expressions as first argument, and has an optional second argument + // containing a scope with variables and functions. The scope is a regular + // JavaScript Object. The scope will be used to resolve symbols, and to write + // assigned variables or function. + console.log('1. USING FUNCTION MATH.EVAL'); + + // evaluate expressions + console.log('\nevaluate expressions'); + math.eval('sqrt(3^2 + 4^2)'); // 5 + math.eval('sqrt(-4)'); // 2i + math.eval('2 inch to cm'); // 5.08 cm + math.eval('cos(45 deg)'); // 0.70711 + + // evaluate multiple expressions at once + console.log('\nevaluate multiple expressions at once'); + math.eval([ + 'f = 3', + 'g = 4', + 'f * g' + ]); // [3, 4, 12] + + // provide a scope (just a regular JavaScript Object) + console.log('\nevaluate expressions providing a scope with variables and functions'); + var scope: any = { + a: 3, + b: 4 + }; + + // variables can be read from the scope + math.eval('a * b', scope); // 12 + + // variable assignments are written to the scope + math.eval('c = 2.3 + 4.5', scope); // 6.8 + scope.c; // 6.8 + + // scope can contain both variables and functions + scope["hello"] = function (name: string) { + return 'hello, ' + name + '!'; + }; + math.eval('hello("hero")', scope); // "hello, hero!" + + // define a function as an expression + var f = math.eval('f(x) = x ^ a', scope); + f(2); // 8 + scope.f(2); // 8 + + + + // 2. using function math.parse + // + // Function `math.parse` parses expressions into a node tree. The syntax is + // similar to function `math.eval`. + // Function `parse` accepts a single expression or an array with + // expressions as first argument. The function returns a node tree, which + // then can be compiled against math, and then evaluated against an (optional + // scope. This scope is a regular JavaScript Object. The scope will be used + // to resolve symbols, and to write assigned variables or function. + console.log('\n2. USING FUNCTION MATH.PARSE'); + + // parse an expression + console.log('\nparse an expression into a node tree'); + var node1 = math.parse('sqrt(3^2 + 4^2)'); + node1.toString(); // "sqrt((3 ^ 2) + (4 ^ 2))" + + // compile and evaluate the compiled code + // you could also do this in two steps: node1.compile().eval() + node1.eval(); // 5 + + // provide a scope + console.log('\nprovide a scope'); + var node2 = math.parse('x^a'); + var code2 = node2.compile(); + node2.toString(); // "x ^ a" + var scope: any = { + x: 3, + a: 2 + }; + code2.eval(scope); // 9 + + // change a value in the scope and re-evaluate the node + scope.a = 3; + code2.eval(scope); // 27 + + + // 3. using function math.compile + // + // Function `math.compile` compiles expressions into a node tree. The syntax is + // similar to function `math.eval`. + // Function `compile` accepts a single expression or an array with + // expressions as first argument, and returns an object with a function eval + // to evaluate the compiled expression. On evaluation, an optional scope can + // be provided. This scope will be used to resolve symbols, and to write + // assigned variables or function. + console.log('\n3. USING FUNCTION MATH.COMPILE'); + + // parse an expression + console.log('\ncompile an expression'); + var code3 = math.compile('sqrt(3^2 + 4^2)'); + + // evaluate the compiled code + code3.eval(); // 5 + + // provide a scope for the variable assignment + console.log('\nprovide a scope'); + var code2 = math.compile('a = a + 3'); + var scope: any = { + a: 7 + }; + code2.eval(scope); + scope.a; // 10 + + + // 4. using a parser + // + // In addition to the static functions `math.eval` and `math.parse`, math.js + // contains a parser with functions `eval` and `parse`, which automatically + // keeps a scope with assigned variables in memory. The parser also contains + // some convenience methods to get, set, and remove variables from memory. + console.log('\n4. USING A PARSER'); + var parser = math.parser(); + + // evaluate with parser + console.log('\nevaluate expressions'); + parser.eval('sqrt(3^2 + 4^2)'); // 5 + parser.eval('sqrt(-4)'); // 2i + parser.eval('2 inch to cm'); // 5.08 cm + parser.eval('cos(45 deg)'); // 0.70711 + + // define variables and functions + console.log('\ndefine variables and functions'); + parser.eval('x = 7 / 2'); // 3.5 + parser.eval('x + 3'); // 6.5 + parser.eval('f(x, y) = x^y'); // f(x, y) + parser.eval('f(2, 3)'); // 8 + + // manipulate matrices + // Note that matrix indexes in the expression parser are one-based with the + // upper-bound included. On a JavaScript level however, math.js uses zero-based + // indexes with an excluded upper-bound. + console.log('\nmanipulate matrices'); + parser.eval('k = [1, 2; 3, 4]'); // [[1, 2], [3, 4]] + parser.eval('l = zeros(2, 2)'); // [[0, 0], [0, 0]] + parser.eval('l[1, 1:2] = [5, 6]'); // [[5, 6], [0, 0]] + parser.eval('l[2, :] = [7, 8]'); // [[5, 6], [7, 8]] + parser.eval('m = k * l'); // [[19, 22], [43, 50]] + parser.eval('n = m[2, 1]'); // 43 + parser.eval('n = m[:, 1]'); // [[19], [43]] + + // get and set variables and functions + console.log('\nget and set variables and function in the scope of the parser'); + var x = parser.get('x'); + console.log('x =', x); // x = 7 + var f = parser.get('f'); + console.log('f =', math.format(f)); // f = f(x, y) + var g = f(3, 3); + console.log('g =', g); // g = 27 + + parser.set('h', 500); + parser.eval('h / 2'); // 250 + parser.set('hello', function (name: string) { + return 'hello, ' + name + '!'; + }); + parser.eval('hello("hero")'); // "hello, hero!" + + // clear defined functions and variables + parser.clear(); +}()); + + +/* +Fractions examples +*/ +(function(){ + // configure the default type of numbers as Fractions + math.config({ + number: 'fraction' // Default type of number: + // 'number' (default), 'bignumber', or 'fraction' + }); + + console.log('basic usage'); + math.fraction(0.125); // Fraction, 1/8 + math.fraction(0.32); // Fraction, 8/25 + math.fraction('1/3'); // Fraction, 1/3 + math.fraction('0.(3)'); // Fraction, 1/3 + math.fraction(2, 3); // Fraction, 2/3 + math.fraction('0.(285714)'); // Fraction, 2/7 + console.log(); + + console.log('round-off errors with numbers'); + math.add(0.1, 0.2); // number, 0.30000000000000004 + math.divide(0.3, 0.2); // number, 1.4999999999999998 + console.log(); + + console.log('no round-off errors with fractions :)'); + math.add(math.fraction(0.1), math.fraction(0.2)); // Fraction, 3/10 + math.divide(math.fraction(0.3), math.fraction(0.2)); // Fraction, 3/2 + console.log(); + + console.log('represent an infinite number of repeating digits'); + math.fraction('1/3'); // Fraction, 0.(3) + math.fraction('2/7'); // Fraction, 0.(285714) + math.fraction('23/11'); // Fraction, 2.(09) + console.log(); + + // one can work conveniently with fractions using the expression parser. + // note though that Fractions are only supported by basic arithmetic functions + console.log('use fractions in the expression parser'); + math.eval('0.1 + 0.2'); // Fraction, 3/10 + math.eval('0.3 / 0.2'); // Fraction, 3/2 + math.eval('23 / 11'); // Fraction, 23/11 + console.log(); + + // output formatting + console.log('output formatting of fractions'); + var a = math.fraction('2/3'); + console.log(math.format(a)); // Fraction, 2/3 + console.log(math.format(a, {fraction: 'ratio'})); // Fraction, 2/3 + console.log(math.format(a, {fraction: 'decimal'})); // Fraction, 0.(6) + console.log(a.toString()); // Fraction, 0.(6) + console.log(); +}()); + +/* +Matrices examples +*/ +(function() { + // create matrices and arrays. a matrix is just a wrapper around an Array, + // providing some handy utilities. + console.log('create a matrix'); + var a = math.matrix([1, 4, 9, 16, 25]); // [1, 4, 9, 16, 25] + var b = math.matrix(math.ones([2, 3])); // [[1, 1, 1], [1, 1, 1]] + b.size(); // [2, 3] + + // the Array data of a Matrix can be retrieved using valueOf() + var array = a.valueOf(); // [1, 4, 9, 16, 25] + + // Matrices can be cloned + var clone = a.clone(); // [1, 4, 9, 16, 25] + console.log(); + + // perform operations with matrices + console.log('perform operations'); + math.sqrt(a); // [1, 2, 3, 4, 5] + var c = [1, 2, 3, 4, 5]; + math.factorial(c); // [1, 2, 6, 24, 120] + console.log(); + + // create and manipulate matrices. Arrays and Matrices can be used mixed. + console.log('manipulate matrices'); + var d = [[1, 2], [3, 4]]; // [[1, 2], [3, 4]] + var e = math.matrix([[5, 6], [1, 1]]); // [[5, 6], [1, 1]] + + // set a submatrix. + // Matrix indexes are zero-based. + e.subset(math.index(1, [0, 1]), [[7, 8]]); // [[5, 6], [7, 8]] + var f = math.multiply(d, e); // [[19, 22], [43, 50]] + var g = f.subset(math.index(1, 0)); // 43 + console.log(); + + // get a sub matrix + // Matrix indexes are zero-based. + console.log('get a sub matrix'); + var h = math.diag(math.range(1,4)); // [[1, 0, 0], [0, 2, 0], [0, 0, 3]] + h.subset( math.index([1, 2], [1, 2])); // [[2, 0], [0, 3]] + var i = math.range(1,6); // [1, 2, 3, 4, 5] + i.subset(math.index(math.range(1,4))); // [2, 3, 4] + console.log(); + + + // resize a multi dimensional matrix + console.log('resizing a matrix'); + var j = math.matrix(); + var defaultValue = 0; + j.resize([2, 2, 2], defaultValue); // [[[0, 0], [0, 0]], [[0, 0], [0, 0]]] + j.size(); // [2, 2, 2] + j.resize([2, 2]); // [[0, 0], [0, 0]] + j.size(); // [2, 2] + console.log(); + + // setting a value outside the matrices range will resize the matrix. + // new elements will be initialized with zero. + console.log('set a value outside a matrices range'); + var k = math.matrix(); + k.subset(math.index(2), 6); // [0, 0, 6] + console.log(); + + console.log('set a value outside a matrices range, leaving new entries uninitialized'); + var m = math.matrix(); + defaultValue = math.uninitialized; + m.subset(math.index(2), 6, defaultValue); // [undefined, undefined, 6] + console.log(); + + // create ranges + console.log('create ranges'); + math.range(1, 6); // [1, 2, 3, 4, 5] + math.range(0, 18, 3); // [0, 3, 6, 9, 12, 15] + math.range('2:-1:-3'); // [2, 1, 0, -1, -2] + math.factorial(math.range('1:6')); // [1, 2, 6, 24, 120] + console.log(); +}()); + +/* +Sparse matrices examples +*/ +(function() { + // create a sparse matrix + console.log('creating a 1000x1000 sparse matrix...'); + var a = math.eye(1000, 1000, 'sparse'); + + // do operations with a sparse matrix + console.log('doing some operations on the sparse matrix...'); + var b = math.multiply(a, a); + var c = math.multiply(b, math.complex(2, 2)); + var d = math.transpose(c); + var e = math.multiply(d, a); + + // we will not print the output, but doing the same operations + // with a dense matrix are very slow, try it for yourself. + console.log('already done'); + console.log('now try this with a dense matrix :)'); +}()); + +/* +Units examples +*/ +(function() { + // units can be created by providing a value and unit name, or by providing + // a string with a valued unit. + console.log('create units'); + var a = math.unit(45, 'cm'); // 450 mm + var b = math.unit('0.1m'); // 100 mm + console.log(); + + // units can be added, subtracted, and multiplied or divided by numbers and by other units + console.log('perform operations'); + math.add(a, b); // 0.55 m + math.multiply(b, 2); // 200 mm + math.divide(math.unit('1 m'), math.unit('1 s')); // 1 m / s + math.pow(math.unit('12 in'), 3); // 1728 in^3 + console.log(); + + // units can be converted to a specific type, or to a number + console.log('convert to another type or to a number'); + b.to('cm'); // 10 cm Alternatively: math.to(b, 'cm') + math.to(b, 'inch'); // 3.9370... inch + b.toNumber('cm'); // 10 + math.number(b, 'cm'); // 10 + console.log(); + + // the expression parser supports units too + console.log('parse expressions'); + math.eval('2 inch to cm'); // 5.08 cm + math.eval('cos(45 deg)'); // 0.70711... + math.eval('90 km/h to m/s'); // 25 m / s + console.log(); + + // convert a unit to a number + // A second parameter with the unit for the exported number must be provided + math.eval('number(5 cm, mm)'); // number, 50 + console.log(); + + // simplify units + console.log('simplify units'); + math.eval('100000 N / m^2'); // 100 kPa + math.eval('9.81 m/s^2 * 100 kg * 40 m'); // 39.24 kJ + console.log(); + + // example engineering calculations + console.log('compute molar volume of ideal gas at 65 Fahrenheit, 14.7 psi in L/mol'); + var Rg = math.unit('8.314 N m / (mol K)'); + var T = math.unit('65 degF'); + var P = math.unit('14.7 psi'); + var v = math.divide(math.multiply(Rg, T), P); + console.log('gas constant (Rg) = ', format(Rg)); + console.log('P = ' + format(P)); + console.log('T = ' + format(T)); + console.log('v = Rg * T / P = ' + format(math.to(v, 'L/mol'))); // 23.910... L / mol + console.log(); + + console.log('compute speed of fluid flowing out of hole in a container'); + var g = math.unit('9.81 m / s^2'); + var h = math.unit('1 m'); + var v2 = math.pow(math.multiply(2, math.multiply(g, h)), 0.5); // Can also use math.sqrt + console.log('g = ' + format(g)); + console.log('h = ' + format(h)); + console.log('v = (2 g h) ^ 0.5 = ' + format(v2)); // 4.429... m / s + console.log(); + + console.log('electrical power consumption:'); + var expr = '460 V * 20 A * 30 days to kWh'; + console.log(expr + ' = ' + math.eval(expr)); // 6624 kWh + console.log(); + + console.log('circuit design:'); + var expr = '24 V / (6 mA)'; + console.log(expr + ' = ' + math.eval(expr)); // 4 kohm + console.log(); + + console.log('operations on arrays:'); + var B = math.eval('[1, 0, 0] T'); + var v3 = math.eval('[0, 1, 0] m/s'); + var q = math.eval('1 C'); + var F = math.multiply(q, math.cross(v3, B)); + console.log('B (magnetic field strength) = ' + format(B)); // [1 T, 0 T, 0 T] + console.log('v (particle velocity) = ' + format(v3)); // [0 m / s, 1 m / s, 0 m / s] + console.log('q (particle charge) = ' + format(q)); // 1 C + console.log('F (force) = q (v cross B) = ' + format(F)); // [0 N, 0 N, -1 N] + + /** + * Helper function to format an output a value. + * @param {*} value + * @return {string} Returns the formatted value + */ + function format (value: any): string { + var precision = 14; + return math.format(value, precision); + } +}()); \ No newline at end of file diff --git a/mathjs/mathjs.d.ts b/mathjs/mathjs.d.ts new file mode 100644 index 000000000..e6fa6a877 --- /dev/null +++ b/mathjs/mathjs.d.ts @@ -0,0 +1,2138 @@ +// Type definitions for mathjs +// Project: http://mathjs.org/ +// Definitions by: Ilya Shestakov +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare var math: mathjs.IMathJsStatic; + +declare module mathjs { + + type MathArray = number[]|number[][]; + type MathType = number|BigNumber|Fraction|Complex|Unit|MathArray|Matrix; + type MathExpression = string|string[]|MathArray|Matrix; + + export interface IMathJsStatic { + + e: number; + pi: number; + uninitialized: any; + + config(options: any): void; + + /** + * Solves the linear equation system by forwards substitution. Matrix must be a lower triangular matrix. + * @param L A N x N matrix or array (L) + * @param b A column vector with the b values + * @returns A column vector with the linear system solution (x) + */ + lsolve(L: Matrix|MathArray, b: Matrix|MathArray): Matrix|MathArray; + + /** + * Calculate the Matrix LU decomposition with partial pivoting. Matrix A is decomposed in two matrices (L, U) + * and a row permutation vector p where A[p,:] = L * U + * @param A A two dimensional matrix or array for which to get the LUP decomposition. + * @returns The lower triangular matrix, the upper triangular matrix and the permutation matrix. + */ + lup(A?: Matrix|MathArray): MathArray; + + /** + * Solves the linear system A * x = b where A is an [n x n] matrix and b is a [n] column vector. + * @param A Invertible Matrix or the Matrix LU decomposition + * @param b Column Vector + * @returns Column vector with the solution to the linear system A * x = b + */ + lusolve(A: Matrix|MathArray|Number, b: Matrix|MathArray): Matrix|MathArray; + + /** + * Calculate the Sparse Matrix LU decomposition with full pivoting. Sparse Matrix A is decomposed in + * two matrices (L, U) and two permutation vectors (pinv, q) where P * A * Q = L * U + * @param A A two dimensional sparse matrix for which to get the LU decomposition. + * @param order The Symbolic Ordering and Analysis order: 0 - Natural ordering, no permutation vector q is + * returned 1 - Matrix must be square, symbolic ordering and analisis is performed on M = A + A' 2 - Symbolic + * ordering and analisis is performed on M = A' * A. Dense columns from A' are dropped, A recreated from A'. + * This is appropriatefor LU factorization of unsymmetric matrices. 3 - Symbolic ordering and analisis is performed + * on M = A' * A. This is best used for LU factorization is matrix M has no dense rows. A dense row is a row with + * more than 10*sqr(columns) entries. + * @param threshold Partial pivoting threshold (1 for partial pivoting) + * @returns The lower triangular matrix, the upper triangular matrix and the permutation vectors. + */ + slu(A: Matrix, order: Number, threshold: Number): any; + + /** + * Solves the linear equation system by backward substitution. Matrix must be an upper triangular matrix. U * x = b + * @param U A N x N matrix or array (U) + * @param b A column vector with the b values + * @returns A column vector with the linear system solution (x) + */ + usolve(U: Matrix|MathArray, b:Matrix|MathArray): Matrix|MathArray; + + /** + * Calculate the absolute value of a number. For matrices, the function is evaluated element wise. + * @param x A number or matrix for which to get the absolute value + * @returns Absolute value of x + */ + abs(x: number): number; + abs(x: BigNumber): BigNumber; + abs(x: Fraction): Fraction; + abs(x: Complex): Complex; + abs(x: MathArray): MathArray; + abs(x: Matrix): Matrix; + abs(x: Unit): Unit; + + /** + * Add two values, x + y. For matrices, the function is evaluated element wise. + * @param x First value to add + * @param y Second value to add + * @returns Sum of x and y + */ + add(x: MathType, y: MathType): MathType; + + /** + * Calculate the cubic root of a value. For matrices, the function is evaluated element wise. + * @param x Value for which to calculate the cubic root. + * @param allRoots Optional, false by default. Only applicable when x is a number or complex number. If true, all complex roots are returned, if false (default) the principal root is returned. + * @returns Returns the cubic root of x + */ + cbrt(x: number, allRoots?: boolean): number; + cbrt(x: BigNumber, allRoots?: boolean): BigNumber; + cbrt(x: Fraction, allRoots?: boolean): Fraction; + cbrt(x: Complex, allRoots?: boolean): Complex; + cbrt(x: MathArray, allRoots?: boolean): MathArray; + cbrt(x: Matrix, allRoots?: boolean): Matrix; + cbrt(x: Unit, allRoots?: boolean): Unit; + + /** + * Round a value towards plus infinity If x is complex, both real and imaginary part are rounded towards plus infinity. For matrices, the function is evaluated element wise. + * @param x Number to be rounded + * @returns Rounded value + */ + ceil(x: number): number; + ceil(x: BigNumber): BigNumber; + ceil(x: Fraction): Fraction; + ceil(x: Complex): Complex; + ceil(x: MathArray): MathArray; + ceil(x: Matrix): Matrix; + ceil(x: Unit): Unit; + + /** + * Compute the cube of a value, x * x * x. For matrices, the function is evaluated element wise. + * @param x Number for which to calculate the cube + * @returns Cube of x + */ + cube(x: number): number; + cube(x: BigNumber): BigNumber; + cube(x: Fraction): Fraction; + cube(x: Complex): Complex; + cube(x: MathArray): MathArray; + cube(x: Matrix): Matrix; + cube(x: Unit): Unit; + + /** + * Divide two values, x / y. To divide matrices, x is multiplied with the inverse of y: x * inv(y). + * @param x Numerator + * @param y Denominator + * @returns Quotient, x / y + */ + divide(x: Unit, y: Unit): Unit; + divide(x: number, y: number): number; + divide(x:MathType, y:MathType): MathType; + + /** + * Divide two matrices element wise. The function accepts both matrices and scalar values. + * @param x Numerator + * @param y Denominator + * @returns Quotient, x ./ y + */ + dotDivide(x: MathType, y: MathType): MathType; + + /** + * Multiply two matrices element wise. The function accepts both matrices and scalar values. + * @param x Left hand value + * @param y Right hand value + * @returns Multiplication of x and y + */ + dotMultiply(x: MathType, y: MathType): MathType; + + /** + * Calculates the power of x to y element wise. + * @param x The base + * @param y The exponent + * @returns The value of x to the power y + */ + dotPow(x: MathType, y: MathType): MathType; + + /** + * Calculate the exponent of a value. For matrices, the function is evaluated element wise. + * @param x A number or matrix to exponentiate + * #returns Exponent of x + */ + exp(x: number): number; + exp(x: BigNumber ): BigNumber ; + exp(x: Complex ): Complex ; + exp(x: MathArray ): MathArray ; + exp(x: Matrix): Matrix; + + /** + * Round a value towards zero. For matrices, the function is evaluated element wise. + * @param x Number to be rounded + * @returns Rounded value + */ + fix(x: number): number; + fix(x: BigNumber ): BigNumber ; + fix(x: Fraction ): Fraction ; + fix(x: Complex ): Complex ; + fix(x: MathArray ): MathArray ; + fix(x: Matrix): Matrix; + + /** + * Round a value towards minus infinity. For matrices, the function is evaluated element wise. + * @param Number to be rounded + * @returns Rounded value + */ + floor(x: number): number; + floor(x: BigNumber ): BigNumber ; + floor(x: Fraction ): Fraction ; + floor(x: Complex ): Complex ; + floor(x: MathArray ): MathArray ; + floor(x: Matrix): Matrix; + + /** + * Calculate the greatest common divisor for two or more values or arrays. For matrices, the function is evaluated element wise. + */ + gcd(...args: number[]): number; + gcd(...args: BigNumber[]): BigNumber ; + gcd(...args: Fraction[]): Fraction ; + gcd(...args: MathArray[]): MathArray ; + gcd(...args: Matrix[]): Matrix; + + /** + * Calculate the hypotenusa of a list with values. The hypotenusa is defined as: + * hypot(a, b, c, ...) = sqrt(a^2 + b^2 + c^2 + ...) + * For matrix input, the hypotenusa is calculated for all values in the matrix. + */ + hypot(...args: number[]): number; + hypot(...args: BigNumber[]): BigNumber; + + /** + * Calculate the least common multiple for two or more values or arrays. lcm is defined as: + * lcm(a, b) = abs(a * b) / gcd(a, b) + * For matrices, the function is evaluated element wise. + */ + lcm(a: number, b: number): number; + lcm(a: BigNumber , b: BigNumber ): BigNumber ; + lcm(a: MathArray, b: MathArray): MathArray; + lcm(a: Matrix, b: Matrix): Matrix; + + /** + * Calculate the logarithm of a value. For matrices, the function is evaluated element wise. + * @param x Value for which to calculate the logarithm. + * @param base Optional base for the logarithm. If not provided, the natural logarithm of x is calculated. Default value: e. + */ + log(x: number|BigNumber|Complex|MathArray|Matrix, base?: number|BigNumber|Complex): number|BigNumber|Complex|MathArray|Matrix; + + /** + * Calculate the 10-base of a value. This is the same as calculating log(x, 10). For matrices, the function is evaluated element wise. + * @param x Value for which to calculate the logarithm. + */ + log10(x: number): number; + log10(x: BigNumber): BigNumber; + log10(x: Complex): Complex; + log10(x: MathArray): MathArray; + log10(x: Matrix): Matrix; + + /** + * Calculates the modulus, the remainder of an integer division. For matrices, the function is evaluated element wise. + * The modulus is defined as: + * x - y * floor(x / y) + * See http://en.wikipedia.org/wiki/Modulo_operation. + * @param x Dividend + * @param y Divisor + */ + mod(x: number|BigNumber|Fraction|MathArray|Matrix, y: number|BigNumber|Fraction|MathArray|Matrix): number|BigNumber|Fraction|MathArray|Matrix; + + /** + * Multiply two values, x * y. The result is squeezed. For matrices, the matrix product is calculated. + */ + multiply(x: MathArray|Matrix, y: MathArray|Matrix): Matrix; + multiply(x: MathArray|Matrix, y: MathType): Matrix; + multiply(x: Unit, y: Unit): Unit; + multiply(x: number, y: number): number; + multiply(x: MathType, y: MathType): MathType; + + /** + * Calculate the norm of a number, vector or matrix. The second parameter p is optional. If not provided, it defaults to 2. + * @param x Value for which to calculate the norm + * @param p Vector space. Supported numbers include Infinity and -Infinity. Supported strings are: 'inf', '-inf', and 'fro' (The Frobenius norm) Default value: 2. + * @returns the p-norm + */ + norm(x: number|BigNumber|Complex|MathArray|Matrix, p?: number|BigNumber|string): number|BigNumber; + + /** + * Calculate the nth root of a value. The principal nth root of a positive real number A, is the positive real solution of the equation + * x^root = A + * For matrices, the function is evaluated element wise. + * @param a Value for which to calculate the nth root + * @param root The root. Default value: 2. + */ + nthRoot(a: number|BigNumber|MathArray|Matrix|Complex, root?: number|BigNumber): number|Complex|MathArray|Matrix; + + /** + * Calculates the power of x to y, x ^ y. Matrix exponentiation is supported for square matrices x, and positive integer exponents y. + * @param x The base + * @param y The exponent + */ + pow(x: number|BigNumber|Complex|MathArray|Matrix, y: number|BigNumber|Complex): number|BigNumber|Complex|MathArray|Matrix; + + /** + * Round a value towards the nearest integer. For matrices, the function is evaluated element wise. + * @param x Number to be rounded + * @param n Number of decimals Default value: 0. + */ + round(x: number|BigNumber|Fraction|Complex|MathArray|Matrix, n?: number|BigNumber|MathArray): number|BigNumber|Fraction|Complex|MathArray|Matrix; + + /** + * Compute the sign of a value. The sign of a value x is: + * 1 when x > 1 + * -1 when x < 0 + * 0 when x == 0 + * For matrices, the function is evaluated element wise. + */ + sign(x: number): number; + sign(x: BigNumber ): BigNumber; + sign(x: Fraction ): Fraction ; + sign(x: Complex ): Complex ; + sign(x: MathArray): MathArray; + sign(x: Matrix): Matrix; + sign(x: Unit): Unit; + + /** + * Calculate the square root of a value. For matrices, the function is evaluated element wise. + */ + sqrt(x: number): number; + sqrt(x: BigNumber ): BigNumber; + sqrt(x: Complex ): Complex ; + sqrt(x: MathArray): MathArray; + sqrt(x: Matrix): Matrix; + sqrt(x: Unit): Unit; + + /** + * Compute the square of a value, x * x. For matrices, the function is evaluated element wise. + */ + square(x: number): number; + square(x: BigNumber ): BigNumber; + square(x: Fraction ): Fraction ; + square(x: Complex ): Complex ; + square(x: MathArray): MathArray; + square(x: Matrix): Matrix; + square(x: Unit): Unit; + + /** + * Subtract two values, x - y. For matrices, the function is evaluated element wise. + */ + subtract(x: MathType, y: MathType): MathType; + + /** + * Inverse the sign of a value, apply a unary minus operation. + * For matrices, the function is evaluated element wise. Boolean values and strings will be converted to a number. For complex numbers, both real and complex value are inverted. + */ + unaryMinus(x: number): number; + unaryMinus(x: BigNumber ): BigNumber; + unaryMinus(x: Fraction ): Fraction ; + unaryMinus(x: Complex ): Complex ; + unaryMinus(x: MathArray): MathArray; + unaryMinus(x: Matrix): Matrix; + unaryMinus(x: Unit): Unit; + + /** + * Unary plus operation. Boolean values and strings will be converted to a number, numeric values will be returned as is. + * For matrices, the function is evaluated element wise. + */ + unaryPlus(x: number): number; + unaryPlus(x: BigNumber ): BigNumber; + unaryPlus(x: Fraction ): Fraction ; + unaryPlus(x: string): string; + unaryPlus(x: Complex ): Complex ; + unaryPlus(x: MathArray): MathArray; + unaryPlus(x: Matrix): Matrix; + unaryPlus(x: Unit): Unit; + + /** + * Calculate the extended greatest common divisor for two values. See http://en.wikipedia.org/wiki/Extended_Euclidean_algorithm. + */ + xgcd(a: number|BigNumber, b: number|BigNumber): MathArray; + + /** + * Bitwise AND two values, x & y. For matrices, the function is evaluated element wise. + */ + bitAnd(x: number|BigNumber|MathArray|Matrix, y: number|BigNumber|MathArray|Matrix): number|BigNumber|MathArray|Matrix; + + /** + * Bitwise NOT value, ~x. For matrices, the function is evaluated element wise. For units, the function is evaluated on the best prefix base. + */ + bitNot(x: number): number; + bitNot(x: BigNumber ): BigNumber ; + bitNot(x: MathArray): MathArray; + bitNot(x: Matrix): Matrix; + + /** + * Bitwise OR two values, x | y. For matrices, the function is evaluated element wise. For units, the function is evaluated on the lowest print base. + */ + bitOr(x: number): number; + bitOr(x: BigNumber ): BigNumber ; + bitOr(x: MathArray): MathArray; + bitOr(x: Matrix): Matrix; + + /** + * Bitwise XOR two values, x ^ y. For matrices, the function is evaluated element wise. + */ + bitXor(x: number|BigNumber|MathArray|Matrix, y: number|BigNumber|MathArray|Matrix): number|BigNumber|MathArray|Matrix; + + /** + * Bitwise left logical shift of a value x by y number of bits, x << y. For matrices, the function is evaluated element wise. For units, the function is evaluated on the best prefix base. + * @param x Value to be shifted + * @param y Amount of shifts + */ + leftShift(x: number|BigNumber|MathArray|Matrix, y: number|BigNumber): number|BigNumber|MathArray|Matrix; + + /** + * Bitwise right arithmetic shift of a value x by y number of bits, x >> y. For matrices, the function is evaluated element wise. For units, the function is evaluated on the best prefix base. + * @param x Value to be shifted + * @param y Amount of shifts + */ + rightArithShift(x: number|BigNumber|MathArray|Matrix, y: number|BigNumber): number|BigNumber|MathArray|Matrix; + + /** + * Bitwise right logical shift of value x by y number of bits, x >>> y. For matrices, the function is evaluated element wise. For units, the function is evaluated on the best prefix base. + * @param x Value to be shifted + * @param y Amount of shifts + */ + rightLogShift(x: number|MathArray|Matrix, y: number): number|MathArray|Matrix; + + /** + * The Bell Numbers count the number of partitions of a set. A partition is a pairwise disjoint subset of S whose union is S. bellNumbers only takes integer arguments. The following condition must be enforced: n >= 0 + * @param n Total number of objects in the set + */ + bellNumbers(n: Number): Number; + bellNumbers(n: BigNumber): BigNumber; + + /** + * The Catalan Numbers enumerate combinatorial structures of many different types. catalan only takes integer arguments. The following condition must be enforced: n >= 0 + * @pararm n nth Catalan number + */ + catalan(n: Number): Number; + catalan(n: BigNumber): BigNumber; + + /** + * The composition counts of n into k parts. Composition only takes integer arguments. The following condition must be enforced: k <= n. + * @param n Total number of objects in the set + * @param k Number of objects in the subset + * @returns Returns the composition counts of n into k parts. + */ + composition(n: Number|BigNumber, k: Number|BigNumber): Number|BigNumber + + /** + * The Stirling numbers of the second kind, counts the number of ways to partition a set of n labelled objects into k nonempty unlabelled subsets. stirlingS2 only takes integer arguments. The following condition must be enforced: k <= n. + * If n = k or k = 1, then s(n,k) = 1 + * @param n Total number of objects in the set + * @param k Number of objects in the subset + */ + stirlingS2(n: Number|BigNumber, k: Number|BigNumber): Number|BigNumber; + + /** + * Compute the argument of a complex value. For a complex number a + bi, the argument is computed as atan2(b, a). For matrices, the function is evaluated element wise. + * @param x A complex number or array with complex numbers + */ + arg(x: number): number; + arg(x: Complex): number; + arg(x: MathArray): MathArray; + arg(x: Matrix): Matrix; + + /** + * Compute the complex conjugate of a complex value. If x = a+bi, the complex conjugate of x is a - bi. For matrices, the function is evaluated element wise. + * @param x A complex number or array with complex numbers + */ + conj(x: number|BigNumber|Complex|MathArray|Matrix): number|BigNumber|Complex|MathArray|Matrix; + + /** + * Get the imaginary part of a complex number. For a complex number a + bi, the function returns b. + * For matrices, the function is evaluated element wise. + */ + im(x: number|BigNumber|Complex|MathArray|Matrix): number|BigNumber|MathArray|Matrix; + + /** + * Get the real part of a complex number. For a complex number a + bi, the function returns a. + * For matrices, the function is evaluated element wise. + */ + re(x: number|BigNumber|Complex|MathArray|Matrix): number|BigNumber|MathArray|Matrix; + + /** + * Create a BigNumber, which can store numbers with arbitrary precision. When a matrix is provided, all elements will be converted to BigNumber. + */ + bignumber(x?: number|string|MathArray|Matrix|boolean): BigNumber; + + /** + * Create a boolean or convert a string or number to a boolean. In case of a number, true is returned for non-zero numbers, and false in case of zero. Strings can be 'true' or 'false', or can contain a number. When value is a matrix, all elements will be converted to boolean. + */ + boolean(x: string|number|boolean|MathArray|Matrix ): boolean|MathArray|Matrix; + + /** + * Wrap any value in a chain, allowing to perform chained operations on the value. + * All methods available in the math.js library can be called upon the chain, and then will be evaluated with the value itself as first argument. The chain can be closed by executing chain.done(), which returns the final value. + * The chain has a number of special functions: + * done() Finalize the chain and return the chain's value. + * valueOf() The same as done() + * toString() Executes math.format() onto the chain's value, returning a string representation of the value. + */ + chain(value?: any): IMathJsChain; + + /** + * Create a complex value or convert a value to a complex value. + */ + complex(): Complex; + complex(re: number, im: number): Complex; + complex(complex: Complex): Complex; + complex(arg: string): Complex; + complex(array: MathArray): Complex; + complex(obj: IPolarCoordinates): Complex; + + /** + * Create a fraction convert a value to a fraction. + */ + fraction(numerator: number|string|MathArray|Matrix, denominator?: number|string|MathArray|Matrix): Fraction|MathArray|Matrix; + + /** + * Create an index. An Index can store ranges having start, step, and end for multiple dimensions. Matrix.get, Matrix.set, and math.subset accept an Index as input. + */ + index(...ranges: any[]): Index; + + /** + * Create a Matrix. The function creates a new math.type.Matrix object from an Array. A Matrix has utility functions + * to manipulate the data in the matrix, like getting the size and getting or setting values in the matrix. Supported + * storage formats are 'dense' and 'sparse'. + */ + matrix(format?: string): Matrix; + matrix(data: MathArray|Matrix, format?: string, dataType?:string): Matrix; + + /** + * Create a number or convert a string, boolean, or unit to a number. When value is a matrix, all elements will be converted to number. + */ + number(value?: string|number|boolean|MathArray|Matrix|Unit): number|MathArray|Matrix; + number(unit: Unit, valuelessUnit: Unit|string): number|MathArray|Matrix; + + /** + * Create a Sparse Matrix. The function creates a new math.type.Matrix object from an Array. A Matrix has utility + * functions to manipulate the data in the matrix, like getting the size and getting or setting values in the matrix. + * @param data A two dimensional array + */ + sparse(data?: MathArray|Matrix, dataType?:string): Matrix; + + /** + * Create a string or convert any object into a string. Elements of Arrays and Matrices are processed element wise. + * @param value A value to convert to a string + */ + string(value: any): string|MathArray|Matrix; + + /** + * Create a unit. Depending on the passed arguments, the function will create and return a new math.type.Unit object. + * When a matrix is provided, all elements will be converted to units. + */ + unit(unit: string): Unit; + unit(value: number, unit: string): Unit; + + /** + * Parse and compile an expression. Returns a an object with a function eval([scope]) to evaluate the compiled expression. + */ + compile(expr: MathExpression): EvalFunction; + compile(exprs: MathExpression[]): EvalFunction[]; + + /** + * Evaluate an expression. + */ + eval(expr: MathExpression, scope?: any): any; + eval(exprs: MathExpression[], scope?: any): any; + + /** + * Retrieve help on a function or data type. Help files are retrieved from the documentation in math.expression.docs. + */ + help(search: any): Help; + + /** + * Parse an expression. Returns a node tree, which can be evaluated by invoking node.eval(); + */ + parse(expr: MathExpression, options?: any): MathNode; + parse(exprs: MathExpression[], options?: any): MathNode[]; + + /** + * Create a parser. The function creates a new math.expression.Parser object. + */ + parser(): Parser; + + /** + * Calculates: The eucledian distance between two points in 2 and 3 dimensional spaces. Distance between point + * and a line in 2 and 3 dimensional spaces. Pairwise distance between a set of 2D or 3D points NOTE: When + * substituting coefficients of a line(a, b and c), use ax + by + c = 0 instead of ax + by = c For parametric + * equation of a 3D line, x0, y0, z0, a, b, c are from: (x−x0, y−y0, z−z0) = t(a, b, c) + */ + distance(x: MathArray|Matrix|any, y: MathArray|Matrix|any): Number | BigNumber; + + /** + * Calculates the point of intersection of two lines in two or three dimensions and of a line and a plane in + * three dimensions. The inputs are in the form of arrays or 1 dimensional matrices. The line intersection functions + * return null if the lines do not meet. + * Note: Fill the plane coefficients as x + y + z = c and not as x + y + z + c = 0. + * @param w Co-ordinates of first end-point of first line + * @param x Co-ordinates of second end-point of first line + * @param y Co-ordinates of first end-point of second line OR Co-efficients of the plane's equation + * @param z Co-ordinates of second end-point of second line OR null if the calculation is for line and plane + * @returns Returns the point of intersection of lines/lines-planes + */ + intersect(w: MathArray|Matrix, x: MathArray|Matrix, y: MathArray|Matrix, z: MathArray|Matrix): MathArray; + + /** + * Logical and. Test whether two values are both defined with a nonzero/nonempty value. For matrices, the function is evaluated element wise. + */ + and(x: number|BigNumber|Complex|Unit|MathArray|Matrix, y: number|BigNumber|Complex|Unit|MathArray|Matrix): boolean|MathArray|Matrix; + + /** + * Logical not. Flips boolean value of a given parameter. For matrices, the function is evaluated element wise. + */ + not(x: number|BigNumber|Complex|Unit|MathArray|Matrix): boolean|MathArray|Matrix; + + /** + * Logical or. Test if at least one value is defined with a nonzero/nonempty value. For matrices, the function is evaluated element wise. + */ + or(x: number|BigNumber|Complex|Unit|MathArray|Matrix, y: number|BigNumber|Complex|Unit|MathArray|Matrix): boolean|MathArray|Matrix; + + /** + * Logical xor. Test whether one and only one value is defined with a nonzero/nonempty value. For matrices, the function is evaluated element wise. + */ + xor(x: number|BigNumber|Complex|Unit|MathArray|Matrix, y: number|BigNumber|Complex|Unit|MathArray|Matrix): boolean|MathArray|Matrix; + + /** + * Concatenate two or more matrices. + * dim: number is a zero-based dimension over which to concatenate the matrices. By default the last dimension of the matrices. + */ + concat(...args: (MathArray|Matrix|number)[]): MathArray|Matrix; + + /** + * Calculate the cross product for two vectors in three dimensional space. The cross product of A = [a1, a2, a3] + * and B =[b1, b2, b3] is defined as: + * cross(A, B) = [ a2 * b3 - a3 * b2, a3 * b1 - a1 * b3, a1 * b2 - a2 * b1 ] + */ + cross(x: MathArray|Matrix, y: MathArray|Matrix): Matrix; + + /** + * Calculate the determinant of a matrix. + */ + det(x: MathArray|Matrix): number; + + /** + * Create a diagonal matrix or retrieve the diagonal of a matrix. + * When x is a vector, a matrix with vector x on the diagonal will be returned. When x is a two dimensional matrix, + * the matrixes kth diagonal will be returned + * as vector. When k is positive, the values are placed on the super diagonal. When k is negative, the values are + * placed on the sub diagonal. + * @param X A two dimensional matrix or a vector + * @param k The diagonal where the vector will be filled in or retrieved. Default value: 0. + * @param format The matrix storage format. Default value: 'dense'. + */ + diag(X: MathArray|Matrix, format?: string): Matrix; + diag(X: MathArray|Matrix, k: number|BigNumber, format?: string): Matrix; + + /** + * Calculate the dot product of two vectors. The dot product of A = [a1, a2, a3, ..., an] and B = [b1, b2, b3, ..., bn] + * is defined as: + * dot(A, B) = a1 * b1 + a2 * b2 + a3 * b3 + ... + an * bn + */ + dot(x: MathArray|Matrix, y: MathArray|Matrix): number; + + /** + * Create a 2-dimensional identity matrix with size m x n or n x n. The matrix has ones on the diagonal and zeros elsewhere. + */ + eye(n: number, format?: string): Matrix; + eye(m: number, n: number, format?: string): Matrix; + eye(size: number[], format?: string): Matrix; + + /** + * Flatten a multi dimensional matrix into a single dimensional matrix. + */ + flatten(x: MathArray|Matrix): MathArray|Matrix; + + /** + * Calculate the inverse of a square matrix. + */ + inv(x: number|Complex|MathArray|Matrix): number|Complex|MathArray|Matrix; + + /** + * Create a matrix filled with ones. The created matrix can have one or multiple dimensions. + */ + ones(n: number, format?: string): MathArray|Matrix; + ones(m: number, n: number, format?: string): MathArray|Matrix; + ones(size: number[], format?: string): MathArray|Matrix; + + /** + * Create an array from a range. By default, the range end is excluded. This can be customized by providing an extra parameter includeEnd. + * @param str A string 'start:end' or 'start:step:end' + * @param start Start of the range + * @param end End of the range, excluded by default, included when parameter includeEnd=true + * @param step Step size. Default value is 1. + * @returns Parameters describing the ranges start, end, and optional step. + */ + range(str: string, includeEnd?: boolean): Matrix; + range(start: number|BigNumber, end:number|BigNumber, includeEnd?:boolean): Matrix; + range(start: number|BigNumber, end: number|BigNumber, step: number|BigNumber, includeEnd?:boolean): Matrix; + + /** + * Resize a matrix + * @param x Matrix to be resized + * @param size One dimensional array with numbers + * @param defaultValue Zero by default, except in case of a string, in that case defaultValue = ' ' Default value: 0. + */ + resize(x: MathArray|Matrix, size: MathArray|Matrix, defaultValue?: number|string): MathArray|Matrix; + + /** + * Calculate the size of a matrix or scalar. + */ + size(x: boolean|number|Complex|Unit|string|MathArray|Matrix): MathArray|Matrix; + + /** + * Squeeze a matrix, remove inner and outer singleton dimensions from a matrix. + */ + squeeze(x: MathArray|Matrix): Matrix|MathArray; + + /** + * Get or set a subset of a matrix or string. + * @param value An array, matrix, or string + * @param index An index containing ranges for each dimension + * @param replacement An array, matrix, or scalar. If provided, the subset is replaced with replacement. If not provided, the subset is returned + * @param defaultValue Default value, filled in on new entries when the matrix is resized. If not provided, math.matrix elements will be left undefined. Default value: undefined. + */ + subset(value: MathArray|Matrix|string, index: Index, replacement?: any, defaultValue?: any): MathArray|Matrix|string; + + /** + * Calculate the trace of a matrix: the sum of the elements on the main diagonal of a square matrix. + */ + trace(x: MathArray|Matrix): number; + + /** + * Transpose a matrix. All values of the matrix are reflected over its main diagonal. Only two dimensional matrices are supported. + */ + transpose(x: MathArray|Matrix): MathArray|Matrix; + + /** + * Create a matrix filled with zeros. The created matrix can have one or multiple dimensions. + */ + zeros(n: number, format?: string): MathArray|Matrix; + zeros(m: number, n: number, format?: string): MathArray|Matrix; + zeros(size: number[], format?: string): MathArray|Matrix; + + /** + * Compute the number of ways of picking k unordered outcomes from n possibilities. + * Combinations only takes integer arguments. The following condition must be enforced: k <= n. + */ + combinations(n: number|BigNumber, k: number|BigNumber): number|BigNumber; + + /** + * Create a distribution object with a set of random functions for given random distribution. + * @param name Name of a distribution. Choose from 'uniform', 'normal'. + */ + distribution(name: string): Distribution; + + /** + * Compute the factorial of a value + * Factorial only supports an integer value as argument. For matrices, the function is evaluated element wise. + */ + factorial(n: number|BigNumber|MathArray|Matrix): number|BigNumber|MathArray|Matrix; + + /** + * Compute the gamma function of a value using Lanczos approximation for small values, and an extended + * Stirling approximation for large values. + * For matrices, the function is evaluated element wise. + */ + gamma(n: number|MathArray|Matrix): number|MathArray|Matrix; + + /** + * Calculate the Kullback-Leibler (KL) divergence between two distributions + */ + kldivergence(x: MathArray|Matrix, y: MathArray|Matrix): number; + + /** + * Multinomial Coefficients compute the number of ways of picking a1, a2, ..., ai unordered outcomes from n possibilities. + * multinomial takes one array of integers as an argument. The following condition must be enforced: every ai <= 0 + */ + multinomial(a: number[]|BigNumber[]): number|BigNumber; + + /** + * Compute the number of ways of obtaining an ordered subset of k elements from a set of n elements. + * Permutations only takes integer arguments. The following condition must be enforced: k <= n. + * @param n The number of objects in total + * @param k The number of objects in the subset + */ + permutations(n: number|BigNumber, k?:number|BigNumber): number|BigNumber; + + /** + * Random pick a value from a one dimensional array. Array element is picked using a random function with uniform distribution. + */ + pickRandom(array: number[]): number; + + /** + * Return a random number larger or equal to min and smaller than max using a uniform distribution. + */ + random(): number; + random(max: number): number; + random(min: number, max: number): number; + random(size: MathArray|Matrix, max?: number): MathArray|Matrix; + random(size: MathArray|Matrix, min:number, max: number): MathArray|Matrix; + + /** + * Return a random integer number larger or equal to min and smaller than max using a uniform distribution. + */ + randomInt(max: number): number; + randomInt(min: number, max: number): number; + randomInt(size: MathArray|Matrix, max?: number): MathArray|Matrix; + randomInt(size: MathArray|Matrix, min:number, max: number): MathArray|Matrix; + + /** + * Compare two values. Returns 1 when x > y, -1 when x < y, and 0 when x == y. + * x and y are considered equal when the relative difference between x and y is smaller than the configured epsilon. + * The function cannot be used to compare values smaller than approximately 2.22e-16. + * For matrices, the function is evaluated element wise. + */ + compare(x: MathType, y: MathType): number|BigNumber|Fraction|MathArray|Matrix; + + /** + * Test element wise whether two matrices are equal. The function accepts both matrices and scalar values. + */ + deepEqual(x: MathType, y: MathType): number|BigNumber|Fraction|Complex|Unit|MathArray|Matrix; + + /** + * Test whether two values are equal. + * + * The function tests whether the relative difference between x and y is smaller than the configured epsilon. + * The function cannot be used to compare values smaller than approximately 2.22e-16. + * + * For matrices, the function is evaluated element wise. In case of complex numbers, x.re must equal y.re, and x.im must equal y.im. + * + * Values null and undefined are compared strictly, thus null is only equal to null and nothing else, and undefined is only equal to undefined and nothing else. + */ + equal(x: MathType, y: MathType): boolean|MathArray|Matrix; + + /** + * Test whether value x is larger than y. + * + * The function returns true when x is larger than y and the relative difference between x and y is larger than the configured epsilon. + * The function cannot be used to compare values smaller than approximately 2.22e-16. + * + * For matrices, the function is evaluated element wise. + */ + larger(x: MathType, y: MathType): boolean|MathArray|Matrix; + + /** + * Test whether value x is larger or equal to y. + * + * The function returns true when x is larger than y or the relative difference between x and y is smaller than the configured epsilon. + * The function cannot be used to compare values smaller than approximately 2.22e-16. + * + * For matrices, the function is evaluated element wise. + */ + largerEq(x: MathType, y: MathType): boolean|MathArray|Matrix; + + /** + * Test whether value x is smaller than y. + * + * The function returns true when x is smaller than y and the relative difference between x and y is smaller than the configured epsilon. + * The function cannot be used to compare values smaller than approximately 2.22e-16. + * + * For matrices, the function is evaluated element wise. + */ + smaller(x: MathType, y: MathType): boolean|MathArray|Matrix; + + /** + * Test whether value x is smaller or equal to y. + * + * The function returns true when x is smaller than y or the relative difference between x and y is smaller than the configured epsilon. + * The function cannot be used to compare values smaller than approximately 2.22e-16. For matrices, the function is evaluated element wise. + */ + smallerEq(x: MathType, y: MathType): boolean|MathArray|Matrix; + + /** + * Test whether two values are unequal. + * + * The function tests whether the relative difference between x and y is larger than the configured epsilon. The function cannot + * be used to compare values smaller than approximately 2.22e-16. + * + * For matrices, the function is evaluated element wise. In case of complex numbers, x.re must unequal y.re, or x.im must unequal y.im. + * + * Values null and undefined are compared strictly, thus null is unequal with everything except null, and undefined is unequal with + * everying except. undefined. + */ + unequal(x: MathType, y: MathType): boolean|MathArray|Matrix; + + /** + * Compute the maximum value of a matrix or a list with values. In case of a multi dimensional array, the maximum of the flattened + * array will be calculated. When dim is provided, the maximum over the selected dimension will be calculated. Parameter dim is zero-based. + */ + max(...args: MathType[]): any; + max(A: MathArray|Matrix, dim?: number): any; + + /** + * Compute the mean value of matrix or a list with values. In case of a multi dimensional array, the mean of the flattened array will be + * calculated. When dim is provided, the maximum over the selected dimension will be calculated. Parameter dim is zero-based. + */ + mean(...args: MathType[]): any; + mean(A: MathArray|Matrix, dim?: number): any; + + /** + * Compute the median of a matrix or a list with values. The values are sorted and the middle value is returned. In case of an + * even number of values, the average of the two middle values is returned. Supported types of values are: Number, BigNumber, Unit + * + * In case of a (multi dimensional) array or matrix, the median of all elements will be calculated. + */ + median(...args: MathType[]): any; + + /** + * Compute the maximum value of a matrix or a list of values. In case of a multi dimensional array, the maximum of the flattened + * array will be calculated. When dim is provided, the maximum over the selected dimension will be calculated. Parameter dim is zero-based. + */ + min(...args: MathType[]): any; + min(A: MathArray|Matrix, dim?: number): any; + + /** + * Computes the mode of a set of numbers or a list with values(numbers or characters). If there are more than one modes, it returns a list of those values. + */ + mode(...args: MathType[]): any; + + /** + * Compute the product of a matrix or a list with values. In case of a (multi dimensional) array or matrix, the sum of all elements will be calculated. + */ + prod(...args: MathType[]): any; + + /** + * Compute the prob order quantile of a matrix or a list with values. The sequence is sorted and the middle value is returned. + * Supported types of sequence values are: Number, BigNumber, Unit Supported types of probability are: Number, BigNumber + * + * In case of a (multi dimensional) array or matrix, the prob order quantile of all elements will be calculated. + */ + quantileSeq(A: MathArray|Matrix, prob: Number|BigNumber|MathArray, sorted?: boolean): Number|BigNumber|Unit|MathArray; + + /** + * Compute the standard deviation of a matrix or a list with values. The standard deviations is defined as the square root of the + * variance: std(A) = sqrt(var(A)). In case of a (multi dimensional) array or matrix, the standard deviation over all elements will + * be calculated. + * + * Optionally, the type of normalization can be specified as second parameter. The parameter normalization can be one of the following + * values: + * + * 'unbiased' (default) The sum of squared errors is divided by (n - 1) + * 'uncorrected' The sum of squared errors is divided by n + * 'biased' The sum of squared errors is divided by (n + 1) + */ + std(array: MathArray|Matrix, normalization?: string): number; + + /** + * Compute the sum of a matrix or a list with values. In case of a (multi dimensional) array or matrix, the sum of all elements will be calculated. + */ + sum(...args: (Number|BigNumber|Fraction)[]): any; + sum(array: MathArray|Matrix): any; + + /** + * Compute the variance of a matrix or a list with values. In case of a (multi dimensional) array or matrix, the variance over all + * elements will be calculated. + * + * Optionally, the type of normalization can be specified as second parameter. The parameter normalization can be one of the + * following values: + * + * 'unbiased' (default) The sum of squared errors is divided by (n - 1) + * 'uncorrected' The sum of squared errors is divided by n + * 'biased' The sum of squared errors is divided by (n + 1) + * Note that older browser may not like the variable name var. In that case, the function can be called as math['var'](...) + * instead of math.var(...). + */ + var(...args: (Number|BigNumber|Fraction)[]): any; + var(array: MathArray|Matrix, normalization?: string): any; + + /** + * Calculate the inverse cosine of a value. For matrices, the function is evaluated element wise. + */ + acos(x: number): number; + acos(x: BigNumber): BigNumber; + acos(x: Complex): Complex; + acos(x: MathArray): MathArray; + acos(x: Matrix): Matrix; + + /** + * Calculate the hyperbolic arccos of a value, defined as acosh(x) = ln(sqrt(x^2 - 1) + x). + * For matrices, the function is evaluated element wise. + */ + acosh(x: number): number; + acosh(x: BigNumber): BigNumber; + acosh(x: Complex): Complex; + acosh(x: MathArray): MathArray; + acosh(x: Matrix): Matrix; + + /** + * Calculate the inverse cotangent of a value. For matrices, the function is evaluated element wise. + */ + acot(x: number): number; + acot(x: BigNumber): BigNumber; + acot(x: MathArray): MathArray; + acot(x: Matrix): Matrix; + + /** + * Calculate the hyperbolic arccotangent of a value, defined as acoth(x) = (ln((x+1)/x) + ln(x/(x-1))) / 2. + * For matrices, the function is evaluated element wise. + */ + acoth(x: number): number; + acoth(x: BigNumber): BigNumber; + acoth(x: MathArray): MathArray; + acoth(x: Matrix): Matrix; + + /** + * Calculate the inverse cosecant of a value. For matrices, the function is evaluated element wise. + */ + acsc(x: number): number; + acsc(x: BigNumber): BigNumber; + acsc(x: MathArray): MathArray; + acsc(x: Matrix): Matrix; + + /** + * Calculate the hyperbolic arccosecant of a value, defined as acsch(x) = ln(1/x + sqrt(1/x^2 + 1)). + * For matrices, the function is evaluated element wise. + */ + acsch(x: number): number; + acsch(x: BigNumber): BigNumber; + acsch(x: MathArray): MathArray; + acsch(x: Matrix): Matrix; + + /** + * Calculate the inverse secant of a value. For matrices, the function is evaluated element wise. + */ + asec(x: number): number; + asec(x: BigNumber): BigNumber; + asec(x: MathArray): MathArray; + asec(x: Matrix): Matrix; + + /** + * Calculate the hyperbolic arcsecant of a value, defined as asech(x) = ln(sqrt(1/x^2 - 1) + 1/x). For matrices, the function is evaluated element wise. + */ + asech(x: number): number; + asech(x: BigNumber): BigNumber; + asech(x: MathArray): MathArray; + asech(x: Matrix): Matrix; + + /** + * Calculate the inverse sine of a value. For matrices, the function is evaluated element wise. + */ + asin(x: number): number; + asin(x: BigNumber): BigNumber; + asin(x: Complex): Complex; + asin(x: MathArray): MathArray; + asin(x: Matrix): Matrix; + + /** + * Calculate the hyperbolic arcsine of a value, defined as asinh(x) = ln(x + sqrt(x^2 + 1)). For matrices, the function is evaluated element wise. + */ + asinh(x: number): number; + asinh(x: BigNumber): BigNumber; + asinh(x: MathArray): MathArray; + asinh(x: Matrix): Matrix; + + /** + * Calculate the inverse tangent of a value. For matrices, the function is evaluated element wise. + */ + atan(x: number): number; + atan(x: BigNumber): BigNumber; + atan(x: MathArray): MathArray; + atan(x: Matrix): Matrix; + + /** + * Calculate the inverse tangent function with two arguments, y/x. By providing two arguments, the right quadrant of the + * computed angle can be determined. + * + * For matrices, the function is evaluated element wise. + */ + atan2(y: number, x: number): number; + atan2(y: MathArray|Matrix, x: MathArray|Matrix): MathArray|Matrix; + + /** + * Calculate the hyperbolic arctangent of a value, defined as atanh(x) = ln((1 + x)/(1 - x)) / 2. + * For matrices, the function is evaluated element wise. + */ + atanh(x: number): number; + atanh(x: BigNumber): BigNumber; + atanh(x: MathArray): MathArray; + atanh(x: Matrix): Matrix; + + /** + * Calculate the cosine of a value. For matrices, the function is evaluated element wise. + */ + asin(x: number): number; + asin(x: BigNumber): BigNumber; + asin(x: Complex): Complex; + asin(x: Unit): number; + asin(x: MathArray): MathArray; + asin(x: Matrix): Matrix; + + /** + * Calculate the hyperbolic cosine of a value, defined as cosh(x) = 1/2 * (exp(x) + exp(-x)). For matrices, the function is evaluated element wise. + */ + cosh(x: number): number; + cosh(x: BigNumber): BigNumber; + cosh(x: Complex): Complex; + cosh(x: Unit): number; + cosh(x: MathArray): MathArray; + cosh(x: Matrix): Matrix; + + /** + * Calculate the cotangent of a value. cot(x) is defined as 1 / tan(x). For matrices, the function is evaluated element wise. + */ + cot(x: number): number; + cot(x: Complex): Complex; + cot(x: Unit): number; + cot(x: MathArray): MathArray; + cot(x: Matrix): Matrix; + + /** + * Calculate the hyperbolic cotangent of a value, defined as coth(x) = 1 / tanh(x). For matrices, the function is evaluated element wise. + */ + coth(x: number): number; + coth(x: Complex): Complex; + coth(x: Unit): number; + coth(x: MathArray): MathArray; + coth(x: Matrix): Matrix; + + /** + * Calculate the cosecant of a value, defined as csc(x) = 1/sin(x). For matrices, the function is evaluated element wise. + */ + csc(x: number): number; + csc(x: Complex): Complex; + csc(x: Unit): number; + csc(x: MathArray): MathArray; + csc(x: Matrix): Matrix; + + /** + * Calculate the hyperbolic cosecant of a value, defined as csch(x) = 1 / sinh(x). For matrices, the function is evaluated element wise. + */ + csch(x: number): number; + csch(x: Complex): Complex; + csch(x: Unit): number; + csch(x: MathArray): MathArray; + csch(x: Matrix): Matrix; + + /** + * Calculate the secant of a value, defined as sec(x) = 1/cos(x). For matrices, the function is evaluated element wise. + */ + sec(x: number): number; + sec(x: Complex): Complex; + sec(x: Unit): number; + sec(x: MathArray): MathArray; + sec(x: Matrix): Matrix; + + /** + * Calculate the hyperbolic secant of a value, defined as sech(x) = 1 / cosh(x). For matrices, the function is evaluated element wise. + */ + sech(x: number): number; + sech(x: Complex): Complex; + sech(x: Unit): number; + sech(x: MathArray): MathArray; + sech(x: Matrix): Matrix; + + /** + * Calculate the sine of a value. For matrices, the function is evaluated element wise. + */ + sin(x: number): number; + sin(x: BigNumber): BigNumber; + sin(x: Complex): Complex; + sin(x: Unit): number; + sin(x: MathArray): MathArray; + sin(x: Matrix): Matrix; + + /** + * Calculate the hyperbolic sine of a value, defined as sinh(x) = 1/2 * (exp(x) - exp(-x)). For matrices, the function is evaluated element wise. + */ + sinh(x: number): number; + sinh(x: BigNumber): BigNumber; + sinh(x: Complex): Complex; + sinh(x: Unit): number; + sinh(x: MathArray): MathArray; + sinh(x: Matrix): Matrix; + + /** + * Calculate the tangent of a value. tan(x) is equal to sin(x) / cos(x). For matrices, the function is evaluated element wise. + */ + tan(x: number): number; + tan(x: BigNumber): BigNumber; + tan(x: Complex): Complex; + tan(x: Unit): number; + tan(x: MathArray): MathArray; + tan(x: Matrix): Matrix; + + /** + * Calculate the hyperbolic tangent of a value, defined as tanh(x) = (exp(2 * x) - 1) / (exp(2 * x) + 1). For matrices, the function is evaluated element wise. + */ + tanh(x: number): number; + tanh(x: BigNumber): BigNumber; + tanh(x: Complex): Complex; + tanh(x: Unit): number; + tanh(x: MathArray): MathArray; + tanh(x: Matrix): Matrix; + + /** + * Change the unit of a value. For matrices, the function is evaluated element wise. + * @param x The unit to be converted. + * @param unit New unit. Can be a string like "cm" or a unit without value. + */ + to(x: Unit|MathArray|Matrix, unit: Unit|string): Unit|MathArray|Matrix + + /** + * Clone an object. + */ + clone(x: any): any; + + /** + * Filter the items in an array or one dimensional matrix. + * @param x A one dimensional matrix or array to filter + * @param test + */ + filter(x: MathArray|Matrix, test: RegExp|((item: any)=>boolean)): MathArray|Matrix; + + /** + * Iterate over all elements of a matrix/array, and executes the given callback function. + * @param x The matrix to iterate on. + * @param callback The callback function is invoked with three parameters: the value of the element, the index of the element, and the Matrix/array being traversed. + */ + forEach(x: MathArray|Matrix, callback: (item: any)=>any): void; + + /** + * Format a value of any type into a string. + * @param value The value to be formatted + */ + format(value: any, options?: IFormatOptions|number|((item: any)=>string)): string; + + /** + * Test whether a value is an integer number. The function supports number, BigNumber, and Fraction. + * The function is evaluated element-wise in case of Array or Matrix input. + */ + isInteger(x: any): boolean; + + /** + * Test whether a value is negative: smaller than zero. The function supports types number, BigNumber, Fraction, and Unit. + * The function is evaluated element-wise in case of Array or Matrix input. + */ + isNegative(x: any): boolean; + + /** + * Test whether a value is an numeric value. The function is evaluated element-wise in case of Array or Matrix input. + */ + isNumeric(x: any): boolean; + + /** + * Test whether a value is positive: larger than zero. The function supports types number, BigNumber, Fraction, and Unit. + * The function is evaluated element-wise in case of Array or Matrix input. + */ + isPositive(x: any): boolean; + + /** + * Test whether a value is zero. The function can check for zero for types number, BigNumber, Fraction, Complex, and Unit. + * The function is evaluated element-wise in case of Array or Matrix input. + */ + isZero(x: any): boolean; + + /** + * Create a new matrix or array with the results of the callback function executed on each entry of the matrix/array. + * @param x The matrix to iterate on. + * @param callback The callback method is invoked with three parameters: the value of the element, the index of the element, and the matrix being traversed. + */ + map(x: MathArray|Matrix, callback: (item: any)=>any): MathArray|Matrix; + + /** + * Partition-based selection of an array or 1D matrix. Will find the kth smallest value, and mutates the input array. Uses Quickselect. + * @param x A one dimensional matrix or array to sort + * @param k The kth smallest value to be retrieved; zero-based index + * @param compare An optional comparator function. The function is called as compare(a, b), and must return 1 when a > b, -1 when a < b, and 0 when a == b. Default value: 'asc'. + * @returns Returns the kth lowest value. + */ + partitionSelect(x: MathArray|Matrix, k: number, compare?: string|((a: any, b: any)=>number)): any; + + /** + * Interpolate values into a string template. + * @param template A string containing variable placeholders. + * @param values An object containing variables which will be filled in in the template. + * @param precision Number of digits to format numbers. If not provided, the value will not be rounded. + */ + print(template:string, values: any, precision?: number): void; + + /** + * Sort the items in a matrix. + * @param x A one dimensional matrix or array to sort + * @param compare An optional comparator function. The function is called as compare(a, b), and must return 1 when a > b, -1 when a < b, and 0 when a == b. Default value: 'asc'. + */ + sort(x: MathArray|Matrix, compare?: string|((a: any, b: any)=>number)): MathArray|Matrix; + + /** + * Determine the type of a variable. + */ + typeof(x: any): string; + } + + export interface Matrix { + size(): number[]; + subset(index: Index, replacement?: any, defaultValue?: any): Matrix; + resize(size: MathArray|Matrix, defaultValue?: number|string): Matrix; + clone(): Matrix; + } + + export interface BigNumber { + + } + + export interface Fraction { + + } + + export interface Complex { + re: number; + im: number; + toPolar(): IPolarCoordinates; + clone(): Complex; + } + + export interface IPolarCoordinates { + r: number; + phi: number; + } + + export interface Unit { + to(unit: string): Unit; + toNumber(unit: string): number; + } + + export interface Index { + + } + + export interface EvalFunction { + eval(scope?: any): any; + } + + export interface MathNode { + compile(): EvalFunction; + eval(): any; + } + + export interface Parser { + eval(expr: string): any; + get(variable: string): any; + set(variable: string, value: any): void; + clear(): void; + } + + export interface Distribution { + random(size: any, min?: any, max?: any): any; + randomInt(min: any, max?: any): any; + pickRandom(array: any): any; + } + + export interface IFormatOptions { + /** + * Number notation. Choose from: + * 'fixed' Always use regular number notation. For example '123.40' and '14000000' + * 'exponential' Always use exponential notation. For example '1.234e+2' and '1.4e+7' + * 'auto' (default) Regular number notation for numbers having an absolute value between lower and upper bounds, and + * uses exponential notation elsewhere. Lower bound is included, upper bound is excluded. For example '123.4' and '1.4e7'. + */ + notation?: string; + + /** + * A number between 0 and 16 to round the digits of the number. In case of notations 'exponential' and 'auto', + * precision defines the total number of significant digits returned and is undefined by default. In case of notation 'fixed', + * precision defines the number of significant digits after the decimal point, and is 0 by default. + */ + precision?: number; + + /** + * An object containing two parameters, {number} lower and {number} upper, used by notation 'auto' to determine + * when to return exponential notation. Default values are lower=1e-3 and upper=1e5. Only applicable for notation auto. + */ + exponential?: {lower: number; upper: number}; + + /** + * Available values: 'ratio' (default) or 'decimal'. For example format(fraction(1, 3)) will output '1/3' when 'ratio' + * is configured, and will output 0.(3) when 'decimal' is configured. + */ + fraction?: string; + + /** + * A custom formatting function. Can be used to override the built-in notations. Function fn is called with + * value as parameter and must return a string. Is useful for example to format all values inside a matrix in a particular way. + * */ + fn?: (item: any)=>string; + } + + export interface Help { + toString(): string; + toJSON(): string; + } + + export interface IMathJsChain { + /** + * Solves the linear equation system by forwards substitution. Matrix must be a lower triangular matrix. + * @param b A column vector with the b values + */ + lsolve(b: Matrix|MathArray): IMathJsChain; + + /** + * Calculate the Matrix LU decomposition with partial pivoting. Matrix A is decomposed in two matrices (L, U) + * and a row permutation vector p where A[p,:] = L * U + */ + lup(): IMathJsChain; + + /** + * Solves the linear system A * x = b where A is an [n x n] matrix and b is a [n] column vector. + * @param b Column Vector + */ + lusolve(b: Matrix|MathArray): IMathJsChain; + + /** + * Calculate the Sparse Matrix LU decomposition with full pivoting. Sparse Matrix A is decomposed in + * two matrices (L, U) and two permutation vectors (pinv, q) where P * A * Q = L * U + * @param order The Symbolic Ordering and Analysis order: 0 - Natural ordering, no permutation vector q is + * returned 1 - Matrix must be square, symbolic ordering and analisis is performed on M = A + A' 2 - Symbolic + * ordering and analisis is performed on M = A' * A. Dense columns from A' are dropped, A recreated from A'. + * This is appropriatefor LU factorization of unsymmetric matrices. 3 - Symbolic ordering and analisis is performed + * on M = A' * A. This is best used for LU factorization is matrix M has no dense rows. A dense row is a row with + * more than 10*sqr(columns) entries. + * @param threshold Partial pivoting threshold (1 for partial pivoting) + * @returns The lower triangular matrix, the upper triangular matrix and the permutation vectors. + */ + slu(order: Number, threshold: Number): IMathJsChain; + + /** + * Solves the linear equation system by backward substitution. Matrix must be an upper triangular matrix. U * x = b + * @param b A column vector with the b values + * @returns A column vector with the linear system solution (x) + */ + usolve(b:Matrix|MathArray): IMathJsChain; + + /** + * Calculate the absolute value of a number. For matrices, the function is evaluated element wise. + */ + abs(): IMathJsChain; + + /** + * Add two values, x + y. For matrices, the function is evaluated element wise. + * @param y Second value to add + */ + add(y: MathType): IMathJsChain; + + /** + * Calculate the cubic root of a value. For matrices, the function is evaluated element wise. + * @param allRoots Optional, false by default. Only applicable when x is a number or complex number. If true, all complex roots are returned, if false (default) the principal root is returned. + */ + cbrt(allRoots?: boolean): IMathJsChain; + + /** + * Round a value towards plus infinity If x is complex, both real and imaginary part are rounded towards plus infinity. For matrices, the function is evaluated element wise. + */ + ceil(): IMathJsChain; + + /** + * Compute the cube of a value, x * x * x. For matrices, the function is evaluated element wise. + */ + cube(): IMathJsChain; + + /** + * Divide two values, x / y. To divide matrices, x is multiplied with the inverse of y: x * inv(y). + * @param y Denominator + */ + divide(y:MathType): IMathJsChain; + + /** + * Divide two matrices element wise. The function accepts both matrices and scalar values. + * @param y Denominator + */ + dotDivide(y: MathType): IMathJsChain; + + /** + * Multiply two matrices element wise. The function accepts both matrices and scalar values. + * @param y Right hand value + */ + dotMultiply(y: MathType): IMathJsChain; + + /** + * Calculates the power of x to y element wise. + * @param y The exponent + */ + dotPow(y: MathType): IMathJsChain; + + /** + * Calculate the exponent of a value. For matrices, the function is evaluated element wise. + */ + exp(): IMathJsChain; + + /** + * Round a value towards zero. For matrices, the function is evaluated element wise. + */ + fix(): IMathJsChain; + + /** + * Round a value towards minus infinity. For matrices, the function is evaluated element wise. + */ + floor(): IMathJsChain; + + /** + * Calculate the greatest common divisor for two or more values or arrays. For matrices, the function is evaluated element wise. + */ + gcd(...args: number[]): IMathJsChain; + gcd(...args: BigNumber[]): IMathJsChain ; + gcd(...args: Fraction[]): IMathJsChain ; + gcd(...args: MathArray[]): IMathJsChain ; + gcd(...args: Matrix[]): IMathJsChain; + + /** + * Calculate the hypotenusa of a list with values. The hypotenusa is defined as: + * hypot(a, b, c, ...) = sqrt(a^2 + b^2 + c^2 + ...) + * For matrix input, the hypotenusa is calculated for all values in the matrix. + */ + hypot(...args: number[]): IMathJsChain; + hypot(...args: BigNumber[]): IMathJsChain; + + /** + * Calculate the least common multiple for two or more values or arrays. lcm is defined as: + * lcm(a, b) = abs(a * b) / gcd(a, b) + * For matrices, the function is evaluated element wise. + */ + lcm(b: number): IMathJsChain; + lcm(b: BigNumber ): IMathJsChain ; + lcm(b: MathArray): IMathJsChain; + lcm(b: Matrix): IMathJsChain; + + /** + * Calculate the logarithm of a value. For matrices, the function is evaluated element wise. + * @param base Optional base for the logarithm. If not provided, the natural logarithm of x is calculated. Default value: e. + */ + log(base?: number|BigNumber|Complex): IMathJsChain; + + /** + * Calculate the 10-base of a value. This is the same as calculating log(x, 10). For matrices, the function is evaluated element wise. + */ + log10(): IMathJsChain; + + /** + * Calculates the modulus, the remainder of an integer division. For matrices, the function is evaluated element wise. + * The modulus is defined as: + * x - y * floor(x / y) + * See http://en.wikipedia.org/wiki/Modulo_operation. + * @param y Divisor + */ + mod(y: number|BigNumber|Fraction|MathArray|Matrix): IMathJsChain; + + /** + * Multiply two values, x * y. The result is squeezed. For matrices, the matrix product is calculated. + */ + multiply(y: MathType): IMathJsChain; + + /** + * Calculate the norm of a number, vector or matrix. The second parameter p is optional. If not provided, it defaults to 2. + * @param p Vector space. Supported numbers include Infinity and -Infinity. Supported strings are: 'inf', '-inf', and 'fro' (The Frobenius norm) Default value: 2. + */ + norm(p?: number|BigNumber|string): IMathJsChain; + + /** + * Calculate the nth root of a value. The principal nth root of a positive real number A, is the positive real solution of the equation + * x^root = A + * For matrices, the function is evaluated element wise. + * @param root The root. Default value: 2. + */ + nthRoot(root?: number|BigNumber): IMathJsChain; + + /** + * Calculates the power of x to y, x ^ y. Matrix exponentiation is supported for square matrices x, and positive integer exponents y. + * @param y The exponent + */ + pow(y: number|BigNumber|Complex): IMathJsChain; + + /** + * Round a value towards the nearest integer. For matrices, the function is evaluated element wise. + * @param n Number of decimals Default value: 0. + */ + round(n?: number|BigNumber|MathArray): IMathJsChain; + + /** + * Compute the sign of a value. The sign of a value x is: + * 1 when x > 1 + * -1 when x < 0 + * 0 when x == 0 + * For matrices, the function is evaluated element wise. + */ + sign(): IMathJsChain; + + /** + * Calculate the square root of a value. For matrices, the function is evaluated element wise. + */ + sqrt(): IMathJsChain; + + /** + * Compute the square of a value, x * x. For matrices, the function is evaluated element wise. + */ + square(): IMathJsChain; + + /** + * Subtract two values, x - y. For matrices, the function is evaluated element wise. + */ + subtract(y: MathType): IMathJsChain; + + /** + * Inverse the sign of a value, apply a unary minus operation. + * For matrices, the function is evaluated element wise. Boolean values and strings will be converted to a number. For complex numbers, both real and complex value are inverted. + */ + unaryMinus(): IMathJsChain; + + /** + * Unary plus operation. Boolean values and strings will be converted to a number, numeric values will be returned as is. + * For matrices, the function is evaluated element wise. + */ + unaryPlus(): IMathJsChain; + + /** + * Calculate the extended greatest common divisor for two values. See http://en.wikipedia.org/wiki/Extended_Euclidean_algorithm. + */ + xgcd(b: number|BigNumber): IMathJsChain; + + /** + * Bitwise AND two values, x & y. For matrices, the function is evaluated element wise. + */ + bitAnd(y: number|BigNumber|MathArray|Matrix): IMathJsChain; + + /** + * Bitwise NOT value, ~x. For matrices, the function is evaluated element wise. For units, the function is evaluated on the best prefix base. + */ + bitNot(): IMathJsChain; + + /** + * Bitwise OR two values, x | y. For matrices, the function is evaluated element wise. For units, the function is evaluated on the lowest print base. + */ + bitOr(): IMathJsChain; + + /** + * Bitwise XOR two values, x ^ y. For matrices, the function is evaluated element wise. + */ + bitXor(y: number|BigNumber|MathArray|Matrix): IMathJsChain; + + /** + * Bitwise left logical shift of a value x by y number of bits, x << y. For matrices, the function is evaluated element wise. For units, the function is evaluated on the best prefix base. + * @param x Value to be shifted + * @param y Amount of shifts + */ + leftShift(y: number|BigNumber): IMathJsChain; + + /** + * Bitwise right arithmetic shift of a value x by y number of bits, x >> y. For matrices, the function is evaluated element wise. For units, the function is evaluated on the best prefix base. + * @param x Value to be shifted + * @param y Amount of shifts + */ + rightArithShift(y: number|BigNumber): IMathJsChain; + + /** + * Bitwise right logical shift of value x by y number of bits, x >>> y. For matrices, the function is evaluated element wise. For units, the function is evaluated on the best prefix base. + * @param x Value to be shifted + * @param y Amount of shifts + */ + rightLogShift(y: number): IMathJsChain; + + /** + * The Bell Numbers count the number of partitions of a set. A partition is a pairwise disjoint subset of S whose union is S. bellNumbers only takes integer arguments. The following condition must be enforced: n >= 0 + * @param n Total number of objects in the set + */ + bellNumbers(): IMathJsChain; + + /** + * The Catalan Numbers enumerate combinatorial structures of many different types. catalan only takes integer arguments. The following condition must be enforced: n >= 0 + * @pararm n nth Catalan number + */ + catalan(): IMathJsChain; + + /** + * The composition counts of n into k parts. Composition only takes integer arguments. The following condition must be enforced: k <= n. + * @param n Total number of objects in the set + * @param k Number of objects in the subset + * @returns Returns the composition counts of n into k parts. + */ + composition(k: Number|BigNumber): IMathJsChain; + + /** + * The Stirling numbers of the second kind, counts the number of ways to partition a set of n labelled objects into k nonempty unlabelled subsets. stirlingS2 only takes integer arguments. The following condition must be enforced: k <= n. + * If n = k or k = 1, then s(n,k) = 1 + * @param n Total number of objects in the set + * @param k Number of objects in the subset + */ + stirlingS2(k: Number|BigNumber): IMathJsChain; + + /** + * Compute the argument of a complex value. For a complex number a + bi, the argument is computed as atan2(b, a). For matrices, the function is evaluated element wise. + * @param x A complex number or array with complex numbers + */ + arg(): IMathJsChain; + + /** + * Compute the complex conjugate of a complex value. If x = a+bi, the complex conjugate of x is a - bi. For matrices, the function is evaluated element wise. + * @param x A complex number or array with complex numbers + */ + conj(): IMathJsChain; + + /** + * Get the imaginary part of a complex number. For a complex number a + bi, the function returns b. + * For matrices, the function is evaluated element wise. + */ + im(): IMathJsChain; + + /** + * Get the real part of a complex number. For a complex number a + bi, the function returns a. + * For matrices, the function is evaluated element wise. + */ + re(): IMathJsChain; + + /** + * Calculates: The eucledian distance between two points in 2 and 3 dimensional spaces. Distance between point + * and a line in 2 and 3 dimensional spaces. Pairwise distance between a set of 2D or 3D points NOTE: When + * substituting coefficients of a line(a, b and c), use ax + by + c = 0 instead of ax + by = c For parametric + * equation of a 3D line, x0, y0, z0, a, b, c are from: (x−x0, y−y0, z−z0) = t(a, b, c) + */ + distance(y: MathArray|Matrix|any): IMathJsChain; + + /** + * Calculates the point of intersection of two lines in two or three dimensions and of a line and a plane in + * three dimensions. The inputs are in the form of arrays or 1 dimensional matrices. The line intersection functions + * return null if the lines do not meet. + * Note: Fill the plane coefficients as x + y + z = c and not as x + y + z + c = 0. + * @param w Co-ordinates of first end-point of first line + * @param x Co-ordinates of second end-point of first line + * @param y Co-ordinates of first end-point of second line OR Co-efficients of the plane's equation + * @param z Co-ordinates of second end-point of second line OR null if the calculation is for line and plane + * @returns Returns the point of intersection of lines/lines-planes + */ + intersect(x: MathArray|Matrix, y: MathArray|Matrix, z: MathArray|Matrix): IMathJsChain; + + /** + * Logical and. Test whether two values are both defined with a nonzero/nonempty value. For matrices, the function is evaluated element wise. + */ + and(y: number|BigNumber|Complex|Unit|MathArray|Matrix): IMathJsChain; + + /** + * Logical not. Flips boolean value of a given parameter. For matrices, the function is evaluated element wise. + */ + not(): IMathJsChain; + + /** + * Logical or. Test if at least one value is defined with a nonzero/nonempty value. For matrices, the function is evaluated element wise. + */ + or(y: number|BigNumber|Complex|Unit|MathArray|Matrix): IMathJsChain; + + /** + * Logical xor. Test whether one and only one value is defined with a nonzero/nonempty value. For matrices, the function is evaluated element wise. + */ + xor(y: number|BigNumber|Complex|Unit|MathArray|Matrix): IMathJsChain; + + /** + * Calculate the cross product for two vectors in three dimensional space. The cross product of A = [a1, a2, a3] + * and B =[b1, b2, b3] is defined as: + * cross(A, B) = [ a2 * b3 - a3 * b2, a3 * b1 - a1 * b3, a1 * b2 - a2 * b1 ] + */ + cross(y: MathArray|Matrix): IMathJsChain; + + /** + * Calculate the determinant of a matrix. + */ + det(): IMathJsChain; + + /** + * Resize a matrix + * @param x Matrix to be resized + * @param size One dimensional array with numbers + * @param defaultValue Zero by default, except in case of a string, in that case defaultValue = ' ' Default value: 0. + */ + resize(size: MathArray|Matrix, defaultValue?: number|string): IMathJsChain; + + /** + * Calculate the size of a matrix or scalar. + */ + size(): IMathJsChain; + + /** + * Squeeze a matrix, remove inner and outer singleton dimensions from a matrix. + */ + squeeze(): IMathJsChain; + + /** + * Get or set a subset of a matrix or string. + * @param value An array, matrix, or string + * @param index An index containing ranges for each dimension + * @param replacement An array, matrix, or scalar. If provided, the subset is replaced with replacement. If not provided, the subset is returned + * @param defaultValue Default value, filled in on new entries when the matrix is resized. If not provided, math.matrix elements will be left undefined. Default value: undefined. + */ + subset(index: Index, replacement?: any, defaultValue?: any): IMathJsChain; + + /** + * Calculate the trace of a matrix: the sum of the elements on the main diagonal of a square matrix. + */ + trace(): IMathJsChain; + + /** + * Transpose a matrix. All values of the matrix are reflected over its main diagonal. Only two dimensional matrices are supported. + */ + transpose(): IMathJsChain; + + /** + * Random pick a value from a one dimensional array. Array element is picked using a random function with uniform distribution. + */ + pickRandom(): IMathJsChain; + + /** + * Return a random number larger or equal to min and smaller than max using a uniform distribution. + */ + random(): IMathJsChain; + random(max?: number): IMathJsChain; + random(min:number, max: number): IMathJsChain; + + /** + * Return a random integer number larger or equal to min and smaller than max using a uniform distribution. + */ + randomInt(max?: number): IMathJsChain; + randomInt(min:number, max: number): IMathJsChain; + + /** + * Compare two values. Returns 1 when x > y, -1 when x < y, and 0 when x == y. + * x and y are considered equal when the relative difference between x and y is smaller than the configured epsilon. + * The function cannot be used to compare values smaller than approximately 2.22e-16. + * For matrices, the function is evaluated element wise. + */ + compare(y: MathType): IMathJsChain; + + /** + * Test element wise whether two matrices are equal. The function accepts both matrices and scalar values. + */ + deepEqual(y: MathType): IMathJsChain; + + /** + * Test whether two values are equal. + * + * The function tests whether the relative difference between x and y is smaller than the configured epsilon. + * The function cannot be used to compare values smaller than approximately 2.22e-16. + * + * For matrices, the function is evaluated element wise. In case of complex numbers, x.re must equal y.re, and x.im must equal y.im. + * + * Values null and undefined are compared strictly, thus null is only equal to null and nothing else, and undefined is only equal to undefined and nothing else. + */ + equal(y: MathType): IMathJsChain; + + /** + * Test whether value x is larger than y. + * + * The function returns true when x is larger than y and the relative difference between x and y is larger than the configured epsilon. + * The function cannot be used to compare values smaller than approximately 2.22e-16. + * + * For matrices, the function is evaluated element wise. + */ + larger(y: MathType): IMathJsChain; + + /** + * Test whether value x is larger or equal to y. + * + * The function returns true when x is larger than y or the relative difference between x and y is smaller than the configured epsilon. + * The function cannot be used to compare values smaller than approximately 2.22e-16. + * + * For matrices, the function is evaluated element wise. + */ + largerEq(y: MathType): IMathJsChain; + + /** + * Test whether value x is smaller than y. + * + * The function returns true when x is smaller than y and the relative difference between x and y is smaller than the configured epsilon. + * The function cannot be used to compare values smaller than approximately 2.22e-16. + * + * For matrices, the function is evaluated element wise. + */ + smaller(IMathJsChainy: MathType): IMathJsChain; + + /** + * Test whether value x is smaller or equal to y. + * + * The function returns true when x is smaller than y or the relative difference between x and y is smaller than the configured epsilon. + * The function cannot be used to compare values smaller than approximately 2.22e-16. For matrices, the function is evaluated element wise. + */ + smallerEq(IMathJsChainy: MathType): IMathJsChain; + + /** + * Test whether two values are unequal. + * + * The function tests whether the relative difference between x and y is larger than the configured epsilon. The function cannot + * be used to compare values smaller than approximately 2.22e-16. + * + * For matrices, the function is evaluated element wise. In case of complex numbers, x.re must unequal y.re, or x.im must unequal y.im. + * + * Values null and undefined are compared strictly, thus null is unequal with everything except null, and undefined is unequal with + * everying except. undefined. + */ + unequal(IMathJsChainy: MathType): IMathJsChain; + + /** + * Compute the maximum value of a matrix or a list with values. In case of a multi dimensional array, the maximum of the flattened + * array will be calculated. When dim is provided, the maximum over the selected dimension will be calculated. Parameter dim is zero-based. + */ + max(dim?: number): IMathJsChain; + + /** + * Compute the mean value of matrix or a list with values. In case of a multi dimensional array, the mean of the flattened array will be + * calculated. When dim is provided, the maximum over the selected dimension will be calculated. Parameter dim is zero-based. + */ + mean(dim?: number): IMathJsChain; + + /** + * Compute the median of a matrix or a list with values. The values are sorted and the middle value is returned. In case of an + * even number of values, the average of the two middle values is returned. Supported types of values are: Number, BigNumber, Unit + * + * In case of a (multi dimensional) array or matrix, the median of all elements will be calculated. + */ + median(): IMathJsChain; + + /** + * Compute the maximum value of a matrix or a list of values. In case of a multi dimensional array, the maximum of the flattened + * array will be calculated. When dim is provided, the maximum over the selected dimension will be calculated. Parameter dim is zero-based. + */ + min(dim?: number): IMathJsChain; + + /** + * Computes the mode of a set of numbers or a list with values(numbers or characters). If there are more than one modes, it returns a list of those values. + */ + mode(): IMathJsChain; + + /** + * Compute the product of a matrix or a list with values. In case of a (multi dimensional) array or matrix, the sum of all elements will be calculated. + */ + prod(): IMathJsChain; + + /** + * Compute the prob order quantile of a matrix or a list with values. The sequence is sorted and the middle value is returned. + * Supported types of sequence values are: Number, BigNumber, Unit Supported types of probability are: Number, BigNumber + * + * In case of a (multi dimensional) array or matrix, the prob order quantile of all elements will be calculated. + */ + quantileSeq(prob: Number|BigNumber|MathArray, sorted?: boolean): IMathJsChain; + + /** + * Compute the standard deviation of a matrix or a list with values. The standard deviations is defined as the square root of the + * variance: std(A) = sqrt(var(A)). In case of a (multi dimensional) array or matrix, the standard deviation over all elements will + * be calculated. + * + * Optionally, the type of normalization can be specified as second parameter. The parameter normalization can be one of the following + * values: + * + * 'unbiased' (default) The sum of squared errors is divided by (n - 1) + * 'uncorrected' The sum of squared errors is divided by n + * 'biased' The sum of squared errors is divided by (n + 1) + */ + std(normalization?: string): IMathJsChain; + + /** + * Compute the sum of a matrix or a list with values. In case of a (multi dimensional) array or matrix, the sum of all elements will be calculated. + */ + sum(): IMathJsChain; + + /** + * Compute the variance of a matrix or a list with values. In case of a (multi dimensional) array or matrix, the variance over all + * elements will be calculated. + * + * Optionally, the type of normalization can be specified as second parameter. The parameter normalization can be one of the + * following values: + * + * 'unbiased' (default) The sum of squared errors is divided by (n - 1) + * 'uncorrected' The sum of squared errors is divided by n + * 'biased' The sum of squared errors is divided by (n + 1) + * Note that older browser may not like the variable name var. In that case, the function can be called as math['var'](...) + * instead of math.var(...). + */ + var(normalization?: string): IMathJsChain; + + /** + * Calculate the inverse cosine of a value. For matrices, the function is evaluated element wise. + */ + acos(): IMathJsChain; + + /** + * Calculate the hyperbolic arccos of a value, defined as acosh(x) = ln(sqrt(x^2 - 1) + x). + * For matrices, the function is evaluated element wise. + */ + acosh(): IMathJsChain; + + /** + * Calculate the inverse cotangent of a value. For matrices, the function is evaluated element wise. + */ + acot(): IMathJsChain; + + /** + * Calculate the hyperbolic arccotangent of a value, defined as acoth(x) = (ln((x+1)/x) + ln(x/(x-1))) / 2. + * For matrices, the function is evaluated element wise. + */ + acoth(): IMathJsChain; + + /** + * Calculate the inverse cosecant of a value. For matrices, the function is evaluated element wise. + */ + acsc(): IMathJsChain; + + /** + * Calculate the hyperbolic arccosecant of a value, defined as acsch(x) = ln(1/x + sqrt(1/x^2 + 1)). + * For matrices, the function is evaluated element wise. + */ + acsch(): IMathJsChain; + + /** + * Calculate the inverse secant of a value. For matrices, the function is evaluated element wise. + */ + asec(): IMathJsChain; + + /** + * Calculate the hyperbolic arcsecant of a value, defined as asech(x) = ln(sqrt(1/x^2 - 1) + 1/x). For matrices, the function is evaluated element wise. + */ + asech(): IMathJsChain; + + /** + * Calculate the inverse sine of a value. For matrices, the function is evaluated element wise. + */ + asin(): IMathJsChain; + + /** + * Calculate the hyperbolic arcsine of a value, defined as asinh(x) = ln(x + sqrt(x^2 + 1)). For matrices, the function is evaluated element wise. + */ + asinh(): IMathJsChain; + + /** + * Calculate the inverse tangent of a value. For matrices, the function is evaluated element wise. + */ + atan(): IMathJsChain; + + /** + * Calculate the inverse tangent function with two arguments, y/x. By providing two arguments, the right quadrant of the + * computed angle can be determined. + * + * For matrices, the function is evaluated element wise. + */ + atan2(x: number): IMathJsChain; + atan2(x: MathArray|Matrix): IMathJsChain; + + /** + * Calculate the hyperbolic arctangent of a value, defined as atanh(x) = ln((1 + x)/(1 - x)) / 2. + * For matrices, the function is evaluated element wise. + */ + atanh(): IMathJsChain; + + /** + * Calculate the cosine of a value. For matrices, the function is evaluated element wise. + */ + asin(): IMathJsChain; + + /** + * Calculate the hyperbolic cosine of a value, defined as cosh(x) = 1/2 * (exp(x) + exp(-x)). For matrices, the function is evaluated element wise. + */ + cosh(): IMathJsChain; + + /** + * Calculate the cotangent of a value. cot(x) is defined as 1 / tan(x). For matrices, the function is evaluated element wise. + */ + cot(): IMathJsChain; + + /** + * Calculate the hyperbolic cotangent of a value, defined as coth(x) = 1 / tanh(x). For matrices, the function is evaluated element wise. + */ + coth(): IMathJsChain; + + /** + * Calculate the cosecant of a value, defined as csc(x) = 1/sin(x). For matrices, the function is evaluated element wise. + */ + csc(): IMathJsChain; + + /** + * Calculate the hyperbolic cosecant of a value, defined as csch(x) = 1 / sinh(x). For matrices, the function is evaluated element wise. + */ + csch(): IMathJsChain; + + /** + * Calculate the secant of a value, defined as sec(x) = 1/cos(x). For matrices, the function is evaluated element wise. + */ + sec(): IMathJsChain; + + /** + * Calculate the hyperbolic secant of a value, defined as sech(x) = 1 / cosh(x). For matrices, the function is evaluated element wise. + */ + sech(): IMathJsChain; + + /** + * Calculate the sine of a value. For matrices, the function is evaluated element wise. + */ + sin(): IMathJsChain; + + /** + * Calculate the hyperbolic sine of a value, defined as sinh(x) = 1/2 * (exp(x) - exp(-x)). For matrices, the function is evaluated element wise. + */ + sinh(): IMathJsChain; + + /** + * Calculate the tangent of a value. tan(x) is equal to sin(x) / cos(x). For matrices, the function is evaluated element wise. + */ + tan(): IMathJsChain; + + /** + * Calculate the hyperbolic tangent of a value, defined as tanh(x) = (exp(2 * x) - 1) / (exp(2 * x) + 1). For matrices, the function is evaluated element wise. + */ + tanh(): IMathJsChain; + + /** + * Change the unit of a value. For matrices, the function is evaluated element wise. + * @param x The unit to be converted. + * @param unit New unit. Can be a string like "cm" or a unit without value. + */ + to(unit: Unit|string): IMathJsChain; + + /** + * Clone an object. + */ + clone(): IMathJsChain; + + /** + * Filter the items in an array or one dimensional matrix. + * @param x A one dimensional matrix or array to filter + * @param test + */ + filter(test: RegExp|((item: any)=>boolean)): IMathJsChain; + + /** + * Format a value of any type into a string. + */ + format(options?: IFormatOptions|number|((item: any)=>string)): IMathJsChain; + + /** + * Create a new matrix or array with the results of the callback function executed on each entry of the matrix/array. + * @param callback The callback method is invoked with three parameters: the value of the element, the index of the element, and the matrix being traversed. + */ + map(callback: (item: any)=>any): IMathJsChain; + + /** + * Partition-based selection of an array or 1D matrix. Will find the kth smallest value, and mutates the input array. Uses Quickselect. + * @param k The kth smallest value to be retrieved; zero-based index + * @param compare An optional comparator function. The function is called as compare(a, b), and must return 1 when a > b, -1 when a < b, and 0 when a == b. Default value: 'asc'. + * @returns Returns the kth lowest value. + */ + partitionSelect(k: number, compare?: string|((a: any, b: any)=>number)): IMathJsChain; + + /** + * Sort the items in a matrix. + * @param compare An optional comparator function. The function is called as compare(a, b), and must return 1 when a > b, -1 when a < b, and 0 when a == b. Default value: 'asc'. + */ + sort(compare?: string|((a: any, b: any)=>number)): IMathJsChain; + + done(): any; + valueOf(): any; + toString(): string; + } +} \ No newline at end of file diff --git a/meteor/meteor.d.ts b/meteor/meteor.d.ts index ee6c1db41..222de7ae7 100644 --- a/meteor/meteor.d.ts +++ b/meteor/meteor.d.ts @@ -616,7 +616,7 @@ declare module Mongo { insert(doc: T, callback?: Function): string; rawCollection(): any; rawDatabase(): any; - remove(selector: Mongo.Selector | Mongo.ObjectID | string, callback?: Function): void; + remove(selector: Mongo.Selector | Mongo.ObjectID | string, callback?: Function): number; update(selector: Mongo.Selector | Mongo.ObjectID | string, modifier: Mongo.Modifier, options?: { multi?: boolean; upsert?: boolean; diff --git a/method-override/method-override-tests.ts b/method-override/method-override-tests.ts index 84b4e966e..9023135d1 100644 --- a/method-override/method-override-tests.ts +++ b/method-override/method-override-tests.ts @@ -5,6 +5,7 @@ import methodOverride = require('method-override'); var app = express(); app.use(methodOverride('X-HTTP-Method-Override')); +app.use(methodOverride('X-HTTP-Method-Override', { methods: ["GET", 'POST'] })); app.use(methodOverride((req: express.Request, res: express.Response) => { if (req.body && typeof req.body === 'object' && '_method' in req.body) { // look in urlencoded POST bodies and delete it diff --git a/method-override/method-override.d.ts b/method-override/method-override.d.ts index 099b5eeb9..22e3b74c1 100644 --- a/method-override/method-override.d.ts +++ b/method-override/method-override.d.ts @@ -13,12 +13,15 @@ declare module Express { declare module "method-override" { import express = require('express'); - module e { - interface MethodOverrideOptions { + + namespace e { + export interface MethodOverrideOptions { methods: string[]; } } - function e(getter: string, options?: any): express.RequestHandler; - function e(getter: (req: express.Request, res: express.Response) => string, options?: any): express.RequestHandler; + + function e(getter?: string, options?: e.MethodOverrideOptions): express.RequestHandler; + function e(getter?: (req: express.Request, res: express.Response) => string, options?: e.MethodOverrideOptions): express.RequestHandler; + export = e; } \ No newline at end of file diff --git a/milliseconds/milliseconds-tests.ts b/milliseconds/milliseconds-tests.ts new file mode 100644 index 000000000..04fa7408f --- /dev/null +++ b/milliseconds/milliseconds-tests.ts @@ -0,0 +1,9 @@ +/// + +milliseconds.seconds(1) +milliseconds.minutes(2) +milliseconds.hours(3) +milliseconds.days(4) +milliseconds.weeks(5) +milliseconds.month(6) +milliseconds.years(7) diff --git a/milliseconds/milliseconds.d.ts b/milliseconds/milliseconds.d.ts new file mode 100644 index 000000000..144886e45 --- /dev/null +++ b/milliseconds/milliseconds.d.ts @@ -0,0 +1,20 @@ +// Type definitions for milliseconds +// Project: http://npmjs.com/milliseconds +// Definitions by: Elmar Burke +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +interface Milliseconds { + seconds(seconds: number): number + minutes(minutes: number): number + hours(hours: number): number + days(days: number): number + weeks(weeks: number): number + month(month: number): number + years(years: number): number +} + +declare var milliseconds: Milliseconds + +declare module 'milliseconds' { + export = milliseconds +} diff --git a/mobservable-react/mobservable-react-tests.ts b/mobservable-react/mobservable-react-tests.ts index 7b39dbb7f..1bf2b49c6 100644 --- a/mobservable-react/mobservable-react-tests.ts +++ b/mobservable-react/mobservable-react-tests.ts @@ -17,7 +17,7 @@ import {reactiveComponent} from 'mobservable-react'; })); let c1Factory = React.createFactory(c1); - React.render(c1Factory({ + ReactDOM.render(c1Factory({ test: "hello" }), null); } @@ -31,7 +31,7 @@ class TestComponent extends React.Component<{ test: string },{}> { { let c2Factory = React.createFactory(TestComponent); - React.render(c2Factory({ + ReactDOM.render(c2Factory({ test: "hello" }) , null); } @@ -39,7 +39,7 @@ class TestComponent extends React.Component<{ test: string },{}> { { var c3 = reactiveComponent((props: { test: string }) => React.createElement("div")); var c3Factory = React.createFactory(c3); //without JSX - React.render(c3Factory({ + ReactDOM.render(c3Factory({ test: "hello" }), null); } @@ -55,7 +55,7 @@ class TestComponent2 extends React.Component<{ test: string },{}> { // Argument of type 'typeof TestComponent2 | void' is not assignable to parameter of type 'ComponentClass<{ test: string; }>'. // Type 'void' is not assignable to type 'ComponentClass<{ test: string; }>'. let c4Factory = React.createFactory(> reactiveComponent(TestComponent2)); - React.render(c4Factory({ + ReactDOM.render(c4Factory({ test: "hello" }) , null); } \ No newline at end of file diff --git a/mongoose-auto-increment/mongoose-auto-increment-tests.ts b/mongoose-auto-increment/mongoose-auto-increment-tests.ts new file mode 100644 index 000000000..fbd2ef68a --- /dev/null +++ b/mongoose-auto-increment/mongoose-auto-increment-tests.ts @@ -0,0 +1,20 @@ +/// +/// + +import * as autoIncrement from 'mongoose-auto-increment'; +import * as mongoose from 'mongoose'; +import { Schema } from 'mongoose'; + +var connection = mongoose.createConnection("mongodb://localhost/myDatabase"); + +autoIncrement.initialize(connection); + +var bookSchema = new Schema({ + author: { type: Schema.Types.ObjectId, ref: 'Author' }, + title: String, + genre: String, + publishDate: Date +}); + +bookSchema.plugin(autoIncrement.plugin, 'Book'); +var Book = connection.model('Book', bookSchema); diff --git a/mongoose-auto-increment/mongoose-auto-increment.d.ts b/mongoose-auto-increment/mongoose-auto-increment.d.ts new file mode 100644 index 000000000..34e7b5ddd --- /dev/null +++ b/mongoose-auto-increment/mongoose-auto-increment.d.ts @@ -0,0 +1,20 @@ +// Type definitions for mongoose-auto-increment 5.0.1 +// Project: https://github.com/codetunnel/mongoose-auto-increment +// Definitions by: Aya Morisawa +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare module 'mongoose-auto-increment' { + import { Connection, Schema, Mongoose } from 'mongoose'; + + /** + * Initialize plugin by creating counter collection in database. + */ + function initialize(connection: Connection): void; + + /** + * The function to use when invoking the plugin on a custom schema. + */ + function plugin(schema: Schema, options: Object): void; +} diff --git a/mongoose-deep-populate/mongoose-deep-populate-tests.ts b/mongoose-deep-populate/mongoose-deep-populate-tests.ts new file mode 100644 index 000000000..d85a854a9 --- /dev/null +++ b/mongoose-deep-populate/mongoose-deep-populate-tests.ts @@ -0,0 +1,19 @@ +/// +/// + +import mongooseDeepPopulate from 'mongoose-deep-populate'; +import * as mongoose from 'mongoose'; +import { Schema } from 'mongoose'; + +var connection = mongoose.connect("mongodb://localhost/myDatabase"); + +var deepPopulate = mongooseDeepPopulate(connection); + +var bookSchema = new Schema({ + author: { type: Schema.Types.ObjectId, ref: 'Author' }, + title: String, + genre: String, + publishDate: Date +}); + +bookSchema.plugin(deepPopulate, {}); diff --git a/mongoose-deep-populate/mongoose-deep-populate.d.ts b/mongoose-deep-populate/mongoose-deep-populate.d.ts new file mode 100644 index 000000000..247ba6b48 --- /dev/null +++ b/mongoose-deep-populate/mongoose-deep-populate.d.ts @@ -0,0 +1,12 @@ +// Type definitions for mongoose-deep-populate 2.0.3 +// Project: https://github.com/buunguyen/mongoose-deep-populate +// Definitions by: Aya Morisawa +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare module "mongoose-deep-populate" { + import { Mongoose, Schema } from 'mongoose'; + + export default function(mognoose: Mongoose): (schema: Schema, options: Object) => void; +} diff --git a/ng-cordova/app-version-tests.ts b/ng-cordova/app-version-tests.ts new file mode 100644 index 000000000..b83fb9ebb --- /dev/null +++ b/ng-cordova/app-version-tests.ts @@ -0,0 +1,16 @@ +/// + +module ngCordova { + function test($cordovaAppVersion: IAppVersionService) { + + $cordovaAppVersion.getVersionNumber() + .then((versionNumber) => { + console.log(versionNumber.toLowerCase()); + }); + + $cordovaAppVersion.getVersionCode() + .then((versionCode) => { + console.log(versionCode.toLowerCase()); + }); + } +} diff --git a/ng-cordova/app-version.d.ts b/ng-cordova/app-version.d.ts new file mode 100644 index 000000000..b81c71b94 --- /dev/null +++ b/ng-cordova/app-version.d.ts @@ -0,0 +1,13 @@ +// Type definitions for ngCordova datepicker plugin +// Project: https://github.com/driftyco/ng-cordova +// Definitions by: Jacques Kang +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare module ngCordova { + export interface IAppVersionService { + getVersionNumber(): ng.IPromise; + getVersionCode(): ng.IPromise; + } +} diff --git a/ng-cordova/camera-tests.ts b/ng-cordova/camera-tests.ts new file mode 100644 index 000000000..207329b7a --- /dev/null +++ b/ng-cordova/camera-tests.ts @@ -0,0 +1,26 @@ +/// + +module ngCordova { + function cameraTest($cordovaCamera: ICameraService) { + var options = { + quality: 50, + destinationType: Camera.DestinationType.DATA_URL, + sourceType: Camera.PictureSourceType.CAMERA, + allowEdit: true, + encodingType: Camera.EncodingType.JPEG, + targetWidth: 100, + targetHeight: 100, + saveToPhotoAlbum: false, + correctOrientation: true + }; + + $cordovaCamera.getPicture(options).then((imageData) => { + console.log(imageData.trim()); + }).finally(() => { + $cordovaCamera.cleanup() + .then(() => { + console.log('cleaned up.'); + }); + }); + }; +} diff --git a/ng-cordova/camera.d.ts b/ng-cordova/camera.d.ts new file mode 100644 index 000000000..e9a6cd2c1 --- /dev/null +++ b/ng-cordova/camera.d.ts @@ -0,0 +1,14 @@ +// Type definitions for ngCordova.plugins.camera +// Project: https://github.com/driftyco/ng-cordova +// Definitions by: Jacques Kang +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// +/// + +declare module ngCordova { + export interface ICameraService { + getPicture(options?: CameraOptions): ng.IPromise; + cleanup(): ng.IPromise; + } +} diff --git a/ng-cordova/datepicker-tests.ts b/ng-cordova/datepicker-tests.ts new file mode 100644 index 000000000..340b9fff0 --- /dev/null +++ b/ng-cordova/datepicker-tests.ts @@ -0,0 +1,31 @@ +/// +/// + +module ngCordova { + function smoketest($cordovaDatePicker: IDatePickerService, isIos: boolean) { + + // minDate is a Date object for iOS and a millisecond precision unix timestamp + // for Android, so you need to account for that when using the plugin. Also, + // on Android, only the date is enforced (time is not). + // - from https://github.com/VitaliiBlagodir/cordova-plugin-datepicker + var minDate = isIos ? new Date() : (new Date()).valueOf(); + + var options: DatePickerOptions = { + date: new Date(), + mode: 'date', + minDate: minDate, + maxDate: '', + allowOldDates: true, + allowFutureDates: false, + doneButtonLabel: 'DONE', + doneButtonColor: '#F2F3F4', + cancelButtonLabel: 'CANCEL', + cancelButtonColor: '#000000', + androidTheme: AndroidTheme.HoloDark + }; + + $cordovaDatePicker.show(options).then(function(date) { + alert(date); + }); + }; +} diff --git a/ng-cordova/datepicker.d.ts b/ng-cordova/datepicker.d.ts new file mode 100644 index 000000000..b4b195982 --- /dev/null +++ b/ng-cordova/datepicker.d.ts @@ -0,0 +1,46 @@ +// Type definitions for ngCordova datepicker plugin +// Project: https://github.com/VitaliiBlagodir/cordova-plugin-datepicker +// Definitions by: Jacques Kang +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare module ngCordova { + + export enum AndroidTheme { + Traditional = 1, + HoloDark = 2, + HoloLight = 3, + DeviceDefaultDark = 4, + DeviceDefaultLight = 5 + } + + export interface DatePickerOptions { + mode?: string; + date?: Date | string | number; + minDate?: Date | string | number; + maxDate?: Date | string | number; + titleText?: string; + okText?: string; + cancelText?: string; + todayText?: string; + nowText?: string; + is24Hour?: boolean; + androidTheme?: AndroidTheme; + allowOldDates?: boolean; + allowFutureDates?: boolean; + doneButtonLabel?: string; + doneButtonColor?: string; + cancelButtonLabel?: string; + cancelButtonColor?: string; + x?: number; + y?: number; + minuteInterval?: number; + popoverArrowDirection?: string; + locale?: string; + } + + export interface IDatePickerService { + show(options?: DatePickerOptions): ng.IPromise; + } +} diff --git a/ng-cordova/tsd.d.ts b/ng-cordova/tsd.d.ts index 188cb367d..5f17dd706 100644 --- a/ng-cordova/tsd.d.ts +++ b/ng-cordova/tsd.d.ts @@ -12,3 +12,6 @@ /// /// /// +/// +/// +/// diff --git a/ng-stomp/ng-stomp-tests.ts b/ng-stomp/ng-stomp-tests.ts new file mode 100644 index 000000000..4f9092c20 --- /dev/null +++ b/ng-stomp/ng-stomp-tests.ts @@ -0,0 +1,49 @@ +/// +/// + +module ngStompTesting { + + "use strict"; + var ngStompTest = "ngStompTest"; + + class test { + constructor(private ngstomp:ngStomp) { + var connectHeaders ={ + "Auth": "user", + "Accept": "lol" + }; + + ngstomp.connect('/endpoint', connectHeaders) + + + // frame = CONNECTED headers + .then(function (frame) { + + this.subscription = ngstomp.subscribe('/dest', function (payload, headers, res) { + this.payload = payload; + }, { + "headers": "are awesome" + }); + + // Unsubscribe + this.subscription.unsubscribe(); + + // Send message + ngstomp.send('/dest', { + message: 'body' + }, { + priority: 9, + custom: 42 //Custom Headers + }); + + // Disconnect + ngstomp.disconnect(function () { + + }); + }); + } + + } + + angular.module("app").controller(ngStompTest, test); +} \ No newline at end of file diff --git a/ng-stomp/ng-stomp.d.ts b/ng-stomp/ng-stomp.d.ts new file mode 100644 index 000000000..7cf263eeb --- /dev/null +++ b/ng-stomp/ng-stomp.d.ts @@ -0,0 +1,36 @@ +// Type definitions for ngStomp +// Project: https://github.com/beevelop/ng-stomp +// Definitions by: Lukasz Potapczuk +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +/// + + +interface ngStomp { + sock:any; + stomp:any; + debug:any; + off: any; + + setDebug:(callback:Function)=> void; + + connect: (endpoint:string, headers?:Headers)=> angular.IHttpPromise; + + disconnect: (callback:()=>void) => angular.IHttpPromise; + + subscribe: (destination:string, callback:(payload:string, headers:Headers, res:Function)=>void, headers?:Headers, scope?:any) => any; + + unsubscribe: () => any; + + send: (destination:string, body:any, headers:Headers)=> any; + + } + + interface Headers { + [key: string]: any; + } + + + + + + diff --git a/ngbootbox/ngbootbox-tests.ts b/ngbootbox/ngbootbox-tests.ts new file mode 100644 index 000000000..ec4fb2830 --- /dev/null +++ b/ngbootbox/ngbootbox-tests.ts @@ -0,0 +1,50 @@ +/// +/// + +class TestBootboxController { + + constructor(private $scope: angular.IScope, $ngBootbox: BootboxService) { + + $ngBootbox.alert('An important message!').then(function() { + console.log('Alert closed'); + }); + + $ngBootbox.confirm('A question?').then(function() { + console.log('Confirmed!'); + }, function() { + console.log('Confirm dismissed!'); + }); + + $ngBootbox.prompt('Enter something').then(function(result) { + console.log('Prompt returned: ' + result); + }, function() { + console.log('Prompt dismissed!'); + }); + + var options: NgBootboxDialog = { + message: 'This is a message!', + title: 'The title!', + className: 'test-class', + buttons: { + warning: { + label: "Cancel", + className: "btn-warning", + callback: function() { + console.log('warning callback'); + } + }, + success: { + label: "Ok", + className: "btn-success", + callback: function() { + console.log('sucess callback'); + } + } + } + }; + $ngBootbox.customDialog(options); + } +} + +var app = angular.module('testBootbox', ['ngBootbox']); +app.controller('TestBootboxCtrl', ['$scope', '$ngBootbox', TestBootboxController]); diff --git a/ngbootbox/ngbootbox.d.ts b/ngbootbox/ngbootbox.d.ts new file mode 100644 index 000000000..e99e47979 --- /dev/null +++ b/ngbootbox/ngbootbox.d.ts @@ -0,0 +1,38 @@ +// Type definitions for ngbootbox +// Project: https://github.com/eriktufvesson/ngBootbox +// Definitions by: Sam Saint-Pettersen +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// +/// + +interface NgBootboxDialog { + title?: string; + message?: string; + templateUrl?: string; + locale?: string; + callback?: () => any; + onEscape?: () => any | boolean; + show?: boolean; + backdrop?: boolean; + closeButton?: boolean; + animate?: boolean; + className?: string; + size?: string; + buttons?: BootboxButtonMap; +} + +interface BootboxService { + alert(msg: string): Promise; + confirm(msg: string): Promise; + prompt(msg: string): Promise; + customDialog(options: NgBootboxDialog): void; + setDefaults(options: BootboxDefaultOptions): void; + hideAll(): void; + + addLocale(name: string, values: BootboxLocaleValues): void; + removeLocale(name: string): void; + setLocale(name: string): void; +} + +declare var $ngBootbox: BootboxService; diff --git a/node/node-0.12-tests.ts b/node/node-0.12-tests.ts new file mode 100644 index 000000000..f955421d9 --- /dev/null +++ b/node/node-0.12-tests.ts @@ -0,0 +1,411 @@ +/// +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 net from "net"; +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"; + +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.throws(() => { throw "a hammer at your face"; }, undefined, "DODGED IT"); + +assert.doesNotThrow(() => { + if (false) { throw "a hammer at your face"; } +}, undefined, "What the...*crunch*"); + +//////////////////////////////////////////////////// +/// 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; + } +}); + + +/////////////////////////////////////////////////////// +/// 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); + 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); + + // 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'); +} + + +//////////////////////////////////////////////////// +/// 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'); + +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; + +//////////////////////////////////////////////////// + +// 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 +//////////////////////////////////////////////////// +module 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; +} + +//////////////////////////////////////////////////// +/// 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://gist.github.com/musubu/2202583 +//////////////////////////////////////////////////// + +var original: string = 'http://example.com/product/abcde.html'; +var escaped: string = querystring.escape(original); +console.log(escaped); +// http%3A%2F%2Fexample.com%2Fproduct%2Fabcde.html +var unescaped: string = querystring.unescape(escaped); +console.log(unescaped); +// http://example.com/product/abcde.html + +//////////////////////////////////////////////////// +/// path tests : http://nodejs.org/api/path.html +//////////////////////////////////////////////////// + +module 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 +//////////////////////////////////////////////////// + +var rl = readline.createInterface({ + input: process.stdin, + output: process.stdout, +}); + +rl.setPrompt("$>"); +rl.prompt(); +rl.prompt(true); + +rl.question("do you like typescript?", function(answer: string) { + rl.close(); +}); + +////////////////////////////////////////////////////////////////////// +/// Child Process tests: https://nodejs.org/api/child_process.html /// +////////////////////////////////////////////////////////////////////// + +childProcess.exec("echo test"); +childProcess.spawnSync("echo test"); diff --git a/node/node-0.12.d.ts b/node/node-0.12.d.ts new file mode 100644 index 000000000..11fd92d24 --- /dev/null +++ b/node/node-0.12.d.ts @@ -0,0 +1,2080 @@ +// Type definitions for Node.js v0.12.0 +// Project: http://nodejs.org/ +// Definitions by: Microsoft TypeScript , DefinitelyTyped +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/************************************************ +* * +* Node.js v0.12.0 API * +* * +************************************************/ + +interface Error { + stack?: string; +} + + +// compat for TypeScript 1.5.3 +// 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.5.3. +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 +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; + /** + * Allocates a new buffer containing the given {array} of octets. + * + * @param array The octets to store. + */ + new (array: any[]): Buffer; + prototype: 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 module NodeJS { + export interface ErrnoException extends Error { + errno?: number; + code?: string; + path?: string; + syscall?: string; + stack?: string; + } + + export interface EventEmitter { + addListener(event: string, listener: Function): EventEmitter; + on(event: string, listener: Function): EventEmitter; + once(event: string, listener: Function): EventEmitter; + removeListener(event: string, listener: Function): EventEmitter; + removeAllListeners(event?: string): EventEmitter; + setMaxListeners(n: number): void; + listeners(event: string): Function[]; + emit(event: string, ...args: any[]): boolean; + } + + 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 Process extends EventEmitter { + stdout: WritableStream; + stderr: WritableStream; + stdin: ReadableStream; + argv: 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): void; + pid: number; + title: string; + arch: string; + platform: string; + memoryUsage(): { rss: number; heapTotal: number; heapUsed: number; }; + nextTick(callback: Function): void; + umask(mask?: number): number; + uptime(): number; + hrtime(time?:number[]): number[]; + + // Worker + send?(message: any, sendHandle?: any): void; + } + + 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 { + [index: number]: number; + 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; + 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, noAsset?: 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): Buffer; +} + +/************************************************ +* * +* MODULES * +* * +************************************************/ +declare module "buffer" { + export var INSPECT_MAX_BYTES: number; +} + +declare module "querystring" { + export function stringify(obj: any, sep?: string, eq?: string): string; + export function parse(str: string, sep?: string, eq?: string, options?: { maxKeys?: number; }): any; + export function escape(str: string): string; + export function unescape(str: string): string; +} + +declare module "events" { + export class EventEmitter implements NodeJS.EventEmitter { + static listenerCount(emitter: EventEmitter, event: string): number; + + addListener(event: string, listener: Function): EventEmitter; + on(event: string, listener: Function): EventEmitter; + once(event: string, listener: Function): EventEmitter; + removeListener(event: string, listener: Function): EventEmitter; + removeAllListeners(event?: string): EventEmitter; + setMaxListeners(n: number): void; + listeners(event: string): Function[]; + emit(event: string, ...args: any[]): boolean; + } +} + +declare module "http" { + import * as events from "events"; + import * as net from "net"; + import * as stream from "stream"; + + export interface Server extends events.EventEmitter { + listen(port: number, hostname?: string, backlog?: number, callback?: Function): Server; + listen(port: number, hostname?: string, callback?: Function): Server; + listen(path: string, callback?: Function): Server; + listen(handle: any, listeningListener?: Function): Server; + close(cb?: any): Server; + address(): { port: number; family: string; address: string; }; + maxHeadersCount: 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; + setHeader(name: string, value: 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; + + // 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: any, 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 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; + } + + 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: Worker[]; + + // Event emitter + export function addListener(event: string, listener: Function): 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 function tmpdir(): 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(): { model: string; speed: number; times: { user: number; nice: number; sys: number; idle: number; irq: number; }; }[]; + export function networkInterfaces(): any; + 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 { + host?: string; + hostname?: string; + port?: number; + path?: string; + method?: string; + headers?: any; + auth?: string; + agent?: any; + pfx?: any; + key?: any; + passphrase?: string; + cert?: any; + ca?: any; + ciphers?: string; + rejectUnauthorized?: boolean; + } + + export interface Agent { + maxSockets: number; + sockets: any; + requests: any; + } + export var Agent: { + new (options?: RequestOptions): 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): string; + 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 ReadLine extends events.EventEmitter { + setPrompt(prompt: string): void; + prompt(preserveCursor?: boolean): void; + question(query: string, callback: Function): void; + pause(): void; + resume(): void; + close(): void; + write(data: any, key?: any): void; + } + export interface ReadLineOptions { + input: NodeJS.ReadableStream; + output: NodeJS.WritableStream; + completer?: Function; + terminal?: boolean; + } + export function createInterface(options: ReadLineOptions): ReadLine; +} + +declare module "vm" { + export interface Context { } + export interface Script { + runInThisContext(): void; + runInNewContext(sandbox?: Context): void; + } + export function runInThisContext(code: string, filename?: string): void; + export function runInNewContext(code: string, sandbox?: Context, filename?: string): void; + export function runInContext(code: string, context: Context, filename?: string): void; + export function createContext(initSandbox?: Context): Context; + export function createScript(code: string, filename?: string): Script; +} + +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; + pid: number; + kill(signal?: string): void; + send(message: any, sendHandle?: any): void; + disconnect(): void; + unref(): void; + } + + export function spawn(command: string, args?: string[], options?: { + cwd?: string; + stdio?: any; + custom?: any; + env?: any; + detached?: boolean; + }): ChildProcess; + export function exec(command: string, options: { + cwd?: string; + stdio?: any; + customFds?: any; + env?: any; + encoding?: string; + timeout?: number; + maxBuffer?: number; + killSignal?: string; + }, callback?: (error: Error, stdout: Buffer, stderr: Buffer) =>void ): ChildProcess; + export function exec(command: string, callback?: (error: Error, stdout: Buffer, stderr: Buffer) =>void ): ChildProcess; + export function execFile(file: string, + callback?: (error: Error, stdout: Buffer, stderr: Buffer) =>void ): ChildProcess; + export function execFile(file: string, args?: string[], + callback?: (error: Error, stdout: Buffer, stderr: Buffer) =>void ): ChildProcess; + export function execFile(file: string, args?: string[], options?: { + cwd?: string; + stdio?: any; + customFds?: any; + env?: any; + encoding?: string; + timeout?: number; + maxBuffer?: number; + killSignal?: string; + }, callback?: (error: Error, stdout: Buffer, stderr: Buffer) =>void ): ChildProcess; + export function fork(modulePath: string, args?: string[], options?: { + cwd?: string; + env?: any; + encoding?: string; + }): ChildProcess; + export function spawnSync(command: string, args?: string[], options?: { + cwd?: string; + input?: string | Buffer; + stdio?: any; + env?: any; + uid?: number; + gid?: number; + timeout?: number; + maxBuffer?: number; + killSignal?: string; + encoding?: string; + }): { + pid: number; + output: string[]; + stdout: string | Buffer; + stderr: string | Buffer; + status: number; + signal: string; + error: Error; + }; + export function execSync(command: string, options?: { + cwd?: string; + input?: string|Buffer; + stdio?: any; + env?: any; + uid?: number; + gid?: number; + timeout?: number; + maxBuffer?: number; + killSignal?: string; + encoding?: string; + }): string | Buffer; + export function execFileSync(command: string, args?: string[], options?: { + cwd?: string; + input?: string|Buffer; + stdio?: any; + env?: any; + uid?: number; + gid?: number; + timeout?: number; + maxBuffer?: number; + killSignal?: string; + encoding?: string; + }): string | Buffer; +} + +declare module "url" { + export interface Url { + href?: string; + protocol?: string; + auth?: string; + hostname?: string; + port?: string; + host?: string; + pathname?: string; + search?: string; + query?: any; // string | Object + 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 Server extends Socket { + listen(port: number, host?: string, backlog?: number, listeningListener?: Function): Server; + listen(path: string, listeningListener?: Function): Server; + listen(handle: any, listeningListener?: Function): Server; + close(callback?: Function): Server; + address(): { port: number; family: string; address: string; }; + 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; + 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 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 { + 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?: any; //string | Buffer + key?: any; //string | Buffer + passphrase?: string; + cert?: any; //string | Buffer + ca?: any; //Array of string | Buffer + rejectUnauthorized?: boolean; + NPNProtocols?: any; //Array of string | Buffer + servername?: string; + } + + export interface Server extends net.Server { + // Extended base methods + listen(port: number, host?: string, backlog?: number, listeningListener?: Function): Server; + listen(path: string, listeningListener?: Function): Server; + listen(handle: any, listeningListener?: Function): Server; + + listen(port: number, host?: string, callback?: Function): 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?: any; //string | buffer + key?: any; //string | buffer + passphrase?: string; + cert?: any; // string | buffer + ca?: any; // string | buffer + crl?: any; // 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: any; //string | string array + crl: any; //string | string array + 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; + interface Hash { + update(data: any, input_encoding?: string): Hash; + digest(encoding: 'buffer'): Buffer; + digest(encoding: string): any; + digest(): Buffer; + } + interface Hmac { + 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; + interface Cipher { + update(data: Buffer): Buffer; + update(data: string, input_encoding?: string, output_encoding?: string): string; + final(): Buffer; + final(output_encoding: string): string; + setAutoPadding(auto_padding: boolean): void; + } + export function createDecipher(algorithm: string, password: any): Decipher; + export function createDecipheriv(algorithm: string, key: any, iv: any): Decipher; + interface Decipher { + update(data: Buffer): Buffer; + update(data: string, input_encoding?: string, output_encoding?: string): string; + final(): Buffer; + final(output_encoding: string): string; + setAutoPadding(auto_padding: boolean): void; + } + export function createSign(algorithm: string): Signer; + interface Signer extends NodeJS.WritableStream { + update(data: any): void; + sign(private_key: string, output_format: string): string; + } + export function createVerify(algorith: string): Verify; + 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; + 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, salt: string, iterations: number, keylen: number, callback: (err: Error, derivedKey: Buffer) => any): void; + export function pbkdf2(password: string, salt: string, iterations: number, keylen: number, digest: string, callback: (err: Error, derivedKey: Buffer) => any): void; + export function pbkdf2Sync(password: string, salt: string, iterations: number, keylen: number) : Buffer; + export function pbkdf2Sync(password: string, salt: string, 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; +} + +declare module "stream" { + import * as events from "events"; + + export interface 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; + module 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 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; + } + export interface WriteStream extends net.Socket { + columns: number; + rows: number; + } +} + +declare module "domain" { + import * as events from "events"; + + export class Domain extends events.EventEmitter { + 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; + + addListener(event: string, listener: Function): Domain; + on(event: string, listener: Function): Domain; + once(event: string, listener: Function): Domain; + removeListener(event: string, listener: Function): Domain; + removeAllListeners(event?: string): Domain; + } + + 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 bd80329dc..930bd1a71 100644 --- a/node/node-tests.ts +++ b/node/node-tests.ts @@ -23,6 +23,8 @@ 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(() => { diff --git a/node/node.d.ts b/node/node.d.ts index 4e6ffdcaf..017ca8e6b 100644 --- a/node/node.d.ts +++ b/node/node.d.ts @@ -1,11 +1,11 @@ -// Type definitions for Node.js v0.12.0 +// Type definitions for Node.js v4.x // Project: http://nodejs.org/ // Definitions by: Microsoft TypeScript , DefinitelyTyped // Definitions: https://github.com/borisyankov/DefinitelyTyped /************************************************ * * -* Node.js v0.12.0 API * +* Node.js v4.x API * * * ************************************************/ @@ -431,6 +431,21 @@ declare module "http" { 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; + } + export interface Server extends events.EventEmitter { listen(port: number, hostname?: string, backlog?: number, callback?: Function): Server; listen(port: number, hostname?: string, callback?: Function): Server; @@ -568,7 +583,7 @@ declare module "http" { }; export function createServer(requestListener?: (request: IncomingMessage, response: ServerResponse) =>void ): Server; export function createClient(port?: number, host?: string): any; - export function request(options: any, callback?: (res: IncomingMessage) => void): ClientRequest; + export function request(options: RequestOptions, callback?: (res: IncomingMessage) => void): ClientRequest; export function get(options: any, callback?: (res: IncomingMessage) => void): ClientRequest; export var globalAgent: Agent; } @@ -718,15 +733,7 @@ declare module "https" { SNICallback?: (servername: string) => any; } - export interface RequestOptions { - host?: string; - hostname?: string; - port?: number; - path?: string; - method?: string; - headers?: any; - auth?: string; - agent?: any; + export interface RequestOptions extends http.RequestOptions{ pfx?: any; key?: any; passphrase?: string; @@ -734,6 +741,7 @@ declare module "https" { ca?: any; ciphers?: string; rejectUnauthorized?: boolean; + secureProtocol?: string; } export interface Agent { @@ -1800,6 +1808,8 @@ declare module "assert" { 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; diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index da07b4d07..6dc63bfb0 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -2,254 +2,217 @@ "name": "DefinitelyTyped", "version": "0.0.1", "dependencies": { + "assertion-error": { + "version": "1.0.1", + "from": "assertion-error@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.0.1.tgz" + }, + "balanced-match": { + "version": "0.3.0", + "from": "balanced-match@>=0.3.0 <0.4.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.3.0.tgz" + }, + "bluebird": { + "version": "2.10.2", + "from": "bluebird@>=2.10.1 <3.0.0", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-2.10.2.tgz" + }, + "brace-expansion": { + "version": "1.1.2", + "from": "brace-expansion@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.2.tgz" + }, + "concat-map": { + "version": "0.0.1", + "from": "concat-map@0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" + }, + "core-util-is": { + "version": "1.0.2", + "from": "core-util-is@>=1.0.0 <1.1.0", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz" + }, + "definition-header": { + "version": "0.1.0", + "from": "definition-header@>=0.1.0 <0.2.0", + "resolved": "https://registry.npmjs.org/definition-header/-/definition-header-0.1.0.tgz" + }, "definition-tester": { "version": "0.3.0", "from": "definition-tester@0.3.0", + "resolved": "https://registry.npmjs.org/definition-tester/-/definition-tester-0.3.0.tgz" + }, + "findup-sync": { + "version": "0.3.0", + "from": "findup-sync@>=0.3.0 <0.4.0", + "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-0.3.0.tgz" + }, + "git-wrapper": { + "version": "0.1.1", + "from": "git-wrapper@>=0.1.1 <0.2.0", + "resolved": "https://registry.npmjs.org/git-wrapper/-/git-wrapper-0.1.1.tgz" + }, + "glob": { + "version": "5.0.15", + "from": "glob@>=5.0.14 <6.0.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz" + }, + "hoek": { + "version": "2.16.3", + "from": "hoek@>=2.2.0 <3.0.0", + "resolved": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz" + }, + "inflight": { + "version": "1.0.4", + "from": "inflight@>=1.0.4 <2.0.0", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.4.tgz" + }, + "inherits": { + "version": "2.0.1", + "from": "inherits@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz" + }, + "isarray": { + "version": "0.0.1", + "from": "isarray@0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz" + }, + "isemail": { + "version": "1.2.0", + "from": "isemail@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/isemail/-/isemail-1.2.0.tgz" + }, + "joi": { + "version": "4.9.0", + "from": "joi@>=4.0.0 <5.0.0", + "resolved": "https://registry.npmjs.org/joi/-/joi-4.9.0.tgz" + }, + "joi-assert": { + "version": "0.0.3", + "from": "joi-assert@0.0.3", + "resolved": "https://registry.npmjs.org/joi-assert/-/joi-assert-0.0.3.tgz" + }, + "jsonparse": { + "version": "0.0.5", + "from": "jsonparse@0.0.5", + "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-0.0.5.tgz" + }, + "JSONStream": { + "version": "0.8.4", + "from": "JSONStream@>=0.8.4 <0.9.0", + "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-0.8.4.tgz" + }, + "lazy.js": { + "version": "0.4.2", + "from": "lazy.js@>=0.4.2 <0.5.0", + "resolved": "https://registry.npmjs.org/lazy.js/-/lazy.js-0.4.2.tgz" + }, + "manticore": { + "version": "0.2.4", + "from": "manticore@>=0.2.4 <0.3.0", + "resolved": "https://registry.npmjs.org/manticore/-/manticore-0.2.4.tgz", "dependencies": { "bluebird": { - "version": "2.10.1", - "from": "bluebird@>=2.10.1 <3.0.0", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-2.10.1.tgz" - }, - "definition-header": { - "version": "0.1.0", - "from": "definition-header@>=0.1.0 <0.2.0", - "resolved": "https://registry.npmjs.org/definition-header/-/definition-header-0.1.0.tgz", - "dependencies": { - "joi": { - "version": "4.9.0", - "from": "joi@>=4.0.0 <5.0.0", - "resolved": "https://registry.npmjs.org/joi/-/joi-4.9.0.tgz", - "dependencies": { - "hoek": { - "version": "2.16.3", - "from": "hoek@>=2.2.0 <3.0.0", - "resolved": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz" - }, - "topo": { - "version": "1.0.3", - "from": "topo@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/topo/-/topo-1.0.3.tgz" - }, - "isemail": { - "version": "1.2.0", - "from": "isemail@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/isemail/-/isemail-1.2.0.tgz" - }, - "moment": { - "version": "2.10.6", - "from": "moment@>=2.0.0 <3.0.0", - "resolved": "https://registry.npmjs.org/moment/-/moment-2.10.6.tgz" - } - } - }, - "joi-assert": { - "version": "0.0.3", - "from": "joi-assert@0.0.3", - "resolved": "https://registry.npmjs.org/joi-assert/-/joi-assert-0.0.3.tgz", - "dependencies": { - "assertion-error": { - "version": "1.0.1", - "from": "assertion-error@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.0.1.tgz" - } - } - }, - "parsimmon": { - "version": "0.5.1", - "from": "parsimmon@>=0.5.0 <0.6.0", - "resolved": "https://registry.npmjs.org/parsimmon/-/parsimmon-0.5.1.tgz", - "dependencies": { - "pjs": { - "version": "5.1.1", - "from": "pjs@>=5.0.0 <6.0.0", - "resolved": "https://registry.npmjs.org/pjs/-/pjs-5.1.1.tgz" - } - } - }, - "xregexp": { - "version": "2.0.0", - "from": "xregexp@>=2.0.0 <2.1.0", - "resolved": "https://registry.npmjs.org/xregexp/-/xregexp-2.0.0.tgz" - } - } - }, - "findup-sync": { - "version": "0.3.0", - "from": "findup-sync@>=0.3.0 <0.4.0", - "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-0.3.0.tgz" - }, - "git-wrapper": { - "version": "0.1.1", - "from": "git-wrapper@>=0.1.1 <0.2.0", - "resolved": "https://registry.npmjs.org/git-wrapper/-/git-wrapper-0.1.1.tgz" - }, - "glob": { - "version": "5.0.14", - "from": "glob@>=5.0.14 <6.0.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.14.tgz", - "dependencies": { - "inflight": { - "version": "1.0.4", - "from": "inflight@>=1.0.4 <2.0.0", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.4.tgz", - "dependencies": { - "wrappy": { - "version": "1.0.1", - "from": "wrappy@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.1.tgz" - } - } - }, - "inherits": { - "version": "2.0.1", - "from": "inherits@>=2.0.0 <3.0.0", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz" - }, - "minimatch": { - "version": "2.0.10", - "from": "minimatch@>=2.0.1 <3.0.0", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-2.0.10.tgz", - "dependencies": { - "brace-expansion": { - "version": "1.1.0", - "from": "brace-expansion@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.0.tgz", - "dependencies": { - "balanced-match": { - "version": "0.2.0", - "from": "balanced-match@>=0.2.0 <0.3.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.2.0.tgz" - }, - "concat-map": { - "version": "0.0.1", - "from": "concat-map@0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" - } - } - } - } - }, - "once": { - "version": "1.3.2", - "from": "once@>=1.3.0 <2.0.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.3.2.tgz", - "dependencies": { - "wrappy": { - "version": "1.0.1", - "from": "wrappy@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.1.tgz" - } - } - }, - "path-is-absolute": { - "version": "1.0.0", - "from": "path-is-absolute@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.0.tgz" - } - } - }, - "lazy.js": { - "version": "0.4.2", - "from": "lazy.js@>=0.4.2 <0.5.0", - "resolved": "https://registry.npmjs.org/lazy.js/-/lazy.js-0.4.2.tgz" - }, - "manticore": { - "version": "0.2.4", - "from": "manticore@>=0.2.4 <0.3.0", - "resolved": "https://registry.npmjs.org/manticore/-/manticore-0.2.4.tgz", - "dependencies": { - "JSONStream": { - "version": "0.8.4", - "from": "JSONStream@>=0.8.4 <0.9.0", - "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-0.8.4.tgz", - "dependencies": { - "jsonparse": { - "version": "0.0.5", - "from": "jsonparse@0.0.5", - "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-0.0.5.tgz" - }, - "through": { - "version": "2.3.8", - "from": "through@>=2.2.7 <3.0.0", - "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz" - } - } - }, - "bluebird": { - "version": "1.2.4", - "from": "bluebird@>=1.2.4 <2.0.0", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-1.2.4.tgz" - }, - "through2": { - "version": "0.5.1", - "from": "through2@>=0.5.1 <0.6.0", - "resolved": "https://registry.npmjs.org/through2/-/through2-0.5.1.tgz", - "dependencies": { - "readable-stream": { - "version": "1.0.33", - "from": "readable-stream@>=1.0.17 <1.1.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.33.tgz", - "dependencies": { - "core-util-is": { - "version": "1.0.1", - "from": "core-util-is@>=1.0.0 <1.1.0", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz" - }, - "isarray": { - "version": "0.0.1", - "from": "isarray@0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz" - }, - "string_decoder": { - "version": "0.10.31", - "from": "string_decoder@>=0.10.0 <0.11.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz" - }, - "inherits": { - "version": "2.0.1", - "from": "inherits@>=2.0.1 <2.1.0", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz" - } - } - }, - "xtend": { - "version": "3.0.0", - "from": "xtend@>=3.0.0 <3.1.0", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-3.0.0.tgz" - } - } - }, - "type-detect": { - "version": "0.1.2", - "from": "type-detect@>=0.1.2 <0.2.0", - "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-0.1.2.tgz" - } - } - }, - "optimist": { - "version": "0.6.1", - "from": "optimist@>=0.6.1 <0.7.0", - "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", - "dependencies": { - "wordwrap": { - "version": "0.0.3", - "from": "wordwrap@>=0.0.2 <0.1.0", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz" - }, - "minimist": { - "version": "0.0.10", - "from": "minimist@>=0.0.1 <0.1.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz" - } - } + "version": "1.2.4", + "from": "bluebird@>=1.2.4 <2.0.0", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-1.2.4.tgz" } } }, + "minimatch": { + "version": "3.0.0", + "from": "minimatch@>=2.0.0 <3.0.0||>=3.0.0 <4.0.0", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.0.tgz" + }, + "minimist": { + "version": "0.0.10", + "from": "minimist@>=0.0.1 <0.1.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz" + }, + "moment": { + "version": "2.10.6", + "from": "moment@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.10.6.tgz" + }, + "once": { + "version": "1.3.3", + "from": "once@>=1.3.0 <2.0.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.3.3.tgz" + }, + "optimist": { + "version": "0.6.1", + "from": "optimist@>=0.6.1 <0.7.0", + "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz" + }, + "parsimmon": { + "version": "0.5.1", + "from": "parsimmon@>=0.5.0 <0.6.0", + "resolved": "https://registry.npmjs.org/parsimmon/-/parsimmon-0.5.1.tgz" + }, + "path-is-absolute": { + "version": "1.0.0", + "from": "path-is-absolute@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.0.tgz" + }, + "pjs": { + "version": "5.1.1", + "from": "pjs@>=5.0.0 <6.0.0", + "resolved": "https://registry.npmjs.org/pjs/-/pjs-5.1.1.tgz" + }, + "readable-stream": { + "version": "1.0.33", + "from": "readable-stream@>=1.0.17 <1.1.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.33.tgz" + }, + "string_decoder": { + "version": "0.10.31", + "from": "string_decoder@>=0.10.0 <0.11.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz" + }, + "through": { + "version": "2.3.8", + "from": "through@>=2.2.7 <3.0.0", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz" + }, + "through2": { + "version": "0.5.1", + "from": "through2@>=0.5.1 <0.6.0", + "resolved": "https://registry.npmjs.org/through2/-/through2-0.5.1.tgz" + }, + "topo": { + "version": "1.1.0", + "from": "topo@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/topo/-/topo-1.1.0.tgz" + }, + "type-detect": { + "version": "0.1.2", + "from": "type-detect@>=0.1.2 <0.2.0", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-0.1.2.tgz" + }, "typescript": { - "version": "1.6.2", - "from": "typescript@1.6.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-1.6.2.tgz" + "version": "1.7.3", + "from": "typescript@1.7.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-1.7.3.tgz" + }, + "wordwrap": { + "version": "0.0.3", + "from": "wordwrap@>=0.0.2 <0.1.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz" + }, + "wrappy": { + "version": "1.0.1", + "from": "wrappy@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.1.tgz" + }, + "xregexp": { + "version": "2.0.0", + "from": "xregexp@>=2.0.0 <2.1.0", + "resolved": "https://registry.npmjs.org/xregexp/-/xregexp-2.0.0.tgz" + }, + "xtend": { + "version": "3.0.0", + "from": "xtend@>=3.0.0 <3.1.0", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-3.0.0.tgz" } } } diff --git a/openpgp/openpgp.d.ts b/openpgp/openpgp.d.ts index 0ae8445a2..309aea153 100644 --- a/openpgp/openpgp.d.ts +++ b/openpgp/openpgp.d.ts @@ -1,4 +1,4 @@ -// Type definitions for openpgpjs +// Type definitions for openpgpjs // Project: http://openpgpjs.org/ // Definitions by: Guillaume Lacasa // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -22,7 +22,7 @@ declare module openpgp { } interface Keyid { - bytes: String, + bytes: string, } interface Signature { @@ -31,7 +31,7 @@ declare module openpgp { } interface VerifiedMessage { - text: String, + text: string, signatures: Array } @@ -41,34 +41,34 @@ declare module openpgp { @param publicKeys array of keys to verify signatures @param msg the message object with signed and encrypted data */ - function decryptAndVerifyMessage(privateKey: key.Key, publicKeys: Array, msg: String): Promise; + function decryptAndVerifyMessage(privateKey: key.Key, publicKeys: Array, msg: string): Promise; /** Decrypts message and verifies signatures @param privateKey private key with decrypted secret key data @param publicKey single key to verify signatures @param msg the message object with signed and encrypted data */ - function decryptAndVerifyMessage(privateKey: key.Key, publicKey: key.Key, msg: String): Promise; + function decryptAndVerifyMessage(privateKey: key.Key, publicKey: key.Key, msg: string): Promise; /** Decrypts message @param privateKey private key with decrypted secret key data @param msg the message object with the encrypted data */ - function decryptMessage(privateKey: key.Key, msg: message.Message): Promise; + function decryptMessage(privateKey: key.Key, msg: message.Message): Promise; /** Encrypts message text with keys @param keys array of keys used to encrypt the message @param text message as native JavaScript string @returns encrypted ASCII armored message */ - function encryptMessage(keys: Array, message: string): Promise; + function encryptMessage(keys: Array, message: string): Promise; /** Encrypts message text with keys @param single key used to encrypt the message @param text message as native JavaScript string */ - function encryptMessage(key: key.Key, message: string): Promise; + function encryptMessage(key: key.Key, message: string): Promise; /** Generates a new OpenPGP key pair. Currently only supports RSA keys. Primary and subkey will be of same type. @param options @@ -81,27 +81,27 @@ declare module openpgp { @param privateKey private key with decrypted secret key data for signing @param text private key with decrypted secret key data for signing */ - function signAndEncryptMessage(publicKeys: Array, privateKey: key.Key, text: String): Promise; + function signAndEncryptMessage(publicKeys: Array, privateKey: key.Key, text: string): Promise; /** Signs message text and encrypts it @param publicKeys single key used to encrypt the message @param privateKey private key with decrypted secret key data for signing @param text private key with decrypted secret key data for signing */ - function signAndEncryptMessage(publicKey: key.Key, privateKey: key.Key, text: String): Promise; + function signAndEncryptMessage(publicKey: key.Key, privateKey: key.Key, text: string): Promise; /** Signs a cleartext message - + @param privateKeys array of keys with decrypted secret key data to sign cleartext @param text cleartext */ - function signClearMessage(privateKeys: Array, text: String): Promise; + function signClearMessage(privateKeys: Array, text: string): Promise; /** Signs a cleartext message - + @param privateKeys single key with decrypted secret key data to sign cleartext @param text cleartext */ - function signClearMessage(privateKey: key.Key, text: String): Promise; + function signClearMessage(privateKey: key.Key, text: string): Promise; /** Verifies signatures of cleartext signed message @@ -126,13 +126,13 @@ declare module openpgp.armor { @param partindex @param parttotal */ - function armor(messagetype: enums.armor, body: Object, partindex: Number, parttotal: Number): String; + function armor(messagetype: enums.armor, body: Object, partindex: number, parttotal: number): string; /** DeArmor an OpenPGP armored message; verify the checksum and return the encoded bytes @param text OpenPGP armored message */ - function dearmor(text: String): Object; + function dearmor(text: string): Object; } declare module openpgp.cleartext { @@ -142,7 +142,7 @@ declare module openpgp.cleartext { interface CleartextMessage { /** Returns ASCII armored text of cleartext signed message */ - armor(): String; + armor(): string; /** Returns the key IDs of the keys that signed the cleartext message */ @@ -150,7 +150,7 @@ declare module openpgp.cleartext { /** Get cleartext */ - getText(): String; + getText(): string; /** Sign the cleartext message @param privateKeys private keys with decrypted secret key data for signing @@ -163,41 +163,41 @@ declare module openpgp.cleartext { verify(keys: Array): Array; } - function readArmored(armoredText: String): CleartextMessage; + function readArmored(armoredText: string): CleartextMessage; } declare module openpgp.config { var prefer_hash_algorithm: enums.hash; var encryption_cipher: enums.symmetric; var compression: enums.compression; - var show_version: Boolean; - var show_comment: Boolean; - var integrity_protect: Boolean; - var keyserver: String; - var debug: Boolean; + var show_version: boolean; + var show_comment: boolean; + var integrity_protect: boolean; + var keyserver: string; + var debug: boolean; } declare module openpgp.crypto { interface Mpi { - data: Number, - read(input: String): Number, - write(): String, + data: number, + read(input: string): number, + write(): string, } /** Generating a session key for the specified symmetric algorithm @param algo Algorithm to use */ - function generateSessionKey(algo: enums.symmetric): String; + function generateSessionKey(algo: enums.symmetric): string; /** generate random byte prefix as string for the specified algorithm @param algo Algorithm to use */ - function getPrefixRandom(algo: enums.symmetric): String; + function getPrefixRandom(algo: enums.symmetric): string; /** Returns the number of integers comprising the private key of an algorithm @param algo The public key algorithm */ - function getPrivateMpiCount(algo: enums.symmetric): Number; + function getPrivateMpiCount(algo: enums.symmetric): number; /** Decrypts data using the specified public key multiprecision integers of the private key, the specified secretMPIs of the private key and the specified algorithm. @param algo Algorithm to be used @@ -222,8 +222,8 @@ declare module openpgp.crypto.cfb { @param ciphertext to be decrypted provided as a string @param resync a boolean value specifying if a resync of the IV should be used or not. The encrypteddatapacket uses the "old" style with a resync. Decryption within an encryptedintegrityprotecteddata packet is not resyncing the IV. */ - function decrypt(cipherfn: String, key: String, ciphertext: String, resync: Boolean): String; - + function decrypt(cipherfn: string, key: string, ciphertext: string, resync: boolean): string; + /** This function encrypts a given with the specified prefixrandom using the specified blockcipher to encrypt a message @param prefixrandom random bytes of block_size length provided as a string to be used in prefixing the data @param cipherfn the algorithm cipher class to encrypt data in one block_size encryption @@ -231,14 +231,14 @@ declare module openpgp.crypto.cfb { @param key binary string representation of key to be used to encrypt the plaintext. This will be passed to the cipherfn @param resync a boolean value specifying if a resync of the IV should be used or not. The encrypteddatapacket uses the "old" style with a resync. Encryption within an encryptedintegrityprotecteddata packet is not resyncing the IV. */ - function encrypt(prefixrandom: String, cipherfn: String, plaintext: String, key: String, resync: Boolean): String; - + function encrypt(prefixrandom: string, cipherfn: string, plaintext: string, key: string, resync: boolean): string; + /** Decrypts the prefixed data for the Modification Detection Code (MDC) computation @param cipherfn cipherfn.encrypt Cipher function to use @param key binary string representation of key to be used to check the mdc This will be passed to the cipherfn @param ciphertext The encrypted data */ - function mdc(cipherfn: Object, key: String, ciphertext: String): String; + function mdc(cipherfn: Object, key: string, ciphertext: string): string; } declare module openpgp.crypto.hash { @@ -246,35 +246,35 @@ declare module openpgp.crypto.hash { @param algo Hash algorithm type @param data Data to be hashed */ - function digest(algo: enums.hash, data: String): String; + function digest(algo: enums.hash, data: string): string; /** Returns the hash size in bytes of the specified hash algorithm type @param algo Hash algorithm type */ - function getHashByteLength(algo: enums.hash): Number; + function getHashByteLength(algo: enums.hash): number; } declare module openpgp.crypto.random { /** Create a secure random big integer of bits length @param bits Bit length of the MPI to create */ - function getRandomBigInteger(bits: Number): Number; - + function getRandomBigInteger(bits: number): number; + /** Retrieve secure random byte string of the specified length @param length Length in bytes to generate */ - function getRandomBytes(length: Number): String; - + function getRandomBytes(length: number): string; + /** Helper routine which calls platform specific crypto random generator - @param buf + @param buf */ function getRandomValues(buf: Uint8Array): void; - + /** Return a secure random number in the specified range @param from Min of the random number @param to Max of the random number (max 32bit) */ - function getSecureRandom(from: Number, to: Number): Number; + function getSecureRandom(from: number, to: number): number; } declare module openpgp.crypto.signature { @@ -285,16 +285,16 @@ declare module openpgp.crypto.signature { @param secretMPIs Private key multiprecision integers which is used to sign the data @param data Data to be signed */ - function sign(hash_algo: enums.hash, algo: enums.publicKey, publicMPIs: Array, secretMPIs: Array, data: String): Mpi; + function sign(hash_algo: enums.hash, algo: enums.publicKey, publicMPIs: Array, secretMPIs: Array, data: string): Mpi; - /** + /** @param algo public Key algorithm @param hash_algo Hash algorithm @param msg_MPIs Signature multiprecision integers @param publickey_MPIs Public key multiprecision integers @param data Data on where the signature was computed on */ - function verify(algo: enums.publicKey, hash_algo: enums.hash, msg_MPIs: Array, publickey_MPIs: Array, data: String): Boolean; + function verify(algo: enums.publicKey, hash_algo: enums.hash, msg_MPIs: Array, publickey_MPIs: Array, data: string): boolean; } declare module openpgp.enums { @@ -364,6 +364,14 @@ declare module openpgp.enums { aes256, twofish } + + enum keyStatus { + invalid, + expired, + revoked, + valid, + no_self_cert + } } declare module openpgp.key { @@ -376,8 +384,19 @@ declare module openpgp.key { /** Class that represents an OpenPGP key. Must contain a primary key. Can contain additional subkeys, signatures, user ids, user attributes. */ interface Key { - armor(): String, - decrypt(passphrase: String): Boolean, + armor(): string, + decrypt(passphrase: string): boolean; + getExpirationTime(): Date; + getKeyIds(): Array; + getPreferredHashAlgorithm(): string; + getPrimaryUser(): any; + getUserIds(): Array; + isPrivate(): boolean; + isPublic(): boolean; + primaryKey: packet.PublicKey; + toPublic(): Key; + update(key: Key): void; + verifyPrimaryKey(): enums.keyStatus; } /** Generates a new OpenPGP key. Currently only supports RSA keys. Primary and subkey will be of same type. @@ -390,7 +409,7 @@ declare module openpgp.key { @param armoredText text to be parsed */ - function readArmored(armoredText: String): KeyResult; + function readArmored(armoredText: string): KeyResult; } @@ -400,7 +419,7 @@ declare module openpgp.message { interface Message { /** Returns ASCII armored text of message */ - armor(): String, + armor(): string, /** Decrypt the message @param privateKey private key with decrypted secret data @@ -418,7 +437,7 @@ declare module openpgp.message { /** Get literal data that is the body of the message */ - getLiteralData(): String, + getLiteralData(): string, /** Returns the key IDs of the keys that signed the message */ @@ -426,7 +445,7 @@ declare module openpgp.message { /** Get literal data as text */ - getText(): String, + getText(): string, /** Sign the message (the literal data packet of the message) @param privateKey private keys with decrypted secret key data for signing @@ -446,22 +465,41 @@ declare module openpgp.message { /** creates new message object from binary data @param bytes */ - function fromBinary(bytes: String): Message; + function fromBinary(bytes: string): Message; /** creates new message object from text @param text */ - function fromText(text: String): Message; + function fromText(text: string): Message; /** reads an OpenPGP armored message and returns a message object @param armoredText text to be parsed */ - function readArmored(armoredText: String): Message; + function readArmored(armoredText: string): Message; } declare module openpgp.packet { + interface PublicKey { + algorithm: enums.publicKey; + created: Date; + fingerprint: string; + + getBitSize(): number; + getFingerprint(): string; + getKeyId(): string; + read(input: string): any; + write(): any; + } + + interface SecretKey extends PublicKey { + read(bytes:string): void; + write(): string; + clearPrivateMPIs(str_passphrase: string): boolean; + encrypt(passphrase:string): void; + } + /** Allocate a new packet from structured packet clone @param packetClone packet clone */ @@ -470,33 +508,33 @@ declare module openpgp.packet { /** Allocate a new packet @param property name from enums.packet */ - function newPacketFromTag(tag: String): Object; + function newPacketFromTag(tag: string): Object; } declare module openpgp.util { /** Convert an array of integers(0.255) to a string @param bin An array of (binary) integers to convert */ - function bin2str(bin: Array): String; + function bin2str(bin: Array): string; /** Calculates a 16bit sum of a string by adding each character codes modulus 65535 - @param text String to create a sum of + @param text string to create a sum of */ - function calc_checksum(text: String): Number; + function calc_checksum(text: string): number; /** Convert a string of utf8 bytes to a native javascript string @param utf8 A valid squence of utf8 bytes */ - function decode_utf8(utf8: String): String + function decode_utf8(utf8: string): string /** Convert a native javascript string to a string of utf8 bytes param str The string to convert */ - function encode_utf8(str: String): String + function encode_utf8(str: string): string /** Return the algorithm type as string */ - function get_hashAlgorithmString(): String + function get_hashAlgorithmString(): string /** Get native Web Cryptography api. The default configuration is to use the api when available. But it can also be deactivated with config.useWebCrypto */ @@ -505,48 +543,48 @@ declare module openpgp.util { /** Create binary string from a hex encoded string @param str Hex string to convert */ - function hex2bin(str: String): String; + function hex2bin(str: string): string; /** Creating a hex string from an binary array of integers (0..255) @param str Array of bytes to convert */ - function hexidump(str: String): String; + function hexidump(str: string): string; /** Create hexstring from a binary - @param str String to convert + @param str string to convert */ - function hexstrdump(str: String): String; - + function hexstrdump(str: string): string; + /** Helper function to print a debug message. Debug messages are only printed if - @param str String of the debug message + @param str string of the debug message */ - function print_debug(str: String): void; - + function print_debug(str: string): void; + /** Helper function to print a debug message. Debug messages are only printed if - @param str String of the debug message + @param str string of the debug message */ - function print_debug_hexstr_dump(str: String): void; - + function print_debug_hexstr_dump(str: string): void; + /** Shifting a string to n bits right @param value The string to shift @param bitcount Amount of bits to shift (MUST be smaller than 9) */ - function shiftRight(value: String, bitcount: Number): String; - + function shiftRight(value: string, bitcount: number): string; + /** Convert a string to an array of integers(0.255) - @param str String to convert + @param str string to convert */ - function str2bin(str: String): Array; - + function str2bin(str: string): Array; + /** Convert a string to a Uint8Array - @param str String to convert + @param str string to convert */ - function str2Uint8Array(str: String): Uint8Array; - + function str2Uint8Array(str: string): Uint8Array; + /** Convert a Uint8Array to a string. This currently functions the same as bin2str. @param bin An array of (binary) integers to convert */ - function Uint8Array2str(bin: Uint8Array): String; + function Uint8Array2str(bin: Uint8Array): string; -} \ No newline at end of file +} diff --git a/p2/p2-tests.ts b/p2/p2-tests.ts new file mode 100644 index 000000000..63c213321 --- /dev/null +++ b/p2/p2-tests.ts @@ -0,0 +1,45 @@ +/// + +// Create a physics world, where bodies and constraints live +var world = new p2.World({ + gravity:[0, -9.82] +}); + +// Create an empty dynamic body +var circleBody = new p2.Body({ + mass: 5, + position: [0, 10] +}); + +// Add a circle shape to the body. +var circleShape = new p2.Circle({ radius: 1 }); +circleBody.addShape(circleShape); + +// ...and add the body to the world. +// If we don't add it to the world, it won't be simulated. +world.addBody(circleBody); + +// Create an infinite ground plane. +var groundBody = new p2.Body({ + mass: 0 // Setting mass to 0 makes the body static +}); +var groundShape = new p2.Plane(); +groundBody.addShape(groundShape); +world.addBody(groundBody); + +// To get the trajectories of the bodies, +// we must step the world forward in time. +// This is done using a fixed time step size. +var timeStep = 1 / 60; // seconds + +// The "Game loop". Could be replaced by, for example, requestAnimationFrame. +setInterval(function(){ + + // The step method moves the bodies forward in time. + world.step(timeStep); + + // Print the circle position to console. + // Could be replaced by a render call. + console.log("Circle y position: " + circleBody.position[1]); + +}, 1000 * timeStep); diff --git a/p2/p2.d.ts b/p2/p2.d.ts new file mode 100644 index 000000000..a0e3f8b6a --- /dev/null +++ b/p2/p2.d.ts @@ -0,0 +1,1005 @@ +// Type definitions for p2.js v0.7.1 +// Project: https://github.com/schteppe/p2.js/ +// Definitions by: Clark Stevenson +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module p2 { + + export class AABB { + + constructor(options?: { + upperBound?: number[]; + lowerBound?: number[]; + }); + + setFromPoints(points: number[][], position: number[], angle: number, skinSize: number): void; + copy(aabb: AABB): void; + extend(aabb: AABB): void; + overlaps(aabb: AABB): boolean; + + } + + export class Broadphase { + + static AABB: number; + static BOUNDING_CIRCLE: number; + + static NAIVE: number; + static SAP: number; + + static boundingRadiusCheck(bodyA: Body, bodyB: Body): boolean; + static aabbCheck(bodyA: Body, bodyB: Body): boolean; + static canCollide(bodyA: Body, bodyB: Body): boolean; + + constructor(type: number); + + type: number; + result: Body[]; + world: World; + boundingVolumeType: number; + + setWorld(world: World): void; + getCollisionPairs(world: World): Body[]; + boundingVolumeCheck(bodyA: Body, bodyB: Body): boolean; + + } + + export class GridBroadphase extends Broadphase { + + constructor(options?: { + xmin?: number; + xmax?: number; + ymin?: number; + ymax?: number; + nx?: number; + ny?: number; + }); + + xmin: number; + xmax: number; + ymin: number; + ymax: number; + nx: number; + ny: number; + binsizeX: number; + binsizeY: number; + + } + + export class NativeBroadphase extends Broadphase { + + } + + export class Narrowphase { + + contactEquations: ContactEquation[]; + frictionEquations: FrictionEquation[]; + enableFriction: boolean; + enableEquations: boolean; + slipForce: number; + frictionCoefficient: number; + surfaceVelocity: number; + reuseObjects: boolean; + resuableContactEquations: any[]; + reusableFrictionEquations: any[]; + restitution: number; + stiffness: number; + relaxation: number; + frictionStiffness: number; + frictionRelaxation: number; + enableFrictionReduction: boolean; + contactSkinSize: number; + + collidedLastStep(bodyA: Body, bodyB: Body): boolean; + reset(): void; + createContactEquation(bodyA: Body, bodyB: Body, shapeA: Shape, shapeB: Shape): ContactEquation; + createFrictionFromContact(c: ContactEquation): FrictionEquation; + + } + + export class SAPBroadphase extends Broadphase { + + axisList: Body[]; + axisIndex: number; + + } + + export class Constraint { + + static DISTANCE: number; + static GEAR: number; + static LOCK: number; + static PRISMATIC: number; + static REVOLUTE: number; + + constructor(bodyA: Body, bodyB: Body, type: number, options?: { + collideConnected?: boolean; + wakeUpBodies?: boolean; + }); + + type: number; + equeations: Equation[]; + bodyA: Body; + bodyB: Body; + collideConnected: boolean; + + update(): void; + setStiffness(stiffness: number): void; + setRelaxation(relaxation: number): void; + + } + + export class DistanceConstraint extends Constraint { + + constructor(bodyA: Body, bodyB: Body, type: number, options?: { + collideConnected?: boolean; + wakeUpBodies?: boolean; + distance?: number; + localAnchorA?: number[]; + localAnchorB?: number[]; + maxForce?: number; + }); + + localAnchorA: number[]; + localAnchorB: number[]; + distance: number; + maxForce: number; + upperLimitEnabled: boolean; + upperLimit: number; + lowerLimitEnabled: boolean; + lowerLimit: number; + position: number; + + setMaxForce(f: number): void; + getMaxForce(): number; + + } + + export class GearConstraint extends Constraint { + + constructor(bodyA: Body, bodyB: Body, type: number, options?: { + collideConnected?: boolean; + wakeUpBodies?: boolean; + angle?: number; + ratio?: number; + maxTorque?: number; + }); + + ratio: number; + angle: number; + + setMaxTorque(torque: number): void; + getMaxTorque(): number; + + } + + export class LockConstraint extends Constraint { + + constructor(bodyA: Body, bodyB: Body, type: number, options?: { + collideConnected?: boolean; + wakeUpBodies?: boolean; + localOffsetB?: number[]; + localAngleB?: number; + maxForce?: number; + }); + + setMaxForce(force: number): void; + getMaxForce(): number; + + } + + export class PrismaticConstraint extends Constraint { + + constructor(bodyA: Body, bodyB: Body, type: number, options?: { + collideConnected?: boolean; + wakeUpBodies?: boolean; + maxForce?: number; + localAnchorA?: number[]; + localAnchorB?: number[]; + localAxisA?: number[]; + disableRotationalLock?: boolean; + upperLimit?: number; + lowerLimit?: number; + }); + + localAnchorA: number[]; + localAnchorB: number[]; + localAxisA: number[]; + position: number; + velocity: number; + lowerLimitEnabled: boolean; + upperLimitEnabled: boolean; + lowerLimit: number; + upperLimit: number; + upperLimitEquation: ContactEquation; + lowerLimitEquation: ContactEquation; + motorEquation: Equation; + motorEnabled: boolean; + motorSpeed: number; + + enableMotor(): void; + disableMotor(): void; + setLimits(lower: number, upper: number): void; + + } + + export class RevoluteConstraint extends Constraint { + + constructor(bodyA: Body, bodyB: Body, type: number, options?: { + collideConnected?: boolean; + wakeUpBodies?: boolean; + worldPivot?: number[]; + localPivotA?: number[]; + localPivotB?: number[]; + maxForce?: number; + }); + + pivotA: number[]; + pivotB: number[]; + motorEquation: RotationalVelocityEquation; + motorEnabled: boolean; + angle: number; + lowerLimitEnabled: boolean; + upperLimitEnabled: boolean; + lowerLimit: number; + upperLimit: number; + upperLimitEquation: ContactEquation; + lowerLimitEquation: ContactEquation; + + enableMotor(): void; + disableMotor(): void; + motorIsEnabled(): boolean; + setLimits(lower: number, upper: number): void; + setMotorSpeed(speed: number): void; + getMotorSpeed(): number; + + } + + export class AngleLockEquation extends Equation { + + constructor(bodyA: Body, bodyB: Body, options?: { + angle?: number; + ratio?: number; + }); + + computeGq(): number; + setRatio(ratio: number): number; + setMaxTorque(torque: number): number; + + } + + export class ContactEquation extends Equation { + + constructor(bodyA: Body, bodyB: Body); + + contactPointA: number[]; + penetrationVec: number[]; + contactPointB: number[]; + normalA: number[]; + restitution: number; + firstImpact: boolean; + shapeA: Shape; + shapeB: Shape; + + computeB(a: number, b: number, h: number): number; + + } + + export class Equation { + + static DEFAULT_STIFFNESS: number; + static DEFAULT_RELAXATION: number; + + constructor(bodyA: Body, bodyB: Body, minForce?: number, maxForce?: number); + + minForce: number; + maxForce: number; + bodyA: Body; + bodyB: Body; + stiffness: number; + relaxation: number; + G: number[]; + offset: number; + a: number; + b: number; + epsilon: number; + timeStep: number; + needsUpdate: boolean; + multiplier: number; + relativeVelocity: number; + enabled: boolean; + + gmult(G: number[], vi: number[], wi: number[], vj: number[], wj: number[]): number; + computeB(a: number, b: number, h: number): number; + computeGq(): number; + computeGW(): number; + computeGWlambda(): number; + computeGiMf(): number; + computeGiMGt(): number; + addToWlambda(deltalambda: number): number; + computeInvC(eps: number): number; + + } + + export class FrictionEquation extends Equation { + + constructor(bodyA: Body, bodyB: Body, slipForce: number); + + contactPointA: number[]; + contactPointB: number[]; + t: number[]; + shapeA: Shape; + shapeB: Shape; + frictionCoefficient: number; + + setSlipForce(slipForce: number): number; + getSlipForce(): number; + computeB(a: number, b: number, h: number): number; + + } + + export class RotationalLockEquation extends Equation { + + constructor(bodyA: Body, bodyB: Body, options?: { + angle?: number; + }); + + angle: number; + + computeGq(): number; + + } + + export class RotationalVelocityEquation extends Equation { + + constructor(bodyA: Body, bodyB: Body); + + computeB(a: number, b: number, h: number): number; + + } + + export class EventEmitter { + + on(type: string, listener: Function, context: any): EventEmitter; + has(type: string, listener: Function): boolean; + off(type: string, listener: Function): EventEmitter; + emit(event: any): EventEmitter; + + } + + export class ContactMaterialOptions { + + friction: number; + restitution: number; + stiffness: number; + relaxation: number; + frictionStiffness: number; + frictionRelaxation: number; + surfaceVelocity: number; + + } + + export class ContactMaterial { + + static idCounter: number; + + constructor(materialA: Material, materialB: Material, options?: ContactMaterialOptions); + + id: number; + materialA: Material; + materialB: Material; + friction: number; + restitution: number; + stiffness: number; + relaxation: number; + frictionStuffness: number; + frictionRelaxation: number; + surfaceVelocity: number; + contactSkinSize: number; + + } + + export class Material { + + static idCounter: number; + + constructor(id: number); + + id: number; + + } + + export class vec2 { + + static crossLength(a: number[], b: number[]): number; + static crossVZ(out: number[], vec: number[], zcomp: number): number; + static crossZV(out: number[], zcomp: number, vec: number[]): number; + static rotate(out: number[], a: number[], angle: number): void; + static rotate90cw(out: number[], a: number[]): number; + static centroid(out: number[], a: number[], b: number[], c: number[]): number[]; + static create(): number[]; + static clone(a: number[]): number[]; + static fromValues(x: number, y: number): number[]; + static copy(out: number[], a: number[]): number[]; + static set(out: number[], x: number, y: number): number[]; + static toLocalFrame(out: number[], worldPoint: number[], framePosition: number[], frameAngle: number): void; + static toGlobalFrame(out: number[], localPoint: number[], framePosition: number[], frameAngle: number): void; + static add(out: number[], a: number[], b: number[]): number[]; + static subtract(out: number[], a: number[], b: number[]): number[]; + static sub(out: number[], a: number[], b: number[]): number[]; + static multiply(out: number[], a: number[], b: number[]): number[]; + static mul(out: number[], a: number[], b: number[]): number[]; + static divide(out: number[], a: number[], b: number[]): number[]; + static div(out: number[], a: number[], b: number[]): number[]; + static scale(out: number[], a: number[], b: number): number[]; + static distance(a: number[], b: number[]): number; + static dist(a: number[], b: number[]): number; + static squaredDistance(a: number[], b: number[]): number; + static sqrDist(a: number[], b: number[]): number; + static length(a: number[]): number; + static len(a: number[]): number; + static squaredLength(a: number[]): number; + static sqrLen(a: number[]): number; + static negate(out: number[], a: number[]): number[]; + static normalize(out: number[], a: number[]): number[]; + static dot(a: number[], b: number[]): number; + static str(a: number[]): string; + + } + + export interface BodyOptions { + + mass?: number; + position?: number[]; + velocity?: number[]; + angle?: number; + angularVelocity?: number; + force?: number[]; + angularForce?: number; + fixedRotation?: boolean; + + } + + export class Body extends EventEmitter { + + sleepyEvent: { + type: string; + }; + + sleepEvent: { + type: string; + }; + + wakeUpEvent: { + type: string; + }; + + static DYNAMIC: number; + static STATIC: number; + static KINEMATIC: number; + static AWAKE: number; + static SLEEPY: number; + static SLEEPING: number; + + constructor(options?: BodyOptions); + + id: number; + world: World; + shapes: Shape[]; + mass: number; + invMass: number; + inertia: number; + invInertia: number; + invMassSolve: number; + invInertiaSolve: number; + fixedRotation: number; + position: number[]; + interpolatedPosition: number[]; + interpolatedAngle: number; + previousPosition: number[]; + previousAngle: number; + velocity: number[]; + vlambda: number[]; + wlambda: number[]; + angle: number; + angularVelocity: number; + force: number[]; + angularForce: number; + damping: number; + angularDamping: number; + type: number; + boundingRadius: number; + aabb: AABB; + aabbNeedsUpdate: boolean; + allowSleep: boolean; + wantsToSleep: boolean; + sleepState: number; + sleepSpeedLimit: number; + sleepTimeLimit: number; + gravityScale: number; + collisionResponse: boolean; + + updateSolveMassProperties(): void; + setDensity(density: number): void; + getArea(): number; + getAABB(): AABB; + updateAABB(): void; + updateBoundingRadius(): void; + addShape(shape: Shape, offset?: number[], angle?: number): void; + removeShape(shape: Shape): boolean; + updateMassProperties(): void; + applyForce(force: number[], worldPoint: number[]): void; + toLocalFrame(out: number[], worldPoint: number[]): void; + toWorldFrame(out: number[], localPoint: number[]): void; + fromPolygon(path: number[][], options?: { + optimalDecomp?: boolean; + skipSimpleCheck?: boolean; + removeCollinearPoints?: any; //boolean | number + }): boolean; + adjustCenterOfMass(): void; + setZeroForce(): void; + resetConstraintVelocity(): void; + applyDamping(dy: number): void; + wakeUp(): void; + sleep(): void; + sleepTick(time: number, dontSleep: boolean, dt: number): void; + getVelocityFromPosition(story: number[], dt: number): number[]; + getAngularVelocityFromPosition(timeStep: number): number; + overlaps(body: Body): boolean; + + } + + export class Spring { + + constructor(bodyA: Body, bodyB: Body, options?: { + + stiffness?: number; + damping?: number; + localAnchorA?: number[]; + localAnchorB?: number[]; + worldAnchorA?: number[]; + worldAnchorB?: number[]; + + }); + + stiffness: number; + damping: number; + bodyA: Body; + bodyB: Body; + + applyForce(): void; + + } + + export class LinearSpring extends Spring { + + localAnchorA: number[]; + localAnchorB: number[]; + restLength: number; + + setWorldAnchorA(worldAnchorA: number[]): void; + setWorldAnchorB(worldAnchorB: number[]): void; + getWorldAnchorA(result: number[]): number[]; + getWorldAnchorB(result: number[]): number[]; + applyForce(): void; + + } + + export class RotationalSpring extends Spring { + + constructor(bodyA: Body, bodyB: Body, options?: { + restAngle?: number; + stiffness?: number; + damping?: number; + }); + + restAngle: number; + + } + + export interface CapsuleOptions extends SharedShapeOptions { + + length?: number; + radius?: number; + + } + + export class Capsule extends Shape { + + constructor(options?: CapsuleOptions); + + length: number; + radius: number; + + } + + export interface CircleOptions extends SharedShapeOptions { + + radius?: number; + + } + + export class Circle extends Shape { + + constructor(options?: CircleOptions); + + radius: number; + + } + + export interface ConvexOptions extends SharedShapeOptions { + + length?: number; + radius?: number; + + } + + export class Convex extends Shape { + + static triangleArea(a: number[], b: number[], c: number[]): number; + + constructor(options?: ConvexOptions); + + vertices: number[][]; + axes: number[]; + centerOfMass: number[]; + triangles: number[]; + boundingRadius: number; + + projectOntoLocalAxis(localAxis: number[], result: number[]): void; + projectOntoWorldAxis(localAxis: number[], shapeOffset: number[], shapeAngle: number, result: number[]): void; + + updateCenterOfMass(): void; + + } + + export interface HeightfieldOptions extends SharedShapeOptions { + + heights?: number[]; + minValue?: number; + maxValue?: number; + elementWidth?: number; + + } + + export class Heightfield extends Shape { + + constructor(options?: HeightfieldOptions); + + data: number[]; + maxValue: number; + minValue: number; + elementWidth: number; + + } + + export interface SharedShapeOptions { + + position?: number[]; + angle?: number; + collisionGroup?: number; + collisionResponse?: boolean; + collisionMask?: number; + sensor?: boolean; + + } + + export interface ShapeOptions extends SharedShapeOptions { + + type?: number; + + } + + export class Shape { + + static idCounter: number; + static CIRCLE: number; + static PARTICLE: number; + static PLANE: number; + static CONVEX: number; + static LINE: number; + static BOX: number; + static CAPSULE: number; + static HEIGHTFIELD: number; + + constructor(options?: ShapeOptions); + + type: number; + id: number; + position: number[]; + angle: number; + boundingRadius: number; + collisionGroup: number; + collisionResponse: boolean; + collisionMask: number; + material: Material; + area: number; + sensor: boolean; + + computeMomentOfInertia(mass: number): number; + updateBoundingRadius(): number; + updateArea(): void; + computeAABB(out: AABB, position: number[], angle: number): void; + + } + + export interface LineOptions extends SharedShapeOptions { + + length?: number; + + } + + export class Line extends Shape { + + constructor(options?: LineOptions); + + length: number; + + } + + export class Particle extends Shape { + + constructor(options?: SharedShapeOptions); + + } + + export class Plane extends Shape { + + constructor(options?: SharedShapeOptions); + + } + + export interface BoxOptions { + + width?: number; + height?: number; + + } + + export class Box extends Shape { + + constructor(options?: BoxOptions); + + width: number; + height: number; + + } + + export class Solver extends EventEmitter { + + static GS: number; + static ISLAND: number; + + constructor(options?: {}, type?: number); + + type: number; + equations: Equation[]; + equationSortFunction: Equation; //Equation | boolean + + solve(dy: number, world: World): void; + solveIsland(dy: number, island: Island): void; + sortEquations(): void; + addEquation(eq: Equation): void; + addEquations(eqs: Equation[]): void; + removeEquation(eq: Equation): void; + removeAllEquations(): void; + + } + + export class GSSolver extends Solver { + + constructor(options?: { + iterations?: number; + tolerance?: number; + }); + + iterations: number; + tolerance: number; + useZeroRHS: boolean; + frictionIterations: number; + usedIterations: number; + + solve(h: number, world: World): void; + + } + + export class OverlapKeeper { + + constructor(bodyA: Body, shapeA: Shape, bodyB: Body, shapeB: Shape); + + shapeA: Shape; + shapeB: Shape; + bodyA: Body; + bodyB: Body; + + tick(): void; + setOverlapping(bodyA: Body, shapeA: Shape, bodyB: Body, shapeB: Body): void; + bodiesAreOverlapping(bodyA: Body, bodyB: Body): boolean; + set(bodyA: Body, shapeA: Shape, bodyB: Body, shapeB: Shape): void; + + } + + export class TupleDictionary { + + data: number[]; + keys: number[]; + + getKey(id1: number, id2: number): string; + getByKey(key: number): number; + get(i: number, j: number): number; + set(i: number, j: number, value: number): number; + reset(): void; + copy(dict: TupleDictionary): void; + + } + + export class Utils { + + static appendArray(a: Array, b: Array): Array; + static splice(array: Array, index: number, howMany: number): void; + static extend(a: any, b: any): void; + static defaults(options: any, defaults: any): any; + + } + + export class Island { + + equations: Equation[]; + bodies: Body[]; + + reset(): void; + getBodies(result: any): Body[]; + wantsToSleep(): boolean; + sleep(): boolean; + + } + + export class IslandManager extends Solver { + + static getUnvisitedNode(nodes: IslandNode[]): IslandNode; // IslandNode | boolean + + equations: Equation[]; + islands: Island[]; + nodes: IslandNode[]; + + visit(node: IslandNode, bds: Body[], eqs: Equation[]): void; + bfs(root: IslandNode, bds: Body[], eqs: Equation[]): void; + split(world: World): Island[]; + + } + + export class IslandNode { + + constructor(body: Body); + + body: Body; + neighbors: IslandNode[]; + equations: Equation[]; + visited: boolean; + + reset(): void; + + } + + export class World extends EventEmitter { + + postStepEvent: { + type: string; + }; + + addBodyEvent: { + type: string; + }; + + removeBodyEvent: { + type: string; + }; + + addSpringEvent: { + type: string; + }; + + impactEvent: { + type: string; + bodyA: Body; + bodyB: Body; + shapeA: Shape; + shapeB: Shape; + contactEquation: ContactEquation; + }; + + postBroadphaseEvent: { + type: string; + pairs: Body[]; + }; + + beginContactEvent: { + type: string; + shapeA: Shape; + shapeB: Shape; + bodyA: Body; + bodyB: Body; + contactEquations: ContactEquation[]; + }; + + endContactEvent: { + type: string; + shapeA: Shape; + shapeB: Shape; + bodyA: Body; + bodyB: Body; + }; + + preSolveEvent: { + type: string; + contactEquations: ContactEquation[]; + frictionEquations: FrictionEquation[]; + }; + + static NO_SLEEPING: number; + static BODY_SLEEPING: number; + static ISLAND_SLEEPING: number; + + static integrateBody(body: Body, dy: number): void; + + constructor(options?: { + solver?: Solver; + gravity?: number[]; + broadphase?: Broadphase; + islandSplit?: boolean; + doProfiling?: boolean; + }); + + springs: Spring[]; + bodies: Body[]; + solver: Solver; + narrowphase: Narrowphase; + islandManager: IslandManager; + gravity: number[]; + frictionGravity: number; + useWorldGravityAsFrictionGravity: boolean; + useFrictionGravityOnZeroGravity: boolean; + doProfiling: boolean; + lastStepTime: number; + broadphase: Broadphase; + constraints: Constraint[]; + defaultMaterial: Material; + defaultContactMaterial: ContactMaterial; + lastTimeStep: number; + applySpringForces: boolean; + applyDamping: boolean; + applyGravity: boolean; + solveConstraints: boolean; + contactMaterials: ContactMaterial[]; + time: number; + stepping: boolean; + islandSplit: boolean; + emitImpactEvent: boolean; + sleepMode: number; + + addConstraint(c: Constraint): void; + addContactMaterial(contactMaterial: ContactMaterial): void; + removeContactMaterial(cm: ContactMaterial): void; + getContactMaterial(materialA: Material, materialB: Material): ContactMaterial; // ContactMaterial | boolean + removeConstraint(c: Constraint): void; + step(dy: number, timeSinceLastCalled?: number, maxSubSteps?: number): void; + runNarrowphase(np: Narrowphase, bi: Body, si: Shape, xi: any[], ai: number, bj: Body, sj: Shape, xj: any[], aj: number, cm: number, glen: number): void; + addSpring(s: Spring): void; + removeSpring(s: Spring): void; + addBody(body: Body): void; + removeBody(body: Body): void; + getBodyByID(id: number): Body; //Body | boolean + disableBodyCollision(bodyA: Body, bodyB: Body): void; + enableBodyCollision(bodyA: Body, bodyB: Body): void; + clear(): void; + clone(): World; + hitTest(worldPoint: number[], bodies: Body[], precision: number): Body[]; + setGlobalEquationParameters(parameters: { + relaxation?: number; + stiffness?: number; + }): void; + setGlobalStiffness(stiffness: number): void; + setGlobalRelaxation(relaxation: number): void; + } + +} diff --git a/package.json b/package.json index 2b9d019f8..52cc5b719 100644 --- a/package.json +++ b/package.json @@ -20,22 +20,22 @@ "node": ">= 0.12.0" }, "scripts": { - "test": "./node_modules/.bin/dt --changes", - "changes": "./node_modules/.bin/dt --changes", - "lint": "./node_modules/.bin/dt --lint", - "tscparams": "./node_modules/.bin/dt --tscparams --no-tests --no-headers", - "all": "./node_modules/.bin/dt", - "dry": "./node_modules/.bin/dt --dry --changes", - "list": "./node_modules/.bin/dt --dry --print-files --print-refmap", - "last": "./node_modules/.bin/dt --dry --print-files --print-refmap --changes", - "files": "./node_modules/.bin/dt --dry --print-files", - "refmap": "./node_modules/.bin/dt --dry --print-refmap", - "help": "./node_modules/.bin/dt -h" + "test": "dt --changes", + "changes": "dt --changes", + "lint": "dt --lint", + "tscparams": "dt --tscparams --no-tests --no-headers", + "all": "dt", + "dry": "dt --dry --changes", + "list": "dt --dry --print-files --print-refmap", + "last": "dt --dry --print-files --print-refmap --changes", + "files": "dt --dry --print-files", + "refmap": "dt --dry --print-refmap", + "help": "dt -h" }, "dependencies": { }, "devDependencies": { "definition-tester": "0.3.0", - "typescript": "1.6.2" + "typescript": "1.7.3" } } diff --git a/pako/pako-tests.ts b/pako/pako-tests.ts new file mode 100644 index 000000000..b364d971f --- /dev/null +++ b/pako/pako-tests.ts @@ -0,0 +1,17 @@ +/// + +import pako = require("pako"); + +var chunk1 = new Uint8Array([1,2,3,4,5,6,7,8,9]) +var chunk2 = new Uint8Array([10,11,12,13,14,15,16,17,18,19]); + +var deflate = new pako.Deflate({ level: 3}); + +deflate.push(chunk1, false); +deflate.push(chunk2, true); // true -> last chunk + +if (deflate.err) { + throw new Error( deflate.err.toString() ); +} + +console.log(deflate.result); \ No newline at end of file diff --git a/pako/pako.d.ts b/pako/pako.d.ts new file mode 100644 index 000000000..1b86f81fa --- /dev/null +++ b/pako/pako.d.ts @@ -0,0 +1,63 @@ +// Type definitions for pako 0.2.8 +// Project: https://github.com/nodeca/pako +// Definitions by: Denis Cappellin +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module Pako { + + /** + * Compress data with deflate algorithm and options. + */ + export function deflate( data: Uint8Array | Array | string, options?: any ): string; + /** + * The same as deflate, but creates raw data, without wrapper (header and adler32 crc). + */ + export function deflateRaw( data: Uint8Array | Array | string, options?: any ): string; + /** + * The same as deflate, but create gzip wrapper instead of deflate one. + */ + export function gzip( data: Uint8Array | Array | string, options?: any ): string; + /** + * Decompress data with inflate/ungzip and options. Autodetect format via wrapper header + * by default. That's why we don't provide separate ungzip method. + */ + export function inflate( data: Uint8Array | Array | string, options?: any ): Uint8Array; + export function inflate( data: Uint8Array | Array | string, options?: any ): Array; + export function inflate( data: Uint8Array | Array | string, options?: any ): String; + /** + * The same as inflate, but creates raw data, without wrapper (header and adler32 crc). + */ + export function inflateRaw( data: Uint8Array | Array | string, options?: any ): Uint8Array; + export function inflateRaw( data: Uint8Array | Array | string, options?: any ): Array; + export function inflateRaw( data: Uint8Array | Array | string, options?: any ): string; + /** + * Just shortcut to inflate, because it autodetects format by header.content. Done for convenience. + */ + export function ungzip( data: Uint8Array | Array | string, options?: any ): Uint8Array; + export function ungzip( data: Uint8Array | Array | string, options?: any ): Array; + export function ungzip( data: Uint8Array | Array | string, options?: any ): string; + + export class Deflate { + constructor( options?: any ); + err: number; + msg: string; + result: Uint8Array | Array; + onData( chunk: Uint8Array | Array | string ): void; + onEnd( status: number ): void; + push( data: Uint8Array | Array | ArrayBuffer | string, mode?: number | boolean ): boolean; + } + + export class Inflate { + constructor( options?: any ); + err: number; + msg: string; + result: Uint8Array | Array | string; + onData( chunk: Uint8Array | Array | string ): void; + onEnd( status: number ): void; + push( data: Uint8Array | Array | ArrayBuffer | string, mode?: number | boolean ): boolean; + } +} + +declare module 'pako' { + export = Pako; +} diff --git a/path-to-regexp/path-to-regexp.d.ts b/path-to-regexp/path-to-regexp.d.ts index 1cea46d85..f8c90c99e 100644 --- a/path-to-regexp/path-to-regexp.d.ts +++ b/path-to-regexp/path-to-regexp.d.ts @@ -5,7 +5,7 @@ declare module "path-to-regexp" { - function pathToRegexp(path: string, keys: string[], options?: pathToRegexp.Options): RegExp; + function pathToRegexp(path: string, keys?: string[], options?: pathToRegexp.Options): RegExp; module pathToRegexp { @@ -14,7 +14,9 @@ declare module "path-to-regexp" { strict?: boolean; end?: boolean; } + } export = pathToRegexp; + } diff --git a/pdf/pdf.d.ts b/pdf/pdf.d.ts index 523cfc5e8..8cac3a81c 100644 --- a/pdf/pdf.d.ts +++ b/pdf/pdf.d.ts @@ -306,11 +306,123 @@ interface PDFJSStatic { **/ maxImageSize: number; + /** + * The url of where the predefined Adobe CMaps are located. Include trailing + * slash. + */ + cMapUrl: string; + + /** + * Specifies if CMaps are binary packed. + */ + cMapPacked: boolean; + /** * By default fonts are converted to OpenType fonts and loaded via font face rules. If disabled, the font will be rendered using a built in font renderer that constructs the glyphs with primitive path commands. **/ disableFontFace: boolean; + /** + * Path for image resources, mainly for annotation icons. Include trailing + * slash. + */ + imageResourcesPath: string; + + /** + * Disable the web worker and run all code on the main thread. This will happen + * automatically if the browser doesn't support workers or sending typed arrays + * to workers. + */ + disableWorker: boolean; + + /** + * Path and filename of the worker file. Required when the worker is enabled in + * development mode. If unspecified in the production build, the worker will be + * loaded based on the location of the pdf.js file. + */ + workerSrc: string; + + /** + * Disable range request loading of PDF files. When enabled and if the server + * supports partial content requests then the PDF will be fetched in chunks. + * Enabled (false) by default. + */ + disableRange: boolean; + + /** + * Disable streaming of PDF file data. By default PDF.js attempts to load PDF + * in chunks. This default behavior can be disabled. + */ + disableStream: boolean; + + /** + * Disable pre-fetching of PDF file data. When range requests are enabled PDF.js + * will automatically keep fetching more data even if it isn't needed to display + * the current page. This default behavior can be disabled. + * + * NOTE: It is also necessary to disable streaming, see above, + * in order for disabling of pre-fetching to work correctly. + */ + disableAutoFetch: boolean; + + /** + * Enables special hooks for debugging PDF.js. + */ + pdfBug: boolean; + + /** + * Enables transfer usage in postMessage for ArrayBuffers. + */ + postMessageTransfers: boolean; + + /** + * Disables URL.createObjectURL usage. + */ + disableCreateObjectURL: boolean; + + /** + * Disables WebGL usage. + */ + disableWebGL: boolean; + + /** + * Disables fullscreen support, and by extension Presentation Mode, + * in browsers which support the fullscreen API. + */ + disableFullscreen: boolean; + + /** + * Enables CSS only zooming. + */ + useOnlyCssZoom: boolean; + + /** + * Controls the logging level. + * The constants from PDFJS.VERBOSITY_LEVELS should be used: + * - errors + * - warnings [default] + * - infos + */ + verbosity: number; + + /** + * The maximum supported canvas size in total pixels e.g. width * height. + * The default value is 4096 * 4096. Use -1 for no limit. + */ + maxCanvasPixels: number; + + /** + * Opens external links in a new window if enabled. The default behavior opens + * external links in the PDF.js window. + */ + openExternalLinksInNewWindow: boolean; + + /** + * Determines if we can eval strings as JS. Primarily used to improve + * performance for font rendering. + */ + isEvalSupported: boolean; + /** * This is the main entry point for loading a PDF and interacting with it. * NOTE: If a URL is used to fetch the PDF data a standard XMLHttpRequest(XHR) diff --git a/pegjs/pegjs.d.ts b/pegjs/pegjs.d.ts index c42b9aae5..1e8bfc6ad 100644 --- a/pegjs/pegjs.d.ts +++ b/pegjs/pegjs.d.ts @@ -6,11 +6,22 @@ declare module PEG { function parse(input:string):any; - class SyntaxError { - line:number; - column:number; - offset:number; + interface Location { + line: number; + column: number; + offset: number; + } + interface LocationRange { + start: Location, + end: Location + } + + class SyntaxError { + line: number; + column: number; + offset: number; + location: LocationRange; expected:any[]; found:any; name:string; diff --git a/phonegap-plugin-push/phonegap-plugin-push-tests.ts b/phonegap-plugin-push/phonegap-plugin-push-tests.ts index 916a6cf82..339c7e8e1 100644 --- a/phonegap-plugin-push/phonegap-plugin-push-tests.ts +++ b/phonegap-plugin-push/phonegap-plugin-push-tests.ts @@ -1,26 +1,39 @@ /// function test() { - var options:PhonegapPluginPush.InitOptions = { + let options: PhonegapPluginPush.InitOptions = { android: { senderID: '123456789', icon: 'phonegap', iconColor: 'blue', sound: true, vibrate: true, - clearNotifications: false + clearNotifications: false, + forceShow: true }, ios: { badge: true, sound: true, - alert: true + alert: true, + clearBadge: true }, windows: {} }; - var push:PhonegapPluginPush.PushNotification; + + let iosStringOptions = { + badge: 'true', + sound: 'true', + alert: 'true', + clearBadge: 'true' + }; + + options.ios = iosStringOptions; + + let push: PhonegapPluginPush.PushNotification; /*from constructor*/ push = new PushNotification(options); + push = new window.PushNotification(options); push.unregister(() => { console.log('did unregister'); @@ -30,12 +43,13 @@ function test() { /*from init*/ push = PushNotification.init(options); + push = window.PushNotification.init(options); - push.on('registration', (data:PhonegapPluginPush.RegistrationEventResponse) => { + let registrationHandler = (data: PhonegapPluginPush.RegistrationEventResponse) => { console.log(data.registrationId); - }); + }; - push.on('notification', (data:PhonegapPluginPush.NotificationEventResponse) => { + let notificationHandler = (data: PhonegapPluginPush.NotificationEventResponse) => { console.log(data.message); console.log(data.title); console.log(data.count); @@ -45,15 +59,35 @@ function test() { /*the rest of the additional fields are not 'canon'*/ console.log(data.additionalData); console.log(data.additionalData.foreground); - }); - push.on('error', (e:Error) => { + push.finish(() => { + console.log('did finish'); + }, () => { + console.log('did not finish'); + }); + }; + + let errorHandler = (e: Error) => { console.log(e.message); - }); + }; + + push.on('registration', registrationHandler); + push.on('notification', notificationHandler); + push.on('error', errorHandler); + + push.off('registration', registrationHandler); + push.off('notification', notificationHandler); + push.off('error', errorHandler); push.setApplicationIconBadgeNumber(() => { console.log('did setApplicationIconBadgeNumber'); }, () => { console.log('did not setApplicationIconBadgeNumber'); }, 1); + + push.getApplicationIconBadgeNumber((count: number) => { + console.log('did getApplicationIconBadgeNumber', count); + }, () => { + console.log('did not getApplicationIconBadgeNumber'); + }); } diff --git a/phonegap-plugin-push/phonegap-plugin-push.d.ts b/phonegap-plugin-push/phonegap-plugin-push.d.ts index e9168a642..a8807cc34 100644 --- a/phonegap-plugin-push/phonegap-plugin-push.d.ts +++ b/phonegap-plugin-push/phonegap-plugin-push.d.ts @@ -12,43 +12,77 @@ declare module PhonegapPluginPush { * @param event * @param callback */ - on(event:"registration", callback:(response:RegistrationEventResponse)=>any):void + on(event: "registration", callback: (response: RegistrationEventResponse) => any): void /** * The event notification will be triggered each time a push notification is received by a 3rd party push service on the device. * @param event * @param callback */ - on(event:"notification", callback:(response:NotificationEventResponse)=>any):void + on(event: "notification", callback: (response: NotificationEventResponse) => any): void /** * The event error will trigger when an internal error occurs and the cache is aborted. * @param event * @param callback */ - on(event:"error", callback:(response:Error)=>any):void - /*Generic one, needed for the overloads*/ + on(event: "error", callback: (response: Error) => any): void /** * * @param event Name of the event to listen to. See below(above) for all the event names. * @param callback is called when the event is triggered. + * @param event + * @param callback */ - on(event:string, callback:(response:EventResponse)=>any):void + on(event: string, callback: (response: EventResponse) => any): void + + off(event: "registration", callback: (response: RegistrationEventResponse) => any): void + off(event: "notification", callback: (response: NotificationEventResponse) => any): void + off(event: "error", callback: (response: Error) => any): void + /** + * As stated in the example, you will have to store your event handler if you are planning to remove it. + * @param event Name of the event type. The possible event names are the same as for the push.on function. + * @param callback handle to the function to get removed. + * @param event + * @param callback + */ + off(event: string, callback: (response: EventResponse) => any): void /** * The unregister method is used when the application no longer wants to receive push notifications. + * Beware that this cleans up all event handlers previously registered, + * so you will need to re-register them if you want them to function again without an application reload. * @param successHandler * @param errorHandler */ - unregister(successHandler:()=>any, errorHandler?:()=>any):void + unregister(successHandler: () => any, errorHandler?: () => any): 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...)*/ /** * Set the badge count visible when the app is not running * - * The count is an integer indicating what number should show up in the badge. Passing 0 will clear the badge. Each notification event contains a data.count value which can be used to set the badge to correct number. + * The count is an integer indicating what number should show up in the badge. + * Passing 0 will clear the badge. + * Each notification event contains a data.count value which can be used to set the badge to correct number. * @param successHandler * @param errorHandler * @param count */ - setApplicationIconBadgeNumber(successHandler:()=>any, errorHandler:()=>any, count:number):void + setApplicationIconBadgeNumber(successHandler: () => any, errorHandler: () => any, count: number): void + /** + * Get the current badge count visible when the app is not running + * successHandler gets called with an integer which is the current badge count + * @param successHandler + * @param errorHandler + */ + getApplicationIconBadgeNumber(successHandler: (count: number) => any, errorHandler: () => any): void + + /** + * iOS only + * Tells the OS that you are done processing a background push notification. + * successHandler gets called when background push processing is successfully completed. + * @param successHandler + * @param errorHandler + */ + finish(successHandler: () => any, errorHandler: () => any): void } /** @@ -62,28 +96,32 @@ declare module PhonegapPluginPush { /** * Maps to the project number in the Google Developer Console. */ - senderID:string + senderID: string /** - * The name of a drawable resource to use as the small-icon. + * The name of a drawable resource to use as the small-icon. The name should not include the extension. */ - icon?:string + icon?: string /** - * Sets the background color of the small icon. + * Sets the background color of the small icon on Android 5.0 and greater. * Supported Formats - http://developer.android.com/reference/android/graphics/Color.html#parseColor(java.lang.String) */ - iconColor?:string + iconColor?: string /** * If true it plays the sound specified in the push data or the default system sound. Default is true. */ - sound?:boolean + sound?: boolean /** * If true the device vibrates on receipt of notification. Default is true. */ - vibrate?:boolean + vibrate?: boolean /** * If true the app clears all pending notifications when it is closed. Default is true. */ - clearNotifications?:boolean + clearNotifications?: boolean + /** + * If true will always show a notification, even when the app is on the foreground. Default is false. + */ + forceShow?: boolean } /** @@ -91,17 +129,33 @@ declare module PhonegapPluginPush { */ ios?: { /** - * If true the device shows an alert on receipt of notification. Default is false. + * If true|"true" the device sets the badge number on receipt of notification. + * Default is false|"false". + * Note: the value you set this option to the first time you call the init method will be how the application always acts. + * Once this is set programmatically in the init method it can only be changed manually by the user in Settings>Notifications>App Name. + * This is normal iOS behaviour. */ - badge?: boolean + badge?: boolean | string /** - * If true the device sets the badge number on receipt of notification. Default is false. + * If true|"true" the device plays a sound on receipt of notification. + * Default is false|"false". + * Note: the value you set this option to the first time you call the init method will be how the application always acts. + * Once this is set programmatically in the init method it can only be changed manually by the user in Settings>Notifications>App Name. + * This is normal iOS behaviour. */ - sound?: boolean + sound?: boolean | string /** - * If true the device plays a sound on receipt of notification. Default is false. + * If true|"true" the device shows an alert on receipt of notification. + * Default is false|"false". + * Note: the value you set this option to the first time you call the init method will be how the application always acts. + * Once this is set programmatically in the init method it can only be changed manually by the user in Settings>Notifications>App Name. + * This is normal iOS behaviour. */ - alert?: boolean + alert?: boolean | string + /** + * If true|"true" the badge will be cleared on app startup. Default is false|"false". + */ + clearBadge?: boolean | string } /** @@ -116,63 +170,64 @@ declare module PhonegapPluginPush { /** * The registration ID provided by the 3rd party remote push service. */ - registrationId:string + registrationId: string } interface NotificationEventResponse { /** * The text of the push message sent from the 3rd party service. */ - message:string + message: string /** * The optional title of the push message sent from the 3rd party service. */ - title?:string + title?: string /** * The number of messages to be displayed in the badge iOS or message count in the notification shade in Android. * For windows, it represents the value in the badge notification which could be a number or a status glyph. */ - count:string + count: string /** * The name of the sound file to be played upon receipt of the notification. */ - sound:string + sound: string /** * The path of the image file to be displayed in the notification. */ - image:string + image: string /** * An optional collection of data sent by the 3rd party push service that does not fit in the above properties. */ additionalData: NotificationEventAdditionalData } + /** + * TODO: document all possible properties (I only got the android ones) + * + * Loosened up with a dictionary notation, but all non-defined properties need to use (map['prop']) notation + * + * Ideally the developer would overload (merged declaration) this or create a new interface that would extend this one + * so that he could specify any custom code without having to use array notation (map['prop']) for all of them. + */ interface NotificationEventAdditionalData { - /** - * TODO: document all possible properties (I only got the android ones) - * - * Loosened up with a dictionary notation, but all non-defined properties need to use (map['prop']) notation - * - * Ideally the developer would overload (merged declaration) this or create a new interface that would extend this one - * so that he could specify any custom code without having to use array notation (map['prop']) for all of them. - */ [name: string]: any + /** * Whether the notification was received while the app was in the foreground */ - foreground?:boolean - collapse_key?:string - from?:string - notId?:string + foreground?: boolean + collapse_key?: string + from?: string + notId?: string } interface PushNotificationStatic { - init(options:InitOptions):PushNotification - new(options:InitOptions):PushNotification + init(options: InitOptions): PushNotification + new (options: InitOptions): PushNotification } } interface Window { - PushNotification:PhonegapPluginPush.PushNotificationStatic + PushNotification: PhonegapPluginPush.PushNotificationStatic } -declare var PushNotification:PhonegapPluginPush.PushNotificationStatic; +declare var PushNotification: PhonegapPluginPush.PushNotificationStatic; diff --git a/pixi.js/pixi.js-tests.ts b/pixi.js/pixi.js-tests.ts index 6a462fc2e..3d3098c38 100644 --- a/pixi.js/pixi.js-tests.ts +++ b/pixi.js/pixi.js-tests.ts @@ -1,5 +1,4 @@ /// - module basics { export class Basics { diff --git a/pixi.js/pixi.js.d.ts b/pixi.js/pixi.js.d.ts index d3f268d2f..5886fc419 100644 --- a/pixi.js/pixi.js.d.ts +++ b/pixi.js/pixi.js.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Pixi.js 3.0.7 +// Type definitions for Pixi.js 3.0.9 dev // Project: https://github.com/GoodBoyDigital/pixi.js/ // Definitions by: clark-stevenson // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -10,7 +10,7 @@ declare class PIXI { static RAD_TO_DEG: number; static DEG_TO_RAD: number; static TARGET_FPMS: number; - static RENDER_TYPE: { + static RENDERER_TYPE: { UNKNOWN: number; WEBGL: number; CANVAS: number; @@ -155,6 +155,8 @@ declare module PIXI { toGlobal(position: Point): Point; toLocal(position: Point, from?: DisplayObject): Point; generateTexture(renderer: CanvasRenderer | WebGLRenderer, scaleMode: number, resolution: number): Texture; + setParent(container: Container): Container; + setTransform(x?: number, y?: number, scaleX?: number, scaleY?: number, rotation?: number, skewX?: number, skewY?: number, pivotX?: number, pivotY?: number): DisplayObject; destroy(): void; getChildByName(name: string): DisplayObject; getGlobalPosition(point: Point): Point; @@ -290,7 +292,7 @@ declare module PIXI { drawRoundedRect(x: number, y: number, width: number, height: number, radius: number): Graphics; drawCircle(x: number, y: number, radius: number): Graphics; drawEllipse(x: number, y: number, width: number, height: number): Graphics; - drawPolygon(path: number[]| Point[]): Graphics; + drawPolygon(path: number[] | Point[]): Graphics; clear(): Graphics; //todo generateTexture(renderer: WebGLRenderer | CanvasRenderer, resolution?: number, scaleMode?: number): Texture; @@ -344,6 +346,8 @@ declare module PIXI { identity(): Matrix; clone(): Matrix; copy(matrix: Matrix): Matrix; + set(a: number, b: number, c: number, d: number, tx: number, ty: number): Matrix; + setTransform(a: number, b: number, c: number, d: number, sr: number, cr: number, cy: number, sy: number, nsx: number, cs: number): PIXI.Matrix; static IDENTITY: Matrix; static TEMP_MATRIX: Matrix; @@ -444,6 +448,7 @@ declare module PIXI { rotation?: boolean; uvs?: boolean; alpha?: boolean; + } export class ParticleContainer extends Container { @@ -451,8 +456,11 @@ declare module PIXI { protected _maxSize: number; protected _batchSize: number; + protected _properties: boolean[]; + protected _buffers: WebGLBuffer[]; + protected _bufferToUpdate: number; - protected onChildrenChange: () => void; + protected onChildrenChange: (smallestChildIndex?: number) => void; interactiveChildren: boolean; blendMode: number; @@ -492,18 +500,17 @@ declare module PIXI { //renderers export interface RendererOptions { + view?: HTMLCanvasElement; transparent?: boolean antialias?: boolean; resolution?: number; + clearBeforeRendering?: boolean; preserveDrawingBuffer?: boolean; forceFXAA?: boolean; roundPixels?: boolean; - - autoResize?: boolean; backgroundColor?: number; - blendModes?: { [s: string]: any; }; - clearBeforeRender?: boolean; + } export class SystemRenderer extends EventEmitter { @@ -525,6 +532,7 @@ declare module PIXI { blendModes: any; //todo? preserveDrawingBuffer: boolean; clearBeforeRender: boolean; + roundPixels: boolean; backgroundColor: number; render(object: DisplayObject): void; @@ -543,8 +551,6 @@ declare module PIXI { refresh: boolean; maskManager: CanvasMaskManager; roundPixels: boolean; - currentScaleMode: number; - currentBlendMode: number; smoothProperty: string; render(object: DisplayObject): void; @@ -612,6 +618,7 @@ declare module PIXI { protected _createContext(): void; protected handleContextLost: (event: WebGLContextEvent) => void; protected _mapGlModes(): void; + protected _managedTextures: Texture[]; constructor(width?: number, height?: number, options?: RendererOptions); @@ -629,7 +636,7 @@ declare module PIXI { setObjectRenderer(objectRenderer: ObjectRenderer): void; setRenderTarget(renderTarget: RenderTarget): void; updateTexture(texture: BaseTexture | Texture): BaseTexture | Texture; - destroyTexture(texture: BaseTexture | Texture): void; + destroyTexture(texture: BaseTexture | Texture, _skipRemove?: boolean): void; } export class AbstractFilter { @@ -764,7 +771,7 @@ declare module PIXI { fragmentSrc: string; init(): void; - cacheUniformLocations(keys: string): void; + cachUniformLocations(keys: string): void; cacheAttributeLocations(keys: string): void; compile(): WebGLProgram; syncUniform(uniform: any): void; @@ -841,6 +848,7 @@ declare module PIXI { map(rect: Rectangle, rect2: Rectangle): void; upload(): void; + destroy(): void; } @@ -954,7 +962,7 @@ declare module PIXI { static fromImage(imageUrl: string, crossorigin?: boolean, scaleMode?: number): BaseTexture; static fromCanvas(canvas: HTMLCanvasElement, scaleMode?: number): BaseTexture; - protected _glTextures: any[]; + protected _glTextures: any; protected _sourceLoaded(): void; @@ -969,7 +977,7 @@ declare module PIXI { scaleMode: number; hasLoaded: boolean; isLoading: boolean; - source: HTMLImageElement | HTMLCanvasElement; + source: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement; premultipliedAlpha: boolean; imageUrl: string; isPowerOfTwo: boolean; @@ -1072,10 +1080,9 @@ declare module PIXI { export class VideoBaseTexture extends BaseTexture { static fromVideo(video: HTMLVideoElement, scaleMode?: number): VideoBaseTexture; - static fromUrl(videoSrc: string | any | string[]| any[]): VideoBaseTexture; + static fromUrl(videoSrc: string | any | string[] | any[]): VideoBaseTexture; protected _loaded: boolean; - protected _onUpdate(): void; protected _onPlayStart(): void; protected _onPlayStop(): void; @@ -1096,11 +1103,11 @@ declare module PIXI { static uuid(): number; static hex2rgb(hex: number, out?: number[]): number[]; static hex2String(hex: number): string; - static rbg2hex(rgb: Number[]): number; + static rgb2hex(rgb: Number[]): number; static canUseNewCanvasBlendModel(): boolean; static getNextPowerOfTwo(number: number): number; static isPowerOfTwo(width: number, height: number): boolean; - static getResolutionOfUrl(url: string): boolean; + static getResolutionOfUrl(url: string): number; static sayHello(type: string): void; static isWebGLSupported(): boolean; static sign(n: number): number; @@ -1147,6 +1154,7 @@ declare module PIXI { textWidth: number; textHeight: number; maxWidth: number; + maxLineHeight: number; dirty: boolean; tint: number; @@ -1165,7 +1173,8 @@ declare module PIXI { static fromFrames(frame: string[]): MovieClip; static fromImages(images: string[]): MovieClip; - protected _textures: Texture; + protected _textures: Texture[]; + protected _durations: number[]; protected _currentTime: number; protected update(deltaTime: number): void; @@ -1527,6 +1536,10 @@ declare module PIXI { xhrType?: string; } + export interface ResourceDictionary { + + [index: string]: PIXI.loaders.Resource; + } export class Loader extends EventEmitter { constructor(baseUrl?: string, concurrency?: number); @@ -1534,7 +1547,7 @@ declare module PIXI { baseUrl: string; progress: number; loading: boolean; - resources: Resource[]; + resources: ResourceDictionary; add(name: string, url: string, options?: LoaderOptions, cb?: () => void): Loader; add(url: string, options?: LoaderOptions, cb?: () => void): Loader; @@ -1633,6 +1646,7 @@ declare module PIXI { blendMode: number; canvasPadding: number; drawMode: number; + shader: Shader; getBounds(matrix?: Matrix): Rectangle; containsPoint(point: Point): boolean; @@ -1660,6 +1674,15 @@ declare module PIXI { refresh(): void; } + export class Plane extends Mesh { + + segmentsX: number; + segmentsY: number; + + constructor(texture: Texture, segmentsX?: number, segmentsY?: number); + + } + export class MeshRenderer extends ObjectRenderer { @@ -1719,4 +1742,4 @@ declare module PIXI { declare module 'pixi.js' { export = PIXI; -} \ No newline at end of file +} diff --git a/protobufjs/protobufjs-tests.ts b/protobufjs/protobufjs-tests.ts index f20efec3c..94afba0a8 100644 --- a/protobufjs/protobufjs-tests.ts +++ b/protobufjs/protobufjs-tests.ts @@ -409,7 +409,7 @@ function assertIsRPCMethod(rpc: ProtoBuf.ReflectRPCMethod, name: string) { assertIsMethod(rpc, name); assertIsMessage(rpc.resolvedRequestType, name + ".resolvedRequestType"); - assertIsMessage(rpc.resolveResponseType, name + ".resolvedResponsetype"); + assertIsMessage(rpc.resolvedResponseType, name + ".resolvedResponsetype"); } testProtoBufJs(); diff --git a/protobufjs/protobufjs.d.ts b/protobufjs/protobufjs.d.ts index 7133df6f6..ec8131e7f 100644 --- a/protobufjs/protobufjs.d.ts +++ b/protobufjs/protobufjs.d.ts @@ -379,7 +379,7 @@ declare module ProtoBuf { requestName: string; responseName: string; resolvedRequestType: ReflectMessage; - resolveResponseType: ReflectMessage; + resolvedResponseType: ReflectMessage; } } diff --git a/q/Q.d.ts b/q/Q.d.ts index 50ee49c52..ba30b2745 100644 --- a/q/Q.d.ts +++ b/q/Q.d.ts @@ -206,6 +206,11 @@ declare module Q { * Returns a promise that is fulfilled with an array containing the fulfillment value of each promise, or is rejected with the same rejection reason as the first promise to be rejected. */ export function all(promises: IPromise[]): Promise; + + /** + * Returns a promise for the first of an array of promises to become settled. + */ + export function race(promises: IPromise[]): Promise; /** * Returns a promise that is fulfilled with an array of promise state snapshots, but only after all the original promises have settled, i.e. become either fulfilled or rejected. diff --git a/query-string/query-string-tests.ts b/query-string/query-string-tests.ts new file mode 100644 index 000000000..597d270f2 --- /dev/null +++ b/query-string/query-string-tests.ts @@ -0,0 +1,13 @@ +/// + +import qs = require('query-string'); + +qs.stringify({ foo: 'bar' }); +qs.stringify({ foo: 'bar', bar: 'baz' }); + +qs.parse('?foo=bar'); +qs.parse('#foo=bar'); +qs.parse('&foo=bar&foo=baz'); + +qs.extract('http://foo.bar/?abc=def&hij=klm'); +qs.extract('http://foo.bar/?foo=bar'); diff --git a/query-string/query-string.d.ts b/query-string/query-string.d.ts new file mode 100644 index 000000000..e4d76d003 --- /dev/null +++ b/query-string/query-string.d.ts @@ -0,0 +1,27 @@ +// Type definitions for query-string v3.0.0 +// Project: https://github.com/sindresorhus/query-string +// Definitions by: Sam Verschueren +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module "query-string" { + /** + * Parse a query string into an object. + * Leading ? or # are ignored, so you can pass location.search or location.hash directly. + * @param str + */ + export function parse(str: string): any; + + /** + * Stringify an object into a query string, sorting the keys. + * + * @param obj + */ + export function stringify(obj: any): string; + + /** + * Extract a query string from a URL that can be passed into .parse(). + * + * @param str + */ + export function extract(str: string): string; +} diff --git a/qunit/qunit-tests.ts b/qunit/qunit-tests.ts index dd0335aed..9a3486118 100644 --- a/qunit/qunit-tests.ts +++ b/qunit/qunit-tests.ts @@ -170,6 +170,30 @@ QUnit.module("module A", { } }); +QUnit.module("module with async setup and teardown", { + setup: function (assert) { + var done = assert.async(); + setTimeout(function () { + // prepare something for all following tests + }); + }, + teardown: function (assert) { + // clean up after each test + } +}); + +QUnit.module("module with async setup and teardown", { + beforeEach: function (assert: QUnitAssert) { + var done = assert.async(); + setTimeout(function () { + // prepare something for all following tests + }); + }, + afterEach: function () { + // clean up after each test + } +}); + QUnit.test("a test", function (assert) { function square(x) { diff --git a/qunit/qunit.d.ts b/qunit/qunit.d.ts index fde535a68..98b513b9a 100644 --- a/qunit/qunit.d.ts +++ b/qunit/qunit.d.ts @@ -148,23 +148,27 @@ interface URLConfigItem { interface LifecycleObject { /** * Runs before each test + * @param assert * @deprecated */ - setup?: () => void; + setup?: (assert: QUnitAssert) => void; /** * Runs after each test + * @param assert * @deprecated */ - teardown?: () => void; + teardown?: (assert: QUnitAssert) => void; /** * Runs before each test + * @param assert */ - beforeEach?: () => void; + beforeEach?: (assert: QUnitAssert) => void; /** * Runs after each test + * @param assert */ - afterEach?: () => void; + afterEach?: (assert: QUnitAssert) => void; /** * Any additional properties on the hooks object will be added to that context. diff --git a/ratelimiter/ratelimiter-tests.ts b/ratelimiter/ratelimiter-tests.ts new file mode 100644 index 000000000..14d42422e --- /dev/null +++ b/ratelimiter/ratelimiter-tests.ts @@ -0,0 +1,17 @@ +/// +/// + +import redis = require('redis'); +import Limiter = require('ratelimiter'); + +let id: string; +let db: redis.RedisClient; +let limit = new Limiter({ id: id, db: db }); + +const str: string = limit.inspect(); + +limit.get((err, limit): void => { + const total: number = limit.total; + const remaining: number = limit.remaining; + const reset: number = limit.reset; +}); diff --git a/ratelimiter/ratelimiter.d.ts b/ratelimiter/ratelimiter.d.ts new file mode 100644 index 000000000..6e9883dd5 --- /dev/null +++ b/ratelimiter/ratelimiter.d.ts @@ -0,0 +1,59 @@ +// Type definitions for ratelimiter 2.1.1 +// Project: https://github.com/tj/node-ratelimiter +// Definitions by: Aya Morisawa +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare module "ratelimiter" { + import { RedisClient } from 'redis'; + + interface LimiterOption { + /** + * The identifier to limit against (typically a user id) + */ + id: string; + + /** + * Redis connection instance + */ + db: RedisClient; + + /** + * Max requests within duration + */ + max?: number; + + /** + * Duration of limit in milliseconds + */ + duration?: number; + } + + interface LimiterInfo { + /** + * max value + */ + total: number; + + /** + * Number of calls left in current duration without decreasing current get + */ + remaining: number; + + /** + * Time in milliseconds until the end of current duration + */ + reset: number; + } + + class Limiter { + constructor(opts: LimiterOption); + + inspect(): string; + + get(fn: (err: any, info: LimiterInfo) => void): void; + } + + export = Limiter; +} diff --git a/react-day-picker/react-day-picker-tests.tsx b/react-day-picker/react-day-picker-tests.tsx new file mode 100644 index 000000000..984834dfd --- /dev/null +++ b/react-day-picker/react-day-picker-tests.tsx @@ -0,0 +1,22 @@ +/// +/// + +import * as DayPicker2 from "react-day-picker"; + +function isSunday(day: Date) { + return day.getDay() === 0; +} + +// make sure global variable version works +function MyComponent2() { + return +} +DayPicker.DateUtils.clone(new Date()); +DayPicker.DateUtils.isDayInRange(new Date(), {from: new Date()}); + +// make sure imported version works +function MyComponent() { + return +} +DayPicker2.DateUtils.clone(new Date()); +DayPicker2.DateUtils.isDayInRange(new Date(), { from: new Date() }); diff --git a/react-day-picker/react-day-picker-tests.tsx.tscparams b/react-day-picker/react-day-picker-tests.tsx.tscparams new file mode 100644 index 000000000..0fa3ed717 --- /dev/null +++ b/react-day-picker/react-day-picker-tests.tsx.tscparams @@ -0,0 +1 @@ +--target es5 --noImplicitAny --jsx react diff --git a/react-day-picker/react-day-picker.d.ts b/react-day-picker/react-day-picker.d.ts new file mode 100644 index 000000000..94214ec45 --- /dev/null +++ b/react-day-picker/react-day-picker.d.ts @@ -0,0 +1,66 @@ +// Type definitions for react-day-picker v1.1.4 +// Project: https://github.com/gpbl/react-day-picker +// Definitions by: Giampaolo Bellavite , Jason Killian +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module "react-day-picker" { + import DayPicker = ReactDayPicker.DayPicker; + export = DayPicker; +} + +declare var DayPicker: typeof ReactDayPicker.DayPicker; + +declare namespace ReactDayPicker { + interface LocaleUtils { + formatMonthTitle: (month: Date, locale: string) => string; + formatWeekdayShort: (weekday: number, locale: string) => string; + formatWeekdayLong: (weekday: number, locale: string) => string; + getFirstDayOfWeek: (locale: string) => number; + } + + interface Modifiers { + [name: string]: (date: Date) => boolean; + } + + interface Props extends __React.Props{ + modifiers?: Modifiers; + initialMonth?: Date; + numberOfMonths?: number; + renderDay?: (date: Date) => number | string | JSX.Element; + enableOutsideDays?: boolean; + canChangeMonth?: boolean; + fromMonth?: Date; + toMonth?: Date; + localeUtils?: LocaleUtils; + locale?: string; + onDayClick?: (e: __React.SyntheticEvent, day: Date, modifiers: string[]) => any; + onDayTouchTap?: (e: __React.SyntheticEvent, day: Date, modifiers: string[]) => any; + onDayMouseEnter?: (e: __React.SyntheticEvent, day: Date, modifiers: string[]) => any; + onDayMouseLeave?: (e: __React.SyntheticEvent, day: Date, modifiers: string[]) => any; + onMonthChange?: (month: Date) => any; + onCaptionClick?: (e: __React.SyntheticEvent, month: Date) => any; + className?: string; + style?: __React.CSSProperties; + tabIndex?: number; + } + + class DayPicker extends __React.Component { + showMonth(month: Date): void; + showPreviousMonth(): void; + showNextMonth(): void; + } + + namespace DayPicker { + var LocaleUtils: LocaleUtils; + namespace DateUtils { + function clone(d: Date): Date; + function isSameDay(d1?: Date, d2?: Date): boolean; + function isPastDay(d: Date): boolean; + function isDayBetween(day: Date, startDate: Date, endDate: Date): boolean; + function addDayToRange(day: Date, range: { from?: Date, to?: Date }): { from?: Date, to?: Date }; + function isDayInRange(day: Date, range: { from?: Date, to?: Date }): boolean; + } + } +} diff --git a/react-dom/react-dom.d.ts b/react-dom/react-dom.d.ts deleted file mode 100644 index 1351fa02e..000000000 --- a/react-dom/react-dom.d.ts +++ /dev/null @@ -1,40 +0,0 @@ -// Type definitions for React-DOM v0.14.0-rc -// Project: https://www.npmjs.com/package/react-dom -// Definitions by: Stefan-Bieliauskas -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -/// - -declare namespace __ReactDom { - function render

    ( - element: __React.DOMElement

    , - container: Element, - callback?: () => any): __React.DOMComponent

    ; - function render( - element: __React.ClassicElement

    , - container: Element, - callback?: () => any): __React.ClassicComponent; - function render( - element: __React.ReactElement

    , - container: Element, - callback?: () => any): __React.Component; - - function findDOMNode( - componentOrElement: __React.Component | Element): TElement; - function findDOMNode( - componentOrElement: __React.Component | Element): Element; - - function unmountComponentAtNode(container: Element): boolean; -} - -declare namespace __ReactDomServer { - function renderToString(element: __React.ReactElement): string; - function renderToStaticMarkup(element: __React.ReactElement): string; -} -declare module "react-dom" { - export = __ReactDom -} - -declare module "react-dom/server" { - export = __ReactDomServer -} diff --git a/react-input-calendar/react-input-calendar-tests.tsx b/react-input-calendar/react-input-calendar-tests.tsx index 127106424..9cc4963fb 100644 --- a/react-input-calendar/react-input-calendar-tests.tsx +++ b/react-input-calendar/react-input-calendar-tests.tsx @@ -1,6 +1,8 @@ /// /// +/// import * as ReactInputCalendar from 'react-input-calendar'; import * as React from 'react'; -React.render(, document.body); +import * as ReactDOM from 'react-dom'; +ReactDOM.render(, document.body); diff --git a/react-native/react-native-tests.tsx b/react-native/react-native-tests.tsx new file mode 100644 index 000000000..f2e4cc22f --- /dev/null +++ b/react-native/react-native-tests.tsx @@ -0,0 +1,71 @@ + +/* + +Note: This must be compiled with the target set to ES6 + +The content of index.io.js could be something like + + 'use strict'; + + import { AppRegistry } from 'react-native' + import Welcome from './gen/Welcome' + + AppRegistry.registerComponent('MopNative', () => Welcome); + + +For a list of complete Typescript examples: check https://github.com/bgrieder/RNTSExplorer + + */ + +/// + + +import React from 'react-native' +const { StyleSheet, Text, View } = React + +var styles = StyleSheet.create( + { + container: { + flex: 1, + justifyContent: 'center', + alignItems: 'center', + backgroundColor: '#F5FCFF', + }, + welcome: { + fontSize: 20, + textAlign: 'center', + margin: 10, + }, + instructions: { + textAlign: 'center', + color: '#333333', + marginBottom: 5, + }, + } +) + + +class Welcome extends React.Component { + + + render() { + + return ( + + + Welcome to React Native + + + To get started, edit index.ios.js + + + Press Cmd+R to reload,{'\n'} + Cmd+D or shake for dev menu + + + ) + } +} + +export default Welcome + diff --git a/react-native/react-native-tests.tsx.tscparams b/react-native/react-native-tests.tsx.tscparams new file mode 100644 index 000000000..7cf88bb1b --- /dev/null +++ b/react-native/react-native-tests.tsx.tscparams @@ -0,0 +1 @@ +--target es5 --noImplicitAny --experimentalDecorators --jsx react --module commonjs diff --git a/react-native/react-native.d.ts b/react-native/react-native.d.ts new file mode 100644 index 000000000..dc6cc5e3c --- /dev/null +++ b/react-native/react-native.d.ts @@ -0,0 +1,3480 @@ +// Type definitions for react-native 0.14 +// Project: https://github.com/facebook/react-native +// Definitions by: Bruno Grieder +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// +// USING: these definitions are meant to be used with the TSC compiler target set to ES6 +// +// USAGE EXAMPLES: check the RNTSExplorer project at https://github.com/bgrieder/RNTSExplorer +// +// CONTRIBUTING: please open pull requests and make sure that the changes do not break RNTSExplorer (they should not) +// Do not hesitate to open a pull request against RNTSExplorer to provide an example for a case not covered by the current App +// +// CREDITS: This work is based on an original work made by Bernd Paradies: https://github.com/bparadie +// +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/// + +//so we know what is "original" React +import React = __React; + +//react-native "extends" react +declare namespace __React { + + + /** + * Represents the completion of an asynchronous operation + * @see lib.es6.d.ts + */ + export interface Promise { + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. + */ + then( onfulfilled?: ( value: T ) => TResult | Promise, onrejected?: ( reason: any ) => TResult | Promise ): Promise; + + /** + * Attaches a callback for only the rejection of the Promise. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of the callback. + */ + catch( onrejected?: ( reason: any ) => T | Promise ): Promise; + + + // not in lib.es6.d.ts but called by react-native + done( callback?: ( value: T ) => void ): void; + } + + export interface PromiseConstructor { + /** + * A reference to the prototype. + */ + prototype: Promise; + + /** + * Creates a new Promise. + * @param init A callback used to initialize the promise. This callback is passed two arguments: + * a resolve callback used resolve the promise with a value or the result of another promise, + * and a reject callback used to reject the promise with a provided reason or error. + */ + new ( init: ( resolve: ( value?: T | Promise ) => void, reject: ( reason?: any ) => void ) => void ): Promise; + + ( init: ( resolve: ( value?: T | Promise ) => void, reject: ( reason?: any ) => void ) => void ): Promise; + + /** + * Creates a Promise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any Promise is rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + all( values: (T | Promise)[] ): Promise; + + /** + * Creates a Promise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any Promise is rejected. + * @param values An array of values. + * @returns A new Promise. + */ + all( values: Promise[] ): Promise; + + /** + * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved + * or rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + race( values: (T | Promise)[] ): Promise; + + /** + * Creates a new rejected promise for the provided reason. + * @param reason The reason the promise was rejected. + * @returns A new rejected Promise. + */ + reject( reason: any ): Promise; + + /** + * Creates a new rejected promise for the provided reason. + * @param reason The reason the promise was rejected. + * @returns A new rejected Promise. + */ + reject( reason: any ): Promise; + + /** + * Creates a new resolved promise for the provided value. + * @param value A promise. + * @returns A promise whose internal state matches the provided promise. + */ + resolve( value: T | Promise ): Promise; + + /** + * Creates a new resolved promise . + * @returns A resolved promise. + */ + resolve(): Promise; + } + + // @see lib.es6.d.ts + export var Promise: PromiseConstructor; + + //TODO: BGR: Replace with ComponentClass ? + // node_modules/react-tools/src/classic/class/ReactClass.js + export interface ReactClass { + // TODO: + } + + // see react-jsx.d.ts + export function createElement

    ( type: React.ReactType, + props?: P, + ...children: React.ReactNode[] ): React.ReactElement

    ; + + + export type Runnable = ( appParameters: any ) => void; + + + // Similar to React.SyntheticEvent except for nativeEvent + interface NativeSyntheticEvent { + bubbles: boolean + cancelable: boolean + currentTarget: EventTarget + defaultPrevented: boolean + eventPhase: number + isTrusted: boolean + nativeEvent: T + preventDefault(): void + stopPropagation(): void + target: EventTarget + timeStamp: Date + type: string + } + + export interface NativeTouchEvent { + /** + * Array of all touch events that have changed since the last event + */ + changedTouches: NativeTouchEvent[] + + /** + * The ID of the touch + */ + identifier: string + + /** + * The X position of the touch, relative to the element + */ + locationX: number + + /** + * The Y position of the touch, relative to the element + */ + locationY: number + + /** + * The X position of the touch, relative to the screen + */ + pageX: number + + /** + * The Y position of the touch, relative to the screen + */ + pageY: number + + /** + * The node id of the element receiving the touch event + */ + target: string + + /** + * A time identifier for the touch, useful for velocity calculation + */ + timestamp: number + + /** + * Array of all current touches on the screen + */ + touches : NativeTouchEvent[] + } + + export interface GestureResponderEvent extends NativeSyntheticEvent { + } + + + export interface PointProperties { + x: number + y: number + } + + export interface Insets { + top?: number + left?: number + bottom?: number + right?: number + } + + /** + * //FIXME: need to find documentation on which compoenent is a native (i.e. non composite component) + */ + export interface NativeComponent { + setNativeProps: ( props: Object ) => void + } + + /** + * //FIXME: need to find documentation on which component is a TTouchable and can implement that interface + * @see React.DOMAtributes + */ + export interface Touchable { + onTouchStart?: ( event: GestureResponderEvent ) => void + onTouchMove?: ( event: GestureResponderEvent ) => void + onTouchEnd?: ( event: GestureResponderEvent ) => void + onTouchCancel?: ( event: GestureResponderEvent ) => void + onTouchEndCapture?: ( event: GestureResponderEvent ) => void + } + + export type AppConfig = { + appKey: string; + component: ReactClass; + run?: Runnable; + } + + // https://github.com/facebook/react-native/blob/master/Libraries/AppRegistry/AppRegistry.js + export class AppRegistry { + static registerConfig( config: AppConfig[] ): void; + + static registerComponent( appKey: string, getComponentFunc: () => React.ComponentClass ): string; + + static registerRunnable( appKey: string, func: Runnable ): string; + + static runApplication( appKey: string, appParameters: any ): void; + } + + export interface LayoutAnimationTypes { + spring: string + linear: string + easeInEaseOut: string + easeIn: string + easeOut: string + } + + export interface LayoutAnimationProperties { + opacity: string + scaleXY: string + } + + export interface LayoutAnimationAnim { + duration?: number + delay?: number + springDamping?: number + initialVelocity?: number + type?: string //LayoutAnimationTypes + property?: string //LayoutAnimationProperties + } + + export interface LayoutAnimationConfig { + duration: number + create?: LayoutAnimationAnim + update?: LayoutAnimationAnim + delete?: LayoutAnimationAnim + } + + export interface LayoutAnimationStatic { + + configureNext: ( config: LayoutAnimationConfig, onAnimationDidEnd?: () => void, onError?: ( error?: any ) => void ) => void + create: ( duration: number, type?: string, creationProp?: string ) => LayoutAnimationConfig + Types: LayoutAnimationTypes + Properties: LayoutAnimationProperties + configChecker: ( conf: {config: LayoutAnimationConfig}, name: string, next: string ) => void + Presets : { + easeInEaseOut: LayoutAnimationConfig + linear:LayoutAnimationConfig + spring: LayoutAnimationConfig + } + } + + + /** + * Flex Prop Types + * @see https://facebook.github.io/react-native/docs/flexbox.html#proptypes + * @see LayoutPropTypes.js + */ + export interface FlexStyle { + + alignItems?: string; //enum('flex-start', 'flex-end', 'center', 'stretch') + alignSelf?: string// enum('auto', 'flex-start', 'flex-end', 'center', 'stretch') + borderBottomWidth?: number + borderLeftWidth?: number + borderRightWidth?: number + borderTopWidth?: number + borderWidth?: number + bottom?: number + flex?: number + flexDirection?: string // enum('row', 'column') + flexWrap?: string // enum('wrap', 'nowrap') + height?: number + justifyContent?: string // enum('flex-start', 'flex-end', 'center', 'space-between', 'space-around') + left?: number + margin?: number + marginBottom?: number + marginHorizontal?: number + marginLeft?: number + marginRight?: number + marginTop?: number + marginVertical?: number + padding?: number + paddingBottom?: number + paddingHorizontal?: number + paddingLeft?: number + paddingRight?: number + paddingTop?: number + paddingVertical?: number + position?: string // enum('absolute', 'relative') + right?: number + top?: number + width?: number + } + + + export interface TransformsStyle { + + transform?: [{perspective: number}, {rotate: string}, {rotateX: string}, {rotateY: string}, {rotateZ: string}, {scale: number}, {scaleX: number}, {scaleY: number}, {translateX: number}, {translateY: number}, {skewX: string}, {skewY: string}] + transformMatrix?: Array + rotation?: number + scaleX?: number + scaleY?: number + translateX?: number + translateY?: number + } + + + export interface StyleSheetProperties { + // TODO: + } + + export interface LayoutRectangle { + x: number; + y: number; + width: number; + height: number; + } + + // @see TextProperties.onLayout + export interface LayoutChangeEvent { + nativeEvent: { + layout: LayoutRectangle + } + } + + // @see https://facebook.github.io/react-native/docs/text.html#style + export interface TextStyle extends ViewStyle { + color?: string + fontFamily?: string + fontSize?: number + fontStyle?: string // 'normal' | 'italic'; + fontWeight?: string // enum("normal", 'bold', '100', '200', '300', '400', '500', '600', '700', '800', '900') + letterSpacing?: number + lineHeight?: number + textAlign?: string // enum("auto", 'left', 'right', 'center') + textDecorationLine?: string // enum("none", 'underline', 'line-through', 'underline line-through') + textDecorationStyle?: string // enum("solid", 'double', 'dotted', 'dashed') + textDecorationColor?: string + writingDirection?: string; //enum("auto", 'ltr', 'rtl') + //containerBackgroundColor?: string + } + + export interface TextPropertiesIOS { + + /** + * When true, no visual change is made when text is pressed down. + * By default, a gray oval highlights the text on press down. + */ + suppressHighlighting?: boolean + } + + // https://facebook.github.io/react-native/docs/text.html#props + export interface TextProperties extends React.Props { + + /** + * Specifies should fonts scale to respect Text Size accessibility setting on iOS. + */ + allowFontScaling?: boolean + + /** + * Used to truncate the text with an elipsis after computing the text layout, including line wrapping, such that the total number of lines does not exceed this number. + */ + numberOfLines?: number + + /** + * Invoked on mount and layout changes with + * + * {nativeEvent: { layout: {x, y, width, height}}}. + */ + onLayout?: ( event: LayoutChangeEvent ) => void + + /** + * This function is called on press. + * Text intrinsically supports press handling with a default highlight state (which can be disabled with suppressHighlighting). + */ + onPress?: () => void + + /** + * @see https://facebook.github.io/react-native/docs/text.html#style + */ + style?: TextStyle + + /** + * Used to locate this view in end-to-end tests. + */ + testID?: string + } + + /** + * A React component for displaying text which supports nesting, styling, and touch handling. + */ + export interface TextStatic extends React.ComponentClass { + + } + + + /** + * IOS Specific properties for TextInput + * @see https://facebook.github.io/react-native/docs/textinput.html#props + */ + export interface TextInputIOSProperties { + + /** + * If true, the text field will blur when submitted. + * The default value is true. + */ + blurOnSubmit?: boolean + + /** + * enum('never', 'while-editing', 'unless-editing', 'always') + * When the clear button should appear on the right side of the text view + */ + clearButtonMode?: string + + /** + * If true, clears the text field automatically when editing begins + */ + clearTextOnFocus?: boolean + + /** + * If true, the keyboard disables the return key when there is no text and automatically enables it when there is text. + * The default value is false. + */ + enablesReturnKeyAutomatically?: boolean + + /** + * Callback that is called when a key is pressed. + * Pressed key value is passed as an argument to the callback handler. + * Fires before onChange callbacks. + */ + onKeyPress?: () => void + + /** + * enum('default', 'go', 'google', 'join', 'next', 'route', 'search', 'send', 'yahoo', 'done', 'emergency-call') + * Determines how the return key should look. + */ + returnKeyType?: string + + /** + * If true, all text will automatically be selected on focus + */ + selectTextOnFocus?: boolean + + /** + * //FIXME: requires typing + * See DocumentSelectionState.js, some state that is responsible for maintaining selection information for a document + */ + selectionState?: any + + + } + + /** + * Android Specific properties for TextInput + * @see https://facebook.github.io/react-native/docs/textinput.html#props + */ + export interface TextInputAndroidProperties { + + /** + * Sets the number of lines for a TextInput. + * Use it with multiline set to true to be able to fill the lines. + */ + numberOfLines?: number + + /** + * enum('start', 'center', 'end') + * Set the position of the cursor from where editing will begin. + */ + textAlign?: string + + /** + * enum('top', 'center', 'bottom') + * Aligns text vertically within the TextInput. + */ + textAlignVertical?: string + + /** + * The color of the textInput underline. + */ + underlineColorAndroid?: string + } + + + /** + * @see https://facebook.github.io/react-native/docs/textinput.html#props + */ + export interface TextInputProperties extends TextInputIOSProperties, TextInputAndroidProperties, React.Props { + + /** + * Can tell TextInput to automatically capitalize certain characters. + * characters: all characters, + * words: first letter of each word + * sentences: first letter of each sentence (default) + * none: don't auto capitalize anything + * + * https://facebook.github.io/react-native/docs/textinput.html#autocapitalize + */ + autoCapitalize?: string + + /** + * If false, disables auto-correct. + * The default value is true. + */ + autoCorrect?: boolean + + /** + * If true, focuses the input on componentDidMount. + * The default value is false. + */ + autoFocus?: boolean + + /** + * Provides an initial value that will change when the user starts typing. + * Useful for simple use-cases where you don't want to deal with listening to events + * and updating the value prop to keep the controlled state in sync. + */ + defaultValue?: string + + /** + * If false, text is not editable. The default value is true. + */ + editable?: boolean + + /** + * enum("default", 'numeric', 'email-address', "ascii-capable", 'numbers-and-punctuation', 'url', 'number-pad', 'phone-pad', 'name-phone-pad', 'decimal-pad', 'twitter', 'web-search') + * Determines which keyboard to open, e.g.numeric. + * The following values work across platforms: - default - numeric - email-address + */ + keyboardType?: string + + /** + * Limits the maximum number of characters that can be entered. + * Use this instead of implementing the logic in JS to avoid flicker. + */ + maxLength?: number + + /** + * If true, the text input can be multiple lines. The default value is false. + */ + multiline?: boolean + + /** + * Callback that is called when the text input is blurred + */ + onBlur?: () => void + + /** + * Callback that is called when the text input's text changes. + */ + onChange?: ( event: {nativeEvent: {text: string}} ) => void + + /** + * Callback that is called when the text input's text changes. + * Changed text is passed as an argument to the callback handler. + */ + onChangeText?: ( text: string ) => void + + /** + * Callback that is called when text input ends. + */ + onEndEditing?: ( event: {nativeEvent: {text: string}} ) => void + + /** + * Callback that is called when the text input is focused + */ + onFocus?: () => void + + /** + * Invoked on mount and layout changes with {x, y, width, height}. + */ + onLayout?: ( event: {nativeEvent: {x: number, y: number, width: number, height: number}} ) => void + + /** + * Callback that is called when the text input's submit button is pressed. + */ + onSubmitEditing?: ( event: {nativeEvent: {text: string}} ) => void + + /** + * //FIXME: Not part of the doc but found in examples + */ + password?: boolean + + /** + * The string that will be rendered before text input has been entered + */ + placeholder?: string + + /** + * The text color of the placeholder string + */ + placeholderTextColor?: string + + /** + * If true, the text input obscures the text entered so that sensitive text like passwords stay secure. + * The default value is false. + */ + secureTextEntry?: boolean + + /** + * Styles + */ + style?: TextStyle + + /** + * Used to locate this view in end-to-end tests + */ + testID?: string + + /** + * The value to show for the text input. TextInput is a controlled component, + * which means the native value will be forced to match this value prop if provided. + * For most uses this works great, but in some cases this may cause flickering - one common cause is preventing edits by keeping value the same. + * In addition to simply setting the same value, either set editable={false}, + * or set/update maxLength to prevent unwanted edits without flicker. + */ + value?: string + } + + export interface TextInputStatic extends NativeComponent, React.ComponentClass { + blur: () => void + focus: () => void + } + + + /** + * Gesture recognition on mobile devices is much more complicated than web. + * A touch can go through several phases as the app determines what the user's intention is. + * For example, the app needs to determine if the touch is scrolling, sliding on a widget, or tapping. + * This can even change during the duration of a touch. There can also be multiple simultaneous touches. + * + * The touch responder system is needed to allow components to negotiate these touch interactions + * without any additional knowledge about their parent or child components. + * This system is implemented in ResponderEventPlugin.js, which contains further details and documentation. + * + * Best Practices + * Users can feel huge differences in the usability of web apps vs. native, and this is one of the big causes. + * Every action should have the following attributes: + * Feedback/highlighting- show the user what is handling their touch, and what will happen when they release the gesture + * Cancel-ability- when making an action, the user should be able to abort it mid-touch by dragging their finger away + * + * These features make users more comfortable while using an app, + * because it allows people to experiment and interact without fear of making mistakes. + * + * TouchableHighlight and Touchable* + * The responder system can be complicated to use. + * So we have provided an abstract Touchable implementation for things that should be "tappable". + * This uses the responder system and allows you to easily configure tap interactions declaratively. + * Use TouchableHighlight anywhere where you would use a button or link on web. + */ + export interface GestureResponderHandlers { + + /** + * A view can become the touch responder by implementing the correct negotiation methods. + * There are two methods to ask the view if it wants to become responder: + */ + + /** + * Does this view want to become responder on the start of a touch? + */ + onStartShouldSetResponder?: ( event: GestureResponderEvent ) => boolean + + /** + * Called for every touch move on the View when it is not the responder: does this view want to "claim" touch responsiveness? + */ + onMoveShouldSetResponder?: ( event: GestureResponderEvent ) => boolean + + /** + * If the View returns true and attempts to become the responder, one of the following will happen: + */ + + /** + * The View is now responding for touch events. + * This is the time to highlight and show the user what is happening + */ + onResponderGrant?: ( event: GestureResponderEvent ) => void + + /** + * Something else is the responder right now and will not release it + */ + onResponderReject?: ( event: GestureResponderEvent ) => void + + /** + * If the view is responding, the following handlers can be called: + */ + + /** + * The user is moving their finger + */ + onResponderMove?: ( event: GestureResponderEvent ) => void + + /** + * Fired at the end of the touch, ie "touchUp" + */ + onResponderRelease?: ( event: GestureResponderEvent ) => void + + /** + * Something else wants to become responder. + * Should this view release the responder? Returning true allows release + */ + onResponderTerminationRequest?: ( event: GestureResponderEvent ) => boolean + + /** + * The responder has been taken from the View. + * Might be taken by other views after a call to onResponderTerminationRequest, + * or might be taken by the OS without asking (happens with control center/ notification center on iOS) + */ + onResponderTerminate?: ( event: GestureResponderEvent ) => void + + /** + * onStartShouldSetResponder and onMoveShouldSetResponder are called with a bubbling pattern, + * where the deepest node is called first. + * That means that the deepest component will become responder when multiple Views return true for *ShouldSetResponder handlers. + * This is desirable in most cases, because it makes sure all controls and buttons are usable. + * + * However, sometimes a parent will want to make sure that it becomes responder. + * This can be handled by using the capture phase. + * Before the responder system bubbles up from the deepest component, + * it will do a capture phase, firing on*ShouldSetResponderCapture. + * So if a parent View wants to prevent the child from becoming responder on a touch start, + * it should have a onStartShouldSetResponderCapture handler which returns true. + */ + onStartShouldSetResponderCapture?: ( event: GestureResponderEvent ) => boolean + + /** + * onStartShouldSetResponder and onMoveShouldSetResponder are called with a bubbling pattern, + * where the deepest node is called first. + * That means that the deepest component will become responder when multiple Views return true for *ShouldSetResponder handlers. + * This is desirable in most cases, because it makes sure all controls and buttons are usable. + * + * However, sometimes a parent will want to make sure that it becomes responder. + * This can be handled by using the capture phase. + * Before the responder system bubbles up from the deepest component, + * it will do a capture phase, firing on*ShouldSetResponderCapture. + * So if a parent View wants to prevent the child from becoming responder on a touch start, + * it should have a onStartShouldSetResponderCapture handler which returns true. + */ + onMoveShouldSetResponderCapture?: () => void; + + } + + // @see https://facebook.github.io/react-native/docs/view.html#style + export interface ViewStyle extends FlexStyle, TransformsStyle { + backgroundColor?: string; + borderBottomColor?: string; + borderBottomLeftRadius?: number; + borderBottomRightRadius?: number; + borderColor?: string; + borderLeftColor?: string; + borderRadius?: number; + borderRightColor?: string; + borderTopColor?: string; + borderTopLeftRadius?: number; + borderTopRightRadius?: number; + opacity?: number; + overflow?: string; // enum('visible', 'hidden') + shadowColor?: string; + shadowOffset?: {width: number, height: number}; + shadowOpacity?: number; + shadowRadius?: number; + } + + + export interface ViewPropertiesIOS { + + /** + * Provides additional traits to screen reader. + * By default no traits are provided unless specified otherwise in element + * + * @enum('none', 'button', 'link', 'header', 'search', 'image', 'selected', 'plays', 'key', 'text','summary', 'disabled', 'frequentUpdates', 'startsMedia', 'adjustable', 'allowsDirectInteraction', 'pageTurn') + */ + accessibilityTraits?: string | string[]; + + /** + * Whether this view should be rendered as a bitmap before compositing. + * + * On iOS, this is useful for animations and interactions that do not modify this component's dimensions nor its children; + * for example, when translating the position of a static view, rasterization allows the renderer to reuse a cached bitmap of a static view + * and quickly composite it during each frame. + * + * Rasterization incurs an off-screen drawing pass and the bitmap consumes memory. + * Test and measure when using this property. + */ + shouldRasterizeIOS?: boolean + } + + export interface ViewPropertiesAndroid { + + /** + * Indicates to accessibility services to treat UI component like a native one. + * Works for Android only. + * + * @enum('none', 'button', 'radiobutton_checked', 'radiobutton_unchecked' ) + */ + accessibilityComponentType?: string + + + /** + * Indicates to accessibility services whether the user should be notified when this view changes. + * Works for Android API >= 19 only. + * See http://developer.android.com/reference/android/view/View.html#attr_android:accessibilityLiveRegion for references. + */ + accessibilityLiveRegion?: string + + /** + * Views that are only used to layout their children or otherwise don't draw anything + * may be automatically removed from the native hierarchy as an optimization. + * Set this property to false to disable this optimization and ensure that this View exists in the native view hierarchy. + */ + collapsable?: boolean + + + /** + * Controls how view is important for accessibility which is if it fires accessibility events + * and if it is reported to accessibility services that query the screen. + * Works for Android only. See http://developer.android.com/reference/android/R.attr.html#importantForAccessibility for references. + * + * Possible values: + * 'auto' - The system determines whether the view is important for accessibility - default (recommended). + * 'yes' - The view is important for accessibility. + * 'no' - The view is not important for accessibility. + * 'no-hide-descendants' - The view is not important for accessibility, nor are any of its descendant views. + */ + importantForAccessibility?: string + + + /** + * Whether this view needs to rendered offscreen and composited with an alpha in order to preserve 100% correct colors and blending behavior. + * The default (false) falls back to drawing the component and its children + * with an alpha applied to the paint used to draw each element instead of rendering the full component offscreen and compositing it back with an alpha value. + * This default may be noticeable and undesired in the case where the View you are setting an opacity on + * has multiple overlapping elements (e.g. multiple overlapping Views, or text and a background). + * + * Rendering offscreen to preserve correct alpha behavior is extremely expensive + * and hard to debug for non-native developers, which is why it is not turned on by default. + * If you do need to enable this property for an animation, + * consider combining it with renderToHardwareTextureAndroid if the view contents are static (i.e. it doesn't need to be redrawn each frame). + * If that property is enabled, this View will be rendered off-screen once, + * saved in a hardware texture, and then composited onto the screen with an alpha each frame without having to switch rendering targets on the GPU. + */ + needsOffscreenAlphaCompositing?: boolean + + + /** + * Whether this view should render itself (and all of its children) into a single hardware texture on the GPU. + * + * On Android, this is useful for animations and interactions that only modify opacity, rotation, translation, and/or scale: + * in those cases, the view doesn't have to be redrawn and display lists don't need to be re-executed. The texture can just be + * re-used and re-composited with different parameters. The downside is that this can use up limited video memory, so this prop should be set back to false at the end of the interaction/animation. + */ + renderToHardwareTextureAndroid?: boolean; + + } + + /** + * @see https://facebook.github.io/react-native/docs/view.html#props + */ + export interface ViewProperties extends ViewPropertiesAndroid, ViewPropertiesIOS, GestureResponderHandlers, Touchable, React.Props { + + /** + * Overrides the text that's read by the screen reader when the user interacts with the element. By default, the label is constructed by traversing all the children and accumulating all the Text nodes separated by space. + */ + accessibilityLabel?: string; + + /** + * When true, indicates that the view is an accessibility element. + * By default, all the touchable elements are accessible. + */ + accessible?: boolean; + + /** + * When `accessible` is true, the system will try to invoke this function when the user performs accessibility tap gesture. + */ + onAcccessibilityTap?: () => void; + + /** + * Invoked on mount and layout changes with + * + * {nativeEvent: { layout: {x, y, width, height}}}. + */ + onLayout?: ( event: LayoutChangeEvent ) => void; + + /** + * When accessible is true, the system will invoke this function when the user performs the magic tap gesture. + */ + onMagicTap?: () => void; + + /** + * + * In the absence of auto property, none is much like CSS's none value. box-none is as if you had applied the CSS class: + * + * .box-none { + * pointer-events: none; + * } + * .box-none * { + * pointer-events: all; + * } + * + * box-only is the equivalent of + * + * .box-only { + * pointer-events: all; + * } + * .box-only * { + * pointer-events: none; + * } + * + * But since pointerEvents does not affect layout/appearance, and we are already deviating from the spec by adding additional modes, + * we opt to not include pointerEvents on style. On some platforms, we would need to implement it as a className anyways. Using style or not is an implementation detail of the platform. + */ + pointerEvents?: string; + + /** + * + * This is a special performance property exposed by RCTView and is useful for scrolling content when there are many subviews, + * most of which are offscreen. For this property to be effective, it must be applied to a view that contains many subviews that extend outside its bound. + * The subviews must also have overflow: hidden, as should the containing view (or one of its superviews). + */ + removeClippedSubviews?: boolean + + style?: ViewStyle; + + /** + * Used to locate this view in end-to-end tests. + */ + testID?: string; + } + + /** + * The most fundamental component for building UI, View is a container that supports layout with flexbox, style, some touch handling, + * and accessibility controls, and is designed to be nested inside other views and to have 0 to many children of any type. + * View maps directly to the native view equivalent on whatever platform React is running on, + * whether that is a UIView,

    , android.view, etc. + */ + export interface ViewStatic extends NativeComponent, React.ComponentClass { + + } + + /** + * //FIXME: No documentation extracted from code comment on WebView.ios.js + */ + export interface NavState { + + url?: string + title?: string + loading?: boolean + canGoBack?: boolean + canGoForward?: boolean; + + [key: string]: any + } + + export interface WebViewPropertiesAndroid { + + /** + * Used for android only, JS is enabled by default for WebView on iOS + */ + javaScriptEnabledAndroid?: boolean + } + + export interface WebViewPropertiesIOS { + + /** + * Used for iOS only, sets whether the webpage scales to fit the view and the user can change the scale + */ + scalesPageToFit?: boolean + } + + /** + * @see https://facebook.github.io/react-native/docs/webview.html#props + */ + export interface WebViewProperties extends WebViewPropertiesAndroid, WebViewPropertiesIOS, React.Props { + + automaticallyAdjustContentInsets?: boolean + + bounces?: boolean + + contentInset?: Insets + + html?: string + + /** + * Sets the JS to be injected when the webpage loads. + */ + injectedJavaScript?: string + + onNavigationStateChange?: ( event: NavState ) => void + + /** + * Allows custom handling of any webview requests by a JS handler. + * Return true or false from this method to continue loading the request. + */ + onShouldStartLoadWithRequest?: () => boolean + + /** + * view to show if there's an error + */ + renderError?: () => ViewStatic + + /** + * loading indicator to show + */ + renderLoading?: () => ViewStatic + + scrollEnabled?: boolean + + startInLoadingState?: boolean + + style?: ViewStyle + + url: string + } + + + export interface WebViewStatic extends React.ComponentClass { + + goBack: () => void + goForward: () => void + reload: () => void + } + + + /** + * @see + */ + export interface SegmentedControlIOSProperties { + /// TODO + } + + + export interface NavigatorIOSProperties extends React.Props { + + /** + * NavigatorIOS uses "route" objects to identify child views, their props, and navigation bar configuration. + * "push" and all the other navigation operations expect routes to be like this + */ + initialRoute?: Route + + /** + * The default wrapper style for components in the navigator. + * A common use case is to set the backgroundColor for every page + */ + itemWrapperStyle?: ViewStyle + + /** + * A Boolean value that indicates whether the navigation bar is hidden + */ + navigationBarHidden?: boolean + + /** + * A Boolean value that indicates whether to hide the 1px hairline shadow + */ + shadowHidden?: boolean + + /** + * The color used for buttons in the navigation bar + */ + tintColor?: string + + /** + * The text color of the navigation bar title + */ + titleTextColor?: string + + /** + * A Boolean value that indicates whether the navigation bar is translucent + */ + translucent?: boolean + + /** + * NOT IN THE DOC BUT IN THE EXAMPLES + */ + style?: ViewStyle + } + + /** + * A navigator is an object of navigation functions that a view can call. + * It is passed as a prop to any component rendered by NavigatorIOS. + * + * Navigator functions are also available on the NavigatorIOS component: + * + * @see https://facebook.github.io/react-native/docs/navigatorios.html#navigator + */ + export interface NavigationIOS { + /** + * Navigate forward to a new route + */ + push: ( route: Route ) => void + + /** + * Go back one page + */ + pop: () => void + + /** + * Go back N pages at once. When N=1, behavior matches pop() + */ + popN: ( n: number ) => void + + /** + * Replace the route for the current page and immediately load the view for the new route + */ + replace: ( route: Route ) => void + + /** + * Replace the route/view for the previous page + */ + replacePrevious: ( route: Route ) => void + + /** + * Replaces the previous route/view and transitions back to it + */ + replacePreviousAndPop: ( route: Route ) => void + + /** + * Replaces the top item and popToTop + */ + resetTo: ( route: Route ) => void + + /** + * Go back to the item for a particular route object + */ + popToRoute( route: Route ): void + + /** + * Go back to the top item + */ + popToTop(): void + } + + export interface NavigatorIOSStatic extends NavigationIOS, React.ComponentClass { + } + + + /** + * @see https://facebook.github.io/react-native/docs/activityindicatorios.html#props + */ + export interface ActivityIndicatorIOSProperties extends React.Props { + + /** + * Whether to show the indicator (true, the default) or hide it (false). + */ + animating?: boolean + + /** + * The foreground color of the spinner (default is gray). + */ + color?: string + + /** + * Whether the indicator should hide when not animating (true by default). + */ + hidesWhenStopped?: boolean + + /** + * Invoked on mount and layout changes with + */ + onLayout?: ( event: {nativeEvent: { layout: {x: number, y: number , width: number, height: number}}} ) => void + + /** + * Size of the indicator. + * Small has a height of 20, large has a height of 36. + * + * enum('small', 'large') + */ + size?: string + + style?: ViewStyle + } + + export interface ActivityIndicatorIOSStatic extends React.ComponentClass { + } + + + export interface DatePickerIOSProperties extends React.Props { + + /** + * The currently selected date. + */ + date?: Date + + + /** + * Maximum date. + * Restricts the range of possible date/time values. + */ + maximumDate?: Date + + /** + * Maximum date. + * Restricts the range of possible date/time values. + */ + minimumDate?: Date + + /** + * enum(1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30) + * The interval at which minutes can be selected. + */ + minuteInterval?: number + + /** + * enum('date', 'time', 'datetime') + * The date picker mode. + */ + mode?: string + + /** + * Date change handler. + * This is called when the user changes the date or time in the UI. + * The first and only argument is a Date object representing the new date and time. + */ + onDateChange?: ( newDate: Date ) => void + + /** + * Timezone offset in minutes. + * By default, the date picker will use the device's timezone. With this parameter, it is possible to force a certain timezone offset. + * For instance, to show times in Pacific Standard Time, pass -7 * 60. + */ + timeZoneOffsetInMinutes?: number + + } + + export interface DatePickerIOSStatic extends React.ComponentClass { + } + + + /** + * @see PickerIOS.ios.js + */ + export interface PickerIOSItemProperties extends React.Props { + value?: string | number + label?: string + } + + /** + * @see PickerIOS.ios.js + */ + export interface PickerIOSItemStatic extends React.ComponentClass { + } + + + /** + * @see https://facebook.github.io/react-native/docs/pickerios.html + * @see PickerIOS.ios.js + */ + export interface PickerIOSProperties extends React.Props { + + onValueChange?: ( value: string | number ) => void + + selectedValue?: string | number + + style?: ViewStyle + } + + /** + * @see https://facebook.github.io/react-native/docs/pickerios.html + * @see PickerIOS.ios.js + */ + export interface PickerIOSStatic extends React.ComponentClass { + + Item: PickerIOSItemStatic + } + + + /** + * @see https://facebook.github.io/react-native/docs/sliderios.html + */ + export interface SliderIOSProperties extends React.Props { + + /** + * If true the user won't be able to move the slider. Default value is false. + */ + disabled?: boolean + + /** + * Initial maximum value of the slider. Default value is 1. + */ + maximumValue?: number + + /** + * The color used for the track to the right of the button. Overrides the default blue gradient image. + */ + maximumTrackTintColor?: string + + /** + * Initial minimum value of the slider. Default value is 0. + */ + minimumValue?: number + + /** + * The color used for the track to the left of the button. Overrides the default blue gradient image. + */ + minimumTrackTintColor?: string + + /** + * Callback called when the user finishes changing the value (e.g. when the slider is released). + */ + onSlidingComplete?: () => void + + /** + * Callback continuously called while the user is dragging the slider. + */ + onValueChange?: ( value: number ) => void + + /** + * Step value of the slider. + * The value should be between 0 and (maximumValue - minimumValue). + * Default value is 0. + */ + step?: number + + /** + * Used to style and layout the Slider. + * @see StyleSheet.js and ViewStylePropTypes.js for more info. + */ + style?: ViewStyle + + /** + * Initial value of the slider. + * The value should be between minimumValue and maximumValue, which default to 0 and 1 respectively. + * Default value is 0. + * + * This is not a controlled component, e.g. if you don't update the value, the component won't be reset to its inital value. + */ + value?: number + } + + export interface SliderIOSStatic extends React.ComponentClass { + + } + + /** + * //FIXME: no dcumentation, inferred + * @see SwitchIOS.ios.js + */ + export interface SwitchIOSStyle extends ViewStyle { + height?: number + width?: number + } + + + /** + * https://facebook.github.io/react-native/docs/switchios.html#props + */ + export interface SwitchIOSProperties extends React.Props { + + /** + * If true the user won't be able to toggle the switch. Default value is false. + */ + disabled?: boolean + + /** + * Background color when the switch is turned on. + */ + onTintColor?: string + + /** + * Callback that is called when the user toggles the switch. + */ + onValueChange?: ( value: boolean ) => void + + /** + * Background color for the switch round button. + */ + thumbTintColor?: string + + /** + * Background color when the switch is turned off. + */ + tintColor?: string + + /** + * The value of the switch, if true the switch will be turned on. Default value is false. + */ + value?: boolean + + style?: SwitchIOSStyle + } + + /** + * + * Use SwitchIOS to render a boolean input on iOS. + * + * This is a controlled component, so you must hook in to the onValueChange callback and update the value prop in order for the component to update, + * otherwise the user's change will be reverted immediately to reflect props.value as the source of truth. + * + * @see https://facebook.github.io/react-native/docs/switchios.html + */ + export interface SwitchIOSStatic extends React.ComponentClass { + + } + + + /** + * @see ImageResizeMode.js + */ + export interface ImageResizeModeStatic { + /** + * contain - The image will be resized such that it will be completely + * visible, contained within the frame of the View. + */ + contain: string + /** + * cover - The image will be resized such that the entire area of the view + * is covered by the image, potentially clipping parts of the image. + */ + cover: string + /** + * stretch - The image will be stretched to fill the entire frame of the + * view without clipping. This may change the aspect ratio of the image, + * distoring it. Only supported on iOS. + */ + stretch: string + } + + /** + * Image style + * @see https://facebook.github.io/react-native/docs/image.html#style + */ + export interface ImageStyle extends FlexStyle, TransformsStyle { + resizeMode?: string //Object.keys(ImageResizeMode) + backgroundColor?: string + borderColor?: string + borderWidth?: number + borderRadius?: number + overflow?: string // enum('visible', 'hidden') + tintColor?: string + opacity?: number + } + + export interface ImagePropertiesIOS { + /** + * The text that's read by the screen reader when the user interacts with the image. + */ + accessibilityLabel?: string; + + /** + * When true, indicates the image is an accessibility element. + */ + accessible?: boolean; + + /** + * When the image is resized, the corners of the size specified by capInsets will stay a fixed size, + * but the center content and borders of the image will be stretched. + * This is useful for creating resizable rounded buttons, shadows, and other resizable assets. + * More info on Apple documentation + */ + capInsets?: Insets + + /** + * A static image to display while downloading the final image off the network. + */ + defaultSource?: {uri: string} + + /** + * Invoked on load error with {nativeEvent: {error}} + */ + onError?: ( error: {nativeEvent: any} ) => void + + /** + * Invoked when load completes successfully + */ + onLoad?: () => void + + /** + * Invoked when load either succeeds or fails + */ + onLoadEnd?: () => void + + /** + * Invoked on load start + */ + onLoadStart?: () => void + + /** + * Invoked on download progress with {nativeEvent: {loaded, total}} + */ + onProgress?: ()=> void + } + + /** + * @see https://facebook.github.io/react-native/docs/image.html + */ + export interface ImageProperties extends ImagePropertiesIOS, React.Props { + /** + * onLayout function + * + * Invoked on mount and layout changes with + * + * {nativeEvent: { layout: {x, y, width, height}}}. + */ + onLayout?: ( event: LayoutChangeEvent ) => void; + + + /** + * Determines how to resize the image when the frame doesn't match the raw image dimensions. + * + * enum('cover', 'contain', 'stretch') + */ + resizeMode?: string; + + /** + * uri is a string representing the resource identifier for the image, + * which could be an http address, a local file path, + * or the name of a static image resource (which should be wrapped in the require('image!name') function). + */ + source: {uri: string} | string; + + /** + * + * Style + */ + style?: ImageStyle; + + /** + * A unique identifier for this element to be used in UI Automation testing scripts. + */ + testID?: string; + + } + + export interface ImageStatic extends React.ComponentClass { + uri: string; + resizeMode: ImageResizeModeStatic + } + + + /** + * @see https://facebook.github.io/react-native/docs/listview.html#props + */ + export interface ListViewProperties extends ScrollViewProperties, React.Props { + + dataSource?: ListViewDataSource + + /** + * How many rows to render on initial component mount. Use this to make + * it so that the first screen worth of data apears at one time instead of + * over the course of multiple frames. + */ + initialListSize?: number + + /** + * (visibleRows, changedRows) => void + * + * Called when the set of visible rows changes. `visibleRows` maps + * { sectionID: { rowID: true }} for all the visible rows, and + * `changedRows` maps { sectionID: { rowID: true | false }} for the rows + * that have changed their visibility, with true indicating visible, and + * false indicating the view has moved out of view. + */ + onChangeVisibleRows?: ( visibleRows: Array<{[sectionId: string]: {[rowID: string]: boolean}}>, changedRows: Array<{[sectionId: string]: {[rowID: string]: boolean}}> ) => void + + /** + * Called when all rows have been rendered and the list has been scrolled + * to within onEndReachedThreshold of the bottom. The native scroll + * event is provided. + */ + onEndReached?: () => void + + /** + * Threshold in pixels for onEndReached. + */ + onEndReachedThreshold?: number + + /** + * Number of rows to render per event loop. + */ + pageSize?: number + + /** + * An experimental performance optimization for improving scroll perf of + * large lists, used in conjunction with overflow: 'hidden' on the row + * containers. Use at your own risk. + */ + removeClippedSubviews?: boolean + + /** + * () => renderable + * + * The header and footer are always rendered (if these props are provided) + * on every render pass. If they are expensive to re-render, wrap them + * in StaticContainer or other mechanism as appropriate. Footer is always + * at the bottom of the list, and header at the top, on every render pass. + */ + renderFooter?: () => React.ReactElement + + /** + * () => renderable + * + * The header and footer are always rendered (if these props are provided) + * on every render pass. If they are expensive to re-render, wrap them + * in StaticContainer or other mechanism as appropriate. Footer is always + * at the bottom of the list, and header at the top, on every render pass. + */ + renderHeader?: () => React.ReactElement + + /** + * (rowData, sectionID, rowID) => renderable + * Takes a data entry from the data source and its ids and should return + * a renderable component to be rendered as the row. By default the data + * is exactly what was put into the data source, but it's also possible to + * provide custom extractors. + */ + renderRow?: ( rowData: any, sectionID: string | number, rowID: string | number, highlightRow?: boolean ) => React.ReactElement + + + /** + * A function that returns the scrollable component in which the list rows are rendered. + * Defaults to returning a ScrollView with the given props. + */ + renderScrollComponent?: ( props: ScrollViewProperties ) => React.ReactElement + + /** + * (sectionData, sectionID) => renderable + * + * If provided, a sticky header is rendered for this section. The sticky + * behavior means that it will scroll with the content at the top of the + * section until it reaches the top of the screen, at which point it will + * stick to the top until it is pushed off the screen by the next section + * header. + */ + renderSectionHeader?: ( sectionData: any, sectionId: string | number ) => React.ReactElement + + + /** + * (sectionID, rowID, adjacentRowHighlighted) => renderable + * If provided, a renderable component to be rendered as the separator below each row + * but not the last row if there is a section header below. + * Take a sectionID and rowID of the row above and whether its adjacent row is highlighted. + */ + renderSeparator?: ( sectionID: string | number, rowID: string | number, adjacentRowHighlighted?: boolean ) => React.ReactElement + + /** + * How early to start rendering rows before they come on screen, in + * pixels. + */ + scrollRenderAheadDistance?: number + } + + export interface ListViewStatic extends React.ComponentClass { + DataSource: ListViewDataSource; + } + + + export interface MapViewAnnotation { + latitude?: number + longitude?: number + animateDrop?: boolean + title?: string + subtitle?: string + hasLeftCallout?: boolean + hasRightCallout?: boolean + onLeftCalloutPress?: () => void + onRightCalloutPress?: () => void + id?: string + } + + export interface MapViewRegion { + latitude: number + longitude: number + latitudeDelta: number + longitudeDelta: number + } + + export interface MapViewPropertiesIOS { + + /** + * If false points of interest won't be displayed on the map. + * Default value is true. + */ + showsPointsOfInterest?: boolean + } + + export interface MapViewProperties extends MapViewPropertiesIOS, Touchable, React.Props { + + /** + * Map annotations with title/subtitle. + */ + annotations?: MapViewAnnotation[] + + /** + * Insets for the map's legal label, originally at bottom left of the map. See EdgeInsetsPropType.js for more information. + */ + legalLabelInsets?: Insets + + /** + * The map type to be displayed. + * standard: standard road map (default) + * satellite: satellite view + * hybrid: satellite view with roads and points of interest overlayed + * + * enum('standard', 'satellite', 'hybrid') + */ + mapType?: string + + /** + * Maximum size of area that can be displayed. + */ + maxDelta?: number + + /** + * Minimum size of area that can be displayed. + */ + minDelta?: number + + /** + * Callback that is called once, when the user taps an annotation. + */ + onAnnotationPress?: () => void + + /** + * Callback that is called continuously when the user is dragging the map. + */ + onRegionChange?: ( region: MapViewRegion ) => void + + /** + * Callback that is called once, when the user is done moving the map. + */ + onRegionChangeComplete?: ( region: MapViewRegion ) => void + + /** + * When this property is set to true and a valid camera is associated with the map, + * the camera’s pitch angle is used to tilt the plane of the map. + * + * When this property is set to false, the camera’s pitch angle is ignored and + * the map is always displayed as if the user is looking straight down onto it. + */ + pitchEnabled?: boolean + + /** + * The region to be displayed by the map. + * The region is defined by the center coordinates and the span of coordinates to display. + */ + region?: MapViewRegion + + /** + * When this property is set to true and a valid camera is associated with the map, + * the camera’s heading angle is used to rotate the plane of the map around its center point. + * + * When this property is set to false, the camera’s heading angle is ignored and the map is always oriented + * so that true north is situated at the top of the map view + */ + rotateEnabled?: boolean + + /** + * If false the user won't be able to change the map region being displayed. + * Default value is true. + */ + scrollEnabled?: boolean + + /** + * If true the app will ask for the user's location and focus on it. + * Default value is false. + * + * NOTE: You need to add NSLocationWhenInUseUsageDescription key in Info.plist to enable geolocation, + * otherwise it is going to fail silently! + */ + showsUserLocation?: boolean + + /** + * Used to style and layout the MapView. + * See StyleSheet.js and ViewStylePropTypes.js for more info. + */ + style?: ViewStyle + + /** + * If false the user won't be able to pinch/zoom the map. + * Default value is true. + */ + zoomEnabled?: boolean + } + + /** + * @see https://facebook.github.io/react-native/docs/mapview.html#content + */ + export interface MapViewStatic extends React.ComponentClass { + } + + + export interface TouchableWithoutFeedbackAndroidProperties { + + /** + * Indicates to accessibility services to treat UI component like a native one. + * Works for Android only. + * + * @enum('none', 'button', 'radiobutton_checked', 'radiobutton_unchecked' ) + */ + accessibilityComponentType?: string + } + + export interface TouchableWithoutFeedbackIOSProperties { + + /** + * Provides additional traits to screen reader. + * By default no traits are provided unless specified otherwise in element + * + * @enum('none', 'button', 'link', 'header', 'search', 'image', 'selected', 'plays', 'key', 'text','summary', 'disabled', 'frequentUpdates', 'startsMedia', 'adjustable', 'allowsDirectInteraction', 'pageTurn') + */ + accessibilityTraits?: string | string[]; + + } + + /** + * @see https://facebook.github.io/react-native/docs/touchablewithoutfeedback.html#props + */ + export interface TouchableWithoutFeedbackProperties extends TouchableWithoutFeedbackAndroidProperties, TouchableWithoutFeedbackIOSProperties { + + + /** + * Called when the touch is released, but not if cancelled (e.g. by a scroll that steals the responder lock). + */ + accessible?: boolean + + /** + * Delay in ms, from onPressIn, before onLongPress is called. + */ + delayLongPress?: number; + + /** + * Delay in ms, from the start of the touch, before onPressIn is called. + */ + delayPressIn?: number; + + /** + * Delay in ms, from the release of the touch, before onPressOut is called. + */ + delayPressOut?: number; + + /** + * Invoked on mount and layout changes with + * {nativeEvent: {layout: {x, y, width, height}}} + */ + onLayout?: ( event: LayoutChangeEvent ) => void + + onLongPress?: () => void; + + /** + * Called when the touch is released, + * but not if cancelled (e.g. by a scroll that steals the responder lock). + */ + onPress?: () => void; + + onPressIn?: () => void; + + onPressOut?: () => void; + + /** + * //FIXME: not in doc but available in exmaples + */ + style?: ViewStyle + } + + + export interface TouchableWithoutFeedbackProps extends TouchableWithoutFeedbackProperties, React.Props { + + } + + /** + * Do not use unless you have a very good reason. + * All the elements that respond to press should have a visual feedback when touched. + * This is one of the primary reason a "web" app doesn't feel "native". + * + * @see https://facebook.github.io/react-native/docs/touchablewithoutfeedback.html + */ + export interface TouchableWithoutFeedbackStatic extends React.ComponentClass { + + } + + + /** + * @see https://facebook.github.io/react-native/docs/touchablehighlight.html#props + */ + export interface TouchableHighlightProperties extends TouchableWithoutFeedbackProperties, React.Props { + + /** + * Determines what the opacity of the wrapped view should be when touch is active. + */ + activeOpacity?: number + + /** + * + * Called immediately after the underlay is hidden + */ + onHideUnderlay?: () => void + + /** + * Called immediately after the underlay is shown + */ + onShowUnderlay?: () => void + + /** + * @see https://facebook.github.io/react-native/docs/view.html#style + */ + style?: ViewStyle + + + /** + * The color of the underlay that will show through when the touch is active. + */ + underlayColor?: string + } + + /** + * A wrapper for making views respond properly to touches. + * On press down, the opacity of the wrapped view is decreased, + * which allows the underlay color to show through, darkening or tinting the view. + * The underlay comes from adding a view to the view hierarchy, + * which can sometimes cause unwanted visual artifacts if not used correctly, + * for example if the backgroundColor of the wrapped view isn't explicitly set to an opaque color. + * + * NOTE: TouchableHighlight supports only one child + * If you wish to have several child components, wrap them in a View. + * + * @see https://facebook.github.io/react-native/docs/touchablehighlight.html + */ + export interface TouchableHighlightStatic extends React.ComponentClass { + } + + + /** + * @see https://facebook.github.io/react-native/docs/touchableopacity.html#props + */ + export interface TouchableOpacityProperties extends TouchableWithoutFeedbackProperties, React.Props { + /** + * Determines what the opacity of the wrapped view should be when touch is active. + * Defaults to 0.2 + */ + activeOpacity?: number + } + + /** + * A wrapper for making views respond properly to touches. + * On press down, the opacity of the wrapped view is decreased, dimming it. + * This is done without actually changing the view hierarchy, + * and in general is easy to add to an app without weird side-effects. + * + * @see https://facebook.github.io/react-native/docs/touchableopacity.html + */ + export interface TouchableOpacityStatic extends React.ComponentClass { + } + + + /** + * @see https://facebook.github.io/react-native/docs/touchableopacity.html#props + */ + export interface TouchableNativeFeedbackProperties extends TouchableWithoutFeedbackProperties, React.Props { + /** + * Determines the type of background drawable that's going to be used to display feedback. + * It takes an object with type property and extra data depending on the type. + * It's recommended to use one of the following static methods to generate that dictionary: + * 1) TouchableNativeFeedback.SelectableBackground() - will create object that represents android theme's default background for selectable elements (?android:attr/selectableItemBackground) + * 2) TouchableNativeFeedback.SelectableBackgroundBorderless() - will create object that represent android theme's default background for borderless selectable elements (?android:attr/selectableItemBackgroundBorderless). Available on android API level 21+ + * 3) TouchableNativeFeedback.Ripple(color, borderless) - will create object that represents ripple drawable with specified color (as a string). If property borderless evaluates to true the ripple will render outside of the view bounds (see native actionbar buttons as an example of that behavior). This background type is available on Android API level 21+ + */ + background?: any + } + + /** + * A wrapper for making views respond properly to touches (Android only). + * On Android this component uses native state drawable to display touch feedback. + * At the moment it only supports having a single View instance as a child node, + * as it's implemented by replacing that View with another instance of RCTView node with some additional properties set. + * + * Background drawable of native feedback touchable can be customized with background property. + * + * @see https://facebook.github.io/react-native/docs/touchablenativefeedback.html#content + */ + export interface TouchableNativeFeedbackStatic extends React.ComponentClass { + SelectableBackground: () => TouchableNativeFeedbackStatic + SelectableBackgroundBorderless: () => TouchableNativeFeedbackStatic + Ripple: ( color: string, borderless?: boolean ) => TouchableNativeFeedbackStatic + } + + + export interface LeftToRightGesture { + //TODO: + } + + export interface AnimationInterpolator { + //TODO: + } + + // see /NavigatorSceneConfigs.js + export interface SceneConfig { + // A list of all gestures that are enabled on this scene + gestures: { + pop: LeftToRightGesture, + }, + + // Rebound spring parameters when transitioning FROM this scene + springFriction: number; + springTension: number; + + // Velocity to start at when transitioning without gesture + defaultTransitionVelocity: number; + + // Animation interpolators for horizontal transitioning: + animationInterpolators: { + into: AnimationInterpolator, + out: AnimationInterpolator + }; + + } + + // see /NavigatorSceneConfigs.js + export interface SceneConfigs { + FloatFromBottom: SceneConfig; + FloatFromRight: SceneConfig; + PushFromRight: SceneConfig; + FloatFromLeft: SceneConfig; + HorizontalSwipeJump: SceneConfig; + } + + export interface Route { + component?: ComponentClass + id?: string + title?: string + passProps?: Object; + + //anything else + [key: string]: any + + //Commonly found properties + backButtonTitle?: string + content?: string + message?: string; + index?: number + onRightButtonPress?: () => void + rightButtonTitle?: string + sceneConfig?: SceneConfig + wrapperStyle?: any + } + + + /** + * @see https://facebook.github.io/react-native/docs/navigator.html#content + */ + export interface NavigatorProperties extends React.Props { + /** + * Optional function that allows configuration about scene animations and gestures. + * Will be invoked with the route and should return a scene configuration object + * @param route + */ + configureScene?: ( route: Route ) => SceneConfig + /** + * Specify a route to start on. + * A route is an object that the navigator will use to identify each scene to render. + * initialRoute must be a route in the initialRouteStack if both props are provided. + * The initialRoute will default to the last item in the initialRouteStack. + */ + initialRoute?: Route + /** + * Provide a set of routes to initially mount. + * Required if no initialRoute is provided. + * Otherwise, it will default to an array containing only the initialRoute + */ + initialRouteStack?: Route[] + + /** + * Optionally provide a navigation bar that persists across scene transitions + */ + navigationBar?: React.ReactElement + + /** + * Optionally provide the navigator object from a parent Navigator + */ + navigator?: Navigator + + /** + * @deprecated Use navigationContext.addListener('willfocus', callback) instead. + */ + onDidFocus?: Function + + /** + * @deprecated Use navigationContext.addListener('willfocus', callback) instead. + */ + onWillFocus?: Function + + /** + * Required function which renders the scene for a given route. + * Will be invoked with the route and the navigator object + * @param route + * @param navigator + */ + renderScene?: ( route: Route, navigator: Navigator ) => React.ReactElement + + /** + * Styles to apply to the container of each scene + */ + sceneStyle?: ViewStyle + + /** + * //FIXME: not found in doc but found in examples + */ + debugOverlay?: boolean + + } + + /** + * Use Navigator to transition between different scenes in your app. + * To accomplish this, provide route objects to the navigator to identify each scene, + * and also a renderScene function that the navigator can use to render the scene for a given route. + * + * To change the animation or gesture properties of the scene, provide a configureScene prop to get the config object for a given route. + * See Navigator.SceneConfigs for default animations and more info on scene config options. + * @see https://facebook.github.io/react-native/docs/navigator.html + */ + export interface NavigatorStatic extends React.ComponentClass { + SceneConfigs: SceneConfigs; + NavigationBar: NavigatorStatic.NavigationBarStatic; + BreadcrumbNavigationBar: NavigatorStatic.BreadcrumbNavigationBarStatic + + getContext( self: any ): NavigatorStatic; + + /** + * returns the current list of routes + */ + getCurrentRoutes(): Route[]; + + /** + * Jump backward without unmounting the current scen + */ + jumpBack(): void; + + /** + * Jump forward to the next scene in the route stack + */ + jumpForward(): void; + + /** + * Transition to an existing scene without unmounting + */ + jumpTo( route: Route ): void; + + /** + * Navigate forward to a new scene, squashing any scenes that you could jumpForward to + */ + push( route: Route ): void; + + /** + * Transition back and unmount the current scene + */ + pop(): void; + + /** + * Replace the current scene with a new route + */ + replace( route: Route ): void; + + /** + * Replace a scene as specified by an index + */ + replaceAtIndex( route: Route, index: number ): void; + + /** + * Replace the previous scene + */ + replacePrevious( route: Route ): void; + + /** + * Reset every scene with an array of routes + */ + immediatelyResetRouteStack( routes: Route[] ): void; + + /** + * Pop to a particular scene, as specified by its route. All scenes after it will be unmounted + */ + popToRoute( route: Route ): void; + + /** + * Pop to the first scene in the stack, unmounting every other scene + */ + popToTop(): void; + + } + + namespace NavigatorStatic { + + + export interface NavState { + routeStack: Route[] + idStack: number[] + presentedIndex: number + } + + export interface NavigationBarStyle { + //TODO @see NavigationBarStyle.ios.js + } + + + export interface NavigationBarRouteMapper { + Title: ( route: Route, nav: Navigator, index: number, navState: NavState ) => React.ReactElement; + LeftButton: ( route: Route, nav: Navigator, index: number, navState: NavState )=> React.ReactElement; + RightButton: ( route: Route, nav: Navigator, index: number, navState: NavState )=> React.ReactElement; + } + + /** + * @see NavigatorNavigationBar.js + */ + export interface NavigationBarProperties extends React.Props { + navigator?: Navigator + routeMapper?: NavigationBarRouteMapper + navState?: NavState + style?: ViewStyle + } + + export interface NavigationBarStatic extends React.ComponentClass { + Styles: NavigationBarStyle + + } + + export type NavigationBar = NavigationBarStatic + export var NavigationBar: NavigationBarStatic + + + export interface BreadcrumbNavigationBarStyle { + //TODO &see NavigatorBreadcrumbNavigationBar.js + } + + export interface BreadcrumbNavigationBarRouteMapper { + rightContentForRoute: ( route: Route, navigator: Navigator ) => React.ReactElement + titleContentForRoute: ( route: Route, navigator: Navigator ) => React.ReactElement + iconForRoute: ( route: Route, navigator: Navigator ) => React.ReactElement + //in samples... + separatorForRoute: ( route: Route, navigator: Navigator ) => React.ReactElement + } + + /** + * @see NavigatorNavigationBar.js + */ + export interface BreadcrumbNavigationBarProperties extends React.Props { + navigator?: Navigator + routeMapper?: BreadcrumbNavigationBarRouteMapper + navState?: NavState + style?: ViewStyle + } + + export interface BreadcrumbNavigationBarStatic extends React.ComponentClass { + Styles: BreadcrumbNavigationBarStyle + } + + export type BreadcrumbNavigationBar = BreadcrumbNavigationBarStatic + var BreadcrumbNavigationBar: BreadcrumbNavigationBarStatic + + } + + + export interface StyleSheetStatic extends React.ComponentClass { + create( styles: T ): T; + } + + /** + * //FIXME: Could not find docs. Inferred from examples and jscode : ListViewDataSource.js + */ + export interface DataSourceAssetCallback { + rowHasChanged?: ( r1: any, r2: any ) => boolean + sectionHeaderHasChanged?: ( h1: any, h2: any ) => boolean + getRowData?: ( dataBlob: any, sectionID: number | string, rowID: number | string ) => T + getSectionHeaderData?: ( dataBlob: any, sectionID: number | string ) => T + } + + /** + * //FIXME: Could not find docs. Inferred from examples and js code: ListViewDataSource.js + */ + export interface ListViewDataSource { + new( onAsset: DataSourceAssetCallback ): ListViewDataSource; + /** + * Clones this `ListViewDataSource` with the specified `dataBlob` and + * `rowIdentities`. The `dataBlob` is just an aribitrary blob of data. At + * construction an extractor to get the interesting informatoin was defined + * (or the default was used). + * + * The `rowIdentities` is is a 2D array of identifiers for rows. + * ie. [['a1', 'a2'], ['b1', 'b2', 'b3'], ...]. If not provided, it's + * assumed that the keys of the section data are the row identities. + * + * Note: This function does NOT clone the data in this data source. It simply + * passes the functions defined at construction to a new data source with + * the data specified. If you wish to maintain the existing data you must + * handle merging of old and new data separately and then pass that into + * this function as the `dataBlob`. + */ + cloneWithRows( dataBlob: Array | {[key: string ]: any}, rowIdentities?: Array ): ListViewDataSource + + /** + * This performs the same function as the `cloneWithRows` function but here + * you also specify what your `sectionIdentities` are. If you don't care + * about sections you should safely be able to use `cloneWithRows`. + * + * `sectionIdentities` is an array of identifiers for sections. + * ie. ['s1', 's2', ...]. If not provided, it's assumed that the + * keys of dataBlob are the section identities. + * + * Note: this returns a new object! + */ + cloneWithRowsAndSections( dataBlob: Array | {[key: string]: any}, sectionIdentities?: Array, rowIdentities?: Array> ): ListViewDataSource + + getRowCount(): number + + /** + * Gets the data required to render the row. + */ + getRowData( sectionIndex: number, rowIndex: number ): any + + /** + * Gets the rowID at index provided if the dataSource arrays were flattened, + * or null of out of range indexes. + */ + getRowIDForFlatIndex( index: number ): string + + /** + * Gets the sectionID at index provided if the dataSource arrays were flattened, + * or null for out of range indexes. + */ + getSectionIDForFlatIndex( index: number ): string + + /** + * Returns an array containing the number of rows in each section + */ + getSectionLengths(): Array + + /** + * Returns if the section header is dirtied and needs to be rerendered + */ + sectionHeaderShouldUpdate( sectionIndex: number ): boolean + + /** + * Gets the data required to render the section header + */ + getSectionHeaderData( sectionIndex: number ): any + } + + + /** + * @see https://facebook.github.io/react-native/docs/tabbarios-item.html#props + */ + export interface TabBarItemProperties extends React.Props { + + /** + * Little red bubble that sits at the top right of the icon. + */ + badge?: string | number + + /** + * A custom icon for the tab. It is ignored when a system icon is defined. + */ + icon?: {uri: string} | string + + /** + * Callback when this tab is being selected, + * you should change the state of your component to set selected={true}. + */ + onPress?: () => void + + /** + * It specifies whether the children are visible or not. If you see a blank content, you probably forgot to add a selected one. + */ + selected?: boolean + + /** + * A custom icon when the tab is selected. + * It is ignored when a system icon is defined. If left empty, the icon will be tinted in blue. + */ + selectedIcon?: {uri: string} | string; + + /** + * React style object. + */ + style?: ViewStyle + + /** + * Items comes with a few predefined system icons. + * Note that if you are using them, the title and selectedIcon will be overriden with the system ones. + * + * enum('bookmarks', 'contacts', 'downloads', 'favorites', 'featured', 'history', 'more', 'most-recent', 'most-viewed', 'recents', 'search', 'top-rated') + */ + systemIcon: string + + /** + * Text that appears under the icon. It is ignored when a system icon is defined. + */ + title?: string + + } + + export interface TabBarItemStatic extends React.ComponentClass { + } + + /** + * @see https://facebook.github.io/react-native/docs/tabbarios.html#props + */ + export interface TabBarIOSProperties extends React.Props { + + /** + * Background color of the tab bar + */ + barTintColor?: string + + style?: ViewStyle + + /** + * Color of the currently selected tab icon + */ + tintColor?: string + + /** + * A Boolean value that indicates whether the tab bar is translucent + */ + translucent?: boolean + } + + export interface TabBarIOSStatic extends React.ComponentClass { + Item: TabBarItemStatic; + } + + + export interface PixelRatioStatic { + get(): number; + } + + export interface DeviceEventSubscriptionStatic { + remove(): void; + } + + export interface DeviceEventEmitterStatic { + addListener( type: string, onReceived: ( data: T ) => void ): DeviceEventSubscription; + } + + // Used by Dimensions below + export interface ScaledSize { + width: number; + height: number; + scale: number; + } + + + export interface InteractionManagerStatic { + runAfterInteractions( fn: () => void ): void; + } + + + export interface ScrollViewStyle extends FlexStyle, TransformsStyle { + + backfaceVisibility?:string //enum('visible', 'hidden') + backgroundColor?: string + borderColor?: string + borderTopColor?: string + borderRightColor?: string + borderBottomColor?: string + borderLeftColor?: string + borderRadius?: number + borderTopLeftRadius?: number + borderTopRightRadius?: number + borderBottomLeftRadius?: number + borderBottomRightRadius?: number + borderStyle?: string //enum('solid', 'dotted', 'dashed') + borderWidth?: number + borderTopWidth?: number + borderRightWidth?: number + borderBottomWidth?: number + borderLeftWidth?: number + opacity?: number + overflow?: string //enum('visible', 'hidden') + shadowColor?: string + shadowOffset?: {width: number; height: number} + shadowOpacity?: number + shadowRadius?: number + } + + + export interface ScrollViewIOSProperties { + + /** + * When true the scroll view bounces horizontally when it reaches the end + * even if the content is smaller than the scroll view itself. The default + * value is true when `horizontal={true}` and false otherwise. + */ + alwaysBounceHorizontal?: boolean + /** + * When true the scroll view bounces vertically when it reaches the end + * even if the content is smaller than the scroll view itself. The default + * value is false when `horizontal={true}` and true otherwise. + */ + alwaysBounceVertical?: boolean + + /** + * Controls whether iOS should automatically adjust the content inset for scroll views that are placed behind a navigation bar or tab bar/ toolbar. + * The default value is true. + */ + automaticallyAdjustContentInsets?: boolean // true + + /** + * When true the scroll view bounces when it reaches the end of the + * content if the content is larger then the scroll view along the axis of + * the scroll direction. When false it disables all bouncing even if + * the `alwaysBounce*` props are true. The default value is true. + */ + bounces?: boolean + /** + * When true gestures can drive zoom past min/max and the zoom will animate + * to the min/max value at gesture end otherwise the zoom will not exceed + * the limits. + */ + bouncesZoom?: boolean + + /** + * When false once tracking starts won't try to drag if the touch moves. + * The default value is true. + */ + canCancelContentTouches?: boolean + + /** + * When true the scroll view automatically centers the content when the + * content is smaller than the scroll view bounds; when the content is + * larger than the scroll view this property has no effect. The default + * value is false. + */ + centerContent?: boolean + + + /** + * The amount by which the scroll view content is inset from the edges of the scroll view. + * Defaults to {0, 0, 0, 0}. + */ + contentInset?: Insets // zeros + + /** + * Used to manually set the starting scroll offset. + * The default value is {x: 0, y: 0} + */ + contentOffset?: PointProperties // zeros + + /** + * A floating-point number that determines how quickly the scroll view + * decelerates after the user lifts their finger. Reasonable choices include + * - Normal: 0.998 (the default) + * - Fast: 0.9 + */ + decelerationRate?: number + + /** + * When true the ScrollView will try to lock to only vertical or horizontal + * scrolling while dragging. The default value is false. + */ + directionalLockEnabled?: boolean + + /** + * The maximum allowed zoom scale. The default value is 1.0. + */ + maximumZoomScale?: number + + /** + * The minimum allowed zoom scale. The default value is 1.0. + */ + minimumZoomScale?: number + + /** + * Called when a scrolling animation ends. + */ + onScrollAnimationEnd?: () => void + + /** + * When true the scroll view stops on multiples of the scroll view's size + * when scrolling. This can be used for horizontal pagination. The default + * value is false. + */ + pagingEnabled?: boolean + + /** + * When false, the content does not scroll. The default value is true + */ + scrollEnabled?: boolean // true + + /** + * This controls how often the scroll event will be fired while scrolling (in events per seconds). + * A higher number yields better accuracy for code that is tracking the scroll position, + * but can lead to scroll performance problems due to the volume of information being send over the bridge. + * The default value is zero, which means the scroll event will be sent only once each time the view is scrolled. + */ + scrollEventThrottle?: number // null + + /** + * The amount by which the scroll view indicators are inset from the edges of the scroll view. + * This should normally be set to the same value as the contentInset. + * Defaults to {0, 0, 0, 0}. + */ + scrollIndicatorInsets?: Insets //zeroes + + /** + * When true the scroll view scrolls to top when the status bar is tapped. + * The default value is true. + */ + scrollsToTop?: boolean + + /** + * When snapToInterval is set, snapToAlignment will define the relationship of the the snapping to the scroll view. + * - start (the default) will align the snap at the left (horizontal) or top (vertical) + * - center will align the snap in the center + * - end will align the snap at the right (horizontal) or bottom (vertical) + */ + snapToAlignment?: string + + /** + * When set, causes the scroll view to stop at multiples of the value of snapToInterval. + * This can be used for paginating through children that have lengths smaller than the scroll view. + * Used in combination with snapToAlignment. + */ + snapToInterval?: number + + /** + * An array of child indices determining which children get docked to the + * top of the screen when scrolling. For example passing + * `stickyHeaderIndices={[0]}` will cause the first child to be fixed to the + * top of the scroll view. This property is not supported in conjunction + * with `horizontal={true}`. + */ + stickyHeaderIndices?: number[] + + /** + * The current scale of the scroll view content. The default value is 1.0. + */ + zoomScale?: number + } + + export interface ScrollViewProperties extends ScrollViewIOSProperties, Touchable { + + /** + * These styles will be applied to the scroll view content container which + * wraps all of the child views. Example: + * + * return ( + * + * + * ); + * ... + * var styles = StyleSheet.create({ + * contentContainer: { + * paddingVertical: 20 + * } + * }); + */ + contentContainerStyle?: ViewStyle + + /** + * When true the scroll view's children are arranged horizontally in a row + * instead of vertically in a column. The default value is false. + */ + horizontal?: boolean + + /** + * Determines whether the keyboard gets dismissed in response to a drag. + * - 'none' (the default) drags do not dismiss the keyboard. + * - 'onDrag' the keyboard is dismissed when a drag begins. + * - 'interactive' the keyboard is dismissed interactively with the drag + * and moves in synchrony with the touch; dragging upwards cancels the + * dismissal. + */ + keyboardDismissMode?: string + + /** + * When false tapping outside of the focused text input when the keyboard + * is up dismisses the keyboard. When true the scroll view will not catch + * taps and the keyboard will not dismiss automatically. The default value + * is false. + */ + keyboardShouldPersistTaps?: boolean + + /** + * Fires at most once per frame during scrolling. + * The frequency of the events can be contolled using the scrollEventThrottle prop. + */ + onScroll?: () => void + + /** + * Experimental: When true offscreen child views (whose `overflow` value is + * `hidden`) are removed from their native backing superview when offscreen. + * This canimprove scrolling performance on long lists. The default value is + * false. + */ + removeClippedSubviews?: boolean + + /** + * When true, shows a horizontal scroll indicator. + */ + showsHorizontalScrollIndicator?: boolean + + /** + * When true, shows a vertical scroll indicator. + */ + showsVerticalScrollIndicator?: boolean + + /** + * Style + */ + style?: ScrollViewStyle + } + + export interface ScrollViewProps extends ScrollViewProperties, React.Props { + + } + + interface ScrollViewStatic extends React.ComponentClass { + + } + + + export interface NativeScrollRectangle { + left: number; + top: number; + bottom: number; + right: number; + } + + export interface NativeScrollPoint { + x: number; + y: number; + } + + export interface NativeScrollSize { + height: number; + width: number; + } + + export interface NativeScrollEvent { + contentInset: NativeScrollRectangle; + contentOffset: NativeScrollPoint; + contentSize: NativeScrollSize; + layoutMeasurement: NativeScrollSize; + zoomScale: number; + } + + + ////////////////////////////////////////////////////////////////////////// + // + // A P I s + // + ////////////////////////////////////////////////////////////////////////// + + /** + * //FIXME: no documentation - inferred from RCTACtionSheetManager.m + */ + export interface ActionSheetIOSOptions { + title?: string + options?: string[] + cancelButtonIndex?: number + destructiveButtonIndex?: number + } + + /** + * //FIXME: no documentation - inferred from RCTACtionSheetManager.m + */ + export interface ShareActionSheetIOSOptions { + message?: string + url?: string + } + + /** + * @see https://facebook.github.io/react-native/docs/actionsheetios.html#content + * //FIXME: no documentation - inferred from RCTACtionSheetManager.m + */ + export interface ActionSheetIOSStatic { + showActionSheetWithOptions: ( options: ActionSheetIOSOptions, callback: ( buttonIndex: number ) => void ) => void + showShareActionSheetWithOptions: ( options: ShareActionSheetIOSOptions, failureCallback: ( error: Error ) => void, successCallback: ( success: boolean, method: string ) => void ) => void + } + + + /** + * //FIXME: No documentation - inferred from RCTAdSupport.m + */ + export interface AdSupportIOSStatic { + getAdvertisingId: ( onSuccess: ( deviceId: string ) => void, onFailure: ( err: Error ) => void ) => void + getAdvertisingTrackingEnabled: ( onSuccess: ( hasTracking: boolean ) => void, onFailure: ( err: Error ) => void ) => void + } + + interface AlertIOSButton { + text: string + onPress?: () => void + } + + /** + * Launches an alert dialog with the specified title and message. + * + * Optionally provide a list of buttons. + * Tapping any button will fire the respective onPress callback and dismiss the alert. + * By default, the only button will be an 'OK' button + * + * The last button in the list will be considered the 'Primary' button and it will appear bold. + * + * @see https://facebook.github.io/react-native/docs/alertios.html#content + */ + export interface AlertIOSStatic { + alert: ( title: string, message?: string, buttons?: Array, type?: string ) => void + prompt: ( title: string, value?: string, buttons?: Array, callback?: ( value?: string ) => void ) => void + } + + + /** + * AppStateIOS can tell you if the app is in the foreground or background, + * and notify you when the state changes. + * + * AppStateIOS is frequently used to determine the intent and proper behavior + * when handling push notifications. + * + * iOS App States + * active - The app is running in the foreground + * background - The app is running in the background. The user is either in another app or on the home screen + * inactive - This is a transition state that currently never happens for typical React Native apps. + * + * For more information, see Apple's documentation: https://developer.apple.com/library/ios/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/TheAppLifeCycle/TheAppLifeCycle.html + * + * @see https://facebook.github.io/react-native/docs/appstateios.html#content + */ + export interface AppStateIOSStatic { + currentState: string + addEventListener( type: string, listener: ( state: string ) => void ): void + removeEventListener( type: string, listener: ( state: string ) => void ): void + } + + /** + * AsyncStorage is a simple, asynchronous, persistent, key-value storage system that is global to the app. + * It should be used instead of LocalStorage. + * + * It is recommended that you use an abstraction on top of AsyncStorage + * instead of AsyncStorage directly for anything more than light usage since it operates globally. + * + * @see https://facebook.github.io/react-native/docs/asyncstorage.html#content + */ + export interface AsyncStorageStatic { + + /** + * Fetches key and passes the result to callback, along with an Error if there is any. + */ + getItem( key: string, callback?: ( error?: Error, result?: string ) => void ): Promise + + /** + * Sets value for key and calls callback on completion, along with an Error if there is any + */ + setItem( key: string, value: string, callback?: ( error?: Error ) => void ): Promise + + removeItem( key: string, callback?: ( error?: Error ) => void ): Promise + + /** + * Merges existing value with input value, assuming they are stringified json. Returns a Promise object. + * Not supported by all native implementation + */ + mergeItem( key: string, value: string, callback?: ( error?: Error ) => void ): Promise + + /** + * Erases all AsyncStorage for all clients, libraries, etc. You probably don't want to call this. + * Use removeItem or multiRemove to clear only your own keys instead. + */ + clear( callback?: ( error?: Error ) => void ): Promise + + /** + * Gets all keys known to the app, for all callers, libraries, etc + */ + getAllKeys( callback?: ( error?: Error, keys?: string[] ) => void ): Promise + + /** + * multiGet invokes callback with an array of key-value pair arrays that matches the input format of multiSet + */ + multiGet( keys: string[], callback?: ( errors?: Error[], result?: string[][] ) => void ): Promise + + /** + * multiSet and multiMerge take arrays of key-value array pairs that match the output of multiGet, + * + * multiSet([['k1', 'val1'], ['k2', 'val2']], cb); + */ + multiSet( keyValuePairs: string[][], callback?: ( errors?: Error[] ) => void ): Promise + + /** + * Delete all the keys in the keys array. + */ + multiRemove( keys: string[], callback?: ( errors?: Error[] ) => void ): Promise + + /** + * Merges existing values with input values, assuming they are stringified json. + * Returns a Promise object. + * + * Not supported by all native implementations. + */ + multiMerge( keyValuePairs: string[][], callback?: ( errors?: Error[] ) => void ): Promise + } + + + export interface CameraRollFetchParams { + first: number; + after?: string; + groupTypes: string; // 'Album','All','Event','Faces','Library','PhotoStream','SavedPhotos' + groupName?: string + assetType?: string + } + + export interface CameraRollNodeInfo { + image: Image; + group_name: string; + timestamp: number; + location: any; + } + + export interface CameraRollEdgeInfo { + node: CameraRollNodeInfo; + } + + export interface CameraRollAssetInfo { + edges: CameraRollEdgeInfo[]; + page_info: { + has_next_page: boolean; + end_cursor: string; + }; + } + + /** + * CameraRoll provides access to the local camera roll / gallery. + */ + export interface CameraRollStatic { + + GroupTypesOptions: string[] //'Album','All','Event','Faces','Library','PhotoStream','SavedPhotos' + + /** + * Saves the image to the camera roll / gallery. + * + * The CameraRoll API is not yet implemented for Android. + * + * @tag On Android, this is a local URI, such as "file:///sdcard/img.png". + * On iOS, the tag can be one of the following: + * local URI + * assets-library tag + * a tag not maching any of the above, which means the image data will be stored in memory (and consume memory as long as the process is alive) + * + * @param successCallback Invoked with the value of tag on success. + * @param errorCallback Invoked with error message on error. + */ + saveImageWithTag( tag: string, successCallback: ( tag?: string ) => void, errorCallback: ( error: Error ) => void ): void + + /** + * Invokes callback with photo identifier objects from the local camera roll of the device matching shape defined by getPhotosReturnChecker. + * + * @param {object} params See getPhotosParamChecker. + * @param {function} callback Invoked with arg of shape defined by getPhotosReturnChecker on success. + * @param {function} errorCallback Invoked with error message on error. + */ + getPhotos( fetch: CameraRollFetchParams, + callback: ( assetInfo: CameraRollAssetInfo ) => void, + errorCallback: ( error: Error )=> void ): void; + } + + export interface FetchableListenable { + fetch: () => Promise + + /** + * eventName is expected to be `change` + * //FIXME: No doc - inferred from NetInfo.js + */ + addEventListener: ( eventName: string, listener: ( result: T ) => void ) => void + + /** + * eventName is expected to be `change` + * //FIXME: No doc - inferred from NetInfo.js + */ + removeEventListener: ( eventName: string, listener: ( result: T ) => void ) => void + } + + /** + * NetInfo exposes info about online/offline status + * + * Asynchronously determine if the device is online and on a cellular network. + * + * - `none` - device is offline + * - `wifi` - device is online and connected via wifi, or is the iOS simulator + * - `cell` - device is connected via Edge, 3G, WiMax, or LTE + * - `unknown` - error case and the network status is unknown + + * @see https://facebook.github.io/react-native/docs/netinfo.html#content + */ + export interface NetInfoStatic extends FetchableListenable { + + /** + * + * Available on all platforms. + * Asynchronously fetch a boolean to determine internet connectivity. + */ + isConnected: FetchableListenable + + //FIXME: Documentation missing + isConnectionMetered: any + } + + + export interface PanResponderGestureState { + + /** + * ID of the gestureState- persisted as long as there at least one touch on + */ + stateID: number + + /** + * the latest screen coordinates of the recently-moved touch + */ + moveX: number + + /** + * the latest screen coordinates of the recently-moved touch + */ + moveY: number + + /** + * the screen coordinates of the responder grant + */ + x0: number + + /** + * the screen coordinates of the responder grant + */ + y0: number + + /** + * accumulated distance of the gesture since the touch started + */ + dx: number + + /** + * accumulated distance of the gesture since the touch started + */ + dy: number + + /** + * current velocity of the gesture + */ + vx: number + + /** + * current velocity of the gesture + */ + vy: number + + /** + * Number of touches currently on screeen + */ + numberActiveTouches: number + + + // All `gestureState` accounts for timeStamps up until: + _accountsForMovesUpTo: number + } + + + /** + * @see documentation of GestureResponderHandlers + */ + export interface PanResponderCallbacks { + onMoveShouldSetPanResponder?: ( e: GestureResponderEvent, gestureState: PanResponderGestureState ) => boolean + onStartShouldSetPanResponder?: ( e: GestureResponderEvent, gestureState: PanResponderGestureState ) => void + onPanResponderGrant?: ( e: GestureResponderEvent, gestureState: PanResponderGestureState ) => void + onPanResponderMove?: ( e: GestureResponderEvent, gestureState: PanResponderGestureState ) => void + onPanResponderRelease?: ( e: GestureResponderEvent, gestureState: PanResponderGestureState ) => void + onPanResponderTerminate?: ( e: GestureResponderEvent, gestureState: PanResponderGestureState ) => void + + onMoveShouldSetPanResponderCapture?: ( e: GestureResponderEvent, gestureState: PanResponderGestureState ) => boolean + onStartShouldSetPanResponderCapture?: ( e: GestureResponderEvent, gestureState: PanResponderGestureState ) => boolean + onPanResponderReject?: ( e: GestureResponderEvent, gestureState: PanResponderGestureState ) => void + onPanResponderStart?: ( e: GestureResponderEvent, gestureState: PanResponderGestureState ) => void + onPanResponderEnd?: ( e: GestureResponderEvent, gestureState: PanResponderGestureState ) => void + onPanResponderTerminationRequest?: ( e: GestureResponderEvent, gestureState: PanResponderGestureState ) => boolean + } + + export interface PanResponderInstance { + panHandlers: GestureResponderHandlers + } + + /** + * PanResponder reconciles several touches into a single gesture. + * It makes single-touch gestures resilient to extra touches, + * and can be used to recognize simple multi-touch gestures. + * + * It provides a predictable wrapper of the responder handlers provided by the gesture responder system. + * For each handler, it provides a new gestureState object alongside the normal event. + */ + export interface PanResponderStatic { + /** + * @param config Enhanced versions of all of the responder callbacks + * that provide not only the typical `ResponderSyntheticEvent`, but also the + * `PanResponder` gesture state. Simply replace the word `Responder` with + * `PanResponder` in each of the typical `onResponder*` callbacks. For + * example, the `config` object would look like: + * + * - `onMoveShouldSetPanResponder: (e, gestureState) => {...}` + * - `onMoveShouldSetPanResponderCapture: (e, gestureState) => {...}` + * - `onStartShouldSetPanResponder: (e, gestureState) => {...}` + * - `onStartShouldSetPanResponderCapture: (e, gestureState) => {...}` + * - `onPanResponderReject: (e, gestureState) => {...}` + * - `onPanResponderGrant: (e, gestureState) => {...}` + * - `onPanResponderStart: (e, gestureState) => {...}` + * - `onPanResponderEnd: (e, gestureState) => {...}` + * - `onPanResponderRelease: (e, gestureState) => {...}` + * - `onPanResponderMove: (e, gestureState) => {...}` + * - `onPanResponderTerminate: (e, gestureState) => {...}` + * - `onPanResponderTerminationRequest: (e, gestureState) => {...}` + * + * In general, for events that have capture equivalents, we update the + * gestureState once in the capture phase and can use it in the bubble phase + * as well. + * + * Be careful with onStartShould* callbacks. They only reflect updated + * `gestureState` for start/end events that bubble/capture to the Node. + * Once the node is the responder, you can rely on every start/end event + * being processed by the gesture and `gestureState` being updated + * accordingly. (numberActiveTouches) may not be totally accurate unless you + * are the responder. + */ + create( config: PanResponderCallbacks ): PanResponderInstance + } + + export interface PushNotificationPermissions { + alert?: boolean + badge?: boolean + sound?: boolean + } + + export interface PushNotification { + + + /** + * An alias for `getAlert` to get the notification's main message string + */ + getMessage(): string | Object + + /** + * Gets the sound string from the `aps` object + */ + getSound(): string + + /** + * Gets the notification's main message from the `aps` object + */ + getAlert(): string | Object + + /** + * Gets the badge count number from the `aps` object + */ + getBadgeCount(): number + + /** + * Gets the data object on the notif + */ + getData(): Object + + } + + + /** + * Handle push notifications for your app, including permission handling and icon badge number. + * @see https://facebook.github.io/react-native/docs/pushnotificationios.html#content + * + * //FIXME: BGR: The documentation seems completely off compared to the actual js implementation. I could never get the example to run + */ + export interface PushNotificationIOSStatic { + + /** + * Sets the badge number for the app icon on the home screen + */ + setApplicationIconBadgeNumber( number: number ): void + + /** + * Gets the current badge number for the app icon on the home screen + */ + getApplicationIconBadgeNumber( callback: ( badge: number ) => void ): void + + /** + * Attaches a listener to remote notifications while the app is running in the + * foreground or the background. + * + * The handler will get be invoked with an instance of `PushNotificationIOS` + * + * The type MUST be 'notification' + */ + addEventListener( type: string, handler: ( notification: PushNotification ) => void ):void + + /** + * Requests all notification permissions from iOS, prompting the user's + * dialog box. + */ + requestPermissions(): void + + /** + * See what push permissions are currently enabled. `callback` will be + * invoked with a `permissions` object: + * + * - `alert` :boolean + * - `badge` :boolean + * - `sound` :boolean + */ + checkPermissions( callback: ( permissions: PushNotificationPermissions ) => void ): void + + /** + * Removes the event listener. Do this in `componentWillUnmount` to prevent + * memory leaks + */ + removeEventListener( type: string, handler: ( notification: PushNotification ) => void ): void + + /** + * An initial notification will be available if the app was cold-launched + * from a notification. + * + * The first caller of `popInitialNotification` will get the initial + * notification object, or `null`. Subsequent invocations will return null. + */ + popInitialNotification(): PushNotification + } + + + /** + * @enum('default', 'light-content') + */ + export type StatusBarStyle = string + + /** + * @enum('none','fade', 'slide') + */ + type StatusBarAnimation = string + + + /** + * //FIXME: No documentation is available (although this is self explanatory) + * + * @see https://facebook.github.io/react-native/docs/statusbarios.html#content + */ + export interface StatusBarIOSStatic { + + setStyle(style: StatusBarStyle, animated?: boolean): void + + setHidden(hidden: boolean, animation?: StatusBarAnimation): void + + setNetworkActivityIndicatorVisible(visible: boolean): void + } + + /** + * The Vibration API is exposed at VibrationIOS.vibrate(). + * On iOS, calling this function will trigger a one second vibration. + * The vibration is asynchronous so this method will return immediately. + * + * There will be no effect on devices that do not support Vibration, eg. the iOS simulator. + * + * Vibration patterns are currently unsupported. + * + * @see https://facebook.github.io/react-native/docs/vibrationios.html#content + */ + export interface VibrationIOSStatic { + vibrate(): void + } + + ////////////////////////////////////////////////////////////////////////// + // + // R E - E X P O R T S + // + ////////////////////////////////////////////////////////////////////////// + + // export var AppRegistry: AppRegistryStatic; + + + export var ActivityIndicatorIOS: ActivityIndicatorIOSStatic + export type ActivityIndicatorIOS = ActivityIndicatorIOSStatic + + export var DatePickerIOS: DatePickerIOSStatic + export type DatePickerIOS = DatePickerIOSStatic + + export var Image: ImageStatic + export type Image = ImageStatic + + export var LayoutAnimation: LayoutAnimationStatic + export type LayoutAnimation = LayoutAnimationStatic + + export var ListView: ListViewStatic + export type ListView = ListViewStatic + + export var MapView: MapViewStatic + export type MapView = MapViewStatic + + export var Navigator: NavigatorStatic + export type Navigator = NavigatorStatic + + export var NavigatorIOS: NavigatorIOSStatic + export type NavigatorIOS = NavigatorIOSStatic + + export var PickerIOS: PickerIOSStatic + export type PickerIOS = PickerIOSStatic + + export var SliderIOS: SliderIOSStatic + export type SliderIOS = SliderIOSStatic + + export var ScrollView: ScrollViewStatic + export type ScrollView = ScrollViewStatic + + export var StyleSheet: StyleSheetStatic + export type StyleSheet = StyleSheetStatic + + export var SwitchIOS: SwitchIOSStatic + export type SwitchIOS = SwitchIOSStatic + + export var TabBarIOS: TabBarIOSStatic + export type TabBarIOS = TabBarIOSStatic + + export var Text: TextStatic + export type Text = TextStatic + + export var TextInput: TextInputStatic + export type TextInput = TextInputStatic + + export var TouchableHighlight: TouchableHighlightStatic + export type TouchableHighlight = TouchableHighlightStatic + + export var TouchableNativeFeedback: TouchableNativeFeedbackStatic + export type TouchableNativeFeedback = TouchableNativeFeedbackStatic + + export var TouchableOpacity: TouchableOpacityStatic + export type TouchableOpacity = TouchableOpacityStatic + + export var TouchableWithoutFeedback: TouchableWithoutFeedbackStatic + export type TouchableWithoutFeedback= TouchableWithoutFeedbackStatic + + export var View: ViewStatic + export type View = ViewStatic + + export var WebView: WebViewStatic + export type WebView = WebViewStatic + + + //////////// APIS ////////////// + export var ActionSheetIOS: ActionSheetIOSStatic + export type ActionSheetIOS = ActionSheetIOSStatic + + export var AdSupportIOS: AdSupportIOSStatic + export type AdSupportIOS = AdSupportIOSStatic + + export var AlertIOS: AlertIOSStatic + export type AlertIOS = AlertIOSStatic + + export var AppStateIOS: AppStateIOSStatic + export type AppStateIOS = AppStateIOSStatic + + export var AsyncStorage: AsyncStorageStatic + export type AsyncStorage = AsyncStorageStatic + + export var CameraRoll: CameraRollStatic + export type CameraRoll = CameraRollStatic + + export var NetInfo: NetInfoStatic + export type NetInfo = NetInfoStatic + + export var PanResponder: PanResponderStatic + export type PanResponder = PanResponderStatic + + export var PushNotificationIOS: PushNotificationIOSStatic + export type PushNotificationIOS = PushNotificationIOSStatic + + export var StatusBarIOS: StatusBarIOSStatic + export type StatusBarIOS = StatusBarIOSStatic + + export var VibrationIOS: VibrationIOSStatic + export type VibrationIOS = VibrationIOSStatic + + + // + // /TODO: BGR: These are leftovers of the initial port that must be revisited + // + + export var SegmentedControlIOS: React.ComponentClass + + export var PixelRatio: PixelRatioStatic + export var DeviceEventEmitter: DeviceEventEmitterStatic + export var DeviceEventSubscription: DeviceEventSubscriptionStatic + export type DeviceEventSubscription = DeviceEventSubscriptionStatic + export var InteractionManager: InteractionManagerStatic + + ////////////////////////////////////////////////////////////////////////// + // + // Additional ( and controversial) + // + ////////////////////////////////////////////////////////////////////////// + + 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 + // + namespace addons { + + //FIXME: Documentation ? + export interface TestModuleStatic { + + verifySnapshot: ( done: ( indicator?: any ) => void ) => void + markTestPassed: ( indicator: any ) => void + markTestCompleted: () => void + } + + export var TestModule: TestModuleStatic + export type TestModule = TestModuleStatic + } + + +} + +declare module "react-native" { + + import ReactNative = __React + export default ReactNative +} + +declare var global: __React.GlobalStatic + +declare function require( name: string ): any + + +//TODO: BGR: this is a left-over from the initial port. Not sure it makes any sense +declare module "Dimensions" { + import React from 'react-native'; + + interface Dimensions { + get( what: string ): React.ScaledSize; + } + + var ExportDimensions: Dimensions; + export = ExportDimensions; +} diff --git a/react-redux/react-redux-tests.tsx b/react-redux/react-redux-tests.tsx index abbacabef..3254e6ec7 100644 --- a/react-redux/react-redux-tests.tsx +++ b/react-redux/react-redux-tests.tsx @@ -1,11 +1,13 @@ /// /// +/// /// -/// +/// /// import { Component, ReactElement } from 'react'; import * as React from 'react'; +import * as ReactDOM from 'react-dom'; import * as Router from 'react-router'; import { Route, RouterState } from 'react-router'; import { Store, Dispatch, bindActionCreators } from 'redux'; @@ -65,7 +67,7 @@ class App extends Component { const targetEl = document.getElementById('root'); -React.render(( +ReactDOM.render(( {() => } @@ -100,7 +102,7 @@ declare var addTodo: () => { type: string; }; declare var todoActionCreators: { [type: string]: (...args: any[]) => any; }; declare var counterActionCreators: { [type: string]: (...args: any[]) => any; }; -React.render( +ReactDOM.render( {() => } , @@ -108,7 +110,7 @@ React.render( ); Router.run(routes, Router.HistoryLocation, (Handler, routerState) => { // note "routerState" here - React.render( + ReactDOM.render( {/* //TODO: error TS2339: Property 'routerState' does not exist on type 'RouteProp'. @@ -121,7 +123,7 @@ Router.run(routes, Router.HistoryLocation, (Handler, routerState) => { // note " //TODO: for React Router 1.0 //TODO: error TS2604: JSX element type 'Router' does not have any construct or call signatures. -//React.render( +//ReactDOM.render( // // {() => ...} // , diff --git a/react-router/history.d.ts b/react-router/history.d.ts new file mode 100644 index 000000000..1b5c6dfad --- /dev/null +++ b/react-router/history.d.ts @@ -0,0 +1,192 @@ +// Type definitions for history v1.13.1 +// Project: https://github.com/rackt/history +// Definitions by: Sergey Buturlakin +// Definitions: https://github.com/borisyankov/DefinitelyTyped + + +declare namespace HistoryModule { + + // types based on https://github.com/rackt/history/blob/master/docs/Terms.md + + type Action = string + + type BeforeUnloadHook = () => string | boolean + + type CreateHistory = (options?: HistoryOptions) => T + + type CreateHistoryEnhancer = (createHistory: CreateHistory) => CreateHistory + + interface History { + listenBefore(hook: TransitionHook): Function + listen(listener: LocationListener): Function + transitionTo(location: Location): void + pushState(state: LocationState, path: Path): void + replaceState(state: LocationState, path: Path): void + push(path: Path): void + replace(path: Path): void + go(n: number): void + goBack(): void + goForward(): void + createKey(): LocationKey + createPath(path: Path): Path + createHref(path: Path): Href + createLocation(path?: Path, state?: LocationState, action?: Action, key?: LocationKey): Location + + /** @deprecated use location.key to save state instead */ + setState(state: LocationState): void + /** @deprecated use listenBefore instead */ + registerTransitionHook(hook: TransitionHook): void + /** @deprecated use the callback returned from listenBefore instead */ + unregisterTransitionHook(hook: TransitionHook): void + } + + type HistoryOptions = Object + + type Href = string + + type Location = { + pathname: Pathname + search: QueryString + query: Query + state: LocationState + action: Action + key: LocationKey + } + + type LocationKey = string + + type LocationListener = (location: Location) => void + + type LocationState = Object + + type Path = string // Pathname + QueryString + + type Pathname = string + + type Query = Object + + type QueryString = string + + type TransitionHook = (location: Location, callback: Function) => any + + + interface HistoryBeforeUnload { + listenBeforeUnload(hook: BeforeUnloadHook): Function + } + + interface HistoryQueries { + pushState(state: LocationState, pathname: Pathname | Path, query?: Query): void + replaceState(state: LocationState, pathname: Pathname | Path, query?: Query): void + createPath(path: Path, query?: Query): Path + createHref(path: Path, query?: Query): Href + } + + + // Global usage, without modules, needs the small trick, because lib.d.ts + // already has `history` and `History` global definitions: + // var createHistory = ((window as any).History as HistoryModule.Module).createHistory; + interface Module { + createHistory: CreateHistory + createHashHistory: CreateHistory + createMemoryHistory: CreateHistory + createLocation(path?: Path, state?: LocationState, action?: Action, key?: LocationKey): Location + useBasename(createHistory: CreateHistory): CreateHistory + useBeforeUnload(createHistory: CreateHistory): CreateHistory + useQueries(createHistory: CreateHistory): CreateHistory + actions: { + PUSH: string + REPLACE: string + POP: string + } + } + +} + + +declare module "history/lib/createBrowserHistory" { + + export default function createBrowserHistory(options?: HistoryModule.HistoryOptions): HistoryModule.History + +} + + +declare module "history/lib/createHashHistory" { + + export default function createHashHistory(options?: HistoryModule.HistoryOptions): HistoryModule.History + +} + + +declare module "history/lib/createMemoryHistory" { + + export default function createMemoryHistory(options?: HistoryModule.HistoryOptions): HistoryModule.History + +} + + +declare module "history/lib/createLocation" { + + export default function createLocation(path?: HistoryModule.Path, state?: HistoryModule.LocationState, action?: HistoryModule.Action, key?: HistoryModule.LocationKey): HistoryModule.Location + +} + + +declare module "history/lib/useBasename" { + + export default function useBasename(createHistory: HistoryModule.CreateHistory): HistoryModule.CreateHistory + +} + + +declare module "history/lib/useBeforeUnload" { + + export default function useBeforeUnload(createHistory: HistoryModule.CreateHistory): HistoryModule.CreateHistory + +} + + +declare module "history/lib/useQueries" { + + export default function useQueries(createHistory: HistoryModule.CreateHistory): HistoryModule.CreateHistory + +} + + +declare module "history/lib/actions" { + + export const PUSH: string + + export const REPLACE: string + + export const POP: string + + export default { + PUSH, + REPLACE, + POP + } + +} + + +declare module "history" { + + export { default as createHistory } from "history/lib/createBrowserHistory" + + export { default as createHashHistory } from "history/lib/createHashHistory" + + export { default as createMemoryHistory } from "history/lib/createMemoryHistory" + + export { default as createLocation } from "history/lib/createLocation" + + export { default as useBasename } from "history/lib/useBasename" + + export { default as useBeforeUnload } from "history/lib/useBeforeUnload" + + export { default as useQueries } from "history/lib/useQueries" + + import * as Actions from "history/lib/actions" + + export { Actions } + +} diff --git a/react-router/react-router-0.13.3.d.ts b/react-router/react-router-0.13.3.d.ts new file mode 100644 index 000000000..4cebcfab3 --- /dev/null +++ b/react-router/react-router-0.13.3.d.ts @@ -0,0 +1,354 @@ +// Type definitions for React Router 0.13.3 +// Project: https://github.com/rackt/react-router +// Definitions by: Yuichi Murata , Václav Ostrožlík +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module ReactRouter { + import React = __React; + + // + // Transition + // ---------------------------------------------------------------------- + interface Transition { + path: string; + abortReason: any; + retry(): void; + abort(reason?: any): void; + redirect(to: string, params?: {}, query?: {}): void; + cancel(): void; + from: (transition: Transition, routes: Route[], components?: React.ReactElement[], callback?: (error?: any) => void) => void; + to: (transition: Transition, routes: Route[], params?: {}, query?: {}, callback?: (error?: any) => void) => void; + } + + interface TransitionStaticLifecycle { + willTransitionTo?( + transition: Transition, + params: {}, + query: {}, + callback: Function + ): void; + + willTransitionFrom?( + transition: Transition, + component: React.ReactElement, + callback: Function + ): void; + } + + // + // Route Configuration + // ---------------------------------------------------------------------- + // DefaultRoute + interface DefaultRouteProp { + name?: string; + handler: React.ComponentClass; + } + interface DefaultRoute extends React.ReactElement {} + interface DefaultRouteClass extends React.ComponentClass {} + + // NotFoundRoute + interface NotFoundRouteProp { + name?: string; + handler: React.ComponentClass; + } + interface NotFoundRoute extends React.ReactElement {} + interface NotFoundRouteClass extends React.ComponentClass {} + + // Redirect + interface RedirectProp { + path?: string; + from?: string; + to?: string; + } + interface Redirect extends React.ReactElement {} + interface RedirectClass extends React.ComponentClass {} + + // Route + interface RouteProp { + name?: string; + path?: string; + handler?: React.ComponentClass; + ignoreScrollBehavior?: boolean; + } + interface Route extends React.ReactElement {} + interface RouteClass extends React.ComponentClass {} + + var DefaultRoute: DefaultRouteClass; + var NotFoundRoute: NotFoundRouteClass; + var Redirect: RedirectClass; + var Route: RouteClass; + + interface CreateRouteOptions { + name?: string; + path?: string; + ignoreScrollBehavior?: boolean; + isDefault?: boolean; + isNotFound?: boolean; + onEnter?: (transition: Transition, params: {}, query: {}, callback: Function) => void; + onLeave?: (transition: Transition, wtf: any, callback: Function) => void; + handler?: Function; + parentRoute?: Route; + } + + type CreateRouteCallback = (route: Route) => void; + + function createRoute(callback: CreateRouteCallback): Route; + function createRoute(options: CreateRouteOptions | string, callback: CreateRouteCallback): Route; + function createDefaultRoute(options?: CreateRouteOptions | string): Route; + function createNotFoundRoute(options?: CreateRouteOptions | string): Route; + + interface CreateRedirectOptions extends CreateRouteOptions { + path?: string; + from?: string; + to: string; + params?: {}; + query?: {}; + } + function createRedirect(options: CreateRedirectOptions): Redirect; + function createRoutesFromReactChildren(children: Route): Route[]; + + // + // Components + // ---------------------------------------------------------------------- + // Link + interface LinkProp extends React.HTMLAttributes { + activeClassName?: string; + activeStyle?: {}; + to: string; + params?: {}; + query?: {}; + } + interface Link extends React.ReactElement, Navigation, State { + handleClick(event: any): void; + getHref(): string; + getClassName(): string; + getActiveState(): boolean; + } + interface LinkClass extends React.ComponentClass {} + + // RouteHandler + interface RouteHandlerProp { } + interface RouteHandlerChildContext { + routeDepth: number; + } + interface RouteHandler extends React.ReactElement { + getChildContext(): RouteHandlerChildContext; + getRouteDepth(): number; + createChildRouteHandler(props: {}): RouteHandler; + } + interface RouteHandlerClass extends React.ComponentClass {} + + var Link: LinkClass; + var RouteHandler: RouteHandlerClass; + + + // + // Top-Level + // ---------------------------------------------------------------------- + interface Router extends React.ReactElement { + run(callback: RouterRunCallback): void; + } + + interface RouterState { + path: string; + action: string; + pathname: string; + params: {}; + query: {}; + routes: Route[]; + } + + interface RouterCreateOption { + routes: Route; + location?: LocationBase; + scrollBehavior?: ScrollBehaviorBase; + onError?: (error: any) => void; + onAbort?: (error: any) => void; + } + + type RouterRunCallback = (Handler: RouteClass, state: RouterState) => void; + + function create(options: RouterCreateOption): Router; + function run(routes: Route, callback: RouterRunCallback): Router; + function run(routes: Route, location: LocationBase | string, callback: RouterRunCallback): Router; + + + // + // Location + // ---------------------------------------------------------------------- + interface LocationBase { + getCurrentPath(): void; + toString(): string; + } + interface Location extends LocationBase { + push(path: string): void; + replace(path: string): void; + pop(): void; + } + + interface LocationListener { + addChangeListener(listener: Function): void; + removeChangeListener(listener: Function): void; + } + + interface HashLocation extends Location, LocationListener { } + interface HistoryLocation extends Location, LocationListener { } + interface RefreshLocation extends Location { } + interface StaticLocation extends LocationBase { } + interface TestLocation extends Location, LocationListener { } + + var HashLocation: HashLocation; + var HistoryLocation: HistoryLocation; + var RefreshLocation: RefreshLocation; + var StaticLocation: StaticLocation; + var TestLocation: TestLocation; + + + // + // Behavior + // ---------------------------------------------------------------------- + interface ScrollBehaviorBase { + updateScrollPosition(position: { x: number; y: number; }, actionType: string): void; + } + interface ImitateBrowserBehavior extends ScrollBehaviorBase { } + interface ScrollToTopBehavior extends ScrollBehaviorBase { } + + var ImitateBrowserBehavior: ImitateBrowserBehavior; + var ScrollToTopBehavior: ScrollToTopBehavior; + + + // + // Mixin + // ---------------------------------------------------------------------- + interface Navigation { + makePath(to: string, params?: {}, query?: {}): string; + makeHref(to: string, params?: {}, query?: {}): string; + transitionTo(to: string, params?: {}, query?: {}): void; + replaceWith(to: string, params?: {}, query?: {}): void; + goBack(): void; + } + + interface State { + getPath(): string; + getRoutes(): Route[]; + getPathname(): string; + getParams(): {}; + getQuery(): {}; + isActive(to: string, params?: {}, query?: {}): boolean; + } + + var Navigation: Navigation; + var State: State; + + + // + // History + // ---------------------------------------------------------------------- + interface History { + back(): void; + length: number; + } + var History: History; + + + // + // Context + // ---------------------------------------------------------------------- + interface Context { + makePath(to: string, params?: {}, query?: {}): string; + makeHref(to: string, params?: {}, query?: {}): string; + transitionTo(to: string, params?: {}, query?: {}): void; + replaceWith(to: string, params?: {}, query?: {}): void; + goBack(): void; + + getCurrentPath(): string; + getCurrentRoutes(): Route[]; + getCurrentPathname(): string; + getCurrentParams(): {}; + getCurrentQuery(): {}; + isActive(to: string, params?: {}, query?: {}): boolean; + } +} + +declare module "react-router" { + export = ReactRouter; +} + +declare module __React { + + // for DefaultRoute + function createElement( + type: ReactRouter.DefaultRouteClass, + props: ReactRouter.DefaultRouteProp, + ...children: __React.ReactNode[]): ReactRouter.DefaultRoute; + + // for Link + function createElement( + type: ReactRouter.LinkClass, + props: ReactRouter.LinkProp, + ...children: __React.ReactNode[]): ReactRouter.Link; + + // for NotFoundRoute + function createElement( + type: ReactRouter.NotFoundRouteClass, + props: ReactRouter.NotFoundRouteProp, + ...children: __React.ReactNode[]): ReactRouter.NotFoundRoute; + + // for Redirect + function createElement( + type: ReactRouter.RedirectClass, + props: ReactRouter.RedirectProp, + ...children: __React.ReactNode[]): ReactRouter.Redirect; + + // for Route + function createElement( + type: ReactRouter.RouteClass, + props: ReactRouter.RouteProp, + ...children: __React.ReactNode[]): ReactRouter.Route; + + // for RouteHandler + function createElement( + type: ReactRouter.RouteHandlerClass, + props: ReactRouter.RouteHandlerProp, + ...children: __React.ReactNode[]): ReactRouter.RouteHandler; +} + +declare module "react/addons" { + // for DefaultRoute + function createElement( + type: ReactRouter.DefaultRouteClass, + props: ReactRouter.DefaultRouteProp, + ...children: __React.ReactNode[]): ReactRouter.DefaultRoute; + + // for Link + function createElement( + type: ReactRouter.LinkClass, + props: ReactRouter.LinkProp, + ...children: __React.ReactNode[]): ReactRouter.Link; + + // for NotFoundRoute + function createElement( + type: ReactRouter.NotFoundRouteClass, + props: ReactRouter.NotFoundRouteProp, + ...children: __React.ReactNode[]): ReactRouter.NotFoundRoute; + + // for Redirect + function createElement( + type: ReactRouter.RedirectClass, + props: ReactRouter.RedirectProp, + ...children: __React.ReactNode[]): ReactRouter.Redirect; + + // for Route + function createElement( + type: ReactRouter.RouteClass, + props: ReactRouter.RouteProp, + ...children: __React.ReactNode[]): ReactRouter.Route; + + // for RouteHandler + function createElement( + type: ReactRouter.RouteHandlerClass, + props: ReactRouter.RouteHandlerProp, + ...children: __React.ReactNode[]): ReactRouter.RouteHandler; +} diff --git a/react-router/react-router-tests.ts b/react-router/react-router-tests.ts deleted file mode 100644 index 54b0545e2..000000000 --- a/react-router/react-router-tests.ts +++ /dev/null @@ -1,425 +0,0 @@ -/// -"use strict"; - -import React = require('react'); -import ReactAddons = require('react/addons'); -import Router = require('react-router'); - -// Mixin -class NavigationTest { - v: T; - - makePath() { - var v1: string = this.v.makePath('to'); - var v2: string = this.v.makePath('to', {id: 1}); - var v3: string = this.v.makePath('to', {id: 1}, {type: 'json'}); - } - makeHref() { - var v1: string = this.v.makeHref('to'); - var v2: string = this.v.makeHref('to', {id: 1}); - var v3: string = this.v.makeHref('to', {id: 1}, {type: 'json'}); - } - transitionTo() { - var v1: void = this.v.transitionTo('to'); - var v2: void = this.v.transitionTo('to', {id: 1}); - var v3: void = this.v.transitionTo('to', {id: 1}, {type: 'json'}); - } - replaceWith() { - var v1: void = this.v.replaceWith('to'); - var v2: void = this.v.replaceWith('to', {id: 1}); - var v3: void = this.v.replaceWith('to', {id: 1}, {type: 'json'}); - } - goBack() { - var v1: void = this.v.goBack(); - } -} - -class StateTest { - v: T; - - getPath() { - var v1: string = this.v.getPath(); - } - - getRoutes() { - var v1: Router.Route[] = this.v.getRoutes(); - } - - getPathname() { - var v1: string = this.v.getPathname(); - } - - getParams() { - var v1: {} = this.v.getParams(); - } - - getQuery() { - var v1: {} = this.v.getQuery(); - } - - isActive() { - var v1: boolean = this.v.isActive('to'); - var v2: boolean = this.v.isActive('to', {id: 1}); - var v3: boolean = this.v.isActive('to', {id: 1}, {type: 'json'}); - } -} - - -// Location -class LocationTest { - v: T; - - push() { - var v1: void = this.v.push('path/to/hoge'); - } - - replace() { - var v1: void = this.v.replace('path/to/hoge'); - } - - pop() { - var v1: void = this.v.pop(); - } - - getCurrentPath() { - var v1: void = this.v.getCurrentPath(); - } -} -new LocationTest(); -new LocationTest(); -new LocationTest(); - -class LocationListenerTest { - v: T; - - addChangeListener() { - var v1: void = this.v.addChangeListener(() => console.log(1)); - } - - removeChangeListener() { - var v1: void = this.v.removeChangeListener(() => console.log(1)); - } -} -new LocationListenerTest(); -new LocationListenerTest(); - - -// Behavior -class ScrollBehaviorTest { - v: T; - - updateScrollPosition() { - var v1: void = this.v.updateScrollPosition({x: 33, y: 102}, 'scrollTop'); - } -} -new ScrollBehaviorTest(); -new ScrollBehaviorTest(); - - -// Component -class DefaultRouteTest { - v: Router.DefaultRoute; - - props() { - var name: string = this.v.props.name; - var handler: React.ComponentClass = this.v.props.handler; - } - - createElement() { - var Handler: React.ComponentClass; - React.createElement(Router.DefaultRoute, null); - React.createElement(Router.DefaultRoute, {name: 'name', handler: Handler}); - - ReactAddons.createElement(Router.DefaultRoute, null); - ReactAddons.createElement(Router.DefaultRoute, {name: 'name', handler: Handler}); - } -} - -class LinkTest { - v: Router.Link; - - constructor() { - new NavigationTest(); - new StateTest(); - } - - props() { - var activeClassName: string = this.v.props.activeClassName; - var to: string = this.v.props.to; - var params: {} = this.v.props.params; - var query: {} = this.v.props.query; - var onClick: Function = this.v.props.onClick; - } - - getHref() { - var v1: string = this.v.getHref(); - } - - getClassName() { - var v1: string = this.v.getClassName(); - } - - createElement() { - React.createElement(Router.Link, null); - React.createElement(Router.Link, {to: 'home'}); - React.createElement(Router.Link, { - activeClassName: 'name', - to: 'home', - params: {}, - query: {}, - onClick: () => console.log(1) - }); - - ReactAddons.createElement(Router.Link, null); - ReactAddons.createElement(Router.Link, {to: 'home'}); - ReactAddons.createElement(Router.Link, { - activeClassName: 'name', - to: 'home', - params: {}, - query: {}, - onClick: () => console.log(1) - }); - } -} - -class NotFoundRouteTest { - v: Router.NotFoundRoute; - - props() { - var name: string = this.v.props.name; - var handler: React.ComponentClass = this.v.props.handler; - } - - createElement() { - var Handler: React.ComponentClass; - React.createElement(Router.NotFoundRoute, null); - React.createElement(Router.NotFoundRoute, {handler: Handler}); - React.createElement(Router.NotFoundRoute, {handler: Handler, name: "home"}); - - ReactAddons.createElement(Router.NotFoundRoute, null); - ReactAddons.createElement(Router.NotFoundRoute, {handler: Handler}); - ReactAddons.createElement(Router.NotFoundRoute, {handler: Handler, name: "home"}); - } -} - -class RedirectTest { - v: Router.Redirect; - - props() { - var path: string = this.v.props.path; - var from: string = this.v.props.from; - var to: string = this.v.props.to; - } - - createElement() { - React.createElement(Router.Redirect, null); - React.createElement(Router.Redirect, {}); - React.createElement(Router.Redirect, {path: 'a', from: 'a', to: 'b'}); - - ReactAddons.createElement(Router.Redirect, null); - ReactAddons.createElement(Router.Redirect, {}); - ReactAddons.createElement(Router.Redirect, {path: 'a', from: 'a', to: 'b'}); - } -} - -class RouteTest { - v: Router.Route; - - props() { - var name: string = this.v.props.name; - var path: string = this.v.props.path; - var handler: React.ComponentClass = this.v.props.handler; - var ignoreScrollBehavior: boolean = this.v.props.ignoreScrollBehavior; - } - - createElement() { - var Handler: React.ComponentClass; - React.createElement(Router.Route, null); - React.createElement(Router.Route, {}); - React.createElement(Router.Route, {name: "home", path: "/", handler: Handler, ignoreScrollBehavior: true}); - - ReactAddons.createElement(Router.Route, null); - ReactAddons.createElement(Router.Route, {}); - ReactAddons.createElement(Router.Route, {name: "home", path: "/", handler: Handler, ignoreScrollBehavior: true}); - } -} - -class RouteHandlerTest { - v: Router.RouteHandler; - - createElement() { - React.createElement(Router.RouteHandler, null); - React.createElement(Router.RouteHandler, {}); - - ReactAddons.createElement(Router.RouteHandler, null); - ReactAddons.createElement(Router.RouteHandler, {}); - } -} - - -// History -class HistoryTest { - v: Router.History; - - length() { - var v1: number = this.v.length; - } - - back() { - var v1: void = this.v.back(); - } -} - - -// Router -class CreateTest { - v: Router.Router; - - constructor() { - // React.createElement() version - this.v = Router.create({ - routes: React.createElement(Router.Route, null) - }); - this.v = Router.create({ - routes: React.createElement(Router.Route, null), - location: Router.HistoryLocation, - scrollBehavior: Router.ImitateBrowserBehavior - }); - - // React.createFactory() version - this.v = Router.create({ - routes: React.createFactory(Router.Route)() - }); - this.v = Router.create({ - routes: React.createFactory(Router.Route)(), - location: Router.HistoryLocation, - scrollBehavior: Router.ImitateBrowserBehavior - }); - } - - run() { - this.v.run((Handler) => console.log(Handler)); - this.v.run((Handler, state) => console.log(Handler, state)); - } -} - -class RunTest { - constructor() { - // React.createElement() version - var v1: Router.Router = Router.run(React.createElement(Router.Route, null), (Handler) => { - React.render(React.createElement(Handler, null), document.body); - }); - var v2: Router.Router = Router.run(React.createElement(Router.Route, null), Router.HistoryLocation, (Handler, state) => { - React.render(React.createElement(Handler, null), document.body); - }); - var v3: Router.Router = Router.run(React.createElement(Router.Route, null), '/foo/bar', (Handler, state) => { - React.render(React.createElement(Handler, null), document.body); - }); - - // React.createFactory() version - var v4: Router.Router = Router.run(React.createFactory(Router.Route)(), (Handler) => { - React.render(React.createElement(Handler, null), document.body); - }); - var v5: Router.Router = Router.run(React.createFactory(Router.Route)(), Router.HistoryLocation, (Handler, state) => { - React.render(React.createElement(Handler, null), document.body); - }); - var v6: Router.Router = Router.run(React.createFactory(Router.Route)(), '/foo/bar', (Handler, state) => { - React.render(React.createElement(Handler, null), document.body); - }); - } -} - - -// Transition -class TransitionTest { - constructor() { - var v1: Router.TransitionStaticLifecycle = { - willTransitionTo: (transition, params, query, callback) => { - transition.abort(); - transition.redirect('to'); - transition.redirect('to', {id: 1}); - transition.redirect('to', {id: 1}, {type: 'json'}); - transition.retry(); - }, - willTransitionFrom: (transition, component, callback) => {} - }; - var v2: Router.TransitionStaticLifecycle = { - willTransitionTo: (transition, params, query) => {}, - willTransitionFrom: (transition, component) => {} - }; - var v3: Router.TransitionStaticLifecycle = { - willTransitionTo: (transition, params) => {}, - willTransitionFrom: (transition) => {} - }; - var v4: Router.TransitionStaticLifecycle = { - willTransitionTo: (transition) => {}, - willTransitionFrom: () => {} - }; - var v5: Router.TransitionStaticLifecycle = { - willTransitionTo: () => {} - }; - var v6: Router.TransitionStaticLifecycle = { - willTransitionFrom: () => {} - }; - } -} - - -// Context -class ContextTest { - v: Router.Context - - makePath() { - var v1: string = this.v.makePath('home'); - var v2: string = this.v.makePath('home', {p1: 1}); - var v3: string = this.v.makePath('home', {p1: 1}, {q1: 1}); - } - - makeHref() { - var v1: string = this.v.makeHref('home'); - var v2: string = this.v.makeHref('home', {p1: 1}); - var v3: string = this.v.makeHref('home', {p1: 1}, {q1: 1}); - } - - transitionTo() { - var v1: void = this.v.transitionTo('home'); - var v2: void = this.v.transitionTo('home', {p1: 1}); - var v3: void = this.v.transitionTo('home', {p1: 1}, {q1: 1}); - } - - replaceWith() { - var v1: void = this.v.replaceWith('home'); - var v2: void = this.v.replaceWith('home', {p1: 1}); - var v3: void = this.v.replaceWith('home', {p1: 1}, {q1: 1}); - } - - goBack() { - var v: void = this.v.goBack(); - } - - getCurrentPath() { - var v: string = this.v.getCurrentPath(); - } - - getCurrentRoutes() { - var v: Router.Route[] = this.v.getCurrentRoutes(); - } - - getCurrentPathname() { - var v: string = this.v.getCurrentPathname(); - } - - getCurrentParams() { - var v: {} = this.v.getCurrentParams(); - } - - getCurrentQuery() { - var v: {} = this.v.getCurrentQuery(); - } - - isActive() { - var v1: boolean = this.v.isActive('home'); - var v2: boolean = this.v.isActive('home', {p1: 1}); - var v3: boolean = this.v.isActive('home', {p1: 1}, {q1: 1}); - } -} diff --git a/react-router/react-router-tests.tsx b/react-router/react-router-tests.tsx new file mode 100644 index 000000000..42ee3236f --- /dev/null +++ b/react-router/react-router-tests.tsx @@ -0,0 +1,69 @@ + +/// +/// +/// +/// + + +import * as React from "react" +import * as ReactDOM from "react-dom" + +import { Router, Route, IndexRoute, Link } from "react-router" + +import createHistory from "history/lib/createBrowserHistory" + + +class Master extends React.Component, {}> { + + render() { + return
    +

    Master

    + Dashboard Users +

    {this.props.children}

    +
    + } + +} + + +class Dashboard extends React.Component<{}, {}> { + + render() { + return
    + This is a dashboard +
    + } + +} + +class NotFound extends React.Component<{}, {}> { + + render() { + return
    + This path does not exists +
    + } + +} + + +class Users extends React.Component<{}, {}> { + + render() { + return
    + This is a user list +
    + } + +} + + +ReactDOM.render(( + + + + + + + +), document.body) diff --git a/react-router/react-router-tests.tsx.tscparams b/react-router/react-router-tests.tsx.tscparams new file mode 100644 index 000000000..f47983778 --- /dev/null +++ b/react-router/react-router-tests.tsx.tscparams @@ -0,0 +1 @@ +--noImplicitAny -jsx react --target es5 \ No newline at end of file diff --git a/react-router/react-router.d.ts b/react-router/react-router.d.ts index 4cebcfab3..2010a1f49 100644 --- a/react-router/react-router.d.ts +++ b/react-router/react-router.d.ts @@ -1,354 +1,452 @@ -// Type definitions for React Router 0.13.3 +// Type definitions for react-router v1.0.0 // Project: https://github.com/rackt/react-router -// Definitions by: Yuichi Murata , Václav Ostrožlík +// Definitions by: Sergey Buturlakin , Yuichi Murata , Václav Ostrožlík // Definitions: https://github.com/borisyankov/DefinitelyTyped -/// -declare module ReactRouter { - import React = __React; +/// +/// - // - // Transition - // ---------------------------------------------------------------------- - interface Transition { - path: string; - abortReason: any; - retry(): void; - abort(reason?: any): void; - redirect(to: string, params?: {}, query?: {}): void; - cancel(): void; - from: (transition: Transition, routes: Route[], components?: React.ReactElement[], callback?: (error?: any) => void) => void; - to: (transition: Transition, routes: Route[], params?: {}, query?: {}, callback?: (error?: any) => void) => void; + +declare namespace ReactRouter { + + import React = __React + + import H = HistoryModule + + // types based on https://github.com/rackt/react-router/blob/master/docs/Glossary.md + + type Component = React.ReactType + + type EnterHook = (nextState: RouterState, replaceState: RedirectFunction, callback?: Function) => any + + type LeaveHook = () => any + + type Params = Object + + type ParseQueryString = (queryString: H.QueryString) => H.Query + + type RedirectFunction = (state: H.LocationState, pathname: H.Pathname | H.Path, query?: H.Query) => void + + type RouteComponent = Component + + // use the following interface in an app code to get access to route param values, history, location... + // interface MyComponentProps extends ReactRouter.RouteComponentProps<{}, { id: number }> {} + // somewhere in MyComponent + // ... + // let id = this.props.routeParams.id + // ... + // this.props.history. ... + // ... + interface RouteComponentProps { + history?: History + location?: H.Location + params?: P + route?: PlainRoute + routeParams?: R + routes?: PlainRoute[] } - interface TransitionStaticLifecycle { - willTransitionTo?( - transition: Transition, - params: {}, - query: {}, - callback: Function - ): void; + type RouteComponents = { [key: string]: RouteComponent } - willTransitionFrom?( - transition: Transition, - component: React.ReactElement, - callback: Function - ): void; - } + type RouteConfig = React.ReactNode | PlainRoute | PlainRoute[] - // - // Route Configuration - // ---------------------------------------------------------------------- - // DefaultRoute - interface DefaultRouteProp { - name?: string; - handler: React.ComponentClass; - } - interface DefaultRoute extends React.ReactElement {} - interface DefaultRouteClass extends React.ComponentClass {} + type RouteHook = (nextLocation?: H.Location) => any - // NotFoundRoute - interface NotFoundRouteProp { - name?: string; - handler: React.ComponentClass; - } - interface NotFoundRoute extends React.ReactElement {} - interface NotFoundRouteClass extends React.ComponentClass {} + type RoutePattern = string - // Redirect - interface RedirectProp { - path?: string; - from?: string; - to?: string; - } - interface Redirect extends React.ReactElement {} - interface RedirectClass extends React.ComponentClass {} + type StringifyQuery = (queryObject: H.Query) => H.QueryString - // Route - interface RouteProp { - name?: string; - path?: string; - handler?: React.ComponentClass; - ignoreScrollBehavior?: boolean; - } - interface Route extends React.ReactElement {} - interface RouteClass extends React.ComponentClass {} - - var DefaultRoute: DefaultRouteClass; - var NotFoundRoute: NotFoundRouteClass; - var Redirect: RedirectClass; - var Route: RouteClass; - - interface CreateRouteOptions { - name?: string; - path?: string; - ignoreScrollBehavior?: boolean; - isDefault?: boolean; - isNotFound?: boolean; - onEnter?: (transition: Transition, params: {}, query: {}, callback: Function) => void; - onLeave?: (transition: Transition, wtf: any, callback: Function) => void; - handler?: Function; - parentRoute?: Route; - } - - type CreateRouteCallback = (route: Route) => void; - - function createRoute(callback: CreateRouteCallback): Route; - function createRoute(options: CreateRouteOptions | string, callback: CreateRouteCallback): Route; - function createDefaultRoute(options?: CreateRouteOptions | string): Route; - function createNotFoundRoute(options?: CreateRouteOptions | string): Route; - - interface CreateRedirectOptions extends CreateRouteOptions { - path?: string; - from?: string; - to: string; - params?: {}; - query?: {}; - } - function createRedirect(options: CreateRedirectOptions): Redirect; - function createRoutesFromReactChildren(children: Route): Route[]; - - // - // Components - // ---------------------------------------------------------------------- - // Link - interface LinkProp extends React.HTMLAttributes { - activeClassName?: string; - activeStyle?: {}; - to: string; - params?: {}; - query?: {}; - } - interface Link extends React.ReactElement, Navigation, State { - handleClick(event: any): void; - getHref(): string; - getClassName(): string; - getActiveState(): boolean; - } - interface LinkClass extends React.ComponentClass {} - - // RouteHandler - interface RouteHandlerProp { } - interface RouteHandlerChildContext { - routeDepth: number; - } - interface RouteHandler extends React.ReactElement { - getChildContext(): RouteHandlerChildContext; - getRouteDepth(): number; - createChildRouteHandler(props: {}): RouteHandler; - } - interface RouteHandlerClass extends React.ComponentClass {} - - var Link: LinkClass; - var RouteHandler: RouteHandlerClass; - - - // - // Top-Level - // ---------------------------------------------------------------------- - interface Router extends React.ReactElement { - run(callback: RouterRunCallback): void; - } + type RouterListener = (error: Error, nextState: RouterState) => void interface RouterState { - path: string; - action: string; - pathname: string; - params: {}; - query: {}; - routes: Route[]; + location: H.Location + routes: PlainRoute[] + params: Params + components: RouteComponent[] } - interface RouterCreateOption { - routes: Route; - location?: LocationBase; - scrollBehavior?: ScrollBehaviorBase; - onError?: (error: any) => void; - onAbort?: (error: any) => void; + + interface HistoryBase extends H.History { + routes: PlainRoute[] + parseQueryString?: ParseQueryString + stringifyQuery?: StringifyQuery } - type RouterRunCallback = (Handler: RouteClass, state: RouterState) => void; - - function create(options: RouterCreateOption): Router; - function run(routes: Route, callback: RouterRunCallback): Router; - function run(routes: Route, location: LocationBase | string, callback: RouterRunCallback): Router; + type History = HistoryBase & H.HistoryQueries & HistoryRoutes - // - // Location - // ---------------------------------------------------------------------- - interface LocationBase { - getCurrentPath(): void; - toString(): string; + /* components */ + + interface RouterProps extends React.Props { + history?: H.History + routes?: RouteConfig // alias for children + createElement?: (component: RouteComponent, props: Object) => any + onError?: (error: any) => any + onUpdate?: () => any + parseQueryString?: ParseQueryString + stringifyQuery?: StringifyQuery } - interface Location extends LocationBase { - push(path: string): void; - replace(path: string): void; - pop(): void; + interface Router extends React.ComponentClass {} + interface RouterElement extends React.ReactElement {} + const Router: Router + + + interface LinkProps extends React.HTMLAttributes, React.Props { + activeStyle?: React.CSSProperties + activeClassName?: string + onlyActiveOnIndex?: boolean + to: RoutePattern + query?: H.Query + state?: H.LocationState + } + interface Link extends React.ComponentClass {} + interface LinkElement extends React.ReactElement {} + const Link: Link + + + const IndexLink: Link + + + interface RoutingContextProps extends React.Props { + history: H.History + createElement: (component: RouteComponent, props: Object) => any + location: H.Location + routes: RouteConfig + params: Params + components?: RouteComponent[] + } + interface RoutingContext extends React.ComponentClass {} + interface RoutingContextElement extends React.ReactElement {} + const RoutingContext: RoutingContext + + + /* components (configuration) */ + + interface RouteProps extends React.Props { + path?: RoutePattern + component?: RouteComponent + components?: RouteComponents + getComponent?: (location: H.Location, cb: (error: any, component?: RouteComponent) => void) => void + getComponents?: (location: H.Location, cb: (error: any, components?: RouteComponents) => void) => void + onEnter?: EnterHook + onLeave?: LeaveHook + } + interface Route extends React.ComponentClass {} + interface RouteElement extends React.ReactElement {} + const Route: Route + + + interface PlainRoute { + path?: RoutePattern + component?: RouteComponent + components?: RouteComponents + getComponent?: (location: H.Location, cb: (error: any, component?: RouteComponent) => void) => void + getComponents?: (location: H.Location, cb: (error: any, components?: RouteComponents) => void) => void + onEnter?: EnterHook + onLeave?: LeaveHook + indexRoute?: PlainRoute + getIndexRoute?: (location: H.Location, cb: (error: any, indexRoute: RouteConfig) => void) => void + childRoutes?: PlainRoute[] + getChildRoutes?: (location: H.Location, cb: (error: any, childRoutes: RouteConfig) => void) => void } - interface LocationListener { - addChangeListener(listener: Function): void; - removeChangeListener(listener: Function): void; + + interface RedirectProps extends React.Props { + path?: RoutePattern + from?: RoutePattern // alias for path + to: RoutePattern + query?: H.Query + state?: H.LocationState + } + interface Redirect extends React.ComponentClass {} + interface RedirectElement extends React.ReactElement {} + const Redirect: Redirect + + + interface IndexRouteProps extends React.Props { + component?: RouteComponent + components?: RouteComponents + getComponent?: (location: H.Location, cb: (error: any, component?: RouteComponent) => void) => void + getComponents?: (location: H.Location, cb: (error: any, components?: RouteComponents) => void) => void + onEnter?: EnterHook + onLeave?: LeaveHook + } + interface IndexRoute extends React.ComponentClass {} + interface IndexRouteElement extends React.ReactElement {} + const IndexRoute: IndexRoute + + + interface IndexRedirectProps extends React.Props { + to: RoutePattern + query?: H.Query + state?: H.LocationState + } + interface IndexRedirect extends React.ComponentClass {} + interface IndexRedirectElement extends React.ReactElement {} + const IndexRedirect: IndexRedirect + + + /* mixins */ + + interface HistoryMixin { + history: History + } + const History: React.Mixin + + + interface LifecycleMixin { + routerWillLeave(nextLocation: H.Location): string | boolean + } + const Lifecycle: React.Mixin + + + const RouteContext: React.Mixin + + + /* utils */ + + interface HistoryRoutes { + listen(listener: RouterListener): Function + listenBeforeLeavingRoute(route: PlainRoute, hook: RouteHook): void + match(location: H.Location, callback: (error: any, nextState: RouterState, nextLocation: H.Location) => void): void + isActive(pathname: H.Pathname, query?: H.Query, indexOnly?: boolean): boolean } - interface HashLocation extends Location, LocationListener { } - interface HistoryLocation extends Location, LocationListener { } - interface RefreshLocation extends Location { } - interface StaticLocation extends LocationBase { } - interface TestLocation extends Location, LocationListener { } - - var HashLocation: HashLocation; - var HistoryLocation: HistoryLocation; - var RefreshLocation: RefreshLocation; - var StaticLocation: StaticLocation; - var TestLocation: TestLocation; + function useRoutes(createHistory: HistoryModule.CreateHistory): HistoryModule.CreateHistory - // - // Behavior - // ---------------------------------------------------------------------- - interface ScrollBehaviorBase { - updateScrollPosition(position: { x: number; y: number; }, actionType: string): void; + function createRoutes(routes: RouteConfig): PlainRoute[] + + + interface MatchArgs { + routes?: RouteConfig + history?: H.History + location?: H.Location + parseQueryString?: ParseQueryString + stringifyQuery?: StringifyQuery } - interface ImitateBrowserBehavior extends ScrollBehaviorBase { } - interface ScrollToTopBehavior extends ScrollBehaviorBase { } - - var ImitateBrowserBehavior: ImitateBrowserBehavior; - var ScrollToTopBehavior: ScrollToTopBehavior; - - - // - // Mixin - // ---------------------------------------------------------------------- - interface Navigation { - makePath(to: string, params?: {}, query?: {}): string; - makeHref(to: string, params?: {}, query?: {}): string; - transitionTo(to: string, params?: {}, query?: {}): void; - replaceWith(to: string, params?: {}, query?: {}): void; - goBack(): void; + interface MatchState extends RouterState { + history: History } + function match(args: MatchArgs, cb: (error: any, nextLocation: H.Location, nextState: MatchState) => void): void - interface State { - getPath(): string; - getRoutes(): Route[]; - getPathname(): string; - getParams(): {}; - getQuery(): {}; - isActive(to: string, params?: {}, query?: {}): boolean; - } - - var Navigation: Navigation; - var State: State; - - - // - // History - // ---------------------------------------------------------------------- - interface History { - back(): void; - length: number; - } - var History: History; - - - // - // Context - // ---------------------------------------------------------------------- - interface Context { - makePath(to: string, params?: {}, query?: {}): string; - makeHref(to: string, params?: {}, query?: {}): string; - transitionTo(to: string, params?: {}, query?: {}): void; - replaceWith(to: string, params?: {}, query?: {}): void; - goBack(): void; - - getCurrentPath(): string; - getCurrentRoutes(): Route[]; - getCurrentPathname(): string; - getCurrentParams(): {}; - getCurrentQuery(): {}; - isActive(to: string, params?: {}, query?: {}): boolean; - } } + +declare module "react-router/lib/Router" { + + export default ReactRouter.Router + +} + + +declare module "react-router/lib/Link" { + + export default ReactRouter.Link + +} + + +declare module "react-router/lib/IndexLink" { + + export default ReactRouter.IndexLink + +} + + +declare module "react-router/lib/IndexRedirect" { + + export default ReactRouter.IndexRedirect + +} + + +declare module "react-router/lib/IndexRoute" { + + export default ReactRouter.IndexRoute + +} + + +declare module "react-router/lib/Redirect" { + + export default ReactRouter.Redirect + +} + + +declare module "react-router/lib/Route" { + + export default ReactRouter.Route + +} + + +declare module "react-router/lib/History" { + + export default ReactRouter.History + +} + + +declare module "react-router/lib/Lifecycle" { + + export default ReactRouter.Lifecycle + +} + + +declare module "react-router/lib/RouteContext" { + + export default ReactRouter.RouteContext + +} + + +declare module "react-router/lib/useRoutes" { + + export default ReactRouter.useRoutes + +} + +declare module "react-router/lib/PatternUtils" { + + export function formatPattern(pattern: string, params: {}): string; + +} + +declare module "react-router/lib/RouteUtils" { + + type E = __React.ReactElement + + export function isReactChildren(object: E | E[]): boolean + + export function createRouteFromReactElement(element: E): ReactRouter.PlainRoute + + export function createRoutesFromReactChildren(children: E | E[], parentRoute: ReactRouter.PlainRoute): ReactRouter.PlainRoute[] + + export import createRoutes = ReactRouter.createRoutes + +} + + +declare module "react-router/lib/RoutingContext" { + + export default ReactRouter.RoutingContext + +} + + +declare module "react-router/lib/PropTypes" { + + import React = __React + + export function falsy(props: any, propName: string, componentName: string): Error; + + export const history: React.Requireable + + export const location: React.Requireable + + export const component: React.Requireable + + export const components: React.Requireable + + export const route: React.Requireable + + export const routes: React.Requireable + + export default { + falsy, + history, + location, + component, + components, + route + } + +} + + +declare module "react-router/lib/match" { + + export default ReactRouter.match + +} + + declare module "react-router" { - export = ReactRouter; -} - -declare module __React { - - // for DefaultRoute - function createElement( - type: ReactRouter.DefaultRouteClass, - props: ReactRouter.DefaultRouteProp, - ...children: __React.ReactNode[]): ReactRouter.DefaultRoute; - - // for Link - function createElement( - type: ReactRouter.LinkClass, - props: ReactRouter.LinkProp, - ...children: __React.ReactNode[]): ReactRouter.Link; - - // for NotFoundRoute - function createElement( - type: ReactRouter.NotFoundRouteClass, - props: ReactRouter.NotFoundRouteProp, - ...children: __React.ReactNode[]): ReactRouter.NotFoundRoute; - - // for Redirect - function createElement( - type: ReactRouter.RedirectClass, - props: ReactRouter.RedirectProp, - ...children: __React.ReactNode[]): ReactRouter.Redirect; - - // for Route - function createElement( - type: ReactRouter.RouteClass, - props: ReactRouter.RouteProp, - ...children: __React.ReactNode[]): ReactRouter.Route; - - // for RouteHandler - function createElement( - type: ReactRouter.RouteHandlerClass, - props: ReactRouter.RouteHandlerProp, - ...children: __React.ReactNode[]): ReactRouter.RouteHandler; -} - -declare module "react/addons" { - // for DefaultRoute - function createElement( - type: ReactRouter.DefaultRouteClass, - props: ReactRouter.DefaultRouteProp, - ...children: __React.ReactNode[]): ReactRouter.DefaultRoute; - - // for Link - function createElement( - type: ReactRouter.LinkClass, - props: ReactRouter.LinkProp, - ...children: __React.ReactNode[]): ReactRouter.Link; - - // for NotFoundRoute - function createElement( - type: ReactRouter.NotFoundRouteClass, - props: ReactRouter.NotFoundRouteProp, - ...children: __React.ReactNode[]): ReactRouter.NotFoundRoute; - - // for Redirect - function createElement( - type: ReactRouter.RedirectClass, - props: ReactRouter.RedirectProp, - ...children: __React.ReactNode[]): ReactRouter.Redirect; - - // for Route - function createElement( - type: ReactRouter.RouteClass, - props: ReactRouter.RouteProp, - ...children: __React.ReactNode[]): ReactRouter.Route; - - // for RouteHandler - function createElement( - type: ReactRouter.RouteHandlerClass, - props: ReactRouter.RouteHandlerProp, - ...children: __React.ReactNode[]): ReactRouter.RouteHandler; + + import Router from "react-router/lib/Router" + + import Link from "react-router/lib/Link" + + import IndexLink from "react-router/lib/IndexLink" + + import IndexRedirect from "react-router/lib/IndexRedirect" + + import IndexRoute from "react-router/lib/IndexRoute" + + import Redirect from "react-router/lib/Redirect" + + import Route from "react-router/lib/Route" + + import History from "react-router/lib/History" + + import Lifecycle from "react-router/lib/Lifecycle" + + import RouteContext from "react-router/lib/RouteContext" + + import useRoutes from "react-router/lib/useRoutes" + + import { createRoutes } from "react-router/lib/RouteUtils" + + import { formatPattern } from "react-router/lib/PatternUtils" + + import RoutingContext from "react-router/lib/RoutingContext" + + import PropTypes from "react-router/lib/PropTypes" + + import match from "react-router/lib/match" + + // 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. + export type PlainRoute = ReactRouter.PlainRoute + + // The following definitions are also very useful to export + // because by using these types lots of potential type errors + // can be exposed: + export type EnterHook = ReactRouter.EnterHook + export type LeaveHook = ReactRouter.LeaveHook + export type ParseQueryString = ReactRouter.ParseQueryString + export type RedirectFunction = ReactRouter.RedirectFunction + export type RouteComponentProps = ReactRouter.RouteComponentProps; + export type RouteHook = ReactRouter.RouteHook + export type StringifyQuery = ReactRouter.StringifyQuery + export type RouterListener = ReactRouter.RouterListener + export type RouterState = ReactRouter.RouterState + export type HistoryBase = ReactRouter.HistoryBase + + export { + Router, + Link, + IndexLink, + IndexRedirect, + IndexRoute, + Redirect, + Route, + History, + Lifecycle, + RouteContext, + useRoutes, + createRoutes, + formatPattern, + RoutingContext, + PropTypes, + match + } + + export default Router + } diff --git a/react/README.md b/react/README.md index b7ff4b55e..8990e8a71 100644 --- a/react/README.md +++ b/react/README.md @@ -1,5 +1,5 @@ -# React v0.13.3 Type Definitions +# React v0.14.2 Type Definitions -This folder contains the following `.d.ts` files: -* `react.d.ts` declares the module `"react"` and `"react/addons"` -* `react-global.d.ts` declares the global namespace `React` (only include this if you are actually using the global `React`) +If you are using modules you should use `react.d.ts`, `react-dom.d.ts` and any of the `react-addon-*.d.ts` definition files. + +If you are using the global `React` variable, you should use `react-global.d.ts`. diff --git a/react/react-0.13.3.d.ts b/react/react-0.13.3.d.ts new file mode 100644 index 000000000..794ec8cc2 --- /dev/null +++ b/react/react-0.13.3.d.ts @@ -0,0 +1,2038 @@ +// Type definitions for React v0.13.3 +// Project: http://facebook.github.io/react/ +// Definitions by: Asana , AssureSign , Microsoft +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare namespace __React { + // + // React Elements + // ---------------------------------------------------------------------- + + type ReactType = ComponentClass | string; + + interface ReactElement

    { + type: string | ComponentClass

    ; + props: P; + key: string | number; + ref: string | ((component: Component) => any); + } + + interface ClassicElement

    extends ReactElement

    { + type: string | ClassicComponentClass

    ; + ref: string | ((component: ClassicComponent) => any); + } + + interface DOMElement

    extends ClassicElement

    { + type: string; + ref: string | ((component: DOMComponent

    ) => any); + } + + type HTMLElement = DOMElement; + type SVGElement = DOMElement; + + // + // Factories + // ---------------------------------------------------------------------- + + interface Factory

    { + (props?: P, ...children: ReactNode[]): ReactElement

    ; + } + + interface ClassicFactory

    extends Factory

    { + (props?: P, ...children: ReactNode[]): ClassicElement

    ; + } + + interface DOMFactory

    extends ClassicFactory

    { + (props?: P, ...children: ReactNode[]): DOMElement

    ; + } + + type HTMLFactory = DOMFactory; + type SVGFactory = DOMFactory; + type SVGElementFactory = DOMFactory; + + // + // React Nodes + // http://facebook.github.io/react/docs/glossary.html + // ---------------------------------------------------------------------- + + type ReactText = string | number; + type ReactChild = ReactElement | ReactText; + + // Should be Array but type aliases cannot be recursive + type ReactFragment = {} | Array; + type ReactNode = ReactChild | ReactFragment | boolean; + + // + // Top Level API + // ---------------------------------------------------------------------- + + function createClass(spec: ComponentSpec): ClassicComponentClass

    ; + + function createFactory

    (type: string): DOMFactory

    ; + function createFactory

    (type: ClassicComponentClass

    | string): ClassicFactory

    ; + function createFactory

    (type: ComponentClass

    ): Factory

    ; + + function createElement

    ( + type: string, + props?: P, + ...children: ReactNode[]): DOMElement

    ; + function createElement

    ( + type: ClassicComponentClass

    | string, + props?: P, + ...children: ReactNode[]): ClassicElement

    ; + function createElement

    ( + type: ComponentClass

    , + props?: P, + ...children: ReactNode[]): ReactElement

    ; + + function cloneElement

    ( + element: DOMElement

    , + props?: P, + ...children: ReactNode[]): DOMElement

    ; + function cloneElement

    ( + element: ClassicElement

    , + props?: P, + ...children: ReactNode[]): ClassicElement

    ; + function cloneElement

    ( + element: ReactElement

    , + props?: P, + ...children: ReactNode[]): ReactElement

    ; + + function render

    ( + element: DOMElement

    , + container: Element, + callback?: () => any): DOMComponent

    ; + function render( + element: ClassicElement

    , + container: Element, + callback?: () => any): ClassicComponent; + function render( + element: ReactElement

    , + container: Element, + callback?: () => any): Component; + + function unmountComponentAtNode(container: Element): boolean; + function renderToString(element: ReactElement): string; + function renderToStaticMarkup(element: ReactElement): string; + function isValidElement(object: {}): boolean; + function initializeTouchEvents(shouldUseTouch: boolean): void; + + function findDOMNode( + componentOrElement: Component | Element): TElement; + function findDOMNode( + componentOrElement: Component | Element): Element; + + var DOM: ReactDOM; + var PropTypes: ReactPropTypes; + var Children: ReactChildren; + + // + // Component API + // ---------------------------------------------------------------------- + + // Base component for plain JS classes + class Component implements ComponentLifecycle { + static propTypes: ValidationMap; + static contextTypes: ValidationMap; + static childContextTypes: ValidationMap; + static defaultProps: Props; + + constructor(props?: P, context?: any); + setState(f: (prevState: S, props: P) => S, callback?: () => any): void; + setState(state: S, callback?: () => any): void; + forceUpdate(callBack?: () => any): void; + render(): JSX.Element; + props: P; + state: S; + context: {}; + refs: { + [key: string]: Component + }; + } + + interface ClassicComponent extends Component { + replaceState(nextState: S, callback?: () => any): void; + getDOMNode(): TElement; + getDOMNode(): Element; + isMounted(): boolean; + getInitialState?(): S; + setProps(nextProps: P, callback?: () => any): void; + replaceProps(nextProps: P, callback?: () => any): void; + } + + interface DOMComponent

    extends ClassicComponent { + tagName: string; + } + + type HTMLComponent = DOMComponent; + type SVGComponent = DOMComponent; + + interface ChildContextProvider { + getChildContext(): CC; + } + + // + // Class Interfaces + // ---------------------------------------------------------------------- + + interface ComponentClass

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

    ; + contextTypes?: ValidationMap; + childContextTypes?: ValidationMap; + defaultProps?: P; + } + + interface ClassicComponentClass

    extends ComponentClass

    { + new(props?: P, context?: any): ClassicComponent; + getDefaultProps?(): P; + displayName?: string; + } + + // + // Component Specs and Lifecycle + // ---------------------------------------------------------------------- + + interface ComponentLifecycle { + componentWillMount?(): void; + componentDidMount?(): void; + componentWillReceiveProps?(nextProps: P, nextContext: any): void; + shouldComponentUpdate?(nextProps: P, nextState: S, nextContext: any): boolean; + componentWillUpdate?(nextProps: P, nextState: S, nextContext: any): void; + componentDidUpdate?(prevProps: P, prevState: S, prevContext: any): void; + componentWillUnmount?(): void; + } + + interface Mixin extends ComponentLifecycle { + mixins?: Mixin; + statics?: { + [key: string]: any; + }; + + displayName?: string; + propTypes?: ValidationMap; + contextTypes?: ValidationMap; + childContextTypes?: ValidationMap; + + getDefaultProps?(): P; + getInitialState?(): S; + } + + interface ComponentSpec extends Mixin { + render(): ReactElement; + + [propertyName: string]: any; + } + + // + // Event System + // ---------------------------------------------------------------------- + + interface SyntheticEvent { + bubbles: boolean; + cancelable: boolean; + currentTarget: EventTarget; + defaultPrevented: boolean; + eventPhase: number; + isTrusted: boolean; + nativeEvent: Event; + preventDefault(): void; + stopPropagation(): void; + target: EventTarget; + timeStamp: Date; + type: string; + } + + interface DragEvent extends SyntheticEvent { + dataTransfer: DataTransfer; + } + + interface ClipboardEvent extends SyntheticEvent { + clipboardData: DataTransfer; + } + + interface KeyboardEvent extends SyntheticEvent { + altKey: boolean; + charCode: number; + ctrlKey: boolean; + getModifierState(key: string): boolean; + key: string; + keyCode: number; + locale: string; + location: number; + metaKey: boolean; + repeat: boolean; + shiftKey: boolean; + which: number; + } + + interface FocusEvent extends SyntheticEvent { + relatedTarget: EventTarget; + } + + interface FormEvent extends SyntheticEvent { + } + + interface MouseEvent extends SyntheticEvent { + altKey: boolean; + button: number; + buttons: number; + clientX: number; + clientY: number; + ctrlKey: boolean; + getModifierState(key: string): boolean; + metaKey: boolean; + pageX: number; + pageY: number; + relatedTarget: EventTarget; + screenX: number; + screenY: number; + shiftKey: boolean; + } + + interface TouchEvent extends SyntheticEvent { + altKey: boolean; + changedTouches: TouchList; + ctrlKey: boolean; + getModifierState(key: string): boolean; + metaKey: boolean; + shiftKey: boolean; + targetTouches: TouchList; + touches: TouchList; + } + + interface UIEvent extends SyntheticEvent { + detail: number; + view: AbstractView; + } + + interface WheelEvent extends SyntheticEvent { + deltaMode: number; + deltaX: number; + deltaY: number; + deltaZ: number; + } + + // + // Event Handler Types + // ---------------------------------------------------------------------- + + interface EventHandler { + (event: E): void; + } + + interface DragEventHandler extends EventHandler {} + interface ClipboardEventHandler extends EventHandler {} + interface KeyboardEventHandler extends EventHandler {} + interface FocusEventHandler extends EventHandler {} + interface FormEventHandler extends EventHandler {} + interface MouseEventHandler extends EventHandler {} + interface TouchEventHandler extends EventHandler {} + interface UIEventHandler extends EventHandler {} + interface WheelEventHandler extends EventHandler {} + + // + // Props / DOM Attributes + // ---------------------------------------------------------------------- + + interface Props { + children?: ReactNode; + key?: string | number; + ref?: string | ((component: T) => any); + } + + interface DOMAttributesBase extends Props { + onCopy?: ClipboardEventHandler; + onCut?: ClipboardEventHandler; + onPaste?: ClipboardEventHandler; + onKeyDown?: KeyboardEventHandler; + onKeyPress?: KeyboardEventHandler; + onKeyUp?: KeyboardEventHandler; + onFocus?: FocusEventHandler; + onBlur?: FocusEventHandler; + onChange?: FormEventHandler; + onInput?: FormEventHandler; + onSubmit?: FormEventHandler; + onClick?: MouseEventHandler; + onContextMenu?: MouseEventHandler; + onDoubleClick?: MouseEventHandler; + onDrag?: DragEventHandler; + onDragEnd?: DragEventHandler; + onDragEnter?: DragEventHandler; + onDragExit?: DragEventHandler; + onDragLeave?: DragEventHandler; + onDragOver?: DragEventHandler; + onDragStart?: DragEventHandler; + onDrop?: DragEventHandler; + onMouseDown?: MouseEventHandler; + onMouseEnter?: MouseEventHandler; + onMouseLeave?: MouseEventHandler; + onMouseMove?: MouseEventHandler; + onMouseOut?: MouseEventHandler; + onMouseOver?: MouseEventHandler; + onMouseUp?: MouseEventHandler; + onTouchCancel?: TouchEventHandler; + onTouchEnd?: TouchEventHandler; + onTouchMove?: TouchEventHandler; + onTouchStart?: TouchEventHandler; + onScroll?: UIEventHandler; + onWheel?: WheelEventHandler; + + className?: string; + id?: string; + + dangerouslySetInnerHTML?: { + __html: string; + }; + } + + interface DOMAttributes extends DOMAttributesBase> { + } + + // This interface is not complete. Only properties accepting + // unitless numbers are listed here (see CSSProperty.js in React) + interface CSSProperties { + boxFlex?: number; + boxFlexGroup?: number; + columnCount?: number; + flex?: number | string; + flexGrow?: number; + flexShrink?: number; + fontWeight?: number | string; + lineClamp?: number; + lineHeight?: number | string; + opacity?: number; + order?: number; + orphans?: number; + widows?: number; + zIndex?: number; + zoom?: number; + + fontSize?: number | string; + + // SVG-related properties + fillOpacity?: number; + strokeOpacity?: number; + strokeWidth?: number; + + [propertyName: string]: any; + } + + interface HTMLAttributesBase extends DOMAttributesBase { + accept?: string; + acceptCharset?: string; + accessKey?: string; + action?: string; + allowFullScreen?: boolean; + allowTransparency?: boolean; + alt?: string; + async?: boolean; + autoComplete?: boolean; + autoFocus?: boolean; + autoPlay?: boolean; + cellPadding?: number | string; + cellSpacing?: number | string; + charSet?: string; + checked?: boolean; + classID?: string; + cols?: number; + colSpan?: number; + content?: string; + contentEditable?: boolean; + contextMenu?: string; + controls?: any; + coords?: string; + crossOrigin?: string; + data?: string; + dateTime?: string; + defaultChecked?: boolean; + defaultValue?: string; + 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; + icon?: string; + label?: 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; + multiple?: boolean; + muted?: boolean; + name?: string; + noValidate?: boolean; + open?: boolean; + optimum?: number; + pattern?: string; + placeholder?: string; + poster?: string; + preload?: string; + radioGroup?: string; + readOnly?: boolean; + rel?: string; + required?: boolean; + role?: string; + rows?: number; + rowSpan?: number; + sandbox?: string; + scope?: string; + scoped?: boolean; + scrolling?: string; + seamless?: boolean; + selected?: boolean; + shape?: string; + size?: number; + sizes?: string; + span?: number; + spellCheck?: boolean; + src?: string; + srcDoc?: string; + srcSet?: string; + start?: number; + step?: number | string; + style?: CSSProperties; + tabIndex?: number; + target?: string; + title?: string; + type?: string; + useMap?: string; + value?: string; + width?: number | string; + wmode?: string; + + // Non-standard Attributes + autoCapitalize?: boolean; + autoCorrect?: boolean; + property?: string; + itemProp?: string; + itemScope?: boolean; + itemType?: string; + unselectable?: boolean; + } + + interface HTMLAttributes extends HTMLAttributesBase { + } + + interface SVGElementAttributes extends HTMLAttributes { + viewBox?: string; + preserveAspectRatio?: string; + } + + interface SVGAttributes extends DOMAttributes { + ref?: string | ((component: SVGComponent) => void); + + cx?: number | string; + cy?: number | string; + d?: string; + dx?: number | string; + dy?: number | string; + fill?: string; + fillOpacity?: number | string; + fontFamily?: string; + fontSize?: number | string; + fx?: number | string; + fy?: number | string; + gradientTransform?: string; + gradientUnits?: string; + height?: number | string; + markerEnd?: string; + markerMid?: string; + markerStart?: string; + offset?: number | string; + opacity?: number | string; + patternContentUnits?: string; + patternUnits?: string; + points?: string; + preserveAspectRatio?: string; + r?: number | string; + rx?: number | string; + ry?: number | string; + spreadMethod?: string; + stopColor?: string; + stopOpacity?: number | string; + stroke?: string; + strokeDasharray?: string; + strokeLinecap?: string; + strokeMiterlimit?: string; + strokeOpacity?: number | string; + strokeWidth?: number | string; + textAnchor?: string; + transform?: string; + version?: string; + viewBox?: string; + width?: number | string; + x1?: number | string; + x2?: number | string; + x?: number | string; + y1?: number | string; + y2?: number | string; + y?: number | string; + } + + // + // React.DOM + // ---------------------------------------------------------------------- + + interface ReactDOM { + // HTML + a: HTMLFactory; + abbr: HTMLFactory; + address: HTMLFactory; + area: HTMLFactory; + article: HTMLFactory; + aside: HTMLFactory; + audio: HTMLFactory; + b: HTMLFactory; + base: HTMLFactory; + bdi: HTMLFactory; + bdo: HTMLFactory; + big: HTMLFactory; + blockquote: HTMLFactory; + body: HTMLFactory; + br: HTMLFactory; + button: HTMLFactory; + canvas: HTMLFactory; + caption: HTMLFactory; + cite: HTMLFactory; + code: HTMLFactory; + col: HTMLFactory; + colgroup: HTMLFactory; + data: HTMLFactory; + datalist: HTMLFactory; + dd: HTMLFactory; + del: HTMLFactory; + details: HTMLFactory; + dfn: HTMLFactory; + dialog: HTMLFactory; + div: HTMLFactory; + dl: HTMLFactory; + dt: HTMLFactory; + em: HTMLFactory; + embed: HTMLFactory; + fieldset: HTMLFactory; + figcaption: HTMLFactory; + figure: HTMLFactory; + footer: HTMLFactory; + form: HTMLFactory; + h1: HTMLFactory; + h2: HTMLFactory; + h3: HTMLFactory; + h4: HTMLFactory; + h5: HTMLFactory; + h6: HTMLFactory; + head: HTMLFactory; + header: HTMLFactory; + hr: HTMLFactory; + html: HTMLFactory; + i: HTMLFactory; + iframe: HTMLFactory; + img: HTMLFactory; + input: HTMLFactory; + ins: HTMLFactory; + kbd: HTMLFactory; + keygen: HTMLFactory; + label: HTMLFactory; + legend: HTMLFactory; + li: HTMLFactory; + link: HTMLFactory; + main: HTMLFactory; + map: HTMLFactory; + mark: HTMLFactory; + menu: HTMLFactory; + menuitem: HTMLFactory; + meta: HTMLFactory; + meter: HTMLFactory; + nav: HTMLFactory; + noscript: HTMLFactory; + object: HTMLFactory; + ol: HTMLFactory; + optgroup: HTMLFactory; + option: HTMLFactory; + output: HTMLFactory; + p: HTMLFactory; + param: HTMLFactory; + picture: HTMLFactory; + pre: HTMLFactory; + progress: HTMLFactory; + q: HTMLFactory; + rp: HTMLFactory; + rt: HTMLFactory; + ruby: HTMLFactory; + s: HTMLFactory; + samp: HTMLFactory; + script: HTMLFactory; + section: HTMLFactory; + select: HTMLFactory; + small: HTMLFactory; + source: HTMLFactory; + span: HTMLFactory; + strong: HTMLFactory; + style: HTMLFactory; + sub: HTMLFactory; + summary: HTMLFactory; + sup: HTMLFactory; + table: HTMLFactory; + tbody: HTMLFactory; + td: HTMLFactory; + textarea: HTMLFactory; + tfoot: HTMLFactory; + th: HTMLFactory; + thead: HTMLFactory; + time: HTMLFactory; + title: HTMLFactory; + tr: HTMLFactory; + track: HTMLFactory; + u: HTMLFactory; + ul: HTMLFactory; + "var": HTMLFactory; + video: HTMLFactory; + wbr: HTMLFactory; + + // SVG + svg: SVGElementFactory; + circle: SVGFactory; + defs: SVGFactory; + ellipse: SVGFactory; + g: SVGFactory; + line: SVGFactory; + linearGradient: SVGFactory; + mask: SVGFactory; + path: SVGFactory; + pattern: SVGFactory; + polygon: SVGFactory; + polyline: SVGFactory; + radialGradient: SVGFactory; + rect: SVGFactory; + stop: SVGFactory; + text: SVGFactory; + tspan: SVGFactory; + } + + // + // React.PropTypes + // ---------------------------------------------------------------------- + + interface Validator { + (object: T, key: string, componentName: string): Error; + } + + interface Requireable extends Validator { + isRequired: Validator; + } + + interface ValidationMap { + [key: string]: Validator; + } + + interface ReactPropTypes { + any: Requireable; + array: Requireable; + bool: Requireable; + func: Requireable; + number: Requireable; + object: Requireable; + string: Requireable; + node: Requireable; + element: Requireable; + instanceOf(expectedClass: {}): Requireable; + oneOf(types: any[]): Requireable; + oneOfType(types: Validator[]): Requireable; + arrayOf(type: Validator): Requireable; + objectOf(type: Validator): Requireable; + shape(type: ValidationMap): Requireable; + } + + // + // React.Children + // ---------------------------------------------------------------------- + + interface ReactChildren { + map(children: ReactNode, fn: (child: ReactChild, index: number) => T): { [key:string]: T }; + forEach(children: ReactNode, fn: (child: ReactChild, index: number) => any): void; + count(children: ReactNode): number; + only(children: ReactNode): ReactChild; + } + + // + // Browser Interfaces + // https://github.com/nikeee/2048-typescript/blob/master/2048/js/touch.d.ts + // ---------------------------------------------------------------------- + + interface AbstractView { + styleMedia: StyleMedia; + document: Document; + } + + interface Touch { + identifier: number; + target: EventTarget; + screenX: number; + screenY: number; + clientX: number; + clientY: number; + pageX: number; + pageY: number; + } + + interface TouchList { + [index: number]: Touch; + length: number; + item(index: number): Touch; + identifiedTouch(identifier: number): Touch; + } +} + +declare module "react" { + export = __React; +} + +declare module "react/addons" { + // + // React Elements + // ---------------------------------------------------------------------- + + type ReactType = ComponentClass | string; + + interface ReactElement

    { + type: string | ComponentClass

    ; + props: P; + key: string | number; + ref: string | ((component: Component) => any); + } + + interface ClassicElement

    extends ReactElement

    { + type: string | ClassicComponentClass

    ; + ref: string | ((component: ClassicComponent) => any); + } + + interface DOMElement

    extends ClassicElement

    { + type: string; + ref: string | ((component: DOMComponent

    ) => any); + } + + type HTMLElement = DOMElement; + type SVGElement = DOMElement; + + // + // Factories + // ---------------------------------------------------------------------- + + interface Factory

    { + (props?: P, ...children: ReactNode[]): ReactElement

    ; + } + + interface ClassicFactory

    extends Factory

    { + (props?: P, ...children: ReactNode[]): ClassicElement

    ; + } + + interface DOMFactory

    extends ClassicFactory

    { + (props?: P, ...children: ReactNode[]): DOMElement

    ; + } + + type HTMLFactory = DOMFactory; + type SVGFactory = DOMFactory; + type SVGElementFactory = DOMFactory; + + // + // React Nodes + // http://facebook.github.io/react/docs/glossary.html + // ---------------------------------------------------------------------- + + type ReactText = string | number; + type ReactChild = ReactElement | ReactText; + + // Should be Array but type aliases cannot be recursive + type ReactFragment = {} | Array; + type ReactNode = ReactChild | ReactFragment | boolean; + + // + // Top Level API + // ---------------------------------------------------------------------- + + function createClass(spec: ComponentSpec): ClassicComponentClass

    ; + + function createFactory

    (type: string): DOMFactory

    ; + function createFactory

    (type: ClassicComponentClass

    | string): ClassicFactory

    ; + function createFactory

    (type: ComponentClass

    ): Factory

    ; + + function createElement

    ( + type: string, + props?: P, + ...children: ReactNode[]): DOMElement

    ; + function createElement

    ( + type: ClassicComponentClass

    | string, + props?: P, + ...children: ReactNode[]): ClassicElement

    ; + function createElement

    ( + type: ComponentClass

    , + props?: P, + ...children: ReactNode[]): ReactElement

    ; + + function cloneElement

    ( + element: DOMElement

    , + props?: P, + ...children: ReactNode[]): DOMElement

    ; + function cloneElement

    ( + element: ClassicElement

    , + props?: P, + ...children: ReactNode[]): ClassicElement

    ; + function cloneElement

    ( + element: ReactElement

    , + props?: P, + ...children: ReactNode[]): ReactElement

    ; + + function render

    ( + element: DOMElement

    , + container: Element, + callback?: () => any): DOMComponent

    ; + function render( + element: ClassicElement

    , + container: Element, + callback?: () => any): ClassicComponent; + function render( + element: ReactElement

    , + container: Element, + callback?: () => any): Component; + + function unmountComponentAtNode(container: Element): boolean; + function renderToString(element: ReactElement): string; + function renderToStaticMarkup(element: ReactElement): string; + function isValidElement(object: {}): boolean; + function initializeTouchEvents(shouldUseTouch: boolean): void; + + function findDOMNode( + componentOrElement: Component | Element): TElement; + function findDOMNode( + componentOrElement: Component | Element): Element; + + var DOM: ReactDOM; + var PropTypes: ReactPropTypes; + var Children: ReactChildren; + + // + // Component API + // ---------------------------------------------------------------------- + + // Base component for plain JS classes + class Component implements ComponentLifecycle { + static propTypes: ValidationMap; + static contextTypes: ValidationMap; + static childContextTypes: ValidationMap; + static defaultProps: Props; + + constructor(props?: P, context?: any); + setState(f: (prevState: S, props: P) => S, callback?: () => any): void; + setState(state: S, callback?: () => any): void; + forceUpdate(callBack?: () => any): void; + render(): JSX.Element; + props: P; + state: S; + context: {}; + refs: { + [key: string]: Component + }; + } + + interface ClassicComponent extends Component { + replaceState(nextState: S, callback?: () => any): void; + getDOMNode(): TElement; + getDOMNode(): Element; + isMounted(): boolean; + getInitialState?(): S; + setProps(nextProps: P, callback?: () => any): void; + replaceProps(nextProps: P, callback?: () => any): void; + } + + interface DOMComponent

    extends ClassicComponent { + tagName: string; + } + + type HTMLComponent = DOMComponent; + type SVGComponent = DOMComponent; + + interface ChildContextProvider { + getChildContext(): CC; + } + + // + // Class Interfaces + // ---------------------------------------------------------------------- + + interface ComponentClass

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

    ; + contextTypes?: ValidationMap; + childContextTypes?: ValidationMap; + defaultProps?: P; + } + + interface ClassicComponentClass

    extends ComponentClass

    { + new(props?: P, context?: any): ClassicComponent; + getDefaultProps?(): P; + displayName?: string; + } + + // + // Component Specs and Lifecycle + // ---------------------------------------------------------------------- + + interface ComponentLifecycle { + componentWillMount?(): void; + componentDidMount?(): void; + componentWillReceiveProps?(nextProps: P, nextContext: any): void; + shouldComponentUpdate?(nextProps: P, nextState: S, nextContext: any): boolean; + componentWillUpdate?(nextProps: P, nextState: S, nextContext: any): void; + componentDidUpdate?(prevProps: P, prevState: S, prevContext: any): void; + componentWillUnmount?(): void; + } + + interface Mixin extends ComponentLifecycle { + mixins?: Mixin; + statics?: { + [key: string]: any; + }; + + displayName?: string; + propTypes?: ValidationMap; + contextTypes?: ValidationMap; + childContextTypes?: ValidationMap; + + getDefaultProps?(): P; + getInitialState?(): S; + } + + interface ComponentSpec extends Mixin { + render(): ReactElement; + + [propertyName: string]: any; + } + + // + // Event System + // ---------------------------------------------------------------------- + + interface SyntheticEvent { + bubbles: boolean; + cancelable: boolean; + currentTarget: EventTarget; + defaultPrevented: boolean; + eventPhase: number; + isTrusted: boolean; + nativeEvent: Event; + preventDefault(): void; + stopPropagation(): void; + target: EventTarget; + timeStamp: Date; + type: string; + } + + interface DragEvent extends SyntheticEvent { + dataTransfer: DataTransfer; + } + + interface ClipboardEvent extends SyntheticEvent { + clipboardData: DataTransfer; + } + + interface KeyboardEvent extends SyntheticEvent { + altKey: boolean; + charCode: number; + ctrlKey: boolean; + getModifierState(key: string): boolean; + key: string; + keyCode: number; + locale: string; + location: number; + metaKey: boolean; + repeat: boolean; + shiftKey: boolean; + which: number; + } + + interface FocusEvent extends SyntheticEvent { + relatedTarget: EventTarget; + } + + interface FormEvent extends SyntheticEvent { + } + + interface MouseEvent extends SyntheticEvent { + altKey: boolean; + button: number; + buttons: number; + clientX: number; + clientY: number; + ctrlKey: boolean; + getModifierState(key: string): boolean; + metaKey: boolean; + pageX: number; + pageY: number; + relatedTarget: EventTarget; + screenX: number; + screenY: number; + shiftKey: boolean; + } + + interface TouchEvent extends SyntheticEvent { + altKey: boolean; + changedTouches: TouchList; + ctrlKey: boolean; + getModifierState(key: string): boolean; + metaKey: boolean; + shiftKey: boolean; + targetTouches: TouchList; + touches: TouchList; + } + + interface UIEvent extends SyntheticEvent { + detail: number; + view: AbstractView; + } + + interface WheelEvent extends SyntheticEvent { + deltaMode: number; + deltaX: number; + deltaY: number; + deltaZ: number; + } + + // + // Event Handler Types + // ---------------------------------------------------------------------- + + interface EventHandler { + (event: E): void; + } + + interface DragEventHandler extends EventHandler {} + interface ClipboardEventHandler extends EventHandler {} + interface KeyboardEventHandler extends EventHandler {} + interface FocusEventHandler extends EventHandler {} + interface FormEventHandler extends EventHandler {} + interface MouseEventHandler extends EventHandler {} + interface TouchEventHandler extends EventHandler {} + interface UIEventHandler extends EventHandler {} + interface WheelEventHandler extends EventHandler {} + + // + // Props / DOM Attributes + // ---------------------------------------------------------------------- + + interface Props { + children?: ReactNode; + key?: string | number; + ref?: string | ((component: T) => any); + } + + interface DOMAttributesBase extends Props { + onCopy?: ClipboardEventHandler; + onCut?: ClipboardEventHandler; + onPaste?: ClipboardEventHandler; + onKeyDown?: KeyboardEventHandler; + onKeyPress?: KeyboardEventHandler; + onKeyUp?: KeyboardEventHandler; + onFocus?: FocusEventHandler; + onBlur?: FocusEventHandler; + onChange?: FormEventHandler; + onInput?: FormEventHandler; + onSubmit?: FormEventHandler; + onClick?: MouseEventHandler; + onDoubleClick?: MouseEventHandler; + onDrag?: DragEventHandler; + onDragEnd?: DragEventHandler; + onDragEnter?: DragEventHandler; + onDragExit?: DragEventHandler; + onDragLeave?: DragEventHandler; + onDragOver?: DragEventHandler; + onDragStart?: DragEventHandler; + onDrop?: DragEventHandler; + onMouseDown?: MouseEventHandler; + onMouseEnter?: MouseEventHandler; + onMouseLeave?: MouseEventHandler; + onMouseMove?: MouseEventHandler; + onMouseOut?: MouseEventHandler; + onMouseOver?: MouseEventHandler; + onMouseUp?: MouseEventHandler; + onTouchCancel?: TouchEventHandler; + onTouchEnd?: TouchEventHandler; + onTouchMove?: TouchEventHandler; + onTouchStart?: TouchEventHandler; + onScroll?: UIEventHandler; + onWheel?: WheelEventHandler; + + className?: string; + id?: string; + + dangerouslySetInnerHTML?: { + __html: string; + }; + } + + interface DOMAttributes extends DOMAttributesBase> { + } + + // This interface is not complete. Only properties accepting + // unitless numbers are listed here (see CSSProperty.js in React) + interface CSSProperties { + boxFlex?: number; + boxFlexGroup?: number; + columnCount?: number; + flex?: number | string; + flexGrow?: number; + flexShrink?: number; + fontWeight?: number | string; + lineClamp?: number; + lineHeight?: number | string; + opacity?: number; + order?: number; + orphans?: number; + widows?: number; + zIndex?: number; + zoom?: number; + + fontSize?: number | string; + + // SVG-related properties + fillOpacity?: number; + strokeOpacity?: number; + strokeWidth?: number; + + [propertyName: string]: any; + } + + interface HTMLAttributesBase extends DOMAttributesBase { + accept?: string; + acceptCharset?: string; + accessKey?: string; + action?: string; + allowFullScreen?: boolean; + allowTransparency?: boolean; + alt?: string; + async?: boolean; + autoComplete?: boolean; + autoFocus?: boolean; + autoPlay?: boolean; + cellPadding?: number | string; + cellSpacing?: number | string; + charSet?: string; + checked?: boolean; + classID?: string; + cols?: number; + colSpan?: number; + content?: string; + contentEditable?: boolean; + contextMenu?: string; + controls?: any; + coords?: string; + crossOrigin?: string; + data?: string; + dateTime?: string; + defaultChecked?: boolean; + defaultValue?: string; + 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; + icon?: string; + label?: 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; + multiple?: boolean; + muted?: boolean; + name?: string; + noValidate?: boolean; + open?: boolean; + optimum?: number; + pattern?: string; + placeholder?: string; + poster?: string; + preload?: string; + radioGroup?: string; + readOnly?: boolean; + rel?: string; + required?: boolean; + role?: string; + rows?: number; + rowSpan?: number; + sandbox?: string; + scope?: string; + scoped?: boolean; + scrolling?: string; + seamless?: boolean; + selected?: boolean; + shape?: string; + size?: number; + sizes?: string; + span?: number; + spellCheck?: boolean; + src?: string; + srcDoc?: string; + srcSet?: string; + start?: number; + step?: number | string; + style?: CSSProperties; + tabIndex?: number; + target?: string; + title?: string; + type?: string; + useMap?: string; + value?: string; + width?: number | string; + wmode?: string; + + // Non-standard Attributes + autoCapitalize?: boolean; + autoCorrect?: boolean; + property?: string; + itemProp?: string; + itemScope?: boolean; + itemType?: string; + unselectable?: boolean; + } + + interface HTMLAttributes extends HTMLAttributesBase { + } + + interface SVGElementAttributes extends HTMLAttributes { + viewBox?: string; + preserveAspectRatio?: string; + } + + interface SVGAttributes extends DOMAttributes { + ref?: string | ((component: SVGComponent) => void); + + cx?: number | string; + cy?: number | string; + d?: string; + dx?: number | string; + dy?: number | string; + fill?: string; + fillOpacity?: number | string; + fontFamily?: string; + fontSize?: number | string; + fx?: number | string; + fy?: number | string; + gradientTransform?: string; + gradientUnits?: string; + height?: number | string; + markerEnd?: string; + markerMid?: string; + markerStart?: string; + offset?: number | string; + opacity?: number | string; + patternContentUnits?: string; + patternUnits?: string; + points?: string; + preserveAspectRatio?: string; + r?: number | string; + rx?: number | string; + ry?: number | string; + spreadMethod?: string; + stopColor?: string; + stopOpacity?: number | string; + stroke?: string; + strokeDasharray?: string; + strokeLinecap?: string; + strokeMiterlimit?: string; + strokeOpacity?: number | string; + strokeWidth?: number | string; + textAnchor?: string; + transform?: string; + version?: string; + viewBox?: string; + width?: number | string; + x1?: number | string; + x2?: number | string; + x?: number | string; + y1?: number | string; + y2?: number | string; + y?: number | string; + } + + // + // React.DOM + // ---------------------------------------------------------------------- + + interface ReactDOM { + // HTML + a: HTMLFactory; + abbr: HTMLFactory; + address: HTMLFactory; + area: HTMLFactory; + article: HTMLFactory; + aside: HTMLFactory; + audio: HTMLFactory; + b: HTMLFactory; + base: HTMLFactory; + bdi: HTMLFactory; + bdo: HTMLFactory; + big: HTMLFactory; + blockquote: HTMLFactory; + body: HTMLFactory; + br: HTMLFactory; + button: HTMLFactory; + canvas: HTMLFactory; + caption: HTMLFactory; + cite: HTMLFactory; + code: HTMLFactory; + col: HTMLFactory; + colgroup: HTMLFactory; + data: HTMLFactory; + datalist: HTMLFactory; + dd: HTMLFactory; + del: HTMLFactory; + details: HTMLFactory; + dfn: HTMLFactory; + dialog: HTMLFactory; + div: HTMLFactory; + dl: HTMLFactory; + dt: HTMLFactory; + em: HTMLFactory; + embed: HTMLFactory; + fieldset: HTMLFactory; + figcaption: HTMLFactory; + figure: HTMLFactory; + footer: HTMLFactory; + form: HTMLFactory; + h1: HTMLFactory; + h2: HTMLFactory; + h3: HTMLFactory; + h4: HTMLFactory; + h5: HTMLFactory; + h6: HTMLFactory; + head: HTMLFactory; + header: HTMLFactory; + hr: HTMLFactory; + html: HTMLFactory; + i: HTMLFactory; + iframe: HTMLFactory; + img: HTMLFactory; + input: HTMLFactory; + ins: HTMLFactory; + kbd: HTMLFactory; + keygen: HTMLFactory; + label: HTMLFactory; + legend: HTMLFactory; + li: HTMLFactory; + link: HTMLFactory; + main: HTMLFactory; + map: HTMLFactory; + mark: HTMLFactory; + menu: HTMLFactory; + menuitem: HTMLFactory; + meta: HTMLFactory; + meter: HTMLFactory; + nav: HTMLFactory; + noscript: HTMLFactory; + object: HTMLFactory; + ol: HTMLFactory; + optgroup: HTMLFactory; + option: HTMLFactory; + output: HTMLFactory; + p: HTMLFactory; + param: HTMLFactory; + picture: HTMLFactory; + pre: HTMLFactory; + progress: HTMLFactory; + q: HTMLFactory; + rp: HTMLFactory; + rt: HTMLFactory; + ruby: HTMLFactory; + s: HTMLFactory; + samp: HTMLFactory; + script: HTMLFactory; + section: HTMLFactory; + select: HTMLFactory; + small: HTMLFactory; + source: HTMLFactory; + span: HTMLFactory; + strong: HTMLFactory; + style: HTMLFactory; + sub: HTMLFactory; + summary: HTMLFactory; + sup: HTMLFactory; + table: HTMLFactory; + tbody: HTMLFactory; + td: HTMLFactory; + textarea: HTMLFactory; + tfoot: HTMLFactory; + th: HTMLFactory; + thead: HTMLFactory; + time: HTMLFactory; + title: HTMLFactory; + tr: HTMLFactory; + track: HTMLFactory; + u: HTMLFactory; + ul: HTMLFactory; + "var": HTMLFactory; + video: HTMLFactory; + wbr: HTMLFactory; + + // SVG + svg: SVGElementFactory; + circle: SVGFactory; + defs: SVGFactory; + ellipse: SVGFactory; + g: SVGFactory; + line: SVGFactory; + linearGradient: SVGFactory; + mask: SVGFactory; + path: SVGFactory; + pattern: SVGFactory; + polygon: SVGFactory; + polyline: SVGFactory; + radialGradient: SVGFactory; + rect: SVGFactory; + stop: SVGFactory; + text: SVGFactory; + tspan: SVGFactory; + } + + // + // React.PropTypes + // ---------------------------------------------------------------------- + + interface Validator { + (object: T, key: string, componentName: string): Error; + } + + interface Requireable extends Validator { + isRequired: Validator; + } + + interface ValidationMap { + [key: string]: Validator; + } + + interface ReactPropTypes { + any: Requireable; + array: Requireable; + bool: Requireable; + func: Requireable; + number: Requireable; + object: Requireable; + string: Requireable; + node: Requireable; + element: Requireable; + instanceOf(expectedClass: {}): Requireable; + oneOf(types: any[]): Requireable; + oneOfType(types: Validator[]): Requireable; + arrayOf(type: Validator): Requireable; + objectOf(type: Validator): Requireable; + shape(type: ValidationMap): Requireable; + } + + // + // React.Children + // ---------------------------------------------------------------------- + + interface ReactChildren { + map(children: ReactNode, fn: (child: ReactChild, index: number) => T): { [key:string]: T }; + forEach(children: ReactNode, fn: (child: ReactChild, index: number) => any): void; + count(children: ReactNode): number; + only(children: ReactNode): ReactChild; + } + + // + // Browser Interfaces + // https://github.com/nikeee/2048-typescript/blob/master/2048/js/touch.d.ts + // ---------------------------------------------------------------------- + + interface AbstractView { + styleMedia: StyleMedia; + document: Document; + } + + interface Touch { + identifier: number; + target: EventTarget; + screenX: number; + screenY: number; + clientX: number; + clientY: number; + pageX: number; + pageY: number; + } + + interface TouchList { + [index: number]: Touch; + length: number; + item(index: number): Touch; + identifiedTouch(identifier: number): Touch; + } + + // + // React.addons + // ---------------------------------------------------------------------- + + export module addons { + export var CSSTransitionGroup: CSSTransitionGroup; + export var TransitionGroup: TransitionGroup; + + export var LinkedStateMixin: LinkedStateMixin; + export var PureRenderMixin: PureRenderMixin; + + export function batchedUpdates( + callback: (a: A, b: B) => any, a: A, b: B): void; + export function batchedUpdates(callback: (a: A) => any, a: A): void; + export function batchedUpdates(callback: () => any): void; + + // deprecated: use petehunt/react-classset or JedWatson/classnames + export function classSet(cx: { [key: string]: boolean }): string; + export function classSet(...classList: string[]): string; + + export function cloneWithProps

    ( + element: DOMElement

    , props: P): DOMElement

    ; + export function cloneWithProps

    ( + element: ClassicElement

    , props: P): ClassicElement

    ; + export function cloneWithProps

    ( + element: ReactElement

    , props: P): ReactElement

    ; + + export function createFragment( + object: { [key: string]: ReactNode }): ReactFragment; + + export function update(value: any[], spec: UpdateArraySpec): any[]; + export function update(value: {}, spec: UpdateSpec): any; + + // Development tools + export import Perf = ReactPerf; + export import TestUtils = ReactTestUtils; + } + + // + // React.addons (Transitions) + // ---------------------------------------------------------------------- + + interface TransitionGroupProps { + component?: ReactType; + childFactory?: (child: ReactElement) => ReactElement; + } + + interface CSSTransitionGroupProps extends TransitionGroupProps { + transitionName: string; + transitionAppear?: boolean; + transitionEnter?: boolean; + transitionLeave?: boolean; + } + + type CSSTransitionGroup = ComponentClass; + type TransitionGroup = ComponentClass; + + // + // React.addons (Mixins) + // ---------------------------------------------------------------------- + + interface ReactLink { + value: T; + requestChange(newValue: T): void; + } + + interface LinkedStateMixin extends Mixin { + linkState(key: string): ReactLink; + } + + interface PureRenderMixin extends Mixin { + } + + // + // Reat.addons.update + // ---------------------------------------------------------------------- + + interface UpdateSpecCommand { + $set?: any; + $merge?: {}; + $apply?(value: any): any; + } + + interface UpdateSpecPath { + [key: string]: UpdateSpec; + } + + type UpdateSpec = UpdateSpecCommand | UpdateSpecPath; + + interface UpdateArraySpec extends UpdateSpecCommand { + $push?: any[]; + $unshift?: any[]; + $splice?: any[][]; + } + + // + // React.addons.Perf + // ---------------------------------------------------------------------- + + interface ComponentPerfContext { + current: string; + owner: string; + } + + interface NumericPerfContext { + [key: string]: number; + } + + interface Measurements { + exclusive: NumericPerfContext; + inclusive: NumericPerfContext; + render: NumericPerfContext; + counts: NumericPerfContext; + writes: NumericPerfContext; + displayNames: { + [key: string]: ComponentPerfContext; + }; + totalTime: number; + } + + module ReactPerf { + export function start(): void; + export function stop(): void; + export function printInclusive(measurements: Measurements[]): void; + export function printExclusive(measurements: Measurements[]): void; + export function printWasted(measurements: Measurements[]): void; + export function printDOM(measurements: Measurements[]): void; + export function getLastMeasurements(): Measurements[]; + } + + // + // React.addons.TestUtils + // ---------------------------------------------------------------------- + + interface MockedComponentClass { + new(): any; + } + + module ReactTestUtils { + export import Simulate = ReactSimulate; + + export function renderIntoDocument

    ( + element: ReactElement

    ): Component; + export function renderIntoDocument>( + element: ReactElement): C; + + export function mockComponent( + mocked: MockedComponentClass, mockTagName?: string): typeof ReactTestUtils; + + export function isElementOfType( + element: ReactElement, type: ReactType): boolean; + export function isTextComponent(instance: Component): boolean; + export function isDOMComponent(instance: Component): boolean; + export function isCompositeComponent(instance: Component): boolean; + export function isCompositeComponentWithType( + instance: Component, + type: ComponentClass): boolean; + + export function findAllInRenderedTree( + tree: Component, + fn: (i: Component) => boolean): Component; + + export function scryRenderedDOMComponentsWithClass( + tree: Component, + className: string): DOMComponent[]; + export function findRenderedDOMComponentWithClass( + tree: Component, + className: string): DOMComponent; + + export function scryRenderedDOMComponentsWithTag( + tree: Component, + tagName: string): DOMComponent[]; + export function findRenderedDOMComponentWithTag( + tree: Component, + tagName: string): DOMComponent; + + export function scryRenderedComponentsWithType

    ( + tree: Component, + type: ComponentClass

    ): Component[]; + export function scryRenderedComponentsWithType>( + tree: Component, + type: ComponentClass): C[]; + + export function findRenderedComponentWithType

    ( + tree: Component, + type: ComponentClass

    ): Component; + export function findRenderedComponentWithType>( + tree: Component, + type: ComponentClass): C; + + export function createRenderer(): ShallowRenderer; + } + + interface SyntheticEventData { + altKey?: boolean; + button?: number; + buttons?: number; + clientX?: number; + clientY?: number; + changedTouches?: TouchList; + charCode?: boolean; + clipboardData?: DataTransfer; + ctrlKey?: boolean; + deltaMode?: number; + deltaX?: number; + deltaY?: number; + deltaZ?: number; + detail?: number; + getModifierState?(key: string): boolean; + key?: string; + keyCode?: number; + locale?: string; + location?: number; + metaKey?: boolean; + pageX?: number; + pageY?: number; + relatedTarget?: EventTarget; + repeat?: boolean; + screenX?: number; + screenY?: number; + shiftKey?: boolean; + targetTouches?: TouchList; + touches?: TouchList; + view?: AbstractView; + which?: number; + } + + interface EventSimulator { + (element: Element, eventData?: SyntheticEventData): void; + (component: Component, eventData?: SyntheticEventData): void; + } + + module ReactSimulate { + export var blur: EventSimulator; + export var change: EventSimulator; + export var click: EventSimulator; + export var cut: EventSimulator; + export var doubleClick: EventSimulator; + export var drag: EventSimulator; + export var dragEnd: EventSimulator; + export var dragEnter: EventSimulator; + export var dragExit: EventSimulator; + export var dragLeave: EventSimulator; + export var dragOver: EventSimulator; + export var dragStart: EventSimulator; + export var drop: EventSimulator; + export var focus: EventSimulator; + export var input: EventSimulator; + export var keyDown: EventSimulator; + export var keyPress: EventSimulator; + export var keyUp: EventSimulator; + export var mouseDown: EventSimulator; + export var mouseEnter: EventSimulator; + export var mouseLeave: EventSimulator; + export var mouseMove: EventSimulator; + export var mouseOut: EventSimulator; + export var mouseOver: EventSimulator; + export var mouseUp: EventSimulator; + export var paste: EventSimulator; + export var scroll: EventSimulator; + export var submit: EventSimulator; + export var touchCancel: EventSimulator; + export var touchEnd: EventSimulator; + export var touchMove: EventSimulator; + export var touchStart: EventSimulator; + export var wheel: EventSimulator; + } + + class ShallowRenderer { + getRenderOutput>(): E; + getRenderOutput(): ReactElement; + render(element: ReactElement, context?: any): void; + unmount(): void; + } +} + +declare namespace JSX { + import React = __React; + + interface Element extends React.ReactElement { } + interface ElementClass extends React.Component { + render(): JSX.Element; + } + interface ElementAttributesProperty { props: {}; } + + interface IntrinsicElements { + // HTML + a: React.HTMLAttributes; + abbr: React.HTMLAttributes; + address: React.HTMLAttributes; + area: React.HTMLAttributes; + article: React.HTMLAttributes; + aside: React.HTMLAttributes; + audio: React.HTMLAttributes; + b: React.HTMLAttributes; + base: React.HTMLAttributes; + bdi: React.HTMLAttributes; + bdo: React.HTMLAttributes; + big: React.HTMLAttributes; + blockquote: React.HTMLAttributes; + body: React.HTMLAttributes; + br: React.HTMLAttributes; + button: React.HTMLAttributes; + canvas: React.HTMLAttributes; + caption: React.HTMLAttributes; + cite: React.HTMLAttributes; + code: React.HTMLAttributes; + col: React.HTMLAttributes; + colgroup: React.HTMLAttributes; + data: React.HTMLAttributes; + datalist: React.HTMLAttributes; + dd: React.HTMLAttributes; + del: React.HTMLAttributes; + details: React.HTMLAttributes; + dfn: React.HTMLAttributes; + dialog: React.HTMLAttributes; + div: React.HTMLAttributes; + dl: React.HTMLAttributes; + dt: React.HTMLAttributes; + em: React.HTMLAttributes; + embed: React.HTMLAttributes; + fieldset: React.HTMLAttributes; + figcaption: React.HTMLAttributes; + figure: React.HTMLAttributes; + footer: React.HTMLAttributes; + form: React.HTMLAttributes; + h1: React.HTMLAttributes; + h2: React.HTMLAttributes; + h3: React.HTMLAttributes; + h4: React.HTMLAttributes; + h5: React.HTMLAttributes; + h6: React.HTMLAttributes; + head: React.HTMLAttributes; + header: React.HTMLAttributes; + hr: React.HTMLAttributes; + html: React.HTMLAttributes; + i: React.HTMLAttributes; + iframe: React.HTMLAttributes; + img: React.HTMLAttributes; + input: React.HTMLAttributes; + ins: React.HTMLAttributes; + kbd: React.HTMLAttributes; + keygen: React.HTMLAttributes; + label: React.HTMLAttributes; + legend: React.HTMLAttributes; + li: React.HTMLAttributes; + link: React.HTMLAttributes; + main: React.HTMLAttributes; + map: React.HTMLAttributes; + mark: React.HTMLAttributes; + menu: React.HTMLAttributes; + menuitem: React.HTMLAttributes; + meta: React.HTMLAttributes; + meter: React.HTMLAttributes; + nav: React.HTMLAttributes; + noscript: React.HTMLAttributes; + object: React.HTMLAttributes; + ol: React.HTMLAttributes; + optgroup: React.HTMLAttributes; + option: React.HTMLAttributes; + output: React.HTMLAttributes; + p: React.HTMLAttributes; + param: React.HTMLAttributes; + picture: React.HTMLAttributes; + pre: React.HTMLAttributes; + progress: React.HTMLAttributes; + q: React.HTMLAttributes; + rp: React.HTMLAttributes; + rt: React.HTMLAttributes; + ruby: React.HTMLAttributes; + s: React.HTMLAttributes; + samp: React.HTMLAttributes; + script: React.HTMLAttributes; + section: React.HTMLAttributes; + select: React.HTMLAttributes; + small: React.HTMLAttributes; + source: React.HTMLAttributes; + span: React.HTMLAttributes; + strong: React.HTMLAttributes; + style: React.HTMLAttributes; + sub: React.HTMLAttributes; + summary: React.HTMLAttributes; + sup: React.HTMLAttributes; + table: React.HTMLAttributes; + tbody: React.HTMLAttributes; + td: React.HTMLAttributes; + textarea: React.HTMLAttributes; + tfoot: React.HTMLAttributes; + th: React.HTMLAttributes; + thead: React.HTMLAttributes; + time: React.HTMLAttributes; + title: React.HTMLAttributes; + tr: React.HTMLAttributes; + track: React.HTMLAttributes; + u: React.HTMLAttributes; + ul: React.HTMLAttributes; + "var": React.HTMLAttributes; + video: React.HTMLAttributes; + wbr: React.HTMLAttributes; + + // SVG + svg: React.SVGElementAttributes; + + circle: React.SVGAttributes; + defs: React.SVGAttributes; + ellipse: React.SVGAttributes; + g: React.SVGAttributes; + line: React.SVGAttributes; + linearGradient: React.SVGAttributes; + mask: React.SVGAttributes; + path: React.SVGAttributes; + pattern: React.SVGAttributes; + polygon: React.SVGAttributes; + polyline: React.SVGAttributes; + radialGradient: React.SVGAttributes; + rect: React.SVGAttributes; + stop: React.SVGAttributes; + text: React.SVGAttributes; + tspan: React.SVGAttributes; + } +} diff --git a/react/react-addons-create-fragment.d.ts b/react/react-addons-create-fragment.d.ts new file mode 100644 index 000000000..b2332eae1 --- /dev/null +++ b/react/react-addons-create-fragment.d.ts @@ -0,0 +1,16 @@ +// Type definitions for React v0.14 (react-addons-create-fragment) +// Project: http://facebook.github.io/react/ +// Definitions by: Asana , AssureSign , Microsoft +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare namespace __React { + namespace __Addons { + export function createFragment(object: { [key: string]: ReactNode }): ReactFragment; + } +} + +declare module "react-addons-create-fragment" { + export = __React.__Addons.createFragment; +} diff --git a/react/react-addons-css-transition-group.d.ts b/react/react-addons-css-transition-group.d.ts new file mode 100644 index 000000000..f55335ccb --- /dev/null +++ b/react/react-addons-css-transition-group.d.ts @@ -0,0 +1,40 @@ +// Type definitions for React v0.14 (react-addons-css-transition-group) +// Project: http://facebook.github.io/react/ +// Definitions by: Asana , AssureSign , Microsoft +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// +/// + +declare namespace __React { + interface CSSTransitionGroupTransitionName { + enter: string; + enterActive?: string; + leave: string; + leaveActive?: string; + appear?: string; + appearActive?: string; + } + + interface CSSTransitionGroupProps extends TransitionGroupProps { + transitionName: string | CSSTransitionGroupTransitionName; + transitionAppear?: boolean; + transitionAppearTimeout?: number; + transitionEnter?: boolean; + transitionEnterTimeout?: number; + transitionLeave?: boolean; + transitionLeaveTimeout?: number; + } + + type CSSTransitionGroup = ComponentClass; + + namespace __Addons { + export var CSSTransitionGroup: __React.CSSTransitionGroup; + } +} + +declare module "react-addons-css-transition-group" { + var CSSTransitionGroup: __React.CSSTransitionGroup; + type CSSTransitionGroup = __React.CSSTransitionGroup; + export = CSSTransitionGroup; +} diff --git a/react/react-addons-linked-state-mixin.d.ts b/react/react-addons-linked-state-mixin.d.ts new file mode 100644 index 000000000..52fd17930 --- /dev/null +++ b/react/react-addons-linked-state-mixin.d.ts @@ -0,0 +1,32 @@ +// Type definitions for React v0.14 (react-addons-linked-state-mixin) +// Project: http://facebook.github.io/react/ +// Definitions by: Asana , AssureSign , Microsoft +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare namespace __React { + interface ReactLink { + value: T; + requestChange(newValue: T): void; + } + + interface LinkedStateMixin extends Mixin { + linkState(key: string): ReactLink; + } + + interface HTMLAttributes { + checkedLink?: ReactLink; + valueLink?: ReactLink; + } + + namespace __Addons { + export var LinkedStateMixin: LinkedStateMixin; + } +} + +declare module "react-addons-linked-state-mixin" { + var LinkedStateMixin: __React.LinkedStateMixin; + type LinkedStateMixin = __React.LinkedStateMixin; + export = LinkedStateMixin; +} diff --git a/react/react-addons-perf.d.ts b/react/react-addons-perf.d.ts new file mode 100644 index 000000000..20416a060 --- /dev/null +++ b/react/react-addons-perf.d.ts @@ -0,0 +1,46 @@ +// Type definitions for React v0.14 (react-addons-perf) +// Project: http://facebook.github.io/react/ +// Definitions by: Asana , AssureSign , Microsoft +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare namespace __React { + interface ComponentPerfContext { + current: string; + owner: string; + } + + interface NumericPerfContext { + [key: string]: number; + } + + interface Measurements { + exclusive: NumericPerfContext; + inclusive: NumericPerfContext; + render: NumericPerfContext; + counts: NumericPerfContext; + writes: NumericPerfContext; + displayNames: { + [key: string]: ComponentPerfContext; + }; + totalTime: number; + } + + namespace __Addons { + namespace Perf { + export function start(): void; + export function stop(): void; + export function printInclusive(measurements: Measurements[]): void; + export function printExclusive(measurements: Measurements[]): void; + export function printWasted(measurements: Measurements[]): void; + export function printDOM(measurements: Measurements[]): void; + export function getLastMeasurements(): Measurements[]; + } + } +} + +declare module "react-addons-perf" { + import Perf = __React.__Addons.Perf; + export = Perf; +} diff --git a/react/react-addons-pure-render-mixin.d.ts b/react/react-addons-pure-render-mixin.d.ts new file mode 100644 index 000000000..3c154e6b5 --- /dev/null +++ b/react/react-addons-pure-render-mixin.d.ts @@ -0,0 +1,20 @@ +// Type definitions for React v0.14 (react-addons-pure-render-mixin) +// Project: http://facebook.github.io/react/ +// Definitions by: Asana , AssureSign , Microsoft +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare namespace __React { + interface PureRenderMixin extends Mixin {} + + namespace __Addons { + export var PureRenderMixin: PureRenderMixin; + } +} + +declare module "react-addons-pure-render-mixin" { + var PureRenderMixin: __React.PureRenderMixin; + type PureRenderMixin = __React.PureRenderMixin; + export = PureRenderMixin; +} diff --git a/react/react-addons-shallow-compare.d.ts b/react/react-addons-shallow-compare.d.ts new file mode 100644 index 000000000..2b5a4dba2 --- /dev/null +++ b/react/react-addons-shallow-compare.d.ts @@ -0,0 +1,19 @@ +// Type definitions for React v0.14 (react-addons-css-transition-group) +// Project: http://facebook.github.io/react/ +// Definitions by: Asana , AssureSign , Microsoft +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare namespace __React { + namespace __Addons { + export function shallowCompare( + component: __React.Component, + nextProps: P, + nextState: S): boolean; + } +} + +declare module "react-addons-shallow-compare" { + export = __React.__Addons.shallowCompare; +} diff --git a/react/react-addons-test-utils.d.ts b/react/react-addons-test-utils.d.ts new file mode 100644 index 000000000..3b77ac4c5 --- /dev/null +++ b/react/react-addons-test-utils.d.ts @@ -0,0 +1,155 @@ +// Type definitions for React v0.14 (react-addons-test-utils) +// Project: http://facebook.github.io/react/ +// Definitions by: Asana , AssureSign , Microsoft +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare namespace __React { + interface SyntheticEventData { + altKey?: boolean; + button?: number; + buttons?: number; + clientX?: number; + clientY?: number; + changedTouches?: TouchList; + charCode?: boolean; + clipboardData?: DataTransfer; + ctrlKey?: boolean; + deltaMode?: number; + deltaX?: number; + deltaY?: number; + deltaZ?: number; + detail?: number; + getModifierState?(key: string): boolean; + key?: string; + keyCode?: number; + locale?: string; + location?: number; + metaKey?: boolean; + pageX?: number; + pageY?: number; + relatedTarget?: EventTarget; + repeat?: boolean; + screenX?: number; + screenY?: number; + shiftKey?: boolean; + targetTouches?: TouchList; + touches?: TouchList; + view?: AbstractView; + which?: number; + } + + interface EventSimulator { + (element: Element, eventData?: SyntheticEventData): void; + (component: Component, eventData?: SyntheticEventData): void; + } + + interface MockedComponentClass { + new(): any; + } + + class ShallowRenderer { + getRenderOutput>(): E; + getRenderOutput(): ReactElement; + render(element: ReactElement, context?: any): void; + unmount(): void; + } + + namespace __Addons { + namespace TestUtils { + namespace Simulate { + export var blur: EventSimulator; + export var change: EventSimulator; + export var click: EventSimulator; + export var cut: EventSimulator; + export var doubleClick: EventSimulator; + export var drag: EventSimulator; + export var dragEnd: EventSimulator; + export var dragEnter: EventSimulator; + export var dragExit: EventSimulator; + export var dragLeave: EventSimulator; + export var dragOver: EventSimulator; + export var dragStart: EventSimulator; + export var drop: EventSimulator; + export var focus: EventSimulator; + export var input: EventSimulator; + export var keyDown: EventSimulator; + export var keyPress: EventSimulator; + export var keyUp: EventSimulator; + export var mouseDown: EventSimulator; + export var mouseEnter: EventSimulator; + export var mouseLeave: EventSimulator; + export var mouseMove: EventSimulator; + export var mouseOut: EventSimulator; + export var mouseOver: EventSimulator; + export var mouseUp: EventSimulator; + export var paste: EventSimulator; + export var scroll: EventSimulator; + export var submit: EventSimulator; + export var touchCancel: EventSimulator; + export var touchEnd: EventSimulator; + export var touchMove: EventSimulator; + export var touchStart: EventSimulator; + export var wheel: EventSimulator; + } + + export function renderIntoDocument( + element: DOMElement): Element; + export function renderIntoDocument

    ( + element: ReactElement

    ): Component; + export function renderIntoDocument>( + element: ReactElement): C; + + export function mockComponent( + mocked: MockedComponentClass, mockTagName?: string): typeof TestUtils; + + export function isElementOfType( + element: ReactElement, type: ReactType): boolean; + export function isDOMComponent(instance: ReactInstance): boolean; + export function isCompositeComponent(instance: ReactInstance): boolean; + export function isCompositeComponentWithType( + instance: ReactInstance, + type: ComponentClass): boolean; + + export function findAllInRenderedTree( + root: Component, + fn: (i: ReactInstance) => boolean): ReactInstance[]; + + export function scryRenderedDOMComponentsWithClass( + root: Component, + className: string): Element[]; + export function findRenderedDOMComponentWithClass( + root: Component, + className: string): Element; + + export function scryRenderedDOMComponentsWithTag( + root: Component, + tagName: string): Element[]; + export function findRenderedDOMComponentWithTag( + root: Component, + tagName: string): Element; + + export function scryRenderedComponentsWithType

    ( + root: Component, + type: ComponentClass

    ): Component[]; + export function scryRenderedComponentsWithType>( + root: Component, + type: ComponentClass): C[]; + + export function findRenderedComponentWithType

    ( + root: Component, + type: ComponentClass

    ): Component; + export function findRenderedComponentWithType>( + root: Component, + type: ComponentClass): C; + + export function createRenderer(): ShallowRenderer; + } + } +} + +declare module "react-addons-test-utils" { + import TestUtils = __React.__Addons.TestUtils; + export = TestUtils; +} diff --git a/react/react-addons-tests.ts b/react/react-addons-tests.ts deleted file mode 100644 index 4d8ed3212..000000000 --- a/react/react-addons-tests.ts +++ /dev/null @@ -1,415 +0,0 @@ -/// -import React = require("react/addons"); - -import TestUtils = React.addons.TestUtils; - -interface Props extends React.Props { - hello: string; - world?: string; - foo: number; - bar: boolean; -} - -interface State { - inputValue?: string; - seconds?: number; -} - -interface Context { - someValue?: string; -} - -interface ChildContext { - someOtherValue: string; -} - -interface MyComponent extends React.Component { - reset(): void; -} - -var props: Props = { - key: 42, - ref: "myComponent42", - hello: "world", - foo: 42, - bar: true -}; - -var container: Element; - -// -// Top-Level API -// -------------------------------------------------------------------------- - -var ClassicComponent: React.ClassicComponentClass = - React.createClass({ - getDefaultProps: () => { - return { - hello: undefined, - world: "peace", - foo: undefined, - bar: undefined - }; - }, - getInitialState: () => { - return { - inputValue: this.context.someValue, - seconds: this.props.foo - }; - }, - // NOTE https://github.com/borisyankov/DefinitelyTyped/pull/5590 - // reset: () => { - // this.replaceState(this.getInitialState()); - // }, - render: () => { - return React.DOM.div(null, - React.DOM.input({ - ref: input => this._input = input, - value: this.state.inputValue - })); - } - }); - -class ModernComponent extends React.Component - implements React.ChildContextProvider { - - static propTypes: React.ValidationMap = { - foo: React.PropTypes.number - } - - static contextTypes: React.ValidationMap = { - someValue: React.PropTypes.string - } - - static childContextTypes: React.ValidationMap = { - someOtherValue: React.PropTypes.string - } - - static defaultProps: Props; - - context: Context; - - getChildContext() { - return { - someOtherValue: 'foo' - } - } - - state = { - inputValue: this.context.someValue, - seconds: this.props.foo - } - - reset() { - this.setState({ - inputValue: this.context.someValue, - seconds: this.props.foo - }); - } - - private _input: React.HTMLComponent; - - render() { - return React.DOM.div(null, - React.DOM.input({ - ref: input => this._input = input, - value: this.state.inputValue - })); - } -} - -// React.createFactory -var factory: React.Factory = - React.createFactory(ModernComponent); -var factoryElement: React.ReactElement = - factory(props); - -var classicFactory: React.ClassicFactory = - React.createFactory(ClassicComponent); -var classicFactoryElement: React.ClassicElement = - classicFactory(props); - -var domFactory: React.DOMFactory = - React.createFactory("foo"); -var domFactoryElement: React.DOMElement = - domFactory(); - -// React.createElement -var element: React.ReactElement = - React.createElement(ModernComponent, props); -var classicElement: React.ClassicElement = - React.createElement(ClassicComponent, props); -var domElement: React.HTMLElement = - React.createElement("div"); - -// React.cloneElement -var clonedElement: React.ReactElement = - React.cloneElement(element, props); -var clonedClassicElement: React.ClassicElement = - React.cloneElement(classicElement, props); -var clonedDOMElement: React.HTMLElement = - React.cloneElement(domElement); - -// React.render -var component: React.Component = - React.render(element, container); -var classicComponent: React.ClassicComponent = - React.render(classicElement, container); -var domComponent: React.DOMComponent = - React.render(domElement, container); - -// Other Top-Level API -var unmounted: boolean = React.unmountComponentAtNode(container); -var str: string = React.renderToString(element); -var markup: string = React.renderToStaticMarkup(element); -var notValid: boolean = React.isValidElement(props); // false -var isValid = React.isValidElement(element); // true -React.initializeTouchEvents(true); -var domNode: Element = React.findDOMNode(component); -domNode = React.findDOMNode(domNode); - -// -// React Elements -// -------------------------------------------------------------------------- - -var type = element.type; -var elementProps: Props = element.props; -var key = element.key; - -// -// React Components -// -------------------------------------------------------------------------- - -var displayName: string = ClassicComponent.displayName; -var defaultProps: Props = ClassicComponent.getDefaultProps(); -var propTypes: React.ValidationMap = ClassicComponent.propTypes; - -// -// Component API -// -------------------------------------------------------------------------- - -// modern -var componentState: State = component.state; -component.setState({ inputValue: "!!!" }); -component.forceUpdate(); - -// classic -var htmlElement: Element = classicComponent.getDOMNode(); -var divElement: HTMLDivElement = classicComponent.getDOMNode(); -var isMounted: boolean = classicComponent.isMounted(); -classicComponent.setProps(elementProps); -classicComponent.replaceProps(props); -classicComponent.replaceState({ inputValue: "???", seconds: 60 }); - -var myComponent = component; -myComponent.reset(); - -// -// Attributes -// -------------------------------------------------------------------------- - -var children: any[] = ["Hello world", [null], React.DOM.span(null)]; -var divStyle: React.CSSProperties = { // CSSProperties - flex: "1 1 main-size", - backgroundImage: "url('hello.png')" -}; -var htmlAttr: React.HTMLAttributes = { - key: 36, - ref: "htmlComponent", - children: children, - className: "test-attr", - style: divStyle, - onClick: (event: React.MouseEvent) => { - event.preventDefault(); - event.stopPropagation(); - }, - dangerouslySetInnerHTML: { - __html: "STRONG" - } -}; -React.DOM.div(htmlAttr); -React.DOM.span(htmlAttr); -React.DOM.input(htmlAttr); - -React.DOM.svg({ viewBox: "0 0 48 48" }, - React.DOM.rect({ - x: 22, - y: 10, - width: 4, - height: 28 - }), - React.DOM.rect({ - x: 10, - y: 22, - width: 28, - height: 4 - })); - -// -// React.PropTypes -// -------------------------------------------------------------------------- - -var PropTypesSpecification: React.ComponentSpec = { - propTypes: { - optionalArray: React.PropTypes.array, - optionalBool: React.PropTypes.bool, - optionalFunc: React.PropTypes.func, - optionalNumber: React.PropTypes.number, - optionalObject: React.PropTypes.object, - optionalString: React.PropTypes.string, - optionalNode: React.PropTypes.node, - optionalElement: React.PropTypes.element, - optionalMessage: React.PropTypes.instanceOf(Date), - optionalEnum: React.PropTypes.oneOf(["News", "Photos"]), - optionalUnion: React.PropTypes.oneOfType([ - React.PropTypes.string, - React.PropTypes.number, - React.PropTypes.instanceOf(Date) - ]), - optionalArrayOf: React.PropTypes.arrayOf(React.PropTypes.number), - optionalObjectOf: React.PropTypes.objectOf(React.PropTypes.number), - optionalObjectWithShape: React.PropTypes.shape({ - color: React.PropTypes.string, - fontSize: React.PropTypes.number - }), - requiredFunc: React.PropTypes.func.isRequired, - requiredAny: React.PropTypes.any.isRequired, - customProp: function(props: any, propName: string, componentName: string) { - if (!/matchme/.test(props[propName])) { - return new Error("Validation failed!"); - } - return null; - } - }, - render: (): React.ReactElement => { - return null; - } -}; - -// -// ContextTypes -// -------------------------------------------------------------------------- - -var ContextTypesSpecification: React.ComponentSpec = { - contextTypes: { - optionalArray: React.PropTypes.array, - optionalBool: React.PropTypes.bool, - optionalFunc: React.PropTypes.func, - optionalNumber: React.PropTypes.number, - optionalObject: React.PropTypes.object, - optionalString: React.PropTypes.string, - optionalNode: React.PropTypes.node, - optionalElement: React.PropTypes.element, - optionalMessage: React.PropTypes.instanceOf(Date), - optionalEnum: React.PropTypes.oneOf(["News", "Photos"]), - optionalUnion: React.PropTypes.oneOfType([ - React.PropTypes.string, - React.PropTypes.number, - React.PropTypes.instanceOf(Date) - ]), - optionalArrayOf: React.PropTypes.arrayOf(React.PropTypes.number), - optionalObjectOf: React.PropTypes.objectOf(React.PropTypes.number), - optionalObjectWithShape: React.PropTypes.shape({ - color: React.PropTypes.string, - fontSize: React.PropTypes.number - }), - requiredFunc: React.PropTypes.func.isRequired, - requiredAny: React.PropTypes.any.isRequired, - customProp: function(props: any, propName: string, componentName: string) { - if (!/matchme/.test(props[propName])) { - return new Error("Validation failed!"); - } - return null; - } - }, - render: (): React.ReactElement => { - return null; - } -}; - -// -// React.Children -// -------------------------------------------------------------------------- - -var childMap: { [key: string]: number } = - React.Children.map(children, (child) => { return 42; }); -React.Children.forEach(children, (child) => {}); -var nChildren: number = React.Children.count(children); -var onlyChild = React.Children.only([null, [[["Hallo"], true]], false]); - -// -// Example from http://facebook.github.io/react/ -// -------------------------------------------------------------------------- - -interface TimerState { - secondsElapsed: number; -} -class Timer extends React.Component, TimerState> { - state = { - secondsElapsed: 0 - } - private _interval: number; - tick() { - this.setState((prevState, props) => ({ - secondsElapsed: prevState.secondsElapsed + 1 - })); - } - componentDidMount() { - this._interval = setInterval(() => this.tick(), 1000); - } - componentWillUnmount() { - clearInterval(this._interval); - } - render() { - return React.DOM.div( - null, - "Seconds Elapsed: ", - this.state.secondsElapsed - ); - } -} -React.render(React.createElement(Timer), container); - -// -// React.addons -// -------------------------------------------------------------------------- - -var cx = React.addons.classSet; -var className: string = cx({ a: true, b: false, c: true }); -className = cx("a", null, "b"); - -React.addons.createFragment({ - a: React.DOM.div(), - b: ["a", false, React.createElement("span")] -}); - -// -// React.addons (Transitions) -// -------------------------------------------------------------------------- - -React.createFactory(React.addons.TransitionGroup)({ component: "div" }); -React.createFactory(React.addons.CSSTransitionGroup)({ - component: React.createClass({ - render: (): React.ReactElement => null - }), - childFactory: (c) => c, - transitionName: "transition", - transitionAppear: false, - transitionEnter: true, - transitionLeave: true -}); - -// -// React.addons.TestUtils -// -------------------------------------------------------------------------- - -var node: Element; -TestUtils.Simulate.click(node); -TestUtils.Simulate.change(node); -TestUtils.Simulate.keyDown(node, { key: "Enter" }); - -var renderer: React.ShallowRenderer = - TestUtils.createRenderer(); -renderer.render(React.createElement(Timer)); -var output: React.ReactElement> = - renderer.getRenderOutput(); diff --git a/react/react-addons-transition-group.d.ts b/react/react-addons-transition-group.d.ts new file mode 100644 index 000000000..728c52aa8 --- /dev/null +++ b/react/react-addons-transition-group.d.ts @@ -0,0 +1,26 @@ +// Type definitions for React v0.14 (react-addons-transition-group) +// Project: http://facebook.github.io/react/ +// Definitions by: Asana , AssureSign , Microsoft +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare namespace __React { + + interface TransitionGroupProps { + component?: ReactType; + childFactory?: (child: ReactElement) => ReactElement; + } + + type TransitionGroup = ComponentClass; + + namespace __Addons { + export var TransitionGroup: __React.TransitionGroup; + } +} + +declare module "react-addons-transition-group" { + var TransitionGroup: __React.TransitionGroup; + type TransitionGroup = __React.TransitionGroup; + export = TransitionGroup; +} \ No newline at end of file diff --git a/react/react-addons-update.d.ts b/react/react-addons-update.d.ts new file mode 100644 index 000000000..11649799d --- /dev/null +++ b/react/react-addons-update.d.ts @@ -0,0 +1,35 @@ +// Type definitions for React v0.14 (react-addons-update) +// Project: http://facebook.github.io/react/ +// Definitions by: Asana , AssureSign , Microsoft +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare namespace __React { + interface UpdateSpecCommand { + $set?: any; + $merge?: {}; + $apply?(value: any): any; + } + + interface UpdateSpecPath { + [key: string]: UpdateSpec; + } + + type UpdateSpec = UpdateSpecCommand | UpdateSpecPath; + + interface UpdateArraySpec extends UpdateSpecCommand { + $push?: any[]; + $unshift?: any[]; + $splice?: any[][]; + } + + namespace __Addons { + export function update(value: any[], spec: UpdateArraySpec): any[]; + export function update(value: {}, spec: UpdateSpec): any; + } +} + +declare module "react-addons-update" { + export = __React.__Addons.update; +} diff --git a/react/react-dom.d.ts b/react/react-dom.d.ts new file mode 100644 index 000000000..80a0c604e --- /dev/null +++ b/react/react-dom.d.ts @@ -0,0 +1,66 @@ +// Type definitions for React v0.14 (react-dom) +// Project: http://facebook.github.io/react/ +// Definitions by: Asana , AssureSign , Microsoft +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare namespace __React { + namespace __DOM { + function findDOMNode(instance: ReactInstance): E; + function findDOMNode(instance: ReactInstance): Element; + + function render

    ( + element: DOMElement

    , + container: Element, + callback?: (element: Element) => any): Element; + function render( + element: ClassicElement

    , + container: Element, + callback?: (component: ClassicComponent) => any): ClassicComponent; + function render( + element: ReactElement

    , + container: Element, + callback?: (component: Component) => any): Component; + + function unmountComponentAtNode(container: Element): boolean; + + var version: string; + + function unstable_batchedUpdates(callback: (a: A, b: B) => any, a: A, b: B): void; + function unstable_batchedUpdates(callback: (a: A) => any, a: A): void; + function unstable_batchedUpdates(callback: () => any): void; + + function unstable_renderSubtreeIntoContainer

    ( + parentComponent: Component, + nextElement: DOMElement

    , + container: Element, + callback?: (element: Element) => any): Element; + function unstable_renderSubtreeIntoContainer( + parentComponent: Component, + nextElement: ClassicElement

    , + container: Element, + callback?: (component: ClassicComponent) => any): ClassicComponent; + function unstable_renderSubtreeIntoContainer( + parentComponent: Component, + nextElement: ReactElement

    , + container: Element, + callback?: (component: Component) => any): Component; + } + + namespace __DOMServer { + function renderToString(element: ReactElement): string; + function renderToStaticMarkup(element: ReactElement): string; + var version: string; + } +} + +declare module "react-dom" { + import DOM = __React.__DOM; + export = DOM; +} + +declare module "react-dom/server" { + import DOMServer = __React.__DOMServer; + export = DOMServer; +} diff --git a/react/react-global-0.13.3.d.ts b/react/react-global-0.13.3.d.ts new file mode 100644 index 000000000..13d114892 --- /dev/null +++ b/react/react-global-0.13.3.d.ts @@ -0,0 +1,285 @@ +// Type definitions for React v0.13.3 (namespace) +// Project: http://facebook.github.io/react/ +// Definitions by: Asana , AssureSign , Microsoft +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +import React = __React; + +declare namespace __React { + // + // React.addons + // ---------------------------------------------------------------------- + + export module addons { + export var CSSTransitionGroup: CSSTransitionGroup; + export var TransitionGroup: TransitionGroup; + + export var LinkedStateMixin: LinkedStateMixin; + export var PureRenderMixin: PureRenderMixin; + + export function batchedUpdates( + callback: (a: A, b: B) => any, a: A, b: B): void; + export function batchedUpdates(callback: (a: A) => any, a: A): void; + export function batchedUpdates(callback: () => any): void; + + // deprecated: use petehunt/react-classset or JedWatson/classnames + export function classSet(cx: { [key: string]: boolean }): string; + export function classSet(...classList: string[]): string; + + export function cloneWithProps

    ( + element: DOMElement

    , props: P): DOMElement

    ; + export function cloneWithProps

    ( + element: ClassicElement

    , props: P): ClassicElement

    ; + export function cloneWithProps

    ( + element: ReactElement

    , props: P): ReactElement

    ; + + export function createFragment( + object: { [key: string]: ReactNode }): ReactFragment; + + export function update(value: any[], spec: UpdateArraySpec): any[]; + export function update(value: {}, spec: UpdateSpec): any; + + // Development tools + export import Perf = ReactPerf; + export import TestUtils = ReactTestUtils; + } + + // + // React.addons (Transitions) + // ---------------------------------------------------------------------- + + interface TransitionGroupProps { + component?: ReactType; + childFactory?: (child: ReactElement) => ReactElement; + } + + interface CSSTransitionGroupProps extends TransitionGroupProps { + transitionName: string; + transitionAppear?: boolean; + transitionEnter?: boolean; + transitionLeave?: boolean; + } + + type CSSTransitionGroup = ComponentClass; + type TransitionGroup = ComponentClass; + + // + // React.addons (Mixins) + // ---------------------------------------------------------------------- + + interface ReactLink { + value: T; + requestChange(newValue: T): void; + } + + interface LinkedStateMixin extends Mixin { + linkState(key: string): ReactLink; + } + + interface PureRenderMixin extends Mixin { + } + + // + // Reat.addons.update + // ---------------------------------------------------------------------- + + interface UpdateSpecCommand { + $set?: any; + $merge?: {}; + $apply?(value: any): any; + } + + interface UpdateSpecPath { + [key: string]: UpdateSpec; + } + + type UpdateSpec = UpdateSpecCommand | UpdateSpecPath; + + interface UpdateArraySpec extends UpdateSpecCommand { + $push?: any[]; + $unshift?: any[]; + $splice?: any[][]; + } + + // + // React.addons.Perf + // ---------------------------------------------------------------------- + + interface ComponentPerfContext { + current: string; + owner: string; + } + + interface NumericPerfContext { + [key: string]: number; + } + + interface Measurements { + exclusive: NumericPerfContext; + inclusive: NumericPerfContext; + render: NumericPerfContext; + counts: NumericPerfContext; + writes: NumericPerfContext; + displayNames: { + [key: string]: ComponentPerfContext; + }; + totalTime: number; + } + + module ReactPerf { + export function start(): void; + export function stop(): void; + export function printInclusive(measurements: Measurements[]): void; + export function printExclusive(measurements: Measurements[]): void; + export function printWasted(measurements: Measurements[]): void; + export function printDOM(measurements: Measurements[]): void; + export function getLastMeasurements(): Measurements[]; + } + + // + // React.addons.TestUtils + // ---------------------------------------------------------------------- + + interface MockedComponentClass { + new(): any; + } + + module ReactTestUtils { + export import Simulate = ReactSimulate; + + export function renderIntoDocument

    ( + element: ReactElement

    ): Component; + export function renderIntoDocument>( + element: ReactElement): C; + + export function mockComponent( + mocked: MockedComponentClass, mockTagName?: string): typeof ReactTestUtils; + + export function isElementOfType( + element: ReactElement, type: ReactType): boolean; + export function isTextComponent(instance: Component): boolean; + export function isDOMComponent(instance: Component): boolean; + export function isCompositeComponent(instance: Component): boolean; + export function isCompositeComponentWithType( + instance: Component, + type: ComponentClass): boolean; + + export function findAllInRenderedTree( + tree: Component, + fn: (i: Component) => boolean): Component; + + export function scryRenderedDOMComponentsWithClass( + tree: Component, + className: string): DOMComponent[]; + export function findRenderedDOMComponentWithClass( + tree: Component, + className: string): DOMComponent; + + export function scryRenderedDOMComponentsWithTag( + tree: Component, + tagName: string): DOMComponent[]; + export function findRenderedDOMComponentWithTag( + tree: Component, + tagName: string): DOMComponent; + + export function scryRenderedComponentsWithType

    ( + tree: Component, + type: ComponentClass

    ): Component[]; + export function scryRenderedComponentsWithType>( + tree: Component, + type: ComponentClass): C[]; + + export function findRenderedComponentWithType

    ( + tree: Component, + type: ComponentClass

    ): Component; + export function findRenderedComponentWithType>( + tree: Component, + type: ComponentClass): C; + + export function createRenderer(): ShallowRenderer; + } + + interface SyntheticEventData { + altKey?: boolean; + button?: number; + buttons?: number; + clientX?: number; + clientY?: number; + changedTouches?: TouchList; + charCode?: boolean; + clipboardData?: DataTransfer; + ctrlKey?: boolean; + deltaMode?: number; + deltaX?: number; + deltaY?: number; + deltaZ?: number; + detail?: number; + getModifierState?(key: string): boolean; + key?: string; + keyCode?: number; + locale?: string; + location?: number; + metaKey?: boolean; + pageX?: number; + pageY?: number; + relatedTarget?: EventTarget; + repeat?: boolean; + screenX?: number; + screenY?: number; + shiftKey?: boolean; + targetTouches?: TouchList; + touches?: TouchList; + view?: AbstractView; + which?: number; + } + + interface EventSimulator { + (element: Element, eventData?: SyntheticEventData): void; + (component: Component, eventData?: SyntheticEventData): void; + } + + module ReactSimulate { + export var blur: EventSimulator; + export var change: EventSimulator; + export var click: EventSimulator; + export var cut: EventSimulator; + export var doubleClick: EventSimulator; + export var drag: EventSimulator; + export var dragEnd: EventSimulator; + export var dragEnter: EventSimulator; + export var dragExit: EventSimulator; + export var dragLeave: EventSimulator; + export var dragOver: EventSimulator; + export var dragStart: EventSimulator; + export var drop: EventSimulator; + export var focus: EventSimulator; + export var input: EventSimulator; + export var keyDown: EventSimulator; + export var keyPress: EventSimulator; + export var keyUp: EventSimulator; + export var mouseDown: EventSimulator; + export var mouseEnter: EventSimulator; + export var mouseLeave: EventSimulator; + export var mouseMove: EventSimulator; + export var mouseOut: EventSimulator; + export var mouseOver: EventSimulator; + export var mouseUp: EventSimulator; + export var paste: EventSimulator; + export var scroll: EventSimulator; + export var submit: EventSimulator; + export var touchCancel: EventSimulator; + export var touchEnd: EventSimulator; + export var touchMove: EventSimulator; + export var touchStart: EventSimulator; + export var wheel: EventSimulator; + } + + class ShallowRenderer { + getRenderOutput>(): E; + getRenderOutput(): ReactElement; + render(element: ReactElement, context?: any): void; + unmount(): void; + } +} diff --git a/react/react-global-tests.ts b/react/react-global-tests.ts index 0b20e4650..ac8b85116 100644 --- a/react/react-global-tests.ts +++ b/react/react-global-tests.ts @@ -68,34 +68,34 @@ var ClassicComponent: React.ClassicComponentClass = class ModernComponent extends React.Component implements React.ChildContextProvider { - + static propTypes: React.ValidationMap = { foo: React.PropTypes.number - } - + }; + static contextTypes: React.ValidationMap = { someValue: React.PropTypes.string - } - + }; + static childContextTypes: React.ValidationMap = { someOtherValue: React.PropTypes.string - } - + }; + static defaultProps: Props; - + context: Context; - + getChildContext() { return { - someOtherValue: 'foo' - } + someOtherValue: "foo" + }; } - + state = { inputValue: this.context.someValue, seconds: this.props.foo - } - + }; + reset() { this.setState({ inputValue: this.context.someValue, @@ -103,12 +103,12 @@ class ModernComponent extends React.Component }); } - private _input: React.HTMLComponent; - + private _input: HTMLInputElement; + render() { return React.DOM.div(null, React.DOM.input({ - ref: input => this._input = input, + ref: input => this._input = input, value: this.state.inputValue })); } @@ -135,7 +135,7 @@ var element: React.ReactElement = React.createElement(ModernComponent, props); var classicElement: React.ClassicElement = React.createElement(ClassicComponent, props); -var domElement: React.HTMLElement = +var domElement: React.ReactHTMLElement = React.createElement("div"); // React.cloneElement @@ -143,26 +143,27 @@ var clonedElement: React.ReactElement = React.cloneElement(element, props); var clonedClassicElement: React.ClassicElement = React.cloneElement(classicElement, props); -var clonedDOMElement: React.HTMLElement = +var clonedDOMElement: React.ReactHTMLElement = React.cloneElement(domElement); // React.render var component: React.Component = - React.render(element, container); + ReactDOM.render(element, container); var classicComponent: React.ClassicComponent = - React.render(classicElement, container); -var domComponent: React.DOMComponent = - React.render(domElement, container); + ReactDOM.render(classicElement, container); +var domComponent: Element = + ReactDOM.render(domElement, container); // Other Top-Level API -var unmounted: boolean = React.unmountComponentAtNode(container); -var str: string = React.renderToString(element); -var markup: string = React.renderToStaticMarkup(element); +var unmounted: boolean = ReactDOM.unmountComponentAtNode(container); + +// ReactDOMServer is not supported in global version +// var str: string = ReactDOMServer.renderToString(element); +// var markup: string = ReactDOMServer.renderToStaticMarkup(element); var notValid: boolean = React.isValidElement(props); // false var isValid = React.isValidElement(element); // true -React.initializeTouchEvents(true); -var domNode: Element = React.findDOMNode(component); -domNode = React.findDOMNode(domNode); +var domNode: Element = ReactDOM.findDOMNode(component); +domNode = ReactDOM.findDOMNode(domNode); // // React Elements @@ -190,11 +191,7 @@ component.setState({ inputValue: "!!!" }); component.forceUpdate(); // classic -var htmlElement: Element = classicComponent.getDOMNode(); -var divElement: HTMLDivElement = classicComponent.getDOMNode(); var isMounted: boolean = classicComponent.isMounted(); -classicComponent.setProps(elementProps); -classicComponent.replaceProps(props); classicComponent.replaceState({ inputValue: "???", seconds: 60 }); var myComponent = component; @@ -209,7 +206,7 @@ var divStyle: React.CSSProperties = { // CSSProperties flex: "1 1 main-size", backgroundImage: "url('hello.png')" }; -var htmlAttr: React.HTMLAttributes = { +var htmlAttr: React.HTMLProps = { key: 36, ref: "htmlComponent", children: children, @@ -328,11 +325,12 @@ var ContextTypesSpecification: React.ComponentSpec = { // React.Children // -------------------------------------------------------------------------- -var childMap: { [key: string]: number } = +var mappedChildrenArray: number[] = React.Children.map(children, (child) => { return 42; }); React.Children.forEach(children, (child) => {}); var nChildren: number = React.Children.count(children); var onlyChild = React.Children.only([null, [[["Hallo"], true]], false]); +var childrenToArray: React.ReactChild[] = React.Children.toArray(children); // // Example from http://facebook.github.io/react/ @@ -344,7 +342,7 @@ interface TimerState { class Timer extends React.Component<{}, TimerState> { state = { secondsElapsed: 0 - } + }; private _interval: number; tick() { this.setState((prevState, props) => ({ @@ -365,5 +363,93 @@ class Timer extends React.Component<{}, TimerState> { ); } } -React.render(React.createElement(Timer), container); +ReactDOM.render(React.createElement(Timer), container); +// +// createFragment addon +// -------------------------------------------------------------------------- +React.addons.createFragment({ + a: React.DOM.div(), + b: ["a", false, React.createElement("span")] +}); + +// +// CSSTransitionGroup addon +// -------------------------------------------------------------------------- +React.createFactory(React.addons.CSSTransitionGroup)({ + component: React.createClass({ + render: (): React.ReactElement => null + }), + childFactory: (c) => c, + transitionName: "transition", + transitionAppear: false, + transitionEnter: true, + transitionLeave: true +}); + +// +// LinkedStateMixin addon +// -------------------------------------------------------------------------- +React.createClass({ + mixins: [React.addons.LinkedStateMixin], + render: function() { return React.DOM.div(null); } +}); + +// +// Perf addon +// -------------------------------------------------------------------------- +React.addons.Perf.start(); +React.addons.Perf.stop(); +var measurements = React.addons.Perf.getLastMeasurements(); +React.addons.Perf.printInclusive(measurements); +React.addons.Perf.printExclusive(measurements); +React.addons.Perf.printWasted(measurements); +React.addons.Perf.printDOM(measurements); + +// +// PureRenderMixin addon +// -------------------------------------------------------------------------- +React.createClass({ + mixins: [React.addons.PureRenderMixin], + render: function() { return React.DOM.div(null); } +}); + +// +// TestUtils addon +// -------------------------------------------------------------------------- +var node: Element; +React.addons.TestUtils.Simulate.click(node); +React.addons.TestUtils.Simulate.change(node); +React.addons.TestUtils.Simulate.keyDown(node, { key: "Enter" }); + +var renderer: React.ShallowRenderer = + React.addons.TestUtils.createRenderer(); +renderer.render(React.createElement(Timer)); +var output: React.ReactElement> = + renderer.getRenderOutput(); + +// +// TransitionGroup addon +// -------------------------------------------------------------------------- +React.createFactory(React.addons.TransitionGroup)({ component: "div" }); + +// +// update addon +// -------------------------------------------------------------------------- +{ +// These are copied from https://facebook.github.io/react/docs/update.html +let initialArray = [1, 2, 3]; +let newArray = React.addons.update(initialArray, {$push: [4]}); // => [1, 2, 3, 4] + +let collection = [1, 2, {a: [12, 17, 15]}]; +let newCollection = React.addons.update(collection, {2: {a: {$splice: [[1, 1, 13, 14]]}}}); +// => [1, 2, {a: [12, 13, 14, 15]}] + +let obj = {a: 5, b: 3}; +let newObj = React.addons.update(obj, {b: {$apply: function(x) {return x * 2;}}}); +// => {a: 5, b: 6} +let newObj2 = React.addons.update(obj, {b: {$set: obj.b * 2}}); + +let objShallow = {a: 5, b: 3}; +let newObjShallow = React.addons.update(obj, {$merge: {b: 6, c: 7}}); // => {a: 5, b: 6, c: 7} +} diff --git a/react/react-global.d.ts b/react/react-global.d.ts index 1728ba2fc..1c50ce7e4 100644 --- a/react/react-global.d.ts +++ b/react/react-global.d.ts @@ -1,285 +1,22 @@ -// Type definitions for React v0.13.3 (namespace) +// Type definitions for React v0.14 (namespace) // Project: http://facebook.github.io/react/ // Definitions by: Asana , AssureSign , Microsoft // Definitions: https://github.com/borisyankov/DefinitelyTyped /// +/// +/// +/// +/// +/// +/// +/// +/// +/// import React = __React; +import ReactDOM = __React.__DOM; declare namespace __React { - // - // React.addons - // ---------------------------------------------------------------------- - - export module addons { - export var CSSTransitionGroup: CSSTransitionGroup; - export var TransitionGroup: TransitionGroup; - - export var LinkedStateMixin: LinkedStateMixin; - export var PureRenderMixin: PureRenderMixin; - - export function batchedUpdates( - callback: (a: A, b: B) => any, a: A, b: B): void; - export function batchedUpdates(callback: (a: A) => any, a: A): void; - export function batchedUpdates(callback: () => any): void; - - // deprecated: use petehunt/react-classset or JedWatson/classnames - export function classSet(cx: { [key: string]: boolean }): string; - export function classSet(...classList: string[]): string; - - export function cloneWithProps

    ( - element: DOMElement

    , props: P): DOMElement

    ; - export function cloneWithProps

    ( - element: ClassicElement

    , props: P): ClassicElement

    ; - export function cloneWithProps

    ( - element: ReactElement

    , props: P): ReactElement

    ; - - export function createFragment( - object: { [key: string]: ReactNode }): ReactFragment; - - export function update(value: any[], spec: UpdateArraySpec): any[]; - export function update(value: {}, spec: UpdateSpec): any; - - // Development tools - export import Perf = ReactPerf; - export import TestUtils = ReactTestUtils; - } - - // - // React.addons (Transitions) - // ---------------------------------------------------------------------- - - interface TransitionGroupProps { - component?: ReactType; - childFactory?: (child: ReactElement) => ReactElement; - } - - interface CSSTransitionGroupProps extends TransitionGroupProps { - transitionName: string; - transitionAppear?: boolean; - transitionEnter?: boolean; - transitionLeave?: boolean; - } - - type CSSTransitionGroup = ComponentClass; - type TransitionGroup = ComponentClass; - - // - // React.addons (Mixins) - // ---------------------------------------------------------------------- - - interface ReactLink { - value: T; - requestChange(newValue: T): void; - } - - interface LinkedStateMixin extends Mixin { - linkState(key: string): ReactLink; - } - - interface PureRenderMixin extends Mixin { - } - - // - // Reat.addons.update - // ---------------------------------------------------------------------- - - interface UpdateSpecCommand { - $set?: any; - $merge?: {}; - $apply?(value: any): any; - } - - interface UpdateSpecPath { - [key: string]: UpdateSpec; - } - - type UpdateSpec = UpdateSpecCommand | UpdateSpecPath; - - interface UpdateArraySpec extends UpdateSpecCommand { - $push?: any[]; - $unshift?: any[]; - $splice?: any[][]; - } - - // - // React.addons.Perf - // ---------------------------------------------------------------------- - - interface ComponentPerfContext { - current: string; - owner: string; - } - - interface NumericPerfContext { - [key: string]: number; - } - - interface Measurements { - exclusive: NumericPerfContext; - inclusive: NumericPerfContext; - render: NumericPerfContext; - counts: NumericPerfContext; - writes: NumericPerfContext; - displayNames: { - [key: string]: ComponentPerfContext; - }; - totalTime: number; - } - - module ReactPerf { - export function start(): void; - export function stop(): void; - export function printInclusive(measurements: Measurements[]): void; - export function printExclusive(measurements: Measurements[]): void; - export function printWasted(measurements: Measurements[]): void; - export function printDOM(measurements: Measurements[]): void; - export function getLastMeasurements(): Measurements[]; - } - - // - // React.addons.TestUtils - // ---------------------------------------------------------------------- - - interface MockedComponentClass { - new(): any; - } - - module ReactTestUtils { - export import Simulate = ReactSimulate; - - export function renderIntoDocument

    ( - element: ReactElement

    ): Component; - export function renderIntoDocument>( - element: ReactElement): C; - - export function mockComponent( - mocked: MockedComponentClass, mockTagName?: string): typeof ReactTestUtils; - - export function isElementOfType( - element: ReactElement, type: ReactType): boolean; - export function isTextComponent(instance: Component): boolean; - export function isDOMComponent(instance: Component): boolean; - export function isCompositeComponent(instance: Component): boolean; - export function isCompositeComponentWithType( - instance: Component, - type: ComponentClass): boolean; - - export function findAllInRenderedTree( - tree: Component, - fn: (i: Component) => boolean): Component; - - export function scryRenderedDOMComponentsWithClass( - tree: Component, - className: string): DOMComponent[]; - export function findRenderedDOMComponentWithClass( - tree: Component, - className: string): DOMComponent; - - export function scryRenderedDOMComponentsWithTag( - tree: Component, - tagName: string): DOMComponent[]; - export function findRenderedDOMComponentWithTag( - tree: Component, - tagName: string): DOMComponent; - - export function scryRenderedComponentsWithType

    ( - tree: Component, - type: ComponentClass

    ): Component[]; - export function scryRenderedComponentsWithType>( - tree: Component, - type: ComponentClass): C[]; - - export function findRenderedComponentWithType

    ( - tree: Component, - type: ComponentClass

    ): Component; - export function findRenderedComponentWithType>( - tree: Component, - type: ComponentClass): C; - - export function createRenderer(): ShallowRenderer; - } - - interface SyntheticEventData { - altKey?: boolean; - button?: number; - buttons?: number; - clientX?: number; - clientY?: number; - changedTouches?: TouchList; - charCode?: boolean; - clipboardData?: DataTransfer; - ctrlKey?: boolean; - deltaMode?: number; - deltaX?: number; - deltaY?: number; - deltaZ?: number; - detail?: number; - getModifierState?(key: string): boolean; - key?: string; - keyCode?: number; - locale?: string; - location?: number; - metaKey?: boolean; - pageX?: number; - pageY?: number; - relatedTarget?: EventTarget; - repeat?: boolean; - screenX?: number; - screenY?: number; - shiftKey?: boolean; - targetTouches?: TouchList; - touches?: TouchList; - view?: AbstractView; - which?: number; - } - - interface EventSimulator { - (element: Element, eventData?: SyntheticEventData): void; - (component: Component, eventData?: SyntheticEventData): void; - } - - module ReactSimulate { - export var blur: EventSimulator; - export var change: EventSimulator; - export var click: EventSimulator; - export var cut: EventSimulator; - export var doubleClick: EventSimulator; - export var drag: EventSimulator; - export var dragEnd: EventSimulator; - export var dragEnter: EventSimulator; - export var dragExit: EventSimulator; - export var dragLeave: EventSimulator; - export var dragOver: EventSimulator; - export var dragStart: EventSimulator; - export var drop: EventSimulator; - export var focus: EventSimulator; - export var input: EventSimulator; - export var keyDown: EventSimulator; - export var keyPress: EventSimulator; - export var keyUp: EventSimulator; - export var mouseDown: EventSimulator; - export var mouseEnter: EventSimulator; - export var mouseLeave: EventSimulator; - export var mouseMove: EventSimulator; - export var mouseOut: EventSimulator; - export var mouseOver: EventSimulator; - export var mouseUp: EventSimulator; - export var paste: EventSimulator; - export var scroll: EventSimulator; - export var submit: EventSimulator; - export var touchCancel: EventSimulator; - export var touchEnd: EventSimulator; - export var touchMove: EventSimulator; - export var touchStart: EventSimulator; - export var wheel: EventSimulator; - } - - class ShallowRenderer { - getRenderOutput>(): E; - getRenderOutput(): ReactElement; - render(element: ReactElement, context?: any): void; - unmount(): void; - } + export import addons = __React.__Addons; } diff --git a/react/react-tests.ts b/react/react-tests.ts index 053a17eb9..53861d35c 100644 --- a/react/react-tests.ts +++ b/react/react-tests.ts @@ -1,11 +1,32 @@ /// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// + import React = require("react"); +import ReactDOM = require("react-dom"); +import ReactDOMServer = require("react-dom/server"); +import createFragment = require("react-addons-create-fragment"); +import CSSTransitionGroup = require("react-addons-css-transition-group"); +import LinkedStateMixin = require("react-addons-linked-state-mixin"); +import Perf = require("react-addons-perf"); +import PureRenderMixin = require("react-addons-pure-render-mixin"); +import shallowCompare = require("react-addons-shallow-compare"); +import TestUtils = require("react-addons-test-utils"); +import TransitionGroup = require("react-addons-transition-group"); +import update = require("react-addons-update"); interface Props extends React.Props { hello: string; world?: string; foo: number; - bar: boolean; } interface State { @@ -29,8 +50,7 @@ var props: Props = { key: 42, ref: "myComponent42", hello: "world", - foo: 42, - bar: true + foo: 42 }; var container: Element; @@ -42,11 +62,10 @@ var container: Element; var ClassicComponent: React.ClassicComponentClass = React.createClass({ getDefaultProps() { - return { + return { hello: undefined, world: "peace", - foo: undefined, - bar: undefined, + foo: undefined }; }, getInitialState() { @@ -68,59 +87,83 @@ var ClassicComponent: React.ClassicComponentClass = }); class ModernComponent extends React.Component - implements React.ChildContextProvider { - + implements MyComponent, React.ChildContextProvider { + static propTypes: React.ValidationMap = { foo: React.PropTypes.number - } - + }; + static contextTypes: React.ValidationMap = { someValue: React.PropTypes.string - } - + }; + static childContextTypes: React.ValidationMap = { someOtherValue: React.PropTypes.string - } - - static defaultProps: Props; - + }; + context: Context; - + getChildContext() { return { - someOtherValue: 'foo' - } + someOtherValue: "foo" + }; } - + state = { inputValue: this.context.someValue, seconds: this.props.foo - } - + }; + reset() { + this._myComponent.reset(); this.setState({ inputValue: this.context.someValue, seconds: this.props.foo }); } - private _input: React.HTMLComponent; - + private _myComponent: MyComponent; + private _input: HTMLInputElement; + render() { return React.DOM.div(null, React.DOM.input({ - ref: input => this._input = input, + ref: input => this._input = input, value: this.state.inputValue })); } + + shouldComponentUpdate(nextProps: Props, nextState: State, nextContext: any): boolean { + return shallowCompare(this, nextProps, nextState); + } } +interface SCProps extends React.Props<{}> { + foo?: number; +} + +var StatelessComponent = (props: SCProps) => { + return React.DOM.div(null, props.foo); +}; + +// Must explicitly type-annotate to add defaultProps/contextTypes +var StatelessComponent2: React.StatelessComponent = + (props: SCProps) => React.DOM.div(null, props.foo); +StatelessComponent2.defaultProps = { + foo: 42 +}; + // React.createFactory var factory: React.Factory = React.createFactory(ModernComponent); var factoryElement: React.ReactElement = factory(props); +var statelessFactory: React.Factory = + React.createFactory(StatelessComponent); +var statelessElement: React.ReactElement = + statelessFactory(props); + var classicFactory: React.ClassicFactory = React.createFactory(ClassicComponent); var classicFactoryElement: React.ClassicElement = @@ -134,36 +177,39 @@ var domFactoryElement: React.DOMElement = // React.createElement var element: React.ReactElement = React.createElement(ModernComponent, props); +var statelessElement: React.ReactElement = + React.createElement(StatelessComponent, props); var classicElement: React.ClassicElement = React.createElement(ClassicComponent, props); -var domElement: React.HTMLElement = +var domElement: React.ReactHTMLElement = React.createElement("div"); // React.cloneElement var clonedElement: React.ReactElement = React.cloneElement(element, props); +var clonedStatelessElement: React.ReactElement = + React.cloneElement(statelessElement, props); var clonedClassicElement: React.ClassicElement = React.cloneElement(classicElement, props); -var clonedDOMElement: React.HTMLElement = +var clonedDOMElement: React.ReactHTMLElement = React.cloneElement(domElement); // React.render var component: React.Component = - React.render(element, container); + ReactDOM.render(element, container); var classicComponent: React.ClassicComponent = - React.render(classicElement, container); -var domComponent: React.DOMComponent = - React.render(domElement, container); + ReactDOM.render(classicElement, container); +var domComponent: Element = + ReactDOM.render(domElement, container); // Other Top-Level API -var unmounted: boolean = React.unmountComponentAtNode(container); -var str: string = React.renderToString(element); -var markup: string = React.renderToStaticMarkup(element); +var unmounted: boolean = ReactDOM.unmountComponentAtNode(container); +var str: string = ReactDOMServer.renderToString(element); +var markup: string = ReactDOMServer.renderToStaticMarkup(element); var notValid: boolean = React.isValidElement(props); // false var isValid = React.isValidElement(element); // true -React.initializeTouchEvents(true); -var domNode: Element = React.findDOMNode(component); -domNode = React.findDOMNode(domNode); +var domNode: Element = ReactDOM.findDOMNode(component); +domNode = ReactDOM.findDOMNode(domNode); // // React Elements @@ -191,16 +237,42 @@ component.setState({ inputValue: "!!!" }); component.forceUpdate(); // classic -var htmlElement: Element = classicComponent.getDOMNode(); -var divElement: HTMLDivElement = classicComponent.getDOMNode(); var isMounted: boolean = classicComponent.isMounted(); -classicComponent.setProps(elementProps); -classicComponent.replaceProps(props); classicComponent.replaceState({ inputValue: "???", seconds: 60 }); var myComponent = component; myComponent.reset(); +// +// Refs +// NB: to infer the correct type for callback refs, your component's Props +// interface must extend React.Props where T is your component type (or +// an interface that it implements). +// -------------------------------------------------------------------------- + +interface RCProps extends React.Props { +} + +class RefComponent extends React.Component { + static create = React.createFactory(RefComponent); + refMethod() { + } +} + +var componentRef: RefComponent; +RefComponent.create({ ref: "componentRef" }); +// type of c should be inferred +RefComponent.create({ ref: c => componentRef = c }); +componentRef.refMethod(); + +var domNodeRef: Element; +React.DOM.div({ ref: "domRef" }); +// type of node should be inferred +React.DOM.div({ ref: node => domNodeRef = node }); + +var inputNodeRef: HTMLInputElement; +React.DOM.input({ ref: node => inputNodeRef = node }); + // // Attributes // -------------------------------------------------------------------------- @@ -210,7 +282,7 @@ var divStyle: React.CSSProperties = { // CSSProperties flex: "1 1 main-size", backgroundImage: "url('hello.png')" }; -var htmlAttr: React.HTMLAttributes = { +var htmlAttr: React.HTMLProps = { key: 36, ref: "htmlComponent", children: children, @@ -329,11 +401,12 @@ var ContextTypesSpecification: React.ComponentSpec = { // React.Children // -------------------------------------------------------------------------- -var childMap: { [key: string]: number } = +var mappedChildrenArray: number[] = React.Children.map(children, (child) => { return 42; }); React.Children.forEach(children, (child) => {}); var nChildren: number = React.Children.count(children); var onlyChild = React.Children.only([null, [[["Hallo"], true]], false]); +var childrenToArray: React.ReactChild[] = React.Children.toArray(children); // // Example from http://facebook.github.io/react/ @@ -345,7 +418,7 @@ interface TimerState { class Timer extends React.Component<{}, TimerState> { state = { secondsElapsed: 0 - } + }; private _interval: number; tick() { this.setState((prevState, props) => ({ @@ -366,5 +439,121 @@ class Timer extends React.Component<{}, TimerState> { ); } } -React.render(React.createElement(Timer), container); +ReactDOM.render(React.createElement(Timer), container); +// +// createFragment addon +// -------------------------------------------------------------------------- +createFragment({ + a: React.DOM.div(), + b: ["a", false, React.createElement("span")] +}); + +// +// CSSTransitionGroup addon +// -------------------------------------------------------------------------- +React.createFactory(CSSTransitionGroup)({ + component: React.createClass({ + render: (): React.ReactElement => null + }), + childFactory: (c) => c, + transitionName: "transition", + transitionAppear: false, + transitionEnter: true, + transitionLeave: true +}); + +React.createFactory(CSSTransitionGroup)({ + transitionName: { + enter: "enter", + enterActive: "enterActive", + leave: "leave", + leaveActive: "leaveActive", + appear: "appear", + appearActive: "appearActive" + } +}); + +// +// LinkedStateMixin addon +// -------------------------------------------------------------------------- +React.createClass({ + mixins: [LinkedStateMixin], + getInitialState: function() { + return { + isChecked: false, + message: "hello!" + }; + }, + render: function() { + return React.DOM.div(null, + React.DOM.input({ + type: "checkbox", + checkedLink: this.linkState("isChecked") + }), + React.DOM.input({ + type: "text", + valueLink: this.linkState("message") + }) + ); + } +}); + +// +// Perf addon +// -------------------------------------------------------------------------- +Perf.start(); +Perf.stop(); +var measurements = Perf.getLastMeasurements(); +Perf.printInclusive(measurements); +Perf.printExclusive(measurements); +Perf.printWasted(measurements); +Perf.printDOM(measurements); + +// +// PureRenderMixin addon +// -------------------------------------------------------------------------- +React.createClass({ + mixins: [PureRenderMixin], + render: function() { return React.DOM.div(null); } +}); + +// +// TestUtils addon +// -------------------------------------------------------------------------- +var node: Element; +TestUtils.Simulate.click(node); +TestUtils.Simulate.change(node); +TestUtils.Simulate.keyDown(node, { key: "Enter" }); + +var renderer: React.ShallowRenderer = + TestUtils.createRenderer(); +renderer.render(React.createElement(Timer)); +var output: React.ReactElement> = + renderer.getRenderOutput(); + +// +// TransitionGroup addon +// -------------------------------------------------------------------------- +React.createFactory(TransitionGroup)({ component: "div" }); + +// +// update addon +// -------------------------------------------------------------------------- +{ +// 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) {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/react/react.d.ts b/react/react.d.ts index 25a3a30b9..fb04cf0f5 100644 --- a/react/react.d.ts +++ b/react/react.d.ts @@ -1,4 +1,4 @@ -// Type definitions for React v0.13.3 +// Type definitions for React v0.14 // Project: http://facebook.github.io/react/ // Definitions by: Asana , AssureSign , Microsoft // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -8,27 +8,32 @@ declare namespace __React { // React Elements // ---------------------------------------------------------------------- - type ReactType = ComponentClass | string; + type ReactType = string | ComponentClass | StatelessComponent; - interface ReactElement

    { - type: string | ComponentClass

    ; + interface ReactElement

    > { + type: string | ComponentClass

    | StatelessComponent

    ; props: P; key: string | number; - ref: string | ((component: Component) => any); + ref: string | ((component: Component | Element) => any); } interface ClassicElement

    extends ReactElement

    { - type: string | ClassicComponentClass

    ; + type: ClassicComponentClass

    ; ref: string | ((component: ClassicComponent) => any); } - interface DOMElement

    extends ClassicElement

    { + interface DOMElement

    > extends ReactElement

    { type: string; - ref: string | ((component: DOMComponent

    ) => any); + ref: string | ((element: Element) => any); } - type HTMLElement = DOMElement; - type SVGElement = DOMElement; + interface ReactHTMLElement extends DOMElement> { + ref: string | ((element: HTMLElement) => any); + } + + interface ReactSVGElement extends DOMElement { + ref: string | ((element: SVGElement) => any); + } // // Factories @@ -42,13 +47,12 @@ declare namespace __React { (props?: P, ...children: ReactNode[]): ClassicElement

    ; } - interface DOMFactory

    extends ClassicFactory

    { + interface DOMFactory

    > extends Factory

    { (props?: P, ...children: ReactNode[]): DOMElement

    ; } - type HTMLFactory = DOMFactory; - type SVGFactory = DOMFactory; - type SVGElementFactory = DOMFactory; + type HTMLFactory = DOMFactory>; + type SVGFactory = DOMFactory; // // React Nodes @@ -69,19 +73,19 @@ declare namespace __React { function createClass(spec: ComponentSpec): ClassicComponentClass

    ; function createFactory

    (type: string): DOMFactory

    ; - function createFactory

    (type: ClassicComponentClass

    | string): ClassicFactory

    ; - function createFactory

    (type: ComponentClass

    ): Factory

    ; + function createFactory

    (type: ClassicComponentClass

    ): ClassicFactory

    ; + function createFactory

    (type: ComponentClass

    | StatelessComponent

    ): Factory

    ; function createElement

    ( type: string, props?: P, ...children: ReactNode[]): DOMElement

    ; function createElement

    ( - type: ClassicComponentClass

    | string, + type: ClassicComponentClass

    , props?: P, ...children: ReactNode[]): ClassicElement

    ; function createElement

    ( - type: ComponentClass

    , + type: ComponentClass

    | StatelessComponent

    , props?: P, ...children: ReactNode[]): ReactElement

    ; @@ -98,29 +102,7 @@ declare namespace __React { props?: P, ...children: ReactNode[]): ReactElement

    ; - function render

    ( - element: DOMElement

    , - container: Element, - callback?: () => any): DOMComponent

    ; - function render( - element: ClassicElement

    , - container: Element, - callback?: () => any): ClassicComponent; - function render( - element: ReactElement

    , - container: Element, - callback?: () => any): Component; - - function unmountComponentAtNode(container: Element): boolean; - function renderToString(element: ReactElement): string; - function renderToStaticMarkup(element: ReactElement): string; function isValidElement(object: {}): boolean; - function initializeTouchEvents(shouldUseTouch: boolean): void; - - function findDOMNode( - componentOrElement: Component | Element): TElement; - function findDOMNode( - componentOrElement: Component | Element): Element; var DOM: ReactDOM; var PropTypes: ReactPropTypes; @@ -130,13 +112,10 @@ declare namespace __React { // Component API // ---------------------------------------------------------------------- + type ReactInstance = Component | Element; + // Base component for plain JS classes class Component implements ComponentLifecycle { - static propTypes: ValidationMap; - static contextTypes: ValidationMap; - static childContextTypes: ValidationMap; - static defaultProps: Props; - constructor(props?: P, context?: any); setState(f: (prevState: S, props: P) => S, callback?: () => any): void; setState(state: S, callback?: () => any): void; @@ -146,27 +125,16 @@ declare namespace __React { state: S; context: {}; refs: { - [key: string]: Component + [key: string]: ReactInstance }; } interface ClassicComponent extends Component { replaceState(nextState: S, callback?: () => any): void; - getDOMNode(): TElement; - getDOMNode(): Element; isMounted(): boolean; getInitialState?(): S; - setProps(nextProps: P, callback?: () => any): void; - replaceProps(nextProps: P, callback?: () => any): void; } - interface DOMComponent

    extends ClassicComponent { - tagName: string; - } - - type HTMLComponent = DOMComponent; - type SVGComponent = DOMComponent; - interface ChildContextProvider { getChildContext(): CC; } @@ -175,6 +143,13 @@ declare namespace __React { // Class Interfaces // ---------------------------------------------------------------------- + interface StatelessComponent

    { + (props?: P, context?: any): ReactElement; + propTypes?: ValidationMap

    ; + contextTypes?: ValidationMap; + defaultProps?: P; + } + interface ComponentClass

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

    ; @@ -212,7 +187,7 @@ declare namespace __React { displayName?: string; propTypes?: ValidationMap; contextTypes?: ValidationMap; - childContextTypes?: ValidationMap + childContextTypes?: ValidationMap; getDefaultProps?(): P; getInitialState?(): S; @@ -243,12 +218,23 @@ declare namespace __React { type: string; } + interface ClipboardEvent extends SyntheticEvent { + clipboardData: DataTransfer; + } + + interface CompositionEvent extends SyntheticEvent { + data: string; + } + interface DragEvent extends SyntheticEvent { dataTransfer: DataTransfer; } - interface ClipboardEvent extends SyntheticEvent { - clipboardData: DataTransfer; + interface FocusEvent extends SyntheticEvent { + relatedTarget: EventTarget; + } + + interface FormEvent extends SyntheticEvent { } interface KeyboardEvent extends SyntheticEvent { @@ -266,13 +252,6 @@ declare namespace __React { which: number; } - interface FocusEvent extends SyntheticEvent { - relatedTarget: EventTarget; - } - - interface FormEvent extends SyntheticEvent { - } - interface MouseEvent extends SyntheticEvent { altKey: boolean; button: number; @@ -313,8 +292,6 @@ declare namespace __React { deltaZ: number; } - interface LoadEvent extends SyntheticEvent {} - // // Event Handler Types // ---------------------------------------------------------------------- @@ -323,16 +300,18 @@ declare namespace __React { (event: E): void; } - interface DragEventHandler extends EventHandler {} - interface ClipboardEventHandler extends EventHandler {} - interface KeyboardEventHandler extends EventHandler {} - interface FocusEventHandler extends EventHandler {} - interface FormEventHandler extends EventHandler {} - interface MouseEventHandler extends EventHandler {} - interface TouchEventHandler extends EventHandler {} - interface UIEventHandler extends EventHandler {} - interface WheelEventHandler extends EventHandler {} - interface LoadEventHandler extends EventHandler {} + type ReactEventHandler = EventHandler; + + type ClipboardEventHandler = EventHandler; + type CompositionEventHandler = EventHandler; + type DragEventHandler = EventHandler; + type FocusEventHandler = EventHandler; + type FormEventHandler = EventHandler; + type KeyboardEventHandler = EventHandler; + type MouseEventHandler = EventHandler; + type TouchEventHandler = EventHandler; + type UIEventHandler = EventHandler; + type WheelEventHandler = EventHandler; // // Props / DOM Attributes @@ -344,18 +323,70 @@ declare namespace __React { ref?: string | ((component: T) => any); } - interface DOMAttributesBase extends Props { + interface HTMLProps extends HTMLAttributes, Props { + } + + interface SVGProps extends SVGAttributes, Props { + } + + interface DOMAttributes { + dangerouslySetInnerHTML?: { + __html: string; + }; + + // Clipboard Events onCopy?: ClipboardEventHandler; onCut?: ClipboardEventHandler; onPaste?: ClipboardEventHandler; - onKeyDown?: KeyboardEventHandler; - onKeyPress?: KeyboardEventHandler; - onKeyUp?: KeyboardEventHandler; + + // Composition Events + onCompositionEnd?: CompositionEventHandler; + onCompositionStart?: CompositionEventHandler; + onCompositionUpdate?: CompositionEventHandler; + + // Focus Events onFocus?: FocusEventHandler; onBlur?: FocusEventHandler; + + // Form Events onChange?: FormEventHandler; onInput?: FormEventHandler; onSubmit?: FormEventHandler; + + // Image Events + onLoad?: ReactEventHandler; + onError?: ReactEventHandler; // also a Media Event + + // Keyboard Events + onKeyDown?: KeyboardEventHandler; + onKeyPress?: KeyboardEventHandler; + onKeyUp?: KeyboardEventHandler; + + // Media Events + onAbort?: ReactEventHandler; + onCanPlay?: ReactEventHandler; + onCanPlayThrough?: ReactEventHandler; + onDurationChange?: ReactEventHandler; + onEmptied?: ReactEventHandler; + onEncrypted?: ReactEventHandler; + onEnded?: ReactEventHandler; + onLoadedData?: ReactEventHandler; + onLoadedMetadata?: ReactEventHandler; + onLoadStart?: ReactEventHandler; + onPause?: ReactEventHandler; + onPlay?: ReactEventHandler; + onPlaying?: ReactEventHandler; + onProgress?: ReactEventHandler; + onRateChange?: ReactEventHandler; + onSeeked?: ReactEventHandler; + onSeeking?: ReactEventHandler; + onStalled?: ReactEventHandler; + onSuspend?: ReactEventHandler; + onTimeUpdate?: ReactEventHandler; + onVolumeChange?: ReactEventHandler; + onWaiting?: ReactEventHandler; + + // MouseEvents onClick?: MouseEventHandler; onContextMenu?: MouseEventHandler; onDoubleClick?: MouseEventHandler; @@ -374,23 +405,21 @@ declare namespace __React { onMouseOut?: MouseEventHandler; onMouseOver?: MouseEventHandler; onMouseUp?: MouseEventHandler; + + // Selection Events + onSelect?: ReactEventHandler; + + // Touch Events onTouchCancel?: TouchEventHandler; onTouchEnd?: TouchEventHandler; onTouchMove?: TouchEventHandler; onTouchStart?: TouchEventHandler; + + // UI Events onScroll?: UIEventHandler; + + // Wheel Events onWheel?: WheelEventHandler; - onLoad?: LoadEventHandler; - - className?: string; - id?: string; - - dangerouslySetInnerHTML?: { - __html: string; - }; - } - - interface DOMAttributes extends DOMAttributesBase> { } // This interface is not complete. Only properties accepting @@ -419,10 +448,1244 @@ declare namespace __React { strokeOpacity?: number; strokeWidth?: number; + // Remaining properties auto-extracted from http://docs.webplatform.org. + // License: http://docs.webplatform.org/wiki/Template:CC-by-3.0 + /** + * Aligns a flex container's lines within the flex container when there is extra space in the cross-axis, similar to how justify-content aligns individual items within the main-axis. + */ + alignContent?: any; + + /** + * Sets the default alignment in the cross axis for all of the flex container's items, including anonymous flex items, similarly to how justify-content aligns items along the main axis. + */ + alignItems?: any; + + /** + * Allows the default alignment to be overridden for individual flex items. + */ + alignSelf?: any; + + /** + * This property allows precise alignment of elements, such as graphics, that do not have a baseline-table or lack the desired baseline in their baseline-table. With the alignment-adjust property, the position of the baseline identified by the alignment-baseline can be explicitly determined. It also determines precisely the alignment point for each glyph within a textual element. + */ + alignmentAdjust?: any; + + alignmentBaseline?: any; + + /** + * Defines a length of time to elapse before an animation starts, allowing an animation to begin execution some time after it is applied. + */ + animationDelay?: any; + + /** + * Defines whether an animation should run in reverse on some or all cycles. + */ + animationDirection?: any; + + /** + * Specifies how many times an animation cycle should play. + */ + animationIterationCount?: any; + + /** + * Defines the list of animations that apply to the element. + */ + animationName?: any; + + /** + * Defines whether an animation is running or paused. + */ + animationPlayState?: any; + + /** + * Allows changing the style of any element to platform-based interface elements or vice versa. + */ + appearance?: any; + + /** + * Determines whether or not the “back” side of a transformed element is visible when facing the viewer. + */ + backfaceVisibility?: any; + + /** + * This property describes how the element's background images should blend with each other and the element's background color. + * The value is a list of blend modes that corresponds to each background image. Each element in the list will apply to the corresponding element of background-image. If a property doesn’t have enough comma-separated values to match the number of layers, the UA must calculate its used value by repeating the list of values until there are enough. + */ + backgroundBlendMode?: any; + + backgroundComposite?: any; + + /** + * Applies one or more background images to an element. These can be any valid CSS image, including url() paths to image files or CSS gradients. + */ + backgroundImage?: any; + + /** + * Specifies what the background-position property is relative to. + */ + backgroundOrigin?: any; + + /** + * Sets the horizontal position of a background image. + */ + backgroundPositionX?: any; + + /** + * Background-repeat defines if and how background images will be repeated after they have been sized and positioned + */ + backgroundRepeat?: any; + + /** + * Obsolete - spec retired, not implemented. + */ + baselineShift?: any; + + /** + * Non standard. Sets or retrieves the location of the Dynamic HTML (DHTML) behavior. + */ + behavior?: any; + + /** + * Shorthand property that defines the different properties of all four sides of an element's border in a single declaration. It can be used to set border-width, border-style and border-color, or a subset of these. + */ + border?: any; + + /** + * Defines the shape of the border of the bottom-left corner. + */ + borderBottomLeftRadius?: any; + + /** + * Defines the shape of the border of the bottom-right corner. + */ + borderBottomRightRadius?: any; + + /** + * Sets the width of an element's bottom border. To set all four borders, use the border-width shorthand property which sets the values simultaneously for border-top-width, border-right-width, border-bottom-width, and border-left-width. + */ + borderBottomWidth?: any; + + /** + * Border-collapse can be used for collapsing the borders between table cells + */ + borderCollapse?: any; + + /** + * The CSS border-color property sets the color of an element's four borders. This property can have from one to four values, made up of the elementary properties: • border-top-color + * • border-right-color + * • border-bottom-color + * • border-left-color The default color is the currentColor of each of these values. + * If you provide one value, it sets the color for the element. Two values set the horizontal and vertical values, respectively. Providing three values sets the top, vertical, and bottom values, in that order. Four values set all for sides: top, right, bottom, and left, in that order. + */ + borderColor?: any; + + /** + * Specifies different corner clipping effects, such as scoop (inner curves), bevel (straight cuts) or notch (cut-off rectangles). Works along with border-radius to specify the size of each corner effect. + */ + borderCornerShape?: any; + + /** + * The property border-image-source is used to set the image to be used instead of the border style. If this is set to none the border-style is used instead. + */ + borderImageSource?: any; + + /** + * The border-image-width CSS property defines the offset to use for dividing the border image in nine parts, the top-left corner, central top edge, top-right-corner, central right edge, bottom-right corner, central bottom edge, bottom-left corner, and central right edge. They represent inward distance from the top, right, bottom, and left edges. + */ + borderImageWidth?: any; + + /** + * Shorthand property that defines the border-width, border-style and border-color of an element's left border in a single declaration. Note that you can use the corresponding longhand properties to set specific individual properties of the left border — border-left-width, border-left-style and border-left-color. + */ + borderLeft?: any; + + /** + * The CSS border-left-color property sets the color of an element's left border. This page explains the border-left-color value, but often you will find it more convenient to fix the border's left color as part of a shorthand set, either border-left or border-color. + * Colors can be defined several ways. For more information, see Usage. + */ + borderLeftColor?: any; + + /** + * Sets the style of an element's left border. To set all four borders, use the shorthand property, border-style. Otherwise, you can set the borders individually with border-top-style, border-right-style, border-bottom-style, border-left-style. + */ + borderLeftStyle?: any; + + /** + * Sets the width of an element's left border. To set all four borders, use the border-width shorthand property which sets the values simultaneously for border-top-width, border-right-width, border-bottom-width, and border-left-width. + */ + borderLeftWidth?: any; + + /** + * Shorthand property that defines the border-width, border-style and border-color of an element's right border in a single declaration. Note that you can use the corresponding longhand properties to set specific individual properties of the right border — border-right-width, border-right-style and border-right-color. + */ + borderRight?: any; + + /** + * Sets the color of an element's right border. This page explains the border-right-color value, but often you will find it more convenient to fix the border's right color as part of a shorthand set, either border-right or border-color. + * Colors can be defined several ways. For more information, see Usage. + */ + borderRightColor?: any; + + /** + * Sets the style of an element's right border. To set all four borders, use the shorthand property, border-style. Otherwise, you can set the borders individually with border-top-style, border-right-style, border-bottom-style, border-left-style. + */ + borderRightStyle?: any; + + /** + * Sets the width of an element's right border. To set all four borders, use the border-width shorthand property which sets the values simultaneously for border-top-width, border-right-width, border-bottom-width, and border-left-width. + */ + borderRightWidth?: any; + + /** + * Specifies the distance between the borders of adjacent cells. + */ + borderSpacing?: any; + + /** + * Sets the style of an element's four borders. This property can have from one to four values. With only one value, the value will be applied to all four borders; otherwise, this works as a shorthand property for each of border-top-style, border-right-style, border-bottom-style, border-left-style, where each border style may be assigned a separate value. + */ + borderStyle?: any; + + /** + * Shorthand property that defines the border-width, border-style and border-color of an element's top border in a single declaration. Note that you can use the corresponding longhand properties to set specific individual properties of the top border — border-top-width, border-top-style and border-top-color. + */ + borderTop?: any; + + /** + * Sets the color of an element's top border. This page explains the border-top-color value, but often you will find it more convenient to fix the border's top color as part of a shorthand set, either border-top or border-color. + * Colors can be defined several ways. For more information, see Usage. + */ + borderTopColor?: any; + + /** + * Sets the rounding of the top-left corner of the element. + */ + borderTopLeftRadius?: any; + + /** + * Sets the rounding of the top-right corner of the element. + */ + borderTopRightRadius?: any; + + /** + * Sets the style of an element's top border. To set all four borders, use the shorthand property, border-style. Otherwise, you can set the borders individually with border-top-style, border-right-style, border-bottom-style, border-left-style. + */ + borderTopStyle?: any; + + /** + * Sets the width of an element's top border. To set all four borders, use the border-width shorthand property which sets the values simultaneously for border-top-width, border-right-width, border-bottom-width, and border-left-width. + */ + borderTopWidth?: any; + + /** + * Sets the width of an element's four borders. This property can have from one to four values. This is a shorthand property for setting values simultaneously for border-top-width, border-right-width, border-bottom-width, and border-left-width. + */ + borderWidth?: any; + + /** + * Obsolete. + */ + boxAlign?: any; + + /** + * Breaks a box into fragments creating new borders, padding and repeating backgrounds or lets it stay as a continuous box on a page break, column break, or, for inline elements, at a line break. + */ + boxDecorationBreak?: any; + + /** + * Deprecated + */ + boxDirection?: any; + + /** + * Do not use. This property has been replaced by the flex-wrap property. + * Gets or sets a value that specifies the direction to add successive rows or columns when the value of box-lines is set to multiple. + */ + boxLineProgression?: any; + + /** + * Do not use. This property has been replaced by the flex-wrap property. + * Gets or sets a value that specifies whether child elements wrap onto multiple lines or columns based on the space available in the object. + */ + boxLines?: any; + + /** + * Do not use. This property has been replaced by flex-order. + * Specifies the ordinal group that a child element of the object belongs to. This ordinal value identifies the display order (along the axis defined by the box-orient property) for the group. + */ + boxOrdinalGroup?: any; + + /** + * The CSS break-after property allows you to force a break on multi-column layouts. More specifically, it allows you to force a break after an element. It allows you to determine if a break should occur, and what type of break it should be. The break-after CSS property describes how the page, column or region break behaves after the generated box. If there is no generated box, the property is ignored. + */ + breakAfter?: any; + + /** + * Control page/column/region breaks that fall above a block of content + */ + breakBefore?: any; + + /** + * Control page/column/region breaks that fall within a block of content + */ + breakInside?: any; + + /** + * The clear CSS property specifies if an element can be positioned next to or must be positioned below the floating elements that precede it in the markup. + */ + clear?: any; + + /** + * Deprecated; see clip-path. + * Lets you specify the dimensions of an absolutely positioned element that should be visible, and the element is clipped into this shape, and displayed. + */ + clip?: any; + + /** + * Clipping crops an graphic, so that only a portion of the graphic is rendered, or filled. This clip-rule property, when used with the clip-path property, defines which clip rule, or algorithm, to use when filling the different parts of a graphics. + */ + clipRule?: any; + + /** + * The color property sets the color of an element's foreground content (usually text), accepting any standard CSS color from keywords and hex values to RGB(a) and HSL(a). + */ + color?: any; + + /** + * Specifies how to fill columns (balanced or sequential). + */ + columnFill?: any; + + /** + * The column-gap property controls the width of the gap between columns in multi-column elements. + */ + columnGap?: any; + + /** + * Sets the width, style, and color of the rule between columns. + */ + columnRule?: any; + + /** + * Specifies the color of the rule between columns. + */ + columnRuleColor?: any; + + /** + * Specifies the width of the rule between columns. + */ + columnRuleWidth?: any; + + /** + * The column-span CSS property makes it possible for an element to span across all columns when its value is set to all. An element that spans more than one column is called a spanning element. + */ + columnSpan?: any; + + /** + * Specifies the width of columns in multi-column elements. + */ + columnWidth?: any; + + /** + * This property is a shorthand property for setting column-width and/or column-count. + */ + columns?: any; + + /** + * The counter-increment property accepts one or more names of counters (identifiers), each one optionally followed by an integer which specifies the value by which the counter should be incremented (e.g. if the value is 2, the counter increases by 2 each time it is invoked). + */ + counterIncrement?: any; + + /** + * The counter-reset property contains a list of one or more names of counters, each one optionally followed by an integer (otherwise, the integer defaults to 0.) Each time the given element is invoked, the counters specified by the property are set to the given integer. + */ + counterReset?: any; + + /** + * The cue property specifies sound files (known as an "auditory icon") to be played by speech media agents before and after presenting an element's content; if only one file is specified, it is played both before and after. The volume at which the file(s) should be played, relative to the volume of the main element, may also be specified. The icon files may also be set separately with the cue-before and cue-after properties. + */ + cue?: any; + + /** + * The cue-after property specifies a sound file (known as an "auditory icon") to be played by speech media agents after presenting an element's content; the volume at which the file should be played may also be specified. The shorthand property cue sets cue sounds for both before and after the element is presented. + */ + cueAfter?: any; + + /** + * The direction CSS property specifies the text direction/writing direction. The rtl is used for Hebrew or Arabic text, the ltr is for other languages. + */ + direction?: any; + + /** + * This property specifies the type of rendering box used for an element. It is a shorthand property for many other display properties. + */ + display?: any; + + /** + * The ‘fill’ property paints the interior of the given graphical element. The area to be painted consists of any areas inside the outline of the shape. To determine the inside of the shape, all subpaths are considered, and the interior is determined according to the rules associated with the current value of the ‘fill-rule’ property. The zero-width geometric outline of a shape is included in the area to be painted. + */ + fill?: any; + + /** + * The ‘fill-rule’ property indicates the algorithm which is to be used to determine what parts of the canvas are included inside the shape. For a simple, non-intersecting path, it is intuitively clear what region lies "inside"; however, for a more complex path, such as a path that intersects itself or where one subpath encloses another, the interpretation of "inside" is not so obvious. + * The ‘fill-rule’ property provides two options for how the inside of a shape is determined: + */ + fillRule?: any; + + /** + * Applies various image processing effects. This property is largely unsupported. See Compatibility section for more information. + */ + filter?: any; + + /** + * Obsolete, do not use. This property has been renamed to align-items. + * Specifies the alignment (perpendicular to the layout axis defined by the flex-direction property) of child elements of the object. + */ + flexAlign?: any; + + /** + * The flex-basis CSS property describes the initial main size of the flex item before any free space is distributed according to the flex factors described in the flex property (flex-grow and flex-shrink). + */ + flexBasis?: any; + + /** + * The flex-direction CSS property describes how flex items are placed in the flex container, by setting the direction of the flex container's main axis. + */ + flexDirection?: any; + + /** + * The flex-flow CSS property defines the flex container's main and cross axis. It is a shorthand property for the flex-direction and flex-wrap properties. + */ + flexFlow?: any; + + /** + * Do not use. This property has been renamed to align-self + * Specifies the alignment (perpendicular to the layout axis defined by flex-direction) of child elements of the object. + */ + flexItemAlign?: any; + + /** + * Do not use. This property has been renamed to align-content. + * Specifies how a flexbox's lines align within the flexbox when there is extra space along the axis that is perpendicular to the axis defined by the flex-direction property. + */ + flexLinePack?: any; + + /** + * Gets or sets a value that specifies the ordinal group that a flexbox element belongs to. This ordinal value identifies the display order for the group. + */ + flexOrder?: any; + + /** + * Elements which have the style float are floated horizontally. These elements can move as far to the left or right of the containing element. All elements after the floating element will flow around it, but elements before the floating element are not impacted. If several floating elements are placed after each other, they will float next to each other as long as there is room. + */ + float?: any; + + /** + * Flows content from a named flow (specified by a corresponding flow-into) through selected elements to form a dynamic chain of layout regions. + */ + flowFrom?: any; + + /** + * The font property is shorthand that allows you to do one of two things: you can either set up six of the most mature font properties in one line, or you can set one of a choice of keywords to adopt a system font setting. + */ + font?: any; + + /** + * The font-family property allows one or more font family names and/or generic family names to be specified for usage on the selected element(s)' text. The browser then goes through the list; for each character in the selection it applies the first font family that has an available glyph for that character. + */ + fontFamily?: any; + + /** + * The font-kerning property allows contextual adjustment of inter-glyph spacing, i.e. the spaces between the characters in text. This property controls metric kerning - that utilizes adjustment data contained in the font. Optical Kerning is not supported as yet. + */ + fontKerning?: any; + + /** + * The font-size-adjust property adjusts the font-size of the fallback fonts defined with font-family, so that the x-height is the same no matter what font is used. This preserves the readability of the text when fallback happens. + */ + fontSizeAdjust?: any; + + /** + * Allows you to expand or condense the widths for a normal, condensed, or expanded font face. + */ + fontStretch?: any; + + /** + * The font-style property allows normal, italic, or oblique faces to be selected. Italic forms are generally cursive in nature while oblique faces are typically sloped versions of the regular face. Oblique faces can be simulated by artificially sloping the glyphs of the regular face. + */ + fontStyle?: any; + + /** + * This value specifies whether the user agent is allowed to synthesize bold or oblique font faces when a font family lacks bold or italic faces. + */ + fontSynthesis?: any; + + /** + * The font-variant property enables you to select the small-caps font within a font family. + */ + fontVariant?: any; + + /** + * Fonts can provide alternate glyphs in addition to default glyph for a character. This property provides control over the selection of these alternate glyphs. + */ + fontVariantAlternates?: any; + + /** + * Lays out one or more grid items bound by 4 grid lines. Shorthand for setting grid-column-start, grid-column-end, grid-row-start, and grid-row-end in a single declaration. + */ + gridArea?: any; + + /** + * Controls a grid item's placement in a grid area, particularly grid position and a grid span. Shorthand for setting grid-column-start and grid-column-end in a single declaration. + */ + gridColumn?: any; + + /** + * Controls a grid item's placement in a grid area as well as grid position and a grid span. The grid-column-end property (with grid-row-start, grid-row-end, and grid-column-start) determines a grid item's placement by specifying the grid lines of a grid item's grid area. + */ + gridColumnEnd?: any; + + /** + * Determines a grid item's placement by specifying the starting grid lines of a grid item's grid area . A grid item's placement in a grid area consists of a grid position and a grid span. See also ( grid-row-start, grid-row-end, and grid-column-end) + */ + gridColumnStart?: any; + + /** + * Gets or sets a value that indicates which row an element within a Grid should appear in. Shorthand for setting grid-row-start and grid-row-end in a single declaration. + */ + gridRow?: any; + + /** + * Determines a grid item’s placement by specifying the block-end. A grid item's placement in a grid area consists of a grid position and a grid span. The grid-row-end property (with grid-row-start, grid-column-start, and grid-column-end) determines a grid item's placement by specifying the grid lines of a grid item's grid area. + */ + gridRowEnd?: any; + + /** + * Specifies a row position based upon an integer location, string value, or desired row size. + * css/properties/grid-row is used as short-hand for grid-row-position and grid-row-position + */ + gridRowPosition?: any; + + gridRowSpan?: any; + + /** + * Specifies named grid areas which are not associated with any particular grid item, but can be referenced from the grid-placement properties. The syntax of the grid-template-areas property also provides a visualization of the structure of the grid, making the overall layout of the grid container easier to understand. + */ + gridTemplateAreas?: any; + + /** + * Specifies (with grid-template-rows) the line names and track sizing functions of the grid. Each sizing function can be specified as a length, a percentage of the grid container’s size, a measurement of the contents occupying the column or row, or a fraction of the free space in the grid. + */ + gridTemplateColumns?: any; + + /** + * Specifies (with grid-template-columns) the line names and track sizing functions of the grid. Each sizing function can be specified as a length, a percentage of the grid container’s size, a measurement of the contents occupying the column or row, or a fraction of the free space in the grid. + */ + gridTemplateRows?: any; + + /** + * Sets the height of an element. The content area of the element height does not include the padding, border, and margin of the element. + */ + height?: any; + + /** + * Specifies the minimum number of characters in a hyphenated word + */ + hyphenateLimitChars?: any; + + /** + * Indicates the maximum number of successive hyphenated lines in an element. The ‘no-limit’ value means that there is no limit. + */ + hyphenateLimitLines?: any; + + /** + * Specifies the maximum amount of trailing whitespace (before justification) that may be left in a line before hyphenation is triggered to pull part of a word from the next line back up into the current one. + */ + hyphenateLimitZone?: any; + + /** + * Specifies whether or not words in a sentence can be split by the use of a manual or automatic hyphenation mechanism. + */ + hyphens?: any; + + imeMode?: any; + + layoutGrid?: any; + + layoutGridChar?: any; + + layoutGridLine?: any; + + layoutGridMode?: any; + + layoutGridType?: any; + + /** + * Sets the left edge of an element + */ + left?: any; + + /** + * The letter-spacing CSS property specifies the spacing behavior between text characters. + */ + letterSpacing?: any; + + /** + * Deprecated. Gets or sets line-breaking rules for text in selected languages such as Japanese, Chinese, and Korean. + */ + lineBreak?: any; + + /** + * Shorthand property that sets the list-style-type, list-style-position and list-style-image properties in one declaration. + */ + listStyle?: any; + + /** + * This property sets the image that will be used as the list item marker. When the image is available, it will replace the marker set with the 'list-style-type' marker. That also means that if the image is not available, it will show the style specified by list-style-property + */ + listStyleImage?: any; + + /** + * Specifies if the list-item markers should appear inside or outside the content flow. + */ + listStylePosition?: any; + + /** + * Specifies the type of list-item marker in a list. + */ + listStyleType?: any; + + /** + * The margin property is shorthand to allow you to set all four margins of an element at once. Its equivalent longhand properties are margin-top, margin-right, margin-bottom and margin-left. Negative values are also allowed. + */ + margin?: any; + + /** + * margin-bottom sets the bottom margin of an element. + */ + marginBottom?: any; + + /** + * margin-left sets the left margin of an element. + */ + marginLeft?: any; + + /** + * margin-right sets the right margin of an element. + */ + marginRight?: any; + + /** + * margin-top sets the top margin of an element. + */ + marginTop?: any; + + /** + * The marquee-direction determines the initial direction in which the marquee content moves. + */ + marqueeDirection?: any; + + /** + * The 'marquee-style' property determines a marquee's scrolling behavior. + */ + marqueeStyle?: any; + + /** + * This property is shorthand for setting mask-image, mask-mode, mask-repeat, mask-position, mask-clip, mask-origin, mask-composite and mask-size. Omitted values are set to their original properties' initial values. + */ + mask?: any; + + /** + * This property is shorthand for setting mask-border-source, mask-border-slice, mask-border-width, mask-border-outset, and mask-border-repeat. Omitted values are set to their original properties' initial values. + */ + maskBorder?: any; + + /** + * This property specifies how the images for the sides and the middle part of the mask image are scaled and tiled. The first keyword applies to the horizontal sides, the second one applies to the vertical ones. If the second keyword is absent, it is assumed to be the same as the first, similar to the CSS border-image-repeat property. + */ + maskBorderRepeat?: any; + + /** + * This property specifies inward offsets from the top, right, bottom, and left edges of the mask image, dividing it into nine regions: four corners, four edges, and a middle. The middle image part is discarded and treated as fully transparent black unless the fill keyword is present. The four values set the top, right, bottom and left offsets in that order, similar to the CSS border-image-slice property. + */ + maskBorderSlice?: any; + + /** + * Specifies an image to be used as a mask. An image that is empty, fails to download, is non-existent, or cannot be displayed is ignored and does not mask the element. + */ + maskBorderSource?: any; + + /** + * This property sets the width of the mask box image, similar to the CSS border-image-width property. + */ + maskBorderWidth?: any; + + /** + * Determines the mask painting area, which defines the area that is affected by the mask. The painted content of an element may be restricted to this area. + */ + maskClip?: any; + + /** + * For elements rendered as a single box, specifies the mask positioning area. For elements rendered as multiple boxes (e.g., inline boxes on several lines, boxes on several pages) specifies which boxes box-decoration-break operates on to determine the mask positioning area(s). + */ + maskOrigin?: any; + + /** + * This property must not be used. It is no longer included in any standard or standard track specification, nor is it implemented in any browser. It is only used when the text-align-last property is set to size. It controls allowed adjustments of font-size to fit line content. + */ + maxFontSize?: any; + + /** + * Sets the maximum height for an element. It prevents the height of the element to exceed the specified value. If min-height is specified and is greater than max-height, max-height is overridden. + */ + maxHeight?: any; + + /** + * Sets the maximum width for an element. It limits the width property to be larger than the value specified in max-width. + */ + maxWidth?: any; + + /** + * Sets the minimum width of an element. It limits the width property to be not smaller than the value specified in min-width. + */ + minWidth?: any; + + /** + * The CSS outline property is a shorthand property for setting one or more of the individual outline properties outline-style, outline-width and outline-color in a single rule. In most cases the use of this shortcut is preferable and more convenient. + * Outlines differ from borders in the following ways: • Outlines do not take up space, they are drawn above the content. + * • Outlines may be non-rectangular. They are rectangular in Gecko/Firefox. Internet Explorer attempts to place the smallest contiguous outline around all elements or shapes that are indicated to have an outline. Opera draws a non-rectangular shape around a construct. + */ + outline?: any; + + /** + * The outline-color property sets the color of the outline of an element. An outline is a line that is drawn around elements, outside the border edge, to make the element stand out. + */ + outlineColor?: any; + + /** + * The outline-offset property offsets the outline and draw it beyond the border edge. + */ + outlineOffset?: any; + + /** + * The overflow property controls how extra content exceeding the bounding box of an element is rendered. It can be used in conjunction with an element that has a fixed width and height, to eliminate text-induced page distortion. + */ + overflow?: any; + + /** + * Specifies the preferred scrolling methods for elements that overflow. + */ + overflowStyle?: any; + + /** + * The overflow-x property is a specific case of the generic overflow property. It controls how extra content exceeding the x-axis of the bounding box of an element is rendered. + */ + overflowX?: any; + + /** + * The padding optional CSS property sets the required padding space on one to four sides of an element. The padding area is the space between an element and its border. Negative values are not allowed but decimal values are permitted. The element size is treated as fixed, and the content of the element shifts toward the center as padding is increased. + * The padding property is a shorthand to avoid setting each side separately (padding-top, padding-right, padding-bottom, padding-left). + */ + padding?: any; + + /** + * The padding-bottom CSS property of an element sets the padding space required on the bottom of an element. The padding area is the space between the content of the element and its border. Contrary to margin-bottom values, negative values of padding-bottom are invalid. + */ + paddingBottom?: any; + + /** + * The padding-left CSS property of an element sets the padding space required on the left side of an element. The padding area is the space between the content of the element and its border. Contrary to margin-left values, negative values of padding-left are invalid. + */ + paddingLeft?: any; + + /** + * The padding-right CSS property of an element sets the padding space required on the right side of an element. The padding area is the space between the content of the element and its border. Contrary to margin-right values, negative values of padding-right are invalid. + */ + paddingRight?: any; + + /** + * The padding-top CSS property of an element sets the padding space required on the top of an element. The padding area is the space between the content of the element and its border. Contrary to margin-top values, negative values of padding-top are invalid. + */ + paddingTop?: any; + + /** + * The page-break-after property is supported in all major browsers. With CSS3, page-break-* properties are only aliases of the break-* properties. The CSS3 Fragmentation spec defines breaks for all CSS box fragmentation. + */ + pageBreakAfter?: any; + + /** + * The page-break-before property sets the page-breaking behavior before an element. With CSS3, page-break-* properties are only aliases of the break-* properties. The CSS3 Fragmentation spec defines breaks for all CSS box fragmentation. + */ + pageBreakBefore?: any; + + /** + * Sets the page-breaking behavior inside an element. With CSS3, page-break-* properties are only aliases of the break-* properties. The CSS3 Fragmentation spec defines breaks for all CSS box fragmentation. + */ + pageBreakInside?: any; + + /** + * The pause property determines how long a speech media agent should pause before and after presenting an element. It is a shorthand for the pause-before and pause-after properties. + */ + pause?: any; + + /** + * The pause-after property determines how long a speech media agent should pause after presenting an element. It may be replaced by the shorthand property pause, which sets pause time before and after. + */ + pauseAfter?: any; + + /** + * The pause-before property determines how long a speech media agent should pause before presenting an element. It may be replaced by the shorthand property pause, which sets pause time before and after. + */ + pauseBefore?: any; + + /** + * The perspective property defines how far an element is placed from the view on the z-axis, from the screen to the viewer. + * Perspective defines how an object is viewed. In graphic arts, perspective is the representation on a flat surface of what the viewer's eye would see in a 3D space. (See Wikipedia for more information about graphical perspective and for related illustrations.) + * The illusion of perspective on a flat surface, such as a computer screen, is created by projecting points on the flat surface as they would appear if the flat surface were a window through which the viewer was looking at the object. In discussion of virtual environments, this flat surface is called a projection plane. + */ + perspective?: any; + + /** + * The perspective-origin property establishes the origin for the perspective property. It effectively sets the X and Y position at which the viewer appears to be looking at the children of the element. + * When used with perspective, perspective-origin changes the appearance of an object, as if a viewer were looking at it from a different origin. An object appears differently if a viewer is looking directly at it versus looking at it from below, above, or from the side. Thus, the perspective-origin is like a vanishing point. + * The default value of perspective-origin is 50% 50%. This displays an object as if the viewer's eye were positioned directly at the center of the screen, both top-to-bottom and left-to-right. A value of 0% 0% changes the object as if the viewer was looking toward the top left angle. A value of 100% 100% changes the appearance as if viewed toward the bottom right angle. + */ + perspectiveOrigin?: any; + + /** + * The pointer-events property allows you to control whether an element can be the target for the pointing device (e.g, mouse, pen) events. + */ + pointerEvents?: any; + + /** + * The position property controls the type of positioning used by an element within its parent elements. The effect of the position property depends on a lot of factors, for example the position property of parent elements. + */ + position?: any; + + /** + * Obsolete: unsupported. + * This property determines whether or not a full-width punctuation mark character should be trimmed if it appears at the beginning of a line, so that its "ink" lines up with the first glyph in the line above and below. + */ + punctuationTrim?: any; + + /** + * Sets the type of quotation marks for embedded quotations. + */ + quotes?: any; + + /** + * Controls whether the last region in a chain displays additional 'overset' content according its default overflow property, or if it displays a fragment of content as if it were flowing into a subsequent region. + */ + regionFragment?: any; + + /** + * The rest-after property determines how long a speech media agent should pause after presenting an element's main content, before presenting that element's exit cue sound. It may be replaced by the shorthand property rest, which sets rest time before and after. + */ + restAfter?: any; + + /** + * The rest-before property determines how long a speech media agent should pause after presenting an intro cue sound for an element, before presenting that element's main content. It may be replaced by the shorthand property rest, which sets rest time before and after. + */ + restBefore?: any; + + /** + * Specifies the position an element in relation to the right side of the containing element. + */ + right?: any; + + rubyAlign?: any; + + rubyPosition?: any; + + /** + * Defines the alpha channel threshold used to extract a shape from an image. Can be thought of as a "minimum opacity" threshold; that is, a value of 0.5 means that the shape will enclose all the pixels that are more than 50% opaque. + */ + shapeImageThreshold?: any; + + /** + * A future level of CSS Shapes will define a shape-inside property, which will define a shape to wrap content within the element. See Editor's Draft and CSSWG wiki page on next-level plans + */ + shapeInside?: any; + + /** + * Adds a margin to a shape-outside. In effect, defines a new shape that is the smallest contour around all the points that are the shape-margin distance outward perpendicular to each point on the underlying shape. For points where a perpendicular direction is not defined (e.g., a triangle corner), takes all points on a circle centered at the point and with a radius of the shape-margin distance. This property accepts only non-negative values. + */ + shapeMargin?: any; + + /** + * Declares a shape around which text should be wrapped, with possible modifications from the shape-margin property. The shape defined by shape-outside and shape-margin changes the geometry of a float element's float area. + */ + shapeOutside?: any; + + /** + * The speak property determines whether or not a speech synthesizer will read aloud the contents of an element. + */ + speak?: any; + + /** + * The speak-as property determines how the speech synthesizer interprets the content: words as whole words or as a sequence of letters, numbers as a numerical value or a sequence of digits, punctuation as pauses in speech or named punctuation characters. + */ + speakAs?: any; + + /** + * The tab-size CSS property is used to customise the width of a tab (U+0009) character. + */ + tabSize?: any; + + /** + * The 'table-layout' property controls the algorithm used to lay out the table cells, rows, and columns. + */ + tableLayout?: any; + + /** + * The text-align CSS property describes how inline content like text is aligned in its parent block element. text-align does not control the alignment of block elements itself, only their inline content. + */ + textAlign?: any; + + /** + * The text-align-last CSS property describes how the last line of a block element or a line before line break is aligned in its parent block element. + */ + textAlignLast?: any; + + /** + * The text-decoration CSS property is used to set the text formatting to underline, overline, line-through or blink. + * underline and overline decorations are positioned under the text, line-through over it. + */ + textDecoration?: any; + + /** + * Sets the color of any text decoration, such as underlines, overlines, and strike throughs. + */ + textDecorationColor?: any; + + /** + * Sets what kind of line decorations are added to an element, such as underlines, overlines, etc. + */ + textDecorationLine?: any; + + textDecorationLineThrough?: any; + + textDecorationNone?: any; + + textDecorationOverline?: any; + + /** + * Specifies what parts of an element’s content are skipped over when applying any text decoration. + */ + textDecorationSkip?: any; + + /** + * This property specifies the style of the text decoration line drawn on the specified element. The intended meaning for the values are the same as those of the border-style-properties. + */ + textDecorationStyle?: any; + + textDecorationUnderline?: any; + + /** + * The text-emphasis property will apply special emphasis marks to the elements text. Slightly similar to the text-decoration property only that this property can have affect on the line-height. It also is noted that this is shorthand for text-emphasis-style and for text-emphasis-color. + */ + textEmphasis?: any; + + /** + * The text-emphasis-color property specifies the foreground color of the emphasis marks. + */ + textEmphasisColor?: any; + + /** + * The text-emphasis-style property applies special emphasis marks to an element's text. + */ + textEmphasisStyle?: any; + + /** + * This property helps determine an inline box's block-progression dimension, derived from the text-height and font-size properties for non-replaced elements, the height or the width for replaced elements, and the stacked block-progression dimension for inline-block elements. The block-progression dimension determines the position of the padding, border and margin for the element. + */ + textHeight?: any; + + /** + * Specifies the amount of space horizontally that should be left on the first line of the text of an element. This horizontal spacing is at the beginning of the first line and is in respect to the left edge of the containing block box. + */ + textIndent?: any; + + textJustifyTrim?: any; + + textKashidaSpace?: any; + + /** + * The text-line-through property is a shorthand property for text-line-through-style, text-line-through-color and text-line-through-mode. (Considered obsolete; use text-decoration instead.) + */ + textLineThrough?: any; + + /** + * Specifies the line colors for the line-through text decoration. + * (Considered obsolete; use text-decoration-color instead.) + */ + textLineThroughColor?: any; + + /** + * Sets the mode for the line-through text decoration, determining whether the text decoration affects the space characters or not. + * (Considered obsolete; use text-decoration-skip instead.) + */ + textLineThroughMode?: any; + + /** + * Specifies the line style for line-through text decoration. + * (Considered obsolete; use text-decoration-style instead.) + */ + textLineThroughStyle?: any; + + /** + * Specifies the line width for the line-through text decoration. + */ + textLineThroughWidth?: any; + + /** + * The text-overflow shorthand CSS property determines how overflowed content that is not displayed is signaled to the users. It can be clipped, display an ellipsis ('…', U+2026 HORIZONTAL ELLIPSIS) or a Web author-defined string. It covers the two long-hand properties text-overflow-mode and text-overflow-ellipsis + */ + textOverflow?: any; + + /** + * The text-overline property is the shorthand for the text-overline-style, text-overline-width, text-overline-color, and text-overline-mode properties. + */ + textOverline?: any; + + /** + * Specifies the line color for the overline text decoration. + */ + textOverlineColor?: any; + + /** + * Sets the mode for the overline text decoration, determining whether the text decoration affects the space characters or not. + */ + textOverlineMode?: any; + + /** + * Specifies the line style for overline text decoration. + */ + textOverlineStyle?: any; + + /** + * Specifies the line width for the overline text decoration. + */ + textOverlineWidth?: any; + + /** + * The text-rendering CSS property provides information to the browser about how to optimize when rendering text. Options are: legibility, speed or geometric precision. + */ + textRendering?: any; + + /** + * Obsolete: unsupported. + */ + textScript?: any; + + /** + * The CSS text-shadow property applies one or more drop shadows to the text and of an element. Each shadow is specified as an offset from the text, along with optional color and blur radius values. + */ + textShadow?: any; + + /** + * This property transforms text for styling purposes. (It has no effect on the underlying content.) + */ + textTransform?: any; + + /** + * Unsupported. + * This property will add a underline position value to the element that has an underline defined. + */ + textUnderlinePosition?: any; + + /** + * After review this should be replaced by text-decoration should it not? + * This property will set the underline style for text with a line value for underline, overline, and line-through. + */ + textUnderlineStyle?: any; + + /** + * This property specifies how far an absolutely positioned box's top margin edge is offset below the top edge of the box's containing block. For relatively positioned boxes, the offset is with respect to the top edges of the box itself (i.e., the box is given a position in the normal flow, then offset from that position according to these properties). + */ + top?: any; + + /** + * Determines whether touch input may trigger default behavior supplied by the user agent, such as panning or zooming. + */ + touchAction?: any; + + /** + * CSS transforms allow elements styled with CSS to be transformed in two-dimensional or three-dimensional space. Using this property, elements can be translated, rotated, scaled, and skewed. The value list may consist of 2D and/or 3D transform values. + */ + transform?: any; + + /** + * This property defines the origin of the transformation axes relative to the element to which the transformation is applied. + */ + transformOrigin?: any; + + /** + * This property allows you to define the relative position of the origin of the transformation grid along the z-axis. + */ + transformOriginZ?: any; + + /** + * This property specifies how nested elements are rendered in 3D space relative to their parent. + */ + transformStyle?: any; + + /** + * The transition CSS property is a shorthand property for transition-property, transition-duration, transition-timing-function, and transition-delay. It allows to define the transition between two states of an element. + */ + transition?: any; + + /** + * Defines when the transition will start. A value of ‘0s’ means the transition will execute as soon as the property is changed. Otherwise, the value specifies an offset from the moment the property is changed, and the transition will delay execution by that offset. + */ + transitionDelay?: any; + + /** + * The 'transition-duration' property specifies the length of time a transition animation takes to complete. + */ + transitionDuration?: any; + + /** + * The 'transition-property' property specifies the name of the CSS property to which the transition is applied. + */ + transitionProperty?: any; + + /** + * Sets the pace of action within a transition + */ + transitionTimingFunction?: any; + + /** + * The unicode-bidi CSS property specifies the level of embedding with respect to the bidirectional algorithm. + */ + unicodeBidi?: any; + + /** + * unicode-range allows you to set a specific range of characters to be downloaded from a font (embedded using @font-face) and made available for use on the current page. + */ + unicodeRange?: any; + + /** + * This is for all the high level UX stuff. + */ + userFocus?: any; + + /** + * For inputing user content + */ + userInput?: any; + + /** + * The vertical-align property controls how inline elements or text are vertically aligned compared to the baseline. If this property is used on table-cells it controls the vertical alignment of content of the table cell. + */ + verticalAlign?: any; + + /** + * The visibility property specifies whether the boxes generated by an element are rendered. + */ + visibility?: any; + + /** + * The voice-balance property sets the apparent position (in stereo sound) of the synthesized voice for spoken media. + */ + voiceBalance?: any; + + /** + * The voice-duration property allows the author to explicitly set the amount of time it should take a speech synthesizer to read an element's content, for example to allow the speech to be synchronized with other media. With a value of auto (the default) the length of time it takes to read the content is determined by the content itself and the voice-rate property. + */ + voiceDuration?: any; + + /** + * The voice-family property sets the speaker's voice used by a speech media agent to read an element. The speaker may be specified as a named character (to match a voice option in the speech reading software) or as a generic description of the age and gender of the voice. Similar to the font-family property for visual media, a comma-separated list of fallback options may be given in case the speech reader does not recognize the character name or cannot synthesize the requested combination of generic properties. + */ + voiceFamily?: any; + + /** + * The voice-pitch property sets pitch or tone (high or low) for the synthesized speech when reading an element; the pitch may be specified absolutely or relative to the normal pitch for the voice-family used to read the text. + */ + voicePitch?: any; + + /** + * The voice-range property determines how much variation in pitch or tone will be created by the speech synthesize when reading an element. Emphasized text, grammatical structures and punctuation may all be rendered as changes in pitch, this property determines how strong or obvious those changes are; large ranges are associated with enthusiastic or emotional speech, while small ranges are associated with flat or mechanical speech. + */ + voiceRange?: any; + + /** + * The voice-rate property sets the speed at which the voice synthesized by a speech media agent will read content. + */ + voiceRate?: any; + + /** + * The voice-stress property sets the level of vocal emphasis to be used for synthesized speech reading the element. + */ + voiceStress?: any; + + /** + * The voice-volume property sets the volume for spoken content in speech media. It replaces the deprecated volume property. + */ + voiceVolume?: any; + + /** + * The white-space property controls whether and how white space inside the element is collapsed, and whether lines may wrap at unforced "soft wrap" opportunities. + */ + whiteSpace?: any; + + /** + * Obsolete: unsupported. + */ + whiteSpaceTreatment?: any; + + /** + * Specifies the width of the content area of an element. The content area of the element width does not include the padding, border, and margin of the element. + */ + width?: any; + + /** + * The word-break property is often used when there is long generated content that is strung together without and spaces or hyphens to beak apart. A common case of this is when there is a long URL that does not have any hyphens. This case could potentially cause the breaking of the layout as it could extend past the parent element. + */ + wordBreak?: any; + + /** + * The word-spacing CSS property specifies the spacing behavior between "words". + */ + wordSpacing?: any; + + /** + * An alias of css/properties/overflow-wrap, word-wrap defines whether to break words when the content exceeds the boundaries of its container. + */ + wordWrap?: any; + + /** + * Specifies how exclusions affect inline content within block-level elements. Elements lay out their inline content in their content area but wrap around exclusion areas. + */ + wrapFlow?: any; + + /** + * Set the value that is used to offset the inner wrap shape from other shapes. Inline content that intersects a shape with this property will be pushed by this shape's margin. + */ + wrapMargin?: any; + + /** + * Obsolete and unsupported. Do not use. + * This CSS property controls the text when it reaches the end of the block in which it is enclosed. + */ + wrapOption?: any; + + /** + * writing-mode specifies if lines of text are laid out horizontally or vertically, and the direction which lines of text and blocks progress. + */ + writingMode?: any; + + [propertyName: string]: any; } - interface HTMLAttributesBase extends DOMAttributesBase { + interface HTMLAttributes extends DOMAttributes { + // React-specific Attributes + defaultChecked?: boolean; + defaultValue?: string | string[]; + + // Standard HTML Attributes accept?: string; acceptCharset?: string; accessKey?: string; @@ -434,23 +1697,25 @@ declare namespace __React { 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?: any; + controls?: boolean; coords?: string; crossOrigin?: string; data?: string; dateTime?: string; - defaultChecked?: boolean; - defaultValue?: string; + default?: boolean; defer?: boolean; dir?: string; disabled?: boolean; @@ -473,6 +1738,13 @@ declare namespace __React { htmlFor?: string; httpEquiv?: string; icon?: string; + id?: string; + inputMode?: string; + integrity?: string; + is?: string; + keyParams?: string; + keyType?: string; + kind?: string; label?: string; lang?: string; list?: string; @@ -487,6 +1759,7 @@ declare namespace __React { mediaGroup?: string; method?: string; min?: number | string; + minLength?: number; multiple?: boolean; muted?: boolean; name?: string; @@ -517,40 +1790,49 @@ declare namespace __React { spellCheck?: boolean; src?: string; srcDoc?: string; + srcLang?: string; srcSet?: string; start?: number; step?: number | string; style?: CSSProperties; + summary?: string; tabIndex?: number; target?: string; title?: string; type?: string; useMap?: string; - value?: string; + value?: string | 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?: boolean; - autoCorrect?: boolean; - property?: string; + autoCorrect?: string; + autoSave?: string; + color?: string; itemProp?: string; itemScope?: boolean; itemType?: string; + itemID?: string; + itemRef?: string; + results?: number; + security?: string; unselectable?: boolean; } - interface HTMLAttributes extends HTMLAttributesBase { - } - - interface SVGElementAttributes extends HTMLAttributes { - viewBox?: string; - preserveAspectRatio?: string; - } - - interface SVGAttributes extends DOMAttributes { - ref?: string | ((component: SVGComponent) => void); - + interface SVGAttributes extends HTMLAttributes { + clipPath?: string; cx?: number | string; cy?: number | string; d?: string; @@ -564,7 +1846,6 @@ declare namespace __React { fy?: number | string; gradientTransform?: string; gradientUnits?: string; - height?: number | string; markerEnd?: string; markerMid?: string; markerStart?: string; @@ -583,19 +1864,27 @@ declare namespace __React { stroke?: string; strokeDasharray?: string; strokeLinecap?: string; - strokeMiterlimit?: string; strokeOpacity?: number | string; strokeWidth?: number | string; textAnchor?: string; transform?: string; version?: string; viewBox?: string; - width?: number | string; x1?: number | string; x2?: number | string; x?: number | string; + xlinkActuate?: string; + xlinkArcrole?: string; + xlinkHref?: string; + xlinkRole?: string; + xlinkShow?: string; + xlinkTitle?: string; + xlinkType?: string; + xmlBase?: string; + xmlLang?: string; + xmlSpace?: string; y1?: number | string; - y2?: number | string + y2?: number | string; y?: number | string; } @@ -719,11 +2008,12 @@ declare namespace __React { wbr: HTMLFactory; // SVG - svg: SVGElementFactory; + svg: SVGFactory; circle: SVGFactory; defs: SVGFactory; ellipse: SVGFactory; g: SVGFactory; + image: SVGFactory; line: SVGFactory; linearGradient: SVGFactory; mask: SVGFactory; @@ -777,10 +2067,11 @@ declare namespace __React { // ---------------------------------------------------------------------- interface ReactChildren { - map(children: ReactNode, fn: (child: ReactChild, index: number) => T): { [key:string]: T }; + map(children: ReactNode, fn: (child: ReactChild, index: number) => T): T[]; forEach(children: ReactNode, fn: (child: ReactChild, index: number) => any): void; count(children: ReactNode): number; only(children: ReactNode): ReactChild; + toArray(children: ReactNode): ReactChild[]; } // @@ -816,1085 +2107,6 @@ declare module "react" { export = __React; } -declare module "react/addons" { - // - // React Elements - // ---------------------------------------------------------------------- - - type ReactType = ComponentClass | string; - - interface ReactElement

    { - type: string | ComponentClass

    ; - props: P; - key: string | number; - ref: string | ((component: Component) => any); - } - - interface ClassicElement

    extends ReactElement

    { - type: string | ClassicComponentClass

    ; - ref: string | ((component: ClassicComponent) => any); - } - - interface DOMElement

    extends ClassicElement

    { - type: string; - ref: string | ((component: DOMComponent

    ) => any); - } - - type HTMLElement = DOMElement; - type SVGElement = DOMElement; - - // - // Factories - // ---------------------------------------------------------------------- - - interface Factory

    { - (props?: P, ...children: ReactNode[]): ReactElement

    ; - } - - interface ClassicFactory

    extends Factory

    { - (props?: P, ...children: ReactNode[]): ClassicElement

    ; - } - - interface DOMFactory

    extends ClassicFactory

    { - (props?: P, ...children: ReactNode[]): DOMElement

    ; - } - - type HTMLFactory = DOMFactory; - type SVGFactory = DOMFactory; - type SVGElementFactory = DOMFactory; - - // - // React Nodes - // http://facebook.github.io/react/docs/glossary.html - // ---------------------------------------------------------------------- - - type ReactText = string | number; - type ReactChild = ReactElement | ReactText; - - // Should be Array but type aliases cannot be recursive - type ReactFragment = {} | Array; - type ReactNode = ReactChild | ReactFragment | boolean; - - // - // Top Level API - // ---------------------------------------------------------------------- - - function createClass(spec: ComponentSpec): ClassicComponentClass

    ; - - function createFactory

    (type: string): DOMFactory

    ; - function createFactory

    (type: ClassicComponentClass

    | string): ClassicFactory

    ; - function createFactory

    (type: ComponentClass

    ): Factory

    ; - - function createElement

    ( - type: string, - props?: P, - ...children: ReactNode[]): DOMElement

    ; - function createElement

    ( - type: ClassicComponentClass

    | string, - props?: P, - ...children: ReactNode[]): ClassicElement

    ; - function createElement

    ( - type: ComponentClass

    , - props?: P, - ...children: ReactNode[]): ReactElement

    ; - - function cloneElement

    ( - element: DOMElement

    , - props?: P, - ...children: ReactNode[]): DOMElement

    ; - function cloneElement

    ( - element: ClassicElement

    , - props?: P, - ...children: ReactNode[]): ClassicElement

    ; - function cloneElement

    ( - element: ReactElement

    , - props?: P, - ...children: ReactNode[]): ReactElement

    ; - - function render

    ( - element: DOMElement

    , - container: Element, - callback?: () => any): DOMComponent

    ; - function render( - element: ClassicElement

    , - container: Element, - callback?: () => any): ClassicComponent; - function render( - element: ReactElement

    , - container: Element, - callback?: () => any): Component; - - function unmountComponentAtNode(container: Element): boolean; - function renderToString(element: ReactElement): string; - function renderToStaticMarkup(element: ReactElement): string; - function isValidElement(object: {}): boolean; - function initializeTouchEvents(shouldUseTouch: boolean): void; - - function findDOMNode( - componentOrElement: Component | Element): TElement; - function findDOMNode( - componentOrElement: Component | Element): Element; - - var DOM: ReactDOM; - var PropTypes: ReactPropTypes; - var Children: ReactChildren; - - // - // Component API - // ---------------------------------------------------------------------- - - // Base component for plain JS classes - class Component implements ComponentLifecycle { - static propTypes: ValidationMap; - static contextTypes: ValidationMap; - static childContextTypes: ValidationMap; - static defaultProps: Props; - - constructor(props?: P, context?: any); - setState(f: (prevState: S, props: P) => S, callback?: () => any): void; - setState(state: S, callback?: () => any): void; - forceUpdate(callBack?: () => any): void; - render(): JSX.Element; - props: P; - state: S; - context: {}; - refs: { - [key: string]: Component - }; - } - - interface ClassicComponent extends Component { - replaceState(nextState: S, callback?: () => any): void; - getDOMNode(): TElement; - getDOMNode(): Element; - isMounted(): boolean; - getInitialState?(): S; - setProps(nextProps: P, callback?: () => any): void; - replaceProps(nextProps: P, callback?: () => any): void; - } - - interface DOMComponent

    extends ClassicComponent { - tagName: string; - } - - type HTMLComponent = DOMComponent; - type SVGComponent = DOMComponent; - - interface ChildContextProvider { - getChildContext(): CC; - } - - // - // Class Interfaces - // ---------------------------------------------------------------------- - - interface ComponentClass

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

    ; - contextTypes?: ValidationMap; - childContextTypes?: ValidationMap; - defaultProps?: P; - } - - interface ClassicComponentClass

    extends ComponentClass

    { - new(props?: P, context?: any): ClassicComponent; - getDefaultProps?(): P; - displayName?: string; - } - - // - // Component Specs and Lifecycle - // ---------------------------------------------------------------------- - - interface ComponentLifecycle { - componentWillMount?(): void; - componentDidMount?(): void; - componentWillReceiveProps?(nextProps: P, nextContext: any): void; - shouldComponentUpdate?(nextProps: P, nextState: S, nextContext: any): boolean; - componentWillUpdate?(nextProps: P, nextState: S, nextContext: any): void; - componentDidUpdate?(prevProps: P, prevState: S, prevContext: any): void; - componentWillUnmount?(): void; - } - - interface Mixin extends ComponentLifecycle { - mixins?: Mixin; - statics?: { - [key: string]: any; - }; - - displayName?: string; - propTypes?: ValidationMap; - contextTypes?: ValidationMap; - childContextTypes?: ValidationMap - - getDefaultProps?(): P; - getInitialState?(): S; - } - - interface ComponentSpec extends Mixin { - render(): ReactElement; - - [propertyName: string]: any; - } - - // - // Event System - // ---------------------------------------------------------------------- - - interface SyntheticEvent { - bubbles: boolean; - cancelable: boolean; - currentTarget: EventTarget; - defaultPrevented: boolean; - eventPhase: number; - isTrusted: boolean; - nativeEvent: Event; - preventDefault(): void; - stopPropagation(): void; - target: EventTarget; - timeStamp: Date; - type: string; - } - - interface DragEvent extends SyntheticEvent { - dataTransfer: DataTransfer; - } - - interface ClipboardEvent extends SyntheticEvent { - clipboardData: DataTransfer; - } - - interface KeyboardEvent extends SyntheticEvent { - altKey: boolean; - charCode: number; - ctrlKey: boolean; - getModifierState(key: string): boolean; - key: string; - keyCode: number; - locale: string; - location: number; - metaKey: boolean; - repeat: boolean; - shiftKey: boolean; - which: number; - } - - interface FocusEvent extends SyntheticEvent { - relatedTarget: EventTarget; - } - - interface FormEvent extends SyntheticEvent { - } - - interface MouseEvent extends SyntheticEvent { - altKey: boolean; - button: number; - buttons: number; - clientX: number; - clientY: number; - ctrlKey: boolean; - getModifierState(key: string): boolean; - metaKey: boolean; - pageX: number; - pageY: number; - relatedTarget: EventTarget; - screenX: number; - screenY: number; - shiftKey: boolean; - } - - interface TouchEvent extends SyntheticEvent { - altKey: boolean; - changedTouches: TouchList; - ctrlKey: boolean; - getModifierState(key: string): boolean; - metaKey: boolean; - shiftKey: boolean; - targetTouches: TouchList; - touches: TouchList; - } - - interface UIEvent extends SyntheticEvent { - detail: number; - view: AbstractView; - } - - interface WheelEvent extends SyntheticEvent { - deltaMode: number; - deltaX: number; - deltaY: number; - deltaZ: number; - } - - // - // Event Handler Types - // ---------------------------------------------------------------------- - - interface EventHandler { - (event: E): void; - } - - interface DragEventHandler extends EventHandler {} - interface ClipboardEventHandler extends EventHandler {} - interface KeyboardEventHandler extends EventHandler {} - interface FocusEventHandler extends EventHandler {} - interface FormEventHandler extends EventHandler {} - interface MouseEventHandler extends EventHandler {} - interface TouchEventHandler extends EventHandler {} - interface UIEventHandler extends EventHandler {} - interface WheelEventHandler extends EventHandler {} - - // - // Props / DOM Attributes - // ---------------------------------------------------------------------- - - interface Props { - children?: ReactNode; - key?: string | number; - ref?: string | ((component: T) => any); - } - - interface DOMAttributesBase extends Props { - onCopy?: ClipboardEventHandler; - onCut?: ClipboardEventHandler; - onPaste?: ClipboardEventHandler; - onKeyDown?: KeyboardEventHandler; - onKeyPress?: KeyboardEventHandler; - onKeyUp?: KeyboardEventHandler; - onFocus?: FocusEventHandler; - onBlur?: FocusEventHandler; - onChange?: FormEventHandler; - onInput?: FormEventHandler; - onSubmit?: FormEventHandler; - onClick?: MouseEventHandler; - onDoubleClick?: MouseEventHandler; - onDrag?: DragEventHandler; - onDragEnd?: DragEventHandler; - onDragEnter?: DragEventHandler; - onDragExit?: DragEventHandler; - onDragLeave?: DragEventHandler; - onDragOver?: DragEventHandler; - onDragStart?: DragEventHandler; - onDrop?: DragEventHandler; - onMouseDown?: MouseEventHandler; - onMouseEnter?: MouseEventHandler; - onMouseLeave?: MouseEventHandler; - onMouseMove?: MouseEventHandler; - onMouseOut?: MouseEventHandler; - onMouseOver?: MouseEventHandler; - onMouseUp?: MouseEventHandler; - onTouchCancel?: TouchEventHandler; - onTouchEnd?: TouchEventHandler; - onTouchMove?: TouchEventHandler; - onTouchStart?: TouchEventHandler; - onScroll?: UIEventHandler; - onWheel?: WheelEventHandler; - - className?: string; - id?: string; - - dangerouslySetInnerHTML?: { - __html: string; - }; - } - - interface DOMAttributes extends DOMAttributesBase> { - } - - // This interface is not complete. Only properties accepting - // unitless numbers are listed here (see CSSProperty.js in React) - interface CSSProperties { - boxFlex?: number; - boxFlexGroup?: number; - columnCount?: number; - flex?: number | string; - flexGrow?: number; - flexShrink?: number; - fontWeight?: number | string; - lineClamp?: number; - lineHeight?: number | string; - opacity?: number; - order?: number; - orphans?: number; - widows?: number; - zIndex?: number; - zoom?: number; - - fontSize?: number | string; - - // SVG-related properties - fillOpacity?: number; - strokeOpacity?: number; - strokeWidth?: number; - - [propertyName: string]: any; - } - - interface HTMLAttributesBase extends DOMAttributesBase { - accept?: string; - acceptCharset?: string; - accessKey?: string; - action?: string; - allowFullScreen?: boolean; - allowTransparency?: boolean; - alt?: string; - async?: boolean; - autoComplete?: boolean; - autoFocus?: boolean; - autoPlay?: boolean; - cellPadding?: number | string; - cellSpacing?: number | string; - charSet?: string; - checked?: boolean; - classID?: string; - cols?: number; - colSpan?: number; - content?: string; - contentEditable?: boolean; - contextMenu?: string; - controls?: any; - coords?: string; - crossOrigin?: string; - data?: string; - dateTime?: string; - defaultChecked?: boolean; - defaultValue?: string; - 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; - icon?: string; - label?: 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; - multiple?: boolean; - muted?: boolean; - name?: string; - noValidate?: boolean; - open?: boolean; - optimum?: number; - pattern?: string; - placeholder?: string; - poster?: string; - preload?: string; - radioGroup?: string; - readOnly?: boolean; - rel?: string; - required?: boolean; - role?: string; - rows?: number; - rowSpan?: number; - sandbox?: string; - scope?: string; - scoped?: boolean; - scrolling?: string; - seamless?: boolean; - selected?: boolean; - shape?: string; - size?: number; - sizes?: string; - span?: number; - spellCheck?: boolean; - src?: string; - srcDoc?: string; - srcSet?: string; - start?: number; - step?: number | string; - style?: CSSProperties; - tabIndex?: number; - target?: string; - title?: string; - type?: string; - useMap?: string; - value?: string; - width?: number | string; - wmode?: string; - - // Non-standard Attributes - autoCapitalize?: boolean; - autoCorrect?: boolean; - property?: string; - itemProp?: string; - itemScope?: boolean; - itemType?: string; - unselectable?: boolean; - } - - interface HTMLAttributes extends HTMLAttributesBase { - } - - interface SVGElementAttributes extends HTMLAttributes { - viewBox?: string; - preserveAspectRatio?: string; - } - - interface SVGAttributes extends DOMAttributes { - ref?: string | ((component: SVGComponent) => void); - - cx?: number | string; - cy?: number | string; - d?: string; - dx?: number | string; - dy?: number | string; - fill?: string; - fillOpacity?: number | string; - fontFamily?: string; - fontSize?: number | string; - fx?: number | string; - fy?: number | string; - gradientTransform?: string; - gradientUnits?: string; - height?: number | string; - markerEnd?: string; - markerMid?: string; - markerStart?: string; - offset?: number | string; - opacity?: number | string; - patternContentUnits?: string; - patternUnits?: string; - points?: string; - preserveAspectRatio?: string; - r?: number | string; - rx?: number | string; - ry?: number | string; - spreadMethod?: string; - stopColor?: string; - stopOpacity?: number | string; - stroke?: string; - strokeDasharray?: string; - strokeLinecap?: string; - strokeMiterlimit?: string; - strokeOpacity?: number | string; - strokeWidth?: number | string; - textAnchor?: string; - transform?: string; - version?: string; - viewBox?: string; - width?: number | string; - x1?: number | string; - x2?: number | string; - x?: number | string; - y1?: number | string; - y2?: number | string - y?: number | string; - } - - // - // React.DOM - // ---------------------------------------------------------------------- - - interface ReactDOM { - // HTML - a: HTMLFactory; - abbr: HTMLFactory; - address: HTMLFactory; - area: HTMLFactory; - article: HTMLFactory; - aside: HTMLFactory; - audio: HTMLFactory; - b: HTMLFactory; - base: HTMLFactory; - bdi: HTMLFactory; - bdo: HTMLFactory; - big: HTMLFactory; - blockquote: HTMLFactory; - body: HTMLFactory; - br: HTMLFactory; - button: HTMLFactory; - canvas: HTMLFactory; - caption: HTMLFactory; - cite: HTMLFactory; - code: HTMLFactory; - col: HTMLFactory; - colgroup: HTMLFactory; - data: HTMLFactory; - datalist: HTMLFactory; - dd: HTMLFactory; - del: HTMLFactory; - details: HTMLFactory; - dfn: HTMLFactory; - dialog: HTMLFactory; - div: HTMLFactory; - dl: HTMLFactory; - dt: HTMLFactory; - em: HTMLFactory; - embed: HTMLFactory; - fieldset: HTMLFactory; - figcaption: HTMLFactory; - figure: HTMLFactory; - footer: HTMLFactory; - form: HTMLFactory; - h1: HTMLFactory; - h2: HTMLFactory; - h3: HTMLFactory; - h4: HTMLFactory; - h5: HTMLFactory; - h6: HTMLFactory; - head: HTMLFactory; - header: HTMLFactory; - hr: HTMLFactory; - html: HTMLFactory; - i: HTMLFactory; - iframe: HTMLFactory; - img: HTMLFactory; - input: HTMLFactory; - ins: HTMLFactory; - kbd: HTMLFactory; - keygen: HTMLFactory; - label: HTMLFactory; - legend: HTMLFactory; - li: HTMLFactory; - link: HTMLFactory; - main: HTMLFactory; - map: HTMLFactory; - mark: HTMLFactory; - menu: HTMLFactory; - menuitem: HTMLFactory; - meta: HTMLFactory; - meter: HTMLFactory; - nav: HTMLFactory; - noscript: HTMLFactory; - object: HTMLFactory; - ol: HTMLFactory; - optgroup: HTMLFactory; - option: HTMLFactory; - output: HTMLFactory; - p: HTMLFactory; - param: HTMLFactory; - picture: HTMLFactory; - pre: HTMLFactory; - progress: HTMLFactory; - q: HTMLFactory; - rp: HTMLFactory; - rt: HTMLFactory; - ruby: HTMLFactory; - s: HTMLFactory; - samp: HTMLFactory; - script: HTMLFactory; - section: HTMLFactory; - select: HTMLFactory; - small: HTMLFactory; - source: HTMLFactory; - span: HTMLFactory; - strong: HTMLFactory; - style: HTMLFactory; - sub: HTMLFactory; - summary: HTMLFactory; - sup: HTMLFactory; - table: HTMLFactory; - tbody: HTMLFactory; - td: HTMLFactory; - textarea: HTMLFactory; - tfoot: HTMLFactory; - th: HTMLFactory; - thead: HTMLFactory; - time: HTMLFactory; - title: HTMLFactory; - tr: HTMLFactory; - track: HTMLFactory; - u: HTMLFactory; - ul: HTMLFactory; - "var": HTMLFactory; - video: HTMLFactory; - wbr: HTMLFactory; - - // SVG - svg: SVGElementFactory; - circle: SVGFactory; - defs: SVGFactory; - ellipse: SVGFactory; - g: SVGFactory; - line: SVGFactory; - linearGradient: SVGFactory; - mask: SVGFactory; - path: SVGFactory; - pattern: SVGFactory; - polygon: SVGFactory; - polyline: SVGFactory; - radialGradient: SVGFactory; - rect: SVGFactory; - stop: SVGFactory; - text: SVGFactory; - tspan: SVGFactory; - } - - // - // React.PropTypes - // ---------------------------------------------------------------------- - - interface Validator { - (object: T, key: string, componentName: string): Error; - } - - interface Requireable extends Validator { - isRequired: Validator; - } - - interface ValidationMap { - [key: string]: Validator; - } - - interface ReactPropTypes { - any: Requireable; - array: Requireable; - bool: Requireable; - func: Requireable; - number: Requireable; - object: Requireable; - string: Requireable; - node: Requireable; - element: Requireable; - instanceOf(expectedClass: {}): Requireable; - oneOf(types: any[]): Requireable; - oneOfType(types: Validator[]): Requireable; - arrayOf(type: Validator): Requireable; - objectOf(type: Validator): Requireable; - shape(type: ValidationMap): Requireable; - } - - // - // React.Children - // ---------------------------------------------------------------------- - - interface ReactChildren { - map(children: ReactNode, fn: (child: ReactChild, index: number) => T): { [key:string]: T }; - forEach(children: ReactNode, fn: (child: ReactChild, index: number) => any): void; - count(children: ReactNode): number; - only(children: ReactNode): ReactChild; - } - - // - // Browser Interfaces - // https://github.com/nikeee/2048-typescript/blob/master/2048/js/touch.d.ts - // ---------------------------------------------------------------------- - - interface AbstractView { - styleMedia: StyleMedia; - document: Document; - } - - interface Touch { - identifier: number; - target: EventTarget; - screenX: number; - screenY: number; - clientX: number; - clientY: number; - pageX: number; - pageY: number; - } - - interface TouchList { - [index: number]: Touch; - length: number; - item(index: number): Touch; - identifiedTouch(identifier: number): Touch; - } - - // - // React.addons - // ---------------------------------------------------------------------- - - export module addons { - export var CSSTransitionGroup: CSSTransitionGroup; - export var TransitionGroup: TransitionGroup; - - export var LinkedStateMixin: LinkedStateMixin; - export var PureRenderMixin: PureRenderMixin; - - export function batchedUpdates( - callback: (a: A, b: B) => any, a: A, b: B): void; - export function batchedUpdates(callback: (a: A) => any, a: A): void; - export function batchedUpdates(callback: () => any): void; - - // deprecated: use petehunt/react-classset or JedWatson/classnames - export function classSet(cx: { [key: string]: boolean }): string; - export function classSet(...classList: string[]): string; - - export function cloneWithProps

    ( - element: DOMElement

    , props: P): DOMElement

    ; - export function cloneWithProps

    ( - element: ClassicElement

    , props: P): ClassicElement

    ; - export function cloneWithProps

    ( - element: ReactElement

    , props: P): ReactElement

    ; - - export function createFragment( - object: { [key: string]: ReactNode }): ReactFragment; - - export function update(value: any[], spec: UpdateArraySpec): any[]; - export function update(value: {}, spec: UpdateSpec): any; - - // Development tools - export import Perf = ReactPerf; - export import TestUtils = ReactTestUtils; - } - - // - // React.addons (Transitions) - // ---------------------------------------------------------------------- - - interface TransitionGroupProps { - component?: ReactType; - childFactory?: (child: ReactElement) => ReactElement; - } - - interface CSSTransitionGroupProps extends TransitionGroupProps { - transitionName: string; - transitionAppear?: boolean; - transitionEnter?: boolean; - transitionLeave?: boolean; - } - - type CSSTransitionGroup = ComponentClass; - type TransitionGroup = ComponentClass; - - // - // React.addons (Mixins) - // ---------------------------------------------------------------------- - - interface ReactLink { - value: T; - requestChange(newValue: T): void; - } - - interface LinkedStateMixin extends Mixin { - linkState(key: string): ReactLink; - } - - interface PureRenderMixin extends Mixin { - } - - // - // Reat.addons.update - // ---------------------------------------------------------------------- - - interface UpdateSpecCommand { - $set?: any; - $merge?: {}; - $apply?(value: any): any; - } - - interface UpdateSpecPath { - [key: string]: UpdateSpec; - } - - type UpdateSpec = UpdateSpecCommand | UpdateSpecPath; - - interface UpdateArraySpec extends UpdateSpecCommand { - $push?: any[]; - $unshift?: any[]; - $splice?: any[][]; - } - - // - // React.addons.Perf - // ---------------------------------------------------------------------- - - interface ComponentPerfContext { - current: string; - owner: string; - } - - interface NumericPerfContext { - [key: string]: number; - } - - interface Measurements { - exclusive: NumericPerfContext; - inclusive: NumericPerfContext; - render: NumericPerfContext; - counts: NumericPerfContext; - writes: NumericPerfContext; - displayNames: { - [key: string]: ComponentPerfContext; - }; - totalTime: number; - } - - module ReactPerf { - export function start(): void; - export function stop(): void; - export function printInclusive(measurements: Measurements[]): void; - export function printExclusive(measurements: Measurements[]): void; - export function printWasted(measurements: Measurements[]): void; - export function printDOM(measurements: Measurements[]): void; - export function getLastMeasurements(): Measurements[]; - } - - // - // React.addons.TestUtils - // ---------------------------------------------------------------------- - - interface MockedComponentClass { - new(): any; - } - - module ReactTestUtils { - export import Simulate = ReactSimulate; - - export function renderIntoDocument

    ( - element: ReactElement

    ): Component; - export function renderIntoDocument>( - element: ReactElement): C; - - export function mockComponent( - mocked: MockedComponentClass, mockTagName?: string): typeof ReactTestUtils; - - export function isElementOfType( - element: ReactElement, type: ReactType): boolean; - export function isTextComponent(instance: Component): boolean; - export function isDOMComponent(instance: Component): boolean; - export function isCompositeComponent(instance: Component): boolean; - export function isCompositeComponentWithType( - instance: Component, - type: ComponentClass): boolean; - - export function findAllInRenderedTree( - tree: Component, - fn: (i: Component) => boolean): Component; - - export function scryRenderedDOMComponentsWithClass( - tree: Component, - className: string): DOMComponent[]; - export function findRenderedDOMComponentWithClass( - tree: Component, - className: string): DOMComponent; - - export function scryRenderedDOMComponentsWithTag( - tree: Component, - tagName: string): DOMComponent[]; - export function findRenderedDOMComponentWithTag( - tree: Component, - tagName: string): DOMComponent; - - export function scryRenderedComponentsWithType

    ( - tree: Component, - type: ComponentClass

    ): Component[]; - export function scryRenderedComponentsWithType>( - tree: Component, - type: ComponentClass): C[]; - - export function findRenderedComponentWithType

    ( - tree: Component, - type: ComponentClass

    ): Component; - export function findRenderedComponentWithType>( - tree: Component, - type: ComponentClass): C; - - export function createRenderer(): ShallowRenderer; - } - - interface SyntheticEventData { - altKey?: boolean; - button?: number; - buttons?: number; - clientX?: number; - clientY?: number; - changedTouches?: TouchList; - charCode?: boolean; - clipboardData?: DataTransfer; - ctrlKey?: boolean; - deltaMode?: number; - deltaX?: number; - deltaY?: number; - deltaZ?: number; - detail?: number; - getModifierState?(key: string): boolean; - key?: string; - keyCode?: number; - locale?: string; - location?: number; - metaKey?: boolean; - pageX?: number; - pageY?: number; - relatedTarget?: EventTarget; - repeat?: boolean; - screenX?: number; - screenY?: number; - shiftKey?: boolean; - targetTouches?: TouchList; - touches?: TouchList; - view?: AbstractView; - which?: number; - } - - interface EventSimulator { - (element: Element, eventData?: SyntheticEventData): void; - (component: Component, eventData?: SyntheticEventData): void; - } - - module ReactSimulate { - export var blur: EventSimulator; - export var change: EventSimulator; - export var click: EventSimulator; - export var cut: EventSimulator; - export var doubleClick: EventSimulator; - export var drag: EventSimulator; - export var dragEnd: EventSimulator; - export var dragEnter: EventSimulator; - export var dragExit: EventSimulator; - export var dragLeave: EventSimulator; - export var dragOver: EventSimulator; - export var dragStart: EventSimulator; - export var drop: EventSimulator; - export var focus: EventSimulator; - export var input: EventSimulator; - export var keyDown: EventSimulator; - export var keyPress: EventSimulator; - export var keyUp: EventSimulator; - export var mouseDown: EventSimulator; - export var mouseEnter: EventSimulator; - export var mouseLeave: EventSimulator; - export var mouseMove: EventSimulator; - export var mouseOut: EventSimulator; - export var mouseOver: EventSimulator; - export var mouseUp: EventSimulator; - export var paste: EventSimulator; - export var scroll: EventSimulator; - export var submit: EventSimulator; - export var touchCancel: EventSimulator; - export var touchEnd: EventSimulator; - export var touchMove: EventSimulator; - export var touchStart: EventSimulator; - export var wheel: EventSimulator; - } - - class ShallowRenderer { - getRenderOutput>(): E; - getRenderOutput(): ReactElement; - render(element: ReactElement, context?: any): void; - unmount(): void; - } -} - declare namespace JSX { import React = __React; @@ -1904,139 +2116,148 @@ declare namespace JSX { } interface ElementAttributesProperty { props: {}; } + interface IntrinsicAttributes { + key?: string | number; + } + + interface IntrinsicClassAttributes { + ref?: string | ((classInstance: T) => void); + } + interface IntrinsicElements { // HTML - a: React.HTMLAttributes; - abbr: React.HTMLAttributes; - address: React.HTMLAttributes; - area: React.HTMLAttributes; - article: React.HTMLAttributes; - aside: React.HTMLAttributes; - audio: React.HTMLAttributes; - b: React.HTMLAttributes; - base: React.HTMLAttributes; - bdi: React.HTMLAttributes; - bdo: React.HTMLAttributes; - big: React.HTMLAttributes; - blockquote: React.HTMLAttributes; - body: React.HTMLAttributes; - br: React.HTMLAttributes; - button: React.HTMLAttributes; - canvas: React.HTMLAttributes; - caption: React.HTMLAttributes; - cite: React.HTMLAttributes; - code: React.HTMLAttributes; - col: React.HTMLAttributes; - colgroup: React.HTMLAttributes; - data: React.HTMLAttributes; - datalist: React.HTMLAttributes; - dd: React.HTMLAttributes; - del: React.HTMLAttributes; - details: React.HTMLAttributes; - dfn: React.HTMLAttributes; - dialog: React.HTMLAttributes; - div: React.HTMLAttributes; - dl: React.HTMLAttributes; - dt: React.HTMLAttributes; - em: React.HTMLAttributes; - embed: React.HTMLAttributes; - fieldset: React.HTMLAttributes; - figcaption: React.HTMLAttributes; - figure: React.HTMLAttributes; - footer: React.HTMLAttributes; - form: React.HTMLAttributes; - h1: React.HTMLAttributes; - h2: React.HTMLAttributes; - h3: React.HTMLAttributes; - h4: React.HTMLAttributes; - h5: React.HTMLAttributes; - h6: React.HTMLAttributes; - head: React.HTMLAttributes; - header: React.HTMLAttributes; - hr: React.HTMLAttributes; - html: React.HTMLAttributes; - i: React.HTMLAttributes; - iframe: React.HTMLAttributes; - img: React.HTMLAttributes; - input: React.HTMLAttributes; - ins: React.HTMLAttributes; - kbd: React.HTMLAttributes; - keygen: React.HTMLAttributes; - label: React.HTMLAttributes; - legend: React.HTMLAttributes; - li: React.HTMLAttributes; - link: React.HTMLAttributes; - main: React.HTMLAttributes; - map: React.HTMLAttributes; - mark: React.HTMLAttributes; - menu: React.HTMLAttributes; - menuitem: React.HTMLAttributes; - meta: React.HTMLAttributes; - meter: React.HTMLAttributes; - nav: React.HTMLAttributes; - noscript: React.HTMLAttributes; - object: React.HTMLAttributes; - ol: React.HTMLAttributes; - optgroup: React.HTMLAttributes; - option: React.HTMLAttributes; - output: React.HTMLAttributes; - p: React.HTMLAttributes; - param: React.HTMLAttributes; - picture: React.HTMLAttributes; - pre: React.HTMLAttributes; - progress: React.HTMLAttributes; - q: React.HTMLAttributes; - rp: React.HTMLAttributes; - rt: React.HTMLAttributes; - ruby: React.HTMLAttributes; - s: React.HTMLAttributes; - samp: React.HTMLAttributes; - script: React.HTMLAttributes; - section: React.HTMLAttributes; - select: React.HTMLAttributes; - small: React.HTMLAttributes; - source: React.HTMLAttributes; - span: React.HTMLAttributes; - strong: React.HTMLAttributes; - style: React.HTMLAttributes; - sub: React.HTMLAttributes; - summary: React.HTMLAttributes; - sup: React.HTMLAttributes; - table: React.HTMLAttributes; - tbody: React.HTMLAttributes; - td: React.HTMLAttributes; - textarea: React.HTMLAttributes; - tfoot: React.HTMLAttributes; - th: React.HTMLAttributes; - thead: React.HTMLAttributes; - time: React.HTMLAttributes; - title: React.HTMLAttributes; - tr: React.HTMLAttributes; - track: React.HTMLAttributes; - u: React.HTMLAttributes; - ul: React.HTMLAttributes; - "var": React.HTMLAttributes; - video: React.HTMLAttributes; - wbr: React.HTMLAttributes; + a: React.HTMLProps; + abbr: React.HTMLProps; + address: React.HTMLProps; + area: React.HTMLProps; + article: React.HTMLProps; + aside: React.HTMLProps; + audio: React.HTMLProps; + b: React.HTMLProps; + base: React.HTMLProps; + bdi: React.HTMLProps; + bdo: React.HTMLProps; + big: React.HTMLProps; + blockquote: React.HTMLProps; + body: React.HTMLProps; + br: React.HTMLProps; + button: React.HTMLProps; + canvas: React.HTMLProps; + caption: React.HTMLProps; + cite: React.HTMLProps; + code: React.HTMLProps; + col: React.HTMLProps; + colgroup: React.HTMLProps; + data: React.HTMLProps; + datalist: React.HTMLProps; + dd: React.HTMLProps; + del: React.HTMLProps; + details: React.HTMLProps; + dfn: React.HTMLProps; + dialog: React.HTMLProps; + div: React.HTMLProps; + dl: React.HTMLProps; + dt: React.HTMLProps; + em: React.HTMLProps; + embed: React.HTMLProps; + fieldset: React.HTMLProps; + figcaption: React.HTMLProps; + figure: React.HTMLProps; + footer: React.HTMLProps; + form: React.HTMLProps; + h1: React.HTMLProps; + h2: React.HTMLProps; + h3: React.HTMLProps; + h4: React.HTMLProps; + h5: React.HTMLProps; + h6: React.HTMLProps; + head: React.HTMLProps; + header: React.HTMLProps; + hr: React.HTMLProps; + html: React.HTMLProps; + i: React.HTMLProps; + iframe: React.HTMLProps; + img: React.HTMLProps; + input: React.HTMLProps; + ins: React.HTMLProps; + kbd: React.HTMLProps; + keygen: React.HTMLProps; + label: React.HTMLProps; + legend: React.HTMLProps; + li: React.HTMLProps; + link: React.HTMLProps; + main: React.HTMLProps; + map: React.HTMLProps; + mark: React.HTMLProps; + menu: React.HTMLProps; + menuitem: React.HTMLProps; + meta: React.HTMLProps; + meter: React.HTMLProps; + nav: React.HTMLProps; + noscript: React.HTMLProps; + object: React.HTMLProps; + ol: React.HTMLProps; + optgroup: React.HTMLProps; + option: React.HTMLProps; + output: React.HTMLProps; + p: React.HTMLProps; + param: React.HTMLProps; + picture: React.HTMLProps; + pre: React.HTMLProps; + progress: React.HTMLProps; + q: React.HTMLProps; + rp: React.HTMLProps; + rt: React.HTMLProps; + ruby: React.HTMLProps; + s: React.HTMLProps; + samp: React.HTMLProps; + script: React.HTMLProps; + section: React.HTMLProps; + select: React.HTMLProps; + small: React.HTMLProps; + source: React.HTMLProps; + span: React.HTMLProps; + strong: React.HTMLProps; + style: React.HTMLProps; + sub: React.HTMLProps; + summary: React.HTMLProps; + sup: React.HTMLProps; + table: React.HTMLProps; + tbody: React.HTMLProps; + td: React.HTMLProps; + textarea: React.HTMLProps; + tfoot: React.HTMLProps; + th: React.HTMLProps; + thead: React.HTMLProps; + time: React.HTMLProps; + title: React.HTMLProps; + tr: React.HTMLProps; + track: React.HTMLProps; + u: React.HTMLProps; + ul: React.HTMLProps; + "var": React.HTMLProps; + video: React.HTMLProps; + wbr: React.HTMLProps; // SVG - svg: React.SVGElementAttributes; + svg: React.SVGProps; - circle: React.SVGAttributes; - defs: React.SVGAttributes; - ellipse: React.SVGAttributes; - g: React.SVGAttributes; - line: React.SVGAttributes; - linearGradient: React.SVGAttributes; - mask: React.SVGAttributes; - path: React.SVGAttributes; - pattern: React.SVGAttributes; - polygon: React.SVGAttributes; - polyline: React.SVGAttributes; - radialGradient: React.SVGAttributes; - rect: React.SVGAttributes; - stop: React.SVGAttributes; - text: React.SVGAttributes; - tspan: React.SVGAttributes; + circle: React.SVGProps; + defs: React.SVGProps; + ellipse: React.SVGProps; + g: React.SVGProps; + image: React.SVGProps; + line: React.SVGProps; + linearGradient: React.SVGProps; + mask: React.SVGProps; + path: React.SVGProps; + pattern: React.SVGProps; + polygon: React.SVGProps; + polyline: React.SVGProps; + radialGradient: React.SVGProps; + rect: React.SVGProps; + stop: React.SVGProps; + text: React.SVGProps; + tspan: React.SVGProps; } } diff --git a/reflux/reflux.d.ts b/reflux/reflux.d.ts index 035bca7f3..d0d79a67c 100644 --- a/reflux/reflux.d.ts +++ b/reflux/reflux.d.ts @@ -52,6 +52,7 @@ declare module RefluxCore { function createActions(definition: ActionsDefinition): any; function createActions(definitions: string[]): any; + function connect(store: Store, key?: string):void; function listenTo(store: Store, handler: string):void; function setState(state: any):void; } diff --git a/request-promise/request-promise-tests.ts b/request-promise/request-promise-tests.ts index 347cca818..8c7840ad4 100644 --- a/request-promise/request-promise-tests.ts +++ b/request-promise/request-promise-tests.ts @@ -20,6 +20,21 @@ rp(options) // --> Displays length of response from server after post +//Defaults tests +(() => { + const githubUrl = 'https://github.com'; + const defaultJarRequest = rp.defaults({ jar: true }); + defaultJarRequest.get(githubUrl).then(() => {}); + //defaultJarRequest(); //this line doesn't compile (and shouldn't) + const defaultUrlRequest = rp.defaults({ url: githubUrl }); + defaultUrlRequest().then(() => {}); + defaultUrlRequest.get().then(() => {}); + const defaultBodyRequest = defaultUrlRequest.defaults({body: '{}', json: true}); + defaultBodyRequest.get().then(() => {}); + defaultBodyRequest.post().then(() => {}); + defaultBodyRequest.put().then(() => {}); +})(); + // Get full response after DELETE options = { method: 'DELETE', diff --git a/request-promise/request-promise.d.ts b/request-promise/request-promise.d.ts index 94e3d3152..d442e527f 100644 --- a/request-promise/request-promise.d.ts +++ b/request-promise/request-promise.d.ts @@ -19,12 +19,12 @@ declare module 'request-promise' { promise(): Promise; } - interface RequestPromiseOptions extends request.OptionalOptions { + interface RequestPromiseOptions extends request.CoreOptions { simple?: boolean; transform?: (body: any, response: http.IncomingMessage) => any; resolveWithFullResponse?: boolean; } - var requestPromise: request.RequestAPI; + var requestPromise: request.RequestAPI; export = requestPromise; } diff --git a/request/request-tests.ts b/request/request-tests.ts index 2e878893b..1f638d864 100644 --- a/request/request-tests.ts +++ b/request/request-tests.ts @@ -31,6 +31,22 @@ var bodyArr: request.RequestPart[] = [{ body: value }]; +//Defaults tests +(() => { + const githubUrl = 'https://github.com'; + const defaultJarRequest = request.defaults({ jar: true }); + defaultJarRequest.get(githubUrl); + //defaultJarRequest(); //this line doesn't compile (and shouldn't) + const defaultUrlRequest = request.defaults({ url: githubUrl }); + defaultUrlRequest(); + defaultUrlRequest.get(); + const defaultBodyRequest = defaultUrlRequest.defaults({body: '{}', json: true}); + defaultBodyRequest.get(); + defaultBodyRequest.post(); + defaultBodyRequest.put(); +})(); + + // --- --- --- --- --- --- --- --- --- --- --- --- obj = req.toJSON(); @@ -526,6 +542,9 @@ var specialRequest = baseRequest.defaults({ headers: {special: 'special value'} }); +const urlRequest = specialRequest.defaults({url: 'https://github.com'}); +urlRequest({}, function(error, response, body) {console.log(body);}); + request.put(url); request.patch(url); request.post(url); diff --git a/request/request.d.ts b/request/request.d.ts index bba684856..d47ed5f9a 100644 --- a/request/request.d.ts +++ b/request/request.d.ts @@ -16,35 +16,40 @@ declare module 'request' { import fs = require('fs'); namespace request { - export interface RequestAPI { - defaults(options: TOptions): RequestAPI; + export interface RequestAPI { + + defaults(options: TOptions): RequestAPI; + defaults(options: RequiredUriUrl & TOptions): DefaultUriUrlRequestApi; + (uri: string, options?: TOptions, callback?: RequestCallback): TRequest; (uri: string, callback?: RequestCallback): TRequest; - (options?: RequiredOptions & TOptions, callback?: RequestCallback): TRequest; + (options: TUriUrlOptions & TOptions, callback?: RequestCallback): TRequest; get(uri: string, options?: TOptions, callback?: RequestCallback): TRequest; get(uri: string, callback?: RequestCallback): TRequest; - get(options: RequiredOptions & TOptions, callback?: RequestCallback): TRequest; + get(options: TUriUrlOptions & TOptions, callback?: RequestCallback): TRequest; post(uri: string, options?: TOptions, callback?: RequestCallback): TRequest; post(uri: string, callback?: RequestCallback): TRequest; - post(options: RequiredOptions & TOptions, callback?: RequestCallback): TRequest; + post(options: TUriUrlOptions & TOptions, callback?: RequestCallback): TRequest; put(uri: string, options?: TOptions, callback?: RequestCallback): TRequest; put(uri: string, callback?: RequestCallback): TRequest; - put(options: RequiredOptions & TOptions, callback?: RequestCallback): TRequest; + put(options: TUriUrlOptions & TOptions, callback?: RequestCallback): TRequest; head(uri: string, options?: TOptions, callback?: RequestCallback): TRequest; head(uri: string, callback?: RequestCallback): TRequest; - head(options: RequiredOptions & TOptions, callback?: RequestCallback): TRequest; + head(options: TUriUrlOptions & TOptions, callback?: RequestCallback): TRequest; patch(uri: string, options?: TOptions, callback?: RequestCallback): TRequest; patch(uri: string, callback?: RequestCallback): TRequest; - patch(options: RequiredOptions & TOptions, callback?: RequestCallback): TRequest; + patch(options: TUriUrlOptions & TOptions, callback?: RequestCallback): TRequest; del(uri: string, options?: TOptions, callback?: RequestCallback): TRequest; del(uri: string, callback?: RequestCallback): TRequest; - del(options: RequiredOptions & TOptions, callback?: RequestCallback): TRequest; + del(options: TUriUrlOptions & TOptions, callback?: RequestCallback): TRequest; forever(agentOptions: any, optionsArg: any): TRequest; jar(): CookieJar; @@ -54,15 +59,22 @@ declare module 'request' { debug: boolean; } - interface UriOptions { - uri: string; + interface DefaultUriUrlRequestApi extends RequestAPI { + + defaults(options: TOptions): DefaultUriUrlRequestApi; + (): TRequest; + get(): TRequest; + post(): TRequest; + put(): TRequest; + head(): TRequest; + patch(): TRequest; + del(): TRequest; } - interface UrlOptions { - url: string; - } - - interface OptionalOptions { + interface CoreOptions { + baseUrl?: string; callback?: (error: any, response: http.IncomingMessage, body: any) => void; jar?: any; // CookieJar formData?: any; // Object @@ -100,8 +112,19 @@ declare module 'request' { har?: HttpArchiveRequest; } - export type RequiredOptions = UriOptions | UrlOptions; - export type Options = RequiredOptions & OptionalOptions; + interface UriOptions { + uri: string; + } + interface UrlOptions { + url: string; + } + export type RequiredUriUrl = UriOptions | UrlOptions; + + interface OptionalUriUrl { + uri?: string; + url?: string; + } + export type Options = RequiredUriUrl & CoreOptions; export interface RequestCallback { (error: any, response: http.IncomingMessage, body: any): void; @@ -223,6 +246,6 @@ declare module 'request' { toString(): string; } } - var request: request.RequestAPI; + var request: request.RequestAPI; export = request; } diff --git a/restangular/restangular-tests.ts b/restangular/restangular-tests.ts index 9b5a9c30b..dba7099da 100644 --- a/restangular/restangular-tests.ts +++ b/restangular/restangular-tests.ts @@ -50,7 +50,7 @@ myApp.config((RestangularProvider: restangular.IProvider) => { }); -interface MyAppScope extends ng.IScope { +interface MyAppScope extends angular.IScope { accounts: string[]; allAccounts: any[]; account: any; diff --git a/restangular/restangular.d.ts b/restangular/restangular.d.ts index b09e4affd..db17e51cf 100644 --- a/restangular/restangular.d.ts +++ b/restangular/restangular.d.ts @@ -16,30 +16,19 @@ declare module 'restangular' { declare module restangular { - interface IPromise extends ng.IPromise { + interface IPromise extends angular.IPromise { call(methodName: string, params?: any): IPromise; get(fieldName: string): IPromise; $object: T; } - interface ICollectionPromise extends ng.IPromise { + interface ICollectionPromise extends angular.IPromise { push(object: any): ICollectionPromise; call(methodName: string, params?: any): ICollectionPromise; get(fieldName: string): ICollectionPromise; $object: T[]; } - interface IRequestConfig { - params?: any; - headers?: any; - cache?: any; - withCredentials?: boolean; - data?: any; - transformRequest?: any; - transformResponse?: any; - timeout?: any; // number | promise - } - interface IResponse { status: number; data: any; @@ -60,14 +49,14 @@ declare module restangular { addElementTransformer(route: string, isCollection: boolean, transformer: Function): void; setTransformOnlyServerElements(active: boolean): void; setOnElemRestangularized(callback: (elem: any, isCollection: boolean, what: string, restangular: IService) => any): void; - setResponseInterceptor(responseInterceptor: (data: any, operation: string, what: string, url: string, response: IResponse, deferred: ng.IDeferred) => any): void; - setResponseExtractor(responseInterceptor: (data: any, operation: string, what: string, url: string, response: IResponse, deferred: ng.IDeferred) => any): void; - addResponseInterceptor(responseInterceptor: (data: any, operation: string, what: string, url: string, response: IResponse, deferred: ng.IDeferred) => any): void; + setResponseInterceptor(responseInterceptor: (data: any, operation: string, what: string, url: string, response: IResponse, deferred: angular.IDeferred) => any): void; + setResponseExtractor(responseInterceptor: (data: any, operation: string, what: string, url: string, response: IResponse, deferred: angular.IDeferred) => any): void; + addResponseInterceptor(responseInterceptor: (data: any, operation: string, what: string, url: string, response: IResponse, deferred: angular.IDeferred) => any): void; setRequestInterceptor(requestInterceptor: (element: any, operation: string, what: string, url: string) => any): void; addRequestInterceptor(requestInterceptor: (element: any, operation: string, what: string, url: string) => any): void; - setFullRequestInterceptor(fullRequestInterceptor: (element: any, operation: string, what: string, url: string, headers: any, params: any, httpConfig: IRequestConfig) => {element: any; headers: any; params: any}): void; - addFullRequestInterceptor(requestInterceptor: (element: any, operation: string, what: string, url: string, headers: any, params: any, httpConfig: IRequestConfig) => {headers: any; params: any; element: any; httpConfig: IRequestConfig}): void; - setErrorInterceptor(errorInterceptor: (response: IResponse, deferred: ng.IDeferred) => any): void; + setFullRequestInterceptor(fullRequestInterceptor: (element: any, operation: string, what: string, url: string, headers: any, params: any, httpConfig: angular.IRequestShortcutConfig) => {element: any; headers: any; params: any}): void; + addFullRequestInterceptor(requestInterceptor: (element: any, operation: string, what: string, url: string, headers: any, params: any, httpConfig: angular.IRequestShortcutConfig) => {headers: any; params: any; element: any; httpConfig: angular.IRequestShortcutConfig}): void; + setErrorInterceptor(errorInterceptor: (response: IResponse, deferred: angular.IDeferred) => any): void; setRestangularFields(fields: {[fieldName: string]: string}): void; setMethodOverriders(overriders: string[]): void; setJsonp(jsonp: boolean): void; @@ -124,7 +113,7 @@ declare module restangular { clone(): IElement; plain(): any; plain(): T; - withHttpConfig(httpConfig: IRequestConfig): IElement; + withHttpConfig(httpConfig: angular.IRequestShortcutConfig): IElement; save(queryParams?: any, headers?: any): IPromise; getRestangularUrl(): string; } @@ -139,7 +128,7 @@ declare module restangular { options(queryParams?: any, headers?: any): IPromise; patch(queryParams?: any, headers?: any): IPromise; putElement(idx: any, params: any, headers: any): IPromise; - withHttpConfig(httpConfig: IRequestConfig): ICollection; + withHttpConfig(httpConfig: angular.IRequestShortcutConfig): ICollection; clone(): ICollection; plain(): any; plain(): T[]; diff --git a/restify/restify.d.ts b/restify/restify.d.ts index 596637f23..d3e5e35f8 100644 --- a/restify/restify.d.ts +++ b/restify/restify.d.ts @@ -110,6 +110,7 @@ declare module "restify" { version ?: string; responseTimeHeader ?: string; responseTimeFormatter ?: (durationInMilliseconds: number) => any; + handleUpgrades ?: boolean; } interface ClientOptions { diff --git a/rivets/rivets-tests.ts b/rivets/rivets-tests.ts index fec282046..f23772094 100644 --- a/rivets/rivets-tests.ts +++ b/rivets/rivets-tests.ts @@ -1,18 +1,22 @@ /// -Rivets.configure({ - // Attribute prefix in templates - prefix: 'rv', - // Preload templates with initial data on bind - preloadData: true, - // Root sightglass interface for keypaths - rootInterface: '.', - // Template delimiters for text bindings - templateDelimiters: ['[[', ']]'], - // Augment the event handler of the on-* binder - handler: function(target:any, event:any, binding:any) { - this.call(target, event, binding.view.models) - } - }) +rivets.configure({ + // Attribute prefix in templates + prefix: 'rv', + // Preload templates with initial data on bind + preloadData: true, + // Root sightglass interface for keypaths + rootInterface: '.', + // Template delimiters for text bindings + templateDelimiters: ['[[', ']]'], + // Augment the event handler of the on-* binder + handler: function(target:any, event:any, binding:any) { + this.call(target, event, binding.view.models) + } +}); + var t = {test: ["hello", "one", "two"]} -Rivets.bind(document.getElementById("para1"), t) \ No newline at end of file +var opts = {bar: "foo"}; +rivets.bind(document.getElementById("para1"), t); +rivets.bind(document.getElementById("para1"), t, opts); +rivets.bind([document.getElementById("para1"), document.getElementById("para2")], t); diff --git a/rivets/rivets.d.ts b/rivets/rivets.d.ts index 2b04653ec..de3ebf47b 100644 --- a/rivets/rivets.d.ts +++ b/rivets/rivets.d.ts @@ -3,33 +3,65 @@ // Definitions by: Trevor Baron // Definitions: https://github.com/borisyankov/DefinitelyTyped -interface FinchStatic { - configure(options?: { - /** - * Attribute prefix in templates - */ - prefix?: string; - /** - * Preload templates with initial data on bind - */ - preloadData?: boolean; - /** - * Root sightglass interface for keypaths - */ - rootInterface?: string; - /** - * Template delimiters for text bindings - */ - templateDelimiters?: Array - /** - * Augment the event handler of the on-* binder - */ - handler?: Function; - }):void; - bind(element:any, template:any):void; +/// + +declare module Rivets { + + interface View { + build(): void; + bind(): void; + unbind(): void; + } + + interface Rivets { + // Global binders. + binders: Object; + + // Global components. + components: Object; + + // Global formatters. + formatters: Object; + + // Global sightglass adapters. + adapters: Object; + + // Default attribute prefix. + prefix: string; + + // Default template delimiters. + templateDelimiters: Array; + + // Default sightglass root interface. + rootInterface: string; + + // Preload data by default. + preloadData: boolean; + + handler(context: any, ev: Event, biding: any): void; + + configure(options?: { + + // Attribute prefix in templates + prefix?: string; + + //Preload templates with initial data on bind + preloadData?: boolean; + + //Root sightglass interface for keypaths + rootInterface?: string; + + // Template delimiters for text bindings + templateDelimiters?: Array + + // Augment the event handler of the on-* binder + handler?: Function; + }): void; + + bind(element: HTMLElement, models: Object, options?: Object): View; + bind(element: JQuery, models: Object, options?: Object): View; + bind(element: Array, models: Object, options?: Object): View; + } } -declare var Rivets: FinchStatic; -declare module "rivets" { - export = Rivets; -} +declare var rivets: Rivets.Rivets; diff --git a/scalike/scalike-tests.ts b/scalike/scalike-tests.ts new file mode 100644 index 000000000..6f2057468 --- /dev/null +++ b/scalike/scalike-tests.ts @@ -0,0 +1,29 @@ +/// + +import {Optional, Some, None, Try, Right, Left, Either, Future} from "scalike"; + +// Optional +Optional(1).map(x => x + 1); // Some(2) +Optional(null).map(x => x + 1); // None +Optional(undefined).map(x => x + 1); // None +Optional(1).flatMap(x => Some(x + 1)).fold(0, x => x + 1); // 3 + +// Try +function something() { return 1; } +Try(something); // Success(1) +function throwError() { throw new Error; } +Try(throwError); // Failure(Error) +Try(() => 1).map(x => x + 1); // Success(2) + +// Either +function validate(x: number): Either { + return x !== 1 ? Left('this is not 1') : Right(x); +} +validate(1).right().getOrElse(0); // 1 +validate(2).left().getOrElse("err"); // "this is not 1" + +// Future +Future(something).map(x => x + 1); // Future(2) +Future.successful(1).value; // Optional(Success(1) +const fu = Future(something); +Future.sequence([fu, fu, fu]); // Future([1, 1, 1]) diff --git a/scalike/scalike.d.ts b/scalike/scalike.d.ts new file mode 100644 index 000000000..1c14a1dc3 --- /dev/null +++ b/scalike/scalike.d.ts @@ -0,0 +1,271 @@ +// Type definitions for scalike API +// Project: https://github.com/ryoppy/scalike-typescript +// Definitions by: ryoppy +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare module scalike { + + export interface Either { + value: A | B; + isLeft: boolean; + isRight: boolean; + left(): LeftProjection; + right(): RightProjection; + fold(fa: (a: A) => X, fb: (b: B) => X): X; + swap(): Either; + } + export function Right(b: B): Either; + export function Left(a: A): Either; + export class LeftProjection { + private self; + constructor(self: Either); + toString(): string; + get(): A; + foreach(f: (a: A) => void): void; + getOrElse(x: X): A; + forall(f: (a: A) => boolean): boolean; + exists(f: (a: A) => boolean): boolean; + filter(f: (a: A) => boolean): Optional>; + map(f: (a: A) => X): Either; + flatMap(f: (a: A) => Either): Either; + toOptional(): Optional; + } + export class RightProjection { + private self; + constructor(self: Either); + toString(): string; + get(): B; + foreach(f: (b: B) => void): void; + getOrElse(x: X): B; + forall(f: (b: B) => boolean): boolean; + exists(f: (b: B) => boolean): boolean; + filter(f: (b: B) => boolean): Optional>; + map(f: (b: B) => X): Either; + flatMap(f: (a: B) => Either): Either; + toOptional(): Optional; + } + + export interface Optional { + isEmpty: boolean; + nonEmpty: boolean; + get(): A; + getOrElse(a: B): A; + map(f: (a: A) => B): Optional; + fold(ifEmpty: B, f: (a: A) => B): B; + flatten(): Optional; + filter(f: (a: A) => boolean): Optional; + contains(b: B): boolean; + exists(f: (a: A) => boolean): boolean; + forall(f: (a: A) => boolean): boolean; + flatMap(f: (a: A) => Optional): Optional; + foreach(f: (a: A) => void): void; + orElse(ob: Optional): Optional; + apply1(ob: Optional, f: (a: A, b: B) => C): Optional; + apply2(ob: Optional, oc: Optional, f: (a: A, b: B, c: C) => D): Optional; + chain(ob: Optional): OptionalBuilder1; + } + export const None: Optional; + export function Optional(a: A): Optional; + export function Some(a: A): Optional; + export class OptionalBuilder1 { + private oa; + private ob; + constructor(oa: Optional, ob: Optional); + run(f: (a: A, b: B) => C): Optional; + chain(oc: Optional): OptionalBuilder2; + } + export class OptionalBuilder2 { + private oa; + private ob; + private oc; + constructor(oa: Optional, ob: Optional, oc: Optional); + run(f: (a: A, b: B, c: C) => D): Optional; + chain(od: Optional): OptionalBuilder3; + } + export class OptionalBuilder3 { + private oa; + private ob; + private oc; + private od; + constructor(oa: Optional, ob: Optional, oc: Optional, od: Optional); + run(f: (a: A, b: B, c: C, d: D) => E): Optional; + chain(oe: Optional): OptionalBuilder4; + } + export class OptionalBuilder4 { + private oa; + private ob; + private oc; + private od; + private oe; + constructor(oa: Optional, ob: Optional, oc: Optional, od: Optional, oe: Optional); + run(f: (a: A, b: B, c: C, d: D, e: E) => F): Optional; + chain(of: Optional): OptionalBuilder5; + } + export class OptionalBuilder5 { + private oa; + private ob; + private oc; + private od; + private oe; + private of; + constructor(oa: Optional, ob: Optional, oc: Optional, od: Optional, oe: Optional, of: Optional); + run(f: (a: A, b: B, c: C, d: D, e: E, f: F) => G): Optional; + } + + export interface Try { + isSuccess: boolean; + isFailure: boolean; + get(): A; + getError(): Error; + fold(fe: (e: Error) => B, ff: (a: A) => B): B; + getOrElse(a: B): A; + orElse(a: Try): Try; + foreach(f: (a: A) => void): void; + flatMap(f: (a: A) => Try): Try; + map(f: (a: A) => B): Try; + filter(f: (a: A) => boolean): Try; + toOptional(): Optional; + failed(): Try; + transform(fs: (a: A) => Try, ff: (e: Error) => Try): Try; + recover(f: (e: Error) => Optional>): Try; + apply1(ob: Try, f: (a: A, b: B) => C): Try; + apply2(ob: Try, oc: Try, f: (a: A, b: B, c: C) => D): Try; + chain(ob: Try): TryBuilder1; + } + export function Try(f: () => A): Try; + export function Success(a: A): Try; + export function Failure(e: Error): Try; + + export class TryBuilder1 { + private oa; + private ob; + constructor(oa: Try, ob: Try); + run(f: (a: A, b: B) => C): Try; + chain(oc: Try): TryBuilder2; + } + export class TryBuilder2 { + private oa; + private ob; + private oc; + constructor(oa: Try, ob: Try, oc: Try); + run(f: (a: A, b: B, c: C) => D): Try; + chain(od: Try): TryBuilder3; + } + export class TryBuilder3 { + private oa; + private ob; + private oc; + private od; + constructor(oa: Try, ob: Try, oc: Try, od: Try); + run(f: (a: A, b: B, c: C, d: D) => E): Try; + chain(oe: Try): TryBuilder4; + } + export class TryBuilder4 { + private oa; + private ob; + private oc; + private od; + private oe; + constructor(oa: Try, ob: Try, oc: Try, od: Try, oe: Try); + run(f: (a: A, b: B, c: C, d: D, e: E) => F): Try; + chain(of: Try): TryBuilder5; + } + export class TryBuilder5 { + private oa; + private ob; + private oc; + private od; + private oe; + private of; + constructor(oa: Try, ob: Try, oc: Try, od: Try, oe: Try, of: Try); + run(f: (a: A, b: B, c: C, d: D, e: E, f: F) => G): Try; + } + + export interface Future { + getPromise(): Promise; + onComplete(f: (t: Try) => B): void; + isCompleted(): boolean; + value(): Optional>; + failed(): Future; + foreach(f: (a: A) => B): void; + transform(f: (t: Try) => Try): Future; + transform1(fs: (a: A) => B, ff: (e: Error) => Error): Future; + transformWith(f: (t: Try) => Future): Future; + map(f: (a: A) => B): Future; + flatMap(f: (a: A) => Future): Future; + filter(f: (a: A) => boolean): Future; + recover(f: (e: Error) => Optional): Future; + recoverWith(f: (e: Error) => Optional>): Future; + zip(fu: Future): Future<[A, B]>; + zipWith(fu: Future, f: (a: A, b: B) => C): Future; + fallbackTo(fu: Future): Future; + andThen(f: (t: Try) => B): Future; + apply1(ob: Future, f: (a: A, b: B) => C): Future; + apply2(ob: Future, oc: Future, f: (a: A, b: B, c: C) => D): Future; + chain(ob: Future): FutureBuilder1; + } + export function Future(f: Promise | (() => A)): Future; + export namespace Future { + function fromPromise(p: Promise): Future; + function unit(): Future; + function failed(e: Error): Future; + function successful(a: A): Future; + function fromTry(t: Try): Future; + function sequence(fus: Array>): Future>; + function firstCompletedOf(fus: Array>): Future; + function find(fus: Array>, f: (a: A) => boolean): Future>; + function foldLeft(fu: Array>, zero: B, f: (b: B, a: A) => B): Future; + function reduceLeft(fu: Array>, f: (b: B, a: A) => B): Future; + function traverse(fu: Array, f: (a: A) => Future): Future>; + } + export class FutureBuilder1 { + private oa; + private ob; + constructor(oa: Future, ob: Future); + run(f: (a: A, b: B) => C): Future; + chain(oc: Future): FutureBuilder2; + } + export class FutureBuilder2 { + private oa; + private ob; + private oc; + constructor(oa: Future, ob: Future, oc: Future); + run(f: (a: A, b: B, c: C) => D): Future; + chain(od: Future): FutureBuilder3; + } + export class FutureBuilder3 { + private oa; + private ob; + private oc; + private od; + constructor(oa: Future, ob: Future, oc: Future, od: Future); + run(f: (a: A, b: B, c: C, d: D) => E): Future; + chain(oe: Future): FutureBuilder4; + } + export class FutureBuilder4 { + private oa; + private ob; + private oc; + private od; + private oe; + constructor(oa: Future, ob: Future, oc: Future, od: Future, oe: Future); + run(f: (a: A, b: B, c: C, d: D, e: E) => F): Future; + chain(of: Future): FutureBuilder5; + } + export class FutureBuilder5 { + private oa; + private ob; + private oc; + private od; + private oe; + private of; + constructor(oa: Future, ob: Future, oc: Future, od: Future, oe: Future, of: Future); + run(f: (a: A, b: B, c: C, d: D, e: E, f: F) => G): Future; + } +} + +declare module "scalike" { + export = scalike +} diff --git a/sequelize/sequelize.d.ts b/sequelize/sequelize.d.ts index a0a567eca..9b5e935bf 100644 --- a/sequelize/sequelize.d.ts +++ b/sequelize/sequelize.d.ts @@ -1994,7 +1994,7 @@ declare module "sequelize" { INITIALLY_IMMEDIATE: DeferrableInitiallyImmediate; NOT: DeferrableNot; SET_DEFERRED: DeferrableSetDeferred; - SET_IMMEDIATE: DeferrableSetImmediate + SET_IMMEDIATE: DeferrableSetImmediate; } // @@ -2007,7 +2007,7 @@ declare module "sequelize" { /** * The Base Error all Sequelize Errors inherit from. */ - interface BaseError extends ErrorConstructor { } + interface BaseError extends Error, ErrorConstructor { } interface ValidationError extends BaseError { @@ -2026,7 +2026,10 @@ declare module "sequelize" { * @param path The path to be checked for error items */ get( path : string ) : Array; - + + /** Array of ValidationErrorItem objects describing the validation errors */ + errors : Array; + } interface ValidationErrorItem extends BaseError { @@ -2041,7 +2044,19 @@ declare module "sequelize" { * @param value The value that generated the error */ new ( message : string, type : string, path : string, value : string ) : ValidationErrorItem; - + + /** An error message */ + message : string; + + /** The type of the validation error */ + type : string; + + /** The field that triggered the validation error */ + path : string; + + /** The value that generated the error */ + value : string; + } interface DatabaseError extends BaseError { @@ -2790,7 +2805,7 @@ declare module "sequelize" { * * @param options.skip An array of strings. All properties that are in this array will not be validated */ - validate( options? : { skip?: Array } ) : Promise; + validate( options? : { skip?: Array } ) : Promise; /** * This is the same as calling `set` and then calling `save`. @@ -5442,8 +5457,11 @@ declare module "sequelize" { * * @param path The path to the file that holds the model you want to import. If the part is relative, it * will be resolved relatively to the calling file + * + * @param defineFunction An optional function that provides model definitions. Useful if you do not + * want to use the module root as the define function */ - import( path : string ) : Model; + import( path : string, defineFunction? : (sequelize: Sequelize, dataTypes: DataTypes) => Model ) : Model; /** * Execute a query on the DB, with the posibility to bypass all the sequelize goodness. @@ -5568,7 +5586,7 @@ declare module "sequelize" { * @param options Query Options for authentication */ authenticate( options? : QueryOptions ) : Promise; - validate( options? : QueryOptions ) : Promise; + validate( options? : QueryOptions ) : Promise; /** * Start a transaction. When using transactions, you should pass the transaction in the options argument diff --git a/signalr/signalr.d.ts b/signalr/signalr.d.ts index e890c8f42..515b1864f 100644 --- a/signalr/signalr.d.ts +++ b/signalr/signalr.d.ts @@ -60,7 +60,7 @@ interface SignalR { starting(handler: () => void ): SignalR; received(handler: (data: any) => void ): SignalR; - error(handler: (error: string) => void ): SignalR; + error(handler: (error: Error) => void ): SignalR; stateChanged(handler: (change: SignalRStateChange) => void ): SignalR; disconnected(handler: () => void ): SignalR; connectionSlow(handler: () => void ): SignalR; diff --git a/snapsvg/snapsvg.d.ts b/snapsvg/snapsvg.d.ts index aff964a6d..d4d6ba7a7 100644 --- a/snapsvg/snapsvg.d.ts +++ b/snapsvg/snapsvg.d.ts @@ -264,6 +264,7 @@ declare module Snap { undrag(onMove: (dx: number, dy: number, event: MouseEvent) => void, onStart: (x: number, y: number, event: MouseEvent) => void, onEnd: (event: MouseEvent) => void): Snap.Element; + undrag(): Snap.Element; } export interface Fragment { diff --git a/source-map/source-map.d.ts b/source-map/source-map.d.ts index 3ddd49b53..34aae2b6a 100644 --- a/source-map/source-map.d.ts +++ b/source-map/source-map.d.ts @@ -73,8 +73,8 @@ declare module SourceMap { constructor(line: number, column: number, source: string); constructor(line: number, column: number, source: string, chunk?: string, name?: string); public static fromStringWithSourceMap(code: string, sourceMapConsumer: SourceMapConsumer, relativePath?: string): SourceNode; - public add(chunk: string): void; - public prepend(chunk: string): void; + public add(chunk: any): SourceNode; + public prepend(chunk: any): SourceNode; public setSourceContent(sourceFile: string, sourceContent: string): void; public walk(fn: (chunk: string, mapping: MappedPosition) => void): void; public walkSourceContents(fn: (file: string, content: string) => void): void; diff --git a/srp/srp-tests.ts b/srp/srp-tests.ts new file mode 100644 index 000000000..002a652d3 --- /dev/null +++ b/srp/srp-tests.ts @@ -0,0 +1,45 @@ +/// + +var srp = require('srp'); + + +// Test the `params` variable. +var params = srp.params['1024']; + + +// Test the `genKey` function. +srp.genKey(function (err: Error, buf: Buffer): void {}); +srp.genKey(16, function (err: Error, buf: Buffer): void {}); + + +// Test the `computeVerifier` function. +var salt = new Buffer('deadbeef', 'hex'); +var identifier = new Buffer('AzureDiamond'); +var password = new Buffer('hunter2'); + +var verifier = srp.computeVerifier(params, salt, identifier, password); + + +// Test the `Client` class. +var secret1 = new Buffer(32); +var client = new srp.Client(params, salt, identifier, password, secret1); + + +// Test the `Server` class. +var secret2 = new Buffer(32); +var server = new srp.Server(params, verifier, secret2); + + +// Test handshake protocol. +var A = client.computeA(); +server.setA(A); + +var B = server.computeB(); +client.setB(B); + +var M1 = client.computeM1(); +var M2 = server.checkM1(M1); +client.checkM2(M2); + +client.computeK(); +server.computeK(); diff --git a/srp/srp.d.ts b/srp/srp.d.ts new file mode 100644 index 000000000..040c1ace6 --- /dev/null +++ b/srp/srp.d.ts @@ -0,0 +1,75 @@ +// Type definitions for node-srp +// Project: https://github.com/mozilla/node-srp +// Definitions by: Pat Smuk +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// +/// + +declare namespace SRP { + export interface Params { + N_length_bits: number; + N: BigNum; + g: BigNum; + hash: string; + } + + export var params: { + [bits: string]: Params; + }; + + /** + * The verifier is calculated as described in Section 3 of [SRP-RFC]. + * We give the algorithm here for convenience. + * + * The verifier (v) is computed based on the salt (s), user name (I), + * password (P), and group parameters (N, g). + * + * x = H(s | H(I | ":" | P)) + * v = g^x % N + * + * @param {Params} params group parameters, with .N, .g, .hash + * @param {Buffer} salt salt + * @param {Buffer} I user identity + * @param {Buffer} P user password + * + * @returns {Buffer} + */ + export function computeVerifier(params: Params, salt: Buffer, I: Buffer, P: Buffer): Buffer; + + /** + * Generate a random key. + * + * @param {number} bytes length of key (default=32) + * @param {function} callback function to call with err,key + */ + export function genKey(bytes: number, callback: (error: Error, key: Buffer) => void): void; + + /** + * Generate a random 32-byte key. + * + * @param {function} callback function to call with err,key + */ + export function genKey(callback: (error: Error, key: Buffer) => void): void; + + export class Client { + constructor(params: Params, salt: Buffer, identity: Buffer, password: Buffer, secret1: Buffer); + computeA(): Buffer; + setB(B: Buffer): void; + computeM1(): Buffer; + checkM2(M2: Buffer): void; + computeK(): Buffer; + } + + export class Server { + constructor(params: Params, verifier: Buffer, secret2: Buffer); + computeB(): Buffer; + setA(A: Buffer): void; + checkM1(M1: Buffer): Buffer; + computeK(): Buffer; + } +} + +declare module "srp" { + export = SRP; +} diff --git a/statuses/statuses.d.ts b/statuses/statuses.d.ts index 7aacc2f61..2347eba0e 100644 --- a/statuses/statuses.d.ts +++ b/statuses/statuses.d.ts @@ -1,4 +1,4 @@ -// Type definitions for http-errors v1.2.1 +// Type definitions for statuses v1.2.1 // Project: https://github.com/jshttp/statuses // Definitions by: Tanguy Krotoff // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/superagent/superagent-tests.ts b/superagent/superagent-tests.ts index 466fc33a1..58b684044 100644 --- a/superagent/superagent-tests.ts +++ b/superagent/superagent-tests.ts @@ -1,17 +1,20 @@ -/// +/// /// // via: http://visionmedia.github.io/superagent/ -import request = require('superagent') -import fs = require('fs'); +import * as request from 'superagent'; +import * as fs from 'fs'; + +// Examples taken from https://github.com/visionmedia/superagent/blob/gh-pages/docs/index.md +// and https://github.com/visionmedia/superagent/blob/master/Readme.md request .post('/api/pet') .send({ name: 'Manny', species: 'cat' }) .set('X-API-Key', 'foobar') .set('Accept', 'application/json') - .end((res: request.Response) => { + .end((err, res) => { if (res.ok) { console.log('yay got ' + JSON.stringify(res.body)); } else { @@ -25,7 +28,7 @@ agent .send({ name: 'Manny', species: 'cat' }) .set('X-API-Key', 'foobar') .set('Accept', 'application/json') - .end((res: request.Response) => { + .end((err, res) => { if (res.error) { console.log('oh no ' + res.error.message); } else { @@ -33,8 +36,19 @@ agent } }); +// Plugins +var nocache = require('superagent-no-cache'); +var prefix = require('superagent-prefix')('/static'); -var callback = (res: request.Response) => {}; +request + .get('/some-url') + .use(prefix) // Prefixes *only* this request + .use(nocache) // Prevents caching of *only* this request + .end(function(err, res){ + // Do something + }); + +var callback = (err: any, res: request.Response) => {}; // Request basics request @@ -44,6 +58,10 @@ request request('GET', '/search') .end(callback); +request + .get('http://example.com/search') + .end(callback); + request .head('/favicon.ico') .end(callback); @@ -100,6 +118,12 @@ request .query('range=1..5') .end(callback); +// HEAD requests +request + .head('/users') + .query({ email: 'joe@smith.com' }) + .end(callback); + // POST / PUT requests request.post('/user') .set('Content-Type', 'application/json') @@ -139,6 +163,7 @@ request.post('/user') request.post('/user') .type('png'); +// Setting Accept request.get('/user') .accept('application/json'); @@ -254,5 +279,3 @@ request .attach('image', 'path/to/tobi.png') .on('error', (err: any) => {}) .end(callback); - - diff --git a/superagent/superagent.d.ts b/superagent/superagent.d.ts index a5118a764..493d287ef 100644 --- a/superagent/superagent.d.ts +++ b/superagent/superagent.d.ts @@ -1,4 +1,4 @@ -// Type definitions for SuperAgent 0.15.4 +// Type definitions for SuperAgent v1.4.0 // Project: https://github.com/visionmedia/superagent // Definitions by: Alex Varju // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -8,7 +8,7 @@ declare module "superagent" { import stream = require('stream'); - type CallbackHandler = { (err: any, res: request.Response): void; }|{ (res: request.Response): void; }; + type CallbackHandler = (err: any, res: request.Response) => void; var request: request.SuperAgentStatic; @@ -102,6 +102,7 @@ declare module "superagent" { set(field: Object): Req; timeout(ms: number): Req; type(val: string): Req; + use(fn: Function): Req; withCredentials(): Req; write(data: string, encoding?: string): Req; write(data: Buffer, encoding?: string): Req; diff --git a/supertest-as-promised/supertest-as-promised-tests.ts b/supertest-as-promised/supertest-as-promised-tests.ts new file mode 100644 index 000000000..2b79abd07 --- /dev/null +++ b/supertest-as-promised/supertest-as-promised-tests.ts @@ -0,0 +1,64 @@ +/// +/// +/// + +import * as request from 'supertest-as-promised'; +import * as express from 'express'; + +var app = express(); + +// chain your requests like you were promised: +request(app) + .get("/user") + .expect(200) + .then(function (res) { + return request(app) + .post("/kittens") + .send({ userId: res}) + .expect(201); + }) + .then(function (res) { + // ... + }); + + +// Usage +request(app) + .get("/kittens") + .expect(200) + .then(function (res) { + // ... + }); + +describe("GET /kittens", function () { + it("should work", function () { + return request(app).get("/kittens").expect(200); + }); +}); + + +// Agents +var agent = request.agent(app); +agent + .get("/ugly-kitteh") + .expect(404) + .then(function () { + // ... + }) + + +// Promisey goodness +request(app) + .get("/kittens") + .expect(201) + .then(function (res) { /* ... */ }) + // I'm a real promise now! + .catch(function (err) { /* ... */ }) + +request(app) + .get("/kittens") + .expect(201) + .toPromise() + // I'm a real promise now! + .delay(10) + .then(function (res) { /* ... */ }) diff --git a/supertest-as-promised/supertest-as-promised.d.ts b/supertest-as-promised/supertest-as-promised.d.ts new file mode 100644 index 000000000..2c035848f --- /dev/null +++ b/supertest-as-promised/supertest-as-promised.d.ts @@ -0,0 +1,45 @@ +// Type definitions for SuperTest as Promised v2.0.2 +// Project: https://github.com/WhoopInc/supertest-as-promised +// Definitions by: Tanguy Krotoff +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// +/// + +declare module "supertest-as-promised" { + // Mostly copy-pasted from supertest.d.ts + + import * as superagent from 'superagent'; + import * as PromiseBluebird from 'bluebird'; + + function supertest(app: any): supertest.SuperTest; + + module supertest { + function agent(app?: any): supertest.SuperTest; + + interface SuperTest extends superagent.SuperAgent { + } + + interface Promise extends PromiseBluebird { + toPromise(): PromiseBluebird; + } + + interface Test extends superagent.Request { + url: string; + serverAddress(app: any, path: string): string; + expect(status: number): Promise; + expect(status: number, body: string): Promise; + expect(body: string): Promise; + expect(body: RegExp): Promise; + expect(body: Object): Promise; + expect(field: string, val: string): Promise; + expect(field: string, val: RegExp): Promise; + expect(checker: (res: Response) => any): Promise; + } + + interface Response extends superagent.Response { + } + } + + export = supertest; +} diff --git a/supertest/supertest-tests.ts b/supertest/supertest-tests.ts index d76c97ea4..5e0de8ad8 100644 --- a/supertest/supertest-tests.ts +++ b/supertest/supertest-tests.ts @@ -1,8 +1,8 @@ /// /// -import supertest = require('supertest') -import express = require('express'); +import * as supertest from 'supertest'; +import * as express from 'express'; var app = express(); @@ -11,7 +11,7 @@ supertest(app) .expect('Content-Type', /json/) .expect('Content-Length', '20') .expect(201) - .end((err: any, res: supertest.Response) => { + .end((err, res) => { if (err) throw err; }); @@ -56,4 +56,3 @@ function hasPreviousAndNextKeys(res: supertest.Response) { if (!('next' in res.body)) return "missing next key"; if (!('prev' in res.body)) throw new Error("missing prev key"); } - diff --git a/supertest/supertest.d.ts b/supertest/supertest.d.ts index dccbd47c8..9ca154e2f 100644 --- a/supertest/supertest.d.ts +++ b/supertest/supertest.d.ts @@ -1,4 +1,4 @@ -// Type definitions for SuperTest 0.14.0 +// Type definitions for SuperTest v1.1.0 // Project: https://github.com/visionmedia/supertest // Definitions by: Alex Varju // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -8,7 +8,7 @@ declare module "supertest" { import superagent = require('superagent'); - type CallbackHandler = { (err: any, res: supertest.Response): void; }|{ (res: supertest.Response): void; }; + type CallbackHandler = (err: any, res: supertest.Response) => void; function supertest(app: any): supertest.SuperTest; @@ -29,6 +29,7 @@ declare module "supertest" { expect(field: string, val: string, callback?: CallbackHandler): Test; expect(field: string, val: RegExp, callback?: CallbackHandler): Test; expect(checker: (res: Response) => any): Test; + end(callback?: CallbackHandler): Test; } interface Response extends superagent.Response { diff --git a/svg-injector/svg-injector-tests.ts b/svg-injector/svg-injector-tests.ts new file mode 100644 index 000000000..e90bf8e2a --- /dev/null +++ b/svg-injector/svg-injector-tests.ts @@ -0,0 +1,22 @@ +/// + +var SVGInjector: SVGInjector; + +// Simple example +var mySVGsToInject = document.querySelectorAll('img.inject-me'); +SVGInjector(mySVGsToInject); + +// Single DOM element +SVGInjector(document.querySelector('.inject-me')); + +// Configuration +SVGInjector(mySVGsToInject, { + evalScripts: 'always', + pngFallback: './path/to/images/', + each: eachCallback +}); +function eachCallback(element: SVGElement) { } + +// Callback +SVGInjector(mySVGsToInject, null, callback); +function callback(count: number) { } diff --git a/svg-injector/svg-injector.d.ts b/svg-injector/svg-injector.d.ts new file mode 100644 index 000000000..2fd41caa8 --- /dev/null +++ b/svg-injector/svg-injector.d.ts @@ -0,0 +1,43 @@ +// Type definitions for SVG Injector +// Project: https://github.com/iconic/SVGInjector +// Definitions by: Patrick Westerhoff +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare interface SVGInjector { + /** + * Replace the given elements with their full inline SVG DOM elements. + * + * @param elements Array of or single DOM element. + * @param options Injector options. + * @param done Callback that receives the injected element count as parameter. + */ + (elements: Node | NodeList | Array, options?: SVGInjectorOptions, done?: (elementCount: number) => void): void; +} + +declare interface SVGInjectorOptions { + /** + * Whether to run scripts blocks found in the SVG. + * + * Possible values: + * 'always' — Run scripts every time. + * 'once' — Only run scripts once for each SVG. + * 'never' — Ignore scripts (default) + */ + evalScripts?: string; + + /** + * Location of fallback pngs, if desired. + */ + pngFallback?: string; + + /** + * Callback to run during each SVG injection. The SVG element is passed if + * the injection was successful. + */ + each?: (svg: SVGElement | string) => void; +} + +declare module "svg-injector" { + var SVGInjector: SVGInjector; + export = SVGInjector; +} diff --git a/temp-fs/temp-fs-tests.ts b/temp-fs/temp-fs-tests.ts new file mode 100644 index 000000000..9d01e31f3 --- /dev/null +++ b/temp-fs/temp-fs-tests.ts @@ -0,0 +1,31 @@ +// Copied from https://github.com/jakwings/node-temp-fs/blob/60a4d2586a81a7057bd4a395ec8c00b4100f84fe/README.md +// and slightly modified. + +/// + +// Create a tempfile in the system-provided tempdir. +tempfs.open(function (err:any, file:tempfs.file) { + if (err) { throw err; } + + console.log(file.path, file.fd); + // async + file.unlink(function () { + console.log('File delected'); + }); + // sync + // No problem even if unlink() is called twice. + file.unlink(); +}); + +// Create a tempdir in current directory. +tempfs.mkdir({ + dir: '.', + recursive: true, // It and its content will be remove recursively. + track: true // Track this directory. +}, function (err:any, dir:tempfs.dir) { + if (err) { throw err; } + + console.log(dir.path, dir.recursive); + throw new Error('Since it is tracked, tempfs will remove it for you.'); + dir.unlink(); +}); diff --git a/temp-fs/temp-fs.d.ts b/temp-fs/temp-fs.d.ts new file mode 100644 index 000000000..a833c773f --- /dev/null +++ b/temp-fs/temp-fs.d.ts @@ -0,0 +1,211 @@ +// Type definitions for temp-fs v0.9.8 +// Project: https://github.com/jakwings/node-temp-fs +// Definitions by: MEDIA CHECK s.r.o. +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/** + * A temporary file and directory creator. + */ +declare module tempfs { + + /** + * A tempdir. + */ + interface dir { + /** + * The absolute path to the tempdir. + */ + path: String; + + /** + * Whether {@link dir#unlink} will remove the tempdir recursively. + */ + recursive: Boolean; + + /** + * A special function for you to remove the directory. + * + * If the directory is not tracked, it may throw when an error occurs or + * the first argument of the callback function will be an Error object. + * + * @param callback makes it asynchronous. + */ + unlink(callback?:(error:Error)=>any): any; + } + + /** + * A tempfile. + */ + interface file { + /** + * The absolute path to the tempfile. + */ + path: String; + + /** + * An integer file descriptor. + */ + fd: Number; + + /** + * A special function for you to delete the file. + * + * If the file is not tracked, it may throw when an error occurs or the + * first argument of the callback function will be an Error object. + * + * @param callback makes it asynchronous. + */ + unlink(callback?:(error:Error)=>any): any; + } + + /** + * Options. + */ + interface options { + /** + * Where to put the generated tempfile or tempdir. + * + * Also see {@link options#name}. Default: tempfs.dir() + */ + dir?: String; + + /** + * The maximum number of chance to retry before throwing an error. + * + * It should be a finite number. Default: 5 + */ + limit?: Number; + + /** + * File mode (default: 0600) or directory mode (default: 0700) to use. + */ + mode?: Number; + + /** + * If set, join the two paths {@link options#dir} || + * tempfs.dir() and {@link options#name} together and use the + * result as the customized filename/pathname. + */ + name?: String; + + /** + * The prefix for the generated random name. + * + * Default: "tmp-" + */ + prefix?: String; + + /** + * Whether {@link dir#unlink} should remove a directory recursively. + * + * Default: false + */ + recursive?: Boolean; + + /** + * The suffix for the generated random name. + * + * Default: "" + */ + suffix?: String; + + /** + * A string containing some capital letters Xs for substitution with + * random characters. + * + * Then it is used as part of the filename/dirname. Just like what you + * do with the mktemp(3) function in the C library. + */ + template?: String; + + /** + * If set to true, let temp-fs manage the the current file/directory for + * you even if the global tracking is off. If set to false, don't let + * temp-fs manage it even if the global tracking is on. Otherwise, use + * the current global setting. + */ + track?: Boolean; + } + + /** + * Remove all tracked files and directories asynchronously. + */ + function clear(callback?:()=>any):any; + + /** + * Remove all tracked files and directories synchronously. + */ + function clearSync():any; + + /** + * Return the path of a system-provided tempdir as + * require('os').tmpdir() does. + * + * You should not make any assumption about whether the path contains a + * trailing path separator, or it is a real path. On most system it is not a + * fixed path, and it can be changed by the user environment. When in doubt, + * check it first. + */ + function dir():string; + + /** + * Try to create a new tempdir asynchronously. + * + * @param callback function receives two arguments error and + * dir. If error is + * null, dir has the properties of + * {@link dir}. + */ + function mkdir(options?:options, callback?:(err:any, dir:dir)=>any):any; + + /** + * The synchronous version of {@link mkdir}. + * + * @throws when an error happens. + */ + function mkdirSync(options?:options):dir; + + /** + * Return a customized/random filename/dirname. + */ + function name(options?:options):string; + + /** + * Try to open a unique tempfile asynchronously. + * + * @param callback function receives two arguments error and + * file. If error is + * null, file has the properties + * of {@link file}. + */ + function open(options?:options, callback?:(err:any, file:file)=>any):any; + + /** + * The synchronous version of {@link open}. + * + * @throws when an error happens. + */ + function openSync(options?:options):file; + + /** + * Use it to switch global files/directories tracking on or off. + * + * Turn it on if you don't want to manually delete everything. When it is + * turned off, all recorded files and directories will not be removed but + * still kept in case it is turned on again before the program exits. + * + * This switch does not affect manually tracked files through + * {@link options#track}. They will be removed automatically on exit. + * + * Note: When an uncaught exception occurs, all tracked temporary files + * and directories will be removed no matter it is on or off. + */ + function track(on?:Boolean):void; +} + +/** + * A temporary file and directory creator. + */ +declare module "temp-fs" { + export = tempfs; +} diff --git a/threejs/tests/canvas/canvas_camera_orthographic.ts b/threejs/tests/canvas/canvas_camera_orthographic.ts index c4f932820..21cade450 100644 --- a/threejs/tests/canvas/canvas_camera_orthographic.ts +++ b/threejs/tests/canvas/canvas_camera_orthographic.ts @@ -54,7 +54,7 @@ // Cubes var geometry2 = new THREE.BoxGeometry(50, 50, 50); - var material2 = new THREE.MeshLambertMaterial({ color: 0xffffff, shading: THREE.FlatShading, overdraw: 0.5 }); + var material2 = new THREE.MeshLambertMaterial({ color: 0xffffff, overdraw: 0.5 }); for (var i = 0; i < 100; i++) { diff --git a/threejs/tests/canvas/canvas_lights_pointlights.ts b/threejs/tests/canvas/canvas_lights_pointlights.ts index 8ca0bc22b..e9cb61cf1 100644 --- a/threejs/tests/canvas/canvas_lights_pointlights.ts +++ b/threejs/tests/canvas/canvas_lights_pointlights.ts @@ -54,7 +54,7 @@ loader = new THREE.JSONLoader(); loader.load('obj/WaltHeadLo.js', function (geometry) { - mesh = new THREE.Mesh(geometry, new THREE.MeshLambertMaterial({ color: 0xffffff, shading: THREE.FlatShading, overdraw: 0.5 })); + mesh = new THREE.Mesh(geometry, new THREE.MeshLambertMaterial({ color: 0xffffff, overdraw: 0.5 })); scene.add(mesh); }); diff --git a/threejs/tests/canvas/canvas_materials.ts b/threejs/tests/canvas/canvas_materials.ts index d5aa8bc65..e14178564 100644 --- a/threejs/tests/canvas/canvas_materials.ts +++ b/threejs/tests/canvas/canvas_materials.ts @@ -52,8 +52,8 @@ new THREE.MeshBasicMaterial({ color: 0x00ffff, wireframe: true, side: THREE.DoubleSide }), new THREE.MeshBasicMaterial({ color: 0xff0000, blending: THREE.AdditiveBlending }), - new THREE.MeshLambertMaterial({ color: 0xffffff, shading: THREE.FlatShading, overdraw: 0.5 }), - new THREE.MeshLambertMaterial({ color: 0xffffff, shading: THREE.SmoothShading, overdraw: 0.5 }), + new THREE.MeshLambertMaterial({ color: 0xffffff, overdraw: 0.5 }), + new THREE.MeshLambertMaterial({ color: 0xffffff, overdraw: 0.5 }), new THREE.MeshDepthMaterial({ overdraw: 0.5 }), new THREE.MeshNormalMaterial({ overdraw: 0.5 }), new THREE.MeshBasicMaterial({ map: THREE.ImageUtils.loadTexture('textures/land_ocean_ice_cloud_2048.jpg') }), diff --git a/threejs/tests/webgl/webgl_animation_skinning_morph.ts b/threejs/tests/webgl/webgl_animation_skinning_morph.ts index f38376efb..7c65905ae 100644 --- a/threejs/tests/webgl/webgl_animation_skinning_morph.ts +++ b/threejs/tests/webgl/webgl_animation_skinning_morph.ts @@ -11,13 +11,15 @@ var SCREEN_HEIGHT = window.innerHeight; var FLOOR = -250; - var container, stats; + var container,stats; var camera, scene; var renderer; var mesh, helper; + var mixer; + var mouseX = 0, mouseY = 0; var windowHalfX = window.innerWidth / 2; @@ -25,51 +27,49 @@ var clock = new THREE.Clock(); - document.addEventListener('mousemove', onDocumentMouseMove, false); + document.addEventListener( 'mousemove', onDocumentMouseMove, false ); init(); animate(); function init() { - container = document.getElementById('container'); + container = document.getElementById( 'container' ); - camera = new THREE.PerspectiveCamera(30, SCREEN_WIDTH / SCREEN_HEIGHT, 1, 10000); + camera = new THREE.PerspectiveCamera( 30, SCREEN_WIDTH / SCREEN_HEIGHT, 1, 10000 ); camera.position.z = 2200; scene = new THREE.Scene(); - scene.fog = new THREE.Fog(0xffffff, 2000, 10000); + scene.fog = new THREE.Fog( 0xffffff, 2000, 10000 ); - scene.add(camera); + scene.add( camera ); // GROUND - var geometry = new THREE.PlaneBufferGeometry(16000, 16000); - var material = new THREE.MeshPhongMaterial({ emissive: 0xbbbbbb }); + var geometry = new THREE.PlaneBufferGeometry( 16000, 16000 ); + var material = new THREE.MeshPhongMaterial( { emissive: 0x888888 } ); - var ground = new THREE.Mesh(geometry, material); - ground.position.set(0, FLOOR, 0); - ground.rotation.x = -Math.PI / 2; - scene.add(ground); + var ground = new THREE.Mesh( geometry, material ); + ground.position.set( 0, FLOOR, 0 ); + ground.rotation.x = -Math.PI/2; + scene.add( ground ); ground.receiveShadow = true; // LIGHTS - var ambient = new THREE.AmbientLight(0x222222); - scene.add(ambient); + scene.add( new THREE.HemisphereLight( 0x111111, 0x444444 ) ); - - var light = new THREE.DirectionalLight(0xebf3ff, 1.6); - light.position.set(0, 140, 500).multiplyScalar(1.1); - scene.add(light); + var light = new THREE.DirectionalLight( 0xebf3ff, 1.5 ); + light.position.set( 0, 140, 500 ).multiplyScalar( 1.1 ); + scene.add( light ); light.castShadow = true; light.shadowMapWidth = 1024; - light.shadowMapHeight = 2048; + light.shadowMapHeight = 1024; var d = 390; @@ -81,41 +81,35 @@ light.shadowCameraFar = 3500; //light.shadowCameraVisible = true; - // - - var light = new THREE.DirectionalLight(0x497f13, 1); - light.position.set(0, -1, 0); - scene.add(light); - // RENDERER - renderer = new THREE.WebGLRenderer({ antialias: true }); - renderer.setClearColor(scene.fog.color); - renderer.setPixelRatio(window.devicePixelRatio); - renderer.setSize(SCREEN_WIDTH, SCREEN_HEIGHT); + renderer = new THREE.WebGLRenderer( { antialias: true } ); + renderer.setClearColor( scene.fog.color ); + renderer.setPixelRatio( window.devicePixelRatio ); + renderer.setSize( SCREEN_WIDTH, SCREEN_HEIGHT ); renderer.domElement.style.position = "relative"; - container.appendChild(renderer.domElement); + container.appendChild( renderer.domElement ); renderer.gammaInput = true; renderer.gammaOutput = true; - renderer.shadowMapEnabled = true; + renderer.shadowMap.enabled = true; // STATS stats = new Stats(); - container.appendChild(stats.domElement); + container.appendChild( stats.domElement ); // var loader = new THREE.JSONLoader(); - loader.load("models/skinned/knight.js", function (geometry, materials) { + loader.load( "models/skinned/knight.js", function ( geometry, materials ) { - createScene(geometry, materials, 0, FLOOR, -300, 60) + createScene( geometry, materials, 0, FLOOR, -300, 60 ) - }); + } ); // GUI @@ -123,7 +117,7 @@ // - window.addEventListener('resize', onWindowResize, false); + window.addEventListener( 'resize', onWindowResize, false ); } @@ -135,30 +129,13 @@ camera.aspect = window.innerWidth / window.innerHeight; camera.updateProjectionMatrix(); - renderer.setSize(window.innerWidth, window.innerHeight); + renderer.setSize( window.innerWidth, window.innerHeight ); } - function ensureLoop(animation) { + function createScene( geometry, materials, x, y, z, s ) { - for (var i = 0; i < animation.hierarchy.length; i++) { - - var bone = animation.hierarchy[i]; - - var first = bone.keys[0]; - var last = bone.keys[bone.keys.length - 1]; - - last.pos = first.pos; - last.rot = first.rot; - last.scl = first.scl; - - } - - } - - function createScene(geometry, materials, x, y, z, s) { - - ensureLoop(geometry.animation); + //ensureLoop( geometry.animation ); geometry.computeBoundingBox(); var bb = geometry.boundingBox; @@ -171,24 +148,15 @@ path + 'posz' + format, path + 'negz' + format ]; + for ( var i = 0; i < materials.length; i ++ ) { - //var envMap = THREE.ImageUtils.loadTextureCube( urls ); - - //var map = THREE.ImageUtils.loadTexture( "textures/UV_Grid_Sm.jpg" ); - - //var bumpMap = THREE.ImageUtils.generateDataTexture( 1, 1, new THREE.Color() ); - //var bumpMap = THREE.ImageUtils.loadTexture( "textures/water.jpg" ); - - for (var i = 0; i < materials.length; i++) { - - var m = materials[i]; + var m = materials[ i ]; m.skinning = true; m.morphTargets = true; - m.specular.setHSL(0, 0, 0.1); + m.specular.setHSL( 0, 0, 0.1 ); - m.color.setHSL(0.6, 0, 0.6); - m.ambient.copy(m.color); + m.color.setHSL( 0.6, 0, 0.6 ); //m.map = map; //m.envMap = envMap; @@ -198,47 +166,49 @@ //m.combine = THREE.MixOperation; //m.reflectivity = 0.75; - m.wrapAround = true; - } - mesh = new THREE.SkinnedMesh(geometry, new THREE.MeshFaceMaterial(materials)); - mesh.position.set(x, y - bb.min.y * s, z); - mesh.scale.set(s, s, s); - scene.add(mesh); + mesh = new THREE.SkinnedMesh( geometry, new THREE.MeshFaceMaterial( materials ) ); + mesh.position.set( x, y - bb.min.y * s, z ); + mesh.scale.set( s, s, s ); + scene.add( mesh ); mesh.castShadow = true; mesh.receiveShadow = true; - helper = new THREE.SkeletonHelper(mesh); + helper = new THREE.SkeletonHelper( mesh ); helper.material.linewidth = 3; helper.visible = false; - scene.add(helper); + scene.add( helper ); - var animation = new THREE.Animation(mesh, geometry.animation); - animation.play(); + var clipMorpher = THREE.AnimationClip.CreateFromMorphTargetSequence( 'facialExpressions', mesh.geometry.morphTargets, 3 ); + var clipBones = geometry.animations[0]; + + mixer = new THREE.AnimationMixer( mesh ); + mixer.addAction( new THREE.AnimationAction( clipMorpher ) ); + mixer.addAction( new THREE.AnimationAction( clipBones ) ); } function initGUI() { var API = { - 'show model': true, - 'show skeleton': false + 'show model' : true, + 'show skeleton' : false }; var gui = new dat.GUI(); - gui.add(API, 'show model').onChange(function () { mesh.visible = API['show model']; }); + gui.add( API, 'show model' ).onChange( function() { mesh.visible = API[ 'show model' ]; } ); - gui.add(API, 'show skeleton').onChange(function () { helper.visible = API['show skeleton']; }); + gui.add( API, 'show skeleton' ).onChange( function() { helper.visible = API[ 'show skeleton' ]; } ); } - function onDocumentMouseMove(event) { + function onDocumentMouseMove( event ) { - mouseX = (event.clientX - windowHalfX); - mouseY = (event.clientY - windowHalfY); + mouseX = ( event.clientX - windowHalfX ); + mouseY = ( event.clientY - windowHalfY ); } @@ -246,7 +216,7 @@ function animate() { - requestAnimationFrame(animate); + requestAnimationFrame( animate ); render(); stats.update(); @@ -257,38 +227,17 @@ var delta = 0.75 * clock.getDelta(); - camera.position.x += (mouseX - camera.position.x) * .05; - camera.position.y = THREE.Math.clamp(camera.position.y + (- mouseY - camera.position.y) * .05, 0, 1000); + camera.position.x += ( mouseX - camera.position.x ) * .05; + camera.position.y = THREE.Math.clamp( camera.position.y + ( - mouseY - camera.position.y ) * .05, 0, 1000 ); - camera.lookAt(scene.position); - - // update skinning - - THREE.AnimationHandler.update(delta); - - if (helper !== undefined) helper.update(); - - // update morphs - - if (mesh) { - - var time = Date.now() * 0.001; - - // mouth - - mesh.morphTargetInfluences[1] = (1 + Math.sin(4 * time)) / 2; - - // frown ? - - mesh.morphTargetInfluences[2] = (1 + Math.sin(2 * time)) / 2; - - // eyes - - mesh.morphTargetInfluences[3] = (1 + Math.cos(4 * time)) / 2; + camera.lookAt( scene.position ); + if( mixer ) { + mixer.update( delta ); + helper.update(); } - renderer.render(scene, camera); + renderer.render( scene, camera ); } } \ No newline at end of file diff --git a/threejs/tests/webgl/webgl_buffergeometry.ts b/threejs/tests/webgl/webgl_buffergeometry.ts index cedd78d9c..c01b0dfe6 100644 --- a/threejs/tests/webgl/webgl_buffergeometry.ts +++ b/threejs/tests/webgl/webgl_buffergeometry.ts @@ -8,7 +8,7 @@ // ------- - if (!Detector.webgl) Detector.addGetWebGLMessage(); + if ( ! Detector.webgl ) Detector.addGetWebGLMessage(); var container, stats; @@ -21,27 +21,27 @@ function init() { - container = document.getElementById('container'); + container = document.getElementById( 'container' ); // - camera = new THREE.PerspectiveCamera(27, window.innerWidth / window.innerHeight, 1, 3500); + camera = new THREE.PerspectiveCamera( 27, window.innerWidth / window.innerHeight, 1, 3500 ); camera.position.z = 2750; scene = new THREE.Scene(); - scene.fog = new THREE.Fog(0x050505, 2000, 3500); + scene.fog = new THREE.Fog( 0x050505, 2000, 3500 ); // - scene.add(new THREE.AmbientLight(0x444444)); + scene.add( new THREE.AmbientLight( 0x444444 ) ); - var light1 = new THREE.DirectionalLight(0xffffff, 0.5); - light1.position.set(1, 1, 1); - scene.add(light1); + var light1 = new THREE.DirectionalLight( 0xffffff, 0.5 ); + light1.position.set( 1, 1, 1 ); + scene.add( light1 ); - var light2 = new THREE.DirectionalLight(0xffffff, 1.5); - light2.position.set(0, -1, 0); - scene.add(light2); + var light2 = new THREE.DirectionalLight( 0xffffff, 1.5 ); + light2.position.set( 0, -1, 0 ); + scene.add( light2 ); // @@ -49,29 +49,14 @@ var geometry = new THREE.BufferGeometry(); - // break geometry into - // chunks of 21,845 triangles (3 unique vertices per triangle) - // for indices to fit into 16 bit integer number - // floor(2^16 / 3) = 21845 - - var chunkSize = 21845; - - var indices = new Uint16Array(triangles * 3); - - for (var i = 0; i < indices.length; i++) { - - indices[i] = i % (3 * chunkSize); - - } - - var positions = new Float32Array(triangles * 3 * 3); - var normals = new Float32Array(triangles * 3 * 3); - var colors = new Float32Array(triangles * 3 * 3); + var positions = new Float32Array( triangles * 3 * 3 ); + var normals = new Float32Array( triangles * 3 * 3 ); + var colors = new Float32Array( triangles * 3 * 3 ); var color = new THREE.Color(); - var n = 800, n2 = n / 2; // triangles spread in the cube - var d = 12, d2 = d / 2; // individual triangle size + var n = 800, n2 = n/2; // triangles spread in the cube + var d = 12, d2 = d/2; // individual triangle size var pA = new THREE.Vector3(); var pB = new THREE.Vector3(); @@ -80,7 +65,7 @@ var cb = new THREE.Vector3(); var ab = new THREE.Vector3(); - for (var i = 0; i < positions.length; i += 9) { + for ( var i = 0; i < positions.length; i += 9 ) { // positions @@ -100,27 +85,27 @@ var cy = y + Math.random() * d - d2; var cz = z + Math.random() * d - d2; - positions[i] = ax; - positions[i + 1] = ay; - positions[i + 2] = az; + positions[ i ] = ax; + positions[ i + 1 ] = ay; + positions[ i + 2 ] = az; - positions[i + 3] = bx; - positions[i + 4] = by; - positions[i + 5] = bz; + positions[ i + 3 ] = bx; + positions[ i + 4 ] = by; + positions[ i + 5 ] = bz; - positions[i + 6] = cx; - positions[i + 7] = cy; - positions[i + 8] = cz; + positions[ i + 6 ] = cx; + positions[ i + 7 ] = cy; + positions[ i + 8 ] = cz; // flat face normals - pA.set(ax, ay, az); - pB.set(bx, by, bz); - pC.set(cx, cy, cz); + pA.set( ax, ay, az ); + pB.set( bx, by, bz ); + pC.set( cx, cy, cz ); - cb.subVectors(pC, pB); - ab.subVectors(pA, pB); - cb.cross(ab); + cb.subVectors( pC, pB ); + ab.subVectors( pA, pB ); + cb.cross( ab ); cb.normalize(); @@ -128,91 +113,76 @@ var ny = cb.y; var nz = cb.z; - normals[i] = nx; - normals[i + 1] = ny; - normals[i + 2] = nz; + normals[ i ] = nx; + normals[ i + 1 ] = ny; + normals[ i + 2 ] = nz; - normals[i + 3] = nx; - normals[i + 4] = ny; - normals[i + 5] = nz; + normals[ i + 3 ] = nx; + normals[ i + 4 ] = ny; + normals[ i + 5 ] = nz; - normals[i + 6] = nx; - normals[i + 7] = ny; - normals[i + 8] = nz; + normals[ i + 6 ] = nx; + normals[ i + 7 ] = ny; + normals[ i + 8 ] = nz; // colors - var vx = (x / n) + 0.5; - var vy = (y / n) + 0.5; - var vz = (z / n) + 0.5; + var vx = ( x / n ) + 0.5; + var vy = ( y / n ) + 0.5; + var vz = ( z / n ) + 0.5; - color.setRGB(vx, vy, vz); + color.setRGB( vx, vy, vz ); - colors[i] = color.r; - colors[i + 1] = color.g; - colors[i + 2] = color.b; + colors[ i ] = color.r; + colors[ i + 1 ] = color.g; + colors[ i + 2 ] = color.b; - colors[i + 3] = color.r; - colors[i + 4] = color.g; - colors[i + 5] = color.b; + colors[ i + 3 ] = color.r; + colors[ i + 4 ] = color.g; + colors[ i + 5 ] = color.b; - colors[i + 6] = color.r; - colors[i + 7] = color.g; - colors[i + 8] = color.b; + colors[ i + 6 ] = color.r; + colors[ i + 7 ] = color.g; + colors[ i + 8 ] = color.b; } - geometry.addAttribute('index', new THREE.BufferAttribute(indices, 1)); - geometry.addAttribute('position', new THREE.BufferAttribute(positions, 3)); - geometry.addAttribute('normal', new THREE.BufferAttribute(normals, 3)); - geometry.addAttribute('color', new THREE.BufferAttribute(colors, 3)); - - var offsets = triangles / chunkSize; - - for (var i = 0; i < offsets; i++) { - - var offset = { - start: i * chunkSize * 3, - index: i * chunkSize * 3, - count: Math.min(triangles - (i * chunkSize), chunkSize) * 3 - }; - - geometry.offsets.push(offset); - - } + geometry.addAttribute( 'position', new THREE.BufferAttribute( positions, 3 ) ); + geometry.addAttribute( 'normal', new THREE.BufferAttribute( normals, 3 ) ); + geometry.addAttribute( 'color', new THREE.BufferAttribute( colors, 3 ) ); geometry.computeBoundingSphere(); - var material = new THREE.MeshPhongMaterial({ + var material = new THREE.MeshPhongMaterial( { color: 0xaaaaaa, specular: 0xffffff, shininess: 250, side: THREE.DoubleSide, vertexColors: THREE.VertexColors - }); + } ); - mesh = new THREE.Mesh(geometry, material); - scene.add(mesh); + mesh = new THREE.Mesh( geometry, material ); + scene.add( mesh ); // - renderer = new THREE.WebGLRenderer({ antialias: false }); - renderer.setClearColor(scene.fog.color); - renderer.setPixelRatio(window.devicePixelRatio); - renderer.setSize(window.innerWidth, window.innerHeight); + renderer = new THREE.WebGLRenderer( { antialias: false } ); + renderer.setClearColor( scene.fog.color ); + renderer.setPixelRatio( window.devicePixelRatio ); + renderer.setSize( window.innerWidth, window.innerHeight ); renderer.gammaInput = true; renderer.gammaOutput = true; - container.appendChild(renderer.domElement); + container.appendChild( renderer.domElement ); // stats = new Stats(); stats.domElement.style.position = 'absolute'; stats.domElement.style.top = '0px'; - container.appendChild(stats.domElement); + container.appendChild( stats.domElement ); // - window.addEventListener('resize', onWindowResize, false); + window.addEventListener( 'resize', onWindowResize, false ); } @@ -221,7 +191,7 @@ camera.aspect = window.innerWidth / window.innerHeight; camera.updateProjectionMatrix(); - renderer.setSize(window.innerWidth, window.innerHeight); + renderer.setSize( window.innerWidth, window.innerHeight ); } @@ -229,7 +199,7 @@ function animate() { - requestAnimationFrame(animate); + requestAnimationFrame( animate ); render(); stats.update(); @@ -243,7 +213,7 @@ mesh.rotation.x = time * 0.25; mesh.rotation.y = time * 0.5; - renderer.render(scene, camera); + renderer.render( scene, camera ); } } \ No newline at end of file diff --git a/threejs/tests/webgl/webgl_camera.ts b/threejs/tests/webgl/webgl_camera.ts index 4ebb7f7bb..a10a4ad0d 100644 --- a/threejs/tests/webgl/webgl_camera.ts +++ b/threejs/tests/webgl/webgl_camera.ts @@ -18,27 +18,27 @@ function init() { - container = document.createElement('div'); - document.body.appendChild(container); + container = document.createElement( 'div' ); + document.body.appendChild( container ); scene = new THREE.Scene(); // - camera = new THREE.PerspectiveCamera(50, 0.5 * SCREEN_WIDTH / SCREEN_HEIGHT, 1, 10000); + camera = new THREE.PerspectiveCamera( 50, 0.5 * SCREEN_WIDTH / SCREEN_HEIGHT, 1, 10000 ); camera.position.z = 2500; - cameraPerspective = new THREE.PerspectiveCamera(50, 0.5 * SCREEN_WIDTH / SCREEN_HEIGHT, 150, 1000); + cameraPerspective = new THREE.PerspectiveCamera( 50, 0.5 * SCREEN_WIDTH / SCREEN_HEIGHT, 150, 1000 ); - cameraPerspectiveHelper = new THREE.CameraHelper(cameraPerspective); - scene.add(cameraPerspectiveHelper); + cameraPerspectiveHelper = new THREE.CameraHelper( cameraPerspective ); + scene.add( cameraPerspectiveHelper ); // - cameraOrtho = new THREE.OrthographicCamera(0.5 * SCREEN_WIDTH / - 2, 0.5 * SCREEN_WIDTH / 2, SCREEN_HEIGHT / 2, SCREEN_HEIGHT / - 2, 150, 1000); + cameraOrtho = new THREE.OrthographicCamera( 0.5 * SCREEN_WIDTH / - 2, 0.5 * SCREEN_WIDTH / 2, SCREEN_HEIGHT / 2, SCREEN_HEIGHT / - 2, 150, 1000 ); - cameraOrthoHelper = new THREE.CameraHelper(cameraOrtho); - scene.add(cameraOrthoHelper); + cameraOrthoHelper = new THREE.CameraHelper( cameraOrtho ); + scene.add( cameraOrthoHelper ); // @@ -51,72 +51,81 @@ cameraOrtho.rotation.y = Math.PI; cameraPerspective.rotation.y = Math.PI; - cameraRig = new THREE.Object3D(); + cameraRig = new THREE.Group(); - cameraRig.add(cameraPerspective); - cameraRig.add(cameraOrtho); + cameraRig.add( cameraPerspective ); + cameraRig.add( cameraOrtho ); - scene.add(cameraRig); + scene.add( cameraRig ); // - mesh = new THREE.Mesh(new THREE.SphereGeometry(100, 16, 8), new THREE.MeshBasicMaterial({ color: 0xffffff, wireframe: true })); - scene.add(mesh); + mesh = new THREE.Mesh( + new THREE.SphereBufferGeometry( 100, 16, 8 ), + new THREE.MeshBasicMaterial( { color: 0xffffff, wireframe: true } ) + ); + scene.add( mesh ); - var mesh2 = new THREE.Mesh(new THREE.SphereGeometry(50, 16, 8), new THREE.MeshBasicMaterial({ color: 0x00ff00, wireframe: true })); + var mesh2 = new THREE.Mesh( + new THREE.SphereBufferGeometry( 50, 16, 8 ), + new THREE.MeshBasicMaterial( { color: 0x00ff00, wireframe: true } ) + ); mesh2.position.y = 150; - mesh.add(mesh2); + mesh.add( mesh2 ); - var mesh3 = new THREE.Mesh(new THREE.SphereGeometry(5, 16, 8), new THREE.MeshBasicMaterial({ color: 0x0000ff, wireframe: true })); + var mesh3 = new THREE.Mesh( + new THREE.SphereBufferGeometry( 5, 16, 8 ), + new THREE.MeshBasicMaterial( { color: 0x0000ff, wireframe: true } ) + ); mesh3.position.z = 150; - cameraRig.add(mesh3); + cameraRig.add( mesh3 ); // var geometry = new THREE.Geometry(); - for (var i = 0; i < 10000; i++) { + for ( var i = 0; i < 10000; i ++ ) { var vertex = new THREE.Vector3(); - vertex.x = THREE.Math.randFloatSpread(2000); - vertex.y = THREE.Math.randFloatSpread(2000); - vertex.z = THREE.Math.randFloatSpread(2000); + vertex.x = THREE.Math.randFloatSpread( 2000 ); + vertex.y = THREE.Math.randFloatSpread( 2000 ); + vertex.z = THREE.Math.randFloatSpread( 2000 ); - geometry.vertices.push(vertex); + geometry.vertices.push( vertex ); } - var particles = new THREE.PointCloud(geometry, new THREE.PointCloudMaterial({ color: 0x888888 })); - scene.add(particles); + var particles = new THREE.Points( geometry, new THREE.PointsMaterial( { color: 0x888888 } ) ); + scene.add( particles ); // - renderer = new THREE.WebGLRenderer({ antialias: true }); - renderer.setPixelRatio(window.devicePixelRatio); - renderer.setSize(SCREEN_WIDTH, SCREEN_HEIGHT); + renderer = new THREE.WebGLRenderer( { antialias: true } ); + renderer.setPixelRatio( window.devicePixelRatio ); + renderer.setSize( SCREEN_WIDTH, SCREEN_HEIGHT ); renderer.domElement.style.position = "relative"; - container.appendChild(renderer.domElement); + container.appendChild( renderer.domElement ); renderer.autoClear = false; // stats = new Stats(); - container.appendChild(stats.domElement); + container.appendChild( stats.domElement ); // - window.addEventListener('resize', onWindowResize, false); - document.addEventListener('keydown', onKeyDown, false); + window.addEventListener( 'resize', onWindowResize, false ); + document.addEventListener( 'keydown', onKeyDown, false ); } // - function onKeyDown(event) { + function onKeyDown ( event ) { - switch (event.keyCode) { + switch( event.keyCode ) { case 79: /*O*/ @@ -134,16 +143,16 @@ } - }; + } // - function onWindowResize(event) { + function onWindowResize( event ) { SCREEN_WIDTH = window.innerWidth; SCREEN_HEIGHT = window.innerHeight; - renderer.setSize(SCREEN_WIDTH, SCREEN_HEIGHT); + renderer.setSize( SCREEN_WIDTH, SCREEN_HEIGHT ); camera.aspect = 0.5 * SCREEN_WIDTH / SCREEN_HEIGHT; camera.updateProjectionMatrix(); @@ -151,9 +160,9 @@ cameraPerspective.aspect = 0.5 * SCREEN_WIDTH / SCREEN_HEIGHT; cameraPerspective.updateProjectionMatrix(); - cameraOrtho.left = - 0.5 * SCREEN_WIDTH / 2; - cameraOrtho.right = 0.5 * SCREEN_WIDTH / 2; - cameraOrtho.top = SCREEN_HEIGHT / 2; + cameraOrtho.left = - 0.5 * SCREEN_WIDTH / 2; + cameraOrtho.right = 0.5 * SCREEN_WIDTH / 2; + cameraOrtho.top = SCREEN_HEIGHT / 2; cameraOrtho.bottom = - SCREEN_HEIGHT / 2; cameraOrtho.updateProjectionMatrix(); @@ -163,7 +172,7 @@ function animate() { - requestAnimationFrame(animate); + requestAnimationFrame( animate ); render(); stats.update(); @@ -175,16 +184,16 @@ var r = Date.now() * 0.0005; - mesh.position.x = 700 * Math.cos(r); - mesh.position.z = 700 * Math.sin(r); - mesh.position.y = 700 * Math.sin(r); + mesh.position.x = 700 * Math.cos( r ); + mesh.position.z = 700 * Math.sin( r ); + mesh.position.y = 700 * Math.sin( r ); - mesh.children[0].position.x = 70 * Math.cos(2 * r); - mesh.children[0].position.z = 70 * Math.sin(r); + mesh.children[ 0 ].position.x = 70 * Math.cos( 2 * r ); + mesh.children[ 0 ].position.z = 70 * Math.sin( r ); - if (activeCamera === cameraPerspective) { + if ( activeCamera === cameraPerspective ) { - cameraPerspective.fov = 35 + 30 * Math.sin(0.5 * r); + cameraPerspective.fov = 35 + 30 * Math.sin( 0.5 * r ); cameraPerspective.far = mesh.position.length(); cameraPerspective.updateProjectionMatrix(); @@ -205,19 +214,19 @@ } - cameraRig.lookAt(mesh.position); + cameraRig.lookAt( mesh.position ); renderer.clear(); activeHelper.visible = false; - renderer.setViewport(0, 0, SCREEN_WIDTH / 2, SCREEN_HEIGHT); - renderer.render(scene, activeCamera); + renderer.setViewport( 0, 0, SCREEN_WIDTH/2, SCREEN_HEIGHT ); + renderer.render( scene, activeCamera ); activeHelper.visible = true; - renderer.setViewport(SCREEN_WIDTH / 2, 0, SCREEN_WIDTH / 2, SCREEN_HEIGHT); - renderer.render(scene, camera); + renderer.setViewport( SCREEN_WIDTH/2, 0, SCREEN_WIDTH/2, SCREEN_HEIGHT ); + renderer.render( scene, camera ); } } \ No newline at end of file diff --git a/threejs/tests/webgl/webgl_custom_attributes.ts b/threejs/tests/webgl/webgl_custom_attributes.ts index e7819f568..94c892f62 100644 --- a/threejs/tests/webgl/webgl_custom_attributes.ts +++ b/threejs/tests/webgl/webgl_custom_attributes.ts @@ -8,29 +8,20 @@ var renderer, scene, camera, stats; - var sphere, uniforms, attributes; + var sphere, uniforms; - var noise = []; - - var WIDTH = window.innerWidth, - HEIGHT = window.innerHeight; + var displacement, noise; init(); animate(); function init() { - camera = new THREE.PerspectiveCamera(30, WIDTH / HEIGHT, 1, 10000); + camera = new THREE.PerspectiveCamera(30, window.innerWidth / window.innerHeight, 1, 10000); camera.position.z = 300; scene = new THREE.Scene(); - attributes = { - - displacement: { type: 'f', value: [] } - - }; - uniforms = { amplitude: { type: "f", value: 1.0 }, @@ -44,7 +35,6 @@ var shaderMaterial = new THREE.ShaderMaterial({ uniforms: uniforms, - attributes: attributes, vertexShader: document.getElementById('vertexshader').textContent, fragmentShader: document.getElementById('fragmentshader').textContent @@ -52,27 +42,27 @@ var radius = 50, segments = 128, rings = 64; - var geometry = new THREE.SphereGeometry(radius, segments, rings); - geometry.dynamic = true; - sphere = new THREE.Mesh(geometry, shaderMaterial); + var geometry = new THREE.SphereBufferGeometry( radius, segments, rings ); - var vertices = sphere.geometry.vertices; - var values = attributes.displacement.value; + displacement = new Float32Array( geometry.attributes["position"].count ); + noise = new Float32Array( geometry.attributes["position"].count ); - for (var v = 0; v < vertices.length; v++) { + for ( var i = 0; i < displacement.length; i ++ ) { - values[v] = 0; - noise[v] = Math.random() * 5; + noise[ i ] = Math.random() * 5; } + geometry.addAttribute( 'displacement', new THREE.BufferAttribute( displacement, 1 ) ); + + sphere = new THREE.Mesh(geometry, shaderMaterial); scene.add(sphere); renderer = new THREE.WebGLRenderer(); renderer.setClearColor(0x050505); renderer.setPixelRatio(window.devicePixelRatio); - renderer.setSize(WIDTH, HEIGHT); + renderer.setSize(window.innerWidth, window.innerHeight); var container = document.getElementById('container'); container.appendChild(renderer.domElement); @@ -114,19 +104,19 @@ uniforms.amplitude.value = 2.5 * Math.sin(sphere.rotation.y * 0.125); uniforms.color.value.offsetHSL(0.0005, 0, 0); - - for (var i = 0; i < attributes.displacement.value.length; i++) { - - attributes.displacement.value[i] = Math.sin(0.1 * i + time); - - noise[i] += 0.5 * (0.5 - Math.random()); - noise[i] = THREE.Math.clamp(noise[i], -5, 5); - - attributes.displacement.value[i] += noise[i]; - + + for ( var i = 0; i < displacement.length; i ++ ) { + + displacement[ i ] = Math.sin( 0.1 * i + time ); + + noise[ i ] += 0.5 * ( 0.5 - Math.random() ); + noise[ i ] = THREE.Math.clamp( noise[ i ], -5, 5 ); + + displacement[ i ] += noise[ i ]; + } - attributes.displacement.needsUpdate = true; + sphere.geometry.attributes.displacement.needsUpdate = true; renderer.render(scene, camera); diff --git a/threejs/tests/webgl/webgl_interactive_raycasting_pointcloud.ts b/threejs/tests/webgl/webgl_interactive_raycasting_points.ts similarity index 76% rename from threejs/tests/webgl/webgl_interactive_raycasting_pointcloud.ts rename to threejs/tests/webgl/webgl_interactive_raycasting_points.ts index 980109f70..550d4b4b9 100644 --- a/threejs/tests/webgl/webgl_interactive_raycasting_pointcloud.ts +++ b/threejs/tests/webgl/webgl_interactive_raycasting_points.ts @@ -5,17 +5,17 @@ () => { // ------- variable definitions that does not exist in the original code. These are for typescript. - var material: THREE.SpriteMaterial; - var container: HTMLElement; - var pcBuffer: THREE.PointCloud; - var v: any; + var material:THREE.SpriteMaterial; + var container:HTMLElement; + var pcBuffer:THREE.Points; + var v:any; // ------- if (!Detector.webgl) Detector.addGetWebGLMessage(); var renderer, scene, camera, stats; var pointclouds; - var raycaster, intersects; + var raycaster; var mouse = new THREE.Vector2(); var intersection = null; var spheres = []; @@ -48,14 +48,14 @@ var u = i / width; var v = j / length; var x = u - 0.5; - var y = (Math.cos(u * Math.PI * 8) + Math.sin(v * Math.PI * 8)) / 20; + var y = ( Math.cos(u * Math.PI * 8) + Math.sin(v * Math.PI * 8) ) / 20; var z = v - 0.5; positions[3 * k] = x; positions[3 * k + 1] = y; positions[3 * k + 2] = z; - var intensity = (y + 0.1) * 5; + var intensity = ( y + 0.1 ) * 5; colors[3 * k] = color.r * intensity; colors[3 * k + 1] = color.g * intensity; colors[3 * k + 2] = color.b * intensity; @@ -78,8 +78,8 @@ var geometry = generatePointCloudGeometry(color, width, length); - var material = new THREE.PointCloudMaterial({ size: pointSize, vertexColors: THREE.VertexColors }); - var pointcloud = new THREE.PointCloud(geometry, material); + var material = new THREE.PointsMaterial({size: pointSize, vertexColors: THREE.VertexColors}); + var pointcloud = new THREE.Points(geometry, material); return pointcloud; @@ -104,10 +104,10 @@ } - geometry.addAttribute('index', new THREE.BufferAttribute(indices, 1)); + geometry.setIndex(new THREE.BufferAttribute(indices, 1)); - var material = new THREE.PointCloudMaterial({ size: pointSize, vertexColors: THREE.VertexColors }); - var pointcloud = new THREE.PointCloud(geometry, material); + var material = new THREE.PointsMaterial({size: pointSize, vertexColors: THREE.VertexColors}); + var pointcloud = new THREE.Points(geometry, material); return pointcloud; @@ -132,13 +132,11 @@ } - geometry.addAttribute('index', new THREE.BufferAttribute(indices, 1)); + geometry.setIndex(new THREE.BufferAttribute(indices, 1)); + geometry.addDrawCall(0, indices.length); - var offset = { start: 0, count: indices.length, index: 0 }; - geometry.offsets.push(offset); - - var material = new THREE.PointCloudMaterial({ size: pointSize, vertexColors: THREE.VertexColors }); - var pointcloud = new THREE.PointCloud(geometry, material); + var material = new THREE.PointsMaterial({size: pointSize, vertexColors: THREE.VertexColors}); + var pointcloud = new THREE.Points(geometry, material); return pointcloud; @@ -147,7 +145,6 @@ function generateRegularPointcloud(color, width, length) { var geometry = new THREE.Geometry(); - var numPoints = width * length; var colors = []; @@ -160,17 +157,17 @@ var u = i / width; var v = j / length; var x = u - 0.5; - var y = (Math.cos(u * Math.PI * 8) + Math.sin(v * Math.PI * 8)) / 20; + var y = ( Math.cos(u * Math.PI * 8) + Math.sin(v * Math.PI * 8) ) / 20; var z = v - 0.5; - var vec = new THREE.Vector3(x, y, z); + var v2 = new THREE.Vector3(x, y, z); - var intensity = (y + 0.1) * 7; + var intensity = ( y + 0.1 ) * 7; colors[3 * k] = color.r * intensity; colors[3 * k + 1] = color.g * intensity; colors[3 * k + 2] = color.b * intensity; - geometry.vertices.push(vec); - colors[k] = (color.clone().multiplyScalar(intensity)); + geometry.vertices.push(v2); + colors[k] = ( color.clone().multiplyScalar(intensity) ); k++; @@ -181,8 +178,8 @@ geometry.colors = colors; geometry.computeBoundingBox(); - var material = new THREE.PointCloudMaterial({ size: pointSize, vertexColors: THREE.VertexColors }); - var pointcloud = new THREE.PointCloud(geometry, material); + var material = new THREE.PointsMaterial({size: pointSize, vertexColors: THREE.VertexColors}); + var pointcloud = new THREE.Points(geometry, material); return pointcloud; @@ -190,7 +187,7 @@ function init() { - container = document.getElementById('container'); + var container = document.getElementById('container'); scene = new THREE.Scene(); @@ -202,7 +199,7 @@ // - pcBuffer = generatePointcloud(new THREE.Color(1, 0, 0), width, length); + var pcBuffer = generatePointcloud(new THREE.Color(1, 0, 0), width, length); pcBuffer.scale.set(10, 10, 10); pcBuffer.position.set(-5, 0, 5); scene.add(pcBuffer); @@ -227,7 +224,7 @@ // var sphereGeometry = new THREE.SphereGeometry(0.1, 32, 32); - var sphereMaterial = new THREE.MeshBasicMaterial({ color: 0xff0000, shading: THREE.FlatShading }); + var sphereMaterial = new THREE.MeshBasicMaterial({color: 0xff0000, shading: THREE.FlatShading}); for (var i = 0; i < 40; i++) { @@ -247,7 +244,7 @@ // raycaster = new THREE.Raycaster(); - raycaster.params.PointCloud.threshold = threshold; + raycaster.params.Points.threshold = threshold; // @@ -267,8 +264,8 @@ event.preventDefault(); - mouse.x = (event.clientX / window.innerWidth) * 2 - 1; - mouse.y = - (event.clientY / window.innerHeight) * 2 + 1; + mouse.x = ( event.clientX / window.innerWidth ) * 2 - 1; + mouse.y = -( event.clientY / window.innerHeight ) * 2 + 1; } @@ -300,13 +297,13 @@ raycaster.setFromCamera(mouse, camera); var intersections = raycaster.intersectObjects(pointclouds); - intersection = (intersections.length) > 0 ? intersections[0] : null; + intersection = ( intersections.length ) > 0 ? intersections[0] : null; if (toggle > 0.02 && intersection !== null) { spheres[spheresIndex].position.copy(intersection.point); spheres[spheresIndex].scale.set(1, 1, 1); - spheresIndex = (spheresIndex + 1) % spheres.length; + spheresIndex = ( spheresIndex + 1 ) % spheres.length; toggle = 0; diff --git a/threejs/tests/webgl/webgl_lights_heimsphere.ts b/threejs/tests/webgl/webgl_lights_heimsphere.ts index a8cf0a7d1..fd2118e62 100644 --- a/threejs/tests/webgl/webgl_lights_heimsphere.ts +++ b/threejs/tests/webgl/webgl_lights_heimsphere.ts @@ -7,10 +7,11 @@ // ------- variable definitions that does not exist in the original code. These are for typescript. var morph: any; // ------- - if (!Detector.webgl) Detector.addGetWebGLMessage(); + + if ( ! Detector.webgl ) Detector.addGetWebGLMessage(); var camera, scene, renderer, dirLight, hemiLight; - var morphs = []; + var mixers = []; var stats; var clock = new THREE.Clock(); @@ -20,45 +21,45 @@ function init() { - var container = document.getElementById('container'); + var container = document.getElementById( 'container' ); - camera = new THREE.PerspectiveCamera(30, window.innerWidth / window.innerHeight, 1, 5000); - camera.position.set(0, 0, 250); + camera = new THREE.PerspectiveCamera( 30, window.innerWidth / window.innerHeight, 1, 5000 ); + camera.position.set( 0, 0, 250 ); scene = new THREE.Scene(); - scene.fog = new THREE.Fog(0xffffff, 1, 5000); - scene.fog.color.setHSL(0.6, 0, 1); + scene.fog = new THREE.Fog( 0xffffff, 1, 5000 ); + scene.fog.color.setHSL( 0.6, 0, 1 ); /* - controls = new THREE.TrackballControls( camera ); + controls = new THREE.TrackballControls( camera ); - controls.rotateSpeed = 1.0; - controls.zoomSpeed = 1.2; - controls.panSpeed = 0.8; + controls.rotateSpeed = 1.0; + controls.zoomSpeed = 1.2; + controls.panSpeed = 0.8; - controls.noZoom = false; - controls.noPan = false; + controls.noZoom = false; + controls.noPan = false; - controls.staticMoving = true; - controls.dynamicDampingFactor = 0.15; - */ + controls.staticMoving = true; + controls.dynamicDampingFactor = 0.15; + */ // LIGHTS - hemiLight = new THREE.HemisphereLight(0xffffff, 0xffffff, 0.6); - hemiLight.color.setHSL(0.6, 1, 0.6); - hemiLight.groundColor.setHSL(0.095, 1, 0.75); - hemiLight.position.set(0, 500, 0); - scene.add(hemiLight); + hemiLight = new THREE.HemisphereLight( 0xffffff, 0xffffff, 0.6 ); + hemiLight.color.setHSL( 0.6, 1, 0.6 ); + hemiLight.groundColor.setHSL( 0.095, 1, 0.75 ); + hemiLight.position.set( 0, 500, 0 ); + scene.add( hemiLight ); // - dirLight = new THREE.DirectionalLight(0xffffff, 1); - dirLight.color.setHSL(0.1, 1, 0.95); - dirLight.position.set(-1, 1.75, 1); - dirLight.position.multiplyScalar(50); - scene.add(dirLight); + dirLight = new THREE.DirectionalLight( 0xffffff, 1 ); + dirLight.color.setHSL( 0.1, 1, 0.95 ); + dirLight.position.set( -1, 1.75, 1 ); + dirLight.position.multiplyScalar( 50 ); + scene.add( dirLight ); dirLight.castShadow = true; @@ -74,108 +75,89 @@ dirLight.shadowCameraFar = 3500; dirLight.shadowBias = -0.0001; - dirLight.shadowDarkness = 0.35; //dirLight.shadowCameraVisible = true; // GROUND - var groundGeo = new THREE.PlaneBufferGeometry(10000, 10000); - var groundMat = new THREE.MeshPhongMaterial({ color: 0xffffff, specular: 0x050505 }); - groundMat.color.setHSL(0.095, 1, 0.75); + var groundGeo = new THREE.PlaneBufferGeometry( 10000, 10000 ); + var groundMat = new THREE.MeshPhongMaterial( { color: 0xffffff, specular: 0x050505 } ); + groundMat.color.setHSL( 0.095, 1, 0.75 ); - var ground = new THREE.Mesh(groundGeo, groundMat); - ground.rotation.x = -Math.PI / 2; + var ground = new THREE.Mesh( groundGeo, groundMat ); + ground.rotation.x = -Math.PI/2; ground.position.y = -33; - scene.add(ground); + scene.add( ground ); ground.receiveShadow = true; // SKYDOME - var vertexShader = document.getElementById('vertexShader').textContent; - var fragmentShader = document.getElementById('fragmentShader').textContent; + var vertexShader = document.getElementById( 'vertexShader' ).textContent; + var fragmentShader = document.getElementById( 'fragmentShader' ).textContent; var uniforms = { - topColor: { type: "c", value: new THREE.Color(0x0077ff) }, - bottomColor: { type: "c", value: new THREE.Color(0xffffff) }, - offset: { type: "f", value: 33 }, - exponent: { type: "f", value: 0.6 } - } - uniforms.topColor.value.copy(hemiLight.color); + topColor: { type: "c", value: new THREE.Color( 0x0077ff ) }, + bottomColor: { type: "c", value: new THREE.Color( 0xffffff ) }, + offset: { type: "f", value: 33 }, + exponent: { type: "f", value: 0.6 } + }; + uniforms.topColor.value.copy( hemiLight.color ); - scene.fog.color.copy(uniforms.bottomColor.value); + scene.fog.color.copy( uniforms.bottomColor.value ); - var skyGeo = new THREE.SphereGeometry(4000, 32, 15); - var skyMat = new THREE.ShaderMaterial({ vertexShader: vertexShader, fragmentShader: fragmentShader, uniforms: uniforms, side: THREE.BackSide }); + var skyGeo = new THREE.SphereGeometry( 4000, 32, 15 ); + var skyMat = new THREE.ShaderMaterial( { vertexShader: vertexShader, fragmentShader: fragmentShader, uniforms: uniforms, side: THREE.BackSide } ); - var sky = new THREE.Mesh(skyGeo, skyMat); - scene.add(sky); + var sky = new THREE.Mesh( skyGeo, skyMat ); + scene.add( sky ); // MODEL var loader = new THREE.JSONLoader(); - loader.load("models/animated/flamingo.js", function (geometry) { + loader.load( "models/animated/flamingo.js", function( geometry ) { - morphColorsToFaceColors(geometry); - geometry.computeMorphNormals(); - - var material = new THREE.MeshPhongMaterial({ color: 0xffffff, specular: 0xffffff, shininess: 20, morphTargets: true, morphNormals: true, vertexColors: THREE.FaceColors, shading: THREE.FlatShading }); - var meshAnim = new THREE.MorphAnimMesh(geometry, material); - - meshAnim.duration = 1000; + var material = new THREE.MeshPhongMaterial( { color: 0xffffff, specular: 0xffffff, shininess: 20, morphTargets: true, vertexColors: THREE.FaceColors, shading: THREE.FlatShading } ); + var mesh = new THREE.Mesh( geometry, material ); var s = 0.35; - meshAnim.scale.set(s, s, s); - meshAnim.position.y = 15; - meshAnim.rotation.y = -1; + mesh.scale.set( s, s, s ); + mesh.position.y = 15; + mesh.rotation.y = -1; - meshAnim.castShadow = true; - meshAnim.receiveShadow = true; + mesh.castShadow = true; + mesh.receiveShadow = true; - scene.add(meshAnim); - morphs.push(meshAnim); + scene.add( mesh ); - }); + var mixer = new THREE.AnimationMixer( mesh ); + mixer.addAction( new THREE.AnimationAction( geometry.animations[ 0 ] ).warpToDuration( 1 ) ); + mixers.push( mixer ); + + } ); // RENDERER - renderer = new THREE.WebGLRenderer({ antialias: true }); - renderer.setClearColor(scene.fog.color); - renderer.setPixelRatio(window.devicePixelRatio); - renderer.setSize(window.innerWidth, window.innerHeight); - container.appendChild(renderer.domElement); + renderer = new THREE.WebGLRenderer( { antialias: true } ); + renderer.setClearColor( scene.fog.color ); + renderer.setPixelRatio( window.devicePixelRatio ); + renderer.setSize( window.innerWidth, window.innerHeight ); + container.appendChild( renderer.domElement ); renderer.gammaInput = true; renderer.gammaOutput = true; - renderer.shadowMapEnabled = true; - renderer.shadowMapCullFace = THREE.CullFaceBack; + renderer.shadowMap.enabled = true; + renderer.shadowMap.cullFace = THREE.CullFaceBack; // STATS stats = new Stats(); - container.appendChild(stats.domElement); + container.appendChild( stats.domElement ); // - window.addEventListener('resize', onWindowResize, false); - document.addEventListener('keydown', onKeyDown, false); - - } - - function morphColorsToFaceColors(geometry) { - - if (geometry.morphColors && geometry.morphColors.length) { - - var colorMap = geometry.morphColors[0]; - - for (var i = 0; i < colorMap.colors.length; i++) { - - geometry.faces[i].color = colorMap.colors[i]; - - } - - } + window.addEventListener( 'resize', onWindowResize, false ); + document.addEventListener( 'keydown', onKeyDown, false ); } @@ -184,20 +166,20 @@ camera.aspect = window.innerWidth / window.innerHeight; camera.updateProjectionMatrix(); - renderer.setSize(window.innerWidth, window.innerHeight); + renderer.setSize( window.innerWidth, window.innerHeight ); } - function onKeyDown(event) { + function onKeyDown ( event ) { - switch (event.keyCode) { + switch ( event.keyCode ) { - case 72: /*h*/ + case 72: // h hemiLight.visible = !hemiLight.visible; break; - case 68: /*d*/ + case 68: // d dirLight.visible = !dirLight.visible; break; @@ -210,7 +192,7 @@ function animate() { - requestAnimationFrame(animate); + requestAnimationFrame( animate ); render(); stats.update(); @@ -223,14 +205,13 @@ //controls.update(); - for (var i = 0; i < morphs.length; i++) { + for ( var i = 0; i < mixers.length; i ++ ) { - morph = morphs[i]; - morph.updateAnimation(1000 * delta); + mixers[ i ].update( delta ); } - renderer.render(scene, camera); + renderer.render( scene, camera ); } } diff --git a/threejs/tests/webgl/webgl_materials.ts b/threejs/tests/webgl/webgl_materials.ts index 9509768a6..a78ae152a 100644 --- a/threejs/tests/webgl/webgl_materials.ts +++ b/threejs/tests/webgl/webgl_materials.ts @@ -54,20 +54,20 @@ texture.needsUpdate = true; materials.push(new THREE.MeshLambertMaterial({ map: texture, transparent: true })); - materials.push(new THREE.MeshLambertMaterial({ color: 0xdddddd, shading: THREE.FlatShading })); + materials.push(new THREE.MeshLambertMaterial({ color: 0xdddddd })); materials.push(new THREE.MeshPhongMaterial({ color: 0xdddddd, specular: 0x009900, shininess: 30, shading: THREE.FlatShading })); materials.push(new THREE.MeshNormalMaterial()); materials.push(new THREE.MeshBasicMaterial({ color: 0xffaa00, transparent: true, blending: THREE.AdditiveBlending })); //materials.push( new THREE.MeshBasicMaterial( { color: 0xff0000, blending: THREE.SubtractiveBlending } ) ); - materials.push(new THREE.MeshLambertMaterial({ color: 0xdddddd, shading: THREE.SmoothShading })); + materials.push(new THREE.MeshLambertMaterial({ color: 0xdddddd })); materials.push(new THREE.MeshPhongMaterial({ color: 0xdddddd, specular: 0x009900, shininess: 30, shading: THREE.SmoothShading, map: texture, transparent: true })); materials.push(new THREE.MeshNormalMaterial({ shading: THREE.SmoothShading })); materials.push(new THREE.MeshBasicMaterial({ color: 0xffaa00, wireframe: true })); materials.push(new THREE.MeshDepthMaterial()); - materials.push(new THREE.MeshLambertMaterial({ color: 0x666666, emissive: 0xff0000, shading: THREE.SmoothShading })); + materials.push(new THREE.MeshLambertMaterial({ color: 0x666666, emissive: 0xff0000 })); materials.push(new THREE.MeshPhongMaterial({ color: 0x000000, specular: 0x666666, emissive: 0xff0000, shininess: 10, shading: THREE.SmoothShading, opacity: 0.9, transparent: true })); materials.push(new THREE.MeshBasicMaterial({ map: texture, transparent: true })); diff --git a/threejs/tests/webgl/webgl_particles_billboards.ts b/threejs/tests/webgl/webgl_particles_billboards.ts deleted file mode 100644 index 96b77588c..000000000 --- a/threejs/tests/webgl/webgl_particles_billboards.ts +++ /dev/null @@ -1,147 +0,0 @@ -/// -/// - -// https://github.com/mrdoob/three.js/blob/master/examples/webgl_particles_billboards.html - -() => { - if (!Detector.webgl) Detector.addGetWebGLMessage(); - - var container, stats; - var camera, scene, renderer, particles, geometry, material, i, h, color, sprite, size; - var mouseX = 0, mouseY = 0; - - var windowHalfX = window.innerWidth / 2; - var windowHalfY = window.innerHeight / 2; - - init(); - animate(); - - function init() { - - container = document.createElement('div'); - document.body.appendChild(container); - - camera = new THREE.PerspectiveCamera(55, window.innerWidth / window.innerHeight, 2, 2000); - camera.position.z = 1000; - - scene = new THREE.Scene(); - scene.fog = new THREE.FogExp2(0x000000, 0.001); - - geometry = new THREE.Geometry(); - - sprite = THREE.ImageUtils.loadTexture("textures/sprites/disc.png"); - - for (i = 0; i < 10000; i++) { - - var vertex = new THREE.Vector3(); - vertex.x = 2000 * Math.random() - 1000; - vertex.y = 2000 * Math.random() - 1000; - vertex.z = 2000 * Math.random() - 1000; - - geometry.vertices.push(vertex); - - } - - material = new THREE.PointCloudMaterial({ size: 35, sizeAttenuation: false, map: sprite, alphaTest: 0.5, transparent: true }); - material.color.setHSL(1.0, 0.3, 0.7); - - particles = new THREE.PointCloud(geometry, material); - scene.add(particles); - - // - - renderer = new THREE.WebGLRenderer(); - renderer.setPixelRatio(window.devicePixelRatio); - renderer.setSize(window.innerWidth, window.innerHeight); - container.appendChild(renderer.domElement); - - // - - stats = new Stats(); - stats.domElement.style.position = 'absolute'; - stats.domElement.style.top = '0px'; - container.appendChild(stats.domElement); - - // - - document.addEventListener('mousemove', onDocumentMouseMove, false); - document.addEventListener('touchstart', onDocumentTouchStart, false); - document.addEventListener('touchmove', onDocumentTouchMove, false); - - // - - window.addEventListener('resize', onWindowResize, false); - - } - - function onWindowResize() { - - windowHalfX = window.innerWidth / 2; - windowHalfY = window.innerHeight / 2; - - camera.aspect = window.innerWidth / window.innerHeight; - camera.updateProjectionMatrix(); - - renderer.setSize(window.innerWidth, window.innerHeight); - - } - - function onDocumentMouseMove(event) { - - mouseX = event.clientX - windowHalfX; - mouseY = event.clientY - windowHalfY; - - } - - function onDocumentTouchStart(event) { - - if (event.touches.length == 1) { - - event.preventDefault(); - - mouseX = event.touches[0].pageX - windowHalfX; - mouseY = event.touches[0].pageY - windowHalfY; - - } - } - - function onDocumentTouchMove(event) { - - if (event.touches.length == 1) { - - event.preventDefault(); - - mouseX = event.touches[0].pageX - windowHalfX; - mouseY = event.touches[0].pageY - windowHalfY; - - } - - } - - // - - function animate() { - - requestAnimationFrame(animate); - - render(); - stats.update(); - - } - - function render() { - - var time = Date.now() * 0.00005; - - camera.position.x += (mouseX - camera.position.x) * 0.05; - camera.position.y += (- mouseY - camera.position.y) * 0.05; - - camera.lookAt(scene.position); - - h = (360 * (1.0 + time) % 360) / 360; - material.color.setHSL(h, 0.5, 0.5); - - renderer.render(scene, camera); - - } -} \ No newline at end of file diff --git a/threejs/tests/webgl/webgl_points_billboards.ts b/threejs/tests/webgl/webgl_points_billboards.ts new file mode 100644 index 000000000..37c41424b --- /dev/null +++ b/threejs/tests/webgl/webgl_points_billboards.ts @@ -0,0 +1,147 @@ +/// +/// + +// https://github.com/mrdoob/three.js/blob/master/examples/webgl_particles_billboards.html + +() => { + if ( ! Detector.webgl ) Detector.addGetWebGLMessage(); + + var container, stats; + var camera, scene, renderer, particles, geometry, material, i, h, color, sprite, size; + var mouseX = 0, mouseY = 0; + + var windowHalfX = window.innerWidth / 2; + var windowHalfY = window.innerHeight / 2; + + init(); + animate(); + + function init() { + + container = document.createElement( 'div' ); + document.body.appendChild( container ); + + camera = new THREE.PerspectiveCamera( 55, window.innerWidth / window.innerHeight, 2, 2000 ); + camera.position.z = 1000; + + scene = new THREE.Scene(); + scene.fog = new THREE.FogExp2( 0x000000, 0.001 ); + + geometry = new THREE.Geometry(); + + sprite = THREE.ImageUtils.loadTexture( "textures/sprites/disc.png" ); + + for ( i = 0; i < 10000; i ++ ) { + + var vertex = new THREE.Vector3(); + vertex.x = 2000 * Math.random() - 1000; + vertex.y = 2000 * Math.random() - 1000; + vertex.z = 2000 * Math.random() - 1000; + + geometry.vertices.push( vertex ); + + } + + material = new THREE.PointsMaterial( { size: 35, sizeAttenuation: false, map: sprite, alphaTest: 0.5, transparent: true } ); + material.color.setHSL( 1.0, 0.3, 0.7 ); + + particles = new THREE.Points( geometry, material ); + scene.add( particles ); + + // + + renderer = new THREE.WebGLRenderer(); + renderer.setPixelRatio( window.devicePixelRatio ); + renderer.setSize( window.innerWidth, window.innerHeight ); + container.appendChild( renderer.domElement ); + + // + + stats = new Stats(); + stats.domElement.style.position = 'absolute'; + stats.domElement.style.top = '0px'; + container.appendChild( stats.domElement ); + + // + + document.addEventListener( 'mousemove', onDocumentMouseMove, false ); + document.addEventListener( 'touchstart', onDocumentTouchStart, false ); + document.addEventListener( 'touchmove', onDocumentTouchMove, false ); + + // + + window.addEventListener( 'resize', onWindowResize, false ); + + } + + function onWindowResize() { + + windowHalfX = window.innerWidth / 2; + windowHalfY = window.innerHeight / 2; + + camera.aspect = window.innerWidth / window.innerHeight; + camera.updateProjectionMatrix(); + + renderer.setSize( window.innerWidth, window.innerHeight ); + + } + + function onDocumentMouseMove( event ) { + + mouseX = event.clientX - windowHalfX; + mouseY = event.clientY - windowHalfY; + + } + + function onDocumentTouchStart( event ) { + + if ( event.touches.length == 1 ) { + + event.preventDefault(); + + mouseX = event.touches[ 0 ].pageX - windowHalfX; + mouseY = event.touches[ 0 ].pageY - windowHalfY; + + } + } + + function onDocumentTouchMove( event ) { + + if ( event.touches.length == 1 ) { + + event.preventDefault(); + + mouseX = event.touches[ 0 ].pageX - windowHalfX; + mouseY = event.touches[ 0 ].pageY - windowHalfY; + + } + + } + + // + + function animate() { + + requestAnimationFrame( animate ); + + render(); + stats.update(); + + } + + function render() { + + var time = Date.now() * 0.00005; + + camera.position.x += ( mouseX - camera.position.x ) * 0.05; + camera.position.y += ( - mouseY - camera.position.y ) * 0.05; + + camera.lookAt( scene.position ); + + h = ( 360 * ( 1.0 + time ) % 360 ) / 360; + material.color.setHSL( h, 0.5, 0.5 ); + + renderer.render( scene, camera ); + + } +} \ No newline at end of file diff --git a/threejs/tests/webgl/webgl_sprites.ts b/threejs/tests/webgl/webgl_sprites.ts index c7e2d4f84..3ec84bba1 100644 --- a/threejs/tests/webgl/webgl_sprites.ts +++ b/threejs/tests/webgl/webgl_sprites.ts @@ -25,14 +25,14 @@ var width = window.innerWidth; var height = window.innerHeight; - camera = new THREE.PerspectiveCamera(60, width / height, 1, 2100); + camera = new THREE.PerspectiveCamera( 60, width / height, 1, 2100 ); camera.position.z = 1500; - cameraOrtho = new THREE.OrthographicCamera(- width / 2, width / 2, height / 2, - height / 2, 1, 10); + cameraOrtho = new THREE.OrthographicCamera( - width / 2, width / 2, height / 2, - height / 2, 1, 10 ); cameraOrtho.position.z = 10; scene = new THREE.Scene(); - scene.fog = new THREE.Fog(0x000000, 1500, 2100); + scene.fog = new THREE.Fog( 0x000000, 1500, 2100 ); sceneOrtho = new THREE.Scene(); @@ -41,93 +41,93 @@ var amount = 200; var radius = 500; - var mapA = THREE.ImageUtils.loadTexture("textures/sprite0.png", undefined, createHUDSprites); - var mapB = THREE.ImageUtils.loadTexture("textures/sprite1.png"); - mapC = THREE.ImageUtils.loadTexture("textures/sprite2.png"); + var mapA = THREE.ImageUtils.loadTexture( "textures/sprite0.png", undefined, createHUDSprites ); + var mapB = THREE.ImageUtils.loadTexture( "textures/sprite1.png" ); + mapC = THREE.ImageUtils.loadTexture( "textures/sprite2.png" ); group = new THREE.Group(); - var materialC = new THREE.SpriteMaterial({ map: mapC, color: 0xffffff, fog: true }); - var materialB = new THREE.SpriteMaterial({ map: mapB, color: 0xffffff, fog: true }); + var materialC = new THREE.SpriteMaterial( { map: mapC, color: 0xffffff, fog: true } ); + var materialB = new THREE.SpriteMaterial( { map: mapB, color: 0xffffff, fog: true } ); - for (var a = 0; a < amount; a++) { + for ( var a = 0; a < amount; a ++ ) { var x = Math.random() - 0.5; var y = Math.random() - 0.5; var z = Math.random() - 0.5; - if (z < 0) { + if ( z < 0 ) { material = materialB.clone(); } else { material = materialC.clone(); - material.color.setHSL(0.5 * Math.random(), 0.75, 0.5); - material.map.offset.set(-0.5, -0.5); - material.map.repeat.set(2, 2); + material.color.setHSL( 0.5 * Math.random(), 0.75, 0.5 ); + material.map.offset.set( -0.5, -0.5 ); + material.map.repeat.set( 2, 2 ); } - var sprite = new THREE.Sprite(material); + var sprite = new THREE.Sprite( material ); - sprite.position.set(x, y, z); + sprite.position.set( x, y, z ); sprite.position.normalize(); - sprite.position.multiplyScalar(radius); + sprite.position.multiplyScalar( radius ); - group.add(sprite); + group.add( sprite ); } - scene.add(group); + scene.add( group ); // renderer renderer = new THREE.WebGLRenderer(); - renderer.setPixelRatio(window.devicePixelRatio); - renderer.setSize(window.innerWidth, window.innerHeight); + renderer.setPixelRatio( window.devicePixelRatio ); + renderer.setSize( window.innerWidth, window.innerHeight ); renderer.autoClear = false; // To allow render overlay on top of sprited sphere - document.body.appendChild(renderer.domElement); + document.body.appendChild( renderer.domElement ); // - window.addEventListener('resize', onWindowResize, false); + window.addEventListener( 'resize', onWindowResize, false ); } - function createHUDSprites(texture) { + function createHUDSprites ( texture ) { - var material = new THREE.SpriteMaterial({ map: texture }); + var material = new THREE.SpriteMaterial( { map: texture } ); var width = material.map.image.width; var height = material.map.image.height; - spriteTL = new THREE.Sprite(material); - spriteTL.scale.set(width, height, 1); - sceneOrtho.add(spriteTL); + spriteTL = new THREE.Sprite( material ); + spriteTL.scale.set( width, height, 1 ); + sceneOrtho.add( spriteTL ); - spriteTR = new THREE.Sprite(material); - spriteTR.scale.set(width, height, 1); - sceneOrtho.add(spriteTR); + spriteTR = new THREE.Sprite( material ); + spriteTR.scale.set( width, height, 1 ); + sceneOrtho.add( spriteTR ); - spriteBL = new THREE.Sprite(material); - spriteBL.scale.set(width, height, 1); - sceneOrtho.add(spriteBL); + spriteBL = new THREE.Sprite( material ); + spriteBL.scale.set( width, height, 1 ); + sceneOrtho.add( spriteBL ); - spriteBR = new THREE.Sprite(material); - spriteBR.scale.set(width, height, 1); - sceneOrtho.add(spriteBR); + spriteBR = new THREE.Sprite( material ); + spriteBR.scale.set( width, height, 1 ); + sceneOrtho.add( spriteBR ); - spriteC = new THREE.Sprite(material); - spriteC.scale.set(width, height, 1); - sceneOrtho.add(spriteC); + spriteC = new THREE.Sprite( material ); + spriteC.scale.set( width, height, 1 ); + sceneOrtho.add( spriteC ); updateHUDSprites(); - }; + } - function updateHUDSprites() { + function updateHUDSprites () { var width = window.innerWidth / 2; var height = window.innerHeight / 2; @@ -137,13 +137,13 @@ var imageWidth = material.map.image.width / 2; var imageHeight = material.map.image.height / 2; - spriteTL.position.set(- width + imageWidth, height - imageHeight, 1); // top left - spriteTR.position.set(width - imageWidth, height - imageHeight, 1); // top right - spriteBL.position.set(- width + imageWidth, - height + imageHeight, 1); // bottom left - spriteBR.position.set(width - imageWidth, - height + imageHeight, 1); // bottom right - spriteC.position.set(0, 0, 1); // center + spriteTL.position.set( - width + imageWidth, height - imageHeight, 1 ); // top left + spriteTR.position.set( width - imageWidth, height - imageHeight, 1 ); // top right + spriteBL.position.set( - width + imageWidth, - height + imageHeight, 1 ); // bottom left + spriteBR.position.set( width - imageWidth, - height + imageHeight, 1 ); // bottom right + spriteC.position.set( 0, 0, 1 ); // center - }; + } function onWindowResize() { @@ -161,13 +161,13 @@ updateHUDSprites(); - renderer.setSize(window.innerWidth, window.innerHeight); + renderer.setSize( window.innerWidth, window.innerHeight ); } function animate() { - requestAnimationFrame(animate); + requestAnimationFrame( animate ); render(); } @@ -176,28 +176,28 @@ var time = Date.now() / 1000; - for (var i = 0, l = group.children.length; i < l; i++) { + for ( var i = 0, l = group.children.length; i < l; i ++ ) { - var sprite = group.children[i]; + var sprite = group.children[ i ]; var material = sprite.material; - var scale = Math.sin(time + sprite.position.x * 0.01) * 0.3 + 1.0; + var scale = Math.sin( time + sprite.position.x * 0.01 ) * 0.3 + 1.0; var imageWidth = 1; var imageHeight = 1; - if (material.map && material.map.image && material.map.image.width) { + if ( material.map && material.map.image && material.map.image.width ) { imageWidth = material.map.image.width; imageHeight = material.map.image.height; } - sprite.material.rotation += 0.1 * (i / l); - sprite.scale.set(scale * imageWidth, scale * imageHeight, 1.0); + sprite.material.rotation += 0.1 * ( i / l ); + sprite.scale.set( scale * imageWidth, scale * imageHeight, 1.0 ); - if (material.map !== mapC) { + if ( material.map !== mapC ) { - material.opacity = Math.sin(time + sprite.position.x * 0.01) * 0.4 + 0.6; + material.opacity = Math.sin( time + sprite.position.x * 0.01 ) * 0.4 + 0.6; } @@ -208,9 +208,9 @@ group.rotation.z = time * 1.0; renderer.clear(); - renderer.render(scene, camera); + renderer.render( scene, camera ); renderer.clearDepth(); - renderer.render(sceneOrtho, cameraOrtho); + renderer.render( sceneOrtho, cameraOrtho ); } } \ No newline at end of file diff --git a/threejs/three-FirstPersonControls.d.ts b/threejs/three-FirstPersonControls.d.ts new file mode 100644 index 000000000..3e34b9e45 --- /dev/null +++ b/threejs/three-FirstPersonControls.d.ts @@ -0,0 +1,41 @@ +// Type definitions for three.js +// Project: http://mrdoob.github.com/three.js/ +// Definitions by: Poul Kjeldager Sørensen +// Definitions: https://github.com/borisyankov/DefinitelyTyped +//Source : https://github.com/NTaylorMullen/CycleR/blob/master/CycleR/CycleR.Game.Client/Client/Interfaces/ThreeJS/Cameras/FirstPersonControls.d.ts + +/// +declare module THREE { + class FirstPersonControls { + constructor(object: Camera, domElement?: HTMLElement); + object: THREE.Object3D; + target: THREE.Vector3; + domElement: HTMLCanvasElement; + movementSpeed: number; + lookSpeed: number; + noFly: boolean; + lookVertical: boolean; + autoForward: boolean; + activeLook: boolean; + heightSpeed: boolean; + heightCoef: boolean; + heightMin: boolean; + constrainVertical: boolean; + verticalMin: number; + verticalMax: number; + autoSpeedFactor: number; + mouseX: number; + mouseY: number; + lat: number; + lon: number; + phi: number; + theta: number; + moveForward: boolean; + moveBackward: boolean; + moveLeft: boolean; + moveRight: boolean; + freeze: boolean; + mouseDragOn: boolean; + update(delta?: number): void; + } +} diff --git a/threejs/three-tests.ts b/threejs/three-tests.ts index ff97df43f..2e9f37b10 100644 --- a/threejs/three-tests.ts +++ b/threejs/three-tests.ts @@ -33,14 +33,14 @@ THE SOFTWARE. /// /// /// -/// +/// /// /// /// /// /// /// -/// +/// /// /// /// diff --git a/threejs/three.d.ts b/threejs/three.d.ts index fd165f936..fb890afe6 100644 --- a/threejs/three.d.ts +++ b/threejs/three.d.ts @@ -1,15 +1,13 @@ -// Type definitions for three.js r71 +// Type definitions for three.js r73 // Project: http://mrdoob.github.com/three.js/ // Definitions by: Kon , Satoru Kimura // Definitions: https://github.com/borisyankov/DefinitelyTyped -interface WebGLRenderingContext {} - declare module THREE { export var REVISION: string; // https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent.button - export enum MOUSE {LEFT, MIDDLE, RIGHT} + export enum MOUSE { LEFT, MIDDLE, RIGHT } // GL STATE CONSTANTS export enum CullFace { } @@ -84,6 +82,17 @@ declare module THREE { export var OneMinusDstColorFactor: BlendingSrcFactor; export var SrcAlphaSaturateFactor: BlendingSrcFactor; + // depth modes + export enum DepthModes { } + export var NeverDepth: DepthModes; + export var AlwaysDepth: DepthModes; + export var LessDepth: DepthModes; + export var LessEqualDepth: DepthModes; + export var EqualDepth: DepthModes; + export var GreaterEqualDepth: DepthModes; + export var GreaterDepth: DepthModes; + export var NotEqualDepth: DepthModes; + // TEXTURE CONSTANTS // Operations export enum Combine { } @@ -155,11 +164,213 @@ declare module THREE { export var RGBA_PVRTC_4BPPV1_Format: CompressedPixelFormat; export var RGBA_PVRTC_2BPPV1_Format: CompressedPixelFormat; + // Loop styles for AnimationAction + export enum AnimationActionLoopStyles { } + export var LoopOnce: AnimationActionLoopStyles; + export var LoopRepeat: AnimationActionLoopStyles; + export var LoopPingPong: AnimationActionLoopStyles; + // log handlers export function warn(message?: any, ...optionalParams: any[]): void; export function error(message?: any, ...optionalParams: any[]): void; export function log(message?: any, ...optionalParams: any[]): void; + // Animation //////////////////////////////////////////////////////////////////////////////////////// + export class AnimationAction { + constructor(clip: AnimationClip, startTime?: number, timeScale?: number, weight?: number, loop?: boolean); + + clip: AnimationClip + localRoot: Mesh; + startTime: number; + timeScale: number; + weight: number; + loop: AnimationActionLoopStyles; + loopCount: number; + enabled: boolean; + actionTime: number; + clipTime: number; + propertyBindings: PropertyBinding[]; + + setLocalRoot( localRoot: Mesh ): AnimationAction; + updateTime( clipDeltaTime: number ): number; + syncWith( action: AnimationAction ): AnimationAction; + warpToDuration( duration: number ): AnimationAction; + init( time: number ): AnimationAction; + update( clipDeltaTime: number ): any[]; + getTimeScaleAt( time: number ): number; + getWeightAt( time: number ): number; + } + + export class AnimationClip { + constructor( name: string, duration?: number, tracks?: KeyframeTrack[] ); + + name: string; + tracks: KeyframeTrack[]; + duration: number; + results: any[]; + + getAt(clipTime: number): any[]; + trim(): AnimationClip; + optimize(): AnimationClip; + + static CreateFromMorphTargetSequence( name: string, morphTargetSequence: MorphTarget[], fps: number ): AnimationClip; + findByName( clipArray: AnimationClip, name: string ): AnimationClip; + static CreateClipsFromMorphTargetSequences( morphTargets: MorphTarget[], fps: number ): AnimationClip[]; + parse( json: any ): AnimationClip; + parseAnimation( animation: any, bones: Bone[], nodeName: string ): AnimationClip; + } + + export class AnimationMixer { + constructor( root: any ); + + root: any; + time: number; + timeScale: number; + actions: AnimationAction; + propertyBindingMap: any; + + addAction( action: AnimationAction ): void; + removeAllActions(): AnimationMixer; + removeAction( action: AnimationAction ): AnimationMixer; + findActionByName( name: string ): AnimationAction; + play( action: AnimationAction, optionalFadeInDuration?: number ): AnimationMixer; + fadeOut( action: AnimationAction, duration: number ): AnimationMixer; + fadeIn( action: AnimationAction, duration: number ): AnimationMixer; + warp( action: AnimationAction, startTimeScale: NumberKeyframeTrack, endTimeScale: NumberKeyframeTrack, duration: number ): AnimationMixer; + crossFade( fadeOutAction: AnimationAction, fadeInAction: AnimationAction, duration: number, warp: boolean ): AnimationMixer; + update( deltaTime: number ): AnimationMixer; + } + + export var AnimationUtils: { + getEqualsFunc( exemplarValue: any ): boolean; + clone(exemplarValue: T): T; + lerp( a: any, b: any, alpha: number, interTrack: boolean ): any; + lerp_object( a: any, b: any, alpha: number ): any; + slerp_object( a: any, b: any, alpha: number ): any; + lerp_number( a: any, b: any, alpha: number ): any; + lerp_boolean( a: any, b: any, alpha: number ): any; + lerp_boolean_immediate( a: any, b: any, alpha: number ): any; + lerp_string( a: any, b: any, alpha: number ): any; + lerp_string_immediate( a: any, b: any, alpha: number ): any; + getLerpFunc( exemplarValue: any, interTrack: boolean ): Function; + }; + + export class KeyframeTrack { + constructor(name: string, keys: any[]); + + name: string; + keys: any[]; + lastIndex: number; + + getAt( time: number ): any; + shift( timeOffset: number ): KeyframeTrack; + scale( timeScale: number ): KeyframeTrack; + trim( startTime: number, endTime: number ): KeyframeTrack; + validate(): KeyframeTrack; + optimize(): KeyframeTrack; + + keyComparator(key0: KeyframeTrack, key1: KeyframeTrack): number; + parse( json: any ): KeyframeTrack; + GetTrackTypeForTypeName( typeName: string ): any; + } + + export class PropertyBinding { + constructor( rootNode: any, trackName: string ); + + rootNode: any; + trackName: string; + referenceCount: number; + originalValue: any; + directoryName: string; + nodeName: string; + objectName: string; + objectIndex: number; + propertyName: string; + propertyIndex: number; + node: any; + cumulativeValue: number; + cumulativeWeight: number; + + reset(): void; + accumulate( value: any, weight: number ): void; + unbind(): void; + bind(): void; + apply(): void; + parseTrackName( trackName: string ): any; + findNode( root: any, nodeName: string ): any; + } + + export class BooleanKeyframeTrack extends KeyframeTrack { + constructor(name: string, keys: any[]); + + result: any; + + setResult( value: any ): void; + lerpValues( value0: any, value1: any, alpha: number ): any; + compareValues( value0: any, value1: any ): boolean; + clone(): BooleanKeyframeTrack; + parse( json: any ): BooleanKeyframeTrack; + } + + export class ColorKeyframeTrack extends KeyframeTrack { + constructor(name: string, keys: any[]); + + result: any; + + setResult( value: any ): void; + lerpValues( value0: any, value1: any, alpha: number ): any; + compareValues( value0: any, value1: any ): boolean; + clone(): ColorKeyframeTrack; + parse( json: any ): ColorKeyframeTrack; + } + + export class NumberKeyframeTrack { + constructor(); + + result: any; + + setResult( value: any ): void; + lerpValues( value0: any, value1: any, alpha: number ): any; + compareValues( value0: any, value1: any ): boolean; + clone(): NumberKeyframeTrack; + parse( json: any ): NumberKeyframeTrack; + } + + export class QuaternionKeyframeTrack { + constructor(); + + result: any; + + setResult( value: any ): void; + lerpValues( value0: any, value1: any, alpha: number ): any; + compareValues( value0: any, value1: any ): boolean; + clone(): QuaternionKeyframeTrack; + parse( json: any ): QuaternionKeyframeTrack; + } + + export class StringKeyframeTrack { + constructor(); + + result: any; + + setResult( value: any ): void; + lerpValues( value0: any, value1: any, alpha: number ): any; + compareValues( value0: any, value1: any ): boolean; + clone(): StringKeyframeTrack; + parse( json: any ): StringKeyframeTrack; + } + + export class VectorKeyframeTrack { + constructor(); + + result: any; + + setResult( value: any ): void; + lerpValues( value0: any, value1: any, alpha: number ): any; + compareValues( value0: any, value1: any ): boolean; + clone(): VectorKeyframeTrack; + parse( json: any ): VectorKeyframeTrack; + } // Cameras //////////////////////////////////////////////////////////////////////////////////////// @@ -190,7 +401,8 @@ declare module THREE { */ lookAt(vector: Vector3): void; - clone(camera?: Camera): Camera; + clone(): Camera; + copy(camera?: Camera): Camera; } export class CubeCamera extends Object3D { @@ -258,8 +470,9 @@ declare module THREE { * Updates the camera projection matrix. Must be called after change of parameters. */ updateProjectionMatrix(): void; - clone(): OrthographicCamera; + copy( source: OrthographicCamera ): OrthographicCamera; + toJSON( meta?: any ): any; } /** @@ -354,60 +567,36 @@ declare module THREE { */ updateProjectionMatrix(): void; clone(): PerspectiveCamera; + copy( source: PerspectiveCamera ): PerspectiveCamera; + toJSON( meta?: any ): any; } // Core /////////////////////////////////////////////////////////////////////////////////////////////// - /** - * @see src/core/InterleavedBuffer.js - */ - export class InterleavedBuffer { - constructor(array: ArrayLike, stride: number); - array: ArrayLike; - stride: number; - dynamic: boolean; - updateRange: {offset:number, count:number}; - version: number; - length: number; - count: number; - needsUpdate: boolean; - - setDynamic(dynamic: boolean): InterleavedBuffer; - copy(source: InterleavedBuffer): void; - copyAt(index1: number, attribute: InterleavedBufferAttribute, index2: number): InterleavedBuffer; - set(value: ArrayLike, index: number): InterleavedBuffer; - clone(): InterleavedBuffer; - } - - /** - * @see src/core/InstancedInterleavedBuffer.js - */ - export class InstancedInterleavedBuffer extends InterleavedBuffer { - constructor(array: ArrayLike, stride: number, meshPerAttribute?: number); - meshPerAttribute: number; - copy(source: InstancedInterleavedBuffer): InstancedInterleavedBuffer; - } - /** * @see src/core/BufferAttribute.js */ export class BufferAttribute { constructor(array: ArrayLike, itemSize: number); // array parameter should be TypedArray. + uuid: string; array: ArrayLike; itemSize: number; dynamic: boolean; updateRange: {offset:number, count:number}; + version: number; + needsUpdate: boolean; /** Deprecated, use count instead */ length: number; count: number; setDynamic(dynamic: boolean): BufferAttribute; + clone(): BufferAttribute; copy(source: BufferAttribute): BufferAttribute; copyAt(index1: number, attribute: BufferAttribute, index2: number): BufferAttribute; copyArray(array: ArrayLike): BufferAttribute; - copyColorArray(colors: {r:number, g:number, b:number}[]): BufferAttribute; + copyColorsArray(colors: {r:number, g:number, b:number}[]): BufferAttribute; copyIndicesArray(indices: {a:number, b:number, c:number}[]): BufferAttribute; copyVector2sArray(vectors: {x:number, y:number}[]): BufferAttribute; copyVector3sArray(vectors: {x:number, y:number, z:number}[]): BufferAttribute; @@ -429,83 +618,47 @@ declare module THREE { // deprecated (are these actually deprecated?) export class Int8Attribute extends BufferAttribute{ - constructor(data: any, itemSize: number); + constructor(array: any, itemSize: number); } // deprecated export class Uint8Attribute extends BufferAttribute { - constructor(data: any, itemSize: number); + constructor(array: any, itemSize: number); } // deprecated export class Uint8ClampedAttribute extends BufferAttribute { - constructor(data: any, itemSize: number); + constructor(array: any, itemSize: number); } // deprecated export class Int16Attribute extends BufferAttribute { - constructor(data: any, itemSize: number); + constructor(array: any, itemSize: number); } // deprecated export class Uint16Attribute extends BufferAttribute { - constructor(data: any, itemSize: number); + constructor(array: any, itemSize: number); } // deprecated export class Int32Attribute extends BufferAttribute { - constructor(data: any, itemSize: number); + constructor(array: any, itemSize: number); } // deprecated export class Uint32Attribute extends BufferAttribute { - constructor(data: any, itemSize: number); + constructor(array: any, itemSize: number); } // deprecated export class Float32Attribute extends BufferAttribute { - constructor(data: any, itemSize: number); + constructor(array: any, itemSize: number); } // deprecated export class Float64Attribute extends BufferAttribute { - constructor(data: any, itemSize: number); - } - - /** - * @see src/core/InstancedBufferAttribute.js - */ - export class InstancedBufferAttribute extends BufferAttribute { - constructor(data: ArrayLike, itemSize: number, meshPerAttribute?: number); - meshPerAttribute: number; - copy(source: InstancedBufferAttribute): InstancedBufferAttribute; - } - - /** - * @see src/core/InterleavedBufferAttribute.js - */ - export class InterleavedBufferAttribute { - constructor(interleavedBuffer: InterleavedBuffer, itemSize: number, offset: number); - - uuid: string; - data: InterleavedBuffer; - itemSize: number; - offset: number; - /** Deprecated, use count instead */ - length: number; - count: number; - - getX(index: number): number; - setX(index: number, x: number): InterleavedBufferAttribute; - getY(index: number): number; - setY(index: number, y: number): InterleavedBufferAttribute; - getZ(index: number): number; - setZ(index: number, z: number): InterleavedBufferAttribute; - getW(index: number): number; - setW(index: number, z: number): InterleavedBufferAttribute; - setXY(index: number, x: number, y: number): InterleavedBufferAttribute; - setXYZ(index: number, x: number, y: number, z: number): InterleavedBufferAttribute; - setXYZW(index: number, x: number, y: number, z: number, w: number): InterleavedBufferAttribute; + constructor(array: any, itemSize: number); } /** @@ -530,30 +683,39 @@ declare module THREE { uuid: string; name: string; type: string; + index: BufferAttribute; attributes: BufferAttribute|InterleavedBufferAttribute[]; - attributesKeys: string[]; - /** Deprecated. Use groups instead. */ - drawcalls: { start: number; count: number; index: number; }[]; - /** Deprecated. Use groups instead. */ - offsets: { start: number; count: number; index: number; }[]; - groups: {start: number, count: number, materialIndex?: number}[] + morphAttributes: any; + groups: {start: number, count: number, materialIndex?: number}[]; boundingBox: Box3; boundingSphere: BoundingSphere; + drawRange: { start: number, count: number }; + + /** Deprecated. */ + addIndex( index: BufferAttribute ): void; + + getIndex(): BufferAttribute; + setIndex( index: BufferAttribute ): void; + /** Deprecated. This overloaded method is deprecated. */ addAttribute(name: string, array: any, itemSize: number): any; addAttribute(name: string, attribute: BufferAttribute|InterleavedBufferAttribute): void; getAttribute(name: string): BufferAttribute|InterleavedBufferAttribute; removeAttribute(name: string): void; - setIndex(index: BufferAttribute): void; - getIndex(): BufferAttribute; + /** Deprecated. */ + drawcalls(): any; + /** Deprecated. */ + offsets(): any; /** Deprecated. Use addGroup */ - addDrawCall(start: number, count: number, index: number): void; + addDrawCall(start: number, count: number, index?: number): void; + /** Deprecated. */ + clearDrawCalls(): void; addGroup(start: number, count: number, materialIndex?: number): void; clearGroups(): void; - setDrawRange(start:number, count:number): void; + setDrawRange(start: number, count: number): void; /** * Bakes matrix transform directly into vertex coordinates. @@ -563,9 +725,9 @@ declare module THREE { rotateX(angle: number): BufferGeometry; rotateY(angle: number): BufferGeometry; rotateZ(angle: number): BufferGeometry; - translate(x:number, y:number, z:number): BufferGeometry; - scale(x:number, y:number, z:number): BufferGeometry; - lookAt(v:Vector3): void; + translate(x: number, y: number, z: number): BufferGeometry; + scale(x: number, y: number, z: number): BufferGeometry; + lookAt(v: Vector3): void; center(): Vector3; @@ -574,6 +736,8 @@ declare module THREE { fromGeometry(geometry: Geometry, settings?: any): BufferGeometry; + fromDirectGeometry( geometry: DirectGeometry ): BufferGeometry; + /** * Computes bounding box of the geometry, updating Geometry.boundingBox attribute. * Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are null. @@ -594,19 +758,12 @@ declare module THREE { */ computeVertexNormals(): void; - /** - * Computes vertex tangents. - * Based on http://www.terathon.com/code/tangent.html - * Geometry must have vertex UVs (layer 0 will be used). - */ - computeTangents(): void; - computeOffsets(size: number): void; merge(geometry: BufferGeometry, offset: number): BufferGeometry; normalizeNormals(): void; - reorderBuffers(indexBuffer: number, indexMap: number[], vertexCount: number): void; toJSON(): any; clone(): BufferGeometry; + copy(source: BufferGeometry): BufferGeometry; /** * Disposes the object from memory. @@ -622,47 +779,15 @@ declare module THREE { dispatchEvent(event: { type: string; target: any; }): void; } - /** - * @see src/core/InstancedBufferGeometry.js - */ - export class InstancedBufferGeometry extends BufferGeometry { + export class Channels { constructor(); - groups: {start:number, count:number, instances:number}[]; - addGroup(start: number, count: number, instances: number): void; - copy(source: InstancedBufferGeometry): InstancedBufferGeometry; - } - /** - * @see src/core/DirectGeometry.js - */ - export class DirectGeometry { - constructor(); - id: number; - uuid: string; - name: string; - type: string; - indices: number[]; - vertices: Vector3[]; - normals: Vector3[]; - colors: Color[]; - uvs: Vector2[]; - uvs2: Vector2[]; - groups: {start: number, materialIndex: number}[]; - morphTargets: MorphTarget[]; - skinWeights: number[]; - skinIndices: number[]; - boundingBox: Box3; - boundingSphere: BoundingSphere; - verticesNeedUpdate: boolean; - normalsNeedUpdate: boolean; - colorsNeedUpdate: boolean; - uvsNeedUpdate: boolean; - groupsNeedUpdate: boolean; - computeBoundingBox(): void; - computeBoundingSphere(): void; - computeGroups(geometry: Geometry): void; - fromGeometry(geometry: Geometry): DirectGeometry; - dispose(): void; + mask: number; + + set( channel: number ): void; + enable( channel: number ): void; + toggle( channel: number ): void; + disable( channel: number ): void; } /** @@ -726,17 +851,44 @@ declare module THREE { } /** - * Deprecated. Use new THREE.BufferAttribute().setDynamic(true) instead. + * @see src/core/DirectGeometry.js */ - export class DynamicBufferAttribute extends BufferAttribute{ - constructor(array: any, itemSize: number); + export class DirectGeometry { + constructor(); - updateRange: { - offset: number; - count: number; - } + id: number; + uuid: string; + name: string; + type: string; + indices: number[]; + vertices: Vector3[]; + normals: Vector3[]; + colors: Color[]; + uvs: Vector2[]; + uvs2: Vector2[]; + groups: {start: number, materialIndex: number}[]; + morphTargets: MorphTarget[]; + skinWeights: number[]; + skinIndices: number[]; + boundingBox: Box3; + boundingSphere: BoundingSphere; + verticesNeedUpdate: boolean; + normalsNeedUpdate: boolean; + colorsNeedUpdate: boolean; + uvsNeedUpdate: boolean; + groupsNeedUpdate: boolean; - clone(): DynamicBufferAttribute; + computeBoundingBox(): void; + computeBoundingSphere(): void; + computeGroups(geometry: Geometry): void; + fromGeometry(geometry: Geometry): DirectGeometry; + dispose(): void; + + // EventDispatcher mixins + addEventListener(type: string, listener: (event: any) => void ): void; + hasEventListener(type: string, listener: (event: any) => void): void; + removeEventListener(type: string, listener: (event: any) => void): void; + dispatchEvent(event: { type: string; target: any; }): void; } /** @@ -889,7 +1041,6 @@ declare module THREE { radius: number; } - /** * Base class for geometries * @@ -957,13 +1108,6 @@ declare module THREE { */ morphTargets: MorphTarget[]; - /** - * Array of morph colors. Morph colors have similar structure as morph targets, each color set is a Javascript object: - * - * morphColor = { name: "colorName", colors: [ new THREE.Color(), ... ] } - */ - morphColors: MorphColor[]; - /** * Array of morph normals. Morph normals have similar structure as morph targets, each normal set is a Javascript object: * @@ -996,18 +1140,6 @@ declare module THREE { */ boundingSphere: BoundingSphere; - /** - * True if geometry has tangents. Set in Geometry.computeTangents. - */ - hasTangents: boolean; - - /** - * Set to true if attribute buffers will need to change in runtime (using "dirty" flags). - * Unless set to true internal typed arrays corresponding to buffers will be deleted once sent to GPU. - * Defaults to true. - */ - dynamic: boolean; - /** * Set to true if the vertices array has been updated. */ @@ -1028,11 +1160,6 @@ declare module THREE { */ normalsNeedUpdate: boolean; - /** - * Set to true if the tangents in the faces has been updated. - */ - tangentsNeedUpdate: boolean; - /** * Set to true if the colors array has been updated. */ @@ -1053,6 +1180,15 @@ declare module THREE { */ applyMatrix(matrix: Matrix4): void; + rotateX(angle: number): Geometry; + rotateY(angle: number): Geometry; + rotateZ(angle: number): Geometry; + + translate(x: number, y: number, z: number): Geometry; + scale(x: number, y: number, z: number): Geometry; + lookAt( vector: Vector3 ): void; + + fromBufferGeometry(geometry: BufferGeometry): Geometry; /** @@ -1060,6 +1196,8 @@ declare module THREE { */ center(): Vector3; + normalize(): Geometry; + /** * Computes face normals. */ @@ -1076,13 +1214,6 @@ declare module THREE { */ computeMorphNormals(): void; - /** - * Computes vertex tangents. - * Based on http://www.terathon.com/code/tangent.html - * Geometry must have vertex UVs (layer 0 will be used). - */ - computeTangents(): void; - computeLineDistances(): void; /** @@ -1106,6 +1237,8 @@ declare module THREE { */ mergeVertices(): number; + sortFacesByMaterialIndex(): void; + toJSON(): any; /** @@ -1113,6 +1246,8 @@ declare module THREE { */ clone(): Geometry; + copy(source: Geometry): Geometry; + /** * Removes The object from memory. * Don't forget to call this method when you remove an geometry because it can cuase meomory leaks. @@ -1122,8 +1257,8 @@ declare module THREE { //These properties do not exist in a normal Geometry class, but if you use the instance that was passed by JSONLoader, it will be added. bones: Bone[]; - animation: AnimationData; - animations: AnimationData[]; + animation: AnimationClip; + animations: AnimationClip[]; // EventDispatcher mixins addEventListener(type: string, listener: (event: any) => void ): void; @@ -1132,6 +1267,89 @@ declare module THREE { dispatchEvent(event: { type: string; target: any; }): void; } + /** + * @see src/core/InstancedBufferAttribute.js + */ + export class InstancedBufferAttribute extends BufferAttribute { + constructor(data: ArrayLike, itemSize: number, meshPerAttribute?: number); + meshPerAttribute: number; + + clone(): InstancedBufferAttribute; + copy(source: InstancedBufferAttribute): InstancedBufferAttribute; + } + + /** + * @see src/core/InstancedBufferGeometry.js + */ + export class InstancedBufferGeometry extends BufferGeometry { + constructor(); + groups: {start:number, count:number, instances:number}[]; + addGroup(start: number, count: number, instances: number): void; + + clone(): InstancedBufferGeometry; + copy(source: InstancedBufferGeometry): InstancedBufferGeometry; + } + + /** + * @see src/core/InstancedInterleavedBuffer.js + */ + export class InstancedInterleavedBuffer extends InterleavedBuffer { + constructor(array: ArrayLike, stride: number, meshPerAttribute?: number); + meshPerAttribute: number; + + clone(): InstancedInterleavedBuffer; + copy(source: InstancedInterleavedBuffer): InstancedInterleavedBuffer; + } + + /** + * @see src/core/InterleavedBuffer.js + */ + export class InterleavedBuffer { + constructor(array: ArrayLike, stride: number); + array: ArrayLike; + stride: number; + dynamic: boolean; + updateRange: {offset:number, count:number}; + version: number; + length: number; + count: number; + needsUpdate: boolean; + + setDynamic(dynamic: boolean): InterleavedBuffer; + clone(): InterleavedBuffer; + copy(source: InterleavedBuffer): InterleavedBuffer; + copyAt(index1: number, attribute: InterleavedBufferAttribute, index2: number): InterleavedBuffer; + set(value: ArrayLike, index: number): InterleavedBuffer; + clone(): InterleavedBuffer; + } + + /** + * @see src/core/InterleavedBufferAttribute.js + */ + export class InterleavedBufferAttribute { + constructor(interleavedBuffer: InterleavedBuffer, itemSize: number, offset: number); + + uuid: string; + data: InterleavedBuffer; + itemSize: number; + offset: number; + /** Deprecated, use count instead */ + length: number; + count: number; + + getX(index: number): number; + setX(index: number, x: number): InterleavedBufferAttribute; + getY(index: number): number; + setY(index: number, y: number): InterleavedBufferAttribute; + getZ(index: number): number; + setZ(index: number, z: number): InterleavedBufferAttribute; + getW(index: number): number; + setW(index: number, z: number): InterleavedBufferAttribute; + setXY(index: number, x: number, y: number): InterleavedBufferAttribute; + setXYZ(index: number, x: number, y: number, z: number): InterleavedBufferAttribute; + setXYZW(index: number, x: number, y: number, z: number, w: number): InterleavedBufferAttribute; + } + /** * Base class for scene graph objects */ @@ -1160,6 +1378,8 @@ declare module THREE { */ parent: Object3D; + channels: Channels; + /** * Array with object's children. */ @@ -1190,6 +1410,10 @@ declare module THREE { */ scale: Vector3; + modelViewMatrix: { value: Matrix4 }; + + normalMatrix: { value: Matrix3 }; + /** * When this is set, then the rotationMatrix gets calculated every frame. */ @@ -1246,14 +1470,7 @@ declare module THREE { * */ static DefaultUp: Vector3; - - - /** - * Order of axis for Euler angles. - */ - // deprecated - eulerOrder: string; - + static DefaultMatrixAutoUpdate: Vector3; /** * This updates the position, rotation and scale with the matrix. @@ -1387,11 +1604,8 @@ declare module THREE { getWorldScale(optionalTarget?: Vector3): Vector3; getWorldDirection(optionalTarget?: Vector3): Vector3; - /** - * Translates object along arbitrary axis by distance. - * @param distance Distance. - * @param axis Translation direction. - */ + raycast(raycaster: Raycaster, intersects: any): void; + traverse(callback: (object: Object3D) => any): void; traverseVisible(callback: (object: Object3D) => any): void; @@ -1408,14 +1622,16 @@ declare module THREE { */ updateMatrixWorld(force: boolean): void; - toJSON(): any; + toJSON(meta?: any): any; + + clone(recursive?: boolean): Object3D; /** * * @param object * @param recursive */ - clone(object?: Object3D, recursive?: boolean): Object3D; + copy(source: Object3D, recursive?: boolean): Object3D; // EventDispatcher mixins addEventListener(type: string, listener: (event: any) => void ): void; @@ -1433,11 +1649,11 @@ declare module THREE { } export interface RaycasterParameters { - Sprite?: any; Mesh?: any; - PointCloud?: any; - LOD?: any; Line?: any; + LOD?: any; + Points?: any; + Sprite?: any; } export class Raycaster { @@ -1464,8 +1680,37 @@ declare module THREE { constructor(hex?: number); color: Color; + receiveShadow: boolean; - clone(light?: Light): Light; + shadowCameraFov: number; + shadowCameraLeft: number; + shadowCameraRight: number; + shadowCameraTop: number; + shadowCameraBottom: number; + shadowCameraNear: number; + shadowCameraFar: number; + shadowBias: number; + shadowDarkness: number; + shadowMapWidth: number; + shadowMapHeight: number; + + clone(recursive?: boolean): Light; + copy( source: Light ): Light; + toJSON( meta: any ): any; + } + + export class LightShadow { + constructor(camera: Camera); + + camera: Camera; + bias: number; + darkness: number; + mapSize: Vector2; + map: RenderTarget; + matrix: Matrix4; + + copy(source: LightShadow): void; + clone(): LightShadow; } /** @@ -1484,21 +1729,8 @@ declare module THREE { */ constructor(hex?: number); - clone(): AmbientLight; - } - - export class AreaLight extends Light{ - constructor(hex: number, intensity?: number); - - normal: Vector3; - right: Vector3; - intensity: number; - width: number; - height: number; - constantAttenuation: number; - linearAttenuation: number; - quadraticAttenuation: number; - + clone(recursive?: boolean): AmbientLight; + copy(source: AmbientLight): AmbientLight; } /** @@ -1527,150 +1759,10 @@ declare module THREE { */ intensity: number; - /** - * If set to true light will cast dynamic shadows. Warning: This is expensive and requires tweaking to get shadows looking right. - * Default — false. - */ - castShadow: boolean; + shadow: LightShadow; - /** - * If set to true light will only cast shadow but not contribute any lighting (as if intensity was 0 but cheaper to compute). - * Default — false. - */ - onlyShadow: boolean; - - /** - * Orthographic shadow camera frustum parameter. - * Default — 50. - */ - shadowCameraNear: number; - - /** - * Orthographic shadow camera frustum parameter. - * Default — 5000. - */ - shadowCameraFar: number; - - /** - * Orthographic shadow camera frustum parameter. - * Default — -500. - */ - shadowCameraLeft: number; - - /** - * Orthographic shadow camera frustum parameter. - * Default — 500. - */ - shadowCameraRight: number; - - /** - * Orthographic shadow camera frustum parameter. - * Default — 500. - */ - shadowCameraTop: number; - - /** - * Orthographic shadow camera frustum parameter. - * Default — -500. - */ - shadowCameraBottom: number; - - /** - * Show debug shadow camera frustum. - * Default — false. - */ - shadowCameraVisible: boolean; - - /** - * Shadow map bias. - * Default — 0. - */ - shadowBias: number; - - /** - * Darkness of shadow casted by this light (from 0 to 1). - * Default — 0.5. - */ - shadowDarkness: number; - - /** - * Shadow map texture width in pixels. - * Default — 512. - */ - shadowMapWidth: number; - - /** - * Shadow map texture height in pixels. - * Default — 512. - */ - shadowMapHeight: number; - - /** - * Default — false. - */ - shadowCascade: boolean; - - /** - * Three.Vector3( 0, 0, -1000 ). - */ - shadowCascadeOffset: Vector3; - - /** - * Default — 2. - */ - shadowCascadeCount: number; - - /** - * Default — [ 0, 0, 0 ]. - */ - shadowCascadeBias: number[]; - - /** - * Default — [ 512, 512, 512 ]. - */ - shadowCascadeWidth: number[]; - - /** - * Default — [ 512, 512, 512 ]. - */ - shadowCascadeHeight: number[]; - - /** - * Default — [ -1.000, 0.990, 0.998 ]. - */ - shadowCascadeNearZ: number[]; - - /** - * Default — [ 0.990, 0.998, 1.000 ]. - */ - shadowCascadeFarZ: number[]; - - /** - * Default — [ ]. - */ - shadowCascadeArray: DirectionalLight[]; - - /** - * Default — null. - */ - shadowMap: RenderTarget; - - /** - * Default — null. - */ - shadowMapSize: number; - - /** - * Default — null. - */ - shadowCamera: Camera; - - /** - * Default — null. - */ - shadowMatrix: Matrix4; - - clone(): DirectionalLight; + clone(recursive?: boolean): DirectionalLight; + copy(source: DirectionalLight): DirectionalLight; } export class HemisphereLight extends Light { @@ -1679,7 +1771,8 @@ declare module THREE { groundColor: Color; intensity: number; - clone(): HemisphereLight; + clone(recursive?: boolean): HemisphereLight; + copy(source: HemisphereLight): HemisphereLight; } /** @@ -1707,23 +1800,14 @@ declare module THREE { decay: number; - clone(): PointLight; + shadow: LightShadow; + + clone(recursive?: boolean): PointLight; + copy(source: PointLight): PointLight; } /** * A point light that can cast shadow in one direction. - * - * @example - * // white spotlight shining from the side, casting shadow - * var spotLight = new THREE.SpotLight( 0xffffff ); - * spotLight.position.set( 100, 1000, 100 ); - * spotLight.castShadow = true; - * spotLight.shadowMapWidth = 1024; - * spotLight.shadowMapHeight = 1024; - * spotLight.shadowCameraNear = 500; - * spotLight.shadowCameraFar = 4000; - * spotLight.shadowCameraFov = 30; - * scene.add( spotLight ); */ export class SpotLight extends Light { constructor(hex?: number, intensity?: number, distance?: number, angle?: number, exponent?: number, decay?: number); @@ -1760,72 +1844,10 @@ declare module THREE { decay: number; - /** - * If set to true light will cast dynamic shadows. Warning: This is expensive and requires tweaking to get shadows looking right. - * Default — false. - */ - castShadow: boolean; + shadow: LightShadow; - /** - * If set to true light will only cast shadow but not contribute any lighting (as if intensity was 0 but cheaper to compute). - * Default — false. - */ - onlyShadow: boolean; - - /** - * Perspective shadow camera frustum near parameter. - * Default — 50. - */ - shadowCameraNear: number; - - /** - * Perspective shadow camera frustum far parameter. - * Default — 5000. - */ - shadowCameraFar: number; - - /** - * Perspective shadow camera frustum field of view parameter. - * Default — 50. - */ - shadowCameraFov: number; - - /** - * Show debug shadow camera frustum. - * Default — false. - */ - shadowCameraVisible: boolean; - - /** - * Shadow map bias. - * Default — 0. - */ - shadowBias: number; - - /** - * Darkness of shadow casted by this light (from 0 to 1). - * Default — 0.5. - */ - shadowDarkness: number; - - /** - * Shadow map texture width in pixels. - * Default — 512. - */ - shadowMapWidth: number; - - /** - * Shadow map texture height in pixels. - * Default — 512. - */ - shadowMapHeight: number; - - shadowMap: RenderTarget; - shadowMapSize: Vector2; - shadowCamera: Camera; - shadowMatrix: Matrix4; - - clone(): SpotLight; + clone(recursive?: boolean): SpotLight; + copy(source: PointLight): SpotLight; } // Loaders ////////////////////////////////////////////////////////////////////////////////// @@ -1849,19 +1871,7 @@ declare module THREE { * message — error message */ export class Loader { - constructor(showStatus?: boolean); - - /** - * If true, show loading status in the statusDomElement. - */ - showStatus: boolean; - - /** - * This is the recipient of status messages. - */ - statusDomElement: HTMLElement; - - imageLoader: ImageLoader; + constructor(); /** * Will be called when load starts. @@ -1887,14 +1897,11 @@ declare module THREE { */ crossOrigin: string; - addStatusElement(): HTMLElement; - updateProgress(progress: Progress): void; extractUrlBase(url: string): string; initMaterials(materials: Material[], texturePath: string): Material[]; - needsTangents(materials: Material[]): boolean; - createMaterial(m: Material, texturePath: string): boolean; + createMaterial(m: Material, texturePath: string, crossOrigin?: string): boolean; - static Handlers:LoaderHandler; + static Handlers: LoaderHandler; } export interface LoaderHandler{ @@ -1903,10 +1910,21 @@ declare module THREE { get(file: string):Loader; } - export class BinaryTextureLoader { - constructor(); + export class AnimationLoader { + constructor(manager?: LoadingManager); + manager: LoadingManager; + load(url: string, onLoad: (animations: AnimationClip[]) => void, onProgress?: (event: any) => void, onError?: (event: any) => void): void; + setCrossOrigin(crossOrigin: string): void; + parse(json: any, onLoad: (animations: AnimationClip[])=>void): void; + } + + export class BinaryTextureLoader { + constructor(manager?: LoadingManager); + + manager: LoadingManager; load(url: string, onLoad: (dataTexture: DataTexture) => void, onProgress?: (event: any) => void, onError?: (event: any) => void): void; + setCrossOrigin(crossOrigin: string): void; } export class BufferGeometryLoader { @@ -1918,7 +1936,8 @@ declare module THREE { parse(json: any): BufferGeometry; } - export interface Cache{ + export interface Cache { + enabled: boolean; files: any[]; add(key: string, file: any): void; @@ -1926,26 +1945,25 @@ declare module THREE { remove(key: string): void; clear(): void; } - export var Cache:Cache; + export var Cache: Cache; export class CompressedTextureLoader{ - constructor(); + constructor(manager?: LoadingManager); - load(url: string, onLoad: (bufferGeometry: BufferGeometry) => void, onError?: (event: any) => void): void; + manager: LoadingManager; + load(url: string, onLoad: (texture: CompressedTexture) => void, onProgress?: (event: any) => void, onError?: (event: any) => void): void; + setCrossOrigin(crossOrigin: string): void; } - export class DataTextureLoader extends BinaryTextureLoader { - // alias for BinaryTextureLoader. + export class CubeTextureLoader { + constructor(manager?: LoadingManager); + + manager: LoadingManager; + load(url: string, onLoad: (texture: CubeTexture) => void, onProgress?: (event: any) => void, onError?: (event: any) => void): void; + setCrossOrigin(crossOrigin: string): void; + } - /* - * GeometryLoader class is experimental, and it is not yet included in the compiled source code. - * - export class GeometryLoader { - - } - */ - /** * A loader for loading an image. * Unlike other loaders, this one emits events instead of using predefined callbacks. So if you're interested in getting notified when things happen, you need to add listeners to the object. @@ -1970,19 +1988,14 @@ declare module THREE { * A loader for loading objects in JSON format. */ export class JSONLoader extends Loader { - constructor(showStatus?: boolean); - + constructor(manager?: LoadingManager); + manager: LoadingManager; withCredentials: boolean; - /** - * @param url - * @param callback. This function will be called with the loaded model as an instance of geometry when the load is completed. - * @param texturePath If not specified, textures will be assumed to be in the same folder as the Javascript model file. - */ - load(url: string, callback: (geometry: Geometry, materials: Material[]) => void , texturePath?: string): void; - - loadAjaxJSON(context: JSONLoader, url: string, callback: (geometry: Geometry, materials: Material[]) => void , texturePath?: string, callbackProgress?: (progress: Progress) => void ): void; + load(url: string, onLoad?: (geometry: Geometry, materials: Material[]) => void, onProgress?: (event: any) => void, onError?: (event: any) => void): void; + setCrossOrigin(crossOrigin: string): void; + setTexturePath( value: string ): void; parse(json: any, texturePath?: string): { geometry: Geometry; materials?: Material[] }; } @@ -1992,6 +2005,8 @@ declare module THREE { export class LoadingManager { constructor(onLoad?: () => void, onProgress?: (url: string, loaded: number, total: number) => void, onError?: () => void); + onStart: () => void; + /** * Will be called when load starts. * The default is a function with empty body. @@ -2002,7 +2017,7 @@ declare module THREE { * Will be called while load progresses. * The default is a function with empty body. */ - onProgress: (item:any, loaded:number, total:number) => void; + onProgress: (item: any, loaded: number, total: number) => void; /** * Will be called when each element in the scene completes loading. @@ -2012,16 +2027,19 @@ declare module THREE { itemStart(url: string): void; itemEnd(url: string): void; - + itemError(url: string): void; } export class MaterialLoader { constructor(manager?: LoadingManager); manager: LoadingManager; + textures: { [key:string]:Texture }; load(url: string, onLoad: (material: Material) => void): void; setCrossOrigin(crossOrigin: string): void; + setTextures(textures: { [key:string]:Texture }): void; + getTexture( name: string ):Texture; parse(json: any): Material; } @@ -2058,7 +2076,7 @@ declare module THREE { * * @param url */ - load(url: string, onLoad: (texture: Texture) => void): void; + load(url: string, onLoad: (texture: Texture) => void): Texture; setCrossOrigin(crossOrigin: string): void; } @@ -2070,9 +2088,10 @@ declare module THREE { responseType: string; crossOrigin: string; - load(url: string, onLoad?: (responseText: string) => void, onProgress?: (event: any) => void, onError?: (event: any) => void): void; + load(url: string, onLoad?: (responseText: string) => void, onProgress?: (event: any) => void, onError?: (event: any) => void): any; setResponseType(responseType: string): void; setCrossOrigin(crossOrigin: string): void; + setWithCredentials( withCredentials: string ): void; } // Materials ////////////////////////////////////////////////////////////////////////////////// @@ -2157,6 +2176,8 @@ declare module THREE { blendDstAlpha: number; blendEquationAlpha: number; + depthFunc: DepthModes; + /** * Whether to have depth test enabled when rendering this material. Default is true. */ @@ -2170,6 +2191,8 @@ declare module THREE { colorWrite: boolean; + precision: any; + /** * Whether to use polygon offset. Default is false. This corresponds to the POLYGON_OFFSET_FILL WebGL feature. */ @@ -2207,8 +2230,9 @@ declare module THREE { needsUpdate: boolean; setValues(values: Object): void; - toJSON(): any; - clone(material?:Material): Material; + toJSON(meta?: any): any; + clone(): Material; + clone(source?:Material): Material; update(): void; dispose(): void; @@ -2239,6 +2263,7 @@ declare module THREE { fog: boolean; clone(): LineBasicMaterial; + copy(source: LineBasicMaterial): LineBasicMaterial; } export interface LineDashedMaterialParameters extends MaterialParameters { @@ -2263,6 +2288,7 @@ declare module THREE { fog: boolean; clone(): LineDashedMaterial; + copy(source: LineDashedMaterial): LineDashedMaterial; } /** @@ -2270,23 +2296,26 @@ declare module THREE { */ export interface MeshBasicMaterialParameters extends MaterialParameters{ color?: number; + opacity?: number; map?: Texture; - lightMap?: Texture; + aoMap?: Texture; + aoMapIntensity?: number; specularMap?: Texture; alphaMap?: Texture; envMap?: Texture; combine?: Combine; reflectivity?: number; refractionRatio?: number; - fog?: boolean; shading?: Shading; + blending?: Blending; + depthTest?: boolean; + depthWrite?: boolean; wireframe?: boolean; wireframeLinewidth?: number; - wireframeLinecap?: string; - wireframeLinejoin?: string; vertexColors?: Colors; skinning?: boolean; morphTargets?: boolean; + fog?: boolean; } export class MeshBasicMaterial extends Material { @@ -2294,7 +2323,8 @@ declare module THREE { color: Color; map: Texture; - lightMap: Texture; + aoMap: Texture; + aoMapIntensity: number; specularMap: Texture; alphaMap: Texture; envMap: Texture; @@ -2312,6 +2342,7 @@ declare module THREE { morphTargets: boolean; clone(): MeshBasicMaterial; + copy(source: MeshBasicMaterial): MeshBasicMaterial; } export interface MeshDepthMaterialParameters extends MaterialParameters{ @@ -2326,25 +2357,14 @@ declare module THREE { wireframeLinewidth: number; clone(): MeshDepthMaterial; - } - - // MeshFaceMaterial does not inherit the Material class in the original code. However, it should treat as Material class. - // See tests/canvas/canvas_materials.ts. - export class MeshFaceMaterial extends Material { - constructor(materials?: Material[]); - materials: Material[]; - - toJSON(): any; - clone(): MeshFaceMaterial; + copy(source: MeshDepthMaterial): MeshDepthMaterial; } export interface MeshLambertMaterialParameters extends MaterialParameters{ color?: number; emissive?: number; - wrapAround?: boolean; - wrapRGB?: Vector3; + opacity?: number; map?: Texture; - lightMap?: Texture; specularMap?: Texture; alphaMap?: Texture; envMap?: Texture; @@ -2352,11 +2372,8 @@ declare module THREE { reflectivity?: number; refractionRatio?: number; fog?: boolean; - shading?: Shading; wireframe?: boolean; wireframeLinewidth?: number; - wireframeLinecap?: string; - wireframeLinejoin?: string; vertexColors?: Colors; skinning?: boolean; morphTargets?: boolean; @@ -2365,12 +2382,10 @@ declare module THREE { export class MeshLambertMaterial extends Material { constructor(parameters?: MeshLambertMaterialParameters); + color: Color; emissive: Color; - wrapAround: boolean; - wrapRGB: Vector3; map: Texture; - lightMap: Texture; specularMap: Texture; alphaMap: Texture; envMap: Texture; @@ -2378,7 +2393,6 @@ declare module THREE { reflectivity: number; refractionRatio: number; fog: boolean; - shading: Shading; wireframe: boolean; wireframeLinewidth: number; wireframeLinecap: string; @@ -2389,39 +2403,21 @@ declare module THREE { morphNormals: boolean; clone(): MeshLambertMaterial; + copy(source: MeshLambertMaterial): MeshLambertMaterial; } export interface MeshNormalMaterialParameters extends MaterialParameters{ - /** Line color in hexadecimal. Default is 0xffffff. */ - color?: number; - /** Sets the texture map. Default is null */ - map?: Texture; - /** Set light map. Default is null. */ - lightMap?: Texture; - /** Set specular map. Default is null. */ - specularMap?: Texture; - /** Set alpha map. Default is null. */ - alphaMap?: Texture; - /** Set env map. Default is null. */ - envMap?: Texture; - /** Define whether the material color is affected by global fog settings. Default is false. */ - fog?: boolean; - /** How the triangles of a curved surface are rendered. Default is THREE.SmoothShading. */ + opacity?: number; shading?: Shading; + blending?: Blending; + depthTest?: boolean; + depthWrite?: boolean; + /** Render geometry as wireframe. Default is false (i.e. render as smooth shaded). */ wireframe?: boolean; /** Controls wireframe thickness. Default is 1. */ wireframeLinewidth?: number; - /** Define appearance of line ends. Default is 'round'. */ - wireframeLinecap?: string; - /** Define appearance of line joints. Default is 'round'. */ - wireframeLinejoin?: string; - /** Define how the vertices gets colored. Default is THREE.NoColors. */ - vertexColors?: Colors; - /** Define whether the material uses skinning. Default is false. */ - skinning?: boolean; - /** Define whether the material uses morphTargets. Default is false. */ - morphTargets?: boolean; + } export class MeshNormalMaterial extends Material { @@ -2432,55 +2428,46 @@ declare module THREE { morphTargets: boolean; clone(): MeshNormalMaterial; + copy(source: MeshNormalMaterial): MeshNormalMaterial; } export interface MeshPhongMaterialParameters extends MaterialParameters { /** geometry color in hexadecimal. Default is 0xffffff. */ color?: number; - /** Sets the texture map. Default is null */ - map?: Texture; - /** Set light map. Default is null */ - lightMap?: Texture; - /** Set specular map. Default is null */ - specularMap?: Texture; - /** Set alpha map. Default is null */ - alphaMap?: Texture; - /** Set env map. Default is null */ - envMap?: Texture; - /** Define whether the material color is affected by global fog settings. Default is true */ - fog?: boolean; - /** Define shading type. Default is THREE.SmoothShading */ - shading?: Shading; - /** render geometry as wireframe. Default is false */ - wireframe?: string; - /** Line thickness. Default is 1. */ - wireframeLinewidth?: number; - /** Define appearance of line ends. Default is 'round' */ - wireframeLinecap?: string; - /** Define appearance of line joints. Default is 'round'. */ - wireframeLinejoin?: string; - /** Define how the vertices gets colored. Default is THREE.NoColors. */ - vertexColors?: Colors; - /** Define whether the material uses skinning. Default is false. */ - skinning?: boolean; - - /** Define whether the material uses morphTargets. Default is false. */ - morphTargets?: boolean; - emissive?: number; specular?: number; shininess?: number; - metal?: boolean; - wrapAround?: boolean; - wrapRGB?: Vector3; + opacity?: number; + map?: Texture; + lightMap?: Texture; + lightMapIntensity?: number; + aoMap?: Texture; + aoMapIntensity?: number; + emissiveMap?: Texture; bumpMap?: Texture; bumpScale?: number; normalMap?: Texture; normalScale?: Vector2; + displacementMap?: Texture; + displacementScale?: number; + displacementBias?: number; + specularMap?: Texture; + alphaMap?: Texture; + envMap?: Texture; combine?: Combine; reflectivity?: number; refractionRatio?: number; + shading?: Shading; + blending?: Blending; + depthTest?: boolean; + depthWrite?: boolean; + wireframe?: string; + wireframeLinewidth?: number; + vertexColors?: Colors; + skinning?: boolean; + morphTargets?: boolean; morphNormals?: boolean; + fog?: boolean; } export class MeshPhongMaterial extends Material { @@ -2491,14 +2478,19 @@ declare module THREE { specular: Color; shininess: number; metal: boolean; - wrapAround: boolean; - wrapRGB: Vector3; map: Texture; lightMap: Texture; + lightMapIntensity: number; + aoMap: Texture; + aoMapIntensity: number; + emissiveMap: Texture; bumpMap: Texture; bumpScale: number; normalMap: Texture; normalScale: Vector2; + displacementMap: Texture; + displacementScale: number; + displacementBias: number; specularMap: Texture; alphaMap: Texture; envMap: Texture; @@ -2517,19 +2509,39 @@ declare module THREE { morphNormals: boolean; clone(): MeshPhongMaterial; + copy(source: MeshPhongMaterial): MeshPhongMaterial; } - export interface PointCloudMaterialParameters extends MaterialParameters{ + // MultiMaterial does not inherit the Material class in the original code. However, it should treat as Material class. + // See tests/canvas/canvas_materials.ts. + export class MultiMaterial extends Material { + constructor(materials?: Material[]); + materials: Material[]; + + toJSON(): any; + clone(): MultiMaterial; + } + + // deprecated + export class MeshFaceMaterial extends MultiMaterial { + + } + + export interface PointsMaterialParameters extends MaterialParameters{ color?: number; + opacity?: number; map?: Texture; size?: number; sizeAttenuation?: boolean; + blending?: Blending, + depthTest?: boolean; + depthWrite?: boolean; vertexColors?: Colors; fog?: boolean; } - export class PointCloudMaterial extends Material { - constructor(parameters?: PointCloudMaterialParameters); + export class PointsMaterial extends Material { + constructor(parameters?: PointsMaterialParameters); color: Color; map: Texture; @@ -2538,40 +2550,31 @@ declare module THREE { vertexColors: boolean; fog: boolean; - clone(): PointCloudMaterial; - } - - // deprecated - export class ParticleBasicMaterial extends PointCloudMaterial{ - - } - - // deprecated - export class ParticleSystemMaterial extends PointCloudMaterial{ - + clone(): PointsMaterial; + copy(source: PointsMaterial): PointsMaterial; } export class RawShaderMaterial extends ShaderMaterial { constructor(parameters?: ShaderMaterialParameters); - } - export interface ShaderMaterialParameters extends MaterialParameters{ + export interface ShaderMaterialParameters extends MaterialParameters { defines?: any; uniforms?: any; - attributes?: any; - vertexShader?: string; fragmentShader?: string; + vertexShader?: string; shading?: Shading; - linewidth?: number; + blending?: Blending; + depthTest?: boolean; + depthWrite?: boolean; wireframe?: boolean; wireframeLinewidth?: number; - fog?: boolean; lights?: boolean; vertexColors?: Colors; skinning?: boolean; morphTargets?: boolean; morphNormals?: boolean; + fog?: boolean; } export class ShaderMaterial extends Material { @@ -2579,7 +2582,6 @@ declare module THREE { defines: any; uniforms: any; - attributes: any; vertexShader: string; fragmentShader: string; shading: Shading; @@ -2592,14 +2594,24 @@ declare module THREE { skinning: boolean; morphTargets: boolean; morphNormals: boolean; + derivatives: boolean; + defaultAttributeValues: any; + index0AttributeName: string; clone(): ShaderMaterial; + copy(source: ShaderMaterial): ShaderMaterial; + toJSON(meta: any): any; } - export interface SpriteMaterialParameters extends MaterialParameters{ + export interface SpriteMaterialParameters extends MaterialParameters { color?: number; + opacity?: number; map?: Texture; - rotation?: number; + blending?: Blending; + depthTest?: boolean; + depthWrite?: boolean; + uvOffset?: Vector2; + uvScale?: Vector2; fog?: boolean; } @@ -2612,6 +2624,7 @@ declare module THREE { fog: boolean; clone(): SpriteMaterial; + copy(source: SpriteMaterial): SpriteMaterial; } // Math ////////////////////////////////////////////////////////////////////////////////// @@ -2625,6 +2638,7 @@ declare module THREE { set(min: Vector2, max: Vector2): Box2; setFromPoints(points: Vector2[]): Box2; setFromCenterAndSize(center: Vector2, size: Vector2): Box2; + clone(): Box2; copy(box: Box2): Box2; makeEmpty(): Box2; empty(): boolean; @@ -2643,7 +2657,6 @@ declare module THREE { union(box: Box2): Box2; translate(offset: Vector2): Box2; equals(box: Box2): boolean; - clone(): Box2; } export class Box3 { @@ -2656,6 +2669,7 @@ declare module THREE { setFromPoints(points: Vector3[]): Box3; setFromCenterAndSize(center: Vector3, size: Vector3): Box3; setFromObject(object: Object3D): Box3; + clone(): Box3; copy(box: Box3): Box3; makeEmpty(): Box3; empty(): boolean; @@ -2676,7 +2690,6 @@ declare module THREE { applyMatrix4(matrix: Matrix4): Box3; translate(offset: Vector3): Box3; equals(box: Box3): boolean; - clone(): Box3; } export interface HSL { @@ -2743,6 +2756,11 @@ declare module THREE { */ setStyle(style: string): Color; + /** + * Clones this color. + */ + clone(): Color; + /** * Copies given color. * @param color Color to copy. @@ -2798,13 +2816,8 @@ declare module THREE { multiplyScalar(s: number): Color; lerp(color: Color, alpha: number): Color; equals(color: Color): boolean; - fromArray(rgb: number[]): Color; + fromArray(rgb: number[], offset?: number): Color; toArray(array?: number[], offset?: number): number[]; - - /** - * Clones this color. - */ - clone(): Color; } export class ColorKeywords { @@ -2966,6 +2979,7 @@ declare module THREE { order: string; set(x: number, y: number, z: number, order?: string): Euler; + clone(): Euler; copy(euler: Euler): Euler; setFromRotationMatrix(m: Matrix4, order?: string, update?: boolean): Euler; setFromQuaternion(q:Quaternion, order?: string, update?: boolean): Euler; @@ -2976,8 +2990,6 @@ declare module THREE { toArray(array?: number[], offset?: number): number[]; toVector3(optionalResult?: Vector3): Vector3; onChange: () => void; - - clone(): Euler; } /** @@ -2992,14 +3004,13 @@ declare module THREE { planes: Plane[]; set(p0?: number, p1?: number, p2?: number, p3?: number, p4?: number, p5?: number): Frustum; + clone(): Frustum; copy(frustum: Frustum): Frustum; setFromMatrix(m: Matrix4): Frustum; intersectsObject(object: Object3D): boolean; intersectsSphere(sphere: Sphere): boolean; intersectsBox(box: Box3): boolean; containsPoint(point: Vector3): boolean; - clone(): Frustum; - } export class Line3 { @@ -3008,6 +3019,7 @@ declare module THREE { end: Vector3; set(start?: Vector3, end?: Vector3): Line3; + clone(): Line3; copy(line: Line3): Line3; center(optionalTarget?: Vector3): Vector3; delta(optionalTarget?: Vector3): Vector3; @@ -3018,7 +3030,6 @@ declare module THREE { closestPointToPoint(point: Vector3, clampToLine?: boolean, optionalTarget?: Vector3): Vector3; applyMatrix4(matrix: Matrix4): Line3; equals(line: Line3): boolean; - clone(): Line3; } interface Math { @@ -3027,19 +3038,12 @@ declare module THREE { /** * Clamps the x to be between a and b. * - * @param x Value to be clamped. - * @param a Minimum value - * @param b Maximum value. + * @param value Value to be clamped. + * @param min Minimum value + * @param max Maximum value. */ - clamp(x: number, a: number, b: number): number; - - /** - * Clamps the x to be larger than a. - * - * @param x — Value to be clamped. - * @param a — Minimum value - */ - clampBottom(x: number, a: number): number; + clamp(value: number, min: number, max: number): number; + euclideanModulo( n: number, m: number ): number; /** * Linear mapping of x from range [a1, a2] to range [b1, b2]. @@ -3083,6 +3087,8 @@ declare module THREE { isPowerOfTwo(value: number): boolean; + nearestPowerOfTwo(value: number): number; + nextPowerOfTwo(value: number): number; } @@ -3155,8 +3161,10 @@ declare module THREE { set(n11: number, n12: number, n13: number, n21: number, n22: number, n23: number, n31: number, n32: number, n33: number): Matrix3; identity(): Matrix3; + clone(): Matrix3; copy(m: Matrix3): Matrix3; applyToVector3Array(array: number[], offset?: number, length?: number): number[]; + applyToBuffer( buffer: BufferAttribute, offset?: number, length?: number): BufferAttribute; multiplyScalar(s: number): Matrix3; determinant(): number; getInverse(matrix: Matrix3, throwOnInvertible?: boolean): Matrix3; @@ -3175,7 +3183,7 @@ declare module THREE { transposeIntoArray(r: number[]): number[]; fromArray(array: number[]): Matrix3; toArray(): number[]; - clone(): Matrix3; + } /** @@ -3216,13 +3224,9 @@ declare module THREE { * Resets this matrix to identity. */ identity(): Matrix4; - - /** - * Copies a matrix m into this matrix. - */ + clone(): Matrix4; copy(m: Matrix4): Matrix4; copyPosition(m: Matrix4): Matrix4; - extractBasis( xAxis: Vector3, yAxis: Vector3, zAxis: Vector3): Matrix4; makeBasis( xAxis: Vector3, yAxis: Vector3, zAxis: Vector3): Matrix4; @@ -3258,7 +3262,7 @@ declare module THREE { */ multiplyScalar(s: number): Matrix4; applyToVector3Array(array: number[], offset?: number, length?: number): number[]; - + applyToBuffer( buffer: BufferAttribute, offset?: number, length?: number): BufferAttribute; /** * Computes determinant of this matrix. * Based on http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.htm @@ -3357,12 +3361,9 @@ declare module THREE { * Creates an orthographic projection matrix. */ makeOrthographic(left: number, right: number, top: number, bottom: number, near: number, far: number): Matrix4; + equals( matrix: Matrix4 ): boolean; fromArray(array: number[]): Matrix4; toArray(): number[]; - /** - * Clones this matrix. - */ - clone(): Matrix4; } export class Plane { @@ -3375,6 +3376,7 @@ declare module THREE { setComponents(x: number, y: number, z: number, w: number): Plane; setFromNormalAndCoplanarPoint(normal: Vector3, point: Vector3): Plane; setFromCoplanarPoints(a: Vector3, b: Vector3, c: Vector3): Plane; + clone(): Plane; copy(plane: Plane): Plane; normalize(): Plane; negate(): Plane; @@ -3388,7 +3390,6 @@ declare module THREE { applyMatrix4(matrix: Matrix4, optionalNormalMatrix?: Matrix3): Plane; translate(offset: Vector3): Plane; equals(plane: Plane): boolean; - clone(): Plane; } /** @@ -3419,6 +3420,11 @@ declare module THREE { */ set(x: number, y: number, z: number, w: number): Quaternion; + /** + * Clones this quaternion. + */ + clone(): Quaternion; + /** * Copies values of q to this quaternion. */ @@ -3485,11 +3491,6 @@ declare module THREE { onChange: () => void; - /** - * Clones this quaternion. - */ - clone(): Quaternion; - /** * Adapted from http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/slerp/. */ @@ -3503,11 +3504,13 @@ declare module THREE { direction: Vector3; set(origin: Vector3, direction: Vector3): Ray; + clone(): Ray; copy(ray: Ray): Ray; at(t: number, optionalTarget?: Vector3): Vector3; recast(t: number): Ray; closestPointToPoint(point: Vector3, optionalTarget?: Vector3): Vector3; distanceToPoint(point: Vector3): number; + distanceSqToPoint(point: Vector3): number; distanceSqToSegment(v0: Vector3, v1: Vector3, optionalPointOnRay?: Vector3, optionalPointOnSegment?: Vector3): number; isIntersectionSphere(sphere: Sphere): boolean; intersectSphere(sphere: Sphere, optionalTarget?: Vector3): Vector3; @@ -3519,7 +3522,6 @@ declare module THREE { intersectTriangle(a: Vector3, b: Vector3, c: Vector3, backfaceCulling: boolean, optionalTarget?: Vector3): Vector3; applyMatrix4(matrix4: Matrix4): Ray; equals(ray: Ray): boolean; - clone(): Ray; } export class Sphere { @@ -3530,6 +3532,7 @@ declare module THREE { set(center: Vector3, radius: number): Sphere; setFromPoints(points: Vector3[], optionalCenter?: Vector3): Sphere; + clone(): Sphere; copy(sphere: Sphere): Sphere; empty(): boolean; containsPoint(point: Vector3): boolean; @@ -3540,8 +3543,6 @@ declare module THREE { applyMatrix4(matrix: Matrix4): Sphere; translate(offset: Vector3): Sphere; equals(sphere: Sphere): boolean; - - clone(): Sphere; } export interface SplineControlPoint { @@ -3606,6 +3607,7 @@ declare module THREE { set(a: Vector3, b: Vector3, c: Vector3): Triangle; setFromPointsAndIndices(points: Vector3[], i0: number, i1: number, i2: number): Triangle; + clone(): Triangle; copy(triangle: Triangle): Triangle; area(): number; midpoint(optionalTarget?: Vector3): Vector3; @@ -3614,7 +3616,6 @@ declare module THREE { barycoordFromPoint(point: Vector3, optionalTarget?: Vector3): Vector3; containsPoint(point: Vector3): boolean; equals(triangle: Triangle): boolean; - clone(): Triangle; static normal(a: Vector3, b: Vector3, c: Vector3, optionalTarget?: Vector3): Vector3; static barycoordFromPoint(point: Vector3, a: Vector3, b: Vector3, c: Vector3, optionalTarget: Vector3): Vector3; @@ -3625,7 +3626,7 @@ declare module THREE { /** * ( interface Vector<T> ) * - * Abstruct interface of Vector2, Vector3 and Vector4. + * Abstract interface of Vector2, Vector3 and Vector4. * Currently the members of Vector is NOT type safe because it accepts different typed vectors. * Those definitions will be changed when TypeScript innovates Generics to be type safe. * @@ -3744,6 +3745,9 @@ declare module THREE { x: number; y: number; + width: number; + height: number; + /** * Sets value of this vector. */ @@ -3768,7 +3772,10 @@ declare module THREE { * Gets a component of this vector. */ getComponent(index: number): number; - + /** + * Clones this vector. + */ + clone(): Vector2; /** * Copies value of v to this vector. */ @@ -3784,7 +3791,7 @@ declare module THREE { */ addScalar(s: number): Vector2; addVectors(a: Vector2, b: Vector2): Vector2; - + addScaledVector( v: Vector2, s: number ): Vector2; /** * Subtracts v from this vector. */ @@ -3799,7 +3806,7 @@ declare module THREE { /** * Multiplies this vector by scalar s. */ - multiplyScalar(s: number): Vector2; + multiplyScalar(scalar: number): Vector2; divide(v: Vector2): Vector2; /** @@ -3813,6 +3820,7 @@ declare module THREE { max(v: Vector2): Vector2; clamp(min: Vector2, max: Vector2): Vector2; clampScalar(min: number, max: number): Vector2; + clampLength(min: number, max: number): Vector2; floor(): Vector2; ceil(): Vector2; round(): Vector2; @@ -3837,6 +3845,7 @@ declare module THREE { * Computes length of this vector. */ length(): number; + lengthManhattan(): number; /** * Normalizes this vector. @@ -3856,7 +3865,7 @@ declare module THREE { /** * Normalizes this vector and multiplies it by l. */ - setLength(l: number): Vector2; + setLength(length: number): Vector2; lerp(v: Vector2, alpha: number): Vector2; @@ -3873,10 +3882,7 @@ declare module THREE { fromAttribute( attribute: BufferAttribute, index: number, offset?: number): Vector2; - /** - * Clones this vector. - */ - clone(): Vector2; + rotateAround( center: Vector2, angle: number ): Vector2; } /** @@ -3922,7 +3928,10 @@ declare module THREE { setComponent(index: number, value: number): void; getComponent(index: number): number; - + /** + * Clones this vector. + */ + clone(): Vector3; /** * Copies value of v to this vector. */ @@ -3933,11 +3942,13 @@ declare module THREE { */ add(a: Vector3): Vector3; addScalar(s: number): Vector3; + addScaledVector(v: Vector3, s: number): Vector3; /** * Sets this vector to a + b. */ addVectors(a: Vector3, b: Vector3): Vector3; + addScaledVector( v: Vector3, s: number ): Vector3; /** * Subtracts v from this vector. @@ -3977,6 +3988,7 @@ declare module THREE { max(v: Vector3): Vector3; clamp(min: Vector3, max: Vector3): Vector3; clampScalar(min: number, max: number): Vector3; + clampLength(min: number, max: number): Vector3; floor(): Vector3; ceil(): Vector3; round(): Vector3; @@ -4059,11 +4071,6 @@ declare module THREE { toArray(xyz?: number[], offset?: number): number[]; fromAttribute( attribute: BufferAttribute, index: number, offset?: number): Vector3; - - /** - * Clones this vector. - */ - clone(): Vector3; } /** @@ -4105,7 +4112,10 @@ declare module THREE { setComponent(index: number, value: number): void; getComponent(index: number): number; - + /** + * Clones this vector. + */ + clone(): Vector4; /** * Copies value of v to this vector. */ @@ -4121,7 +4131,7 @@ declare module THREE { * Sets this vector to a + b. */ addVectors(a: Vector4, b: Vector4): Vector4; - + addScaledVector( v: Vector4, s: number ): Vector4; /** * Subtracts v from this vector. */ @@ -4195,7 +4205,7 @@ declare module THREE { /** * Normalizes this vector and multiplies it by l. */ - setLength(l: number): Vector4; + setLength(length: number): Vector4; /** * Linearly interpolate between this vector and v with alpha factor. @@ -4214,11 +4224,6 @@ declare module THREE { toArray(xyzw?: number[], offset?: number): number[]; fromAttribute( attribute: BufferAttribute, index: number, offset?: number): Vector4; - - /** - * Clones this vector. - */ - clone(): Vector4; } // Objects ////////////////////////////////////////////////////////////////////////////////// @@ -4227,12 +4232,30 @@ declare module THREE { constructor(skin: SkinnedMesh); skin: SkinnedMesh; + + clone(): Bone; + copy(source: Bone): Bone; } export class Group extends Object3D { constructor(); } + export class LOD extends Object3D { + constructor(); + + levels: any[]; + + addLevel(object: Object3D, distance?: number): void; + getObjectForDistance(distance: number): Object3D; + raycast(raycaster: Raycaster, intersects: any): void; + update(camera: Camera): void; + + clone(): LOD; + copy(source: LOD): LOD; + toJSON(meta: any): any; + } + export interface LensFlareProperty { texture: Texture; // Texture size: number; // size in pixels (-1 = use texture.width) @@ -4257,100 +4280,54 @@ declare module THREE { add(texture: Texture, size?: number, distance?: number, blending?: Blending, color?: Color): void; add(obj: Object3D): void; - updateLensFlares(): void; + + clone(): LensFlare; + copy(source: LensFlare): LensFlare; } export class Line extends Object3D { - constructor(geometry?: Geometry, material?: LineDashedMaterial, mode?: number); - constructor(geometry?: Geometry, material?: LineBasicMaterial, mode?: number); - constructor(geometry?: Geometry, material?: ShaderMaterial, mode?: number); - constructor(geometry?: BufferGeometry, material?: LineDashedMaterial, mode?: number); - constructor(geometry?: BufferGeometry, material?: LineBasicMaterial, mode?: number); - constructor(geometry?: BufferGeometry, material?: ShaderMaterial, mode?: number); + constructor( + geometry?: Geometry | BufferGeometry, + material?: LineDashedMaterial | LineBasicMaterial | ShaderMaterial, + mode?: number + ); - geometry: any; // Geometry or BufferGeometry; + geometry: Geometry|BufferGeometry; material: Material; // LineDashedMaterial or LineBasicMaterial or ShaderMaterial - mode: LineMode; raycast(raycaster: Raycaster, intersects: any): void; - clone(object?: Line): Line; + clone(): Line; + copy(source: Line): Line; } export class LineSegments extends Line { - constructor(geometry?: Geometry, material?: LineDashedMaterial); - constructor(geometry?: Geometry, material?: LineBasicMaterial); - constructor(geometry?: Geometry, material?: ShaderMaterial); - constructor(geometry?: BufferGeometry, material?: LineDashedMaterial); - constructor(geometry?: BufferGeometry, material?: LineBasicMaterial); - constructor(geometry?: BufferGeometry, material?: ShaderMaterial); + constructor( + geometry?: Geometry | BufferGeometry, + material?: LineDashedMaterial | LineBasicMaterial | ShaderMaterial, + mode?: number + ); - geometry: any; // Geometry or BufferGeometry; - material: Material; // LineDashedMaterial or LineBasicMaterial or ShaderMaterial - - raycast(raycaster: Raycaster, intersects: any): void; - clone(object?: LineSegments): LineSegments; + clone(): LineSegments; + copy(source: LineSegments): LineSegments; } enum LineMode{} var LineStrip: LineMode; var LinePieces: LineMode; - export class LOD extends Object3D { - constructor(); - - objects: any[]; - - addLevel(object: Object3D, distance?: number): void; - getObjectForDistance(distance: number): Object3D; - raycast(raycaster: Raycaster, intersects: any): void; - update(camera: Camera): void; - clone(object?: LOD): LOD; - } - export class Mesh extends Object3D { constructor(geometry?: Geometry, material?: Material); constructor(geometry?: BufferGeometry, material?: Material); - geometry: Geometry; + geometry: Geometry|BufferGeometry; material: Material; updateMorphTargets(): void; getMorphTargetIndexByName(name: string): number; raycast(raycaster: Raycaster, intersects: any): void; - clone(object?: Mesh): Mesh; - } - - export class MorphAnimMesh extends Mesh { - constructor(geometry?: Geometry, material?: MeshBasicMaterial); - constructor(geometry?: Geometry, material?: MeshDepthMaterial); - constructor(geometry?: Geometry, material?: MeshFaceMaterial); - constructor(geometry?: Geometry, material?: MeshLambertMaterial); - constructor(geometry?: Geometry, material?: MeshNormalMaterial); - constructor(geometry?: Geometry, material?: MeshPhongMaterial); - constructor(geometry?: Geometry, material?: ShaderMaterial); - - duration: number; // milliseconds - mirroredLoop: boolean; - time: number; - lastKeyframe: number; - currentKeyframe: number; - direction: number; - directionBackwards: boolean; - - startKeyframe: number; - endKeyframe: number; - length: number; - - setFrameRange(start: number, end: number): void; - setDirectionForward(): void; - setDirectionBackward(): void; - parseAnimations(): void; - setAnimationLabel(label: string, start: number, end: number): void; - playAnimation(label: string, fps: number): void; - updateAnimation(delta: number): void; - interpolateTargets( a: number, b: number, t: number ): void; - clone(object?: MorphAnimMesh): MorphAnimMesh; + clone(): Mesh; + copy(source: Mesh): Mesh; } /** @@ -4358,16 +4335,16 @@ declare module THREE { * * @see src/objects/ParticleSystem.js */ - export class PointCloud extends Object3D { + export class Points extends Object3D { /** * @param geometry An instance of Geometry. * @param material An instance of Material (optional). */ - constructor(geometry: Geometry, material?: PointCloudMaterial); - constructor(geometry: Geometry, material?: ShaderMaterial); - constructor(geometry: BufferGeometry, material?: PointCloudMaterial); - constructor(geometry: BufferGeometry, material?: ShaderMaterial); + constructor( + geometry: Geometry | BufferGeometry, + material?: PointsMaterial | ShaderMaterial + ); /** * An instance of Geometry, where each vertex designates the position of a particle in the system. @@ -4380,7 +4357,8 @@ declare module THREE { material: Material; raycast(raycaster: Raycaster, intersects: any): void; - clone(object?: PointCloud): PointCloud; + clone(): Points; + copy(source: Points): Points; } export class Skeleton { @@ -4398,6 +4376,8 @@ declare module THREE { calculateInverses(bone: Bone): void; pose(): void; update(): void; + clone(): Skeleton; + } export class SkinnedMesh extends Mesh { @@ -4417,7 +4397,8 @@ declare module THREE { pose(): void; normalizeSkinWeights(): void; updateMatrixWorld(force?: boolean): void; - clone(object?: SkinnedMesh): SkinnedMesh; + clone(): SkinnedMesh; + copy(source?: SkinnedMesh): SkinnedMesh; skeleton: Skeleton; } @@ -4429,7 +4410,8 @@ declare module THREE { material: SpriteMaterial; raycast(raycaster: Raycaster, intersects: any): void; - clone(object?: Sprite): Sprite; + clone(): Sprite; + copy(source?: Sprite): Sprite; } @@ -4512,9 +4494,7 @@ declare module THREE { /** * The HTML5 Canvas's 'webgl' context obtained from the canvas where the renderer will draw. */ - // If you are using three.d.ts with other complete definitions of webgl, context:WebGLRenderingContext is suitable. - //context:WebGLRenderingContext; - context: any; + context: WebGLRenderingContext; /** * Defines whether the renderer should automatically clear its output before rendering. @@ -4541,6 +4521,8 @@ declare module THREE { */ sortObjects: boolean; + extensions: WebGLExtensions; + gammaFactor: number; /** @@ -4574,11 +4556,6 @@ declare module THREE { */ shadowMapDebug: boolean; - /** - * Default is false. - */ - shadowMapCascade: boolean; - /** * Default is 8. */ @@ -4611,7 +4588,7 @@ declare module THREE { }; }; - shadowMapPlugin: ShadowMapPlugin; + shadowMap: WebGLShadowMapInstance; /** * Return the WebGL context. @@ -4620,19 +4597,22 @@ declare module THREE { forceContextLoss(): void; - /** - * Return a Boolean true if the context supports vertex textures. - */ + capabilities: WebGLCapabilities; + + /** Deprecated, use capabilities instead */ supportsVertexTextures(): boolean; supportsFloatTextures(): boolean; supportsStandardDerivatives(): boolean; supportsCompressedTextureS3TC(): boolean; supportsCompressedTexturePVRTC(): boolean; supportsBlendMinMax(): boolean; - getMaxAnisotropy(): number; getPrecision(): string; + + getMaxAnisotropy(): number; getPixelRatio(): number; setPixelRatio(value: number): void; + + getSize(): { width: number; height: number; }; /** * Resizes the output canvas to (width, height), and also sets the viewport to fit that size, starting in (0, 0). @@ -4695,6 +4675,7 @@ declare module THREE { clearStencil(): void; clearTarget(renderTarget:WebGLRenderTarget, color: boolean, depth: boolean, stencil: boolean): void; resetGLState(): void; + dispose(): void; /** * Tells the shadow map plugin to update using the passed scene and camera parameters. @@ -4753,6 +4734,7 @@ declare module THREE { export class WebGLRenderTarget implements RenderTarget { constructor(width: number, height: number, options?: WebGLRenderTargetOptions); + uuid: string; width: number; height: number; wrapS: Wrapping; @@ -4771,6 +4753,7 @@ declare module THREE { setSize(width: number, height: number): void; clone(): WebGLRenderTarget; + copy(source: WebGLRenderTarget): WebGLRenderTarget; dispose(): void; @@ -4792,27 +4775,33 @@ declare module THREE { [name: string]: string; common: string; + alphamap_fragment: string; alphamap_pars_fragment: string; alphatest_fragment: string; + aomap_fragment: string; + aomap_pars_fragment: string; + begin_vertex: string; + beginnormal_vertex: string; bumpmap_pars_fragment: string; color_fragment: string; color_pars_fragment: string; color_pars_vertex: string; color_vertex: string; - default_vertex: string; defaultnormal_vertex: string; + displacementmap_pars_vertex: string; + displacementmap_vertex: string; + emissivemap_fragment: string; + emissivemap_pars_fragment: string; envmap_fragment: string; envmap_pars_fragment: string; envmap_pars_vertex: string; envmap_vertex: string; fog_fragment: string; fog_pars_fragment: string; - + hemilight_fragment: string; lightmap_fragment: string; lightmap_pars_fragment: string; - lightmap_pars_vertex: string; - lightmap_vertex: string; lights_lambert_pars_vertex: string; lights_lambert_vertex: string; lights_phong_fragment: string; @@ -4826,14 +4815,14 @@ declare module THREE { logdepthbuf_vertex: string; map_fragment: string; map_pars_fragment: string; - map_pars_vertex: string; map_particle_fragment: string; map_particle_pars_fragment: string; - map_vertex: string; morphnormal_vertex: string; morphtarget_pars_vertex: string; morphtarget_vertex: string; + normal_phong_fragment: string; normalmap_pars_fragment: string; + project_vertex: string; shadowmap_fragment: string; shadowmap_pars_fragment: string; shadowmap_pars_vertex: string; @@ -4844,6 +4833,12 @@ declare module THREE { skinnormal_vertex: string; specularmap_fragment: string; specularmap_pars_fragment: string; + uv2_pars_fragment: string; + uv2_pars_vertex: string; + uv2_vertex: string; + uv_pars_fragment: string; + uv_pars_vertex: string; + uv_vertex: string; worldpos_vertex: string; } @@ -4872,11 +4867,15 @@ declare module THREE { export var UniformsLib: { common: any; - bump: any; + aomap: any; + lightmap: any; + emissivemap: any; + bumpmap: any; normalmap: any; + displacementmap: any; fog: any; lights: any; - particle: any; + points: any; shadowmap: any; }; @@ -4886,17 +4885,83 @@ declare module THREE { }; // Renderers / WebGL ///////////////////////////////////////////////////////////////////// + export class WebGLBufferRenderer{ + constructor(_gl: any, extensions: any, _infoRender: any); // WebGLRenderingContext + + setMode( value: any ): void; + render( start: any, count: any ): void; + renderInstances( geometry: any ): void; + } + + export class WebGLCapabilities{ + constructor(gl: any, extensions: any, parameters: any); // WebGLRenderingContext + + getMaxPrecision: any; + precision: any; + maxTextures: any; + maxVertexTextures: any; + maxTextureSize: any; + maxCubemapSize: any; + maxAttributes: any; + maxVertexUniforms: any; + maxVaryings: any; + maxFragmentUniforms: any; + vertexTextures: any; + floatFragmentTextures: any; + floatVertexTextures: any; + } + export class WebGLExtensions{ constructor(gl: any); // WebGLRenderingContext get(name: string): any; } + interface WebGLGeometriesInstance { + new (gl: any, properties: any, info: any): void; + get( object: any ): any; + } + interface WebGLGeometriesStatic{ + (_gl: any, extensions: any, _infoRender: any): WebGLGeometriesInstance; + } + export var WebGLGeometries: WebGLGeometriesStatic; + + + interface WebGLIndexedBufferRendererInstance { + new (gl: any, properties: any, info: any): void; + setMode( value: any ): void; + setIndex( index: any ): void; + render( start: any, count: any ): void; + renderInstances( geometry: any ): void; + } + interface WebGLIndexedBufferRendererStatic{ + (_gl: any, extensions: any, _infoRender: any): WebGLIndexedBufferRendererInstance; + } + export var WebGLIndexedBufferRenderer: WebGLIndexedBufferRendererStatic; + + + interface WebGLObjectsInstance { + new (gl: any, properties: any, info: any): void; + getAttributeBuffer( attribute: any ): any; + getWireframeAttribute(geometry: any): any; + update(object: any): void; + } + interface WebGLObjectsStatic{ + (gl: any, properties: any, info: any): WebGLObjectsInstance; + } + export var WebGLObjects: WebGLObjectsStatic; + export class WebGLProgram{ constructor(renderer: WebGLRenderer, code: string, material: ShaderMaterial, parameters: WebGLRendererParameters); + + getUniforms(): any; + getAttributes(): any; + /** Deprecated, use getUniforms */ + uniforms: any; + /** Deprecated, use getAttributes */ attributes: any; - attributesKeys: string[]; + id: number; code: string; usedTimes: number; @@ -4905,44 +4970,82 @@ declare module THREE { fragmentShader: WebGLShader; } + interface WebGLProgramsInstance { + new (renderer: WebGLRenderer, capabilities: any): void; + + getParameters( material: any, lights: any, fog: any, object: any ): any[]; + getProgramCode( material: any, parameters: any ): any; + acquireProgram( material: any, parameters: any, code: any ): any; + releaseProgram( program: any ): void; + } + interface WebGLProgramsStatic{ + (): WebGLProgramsInstance; + } + export var WebGLPrograms: WebGLProgramsStatic; + + interface WebGLPropertiesInstance { + new (): void; + + get(object: any): any; + delete(object: any): void; + clear(): void; + } + interface WebGLPropertiesStatic{ + (): WebGLPropertiesInstance; + } + export var WebGLProperties: WebGLPropertiesStatic; + export class WebGLShader{ constructor(gl: any, type: string, string: string); } + interface WebGLShadowMapInstance{ + new ( _renderer: Renderer, _lights: any[], _objects: any[] ): void; + + enabled: boolean; + autoUpdate: boolean; + needsUpdate: boolean; + type: ShadowMapType; + cullFace: CullFace; + + render( scene: Scene ): void; + } + interface WebGLShadowMapStatic{ + ( _renderer: Renderer, _lights: any[], _objects: any[] ): WebGLStateInstance; + } + export var WebGLShadowMap: WebGLShadowMapStatic; + interface WebGLStateInstance{ - new ( gl: any, paramThreeToGL: Function ): void; + new ( gl: any, extensions: any, paramThreeToGL: Function ): void; + init(): void; initAttributes(): void; enableAttribute(attribute: string): void; + enableAttributeAndDivisor( attribute: string, meshPerAttribute: any, extension: any ): void; disableUnusedAttributes(): void; + enable( id: string ): void; + disable( id: string ): void; + getCompressedTextureFormats(): any; setBlending( blending: number, blendEquation: number, blendSrc: number, blendDst: number, blendEquationAlpha: number, blendSrcAlpha: number, blendDstAlpha: number ): void; + setDepthFunc( func: Function): void; setDepthTest( depthTest: number ): void; setDepthWrite( depthWrite: number ): void; setColorWrite( colorWrite: number ): void; - setDoubleSided( doubleSided: number ): void; setFlipSided( flipSided: number ): void; setLineWidth( width: number ): void; setPolygonOffset(polygonoffset: number, factor: number, units: number): void; + setScissorTest( scissorTest: boolean ): void; + activeTexture( webglSlot: any ): void; + bindTexture( webglType: any, webglTexture: any ): void; + compressedTexImage2D(): void; + texImage2D(): void; reset(): void; } interface WebGLStateStatic{ - ( gl: any, paramThreeToGL: Function ): WebGLStateInstance; + ( gl: any, extensions: any, paramThreeToGL: Function ): WebGLStateInstance; } export var WebGLState: WebGLStateStatic; - interface WebGLTexturesInstance{ - new (webgglcontext: any): WebGLTexturesInstance; - - get(texture: Texture): any; // it will return result of gl.createTexture(). - create(texture: Texture): any; // it will return result of gl.createTexture(). - delete(texture: Texture): void; - } - interface WebGLTexturesStatic{ - (webgglcontext: any): WebGLTexturesInstance; - } - export var WebGLTextures: WebGLTexturesStatic; - - // Renderers / WebGL / Plugins ///////////////////////////////////////////////////////////////////// export interface RendererPlugin { init(renderer: WebGLRenderer): void; @@ -4956,14 +5059,6 @@ declare module THREE { render(scene: Scene, camera: Camera, viewportWidth: number, viewportHeight: number): void; } - export class ShadowMapPlugin implements RendererPlugin { - constructor(); - - init(renderer: Renderer): void; - render(scene: Scene, camera: Camera): void; - update(scene: Scene, camera: Camera): void; - } - export class SpritePlugin implements RendererPlugin { constructor(); @@ -5042,10 +5137,26 @@ declare module THREE { overrideMaterial: Material; autoUpdate: boolean; - clone(): Scene; + copy(source: Scene): Scene; } // Textures ///////////////////////////////////////////////////////////////////// + export class CanvasTexture extends Texture { + constructor( + canvas: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement, + mapping?: Mapping, + wrapS?: Wrapping, + wrapT?: Wrapping, + magFilter?: TextureFilter, + minFilter?: TextureFilter, + format?: PixelFormat, + type?: TextureDataType, + anisotropy?: number + ); + + needsUpdate: boolean; + } + export class CompressedTexture extends Texture { constructor( mipmaps: ImageData[], @@ -5065,8 +5176,6 @@ declare module THREE { mipmaps: ImageData[]; flipY: boolean; generateMipmaps: boolean; - - clone(): CompressedTexture; } export class CubeTexture extends Texture { @@ -5084,7 +5193,7 @@ declare module THREE { images: any[]; - clone(texture?: CubeTexture): CubeTexture; + copy(source: CubeTexture): CubeTexture; } export class DataTexture extends Texture { @@ -5103,8 +5212,10 @@ declare module THREE { ); image: { data: ImageData; width: number; height: number; }; - - clone(): DataTexture; + magFilter: TextureFilter; + minFilter: TextureFilter; + flipY: boolean; + generateMipmaps: boolean; } export class Texture { @@ -5140,14 +5251,17 @@ declare module THREE { premultiplyAlpha: boolean; flipY: boolean; unpackAlignment: number; + version: number; needsUpdate: boolean; onUpdate: () => void; static DEFAULT_IMAGE: any; static DEFAULT_MAPPING: any; clone(): Texture; - update(): void; + copy(source: Texture): Texture; + toJSON(meta: any): any; dispose(): void; + transformUv( uv: Vector ): void; // EventDispatcher mixins addEventListener(type: string, listener: (event: any) => void ): void; @@ -5173,50 +5287,27 @@ declare module THREE { } // Extras ///////////////////////////////////////////////////////////////////// - - export interface TypefaceData { - familyName: string; - cssFontWeight: string; - cssFontStyle: string; + export var CurveUtils: { + tangentQuadraticBezier(t: number, p0: number, p1: number, p2: number): number; + tangentCubicBezier(t: number, p0: number, p1: number, p2: number, p3: number): number; + tangentSpline(t: number, p0: number, p1: number, p2: number, p3: number): number; + interpolate(p0: number, p1: number, p2: number, p3: number, t: number): number; } - export var FontUtils: { - faces: { [weight: string]: { [style: string]: Face3; }; }; - face: string; - weight: string; - style: string; - size: number; - divisions: number; - - getFace(): Face3; - loadFace(data: TypefaceData): TypefaceData; - drawText(text: string): { paths: Path[]; offset: number; }; - extractGlyphPoints(c: string, face: Face3, scale: number, offset: number, path: Path): { offset: number; path: Path; }; - - generateShapes(text: string, parameters?: { size?: number; curveSegments?: number; font?: string; weight?: string; style?: string; }): Shape[]; - Triangulate: { - (contour: Vector2[], indices: boolean): Vector2[]; - area(contour: Vector2[]): number; - }; - }; - - export var GeometryUtils: { - // DEPRECATED - merge(geometry1: Geometry, object2: Mesh, materialIndexOffset?: number): void; - - // DEPRECATED - merge(geometry1: Geometry, object2: Geometry, materialIndexOffset?: number): void; - - // DEPRECATED - center(geometry: Geometry): Vector3; - }; - + // deprecated. export var ImageUtils: { crossOrigin: string; + // deprecated. loadTexture(url: string, mapping?: Mapping, onLoad?: (texture: Texture) => void, onError?: (message: string) => void): Texture; + + // deprecated. loadTextureCube(array: string[], mapping?: Mapping, onLoad?: (texture: Texture) => void , onError?: (message: string) => void ): Texture; + + // deprecated. getNormalMap(image: HTMLImageElement, depth?: number): HTMLCanvasElement; + + // deprecated. generateDataTexture(width: number, height: number, color: Color): DataTexture; }; @@ -5226,100 +5317,15 @@ declare module THREE { attach(child: Object3D, scene: Scene, parent: Object3D): void; }; - // Extras / Animation ///////////////////////////////////////////////////////////////////// - - export interface KeyFrame { - pos: number[]; - rot: number[]; - scl: number[]; - time: number; - } - - export interface KeyFrames { - keys: KeyFrame[]; - parent: number; - } - - export interface AnimationData { - JIT: number; - fps: number; - hierarchy: KeyFrames[]; - length: number; - name: string; - } - - export class Animation { - constructor(root: Mesh, data: AnimationData); - - root: Mesh; - data: AnimationData; - hierarchy: Bone[]; - currentTime: number; - timeScale: number; - isPlaying: boolean; - loop: boolean; - weight: number; - interpolationType: number; - - play(startTime?: number, weight?: number): void; - stop(): void; - reset(): void; - resetBlendWeights(): void; - update(delta: number): void; - getNextKeyWith(type: string, h: number, key: number): KeyFrame; - getPrevKeyWith(type: string, h: number, key: number): KeyFrame; - } - - export var AnimationHandler: { - LINEAR: number; - CATMULLROM: number; - CATMULLROM_FORWARD: number; - - animations: any[]; - - init(data: AnimationData): AnimationData; - parse(root: Mesh): Object3D[]; - play(animation: Animation): void; - stop(animation: Animation): void; - update(deltaTimeMS: number): void; + export var ShapeUtils: { + area( contour: number[] ): number; + triangulate( contour: number[], indices: boolean ): number[]; + triangulateShape( contour: number[], holes: any[] ): number[]; + isClockWise( pts: number[] ): boolean; + b2( t: number, p0: number, p1: number, p2: number ): number; + b3( t: number, p0: number, p1: number, p2: number, p3: number ): number; }; - export class KeyFrameAnimation { - constructor(data: any); - - root: Mesh; - data: AnimationData; - hierarchy: KeyFrames[]; - currentTime: number; - timeScale: number; - isPlaying: boolean; - isPaused: boolean; - loop: boolean; - - play(startTime?: number): void; - stop(): void; - update(delta: number): void; - getNextKeyWith(type: string, h: number, key: number): KeyFrame; - getPrevKeyWith(type: string, h: number, key: number): KeyFrame; - } - - export class MorphAnimation { - constructor(mesh: Mesh); - - mesh: Mesh; - frames: number; - currentTime: number; - duration: number; - loop: boolean; - lastFrame: number; - currentFrame: number; - isPlaying: boolean; - - play(): void; - pause(): void; - update(delta: number): void; - } - // Extras / Audio ///////////////////////////////////////////////////////////////////// export class Audio extends Object3D { @@ -5331,16 +5337,28 @@ declare module THREE { panner: PannerNode; autoplay: boolean; startTime: number; + playbackRate: number; isPlaying: boolean; load(file: string): Audio; play(): void; pause(): void; stop(): void; + connect(): void; + disconnect(): void; + setFilter(value: any): void; + getFilter(): any; + setPlaybackRate(value: number): void; + getPlaybackRate(): number; + setLoop(value: boolean): void; + getLoop(): boolean; setRefDistance(value: number): void; + getRefDistance(): number; setRolloffFactor(value: number): void; + getRolloffFactor(): number; setVolume(value: number): void; + getVolume(): number; updateMatrixWorld(force?: boolean): void; } @@ -5416,16 +5434,16 @@ declare module THREE { */ getTangentAt(u: number): T; - static Utils: { - tangentQuadraticBezier(t: number, p0: number, p1: number, p2: number): number; - tangentCubicBezier(t: number, p0: number, p1: number, p2: number, p3: number): number; - tangentSpline(t: number, p0: number, p1: number, p2: number, p3: number): number; - interpolate(p0: number, p1: number, p2: number, p3: number, t: number): number; - }; - static create(constructorFunc: Function, getPointFunc: Function): Function; } + export var CurveUtils: { + tangentQuadraticBezier(t: number, p0: number, p1: number, p2: number): number; + tangentCubicBezier(t: number, p0: number, p1: number, p2: number, p3: number): number; + tangentSpline(t: number, p0: number, p1: number, p2: number, p3: number): number; + interpolate(p0: number, p1: number, p2: number, p3: number, t: number): number; + }; + export interface BoundingBox { minX: number; minY: number; @@ -5439,28 +5457,17 @@ declare module THREE { constructor(); curves: Curve[]; - bends: Path[]; autoClose: boolean; add(curve: Curve): void; checkConnection(): boolean; closePath(): void; + getPoint(t: number): T; getLength(): number; getCurveLengths(): number[]; - getBoundingBox(): BoundingBox; createPointsGeometry(divisions: number): Geometry; createSpacedPointsGeometry(divisions: number): Geometry; createGeometry(points: T[]): Geometry; - addWrapPath(bendpath: Path): void; - getTransformedPoints(segments: number, bends?: Path[]): T[]; - getTransformedSpacedPoints(segments: number, bends?: Path[]): T[]; - getWrapPoints(oldPts: T[], path: Path): T[]; - } - - export class Gyroscope extends Object3D { - constructor(); - - updateMatrixWorld(force?: boolean): void; } export enum PathActions { @@ -5494,8 +5501,8 @@ declare module THREE { splineThru(pts: Vector2[]): void; arc(aX: number, aY: number, aRadius: number, aStartAngle: number, aEndAngle: number, aClockwise: boolean): void; absarc(aX: number, aY: number, aRadius: number, aStartAngle: number, aEndAngle: number, aClockwise: boolean): void; - ellipse(aX: number, aY: number, xRadius: number, yRadius: number, aStartAngle: number, aEndAngle: number, aClockwise: boolean): void; - absellipse(aX: number, aY: number, xRadius: number, yRadius: number, aStartAngle: number, aEndAngle: number, aClockwise: boolean): void; + ellipse(aX: number, aY: number, xRadius: number, yRadius: number, aStartAngle: number, aEndAngle: number, aClockwise: boolean, aRotation: number): void; + absellipse(aX: number, aY: number, xRadius: number, yRadius: number, aStartAngle: number, aEndAngle: number, aClockwise: boolean, aRotation: number): void; getSpacedPoints(divisions?: number, closedPath?: boolean): Vector2[]; getPoints(divisions?: number, closedPath?: boolean): Vector2[]; toShapes(): Shape[]; @@ -5512,16 +5519,11 @@ declare module THREE { extrude(options?: any): ExtrudeGeometry; makeGeometry(options?: any): ShapeGeometry; getPointsHoles(divisions: number): Vector2[][]; - getSpacedPointsHoles(divisions: number): Vector2[][]; extractAllPoints(divisions: number): { shape: Vector2[]; holes: Vector2[][]; }; extractPoints(divisions: number): Vector2[]; - extractAllSpacedPoints(divisions: Vector2): { - shape: Vector2[]; - holes: Vector2[][]; - }; } @@ -5530,14 +5532,18 @@ declare module THREE { constructor(aX: number, aY: number, aRadius: number, aStartAngle: number, aEndAngle: number, aClockwise: boolean ); } - export class ClosedSplineCurve3 extends Curve { - constructor( points?:Vector3[] ); + export class CatmullRomCurve3 extends Curve { + constructor(); + } - points:Vector3[]; + export class ClosedSplineCurve3 extends Curve { + constructor(points?: Vector3[]); + + points: Vector3[]; } export class CubicBezierCurve extends Curve { - constructor( v0: Vector2, v1: Vector2, v2: Vector2, v3: Vector2 ); + constructor(v0: Vector2, v1: Vector2, v2: Vector2, v3: Vector2); v0: Vector2; v1: Vector2; @@ -5545,7 +5551,7 @@ declare module THREE { v3: Vector2; } export class CubicBezierCurve3 extends Curve { - constructor( v0: Vector3, v1: Vector3, v2: Vector3, v3: Vector3 ); + constructor(v0: Vector3, v1: Vector3, v2: Vector3, v3: Vector3); v0: Vector3; v1: Vector3; @@ -5553,7 +5559,7 @@ declare module THREE { v3: Vector3; } export class EllipseCurve extends Curve { - constructor( aX: number, aY: number, xRadius: number, yRadius: number, aStartAngle: number, aEndAngle: number, aClockwise: boolean ); + constructor(aX: number, aY: number, xRadius: number, yRadius: number, aStartAngle: number, aEndAngle: number, aClockwise: boolean, aRotation: number); aX: number; aY: number; @@ -5562,6 +5568,7 @@ declare module THREE { aStartAngle: number; aEndAngle: number; aClockwise: boolean; + aRotation: number; } export class LineCurve extends Curve { constructor( v1: Vector2, v2: Vector2 ); @@ -5624,6 +5631,21 @@ declare module THREE { heightSegments: number; depthSegments: number; }; + + clone(): BoxGeometry; + } + + export class CircleBufferGeometry extends Geometry { + constructor(radius?: number, segments?: number, thetaStart?: number, thetaLength?: number); + + parameters: { + radius: number; + segments: number; + thetaStart: number; + thetaLength: number; + }; + + clone(): CircleBufferGeometry; } export class CircleGeometry extends Geometry { @@ -5635,6 +5657,8 @@ declare module THREE { thetaStart: number; thetaLength: number; }; + + clone(): CircleGeometry; } // deprecated @@ -5662,6 +5686,8 @@ declare module THREE { thetaStart: number; thetaLength: number; }; + + clone(): CylinderGeometry; } export class DodecahedronGeometry extends Geometry { @@ -5671,6 +5697,14 @@ declare module THREE { radius: number; detail: number; }; + + clone(): DodecahedronGeometry; + } + + export class EdgesGeometry extends BufferGeometry { + constructor(geometry: BufferGeometry, thresholdAngle: number); + + clone(): EdgesGeometry; } export class ExtrudeGeometry extends Geometry { @@ -5688,6 +5722,8 @@ declare module THREE { export class IcosahedronGeometry extends PolyhedronGeometry { constructor(radius: number, detail: number); + + clone(): IcosahedronGeometry; } export class LatheGeometry extends Geometry { @@ -5703,6 +5739,8 @@ declare module THREE { export class OctahedronGeometry extends PolyhedronGeometry { constructor(radius: number, detail: number); + + clone(): OctahedronGeometry; } export class ParametricGeometry extends Geometry { @@ -5724,6 +5762,8 @@ declare module THREE { widthSegments: number; heightSegments: number; }; + + clone(): PlaneBufferGeometry; } export class PlaneGeometry extends Geometry { @@ -5735,6 +5775,8 @@ declare module THREE { widthSegments: number; heightSegments: number; }; + + clone(): PlaneGeometry; } export class PolyhedronGeometry extends Geometry { @@ -5746,6 +5788,8 @@ declare module THREE { radius: number; detail: number; }; + + clone(): PolyhedronGeometry; } export class RingGeometry extends Geometry { @@ -5759,6 +5803,8 @@ declare module THREE { thetaStart: number; thetaLength: number; }; + + clone(): RingGeometry; } export class ShapeGeometry extends Geometry { @@ -5770,6 +5816,23 @@ declare module THREE { addShape(shape: Shape, options?: any): void; } + + export class SphereBufferGeometry extends BufferGeometry { + constructor(radius: number, widthSegments?: number, heightSegments?: number, phiStart?: number, phiLength?: number, thetaStart?: number, thetaLength?: number); + + parameters: { + radius: number; + widthSegments: number; + heightSegments: number; + phiStart: number; + phiLength: number; + thetaStart: number; + thetaLength: number; + }; + + clone(): SphereBufferGeometry; + } + /** * A class for generating sphere geometries */ @@ -5800,22 +5863,8 @@ declare module THREE { export class TetrahedronGeometry extends PolyhedronGeometry { constructor(radius?: number, detail?: number); - } - export interface TextGeometryParameters { - size?: number; // size of the text - height?: number; // thickness to extrude text - curveSegments?: number; // number of points on the curves - font?: string; // font name - weight?: string; // font weight (normal, bold) - style?: string; // font style (normal, italics) - bevelEnabled?: boolean; // turn on bevel - bevelThickness?: number; // how deep into text bevel goes - bevelSize?: number; // how far from text outline is bevel - } - - export class TextGeometry extends ExtrudeGeometry { - constructor(text: string, TextGeometryParameters?: TextGeometryParameters); + clone(): TetrahedronGeometry; } export class TorusGeometry extends Geometry { @@ -5828,6 +5877,8 @@ declare module THREE { tubularSegments: number; arc: number; }; + + clone(): TorusGeometry; } export class TorusKnotGeometry extends Geometry { @@ -5842,6 +5893,8 @@ declare module THREE { q: number; heightScale: number; }; + + clone(): TorusKnotGeometry; } @@ -5864,6 +5917,11 @@ declare module THREE { static SinusoidalTaper(u: number): number; static FrenetFrames(path: Path, segments: number, closed: boolean): void; + clone(): TubeGeometry; + } + + export class WireframeGeometry extends BufferGeometry{ + constructor(geometry: Geometry | BufferGeometry); } // Extras / Helpers ///////////////////////////////////////////////////////////////////// @@ -5879,7 +5937,7 @@ declare module THREE { setColor(hex: number): void; } - export class AxisHelper extends Line { + export class AxisHelper extends LineSegments { constructor(size?: number); } @@ -5892,13 +5950,13 @@ declare module THREE { update(): void; } - export class BoxHelper extends Line { + export class BoxHelper extends LineSegments { constructor(object?: Object3D); update(object?: Object3D): void; } - export class CameraHelper extends Line { + export class CameraHelper extends LineSegments { constructor(camera: Camera); camera: Camera; @@ -5918,22 +5976,21 @@ declare module THREE { update(): void; } - export class EdgesHelper extends Line { + export class EdgesHelper extends LineSegments { constructor(object: Object3D, hex?: number, thresholdAngle?: number); } - export class FaceNormalsHelper extends Line { + export class FaceNormalsHelper extends LineSegments { constructor(object: Object3D, size?: number, hex?: number, linewidth?: number); object: Object3D; size: number; - normalMatrix: Matrix3; update(object?: Object3D): void; } - export class GridHelper extends Line { + export class GridHelper extends LineSegments { constructor(size: number, step: number); color1: Color; @@ -5961,7 +6018,7 @@ declare module THREE { update(): void; } - export class SkeletonHelper extends Line { + export class SkeletonHelper extends LineSegments { constructor(bone: Object3D); bones: Bone[]; @@ -5981,17 +6038,7 @@ declare module THREE { update(): void; } - export class VertexNormalsHelper extends Line { - constructor(object: Object3D, size?: number, hex?: number, linewidth?: number); - - object: Object3D; - size: number; - normalMatrix: Matrix3; - - update(object?: Object3D): void; - } - - export class VertexTangentsHelper extends Line { + export class VertexNormalsHelper extends LineSegments { constructor(object: Object3D, size?: number, hex?: number, linewidth?: number); object: Object3D; @@ -6000,7 +6047,7 @@ declare module THREE { update(object?: Object3D): void; } - export class WireframeHelper extends Line { + export class WireframeHelper extends LineSegments { constructor(object: Object3D, hex?: number); } @@ -6008,14 +6055,15 @@ declare module THREE { // Extras / Objects ///////////////////////////////////////////////////////////////////// export class ImmediateRenderObject extends Object3D { - constructor(); + constructor(material: Material); + material: Material; render(renderCallback:Function): void; } export interface MorphBlendMeshAnimation { - startFrame: number; - endFrame: number; + start: number; + end: number; length: number; fps: number; duration: number; @@ -6052,5 +6100,5 @@ declare module THREE { } declare module 'three' { - export=THREE; + export = THREE; } diff --git a/toastr/toastr.d.ts b/toastr/toastr.d.ts index 321177ec2..e7cd15f92 100644 --- a/toastr/toastr.d.ts +++ b/toastr/toastr.d.ts @@ -113,21 +113,26 @@ interface ToastrOptions { * Set newest toast to appear on top **/ newestOnTop?: boolean; - - /** - * Rather than having identical toasts stack, set the preventDuplicates property to true. Duplicates are matched to the previous toast based on their message content. - */ - preventDuplicates?: boolean; - - /** - * Visually indicates how long before a toast expires. - */ - progressBar?: boolean; - + /** + * The element to put the toastr container + **/ + target?: string; + /** + * Rather than having identical toasts stack, set the preventDuplicates property to true. Duplicates are matched to the previous toast based on their message content. + */ + preventDuplicates?: boolean; + /** + * Visually indicates how long before a toast expires. + */ + progressBar?: boolean; /** * Function to execute on toast click */ onclick?: () => void; + /** + * Set if toastr should parse containing html + **/ + allowHtml?: boolean; } interface ToastrDisplayMethod { diff --git a/typeahead/typeahead-tests.ts b/typeahead/typeahead-tests.ts index 2bcb016c0..ec2b2e2f3 100644 --- a/typeahead/typeahead-tests.ts +++ b/typeahead/typeahead-tests.ts @@ -6,14 +6,10 @@ // var substringMatcher = function (strs: any) { - return function findMatches(q: any, cb: any) { - var matches: any, substrRegex: any; - - // an array that will be populated with substring matches - matches = []; - + return function findMatches(q: string, syncResults: (x: Array) => void) { + var matches: Array<{ value: string }> = []; // regex used to determine if a string contains the substring `q` - substrRegex = new RegExp(q, 'i'); + var substrRegex = new RegExp(q, 'i'); // iterate through the pool of strings and for any string that // contains the substring `q`, add it to the `matches` array @@ -25,7 +21,7 @@ var substringMatcher = function (strs: any) { } }); - cb(matches); + syncResults(matches); } } @@ -46,14 +42,14 @@ function test_method_names() { $('#the-basics .typeahead').typeahead('open'); $('#the-basics .typeahead').typeahead('close'); $('#the-basics .typeahead').typeahead('val'); - $('#the-basics .typeahead').typeahead('val', 'test value'); + $('#the-basics .typeahead').typeahead('val', 'test value'); } function test_options() { var dataSets: Twitter.Typeahead.Dataset[] = []; - + function with_empty_options() { $('#the-basics .typeahead').typeahead({}, dataSets); } @@ -72,10 +68,10 @@ function test_options() { function with_all_options() { $('#the-basics .typeahead').typeahead({ - hint: true, - highlight: true, - minLength: 1 - }, + hint: true, + highlight: true, + minLength: 1 + }, dataSets ); } @@ -101,41 +97,41 @@ function test_datasets_array() { function with_displayKey_option() { $('#the-basics .typeahead').typeahead(options, [{ - displayKey: 'value', - source: substringMatcher(states) - }] + display: 'value', + source: substringMatcher(states) + }] ); } function with_templates_option() { $('#the-basics .typeahead').typeahead(options, [{ - templates: {}, - source: substringMatcher(states) - }] + templates: {}, + source: substringMatcher(states) + }] ); } function with_all_options() { $('#the-basics .typeahead').typeahead(options, [{ - name: 'states', - displayKey: 'value', - templates: {}, - source: substringMatcher(states) - }] + name: 'states', + display: 'value', + templates: {}, + source: substringMatcher(states) + }] ); } function with_multiple_datasets() { $('#the-basics .typeahead').typeahead(options, [ - { + { name: 'states', - displayKey: 'value', + display: 'value', templates: {}, source: substringMatcher(states) }, { name: 'states alternative', - displayKey: 'value', + display: 'value', templates: {}, source: substringMatcher(states) } @@ -165,7 +161,7 @@ function test_datasets_objects() { function with_displayKey_option() { $('#the-basics .typeahead').typeahead(options, { - displayKey: 'value', + display: 'value', source: substringMatcher(states) } ); @@ -184,7 +180,7 @@ function test_datasets_objects() { $('#the-basics .typeahead').typeahead(options, { name: 'states', - displayKey: 'value', + display: x => x.value, templates: {}, source: substringMatcher(states) } @@ -192,16 +188,16 @@ function test_datasets_objects() { } function with_multiple_objects() { - $('#the-basics .typeahead').typeahead(options, + $('#the-basics .typeahead').typeahead(options, { name: 'states', - displayKey: 'value', + display: 'value', templates: {}, source: substringMatcher(states) }, { name: 'states alternative', - displayKey: 'value', + display: 'value', templates: {}, source: substringMatcher(states) } @@ -231,7 +227,7 @@ function test_dataset_templates() { $('#the-basics .typeahead').typeahead(options, { source: substringMatcher(states), templates: { - empty: function(context: any) { + empty: function (context: any) { return context.name; } } @@ -249,7 +245,7 @@ function test_dataset_templates() { $('#the-basics .typeahead').typeahead(options, { source: substringMatcher(states), templates: { - footer: function(context: any) { + footer: function (context: any) { return context.name; } } @@ -267,7 +263,7 @@ function test_dataset_templates() { $('#the-basics .typeahead').typeahead(options, { source: substringMatcher(states), templates: { - header: function(context: any) { + header: function (context: any) { return context.name; } } @@ -277,8 +273,8 @@ function test_dataset_templates() { function with_suggestion_option() { $('#the-basics .typeahead').typeahead(options, { source: substringMatcher(states), - templates: { - suggestion: function(context) { + templates: { + suggestion: function (context) { return context.name; } } @@ -289,13 +285,13 @@ function test_dataset_templates() { $('#the-basics .typeahead').typeahead(options, { source: substringMatcher(states), templates: { - empty: 'no results', + empty: 'no results', footer: 'custom footer', header: 'custom header', - suggestion: function(context) { + suggestion: function (context) { return context.name; } - } + }, }); } } diff --git a/typeahead/typeahead.d.ts b/typeahead/typeahead.d.ts index 49538fbd9..e01e0d509 100644 --- a/typeahead/typeahead.d.ts +++ b/typeahead/typeahead.d.ts @@ -87,7 +87,67 @@ interface JQuery { * @param options ('hint' or 'highlight' or 'minLength' all of which are optional) * @param datasets One or more datasets passed in as arguments. */ - typeahead(options: Twitter.Typeahead.Options, ... datasets: Twitter.Typeahead.Dataset[]): JQuery; + typeahead(options: Twitter.Typeahead.Options, ...datasets: Twitter.Typeahead.Dataset[]): JQuery; + + on(events: "typeahead:active", selector: string, data: any, handler: (ev: JQueryEventObject) => any): JQuery; + on(events: "typeahead:active", selector: string, handler: (ev: JQueryEventObject) => any): JQuery; + on(events: "typeahead:active", handler: (ev: JQueryEventObject) => any): JQuery; + off(events: "typeahead:active", handler: (ev: JQueryEventObject) => any): JQuery; + + on(events: "typeahead:idle", selector: string, data: any, handler: (ev: JQueryEventObject) => any): JQuery; + on(events: "typeahead:idle", selector: string, handler: (ev: JQueryEventObject) => any): JQuery; + on(events: "typeahead:idle", handler: (ev: JQueryEventObject) => any): JQuery; + off(events: "typeahead:idle", handler: (ev: JQueryEventObject) => any): JQuery; + + on(events: "typeahead:open", selector: string, data: any, handler: (ev: JQueryEventObject) => any): JQuery; + on(events: "typeahead:open", selector: string, handler: (ev: JQueryEventObject) => any): JQuery; + on(events: "typeahead:open", handler: (ev: JQueryEventObject) => any): JQuery; + off(events: "typeahead:open", handler: (ev: JQueryEventObject) => any): JQuery; + + on(events: "typeahead:close", selector: string, data: any, handler: (ev: JQueryEventObject) => any): JQuery; + on(events: "typeahead:close", selector: string, handler: (ev: JQueryEventObject) => any): JQuery; + on(events: "typeahead:close", handler: (ev: JQueryEventObject) => any): JQuery; + off(events: "typeahead:close", handler: (ev: JQueryEventObject) => any): JQuery; + + on(events: "typeahead:change", selector: string, data: any, handler: (ev: JQueryEventObject) => any): JQuery; + on(events: "typeahead:change", selector: string, handler: (ev: JQueryEventObject) => any): JQuery; + on(events: "typeahead:change", handler: (ev: JQueryEventObject) => any): JQuery; + off(events: "typeahead:change", handler: (ev: JQueryEventObject) => any): JQuery; + + on(events: "typeahead:render", selector: string, data: any, handler: (ev: JQueryEventObject, suggestions: Array, async: boolean, datasetName: string) => any): JQuery; + on(events: "typeahead:render", selector: string, handler: (ev: JQueryEventObject, suggestions: Array, async: boolean, datasetName: string) => any): JQuery; + on(events: "typeahead:render", handler: (ev: JQueryEventObject, suggestions: Array, async: boolean, datasetName: string) => any): JQuery; + off(events: "typeahead:render", handler: (ev: JQueryEventObject, suggestions: Array, async: boolean, datasetName: string) => any): JQuery; + + on(events: "typeahead:select", selector: string, data: any, handler: (ev: JQueryEventObject, suggestion: any) => any): JQuery; + on(events: "typeahead:select", selector: string, handler: (ev: JQueryEventObject, suggestion: any) => any): JQuery; + on(events: "typeahead:select", handler: (ev: JQueryEventObject, suggestion: any) => any): JQuery; + off(events: "typeahead:select", handler: (ev: JQueryEventObject, suggestion: any) => any): JQuery; + + on(events: "typeahead:autocomplete", selector: string, data: any, handler: (ev: JQueryEventObject, suggestion: any) => any): JQuery; + on(events: "typeahead:autocomplete", selector: string, handler: (ev: JQueryEventObject, suggestion: any) => any): JQuery; + on(events: "typeahead:autocomplete", handler: (ev: JQueryEventObject, suggestion: any) => any): JQuery; + off(events: "typeahead:autocomplete", handler: (ev: JQueryEventObject, suggestion: any) => any): JQuery; + + on(events: "typeahead:cursorchange", selector: string, data: any, handler: (ev: JQueryEventObject, suggestion: any) => any): JQuery; + on(events: "typeahead:cursorchange", selector: string, handler: (ev: JQueryEventObject, suggestion: any) => any): JQuery; + on(events: "typeahead:cursorchange", handler: (ev: JQueryEventObject, suggestion: any) => any): JQuery; + off(events: "typeahead:cursorchange", handler: (ev: JQueryEventObject, suggestion: any) => any): JQuery; + + on(events: "typeahead:asyncrequest", selector: string, data: any, handler: (ev: JQueryEventObject, query: string, datasetName: string) => any): JQuery; + on(events: "typeahead:asyncrequest", selector: string, handler: (ev: JQueryEventObject, query: string, datasetName: string) => any): JQuery; + on(events: "typeahead:asyncrequest", handler: (ev: JQueryEventObject, query: string, datasetName: string) => any): JQuery; + off(events: "typeahead:asyncrequest", handler: (ev: JQueryEventObject, query: string, datasetName: string) => any): JQuery; + + on(events: "typeahead:asynccancel", selector: string, data: any, handler: (ev: JQueryEventObject, query: string, datasetName: string) => any): JQuery; + on(events: "typeahead:asynccancel", selector: string, handler: (ev: JQueryEventObject, query: string, datasetName: string) => any): JQuery; + on(events: "typeahead:asynccancel", handler: (ev: JQueryEventObject, query: string, datasetName: string) => any): JQuery; + off(events: "typeahead:asynccancel", handler: (ev: JQueryEventObject, query: string, datasetName: string) => any): JQuery; + + on(events: "typeahead:asyncreceive", selector: string, data: any, handler: (ev: JQueryEventObject, query: string, datasetName: string) => any): JQuery; + on(events: "typeahead:asyncreceive", selector: string, handler: (ev: JQueryEventObject, query: string, datasetName: string) => any): JQuery; + on(events: "typeahead:asyncreceive", handler: (ev: JQueryEventObject, query: string, datasetName: string) => any): JQuery; + off(events: "typeahead:asyncreceive", handler: (ev: JQueryEventObject, query: string, datasetName: string) => any): JQuery; } declare module Twitter.Typeahead { @@ -105,7 +165,7 @@ declare module Twitter.Typeahead { * cb can be invoked synchronously or asynchronously. * */ - source: (query: string, cb: (result: any) => void) => void; + source: ((query: string, syncResults: (result: Array) => void, asyncResults?: (result: Array) => void) => void); /** * The name of the dataset. @@ -120,18 +180,18 @@ declare module Twitter.Typeahead { * This will be used when setting the value of the input control after a suggestion is selected. Can be either a key string or a function that transforms a suggestion object into a string. * Defaults to value. */ - displayKey?: string | ((obj: any) => string); + display?: string | ((obj: any) => string); /** * A hash of templates to be used when rendering the dataset. * Note a precompiled template is a function that takes a JavaScript object as its first argument and returns a HTML string. */ templates?: Templates; + async?: boolean; } interface Templates { - /** * Rendered when 0 suggestions are available for the given query. * Can be either a HTML string or a precompiled template. @@ -178,267 +238,261 @@ declare module Twitter.Typeahead { } - /** - * When initializing a typeahead, there are a number of options you can configure. - */ + /** + * When initializing a typeahead, there are a number of options you can configure. + */ interface Options { - /** - * highlight: If true, when suggestions are rendered, - * pattern matches for the current query in text nodes will be wrapped in a strong element. - * Defaults to false. - */ - highlight?: boolean; + /** + * highlight: If true, when suggestions are rendered, + * pattern matches for the current query in text nodes will be wrapped in a strong element. + * Defaults to false. + */ + highlight?: boolean; - /** - * If false, the typeahead will not show a hint. Defaults to true. - */ - hint?: boolean; + /** + * If false, the typeahead will not show a hint. Defaults to true. + */ + hint?: boolean; - /** - * The minimum character length needed before suggestions start getting rendered. Defaults to 1. - */ - minLength?: number; + /** + * The minimum character length needed before suggestions start getting rendered. Defaults to 1. + */ + minLength?: number; } } -declare module Bloodhound -{ - interface BloodhoundOptions - { - /** - * Transforms a datum into an array of string tokens - * - * @constructor - * @param datum individual units that compose the dataset - */ - datumTokenizer?: any; - /** - * Transforms a query into an array of string tokens - * - * @constructor - * @param query tokenizer query - */ - queryTokenizer?: any; - /** - * The max number of suggestions to return from Bloodhound#get. - * If not reached, the data source will attempt to backfill the suggestions from remote. Defaults to 5 - */ - limit?: number; - /** - * If set, this is expected to be a function with the signature (remoteMatch, localMatch) that returns true if the datums are duplicates or false otherwise. - * If not set, duplicate detection will not be performed. - */ - dupDetector?: (remoteMatch: T, localMatch: T) => boolean; - /** - * A compare function used to sort matched datums for a given query. - */ - sorter?: (a: T, b: T) => number; - /** - *An array of datums or a function that returns an array of datums. - */ - local?: () => T[]; - /** - * Can be a URL to a JSON file containing an array of datums or, if more configurability is needed, a prefetch options hash. - */ - prefetch?: PrefetchOptions; - /** - * Can be a URL to fetch suggestions from when the data provided by local and prefetch is insufficient or, if more configurability is needed, a remote options hash. - */ - remote?: RemoteOptions; - } - - /** - * Prefetched data is fetched and processed on initialization. - * If the browser supports localStorage, the processed data will be cached - * there to prevent additional network requests on subsequent page loads. - */ - interface PrefetchOptions - { - /** - * A URL to a JSON file containing an array of datums. Required. - */ - url: string; - /** - * The time (in milliseconds) the prefetched data should be cached - * in localStorage. Defaults to 86400000 (1 day). - */ - ttl?: number; - /** - * A function that transforms the response body into an array of datums. - * - * @param parsedResponse Response body - */ - filter?: (parsedResponse: any) => T[]; - /** The key that data will be stored in local storage under. Defaults to value of url. - * - */ - cacheKey?: string; - /** - * A string used for thumbprinting prefetched data. If this doesn't match what's stored in local storage, the data will be refetched. - */ - thumbprint?: string; - /** - * The ajax settings object passed to jQuery.ajax. - */ - ajax?: JQueryAjaxSettings; - } - - /** - * Remote data is only used when the data provided by local and prefetch - * is insufficient. In order to prevent an obscene number of requests - * being made to remote endpoint, typeahead.js rate-limits remote requests. - */ - interface RemoteOptions - { - /** - * A URL to make requests to when the data provided by local and - * prefetch is insufficient. Required. - */ - url: string; - /** - * The pattern in url that will be replaced with the user's query - * when a request is made. Defaults to %QUERY. - */ - wildcard?: string; - /** - * Overrides the request URL. If set, no wildcard substitution will - * be performed on url. - * - * @param url Replacement URL - * @param uriEncodedQuery Encoded query - * @returns A valid URL - */ - replace?: (url: string, uriEncodedQuery: string) => string; - /** - * The function used for rate-limiting network requests. - * Can be either 'debounce' or 'throttle'. Defaults to 'debounce'. - */ - rateLimitby?: string; - /** - * The time interval in milliseconds that will be used by rateLimitFn. - * Defaults to 300. - */ - rateLimitWait?: number; +declare module Bloodhound { + interface BloodhoundOptions { + /** + * Transforms a datum into an array of string tokens + * + * @constructor + * @param datum individual units that compose the dataset + */ + datumTokenizer?: any; + /** + * Transforms a query into an array of string tokens + * + * @constructor + * @param query tokenizer query + */ + queryTokenizer?: any; + /** + * The max number of suggestions to return from Bloodhound#get. + * If not reached, the data source will attempt to backfill the suggestions from remote. Defaults to 5 + */ + limit?: number; + /** + * If set, this is expected to be a function with the signature (remoteMatch, localMatch) that returns true if the datums are duplicates or false otherwise. + * If not set, duplicate detection will not be performed. + */ + dupDetector?: (remoteMatch: T, localMatch: T) => boolean; + /** + * A compare function used to sort matched datums for a given query. + */ + sorter?: (a: T, b: T) => number; + /** + * An array of datums or a function that returns an array of datums. + */ + local?: () => T[]; + /** + * Can be a URL to a JSON file containing an array of datums or, if more configurability is needed, a prefetch options hash. + */ + prefetch?: PrefetchOptions; + /** + * Can be a URL to fetch suggestions from when the data provided by local and prefetch is insufficient or, if more configurability is needed, a remote options hash. + */ + remote?: RemoteOptions; + } /** - * Transforms the response body into an array of datums. - * - * @param parsedResponse Response body + * Prefetched data is fetched and processed on initialization. + * If the browser supports localStorage, the processed data will be cached + * there to prevent additional network requests on subsequent page loads. */ - filter?: (parsedResponse: any) => T[]; + interface PrefetchOptions { + /** + * A URL to a JSON file containing an array of datums. Required. + */ + url: string; + /** + * The time (in milliseconds) the prefetched data should be cached + * in localStorage. Defaults to 86400000 (1 day). + */ + ttl?: number; + /** + * A function that transforms the response body into an array of datums. + * + * @param parsedResponse Response body + */ + filter?: (parsedResponse: any) => T[]; + /** The key that data will be stored in local storage under. Defaults to value of url. + * + */ + cacheKey?: string; + /** + * A string used for thumbprinting prefetched data. If this doesn't match what's stored in local storage, the data will be refetched. + */ + thumbprint?: string; + /** + * The ajax settings object passed to jQuery.ajax. + */ + ajax?: JQueryAjaxSettings; + } + /** - * The ajax settings object passed to jQuery.ajax. + * Remote data is only used when the data provided by local and prefetch + * is insufficient. In order to prevent an obscene number of requests + * being made to remote endpoint, typeahead.js rate-limits remote requests. */ - ajax?: JQueryAjaxSettings; + interface RemoteOptions { + /** + * A URL to make requests to when the data provided by local and + * prefetch is insufficient. Required. + */ + url: string; + /** + * The pattern in url that will be replaced with the user's query + * when a request is made. Defaults to %QUERY. + */ + wildcard?: string; + /** + * Overrides the request URL. If set, no wildcard substitution will + * be performed on url. + * + * @param url Replacement URL + * @param uriEncodedQuery Encoded query + * @returns A valid URL + */ + replace?: (url: string, uriEncodedQuery: string) => string; + /** + * The function used for rate-limiting network requests. + * Can be either 'debounce' or 'throttle'. Defaults to 'debounce'. + */ + rateLimitby?: string; + /** + * The time interval in milliseconds that will be used by rateLimitFn. + * Defaults to 300. + */ + rateLimitWait?: number; + + /** + * Transforms the response body into an array of datums. + * + * @param parsedResponse Response body + */ + filter?: (parsedResponse: any) => T[]; + /** + * The ajax settings object passed to jQuery.ajax. + */ + ajax?: JQueryAjaxSettings; - /** - * A function that provides a hook to allow you to prepare the settings object passed to transport - * when a request is about to be made. The function signature should be prepare(query, settings), - * where query is the query #search was called with and settings is the default settings object - * created internally by the Bloodhound instance. The prepare function should return a settings object. - * [Note: Added in 0.11.1] - * - * @param query The query #search was called with. - * @param settings The default settings object created internally by Bloodhound. - * @returns A JqueryAjaxSettings object. - */ - prepare?: (query: string, settings: JQueryAjaxSettings) => JQueryAjaxSettings; - } + /** + * A function that provides a hook to allow you to prepare the settings object passed to transport + * when a request is about to be made. The function signature should be prepare(query, settings), + * where query is the query #search was called with and settings is the default settings object + * created internally by the Bloodhound instance. The prepare function should return a settings object. + * [Note: Added in 0.11.1] + * + * @param query The query #search was called with. + * @param settings The default settings object created internally by Bloodhound. + * @returns A JqueryAjaxSettings object. + */ + prepare?: (query: string, settings: JQueryAjaxSettings) => JQueryAjaxSettings; + } - /** - * The most common tokenization methods. - */ - interface Tokenizers - { /** - * Split a given string on whitespace characters. + * The most common tokenization methods. */ - whitespace(query: string): string[]; - /** - * Split a given string on non-word characters. - */ - nonword(query: string): string[]; + interface Tokenizers { + /** + * Split a given string on whitespace characters. + */ + whitespace(query: string): string[]; + /** + * Split a given string on non-word characters. + */ + nonword(query: string): string[]; - /** - * Instances of the most common tokenization methods. - */ - obj: ObjTokenizer; - } + /** + * Instances of the most common tokenization methods. + */ + obj: ObjTokenizer; + } - interface ObjTokenizer - { - /** - * Split a given string on whitespace characters. - */ - whitespace(query: string): string[]; - /** - * Split a given string on non-word characters. - */ - nonword(query: string): string[]; - } + interface ObjTokenizer { + /** + * Split a given string on whitespace characters. + */ + whitespace(query: string): string[]; + /** + * Split a given string on non-word characters. + */ + nonword(query: string): string[]; + } } declare class Bloodhound { - constructor(options: Bloodhound.BloodhoundOptions); - /** - * wraps the suggestion engine in an adapter that is compatible with the typeahead jQuery plugin - */ - public ttAdapter(): any; - /** - * Kicks off the initialization of the suggestion engine. This includes processing the data provided through local and fetching/processing the data provided through prefetch. - * Until initialized, all other methods will behave as no-ops. - * Returns a jQuery promise which is resolved when engine has been initialized. - * - * After the initial call of initialize, how subsequent invocations of the method behave depends on the reinitialize argument. - * If reinitialize is falsy, the method will not execute the initialization logic and will just return the same jQuery promise returned by the initial invocation. - * If reinitialize is truthy, the method will behave as if it were being called for the first time. - * - * var promise1 = engine.initialize(); - * var promise2 = engine.initialize(); - * var promise3 = engine.initialize(true); - * - * promise1 === promise2; - * promise3 !== promise1 && promise3 !== promise2; - */ - public initialize(reinitialize?: boolean): JQueryPromise; - /** - * Takes one argument, datums, which is expected to be an array of datums. - * The passed in datums will get added to the search index that powers the suggestion engine. - */ - public add(datums: T[]): void; - /** - * Removes all suggestions from the search index. - */ - public clear(): void; - /** - * If you're using prefetch, data gets cached in local storage in an effort to cut down on unnecessary network requests. - * clearPrefetchCache offers a way to programmatically clear said cache. - */ - public clearPrefetchCache(): void; - /** - * If you're using remote, Bloodhound will cache the 10 most recent responses in an effort to provide a better user experience. - * clearRemoteCache offers a way to programmatically clear said cache. - */ - public clearRemoteCache(): void; - /** - * Returns a reference to the Bloodhound constructor and reverts window.Bloodhound to its previous value. Can be used to avoid naming collisions. - */ - public noConflict(): any; + constructor(options: Bloodhound.BloodhoundOptions); + /** + * wraps the suggestion engine in an adapter that is compatible with the typeahead jQuery plugin + */ + public ttAdapter(): any; + /** + * Kicks off the initialization of the suggestion engine. This includes processing the data provided through local and fetching/processing the data provided through prefetch. + * Until initialized, all other methods will behave as no-ops. + * Returns a jQuery promise which is resolved when engine has been initialized. + * + * After the initial call of initialize, how subsequent invocations of the method behave depends on the reinitialize argument. + * If reinitialize is falsy, the method will not execute the initialization logic and will just return the same jQuery promise returned by the initial invocation. + * If reinitialize is truthy, the method will behave as if it were being called for the first time. + * + * var promise1 = engine.initialize(); + * var promise2 = engine.initialize(); + * var promise3 = engine.initialize(true); + * + * promise1 === promise2; + * promise3 !== promise1 && promise3 !== promise2; + */ + public initialize(reinitialize?: boolean): JQueryPromise; + /** + * Takes one argument, datums, which is expected to be an array of datums. + * The passed in datums will get added to the search index that powers the suggestion engine. + */ + public add(datums: T[]): void; + /** + * Removes all suggestions from the search index. + */ + public clear(): void; + /** + * If you're using prefetch, data gets cached in local storage in an effort to cut down on unnecessary network requests. + * clearPrefetchCache offers a way to programmatically clear said cache. + */ + public clearPrefetchCache(): void; + /** + * If you're using remote, Bloodhound will cache the 10 most recent responses in an effort to provide a better user experience. + * clearRemoteCache offers a way to programmatically clear said cache. + */ + public clearRemoteCache(): void; + /** + * Returns a reference to the Bloodhound constructor and reverts window.Bloodhound to its previous value. Can be used to avoid naming collisions. + */ + public noConflict(): any; - /** - * Computes a set of suggestions for query. cb will be invoked with an array of datums that represent said set. - * cb will always be invoked once synchronously with suggestions that were available on the client. - * If those suggestions are insufficient (# of suggestions is less than limit) and remote was configured, cb may also be invoked asynchronously with the suggestions available on the client mixed with suggestions from the remote source. - */ - public get(query: string, cb: (datums: T[]) => void): void; + /** + * Computes a set of suggestions for query. cb will be invoked with an array of datums that represent said set. + * cb will always be invoked once synchronously with suggestions that were available on the client. + * If those suggestions are insufficient (# of suggestions is less than limit) and remote was configured, cb may also be invoked asynchronously with the suggestions available on the client mixed with suggestions from the remote source. + */ + public get(query: string, cb: (datums: T[]) => void): void; - /** - * The Bloodhound suggestion engine is token-based, so how datums and queries are tokenized plays a vital role in the quality of search results. - * Specify how you want datums and queries tokenized. - */ - public static tokenizers: Bloodhound.Tokenizers; + /** + * The Bloodhound suggestion engine is token-based, so how datums and queries are tokenized plays a vital role in the quality of search results. + * Specify how you want datums and queries tokenized. + */ + public static tokenizers: Bloodhound.Tokenizers; } declare module "bloodhound" { - export = Bloodhound; + export = Bloodhound; } diff --git a/ui-grid/ui-grid-tests.ts b/ui-grid/ui-grid-tests.ts index fe88fec4f..e89f180b9 100644 --- a/ui-grid/ui-grid-tests.ts +++ b/ui-grid/ui-grid-tests.ts @@ -130,3 +130,14 @@ anotherGridInstance.scrollTo(rowEntityToScrollTo, columnDefToScrollTo); var selectedRowEntities: Array = gridApi.selection.getSelectedRows(); var selectedGridRows: Array = gridApi.selection.getSelectedGridRows(); + +gridApi.expandable.on.rowExpandedStateChanged(null, (row) => { + if (row.isExpanded) { + console.log('expanded', row.entity); + } else { + gridApi.expandable.toggleRowExpansion(row.entity); + } +}); +gridApi.expandable.expandAllRows(); +gridApi.expandable.collapseAllRows(); +gridApi.expandable.toggleAllRows(); diff --git a/ui-grid/ui-grid.d.ts b/ui-grid/ui-grid.d.ts index cba3c69ac..e6dd7468d 100644 --- a/ui-grid/ui-grid.d.ts +++ b/ui-grid/ui-grid.d.ts @@ -1558,6 +1558,18 @@ declare module uiGrid { */ (row: IGridRowOf): void; } + + /** + * GridRow settings for expandable + */ + export interface IGridRow { + /** + * If set to true, the row is expanded and the expanded view is visible + * Defaults to false + * @default false + */ + isExpanded?: boolean; + } } export module exporter { @@ -3418,7 +3430,7 @@ declare module uiGrid { } export type IGridRow = IGridRowOf; export interface IGridRowOf extends cellNav.IGridRow, edit.IGridRow, exporter.IGridRow, - selection.IGridRow { + selection.IGridRow, expandable.IGridRow { /** A reference to an item in gridOptions.data[] */ entity: TEntity; /** A reference back to the grid */ @@ -3527,6 +3539,8 @@ declare module uiGrid { filter?: IFilterOptions; /** Filters for this column. Includes 'term' property bound to filter input elements */ filters?: Array; + /** Reference to grid containing the column */ + grid: IGridInstanceOf; name?: string; /** Sort on this column */ sort?: ISortInfo; @@ -3843,7 +3857,7 @@ declare module uiGrid { * defaults to uiGridConstants.filter.INPUT, which gives a text box. If set to uiGridConstants.filter.SELECT * then a select box will be shown with options selectOptions */ - type?: number; + type?: number | string; /** * options in the format [{ value: 1, label: 'male' }]. No i18n filter is provided, you need to perform the i18n * on the values before you provide them @@ -3856,7 +3870,7 @@ declare module uiGrid { disableCancelButton?: boolean; } export interface ISelectOption { - value: number; + value: number | string; label: string; } diff --git a/umzug/umzug-tests.ts b/umzug/umzug-tests.ts new file mode 100644 index 000000000..95d7521fd --- /dev/null +++ b/umzug/umzug-tests.ts @@ -0,0 +1,134 @@ +/// +/// +/// + +import Umzug = require("umzug"); +import Sequelize = require("sequelize"); + + +var umzug = new Umzug({}); + +umzug.up().then(function (result) { + // do something with the result +}); + +umzug.execute({ + migrations: ['some-id', 'some-other-id'], + method: 'up' +}).then(function (migrations) { + // "migrations" will be an Array of all executed/reverted migrations. +}); + +umzug.pending().then(function (migrations) { + // "migrations" will be an Array with the names of + // pending migrations. +}); + +umzug.executed().then(function (migrations) { + // "migrations" will be an Array of already executed migrations. +}); + +umzug.up().then(function (migrations) { + // "migrations" will be an Array with the names of the + // executed migrations. +}); + +umzug.up({ to: '20141101203500-task' }).then(function (migrations) {}); + +umzug.up({ migrations: ['20141101203500-task', '20141101203501-task-2'] }); + +umzug.up('20141101203500-task'); // Runs just the passed migration +umzug.up(['20141101203500-task', '20141101203501-task-2']); + +umzug.down().then(function (migration) { + // "migration" will the name of the reverted migration. +}); + +umzug.down({ to: '20141031080000-task' }).then(function (migrations) { + // "migrations" will be an Array with the names of all reverted migrations. +}); + +umzug.down({ migrations: ['20141101203500-task', '20141101203501-task-2'] }); + +umzug.down('20141101203500-task'); // Runs just the passed migration +umzug.down(['20141101203500-task', '20141101203501-task-2']); + +var AnotherUmzug = new Umzug({ + // The storage. + // Possible values: 'json', 'sequelize', an object + storage: 'json', + + // The options for the storage. + // Check the available storages for further details. + storageOptions: {}, + + // The logging function. + // A function that gets executed everytime migrations start and have ended. + logging: false, + + // The name of the positive method in migrations. + upName: 'up', + + // The name of the negative method in migrations. + downName: 'down', + + migrations: { + // The params that gets passed to the migrations. + // Might be an array or a synchronous function which returns an array. + params: [], + + // The path to the migrations directory. + path: 'migrations', + + // The pattern that determines whether or not a file is a migration. + pattern: /^\d+[\w-]+\.js$/, + + // A function that receives and returns the to be executed function. + // This can be used to modify the function. + wrap: function (fun : Function) { return fun; } + } +}); + +var AnotherUmzug = new Umzug({ + // The storage. + // Possible values: 'json', 'sequelize', an object + storage: 'json', + storageOptions: { + path: process.cwd() + '/db/sequelize-meta.json' + } +}); + +var sequelize = new Sequelize(''); + +var AnotherUmzug = new Umzug({ + // The storage. + // Possible values: 'json', 'sequelize', an object + storage: 'sequelize', + storageOptions: { + // The configured instance of Sequelize. + // Optional if `model` is passed. + sequelize: sequelize, + + // The to be used Sequelize model. + // Must have column name matching `columnName` option + // Optional of `sequelize` is passed. + model: sequelize.define( 'model', {} ), + + // The name of the to be used model. + // Defaults to 'SequelizeMeta' + modelName: 'Schema', + + // The name of table to create if `model` option is not supplied + // Defaults to `modelName` + tableName: 'Schema', + + // The name of table column holding migration name. + // Defaults to 'name'. + columnName: 'migration', + + // The type of the column holding migration name. + // Defaults to `Sequelize.STRING` + columnType: Sequelize.STRING(100) + } + +}); diff --git a/umzug/umzug.d.ts b/umzug/umzug.d.ts new file mode 100644 index 000000000..2e2b20a7c --- /dev/null +++ b/umzug/umzug.d.ts @@ -0,0 +1,188 @@ +// Type definitions for Umzug v1.7.0 +// Project: https://github.com/sequelize/umzug +// Definitions by: Ivan Drinchev +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// +/// + +declare module "umzug" { + + import Sequelize = require("sequelize"); + + interface MigrationOptions { + + /* + * The params that gets passed to the migrations. + * Might be an array or a synchronous function which returns an array. + */ + params?: Array; + + /** The path to the migrations directory. */ + path?: string; + + /** The pattern that determines whether or not a file is a migration. */ + pattern?: RegExp; + + /** + * A function that receives and returns the to be executed function. + * This can be used to modify the function. + */ + wrap?: ( fn : T ) => T; + + } + + interface JSONStorageOptions { + + /** + * The path to the json storage. + * Defaults to process.cwd() + '/umzug.json'; + */ + path?: string; + + } + + interface SequelizeStorageOptions { + + /** + * The configured instance of Sequelize. + * Optional if `model` is passed. + */ + sequelize?: Sequelize.Sequelize; + + /** + * The to be used Sequelize model. + * Must have column name matching `columnName` option + * Optional of `sequelize` is passed. + */ + model?: Sequelize.Model; + + /** + * The name of the to be used model. + * Defaults to 'SequelizeMeta' + */ + modelName?: string; + + /** + * The name of table to create if `model` option is not supplied + * Defaults to `modelName` + */ + tableName?: string; + + /** + * The name of table column holding migration name. + * Defaults to 'name'. + */ + columnName: string; + + /** + * The type of the column holding migration name. + * Defaults to `Sequelize.STRING` + */ + columnType: Sequelize.DataTypeAbstract; + + } + + interface ExecuteOptions { + migrations?: Array; + method?: string; + } + + interface UmzugOptions { + + /** + * The storage. + * Possible values: 'json', 'sequelize', an object + */ + storage?: string; + + /** + * The options for the storage. + */ + storageOptions?: JSONStorageOptions | SequelizeStorageOptions | Object; + + /** + * The logging function. + * A function that gets executed everytime migrations start and have ended. + */ + logging? : boolean | Function; + + /** + * The name of the positive method in migrations. + */ + upName? : string; + + /** + * The name of the negative method in migrations. + */ + downName? : string; + + /** + * Options for defined migration + */ + migrations? : MigrationOptions; + + } + + interface UpDownToOptions { + + /** + * It is also possible to pass the name of a migration in order to + * just run the migrations from the current state to the passed + * migration name. + */ + to: string; + + } + + interface UpDownMigrationsOptions { + + /** + * Running specific migrations while ignoring the right order, can be + * done like this: + */ + migrations: Array; + + } + + class Umzug { + + constructor(options?: UmzugOptions); + + /** + * The execute method is a general purpose function that runs for + * every specified migrations the respective function. + */ + execute(options? : ExecuteOptions) : Promise>; + + /** + * You can get a list of pending/not yet executed migrations like this: + */ + pending() : Promise>; + + /** + * You can get a list of already executed migrations like this: + */ + executed() : Promise>; + + /** + * The up method can be used to execute all pending migrations. + */ + up(migration?: string) : Promise; + up(migrations?: Array) : Promise>; + up(options?: UpDownToOptions | UpDownMigrationsOptions ) : Promise>; + + /** + * The down method can be used to revert the last executed migration. + */ + down(migration?: string) : Promise; + down(migrations?: Array) : Promise>; + down(options?: UpDownToOptions | UpDownMigrationsOptions ) : Promise>; + + } + + var umzug : typeof Umzug; + + export = umzug; + +} diff --git a/underscore/underscore-tests.ts b/underscore/underscore-tests.ts index 13410c23b..051e000d0 100644 --- a/underscore/underscore-tests.ts +++ b/underscore/underscore-tests.ts @@ -17,9 +17,135 @@ var list = [[0, 1], [2, 3], [4, 5]]; //var flat = _.reduceRight(list, (a, b) => a.concat(b), []); // https://typescript.codeplex.com/workitem/1960 var flat = _.reduceRight(list, (a, b) => a.concat(b), []); -var even = _.find([1, 2, 3, 4, 5, 6], (num) => num % 2 == 0); +module TestFind { + let array: {a: string}[] = [{a: 'a'}, {a: 'b'}]; + let list: _.List<{a: string}> = {0: {a: 'a'}, 1: {a: 'b'}, length: 2}; + let dict: _.Dictionary<{a: string}> = {a: {a: 'a'}, b: {a: 'b'}}; + let context = {}; -var firstCapitalLetter = _.find({ a: 'a', b: 'B', c: 'C', d: 'd' }, l => l === l.toUpperCase()); + { + let iterator = (value: {a: string}, index: number, list: _.List<{a: string}>) => value.a === 'b'; + let result: {a: string}; + + result = _.find<{a: string}>(array, iterator); + result = _.find<{a: string}>(array, iterator, context); + result = _.find<{a: string}, {a: string}>(array, {a: 'b'}); + result = _.find<{a: string}>(array, 'a'); + + result = _(array).find<{a: string}>(iterator); + result = _(array).find<{a: string}>(iterator, context); + result = _(array).find<{a: string}, {a: string}>({a: 'b'}); + result = _(array).find<{a: string}>('a'); + + result = _(array).chain().find<{a: string}>(iterator).value(); + result = _(array).chain().find<{a: string}>(iterator, context).value(); + result = _(array).chain().find<{a: string}, {a: string}>({a: 'b'}).value(); + result = _(array).chain().find<{a: string}>('a').value(); + + result = _.find<{a: string}>(list, iterator); + result = _.find<{a: string}>(list, iterator, context); + result = _.find<{a: string}, {a: string}>(list, {a: 'b'}); + result = _.find<{a: string}>(list, 'a'); + + result = _(list).find<{a: string}>(iterator); + result = _(list).find<{a: string}>(iterator, context); + result = _(list).find<{a: string}, {a: string}>({a: 'b'}); + result = _(list).find<{a: string}>('a'); + + result = _(list).chain().find<{a: string}>(iterator).value(); + result = _(list).chain().find<{a: string}>(iterator, context).value(); + result = _(list).chain().find<{a: string}, {a: string}>({a: 'b'}).value(); + result = _(list).chain().find<{a: string}>('a').value(); + + result = _.detect<{a: string}>(array, iterator); + result = _.detect<{a: string}>(array, iterator, context); + result = _.detect<{a: string}, {a: string}>(array, {a: 'b'}); + result = _.detect<{a: string}>(array, 'a'); + + result = _(array).detect<{a: string}>(iterator); + result = _(array).detect<{a: string}>(iterator, context); + result = _(array).detect<{a: string}, {a: string}>({a: 'b'}); + result = _(array).detect<{a: string}>('a'); + + result = _(array).chain().detect<{a: string}>(iterator).value(); + result = _(array).chain().detect<{a: string}>(iterator, context).value(); + result = _(array).chain().detect<{a: string}, {a: string}>({a: 'b'}).value(); + result = _(array).chain().detect<{a: string}>('a').value(); + + result = _.detect<{a: string}>(list, iterator); + result = _.detect<{a: string}>(list, iterator, context); + result = _.detect<{a: string}, {a: string}>(list, {a: 'b'}); + result = _.detect<{a: string}>(list, 'a'); + + result = _(list).detect<{a: string}>(iterator); + result = _(list).detect<{a: string}>(iterator, context); + result = _(list).detect<{a: string}, {a: string}>({a: 'b'}); + result = _(list).detect<{a: string}>('a'); + + result = _(list).chain().detect<{a: string}>(iterator).value(); + result = _(list).chain().detect<{a: string}>(iterator, context).value(); + result = _(list).chain().detect<{a: string}, {a: string}>({a: 'b'}).value(); + result = _(list).chain().detect<{a: string}>('a').value(); + } + + { + let iterator = (element: {a: string}, key: string, list: _.Dictionary<{a: string}>) => element.a === 'b'; + let result: {a: string}; + + result = _.find<{a: string}>(dict, iterator); + result = _.find<{a: string}>(dict, iterator, context); + result = _.find<{a: string}, {a: string}>(dict, {a: 'b'}); + result = _.find<{a: string}>(dict, 'a'); + + result = _(dict).find<{a: string}>(iterator); + result = _(dict).find<{a: string}>(iterator, context); + result = _(dict).find<{a: string}, {a: string}>({a: 'b'}); + result = _(dict).find<{a: string}>('a'); + + result = _(dict).chain().find<{a: string}>(iterator).value(); + result = _(dict).chain().find<{a: string}>(iterator, context).value(); + result = _(dict).chain().find<{a: string}, {a: string}>({a: 'b'}).value(); + result = _(dict).chain().find<{a: string}>('a').value(); + + result = _.detect<{a: string}>(dict, iterator); + result = _.detect<{a: string}>(dict, iterator, context); + result = _.detect<{a: string}, {a: string}>(dict, {a: 'b'}); + result = _.detect<{a: string}>(dict, 'a'); + + result = _(dict).detect<{a: string}>(iterator); + result = _(dict).detect<{a: string}>(iterator, context); + result = _(dict).detect<{a: string}, {a: string}>({a: 'b'}); + result = _(dict).detect<{a: string}>('a'); + + result = _(dict).chain().detect<{a: string}>(iterator).value(); + result = _(dict).chain().detect<{a: string}>(iterator, context).value(); + result = _(dict).chain().detect<{a: string}, {a: string}>({a: 'b'}).value(); + result = _(dict).chain().detect<{a: string}>('a').value(); + } + + { + let iterator = (value: string, index: number, list: _.List) => value === 'b'; + let result: string; + + result = _.find('abc', iterator); + result = _.find('abc', iterator, context); + + result = _('abc').find(iterator); + result = _('abc').find(iterator, context); + + result = _('abc').chain().find(iterator).value(); + result = _('abc').chain().find(iterator, context).value(); + + result = _.detect('abc', iterator); + result = _.detect('abc', iterator, context); + + result = _('abc').detect(iterator); + result = _('abc').detect(iterator, context); + + result = _('abc').chain().detect(iterator).value(); + result = _('abc').chain().detect(iterator, context).value(); + } +} var evens = _.filter([1, 2, 3, 4, 5, 6], (num) => num % 2 == 0); diff --git a/underscore/underscore.d.ts b/underscore/underscore.d.ts index 7dea66a84..8cf98071b 100644 --- a/underscore/underscore.d.ts +++ b/underscore/underscore.d.ts @@ -254,6 +254,20 @@ interface UnderscoreStatic { iterator: _.ObjectIterator, context?: any): T; + /** + * @see _.find + **/ + find( + object: _.List|_.Dictionary, + iterator: U): T; + + /** + * @see _.find + **/ + find( + object: _.List|_.Dictionary, + iterator: string): T; + /** * @see _.find **/ @@ -270,6 +284,20 @@ interface UnderscoreStatic { iterator: _.ObjectIterator, context?: any): T; + /** + * @see _.find + **/ + detect( + object: _.List|_.Dictionary, + iterator: U): T; + + /** + * @see _.find + **/ + detect( + object: _.List|_.Dictionary, + iterator: string): T; + /** * Looks through each value in the list, returning the index of the first one that passes a truth * test (iterator). The function returns as soon as it finds an acceptable element, @@ -1696,12 +1724,32 @@ interface Underscore { * Wrapped type `any[]`. * @see _.find **/ - find(iterator: _.ListIterator, context?: any): T; + find(iterator: _.ListIterator|_.ObjectIterator, context?: any): T; /** * @see _.find **/ - detect(iterator: _.ListIterator, context?: any): T; + find(interator: U): T; + + /** + * @see _.find + **/ + find(interator: string): T; + + /** + * @see _.find + **/ + detect(iterator: _.ListIterator|_.ObjectIterator, context?: any): T; + + /** + * @see _.find + **/ + detect(interator?: U): T; + + /** + * @see _.find + **/ + detect(interator?: string): T; /** * Wrapped type `any[]`. @@ -2554,12 +2602,32 @@ interface _Chain { * Wrapped type `any[]`. * @see _.find **/ - find(iterator: _.ListIterator, context?: any): _ChainSingle; + find(iterator: _.ListIterator|_.ObjectIterator, context?: any): _ChainSingle; /** * @see _.find **/ - detect(iterator: _.ListIterator, context?: any): _Chain; + find(interator: U): _ChainSingle; + + /** + * @see _.find + **/ + find(interator: string): _ChainSingle; + + /** + * @see _.find + **/ + detect(iterator: _.ListIterator|_.ObjectIterator, context?: any): _ChainSingle; + + /** + * @see _.find + **/ + detect(interator: U): _ChainSingle; + + /** + * @see _.find + **/ + detect(interator: string): _ChainSingle; /** * Wrapped type `any[]`. diff --git a/wake_on_lan/wake_on_lan-tests.ts b/wake_on_lan/wake_on_lan-tests.ts new file mode 100644 index 000000000..35c8754cd --- /dev/null +++ b/wake_on_lan/wake_on_lan-tests.ts @@ -0,0 +1,39 @@ +/// +/// + +import wol = require('wake_on_lan'); + +wol.wake("20:DE:20:DE:20:DE"); + +let errFunc:wol.ErrorCallback = function(error:any) { + if (error) { + // handle error + } else { + // done sending packets + } +}; + +var opts:wol.WakeOptions = { address: "192.168.1.1" }; +var opts1:wol.WakeOptions = { address: "192.168.1.1", num_packets: 3 }; +var opts2:wol.WakeOptions = { address: "192.168.1.1", num_packets: 3, interval: 4 }; +var opts3:wol.WakeOptions = { address: "192.168.1.1", num_packets: 3, interval: 4, port: 5 }; +var opts4:wol.WakeOptions = { address: "192.168.1.1" }; +var opts5:wol.WakeOptions = { address: "192.168.1.1", interval: 4 }; +var opts6:wol.WakeOptions = { address: "192.168.1.1", port: 5 }; +var opts7:wol.WakeOptions = { address: "192.168.1.1", interval: 4, port: 5 }; +var opts8:wol.WakeOptions = { num_packets: 3 }; +var opts9:wol.WakeOptions = { num_packets: 3, interval: 4 }; +var opts10:wol.WakeOptions = { num_packets: 3, port: 5 }; +var opts11:wol.WakeOptions = { num_packets: 3, interval: 4, port: 5 }; +var opts12:wol.WakeOptions = { interval: 4 }; +var opts13:wol.WakeOptions = { interval: 4, port: 5 }; +var opts14:wol.WakeOptions = { port: 5 }; +var opts15:wol.WakeOptions = { }; + +wol.wake('20:DE:20:DE:20:DE'); +wol.wake('20:DE:20:DE:20:DE', opts); +wol.wake('20:DE:20:DE:20:DE', errFunc); +wol.wake('20:DE:20:DE:20:DE', opts, errFunc); + + +var magic_packet:Buffer = wol.createMagicPacket('20:DE:20:DE:20:DE'); \ No newline at end of file diff --git a/wake_on_lan/wake_on_lan.d.ts b/wake_on_lan/wake_on_lan.d.ts new file mode 100644 index 000000000..97e4a7177 --- /dev/null +++ b/wake_on_lan/wake_on_lan.d.ts @@ -0,0 +1,73 @@ +// Type definitions for wake_on_lan +// Project: https://github.com/agnat/node_wake_on_lan +// Definitions by: Tobias Kahlert +// Definitions: https://github.com/SrTobi/DefinitelyTyped + +/// + +declare module wol { + + export interface WakeOptions { + + /** + * The ip address to which the packet is send (default: 255.255.255.255) + */ + address?:string; + + /** + * Number of packets to send (default: 3) + */ + num_packets?:number; + + /** + * The interval between packets (default: 100ms) + */ + interval?:number; + + /** + * The port to send to (default: 9) + */ + port?:number; + } + + type ErrorCallback = (Error:any) => void; + + export interface Wol { + /** + * Send a sequence of Wake-on-LAN magic packets to the given MAC address. + * + * @param {string} macAddress the mac address of the target device + */ + wake(macAddress:string):void; + + /** + * Send a sequence of Wake-on-LAN magic packets to the given MAC address. + * + * @param {string} macAddress the mac address of the target device + * @param {ErrorCallback} callback is called when all packets have been sent or an error occurs. + */ + wake(macAddress:string, callback:ErrorCallback):void; + + /** + * Send a sequence of Wake-on-LAN magic packets to the given MAC address. + * + * @param {string} macAddress the mac address of the target device + * @param {WakeOptions} opts additional options to send the packet + * @param {ErrorCallback} callback is called when all packets have been sent or an error occurs. + */ + wake(macAddress:string, opts:WakeOptions, callback?:Function):void; + + /** + * Creates a buffer with a magic packet for the given MAC address. + * + * @param {string} macAddress mac address of the target device + * @return {Buffer} the magic packet + */ + createMagicPacket(macAddress:string):Buffer; + } +} + +declare module 'wake_on_lan' { + var wol: wol.Wol; + export = wol; +} diff --git a/whatwg-fetch/whatwg-fetch-tests.ts b/whatwg-fetch/whatwg-fetch-tests.ts index b6bae3066..75fead12d 100644 --- a/whatwg-fetch/whatwg-fetch-tests.ts +++ b/whatwg-fetch/whatwg-fetch-tests.ts @@ -39,6 +39,13 @@ function test_fetchUrlWithRequestObject() { handlePromise(window.fetch(request)); } +function test_globalFetchVar() { + fetch('http://test.com', {}) + .then(response => { + // for test only + }); +} + function handlePromise(promise: Promise) { promise.then((response) => { if (response.type === 'basic') { diff --git a/whatwg-fetch/whatwg-fetch.d.ts b/whatwg-fetch/whatwg-fetch.d.ts index c6d95e87a..a1d82c55f 100644 --- a/whatwg-fetch/whatwg-fetch.d.ts +++ b/whatwg-fetch/whatwg-fetch.d.ts @@ -83,3 +83,5 @@ declare type RequestInfo = Request|string; interface Window { fetch(url: string|Request, init?: RequestInit): Promise; } + +declare var fetch: typeof window.fetch; diff --git a/winjs/winjs.d.ts b/winjs/winjs.d.ts index 903019698..5f6309b23 100644 --- a/winjs/winjs.d.ts +++ b/winjs/winjs.d.ts @@ -10620,3 +10620,7 @@ declare module WinJS.Utilities.Scheduler { //#endregion Functions } + +declare module 'winjs' { + export = WinJS; +} diff --git a/wordcloud/wordcloud-tests.ts b/wordcloud/wordcloud-tests.ts new file mode 100644 index 000000000..2eecca3b8 --- /dev/null +++ b/wordcloud/wordcloud-tests.ts @@ -0,0 +1,196 @@ +/// +/// + +'use strict'; +//declare function test(name: string, test: Function); +var element: HTMLElement | HTMLElement[]; + +if (!WordCloud.isSupported) + console.log('WordCloud is not supported.'); + +WordCloud.miniumFontSize = 20; + +var list = (function () { + var string = 'Grumpy wizards make toxic brew for the evil Queen and Jack'; + + var list: WordCloud.ListEntry[] = []; + string.split(' ').forEach(function(word) { + list.push([word, word.length * 5]); + }); + + return list; +})(); + +function getTestOptions(): WordCloud.Options { + return { + shuffle: false, + rotateRatio: 0, + color: '#000', + fontFamily: 'sans-serif', + list: list + }; +}; + +test('Test runs without any extra parameters.', function() { + var options = getTestOptions(); + WordCloud(element, options); +}); + +test('Empty list results no output.', function() { + var options = getTestOptions(); + options.list = []; + + WordCloud(element, options); +}); + +test('gridSize can be set', function() { + var options = getTestOptions(); + options.gridSize = 15; + + WordCloud(element, options); +}); + +test('ellipticity can be set', function() { + var options = getTestOptions(); + options.ellipticity = 1.5; + + WordCloud(element, options); +}); + +test('origin can be set', function() { + var options = getTestOptions(); + options.origin = [300, 0]; + + WordCloud(element, options); +}); + +test('minSize can be set', function() { + var options = getTestOptions(); + options.minSize = 10; + + WordCloud(element, options); +}); + +test('rotation can be set and locked', function() { + var options = getTestOptions(); + options.rotateRatio = 1; + options.minRotation = options.maxRotation = Math.PI / 6; + + WordCloud(element, options); +}); + +test('drawMask can be set', function() { + var options = getTestOptions(); + options.drawMask = true; + + WordCloud(element, options); +}); + +test('maskColor can be set', function() { + var options = getTestOptions(); + options.drawMask = true; + options.maskColor = 'rgba(0, 0, 255, 0.8)'; + + WordCloud(element, options); +}); + +test('backgroundColor can be set', function() { + var options = getTestOptions(); + options.backgroundColor = 'rgb(0, 0, 255)'; + + WordCloud(element, options); +}); + +test('semi-transparent backgroundColor can be set', function() { + var options = getTestOptions(); + options.backgroundColor = 'rgba(0, 0, 255, 0.3)'; + + WordCloud(element, options); +}); + +test('weightFactor can be set', function() { + var options = getTestOptions(); + options.weightFactor = 2; + + WordCloud(element, options); +}); + +test('weightFactor can be set as a function', function() { + var options = getTestOptions(); + options.weightFactor = function (w) { return Math.sqrt(w); }; + + WordCloud(element, options); +}); + +test('color can be set as a function', function() { + var options = getTestOptions(); + options.color = function (word, weight, fontSize, radius, theta) { + if (theta < 2*Math.PI/3) { + return '#600'; + } else if (theta < 2*Math.PI*2/3) { + return '#060'; + } else { + return '#006'; + } + }; + + WordCloud(element, options); +}); + +test('shape can be set to circle', function() { + var options = getTestOptions(); + options.shape = 'circle'; + + WordCloud(element, options); +}); + +test('shape can be set to cardioid', function() { + var options = getTestOptions(); + options.shape = 'cardioid'; + + WordCloud(element, options); +}); + +test('shape can be set to diamond', function() { + var options = getTestOptions(); + options.shape = 'diamond'; + + WordCloud(element, options); +}); + +test('shape can be set to triangle', function() { + var options = getTestOptions(); + options.shape = 'triangle'; + + WordCloud(element, options); +}); + +test('shape can be set to triangle-forward', function() { + var options = getTestOptions(); + options.shape = 'triangle-forward'; + + WordCloud(element, options); +}); + +test('shape can be set to pentagon', function() { + var options = getTestOptions(); + options.shape = 'pentagon'; + + WordCloud(element, options); +}); + +test('shape can be set to star', function() { + var options = getTestOptions(); + options.shape = 'star'; + + WordCloud(element, options); +}); + +test('shape can be set to a given polar equation', function() { + var options = getTestOptions(); + options.shape = function (theta) { + return theta / (2 * Math.PI); + }; + + WordCloud(element, options); +}); \ No newline at end of file diff --git a/wordcloud/wordcloud.d.ts b/wordcloud/wordcloud.d.ts new file mode 100644 index 000000000..61c7003a4 --- /dev/null +++ b/wordcloud/wordcloud.d.ts @@ -0,0 +1,105 @@ +// Type definitions for wordcloud +// Project: https://github.com/timdream/wordcloud2.js +// Definitions by: Joe Skeen +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare function WordCloud(elements: HTMLElement | HTMLElement[], options: WordCloud.Options): void; + +declare namespace WordCloud { + var isSupported: boolean; + var miniumFontSize: number; + + interface Options { + /** + * List of words/text to paint on the canvas in a 2-d array, in the form of [word, size], + * e.g. [['foo', 12] , ['bar', 6]]. + */ + list?: Array | any[]; + /** font to use. */ + fontFamily?: string; + /** font weight to use, e.g. normal, bold or 600 */ + fontWeight?: string | number; + /** + * color of the text, can be any CSS color, or a callback(word, weight, fontSize, distance, theta) + * specifies different color for each item in the list. You may also specify colors with built-in + * keywords: random-dark and random-light. + */ + color?: string | ((word: string, weight: string | number, fontSize: number, distance: number, theta: number) => string); + /** minimum font size to draw on the canvas. */ + minSize?: number; + /** function to call or number to multiply for size of each word in the list. */ + weightFactor?: number | ((weight: number) => number); + /** paint the entire canvas with background color and consider it empty before start. */ + clearCanvas?: boolean; + /** color of the background. */ + backgroundColor?: string; + + /** + * size of the grid in pixels for marking the availability of the canvas — the larger the grid size, + * the bigger the gap between words. + */ + gridSize?: number; + /** origin of the “cloud” in [x, y]. */ + origin?: [number, number]; + + /** visualize the grid by draw squares to mask the drawn areas. */ + drawMask?: boolean; + /** color of the mask squares. */ + maskColor?: string; + /** width of the gaps between mask squares. */ + maskGapWidth?: number; + + /** Wait for x milliseconds before start drawn the next item using setTimeout. */ + wait?: number; + /** If the call with in the loop takes more than x milliseconds (and blocks the browser), abort immediately. */ + abortThreshold?: number; + /** callback function to call when abort. */ + abort?: Function; + + /** If the word should rotate, the minimum rotation (in rad) the text should rotate. */ + minRotation?: number; + /** + * If the word should rotate, the maximum rotation (in rad) the text should rotate. Set the two value equal + * to keep all text in one angle. + */ + maxRotation?: number; + + /** Shuffle the points to draw so the result will be different each time for the same list and settings. */ + shuffle?: boolean; + /** Probability for the word to rotate. Set the number to 1 to always rotate. */ + rotateRatio?: number; + + /** + * The shape of the "cloud" to draw. Can be any polar equation represented as a callback function, or a + * keyword present. Available presents are circle (default), cardioid (apple or heart shape curve, the most + * known polar equation), diamond (alias of square), triangle-forward, triangle, (alias of triangle-upright, + * pentagon, and star. + */ + shape?: string | ((theta: number) => number); + /** degree of "flatness" of the shape wordcloud2.js should draw. */ + ellipticity?: number; + + /** + * callback to call when the cursor enters or leaves a region occupied by a word. The callback will take + * arugments callback(item, dimension, event), where event is the original mousemove event. This only will work + * on HTML5 canvas word clouds. + */ + hover?: EventCallback; + /** + * callback to call when the user clicks on a word. The callback will take arugments + * callback(item, dimension, event), where event is the original click event. This only will work on HTML5 + * canvas word clouds. + */ + click?: EventCallback; + } + + interface Dimension { + x: number; + y: number; + w: number; + h: number; + } + + type ListEntry = [string, number]; + type EventCallback = (item: ListEntry, dimension: Dimension, event: MouseEvent) => void; +} \ No newline at end of file diff --git a/wreck/wreck-tests.ts b/wreck/wreck-tests.ts new file mode 100644 index 000000000..6e7abab0e --- /dev/null +++ b/wreck/wreck-tests.ts @@ -0,0 +1,39 @@ +/// + +import Wreck = require('wreck'); + +Wreck.get('https://google.com/', {}, function (err: any, res: any, payload: any) { + /* do stuff */ +}); + + +var method = 'GET'; // GET, POST, PUT, DELETE +var uri = 'https://google.com/'; +var readableStream = Wreck.toReadableStream('foo=bar'); + +var wreck = Wreck.defaults({ + headers: { 'x-foo-bar': 123 } +}); + +// cascading example -- does not alter `wreck` +var wreckWithTimeout = wreck.defaults({ + timeout: 5 +}); + +// all attributes are optional +var options = { + maxBytes: 1048576, // 1 MB, default: unlimited + rejectUnauthorized: true +}; + +var optionalCallback = function (err: any, res: any) { + + /* handle err if it exists, in which case res will be undefined */ + + // buffer the response stream + Wreck.read(res, null, function (err: any, body: any) { + /* do stuff */ + }); +}; + +var req = wreck.request(method, uri, options, optionalCallback); diff --git a/wreck/wreck.d.ts b/wreck/wreck.d.ts new file mode 100644 index 000000000..8bc7b2d24 --- /dev/null +++ b/wreck/wreck.d.ts @@ -0,0 +1,41 @@ +// Type definitions for wreck 7.0.0 +// Project: https://github.com/hapijs/wreck +// Definitions by: Marcin Porębski +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module "wreck" +{ + import http = require('http'); + import stream = require('stream'); + + + interface WreckObject + { + defaults: (options: any) => WreckObject; + + request: (method: string, uri: string, options: any, callback?: (err: any, response: http.IncomingMessage) => void) => http.ClientRequest; + + read: (response: http.IncomingMessage, options: any, callback: (err: any, payload: any) => void) => void; + + get: (uri: string, options: any, callback: (err: any, response: http.IncomingMessage, payload: any) => void) => http.ClientRequest; + post: (uri: string, options: any, callback: (err: any, response: http.IncomingMessage, payload: any) => void) => http.ClientRequest; + patch: (uri: string, options: any, callback: (err: any, response: http.IncomingMessage, payload: any) => void) => http.ClientRequest; + put: (uri: string, options: any, callback: (err: any, response: http.IncomingMessage, payload: any) => void) => http.ClientRequest; + delete: (uri: string, options: any, callback: (err: any, response: http.IncomingMessage, payload: any) => void) => http.ClientRequest; + + toReadableStream: (payload: any, encoding?: string) => stream.Readable; + + parseCacheControl: (field: string) => any; + + agents: { + http: http.Agent, + https: http.Agent + }; + } + + var wreck: WreckObject; + + export = wreck; +} diff --git a/youtube/youtube.d.ts b/youtube/youtube.d.ts index f3f5c3b52..a90ab4c88 100644 --- a/youtube/youtube.d.ts +++ b/youtube/youtube.d.ts @@ -17,6 +17,7 @@ declare module YT { onReady?: EventHandler; onPlayback?: EventHandler; onStateChange?: EventHandler; + onError?: EventHandler; } export enum ListType { @@ -43,6 +44,7 @@ declare module YT { origin?: string; playerpiid?: string; playlist?: string[]; + playsinline?: number; rel?: number; showinfo?: number; start?: number; diff --git a/z-schema/z-schema-tests.ts b/z-schema/z-schema-tests.ts new file mode 100644 index 000000000..90fdc4cd3 --- /dev/null +++ b/z-schema/z-schema-tests.ts @@ -0,0 +1,34 @@ +/// + +import ZSchema = require('z-schema'); + +var options: ZSchema.Options = { + noTypeless: true, + forceItems: true, +}; + +var validator: ZSchema.Validator = new ZSchema(options); +var json: any = { + foo: 'bar', +}; + +var schema: any = { + 'type': 'object', + properties: { + foo: { + 'type': 'string', + }, + }, +}; + +validator.validate(json, schema); +validator.validate(json, schema, function (err: any, valid: boolean) { + if (err) { + console.log(err); + } else { + console.log('valid = ' + valid); + } +}); + +var error: ZSchema.SchemaError = validator.getLastError(); +var errors: ZSchema.SchemaError[] = validator.getLastErrors(); diff --git a/z-schema/z-schema.d.ts b/z-schema/z-schema.d.ts new file mode 100644 index 000000000..4e8d673c5 --- /dev/null +++ b/z-schema/z-schema.d.ts @@ -0,0 +1,62 @@ +// Type definitions for z-schema v3.16.0 +// Project: https://github.com/zaggino/z-schema +// Definitions by: Adam Meadows +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare module ZSchema { + + export interface Options { + asyncTimeout?: number; + forceAdditional?: boolean; + assumeAdditional?: boolean; + forceItems?: boolean; + forceMinItems?: boolean; + forceMaxItems?: boolean; + forceMinLength?: boolean; + forceMaxLength?: boolean; + forceProperties?: boolean; + ignoreUnresolvableReferences?: boolean; + noExtraKeywords?: boolean; + noTypeless?: boolean; + noEmptyStrings?: boolean; + noEmptyArrays?: boolean; + strictUris?: boolean; + strictMode?: boolean; + reportPathAsArray?: boolean; + breakOnFirstError?: boolean; + pedanticCheck?: boolean; + ignoreUnknownFormats?: boolean; + } + + export interface SchemaError { + code: string; + description: string; + message: string; + params: string[]; + path: string; + } + + export class Validator { + constructor(options: Options); + + /** + * @param json - either a JSON string or a parsed JSON object + * @param schema - the JSON object representing the schema + * @returns true if json matches schema + */ + validate(json: any, schema: any): boolean; + + /** + * @param json - either a JSON string or a parsed JSON object + * @param schema - the JSON object representing the schema + */ + validate(json: any, schema: any, callback: (err: any, valid: boolean) => void): void; + + getLastError(): SchemaError; + getLastErrors(): SchemaError[]; + } +} + +declare module "z-schema" { + export = ZSchema.Validator; +} diff --git a/zone.js/zone.js-tests.ts b/zone.js/zone.js-tests.ts new file mode 100644 index 000000000..e0a4df3b6 --- /dev/null +++ b/zone.js/zone.js-tests.ts @@ -0,0 +1,11 @@ +/// + +declare var zone: Zone; + +zone.fork().fork({ + beforeTask: function () { + console.log('from beforeTask'); + } +}).run(function () { + console.log('from main'); +}); diff --git a/zone.js/zone.js.d.ts b/zone.js/zone.js.d.ts new file mode 100644 index 000000000..a34e1f8f5 --- /dev/null +++ b/zone.js/zone.js.d.ts @@ -0,0 +1,21 @@ +// Type definitions for Zone.js +// Project: https://github.com/angular/zone.js +// Definitions by: angular team +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare class Zone { + constructor(parentZone: Zone, data: any); + + fork(locals?: {[key: string]: any}): Zone; + bind(fn: Function, skipEnqueue?: boolean): void; + bindOnce(fn: Function): any; + run(fn: Function, applyTo?: any, applyWith?: any): void; + isRootZone(): boolean; + + static bindPromiseFn Promise>(fn: T): T; + + static longStackTraceZone: {[key: string]: any}; +} +